summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/CMakeLists.txt63
-rw-r--r--src/components/HMI/IVSU/PROPRIETARY_REQUEST1
-rw-r--r--src/components/HMI/app/AppViews.js113
-rw-r--r--src/components/HMI/app/Flags.js62
-rw-r--r--src/components/HMI/app/SDLApp.js80
-rw-r--r--src/components/HMI/app/StateManager.js284
-rw-r--r--src/components/HMI/app/controller/AppController.js36
-rw-r--r--src/components/HMI/app/controller/InfoController.js80
-rw-r--r--src/components/HMI/app/controller/MediaController.js83
-rw-r--r--src/components/HMI/app/controller/PhoneController.js82
-rw-r--r--src/components/HMI/app/controller/SettingsController.js338
-rw-r--r--src/components/HMI/app/controller/sdl/AppController.js215
-rw-r--r--src/components/HMI/app/controller/sdl/Controller.js942
-rw-r--r--src/components/HMI/app/controller/sdl/MediaController.js142
-rw-r--r--src/components/HMI/app/controller/sdl/NonMediaController.js114
-rw-r--r--src/components/HMI/app/controller/sdl/RPCController.js3069
-rwxr-xr-xsrc/components/HMI/app/controlls/AZERTYLayout.js264
-rw-r--r--src/components/HMI/app/controlls/Button.js169
-rw-r--r--src/components/HMI/app/controlls/Indicator.js134
-rw-r--r--src/components/HMI/app/controlls/Label.js55
-rw-r--r--src/components/HMI/app/controlls/List.js186
-rw-r--r--src/components/HMI/app/controlls/MenuList.js204
-rwxr-xr-xsrc/components/HMI/app/controlls/QWERTYLayout.js264
-rwxr-xr-xsrc/components/HMI/app/controlls/QWERTZLayout.js264
-rw-r--r--src/components/HMI/app/controlls/ScrollBar.js167
-rw-r--r--src/components/HMI/app/controlls/ScrollableText.js209
-rw-r--r--src/components/HMI/app/mixins/PresetEventCustom.js57
-rw-r--r--src/components/HMI/app/mixins/PresetEvents.js44
-rw-r--r--src/components/HMI/app/model/PhoneModel.js88
-rw-r--r--src/components/HMI/app/model/abstract/RangedValue.js137
-rw-r--r--src/components/HMI/app/model/media/CDModel.js43
-rw-r--r--src/components/HMI/app/model/sdl/AppModel.js452
-rw-r--r--src/components/HMI/app/model/sdl/MediaModel.js361
-rw-r--r--src/components/HMI/app/model/sdl/Model.js1564
-rw-r--r--src/components/HMI/app/model/sdl/NonMediaModel.js228
-rw-r--r--src/components/HMI/app/model/sdl/VehicleInfoModel.js501
-rw-r--r--src/components/HMI/app/util/Audio.js43
-rw-r--r--src/components/HMI/app/util/StreamAudio.js49
-rw-r--r--src/components/HMI/app/view/WarningView.js335
-rw-r--r--src/components/HMI/app/view/climateView.js56
-rw-r--r--src/components/HMI/app/view/home/bottomControls.js90
-rw-r--r--src/components/HMI/app/view/home/controlButtons.js579
-rw-r--r--src/components/HMI/app/view/home/statusClimateView.js66
-rw-r--r--src/components/HMI/app/view/home/statusInfoView.js60
-rw-r--r--src/components/HMI/app/view/home/statusMediaView.js99
-rw-r--r--src/components/HMI/app/view/home/statusNavigationView.js59
-rw-r--r--src/components/HMI/app/view/home/statusPhoneView.js68
-rw-r--r--src/components/HMI/app/view/home/topControls.js59
-rw-r--r--src/components/HMI/app/view/homeView.js40
-rw-r--r--src/components/HMI/app/view/info/alertsView.js118
-rw-r--r--src/components/HMI/app/view/info/appsView.js155
-rw-r--r--src/components/HMI/app/view/info/calendarView.js104
-rw-r--r--src/components/HMI/app/view/info/devicelistView.js142
-rw-r--r--src/components/HMI/app/view/info/nonMediaView.js264
-rw-r--r--src/components/HMI/app/view/info/servicesView.js54
-rw-r--r--src/components/HMI/app/view/info/travelLinkView.js164
-rw-r--r--src/components/HMI/app/view/infoView.js190
-rw-r--r--src/components/HMI/app/view/media/common/LeftMenuView.js82
-rw-r--r--src/components/HMI/app/view/media/playerView.js43
-rw-r--r--src/components/HMI/app/view/media/sdl/controllsView.js238
-rw-r--r--src/components/HMI/app/view/media/sdlmediaView.js110
-rw-r--r--src/components/HMI/app/view/mediaView.js49
-rw-r--r--src/components/HMI/app/view/navigationApp/baseNavigationView.js169
-rw-r--r--src/components/HMI/app/view/navigationAppView.js76
-rw-r--r--src/components/HMI/app/view/navigationView.js53
-rw-r--r--src/components/HMI/app/view/phone/dialpadView.js261
-rw-r--r--src/components/HMI/app/view/phoneView.js97
-rw-r--r--src/components/HMI/app/view/sdl/AlertManeuverPopUp.js184
-rw-r--r--src/components/HMI/app/view/sdl/AlertPopUp.js251
-rw-r--r--src/components/HMI/app/view/sdl/AudioPassThruPopUp.js184
-rw-r--r--src/components/HMI/app/view/sdl/ExitAppView.js133
-rw-r--r--src/components/HMI/app/view/sdl/PopUp.js160
-rw-r--r--src/components/HMI/app/view/sdl/SystemRequestView.js113
-rw-r--r--src/components/HMI/app/view/sdl/TTSPopUp.js168
-rw-r--r--src/components/HMI/app/view/sdl/VRHelpListView.js106
-rw-r--r--src/components/HMI/app/view/sdl/VRPopUp.js236
-rw-r--r--src/components/HMI/app/view/sdl/VehicleInfoView.js219
-rw-r--r--src/components/HMI/app/view/sdl/driverDistraction.js84
-rw-r--r--src/components/HMI/app/view/sdl/shared/AbstractView.js95
-rw-r--r--src/components/HMI/app/view/sdl/shared/interactionChoicesView.js395
-rw-r--r--src/components/HMI/app/view/sdl/shared/keyboard.js297
-rw-r--r--src/components/HMI/app/view/sdl/shared/optionsView.js132
-rw-r--r--src/components/HMI/app/view/sdl/shared/scrollableMessage.js148
-rw-r--r--src/components/HMI/app/view/sdl/shared/sliderView.js211
-rw-r--r--src/components/HMI/app/view/sdl/shared/tbtTurnList.js125
-rw-r--r--src/components/HMI/app/view/sdl/shared/turnByTurnView.js236
-rw-r--r--src/components/HMI/app/view/sdl/tbtClientStateView.js113
-rw-r--r--src/components/HMI/app/view/settings/policies/appPermissionsListView.js126
-rw-r--r--src/components/HMI/app/view/settings/policies/appPermissionsView.js136
-rw-r--r--src/components/HMI/app/view/settings/policies/deviceConfigView.js135
-rw-r--r--src/components/HMI/app/view/settings/policies/deviceStateChangeView.js113
-rw-r--r--src/components/HMI/app/view/settings/policies/statisticsInfoView.js88
-rw-r--r--src/components/HMI/app/view/settings/policies/systemErrorView.js88
-rw-r--r--src/components/HMI/app/view/settings/policiesView.js152
-rw-r--r--src/components/HMI/app/view/settingsView.js100
-rw-r--r--src/components/HMI/audio/alert.wavbin37428 -> 0 bytes
-rw-r--r--src/components/HMI/audio/initial.wavbin46834 -> 0 bytes
-rw-r--r--src/components/HMI/audio/listen.wavbin11070 -> 0 bytes
-rw-r--r--src/components/HMI/audio/positive.wavbin20302 -> 0 bytes
-rw-r--r--src/components/HMI/audio/say.wavbin47292 -> 0 bytes
-rw-r--r--src/components/HMI/css/buttonControls.css546
-rw-r--r--src/components/HMI/css/general.css1560
-rw-r--r--src/components/HMI/css/info.css671
-rw-r--r--src/components/HMI/css/mcs.css3703
-rw-r--r--src/components/HMI/css/media.css528
-rw-r--r--src/components/HMI/css/navigation.css102
-rw-r--r--src/components/HMI/css/phone.css300
-rw-r--r--src/components/HMI/css/sdl.css1254
-rw-r--r--src/components/HMI/css/settings.css129
-rw-r--r--src/components/HMI/ffw/BasicCommunicationRPC.js1339
-rw-r--r--src/components/HMI/ffw/ButtonsRPC.js347
-rw-r--r--src/components/HMI/ffw/Framework.js40
-rw-r--r--src/components/HMI/ffw/NavigationRPC.js382
-rw-r--r--src/components/HMI/ffw/RPCClient.js302
-rw-r--r--src/components/HMI/ffw/RPCObserver.js349
-rw-r--r--src/components/HMI/ffw/TTSRPC.js476
-rw-r--r--src/components/HMI/ffw/UIRPC.js1857
-rw-r--r--src/components/HMI/ffw/VRRPC.js520
-rw-r--r--src/components/HMI/ffw/VehicleInfoRPC.js481
-rw-r--r--src/components/HMI/ffw/WebSocket.js77
-rw-r--r--src/components/HMI/images/common/arr-r-disable.pngbin1268 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/arr-r.pngbin1467 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/arrow_ico.pngbin1194 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/bt_bg.pngbin1204 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/bt_bg_pressed.pngbin1211 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/btn-28h-gray-active.pngbin957 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/btn-28h.pngbin1080 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h-active-gray.pngbin952 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h-active.pngbin972 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h-pressed.pngbin3011 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/btn-48h.pngbin1141 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/btn-98h.pngbin1266 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/button.pngbin655 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/button_active_blue.pngbin170 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/button_large.pngbin1192 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/button_small.pngbin487 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/center-button-150.pngbin1390 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/center-button.pngbin1300 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/climate-status-bg.pngbin2315 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/defaultButtonImage.pngbin3874 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/delim.pngbin1120 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/divider.pngbin1157 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/header_bg.pngbin6743 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/ico_back.pngbin1123 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/ind_vert_active.pngbin2346 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/ind_vert_def.pngbin1066 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/ls_border.pngbin3403 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/media-status-bg.pngbin2048 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/minus-ico.pngbin934 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/nav-status-bg.pngbin2971 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/okbut.pngbin3102 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/okbut_pressed.pngbin3155 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/page-back-button.pngbin1112 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/phone-statusbar-bg.pngbin2910 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/plus-ico.pngbin958 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/scroll_down.pngbin1072 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/scroll_down_active.pngbin1070 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/scroll_down_inactive.pngbin1033 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/scroll_up.pngbin1186 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/scroll_up_inactive.pngbin1108 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/seat-act-led.pngbin1383 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/seat-inact-led.pngbin967 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/skipbuttonbg.pngbin1562 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/skippbuttonbg_pressed.pngbin1544 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/system_settings_btn_bg.pngbin962 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/system_settings_btn_bg_active.pngbin970 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/system_settings_btn_h54.pngbin966 -> 0 bytes
-rw-r--r--src/components/HMI/images/common/toggle.pngbin3596 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/bottom_controlls_full.pngbin28638 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/DownButton.pngbin6391 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/DownButton_pressed.pngbin6278 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/LeftButton.pngbin6547 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/LeftButton_pressed.pngbin6630 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/OkButton.pngbin4939 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/OkButton_pressed.pngbin4809 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/RightButton.pngbin6550 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/RightButton_pressed.pngbin6549 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/UpButton.pngbin6397 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/UpButton_pressed.pngbin6536 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/backGroundControllButtons.pngbin3157 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/vr.pngbin5429 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/vrImage.pngbin2461 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/controlButtons/vr_pressed.pngbin6165 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/home_main_image.pngbin39085 -> 0 bytes
-rw-r--r--src/components/HMI/images/home/home_phone.pngbin2774 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/callendar-btn.pngbin1366 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/ico_assist.pngbin1553 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/ico_info_install.pngbin2022 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/ico_vehicle.pngbin1614 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_apps_ico.pngbin1632 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_calendar_ico.pngbin1868 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_services_ico.pngbin2493 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/info_leftMenu_travelLink_ico.pngbin3646 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/info_services_bg.pngbin11109 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/info_travelLink_sirius_logo.pngbin3627 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/menu_active.pngbin973 -> 0 bytes
-rw-r--r--src/components/HMI/images/info/view_info_calendar.pngbin5924 -> 0 bytes
-rw-r--r--src/components/HMI/images/list/list_item_bg.pngbin1099 -> 0 bytes
-rw-r--r--src/components/HMI/images/list/list_item_pressed.pngbin1091 -> 0 bytes
-rw-r--r--src/components/HMI/images/list/scrollbar/button-down-active.pngbin1407 -> 0 bytes
-rw-r--r--src/components/HMI/images/list/scrollbar/button-up-active.pngbin1406 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgL.pngbin1472 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgR.pngbin1423 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgR_pressed.pngbin1407 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgS.pngbin1542 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/bcs-item_bgS_pressed.pngbin1541 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/bg.pngbin4614 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/btn_bg.pngbin1286 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/cd-next-btn.pngbin1744 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/cd-next-btn_pressed.pngbin1752 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/cd-prev-btn.pngbin1845 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/cd-prev-btn_pressed.pngbin1872 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/cd_play_btn.pngbin1999 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/divider_o.pngbin1136 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico-play.pngbin1162 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico_arrow_down.pngbin1723 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico_arrow_up.pngbin1726 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico_back.pngbin1123 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico_cd.pngbin2479 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico_next.pngbin1423 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico_pause.pngbin1134 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ico_prew.pngbin1435 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ls-item_bg.pngbin1481 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/ls-item_bg_act.pngbin1219 -> 0 bytes
-rw-r--r--src/components/HMI/images/media/player_view.pngbin62443 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/bg.pngbin13851 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/del.pngbin207 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/dial.pngbin510 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/end.pngbin499 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/ico_phone.pngbin1204 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/center_btn.pngbin706 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/center_btn_pressed.pngbin699 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/left_btn.pngbin636 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/left_btn_pressed.pngbin624 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/right_btn.pngbin571 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/keypad/right_btn_pressed.pngbin563 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/menu_active.pngbin172 -> 0 bytes
-rw-r--r--src/components/HMI/images/phone/menu_bg.pngbin555 -> 0 bytes
-rw-r--r--src/components/HMI/images/sdl/Warning.pngbin7546 -> 0 bytes
-rw-r--r--src/components/HMI/images/sdl/audio_icon.jpgbin5560 -> 0 bytes
-rw-r--r--src/components/HMI/images/sdl/devices.pngbin632 -> 0 bytes
-rw-r--r--src/components/HMI/images/sdl/new_apps.pngbin1424 -> 0 bytes
-rw-r--r--src/components/HMI/images/sdl/progress.gifbin2327 -> 0 bytes
-rw-r--r--src/components/HMI/images/sdl/progressindicator.gifbin7703 -> 0 bytes
-rw-r--r--src/components/HMI/images/settings/ico_settings.pngbin2561 -> 0 bytes
-rw-r--r--src/components/HMI/index.html189
-rw-r--r--src/components/HMI/lib/ember-1.0.pre.js20709
-rw-r--r--src/components/HMI/lib/ember-1.0.pre.min.js18
-rw-r--r--src/components/HMI/lib/handlebars-1.0.0.beta.6.js1550
-rw-r--r--src/components/HMI/lib/iscroll-lite.js594
-rw-r--r--src/components/HMI/lib/jquery-1.7.2.js9404
-rw-r--r--src/components/HMI/lib/jquery-1.7.2.min.js4
-rw-r--r--src/components/HMI/locale/eng.js62
-rw-r--r--src/components/HMI/locale/locale.js42
-rw-r--r--src/components/application_manager/CMakeLists.txt164
-rw-r--r--src/components/application_manager/include/application_manager/app_extension.h58
-rw-r--r--src/components/application_manager/include/application_manager/application.h168
-rw-r--r--src/components/application_manager/include/application_manager/application_data_impl.h2
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h157
-rw-r--r--src/components/application_manager/include/application_manager/application_manager.h597
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h490
-rw-r--r--src/components/application_manager/include/application_manager/command_holder.h85
-rw-r--r--src/components/application_manager/include/application_manager/command_holder_impl.h110
-rw-r--r--src/components/application_manager/include/application_manager/commands/command.h1
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_impl.h32
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h7
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_notification_impl.h7
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h139
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_response_impl.h7
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h2
-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/basic_communication_on_awake_sdl.h44
-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/close_popup_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h68
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/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.h16
-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/navi_is_ready_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h85
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h9
-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_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_unregistered_notification.h14
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h8
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h6
-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_received_policy_update.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.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h6
-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_video_data_streaming_notification.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h90
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h33
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h8
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h7
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h2
-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.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h6
-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.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h6
-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/ui_perform_interaction_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h74
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h6
-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_icon_request.h3
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h6
-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/vi_get_vehicle_data_request_template.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h6
-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/mobile/add_command_request.h20
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h17
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_request.h13
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/alert_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h10
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h19
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h18
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h15
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h17
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/generic_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h61
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h60
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h10
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h57
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h7
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h32
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h29
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h84
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h11
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/show_request.h11
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h15
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h28
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h11
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_request.h12
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/system_response.h6
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h9
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h16
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h12
-rw-r--r--src/components/application_manager/include/application_manager/core_service.h214
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event.h8
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher.h6
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h6
-rw-r--r--src/components/application_manager/include/application_manager/event_engine/event_observer.h6
-rw-r--r--src/components/application_manager/include/application_manager/helpers/application_helper.h97
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h104
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces.h3
-rw-r--r--src/components/application_manager/include/application_manager/hmi_language_handler.h5
-rw-r--r--src/components/application_manager/include/application_manager/hmi_state.h108
-rw-r--r--src/components/application_manager/include/application_manager/message.h46
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h179
-rw-r--r--src/components/application_manager/include/application_manager/mobile_message_handler.h6
-rw-r--r--src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h87
-rw-r--r--src/components/application_manager/include/application_manager/policies/delegates/statistics_delegate.h91
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h85
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h86
-rw-r--r--src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h62
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_event_observer.h68
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h341
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler_observer.h53
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h59
-rw-r--r--src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h52
-rw-r--r--src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h57
-rw-r--r--src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h66
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h82
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h86
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h62
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h57
-rw-r--r--src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h54
-rw-r--r--src/components/application_manager/include/application_manager/request_controller.h19
-rw-r--r--src/components/application_manager/include/application_manager/request_info.h93
-rw-r--r--src/components/application_manager/include/application_manager/request_tracker.h125
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl.h14
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h25
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data.h26
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_db.h31
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_data_json.h14
-rw-r--r--src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h8
-rw-r--r--src/components/application_manager/include/application_manager/service.h183
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h60
-rw-r--r--src/components/application_manager/include/application_manager/state_controller_impl.h7
-rw-r--r--src/components/application_manager/include/application_manager/telemetry_observer.h7
-rw-r--r--src/components/application_manager/include/application_manager/usage_statistics.h2
-rw-r--r--src/components/application_manager/include/application_manager/vehicle_info_data.h71
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_data_json.cc9
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_sql_queries.cc2
-rw-r--r--src/components/application_manager/src/app_launch/apps_launcher.cc3
-rw-r--r--src/components/application_manager/src/application_impl.cc194
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc1462
-rw-r--r--src/components/application_manager/src/command_holder_impl.cc142
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc67
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc485
-rw-r--r--src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc44
-rw-r--r--src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc59
-rw-r--r--src/components/application_manager/src/commands/hmi/get_urls.cc204
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc18
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc147
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc20
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_from_hmi.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/notification_to_hmi.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc103
-rw-r--r--src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc6
-rw-r--r--src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc70
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc25
-rw-r--r--src/components/application_manager/src/commands/hmi/on_received_policy_update.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/on_system_request_notification.cc16
-rw-r--r--src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc60
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc99
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/request_from_hmi.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/request_to_hmi.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/response_from_hmi.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/response_to_hmi.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc75
-rw-r--r--src/components/application_manager/src/commands/hmi/sdl_policy_update.cc2
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc26
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc52
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc56
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc5
-rw-r--r--src/components/application_manager/src/commands/mobile/add_command_request.cc13
-rw-r--r--src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc10
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc44
-rw-r--r--src/components/application_manager/src/commands/mobile/alert_request.cc33
-rw-r--r--src/components/application_manager/src/commands/mobile/change_registration_request.cc152
-rw-r--r--src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc37
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_command_request.cc18
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_file_request.cc11
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc8
-rw-r--r--src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc10
-rw-r--r--src/components/application_manager/src/commands/mobile/diagnostic_message_request.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.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/get_dtcs_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/get_system_capability_request.cc95
-rw-r--r--src/components/application_manager/src/commands/mobile/get_system_capability_response.cc22
-rw-r--r--src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/get_way_points_request.cc12
-rw-r--r--src/components/application_manager/src/commands/mobile/list_files_request.cc23
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_event_notification.cc14
-rw-r--r--[-rwxr-xr-x]src/components/application_manager/src/commands/mobile/on_button_press_notification.cc15
-rw-r--r--src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc15
-rw-r--r--src/components/application_manager/src/commands/mobile/on_keyboard_input_notification.cc4
-rw-r--r--src/components/application_manager/src/commands/mobile/on_system_request_notification.cc30
-rw-r--r--src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc25
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc115
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_interaction_request.cc26
-rw-r--r--src/components/application_manager/src/commands/mobile/put_file_request.cc11
-rw-r--r--src/components/application_manager/src/commands/mobile/read_did_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc185
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_response.cc9
-rw-r--r--src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc107
-rw-r--r--src/components/application_manager/src/commands/mobile/scrollable_message_request.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc99
-rw-r--r--src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc53
-rw-r--r--src/components/application_manager/src/commands/mobile/send_location_request.cc10
-rw-r--r--src/components/application_manager/src/commands/mobile/set_app_icon_request.cc17
-rw-r--r--src/components/application_manager/src/commands/mobile/set_display_layout_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/set_global_properties_request.cc23
-rw-r--r--src/components/application_manager/src/commands/mobile/set_icon_request.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc2
-rw-r--r--src/components/application_manager/src/commands/mobile/show_request.cc64
-rw-r--r--src/components/application_manager/src/commands/mobile/slider_request.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/speak_request.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_button_request.cc35
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc65
-rw-r--r--src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc17
-rw-r--r--src/components/application_manager/src/commands/mobile/system_request.cc44
-rw-r--r--src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc1
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc20
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc57
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc14
-rw-r--r--src/components/application_manager/src/commands/mobile/update_turn_list_request.cc3
-rw-r--r--src/components/application_manager/src/core_service.cc231
-rw-r--r--src/components/application_manager/src/event_engine/event_dispatcher_impl.cc9
-rw-r--r--src/components/application_manager/src/helpers/application_helper.cc146
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc234
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc77
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc18
-rw-r--r--src/components/application_manager/src/hmi_language_handler.cc15
-rw-r--r--src/components/application_manager/src/hmi_state.cc112
-rw-r--r--src/components/application_manager/src/message.cc75
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc832
-rw-r--r--src/components/application_manager/src/mobile_command_factory.cc31
-rw-r--r--src/components/application_manager/src/mobile_message_handler.cc127
-rw-r--r--src/components/application_manager/src/policies/delegates/app_permission_delegate.cc18
-rw-r--r--src/components/application_manager/src/policies/delegates/statistics_delegate.cc12
-rw-r--r--src/components/application_manager/src/policies/policy_event_observer.cc1
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc1086
-rw-r--r--src/components/application_manager/src/policies/policy_retry_sequence.cc3
-rw-r--r--src/components/application_manager/src/policies/pt_exchange_handler_ext.cc88
-rw-r--r--src/components/application_manager/src/policies/pt_exchange_handler_impl.cc79
-rw-r--r--src/components/application_manager/src/request_controller.cc51
-rw-r--r--src/components/application_manager/src/request_info.cc60
-rw-r--r--src/components/application_manager/src/request_tracker.cc133
-rw-r--r--src/components/application_manager/src/resumption/resume_ctrl_impl.cc68
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc1
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_db.cc37
-rw-r--r--src/components/application_manager/src/resumption/resumption_data_json.cc28
-rw-r--r--src/components/application_manager/src/resumption/resumption_sql_queries.cc24
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc52
-rw-r--r--src/components/application_manager/src/state_controller_impl.cc61
-rw-r--r--src/components/application_manager/src/usage_statistics.cc14
-rw-r--r--src/components/application_manager/test/CMakeLists.txt217
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc73
-rw-r--r--src/components/application_manager/test/app_launch/app_launch_data_json_test.cc6
-rw-r--r--src/components/application_manager/test/application_helper_test.cc258
-rw-r--r--src/components/application_manager/test/application_impl_test.cc144
-rw-r--r--src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc254
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc829
-rw-r--r--src/components/application_manager/test/application_state_test.cc105
-rw-r--r--src/components/application_manager/test/command_holder_test.cc173
-rw-r--r--src/components/application_manager/test/commands/CMakeLists.txt37
-rw-r--r--src/components/application_manager/test/commands/command_impl_test.cc39
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc217
-rw-r--r--src/components/application_manager/test/commands/command_response_impl_test.cc2
-rw-r--r--src/components/application_manager/test/commands/hmi/CMakeLists.txt59
-rw-r--r--src/components/application_manager/test/commands/hmi/activate_app_request_test.cc125
-rw-r--r--src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc90
-rw-r--r--src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc77
-rw-r--r--src/components/application_manager/test/commands/hmi/allow_app_response_test.cc95
-rw-r--r--src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc116
-rw-r--r--src/components/application_manager/test/commands/hmi/close_popup_response_test.cc73
-rw-r--r--src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc617
-rw-r--r--src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc100
-rw-r--r--src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc153
-rw-r--r--src/components/application_manager/test/commands/hmi/get_urls_response_test.cc91
-rw-r--r--src/components/application_manager/test/commands/hmi/get_urls_test.cc331
-rw-r--r--src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc1980
-rw-r--r--src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc92
-rw-r--r--src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc106
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc5
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc5
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc76
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc216
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc5
-rw-r--r--src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc3
-rw-r--r--src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc161
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc181
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc174
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc137
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc503
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc88
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc116
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc82
-rw-r--r--src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc169
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_notifications_test.cc77
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc99
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc285
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc373
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc107
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc136
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc109
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc134
-rw-r--r--src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc99
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc346
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc113
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc128
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc13
-rw-r--r--src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc92
-rw-r--r--src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc175
-rw-r--r--src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc91
-rw-r--r--src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc87
-rw-r--r--src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc156
-rw-r--r--src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc8
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc112
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc113
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc128
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc12
-rw-r--r--src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/mobile/CMakeLists.txt75
-rw-r--r--src/components/application_manager/test/commands/mobile/add_command_request_test.cc1121
-rw-r--r--src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc25
-rw-r--r--src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc58
-rw-r--r--src/components/application_manager/test/commands/mobile/alert_request_test.cc600
-rw-r--r--src/components/application_manager/test/commands/mobile/change_registration_test.cc170
-rw-r--r--src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc641
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_command_request_test.cc21
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_file_test.cc246
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc284
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc219
-rw-r--r--src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc3
-rw-r--r--src/components/application_manager/test/commands/mobile/dial_number_request_test.cc20
-rw-r--r--src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc342
-rw-r--r--src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc25
-rw-r--r--src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc16
-rw-r--r--src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc34
-rw-r--r--src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc284
-rw-r--r--src/components/application_manager/test/commands/mobile/list_files_request_test.cc19
-rw-r--r--src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc15
-rw-r--r--src/components/application_manager/test/commands/mobile/on_command_notification_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc21
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc28
-rw-r--r--src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc19
-rw-r--r--src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc21
-rw-r--r--src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc33
-rw-r--r--src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc22
-rw-r--r--src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc16
-rw-r--r--src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc642
-rw-r--r--src/components/application_manager/test/commands/mobile/perform_interaction_test.cc36
-rw-r--r--src/components/application_manager/test/commands/mobile/put_file_test.cc351
-rw-r--r--src/components/application_manager/test/commands/mobile/read_did_request_test.cc25
-rw-r--r--src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc216
-rw-r--r--src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc565
-rw-r--r--src/components/application_manager/test/commands/mobile/scrollable_message_test.cc152
-rw-r--r--src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc163
-rw-r--r--src/components/application_manager/test/commands/mobile/send_location_request_test.cc396
-rw-r--r--src/components/application_manager/test/commands/mobile/set_app_icon_test.cc21
-rw-r--r--src/components/application_manager/test/commands/mobile/set_display_layout_test.cc122
-rw-r--r--src/components/application_manager/test/commands/mobile/set_global_properties_test.cc1013
-rw-r--r--src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc243
-rw-r--r--src/components/application_manager/test/commands/mobile/show_test.cc813
-rw-r--r--src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc18
-rw-r--r--src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc130
-rw-r--r--src/components/application_manager/test/commands/mobile/slider_test.cc215
-rw-r--r--src/components/application_manager/test/commands/mobile/speak_request_test.cc265
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc21
-rw-r--r--src/components/application_manager/test/commands/mobile/system_request_test.cc135
-rw-r--r--src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc6
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc67
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc42
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc172
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc~ff89c63... Cover UnsubscribeWayPoints and UpdateTurnList by Unit Tests.169
-rw-r--r--src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc39
-rw-r--r--src/components/application_manager/test/event_engine_test.cc5
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json1062
-rw-r--r--src/components/application_manager/test/hmi_capabilities_sc1.json9
-rw-r--r--src/components/application_manager/test/hmi_capabilities_sc2.json14
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc222
-rw-r--r--src/components/application_manager/test/hmi_language_handler_test.cc353
-rw-r--r--src/components/application_manager/test/include/application_manager/application_manager_mock.h112
-rw-r--r--src/components/application_manager/test/include/application_manager/application_mock.h280
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/command_request_test.h12
-rw-r--r--src/components/application_manager/test/include/application_manager/commands/commands_test.h104
-rw-r--r--src/components/application_manager/test/include/application_manager/event_observer_mock.h58
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h56
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application_helper.h57
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application_manager.h255
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_event_observer.h58
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h27
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h60
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h67
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_request.h70
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h4
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_statistics_manager.h65
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h6
-rw-r--r--src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h203
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_mock.h94
-rw-r--r--src/components/application_manager/test/include/application_manager/resumption_data_test.h2
-rw-r--r--src/components/application_manager/test/include/application_manager/statistics_manager_mock.h59
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt16
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt.user189
-rw-r--r--src/components/application_manager/test/message_helper/message_helper_test.cc214
-rw-r--r--src/components/application_manager/test/mobile_message_handler_test.cc45
-rw-r--r--src/components/application_manager/test/mobile_message_handler_v1_test.cc18
-rw-r--r--src/components/application_manager/test/mock_application_helper.cc55
-rw-r--r--src/components/application_manager/test/mock_hmi_command_factory.cc57
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc105
-rw-r--r--src/components/application_manager/test/policy_event_observer_test.cc5
-rw-r--r--src/components/application_manager/test/policy_handler_test.cc1336
-rw-r--r--src/components/application_manager/test/rc_policy_handler_test.cc400
-rw-r--r--src/components/application_manager/test/request_controller/request_controller_test.cc231
-rw-r--r--src/components/application_manager/test/request_info_test.cc140
-rw-r--r--src/components/application_manager/test/request_tracker_test.cc251
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc510
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc38
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc42
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc8
-rw-r--r--src/components/application_manager/test/resumption_sql_queries_test.cc26
-rw-r--r--src/components/application_manager/test/state_controller/CMakeLists.txt3
-rw-r--r--src/components/application_manager/test/state_controller/state_controller_test.cc600
-rw-r--r--src/components/application_manager/test/usage_statistics_test.cc4
-rw-r--r--src/components/application_manager/test/zero_request_amount_test.cc4
-rw-r--r--src/components/config_profile/CMakeLists.txt19
-rw-r--r--src/components/config_profile/include/config_profile/profile.h93
-rw-r--r--src/components/config_profile/src/ini_file.cc13
-rw-r--r--src/components/config_profile/src/profile.cc173
-rw-r--r--src/components/config_profile/test/CMakeLists.txt16
-rw-r--r--src/components/config_profile/test/ini_file_test.cc4
-rw-r--r--src/components/config_profile/test/profile_test.cc72
-rw-r--r--src/components/connection_handler/CMakeLists.txt32
-rw-r--r--src/components/connection_handler/include/connection_handler/connection.h15
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler.h209
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_impl.h107
-rw-r--r--src/components/connection_handler/include/connection_handler/connection_handler_observer.h120
-rw-r--r--src/components/connection_handler/include/connection_handler/device.h5
-rw-r--r--src/components/connection_handler/include/connection_handler/heartbeat_monitor.h6
-rw-r--r--src/components/connection_handler/src/connection.cc39
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc264
-rw-r--r--src/components/connection_handler/test/CMakeLists.txt20
-rw-r--r--src/components/connection_handler/test/connection_handler_impl_test.cc954
-rw-r--r--src/components/connection_handler/test/connection_test.cc39
-rw-r--r--src/components/connection_handler/test/device_test.cc4
-rw-r--r--src/components/connection_handler/test/heart_beat_monitor_test.cc97
-rw-r--r--src/components/connection_handler/test/include/connection_handler/connection_handler_observer_mock.h72
-rw-r--r--src/components/dbus/CMakeLists.txt30
-rw-r--r--src/components/dbus/codegen/introspection_xml.cc327
-rw-r--r--src/components/dbus/include/dbus/dbus_adapter.h3
-rw-r--r--src/components/dbus/include/dbus/dbus_message.h6
-rw-r--r--src/components/dbus/include/dbus/dbus_message_controller.h40
-rw-r--r--src/components/dbus/include/dbus/dbus_message_inl.h6
-rw-r--r--src/components/dbus/include/dbus/schema.h6
-rw-r--r--src/components/dbus/src/dbus_adapter.cc14
-rw-r--r--src/components/dbus/src/dbus_message_controller.cc19
-rw-r--r--src/components/dbus/src/introspection_xml.cc327
-rw-r--r--src/components/dbus/src/message_descriptions.cc10424
-rw-r--r--src/components/dbus/test/CMakeLists.txt20
-rw-r--r--src/components/dbus/test/dbus_adapter_test.cc (renamed from src/components/dbus/test/test_dbus_adapter.cc)0
-rw-r--r--src/components/dbus/test/dbus_message_controller_test.cc116
-rw-r--r--src/components/dbus/test/include/dbus/mock_dbus_message_controller.h75
-rw-r--r--src/components/dbus/test/include/dbus/mock_subscriber.h62
-rw-r--r--src/components/dbus/test/mock_subscriber.cc71
-rw-r--r--src/components/dbus/test/schema_test.cc (renamed from src/components/dbus/test/test_schema.cc)0
-rw-r--r--src/components/dbus/test/test_dbus_message_controller.cc116
-rw-r--r--src/components/formatters/CMakeLists.txt26
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonBase.h6
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h6
-rw-r--r--src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h6
-rw-r--r--src/components/formatters/include/formatters/CSmartFactory.h6
-rw-r--r--src/components/formatters/include/formatters/formatter_json_rpc.h6
-rw-r--r--src/components/formatters/include/formatters/generic_json_formatter.h6
-rw-r--r--src/components/formatters/include/formatters/meta_formatter.h6
-rw-r--r--src/components/formatters/test/CMakeLists.txt26
-rw-r--r--src/components/formatters/test/CSmartFactory_test.cc84
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc21
-rw-r--r--src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc25
-rw-r--r--src/components/formatters/test/formatter_json_rpc_test.cc8
-rw-r--r--src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h8
-rw-r--r--src/components/formatters/test/include/formatters/create_smartSchema.h6
-rw-r--r--src/components/formatters/test/include/formatters/meta_formatter_test_helper.h6
-rw-r--r--src/components/formatters/test/meta_formatter_test.cc45
-rw-r--r--src/components/formatters/test/src/create_smartSchema.cc4
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc28
-rw-r--r--src/components/functional_module/CMakeLists.txt58
-rw-r--r--src/components/functional_module/include/functional_module/function_ids.h63
-rw-r--r--src/components/functional_module/include/functional_module/generic_module.h180
-rw-r--r--src/components/functional_module/include/functional_module/module_observer.h54
-rw-r--r--src/components/functional_module/include/functional_module/plugin_manager.h159
-rw-r--r--src/components/functional_module/include/functional_module/timer/module_timer.h246
-rw-r--r--src/components/functional_module/include/functional_module/timer/timer_director.h92
-rw-r--r--src/components/functional_module/src/generic_module.cc54
-rw-r--r--src/components/functional_module/src/plugin_manager.cc396
-rw-r--r--src/components/functional_module/src/timer/timer_director.cc156
-rw-r--r--src/components/functional_module/test/CMakeLists.txt53
-rw-r--r--src/components/functional_module/test/include/driver_generic_module_test.h80
-rw-r--r--src/components/functional_module/test/include/mock_application.h250
-rw-r--r--src/components/functional_module/test/include/mock_module_observer.h50
-rw-r--r--src/components/functional_module/test/include/mock_service.h76
-rw-r--r--src/components/functional_module/test/include/module_timer_test.h56
-rw-r--r--src/components/functional_module/test/plugins/CMakeLists.txt17
-rw-r--r--src/components/functional_module/test/plugins/mock_generic_module.cc23
-rw-r--r--src/components/functional_module/test/plugins/mock_generic_module.h71
-rw-r--r--src/components/functional_module/test/src/generic_module_test.cc106
-rw-r--r--src/components/functional_module/test/src/module_timer_test.cc123
-rw-r--r--src/components/functional_module/test/src/plugin_manager_test.cc148
-rw-r--r--src/components/hmi_message_handler/CMakeLists.txt46
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h60
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h63
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h27
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h53
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h47
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h156
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h9
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h66
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h178
-rw-r--r--src/components/hmi_message_handler/mock_hmi_message_handler.h61
-rw-r--r--src/components/hmi_message_handler/src/dbus_message_adapter.cc7
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_handler_impl.cc5
-rw-r--r--src/components/hmi_message_handler/src/mb_controller.cc475
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc13
-rw-r--r--src/components/hmi_message_handler/src/mqueue_adapter.cc143
-rw-r--r--src/components/hmi_message_handler/src/websocket_session.cc292
-rw-r--r--src/components/hmi_message_handler/test/CMakeLists.txt30
-rw-r--r--src/components/hmi_message_handler/test/dbus_message_adapter_test.cc68
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_adapter_test.cc4
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc82
-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_hmi_message_observer.h57
-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/mock_subscriber.cc74
-rw-r--r--src/components/hmi_message_handler/test/mqueue_adapter_test.cc94
-rw-r--r--src/components/include/application_manager/application_manager.h720
-rw-r--r--src/components/include/application_manager/application_manager_settings.h4
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h98
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h195
-rw-r--r--src/components/include/application_manager/policies/policy_handler_observer.h57
-rw-r--r--src/components/include/application_manager/request_controller_settings.h6
-rw-r--r--src/components/include/connection_handler/connection_handler.h243
-rw-r--r--src/components/include/connection_handler/connection_handler_observer.h168
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_adapter.h66
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_handler.h63
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_handler_settings.h2
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_observer.h54
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_sender.h48
-rw-r--r--src/components/include/media_manager/media_manager.h68
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h180
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h655
-rw-r--r--src/components/include/policy/policy_external/policy/policy_settings.h42
-rw-r--r--src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h50
-rw-r--r--src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h111
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_listener.h155
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h610
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_settings.h42
-rw-r--r--src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h50
-rw-r--r--src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h111
-rw-r--r--src/components/include/policy/policy_settings.h42
-rw-r--r--src/components/include/policy/policy_types.h318
-rw-r--r--src/components/include/policy/usage_statistics/statistics_manager.h79
-rw-r--r--src/components/include/protocol/bson_object_keys.h48
-rw-r--r--src/components/include/protocol/common.h11
-rw-r--r--src/components/include/protocol_handler/protocol_handler.h35
-rw-r--r--src/components/include/protocol_handler/protocol_handler_settings.h13
-rw-r--r--src/components/include/protocol_handler/session_observer.h133
-rw-r--r--src/components/include/protocol_handler/telemetry_observer.h57
-rw-r--r--src/components/include/rpc_base/validation_report.h125
-rw-r--r--src/components/include/security_manager/security_manager.h18
-rw-r--r--src/components/include/security_manager/security_manager_listener.h11
-rw-r--r--src/components/include/security_manager/security_manager_settings.h6
-rw-r--r--src/components/include/security_manager/security_query.h6
-rw-r--r--src/components/include/telemetry_monitor/telemetry_observable.h6
-rw-r--r--src/components/include/test/application_manager/mock_app_launch_settings.h1
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h321
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h4
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h99
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_observer.h1
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler.h11
-rw-r--r--src/components/include/test/connection_handler/mock_connection_handler_observer.h81
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_adapter.h54
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_handler.h54
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h8
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h58
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_sender.h52
-rw-r--r--src/components/include/test/media_manager/mock_media_manager.h66
-rw-r--r--src/components/include/test/media_manager/mock_media_manager_settings.h6
-rw-r--r--src/components/include/test/policy/mock_policy_manager.h185
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h259
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_listener.h111
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h226
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_settings.h58
-rw-r--r--src/components/include/test/policy/policy_external/policy/usage_statistics/mock_app_stopwatch.h54
-rw-r--r--src/components/include/test/policy/policy_external/policy/usage_statistics/mock_statistics_manager.h (renamed from src/components/include/test/policy/mock_statistics_manager.h)0
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h223
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h104
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h235
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h (renamed from src/components/include/test/policy/mock_policy_settings.h)0
-rw-r--r--src/components/include/test/policy/policy_regular/policy/usage_statistics/mock_app_stopwatch.h (renamed from src/components/policy/test/include/mock_app_stopwatch.h)0
-rw-r--r--src/components/include/test/policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h (renamed from src/components/include/test/policy/usage_statistics/mock_statistics_manager.h)0
-rw-r--r--src/components/include/test/policy/usage_statistics/mock_app_stopwatch.h1
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler.h10
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_handler_settings.h4
-rw-r--r--src/components/include/test/protocol_handler/mock_protocol_observer.h57
-rw-r--r--src/components/include/test/protocol_handler/mock_session_observer.h41
-rw-r--r--src/components/include/test/protocol_handler/mock_telemetry_observer.h54
-rw-r--r--src/components/include/test/resumption/mock_last_state.h53
-rw-r--r--src/components/include/test/security_manager/mock_security_manager.h3
-rw-r--r--src/components/include/test/security_manager/mock_security_manager_listener.h1
-rw-r--r--src/components/include/test/telemetry_monitor/mock_telemetry_observable.h6
-rw-r--r--src/components/include/test/telemetry_monitor/mock_telemetry_observer.h54
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_listener.h94
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h6
-rw-r--r--src/components/include/test/transport_manager/mock_transport_manager_settings.h8
-rw-r--r--src/components/include/test/transport_manager/transport_adapter/mock_device.h71
-rw-r--r--src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h116
-rw-r--r--src/components/include/test/utils/test_async_waiter.h106
-rw-r--r--src/components/include/transport_manager/common.h10
-rw-r--r--src/components/include/transport_manager/transport_adapter/device.h29
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter.h42
-rw-r--r--src/components/include/transport_manager/transport_adapter/transport_adapter_event.h50
-rw-r--r--src/components/include/transport_manager/transport_manager_listener.h17
-rw-r--r--src/components/include/transport_manager/transport_manager_listener_empty.h17
-rw-r--r--src/components/include/transport_manager/transport_manager_settings.h12
-rw-r--r--src/components/include/utils/callable.h26
-rw-r--r--src/components/include/utils/macro.h27
-rw-r--r--src/components/include/utils/memory_barrier.h6
-rw-r--r--src/components/include/utils/scope_guard.h6
-rw-r--r--src/components/include/utils/threads/CMakeLists.txt5
-rw-r--r--src/components/include/utils/threads/async_runner.h6
-rw-r--r--src/components/include/utils/threads/thread.h1
-rw-r--r--src/components/interfaces/CMakeLists.txt71
-rw-r--r--src/components/interfaces/HMI_API.xml896
-rw-r--r--src/components/interfaces/MOBILE_API.xml11413
-rw-r--r--src/components/interfaces/QT_HMI_API.xml1572
-rw-r--r--src/components/interfaces/v4_protocol_v1_2_no_extra.xml186
-rw-r--r--src/components/media_manager/CMakeLists.txt127
-rw-r--r--src/components/media_manager/include/media_manager/audio/audio_stream_sender_thread.h7
-rw-r--r--src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h1
-rw-r--r--src/components/media_manager/include/media_manager/file_streamer_adapter.h2
-rw-r--r--src/components/media_manager/include/media_manager/media_manager.h68
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h7
-rw-r--r--src/components/media_manager/include/media_manager/pipe_streamer_adapter.h2
-rw-r--r--src/components/media_manager/include/media_manager/socket_streamer_adapter.h2
-rw-r--r--src/components/media_manager/include/media_manager/streamer_adapter.h2
-rw-r--r--src/components/media_manager/src/audio/audio_stream_sender_thread.cc9
-rw-r--r--src/components/media_manager/src/audio/from_mic_recorder_listener.cc5
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc47
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc8
-rw-r--r--src/components/media_manager/src/socket_streamer_adapter.cc8
-rw-r--r--src/components/media_manager/src/streamer_adapter.cc5
-rw-r--r--src/components/media_manager/test/CMakeLists.txt10
-rw-r--r--src/components/media_manager/test/include/media_manager/media_adapter_impl_mock.h71
-rw-r--r--src/components/media_manager/test/include/media_manager/media_adapter_listener_mock.h60
-rw-r--r--src/components/media_manager/test/include/media_manager/media_adapter_mock.h61
-rw-r--r--src/components/media_manager/test/include/media_manager/mock_media_adapter.h61
-rw-r--r--src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h63
-rw-r--r--src/components/media_manager/test/include/media_manager/mock_media_adapter_listener.h60
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc429
-rw-r--r--src/components/policy/CMakeLists.txt110
-rw-r--r--src/components/policy/doc/grc/conf.smartDeviceLinkCore34
-rw-r--r--src/components/policy/doc/install.txt91
-rw-r--r--src/components/policy/doc/readme.txt66
-rw-r--r--src/components/policy/include/policy/cache_manager.h768
-rw-r--r--src/components/policy/include/policy/cache_manager_interface.h631
-rw-r--r--src/components/policy/include/policy/policy_helper.h248
-rw-r--r--src/components/policy/include/policy/policy_listener.h104
-rw-r--r--src/components/policy/include/policy/policy_manager.h481
-rw-r--r--src/components/policy/include/policy/policy_manager_impl.h352
-rw-r--r--src/components/policy/include/policy/policy_table.h62
-rw-r--r--src/components/policy/include/policy/policy_table/enums.h113
-rw-r--r--src/components/policy/include/policy/policy_table/functions.h7
-rw-r--r--src/components/policy/include/policy/policy_table/types.h441
-rw-r--r--src/components/policy/include/policy/pt_ext_representation.h333
-rw-r--r--src/components/policy/include/policy/pt_representation.h324
-rw-r--r--src/components/policy/include/policy/sql_pt_ext_queries.h97
-rw-r--r--src/components/policy/include/policy/sql_pt_ext_representation.h205
-rw-r--r--src/components/policy/include/policy/sql_pt_queries.h125
-rw-r--r--src/components/policy/include/policy/sql_pt_representation.h203
-rw-r--r--src/components/policy/include/policy/sql_wrapper.h44
-rw-r--r--src/components/policy/include/policy/update_status_manager.h198
-rw-r--r--src/components/policy/include/policy/update_status_manager_interface.h107
-rw-r--r--src/components/policy/include/policy/usage_statistics/app_stopwatch.h50
-rw-r--r--src/components/policy/include/policy/usage_statistics/counter.h107
-rw-r--r--src/components/policy/include/policy/user_consent_manager.h44
-rw-r--r--src/components/policy/policy_external/.gitignore79
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt125
-rw-r--r--src/components/policy/policy_external/Readme.txt (renamed from src/components/policy/Readme.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/AppMgr/index.txt (renamed from src/components/policy/doc/doxygen/components/AppMgr/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/HMI/index.txt (renamed from src/components/policy/doc/doxygen/components/HMI/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt (renamed from src/components/policy/doc/doxygen/components/JSONHandler/Formatters/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/JSONHandler/index.txt (renamed from src/components/policy/doc/doxygen/components/JSONHandler/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/ProtocolHandler/index.txt (renamed from src/components/policy/doc/doxygen/components/ProtocolHandler/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart (renamed from src/components/HMI/IVSU/PROPRIETARY_REQUEST~)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt25
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/index.txt9
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt101
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt9
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/index.txt10
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Use (renamed from src/components/HMI/images/media/bcs-item_bgL_pressed.png)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Use of Smart Objects/index.txt6
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/SmartObjects/index.txt (renamed from src/components/policy/doc/doxygen/components/SmartObjects/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt11
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt11
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt14
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt18
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt19
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt20
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt89
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Interaction.txt7
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt9
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt15
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/index.txt15
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase1.txt74
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase2.txt96
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase3.txt131
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/index.txt11
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/TransportManager/index.txt (renamed from src/components/policy/doc/doxygen/components/TransportManager/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/components/index.txt (renamed from src/components/policy/doc/doxygen/components/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/info.txt (renamed from src/components/policy/doc/doxygen/info.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/mainpage.txt (renamed from src/components/policy/doc/doxygen/mainpage.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt (renamed from src/components/policy/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/CMake Integration.txt13
-rw-r--r--src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/How To Use.txt31
-rw-r--r--src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/Use of Output.txt11
-rw-r--r--src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/index.txt (renamed from src/components/policy/doc/doxygen/tools/InterfaceGenerator/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/doxygen/tools/index.txt (renamed from src/components/policy/doc/doxygen/tools/index.txt)0
-rw-r--r--src/components/policy/policy_external/doc/grc/conf.smartDeviceLinkCore33
-rw-r--r--src/components/policy/policy_external/doc/grc/grc.conf (renamed from src/components/policy/doc/grc/grc.conf)0
-rw-r--r--src/components/policy/policy_external/doc/install.txt91
-rw-r--r--src/components/policy/policy_external/doc/qnx_build.txt (renamed from src/components/policy/doc/qnx_build.txt)0
-rw-r--r--src/components/policy/policy_external/doc/readme.txt65
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote.h139
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote_impl.h174
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h943
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h805
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h346
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h1087
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table.h62
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h180
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/functions.h39
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h595
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml284
-rw-r--r--src/components/policy/policy_external/include/policy/policy_types.h529
-rw-r--r--src/components/policy/policy_external/include/policy/pt_ext_representation.h347
-rw-r--r--src/components/policy/policy_external/include/policy/pt_representation.h328
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_ext_queries.h104
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h218
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_queries.h136
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h228
-rw-r--r--src/components/policy/policy_external/include/policy/sql_wrapper.h45
-rw-r--r--src/components/policy/policy_external/include/policy/status.h196
-rw-r--r--src/components/policy/policy_external/include/policy/update_status_manager.h240
-rw-r--r--src/components/policy/policy_external/include/policy/usage_statistics/counter.h108
-rw-r--r--src/components/policy/policy_external/include/policy/user_consent_manager.h44
-rw-r--r--src/components/policy/policy_external/specification.txt (renamed from src/components/policy/specification.txt)0
-rw-r--r--src/components/policy/policy_external/src/access_remote_impl.cc261
-rw-r--r--src/components/policy/policy_external/src/cache_manager.cc2764
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc904
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc2038
-rw-r--r--src/components/policy/policy_external/src/policy_table.cc52
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc771
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc2161
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc307
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_queries.cc299
-rw-r--r--src/components/policy/policy_external/src/sql_pt_ext_representation.cc1937
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc848
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc2099
-rw-r--r--src/components/policy/policy_external/src/status.cc139
-rw-r--r--src/components/policy/policy_external/src/update_status_manager.cc262
-rw-r--r--src/components/policy/policy_external/src/usage_statistics/counter.cc126
-rw-r--r--src/components/policy/policy_external/test/CMakeLists.txt69
-rw-r--r--src/components/policy/policy_external/test/counter_test.cc183
-rw-r--r--src/components/policy/policy_external/test/generated_code_test.cc228
-rw-r--r--src/components/policy/policy_external/test/include/policy/driver_dbms.h159
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_access_remote.h73
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h53
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h149
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_pt_representation.h109
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h61
-rw-r--r--src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h306
-rw-r--r--src/components/policy/policy_external/test/json/PTU.json2153
-rw-r--r--src/components/policy/policy_external/test/json/PTU2.json2152
-rw-r--r--src/components/policy/policy_external/test/json/PTU3.json2154
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app.json319
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json317
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json314
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json313
-rw-r--r--src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json320
-rw-r--r--src/components/policy/policy_external/test/json/PTU_functional_grouping.json11
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json319
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json314
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json315
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json307
-rw-r--r--src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json320
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json1727
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json1730
-rw-r--r--src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json1727
-rw-r--r--src/components/policy/policy_external/test/json/PTU_without_requestType_field.json1726
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json1944
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json1942
-rw-r--r--src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json1943
-rw-r--r--src/components/policy/policy_external/test/json/ptu2_requestType.json2615
-rw-r--r--src/components/policy/policy_external/test/json/ptu_requestType.json2605
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt.json (renamed from src/components/policy/test/sdl_preloaded_pt.json)0
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json2413
-rw-r--r--src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json2321
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_first_update.json (renamed from src/components/policy/test/sdl_pt_first_update.json)0
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_second_update.json (renamed from src/components/policy/test/sdl_pt_second_update.json)0
-rw-r--r--src/components/policy/policy_external/test/json/sdl_pt_update.json1728
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json2340
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json2342
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json2330
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json2329
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json2341
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json2330
-rw-r--r--src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json2335
-rw-r--r--src/components/policy/policy_external/test/json/valid_sdl_pt_update.json (renamed from src/components/policy/test/valid_sdl_pt_update.json)0
-rw-r--r--src/components/policy/policy_external/test/log4cxx.properties (renamed from src/components/policy/test/log4cxx.properties)0
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc1719
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc338
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc293
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test.cc1127
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc919
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc675
-rw-r--r--src/components/policy/policy_external/test/shared_library_test.cc76
-rw-r--r--src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc1718
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc1856
-rw-r--r--src/components/policy/policy_external/test/update_status_manager_test.cc339
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt125
-rw-r--r--src/components/policy/policy_regular/Readme.txt3
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/AppMgr/index.txt5
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/HMI/index.txt5
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt9
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/index.txt8
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/ProtocolHandler/index.txt5
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/SmartObjects/index.txt11
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/TransportManager/index.txt9
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/components/index.txt10
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/info.txt5
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/mainpage.txt9
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt5
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/index.txt12
-rw-r--r--src/components/policy/policy_regular/doc/doxygen/tools/index.txt5
-rw-r--r--src/components/policy/policy_regular/doc/grc/conf.smartDeviceLinkCore33
-rw-r--r--src/components/policy/policy_regular/doc/grc/grc.conf3
-rw-r--r--src/components/policy/policy_regular/doc/install.txt91
-rw-r--r--src/components/policy/policy_regular/doc/qnx_build.txt28
-rw-r--r--src/components/policy/policy_regular/doc/readme.txt65
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote.h122
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote_impl.h169
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h800
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h659
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_helper.h249
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h939
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table.h62
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h165
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/functions.h7
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h491
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_types.h490
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_ext_representation.h336
-rw-r--r--src/components/policy/policy_regular/include/policy/pt_representation.h323
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h97
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h206
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_queries.h138
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h220
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_wrapper.h44
-rw-r--r--src/components/policy/policy_regular/include/policy/status.h199
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager.h221
-rw-r--r--src/components/policy/policy_regular/include/policy/update_status_manager_interface.h120
-rw-r--r--src/components/policy/policy_regular/include/policy/usage_statistics/counter.h107
-rw-r--r--src/components/policy/policy_regular/include/policy/user_consent_manager.h44
-rw-r--r--src/components/policy/policy_regular/policy_table_interface_ext.xml (renamed from src/components/policy/policy_table_interface_ext.xml)0
-rw-r--r--src/components/policy/policy_regular/specification.txt1
-rw-r--r--src/components/policy/policy_regular/src/access_remote_impl.cc247
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc1738
-rw-r--r--src/components/policy/policy_regular/src/policy_helper.cc817
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc1279
-rw-r--r--src/components/policy/policy_regular/src/policy_table.cc (renamed from src/components/policy/src/policy_table.cc)0
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc634
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc1510
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc267
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_ext_queries.cc (renamed from src/components/policy/src/sql_pt_ext_queries.cc)0
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_ext_representation.cc (renamed from src/components/policy/src/sql_pt_ext_representation.cc)0
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc792
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc2007
-rw-r--r--src/components/policy/policy_regular/src/status.cc141
-rw-r--r--src/components/policy/policy_regular/src/update_status_manager.cc190
-rw-r--r--src/components/policy/policy_regular/src/usage_statistics/counter.cc (renamed from src/components/policy/src/usage_statistics/counter.cc)0
-rw-r--r--src/components/policy/policy_regular/test/CMakeLists.txt77
-rw-r--r--src/components/policy/policy_regular/test/PTU.json1948
-rw-r--r--src/components/policy/policy_regular/test/PTU2.json (renamed from src/components/policy/test/PTU2.json)0
-rw-r--r--src/components/policy/policy_regular/test/PTU3.json1950
-rw-r--r--src/components/policy/policy_regular/test/PTU4.json (renamed from src/components/policy/test/PTU4.json)0
-rw-r--r--src/components/policy/policy_regular/test/access_remote_impl_test.cc95
-rw-r--r--src/components/policy/policy_regular/test/counter_test.cc194
-rw-r--r--src/components/policy/policy_regular/test/generated_code_test.cc72
-rw-r--r--src/components/policy/policy_regular/test/include.cmake (renamed from src/components/policy/test/include.cmake)0
-rw-r--r--src/components/policy/policy_regular/test/include/policy/driver_dbms.h159
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_access_remote.h73
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_app_stopwatch.h54
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h139
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h105
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h57
-rw-r--r--src/components/policy/policy_regular/test/log4cxx.properties33
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc1379
-rw-r--r--src/components/policy/policy_regular/test/ptu2_requestType.json (renamed from src/components/policy/test/ptu2_requestType.json)0
-rw-r--r--src/components/policy/policy_regular/test/ptu_requestType.json (renamed from src/components/policy/test/ptu_requestType.json)0
-rw-r--r--src/components/policy/policy_regular/test/sdl_preloaded_pt.json1944
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_first_update.json1744
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_second_update.json1744
-rw-r--r--src/components/policy/policy_regular/test/sdl_pt_update.json (renamed from src/components/policy/test/sdl_pt_update.json)0
-rw-r--r--src/components/policy/policy_regular/test/shared_library_test.cc76
-rw-r--r--src/components/policy/policy_regular/test/smartDeviceLink.ini (renamed from src/components/policy/test/smartDeviceLink.ini)0
-rw-r--r--src/components/policy/policy_regular/test/smartDeviceLink2.ini (renamed from src/components/policy/test/smartDeviceLink2.ini)0
-rw-r--r--src/components/policy/policy_regular/test/smartDeviceLink3.ini (renamed from src/components/policy/test/smartDeviceLink3.ini)0
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc1706
-rw-r--r--src/components/policy/policy_regular/test/update_status_manager_test.cc93
-rw-r--r--src/components/policy/policy_regular/test/valid_sdl_pt_update.json1720
-rw-r--r--src/components/policy/policy_table_interface.xml225
-rw-r--r--src/components/policy/src/cache_manager.cc1601
-rw-r--r--src/components/policy/src/policy_helper.cc805
-rw-r--r--src/components/policy/src/policy_manager_impl.cc1014
-rw-r--r--src/components/policy/src/policy_table/enums.cc577
-rw-r--r--src/components/policy/src/policy_table/types.cc1371
-rw-r--r--src/components/policy/src/policy_table/validation.cc197
-rw-r--r--src/components/policy/src/sql_pt_queries.cc712
-rw-r--r--src/components/policy/src/sql_pt_representation.cc1754
-rw-r--r--src/components/policy/src/update_status_manager.cc270
-rw-r--r--src/components/policy/test/CMakeLists.txt78
-rw-r--r--src/components/policy/test/PTU.json1949
-rw-r--r--src/components/policy/test/PTU3.json1951
-rw-r--r--src/components/policy/test/counter_test.cc194
-rw-r--r--src/components/policy/test/generated_code_test.cc72
-rw-r--r--src/components/policy/test/include/driver_dbms.h159
-rw-r--r--src/components/policy/test/include/mock_cache_manager.h207
-rw-r--r--src/components/policy/test/include/mock_policy_listener.h81
-rw-r--r--src/components/policy/test/include/mock_policy_manager.h179
-rw-r--r--src/components/policy/test/include/mock_pt_ext_representation.h139
-rw-r--r--src/components/policy/test/include/mock_pt_representation.h105
-rw-r--r--src/components/policy/test/include/mock_update_status_manager.h57
-rw-r--r--src/components/policy/test/policy_manager_impl_test.cc1340
-rw-r--r--src/components/policy/test/shared_library_test.cc76
-rw-r--r--src/components/policy/test/sql_pt_representation_test.cc1711
-rw-r--r--src/components/policy/test/update_status_manager_test.cc92
-rw-r--r--src/components/protocol/CMakeLists.txt18
-rw-r--r--src/components/protocol/src/bson_object_keys.cc18
-rw-r--r--src/components/protocol_handler/CMakeLists.txt18
-rw-r--r--src/components/protocol_handler/include/protocol_handler/handshake_handler.h128
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h147
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_packet.h68
-rw-r--r--src/components/protocol_handler/include/protocol_handler/protocol_payload.h4
-rw-r--r--src/components/protocol_handler/include/protocol_handler/telemetry_observer.h57
-rw-r--r--src/components/protocol_handler/src/handshake_handler.cc201
-rw-r--r--src/components/protocol_handler/src/incoming_data_handler.cc1
-rw-r--r--src/components/protocol_handler/src/protocol_handler_impl.cc818
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc134
-rw-r--r--src/components/protocol_handler/test/CMakeLists.txt20
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h6
-rw-r--r--src/components/protocol_handler/test/include/protocol_handler/protocol_observer_mock.h57
-rw-r--r--src/components/protocol_handler/test/incoming_data_handler_test.cc2
-rw-r--r--src/components/protocol_handler/test/protocol_handler_tm_test.cc1070
-rw-r--r--src/components/protocol_handler/test/protocol_header_validator_test.cc91
-rw-r--r--src/components/protocol_handler/test/protocol_packet_test.cc12
-rw-r--r--src/components/qt_hmi/CMakeLists.txt42
-rw-r--r--src/components/qt_hmi/Readme.txt7
-rw-r--r--src/components/qt_hmi/References/Look/.DS_Storebin15364 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttfbin246000 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttfbin246040 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttfbin260780 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttfbin380840 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttfbin314564 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttfbin332128 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/ImageHardkey.qml52
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml378
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml9
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml69
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml111
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml57
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/FMLayout.qml217
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml152
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml61
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/ListLayout.qml59
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml130
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml547
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml78
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/OffLayout.qml71
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml123
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml40
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml195
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/StartLayout.qml30
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml76
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml107
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml73
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/USBLayout.qml132
-rw-r--r--src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml155
-rw-r--r--src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml373
-rw-r--r--src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject20
-rw-r--r--src/components/qt_hmi/References/Look/Resources/CButton.pngbin4607 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psdbin1111637 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.pngbin40425 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/Map.pngbin335952 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.pngbin5760 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.pngbin10538 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.pngbin10625 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/compass.pngbin3528 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.pngbin2892 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.pngbin2898 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/destIcon.pngbin3097 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.pngbin3000 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.pngbin2894 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/OButton.pngbin5287 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.pngbin2861 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.pngbin3859 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.pngbin3911 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.pngbin42473 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.pngbin5292 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.pngbin5251 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.pngbin5059 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/blueBall.pngbin2874 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.pngbin2850 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.pngbin13194 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.pngbin2866 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.pngbin11177 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.pngbin11472 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.pngbin11089 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.pngbin11325 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/albumArt.pngbin45068 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pause.pngbin3276 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.pngbin12559 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.pngbin13816 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.pngbin12335 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/USB/play_9_9.pngbin13219 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/cal.pngbin3699 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/folders.pngbin3337 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.pngbin4426 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/Vehicle/sun.pngbin4773 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.pngbin10154 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/keySelected.pngbin4396 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.pngbin9590 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/muteActive.pngbin5614 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.pngbin4903 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.pngbin10510 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.pngbin11248 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.pngbin8915 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.pngbin4017 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.pngbin8401 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.pngbin8107 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.pngbin3611 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.pngbin8490 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.pngbin5166 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.pngbin4264 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.pngbin13064 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.pngbin12252 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/climate/ring.pngbin10987 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/dn-arrow.pngbin1097 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/g136p.pngbin274 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/g137p.pngbin357 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/arrow.pngbin3745 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/car.pngbin4114 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/gear.pngbin4806 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/notes.pngbin1962 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/phone.pngbin2528 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/menu/snow.pngbin3976 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/DNDoff.pngbin7073 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/DNDon.pngbin5564 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/contacts.pngbin4036 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/keypad.pngbin3200 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/messages.pngbin2576 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/more.pngbin3447 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/recent.pngbin3104 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/phone/texts.pngbin3917 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/scrollbar.pngbin1008 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/slider.pngbin1017 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/Resources/up-arrow.pngbin1101 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/TextHardkey.qml52
-rw-r--r--src/components/qt_hmi/References/Look/Views/AM.qml86
-rw-r--r--src/components/qt_hmi/References/Look/Views/AMPCA.qml122
-rw-r--r--src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml151
-rw-r--r--src/components/qt_hmi/References/Look/Views/AuxPCA.qml41
-rw-r--r--src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/CDPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/Chrome.qml55
-rw-r--r--src/components/qt_hmi/References/Look/Views/ClimatePCA.qml74
-rw-r--r--src/components/qt_hmi/References/Look/Views/ControlMirror.qml55
-rw-r--r--src/components/qt_hmi/References/Look/Views/FM.qml94
-rw-r--r--src/components/qt_hmi/References/Look/Views/FMPCA.qml175
-rw-r--r--src/components/qt_hmi/References/Look/Views/GenListHandling.qml14
-rw-r--r--src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml87
-rw-r--r--src/components/qt_hmi/References/Look/Views/Home.qml50
-rw-r--r--src/components/qt_hmi/References/Look/Views/List.qml74
-rw-r--r--src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavInRoute.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml159
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavMenu.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/NavNoRoute.qml35
-rw-r--r--src/components/qt_hmi/References/Look/Views/Off.qml34
-rw-r--r--src/components/qt_hmi/References/Look/Views/On.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml104
-rw-r--r--src/components/qt_hmi/References/Look/Views/PhonePCA.qml85
-rw-r--r--src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml37
-rw-r--r--src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml61
-rw-r--r--src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Views/Sirius.qml71
-rw-r--r--src/components/qt_hmi/References/Look/Views/SiriusPCA.qml115
-rw-r--r--src/components/qt_hmi/References/Look/Views/SourceChange.qml73
-rw-r--r--src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml105
-rw-r--r--src/components/qt_hmi/References/Look/Views/Start.qml43
-rw-r--r--src/components/qt_hmi/References/Look/Views/USB.qml59
-rw-r--r--src/components/qt_hmi/References/Look/Views/USBPCA.qml49
-rw-r--r--src/components/qt_hmi/References/Look/Views/iPodPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml34
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml25
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml24
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml56
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml22
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml61
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml50
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml40
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml40
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml24
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml50
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml97
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml143
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml95
-rw-r--r--src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml325
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/BaseText.qml50
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/CondText.qml14
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml45
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml31
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml32
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml41
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml35
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml31
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml60
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml28
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml48
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml78
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton.qml77
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml32
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml38
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml34
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml27
-rw-r--r--src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml18
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dllbin335360 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dllbin974848 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdbbin5516288 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes682
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml40
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml8
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml35
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml43
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml104
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js12
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml14
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml25
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml13
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml51
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js132
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml28
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml56
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml41
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js5
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml19
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml9
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml7
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml15
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml6
-rw-r--r--src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir35
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro21
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop11
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas64.pngbin3400 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas80.pngbin4945 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop11
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/README.md37
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject19
-rwxr-xr-xsrc/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh8
-rwxr-xr-xsrc/components/qt_hmi/References/Work/bananasnacks/load_env.sh1
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/main.cpp16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir2
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.pngbin4369 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.pngbin2975 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.pngbin6876 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.pngbin10475 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.pngbin16926 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.pngbin13849 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.pngbin4471 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.pngbin3848 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.pngbin49513 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.pngbin1035032 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.pngbin16044 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.pngbin5932 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.pngbin2890 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.pngbin8217 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.pngbin7355 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.pngbin6218 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.pngbin3072 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.pngbin5305 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.pngbin4473 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.pngbin5374 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.pngbin5073 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.pngbin6456 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.pngbin3115 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.pngbin3992 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.pngbin4974 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.pngbin55017 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.pngbin4821 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.pngbin6918 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.pngbin2826 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.pngbin4156 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.pngbin7277 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.pngbin4759 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.pngbin5748 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.pngbin3020 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.pngbin4517 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.pngbin9198 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.pngbin5831 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.pngbin5807 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.pngbin3092 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.pngbin8684 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.pngbin6611 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.pngbin395 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.pngbin7897 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.pngbin5832 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.pngbin3149 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.pngbin6570 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.pngbin5976 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.pngbin3592 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.pngbin31003 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.pngbin4741 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.pngbin7070 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.pngbin7500 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.pngbin4767 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.pngbin8214 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.pngbin4698 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml9
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml32
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml36
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml24
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml40
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml9
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml7
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml129
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml43
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml40
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml46
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml30
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml5
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml29
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml72
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml34
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml59
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml34
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml14
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swpbin12288 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml6
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml29
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml46
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml54
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml13
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml59
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swpbin12288 -> 0 bytes
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml70
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml64
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml63
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml57
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml205
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml70
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml20
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml21
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml23
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml55
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml16
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml54
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml62
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml60
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml68
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml144
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml51
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml133
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml55
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml49
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml37
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml17
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml79
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp64
-rw-r--r--src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h33
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro48
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp456
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h98
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp749
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h181
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro21
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj328
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp30
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h14
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/qmldir3
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp3
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h16
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp4
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h47
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp386
-rw-r--r--src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h80
-rw-r--r--src/components/qt_hmi/qml_model_qt4/CMakeLists.txt87
-rw-r--r--src/components/qt_hmi/qml_model_qt4/MainWindow.qml356
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml68
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml87
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml143
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml108
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml134
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/Icon.qml65
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml64
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml240
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/Pager.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml106
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml136
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml49
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js39
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml104
-rw-r--r--src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml42
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js7
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml88
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml127
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml115
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml449
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml749
-rw-r--r--src/components/qt_hmi/qml_model_qt4/log4cxx.properties41
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml57
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml91
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/Constants.js249
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml510
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml58
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/Internal.js163
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml112
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml72
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml52
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml43
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml51
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml234
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml285
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml56
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml81
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml149
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml214
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml71
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml111
-rw-r--r--src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject20
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml123
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml62
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml63
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml102
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml118
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml86
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml173
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml73
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml325
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml250
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml221
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml205
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml171
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml55
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml160
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml223
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml194
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml120
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml216
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml284
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml46
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml201
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml135
-rw-r--r--src/components/qt_hmi/qml_model_qt5/CMakeLists.txt87
-rw-r--r--src/components/qt_hmi/qml_model_qt5/MainWindow.qml462
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml68
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml87
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml93
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml125
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml108
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml133
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/Icon.qml65
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml70
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml64
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml246
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/Pager.qml53
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml77
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml106
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml136
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml49
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js39
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml97
-rw-r--r--src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml42
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js7
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml187
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml246
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml38
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml203
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml730
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml170
-rw-r--r--src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml764
-rw-r--r--src/components/qt_hmi/qml_model_qt5/log4cxx.properties41
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml59
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml105
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/Constants.js250
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml660
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/Internal.js176
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml117
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml72
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml50
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml43
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml78
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml51
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml92
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml401
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml45
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml234
-rw-r--r--src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml66
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml290
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml56
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml82
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml153
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml150
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml217
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml71
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml110
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml113
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml158
-rw-r--r--src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml112
-rw-r--r--src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject20
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml126
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml62
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml63
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml102
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml94
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml118
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml82
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml48
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml86
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml175
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml54
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml73
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml302
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml250
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml221
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml75
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml205
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml171
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml55
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml98
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml160
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml117
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml223
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml179
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml121
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml79
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml181
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml88
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml293
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml46
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml89
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml202
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml103
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml61
-rw-r--r--src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml135
-rw-r--r--src/components/qt_hmi/qml_plugins/CMakeLists.txt41
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt164
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc95
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h67
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc97
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h69
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc45
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h63
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h61
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h90
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h259
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h48
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc68
-rw-r--r--src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h42
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt85
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc39
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h64
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc58
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h58
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc153
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h89
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h48
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt86
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc108
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h78
-rw-r--r--src/components/qt_hmi/qml_plugins/log4cxx/qmldir3
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt84
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc60
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h67
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc52
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h59
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir2
-rw-r--r--src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h48
-rw-r--r--src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST2
-rw-r--r--src/components/qt_hmi/res/SPT.pngbin11718 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/album_art.pngbin45068 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/app_911_assist.pngbin6982 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/app_vehicle_info.pngbin4842 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/apps.pngbin5957 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/arrow.pngbin3745 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/blue_ball.pngbin2874 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/long_oval_btn.pngbin5251 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/long_oval_pressed_btn.pngbin5042 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/longest_oval_btn.pngbin5292 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.pngbin4977 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_bottom.pngbin2817 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_left.pngbin3893 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_pressed_left.pngbin3735 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_pressed_right.pngbin3755 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_right.pngbin3881 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/oval_btn_top.pngbin2814 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_next_btn.pngbin11472 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_next_pressed_btn.pngbin11177 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_pause_btn.pngbin6666 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_pause_pressed_btn.pngbin6268 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_play_btn.pngbin13219 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_play_pressed_btn.pngbin12335 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_prev_btn.pngbin11325 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/player_prev_pressed_btn.pngbin11089 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/preset_btn.pngbin8401 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/preset_pressed_btn.pngbin8915 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/round_btn.pngbin9590 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/round_pressed_btn.pngbin10154 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/short_oval_btn.pngbin5059 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/short_oval_btn_pressed.pngbin4733 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/zoom.pngbin8490 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/buttons/zoom_pressed.pngbin8107 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/car.pngbin4114 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/change_devices.pngbin5188 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/AC_off.pngbin3566 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/AC_on.pngbin3871 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/climate_round_off_btn.pngbin12252 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/climate_round_on_btn.pngbin13064 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/defrost_off.pngbin3887 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/defrost_on.pngbin3509 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/face_off.pngbin3593 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/face_on.pngbin3931 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/feet_off.pngbin3568 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/feet_on.pngbin3878 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/headed_dash_off.pngbin3638 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/headed_dash_on.pngbin3326 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_seat_off.pngbin3967 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_seat_on.pngbin4406 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_wheel_off.pngbin3807 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/climate/heated_wheel_on.pngbin4272 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/DownButton.pngbin4688 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/DownButton_pressed.pngbin4612 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/LeftButton.pngbin5170 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/LeftButton_pressed.pngbin5269 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/OkButton.pngbin4497 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/OkButton_pressed.pngbin4622 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/RightButton.pngbin5242 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/RightButton_pressed.pngbin5138 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/UpButton.pngbin4553 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/UpButton_pressed.pngbin4681 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/backGroundControllButtons.pngbin3157 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrButton.pngbin5429 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrButton_pressed.pngbin6165 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/controlButtons/vrImage.pngbin2461 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/find_apps.pngbin4085 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/gear.pngbin4806 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/hd_logo_off.pngbin3543 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/hd_logo_on.pngbin3609 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/initial.wavbin46834 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/install_apps.pngbin6517 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/compass.pngbin3552 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/current_street.pngbin5491 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/delete_icon.pngbin2892 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/delete_icon_black.pngbin2898 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/dest_icon.pngbin3097 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/dest_icon_black.pngbin3000 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/map.pngbin332637 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/mute_off.pngbin11248 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/mute_on.pngbin4334 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options.pngbin10625 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options_in_active.pngbin5760 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/options_pressed.pngbin10538 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/nav/turnArrow.pngbin2894 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/notes.pngbin1962 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/contacts.pngbin4036 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/dnd_off.pngbin7073 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/dnd_on.pngbin5564 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/keypad.pngbin3200 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/messages.pngbin2576 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/more.pngbin3447 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/phone.pngbin2528 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/recent.pngbin3104 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/phone/texts.pngbin3917 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/snow.pngbin3976 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/cal.pngbin3699 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/folders.pngbin3337 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/key_car.pngbin4426 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/vehicle/sun.pngbin4773 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/warning.pngbin7546 -> 0 bytes
-rw-r--r--src/components/qt_hmi/res/white_ball.pngbin2866 -> 0 bytes
-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/remote_control/CMakeLists.txt83
-rw-r--r--src/components/remote_control/include/remote_control/commands/base_command_notification.h110
-rw-r--r--src/components/remote_control/include/remote_control/commands/base_command_request.h293
-rw-r--r--src/components/remote_control/include/remote_control/commands/button_press_request.h104
-rw-r--r--src/components/remote_control/include/remote_control/commands/command.h84
-rw-r--r--src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h101
-rw-r--r--src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h75
-rw-r--r--src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h79
-rw-r--r--src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h127
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event.h127
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h203
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event_observer.h96
-rw-r--r--src/components/remote_control/include/remote_control/message_helper.h122
-rw-r--r--src/components/remote_control/include/remote_control/module_helper.h0
-rw-r--r--src/components/remote_control/include/remote_control/rc_app_extension.h82
-rw-r--r--src/components/remote_control/include/remote_control/rc_command_factory.h66
-rw-r--r--src/components/remote_control/include/remote_control/rc_module_constants.h233
-rw-r--r--src/components/remote_control/include/remote_control/rc_module_timer.h70
-rw-r--r--src/components/remote_control/include/remote_control/remote_control_event.h82
-rw-r--r--src/components/remote_control/include/remote_control/remote_control_plugin.h164
-rw-r--r--src/components/remote_control/include/remote_control/remote_plugin_interface.h118
-rw-r--r--src/components/remote_control/include/remote_control/request_controller.h110
-rw-r--r--src/components/remote_control/include/remote_control/resource_allocation_manager.h115
-rw-r--r--src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h137
-rw-r--r--src/components/remote_control/src/commands/base_command_notification.cc154
-rw-r--r--src/components/remote_control/src/commands/base_command_request.cc564
-rw-r--r--src/components/remote_control/src/commands/button_press_request.cc264
-rw-r--r--src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc224
-rw-r--r--src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc103
-rw-r--r--src/components/remote_control/src/commands/on_remote_control_settings_notification.cc122
-rw-r--r--src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc350
-rw-r--r--src/components/remote_control/src/message_helper.cc154
-rw-r--r--src/components/remote_control/src/module_helper.cc0
-rw-r--r--src/components/remote_control/src/rc_app_extension.cc62
-rw-r--r--src/components/remote_control/src/rc_command_factory.cc86
-rw-r--r--src/components/remote_control/src/remote_control_event.cc56
-rw-r--r--src/components/remote_control/src/remote_control_plugin.cc341
-rw-r--r--src/components/remote_control/src/request_controller.cc96
-rw-r--r--src/components/remote_control/src/resource_allocation_manager_impl.cc377
-rw-r--r--src/components/remote_control/test/CMakeLists.txt67
-rw-r--r--src/components/remote_control/test/commands/CMakeLists.txt62
-rw-r--r--src/components/remote_control/test/commands/button_press_request_test.cc344
-rw-r--r--src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc291
-rw-r--r--src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc182
-rw-r--r--src/components/remote_control/test/commands/on_remote_control_settings_test.cc326
-rw-r--r--src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc433
-rw-r--r--src/components/remote_control/test/include/mock_application.h344
-rw-r--r--src/components/remote_control/test/include/mock_remote_control_plugin.h54
-rw-r--r--src/components/remote_control/test/include/mock_resource_allocation_manager.h40
-rw-r--r--src/components/remote_control/test/src/rc_app_extension_test.cc43
-rw-r--r--src/components/remote_control/test/src/rc_library_test.cc92
-rw-r--r--src/components/remote_control/test/src/rc_module_test.cc263
-rw-r--r--src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc481
-rw-r--r--src/components/resumption/CMakeLists.txt12
-rw-r--r--src/components/resumption/include/resumption/last_state.h28
-rw-r--r--src/components/resumption/include/resumption/last_state_impl.h83
-rw-r--r--src/components/resumption/src/last_state.cc77
-rw-r--r--src/components/resumption/src/last_state_impl.cc81
-rw-r--r--src/components/resumption/test/CMakeLists.txt18
-rw-r--r--src/components/resumption/test/last_state_test.cc20
-rw-r--r--src/components/rpc_base/CMakeLists.txt29
-rw-r--r--src/components/rpc_base/include/rpc_base/gtest_support.h6
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base.h10
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_dbus_inl.h6
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_inl.h14
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h12
-rw-r--r--src/components/rpc_base/include/rpc_base/rpc_message.h6
-rw-r--r--src/components/rpc_base/include/rpc_base/validation_report.h122
-rw-r--r--src/components/rpc_base/test/CMakeLists.txt32
-rw-r--r--src/components/rpc_base/test/rpc_base_dbus_test.cc35
-rw-r--r--src/components/rpc_base/test/rpc_base_json_test.cc9
-rw-r--r--src/components/rpc_base/test/rpc_base_test.cc28
-rw-r--r--src/components/rpc_base/test/validation_report_test.cc8
-rw-r--r--src/components/security_manager/CMakeLists.txt29
-rw-r--r--src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox241
-rw-r--r--src/components/security_manager/docs/assets/sm_class_digram.pngbin0 -> 368935 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_digram_decryption.pngbin0 -> 28014 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_digram_encryption.pngbin0 -> 22326 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_digram_init.pngbin0 -> 119018 bytes
-rw-r--r--src/components/security_manager/docs/assets/sm_sequence_digram_verify.pngbin0 -> 39820 bytes
-rw-r--r--src/components/security_manager/include/security_manager/crypto_manager_impl.h14
-rw-r--r--src/components/security_manager/include/security_manager/security_manager_impl.h20
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc63
-rw-r--r--src/components/security_manager/src/security_manager_impl.cc33
-rw-r--r--src/components/security_manager/src/ssl_context_impl.cc92
-rw-r--r--src/components/security_manager/test/CMakeLists.txt24
-rw-r--r--src/components/security_manager/test/crypto_manager_impl_test.cc27
-rw-r--r--src/components/security_manager/test/security_manager_test.cc237
-rw-r--r--src/components/security_manager/test/ssl_certificate_handshake_test.cc17
-rw-r--r--src/components/security_manager/test/ssl_context_test.cc61
-rw-r--r--src/components/smart_objects/CMakeLists.txt31
-rw-r--r--src/components/smart_objects/include/smart_objects/always_false_schema_item.h9
-rw-r--r--src/components/smart_objects/include/smart_objects/always_true_schema_item.h9
-rw-r--r--src/components/smart_objects/include/smart_objects/array_schema_item.h14
-rw-r--r--src/components/smart_objects/include/smart_objects/default_shema_item.h30
-rw-r--r--src/components/smart_objects/include/smart_objects/enum_schema_item.h30
-rw-r--r--src/components/smart_objects/include/smart_objects/number_schema_item.h35
-rw-r--r--src/components/smart_objects/include/smart_objects/object_schema_item.h9
-rw-r--r--src/components/smart_objects/include/smart_objects/schema_item.h19
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_object.h44
-rw-r--r--src/components/smart_objects/include/smart_objects/smart_schema.h21
-rw-r--r--src/components/smart_objects/include/smart_objects/string_schema_item.h9
-rw-r--r--src/components/smart_objects/src/always_false_schema_item.cc7
-rw-r--r--src/components/smart_objects/src/always_true_schema_item.cc5
-rw-r--r--src/components/smart_objects/src/array_schema_item.cc27
-rw-r--r--src/components/smart_objects/src/object_schema_item.cc16
-rw-r--r--src/components/smart_objects/src/schema_item.cc7
-rw-r--r--src/components/smart_objects/src/smart_object.cc10
-rw-r--r--src/components/smart_objects/src/smart_schema.cc10
-rw-r--r--src/components/smart_objects/src/string_schema_item.cc21
-rw-r--r--src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc27
-rw-r--r--src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc26
-rw-r--r--src/components/smart_objects/test/ArraySchemaItem_test.cc97
-rw-r--r--src/components/smart_objects/test/BoolSchemaItem_test.cc50
-rw-r--r--src/components/smart_objects/test/CMakeLists.txt27
-rw-r--r--src/components/smart_objects/test/CObjectSchemaItem_test.cc131
-rw-r--r--src/components/smart_objects/test/EnumSchemaItem_test.cc44
-rw-r--r--src/components/smart_objects/test/NumberSchemaItem_test.cc208
-rw-r--r--src/components/smart_objects/test/SmartObjectConvertionTime_test.cc17
-rw-r--r--src/components/smart_objects/test/SmartObjectDraft_test.cc7
-rw-r--r--src/components/smart_objects/test/SmartObjectInvalid_test.cc8
-rw-r--r--src/components/smart_objects/test/SmartObjectStress_test.cc12
-rw-r--r--src/components/smart_objects/test/SmartObjectUnit_test.cc7
-rw-r--r--src/components/smart_objects/test/StringSchemaItem_test.cc80
-rw-r--r--src/components/smart_objects/test/map_performance_test.cc8
-rw-r--r--src/components/smart_objects/test/smart_object_performance_test.cc8
-rw-r--r--src/components/telemetry_monitor/CMakeLists.txt33
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h6
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h6
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h6
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h18
-rw-r--r--src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h6
-rw-r--r--src/components/telemetry_monitor/src/telemetry_monitor.cc79
-rw-r--r--src/components/telemetry_monitor/test/CMakeLists.txt28
-rw-r--r--src/components/telemetry_monitor/test/application_manager_metric_test.cc2
-rw-r--r--src/components/telemetry_monitor/test/application_manager_observer_test.cc2
-rw-r--r--src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h6
-rw-r--r--src/components/telemetry_monitor/test/metric_wrapper_test.cc2
-rw-r--r--src/components/telemetry_monitor/test/protocol_handler_metric_test.cc2
-rw-r--r--src/components/telemetry_monitor/test/telemetry_monitor_test.cc13
-rw-r--r--src/components/telemetry_monitor/test/transport_manager_metric_test.cc2
-rw-r--r--src/components/telemetry_monitor/test/transport_manager_observer_test.cc2
-rw-r--r--src/components/test_main.cc2
-rw-r--r--src/components/transport_manager/CMakeLists.txt110
-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.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_device_scanner.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_socket_connection.h13
-rw-r--r--src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h6
-rw-r--r--src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h165
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_connection_factory.h5
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_device.h12
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_server_originated_socket_connection.h84
-rw-r--r--src/components/transport_manager/include/transport_manager/tcp/tcp_socket_connection.h42
-rw-r--r--src/components/transport_manager/include/transport_manager/telemetry_observer.h6
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/client_connection_listener.h2
-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.h42
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h27
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h8
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h31
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_default.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/transport_manager_impl.h172
-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.h1
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_handler.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_connection_factory.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_control_transfer.h6
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device.h2
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h6
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc21
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc4
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc20
-rw-r--r--src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc7
-rw-r--r--src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc174
-rw-r--r--src/components/transport_manager/src/tcp/tcp_client_listener.cc74
-rw-r--r--src/components/transport_manager/src/tcp/tcp_connection_factory.cc25
-rw-r--r--src/components/transport_manager/src/tcp/tcp_device.cc17
-rw-r--r--src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc111
-rw-r--r--src/components/transport_manager/src/tcp/tcp_socket_connection.cc71
-rw-r--r--src/components/transport_manager/src/tcp/tcp_transport_adapter.cc6
-rw-r--r--src/components/transport_manager/src/transport_adapter/threaded_socket_connection.cc39
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc78
-rw-r--r--src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc184
-rw-r--r--src/components/transport_manager/src/transport_manager_default.cc21
-rw-r--r--src/components/transport_manager/src/transport_manager_impl.cc388
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc18
-rw-r--r--src/components/transport_manager/src/usb/usb_aoa_adapter.cc2
-rw-r--r--src/components/transport_manager/src/usb/usb_connection_factory.cc20
-rw-r--r--src/components/transport_manager/test/CMakeLists.txt30
-rw-r--r--src/components/transport_manager/test/app_info_storage299
-rw-r--r--src/components/transport_manager/test/include/transport_manager/client_connection_listener_mock.h62
-rw-r--r--src/components/transport_manager/test/include/transport_manager/connection_mock.h57
-rw-r--r--src/components/transport_manager/test/include/transport_manager/device_mock.h71
-rw-r--r--src/components/transport_manager/test/include/transport_manager/device_scanner_mock.h58
-rw-r--r--src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h18
-rw-r--r--src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h128
-rw-r--r--src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h91
-rw-r--r--src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h11
-rw-r--r--src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h59
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_client_connection_listener.h62
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_connection.h57
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_device_scanner.h58
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_server_connection_factory.h59
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h101
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h9
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h131
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h101
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter_listener_mock.h133
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h109
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h54
-rw-r--r--src/components/transport_manager/test/include/transport_manager/transport_manager_listener_mock.h91
-rw-r--r--src/components/transport_manager/test/raw_message_matcher.cc7
-rw-r--r--src/components/transport_manager/test/tcp_client_listener_test.cc2
-rw-r--r--src/components/transport_manager/test/tcp_transport_adapter_test.cc25
-rw-r--r--src/components/transport_manager/test/transport_adapter_listener_test.cc155
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc78
-rw-r--r--src/components/transport_manager/test/transport_manager_default_test.cc89
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc688
-rw-r--r--src/components/utils/CMakeLists.txt107
-rw-r--r--src/components/utils/include/utils/file_system.h9
-rw-r--r--src/components/utils/include/utils/helpers.h6
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h2
-rw-r--r--src/components/utils/include/utils/qdb_wrapper/sql_database.h6
-rw-r--r--src/components/utils/include/utils/qdb_wrapper/sql_error.h6
-rw-r--r--src/components/utils/include/utils/qdb_wrapper/sql_query.h6
-rw-r--r--src/components/utils/include/utils/resource_usage.h2
-rw-r--r--src/components/utils/include/utils/signals.h2
-rw-r--r--src/components/utils/include/utils/sqlite_wrapper/sql_database.h6
-rw-r--r--src/components/utils/include/utils/sqlite_wrapper/sql_error.h6
-rw-r--r--src/components/utils/include/utils/sqlite_wrapper/sql_query.h6
-rw-r--r--src/components/utils/include/utils/threads/thread_validator.h6
-rw-r--r--src/components/utils/src/file_system.cc59
-rw-r--r--src/components/utils/src/lock_posix.cc2
-rw-r--r--src/components/utils/src/log_message_loop_thread.cc4
-rw-r--r--src/components/utils/src/qdb_wrapper/CMakeLists.txt17
-rw-r--r--src/components/utils/src/signals_posix.cc (renamed from src/components/utils/src/signals_linux.cc)0
-rw-r--r--src/components/utils/src/sqlite_wrapper/CMakeLists.txt7
-rw-r--r--src/components/utils/src/sqlite_wrapper/sql_database.cc5
-rw-r--r--src/components/utils/src/sqlite_wrapper/sql_error.cc2
-rw-r--r--src/components/utils/src/sqlite_wrapper/sql_query.cc4
-rw-r--r--src/components/utils/src/threads/thread_delegate.cc1
-rw-r--r--src/components/utils/src/threads/thread_posix.cc (renamed from src/components/utils/src/threads/posix_thread.cc)0
-rw-r--r--src/components/utils/src/timer.cc2
-rw-r--r--src/components/utils/test/CMakeLists.txt92
-rw-r--r--src/components/utils/test/async_runner_test.cc108
-rw-r--r--src/components/utils/test/atomic_object_test.cc8
-rw-r--r--src/components/utils/test/back_trace_test.cc4
-rw-r--r--src/components/utils/test/bitstream_test.cc4
-rw-r--r--src/components/utils/test/conditional_variable_test.cc6
-rw-r--r--src/components/utils/test/custom_string_test.cc4
-rw-r--r--src/components/utils/test/data_accessor_test.cc4
-rw-r--r--src/components/utils/test/date_time_test.cc4
-rw-r--r--src/components/utils/test/file_system_test.cc4
-rw-r--r--src/components/utils/test/generated_code_with_sqlite_test.cc22
-rw-r--r--src/components/utils/test/include/utils/generated_code_with_sqlite_test.h20
-rw-r--r--src/components/utils/test/lock_posix_test.cc4
-rw-r--r--src/components/utils/test/log_message_loop_thread_test.cc4
-rw-r--r--src/components/utils/test/message_queue_test.cc4
-rw-r--r--src/components/utils/test/messagemeter_test.cc14
-rw-r--r--src/components/utils/test/policy.sql30
-rw-r--r--src/components/utils/test/posix_thread_test.cc6
-rw-r--r--src/components/utils/test/prioritized_queue_test.cc4
-rw-r--r--src/components/utils/test/qdb_wrapper/sql_database_test.cc8
-rw-r--r--src/components/utils/test/qdb_wrapper/sql_query_test.cc8
-rw-r--r--src/components/utils/test/rwlock_posix_test.cc4
-rw-r--r--src/components/utils/test/scope_guard_test.cc24
-rw-r--r--src/components/utils/test/shared_ptr_test.cc15
-rw-r--r--src/components/utils/test/singleton_test.cc4
-rw-r--r--src/components/utils/test/sqlite_wrapper/sql_database_test.cc8
-rw-r--r--src/components/utils/test/sqlite_wrapper/sql_query_test.cc12
-rw-r--r--src/components/utils/test/stl_utils_test.cc4
-rw-r--r--src/components/utils/test/system_test.cc4
-rw-r--r--src/components/utils/test/test_generator/CMakeLists.txt35
-rw-r--r--src/components/utils/test/test_generator/generated_msg_version_test.cc46
-rw-r--r--src/components/utils/test/thread_validator_test.cc4
2313 files changed, 203012 insertions, 157570 deletions
diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt
index d31141b36c..e1071e826f 100644
--- a/src/components/CMakeLists.txt
+++ b/src/components/CMakeLists.txt
@@ -28,69 +28,76 @@
# 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)
+set(COMPONENTS_DIR ${COMPONENTS_DIR} PARENT_SCOPE)
-# --- HMI_API interfaces
+# --- HMI, MOBILE Interfaces
add_subdirectory(./interfaces)
-# --- ProtocolHandler
+# --- Protocol Handler
add_subdirectory(./protocol)
-# --- TransportManager
+# --- Transport Manager
add_subdirectory(./transport_manager)
-# --- Policies
+# --- Resumption
add_subdirectory(./resumption)
-# --- formatters
+# --- Formatters
add_subdirectory(./formatters)
-# --- ProtocolHandler
+# --- Protocol Handler
add_subdirectory(./protocol_handler)
-# --- ConnectionHandler
+# --- Connection Handler
add_subdirectory(./connection_handler)
# --- Utils
add_subdirectory(./utils)
-# --- Security manager
+# --- Security Manager
if(ENABLE_SECURITY)
add_subdirectory(./security_manager)
endif()
-#
-# --- Policy_impl
-add_subdirectory(./policy)
-# --- Validated types
+# --- Policy
+if (${EXTENDED_POLICY} STREQUAL "EXTERNAL_PROPRIETARY")
+ add_subdirectory(./policy/policy_external/)
+ message(STATUS "Use external policy")
+else()
+ add_subdirectory(./policy/policy_regular/)
+ message(STATUS "Use regular policy")
+endif()
+
+# --- Validated Types
add_subdirectory(./rpc_base)
-# --- SmartObjects
+# --- Smart Objects
add_subdirectory(./smart_objects)
-# --- Application manager
+# --- Application Manager
add_subdirectory(./application_manager)
# --- HMI Message Handler
add_subdirectory(./hmi_message_handler)
-# --- Config
+# --- Config Profile
add_subdirectory(./config_profile)
-# --- AudioManager
+# --- Media Manager
add_subdirectory(./media_manager)
-if (TELEMETRY_MONITOR)
- add_subdirectory(./telemetry_monitor)
+if(REMOTE_CONTROL)
+ # --- CAN Module
+ add_subdirectory(./remote_control)
+ # --- Functional module
+ add_subdirectory(./functional_module)
+endif()
+# --- Telemetry Monitor
+if(TELEMETRY_MONITOR)
+ add_subdirectory(./telemetry_monitor)
endif()
-
-if (${HMI_DBUS_API})
# --- DBus
- add_subdirectory(./dbus)
-endif ()
-if (${QT_HMI})
-# --- Qt HMI
- add_subdirectory(./qt_hmi)
-endif ()
-
+if(HMI_DBUS_API)
+ add_subdirectory(./dbus)
+endif()
diff --git a/src/components/HMI/IVSU/PROPRIETARY_REQUEST b/src/components/HMI/IVSU/PROPRIETARY_REQUEST
deleted file mode 100644
index e9009f7229..0000000000
--- a/src/components/HMI/IVSU/PROPRIETARY_REQUEST
+++ /dev/null
@@ -1 +0,0 @@
-{"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
deleted file mode 100644
index ec31c13399..0000000000
--- a/src/components/HMI/app/AppViews.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL
- * @desc Setup application container for all views
- * @category Application
- * @filesource app/AppViews.js
- * @version 1.0
- */
-
-/** Appending views */
-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,
- SDL.InteractionChoicesView,
- SDL.Keyboard,
- SDL.VRHelpListView,
- SDL.ScrollableMessage,
- SDL.SliderView,
- SDL.StatusClimateView,
- SDL.StatusMediaView,
- SDL.StatusNavigationView,
- SDL.StatusInfoView,
- SDL.StatusPhoneView,
- SDL.TopControls,
- SDL.BottomControls,
- SDL.TTSPopUp,
- SDL.AlertPopUp,
- SDL.AlertManeuverPopUp,
- SDL.AudioPassThruPopUp,
- SDL.VRPopUp,
- SDL.VehicleInfo,
- SDL.TBTClientStateView,
- SDL.DriverDistraction,
- SDL.ExitApp,
- SDL.SystemRequest
- ],
-
- /*
- * This method is called when the app is fully rendered and ready to be
- * displayed. We notify the backend to hide the splash and load internal
- * view modules
- */
- didInsertElement: function() {
-
- this._super();
-
- SDL.set('appReady', true);
-
- $(window).bind("beforeunload", function(e) {
-
- FFW.BasicCommunication.OnIgnitionCycleOver();
-
- FFW.BasicCommunication.disconnect();
- FFW.UI.disconnect();
- FFW.VR.disconnect();
- FFW.VehicleInfo.disconnect();
- FFW.TTS.disconnect();
- FFW.Buttons.disconnect();
- FFW.Navigation.disconnect();
-
- if(confirm('The "ignition off" emulation executed!')){
- return 'OK, Good Bye then';
- }
- else {
- e = e || event;
- if (e.preventDefault) {
- e.preventDefault();
- }
- e.returnValue = false;
- return 'The "ignition off" emulation executed!';
- }
- })
-
- }
-});
diff --git a/src/components/HMI/app/Flags.js b/src/components/HMI/app/Flags.js
deleted file mode 100644
index c1e755a510..0000000000
--- a/src/components/HMI/app/Flags.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL
- * @desc flags for application flags used for diffeerent configurations of
- * application As the same code base is used fro Production and RnD work
- * pakackages, it is necessary to configare application for different
- * needs/releases It is NOT recommended to extend this object with new
- * flags. Each modification should be discussed with PM in advance
- * @category Application
- * @filesource app/AppFlags.js
- * @version 1.0
- */
-
-FLAGS = Em.Object.create( {
- /**
- * Set language for localization
- */
- SET_LOCALIZATION: 'eng',
-
- WEBSOCKET_URL: "ws://127.0.0.1:8087",
-
- TOUCH_EVENT_STARTED: false,
-
- BC: true,
-
- UI: true,
-
- VI: true,
-
- VR: true,
-
- Buttons: true,
-
- TTS: true,
-
- Navi: true
-
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/SDLApp.js b/src/components/HMI/app/SDLApp.js
deleted file mode 100644
index bbe4644008..0000000000
--- a/src/components/HMI/app/SDLApp.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL
- * @desc Setup application namespace and settings
- * @category Application
- * @filesource app/App.js
- * @version 1.0
- */
-
-SDL = Em.Application.create( {
-
- /** Override for mouse/touch events */
- customEvents: ('ontouchstart' in document.documentElement) ? {
- touchstart: 'actionDown',
- touchend: 'actionUp',
- touchmove: 'actionMove'
- } : {
- mousedown: 'actionDown',
- mouseup: 'actionUp',
- mousemove: 'actionMove'
- },
-
- /** Help mode flag {boolean} */
- helpMode: false,
-
- // determine home view {string}
- homeView: 'home',
-
- /** Set language for localization */
- localization: 'eng',
-
- // Application ready flag
- appReady: false,
-
- // Debug text
- debugText: 'debug mode',
-
- init: function() {
-
- Em.Logger.log('SDL: Application init!');
-
- this._super();
- },
-
- /** Application ready event */
- ready: function() {
-
- Em.Logger.log('SDL: Application ready!');
-
- /** State manager init */
- SDL.States = StateManager.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/StateManager.js b/src/components/HMI/app/StateManager.js
deleted file mode 100644
index b11ce0b835..0000000000
--- a/src/components/HMI/app/StateManager.js
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.States
- * @desc State manager definition
- * @category State Manager
- * @filesource app/StateManager.js
- * @version 1.0
- */
-
- // Extend base Em.State object
-Em.State.reopen({
-
- // used for determine display status
- active: false,
-
- enter: function () {
-
- this.set('active', true);
- },
-
- exit: function () {
-
- this.set('active', false);
- SDL.SDLController.triggerState();
- }
-});
-
-// State Manager class
-var StateManager = Em.StateManager.extend({
-
- // default state
- initialState: 'home',
-
- /**
- * Name of the next state to which at the moment is a transition
- */
- nextState: 'home',
-
- /**
- * Method used for determine previous currentState and make
- */
- goToStates: function (stateName) {
-
- SDL.SDLController.userStateAction();
- this.set('nextState', stateName);
- this.transitionTo(stateName);
- },
-
- /** Go to parent state */
- back: function () {
-
- if (this.currentState.parentState.hasOwnProperty('name')) {
- this.goToStates(this.currentState.parentState.get('path'));
- } else {
- this.goToStates('home');
- }
-
- SDL.StateVisitor.visit(this.currentState);
- },
-
- /** Home state */
- home: Em.State.create({
-
- }),
-
- /** Climate state */
- climate: Em.State.create({
-
- }),
-
- /** info state */
- info: Em.State.create({
-
- exit: function () {
-
- SDL.InfoController.set('activeState', SDL.States.currentState.get('path'));
- this._super();
- },
-
- services: Em.State.create({
-
- }),
-
- travelLink: Em.State.create({
-
- }),
-
- alerts: Em.State.create({
-
- }),
-
- calendar: Em.State.create({
-
- }),
-
- apps: Em.State.create({
-
- /**
- * Calls function from BasicCommunicationRPC to get new list of
- * applications
- */
- enter: function () {
-
- this._super();
- FFW.BasicCommunication.OnFindApplications();
- }
- }),
-
- devicelist: Em.State.create({
- /**
- * Calls function to clear device list on DeviceListView
- */
- enter: function () {
-
- this._super();
- SDL.DeviceListView.clearDeviceList();
- FFW.BasicCommunication.OnStartDeviceDiscovery();
- }
- }),
-
- nonMedia: Em.State.create({
-
- enter: function () {
-
- this._super();
- SDL.SDLController.activateTBT();
- },
-
- exit: function () {
-
- this._super();
-
- SDL.SDLAppController.deactivateApp();
- }
- })
- }),
-
- /** settings state */
- settings: Em.State.create({
-
- exit: function () {
-
- SDL.SettingsController.set('activeState', SDL.States.currentState.get('path'));
- this._super();
- },
-
- policies: Em.State.create({
- statisticsInfo: Em.State.create({
-
- }),
-
- deviceConfig: Em.State.create({
-
- enter: function () {
-
- this._super();
- SDL.DeviceConfigView.showDeviceList();
- }
- }),
-
- appPermissionsList: Em.State.create({
-
- enter: function () {
-
- this._super();
-
- }
- }),
-
- appPermissions: Em.State.create({
-
- }),
-
- systemError: Em.State.create({
-
- }),
-
- deviceStateChange: Em.State.create({
-
- enter: function () {
-
- this._super();
- SDL.DeviceStateChangeView.showDeviceList();
- }
- })
- })
- }),
-
- /** Media state */
- media: Em.State.create({
-
- exit: function () {
-
- SDL.MediaController.set('activeState', SDL.States.currentState.get('path'));
- this._super();
- },
-
- player: Em.State.create({
-
- enter: function () {
-
- this._super();
- if (SDL.SDLModel.stateLimited) {
-
- FFW.BasicCommunication.OnAppDeactivated('AUDIO', SDL.SDLModel.stateLimited);
- SDL.SDLModel.stateLimited = null;
- SDL.SDLModel.set('limitedExist', false);
- }
- }
- }),
-
- sdlmedia: Em.State.create({
-
- enter: function () {
-
- this._super();
- SDL.SDLController.activateTBT();
- },
-
- exit: function () {
-
- this._super();
-
- SDL.SDLModel.stateLimited = SDL.SDLAppController.model.appID;
- SDL.SDLModel.set('limitedExist', true);
- SDL.SDLAppController.deactivateApp();
- }
-
- })
- }),
-
- navigationApp: Em.State.create({
-
- baseNavigation: Em.State.create({
-
- }),
-
- exit: function () {
-
- this._super();
-
- SDL.SDLModel.stateLimited = SDL.SDLAppController.model.appID;
- SDL.SDLModel.set('limitedExist', true);
- SDL.SDLAppController.deactivateApp();
- }
- }),
-
- /** Navigation state */
- navigation: Em.State.create({
-
- }),
-
- /** Phone state */
- phone: Em.State.create({
-
- dialpad: Em.State.create({
-
- })
- })
-});
diff --git a/src/components/HMI/app/controller/AppController.js b/src/components/HMI/app/controller/AppController.js
deleted file mode 100644
index c655463391..0000000000
--- a/src/components/HMI/app/controller/AppController.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.AppController
- * @desc App general logic
- * @category Controller
- * @filesource app/controller/AppController.js
- * @version 1.0
- */
-
-SDL.AppController = Em.Object.create( {
- active: false
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/InfoController.js b/src/components/HMI/app/controller/InfoController.js
deleted file mode 100644
index 8ad129dd4f..0000000000
--- a/src/components/HMI/app/controller/InfoController.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InfoController
- * @desc Info Controller logic
- * @category Controller
- * @filesource app/controller/InfoController.js
- * @version 1.0
- */
-
-SDL.InfoController = Em.Object.create( {
-
- activeState: 'info.apps',
-
- hiddenLeftMenu: false,
-
- onState: function(event) {
-
- SDL.States.goToStates('info.' + event.goToState);
- },
-
- onChildState: function(event) {
-
- SDL.States.goToStates(SDL.States.currentState.get('path') + '.'
- + event.goToState);
- },
-
- /**
- * Switching on Application
- */
- turnOnSDL: function () {
-
- //SDL.CDModel.set('active', false);
- /**
- * Set SDL Data active, flag for status bar
- */
- if (SDL.SDLAppController.model) {
- SDL.SDLAppController.model.set('active', true);
- }
- /**
- * Go to SDL state
- */
- if (SDL.SDLAppController.model.appType) {
- for (var i = 0; i < SDL.SDLAppController.model.appType.length; i++) {
- if (SDL.SDLAppController.model.appType[i] == "NAVIGATION") {
- SDL.BaseNavigationView.update();
- SDL.States.goToStates('navigationApp.baseNavigation');
- return;
- }
- }
- }
-
- SDL.States.goToStates('info.nonMedia');
- //SDL.States.goToStates('media.sdlmedia');
-
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/MediaController.js b/src/components/HMI/app/controller/MediaController.js
deleted file mode 100644
index 45b46437be..0000000000
--- a/src/components/HMI/app/controller/MediaController.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.MediaController
- * @desc Media module logic
- * @category Controller
- * @filesource app/controller/MediaController.js
- * @version 1.0
- */
-SDL.MediaController = Em.Object.create({
-
- /**
- * Initial substate
- */
- activeState: 'media.player',
-
- /**
- * Turn on CD
- */
- turnOnCD: function () {
-
- if (!SDL.States.media.player.active) {
- SDL.States.goToStates('media.player');
- }
-
- if (SDL.SDLAppController.model) {
- SDL.SDLAppController.model.set('active', false);
- }
- SDL.CDModel.set('active', true);
- },
-
- /**
- * Switching on Application
- */
- turnOnSDL: function () {
-
- SDL.CDModel.set('active', false);
- /**
- * Set SDL Data active, flag for status bar
- */
- if (SDL.SDLAppController.model) {
- SDL.SDLAppController.model.set('active', true);
- }
- /**
- * Go to SDL state
- */
- if (SDL.SDLAppController.model.appType) {
- for (var i = 0; i < SDL.SDLAppController.model.appType.length; i++) {
- if (SDL.SDLAppController.model.appType[i] == "NAVIGATION") {
- SDL.BaseNavigationView.update();
- SDL.States.goToStates('navigationApp.baseNavigation');
- return;
- }
- }
- }
-
- SDL.States.goToStates('media.sdlmedia');
-
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/PhoneController.js b/src/components/HMI/app/controller/PhoneController.js
deleted file mode 100644
index c29cae064d..0000000000
--- a/src/components/HMI/app/controller/PhoneController.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PhoneController
- * @desc Phone module logic
- * @category Controller
- * @filesource app/controller/PhoneController.js
- * @version 1.0
- */
-
-SDL.PhoneController = Em.Object.create( {
-
- /**
- * Model binding
- */
- modelBinding: "SDL.PhoneModel",
-
- /**
- * Dialpad delete key press handeler
- */
- onDelete: function() {
-
- this.model.deleteDialpadNumber();
- },
-
- /**
- * Dial call handeler
- */
- onEndCall: function() {
-
- FFW.BasicCommunication.OnPhoneCall(false);
- this.model.endCall();
- },
-
- /**
- * Dial call handeler
- */
- onDialCall: function() {
-
- FFW.BasicCommunication.OnPhoneCall(true);
- this.model.dialCall();
- },
-
- /**
- * Dialpad key press handler
- */
- keyPress: function(element) {
- this.model.setDialpadNumber(element.text)
- },
-
- /**
- *
- */
- incomingCall: function(request) {
-
- this.model.setDialpadNumber(request.params.number);
- this.onDialCall();
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controller/SettingsController.js b/src/components/HMI/app/controller/SettingsController.js
deleted file mode 100644
index 32f4e4762a..0000000000
--- a/src/components/HMI/app/controller/SettingsController.js
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SettingsController
- * @desc Info Controller logic
- * @category Controller
- * @filesource app/controller/SettingsController.js
- * @version 1.0
- */
-
-SDL.SettingsController = Em.Object.create( {
-
- activeState: 'settings.policies',
-
- hiddenLeftMenu: false,
-
- /**
- * File name for SDL.OnSystemRequest
- * Came in SDL.PolicyUpdate request
- */
- policyUpdateFile: null,
-
- /**
- * Data of current requested devices which access will be allowed or disallowed.
- */
- currentDeviceAllowance: null,
-
- onState: function(event) {
-
- SDL.States.goToStates('settings.' + event.goToState);
- },
-
- onChildState: function(event) {
-
- SDL.States.goToStates(SDL.States.currentState.get('path') + '.'
- + event.goToState);
- },
-
- getStatusUpdate: function(){
- FFW.BasicCommunication.GetStatusUpdate();
- },
-
- phoneCall: function() {
-
- FFW.BasicCommunication.OnPhoneCall(true);
-
- SDL.SDLModel.phoneCallActive = true;
-
- var appID = null;
-
- if (SDL.SDLAppController.model) {
- appID = SDL.SDLAppController.model.appID;
- }
-
-
- if (appID) {
- SDL.SDLModel.onDeactivateApp('call', appID);
- SDL.States.goToStates('phone.dialpad');
-
- setTimeout(function () {
- FFW.BasicCommunication.OnPhoneCall(false);
- SDL.SDLController.getApplicationModel(appID).turnOnSDL(appID);
- SDL.SDLModel.phoneCallActive = false;
- }, 5000); //Magic number - 5 seconds timeout for emulating conversation call
- } else {
- setTimeout(function () {
- FFW.BasicCommunication.OnPhoneCall(false);
- SDL.SDLModel.phoneCallActive = false;
- }, 5000); //Magic number - 5 seconds timeout for emulating conversation call
- }
- },
-
- allDeviceAccess: function(){
-
- var allowedValue, allowedText;
-
- if (SDL.DeviceConfigView.globalConfigurationValue) {
- SDL.DeviceConfigView.set('globalConfigurationValue', false);
- allowedValue = false;
- allowedText = " - Not allowed";
- } else {
- SDL.DeviceConfigView.set('globalConfigurationValue', true);
- allowedValue = true;
- allowedText = " - Allowed";
- }
-
- var dev = SDL.SDLModel.connectedDevices;
- for (var key in dev) {
- if (dev.hasOwnProperty(key)) {
- dev[key].allowed = allowedValue;
- }
- }
-
- SDL.DeviceConfigView.showDeviceList();
-
- FFW.BasicCommunication.OnAllowSDLFunctionality(allowedValue, "GUI");
- },
-
- changeDeviceAccess: function(event) {
-
- var dev = SDL.SDLModel.connectedDevices;
- for (var key in dev) {
-
- if (dev.hasOwnProperty(key)) {
-
- if (dev[key].id == event.id) {
-
- if (dev[key].allowed) {
-
- dev[key].allowed = false;
- event.set('text', event.name + " - Not allowed");
- } else {
-
- dev[key].allowed = true;
- event.set('text', event.name + " - Allowed");
- }
-
- var device = {
- "name": dev[key].name,
- "id": dev[key].id
- };
-
- SDL.DeviceConfigView.set('globalConfigurationValue', null);
-
- FFW.BasicCommunication.OnAllowSDLFunctionality(dev[key].allowed, "GUI", device);
- break;
- }
- }
- }
- },
-
- changeAppPermission: function(element) {
-
- if (element.allowed) {
-
- element.allowed = false;
- element.set('text', element.name + " - Not allowed");
- } else {
-
- element.allowed = true;
- element.set('text', element.name + " - Allowed");
- }
- },
-
- /**
- * Method to send request to update array with app permissions
- *
- * @param {Object} element
- *
- */
- GetListOfPermissions: function(element) {
- FFW.BasicCommunication.GetListOfPermissions(element.appID);
- },
-
- /**
- * Method to update array with app permissions which came from SDL
- *
- * @param {Object} message
- *
- */
- GetListOfPermissionsResponse: function(message) {
-
- if (message.id in SDL.SDLModel.getListOfPermissionsPull) {
-
- var appID = SDL.SDLModel.getListOfPermissionsPull[message.id],
- messageCodes = [];
-
- for (var i = 0; i < message.result.allowedFunctions.length; i++) {
- messageCodes.push(message.result.allowedFunctions[i].name);
- }
-
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.permissionsFriendlyMessageUpdate, appID, messageCodes);
-
- SDL.AppPermissionsView.update(message.result.allowedFunctions, appID);
-
- delete SDL.SDLModel.getListOfPermissionsPull[message.id];
- }
- },
-
- /**
- * Method to update array with app permissions with UserFriendlyMessage from SDL
- *
- * @param {Object} message
- *
- */
- permissionsFriendlyMessageUpdate: function(message) {
-
-
- SDL.SettingsController.simpleParseUserFriendlyMessageData(message);
-
- SDL.States.goToStates('settings.policies.appPermissions');
-
- },
-
- updateSDL: function() {
- FFW.BasicCommunication.UpdateSDL();
- },
-
- getURLS: function() {
- FFW.BasicCommunication.GetURLS(7);
- },
-
- AllowSDLFunctionality: function(messages) {
-
- 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);
- }
-
- },
-
- userFriendlyMessagePopUp: function(appId, messageCode) {
-
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appId, messageCode);
- },
-
- simpleParseUserFriendlyMessageData: function (messages, func) {
- var tts = "",
- text = "";
-
- messages.forEach(function (x) {
- if (x.ttsString) {
- tts += x.ttsString;
- }
- if (x.textBody) {
- text += x.textBody;
- }
- if (x.line1) {
- text += x.line1;
- }
- if (x.line2) {
- text += x.line2;
- }
- });
-
- if (tts) {
- SDL.TTSPopUp.ActivateTTS(tts);
- }
-
-
- if (text) {
- SDL.PopUp.create().appendTo('body').popupActivate(text, func);
- }
- },
-
- OnAllowSDLFunctionality: function(result) {
-
- var dev = SDL.SDLModel.connectedDevices;
- for (var key in dev) {
- if (dev.hasOwnProperty(key)) {
- if (dev[key].id == SDL.SettingsController.currentDeviceAllowance.id) {
- dev[key].allowed = result;
- }
- }
- }
-
- SDL.DeviceConfigView.set('globalConfigurationValue', null);
-
- SDL.DeviceConfigView.showDeviceList();
-
- FFW.BasicCommunication.OnAllowSDLFunctionality(result, "GUI", SDL.SettingsController.currentDeviceAllowance);
-
- SDL.SDLModel.connectedDevices[SDL.SettingsController.currentDeviceAllowance.id].sdlFunctionality.allowed = result;
-
- SDL.SDLModel.connectedDevices[SDL.SettingsController.currentDeviceAllowance.id].sdlFunctionality.popUpId = null;
-
- SDL.SettingsController.currentDeviceAllowance = null;
- },
-
- /**
- * Method responsible for PolicyUpdate retry sequence
- * abort parameter if set to true means that retry sequence if finished
- *
- * @param {Boolean} abort
- */
- policyUpdateRetry: function(abort) {
-
- clearTimeout(SDL.SDLModel.policyUpdateRetry.timer);
- SDL.SDLModel.policyUpdateRetry.timer = null;
-
- if (abort !== "ABORT" && (SDL.SDLModel.policyUpdateRetry.try < SDL.SDLModel.policyUpdateRetry.retry.length)) {
-
- SDL.SDLModel.policyUpdateRetry.oldTimer = SDL.SDLModel.policyUpdateRetry.oldTimer +
- SDL.SDLModel.policyUpdateRetry.timeout * 1000 +
- SDL.SDLModel.policyUpdateRetry.retry[SDL.SDLModel.policyUpdateRetry.try] * 1000;
-
- SDL.SDLModel.policyUpdateRetry.timer = setTimeout(
- function(){
- FFW.BasicCommunication.OnSystemRequest(
- "PROPRIETARY",
- SDL.SDLModel.policyURLs[0].policyAppId,
- SDL.SettingsController.policyUpdateFile,
- SDL.SDLModel.policyURLs[0].url
- );
- SDL.SettingsController.policyUpdateRetry();
- }, SDL.SDLModel.policyUpdateRetry.oldTimer
- );
-
- SDL.SDLModel.policyUpdateRetry.try++;
- } else {
- clearTimeout(SDL.SDLModel.policyUpdateRetry.timer);
- SDL.SDLModel.policyUpdateRetry = {
- timeout: null,
- retry: [],
- try: null,
- timer: null,
- oldTimer: 0
- };
- }
- }
-});
diff --git a/src/components/HMI/app/controller/sdl/AppController.js b/src/components/HMI/app/controller/sdl/AppController.js
deleted file mode 100644
index 9cf5d1f153..0000000000
--- a/src/components/HMI/app/controller/sdl/AppController.js
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLAppController
- * @desc SDL abstract application controller
- * @category Controller
- * @filesource app/controller/sdl/AppController.js
- * @version 1.0
- */
-
-SDL.SDLAppController = Em.Object.create({
-
- init: function () {
-
- this._super();
-
- //FFW.UI.set('isReady', true);
- //FFW.Navigation.set('isReady', true);
- },
-
- /**
- * Active application model binding type {SDLAppModel}
- */
- model: null,
-
- /**
- * Function to add application to application list
- */
- showAppList: function() {
-
- SDL.AppPermissionsListView.showAppList();
- }.observes('SDL.SDLModel.registeredApps.@each'),
-
- /**
- * Handeler for command button press
- *
- * @param element:
- * SDL.Button
- */
- onCommand: function (element) {
-
- if (element.commandID < 0) {
-
- switch (element.commandID) {
- case -1: {
- FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID, "DRIVER_DISTRACTION_VIOLATION");
- break;
- }
- case -2: {
- FFW.BasicCommunication.ExitApplication(SDL.SDLAppController.model.appID, "USER_EXIT");
- break;
- }
- default: {
- console.log("Unknown command with ID: " + element.commandID);
- }
- }
-
- SDL.OptionsView.deactivate();
- SDL.States.goToStates('info.apps');
-
- } else if (element.menuID >= 0) {
-
- // if subMenu
- // activate driver destruction if necessary
- if (SDL.SDLModel.driverDistractionState) {
- SDL.DriverDistraction.activate();
- } else {
- this.onSubMenu(element.menuID);
- }
-
- return;
- } else {
-
- FFW.UI.onCommand(element.commandID, this.model.appID);
- SDL.OptionsView.deactivate();
- }
- },
-
- /**
- * Handeler for VR command button press
- *
- * @param element: SDL.Button
- */
- VRPerformAction: function (element) {
-
- SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode["SUCCESS"], element.commandID);
-
- if (SDL.SDLModel.VRActive) {
- SDL.SDLModel.toggleProperty('VRActive');
- }
- },
-
- /**
- * Open commands submenu
- *
- * @param {Number}
- */
- onSubMenu: function (id) {
-
- this.model.set('currentSubMenuId', id);
- },
-
- /**
- * Comparison function for sort array of buttons in options list by 'position' parameter
- *
- * @param {Number}
- */
- buttonsSort: function (arrayId, appID) {
-
- SDL.SDLController.getApplicationModel(appID).commandsList[arrayId].sort(function (a, b) {
- return a.position - b.position;
- })
- },
-
- /**
- * Handeler for command button press
- *
- * @param element:
- * SDL.Button
- */
- onVRCommand: function (element) {
-
- if (SDL.SDLModel.VRActive) {
- SDL.SDLModel.toggleProperty('VRActive');
- }
- FFW.VR.onCommand(element.commandID, element.appID);
- },
-
- /**
- * Handler for preform interaction choice send response to device and
- * deactivate interactions window
- *
- * @param element:
- * SDL.Button
- */
- onChoiceInteraction: function (element) {
-
- SDL.InteractionChoicesView.deactivate("SUCCESS", element.choiceID);
- },
-
- /**
- * Handeler for Navigation preform interaction choice send response to device and
- * deactivate interactions window
- *
- * @param {Object}
- */
- onChoiceNaviInteraction: function(element) {
-
- SDL.SDLModel.uiShowKeyboard();
-
- FFW.UI.interactionResponse(SDL.SDLModel.resultCode["SUCCESS"], element.choiceID);
-
- SDL.InteractionChoicesView.deactivate("SUCCESS");
- },
-
- /**
- * Open commands list
- */
- openCommandsList: function () {
-
- SDL.OptionsView.activate();
- },
-
- /**
- * Notification of deactivation of current application model initiated in
- * StateManager
- */
- deactivateApp: function () {
-
- if (this.model) {
- SDL.SDLModel.onDeactivateApp(SDL.States.nextState, this.model.appID);
- }
-
- SDL.SDLAppController.onSubMenu('top');
- SDL.SDLAppController.model.set('tbtActivate', false);
- this.set('model', null);
- },
-
- /**
- * Method clears all applications data and unregister models
- */
- onSDLDisconected: function () {
-
- var i = 0, apps = SDL.SDLModel.registeredApps;
-
- for (i = 0; i < apps.length; i++) {
- SDL.SDLModel.onAppUnregistered({
- "appID": apps[i].appID
- });
- }
- }
-});
diff --git a/src/components/HMI/app/controller/sdl/Controller.js b/src/components/HMI/app/controller/sdl/Controller.js
deleted file mode 100644
index e33656ecf4..0000000000
--- a/src/components/HMI/app/controller/sdl/Controller.js
+++ /dev/null
@@ -1,942 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLController
- * @desc Main SDL Controller
- * @category Controller
- * @filesource app/controller/sdl/SDLController.js
- * @version 1.0
- */
-SDL.SDLController = Em.Object
- .create( {
-
- init: function () {
-
- /**
- * Added object size counter
- */
- Object.size = function(obj) {
- var size = 0, key;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) size++;
- }
- return size;
- }
-
- },
-
- /**
- * Current system context
- *
- * @type {String}
- */
- sysContext: function() {
-
- if (SDL.SDLModel.VRActive) {
- return 'VRSESSION';
- }
- if (SDL.AlertPopUp.active) {
- return 'ALERT';
- }
- if ( SDL.SliderView.active
- || SDL.InteractionChoicesView.active
- || SDL.ScrollableMessage.active
- || SDL.SDLModel.AudioPassThruState
- || SDL.Keyboard.active) {
-
- return 'HMI_OBSCURED';
- }
- if (SDL.OptionsView.active) {
- return 'MENU';
- }
-
- return 'MAIN';
-
- }.property('SDL.OptionsView.active',
- 'SDL.SliderView.active',
- 'SDL.SDLModel.AudioPassThruState',
- 'SDL.SDLModel.VRActive',
- 'SDL.AlertPopUp.active',
- 'SDL.States.info.nonMedia.active',
- 'SDL.States.media.sdlmedia.active',
- 'SDL.States.navigationApp.baseNavigation.active',
- 'SDL.ScrollableMessage.active',
- 'SDL.InteractionChoicesView.active',
- 'SDL.VRHelpListView.active',
- 'SDL.Keyboard.active'),
-
- /**
- * Flag consider that previously alert request was received from SDL for app in BACKGROUND HMI level
- * the applications appID will be stashed as current value
- *
- * @type number
- */
- backgroundAlertAppID: null,
-
- /**
- * List of SDL application models
- *
- * @type object
- */
- applicationModels: {
- 0: SDL.SDLMediaModel,
- 1: SDL.SDLNonMediaModel
- },
-
- /**
- * Registered components handler
- *
- * @type object
- */
- activateTBT: function(){
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.tbtActivate) {
- SDL.TurnByTurnView.activate(SDL.SDLAppController.model.appID);
- }
- },
-
- /**
- * Registered components handler
- *
- * @type object
- */
- registeredComponentStatus: function(component) {
-
- for ( var i = 0; i < SDL.SDLModel.registeredComponents.length; i++) {
- if (SDL.SDLModel.registeredComponents[i].type == component) {
- SDL.SDLModel.set('registeredComponents.' + i + '.state', true);
- return;
- }
- }
- },
-
- /**
- * Registered components handler
- *
- * @type object
- */
- unregisterComponentStatus: function(component) {
-
- for ( var i = 0; i < SDL.SDLModel.registeredComponents.length; i++) {
- if (SDL.SDLModel.registeredComponents[i].type == component) {
- SDL.SDLModel.set('registeredComponents.' + i + '.state', false);
- return;
- }
- }
- },
-
- /**
- * Notification from state manager about triggered state
- * Method aborts all popups and requests currently in process
- *
- * @type object
- */
- triggerState: function(){
- if (SDL.SliderView.active) {
- SDL.SliderView.deactivate(false);
- }
- },
-
- /**
- * Notify SDLCore that HMI is ready and all components are registered
- *
- * @type {String}
- */
- componentsReadiness: function(component) {
-
- for ( var i = 0; i < SDL.SDLModel.registeredComponents.length; i++) {
- if (!SDL.SDLModel.registeredComponents[i].state) {
- return;
- }
- }
- FFW.BasicCommunication.onReady();
- SDL.SDLModel.timeStamp = new Date().getTime();
-
- console.log(SDL.SDLModel.timeStamp);
-
- }.observes('SDL.SDLModel.registeredComponents.@each.state'),
-
- /**
- * Show VrHelpItems popup with necessary params
- * if VRPopUp is active - show data from Global Properties
- * if VRPopUp and InteractionChoicesView are active - show data from PerformInteraction request
- *
- */
- showVRHelpItems: function() {
-
- if (SDL.SDLAppController.model) {
- if (SDL.SDLModel.VRActive && SDL.SDLModel.interactionData.vrHelp) {
-
- SDL.SDLModel.ShowVrHelp(SDL.SDLModel.interactionData.vrHelpTitle, SDL.SDLModel.interactionData.vrHelp);
- } else if (SDL.SDLModel.VRActive && !SDL.SDLModel.interactionData.vrHelp && SDL.SDLAppController.model.globalProperties.vrHelp) {
-
- if (SDL.SDLAppController.model) {
- SDL.SDLModel.ShowVrHelp(SDL.SDLAppController.model.globalProperties.vrHelpTitle, SDL.SDLAppController.model.globalProperties.vrHelp );
- }
- } else {
- if (SDL.VRHelpListView.active) {
- SDL.VRHelpListView.deactivate();
- }
- }
- } else if (SDL.VRHelpListView.active) {
- SDL.VRHelpListView.deactivate();
- }
- }.observes('SDL.SDLModel.VRActive', 'SDL.SDLModel.interactionData.vrHelp'),
-
- /**
- * Handler for Help button in VR menu
- * triggers helpPrompt on HMI
- *
- */
- vrHelpAction: function() {
- if (SDL.SDLModel.interactionData.helpPrompt) {
- SDL.SDLModel.onPrompt(SDL.SDLModel.interactionData.helpPrompt);
- } else if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.helpPrompt.length) {
- SDL.SDLModel.onPrompt(SDL.SDLAppController.model.globalProperties.helpPrompt);
- }
- },
-
- /**
- * Notify SDLCore that TTS haas finished processing
- *
- * @type {String}
- */
- TTSResponseHandler: function() {
-
- if (FFW.TTS.requestId) {
- if (FFW.TTS.aborted) {
- FFW.TTS.sendError(SDL.SDLModel.resultCode["ABORTED"], FFW.TTS.requestId, "TTS.Speak", "TTS Speak request aborted");
- } else {
- FFW.TTS.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"], FFW.TTS.requestId, "TTS.Speak");
- }
- FFW.TTS.requestId = null;
- FFW.TTS.aborted = false;
- }
- },
-
- /**
- * Move VR list to right side when VRHelpList was activated
- *
- * @type {String}
- */
- VRMove: function() {
-
- if (SDL.VRHelpListView.active || SDL.InteractionChoicesView.active) {
- SDL.SDLModel.set('VRHelpListActivated', true);
- } else {
- SDL.SDLModel.set('VRHelpListActivated', false);
- }
- },
-
- /**
- * Activate navigationApp method to set navigationApp data to controlls on main screen
- */
- navigationAppUpdate: function() {
- SDL.BaseNavigationView.update(SDL.SDLAppController.model.appID);
- },
-
- /**
- * Default action for SoftButtons: closes window, popUp or clears
- * applications screen
- *
- * @param {Object}
- */
- defaultActionSoftButton: function(element) {
-
- switch (element.groupName) {
- case "AlertPopUp": {
- SDL.AlertPopUp.deactivate();
- break;
- }
- case "ScrollableMessage": {
- SDL.ScrollableMessage.deactivate(true);
- break;
- }
- }
- },
-
- /**
- * SDL notification call function
- * to notify that SDL Core should reset timeout for some method
- */
- onResetTimeout: function (appID, methodName) {
- FFW.UI.onResetTimeout(appID, methodName);
- },
- /**
- * Action to show Voice Recognition PopUp
- */
- 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
- * applications screen
- *
- * @param {Object}
- */
- stealFocusSoftButton: function(element) {
-
- switch (element.groupName) {
- case "AlertPopUp": {
- SDL.AlertPopUp.deactivate();
- this.onActivateSDLApp(element);
- break;
- }
- case "ScrollableMessage": {
- SDL.ScrollableMessage.deactivate();
- this.onActivateSDLApp(element);
- break;
- }
- }
- },
- /**
- * Action for SoftButtons that clears popUps timer and it become visible
- * all the time until user user closes it
- *
- * @param {Object}
- */
- keepContextSoftButton: function(element) {
-
- switch (element.groupName) {
- case "AlertPopUp": {
- clearTimeout(SDL.AlertPopUp.timer);
- SDL.AlertPopUp.timer = setTimeout(function() {
- SDL.AlertPopUp.deactivate();
- }, SDL.AlertPopUp.timeout);
- this.onResetTimeout(element.appID, "UI.Alert");
- break;
- }
- case "ScrollableMessage": {
- clearTimeout(SDL.ScrollableMessage.timer);
- SDL.ScrollableMessage.timer = setTimeout(function() {
- SDL.ScrollableMessage.deactivate();
- }, SDL.ScrollableMessage.timeout);
- this.onResetTimeout(element.appID, "UI.ScrollableMessage");
- break;
- }
- }
- },
- /**
- * Action for ClosePopUp request that triggers deactivate function from
- * opened popUp
- */
- closePopUp: function(methodName) {
-
- if (methodName == "UI.Alert") {
- SDL.AlertPopUp.deactivate();
- }
- if (methodName == "UI.PerformAudioPassThru") {
- SDL.AudioPassThruPopUp.deactivate();
- this.performAudioPassThruResponse(SDL.SDLModel.resultCode["SUCCESS"]);
- }
- if (methodName == "UI.PerformInteraction") {
- SDL.InteractionChoicesView.deactivate("ABORTED");
- }
- if (methodName == "UI.ScrollableMessage") {
- SDL.ScrollableMessage.deactivate(true);
- }
- if (methodName == "UI.Slider") {
- SDL.SliderView.deactivate(true);
- }
-// if (SDL.VRHelpListView.active) {
-// SDL.VRHelpListView.deactivate();
-// }
- },
-
- /**
- * Method to close InteractionChoices view
- */
- InteractionChoicesDeactivate: function() {
-
- SDL.InteractionChoicesView.deactivate("ABORTED");
- },
-
- /**
- * Method to close AlertMeneuverPopUp view
- */
- closeAlertMeneuverPopUp: function() {
-
- SDL.AlertManeuverPopUp.set('activate', false);
- },
- /**
- * Method to open Turn List view from TBT
- *
- * @param {Number}
- * appID AppID of activated sdl application
- */
- tbtTurnList: function(appID) {
-
- SDL.TBTTurnList.activate(appID);
- },
- /**
- * Method to sent notification with selected state of TBT Client State
- *
- * @param {String}
- */
- tbtClientStateSelected: function(state) {
-
- FFW.Navigation.onTBTClientState(state);
- },
- /**
- * Method to sent notification with selected reason of Exit Application
- *
- * @param {String}
- */
- exitAppViewSelected: function(state) {
-
- //if ignition off if executed than OnIgnitionCycleOver must be sent
- if (state == SDL.SDLModel.exitAppState[0].name) {
-
- FFW.BasicCommunication.OnIgnitionCycleOver();
- }
-
- 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}
- */
- systemRequestViewSelected: function(state) {
-
- if (SDL.SDLModel.policyURLs.length) {
- FFW.BasicCommunication.OnSystemRequest(state, SDL.SDLModel.policyURLs[0].policyAppId, null, SDL.SDLModel.policyURLs[0].url);
- } else {
- FFW.BasicCommunication.OnSystemRequest(state);
- }
-
- },
- /**
- * Method to sent notification ABORTED for PerformInteractionChoise
- */
- interactionChoiseCloseResponse: function(appID, result, choiceID, manualTextEntry) {
-
- FFW.UI.interactionResponse(SDL.SDLController.getApplicationModel(appID).activeRequests.uiPerformInteraction, result, choiceID, manualTextEntry);
- SDL.SDLModel.set('interactionData.vrHelpTitle', null);
- SDL.SDLModel.set('interactionData.vrHelp', null);
-
- SDL.SDLController.getApplicationModel(appID).activeRequests.uiPerformInteraction = null;
-
- if (SDL.TTSPopUp.active && FFW.TTS.requestId == null) {
- SDL.TTSPopUp.DeactivateTTS();
- }
- },
- /**
- * Method to sent notification ABORTED for VR PerformInteraction
- */
- vrInteractionResponse: function(result, choiceID) {
-
- FFW.VR.interactionResponse(SDL.SDLModel.vrActiveRequests.vrPerformInteraction, result, choiceID);
-
- SDL.SDLModel.vrActiveRequests.vrPerformInteraction = null;
-
- SDL.SDLModel.set('VRActive', false);
-
- SDL.InteractionChoicesView.timerUpdate();
-
- if (choiceID && SDL.TTSPopUp.active && FFW.TTS.requestId == null) {
- SDL.TTSPopUp.DeactivateTTS();
- }
-
- SDL.SDLModel.interactionData.helpPrompt = null;
- },
- /**
- * Method to sent notification for Alert
- *
- * @param {String}
- * result
- * @param {Number}
- * alertRequestID
- */
- alertResponse: function(result, alertRequestID) {
-
- FFW.UI.alertResponse(result, alertRequestID);
- },
- /**
- * Method to sent notification for Scrollable Message
- *
- * @param {String}
- * result
- * @param {Number}
- * messageRequestId
- */
- scrollableMessageResponse: function(result, messageRequestId) {
-
- if (result == SDL.SDLModel.resultCode['SUCCESS']) {
- FFW.UI.sendUIResult(result,
- messageRequestId,
- 'UI.ScrollableMessage');
- } else {
- FFW.UI.sendError(result,
- messageRequestId,
- 'UI.ScrollableMessage',
- "ScrollableMessage aborted!");
- }
- },
- /**
- * Method to do necessary actions when user navigate throught the menu
- */
- userStateAction: function() {
- if (SDL.ScrollableMessage.active) {
- SDL.ScrollableMessage.deactivate(true);
- }
- },
- /**
- * Method to sent notification for Slider
- *
- * @param {String}
- * result
- * @param {Number}
- * sliderRequestId
- */
- sliderResponse: function(result, sliderRequestId) {
-
- FFW.UI.sendUIResult(result, sliderRequestId, 'UI.Slider');
- },
- /**
- * Method to call performAudioPassThruResponse with Result code
- * parameters
- *
- * @param {Object}
- * element Button object
- */
- callPerformAudioPassThruPopUpResponse: function(element) {
-
- this.performAudioPassThruResponse(element.responseResult);
- },
- /**
- * Method close PerformAudioPassThruPopUp and call response from UI RPC
- * back to SDLCore
- *
- * @param {String}
- * result Result code
- */
- performAudioPassThruResponse: function(result) {
-
- SDL.SDLModel.set('AudioPassThruState', false);
- FFW.UI.sendUIResult(result,
- FFW.UI.performAudioPassThruRequestID,
- "UI.PerformAudioPassThru");
- FFW.UI.performAudioPassThruRequestID = -1;
- },
- /**
- * Method close PerformAudioPassThruPopUp and call error response from
- * UI RPC back to SDLCore
- *
- * @param {String}
- * result Result code
- */
- callPerformAudioPassThruPopUpErrorResponse: function(element) {
-
- SDL.SDLModel.set('AudioPassThruState', false);
- FFW.UI.sendError(element.responseResult,
- FFW.UI.performAudioPassThruRequestID,
- "UI.PerformAudioPassThru",
- "PerformAudioPassThru was not completed successfuly!");
- FFW.UI.performAudioPassThruRequestID = -1;
- },
- /**
- * Method to set language for UI component with parameters sent from
- * SDLCore to UIRPC
- */
- onLanguageChangeUI: function() {
-
- FFW.UI.OnLanguageChange(SDL.SDLModel.hmiUILanguage);
- FFW.BasicCommunication.OnSystemInfoChanged(SDL.SDLModel.hmiUILanguage);
- }.observes('SDL.SDLModel.hmiUILanguage'),
- /**
- * Method to set language for TTS and VR components with parameters sent
- * from SDLCore to UIRPC
- */
- onLanguageChangeTTSVR: function() {
-
- FFW.TTS.OnLanguageChange(SDL.SDLModel.hmiTTSVRLanguage);
- FFW.VR.OnLanguageChange(SDL.SDLModel.hmiTTSVRLanguage);
- }.observes('SDL.SDLModel.hmiTTSVRLanguage'),
- /**
- * Register application
- *
- * @param {Object}
- * params
- * @param {Number}
- * applicationType
- */
- registerApplication: function(params, applicationType) {
-
- 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": {
- "menuParams":{
- "parentID": 0,
- "menuName": "Exit 'DRIVER_DISTRACTION_VIOLATION'",
- "position": 0
- },
- cmdID: -1
- }
- };
-
- SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
-
- exitCommand = {
- "id": -10,
- "params": {
- "menuParams":{
- "parentID": 0,
- "menuName": "Exit 'USER_EXIT'",
- "position": 0
- },
- cmdID: -2
- }
- };
-
- SDL.SDLController.getApplicationModel(params.appID).addCommand(exitCommand);
- },
- /**
- * Unregister application
- *
- * @param {Number}
- * appID
- */
- unregisterApplication: function(appID) {
-
- this.getApplicationModel(appID).VRCommands = [];
-
- this.getApplicationModel(appID).onDeleteApplication(appID);
-
- var len = SDL.SDLModel.VRCommands.length;
- for (var i = len - 1; i >= 0; i--) {
- if (SDL.SDLModel.VRCommands[i].appID == appID) {
- SDL.SDLModel.VRCommands.splice(i, 1);
- }
- }
-
- SDL.VRPopUp.DeleteActivateApp(appID);
- if (SDL.SDLModel.stateLimited == appID) {
- SDL.SDLModel.set('stateLimited', null);
- }
-
- if (SDL.VRHelpListView.active) {
- this.showVRHelpItems();
- }
- },
- /**
- * SDL Driver Distraction ON/OFF switcher
- */
- selectDriverDistraction: function() {
-
- if (SDL.SDLModel.driverDistractionState) {
- FFW.UI.onDriverDistraction("DD_ON");
- } else {
- FFW.UI.onDriverDistraction("DD_OFF");
- }
- }.observes('SDL.SDLModel.driverDistractionState'),
-
- /**
- * Ondisplay keyboard event handler
- * Sends notification on SDL Core with changed value
- */
- onKeyboardChanges: function() {
- if (null !== SDL.SDLModel.keyboardInputValue) {
-
- var str = SDL.SDLModel.keyboardInputValue;
-
- if (SDL.SDLAppController.model.globalProperties.keyboardProperties.keypressMode) {
- switch (SDL.SDLAppController.model.globalProperties.keyboardProperties.keypressMode) {
- case 'SINGLE_KEYPRESS':{
- FFW.UI.OnKeyboardInput(str.charAt( str.length-1 ), "KEYPRESS");
- break;
- }
- case 'QUEUE_KEYPRESS':{
- break;
- }
- case 'RESEND_CURRENT_ENTRY':{
- if (str) {
- FFW.UI.OnKeyboardInput(str, "KEYPRESS");
- }
- break;
- }
- }
- }
- }
- }.observes('SDL.SDLModel.keyboardInputValue'),
-
- /**
- * Get application model
- *
- * @param {Number}
- */
- getApplicationModel: function(applicationId) {
-
- return SDL.SDLModel.registeredApps.filterProperty('appID', applicationId)[0];
- },
- /**
- * Function returns ChangeDeviceView back to previous state
- */
- turnChangeDeviceViewBack: function() {
-
- SDL.States.goToStates('info.apps');
- },
- /**
- * Enter screen vith list of devices application model
- */
- onGetDeviceList: function() {
-
- SDL.States.goToStates('info.devicelist');
- SDL.SDLModel.set('deviceSearchProgress', true);
- },
- /**
- * Send notification if device was choosed
- *
- * @param element:
- * SDL.Button
- */
- onDeviceChoosed: function(element) {
-
- SDL.SDLModel.set('CurrDeviceInfo.name', element.deviceName);
- SDL.SDLModel.set('CurrDeviceInfo.id', element.id);
- FFW.BasicCommunication.OnDeviceChosen(element.deviceName,
- element.id);
- this.turnChangeDeviceViewBack();
- },
- /**
- * Method call's request to get list of applications
- */
- findNewApps: function() {
-
- FFW.BasicCommunication.OnFindApplications();
- },
- /**
- * Method activates selected registered application
- *
- * @param {Object}
- */
- onActivateSDLApp: function(element) {
-
- if (SDL.SDLModel.VRActive) {
- SDL.SDLModel.toggleProperty('VRActive');
- }
- FFW.BasicCommunication.ActivateApp(element.appID);
- },
- /**
- * Method sent custom softButtons pressed and event status to RPC
- *
- * @param {Object}
- */
- onSoftButtonActionUpCustom: function(element) {
-
- if (element.time > 0) {
- FFW.Buttons.buttonEventCustom(
- "CUSTOM_BUTTON",
- "BUTTONUP",
- element.softButtonID,
- element.appID
- );
- } else {
- FFW.Buttons.buttonEventCustom(
- "CUSTOM_BUTTON",
- "BUTTONUP",
- element.softButtonID,
- element.appID
- );
- FFW.Buttons.buttonPressedCustom(
- "CUSTOM_BUTTON",
- "SHORT",
- element.softButtonID,
- element.appID
- );
- }
- clearTimeout(element.timer);
- element.time = 0;
- },
- /**
- * Method sent custom softButtons pressed and event status to RPC
- *
- * @param {Object}
- */
- onSoftButtonActionDownCustom: function(element) {
-
- FFW.Buttons.buttonEventCustom(
- "CUSTOM_BUTTON",
- "BUTTONDOWN",
- element.softButtonID,
- element.appID
- );
- element.time = 0;
- element.timer = setTimeout(function() {
-
- FFW.Buttons.buttonPressedCustom(
- "CUSTOM_BUTTON",
- "LONG",
- element.softButtonID,
- element.appID
- );
- element.time++;
- }, 2000);
- },
- /**
- * Method sent softButtons pressed and event status to RPC
- *
- * @param {String}
- * @param {Object}
- */
- onSoftButtonActionUp: function(element) {
-
- if (element.time > 0) {
- FFW.Buttons.buttonEvent(element.presetName, "BUTTONUP");
- } else {
- FFW.Buttons.buttonEvent(element.presetName, "BUTTONUP");
- FFW.Buttons.buttonPressed(element.presetName, "SHORT");
- }
- clearTimeout(element.timer);
- element.time = 0;
- },
- /**
- * Method sent softButtons Ok pressed and event status to RPC
- *
- * @param {String}
- */
- onSoftButtonOkActionDown: function(name) {
-
- FFW.Buttons.buttonEvent(name, "BUTTONDOWN");
- },
- /**
- * Method sent softButton OK pressed and event status to RPC
- *
- * @param {String}
- */
- onSoftButtonOkActionUp: function(name) {
-
- FFW.Buttons.buttonEvent(name, "BUTTONUP");
- FFW.Buttons.buttonPressed(name, "SHORT");
- if (SDL.SDLAppController.model) {
- SDL.SDLAppController.model.set('isPlaying',
- !SDL.SDLAppController.model.isPlaying);
- }
- },
- /**
- * 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}
- * @param {Object}
- */
- onSoftButtonActionDown: function(element) {
-
- FFW.Buttons.buttonEvent(element.presetName, "BUTTONDOWN");
- element.time = 0;
- element.timer = setTimeout(function() {
-
- FFW.Buttons.buttonPressed(element.presetName, "LONG");
- element.time++;
- }, 2000);
- },
- /**
- * Send system context
- */
- onSystemContextChange: function(appID) {
-
- var sysContextValue = this.get('sysContext');
-
- if ((appID && SDL.SDLController.getApplicationModel(appID) != SDL.SDLAppController.model)
- || this.backgroundAlertAppID){
-
- if (SDL.SDLAppController.model == null
- || (SDL.SDLAppController.model.appID != appID
- && this.backgroundAlertAppID == null)) {
-
- this.backgroundAlertAppID = appID;
- FFW.UI.OnSystemContext(sysContextValue, appID);
- if (SDL.SDLAppController.model) {
- FFW.UI.OnSystemContext('HMI_OBSCURED', SDL.SDLAppController.model.appID);
- }
-
- } 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, appID);
- }
- } else {
- if (SDL.SDLAppController.model) {
- appID = SDL.SDLAppController.model.appID;
- } else {
- appID = null;
- }
-
- FFW.UI.OnSystemContext(sysContextValue, appID);
- }
- }
- });
diff --git a/src/components/HMI/app/controller/sdl/MediaController.js b/src/components/HMI/app/controller/sdl/MediaController.js
deleted file mode 100644
index b09d26b76f..0000000000
--- a/src/components/HMI/app/controller/sdl/MediaController.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLMediaController
- * @desc SDL Media Controller logic
- * @category Controller
- * @filesource app/controller/sdl/SDLMediaController.js
- * @version 1.0
- */
-
-SDL.SDLMediaController = Em.Object.create( {
-
- /**
- * Current Media application id
- *
- * @type {Number}
- */
- currentAppId: 0,
-
- /**
- * Return current Media application name used for application button
- */
- currentAppName: function() {
-
- if (this.currentAppId) {
- return SDL.SDLController.getApplicationModel(this.currentAppId).appName;
- }
- }.property('this.currentAppId'),
-
- /**
- * Return current Media application icon used for application button
- */
- currentAppIcon: function() {
-
- if (this.currentAppId) { return SDL.SDLController
- .getApplicationModel(this.currentAppId).appIcon; }
- }.property('this.currentAppId', 'SDL.SDLAppController.model.appIcon'),
-
- /** Call notification OnCommand on UIRPC */
- onCommand: function(element) {
-
- FFW.UI.onCommand(element.commandID, element.appID);
- },
-
- /** Call notification OnCommandSoftButton on UIRPC */
- onCommandSoftButton: function(element) {
-
- FFW.UI.onCommandSoftButton(element.softButtonID, element.appID);
- },
-
- /** Switching on Application */
- activateApp: function(applicationModel) {
-
- // store active application id
- this.set('currentAppId', applicationModel.appID);
-
- // set active model
- SDL.SDLAppController.set('model', applicationModel);
-
- SDL.MediaController.turnOnSDL();
-
- },
-
- /**
- * Restore current application to active state
- */
- activateCurrentApp: function() {
-
- FFW.BasicCommunication.OnAppActivated(this.currentAppId);
- },
-
- /** SDL perform interaction action from VR */
- onVRPerformInteractionChoosed: function(element) {
-
- if (SDL.States.media.sdl.sdlperforminteractionchoise.active) {
- FFW.VR.onChoise(element.choiceID);
- SDL.States.back();
- }
-
- },
-
- /** SDL perform interaction action */
- onPerformInteractionChoosed: function(element) {
-
- if (SDL.States.media.sdl.sdlperforminteractionchoise.active) {
- FFW.UI.interactionResponse("SUCCESS", element.choiceID);
- SDL.States.back();
- }
-
- },
-
- /**
- * Method hides sdl activation button and sdl application
- *
- * @param {Number}
- */
- onDeleteApplication: function(appID) {
-
- if (this.currentAppId == appID) {
-
- if (SDL.States.media.sdlmedia.active
- || SDL.SDLAppController.model) {
-
- SDL.SDLController.getApplicationModel(appID).set('active', false);
-
- SDL.States.goToStates('info.apps');
-
- SDL.MediaController.set('activeState', 'media.player');
- }
-
- this.set('currentAppId', 0);
- }
-
- 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
deleted file mode 100644
index fc4ff03717..0000000000
--- a/src/components/HMI/app/controller/sdl/NonMediaController.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.NonMediaController
- * @desc SDL NonMedia Controller logic
- * @category Controller
- * @filesource app/controller/sdl/NonMediaController.js
- * @version 1.0
- */
-
-SDL.NonMediaController = Em.Object.create( {
-
- /**
- * Current NonMedia application id
- *
- * @type {Number}
- */
- currentAppId: 0,
-
- /**
- * Return current NonMedia application name used for application button
- */
- currentAppName: function() {
-
- if (this.currentAppId) { return SDL.SDLController
- .getApplicationModel(this.currentAppId).appName; }
- }.property('this.currentAppId'),
-
- /**
- * Return current NonMedia application icon used for application button
- */
- currentAppIcon: function() {
-
- if (this.currentAppId) { return SDL.SDLController
- .getApplicationModel(this.currentAppId).appIcon; }
- }.property('this.currentAppId', 'SDL.SDLAppController.model.appIcon'),
-
- /**
- * Activate application model
- *
- * @param {SDLAppModel}
- */
- activateApp: function(applicationModel) {
-
- // store active application id
- this.set('currentAppId', applicationModel.appID);
-
- // set active model
- SDL.SDLAppController.set('model', applicationModel);
-
- // send response
- // FFW.BasicCommunication.ActivateApp( applicationModel.appID );
-
- // Go to SDL state
- SDL.InfoController.turnOnSDL();
- //SDL.States.goToStates('info.nonMedia');
- },
-
- /**
- * Restore current application to active state
- */
- activateCurrentApp: function() {
-
- FFW.BasicCommunication.OnAppActivated(this.currentAppId);
- },
-
- /**
- * Method hides sdl activation button and sdl application
- *
- * @param {Number}
- */
- onDeleteApplication: function(appID) {
-
- if (this.currentAppId == appID) {
- if (SDL.States.info.nonMedia.active
- || SDL.SDLAppController.model) {
-
- SDL.SDLController.getApplicationModel(appID).set('active', false);
-
- SDL.States.goToStates('info.apps');
- }
-
- SDL.InfoController.set('activeState', 'info.apps');
-
- 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
deleted file mode 100644
index 44cbd6978e..0000000000
--- a/src/components/HMI/app/controller/sdl/RPCController.js
+++ /dev/null
@@ -1,3069 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.RPCController
- * @desc RPC Controller
- * @category Controller
- * @filesource app/controller/sdl/RPCController.js
- * @version 1.0
- */
-
-SDL.RPCController = Em.Object
- .create( {
-
- capabilityCheckResult: null,
-
- /**
- * Start register RPC components on controller init
- */
- ConnectToSDL: function() {
-
- if (FLAGS.Buttons) {
- FFW.Buttons.connect();
- }
-
- if (FLAGS.TTS) {
- FFW.TTS.connect();
- }
-
- if (FLAGS.VR) {
- FFW.VR.connect();
- }
-
- if (FLAGS.BC) {
- FFW.BasicCommunication.connect();
- }
-
- if (FLAGS.UI) {
- FFW.UI.connect();
- }
-
- if (FLAGS.VI) {
- FFW.VehicleInfo.connect();
- }
-
- if (FLAGS.Navi) {
- FFW.Navigation.connect();
- }
- },
-
- capabilitiesCheck: function(key, value) {
- if (key == "imageType" && value == "STATIC") {
- SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
- }
- if (key == "type" && value == "PRE_RECORDED") {
- SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
- }
- if (key == "type" && value == "SAPI_PHONEMES") {
- SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
- }
- if (key == "type" && value == "LHPLUS_PHONEMES") {
- SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
- }
- if (key == "type" && value == "SILENCE") {
- SDL.RPCController.capabilityCheckResult = {code: SDL.SDLModel.resultCode['UNSUPPORTED_RESOURCE'], type: value};
- }
- return value;
- },
-
- /**
- * Object that contains check methods that returns true if mandatory
- * fields is successful and returns false if not
- */
- BasicCommunication: Em.Object
- .create( {
-
- resultStruct: {},
-
- /**
- * Validate method for request UpdateAppList
- *
- * @param {Object}
- * params
- */
- UpdateAppList: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request DialNumber
- *
- * @param {Object}
- * params
- */
- DialNumber: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
-
- if (params.number == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'number' does not exists!"
- };
-
- return this.resultStruct;
- }
-
- if (typeof params.number != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'number'!"
- };
-
- return this.resultStruct;
- }
-
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
-
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request UpdateDeviceList
- *
- * @param {Object}
- * params
- */
- UpdateDeviceList: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.deviceList == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'deviceList' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.deviceList.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'deviceList'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
-
- /**
- * Validate method for request PolicyUpdate
- *
- * @param {Object}
- * params
- */
- PolicyUpdate: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.file == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'file' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.file != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'file'!"
- };
-
- return this.resultStruct;
- }
- if (params.timeout == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'timeout' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.timeout != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'timeout'!"
- };
-
- return this.resultStruct;
- }
- if (params.retry == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'retry' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.retry.length < 1) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'retry'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request SystemRequest
- *
- * @param {Object}
- * params
- */
- SystemRequest: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.fileName == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'fileName' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.fileName != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'fileName'!"
- };
-
- return this.resultStruct;
- }
- if (params.requestType == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'requestType' does not exists!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ActivateApp
- *
- * @param {Object}
- * params
- */
- ActivateApp: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request AllowSDLFunctionality
- *
- * @param {Object}
- * params
- */
- AllowSDLFunctionality: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.device == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'device' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.device != 'object') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'device'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request AllowDeviceToConnect
- *
- * @param {Object}
- * params
- */
- AllowDeviceToConnect: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.device == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'device' does not exists!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetSystemInfo
- *
- * @param {Object}
- * params
- */
- GetSystemInfo: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request MixingAudioSupported
- *
- * @param {Object}
- * params
- */
- MixingAudioSupported: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request AllowAllApps
- *
- * @param {Object}
- * params
- */
- AllowAllApps: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request AllowApp
- *
- * @param {Object}
- * params
- */
- AllowApp: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appPermissions == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'app' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appPermissions.length < 1) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appPermissions'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- }
-
- }),
-
- /**
- * Object that contains check methods that returns true if mandatory
- * fields is successful and returns false if not
- */
- TTS: Em.Object
- .create( {
-
- resultStruct: {},
-
- /**
- * Validate method for request IsReady
- *
- * @param {Object}
- * params
- */
- IsReady: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetLanguage
- *
- * @param {Object}
- * params
- */
- GetLanguage: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request SetGlobalProperties
- *
- * @param {Object}
- * params
- */
- SetGlobalProperties: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetSupportedLanguages
- *
- * @param {Object}
- * params
- */
- GetSupportedLanguages: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request StopSpeaking
- *
- * @param {Object}
- * params
- */
- StopSpeaking: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request Speak
- *
- * @param {Object}
- * params
- */
- Speak: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.ttsChunks == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'ttsChunks' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.ttsChunks.length < 1) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'ttsChunks'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ChangeRegistration
- *
- * @param {Object}
- * params
- */
- ChangeRegistration: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.language == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'language' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.language != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'language'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request OnLanguageChange
- *
- * @param {Object}
- * params
- */
- OnLanguageChange: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.language == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'language' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.language != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'language'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- }
- }),
-
- /**
- * Object that contains check methods that returns true if mandatory
- * fields is successful and returns false if not
- */
- Navigation: Em.Object
- .create( {
-
- resultStruct: {},
-
- /**
- * Validate method for request IsReady
- *
- * @param {Object}
- * params
- */
- IsReady: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request Navigation.SendLocation
- *
- * @param {Object}
- * params
- */
- SendLocation: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request Navigation.AlertManeuver
- *
- * @param {Object}
- * params
- */
- AlertManeuver: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request StartStream
- *
- * @param {Object}
- * params
- */
- StartStream: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.url == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'url' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.url != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'url'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request StopStream
- *
- * @param {Object}
- * params
- */
- StopStream: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request StartAudioStream
- *
- * @param {Object}
- * params
- */
- StartAudioStream: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.url == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'url' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.url != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'url'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request StopAudioStream
- *
- * @param {Object}
- * params
- */
- StopAudioStream: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request Navigation.ShowConstantTBT
- *
- * @param {Object}
- * params
- */
- ShowConstantTBT: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if ("turnIcon" in params
- && ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- if ("nextTurnIcon" in params
- && ((params.nextTurnIcon.imageType !== "DYNAMIC") && (params.nextTurnIcon.imageType !== "STATIC"))) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- if (params.navigationTexts == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'navigationTexts' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.navigationTexts.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'navigationTexts'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request Navigation.UpdateTurnList
- *
- * @param {Object}
- * params
- */
- UpdateTurnList: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if ("turnList" in params) {
-
- for ( var i = 0; i < params.turnList.length; i++) {
- if (params.turnList[i].image
- && ((params.turnIcon.imageType !== "DYNAMIC")
- && (params.turnIcon.imageType !== "STATIC"))) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- e;
- }
- }
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- }
-
- }),
-
- /**
- * Object that contains check methods that returns true if mandatory
- * fields is successful and returns false if not
- */
- UI: Em.Object
- .create( {
-
- resultStruct: {},
-
- /**
- * Validate method for request SetDisplayLayout
- *
- * @param {Object}
- * params
- */
- SetDisplayLayout: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request IsReady
- *
- * @param {Object}
- * params
- */
- IsReady: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request UI.Alert
- *
- * @param {Object}
- * params
- */
- Alert: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.alertStrings == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'alertStrings' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.alertStrings.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'alertStrings'!"
- };
-
- return this.resultStruct;
- }
- if ('duration' in params && typeof params.duration != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'duration'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request Show
- *
- * @param {Object}
- * params
- */
- ShowNotification: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if ("icon" in params &&
- ((params.turnIcon.imageType !== "DYNAMIC") && (params.turnIcon.imageType !== "STATIC"))) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- if (params.text == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'text' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.text.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'text'!"
- };
-
- return this.resultStruct;
- }
- if (params.timeout == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'timeout' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.timeout != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'timeout'!"
- };
-
- return this.resultStruct;
- }
- },
-
- /**
- * Validate method for request Show
- *
- * @param {Object}
- * params
- */
- Show: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if ("graphic" in params
- && ((params.graphic.imageType !== "DYNAMIC") && (params.graphic.imageType !== "STATIC"))) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- if (params.showStrings == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'showStrings' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.showStrings.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'showStrings'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request AddCommand
- *
- * @param {Object}
- * params
- */
- AddCommand: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if ("cmdIcon" in params
- && (params.cmdIcon.imageType !== "DYNAMIC" && params.cmdIcon.imageType !== "STATIC")) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- if (params.cmdID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'cmdID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.cmdID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'cmdID'!"
- };
-
- return this.resultStruct;
- }
- if (params.menuParams == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'menuParams' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.menuParams != 'object') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'menuParams'!"
- };
-
- return this.resultStruct;
- }
- if (params.menuParams.menuName == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'menuName' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.menuParams.menuName != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'menuName'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request DeleteCommand
- *
- * @param {Object}
- * params
- */
- DeleteCommand: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.cmdID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'cmdID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.cmdID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'cmdID'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request AddSubMenu
- *
- * @param {Object}
- * params
- */
- AddSubMenu: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.menuID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'menuID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.menuID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'menuID'!"
- };
-
- return this.resultStruct;
- }
- if (!params.menuParams) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'menuParams' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request DeleteSubMenu
- *
- * @param {Object}
- * params
- */
- DeleteSubMenu: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.menuID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'menuID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.menuID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'menuID'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
- // don't delete if current submenu active
- if (SDL.SDLController.getApplicationModel(params.appID)
- .get('currentSubMenuId') == params.menuID) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["IN_USE"],
- "resultMessage": "SubMenu is already in use!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request PerformInteraction
- *
- * @param {Object}
- * params
- */
- PerformInteraction: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.timeout == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'timeout' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.timeout != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'timeout'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request SetMediaClockTimer
- *
- * @param {Object}
- * params
- */
- SetMediaClockTimer: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.updateMode == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'updateMode' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.updateMode != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'updateMode'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request SetGlobalProperties
- *
- * @param {Object}
- * params
- */
- SetGlobalProperties: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetCapabilities
- *
- * @param {Object}
- * params
- */
- GetCapabilities: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ChangeRegistration
- *
- * @param {Object}
- * params
- */
- ChangeRegistration: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.language == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'language' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.language != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'language'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetSupportedLanguages
- *
- * @param {Object}
- * params
- */
- GetSupportedLanguages: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetLanguage
- *
- * @param {Object}
- * params
- */
- GetLanguage: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request SetAppIcon
- *
- * @param {Object}
- * params
- */
- SetAppIcon: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.syncFileName == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'syncFileName' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.syncFileName != 'object') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'syncFileName'!"
- };
-
- return this.resultStruct;
- }
- if ("syncFileName" in params
- && ((params.syncFileName.imageType !== "DYNAMIC") && (params.syncFileName.imageType !== "STATIC"))) {
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Unsupported image type!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request Slider
- *
- * @param {Object}
- * params
- */
- Slider: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.numTicks == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'numTicks' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.numTicks != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'numTicks'!"
- };
-
- return this.resultStruct;
- }
- if (params.position == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'position' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.position != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'position'!"
- };
-
- return this.resultStruct;
- }
- if (params.sliderHeader == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'sliderHeader' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.sliderHeader != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'sliderHeader'!"
- };
-
- return this.resultStruct;
- }
- if (params.timeout == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'timeout' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.timeout != 'number' || params.timeout < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'timeout'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ScrollableMessage
- *
- * @param {Object}
- * params
- */
- ScrollableMessage: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.messageText == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'messageText' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.messageText.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'messageText'!"
- };
-
- return this.resultStruct;
- }
- if (params.timeout == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'timeout' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.timeout != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'timeout'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request PerformAudioPassThru
- *
- * @param {Object}
- * params
- */
- PerformAudioPassThru: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.audioPassThruDisplayTexts == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'audioPassThruDisplayTexts' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.audioPassThruDisplayTexts.length < 0
- || params.audioPassThruDisplayTexts.length > 2) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'audioPassThruDisplayTexts'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request EndAudioPassThru
- *
- * @param {Object}
- * params
- */
- EndAudioPassThru: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ClosePopUp
- *
- * @param {Object}
- * params
- */
- ClosePopUp: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ShowVrHelp
- *
- * @param {Object}
- * params
- */
- ShowVrHelp: function(params) {
-
- if (params) {
- if ("appID" in params) {
-
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
- }
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- }
- }),
-
- /**
- * Object that contains check methods that returns true if mandatory
- * fields is successful and returns false if not
- */
- VehicleInfo: Em.Object
- .create( {
-
- resultStruct: {},
-
- /**
- * Validate method for request IsReady
- *
- * @param {Object}
- * params
- */
- IsReady: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request DiagnosticMessage
- *
- * @param {Object}
- * params
- */
- DiagnosticMessage: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetVehicleType
- *
- * @param {Object}
- * params
- */
- GetVehicleType: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ReadDID
- *
- * @param {Object}
- * params
- */
- ReadDID: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.ecuName == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'ecuName' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.ecuName != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'ecuName'!"
- };
-
- return this.resultStruct;
- }
- if (params.didLocation == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'didLocation' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.didLocation.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'didLocation'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetDTCs
- *
- * @param {Object}
- * params
- */
- GetDTCs: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.ecuName == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'ecuName' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.ecuName != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'ecuName'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetVehicleData
- *
- * @param {Object}
- * params
- */
- GetVehicleData: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- /*if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }*/
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request SubscribeVehicleData
- *
- * @param {Object}
- * params
- */
- SubscribeVehicleData: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request UnsubscribeVehicleData
- *
- * @param {Object}
- * params
- */
- UnsubscribeVehicleData: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- }
- }),
-
- /**
- * Object that contains check methods that returns true if mandatory
- * fields is successful and returns false if not
- */
- VR: Em.Object
- .create( {
-
- resultStruct: {},
-
- /**
- * Validate method for request IsReady
- *
- * @param {Object}
- * params
- */
- IsReady: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request PerformInteraction
- *
- * @param {Object}
- * params
- */
- PerformInteraction: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.timeout == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'timeout' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.timeout != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'timeout'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetCapabilities
- *
- * @param {Object}
- * params
- */
- GetCapabilities: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetLanguage
- *
- * @param {Object}
- * params
- */
- GetLanguage: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request GetSupportedLanguages
- *
- * @param {Object}
- * params
- */
- GetSupportedLanguages: function(params) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request AddCommand
- *
- * @param {Object}
- * params
- */
- AddCommand: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.cmdID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'cmdID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.cmdID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'cmdID'!"
- };
-
- return this.resultStruct;
- }
- if (params.vrCommands == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'vrCommands' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.vrCommands.length < 0) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'vrCommands'!"
- };
-
- return this.resultStruct;
- }
- if ("appID" in params) {
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request DeleteCommand
- *
- * @param {Object}
- * params
- */
- DeleteCommand: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.cmdID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'cmdID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.cmdID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'cmdID'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- },
-
- /**
- * Validate method for request ChangeRegistration
- *
- * @param {Object}
- * params
- */
- ChangeRegistration: function(params) {
-
- if (params == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'params' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (params.language == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'language' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.language != 'string') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'language'!"
- };
-
- return this.resultStruct;
- }
- if (params.appID == null) {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Parameter 'appID' does not exists!"
- };
-
- return this.resultStruct;
- }
- if (typeof params.appID != 'number') {
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["INVALID_DATA"],
- "resultMessage": "Wrong type of parameter 'appID'!"
- };
-
- return this.resultStruct;
- }
-
- this.resultStruct = {
- "resultCode": SDL.SDLModel.resultCode["SUCCESS"]
- };
-
- return this.resultStruct;
- }
- })
- });
diff --git a/src/components/HMI/app/controlls/AZERTYLayout.js b/src/components/HMI/app/controlls/AZERTYLayout.js
deleted file mode 100755
index d6ae033884..0000000000
--- a/src/components/HMI/app/controlls/AZERTYLayout.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.QWERTYLayout
- * @desc General list component for SDL application
- * @category Controlls
- * @filesource app/controlls/QWERTYLayout.js
- * @version 1.0
- */
-
-SDL.AZERTYLayout = Em.ContainerView.extend( {
-
- classNames: 'keyboardLayout AZERTYLayout wide',
-
- childViews: [
- 'a',
- 'z',
- 'e',
- 'r',
- 't',
- 'y',
- 'u',
- 'i',
- 'o',
- 'p',
- 'q',
- 's',
- 'd',
- 'f',
- 'g',
- 'h',
- 'j',
- 'k',
- 'l',
- 'm',
- 'w',
- 'x',
- 'c',
- 'v',
- 'b',
- 'n',
- 'dash',
- 'ampersand'
- ],
-
- a: SDL.Button.extend({
- classNames: 'a k0',
- text : 'a',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- z: SDL.Button.extend({
- classNames: 'z k1',
- text : 'z',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- e: SDL.Button.extend({
- classNames: 'e k2',
- text : 'e',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- r: SDL.Button.extend({
- classNames: 'r k3',
- text : 'r',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- t: SDL.Button.extend({
- classNames: 't k4',
- text : 't',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- y: SDL.Button.extend({
- classNames: 'y k5',
- text : 'y',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- u: SDL.Button.extend({
- classNames: 'u k6',
- text : 'u',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- i: SDL.Button.extend({
- classNames: 'i k7',
- text : 'i',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- o: SDL.Button.extend({
- classNames: 'o k8',
- text : 'o',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- p: SDL.Button.extend({
- classNames: 'p k9',
- text : 'p',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- q: SDL.Button.extend({
- classNames: 'q k10',
- text : 'q',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- s: SDL.Button.extend({
- classNames: 's k11',
- text : 's',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- d: SDL.Button.extend({
- classNames: 'd k12',
- text : 'd',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- f: SDL.Button.extend({
- classNames: 'f k13',
- text : 'f',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- g: SDL.Button.extend({
- classNames: 'g k14',
- text : 'g',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- h: SDL.Button.extend({
- classNames: 'h k15',
- text : 'h',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- j: SDL.Button.extend({
- classNames: 'j k16',
- text : 'j',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- k: SDL.Button.extend({
- classNames: 'k k17',
- text : 'k',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- l: SDL.Button.extend({
- classNames: 'l k18',
- text : 'l',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- m: SDL.Button.extend({
- classNames: 'm k19',
- text : 'm',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- w: SDL.Button.extend({
- classNames: 'w k21',
- text : 'w',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- x: SDL.Button.extend({
- classNames: 'x k22',
- text : 'x',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- c: SDL.Button.extend({
- classNames: 'c k23',
- text : 'c',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- v: SDL.Button.extend({
- classNames: 'v k24',
- text : 'v',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- b: SDL.Button.extend({
- classNames: 'b k25',
- text : 'b',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- n: SDL.Button.extend({
- classNames: 'n k26',
- text : 'n',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- dash: SDL.Button.extend({
- classNames: 'dash k27',
- text : '-',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- ampersand: SDL.Button.extend({
- classNames: 'ampersand k28',
- text : '&',
- target : 'parentView.parentView',
- action : 'inputChanges'
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/Button.js b/src/components/HMI/app/controlls/Button.js
deleted file mode 100644
index 7d5b4f4ed2..0000000000
--- a/src/components/HMI/app/controlls/Button.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.Button
- * @desc Universal button component for SDL application
- * @category Controlls
- * @filesource app/controlls/Button.js
- * @version 1.0
- */
-
-SDL.Button = Em.View
- .extend(Ember.TargetActionSupport,
- {
- classNames: [
- 'ffw-button', 'notpressed'
- ],
-
- classNameBindings: [
- 'pressed', 'disabled', 'hidden'
- ],
-
- /** Pressed state binding */
- pressed: false,
-
- /** Disable actions on button */
- disabled: false,
-
- /** Button icon class */
- icon: null,
-
- /** Button text */
- text: null,
-
- rightText: null,
-
- target: this.target ? this.target : this,
-
- /** Arrow icon */
- arrow: false,
-
- /** Button timer flag */
- timer: 0,
-
- timerId: null,
- /** Touch leave event flag */
- touchleave: false,
-
- onDown: true,
-
- helpMode: false,
- /** */
- targetElement: null,
-
- actionDown: function(event) {
-
- if (this.get('disabled')) { return; }
-
- var self = this;
-
- this.set('pressed', true);
- /** Set Mouse Leave Event Flag to false */
- this.set('mouseleave', false);
-
- // Default trigger action
- if (this.onDown) {
- this.triggerAction();
- }
-
- // Call trigger with timeout
- if (this.timer) {
- this.timerId = setInterval(function() {
-
- self.triggerAction();
- }, this.timer);
- }
- },
-
- actionUp: function(event) {
-
- this.set('pressed', false);
-
- if (this.timer) {
- clearInterval(this.timerId);
- }
-
- if (this.get('disabled')) {
- if (this.touchleave == true) {
- this.set('touchleave', false);
- }
- return;
- }
-
- if (!this.onDown) {
- this.triggerAction();
- }
- },
-
- /** Only for desktop */
- mouseLeave: function(event) {
-
- this.set('pressed', false);
-
- if (this.timer) {
- clearInterval(this.timerId);
- }
- },
-
- /**
- * Only for IOS Simulation of mouseleave event for touch devices If
- * target element looses focus during touch move event events dont
- * trigger
- */
- touchMove: function(event) {
-
- /** Set Mouse Leave Event Flag to true */
- this.set('touchleave', this.targetElement !== document
- .elementFromPoint(event.originalEvent.touches[0].pageX,
- event.originalEvent.touches[0].pageY));
- },
-
- // component default template
- defaultTemplate: Em.Handlebars
- .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
- + '<span>{{view.text}}</span>'),
-
- templates: {
- text: Em.Handlebars.compile('<span class="text">{{view.text}}</span>'),
-
- icon: Em.Handlebars
- .compile('<img class="ico" {{bindAttr src="view.icon"}} />'),
-
- rightText: Em.Handlebars
- .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
- + '<span class="right_text">{{view.text}}</span>'),
-
- arrow: Em.Handlebars
- .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
- + '<span>{{view.text}}</span>'
- + '<img class="arrow-ico" src="images/common/arrow_ico.png" />'),
-
- rightIcon: Em.Handlebars
- .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
- + '<span>{{view.text}}</span>'
- + '<img class="right_ico" {{bindAttr src="view.righticon"}} />')
- }
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/Indicator.js b/src/components/HMI/app/controlls/Indicator.js
deleted file mode 100644
index 4d3804e730..0000000000
--- a/src/components/HMI/app/controlls/Indicator.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.Indicator
- * @desc Universal button component with value indicator for SDL application
- * @category Controlls
- * @filesource app/controlls/Indicator.js
- * @version 1.0
- */
-
-SDL.Indicator = Em.View.extend(Ember.TargetActionSupport, {
-
- /** Content binding */
- content: null,
-
- /** internal indicators array */
- indicators: null,
-
- /** indicator active class */
- indActiveClass: null,
-
- /** indicator default class */
- indDefaultClass: null,
-
- /** Set active indicator from the start */
- startFrom: null,
-
- /** binding property to enable/disable indicators */
- enabledBinding: 'content.enabled',
-
- /**
- * Before rendering view handeler need to generate indicators array based on
- * indicator range value
- */
- beforeRender: function() {
-
- // define variables
- var length = this.content.range, view = this, i;
-
- // generate indicators
- this.indicators = [];
-
- for (i = 0; i < length; i++) {
- this.indicators.push(Em.Object.create( {
- index: i,
- className: this.indDefaultClass
- }));
- }
- // apply indicator visualization rule
- view.setRecord();
-
- if (this.startFrom) {
- this.indicators[this.startFrom].set('className',
- this.indActiveClass);
- }
-
- // add observer to content record
- this.addObserver('content', function() {
-
- view.setRecord();
- });
-
- // view internal call
- this.applyAttributesToBuffer(this.buffer);
- },
-
- actionDown: function() {
-
- this.triggerAction();
- },
-
- // change record binding
- setRecord: function() {
-
- var view = this;
-
- if (this.content.observersForKey('value').length == 0) {
-
- this.content.addObserver('value', function() {
-
- view.toggleIndicators();
- });
-
- }
-
- this.toggleIndicators();
- },
-
- // Toggle indicator handeler
- toggleIndicators: function() {
-
- var length = this.indicators.length, i;
-
- for (i = 0; i < length; i++) {
- if (i >= this.content.value) {
- this.indicators[i].set('className', 'SDL_indicator '
- + this.indDefaultClass);
- } else {
- this.indicators[i].set('className', 'SDL_indicator '
- + this.indActiveClass);
- }
- }
- },
-
- /** Define indicator template */
- template: Ember.Handlebars.compile('{{#with view}}'
- + '{{#each indicators}}'
- + '<div {{bindAttr class="className view.enabled:show"}}></div>'
- + '{{/each}}' + '{{/with}}')
-
-});
diff --git a/src/components/HMI/app/controlls/Label.js b/src/components/HMI/app/controlls/Label.js
deleted file mode 100644
index 2fc9e6604f..0000000000
--- a/src/components/HMI/app/controlls/Label.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.Label
- * @desc Universal label component for SDL application
- * @category Controlls
- * @filesource app/controlls/Label.js
- * @version 1.0
- */
-
-SDL.Label = Em.View.extend( {
- classNameBindings: [
- 'disabled'
- ],
- classNames: 'label',
-
- // component default template
- defaultTemplate: Em.Handlebars.compile('<span>{{view.content}}</span>'),
-
- templates: {
- icon: Em.Handlebars
- .compile('<img class="ico" {{bindAttr src="view.icon"}} />'
- + '<span>{{view.content}}</span>')
- }
-
-/** Define button template */
-/*
- * template: Ember.Handlebars.compile( '{{#with view}}'+ '{{#if icon}}<img
- * class="ico" {{bindAttr src="icon"}} />{{/if}}'+ '<span>{{content}}</span>'+
- * '{{/with}}' )
- */
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/List.js b/src/components/HMI/app/controlls/List.js
deleted file mode 100644
index e0fc551f40..0000000000
--- a/src/components/HMI/app/controlls/List.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.List
- * @desc General list component for SDL application
- * @category Controlls
- * @filesource app/controlls/List.js
- * @version 1.0
- */
-
-SDL.List = Em.ContainerView.extend( {
-
- classNames: 'list',
-
- /** flag for scrollbar */
- disableScrollbar: false,
-
- /** Set count of items at one time */
- itemsOnPage: 0,
-
- /** Speed of scrolling in milliseconds */
- scrollBarSpeed: 200,
-
- /** Number of columns on page */
- columnsNumber: 1,
-
- itemheight: 50,
-
- /** Current scroll page */
- currentPage: 0,
-
- /** Css style of list */
- listScrollingAttributes: '',
-
- /** Count of items in menu */
- /*
- * listCount: function(){ if( this.items ) { return this.items.length; }
- * }.property('items.@each.type'),
- */
- listCount: function() {
-
- if ( (this.get('this.list.childViews.length') / this.get('columnsNumber') / this.get('itemsOnPage') ) < this.get('currentPage')) {
- this.set('currentPage', 0);
- }
- // console.log(this.get('this.list.childViews.length'));
- return this.get('this.list.childViews.length');
- }.property('this.list.childViews.length'),
-
- /** Pages count */
- pageCount: function() {
-
- return Math.ceil(this.get('listCount') / this.get('columnsNumber')
- / this.get('itemsOnPage'));
- }.property('listCount', 'itemsOnPage'),
-
- listHeight: function() {
-
- return this.itemsOnPage * this.itemheight;
- }.property('itemsOnPage'),
-
- /** Action of element "sb-top" which show previous list page */
- sbUp: function() {
-
- if (this.get('currentPage') > 0) {
- this.set('currentPage', this.get('currentPage') - 1);
- }
- },
-
- /** Action of element "sb-bottom" which show previous list page */
- sbDown: function() {
-
- if (this.get('currentPage') < this.get('pageCount') - 1) {
- this.set('currentPage', this.get('currentPage') + 1);
- }
- },
-
- /** Scroll content according to current page */
- onCurrentPageChange: function() {
-
- this.set('listScrollingAttributes', 'margin-top: '
- + (this.get('currentPage') * this.itemsOnPage * (-50)) + 'px');
- }.observes('currentPage'),
-
- /** Method for delete certain item from list */
- deleteItem: function(id) {
-
- this.items.splice(id, 1);
- this.list.refresh();
- },
-
- /** List components */
- childViews: [
- 'list', 'scrollbar'
- ],
-
- /** List view */
- list: Em.ContainerView.extend( {
-
- classNames: 'list-content',
-
- listStyleBinding: 'parentView.listScrollingAttributes',
-
- attributeBindings: [
- 'listStyle:style'
- ],
-
- refresh: function() {
-
- this.rerender();
- }.observes('_parentView.items.@each.type'),
-
- afterRender: function() {
-
- var items = this._parentView.items, element, i, key, binding;
-
- for (i = 0; i < items.length; i++) {
-
- element = items[i].type.create( {
- // element id
- elementId: this._parentView.elementId + '_item' + i,
-
- // list item css class
- classNames: 'list-item',
-
- classNameBindings: [
- 'this.voiceOver'
- ],
-
- // Dynamic property set
- init: function() {
-
- for (key in items[i].params) {
- if (key.match('Binding') != null) {
- binding = Ember.Binding
- .from(items[i].params[key]).to(key
- .replace('Binding', ''));
- binding.connect(this);
- // Set one way binding
- binding.oneWay();
- } else {
- this.set(key, items[i].params[key]);
- }
- }
- this._super();
- // synchronize bindings
- Ember.run.sync();
- }
- })
-
- // Push element to list
- this.get('childViews').pushObject(element);
- }
- }
- }),
-
- /** Scrollbar view */
- scrollbar: SDL.ScrollBar.extend( {
- currentPageBinding: 'parentView.currentPage',
- pageCountBinding: 'parentView.pageCount',
- listHeightBinding: 'parentView.listHeight',
- scrollBarIsDisabledBinding: 'parentView.disableScrollbar'
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/MenuList.js b/src/components/HMI/app/controlls/MenuList.js
deleted file mode 100644
index b4ba9207ef..0000000000
--- a/src/components/HMI/app/controlls/MenuList.js
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.MenuList
- * @desc
- * @category Controlls
- * @filesource app/controlls/MenuList.js
- * @version 1.0
- */
-
-SDL.MenuList = Em.ContainerView
- .extend( {
-
- /**
- * Add new item to container
- *
- * @param buttons:
- * SoftButton[]
- */
- addItems: function(buttons, appID) {
-
- this.deleteItems();
-
- if (buttons) {
- for ( var i = 0; i < buttons.length; i++) {
- this.get('content.childViews').pushObject(SDL.Button
- .create(SDL.PresetEventsCustom, {
- text: buttons[i].text,
- icon: buttons[i].image ? buttons[i].image.value : "",
- templateName: buttons[i].image ? 'rightText' : 'text',
- groupName: "AlertPopUp",
- classNameBindings: ['isHighlighted:isHighlighted'],
- isHighlighted: buttons[i].isHighlighted ? true : false,
- softButtonID: buttons[i].softButtonID,
- systemAction: buttons[i].systemAction,
- groupName: this.groupName,
- classNames: 'softButton',
- appID: appID
- }));
- }
- }
- },
-
- /**
- * Delete existing Soft Buttons from container
- */
- deleteItems: function() {
-
- this.get('content.childViews').removeObjects(this.get('content.childViews').filterProperty('softButtonID'));
- this.get('content.childViews').removeObjects(this.get('content.childViews').filterProperty('softButtonID', 0));
- },
-
- classNames: [
- 'ffw_list_menu'
- ],
-
- attributeBindings: [
- 'elementHeight:style'
- ],
-
- // Position of current page
- page: 0,
-
- // Items per one page
- itemsOnPage: 5,
-
- // Height of one item
- ITEM_HEIGHT: 50,
-
- pageHeight: function() {
-
- return this.itemsOnPage * this.ITEM_HEIGHT;
- }.property('this.itemsOnPage'),
-
- elementHeight: function() {
-
- return 'height:'
- + String(this.get('pageHeight') + this.ITEM_HEIGHT - 2) + 'px;';
- }.property('this.pageHeight'),
-
- // Position of content block
- contentPositon: function() {
-
- return 'top:'
- + String(-(this.get('page') * this.get('pageHeight')))
- + 'px; height:'
- + String(this.get('pageHeight')
- - (Boolean(this.get('onLastPage') && this.get('page')) * this.ITEM_HEIGHT))
- + 'px;';
- }.property('onLastPage'),
-
- // Property for show or hide 'down' button
- onLastPage: function() {
-
- return ((this.get('page') * this.itemsOnPage) < (this
- .get('content.childViews.length') - this.itemsOnPage));
- }.property('page', 'content.childViews.length'),
-
- // Handeler to go previous page
- pageUp: function() {
-
- if (this.get('page')) {
- this.set('page', (this.get('page') - 1));
- }
- },
-
- // Handeler to go next page
- pageDown: function() {
-
- if (this.get('onLastPage')) {
- this.set('page', (this.get('page') + 1));
- }
- },
-
- childViews: [
- 'upButton', 'content', 'downButton'
- ],
-
- upButton: SDL.Button.extend( {
-
- classNames: [
- 'control', 'up_button'
- ],
-
- hidden: function() {
-
- if (this.get('parentView.page')) {
- return false;
- } else {
- return true;
- }
- }.property('parentView.page'),
-
- templateName: 'icon',
-
- icon: 'images/media/ico_arrow_up.png',
-
- action: 'pageUp',
-
- onDown: false,
-
- target: 'parentView'
- }),
-
- downButton: SDL.Button.extend( {
-
- classNames: [
- 'control', 'down_button'
- ],
-
- hidden: function() {
-
- if (this.get('parentView.onLastPage')) {
- return false;
- } else {
- return true;
- }
- }.property('parentView.onLastPage'),
-
- templateName: 'icon',
-
- icon: 'images/media/ico_arrow_down.png',
-
- action: 'pageDown',
-
- onDown: false,
-
- target: 'parentView'
- }),
-
- content: Em.ContainerView.extend( {
-
- classNames: [
- 'content'
- ],
-
- attributeBindings: [
- 'parentView.contentPositon:style'
- ]
- })
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/QWERTYLayout.js b/src/components/HMI/app/controlls/QWERTYLayout.js
deleted file mode 100755
index 336587d02a..0000000000
--- a/src/components/HMI/app/controlls/QWERTYLayout.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.QWERTYLayout
- * @desc General list component for SDL application
- * @category Controlls
- * @filesource app/controlls/QWERTYLayout.js
- * @version 1.0
- */
-
-SDL.QWERTYLayout = Em.ContainerView.extend( {
-
- classNames: 'keyboardLayout QWERTYLayout',
-
- childViews: [
- 'q',
- 'w',
- 'e',
- 'r',
- 't',
- 'y',
- 'u',
- 'i',
- 'o',
- 'p',
- 'a',
- 's',
- 'd',
- 'f',
- 'g',
- 'h',
- 'j',
- 'k',
- 'l',
- 'z',
- 'x',
- 'c',
- 'v',
- 'b',
- 'n',
- 'm',
- 'dash',
- 'ampersand'
- ],
-
- q: SDL.Button.extend({
- classNames: 'q k0',
- text : 'q',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- w: SDL.Button.extend({
- classNames: 'w k1',
- text : 'w',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- e: SDL.Button.extend({
- classNames: 'e k2',
- text : 'e',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- r: SDL.Button.extend({
- classNames: 'r k3',
- text : 'r',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- t: SDL.Button.extend({
- classNames: 't k4',
- text : 't',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- y: SDL.Button.extend({
- classNames: 'y k5',
- text : 'y',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- u: SDL.Button.extend({
- classNames: 'u k6',
- text : 'u',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- i: SDL.Button.extend({
- classNames: 'i k7',
- text : 'i',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- o: SDL.Button.extend({
- classNames: 'o k8',
- text : 'o',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- p: SDL.Button.extend({
- classNames: 'p k9',
- text : 'p',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- a: SDL.Button.extend({
- classNames: 'a k10',
- text : 'a',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- s: SDL.Button.extend({
- classNames: 's k11',
- text : 's',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- d: SDL.Button.extend({
- classNames: 'd k12',
- text : 'd',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- f: SDL.Button.extend({
- classNames: 'f k13',
- text : 'f',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- g: SDL.Button.extend({
- classNames: 'g k14',
- text : 'g',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- h: SDL.Button.extend({
- classNames: 'h k15',
- text : 'h',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- j: SDL.Button.extend({
- classNames: 'j k16',
- text : 'j',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- k: SDL.Button.extend({
- classNames: 'k k17',
- text : 'k',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- l: SDL.Button.extend({
- classNames: 'l k18',
- text : 'l',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- z: SDL.Button.extend({
- classNames: 'z k21',
- text : 'z',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- x: SDL.Button.extend({
- classNames: 'x k22',
- text : 'x',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- c: SDL.Button.extend({
- classNames: 'c k23',
- text : 'c',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- v: SDL.Button.extend({
- classNames: 'v k24',
- text : 'v',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- b: SDL.Button.extend({
- classNames: 'b k25',
- text : 'b',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- n: SDL.Button.extend({
- classNames: 'n k26',
- text : 'n',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- m: SDL.Button.extend({
- classNames: 'm k27',
- text : 'm',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- dash: SDL.Button.extend({
- classNames: 'dash k28',
- text : '-',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- ampersand: SDL.Button.extend({
- classNames: 'ampersand k29',
- text : '&',
- target : 'parentView.parentView',
- action : 'inputChanges'
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/QWERTZLayout.js b/src/components/HMI/app/controlls/QWERTZLayout.js
deleted file mode 100755
index 4374c5f78b..0000000000
--- a/src/components/HMI/app/controlls/QWERTZLayout.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.QWERTYLayout
- * @desc General list component for SDL application
- * @category Controlls
- * @filesource app/controlls/QWERTYLayout.js
- * @version 1.0
- */
-
-SDL.QWERTZLayout = Em.ContainerView.extend( {
-
- classNames: 'keyboardLayout QWERTZLayout',
-
- childViews: [
- 'q',
- 'w',
- 'e',
- 'r',
- 't',
- 'z',
- 'u',
- 'i',
- 'o',
- 'p',
- 'a',
- 's',
- 'd',
- 'f',
- 'g',
- 'h',
- 'j',
- 'k',
- 'l',
- 'y',
- 'x',
- 'c',
- 'v',
- 'b',
- 'n',
- 'm',
- 'dash',
- 'ampersand'
- ],
-
- q: SDL.Button.extend({
- classNames: 'q k0',
- text : 'q',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- w: SDL.Button.extend({
- classNames: 'w k1',
- text : 'w',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- e: SDL.Button.extend({
- classNames: 'e k2',
- text : 'e',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- r: SDL.Button.extend({
- classNames: 'r k3',
- text : 'r',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- t: SDL.Button.extend({
- classNames: 't k4',
- text : 't',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- z: SDL.Button.extend({
- classNames: 'z k5',
- text : 'z',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- u: SDL.Button.extend({
- classNames: 'u k6',
- text : 'u',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- i: SDL.Button.extend({
- classNames: 'i k7',
- text : 'i',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- o: SDL.Button.extend({
- classNames: 'o k8',
- text : 'o',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- p: SDL.Button.extend({
- classNames: 'p k9',
- text : 'p',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- a: SDL.Button.extend({
- classNames: 'a k10',
- text : 'a',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- s: SDL.Button.extend({
- classNames: 's k11',
- text : 's',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- d: SDL.Button.extend({
- classNames: 'd k12',
- text : 'd',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- f: SDL.Button.extend({
- classNames: 'f k13',
- text : 'f',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- g: SDL.Button.extend({
- classNames: 'g k14',
- text : 'g',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- h: SDL.Button.extend({
- classNames: 'h k15',
- text : 'h',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- j: SDL.Button.extend({
- classNames: 'j k16',
- text : 'j',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- k: SDL.Button.extend({
- classNames: 'k k17',
- text : 'k',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- l: SDL.Button.extend({
- classNames: 'l k18',
- text : 'l',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- y: SDL.Button.extend({
- classNames: 'y k21',
- text : 'y',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- x: SDL.Button.extend({
- classNames: 'x k22',
- text : 'x',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- c: SDL.Button.extend({
- classNames: 'c k23',
- text : 'c',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- v: SDL.Button.extend({
- classNames: 'v k24',
- text : 'v',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- b: SDL.Button.extend({
- classNames: 'b k25',
- text : 'b',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- n: SDL.Button.extend({
- classNames: 'n k26',
- text : 'n',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- m: SDL.Button.extend({
- classNames: 'm k27',
- text : 'm',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- dash: SDL.Button.extend({
- classNames: 'dash k28',
- text : '-',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- ampersand: SDL.Button.extend({
- classNames: 'ampersand k29',
- text : '&',
- target : 'parentView.parentView',
- action : 'inputChanges'
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/ScrollBar.js b/src/components/HMI/app/controlls/ScrollBar.js
deleted file mode 100644
index 466a29e409..0000000000
--- a/src/components/HMI/app/controlls/ScrollBar.js
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.ScrollBar
- * @desc ScrollBar component for List component
- * @category Controlls
- * @filesource app/controlls/ScrollBar.js
- * @version 1.0
- */
-
-SDL.ScrollBar = Em.ContainerView
- .extend( {
-
- /** Define enable/disable scrollbar */
- classNameBindings: [
- 'scrollBarIsDisabled:is-disabled'
- ],
-
- /** Componet class */
- classNames: 'scrollbar',
-
- /** Childs views */
- childViews: [
- 'upButton', 'bar', 'downButton'
- ],
-
- /** current page */
- currentPage: 1,
-
- /** Pages count */
- pageCount: 0,
-
- listHeight: 250,
-
- /** On/OF scrollbar */
- scrollBarIsDisabled: false,
-
- /** Define bar height */
- sbHeight: function() {
-
- /** Max bar height */
- this.maxHeight = this.listHeight - 102;
- if (this.pageCount <= 1) {
- return this.maxHeight + 1;
- } else {
- return (this.maxHeight / this.pageCount);
- }
- }.property('pageCount'),
-
- /** Position of bar */
- sbTop: function() {
-
- if (this.get('currentPage') == 0) {
- return 0;
- } else {
- return (this.maxHeight - this.get('sbHeight'))
- / (this.get('pageCount') - 1) * this.get('currentPage') + 1;
- }
- }.property('currentPage', 'pageCount'),
-
- /** Support function */
- scrollbarBodyStyleAttributes: function() {
-
- return 'height: ' + (this.get('listHeight') - 1) + 'px;';
- }.property('listHeight'),
-
- /** Support function */
- sbBodyStyleAttributes: function() {
-
- return 'height: ' + (this.get('listHeight') - 100 - 1) + 'px;';
- }.property('listHeight'),
-
- sbStyleAttributes: function() {
-
- return 'height: ' + this.get('sbHeight') + 'px; ' + 'top: '
- + this.get('sbTop') + 'px';
- }.property('currentPage', 'pageCount'),
-
- /** Define scroll up button "disable" status */
- sbUpButtonIsDisabled: function() {
-
- if (this.get('currentPage') < 1) {
- return true;
- } else {
- return false;
- }
- }.property('currentPage', 'pageCount'),
-
- /** Define scroll down button "disable" status */
- sbDownButtonIsDisabled: function() {
-
- if ((this.pageCount - 1) > this.get('currentPage')) {
- return false;
- } else {
- return true;
- }
- }.property('currentPage', 'pageCount'),
-
- attributeBindings: [
- 'scrollbarBodyStyleAttributes:style'
- ],
-
- /** Bottom for scroll up */
- upButton: SDL.Button.extend( {
- classNames: [
- 'sb-top', 'button'
- ],
- action: 'sbUp',
- target: 'parentView.parentView',
- disabledBinding: 'parentView.sbUpButtonIsDisabled',
- icon: 'images/list/scrollbar/button-up-active.png',
- timer: 200
- }),
-
- /** Bottom for scroll down */
- downButton: SDL.Button.extend( {
- classNames: [
- 'sb-bottom', 'button'
- ],
- action: 'sbDown',
- target: 'parentView.parentView',
- disabledBinding: 'parentView.sbDownButtonIsDisabled',
- icon: 'images/list/scrollbar/button-down-active.png',
- timer: 200
- }),
-
- /** Scrollbar track */
- bar: Em.View
- .extend( {
- barBodyStyleBinding: 'parentView.sbBodyStyleAttributes',
- barStyleBinding: 'parentView.sbStyleAttributes',
- cancelAnimationBinding: 'parentView.parentView.cancelAnimation',
-
- layout: Em.Handlebars
- .compile('<div class="sb-body" {{bindAttr style="view.barBodyStyle"}}>'
- + '{{yield}}' + '</div>'),
-
- template: Em.Handlebars
- .compile('<div class="sb-bar" '
- + '{{bindAttr style="view.barStyle"}}'
- + '{{bindAttr class="view.cancelAnimation:cancelBarAnimation"}}>'
- + '</div>')
- })
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/controlls/ScrollableText.js b/src/components/HMI/app/controlls/ScrollableText.js
deleted file mode 100644
index 40d35f012b..0000000000
--- a/src/components/HMI/app/controlls/ScrollableText.js
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.ScrollableText
- * @desc General ScrollableText component
- * @category Controlls
- * @filesource app/controlls/scrollableText.js
- * @version 1.0
- */
-
-SDL.ScrollableText = Em.ContainerView
- .extend( {
-
- classNames: 'scrollableText',
-
- /** flag for scrollbar */
- disableScrollbar: false,
-
- /** Set count of items at one time */
- itemsOnPage: 0,
-
- /** Speed of scrolling in milliseconds */
- scrollBarSpeed: 200,
-
- /** Number of columns on page */
- columnsNumber: 1,
-
- itemheight: 50,
-
- /** Current scroll page */
- currentPage: 0,
-
- /** Css style of scrollableText */
- scrollableTextScrollingAttributes: '',
-
- /** Css style of line-height of rows */
- linesHeght: 23,
-
- linesCount: 1,
-
- scrollHeight: null,
-
- scrollableTextCount: function() {
-
- if ($('#' + this.get('childViews')[1].elementId)) {
- $('#' + this.get('childViews')[1].elementId)
- .removeAttr('style');
- this.set('scrollHeight', $('#'
- + this.get('childViews')[1].elementId)[0].scrollHeight);
- $('#' + this.get('childViews')[1].elementId)
- .height(this.scrollHeight);
- this.set('linesCount', $('#'
- + this.get('childViews')[1].elementId)[0].scrollHeight
- / this.linesHeght);
- }
- },
-
- /** Pages count */
- pageCount: function() {
-
- return Math.ceil(this.get('linesCount') / this.get('itemsOnPage'));
- }.property('linesCount', 'itemsOnPage'),
-
- scrollableTextHeight: function() {
-
- return this.itemsOnPage * this.itemheight;
- }.property('itemsOnPage'),
-
- /** Action of element "sb-top" which show previous scrollableText page */
- sbUp: function() {
-
- if (this.get('currentPage') > 0) {
- this.set('currentPage', this.get('currentPage') - 1);
- }
- },
-
- /** Action of element "sb-bottom" which show previous scrollableText page */
- sbDown: function() {
-
- if (this.get('currentPage') < this.get('pageCount') - 1) {
- this.set('currentPage', this.get('currentPage') + 1);
- }
- },
-
- /** Scroll content according to current page */
- onCurrentPageChange: function() {
-
- this.set('scrollableTextScrollingAttributes', 'height: '
- + this.scrollHeight + 'px; top: '
- + (this.get('currentPage') * this.itemsOnPage * (-23)) + 'px');
- }.observes('currentPage'),
-
- /** Method for delete certain item from scrollableText */
- deleteItem: function(id) {
-
- this.items.splice(id, 1);
- this.scrollableText.refresh();
- },
-
- /** scrollableText components */
- childViews: [
- 'scrollbar',
- // 'scrollableText'
- ],
-
- refreshTextArea: function() {
-
- if (this.get('childViews')[1]) {
- this.get('childViews').removeObject(this.get('childViews')[1]);
- }
-
- $('#scrollableTextArea').height(23);
- this.set('scrollHeight', 23);
- this.set('linesCount', 1);
- this.set('currentPage', 0);
-
- this
- .get('childViews')
- .pushObject(Ember.TextArea
- .create( {
-
- classNames: 'scrollableTextArea',
-
- elementId: 'scrollableTextArea',
-
- scrollableTextStyleBinding: 'parentView.scrollableTextScrollingAttributes',
-
- attributeBindings: [
- 'scrollableTextStyle:style'
- ],
-
- valueBinding: 'this.parentView.items',
-
- actionDown: function() {
-
- return false;
- },
-
- didInsertElement: function() {
-
- this.get('parentView').scrollableTextCount();
- }
- }));
- }.observes('items'),
-
- /** scrollableText view */
- scrollableText: Ember.TextArea
- .extend( {
-
- classNames: 'scrollableTextArea',
-
- elementId: 'scrollableTextArea',
-
- scrollableTextStyleBinding: 'parentView.scrollableTextScrollingAttributes',
-
- attributeBindings: [
- 'scrollableTextStyle:style'
- ],
-
- valueBinding: 'this.parentView.items',
-
- actionDown: function() {
-
- return false;
- },
-
- didInsertElement: function() {
-
- this._parentView.scrollableTextCount();
- },
-
- refresh: function() {
-
- this.rerender();
- }.observes('_parentView.items')
-
- }),
-
- /** Scrollbar view */
- scrollbar: SDL.ScrollBar.extend( {
- currentPageBinding: 'parentView.currentPage',
- pageCountBinding: 'parentView.pageCount',
- scrollableTextHeightBinding: 'parentView.scrollableTextHeight',
- scrollBarIsDisabledBinding: 'parentView.disableScrollbar'
- })
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/mixins/PresetEventCustom.js b/src/components/HMI/app/mixins/PresetEventCustom.js
deleted file mode 100644
index b28468e471..0000000000
--- a/src/components/HMI/app/mixins/PresetEventCustom.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PresetEventsCustom
- * @desc Handler of custom preset butons events
- * @category mixin
- * @filesource app/mixins/PresetEventsCustom.js
- * @version 1.0
- */
-SDL.PresetEventsCustom = Ember.Mixin.create( {
- actionDown: function() {
-
- this._super();
- SDL.SDLController.onSoftButtonActionDownCustom(this);
- },
- actionUp: function() {
-
- this._super();
- SDL.SDLController.onSoftButtonActionUpCustom(this);
- if (this.systemAction == 'DEFAULT_ACTION') {
-
- SDL.SDLController.defaultActionSoftButton(this);
-
- } else if (this.systemAction == 'STEAL_FOCUS') {
-
- SDL.SDLController.stealFocusSoftButton(this);
-
- } else if (this.systemAction == 'KEEP_CONTEXT') {
-
- SDL.SDLController.keepContextSoftButton(this);
-
- }
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/mixins/PresetEvents.js b/src/components/HMI/app/mixins/PresetEvents.js
deleted file mode 100644
index 08e58b6f31..0000000000
--- a/src/components/HMI/app/mixins/PresetEvents.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PresetEvents
- * @desc Handler of preset butons events
- * @category mixin
- * @filesource app/mixins/PresetEvents.js
- * @version 1.0
- */
-SDL.PresetEvents = Ember.Mixin.create( {
- actionDown: function() {
-
- this._super();
- SDL.SDLController.onSoftButtonActionDown(this);
- },
- actionUp: function() {
-
- this._super();
- SDL.SDLController.onSoftButtonActionUp(this);
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/model/PhoneModel.js b/src/components/HMI/app/model/PhoneModel.js
deleted file mode 100644
index 7273be7a9c..0000000000
--- a/src/components/HMI/app/model/PhoneModel.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PhoneModel
- * @desc Phone model
- * @category Model
- * @filesource app/model/PhoneModel.js
- * @version 1.0
- */
-
-SDL.PhoneModel = Em.Object.create( {
-
- /** Dial number */
- dialpadNumber: '',
-
- readyForCall: true,
-
- onCall: false,
-
- /** Text for phone status bar */
- statusModeText: null,
-
- /** Start call */
- dialCall: function() {
-
- if (this.dialpadNumber.length) {
- this.set('onCall', true);
- this.set('readyForCall', false);
- }
- },
-
- /** End call */
- endCall: function() {
-
- this.set('onCall', false);
- this.set('readyForCall', true);
- this.set('dialpadNumber', '');
-
- this.set('statusModeText', null);
-
- if (SDL.SDLModel.phoneCall) {
- SDL.SDLModel.set('phoneCall', false);
- SDL.SDLController
- .getApplicationModel(SDL.SDLAppController.model.appID)
- .turnOnSDL();
- }
- },
-
- /** Add symbol to dial pad number */
- setDialpadNumber: function(key) {
-
- if (this.dialpadNumber.length < 14) {
- key = this.dialpadNumber + key;
- this.set('dialpadNumber', key);
- }
- },
-
- /** Delete last number symbol */
- deleteDialpadNumber: function() {
-
- if (this.dialpadNumber.length) {
- this.set('dialpadNumber', this.dialpadNumber.slice(0, -1));
- }
- }
-}) \ No newline at end of file
diff --git a/src/components/HMI/app/model/abstract/RangedValue.js b/src/components/HMI/app/model/abstract/RangedValue.js
deleted file mode 100644
index 425e41806a..0000000000
--- a/src/components/HMI/app/model/abstract/RangedValue.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name Ranged Value
- * @desc Abstract ranged value class
- * @category Model
- * @filesource app/model/abstract/RangedValue.js
- * @version 1.0
- */
-
-SDL.RangedValue = Em.Object.extend( {
-
- range: 3,
- minValue: 1,
- value: 0,
- cycle: true,
- enabled: true,
-
- /**
- * @desc Cyclically increases seat value until it reaches the range value
- * than value is switched to off (0)
- */
- increase: function() {
-
- if (!this.enabled) {
- this.enable();
- return;
- }
-
- if (this.value < this.range) {
- this.set('value', this.value + 1);
- } else {
- if (!this.cycle) { return; }
- this.set('value', 0);
- }
- },
- /**
- * Toggle indicators one by one
- */
- toggleIndicators: function() {
-
- if (!this.enabled) {
- this.enable();
- return;
- }
-
- if (this.value < this.range - 1) {
- this.set('value', this.value + 1);
- } else {
- this.set('value', 0);
- }
- },
- /**
- * @desc Cyclically increases seat value until it reaches zero value (off)
- * than value is changed to the range value
- */
- decrease: function() {
-
- if (!this.enabled) {
- this.enable();
- return;
- }
-
- if (this.value >= this.minValue) {
- if (!this.cycle && (this.value == this.minValue)) { return; }
- this.set('value', this.value - 1);
- } else {
- this.set('value', this.range);
- }
- },
-
- /**
- * @desc Switch off
- */
- off: function() {
-
- this.set('beforeOff', this.value);
- this.set('value', 0);
- },
-
- /**
- * Switch on
- */
- on: function() {
-
- this.set('value', this.range);
- },
-
- /**
- * Switch visual enable
- */
- enable: function() {
-
- this.set('enabled', true);
- },
-
- /**
- * Switch visual disable
- */
- disable: function() {
-
- this.set('enabled', false);
- },
-
- /**
- * Revert to value before toggle Off
- */
- revert: function() {
-
- if (this.beforeOff) {
- this.set('value', this.beforeOff);
- }
- }
-}) \ No newline at end of file
diff --git a/src/components/HMI/app/model/media/CDModel.js b/src/components/HMI/app/model/media/CDModel.js
deleted file mode 100644
index 9ded512c5d..0000000000
--- a/src/components/HMI/app/model/media/CDModel.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.CDModel
- * @desc CD Media data model
- * @category Model
- * @filesource app/model/media/CDModel.js
- * @version 1.0
- */
-
-SDL.CDModel = Em.Object.create( {
- active: true,
-
- statusBar: 'The Electric Broncos',
-
- init: function() {
-
- 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
deleted file mode 100644
index 682eee592b..0000000000
--- a/src/components/HMI/app/model/sdl/AppModel.js
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLAppModel
- * @desc Abstarct model for SDL applications
- * @category Model
- * @filesource app/model/sdl/AppModel.js
- * @version 1.0
- */
-
-SDL.SDLAppModel = Em.Object.extend({
-
- /**
- * List of subscribed data on VehicleInfo model
- *
- * @type {Object}
- */
- subscribedData: {},
-
- /**
- * Application's container for current processed requests on HMI
- *
- * @type {Object}
- */
- activeRequests: {},
-
- /**
- * Application Id
- *
- * @type {Number}
- */
- appID: null,
-
- /**
- * Application name
- *
- * @type {String}
- */
- 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,
-
- /**
- * Navigation streaming url
- */
- navigationAudioStream: null,
-
- /**
- * Chosen device name
- *
- * @type {String}
- */
- deviceName: '',
-
- /**
- * Chosen device id
- *
- * @type {String}
- */
- deviceID: null,
-
- /**
- * Global properties for current application
- *
- * @type {Object}
- */
- globalProperties: {},
-
- /**
- * Statusbar text
- *
- * @type {String}
- */
- statusText: '',
-
- /**
- * Info data
- *
- * @type: {Em.Object}
- */
- appInfo: null,
-
- /**
- * Current language of applications UI component
- *
- * @type {String}
- */
- UILanguage: 'EN-US',
-
- /**
- * Current language of applications TTS and applications VR component
- *
- * @type {String}
- */
- TTSVRLanguage: 'EN-US',
-
- /**
- * List of VR commands
- */
- VRCommands: [],
-
- /**
- * Array of Soft Buttons
- *
- * @type {Array}
- */
- softButtons: [],
-
- /**
- * Array of Soft Buttons
- *
- * @type {Array}
- */
- turnListSoftButtons: [],
-
- /**
- * Array of Objects for TBTTurnList
- *
- * @type {Array}
- */
- turnList: [],
-
- /**
- * Policies
- * Array of avaliable permission codes for current app
- * came from SDLCore in SDL.GetListOfPermissions response
- *
- * @type {Array}
- */
- allowedFunctions: [],
-
- /**
- * URL to application Icon
- *
- * @type {String}
- */
- appIcon: 'images/info/info_leftMenu_apps_ico.png',
-
- /**
- * Application commands list
- *
- * @type {Array}
- */
- commandsList: {
- 0: []
- },
-
- /**
- * Flag to open ShowConstantTBTview when entering to current screen
- *
- * @type {Boolean}
- */
- tbtActivate: false,
-
- /**
- * Return current menu commands
- *
- * @return {Array}
- */
- currentCommandsList: function () {
-
- return this.get('commandsList.' + this.get('currentSubMenuId'));
- }.property('this.currentSubMenuId'),
-
- /**
- * Current command submenu identificator
- *
- * @type {Number}
- */
- currentSubMenuId: 'top',
-
- /**
- * Return current submenu name
- *
- * @return {String}
- */
- currentSubMenuLabel: function () {
-
- //Param "top" is Top level menu index
- var submenu, commands = this.commandsList["top"];
-
- for (var i = 0; i < commands.length; i++) {
- if (commands[i].menuID == this.currentSubMenuId) {
- submenu = commands[i].name;
- }
- }
-
- return this.get('currentSubMenuId') != 'top' ? submenu : 'Options';
- }.property('this.currentSubMenuId'),
-
- /**
- * Interaction chooses data
- *
- * @type {Object}
- */
- interactionChoices: {},
-
- /**
- * Method to remove deleted by SDL Core images used in HMI
- *
- * @param imageName
- */
- onImageRemoved: function(imageName){
-
- var result = false;
-
- // Get list of subMenus with commands
- for (var commands in this.commandsList) {
-
- // Check if object item (subMenu list of commands) is added list with command in object and not an inherited method of object
- if(this.commandsList.hasOwnProperty(commands)){
-
- var len = this.commandsList[commands].length;
- for (var i = 0; i < len; i++) {
-
- // Check image name with each command in each subMenu
- if (this.commandsList[commands][i].icon) {
- if (this.commandsList[commands][i].icon.indexOf(imageName) != -1
- && imageName.length == this.commandsList[commands][i].icon.length) {
-
- // If found same image path than set default icon path
- this.commandsList[commands][i].icon = SDL.SDLModel.defaultListOfIcons.command;
- result = true;
- }
- }
- }
- }
- }
-
- return result;
- },
-
- /**
- * Update Soft Buttons will handle on command Show
- *
- * @param {Array}
- */
- updateSoftButtons: function (buttons) {
-
- // delete existing buttons from array
- this.softButtons.splice(0);
-
- // push new buttons to array
- this.get('softButtons').pushObjects(buttons);
- },
-
- /**
- * Add command to list
- *
- * @param {Object}
- */
- addCommand: function (request) {
-
- var parentID = request.params.menuParams.parentID > 0 ? request.params.menuParams.parentID : 'top';
-
- if (!this.get('commandsList.' + parentID)) {
- this.commandsList[parentID] = [];
- }
-
- var commands = this.get('commandsList.' + parentID);
-
- // Magic number is limit of 1000 commands added on one menu
- if (commands.length <= 999) {
-
- commands[commands.length] = {
- commandID: request.params.cmdID,
- name : request.params.menuParams.menuName,
- parent : parentID,
- position : request.params.menuParams.position ? request.params.menuParams.position : 0,
- icon : request.params.cmdIcon ? request.params.cmdIcon.value : null
- };
-
- if (SDL.SDLController.getApplicationModel(request.params.appID) && SDL.OptionsView.active) {
- SDL.SDLAppController.buttonsSort(parentID, this.appID);
- SDL.OptionsView.commands.refreshItems();
- }
-
- console.log(commands.length);
- if (request.id >= 0) {
- FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
- }
- } else {
- FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'Adding more than 1000 item to the top menu or to submenu is not allowed.');
- }
-
- },
-
- /**
- * Delete command from list
- *
- * @param {Number}
- */
- deleteCommand: function (commandID, requestID) {
-
- for (var i in this.commandsList) {
- if (this.commandsList[i].filterProperty('commandID', commandID).length) {
- if (i != this.currentSubMenuId || this.currentSubMenuId == 'top') {
- this.get('commandsList.' + i).removeObjects(this.get('commandsList.' + i).filterProperty('commandID', commandID));
- SDL.SDLModel.deleteCommandResponse(SDL.SDLModel.resultCode["SUCCESS"], requestID);
- return;
- } else {
- SDL.SDLModel.deleteCommandResponse(SDL.SDLModel.resultCode["IN_USE"], requestID);
- return;
- }
- }
- }
- },
-
- /**
- * Add submenu to commands list
- *
- * @param {Object}
- */
- addSubMenu: function (request) {
-
- // parentID is equal to 'top' cause Top level menu ID
- var parentID = 'top';
-
- var commands = this.get('commandsList.' + parentID);
-
- // Magic number is limit of 1000 commands added on one menu
- if (commands.length <= 999) {
-
- this.commandsList[request.params.menuID] = [];
- commands[commands.length] = {
- menuID : request.params.menuID,
- name : request.params.menuParams.menuName ? request.params.menuParams.menuName : '',
- parent : 0,
- position: request.params.menuParams.position ? request.params.menuParams.position : 0
- };
-
- if (SDL.SDLController.getApplicationModel(request.params.appID) && SDL.OptionsView.active) {
- SDL.SDLAppController.buttonsSort(parentID, this.appID);
- SDL.OptionsView.commands.refreshItems();
- }
-
- FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
- } else {
- FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'Adding more than 1000 item to the top menu or to submenu is not allowed.');
- }
- },
-
- /**
- * Delete submenu and related commands from list
- *
- * @param {Number}
- */
- deleteSubMenu: function (menuID) {
-
- if (this.commandsList['top'].filterProperty('commandID', menuID)) {
- this.get('commandsList.top').removeObjects(this.get('commandsList.top').filterProperty('menuID', menuID));
- delete(this.commandsList[menuID]);
- }
-
- return SDL.SDLModel.resultCode['SUCCESS'];
- },
-
- /**
- * SDL UI CreateInteraction response handeler push set of commands to
- * voice recognition list
- *
- * @param {Object}
- */
- onCreateInteraction: function (message) {
-
- this.interactionChoices[message.interactionChoiceSetID] = message.choiceSet;
-
- },
-
- /**
- * SDL UI DeleteInteraction response handeler close current interaction
- * set window (if opened) and delete current set commands from voice
- * recognition list
- *
- * @param {Object}
- */
- onDeleteInteraction: function (message) {
-
- delete this.interactionChoices[message.interactionChoiceSetID];
- },
-
- /**
- * SDL UI Slider response handeler open Slider window with received
- * parameters
- *
- * @param {Object}
- */
- onSlider: function (message) {
-
- SDL.SliderView.loadData(message);
-
- SDL.SliderView.activate(this.appName, message.params.timeout);
-
- }
- });
diff --git a/src/components/HMI/app/model/sdl/MediaModel.js b/src/components/HMI/app/model/sdl/MediaModel.js
deleted file mode 100644
index 0feceb2119..0000000000
--- a/src/components/HMI/app/model/sdl/MediaModel.js
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLMediaModel
- * @desc SDL data model
- * @category Model
- * @filesource app/model/media/SDLMediaModel.js
- * @version 1.0
- */
-
-SDL.SDLMediaModel = SDL.SDLAppModel.extend({
-
- init: function () {
-
- this._super();
-
- var subscribeVIData = {};
-
- for (var key in SDL.SDLVehicleInfoModel.vehicleData) {
- if (key != "externalTemperature") {
- subscribeVIData[key] = false;
- }
- }
-
- this.set('subscribedData', subscribeVIData);
-
- // init properties here
- this.set('appInfo', Em.Object.create({
- field1 : '<field1>',
- field2 : '<field2>',
- field3 : '<field3>',
- mediaClock : '<mediaClock>',
- trackIcon : SDL.SDLModel.defaultListOfIcons.trackIcon,
- customPresets: [
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>'
- ],
- alignment : "text-align:center"
- }));
-
- this.set('activeRequests', Em.Object.create({
- uiPerformInteraction: null
- }));
-
- this.set('VRCommands', []);
- this.set('tbtActivate', false);
- this.set('isPlaying', true);
- this.set('globalProperties.helpPrompt', []);
- this.set('globalProperties.timeoutPrompt', []);
- this.set('globalProperties.keyboardProperties', Em.Object.create());
- this.set('globalProperties.keyboardProperties.keyboardLayout', 'QWERTY');
- this.set('globalProperties.keyboardProperties.limitedCharacterList', []);
-
- this.set('commandsList', {"top": []});
- this.set('softButtons', []);
- },
-
- /**
- * Parameter for presets for Media App to show presets on media screen
- *
- * @type bool
- */
- mediaPreset: false,
-
- /**
- * Flag for media playing state
- *
- * @param {Boolean}
- */
- isPlaying: false,
-
- /**
- * Flag for model active state currently used for status bar
- *
- * @param {Boolean}
- */
- active: false,
-
- /**
- * Timer for Media Clock
- */
- timer: null,
-
- /**
- * Current sdl Sub Menu identificator
- */
- currentSDLSubMenuid: null,
-
- /**
- * Current sdl Perform Interaction Choise identificator
- */
- currentSDLPerformInteractionChoiseId: null,
-
- countUp : true,
- pause : null,
- maxTimeValue: 68400, // 19 hours
- duration : 0,
- currTime : 0,
-
- /**
- * Method hides sdl activation button and sdl application
- *
- * @param {Number}
- */
- onDeleteApplication: function (appID) {
-
- SDL.SDLMediaController.onDeleteApplication(appID);
- },
-
- /**
- * Activate current application model
- */
- turnOnSDL: function () {
-
- SDL.SDLMediaController.activateApp(this);
- },
-
- startTimer: function () {
-
- var self = this;
-
- if (this.pause === false) {
- this.timer = setInterval(function () {
-
- self.set('currTime', self.currTime + 1);
- }, 1000);
- } else {
- clearInterval(this.timer);
- }
- }.observes('this.pause'),
-
- stopTimer: function () {
-
- clearInterval(this.timer);
- this.pause = null;
- this.appInfo.set('mediaClock', '');
- },
-
- setDuration: function () {
-
- var number, str = '', hrs = 0, min = 0, sec = 0;
- if (this.countUp) {
- number = this.duration + this.currTime;
- } else {
- if (this.duration <= this.currTime) {
- clearInterval(this.timer);
- this.currTime = 0;
- this.appInfo.set('mediaClock', '00:00:00');
- return;
- }
- number = this.duration - this.currTime;
- }
-
- hrs = parseInt(number / 3600), // hours
- min = parseInt(number / 60) % 60, // minutes
- sec = number % 60; // seconds
-
- str = (hrs < 10 ? '0' : '') + hrs + ':';
- str += (min < 10 ? '0' : '') + min + ":";
- str += (sec < 10 ? '0' : '') + sec;
- this.appInfo.set('mediaClock', str);
-
- if (!this.get('countUp') && this.duration == this.currTime) {
- clearInterval(this.timer);
- return;
- }
-
- }.observes('this.currTime'),
-
- changeDuration: function () {
-
- clearInterval(this.timer);
- this.currTime = -1;
- this.startTimer();
- }.observes('this.duration'),
-
- /**
- * SDL Setter for Media Clock Timer
- *
- * @param {Object}
- */
- sdlSetMediaClockTimer: function (params) {
-
- if ((params.updateMode == "PAUSE" && this.pause) || (params.updateMode == "RESUME" && !this.pause) || ((params.updateMode == "RESUME" || params.updateMode == "PAUSE") && this.pause === null )) {
- return SDL.SDLModel.resultCode['IGNORED'];
- }
-
- if (params.updateMode == "CLEAR") {
- this.stopTimer();
- return SDL.SDLModel.resultCode['SUCCESS'];
- }
-
- if (params.updateMode == "PAUSE") {
- this.set('pause', true);
- } else if (params.updateMode == "RESUME") {
- this.set('pause', false);
- } else {
- if (params.startTime) {
- this.set('countUp', params.updateMode == "COUNTUP" ? true : false);
- this.set('duration', null);
- this.set('duration', params.startTime.hours * 3600 + params.startTime.minutes * 60 + params.startTime.seconds);
- }
- this.set('pause', false);
- }
-
- return SDL.SDLModel.resultCode['SUCCESS'];
- },
-
- /**
- * Method to clear App OverLay
- */
- clearAppOverLay: function () {
-
- clearInterval(this.timer);
- this.appInfo.set('field1', '');
- this.appInfo.set('field2', '');
- this.appInfo.set('field3', '');
- this.appInfo.set('field4', '');
- this.appInfo.set('alignment', '');
- this.set('statusText', '');
- this.appInfo.set('mediaClock', '');
- this.appInfo.set('mediaTrack', '');
- this.appInfo.set('trackIcon', 'images/sdl/audio_icon.jpg');
- this.updateSoftButtons();
- for (i = 0; i < 10; i++) {
- this.appInfo.set('customPresets.' + i, '');
- }
- this.set('mediaPreset', false);
-
- },
-
- /**
- * Applin UI Show handler
- *
- * @param {Object}
- */
- onSDLUIShow: function (params) {
-
- clearInterval(this.timer);
-
- for (var i = 0; i < params.showStrings.length; i++) {
- switch (params.showStrings[i].fieldName) {
- case 'mainField1':
- {
- this.appInfo.set('field1', params.showStrings[i].fieldText);
- break;
- }
- case 'mainField2':
- {
- this.appInfo.set('field2', params.showStrings[i].fieldText);
- break;
- }
- case 'mainField3':
- {
- this.appInfo.set('field3', params.showStrings[i].fieldText);
- break;
- }
- case 'mainField4':
- {
- this.appInfo.set('field4', params.showStrings[i].fieldText);
- break;
- }
- case 'statusBar':
- {
- this.set('statusText', params.showStrings[i].fieldText);
- break;
- }
- case 'mediaClock':
- {
- this.appInfo.set('mediaClock', params.showStrings[i].fieldText);
- break;
- }
- case 'mediaTrack':
- {
- this.appInfo.set('mediaTrack', params.showStrings[i].fieldText);
- break;
- }
- default :
- {
- break;
- }
- }
- }
-
- if (params.alignment) {
- switch (params.alignment) {
- case "CENTERED":
- {
- this.appInfo.set('alignment', "text-align:center");
- break;
- }
- case "LEFT_ALIGNED":
- {
- this.appInfo.set('alignment', "text-align:left");
- break;
- }
- case "RIGHT_ALIGNED":
- {
- this.appInfo.set('alignment', "text-align:right");
- break;
- }
- }
- } else {
-
- this.appInfo.set('alignment', "text-align:center");
- }
-
- 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) {
- this.updateSoftButtons(params.softButtons);
- }
-
- // Magic number is a count of Preset Buttons on HMI = 8
- for (var i = 0; i < 10; i++) {
- if (!params.customPresets || (params.customPresets[i] == '' || params.customPresets[i] == null)) {
- this.appInfo.set('customPresets.' + i, 'PRESET_' + i);
- } else {
- this.appInfo.set('customPresets.' + i, params.customPresets[i]);
- }
- }
- this.set('mediaPreset', true);
- }
- });
diff --git a/src/components/HMI/app/model/sdl/Model.js b/src/components/HMI/app/model/sdl/Model.js
deleted file mode 100644
index 0dfcf0394d..0000000000
--- a/src/components/HMI/app/model/sdl/Model.js
+++ /dev/null
@@ -1,1564 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLModel
- * @desc General model for SDL applications
- * @category Model
- * @filesource app/model/sdl/SDLModel.js
- * @version 1.0
- */
-
-SDL.SDLModel = Em.Object.create({
-
- /**
- * Data came from UI.PerformInteractionRequest for ShowVRHelpItems popup
- *
- * @type {Object}
- */
- interactionData: {
- 'vrHelpTitle': null,
- 'vrHelp': null
- },
-
- /**
- * Structure specified for PoliceUpdate retry sequence
- * contains timeout seconds param, array of retry seconds and counter of number of retries
- *
- * @type {Objetc}
- */
- policyUpdateRetry:{
- timeout: null,
- retry: [],
- try: null,
- timer: null,
- oldTimer: 0
- },
-
- /**
- * Application's container for current processed requests on VR component of HMI
- *
- * @type {Object}
- */
- vrActiveRequests: {
- vrPerformInteraction: null
- },
-
- /**
- * List of callback functions for request SDL.GetUserFriendlyMessage
- * where key is requestId
- * and parameter is a function that will handle data came in respone from SDL
- *
- * @type {Object}
- */
- userFriendlyMessagePull: {},
-
- /**
- * List of appID functions for request SDL.GetListOfPermissions
- * where key is requestId
- * and parameter is a appID that will handle data came in respone from SDL
- *
- * @type {Object}
- */
- getListOfPermissionsPull: {},
-
- /**
- * List of application id's for request SDL.ActivateApp
- * where key is requestId
- * and parameter is a id of application to be activated
- *
- * @type {Object}
- */
- activateAppRequestsList: {},
-
- /**
- * ID of app in LIMITED HMI state
- */
- stateLimited: null,
-
- /**
- * Active state of phone call on HMI for Deactivate app to handle event
- */
- phoneCallActive: false,
-
- /**
- * FLAG of any app in limited level exists
- */
- limitedExist: false,
-
- applicationStatusBar: function () {
-
- if (this.limitedExist && SDL.SDLController.getApplicationModel(this.stateLimited)) {
- return SDL.SDLController.getApplicationModel(this.stateLimited).statusText;
- } else {
- return '';
- }
- }.property("this.limitedExist"),
-
- /**
- * IScroll object to manage scroll on PerformInteraction view
- *
- * @type {Object}
- */
- interactionListWrapper: null,
-
- /**
- * TimeStamp of current started HMI session
- *
- * @type {Number}
- */
- timeStamp: null,
-
- /**
- * List of VR commands
- */
- VRCommands: [],
-
- /**
- * Video player object for navigationApp
- *
- * @type {Object}
- */
- naviVideo: {},
-
-/**
- * Array of strings came in SDL.GetURLS response
- *
- * @type {Object}
- */
- policyURLs: [],
-
- /**
- * Policy Settings Info state value
- *
- * @type {String}
- */
- settingsInfoListState: 'iAPP_BUFFER_FULL',
-
- /**
- * Policy Settings Info list
- *
- * @type {Object}
- */
- settingsInfoList: [
- 'iAPP_BUFFER_FULL',
- 'blah'
- ],
-
- /**
- * Policy Settings Info state value
- *
- * @type {String}
- */
- systemErrorListState: 'SYNC_REBOOTED',
-
- /**
- * Policy Settings Info list
- *
- * @type {Object}
- */
- systemErrorList: [
- 'SYNC_REBOOTED',
- 'SYNC_OUT_OF_MEMMORY'
- ],
-
- /**
- * Flag to indicate AudioPassThruPopUp activity
- *
- * @type {Boolean}
- */
- AudioPassThruState: false,
-
- /**
- * Current device information
- *
- * @type {Object}
- */
- CurrDeviceInfo: {
- "name": null,
- "id": null
- },
-
- /**
- * Driver Distraction State
- *
- * @type bool
- */
- driverDistractionState: false,
-
- /**
- * Flag to sent Send Data extended params
- *
- * @type {Boolean}
- */
- sendDataExtend: false,
-
- /**
- * VR active status
- *
- * @type {Boolean}
- */
- VRActive: false,
-
- /**
- * Flag to be set true when phone call is initialised
- *
- * @type {Boolean}
- */
- phoneCall: false,
-
- /**
- * Device list search progress flag
- *
- * @param {Boolean}
- */
- deviceSearchProgress: false,
-
- /**
- * Flag to be set true when VRHelpList are activated
- *
- * @param {Boolean}
- */
- VRHelpListActivated: false,
-
- /**
- * Flag to be set true when VRHelpList are activated
- *
- * @type {String}
- */
- keyboardInputValue: "",
-
- /**
- * List of states for OnTBTClientState notification
- */
- tbtClientStates: [
- {
- name: "ROUTE_UPDATE_REQUEST",
- id: 0
- }, {
- name: "ROUTE_ACCEPTED",
- id: 1
- }, {
- name: "ROUTE_REFUSED",
- id: 2
- }, {
- name: "ROUTE_CANCELLED",
- id: 3
- }, {
- name: "ETA_REQUEST",
- id: 4
- }, {
- name: "NEXT_TURN_REQUEST",
- id: 5
- }, {
- name: "ROUTE_STATUS_REQUEST",
- id: 6
- }, {
- name: "ROUTE_SUMMARY_REQUEST",
- id: 7
- }, {
- name: "TRIP_STATUS_REQUEST",
- id: 8
- }, {
- name: "ROUTE_UPDATE_REQUEST_TIMEOUT",
- id: 9
- }
- ],
-
- /**
- * List of states for ExitApplication notification
- */
- exitAppState: [
- {
- name: "IGNITION_OFF",
- id : 0
- },
- {
- name: "MASTER_RESET",
- id : 1
- },
- {
- name: "FACTORY_DEFAULTS",
- id : 2
- },
- {
- name: "SUSPEND",
- id : 3
- }
- ],
-
- /**
- * List of states for OnSystemRequest notification
- */
- systemRequestState: [
- {
- name: "HTTP",
- id : 0
- },
- {
- name: "FILE_RESUME",
- id : 1
- },
- {
- name: "AUTH_REQUEST",
- id : 2
- },
- {
- name: "AUTH_CHALLENGE",
- id : 3
- },
- {
- name: "AUTH_ACK",
- id : 4
- },
- {
- name: "PROPRIETARY",
- id : 5
- }
- ],
-
- /**
- * Data for AudioPassThruPopUp that contains params for visualisation
- *
- * @type {Object}
- */
- AudioPassThruData: {},
-
- /**
- * Enum with result codes for RPC
- */
- resultCode: {
- "SUCCESS" : 0,
- "UNSUPPORTED_REQUEST" : 1,
- "UNSUPPORTED_RESOURCE" : 2,
- "DISALLOWED" : 3,
- "REJECTED" : 4,
- "ABORTED" : 5,
- "IGNORED" : 6,
- "RETRY" : 7,
- "IN_USE" : 8,
- "DATA_NOT_AVAILABLE" : 9,
- "TIMED_OUT" : 10,
- "INVALID_DATA" : 11,
- "CHAR_LIMIT_EXCEEDED" : 12,
- "INVALID_ID" : 13,
- "DUPLICATE_NAME" : 14,
- "APPLICATION_NOT_REGISTERED": 15,
- "WRONG_LANGUAGE" : 16,
- "OUT_OF_MEMORY" : 17,
- "TOO_MANY_PENDING_REQUESTS" : 18,
- "NO_APPS_REGISTERED" : 19,
- "NO_DEVICES_CONNECTED" : 20,
- "WARNINGS" : 21,
- "GENERIC_ERROR" : 22,
- "USER_DISALLOWED" : 23
- },
-
- /**
- * Info navigationApp data for ShowConstantTBT request
- *
- * @type: {Object}
- */
- constantTBTParams: {
- "navigationTexts":[
- {
- "fieldName": "navigationText1",
- "fieldText": "mainField1"
- },
- {
- "fieldName": "navigationText2",
- "fieldText": "mainField2"
- },
- {
- "fieldName": "ETA",
- "fieldText": "mainField3"
- },
- {
- "fieldName": "totalDistance",
- "fieldText": "mainField4"
- },
- {
- "fieldName": "navigationText",
- "fieldText": "mainField5"
- },
- {
- "fieldName": "timeToDestination",
- "fieldText": "mainField6"
- }
- ],
- "softButtons": [
- {
- "text" : "Menu",
- "isHighlighted" : true,
- "softButtonID" : 1
- },
- {
- "text" : "Custom button",
- "isHighlighted" : false,
- "softButtonID" : 2
- },
- {
- "text" : "+",
- "isHighlighted" : true,
- "softButtonID" : 3
- },
- {
- "text" : "-",
- "isHighlighted" : false,
- "softButtonID" : 4
- }
- ]
- },
-
- /**
- * List of registered applications, To prevent errors without registered
- * application "-1" used as test appID
- *
- * @type object
- */
- registeredApps: [],
-
- /**
- * List of unregistered applications, to verify which app is reestablished connection
- *
- * @type object
- */
- 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
- */
- connectedDevices: {},
-
- /**
- * List of devices with registered applications
- *
- * @type object
- */
- conectedDevices: [],
-
- /**
- * List of registered components
- *
- * @type object
- */
- registeredComponents: [
- {
- type: "UI",
- state: false
- }, {
- type: "TTS",
- state: false
- }, {
- type: "VR",
- state: false
- }, {
- type: "BasicCommunication",
- state: false
- }, {
- type: "VehicleInfo",
- state: false
- }, {
- type: "Buttons",
- state: false
- }, {
- type: "Navigation",
- state: false
- }
- ],
-
- /**
- * List of icons
- *
- * @type {Object}
- */
- defaultListOfIcons: {
- // appID: syncFileName
- //0: "images/media/ico_li.png"
- 'app': 'images/info/info_leftMenu_apps_ico.png',
- 'command': 'images/common/defaultButtonImage.png',
- 'trackIcon': 'images/sdl/audio_icon.jpg'
- },
-
- /**
- * Array of active applications
- *
- * @type {Array}
- */
- applicationsList: [],
-
- /**
- * Array of connected devices
- *
- * @type {Array}
- */
- devicesList: [],
-
- /**
- * TTS + VR language
- *
- * @type {String}
- */
- hmiTTSVRLanguage: 'EN-US',
-
- /**
- * UI language
- *
- * @type {String}
- */
- hmiUILanguage: 'EN-US',
-
- /**
- * Parameter describes if performInteraction session was started on HMI
- * this flag set to true when UI.PerformInteraction request came on HMI
- * and set to false when HMI send response to SDL Core on UI.PerformInteraction request
- *
- * @type {Boolean}
- */
- performInteractionSession: [],
-
-/**
- * Array with app permissions
- * used for policies
- *
- * @type {Object}
- */
- appPermissions: [],
-
- /**
- * List of supported languages
- *
- * @type {Array}
- */
- sdlLanguagesList: [
- 'EN-US',
- 'ES-MX',
- 'FR-CA',
- 'DE-DE',
- 'ES-ES',
- 'EN-GB',
- 'RU-RU',
- 'TR-TR',
- 'PL-PL',
- 'FR-FR',
- 'IT-IT',
- 'SV-SE',
- 'PT-PT',
- 'NL-NL',
- 'ZH-TW',
- 'JA-JP',
- 'AR-SA',
- 'KO-KR',
- 'PT-BR',
- 'CS-CZ',
- 'DA-DK',
- 'NO-NO'
- ],
-
- /**
- * Function make diff between two arrays of permissions
- * remove argument array from existed array of permissions
- */
- setAppPermissions: function(appID, permissions){
-
- var messageCodes = [];
-
- permissions.forEach(function (x) {
- messageCodes.push(x.name);
- });
-
- messageCodes.push("AppPermissionsRevoked");
-
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, appID, messageCodes);
-
- },
-
- /**
- * Method to set selected state of settings Info List
- */
- settingsInfoListStateChange: function() {
-
- FFW.BasicCommunication.AddStatisticsInfo(this.settingsInfoListState);
- }.observes('this.settingsInfoListState'),
-
- /**
- * Method to set selected state of settings Info List
- */
- systemErrorListStateChange: function() {
-
- FFW.BasicCommunication.OnSystemError(this.systemErrorListState);
- }.observes('this.systemErrorListState'),
-
- /**
- * Method to open Phone view and dial phone number
- *
- * @param {Object}
- */
- dialNumber: function(params) {
-
- this.set('phoneCall', true);
- SDL.States.goToStates('phone.dialpad');
- SDL.PhoneModel.set('dialpadNumber', params.number);
- SDL.PhoneController.onDialCall();
- },
-
- /**
- * Notification method to send touch event data to SDLCore
- *
- * @param {Object}
- */
- onTouchEvent: function(event){
-
- if (event.target.parentElement.className.indexOf("navButton") >= 0 || event.target.className.indexOf("navButton") >= 0) {
- return;
- }
-
- var type = "",
- changedTouches = event.originalEvent.changedTouches ? event.originalEvent.changedTouches.length : 1;
-
- switch (event.originalEvent.type) {
- case "touchstart": {
- FLAGS.TOUCH_EVENT_STARTED = true;
- type = "BEGIN";
- break;
- }
- case "touchmove": {
- type = "MOVE";
- break;
- }
- case "touchend": {
- type = "END";
- break;
- }
- case "mousedown": {
- FLAGS.TOUCH_EVENT_STARTED = true;
- type = "BEGIN";
- break;
- }
- case "mousemove": {
- type = "MOVE";
- break;
- }
- case "mouseup": {
- type = "END";
- break;
- }
- }
-
- if (FLAGS.TOUCH_EVENT_STARTED ) {
-
- var events = [];
- for(var i = 0; i < changedTouches; i++){
-
- if (event.originalEvent.changedTouches && (event.originalEvent.changedTouches[i].pageX > SDL.SDLVehicleInfoModel.vehicleData.displayResolution.width || event.originalEvent.changedTouches[i].pageY > SDL.SDLVehicleInfoModel.vehicleData.displayResolution.height)) {
- return;
- }
-
- events[i] = {};
- events[i].c = [{}];
-
- events[i].id = event.originalEvent.changedTouches ? event.originalEvent.changedTouches[i].identifier : 0;
- events[i].c[0].x = event.originalEvent.changedTouches ? event.originalEvent.changedTouches[i].pageX : event.originalEvent.pageX;
- events[i].c[0].y = event.originalEvent.changedTouches ? event.originalEvent.changedTouches[i].pageY : event.originalEvent.pageY;
- events[i].ts = [event.timeStamp - SDL.SDLModel.timeStamp];
-
-
-
- }
- FFW.UI.onTouchEvent(type, events);
- }
-
- if (event.originalEvent.type == "mouseup") {
- FLAGS.TOUCH_EVENT_STARTED = false;
- }
- },
-
- /**
- * Method to remove deleted by SDL Core images used in HMI
- * check images came in request from SDLCore like UI.Show, UI.AddCommand, UI.SetGlobalProperties,
- * UI.SeAppIcon, Navigation.ShowConstantTBT, Navigation.UpdateTurnList, UI.ShowNotification
- *
- * @param {Object}
- */
- onFileRemoved: function(params) {
-
- var result = false;
-
- if ((params.fileType === "GRAPHIC_PNG" || params.fileType === "GRAPHIC_BMP" || params.fileType === "GRAPHIC_JPEG") && SDL.SDLController.getApplicationModel(params.appID)) {
- result = SDL.SDLController.getApplicationModel(params.appID).onImageRemoved(params.fileName);
-
- if (SDL.SDLController.getApplicationModel(params.appID).appIcon.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).appIcon.length) {
- SDL.SDLController.getApplicationModel(params.appID).set('appIcon', SDL.SDLModel.defaultListOfIcons.app);
- }
-
- if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams) {
-
- if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon
- && SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value.length) {
- SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.turnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
- SDL.TurnByTurnView.activate(params.appID);
- }
-
- if (SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon
- && SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value.length) {
- SDL.SDLController.getApplicationModel(params.appID).constantTBTParams.nextTurnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
- SDL.TurnByTurnView.activate(params.appID);
- }
- }
-
- if (SDL.SDLAppController.model.appInfo.trackIcon && SDL.SDLAppController.model.appInfo.trackIcon.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.SDLAppController.model.appInfo.trackIcon.length) {
- SDL.SDLAppController.model.appInfo.set('trackIcon', SDL.SDLModel.defaultListOfIcons.trackIcon);
- }
-
- if (SDL.SDLAppController.model.appInfo.mainImage && SDL.SDLAppController.model.appInfo.mainImage.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.SDLAppController.model.appInfo.mainImage.length) {
- SDL.SDLAppController.model.appInfo.set('mainImage', SDL.SDLModel.defaultListOfIcons.trackIcon);
- }
-
- var len = SDL.SDLController.getApplicationModel(params.appID).turnList.length;
- for (var i = 0; i < len; i++) {
- if (!SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon) {
- continue;
- }
- if (SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value.length) {
- SDL.SDLController.getApplicationModel(params.appID).turnList[i].turnIcon.value = SDL.SDLModel.defaultListOfIcons.command;
- }
- }
-
- SDL.TBTTurnList.updateList(params.appID);
-
- if (SDL.SDLController.getApplicationModel(params.appID).softButtons) {
- var len = SDL.SDLController.getApplicationModel(params.appID).softButtons.length;
- for (var i = 0; i < len; i++) {
- if (!SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image) {
- continue;
- }
- if (SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value.length) {
- SDL.SDLController.getApplicationModel(params.appID).softButtons[i].image.value = SDL.SDLModel.defaultListOfIcons.command;
- }
- }
-
- if (params.appID == SDL.SDLAppController.model.appID) {
- SDL.sdlView.innerMenu.refreshItems();
- }
- }
-
- var len = SDL.VRHelpListView.helpList.items.length;
- for (var i = 0; i < len; i++) {
- if (!SDL.VRHelpListView.helpList.items[i].params.icon) {
- continue;
- }
- if (SDL.VRHelpListView.helpList.items[i].params.icon.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.VRHelpListView.helpList.items[i].params.icon.length) {
- SDL.VRHelpListView.helpList.items[i].params.icon = SDL.SDLModel.defaultListOfIcons.command;
- }
- }
-
- SDL.VRHelpListView.helpList.list.refresh();
-
- var len = SDL.InteractionChoicesView.listOfChoices.items.length;
- for (var i = 0; i < len; i++) {
- if (!SDL.InteractionChoicesView.listOfChoices.items[i].params.icon) {
- continue;
- }
- if (SDL.InteractionChoicesView.listOfChoices.items[i].params.icon.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.InteractionChoicesView.listOfChoices.items[i].params.icon.length) {
- SDL.InteractionChoicesView.listOfChoices.items[i].params.icon = SDL.SDLModel.defaultListOfIcons.command;
- }
- }
-
- SDL.InteractionChoicesView.listOfChoices.list.refresh();
-
- var len = SDL.InteractionChoicesView.listWrapper.naviChoises._childViews.length;
- for (var i = 0; i < len; i++) {
- if (!SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon) {
- continue;
- }
- if (SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon.indexOf(params.fileName) != -1
- && params.fileName.length == SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon.length) {
- SDL.InteractionChoicesView.listWrapper.naviChoises._childViews[i].icon = SDL.SDLModel.defaultListOfIcons.command;
- }
- }
-
- SDL.InteractionChoicesView.listWrapper.naviChoises.rerender();
-
- }
-
-
- if (result && SDL.OptionsView.active && SDL.SDLAppController.model.appID == params.appID) {
- SDL.OptionsView.commands.refreshItems();
- }
- },
-
- /**
- * Method to start playing video from streaming video source
- * provided by SDLCore
- *
- * @param {Object}
- */
- 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!"
- );
- }
- });
-
- },
-
- /**
- * Method to stop playing video streaming
- *
- * @param {Number}
- */
- stopStream: function(appID) {
-
- var createVideoView = Ember.View.create({
- templateName: "video",
- template: Ember.Handlebars.compile('<video id="html5Player"></video>')
- }),
- videoChild = null;
-
- SDL.NavigationAppView.videoView.remove();
- SDL.NavigationAppView.videoView.destroy();
-
- SDL.SDLController.getApplicationModel(appID).set('navigationStream', null);
-
- //this.pauseVideo();
-
- videoChild = SDL.NavigationAppView.createChildView(createVideoView);
-
- SDL.NavigationAppView.get('childViews').pushObject(videoChild);
- SDL.NavigationAppView.set('videoView', videoChild);
- },
-
- /**
- * Method to start playing audio from streaming audio source
- * provided by SDLCore
- *
- * @param {Object}
- */
- startAudioStream: function(params) {
-
- 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!"
- );
- }
- });
- },
-
- /**
- * Method to set navigationApp streaming url to current app model
- *
- * @param {Number}
- */
- stoptAudioStream: function(appID) {
-
- SDL.SDLController.getApplicationModel(appID).set('navigationAudioStream', null);
- SDL.StreamAudio.stop();
- },
-
- /**
- * Method to reset navigationApp streaming url from current app model
- */
- playVideo: function(appID){
- if (SDL.SDLController.getApplicationModel(appID).navigationStream !== null) {
-
- SDL.SDLModel.naviVideo = document.getElementById("html5Player");
- SDL.SDLModel.naviVideo.src = SDL.SDLController.getApplicationModel(appID).navigationStream;
- SDL.SDLModel.naviVideo.play();
- }
- },
-
- /**
- * Video player trigger to stop playing video
- */
- pauseVideo: function(){
- if (SDL.SDLModel.naviVideo != null) {
-
- SDL.SDLModel.naviVideo.pause();
- }
- },
-
- /**
- * Method to open Turn By Turn view
- *
- * @param {Object}
- */
- tbtActivate: function(params) {
-
- SDL.SDLController.getApplicationModel(params.appID).set('constantTBTParams', params);
- SDL.SDLController.getApplicationModel(params.appID).set('tbtActivate', true);
-
- if (SDL.SDLAppController.model) {
- SDL.SDLController.activateTBT();
- }
- },
-
- /**
- * Method to set data for Turn List in applications model
- *
- * @param {Object}
- */
- tbtTurnListUpdate: function(params) {
-
- SDL.SDLController.getApplicationModel(params.appID).turnList = params.turnList ? params.turnList : [];
- SDL.SDLController.getApplicationModel(params.appID).turnListSoftButtons = params.softButtons ? params.softButtons : [];
- SDL.TBTTurnList.updateList(params.appID);
- },
-
- /**
- * Method to VRHelpList on UI with request parameters
- * It opens VrHelpList PopUp with current list of readable VR commands
- *
- * @param {Object}
- */
- ShowVrHelp: function(vrHelpTitle, vrHelp) {
-
- SDL.VRHelpListView.showVRHelp(vrHelpTitle, vrHelp);
- },
-
- /**
- * Method to set language for UI component with parameters sent from
- * SDLCore to UIRPC
- *
- * @type {String} lang
- */
- 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);
- }
- },
-
- /**
- * Method to set language for TTS and VR components with parameters sent
- * from SDLCore to UIRPC
- *
- * @type {String} lang
- */
- changeRegistrationTTSVR: function (lang, appID) {
-
- if (SDL.SDLController.getApplicationModel(appID)) {
- SDL.SDLController.getApplicationModel(appID).set('TTSVRLanguage', lang);
- }
- },
-
- /**
- * Method to add activation button to VR commands and set device
- * parameters to model
- *
- * @param {Object}
- */
- onAppRegistered: function (params) {
-
- var applicationType = null,//Default value - NonMediaModel see SDL.SDLController.applicationModels
- app = SDL.SDLController.getApplicationModel(params.appID);
-
- if (app != undefined && app.initialized == false) {
-
- 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.appID, "type": "Application"};
- this.addCommandVR(message);
- }
-
- if (params.isMediaApplication === true) {
-
- applicationType = 0;
- } else if (params.isMediaApplication === false) {
-
- applicationType = 1;
- }
-
- SDL.SDLController.registerApplication(params, applicationType);
-
- 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
- *
- * @param {Object}
- */
- onAppUnregistered: function (params) {
-
- if (SDL.SDLController.getApplicationModel(params.appID)) {
-
- if (params.unexpectedDisconnect) {
- SDL.PopUp.create().appendTo('body').popupActivate("The connection with the " + SDL.SDLController.getApplicationModel(params.appID).appName + " was unexpectedly lost.");
- this.unRegisteredApps.push(params.appID);
- }
-
- if (SDL.SDLController.getApplicationModel(params.appID).activeRequests.uiPerformInteraction) {
- SDL.InteractionChoicesView.deactivate("ABORTED");
- }
- SDL.SDLController.unregisterApplication(params.appID);
- }
- },
-
- /**
- * SDL UI ScrolableMessage activation function dependent of Driver
- * Distraction toggle state
- *
- * @param {Object}
- * params Object with parameters come from SDLCore.
- * @param {Number}
- * messageRequestId Identification of unique request
- */
- onSDLScrolableMessage: function (request, messageRequestId) {
-
- if (!SDL.ScrollableMessage.active) {
- if (SDL.SDLModel.driverDistractionState) {
- SDL.DriverDistraction.activate();
- FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'DD mode is active!');
- } else {
- SDL.ScrollableMessage.activate(SDL.SDLController.getApplicationModel(request.params.appID).appName, request.params, messageRequestId);
- }
- return true;
- } else {
- FFW.UI.sendError(SDL.SDLModel.resultCode["REJECTED"], request.id, request.method, 'Higher priority request is being processed on HMI!');
- return false;
- }
- },
-
- /**
- * setGlobalProperties
- *
- * @param {Object}
- * message Object with parameters come from SDLCore.
- */
- setProperties: function(params) {
-
- if (SDL.SDLController.getApplicationModel(params.appID)) {
- for (var i in params) {
- if (i === "keyboardProperties") {
- if (params[i].language) {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.language', params[i].language);
- }
- if (params[i].keyboardLayout) {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.keyboardLayout', params[i].keyboardLayout);
- }
- if (params[i].keypressMode) {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.keypressMode', params[i].keypressMode);
- }
- if (params[i].limitedCharacterList) {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.limitedCharacterList', params[i].limitedCharacterList);
- } else {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.limitedCharacterList', []);
- }
- if (params[i].autoCompleteText) {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.autoCompleteText', params[i].autoCompleteText);
- } else {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.keyboardProperties.autoCompleteText', '');
- }
- } else {
- SDL.SDLController.getApplicationModel(params.appID).set('globalProperties.' + i, params[i]);
- }
- }
- } else {
- console.error("CriticalError! No app registered with current appID!");
- }
- },
-
- /**
- * Method to call function from DeviceListView to show list of connected
- * devices
- *
- * @param {Object}
- * params
- */
- onGetDeviceList: function (params) {
-
- //SDL.SDLModel.set('connectedDevices', params.deviceList);
- var exist = false;
-
- for (var i = 0; i < params.deviceList.length; i++) {
-
- if (params.deviceList[i].id in SDL.SDLModel.connectedDevices) {
- exist = true;
- }
-
- if (!exist) {
- SDL.SDLModel.connectedDevices[params.deviceList[i].id] = {
- "name": params.deviceList[i].name,
- "id": params.deviceList[i].id,
- "sdlFunctionality": {
- "popUpId": null,
- "allowed": false
- }
- }
- } else {
-
- exist = false;
- }
- }
-
- if (SDL.States.info.devicelist.active) {
- SDL.DeviceListView.ShowDeviceList(params);
- }
-
- SDL.SDLModel.set('deviceSearchProgress', false);
- },
-
- /**
- * SDL UI SetAppIcon handler
- *
- * @param {Object}
- * message
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- onSDLSetAppIcon: function (message, id, method) {
-
- if (!SDL.SDLController.getApplicationModel(message.appID)){
- FFW.UI.sendUIResult(SDL.SDLModel.resultCode["APPLICATION_NOT_REGISTERED"], id, method);
- } else {
-
- var img = new Image();
- img.onload = function () {
-
- // code to set the src on success
- SDL.SDLController.getApplicationModel(message.appID).set('appIcon', message.syncFileName.value);
- FFW.UI.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], id, method);
- };
- img.onerror = function (event) {
-
- // doesn't exist or error loading
- FFW.UI.sendError(SDL.SDLModel.resultCode["INVALID_DATA"], id, method, 'Image does not exist!');
- return false;
- };
-
- img.src = message.syncFileName.value;
- }
- },
-
- /**
- * SDL UI Alert response handler show popup window
- *
- * @param {Object}
- * message Object with parameters come from SDLCore
- * @param {Number}
- * alertRequestId Id of current handled request
- */
- onUIAlert: function (message, alertRequestId) {
-
- if (!SDL.AlertPopUp.active) {
- SDL.AlertPopUp.AlertActive(message, alertRequestId);
- return true;
- } else {
- SDL.SDLController.alertResponse(this.resultCode['REJECTED'], alertRequestId);
- return false;
- }
- },
-
- /**
- * SDL UI PerformInteraction response handler show popup window
- *
- * @param {Object}
- * message Object with parameters come from SDLCore
- */
- uiPerformInteraction: function (message) {
-
- if (!SDL.SDLController.getApplicationModel(message.params.appID).activeRequests.uiPerformInteraction) {
- SDL.SDLController.getApplicationModel(message.params.appID).activeRequests.uiPerformInteraction = message.id;
-
- if (message.params && message.params.vrHelpTitle && message.params.vrHelp) {
-
- SDL.SDLModel.set('interactionData.vrHelpTitle', message.params.vrHelpTitle);
- SDL.SDLModel.set('interactionData.vrHelp', message.params.vrHelp);
- }
-
- SDL.InteractionChoicesView.activate(message);
- SDL.SDLController.VRMove();
-
- return true;
- } else {
-
- FFW.UI.sendError(SDL.SDLModel.resultCode['REJECTED'], message.id, message.method, "UI PerformInterection REJECTED on HMI");
- return false;
- }
- },
-
- /**
- * SDL VR PerformInteraction response handler
- *
- * @param {Object}
- * message Object with parameters come from SDLCore
- */
- vrPerformInteraction: function (message) {
-
- if (!SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
- SDL.SDLModel.vrActiveRequests.vrPerformInteraction = message.id;
- } else {
- FFW.VR.sendError(SDL.SDLModel.resultCode['REJECTED'], message.id, message.method, "VR PerformInterection REJECTED on HMI")
- return;
- }
-
- setTimeout(function(){
- if (SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
- SDL.SDLModel.onPrompt(message.params.timeoutPrompt);
- }
- }, message.params.timeout - 2000); //Magic numer is a platform depended HMI behavior: -2 seconds for timeout prompt
-
- SDL.SDLModel.onPrompt(message.params.initialPrompt);
-
- SDL.SDLModel.interactionData.helpPrompt = message.params.helpPrompt;
-
- if (message.params.grammarID) {
-
- this.set('performInteractionSession', message.params.grammarID);
- SDL.SDLModel.set('VRActive', true);
-
- setTimeout(function(){
- if (SDL.SDLModel.VRActive) {
- if (SDL.SDLAppController.model && SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
- SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['TIMED_OUT']);
- }
-
- SDL.SDLModel.set('VRActive', false);
- }
- }, message.params.timeout);
-
- SDL.InteractionChoicesView.timerUpdate();
- } else {
-
- SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['SUCCESS']);
- }
- },
-
- /**
- * SDL UI Slider response handler show popup window
- *
- * @param {Object}
- * message Object with parameters come from SDLCore
- */
- uiSlider: function (message) {
-
- if (!SDL.SliderView.active) {
- SDL.SDLController.getApplicationModel(message.params.appID).onSlider(message);
- return true;
- } else {
- FFW.UI.sendSliderResult(this.resultCode["REJECTED"], message.id);
- return false;
- }
- },
-
- /**
- * SDL ShowKeyboard show method with incoming parameters of layout, language etc...
- *
- * @param {Object}
- * message Object with parameters come from SDLCore
- */
- uiShowKeyboard: function(element){
- SDL.Keyboard.activate(element);
- },
-
- /**
- * SDL UI AudioPassThru response handler show popup window
- *
- * @param {Object}
- * message Object with parameters come from SDLCore.
- */
- UIPerformAudioPassThru: function(message) {
-
- this.set('AudioPassThruData', message);
- this.set('AudioPassThruState', true);
- },
-
- /**
- * Method ends processing of AudioPassThru and call AudioPassThru UI
- * response handler
- */
- UIEndAudioPassThru: function () {
-
- if (this.AudioPassThruState) {
- FFW.UI.sendUIResult(this.resultCode["SUCCESS"], FFW.UI.endAudioPassThruRequestID, "UI.EndAudioPassThru");
- SDL.SDLController.performAudioPassThruResponse(this.resultCode["SUCCESS"]);
- } else {
- FFW.UI.sendError(this.resultCode["REJECTED"], FFW.UI.endAudioPassThruRequestID, "UI.EndAudioPassThru", "UI.PerformAudioPassThru are not processed at the moment!");
- }
- },
-
- /**
- * Prompt activation
- *
- * @param {Object}
- * @param {Number}
- */
- onPrompt: function (ttsChunks, appID) {
-
- var message = '';
- if (ttsChunks) {
- for (var i = 0; i < ttsChunks.length; i++) {
- message += ttsChunks[i].text + '\n';
- }
- SDL.TTSPopUp.ActivateTTS(message, appID);
- }
- },
-
- /**
- * Play audio file on PlayTone notification
- */
- onPlayTone: function () {
-
- SDL.Audio.play('audio/initial.wav');
- },
-
- /**
- * Prompt deactivation
- */
- TTSStopSpeaking: function () {
- //true parameter makes send error response ABORTED
- FFW.TTS.set('aborted', true);
- SDL.TTSPopUp.DeactivateTTS();
- },
-
- /**
- * SDL DeleteCommand response handler to sent delete command error or normal result
- *
- * @param {Number}
- * @param {Number}
- */
- deleteCommandResponse: function (resultCode, requestID) {
-
- if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
- FFW.UI.sendUIResult(resultCode, requestID, "UI.DeleteCommand");
- } else {
- FFW.UI.sendError(resultCode, requestID, "UI.DeleteCommand", "SubMenu is opened")
- }
- },
-
- /**
- * SDL VR AddCommand response handler add command to voice recognition
- * window
- *
- * @param {Object}
- */
- addCommandVR: function (message) {
-
- if (message.type == "Application") {
-
- SDL.SDLModel.VRCommands.push(message);
- SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, message.appID, message.type);
- } else if ("appID" in message) {
-
- SDL.SDLController.getApplicationModel(message.appID).VRCommands.push(message);
-
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID == message.appID) {
-
- SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, message.appID, message.type, message.grammarID);
- }
- } else {
-
- SDL.SDLModel.VRCommands.push(message);
- SDL.VRPopUp.AddCommand(message.cmdID, message.vrCommands, 0, message.type, message.grammarID);
- }
- },
-
- /**
- * SDL VR DeleteCommand response handler delete command from voice
- * recognition window
- *
- * @param {Number}
- */
- deleteCommandVR: function (request) {
-
- var appModel = SDL.SDLController.getApplicationModel(request.params.appID);
-
- if (appModel.currentSubMenuId != 'top') {
- for (var i in appModel.commandsList) {
- if (appModel.commandsList[i].filterProperty('commandID', request.params.cmdID).length) {
- if (i == appModel.currentSubMenuId) {
-
- FFW.VR.sendError(SDL.SDLModel.resultCode["IN_USE"], request.id, request.method, "SubMenu is currently opened on UI!");
- return;
- }
- }
- }
- }
-
- SDL.VRPopUp.DeleteCommand(request.params.cmdID, request.params.appID);
- var len = appModel.VRCommands.length;
-
- for (var i = len - 1; i >= 0 ; i--) {
- if (appModel.VRCommands[i].appID == request.params.appID &&
- appModel.VRCommands[i].cmdID == request.params.cmdID) {
- appModel.VRCommands.splice(i, 1);
- }
- }
-
- FFW.VR.sendVRResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
-
-
- },
-
- onDeactivateApp: function (target, appID) {
-
- if (SDL.SDLController.getApplicationModel(appID)) {
- /**
- * Close Options menu if opened
- */
- if (SDL.OptionsView.active) {
- SDL.OptionsView.set('active', false);
- }
-
- var dest = target.split('.'), reason;
-
- switch (dest[0]) {
- case 'media':
- {
- reason = 'AUDIO';
- break;
- }
- case "phone":
- {
- reason = 'PHONEMENU';
- break;
- }
- case "navigation":
- {
- reason = 'NAVIGATIONMAP';
- break;
- }
- case "settings":
- {
- reason = 'SYNCSETTINGS';
- break;
- }
- case "call":
- {
- reason = 'PHONECALL';
- break;
- }
- default:
- {
- reason = 'GENERAL';
- break;
- }
- }
-
- if (SDL.SDLModel.stateLimited && reason === 'AUDIO') {
-
- SDL.SDLModel.stateLimited = null;
- SDL.SDLModel.set('limitedExist', false);
- }
-
- SDL.TurnByTurnView.deactivate();
-
- if (!SDL.SDLModel.phoneCallActive) {
- FFW.BasicCommunication.OnAppDeactivated(reason, appID);
- }
- }
- }
-});
diff --git a/src/components/HMI/app/model/sdl/NonMediaModel.js b/src/components/HMI/app/model/sdl/NonMediaModel.js
deleted file mode 100644
index 42ac14bc0c..0000000000
--- a/src/components/HMI/app/model/sdl/NonMediaModel.js
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLNonMediaModel
- * @desc Concrate model for SDL NonMedia application
- * @category Model
- * @filesource app/model/sdl/NonMediaModel.js
- * @version 1.0
- */
-
-SDL.SDLNonMediaModel = SDL.SDLAppModel.extend({
-
- init: function () {
-
- this._super();
-
- var subscribeVIData = {};
-
- for (var key in SDL.SDLVehicleInfoModel.vehicleData) {
- if (key != "externalTemperature") {
- subscribeVIData[key] = false;
- }
- }
-
- this.set('subscribedData', subscribeVIData);
-
- // init properties here
- this.set('appInfo', Em.Object.create({
- field1 : '<field1>',
- field2 : '<field2>',
- field3 : '<field3>',
- field4 : '<field4>',
- mainImage : SDL.SDLModel.defaultListOfIcons.trackIcon,
- image : '',
- customPresets: [
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>',
- '<no definition>'
- ],
- alignment : "text-align:center"
- }));
-
- this.set('activeRequests', Em.Object.create({
- uiPerformInteraction: null
- }));
-
- this.set('constantTBTParams', null);
-
- this.set('VRCommands', []);
- this.set('tbtActivate', false);
- this.set('globalProperties.helpPrompt', []);
- this.set('globalProperties.timeoutPrompt', []);
- this.set('globalProperties.keyboardProperties', Em.Object.create());
- this.set('globalProperties.keyboardProperties.keyboardLayout', 'QWERTY');
- this.set('globalProperties.keyboardProperties.limitedCharacterList', []);
-
- this.set('commandsList', {'top': []});
- this.set('softButtons', []);
- },
-
- /**
- * Method hides sdl activation button and sdl application
- *
- * @param {Number}
- */
- onDeleteApplication: function (appID) {
-
- SDL.NonMediaController.onDeleteApplication(appID);
- },
-
- /**
- * Activate current application model
- */
- turnOnSDL: function () {
-
- SDL.NonMediaController.activateApp(this);
- },
-
- /**
- * Method to clear App OverLay
- */
- clearAppOverLay: function () {
-
- clearInterval(this.timer);
- this.appInfo.set('field1', '');
- this.appInfo.set('field2', '');
- this.appInfo.set('field3', '');
- this.appInfo.set('field4', '');
- this.appInfo.set('alignment', '');
- this.appInfo.set('mainImage', 'images/sdl/audio_icon.jpg');
- this.updateSoftButtons();
- for (i = 0; i < 10; i++) {
- this.appInfo.set('customPresets.' + i, '');
- }
-
- },
-
- /**
- * Applin UI Show handler
- *
- * @param {Object}
- */
- onSDLUIShow: function (params) {
-
- for (var i = 0; i < params.showStrings.length; i++) {
- switch (params.showStrings[i].fieldName) {
- case 'mainField1':
- {
- this.appInfo.set('field1', params.showStrings[i].fieldText);
- break;
- }
- case 'mainField2':
- {
- this.appInfo.set('field2', params.showStrings[i].fieldText);
- break;
- }
- case 'mainField3':
- {
- this.appInfo.set('field3', params.showStrings[i].fieldText);
- break;
- }
- case 'mainField4':
- {
- this.appInfo.set('field4', params.showStrings[i].fieldText);
- break;
- }
- case 'statusBar':
- {
- this.appInfo.set('statusText', params.showStrings[i].fieldText);
- break;
- }
- case 'mediaClock':
- {
- this.appInfo.set('mediaClock', params.showStrings[i].fieldText);
- break;
- }
- case 'mediaTrack':
- {
- this.appInfo.set('mediaTrack', params.showStrings[i].fieldText);
- break;
- }
- default :{
- break;
- }
- }
- }
-
- if (params.alignment) {
- switch (params.alignment) {
- case "CENTERED":
- {
- this.appInfo.set('alignment', "text-align:center");
- break;
- }
- case "LEFT_ALIGNED":
- {
- this.appInfo.set('alignment', "text-align:left");
- break;
- }
- case "RIGHT_ALIGNED":
- {
- this.appInfo.set('alignment', "text-align:right");
- break;
- }
- }
- } else {
-
- this.appInfo.set('alignment', "text-align:center");
- }
-
- 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
- this.appInfo.set('customPresets', []);
- for (var i = 0; i < 10; i++) {
- if (!params.customPresets || (params.customPresets[i] == '' || params.customPresets[i] == null)) {
- this.appInfo.get('customPresets').pushObject('PRESET_' + i);
- } else {
- this.appInfo.get('customPresets').pushObject(params.customPresets[i]);
- }
- }
-
- if ("softButtons" in params) {
- this.updateSoftButtons(params.softButtons);
- }
- },
-
- sdlSetMediaClockTimer: function () {
-
- return;
- }
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/model/sdl/VehicleInfoModel.js b/src/components/HMI/app/model/sdl/VehicleInfoModel.js
deleted file mode 100644
index f9fe33d97c..0000000000
--- a/src/components/HMI/app/model/sdl/VehicleInfoModel.js
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLVehicleInfoModel
- * @desc SDL model with vehicle information used instead of CAN network.
- * VehicleInfoModel is simulation of real CAN network.
- * @category Model
- * @filesource app/model/sdl/SDLVehicleInfoModel.js
- * @version 1.0
- */
-
-SDL.SDLVehicleInfoModel = Em.Object
- .create( {
-
- /**
- * Stored VehicleInfo transmission state Data
- *
- * @type {Array}
- */
- vehicleInfoPRNDL: [
- "PARK",
- "REVERSE",
- "NEUTRAL",
- "DRIVE",
- "SPORT",
- "LOWGEAR",
- "FIRST",
- "SECOND",
- "THIRD",
- "FOURTH",
- "FIFTH",
- "SIXTH"
- ],
-
- /**
- * Data changed in Odometr Input in VehicleInfo popUp
- *
- * @type {String}
- */
- odometrInputBinding: 'this.vehicleData.odometer',
-
- /**
- * PRNDL state value
- *
- * @type {String}
- */
- prndlSelectState: 'PARK',
-
- /**
- * Stored VehicleInfo Data
- *
- * @type {Array}
- */
- ecuDIDData: [
- {
- 'data': "ECU 1 Test Data"
- }, {
- 'data': "ECU 2 Test Data"
- }
- ],
-
- /**
- * Type of current vehicle: make of the vehicle, model of the vehicle,
- * model Year of the vehicle, trim of the vehicle.
- *
- * @type {Object}
- */
- vehicleType: {
- make: "Ford",
- model: "Fiesta",
- modelYear: "2013",
- trim: "SE"
- },
-
- eVehicleDataType:{
- "gps" :"VEHICLEDATA_GPS",
- "speed": "VEHICLEDATA_SPEED",
- "rpm": "VEHICLEDATA_RPM",
- "fuelLevel": "VEHICLEDATA_FUELLEVEL",
- "fuelLevel_State": "VEHICLEDATA_FUELLEVEL_STATE",
- "instantFuelConsumption": "VEHICLEDATA_FUELCONSUMPTION",
- "prndl": "VEHICLEDATA_PRNDL",
- "externalTemperature": "VEHICLEDATA_EXTERNTEMP",
- "tirePressure": "VEHICLEDATA_TIREPRESSURE",
- "odometer": "VEHICLEDATA_ODOMETER",
- "beltStatus": "VEHICLEDATA_BELTSTATUS",
- "bodyInformation": "VEHICLEDATA_BODYINFO",
- "deviceStatus": "VEHICLEDATA_DEVICESTATUS",
- "eCallInfo": "VEHICLEDATA_ECALLINFO",
- "airbagStatus": "VEHICLEDATA_AIRBAGSTATUS",
- "emergencyEvent": "VEHICLEDATA_EMERGENCYEVENT",
- "clusterModes": "VEHICLEDATA_CLUSTERMODESTATUS",
- "myKey": "VEHICLEDATA_MYKEY",
- "driverBraking": "VEHICLEDATA_BRAKING",
- "wiperStatus": "VEHICLEDATA_WIPERSTATUS",
- "headLampStatus": "VEHICLEDATA_HEADLAMPSTATUS",
- "engineTorque":"VEHICLEDATA_ENGINETORQUE",
- "accPedalPosition": "VEHICLEDATA_ACCPEDAL",
- "steeringWheelAngle": "VEHICLEDATA_STEERINGWHEEL"
- },
-
- /**
- * Stored VehicleInfo Data
- *
- * @type {Object}
- */
- vehicleData: {
- 'displayResolution':{
- 'width': 800,
- 'height': 480
- },
- 'speed': 80.08E0,
- 'fuelLevel': 0.2E0,
- 'fuelLevel_State': "UNKNOWN",
- 'instantFuelConsumption': 2.2E0,
- 'tirePressure': {
- 'pressureTelltale': 'OFF',
- 'leftFront': {
- 'status': 'UNKNOWN'
- },
- 'rightFront': {
- 'status': 'UNKNOWN'
- },
- 'leftRear': {
- 'status': 'UNKNOWN'
- },
- 'rightRear': {
- 'status': 'UNKNOWN'
- },
- 'innerLeftRear': {
- 'status': 'UNKNOWN'
- },
- 'innerRightRear': {
- 'status': 'UNKNOWN'
- }
- },
- 'beltStatus': {
- 'driverBeltDeployed': "NOT_SUPPORTED",
- 'passengerBeltDeployed': "NOT_SUPPORTED",
- 'passengerBuckleBelted': "NOT_SUPPORTED",
- 'driverBuckleBelted': "NOT_SUPPORTED",
- 'leftRow2BuckleBelted': "NOT_SUPPORTED",
- 'passengerChildDetected': "NOT_SUPPORTED",
- 'rightRow2BuckleBelted': "NOT_SUPPORTED",
- 'middleRow2BuckleBelted': "NOT_SUPPORTED",
- 'middleRow3BuckleBelted': "NOT_SUPPORTED",
- 'leftRow3BuckleBelted': "NOT_SUPPORTED",
- 'rightRow3BuckleBelted': "NOT_SUPPORTED",
- 'leftRearInflatableBelted': "NOT_SUPPORTED",
- 'rightRearInflatableBelted': "NOT_SUPPORTED",
- 'middleRow1BeltDeployed': "NOT_SUPPORTED",
- 'middleRow1BuckleBelted': "NOT_SUPPORTED"
- },
- 'bodyInformation': {
- 'parkBrakeActive': false,
- 'ignitionStableStatus': "MISSING_FROM_TRANSMITTER",
- 'ignitionStatus': "UNKNOWN",
- 'driverDoorAjar': true,
- 'passengerDoorAjar': true,
- 'rearLeftDoorAjar': true,
- 'rearRightDoorAjar': true
- },
- 'deviceStatus': {
- 'voiceRecOn': false,
- 'btIconOn': false,
- 'callActive': false,
- 'phoneRoaming': false,
- 'textMsgAvailable': false,
- 'battLevelStatus': "NOT_PROVIDED",
- 'stereoAudioOutputMuted': false,
- 'monoAudioOutputMuted': false,
- 'signalLevelStatus': "NOT_PROVIDED",
- 'primaryAudioSource': "NO_SOURCE_SELECTED",
- 'eCallEventActive': false
- },
- 'driverBraking': "NOT_SUPPORTED",
- 'wiperStatus': "NO_DATA_EXISTS",
- 'headLampStatus': {
- "lowBeamsOn": false,
- "highBeamsOn": false,
- "ambientLightSensorStatus": "NIGHT"
- },
- 'engineTorque': 2.5E0,
- 'accPedalPosition': 10.5E0,
- 'steeringWheelAngle': 1.2E0,
- 'myKey': {
- "e911Override": "NO_DATA_EXISTS"
- },
- 'avgFuelEconomy': 0.1,
- 'batteryVoltage': 12.5,
- 'vin': '52-452-52-752',
- 'prndl': 'PARK',
- 'odometer': 23,
- 'batteryPackVoltage': 12.5,
- 'batteryPackCurrent': 7.0,
- 'batteryPackTemperature': 30,
- 'tripOdometer': 0,
- 'genericbinary': '165165650',
- 'satRadioESN': "165165650",
- 'rainSensor': 165165650,
- 'gps': {
- 'longitudeDegrees': 42.5E0,
- 'latitudeDegrees': -83.3E0,
- 'utcYear': 2013,
- 'utcMonth': 2,
- 'utcDay': 14,
- 'utcHours': 13,
- 'utcMinutes': 16,
- 'utcSeconds': 54,
- 'compassDirection': 'SOUTHWEST',
- 'pdop': 8.4E0,
- 'hdop': 5.9E0,
- 'vdop': 3.2E0,
- 'actual': false,
- 'satellites': 8,
- 'dimension': '2D',
- 'altitude': 7.7E0,
- 'heading': 173.99E0,
- 'speed': 2.78E0
- },
- 'eCallInfo': {
- 'eCallNotificationStatus': 'NORMAL',
- 'auxECallNotificationStatus': 'NORMAL',
- 'eCallConfirmationStatus': 'NORMAL'
- },
- 'airbagStatus': {
- 'driverAirbagDeployed': 'NO_EVENT',
- 'driverSideAirbagDeployed': 'NO_EVENT',
- 'driverCurtainAirbagDeployed': 'NO_EVENT',
- 'passengerAirbagDeployed': 'NO_EVENT',
- 'passengerCurtainAirbagDeployed': 'NO_EVENT',
- 'driverKneeAirbagDeployed': 'NO_EVENT',
- 'passengerSideAirbagDeployed': 'NO_EVENT',
- 'passengerKneeAirbagDeployed': 'NO_EVENT'
- },
- 'emergencyEvent': {
- 'emergencyEventType': 'NO_EVENT',
- 'fuelCutoffStatus': 'NORMAL_OPERATION',
- 'rolloverEvent': 'NO_EVENT',
- 'maximumChangeVelocity': 'NO_EVENT',
- 'multipleEvents': 'NO_EVENT'
- },
- 'clusterModeStatus': {
- 'powerModeActive': false,
- 'powerModeQualificationStatus': 'POWER_MODE_EVALUATION_IN_PROGRESS',
- 'carModeStatus': 'FACTORY',
- 'powerModeStatus': 'KEY_OUT'
- }
-
- },
-
- /**
- * Method to set selected state of vehicle transmission to vehicleData
- */
- onPRNDLSelected: function() {
-
- if (this.prndlSelectState) {
- this.set('vehicleData.prndl', this.prndlSelectState);
- }
- }.observes('this.prndlSelectState'),
-
- /**
- * Method calls GetVehicleType response
- *
- * @type {Number}
- */
- getVehicleType: function(id) {
-
- FFW.VehicleInfo.GetVehicleTypeResponse(this.vehicleType, id);
- },
-
- /**
- * SDL VehicleInfo.GetDTCs handler fill data for response about vehicle
- * errors
- *
- * @type {Object} params
- * @type {Number} id
- */
- vehicleInfoGetDTCs: function(params, id) {
-
- var dtc = [], result = "", ecuHeader = 2;
-
- for ( var i = 0; i < 3; i++) {
- dtc.push("line " + i);
- }
-
- result = "SUCCESS";
-
- FFW.VehicleInfo.vehicleInfoGetDTCsResponse(ecuHeader,
- dtc,
- result,
- id);
-
- },
-
- /**
- * SDL VehicleInfo.ReadDID handler send response about vehicle
- * conditions
- *
- * @type {Object} params
- * @type {Number} id
- */
- vehicleInfoReadDID: function(params, id) {
-
- var didResult = [], resultCode = "";
- // magic number used because there is no huge database on HMI of
- // vehicle
- // data
- if (this.ecuDIDData[1].data) {
- resultCode = "SUCCESS";
- } else {
- resultCode = "INVALID_DATA";
- }
-
- for ( var i = 0; i < params.didLocation.length; i++) {
- if (i < 10) {
- didResult[i] = {};
- didResult[i].resultCode = 'SUCCESS';
- didResult[i].didLocation = params.didLocation[i];
- didResult[i].data = '0';
- } else {
- didResult[i] = {};
- didResult[i].resultCode = "VEHICLE_DATA_NOT_AVAILABLE";
- didResult[i].didLocation = params.didLocation[i];
- didResult[i].data = '0';
- }
- }
-
- FFW.VehicleInfo.vehicleInfoReadDIDResponse(didResult,
- resultCode,
- id);
- },
-
- /**
- * Function returns response message to VehicleInfoRPC
- *
- * @type {Object} message
- */
- SubscribeVehicleData: function(message) {
- if (SDL.SDLController.getApplicationModel(message.params.appID)) {
-
- var subscribeVIData = {};
- for (var key in message.params) {
-
- if (key === "clusterModeStatus") {
- key = "clusterModes";
- }
-
- if (key != 'appID' && SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] === true) {
- subscribeVIData[key] = {
- dataType: this.eVehicleDataType[key],
- resultCode: "DATA_ALREADY_SUBSCRIBED"
- };
- } else if (key != 'appID' && key in SDL.SDLController.getApplicationModel(message.params.appID).subscribedData) {
- SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] = true;
- subscribeVIData[key] = {
- dataType: this.eVehicleDataType[key],
- resultCode: "SUCCESS"
- };
- } else if (key === "externalTemperature") {
- subscribeVIData[key] = {
- dataType: this.eVehicleDataType[key],
- resultCode: "VEHICLE_DATA_NOT_AVAILABLE"
- };
- }
- }
- }
- FFW.VehicleInfo.sendVISubscribeVehicleDataResult(SDL.SDLModel.resultCode["SUCCESS"], message.id, message.method, subscribeVIData);
- },
-
- /**
- * Function returns response message to VehicleInfoRPC
- *
- * @type {Object} message
- */
- UnsubscribeVehicleData: function(message) {
- if (SDL.SDLController.getApplicationModel(message.params.appID)) {
-
- var subscribeVIData = {};
- for (var key in message.params) {
-
- if (key === "clusterModeStatus") {
- key = "clusterModes";
- }
-
- if (key != 'appID' && SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] === false) {
- SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] = false;
- subscribeVIData[key] = {
- dataType: this.eVehicleDataType[key],
- resultCode: "DATA_NOT_SUBSCRIBED"
- };
- } else if (key != 'appID' && key in SDL.SDLController.getApplicationModel(message.params.appID).subscribedData) {
- SDL.SDLController.getApplicationModel(message.params.appID).subscribedData[key] = false;
- subscribeVIData[key] = {
- dataType: this.eVehicleDataType[key],
- resultCode: "SUCCESS"
- };
- } else if (key === "externalTemperature") {
- subscribeVIData[key] = {
- dataType: this.eVehicleDataType[key],
- resultCode: "VEHICLE_DATA_NOT_AVAILABLE"
- };
- }
- }
- }
- FFW.VehicleInfo.sendVISubscribeVehicleDataResult(SDL.SDLModel.resultCode["SUCCESS"], message.id, message.method, subscribeVIData);
- },
-
- /**
- * Function returns response message to VehicleInfoRPC
- *
- * @type {Object} message
- */
- getVehicleData: function(message) {
-
- var data = {}
- text = "Params ", result = true;
-
- for ( var key in message.params) {
- if (key != "appID") {
- if (this.vehicleData[key]) {
- data[key] = this.vehicleData[key];
- } else {
- if (!result) {
-
- text += ", " + key;
- } else {
-
- text += key;
- result = false;
- }
- }
- }
- }
-
- text += " are not available";
-
- if (result) {
- FFW.VehicleInfo.sendGetVehicleDataResut(SDL.SDLModel.resultCode["SUCCESS"], message.id, message.method, data);
- } else {
- FFW.VehicleInfo.sendGetVehicleDataError(SDL.SDLModel.resultCode["DATA_NOT_AVAILABLE"], message.id, message.method, text, data);
- }
- },
-
- /**
- * Function send all vehicle conditions on FFW.VehicleInfo.OnVehicleData
- * for notification when data changes
- */
- onVehicleDataChanged: function() {
-
- var appID = null;
-
- for (var i = 0; i < SDL.SDLModel.registeredApps.length; i++) {
- appID = SDL.SDLModel.registeredApps[i].appID;
- if (SDL.SDLController.getApplicationModel(appID).subscribedData["prndl"]) {
-
- var jsonData = {};
- jsonData["prndl"] = this.vehicleData["prndl"];
- FFW.VehicleInfo.OnVehicleData(jsonData);
- return;
- }
- }
-
- }.observes('this.vehicleData.prndl'),
-
- /**
- * Function send all vehicle conditions on FFW.VehicleInfo.OnVehicleData
- * for notification when data changes
- */
- onOdometerDataChanged: function() {
-
- var jsonData = {};
-
- jsonData["odometer"] = parseInt(this.odometrInput);
- FFW.VehicleInfo.OnVehicleData(jsonData);
-
- }.observes('this.odometrInput')
- });
diff --git a/src/components/HMI/app/util/Audio.js b/src/components/HMI/app/util/Audio.js
deleted file mode 100644
index 9684d5b4e4..0000000000
--- a/src/components/HMI/app/util/Audio.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.Audio
- * @desc HTML5 Audio player
- * @category utils
- * @filesource app/util/Audio.js
- * @version 1.0
- */
-
-SDL.Audio = {
-
- audio: new Audio(),
-
- play: function(path) {
-
- this.audio.src = path;
- this.audio.play();
- }
-} \ No newline at end of file
diff --git a/src/components/HMI/app/util/StreamAudio.js b/src/components/HMI/app/util/StreamAudio.js
deleted file mode 100644
index de78abae7f..0000000000
--- a/src/components/HMI/app/util/StreamAudio.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.StreamAudio
- * @desc HTML5 Audio player
- * @category utils
- * @filesource app/util/StreamAudio.js
- * @version 1.0
- */
-
-SDL.StreamAudio = {
-
- audio: new Audio(),
-
- play: function(path) {
-
- this.audio.src = path;
- this.audio.play();
- },
-
- stop: function() {
-
- this.audio.src = "";
- this.audio.pause();
- }
-} \ No newline at end of file
diff --git a/src/components/HMI/app/view/WarningView.js b/src/components/HMI/app/view/WarningView.js
deleted file mode 100644
index 8fa40b4547..0000000000
--- a/src/components/HMI/app/view/WarningView.js
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.WarningViewg
- * @desc Warning representation
- * @category View
- * @filesource app/view/WarningView.js
- * @version 1.0
- */
-
-SDL.warningView = Em.ContainerView
- .extend( {
-
- classNameBindings: [
- 'fade:fadeAnimation:fadeWarning', 'hide:inactive_state',
- ],
-
- elementId: 'warning_view',
-
- childViews: [
- 'content', 'button'
- ],
-
- content: Em.View
- .extend( {
-
- classNames: 'message',
-
- template: Ember.Handlebars
- .compile('<div class="warning_text"> {{SDL.locale.label.view_warning}}</div>'
- + '<div class="text">'
- + '<br>'
- + '<p>{{SDL.locale.label.view_warning_paragraph1}} </p><br>'
- + '<p> {{SDL.locale.label.view_warning_paragraph2}} </p><br>'
- + '</div>')
- }),
-
- button: Em.View.create( {
-
- elementId: 'warning_ok_button',
-
- classNameBindings: [
- 'isReady: visible_display', 'pressed:pressed'
- ],
-
- classNames: [
- 'okbut', 'ffw-button'
- ],
- /**
- * Check for webkit fillmode animation support Android < 4 version
- * doesnt support webkit animation fillmode
- */
- checkForCCS3AnimationSupport: function() {
-
- if (FFW.isAndroid) {
- return $('body')[0].style.webkitAnimationFillMode === '';
- } else {
- return false;
- }
- },
-
- template: Ember.Handlebars.compile('<span>OK</span>'),
-
- /* this method is called when the web part is fully loaded */
- appLoaded: function() {
-
- var self = this;
- /** Show OK Button after 2 second delay */
- setTimeout(function() {
-
- self.set('isReady', true);
- }, 2000);
-
- var components = Em.ContainerView.create({
-
- classNames: 'components',
-
- childViews: [
- 'BasicCommunication',
- 'Buttons',
- 'Navigation',
- 'TTS',
- 'UI',
- 'VI',
- 'VR'
- ],
-
- BasicCommunication: Em.ContainerView.extend({
-
- classNames: 'component',
-
- childViews: [
- 'checkBox',
- 'text'
- ],
-
- checkBox: Em.Checkbox.extend( {
-
- elementId: 'basicCommunicationCheckBox',
-
- classNames: 'basicCommunicationCheckBox item',
-
- checkedBinding: 'FLAGS.BC'
-
- }),
-
- text: SDL.Label.extend({
-
- classNames: 'basicCommunicationText item',
-
- content: 'BasicCommunication'
-
- })
- }),
-
- Buttons: Em.ContainerView.extend({
-
- classNames: 'component',
-
- childViews: [
- 'checkBox',
- 'text'
- ],
-
- checkBox: Em.Checkbox.extend( {
-
- elementId: 'buttonsCheckBox',
-
- classNames: 'buttonsCheckBox item',
-
- checkedBinding: 'FLAGS.Buttons'
-
- }),
-
- text: SDL.Label.extend({
-
- classNames: 'buttonsText item',
-
- content: 'Buttons'
-
- })
- }),
-
- Navigation: Em.ContainerView.extend({
-
- classNames: 'component',
-
- childViews: [
- 'checkBox',
- 'text'
- ],
-
- checkBox: Em.Checkbox.extend( {
-
- elementId: 'navigationCheckBox',
-
- classNames: 'navigationCheckBox item',
-
- checkedBinding: 'FLAGS.Navi'
-
- }),
-
- text: SDL.Label.extend({
-
- classNames: 'navigationText item',
-
- content: 'Navigation'
-
- })
- }),
-
- TTS: Em.ContainerView.extend({
-
- classNames: 'component',
-
- childViews: [
- 'checkBox',
- 'text'
- ],
-
- checkBox: Em.Checkbox.extend( {
-
- elementId: 'ttsCheckBox',
-
- classNames: 'ttsCheckBox item',
-
- checkedBinding: 'FLAGS.TTS'
-
- }),
-
- text: SDL.Label.extend({
-
- classNames: 'ttsText item',
-
- content: 'TTS'
-
- })
- }),
-
- UI: Em.ContainerView.extend({
-
- classNames: 'component',
-
- childViews: [
- 'checkBox',
- 'text'
- ],
-
- checkBox: Em.Checkbox.extend( {
-
- elementId: 'uiCheckBox',
-
- classNames: 'uiCheckBox item',
-
- checkedBinding: 'FLAGS.UI'
-
- }),
-
- text: SDL.Label.extend({
-
- classNames: 'uiText item',
-
- content: 'UI'
-
- })
- }),
-
- VI: Em.ContainerView.extend({
-
- classNames: 'component',
-
- childViews: [
- 'checkBox',
- 'text'
- ],
-
- checkBox: Em.Checkbox.extend( {
-
- elementId: 'viCheckBox',
-
- classNames: 'viCheckBox item',
-
- checkedBinding: 'FLAGS.VI'
-
- }),
-
- text: SDL.Label.extend({
-
- classNames: 'viText item',
-
- content: 'VI'
-
- })
- }),
-
- VR: Em.ContainerView.extend({
-
- classNames: 'component',
-
- childViews: [
- 'checkBox',
- 'text'
- ],
-
- checkBox: Em.Checkbox.extend( {
-
- elementId: 'vrCheckBox',
-
- classNames: 'vrCheckBox item',
-
- checkedBinding: 'FLAGS.VR'
-
- }),
-
- text: SDL.Label.extend({
-
- classNames: 'vrText item',
-
- content: 'VR'
-
- })
- })
-
- });
-
- components.appendTo('#warning_view');
-
- }.observes('SDL.appReady'),
-
- actionDown: function(event) {
-
- this.set('pressed', true);
- },
-
- actionUp: function(event) {
-
- this.set('pressed', false);
-
- var self = this;
-
- 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/climateView.js b/src/components/HMI/app/view/climateView.js
deleted file mode 100644
index 626c2a2353..0000000000
--- a/src/components/HMI/app/view/climateView.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PlayerControllsView
- * @desc Video player visual representation
- * @category View
- * @filesource app/view/player/PlayerView.js
- * @version 1.0
- */
-SDL.ClimateView = Em.ContainerView.create( {
- /** View Id */
- elementId: 'climateView',
-
- classNameBindings:
- [
- 'SDL.States.climate.active:active_state:inactive_state'
- ],
-
- childViews:
- [
- 'windowText'
- ],
-
-
- windowText: SDL.Label.extend( {
-
- classNames: 'windowText',
-
- content: 'Climate'
- } )
-
-} );
diff --git a/src/components/HMI/app/view/home/bottomControls.js b/src/components/HMI/app/view/home/bottomControls.js
deleted file mode 100644
index 46fcb768cf..0000000000
--- a/src/components/HMI/app/view/home/bottomControls.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.BottomControlls
- * @desc BottomControlls module visual representation
- * @category View
- * @filesource app/view/BottomControls.js
- * @version 1.0
- */
-
-SDL.BottomControls = Em.ContainerView.extend( {
-
- elementId: 'app_bottom_controlls',
-
- childViews: [
- 'information', 'home', 'settings'
- ],
-
- information: Em.View.extend( {
- elementId: 'info_but',
- classNameBindings: [
- 'SDL.States.info.active:selected'
- ],
-
- template: Em.Handlebars.compile('<div id="info_but_click"></div>'),
-
- actionDown: function(event) {
-
- if (!SDL.States.info.active) {
- if (SDL.InfoController.activeState === 'info.nonMedia') {
- SDL.NonMediaController.activateCurrentApp();
- } else {
- SDL.States.goToStates(SDL.InfoController.activeState);
- }
- }
- }
- }),
-
- home: Em.View.extend( {
- elementId: 'home_but',
- classNameBindings: [
- 'SDL.States.home.active:selected'
- ],
-
- template: Em.Handlebars.compile('<div id="home_but_click"></div>'),
-
- actionDown: function(event) {
-
- SDL.States.goToStates('home');
- }
- }),
-
- settings: Em.View.extend( {
- elementId: 'setting_but',
-
- classNameBindings: 'SDL.States.settings.active:selected',
-
- template: Em.Handlebars.compile('<div id="setting_but_click"></div>'),
-
- actionDown: function(event) {
-
- if (!SDL.States.settings.active) {
- SDL.States.goToStates(SDL.SettingsController.activeState);
- }
- }
- })
-}); \ 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
deleted file mode 100644
index 3b32d47368..0000000000
--- a/src/components/HMI/app/view/home/controlButtons.js
+++ /dev/null
@@ -1,579 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.controlButtons
- * @desc Climate module visual representation
- * @category View
- * @filesource app/view/home/controlButtons.js
- * @version 1.0
- */
-
-SDL.ControlButtons = Em.ContainerView
- .create( {
-
- elementId: 'app_controlButtons',
-
- childViews: [
- 'VRButton',
- 'buttonControls',
- 'driverDistractionControl',
- 'infoTable',
- 'vehicleInfo',
- 'tbtClientState',
- 'ExitApp',
- 'SystemRequest',
- 'UILanguages',
- 'TTSVRLanguages',
- 'UILanguagesLabel',
- 'TTSVRLanguagesLabel',
- 'appUILanguagesLabel',
- 'appTTSVRLanguagesLabel',
- 'appUILang',
- 'appTTSVRLang',
- 'phoneCall'
- ],
-
- /**
- * Button to initiate phone call emulation on HMI
- */
- phoneCall: SDL.Button.extend( {
- elementId: 'phone_call_button',
-
- classNames: ['phone_call_button', 'button'],
-
- expand: false,
-
- classNameBindings: ['this.expand:expand'],
-
- mouseEnter: function(){
- this.set('expand', true);
- },
-
- mouseLeave: function(){
- this.set('expand', false);
- },
-
- action: 'phoneCall',
-
- target: 'SDL.SettingsController',
-
- text: 'Incoming call!'
- }),
-
- /*
- * Label with name of UILanguages select
- */
- appUILang: SDL.Label.extend( {
-
- elementId: 'appUILang',
-
- classNames: 'appUILang',
-
- contentBinding: 'SDL.SDLAppController.model.UILanguage'
- }),
-
- /*
- * Label with name of TTSVRLanguages select
- */
- appTTSVRLang: SDL.Label.extend( {
-
- elementId: 'appTTSVRLang',
-
- classNames: 'appTTSVRLang',
-
- contentBinding: 'SDL.SDLAppController.model.TTSVRLanguage'
- }),
-
- /*
- * Label with name of UILanguages select
- */
- appUILanguagesLabel: SDL.Label.extend( {
-
- elementId: 'appUILanguagesLabel',
-
- classNames: 'appUILanguagesLabel',
-
- content: 'application UI Languages'
- }),
-
- /*
- * Label with name of TTSVRLanguages select
- */
- appTTSVRLanguagesLabel: SDL.Label.extend( {
-
- elementId: 'appTTSVRLanguagesLabel',
-
- classNames: 'appTTSVRLanguagesLabel',
-
- content: 'application (TTS + VR) Languages'
- }),
-
- /*
- * Label with name of UILanguages select
- */
- UILanguagesLabel: SDL.Label.extend( {
-
- elementId: 'UILanguagesLabel',
-
- classNames: 'UILanguagesLabel',
-
- content: 'UI Languages'
- }),
-
- /*
- * Label with name of TTSVRLanguages select
- */
- TTSVRLanguagesLabel: SDL.Label.extend( {
-
- elementId: 'TTSVRLanguagesLabel',
-
- classNames: 'TTSVRLanguagesLabel',
-
- content: 'TTS + VR Languages'
- }),
-
- /*
- * HMI element Select with list of supported UI component languages
- */
- UILanguages: Em.Select.extend( {
-
- elementId: 'UILanguages',
-
- classNames: 'languageSelect',
-
- contentBinding: 'SDL.SDLModel.sdlLanguagesList',
-
- valueBinding: 'SDL.SDLModel.hmiUILanguage'
- }),
-
- /*
- * HMI element Select with list of supported TTS and VR component
- * languages
- */
- TTSVRLanguages: Em.Select.extend( {
-
- elementId: 'TTSVRLanguages',
-
- classNames: 'languageSelect',
-
- contentBinding: 'SDL.SDLModel.sdlLanguagesList',
-
- valueBinding: 'SDL.SDLModel.hmiTTSVRLanguage'
- }),
-
- /**
- * VehicleInfo button
- */
- vehicleInfo: SDL.Button.create( {
- elementId: 'vehicleInfoButton',
- classNames: 'vehicleInfoButton btn',
- text: 'Vehicle Info',
- action: function() {
-
- // this._super();
- SDL.VehicleInfo.toggleActivity();
- },
- templateName: 'text'
- }),
-
- /**
- * TBT Client State button
- */
- tbtClientState: SDL.Button.create( {
- elementId: 'tbtClientStateButton',
- classNames: 'tbtClientStateButton btn',
- text: 'TBT Client State',
- action: function() {
-
- // this._super();
- SDL.TBTClientStateView.toggleActivity();
- },
- templateName: 'text'
- }),
-
- /**
- * Exit Application button opens Exit Application reasons popup
- */
- ExitApp: SDL.Button.create( {
- elementId: 'exitApp',
- classNames: 'exitApp btn',
- text: 'Exit Application',
- action: function() {
-
- // this._super();
- SDL.ExitApp.toggleActivity();
- },
- templateName: 'text'
- }),
-
- /**
- * Exit Application button opens Exit Application reasons popup
- */
- SystemRequest: SDL.Button.create( {
- elementId: 'systemRequest',
- classNames: 'systemRequest btn',
- text: 'System Request',
- action: function() {
-
- // this._super();
- SDL.SystemRequest.toggleActivity();
- },
- templateName: 'text'
- }),
-
- /**
- * Voice Recognition button
- */
- VRButton: SDL.Button.create( {
- elementId: 'VRButton',
- classNames: 'VRButton',
- action: 'activateVRPopUp',
- target: 'SDL.SDLController'
- }),
-
- infoTable: Em.ContainerView
- .extend( {
- elementId: 'infoTable',
-
- classNames: 'infoTable',
-
- childViews: [
- 'globalPropertiesLabel',
- 'gpHelpData',
- 'gpTimeoutData',
- 'gpAUTOCOMPLETE',
- 'policyURLs'
- ],
-
- globalPropertiesLabel: SDL.Label.extend( {
-
- elementId: 'sdlGPLabel',
-
- classNames: 'sdlGPLabel',
-
- content: 'HELP_PROMPT: TIMEOUT_PROMPT: AUTOCOMPLETE_TEXT: POLICY_GetURLS:'
- }),
-
- policyURLs: SDL.Label.extend( {
-
- elementId: 'policyURLs',
-
- classNames: 'sdlGPData',
-
- contentBinding: 'this.propertiesData',
-
- propertiesData: function() {
-
- var str = '';
- for (var i = 0; i < SDL.SDLModel.policyURLs.length; i++) {
- str += SDL.SDLModel.policyURLs[i] + '; ';
- }
-
- return str;
- }.property('SDL.SDLModel.policyURLs')
- }),
-
- gpHelpData: SDL.Label.extend( {
-
- elementId: 'sdlGPHData',
-
- classNames: 'sdlGPData',
-
- contentBinding: 'this.propertiesData',
-
- propertiesData: function() {
-
- var str = '';
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.helpPrompt) {
- var i = 0;
-
- for (i = 0; i < SDL.SDLAppController.model.globalProperties.helpPrompt.length; i++) {
- str += SDL.SDLAppController.model.globalProperties.helpPrompt[i].text
- + ' ';
- }
- }
- return str;
- }.property('SDL.SDLAppController.model.globalProperties.helpPrompt.@each.text')
- }),
-
- gpTimeoutData: SDL.Label.extend( {
-
- elementId: 'sdlGPTData',
-
- classNames: 'sdlGPData',
-
- contentBinding: 'this.propertiesData',
-
- propertiesData: function() {
-
- var str = '';
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.timeoutPrompt) {
- var i = 0;
- for (i = 0; i < SDL.SDLAppController.model.globalProperties.timeoutPrompt.length; i++) {
- str += SDL.SDLAppController.model.globalProperties.timeoutPrompt[i].text
- + ' ';
- }
- }
-
- return str;
- }.property('SDL.SDLAppController.model.globalProperties.timeoutPrompt.@each.text')
- }),
-
- gpAUTOCOMPLETE: SDL.Label.extend( {
-
- elementId: 'sdlGPAUTOCOMPLETE',
-
- classNames: 'sdlGPData',
-
- contentBinding: 'SDL.SDLAppController.model.globalProperties.keyboardProperties.autoCompleteText',
-
- propertiesData: function() {
-
-// var str = '';
-// if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.timeoutPrompt) {
-// var i = 0;
-// for (i = 0; i < SDL.SDLAppController.model.globalProperties.timeoutPrompt.length; i++) {
-// str += SDL.SDLAppController.model.globalProperties.timeoutPrompt[i].text
-// + ' ';
-// }
-// }
-//
-// return str;
- }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.autoCompleteText.@each')
- })
- }),
-
- driverDistractionControl: Em.ContainerView.extend( {
- elementId: 'driverDistractionControl',
-
- classNames: 'driverDistractionControl',
-
- childViews: [
- 'driverDistractionLabel', 'driverDistractionCheckBox'
- ],
-
- driverDistractionLabel: SDL.Label.extend( {
-
- elementId: 'driverDistractionControlLabel',
-
- classNames: 'driverDistractionControlLabel',
-
- content: 'DD'
- }),
-
- driverDistractionCheckBox: Em.Checkbox.extend( {
-
- elementId: 'driverDistractionControlCheckBox',
-
- classNames: 'driverDistractionControlCheckBox',
-
- checkedBinding: 'SDL.SDLModel.driverDistractionState'
-
- })
- }),
-
- buttonControls: Em.ContainerView.extend( {
- elementId: 'buttonControls',
-
- classNames: 'buttonControls',
-
- childViews: [
- 'ContainerControlls',
- 'OneBtn',
- 'TwoBtn',
- 'ThreeBtn',
- 'FourBtn',
- 'FiveBtn',
- 'SixBtn',
- 'SevenBtn',
- 'EightBtn',
- 'NineBtn',
- 'ZiroBtn'
- ],
-
- ContainerControlls: Em.ContainerView.extend( {
- elementId: 'ContainerControlls',
-
- classNames: 'ContainerControlls',
-
- childViews: [
- 'UpBtn', 'DownBtn', 'LeftBtn', 'RightBtn', 'OkBtn'
- ],
-
- /** Up button */
- UpBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'TUNEUP',
- classNames: 'UpBtn',
- time: 0,
- presetName: 'TUNEUP'
- }),
-
- /** Down button */
- DownBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'TUNEDOWN',
- classNames: 'DownBtn',
- time: 0,
- presetName: 'TUNEDOWN'
- }),
-
- /** Left button */
- LeftBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'SEEKLEFT',
- classNames: 'LeftBtn',
- time: 0,
- presetName: 'SEEKLEFT'
- }),
-
- /** Right button */
- RightBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'SEEKRIGHT',
- classNames: 'RightBtn',
- time: 0,
- presetName: 'SEEKRIGHT'
- }),
-
- /** Ok button */
- OkBtn: SDL.Button.create( {
- elementId: 'OK',
- classNames: 'OkBtn',
- time: 0,
- presetName: 'OK',
- actionDown: function() {
-
- this._super();
- SDL.SDLController
- .onSoftButtonOkActionDown(this.presetName);
- },
- actionUp: function() {
-
- this._super();
- SDL.SDLController
- .onSoftButtonOkActionUp(this.presetName);
- }
- })
- }),
-
- /** One button */
- OneBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_1',
- classNames: 'OneBtn btnNotPressed',
- text: '1',
- time: 0,
- presetName: 'PRESET_1',
- templateName: 'text'
- }),
-
- /** Two button */
- TwoBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_2',
- classNames: 'TwoBtn btnNotPressed',
- text: '2',
- time: 0,
- presetName: 'PRESET_2',
- templateName: 'text'
- }),
-
- /** Three button */
- ThreeBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_3',
- classNames: 'ThreeBtn btnNotPressed',
- text: '3',
- time: 0,
- presetName: 'PRESET_3',
- templateName: 'text'
- }),
-
- /** Four button */
- FourBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_4',
- classNames: 'FourBtn btnNotPressed',
- text: '4',
- time: 0,
- presetName: 'PRESET_4',
- templateName: 'text'
- }),
-
- /** Five button */
- FiveBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_5',
- classNames: 'FiveBtn btnNotPressed',
- text: '5',
- time: 0,
- presetName: 'PRESET_5',
- templateName: 'text'
- }),
-
- /** One button */
- SixBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_6',
- classNames: 'SixBtn btnNotPressed',
- text: '6',
- time: 0,
- presetName: 'PRESET_6',
- templateName: 'text'
- }),
-
- /** One button */
- SevenBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_7',
- classNames: 'SevenBtn btnNotPressed',
- text: '7',
- time: 0,
- presetName: 'PRESET_7',
- templateName: 'text'
- }),
-
- /** One button */
- EightBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_8',
- classNames: 'EightBtn btnNotPressed',
- text: '8',
- time: 0,
- presetName: 'PRESET_8',
- templateName: 'text'
- }),
-
- /** One button */
- NineBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_9',
- classNames: 'NineBtn btnNotPressed',
- text: '9',
- time: 0,
- presetName: 'PRESET_9',
- templateName: 'text'
- }),
-
- /** One button */
- ZiroBtn: SDL.Button.create(SDL.PresetEvents, {
- elementId: 'PRESET_0',
- classNames: 'ZiroBtn btnNotPressed',
- text: '0',
- time: 0,
- presetName: 'PRESET_0',
- templateName: 'text'
- })
- })
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusClimateView.js b/src/components/HMI/app/view/home/statusClimateView.js
deleted file mode 100644
index 01b6dc636b..0000000000
--- a/src/components/HMI/app/view/home/statusClimateView.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.StatusClimateView
- * @desc Climate statusbar visual representation
- * @category View
- * @filesource app/view/climate/StatusClimateView.js
- * @version 1.0
- */
-
-SDL.StatusClimateView = Em.ContainerView.extend( {
-
- elementId: 'status_climate',
-
- classNames: [
- 'status_bar'
- ],
-
- /** Climate components */
- childViews: [
- 'statusHome'
- ],
-
- /** Label for Home screen */
- statusHome: SDL.Label.create( {
- elementId: 'status_climate_label',
-
- classNames: [
- 'visible'
- ],
-
- content: 'Climate'
- }),
-
- /**
- * Select phone state should be called when user press phone statusbar
- */
- actionUp: function(event) {
-
- SDL.States.goToStates('climate');
- }
-
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusInfoView.js b/src/components/HMI/app/view/home/statusInfoView.js
deleted file mode 100644
index 1241d87c39..0000000000
--- a/src/components/HMI/app/view/home/statusInfoView.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.StatusInfoView
- * @desc Component for Information Status bar
- * @category view
- * @filesource app/view/home/statusNavigationView.js
- * @version 1.0
- */
-SDL.StatusInfoView = Em.ContainerView.extend( {
- /** View Id */
- elementId: 'status_info',
-
- classNames: [
- 'status_bar', 'hidden'
- ],
-
- classNameBindings: [
- 'SDL.States.info.active:selected'
- ],
-
- /** Navigation components */
- childViews: [
- 'statusHome'
- ],
-
- /** Label for Home screen */
- statusHome: SDL.Label.create( {
- elementId: 'status_info_label',
- content: 'Information'
- }),
-
- actionUp: function(event) {
-
- SDL.States.goToStates(SDL.InfoController.activeState);
- }
-}); \ 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
deleted file mode 100644
index bc94c9e22f..0000000000
--- a/src/components/HMI/app/view/home/statusMediaView.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.StatusMediaView
- * @desc Component for Media Status bar
- * @category view
- * @filesource app/view/media/StatusMediaView.js
- * @version 1.0
- */
-SDL.StatusMediaView = Em.ContainerView
- .extend( {
-
- elementId: 'media_status',
-
- classNameBindings: [
- 'SDL.States.media.active:selected'
- ],
-
- /** Climate components */
- childViews: [
- 'statusHome', 'statusInfo'
- ],
-
- /** Label for Home screen */
- statusHome: SDL.Label.extend( {
- elementId: 'media_status_homestatus',
- classNameBindings: [
- 'SDL.States.home.active:visible'
- ],
- contentBinding: Ember.Binding
- .oneWay('SDL.locale.label.view_mediaStatus_entertainment')
- }),
-
- statusInfo: Em.ContainerView
- .extend( {
- elementId: 'media_status_radio_container',
-
- childViews: [
- 'info'
- ],
-
- info: Em.View
- .extend( {
- elementId: 'media_status_radio_info',
- controlerBinding: 'SDL.MediaController',
- /** Bind class for visual representation */
- classNameBindings: [
- 'SDL.States.home.active:hidden_display:visible_display'
- ],
- /** Define module layout */
- template: Em.Handlebars
- .compile('<div class="statusInfo">'
- + '<div class="station">'
- + '<span {{bindAttr class="SDL.CDModel.active:visible_display"}}>{{SDL.CDModel.statusBar}}</span>'
- + // title
- '<span {{bindAttr class="SDL.SDLModel.limitedExist:visible_display"}}>{{SDL.SDLModel.applicationStatusBar}}</span>'
- + // SDL
- '</div>'
- + '<div class="icon cdIco"'
- + '{{bindAttr class="SDL.CDModel.active:cdIco"}}'
- + // CD
- // icon
- '{{bindAttr class="SDL.SDLModel.limitedExist:appIco"}}>'
- + // SDL
- '</div>' + '</div>')
- })
- }),
- actionUp: function(event) {
-
- if (SDL.MediaController.activeState.indexOf('media.sdlmedia') >= 0) {
- SDL.SDLMediaController.activateCurrentApp();
- } else {
- SDL.States.goToStates(SDL.MediaController.activeState);
- }
- }
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusNavigationView.js b/src/components/HMI/app/view/home/statusNavigationView.js
deleted file mode 100644
index e1d5bac3df..0000000000
--- a/src/components/HMI/app/view/home/statusNavigationView.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.StatusNavigationView
- * @desc Component for Navigation Status bar
- * @category view
- * @filesource app/view/home/statusNavigationView.js
- * @version 1.0
- */
-SDL.StatusNavigationView = Em.ContainerView.extend( {
- /** View Id */
- elementId: 'status_nav',
-
- classNames: 'status_bar',
-
- /** Navigation components */
- childViews: [
- 'statusHome'
- ],
-
- /** Label for Home screen */
- statusHome: SDL.Label.create( {
- elementId: 'navigation_status_label',
- classNames: 'visible',
- content: 'Navigation'
- }),
-
- /**
- * Select phone state should be called when user press phone statusbar
- */
- actionUp: function(event) {
-
- SDL.States.goToStates('navigation');
- }
-
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/statusPhoneView.js b/src/components/HMI/app/view/home/statusPhoneView.js
deleted file mode 100644
index 32fb878608..0000000000
--- a/src/components/HMI/app/view/home/statusPhoneView.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.StatusPhoneView
- * @desc Phone statusbar visual representation
- * @category View
- * @filesource app/view/phone/StatusPhoneView.js
- * @version 1.0
- */
-
-SDL.StatusPhoneView = Em.ContainerView.extend( {
-
- elementId: 'status_phone',
-
- classNames: [
- 'status_bar'
- ],
-
- /** Bind class for visual representation */
- classNameBindings: [
- 'SDL.States.phone.active:selected'
- ],
-
- /** Climate components */
- childViews: [
- 'statusHome'
- ],
-
- /** Label for Home screen */
- statusHome: SDL.Label.extend( {
- elementId: 'status_phone_label',
-
- classNames: 'visible',
-
- content: 'Phone'
- }),
-
- /**
- * Select phone state should be called when user press phone statusbar
- */
- actionUp: function(event) {
-
- SDL.States.goToStates('phone.dialpad');
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/home/topControls.js b/src/components/HMI/app/view/home/topControls.js
deleted file mode 100644
index 6eb9323b32..0000000000
--- a/src/components/HMI/app/view/home/topControls.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.TopControls
- *
- * @desc Component for Home top controls
- *
- * @category view
- * @filesource app/view/home/topControls.js
- * @version 1.0
- */
-
-SDL.TopControls = Em.ContainerView.extend( {
-
- elementId: 'app_top_menu_cont',
-
- childViews: [
- 'controls'
- ],
-
- controls: Em.ContainerView.extend( {
- elementId: 'top_controls',
-
- childViews: [
- 'clock'
- ],
-
- clock: Em.View.extend( {
- elementId: 'clock',
-
- template: Em.Handlebars
- .compile('<div id="time_num">1:47 86°</div>')
-
- })
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/homeView.js b/src/components/HMI/app/view/homeView.js
deleted file mode 100644
index 4663996afc..0000000000
--- a/src/components/HMI/app/view/homeView.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.HomeView
- * @desc Home screen visual representation
- * @category View
- * @filesource app/view/home/HomeView.js
- * @version 1.0
- */
-
-SDL.HomeView = Em.ContainerView.create( {
-
- classNameBindings: 'SDL.States.home.active:active_state:inactive_state',
-
- elementId: 'home'
-} );
diff --git a/src/components/HMI/app/view/info/alertsView.js b/src/components/HMI/app/view/info/alertsView.js
deleted file mode 100644
index 6e4e935f58..0000000000
--- a/src/components/HMI/app/view/info/alertsView.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InfoAlertsView
- * @desc Info Alerts module visual representation
- * @category View
- * @filesource app/view/sinfo/InfoAlertsView.js
- * @version 1.0
- */
-
-SDL.InfoAlertsView = Em.ContainerView.create( {
- /** Bind class for visual representation */
- classNameBindings: [
- 'SDL.States.info.alerts.active:active_state:inactive_state'
- ],
-
- elementId: 'info_alerts',
-
- childViews: [
- 'listCaption', 'mainlist', 'rightlist'
- ],
-
- listCaption: SDL.LabelPlusToggleButton.extend( {
- elementId: 'info_alerts_listCaption',
- labelContentBinding: 'SDL.locale.label.view_info_alerts_sort',
- tButtonValue: 0,
- tButtonRange: 2,
- tButtonLabelsBinding: 'SDL.locale.label.view_info_alerts_dateIcon',
- labelDisabled: true,
- tButtonDisabled: true
- }),
-
- mainlist: SDL.List.extend( {
-
- elementId: 'info_alerts_list',
-
- itemsOnPage: 6,
-
- items: [
- {
- type: SDL.Label,
-
- params: {
- disabled: true
- }
- }, {
- type: SDL.Button,
- params: {
- classNames: [
- 'ember-view ffw-button notpressed list-item disabled active'
- ],
- textBinding: 'SDL.locale.label.view_info_alerts_911Assist',
- templateName: 'rightIcon',
- icon: 'images/info/ico_emergcyAndEnvelope.png',
- righticon: 'images/info/ico_arrowLock.png',
- disabled: true
- }
- }
- ]
- }),
-
- rightlist: SDL.List.extend( {
-
- elementId: 'info_alerts_rightList',
-
- itemsOnPage: 5,
-
- disableScrollbar: true,
-
- items: [
- {
- type: SDL.Button,
- params: {
- className: 'button',
- textBinding: 'SDL.locale.label.view_info_alerts_view',
- disabled: true
- }
- }, {
- type: SDL.Button,
- params: {
- className: 'button',
- textBinding: 'SDL.locale.label.view_info_alerts_delete',
- disabled: true
- }
- }, {
- type: SDL.Button,
- params: {
- className: 'button',
- textBinding: 'SDL.locale.label.view_info_alerts_deleteAll',
- disabled: true
- }
- }
- ]
- })
-}); \ 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
deleted file mode 100644
index 81d1ce5104..0000000000
--- a/src/components/HMI/app/view/info/appsView.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InfoAppsview
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/info/AppsView.js
- * @version 1.0
- */
-
-SDL.InfoAppsView = Em.ContainerView
- .create( {
-
- elementId: 'info_apps',
-
- classNameBindings: [
- 'SDL.States.info.apps.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'vehicleHealthReport',
- 'Asist911',
- 'installButton',
- 'findNewApps',
- 'getDeviceList',
- 'listOfApplications'
- ],
-
- /**
- * Function to add application to application list
- */
- showAppList: function() {
-
- this.get('listOfApplications.list').removeAllChildren();
-
- this.listOfApplications.list.refresh();
-
- var i, apps = SDL.SDLModel.updatedAppsList, btn, appIndex;
-
- for (i = 0; i < apps.length; i++) {
-
- 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));
- }
-
- },
-
- vehicleHealthReport: SDL.Button
- .extend( {
- goToState: 'vehicle.healthReport',
- classNames: 'button vehicleHealthReport leftButtons',
- icon: 'images/info/ico_vehicle.png',
- textBinding: 'SDL.locale.label.view_info_apps_vehicle_VehicleHealthReport',
- elementId: 'infoAppsVehicleHealthReport',
- arrow: true,
- onDown: false
- }),
-
- Asist911: SDL.Button.extend( {
- goToState: 'help.helpAssist',
- classNames: 'button Asist911 leftButtons',
- icon: 'images/info/ico_assist.png',
- textBinding: 'SDL.locale.label.view_info_apps_911Assist',
- elementId: 'infoAppsAsist911',
- arrow: true,
- onDown: false
- }),
-
- installButton: SDL.Button
- .extend( {
- goToState: 'settings.system.installApplications',
- icon: 'images/info/ico_info_install.png',
- textBinding: 'SDL.locale.label.view_info_apps_vehicle_InstallApplicationsUp',
- elementId: 'infoAppsInstallButton',
- classNames: 'button installButton leftButtons',
- arrow: true,
- onDown: false
- }),
-
- findNewApps: SDL.Button
- .extend( {
- goToState: 'settings.system.installApplications',
- icon: 'images/sdl/new_apps.png',
- textBinding: 'SDL.locale.label.view_info_apps_vehicle_FindNewApplications',
- elementId: 'infoAppsFindNewApps',
- classNames: 'button findNewApps leftButtons',
- arrow: true,
- action: 'findNewApps',
- target: 'SDL.SDLController',
- onDown: false
- }),
-
- getDeviceList: SDL.Button
- .extend( {
- icon: 'images/sdl/devices.png',
- textBinding: 'SDL.locale.label.view_info_apps_vehicle_GetDeviceList',
- elementId: 'infoAppsGetDeviceList',
- classNames: 'button getDeviceList leftButtons',
- arrow: true,
- action: 'onGetDeviceList',
- target: 'SDL.SDLController',
- onDown: false
- }),
-
- listOfApplications: SDL.List.extend( {
-
- elementId: 'info_apps_list',
-
- itemsOnPage: 5,
-
- /** Items */
- items: new Array()
- })
- });
diff --git a/src/components/HMI/app/view/info/calendarView.js b/src/components/HMI/app/view/info/calendarView.js
deleted file mode 100644
index 235938a90e..0000000000
--- a/src/components/HMI/app/view/info/calendarView.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InfoCalendarView
- * @desc Info Calendar module visual representation
- * @category View
- * @filesource app/view/sinfo/CalendarView.js
- * @version 1.0
- */
-
-SDL.InfoCalendarView = Em.View
- .create( {
- /** Bind class for visual representation */
- classNameBindings: [
- 'SDL.States.info.calendar.active:active_state:inactive_state'
- ],
-
- elementId: 'info_calendar',
-
- template: Ember.Handlebars
- .compile('<div class="inner-wrapper">'
- + '<div class="label-20 disabled date">{{SDL.locale.label.view_info_calendar_date}}</div>'
- +
-
- '{{view SDL.Button '
- + 'class= "today button" '
- + 'textBinding="SDL.locale.label.view_info_calendar_today" '
- + 'disabled=true '
- + '}}'
- +
-
- '<div class="day day-1">{{SDL.locale.label.view_info_calendar_day1}}</div>'
- + '<div class="day day-2">{{SDL.locale.label.view_info_calendar_day2}}</div>'
- + '<div class="day day-3">{{SDL.locale.label.view_info_calendar_day3}}</div>'
- + '<div class="day day-4">{{SDL.locale.label.view_info_calendar_day4}}</div>'
- + '<div class="day day-5">{{SDL.locale.label.view_info_calendar_day5}}</div>'
- + '<div class="day day-6">{{SDL.locale.label.view_info_calendar_day6}}</div>'
- + '<div class="day day-7 active">{{SDL.locale.label.view_info_calendar_day7}}</div>'
- +
-
- '<div class="c-btn disabled btn-1">1</div>'
- + '<div class="c-btn disabled btn-8">8</div>'
- + '<div class="c-btn disabled btn-15">15</div>'
- + '<div class="c-btn disabled btn-22">22</div>'
- + '<div class="c-btn disabled btn-29">29</div>' +
-
- '<div class="c-btn disabled btn-7">7</div>'
- + '<div class="c-btn disabled btn-14">14</div>'
- + '<div class="c-btn disabled btn-21">21</div>'
- + '<div class="c-btn disabled active btn-28">28</div>' +
-
- '<div class="c-btn disabled btn-6">6</div>'
- + '<div class="c-btn disabled btn-13">13</div>'
- + '<div class="c-btn disabled btn-20">20</div>'
- + '<div class="c-btn disabled btn-27">27</div>' +
-
- '<div class="c-btn disabled btn-5">5</div>'
- + '<div class="c-btn disabled btn-12">12</div>'
- + '<div class="c-btn disabled btn-19">19</div>'
- + '<div class="c-btn disabled btn-26">26</div>' +
-
- '<div class="c-btn disabled btn-4">4</div>'
- + '<div class="c-btn disabled btn-11">11</div>'
- + '<div class="c-btn disabled btn-18">18</div>'
- + '<div class="c-btn disabled btn-25">25</div>' +
-
- '<div class="c-btn disabled btn-3">3</div>'
- + '<div class="c-btn disabled btn-10">10</div>'
- + '<div class="c-btn disabled btn-17">17</div>'
- + '<div class="c-btn disabled btn-24">24</div>'
- + '<div class="c-btn disabled btn-31">31</div>' +
-
- '<div class="c-btn disabled btn-2">2</div>'
- + '<div class="c-btn disabled btn-9">9</div>'
- + '<div class="c-btn disabled btn-16">16</div>'
- + '<div class="c-btn disabled btn-23">23</div>'
- + '<div class="c-btn disabled btn-30">30</div>' +
-
- '</div>')
-
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/devicelistView.js b/src/components/HMI/app/view/info/devicelistView.js
deleted file mode 100644
index 5bd6b8e686..0000000000
--- a/src/components/HMI/app/view/info/devicelistView.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DeviceListView
- * @desc Media App Options module visual representation
- * @category View
- * @filesource app/view/media/devicelistView.js
- * @version 1.0
- */
-
-SDL.DeviceListView = Em.ContainerView.create( {
-
- classNames: [
- 'info_apps_deviceList_view'
- ],
-
- classNameBindings: [
- 'SDL.States.info.devicelist.active:active_state:inactive_state'
- ],
-
- /**
- * View Id
- */
- elementId: 'info_apps_deviceList_view',
-
- /**
- * View Components
- */
- childViews: [
- 'backButton',
- 'listOfDevices',
- 'deviceListLabel',
- 'progress'
- ],
-
- /**
- * Animation of search devices progress
- */
- progress: Em.View.extend( {
- classNames: [
- 'progress'
- ],
- classNameBindings: ['SDL.SDLModel.deviceSearchProgress:progress']
- }),
-
-
- /**
- * Button to return to previous view
- */
- backButton: SDL.Button.extend( {
- classNames: [
- 'backButton', 'button'
- ],
- action: 'turnChangeDeviceViewBack',
- target: 'SDL.SDLController',
- icon: 'images/media/ico_back.png'
- }),
-
- /**
- * Label in title
- */
- deviceListLabel: SDL.Label.extend( {
-
- elementId: 'deviceListLabel',
-
- classNames: 'deviceListLabel',
-
- content: 'Change Devices'
- }),
-
- /**
- * Function calls when notification from RPC comes and creates buttons to
- * choose devices
- */
- ShowDeviceList: function(params) {
-
- this.clearDeviceList();
-
- var i, len = params.deviceList.length;
- for (i = 0; i < len; i++) {
- this.get('listOfDevices.list.childViews').pushObject(SDL.Button
- .create( {
- deviceName: params.deviceList[i].name,
- icon: params.deviceList[i].icon,
- text: params.deviceList[i].name,
- classNames: 'ffw-button notpressed list-item',
- templateName: params.deviceList[i].icon ? 'rightIcon'
- : 'text',
- action: 'onDeviceChoosed',
- target: 'SDL.SDLController',
- onDown: false,
- id: params.deviceList[i].id
- }));
- }
- },
-
- /**
- * Function calls each time when user enters Change Device menu and clear
- * all old data about devices
- */
- clearDeviceList: function() {
-
- this.get('listOfDevices.list').removeAllChildren();
- this.listOfDevices.rerender();
- },
-
- /**
- * List for option on DeviceListView screen
- */
- listOfDevices: SDL.List.extend( {
-
- elementId: 'info_apps_deviceList_list',
-
- itemsOnPage: 5,
-
- /** Items array */
- items: []
- })
-});
diff --git a/src/components/HMI/app/view/info/nonMediaView.js b/src/components/HMI/app/view/info/nonMediaView.js
deleted file mode 100644
index 12dd8a654e..0000000000
--- a/src/components/HMI/app/view/info/nonMediaView.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InfoNonMedia
- * @desc NonMedia application visual representation
- * @category View
- * @filesource app/view/info/nonMedia.js
- * @version 1.0
- */
-
-SDL.InfoNonMedia = Em.ContainerView
- .create( {
-
- elementId: 'info_nonMedia',
-
- controller: SDL.SDLAppController,
-
- childViews: [
- 'content'
- ],
-
- classNameBindings: [
- 'this.activeState:active_state:inactive_state'
- ],
-
- activeState: function(){
- if (SDL.TurnByTurnView.activeTBT) {
- return false;
- } else if (SDL.States.info.nonMedia.active) {
- return true;
- } else {
- return false;
- }
- }.property('SDL.States.info.nonMedia.active', 'SDL.TurnByTurnView.activeTBT'),
-
- content: Em.ContainerView
- .extend( {
- classNames: [
- 'inner_content'
- ],
-
- childViews: [
- 'deviceName', 'image', 'fields', 'innerMenu', 'presets'
- ],
-
- /**
- * Deactivate View
- */
- deactivate: function() {
-
- SDL.States.goToStates('info.apps');
- },
-
- deviceName: SDL.Label.extend( {
-
- classNames: [
- 'app_title'
- ],
-
- contentBinding: 'SDL.SDLAppController.model.deviceName'
- }),
-
- image: Em.View
- .extend( {
-
- classNames: [
- 'app_image'
- ],
-
- template: Ember.Handlebars
- .compile('<img width="150px" {{bindAttr src="SDL.SDLAppController.model.appInfo.mainImage"}}>')
- }),
-
- fields: Em.ContainerView.extend( {
-
- classNames: [
- 'app_fields'
- ],
-
- childViews: [
- 'field1', 'field2', 'field3', 'field4'
- ],
-
- field1: SDL.Label.extend( {
- contentBinding: 'controller.model.appInfo.field1',
- attributeBindings: ["style"],
- style: function(){
- if (SDL.SDLAppController.model) {
- return SDL.SDLAppController.model.appInfo.alignment;
- } else {
- return null;
- }
- }.property("SDL.SDLAppController.model.appInfo.alignment")
- }),
-
- field2: SDL.Label.extend( {
- contentBinding: 'controller.model.appInfo.field2',
- attributeBindings: ["style"],
- style: function(){
- if (SDL.SDLAppController.model) {
- return SDL.SDLAppController.model.appInfo.alignment;
- } else {
- return null;
- }
- }.property("SDL.SDLAppController.model.appInfo.alignment")
- }),
-
- field3: SDL.Label.extend( {
- contentBinding: 'controller.model.appInfo.field3'
- }),
-
- field4: SDL.Label.extend( {
- contentBinding: 'controller.model.appInfo.field4'
- })
-
- }),
-
- innerMenu: SDL.MenuList
- .extend( {
-
- refreshItems: function() {
-
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID == SDL.NonMediaController.currentAppId) {
- this
- .addItems(SDL.SDLAppController.model.softButtons,
- SDL.SDLAppController.model.appID);
- }
- }
- .observes('SDL.SDLAppController.model.softButtons.@each'),
-
- groupName: "NonMediaView",
-
- content: Em.ContainerView.extend( {
-
- classNames: [
- 'content'
- ],
-
- attributeBindings: [
- 'parentView.contentPositon:style'
- ],
-
- childViews: [
- 'optionsButton'
- ],
-
- optionsButton: SDL.Button.extend( {
- text: 'Options',
-
- templateName: 'arrow',
-
- action: 'openCommandsList',
- target: 'SDL.SDLAppController'
- })
- })
- }),
-
- presets: Em.ContainerView
- .extend( {
- classNames: [
- 'presets'
- ],
-
- classNameBindings: [
- 'hidden'
- ],
-
- hidden: function() {
-
- if (SDL.SDLAppController.model) { return !Boolean(SDL.SDLAppController.model
- .get('appInfo.customPresets').length); }
-
- }
- .property('SDL.SDLAppController.model.appInfo.customPresets.@each'),
-
- childViews: [
- 'perset1',
- 'perset2',
- 'perset3',
- 'perset4',
- 'perset5',
- 'perset6',
- 'perset7',
- 'perset8',
- 'perset9',
- 'perset10'
- ],
-
- perset1: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.0',
- presetName: 'PRESET_0',
- templateName: 'text'
- }),
- perset2: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.1',
- presetName: 'PRESET_1',
- templateName: 'text'
- }),
- perset3: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.2',
- presetName: 'PRESET_2',
- templateName: 'text'
- }),
- perset4: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.3',
- presetName: 'PRESET_3',
- templateName: 'text'
- }),
- perset5: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.4',
- presetName: 'PRESET_4',
- templateName: 'text'
- }),
- perset6: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.5',
- presetName: 'PRESET_5',
- templateName: 'text'
- }),
- perset7: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.6',
- presetName: 'PRESET_6',
- templateName: 'text'
- }),
- perset8: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.7',
- presetName: 'PRESET_7',
- templateName: 'text'
- }),
- perset9: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.8',
- presetName: 'PRESET_8',
- templateName: 'text'
- }),
- perset10: SDL.Button.extend(SDL.PresetEvents, {
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.9',
- presetName: 'PRESET_9',
- templateName: 'text'
- })
- })
- })
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/servicesView.js b/src/components/HMI/app/view/info/servicesView.js
deleted file mode 100644
index f4bac6d0ee..0000000000
--- a/src/components/HMI/app/view/info/servicesView.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.ServicesView
- * @desc Info Services module visual representation
- * @category Info
- * @filesource app/view/ServicesView.js
- * @version 1.0
- */
-
-SDL.InfoServicesView = Em.View
- .create( {
-
- elementId: 'info_services_view',
-
- classNameBindings: [
- 'SDL.States.info.services.active:active_state:inactive_state'
- ],
-
- /** Define module template */
- template: Ember.Handlebars
- .compile('<div class="inner-content">'
- + '<div id="info_sync_services" class="info-text">{{SDL.locale.label.view_info_services_syncServices}}</div>'
- + '<div id="info_traff" class="info-text">{{SDL.locale.label.view_info_services_trafficDirectionsAndInformation}}</div>'
- + '<div id="info_traffic_report" class="info-text">{{SDL.locale.label.view_info_services_getTheLatestTrafficRreport}}</div>'
- + '<div id="info_traffic_pts" class="info-text">{{SDL.locale.label.view_info_services_findBusinessesAndDownloadSaved}}<br>{{SDL.locale.label.view_info_services_Pts}}</div>'
- + '<div id="info_traffic_hear" class="info-text">{{SDL.locale.label.view_info_services_hearPersonalizedInformationMore}}</div>'
- + '<div id="info_connect" class="info-text">{{SDL.locale.label.view_info_services_connecttoServices}}</div>'
- + '<div id="info_log" class="info-text">{{SDL.locale.label.view_info_services_toActivate}}</div>'
- + '</div>')
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/info/travelLinkView.js b/src/components/HMI/app/view/info/travelLinkView.js
deleted file mode 100644
index 2bf6b90a95..0000000000
--- a/src/components/HMI/app/view/info/travelLinkView.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InfoTravelLinkView
- * @desc Info Travel Link Help module visual representation
- * @category View
- * @filesource app/view/settings/InfoTravelLinkView.js
- * @version 1.0
- */
-
-SDL.InfoTravelLinkView = Em.ContainerView
- .create( {
-
- classNameBindings: [
- 'SDL.States.info.travelLink.active:active_state:inactive_state'
- ],
-
- elementId: 'info_travelLink',
-
- childViews: [
- 'imageLogo', 'listLeft', 'listRight',
- ],
-
- imageLogo: SDL.Label.extend( {
- elementId: 'info_travelLink_logo',
- icon: 'images/info/info_travelLink_sirius_logo.png',
- templateName: 'icon'
- }),
-
- listLeft: SDL.List
- .extend( {
- elementId: 'info_travelLink_listLeft',
-
- disableScrollbar: true,
-
- itemsOnPage: 5,
-
- /** Items */
- items: [
- {
-
- type: SDL.Button,
-
- params: {
- textBinding: 'SDL.locale.label.view_info_travelLink_trafficOnRoute',
- templateName: 'arrow',
- disabled: true
- }
-
- },
- {
-
- type: SDL.Button,
-
- params: {
- textBinding: 'SDL.locale.label.view_info_travelLink_trafficNearby',
- templateName: 'arrow',
- disabled: true
- }
-
- },
- {
-
- type: SDL.Button,
-
- params: {
- textBinding: 'SDL.locale.label.view_info_travelLink_fuelPrices',
- templateName: 'arrow',
- disabled: true
- }
-
- },
- {
-
- type: SDL.Button,
-
- params: {
- textBinding: 'SDL.locale.label.view_info_travelLink_movieListings',
- templateName: 'arrow',
- disabled: true
- }
-
- },
- ]
- }),
-
- listRight: SDL.List
- .extend( {
- elementId: 'info_travelLink_listRight',
-
- disableScrollbar: true,
-
- /** Items */
- items: [
- {
-
- type: SDL.Button,
-
- params: {
-
- textBinding: 'SDL.locale.label.view_info_travelLink_subscriptionInfo',
- disabled: true
- }
-
- },
- {
-
- type: SDL.Button,
-
- params: {
- textBinding: 'SDL.locale.label.view_info_travelLink_weather',
- templateName: 'arrow',
- disabled: true
- }
-
- },
- {
-
- type: SDL.Button,
-
- params: {
- textBinding: 'SDL.locale.label.view_info_travelLink_sportsInfo',
- templateName: 'arrow',
- disabled: true
- }
-
- },
- {
-
- type: SDL.Button,
-
- params: {
- textBinding: 'SDL.locale.label.view_info_travelLink_skiConditions',
- templateName: 'arrow',
- disabled: true
- }
-
- }
- ]
- })
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/infoView.js b/src/components/HMI/app/view/infoView.js
deleted file mode 100644
index 397553d9fa..0000000000
--- a/src/components/HMI/app/view/infoView.js
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InfoView
- * @desc Info module visual representation
- * @category Info
- * @filesource app/view/InfoView.js
- * @version 1.0
- */
-
-SDL.InfoView = Em.ContainerView.create( {
-
- elementId: 'info_view',
-
- /** Bind class for visual representation */
- classNameBindings:
- [
- 'SDL.States.info.active:active_state:inactive_state'
- ],
-
- controllerBinding: Ember.Binding.oneWay( 'SDL.InfoController' ),
-
- /** Settings components */
- childViews:
- [
- 'leftMenu',
- SDL.InfoServicesView,
- SDL.InfoTravelLinkView,
- SDL.InfoCalendarView,
- SDL.InfoAppsView,
- SDL.InfoNonMedia,
- SDL.DeviceListView
- ],
-
- /** Left menu */
- leftMenu: Em.ContainerView.extend( {
- elementId: 'info_leftMenu',
-
- classNameBindings:
- [
- 'parentView.controller.hiddenLeftMenu:hidden'
- ],
-
- classNames: 'menu-items',
-
- childViews:
- [
- 'border',
- 'items'
- ],
-
- border: Em.View.extend( {
- classNames: 'ls_border'
- } ),
-
- items: Em.ContainerView.extend( {
- classNames: 'ls-items',
-
- childViews:
- [
- 'servicesButton',
- 'travelLinkButton',
- 'calendarButton',
- 'appsButton',
- 'sdlButton',
- 'goToCD'
- ],
-
- servicesButton: SDL.Button.extend( {
- elementId: 'info_leftMenu_services',
- goToState: 'services',
- classNames: 'menu-item lsp1_p',
- classNameBindings:
- [
- 'SDL.States.info.services.active:info_active'
- ],
- textBinding: 'SDL.locale.label.view_info_leftmenu_services',
- icon: 'images/info/info_leftMenu_services_ico.png',
- action: 'onState',
- target: 'SDL.InfoController'
- } ),
-
- travelLinkButton: SDL.Button.extend( {
- elementId: 'info_leftMenu_travelLink',
- goToState: 'travelLink',
- classNames: 'menu-item lsp1_p',
- classNameBindings:
- [
- 'SDL.States.info.travelLink.active:info_active'
- ],
- textBinding: 'SDL.locale.label.view_info_leftmenu_travelLink',
- icon: 'images/info/info_leftMenu_travelLink_ico.png',
- action: 'onState',
- target: 'SDL.InfoController'
- } ),
-
- alertsButton: SDL.Button.extend( {
- elementId: 'info_leftMenu_alerts',
- goToState: 'alerts',
- classNames: 'menu-item lsp1_p',
- classNameBindings:
- [
- 'SDL.States.info.alerts.active:info_active'
- ],
- textBinding: 'SDL.locale.label.view_info_leftmenu_alerts',
- icon: 'images/info/info_leftMenu_alerts_ico.png',
- action: 'onState',
- target: 'SDL.InfoController'
- } ),
-
- calendarButton: SDL.Button.extend( {
- elementId: 'info_leftMenu_calendar',
- goToState: 'calendar',
- classNames: 'menu-item lsp1_p',
- classNameBindings:
- [
- 'SDL.States.info.calendar.active:info_active'
- ],
- textBinding: 'SDL.locale.label.view_info_leftmenu_calendar',
- icon: 'images/info/info_leftMenu_calendar_ico.png',
- action: 'onState',
- target: 'SDL.InfoController'
- } ),
-
- appsButton: SDL.Button.extend( {
- elementId: 'info_leftMenu_apps',
- goToState: 'apps',
- classNames: 'menu-item lsp1_p',
- classNameBindings:
- [
- 'SDL.States.info.apps.active:info_active'
- ],
- textBinding: 'SDL.locale.label.view_info_leftmenu_apps',
- icon: 'images/info/info_leftMenu_apps_ico.png',
- action: 'onState',
- target: 'SDL.InfoController'
- } ),
-
- sdlButton: SDL.Button.extend( {
- elementId: 'info_leftMenu_sdl',
- goToState: 'nonMedia',
- classNames: 'menu-item lsp1_p',
- classNameBindings:
- [
- 'SDL.States.info.nonMedia.active:info_active'
- ],
- hidden: function() {
- return !SDL.NonMediaController.currentAppId;
- }.property( 'SDL.NonMediaController.currentAppId' ),
- textBinding: 'SDL.NonMediaController.currentAppName',
- iconBinding: 'SDL.NonMediaController.currentAppIcon',
- action: 'activateCurrentApp',
- target: 'SDL.NonMediaController'
- } ),
-
- goToCD: SDL.Button.extend( {
- elementId: 'info_leftMenu_goToCD',
- classNames: 'menu-item lsp1_p',
- text: 'Go To CD',
- action: 'turnOnCD',
- icon: 'images/media/ico_cd.png',
- target: 'SDL.MediaController'
- } )
- } )
- } )
-} ); \ 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
deleted file mode 100644
index ba4495681f..0000000000
--- a/src/components/HMI/app/view/media/common/LeftMenuView.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.LeftMenuView
- * @desc Media Left Menu module visual representation
- * @category View
- * @filesource app/view/media/SiriusView.js
- * @version 1.0
- */
-
-SDL.LeftMenuView = Em.ContainerView.extend( {
- /** View ID */
- elementId: 'media_leftmenu',
-
- /** View components */
- childViews:
- [
- 'border',
- 'cdButton',
- 'sdlButton'
- ],
- /** Border decoration */
- border: Em.View.extend( {
- elementId: 'media_left_menu_border',
- classNames: 'ls_border'
- } ),
-
- /** CD Station Button */
- cdButton: SDL.Button.extend( {
- classNameBindings:
- [
- 'SDL.CDModel.active:active_state'
- ],
- elementId: 'media_cdButton',
- classNames: 'media-ls-item',
- action: 'turnOnCD',
- icon: 'images/media/ico_cd.png',
- target: 'SDL.MediaController',
- textBinding: Ember.Binding.oneWay( 'SDL.locale.label.view_media_cd' )
- } ),
- /** SDL Button */
- sdlButton: SDL.Button.extend( {
- classNameBindings:
- [
- 'SDL.States.media.sdlmedia.active:active_state'
- ],
- elementId: 'media_sdlButton',
- classNames: 'media-ls-item',
- hidden: function() {
- return !SDL.SDLMediaController.currentAppId;
- }.property( 'SDL.SDLMediaController.currentAppId' ),
- textBinding: 'SDL.SDLMediaController.currentAppName',
- iconBinding: 'SDL.SDLMediaController.currentAppIcon',
- action: 'activateCurrentApp',
- target: 'SDL.SDLMediaController'
- } )
-
-} );
diff --git a/src/components/HMI/app/view/media/playerView.js b/src/components/HMI/app/view/media/playerView.js
deleted file mode 100644
index 406a6dba46..0000000000
--- a/src/components/HMI/app/view/media/playerView.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.MediaPlayerView
- * @desc Media Player module visual representation
- * @category View
- * @filesource app/view/media/common/MediaPalyerView.js
- * @version 1.0
- */
-SDL.playerView = Em.View.create( {
-
- elementId: 'media_player_view_container',
-
- classNameBindings:
- [
- 'SDL.States.media.player.active:active_state:inactive_state'
- ]
-
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/media/sdl/controllsView.js b/src/components/HMI/app/view/media/sdl/controllsView.js
deleted file mode 100644
index 8e73f0ba0e..0000000000
--- a/src/components/HMI/app/view/media/sdl/controllsView.js
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLMediaControlls
- * @desc SDLMediaControlls visual representation
- * @category View
- * @filesource app/view/media/sdl/controllsView.js
- * @version 1.0
- */
-
-SDL.SDLMediaControlls = Em.ContainerView.create( {
-
- childViews:
- [
- 'info',
- 'Controls',
- 'tuneButtons'
- ],
-
- /**
- * Verification paramiter
- */
- sdlMediaControlls: "V2",
-
- info: Em.View.extend( {
-
- elementId: 'app_view_info',
-
- template: Em.Handlebars
- .compile('{{#with view}}'
- + '<div class="track-info">'
- + '<div class="device">{{SDL.SDLAppController.model.deviceName}}</div>'
- + '<div class="divider_o"></div>'
- + '<div class="title textLimit" {{bindAttr style="SDL.SDLAppController.model.appInfo.alignment"}}>{{SDL.SDLAppController.model.appInfo.field1}}</div>'
- + '<div class="album textLimit" {{bindAttr style="SDL.SDLAppController.model.appInfo.alignment"}}>{{SDL.SDLAppController.model.appInfo.field2}}</div>'
- + '<div class="artist textLimit"{{bindAttr class="SDL.SDLAppController.model.mediaPreset:hidden"}}>{{SDL.SDLAppController.model.appInfo.field3}}</div>'
- + '<div class="time"{{bindAttr class="SDL.SDLAppController.model.mediaPreset:timeV2"}}>{{SDL.SDLAppController.model.appInfo.mediaClock}}</div>'
- + '<img class="cd_logo" {{bindAttr src="SDL.SDLAppController.model.appInfo.trackIcon" class="SDL.SDLAppController.model.mediaPreset:cd_logoV2"}} />'
- + '</div>' + '{{/with}}')
- }),
-
- Controls: Em.ContainerView.create( {
-
- elementId: 'app_view_controlls',
-
- /** View components */
- childViews:
- [
- 'PrevTrackButton',
- 'PlayButton',
- 'NextTrackButton'
- ],
-
- classNames: 'player_controlls',
-
- classNameBindings: 'SDL.SDLAppController.model.mediaPreset:player_controllsV2',
-
- PrevTrackButton: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'app_view_controlls_prev_track_button_v2',
- classNames:
- [
- 'bc-item-big',
- 'prevcd'
- ],
- icon: 'images/media/ico_prew.png',
- presetName: 'SEEKLEFT'
- } ),
-
- PlayButton: SDL.Button.extend( {
- elementId: 'app_view_controlls_play_button_v2',
- classNames:
- [
- 'bc-item-big',
- 'playcd'
- ],
- presetName: 'OK',
- actionUp: function() {
- SDL.SDLController.onSoftButtonOkActionUp( this.presetName );
- },
- actionDown: function() {
- SDL.SDLController.onSoftButtonOkActionDown( this.presetName );
- },
- /**
- * Define button
- * template
- */
- template: Ember.Handlebars
- .compile( '<img class="playIcon" {{bindAttr class="SDL.SDLAppController.model.isPlaying:visible:not-visible"}} src="images/media/ico_pause.png" />'
- + '<img class="playIcon not-visible" {{bindAttr class="SDL.SDLAppController.model.isPlaying:not-visible:visible"}} src="images/media/ico-play.png" />' )
- } ),
- NextTrackButton: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'app_view_controlls_next_track_button_v2',
- classNames:
- [
- 'bc-item-big',
- 'nextcd'
- ],
- icon: 'images/media/ico_next.png',
- presetName: 'SEEKRIGHT'
- } )
- } ),
-
- tuneButtons: Em.ContainerView.create( {
-
- elementId: 'sdl_media_presetButtons',
-
- classNameBindings:
- [
- 'SDL.SDLAppController.model.mediaPreset::hidden'
- ],
-
- classNames:
- [
- 'main-preset-buttons-wraper'
- ],
-
- childViews:
- [
- 'wrapper'
- ],
-
- wrapper: Em.ContainerView.extend( {
-
- elementId: 'sdl_media_presetButtons_wrapper',
-
- classNames: 'preset-items',
-
- childViews:
- [
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- '10'
- ],
-
- 1: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button1',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.0',
- templateName: 'text',
- presetName: 'PRESET_0'
- } ),
- 2: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button2',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.1',
- templateName: 'text',
- presetName: 'PRESET_1'
- } ),
- 3: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button3',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.2',
- templateName: 'text',
- presetName: 'PRESET_2'
- } ),
- 4: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button4',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.3',
- templateName: 'text',
- presetName: 'PRESET_3'
- } ),
- 5: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button5',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.4',
- templateName: 'text',
- presetName: 'PRESET_4'
- } ),
- 6: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button6',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.5',
- templateName: 'text',
- presetName: 'PRESET_5'
- } ),
- 7: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button7',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.6',
- templateName: 'text',
- presetName: 'PRESET_6'
- } ),
- 8: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button8',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.7',
- templateName: 'text',
- presetName: 'PRESET_7'
- } ),
- 9: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button9',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.8',
- templateName: 'text',
- presetName: 'PRESET_8'
- } ),
- 10: SDL.Button.extend( SDL.PresetEvents, {
- elementId: 'sdl_media_preset_button10',
- classNames: 'preset-item',
- textBinding: 'SDL.SDLAppController.model.appInfo.customPresets.9',
- templateName: 'text',
- presetName: 'PRESET_9'
- } )
- } )
- } )
-} ); \ 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
deleted file mode 100644
index 78371e7ea7..0000000000
--- a/src/components/HMI/app/view/media/sdlmediaView.js
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.sdlView
- * @desc SDL Media application module visual representation
- * @category View
- * @filesource app/view/media/sdlView.js
- * @version 1.0
- */
-SDL.sdlView = Em.ContainerView
- .create( {
-
- /**
- * View Id
- */
- elementId: 'sdl_view_container',
-
- classNameBindings: [
- 'this.activeState:active_state:inactive_state'
- ],
-
- activeState: function(){
- if (SDL.TurnByTurnView.activeTBT) {
- return false;
- } else if (SDL.States.media.sdlmedia.active) {
- return true;
- } else {
- return false;
- }
- }.property('SDL.States.media.sdlmedia.active', 'SDL.TurnByTurnView.activeTBT'),
-
- /**
- * View Components
- */
- childViews: [
- 'innerMenu',
- 'controlls'
- ],
-
- controlls: SDL.SDLMediaControlls,
-
- /**
- * Deactivate View
- */
- deactivate: function() {
-
- SDL.States.goToStates('info.apps');
- },
-
- innerMenu: SDL.MenuList
- .extend( {
-
- refreshItems: function() {
-
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.appID == SDL.SDLMediaController.currentAppId) {
- this.addItems(SDL.SDLAppController.model.softButtons,
- SDL.SDLAppController.model.appID);
- }
- }.observes('SDL.SDLAppController.model.softButtons.@each'),
-
- groupName: "MediaView",
-
- content: Em.ContainerView.extend( {
-
- classNames: [
- 'content'
- ],
-
- attributeBindings: [
- 'parentView.contentPositon:style'
- ],
-
- childViews: [
- 'optionsButton'
- ],
-
- optionsButton: SDL.Button.extend( {
- text: 'Options',
-
- templateName: 'arrow',
-
- action: 'openCommandsList',
- target: 'SDL.SDLAppController'
- })
- })
- })
- }); \ No newline at end of file
diff --git a/src/components/HMI/app/view/mediaView.js b/src/components/HMI/app/view/mediaView.js
deleted file mode 100644
index 647b593065..0000000000
--- a/src/components/HMI/app/view/mediaView.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.MediaView
- * @desc Media module visual representation
- * @category View
- * @filesource app/view/media/MediaView.js
- * @version 1.0
- */
-SDL.MediaView = Em.ContainerView.create( {
- /** View Id */
- elementId: 'media',
-
- classNameBindings: 'SDL.States.media.active:active_state:inactive_state',
-
- /** Media components */
- childViews:
- [
- 'leftMenu',
- SDL.playerView,
- SDL.sdlView
- ],
- /** Left Menu view component */
- leftMenu: SDL.LeftMenuView
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/navigationApp/baseNavigationView.js b/src/components/HMI/app/view/navigationApp/baseNavigationView.js
deleted file mode 100644
index 1b373b615a..0000000000
--- a/src/components/HMI/app/view/navigationApp/baseNavigationView.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.BaseNavigationView
- * @desc Navigation component base screen
- * @category View
- * @filesource app/view/navigationApp/baseNavigationView.js
- * @version 1.0
- */
-SDL.BaseNavigationView = Em.ContainerView.create({
- /** View Id */
- elementId: 'baseNavigation',
-
- classNameBindings: [
- 'SDL.States.navigationApp.baseNavigation.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'mainField1',
- 'mainField2',
- 'mainField3',
- 'mainField4',
- 'mainField5',
- 'mainField6',
- 'optionsBtn'
- ],
-
- mainField1: null,
- mainField2: null,
- mainField3: null,
- mainField4: null,
- mainField5: null,
- mainField6: null,
-
- update: function(){
-
- var naviParams = SDL.SDLModel.constantTBTParams;
-
- if (naviParams) {
-
- for ( var i = 0; i < naviParams.navigationTexts.length; i++) {
- switch (naviParams.navigationTexts[i].fieldName) {
- case 'navigationText1': {
- this.set('mainField1',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'navigationText2': {
- this.set('mainField2',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'ETA': {
- this.set('mainField4', naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'totalDistance': {
- this.set('mainField5',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'navigationText': {
- this.set('mainField6',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
- case 'timeToDestination': {
- this.set('mainField3',
- naviParams.navigationTexts[i].fieldText);
- break;
- }
- default :{
- break;
- }
- }
- }
-
- if (naviParams.softButtons) {
- for ( var i = 0; i < naviParams.softButtons.length; i++) {
- this.get('childViews').pushObject(SDL.Button.create(SDL.PresetEventsCustom, {
- text: naviParams.softButtons[i].text,
- icon: naviParams.softButtons[i].image ? naviParams.softButtons[i].image.value : "",
- templateName: naviParams.softButtons[i].image ? 'rightText' : 'text',
- groupName: "NaviBase",
- classNameBindings: ['isHighlighted:isHighlighted'],
- isHighlighted: naviParams.softButtons[i].isHighlighted ? true : false,
- softButtonID: naviParams.softButtons[i].softButtonID,
- systemAction: naviParams.softButtons[i].systemAction,
- classNames: 'navButton softButton softButton' + (i + 1),
- appID: SDL.SDLAppController.model.appID
- }));
- }
- }
- }
- },
-
- mainField1: SDL.Label.extend({
-
- classNames: 'mainField1 mainField',
-
- contentBinding: 'SDL.SDLAppController.model.appInfo.field1'
- }),
-
- mainField2: SDL.Label.extend({
-
- classNames: 'mainField2 mainField',
-
- contentBinding: 'SDL.SDLAppController.model.appInfo.field2'
- }),
-
- mainField3: SDL.Label.extend({
-
- classNames: 'mainField3 mainField',
-
- contentBinding: 'SDL.SDLAppController.model.appInfo.field3'
- }),
-
- mainField4: SDL.Label.extend({
-
- classNames: 'mainField4 mainField',
-
- contentBinding: 'SDL.SDLAppController.model.appInfo.field4'
- }),
-
- mainField5: SDL.Label.extend({
-
- classNames: 'mainField5 mainField',
-
- contentBinding: 'parentView.mainField5'
- }),
-
- mainField6: SDL.Label.extend({
-
- classNames: 'mainField6 mainField',
-
- contentBinding: 'parentView.mainField6'
- }),
-
- optionsBtn: SDL.Button.extend({
- classNames: 'naviOptionsBtn navButton',
- text : "Options",
- action: 'openCommandsList',
- target: 'SDL.SDLAppController'
- })
-
-});
diff --git a/src/components/HMI/app/view/navigationAppView.js b/src/components/HMI/app/view/navigationAppView.js
deleted file mode 100644
index 29a69e1904..0000000000
--- a/src/components/HMI/app/view/navigationAppView.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.NavigationAppView
- * @desc Navigation component
- * @category View
- * @filesource app/view/navigationAppView.js
- * @version 1.0
- */
-SDL.NavigationAppView = Em.ContainerView.create( {
- /** View Id */
- elementId: 'NavigationAppView',
-
- classNameBindings: [
- 'this.activeState:active_state:inactive_state'
- ],
-
- activeState: function(){
- if (SDL.TurnByTurnView.activeTBT) {
- return false;
- } else if (SDL.States.navigationApp.active) {
- return true;
- } else {
- return false;
- }
- }.property('SDL.States.navigationApp.active', 'SDL.TurnByTurnView.activeTBT'),
-
- childViews: [
- 'videoView',
- SDL.BaseNavigationView
- ],
-
- actionMove:function(event){
-
- SDL.SDLModel.onTouchEvent(event);
- },
-
- actionUp:function(event){
-
- SDL.SDLModel.onTouchEvent(event);
- },
-
- actionDown:function(event){
-
- SDL.SDLModel.onTouchEvent(event);
- },
-
- videoView: Ember.View.create({
- templateName: "video",
- template: Ember.Handlebars.compile('<video id="html5Player"></video>')
- })
-
-});
diff --git a/src/components/HMI/app/view/navigationView.js b/src/components/HMI/app/view/navigationView.js
deleted file mode 100644
index 787da23310..0000000000
--- a/src/components/HMI/app/view/navigationView.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.NavigationView
- * @desc Navigation component
- * @category View
- * @filesource app/view/navigationView.js
- * @version 1.0
- */
-SDL.NavigationView = Em.ContainerView.create( {
- /** View Id */
- elementId: 'navigationView',
-
- classNameBindings: [
- 'SDL.States.navigation.active:active_state:inactive_state'
- ],
-
- childViews:
- [
- 'windowText'
- ],
-
- windowText: SDL.Label.extend( {
-
- classNames: 'windowText',
-
- content: 'Navigation'
- } )
-
-});
diff --git a/src/components/HMI/app/view/phone/dialpadView.js b/src/components/HMI/app/view/phone/dialpadView.js
deleted file mode 100644
index 06b535bda4..0000000000
--- a/src/components/HMI/app/view/phone/dialpadView.js
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DialpadPhoneView
- * @desc Phone Dialpad module visual representation
- * @category View
- * @filesource app/view/phone/DialpadView.js
- * @version 1.0
- */
-
-SDL.DialpadPhoneView = Em.ContainerView.create( {
-
- elementId: 'phone_dialpad',
-
- classNameBindings: 'SDL.States.phone.dialpad.active:active_state:inactive_state',
-
- childViews:
- [
- 'number',
- 'keypad',
- 'deleteButton',
- 'dialButton',
- 'endButton'
- ],
-
- /** Number area */
- number: SDL.Label.extend( {
- elementId: 'phone_dialpad_number',
-
- contentBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.dialpadNumber' )
- } ),
-
- /** Keypad block */
- keypad: Em.ContainerView.extend( {
- elementId: 'phone_dialpad_keypad',
-
- childViews:
- [
- 'key1',
- 'key2',
- 'key3',
- 'key4',
- 'key5',
- 'key6',
- 'key7',
- 'key8',
- 'key9',
- 'key0',
- 'keyStar',
- 'keyDiez'
- ],
-
- key1: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key1',
-
- classNames: 'left',
-
- text: '1',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key2: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key2',
-
- classNames: 'center',
-
- text: '2',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key3: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key3',
-
- classNames: 'right',
-
- text: '3',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key4: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key4',
-
- classNames: 'left',
-
- text: '4',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key5: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key5',
-
- classNames: 'center',
-
- text: '5',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key6: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key6',
-
- classNames: 'right',
-
- text: '6',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key7: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key7',
-
- classNames: 'left',
-
- text: '7',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key8: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key8',
-
- classNames: 'center',
-
- text: '8',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key9: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key9',
-
- classNames: 'right',
-
- text: '9',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- key0: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_key0',
-
- classNames: 'center',
-
- text: '0',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- keyStar: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_keyStar',
-
- classNames: 'left',
-
- text: '*',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } ),
-
- keyDiez: SDL.Button.extend( {
- elementId: 'phone_dialpad_keypad_keyDiez',
-
- classNames: 'right',
-
- text: '#',
-
- action: "keyPress",
-
- target: "SDL.PhoneController"
- } )
- } ),
-
- deleteButton: SDL.Button.extend( {
- elementId: 'phone_dialpad_deleteButton',
-
- classNameBindings:
- [
- 'SDL.PhoneController.model.dialpadNumber.length:show'
- ],
-
- icon: 'images/phone/del.png',
-
- action: 'onDelete',
- target: 'SDL.PhoneController',
-
- disabledBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.onCall' )
- } ),
-
- dialButton: SDL.Button.extend( {
- elementId: 'phone_dialpad_dialButton',
-
- textBinding: Em.Binding.oneWay( 'SDL.locale.label.view_phone_dial' ),
- icon: 'images/phone/dial.png',
-
- action: 'onDialCall',
- target: 'SDL.PhoneController',
-
- disabledBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.onCall' )
- } ),
-
- endButton: SDL.Button.extend( {
- elementId: 'phone_dialpad_endButton',
-
- textBinding: Em.Binding.oneWay( 'SDL.locale.label.view_phone_end' ),
- icon: 'images/phone/end.png',
-
- action: 'onEndCall',
- target: 'SDL.PhoneController',
-
- disabledBinding: Em.Binding.oneWay( 'SDL.PhoneController.model.readyForCall' )
- } )
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/phoneView.js b/src/components/HMI/app/view/phoneView.js
deleted file mode 100644
index ec3413eb72..0000000000
--- a/src/components/HMI/app/view/phoneView.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PhoneView
- * @desc Phone module visual representation
- * @category View
- * @filesource app/view/phone/PhoneView.js
- * @version 1.0
- */
-
-SDL.PhoneView = Em.ContainerView.create( {
-
- elementId: 'phone',
-
- /** Bind class for visual representation */
- classNameBindings: [
- 'SDL.States.phone.active:active_state:inactive_state'
- ],
-
- /** Initial phone components */
- childViews: [
- 'menu', SDL.DialpadPhoneView
- ],
-
- /** Left menu */
- menu: Em.ContainerView.extend( {
- elementId: 'phone_menu',
-
- // classNameBindings: ['SDL.PhoneController.hideMenu:hide'],
-
- childViews: [
- 'border', 'items'
- ],
-
- border: Em.View.extend( {
- classNames: 'ls_border',
-
- template: Ember.Handlebars
- .compile('<img class="bg" src="images/common/ls_border.png">')
- }),
-
- items: Em.ContainerView.extend( {
- classNames: 'ls-items',
-
- childViews: [
- 'dialpadButton'
- ],
-
- dialpadButton: SDL.Button.extend( {
- elementId: 'phone_menu_dialpadButton',
-
- classNames: 'ls-item lsp1_p active_in_helpmode',
- classNameBindings: [
- 'SDL.States.phone.dialpad.active:phone_active'
- ],
- textBinding: Em.Binding
- .oneWay('SDL.locale.label.view_phone_phone'),
- icon: 'images/phone/ico_phone.png',
- action: 'subState',
- target: 'SDL.PhoneController',
-
- stateName: 'dialpad'
- })
- })
- }),
-
- /** End call message window */
- endCallMessage: SDL.Label.extend( {
- elementId: 'phone_endCallMessage',
-
- contentBinding: Em.Binding
- .oneWay('SDL.locale.label.view_phone_popUp_callEnded')
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/AlertManeuverPopUp.js b/src/components/HMI/app/view/sdl/AlertManeuverPopUp.js
deleted file mode 100644
index b675b32cf5..0000000000
--- a/src/components/HMI/app/view/sdl/AlertManeuverPopUp.js
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.AlertManeuverPopUp
- * @desc AlertManeuverPopUp module visual representation
- * @category View
- * @filesource app/view/sdl/AlertManeuverPopUp.js
- * @version 1.0
- */
-
-SDL.AlertManeuverPopUp = Em.ContainerView.create( {
-
- elementId: 'AlertManeuverPopUp',
-
- classNames: 'AlertManeuverPopUp',
-
- classNameBindings:
- ['activate:AlertManeuverActive'
- ],
-
- childViews:
- [
- 'applicationName',
- // 'image',
- // 'message1',
- // 'message2',
- // 'message3',
- 'softbuttons',
- 'closeButton'
- ],
-
- content1: 'Title',
-
- content2: 'Text',
-
- activate: false,
-
- timer: null,
-
- /**
- * Wagning image on Alert Maneuver PopUp
- */
- image: Em.View.extend( {
- elementId: 'alertManeuverPopUpImage',
-
- classNames: 'alertManeuverPopUpImage'
- } ),
-
- applicationName: SDL.Label.extend( {
-
- elementId: 'applicationName',
-
- classNames: 'applicationName',
-
- contentBinding: 'parentView.appName'
- } ),
-
- message1: SDL.Label.extend( {
-
- elementId: 'message1',
-
- classNames: 'message1',
-
- contentBinding: 'parentView.content1'
- } ),
-
- message2: SDL.Label.extend( {
-
- elementId: 'message2',
-
- classNames: 'message2',
-
- contentBinding: 'parentView.content2'
- } ),
-
- message3: SDL.Label.extend( {
-
- elementId: 'message3',
-
- classNames: 'message3',
-
- contentBinding: 'parentView.content3'
- } ),
-
- /**
- * Container for softbuttons
- */
- softbuttons: Em.ContainerView.extend( {
- elementId: 'alertManeuverSoftButtons',
-
- classNames: 'alertManeuverSoftButtons'
- } ),
-
- /**
- * Close button
- */
- closeButton: SDL.Button.create( {
- text: 'Close',
- classNames: 'closeButton softButton',
- action: 'closeAlertMeneuverPopUp',
- target: 'SDL.SDLController',
- templateName: 'text'
- } ),
-
- /**
- * @desc Function creates Soft Buttons on AlertPoUp
- * @param {Object} params
- */
- addSoftButtons: function( params ) {
-
- var count = this.get( 'softbuttons' ).removeAllChildren();
-
- if( params ){
-
- var softButtonsClass;
- switch( params.length ){
- case 1:
- softButtonsClass = 'one';
- break;
- case 2:
- softButtonsClass = 'two';
- break;
- case 3:
- softButtonsClass = 'three';
- break;
- case 4:
- softButtonsClass = 'four';
- break;
- }
-
- for( var i = 0; i < params.length; i++ ){
- this.get( 'softbuttons.childViews' ).pushObject( SDL.Button.create( SDL.PresetEventsCustom, {
- softButtonID: params[i].softButtonID,
- icon: params[i].image,
- text: params[i].text,
- classNames: 'list-item softButton ' + softButtonsClass,
- elementId: 'softButton' + i,
- templateName: params[i].image ? 'rightIcon' : 'text',
- systemAction: params[i].systemAction,
- appID: params.appID
- } ) );
- }
- }
- },
-
- AlertManeuverActive: function( message ) {
-// var self = this;
-//
-// if (message.softButtons) {
-// this.addSoftButtons( message.softButtons );
-// }
-//
-// this.set( 'activate', true );
-//
-// clearTimeout( this.timer );
-// this.timer = setTimeout( function() {
-// self.set( 'activate', false );
-// }, 5000 );
- }
-} ); \ 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
deleted file mode 100644
index 0589da3649..0000000000
--- a/src/components/HMI/app/view/sdl/AlertPopUp.js
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.AlertPopUp
- * @desc AlertPopUp module visual representation
- * @category View
- * @filesource app/view/sdl/AlertPopUp.js
- * @version 1.0
- */
-
-SDL.AlertPopUp = Em.ContainerView.create({
-
- elementId: 'AlertPopUp',
-
- classNames: 'AlertPopUp',
-
- classNameBindings:
- [
- 'active:AlertActive'
- ],
-
- childViews:
- [
- 'applicationName',
- 'image',
- 'message1',
- 'message2',
- 'message3',
- 'softbuttons',
- 'progressIndicatorView'
- ],
-
- /**
- * Id of current request
- *
- * @type {Number}
- */
- alertRequestId: null,
-
- content1: '',
-
- content2: '',
-
- content3: '',
-
- active: false,
-
- timer: null,
-
- timeout: null,
-
- progressIndicator: false,
-
- /**
- * Wagning image on Alert PopUp
- */
- image: Em.View.extend({
- elementId: 'alertPopUpImage',
-
- classNames: 'alertPopUpImage'
- }),
-
- /**
- * Wagning image on Alert PopUp
- */
- progressIndicatorView: Em.View.extend({
- elementId: 'progressIndicator',
-
- classNameBindings: 'this.parentView.progressIndicator:progressIndicator'
- }),
-
- applicationName: SDL.Label.extend({
-
- elementId: 'applicationName',
-
- classNames: 'applicationName',
-
- contentBinding: 'parentView.appName'
- }),
-
- message1: SDL.Label.extend({
-
- elementId: 'message1',
-
- classNames: 'message1',
-
- contentBinding: 'parentView.content1'
- }),
-
- message2: SDL.Label.extend({
-
- elementId: 'message2',
-
- classNames: 'message2',
-
- contentBinding: 'parentView.content2'
- }),
-
- message3: SDL.Label.extend({
-
- elementId: 'message3',
-
- classNames: 'message3',
-
- contentBinding: 'parentView.content3'
- }),
-
- /**
- * Deactivate PopUp
- */
- deactivate: function(reason) {
- this.set('active', false);
- clearTimeout(this.timer);
-
- this.set('content1', '');
- this.set('content2', '');
- this.set('content3', '');
-
- 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);
- }
-
- SDL.SDLController.onSystemContextChange();
- },
-
- /**
- * Container for softbuttons
- */
- softbuttons: Em.ContainerView.extend({
-
- childViews:
- [
- 'buttons'
- ],
-
- buttons: Em.ContainerView.extend({
- elementId: 'alertSoftButtons',
-
- classNames: 'alertSoftButtons'
- })
- }),
-
- /**
- * @desc Function creates Soft Buttons on AlertPoUp
- * @param {Object} params
- */
- addSoftButtons: function(params, appID) {
-
- this.softbuttons.buttons.removeAllChildren();
- this.softbuttons.buttons.rerender();
-
- if(params){
-
- var softButtonsClass;
- switch(params.length){
- case 1:
- softButtonsClass = 'one';
- break;
- case 2:
- softButtonsClass = 'two';
- break;
- case 3:
- softButtonsClass = 'three';
- break;
- case 4:
- softButtonsClass = 'four';
- break;
- }
-
- for(var i = 0; i < params.length; i++){
- this.get('softbuttons.buttons.childViews')
- .pushObject(SDL.Button.create(SDL.PresetEventsCustom, {
- systemAction: params[i].systemAction,
- groupName: "AlertPopUp",
- classNameBindings: ['isHighlighted:isHighlighted'],
- isHighlighted: params[i].isHighlighted ? true : false,
- softButtonID: params[i].softButtonID,
- icon: params[i].image ? params[i].image.value : "",
- text: params[i].text,
- classNames: 'list-item softButton ' + softButtonsClass,
- elementId: 'softButton' + i,
- templateName: params[i].image ? 'rightText' : 'text',
- appID: appID
- }));
- }
- }
- },
-
- AlertActive: function(message, alertRequestId) {
- var self = this;
-
- this.set('alertRequestId', alertRequestId);
-
- this.addSoftButtons(message.softButtons, message.appID);
-
- this.set('progressIndicator', message.progressIndicator);
-
- this.set('appName', SDL.SDLController.getApplicationModel(message.appID).appName);
-
- for (var i = 0; i < message.alertStrings.length; i++) {
- switch (message.alertStrings[i].fieldName) {
- case 'alertText1': {
- this.set('content1', message.alertStrings[i].fieldText);
- break;
- }
- case 'alertText2': {
- this.set('content2', message.alertStrings[i].fieldText);
- break;
- }
- case 'alertText3': {
- this.set('content3', message.alertStrings[i].fieldText);
- break;
- }
- }
- }
-
- this.set('active', true);
- this.set('timeout', message.duration ? message.duration : 30000); //default timeout defined for Alert popUp
-
- clearTimeout(this.timer);
- this.timer = setTimeout(function() {
- self.deactivate('timeout');
- }, this.timeout);
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/AudioPassThruPopUp.js b/src/components/HMI/app/view/sdl/AudioPassThruPopUp.js
deleted file mode 100644
index 849daa2243..0000000000
--- a/src/components/HMI/app/view/sdl/AudioPassThruPopUp.js
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.AudioPassThruPopUp
- * @desc AudioPassThruPopUp module visual representation
- * @category View
- * @filesource app/view/sdl/AudioPassThruPopUp.js
- * @version 1.0
- */
-
-SDL.AudioPassThruPopUp = Em.ContainerView.create( {
-
- elementId: 'AudioPassThruPopUp',
-
- classNames: 'AudioPassThruPopUp',
-
- classNameBindings:
- [
- 'activate:AudioPassThruActive'
- ],
-
- childViews:
- [
- 'applicationName',
- 'image',
- 'message1',
- 'message2',
- 'message3',
- 'buttonRetry',
- 'buttonDone',
- 'buttonCancel'
- ],
-
- content1: 'Title',
-
- content2: 'Text',
-
- activateBinding: 'SDL.SDLModel.AudioPassThruState',
-
- timer: null,
-
- applicationName: SDL.Label.extend( {
-
- elementId: 'AudioPassThruPopUpApplicationName',
-
- classNames: 'applicationName',
-
- contentBinding: 'parentView.appName'
- } ),
-
- /**
- * Wagning image on Alert PopUp
- */
- image: Em.View.extend( {
- elementId: 'audioPassThruImage',
-
- classNames: 'audioPassThruImage'
- } ),
-
- message1: SDL.Label.extend( {
-
- elementId: 'AudioPassThruPopUpMessage1',
-
- classNames: 'message1',
-
- contentBinding: 'parentView.content1'
- } ),
-
- message2: SDL.Label.extend( {
-
- elementId: 'AudioPassThruPopUpMessage2',
-
- classNames: 'message2',
-
- contentBinding: 'parentView.content2'
- } ),
-
- message3: SDL.Label.extend( {
-
- elementId: 'AudioPassThruPopUpMessage3',
-
- classNames: 'message3',
-
- contentBinding: 'parentView.content3'
- } ),
-
- buttonRetry: SDL.Button.create( {
- elementId: 'AudioPassThruPopUpButtonRetry',
- classNames: 'buttonRetry softButton',
- text: 'Retry',
- responseResult: SDL.SDLModel.resultCode['RETRY'],
- actionUp: function() {
- SDL.SDLController.callPerformAudioPassThruPopUpErrorResponse( this );
- }
- } ),
-
- buttonDone: SDL.Button.create( {
- elementId: 'AudioPassThruPopUpButtonDone',
- classNames: 'buttonDone softButton',
- text: 'Done',
- responseResult: SDL.SDLModel.resultCode['SUCCESS'],
- actionUp: function() {
- SDL.SDLController.callPerformAudioPassThruPopUpResponse( this );
- }
- } ),
-
- buttonCancel: SDL.Button.create( {
- elementId: 'AudioPassThruPopUpButtonCancel',
- classNames: 'buttonCancel softButton',
- text: 'Cancel',
- responseResult: SDL.SDLModel.resultCode['ABORTED'],
- actionUp: function() {
- SDL.SDLController.callPerformAudioPassThruPopUpErrorResponse( this );
- }
- } ),
-
- /**
- * Method to start AudioPassThru timer to deactivate popUp and send response to SDL
- */
- StartAudioPassThruTimer: function() {
- clearTimeout( this.timer );
- this.timer = setTimeout( function() {
- SDL.SDLController.performAudioPassThruResponse( SDL.SDLModel.resultCode["SUCCESS"] );
- }, SDL.SDLModel.AudioPassThruData.maxDuration );
- },
-
- /**
- * Method clears PopUp's timer when activity flag become false, and show
- * PopUp with data come from SDLCorel when activity flag become true
- */
- AudioPassThruActivity: function() {
-
- if( this.activate ){
-
- var self = this, data = SDL.SDLModel.AudioPassThruData;
-
- this.set( 'appName', SDL.SDLController.getApplicationModel( data.appID ).appName );
-
- for (var i = 0; i < data.audioPassThruDisplayTexts.length; i++) {
- switch (data.audioPassThruDisplayTexts[i].fieldName) {
- case 'audioPassThruDisplayText1': {
- this.set('content1', data.audioPassThruDisplayTexts[i].fieldText);
- break;
- }
- case 'audioPassThruDisplayText2': {
- this.set('content2', data.audioPassThruDisplayTexts[i].fieldText);
- break;
- }
- }
- }
- }else{
- if( this.timer ){
- clearTimeout( this.timer );
- this.timer = null;
- }
-
- SDL.SDLController.onSystemContextChange();
- }
- }.observes( 'activate' )
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/ExitAppView.js b/src/components/HMI/app/view/sdl/ExitAppView.js
deleted file mode 100644
index 81e9c7ad5f..0000000000
--- a/src/components/HMI/app/view/sdl/ExitAppView.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.ExitApp
- * @desc Exit All Applications reason select visual representation
- * @category View
- * @filesource app/view/sdl/ExitAppView.js
- * @version 1.0
- */
-
-SDL.ExitApp = Em.ContainerView.create( {
-
- elementId: 'exitAppView',
-
- classNames: 'exitAppView',
-
- classNameBindings:
- [
- 'active'
- ],
-
- childViews:
- [
- 'exitAppViewLabel',
- 'exitAppViewTitle',
- 'exitAppViewSelect',
- 'onAwakeSDLLabel',
- 'onAwakeSDLButton'
- ],
-
- /**
- * Title of VehicleInfo PopUp view
- */
- exitAppViewLabel: SDL.Label.extend( {
-
- elementId: 'exitAppViewLabel',
-
- classNames: 'exitAppViewLabel',
-
- content: 'Exit Application'
- } ),
-
- /**
- * Property indicates the activity state of TBTClientStateView
- */
- active: false,
-
- /**
- * Title of tbtClientState group of parameters
- */
- exitAppViewTitle: SDL.Label.extend( {
-
- elementId: 'exitAppViewTitle',
-
- classNames: 'exitAppViewTitle',
-
- content: 'Exit Application reason'
- } ),
-
- /**
- * HMI element Select with parameters of TBTClientStates
- */
- exitAppViewSelect: Em.Select.extend( {
-
- elementId: 'exitAppViewSelect',
-
- classNames: 'exitAppViewSelect',
-
- contentBinding: 'SDL.SDLModel.exitAppState',
-
- optionValuePath: 'content.id',
-
- optionLabelPath: 'content.name',
-
- /**
- * Selected data sent on model for further processing
- */
- click: function() {
-
- SDL.SDLController.exitAppViewSelected( this.selection.name );
-
- }
- } ),
-
- 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
- */
- toggleActivity: function() {
- this.toggleProperty( 'active' );
- }
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/PopUp.js b/src/components/HMI/app/view/sdl/PopUp.js
deleted file mode 100644
index 6da36feb4f..0000000000
--- a/src/components/HMI/app/view/sdl/PopUp.js
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PopUp
- * @desc PopUp module visual representation
- * @category View
- * @filesource app/view/sdl/PopUp.js
- * @version 1.0
- */
-
-SDL.PopUp = Em.ContainerView.extend({
-
- classNames: 'PopUp',
-
- childViews:
- [
- 'message',
- 'buttonOk',
- 'buttonCancel',
- 'backButton'
- ],
-
- classNameBindings: [
- 'this.active:active_state:inactive_state'
- ],
-
- popUpId: 0,
-
- /**
- * Callback function to return result of made action by user
- */
- callback: null,
-
- content: 'Title',
-
- active: false,
-
- timer: null,
-
- backButton: SDL.Button.extend( {
- classNames: 'button backButton',
- text: 'X',
- click: function () {
- this._parentView.deactivate();
- },
- buttonAction: true,
- onDown: false,
- disabledBinding: 'parentView.buttons'
- }),
-
- buttons: true,
-
- buttonOk: SDL.Button.extend( {
- classNames: 'button vehicleHealthReport OkButton',
- text: 'Ok',
- action: 'deactivate',
- target: 'parentView',
- buttonAction: true,
- onDown: false,
- disabledBinding: 'parentView.buttons'
- }),
-
- buttonCancel: SDL.Button.extend( {
- classNames: 'button vehicleHealthReport CancelButton',
- text: 'Cancel',
- action: 'deactivate',
- target: 'parentView',
- buttonAction: false,
- onDown: false,
- disabledBinding: 'parentView.buttons'
- }),
-
- message: SDL.Label.extend({
-
- elementId: 'text',
-
- classNames: 'text',
-
- contentBinding: 'parentView.content'
- }),
-
- /**
- * Deactivate PopUp
- */
- deactivate: function(event) {
- this.set('active', false);
-
- if (this.callback && event) {
- this.callback(event.buttonAction);
- }
-
- this.set('callback', null);
- this.set('content', '');
- this.remove();
- },
-
- /**
- * 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 (indicator) {
- this.set('buttons', true);
- } else if (callback) {
- this.set('callback', callback);
- this.set('buttons', false);
- } else {
- this.set('buttons', true);
- var self = this;
- this.timer = setTimeout(function(){
- self.deactivate();
- },
- 5000);
- }
-
- this.set('content', textBody);
- this.set('label', label);
- this.set('line1', line1);
- this.set('line2', line2);
-
- return this;
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/SystemRequestView.js b/src/components/HMI/app/view/sdl/SystemRequestView.js
deleted file mode 100644
index 0701cd2206..0000000000
--- a/src/components/HMI/app/view/sdl/SystemRequestView.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.systemRequest
- * @desc Exit All Applications reason select visual representation
- * @category View
- * @filesource app/view/sdl/systemRequestView.js
- * @version 1.0
- */
-
-SDL.SystemRequest = Em.ContainerView.create( {
-
- elementId: 'systemRequestView',
-
- classNames: 'systemRequestView',
-
- classNameBindings:
- [
- 'active'
- ],
-
- childViews:
- [
- 'systemRequestViewLabel',
- 'systemRequestViewTitle',
- 'systemRequestViewSelect'
- ],
-
- /**
- * Title of VehicleInfo PopUp view
- */
- systemRequestViewLabel: SDL.Label.extend( {
-
- elementId: 'systemRequestViewLabel',
-
- classNames: 'systemRequestViewLabel',
-
- content: 'System Request'
- } ),
-
- /**
- * Property indicates the activity state of TBTClientStateView
- */
- active: false,
-
- /**
- * Title of tbtClientState group of parameters
- */
- systemRequestViewTitle: SDL.Label.extend( {
-
- elementId: 'systemRequestViewTitle',
-
- classNames: 'systemRequestViewTitle',
-
- content: 'System Request reason'
- } ),
-
- /**
- * HMI element Select with parameters of TBTClientStates
- */
- systemRequestViewSelect: Em.Select.extend( {
-
- elementId: 'systemRequestViewSelect',
-
- classNames: 'systemRequestViewSelect',
-
- contentBinding: 'SDL.SDLModel.systemRequestState',
-
- optionValuePath: 'content.id',
-
- optionLabelPath: 'content.name',
-
- /**
- * Selected data sent on model for further processing
- */
- click: function() {
-
- SDL.SDLController.systemRequestViewSelected( this.selection.name );
-
- }
- } ),
-
- /**
- * Trigger function that activates and deactivates tbtClientStateView
- */
- toggleActivity: function() {
- this.toggleProperty( 'active' );
- }
-} ); \ 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
deleted file mode 100644
index ae45786f5c..0000000000
--- a/src/components/HMI/app/view/sdl/TTSPopUp.js
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.TTSPopUp
- * @desc TTSPopUp module visual representation
- * @category View
- * @filesource app/view/sdl/TTSPopUp.js
- * @version 1.0
- */
-
-SDL.TTSPopUp = Em.ContainerView.create( {
-
- elementId: 'TTSPopUp',
-
- classNames: 'TTSPopUp',
-
- classNameBindings: [
- 'active'
- ],
-
- childViews: [
- 'popUp',
- 'message',
- 'okButton',
- 'timerText',
- 'checkBoxLabel',
- 'checkBox'
- ],
-
- requestId: null,
-
- content: 'Messaage',
-
- active: false,
-
- timer: null,
-
- appID: null,
-
- timerSeconds: 5,
-
- popUp: Ember.TextArea.extend( {
-
- elementId: 'popUp',
-
- classNames: 'popUp',
-
- valueBinding: 'parentView.content'
- }),
-
- message: SDL.Label.extend( {
-
- elementId: 'message',
-
- classNames: 'message'
- }),
-
- okButton: SDL.Button.extend( {
- classNames: 'button okButton',
- text: 'Reset Timeout',
- action: 'resetTimeout',
- target: 'parentView',
- buttonAction: true,
- onDown: false,
- 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',
-
- classNames: 'timerText',
-
- contentBinding: 'parentView.timerSeconds'
- }),
-
-
-
- resetTimeout: function () {
- this.set('timerSeconds', 10);
- FFW.TTS.OnResetTimeout(this.appID, "TTS.Speak");
- },
-
- ActivateTTS: function(msg, appID) {
-
- var self = this;
-
- this.set('appID', appID);
- this.set('content', msg);
- this.set('active', true);
-
- clearInterval(this.timer);
- this.timer = setInterval(function() {
-
- self.set('timerSeconds', self.timerSeconds - 1);
- }, 1000); // timeout for TTS popUp timer interval in milliseconds
- FFW.TTS.Started();
- },
-
- timerHandler: function () {
- if (this.timerSeconds === 0) {
- this.DeactivateTTS();
- }
- }.observes('this.timerSeconds'),
-
- DeactivateTTS: function() {
- clearInterval(this.timer);
- this.set('active', false);
- this.appID = null;
- this.set('timerSeconds', 5);
- this.checkBox.set('checked', true);
-
- if (this.checkBox.checked) {
- SDL.SDLController.TTSResponseHandler();
- FFW.TTS.Stopped();
- }
- },
-
- /**
- * This event triggered when component is placed to document DOM structure
- */
- didInsertElement: function() {
-
- this._super();
- }
-});
diff --git a/src/components/HMI/app/view/sdl/VRHelpListView.js b/src/components/HMI/app/view/sdl/VRHelpListView.js
deleted file mode 100644
index bf93137fac..0000000000
--- a/src/components/HMI/app/view/sdl/VRHelpListView.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InteractionChoicesView
- * @desc Interaction Choices visual representation
- * @category View
- * @filesource app/view/sdl/shared/interactionChoicesView.js
- * @version 1.0
- */
-
-SDL.VRHelpListView = SDL.SDLAbstractView.create( {
-
- elementId: 'vr_help_list_view',
-
- childViews: [
- 'backButton', 'captionText', 'helpList'
- ],
-
- helpList: SDL.List.extend( {
- elementId: 'vr_help_list_view_list',
- itemsOnPage: 5,
- items: []
- }),
-
- /**
- * Deactivate window
- */
- deactivate: function() {
-
- this._super();
-
- if (SDL.SDLAppController.model && SDL.SDLModel.vrActiveRequests.vrPerformInteraction) {
- SDL.SDLController.vrInteractionResponse(SDL.SDLModel.resultCode['ABORTED']);
- }
-
- SDL.SDLController.VRMove();
- },
-
- /**
- * Clean choices caption and list before new proform
- */
- clean: function() {
-
- this.set('captionText.content', 'vrHelp');
- this.helpList.items = [];
- this.helpList.list.refresh();
- },
-
- /**
- * Update choises list with actual set id
- *
- * @param data:
- * Array
- */
- showVRHelp: function(vrHelpTitle, vrHelp) {
-
- this.clean();
-
- this.set('active', true);
-
- SDL.SDLController.VRMove();
-
- if (vrHelpTitle) {
- this.captionText.set('content', vrHelpTitle);
- }
-
- if (vrHelp) {
- for (i = 0; i < vrHelp.length; i++) {
- this.helpList.items.push( {
- type: SDL.Label,
- params: {
- content: vrHelp[i].text,
- icon: vrHelp[i].image
- ? vrHelp[i].image.value : null,
- templateName: vrHelp[i].image ? "icon" : null
- }
- });
- }
- }
-
- this.helpList.list.refresh();
- }
-});
diff --git a/src/components/HMI/app/view/sdl/VRPopUp.js b/src/components/HMI/app/view/sdl/VRPopUp.js
deleted file mode 100644
index 5a26a9ee80..0000000000
--- a/src/components/HMI/app/view/sdl/VRPopUp.js
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.VRPopUp
- * @desc VRPopUp module visual representation
- * @category View
- * @filesource app/view/sdl/VRPopUp.js
- * @version 1.0
- */
-
-SDL.VRPopUp = Em.ContainerView.create( {
-
- elementId: 'VRPopUp',
-
- classNames: 'VRPopUp',
-
- classNameBindings:
- [
- 'SDL.SDLModel.VRActive:active',
- 'SDL.SDLModel.VRHelpListActivated:move'
- ],
-
- childViews:
- [
- 'popUp',
- 'VRLabel',
- 'VRImage',
- 'listOfCommands'
- ],
-
- VRImage: Em.View.extend( {
-
- elementId: 'VRImage',
-
- classNames: 'VRImage'
- } ),
-
- VRLabel: SDL.Label.extend( {
-
- elementId: 'VRLabel',
-
- classNames: 'VRLabel',
-
- content: 'Speak the command'
- } ),
-
- VRActiveBinding: 'SDL.SDLModel.VRActive',
-
- popUp: Em.View.extend( {
-
- elementId: 'popUp',
-
- classNames: 'popUp'
- } ),
-
- AddCommand: function(cmdID, vrCommands, appID, type, grammarID) {
-
- if (type == "Application") {
- for( var i = 0; i < vrCommands.length; i++ ){
- this.get( 'listOfCommands.list.childViews' ).pushObject( SDL.Button.create( {
- action: 'onActivateSDLApp',
- target: 'SDL.SDLController',
- appID: appID,
- text: vrCommands[i],
- classNames: 'list-item',
- templateName: 'text'
- } ) );
- }
- } else {
- for( var j = 0; j < vrCommands.length; j++ ){
-
- this.get( 'listOfCommands.list.childViews' ).pushObject( SDL.Button.create( {
- action: type == 'Command' ? 'onVRCommand' : 'VRPerformAction',
- target: 'SDL.SDLAppController',
- appID: appID,
- grammarID: grammarID,
- commandID: cmdID,
- text: vrCommands[j],
- type: type,
- hideButtons: function() {
- if (this.type == "Command" && SDL.SDLModel.performInteractionSession.length == 0) {
- return false;
- } else if (SDL.SDLModel.performInteractionSession && SDL.SDLModel.performInteractionSession.indexOf(this.grammarID) >= 0) {
- return false;
- } else {
- return true;
- }
- }.property('SDL.SDLModel.performInteractionSession'),
- classNameBindings: ['this.hideButtons:hide'],
- classNames: 'list-item',
- templateName: 'text'
- } ) );
- }
- }
- },
-
- updateVR: function(){
-
- this.listOfCommands.list.removeAllChildren();
- this.listOfCommands.list.refresh();
-
- var len = SDL.SDLModel.VRCommands.length;
- for (var i = 0; i < len; i++) {
- this.AddCommand(SDL.SDLModel.VRCommands[i].cmdID, SDL.SDLModel.VRCommands[i].vrCommands, SDL.SDLModel.VRCommands[i].appID, SDL.SDLModel.VRCommands[i].type);
- }
-
- if (SDL.SDLAppController.model) {
-
- len = SDL.SDLAppController.model.VRCommands.length;
- for (var i = 0; i < len; i++) {
- this.AddCommand(SDL.SDLAppController.model.VRCommands[i].cmdID,
- SDL.SDLAppController.model.VRCommands[i].vrCommands,
- SDL.SDLAppController.model.VRCommands[i].appID,
- SDL.SDLAppController.model.VRCommands[i].type,
- SDL.SDLAppController.model.VRCommands[i].grammarID);
- }
- }
-
- if (SDL.SDLModel.stateLimited) {
- len = SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands.length;
- for (var i = 0; i < len; i++) {
- this.AddCommand(SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].cmdID,
- SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].vrCommands,
- SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].appID,
- SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].type,
- SDL.SDLController.getApplicationModel(SDL.SDLModel.stateLimited).VRCommands[i].grammarID);
- }
- }
-
- }.observes('SDL.SDLAppController.model'),
-
- DeleteCommand: function(commandID, appID) {
-
- if (commandID != 0) {
- var t = this.get('listOfCommands.list.childViews').filterProperty('commandID', commandID);
- for (var i = 0; i < t.length; i++) {
- t[i].remove();
- t[i].destroy();
- }
- } else {
- var t = this.get('listOfCommands.list.childViews').filterProperty('appID', appID);
- for (var i = 0; i < t.length; i++) {
- t[i].remove();
- t[i].destroy();
- }
- }
- },
-
- DeleteActivateApp: function(appID) {
-
- var t = this.get('listOfCommands.list.childViews').filterProperty('appID', appID);
- for (var i = 0; i < t.length; i++) {
- t[i].remove();
- t[i].destroy();
- }
- },
-
- /**
- * List for option on SDLOptionsView screen
- */
- listOfCommands: SDL.List.extend( {
-
- elementId: 'VR_list',
-
- itemsOnPage: 5,
-
- /** Items array */
- items: [
- {
- type: SDL.Button,
- params: {
- //templateName: template,
- text: 'Help',
- target: 'SDL.SDLController',
- action: 'vrHelpAction',
- onDown: false
- }
- }
- ]
- } ),
-
- // deactivate VR on change application state
- onStateChange: function() {
- if (this.VRActive) {
- FFW.VR.Started();
- this.set( 'VRActive', false );
- } else {
- FFW.VR.Stopped();
- }
- }.observes('SDL.TransitionIterator.ready'),
-
- onActivate: function() {
- SDL.SDLController.VRMove();
- if (this.VRActive) {
-
- FFW.VR.Started();
- SDL.SDLController.onSystemContextChange();
- } else {
-
- FFW.VR.Stopped();
- SDL.SDLController.onSystemContextChange();
- }
- }.observes('this.VRActive'),
-
- /**
- * This event triggered when component is placed to
- * document DOM structure
- */
- didInsertElement: function() {
- this._super();
- }
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/VehicleInfoView.js b/src/components/HMI/app/view/sdl/VehicleInfoView.js
deleted file mode 100644
index 915d416d76..0000000000
--- a/src/components/HMI/app/view/sdl/VehicleInfoView.js
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.VehicleInfo
- * @desc VehicleInfo module visual representation
- * @category View
- * @filesource app/view/sdl/VehicleInfo.js
- * @version 1.0
- */
-
-SDL.VehicleInfo = Em.ContainerView.create( {
-
- elementId: 'VehicleInfo',
-
- classNames: 'VehicleInfo',
-
- classNameBindings:
- [
- 'active'
- ],
-
- childViews:
- [
- 'prndl',
- 'vehicleInfoLabel',
- 'prndlSelect',
- 'ecu1Title',
- 'ecu1',
- 'ecu2',
- 'ecu1Data',
- 'ecu2Data',
- 'odometrTitle',
- 'odometrInput',
- 'onAwakeSDLButton'
- ],
-
- /**
- * Title of odometr group of parameters stored data in VehicleInfo model
- */
- odometrTitle: SDL.Label.extend( {
-
- elementId: 'odometrTitle',
-
- classNames: 'odometrTitle',
-
- content: 'Odometr'
- } ),
-
- /**
- * Input for odometr value changes
- */
- odometrInput: Ember.TextField.extend({
- elementId: "odometrInput",
- classNames: "odometrInput",
- keyUp: function(event, view) {
- if(event.which == 13){
- SDL.SDLVehicleInfoModel.set('odometrInput', parseInt(this.value));
- }
- }
- }),
-
- /**
- * Label with stored data in VehicleInfo model
- */
- ecu2Data: SDL.Label.extend( {
-
- elementId: 'ecu2Data',
-
- classNames: 'ecu2Data',
-
- contentBinding: 'SDL.SDLVehicleInfoModel.ecuDIDData.1.data'
- } ),
-
- /**
- * Label with stored data in VehicleInfo model
- */
- ecu1Data: SDL.Label.extend( {
-
- elementId: 'ecu1Data',
-
- classNames: 'ecu1Data',
-
- contentBinding: 'SDL.SDLVehicleInfoModel.ecuDIDData.0.data'
- } ),
-
- /**
- * Label with name of some parameter stored data in VehicleInfo model
- */
- ecu2: SDL.Label.extend( {
-
- elementId: 'ecu2',
-
- classNames: 'ecu2',
-
- content: 'ECU 2:'
- } ),
-
- /**
- * Label with name of some parameter stored data in VehicleInfo model
- */
- ecu1: SDL.Label.extend( {
-
- elementId: 'ecu1',
-
- classNames: 'ecu1',
-
- content: 'ECU 1:'
- } ),
-
- /**
- * Title of ecu group of parameters stored data in VehicleInfo model
- */
- ecu1Title: SDL.Label.extend( {
-
- elementId: 'ecu1Title',
-
- classNames: 'ecu1Title',
-
- content: 'ECU'
- } ),
-
- /**
- * Title of VehicleInfo PopUp view
- */
- vehicleInfoLabel: SDL.Label.extend( {
-
- elementId: 'vehicleInfoLabel',
-
- classNames: 'vehicleInfoLabel',
-
- content: 'Vehicle Information'
- } ),
-
- /**
- * Property indicates the activity state of VehicleInfo PopUp
- */
- active: false,
-
- /**
- * Title of prndl group of parameters stored in VehicleInfo model
- */
- prndl: SDL.Label.extend( {
-
- elementId: 'prndl',
-
- classNames: 'prndl',
-
- content: 'PRNDL'
- } ),
-
- /**
- * HMI element Select with parameters of transmission state from VehicleInfo
- * Model
- */
- prndlSelect: Em.Select.extend( {
-
- elementId: 'prndlSelect',
-
- classNames: 'prndlSelect',
-
- contentBinding: 'SDL.SDLVehicleInfoModel.vehicleInfoPRNDL',
-
- valueBinding: 'SDL.SDLVehicleInfoModel.prndlSelectState'
- } ),
-
- /**
- * 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() {
- this.set( 'active', !this.active );
- },
-
- /**
- * This event triggered when component is placed to
- * document DOM structure
- */
- didInsertElement: function() {
- this._super();
- }
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/driverDistraction.js b/src/components/HMI/app/view/sdl/driverDistraction.js
deleted file mode 100644
index e2f57105c7..0000000000
--- a/src/components/HMI/app/view/sdl/driverDistraction.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DriverDistraction
- * @desc DriverDistractionPopUp module visual representation
- * @category View
- * @filesource app/view/sdl/driverDistraction.js
- * @version 1.0
- */
-
-SDL.DriverDistraction = Em.ContainerView.create( {
-
- elementId: 'driverDistraction',
-
- classNames: 'driverDistractionWindow',
-
- classNameBindings:
- [
- 'active'
- ],
-
- childViews:
- [
- 'driverDistractionPopUp',
- 'driverDistractionText'
- ],
-
- content: 'Not accessible while driving',
-
- active: false,
-
- driverDistractionPopUp: Em.View.create( {
-
- classNames: 'driverDistraction'
- } ),
-
- driverDistractionText: SDL.Label.extend( {
-
- elementId: 'driverDistractionText',
-
- classNames: 'driverDistractionText',
-
- contentBinding: 'parentView.content'
- } ),
-
- activate: function() {
- this.set( 'active', true );
- setTimeout( function() {
- SDL.DriverDistraction.deactivate();
- }, 3000 );
-
- SDL.SDLController.onSystemContextChange();
- },
-
- deactivate: function() {
- this.set( 'active', false );
-
- SDL.SDLController.onSystemContextChange();
- }
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/shared/AbstractView.js b/src/components/HMI/app/view/sdl/shared/AbstractView.js
deleted file mode 100644
index 0294c17732..0000000000
--- a/src/components/HMI/app/view/sdl/shared/AbstractView.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SDLAbstractView
- * @desc SDL application abstract shared view
- * @category View
- * @filesource app/view/sdl/shared/AbstractView.js
- * @version 1.0
- */
-
-SDL.SDLAbstractView = Em.ContainerView.extend( {
-
- classNames:
- [
- 'sdl-window'
- ],
-
- classNameBindings:
- [
- 'active:active_state:inactive_state'
- ],
-
- active: false,
-
- caption: 'Caption Text',
-
- /**
- * Activate window and set caption text
- *
- * @param text: String
- */
- activate: function( text ) {
- if( text ){
- this.set( 'caption', text );
- }
- this.set( 'active', true );
- },
-
- /**
- * Deactivate window
- */
- deactivate: function() {
- this.set( 'active', false );
- },
-
- onStateChange: function() {
- if( this.active ){
- this.deactivate();
- }
- }.observes( 'SDL.TransitionIterator.ready' ),
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'back-button'
- ],
- target: 'this.parentView',
- action: 'deactivate',
- icon: 'images/media/ico_back.png',
- onDown: false
- } ),
-
- captionText: SDL.Label.extend( {
- classNames:
- [
- 'caption-text'
- ],
-
- contentBinding: 'this.parentView.caption'
- } )
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js b/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
deleted file mode 100644
index 288031ab17..0000000000
--- a/src/components/HMI/app/view/sdl/shared/interactionChoicesView.js
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.InteractionChoicesView
- * @desc Interaction Choices visual representation
- * @category View
- * @filesource app/view/sdl/shared/interactionChoicesView.js
- * @version 1.0
- */
-
-SDL.InteractionChoicesView = SDL.SDLAbstractView.create({
-
- elementId: 'perform_interaction_view',
-
- childViews: [
- 'backButton',
- 'captionText',
- 'listOfChoices',
- 'input',
- 'listWrapper'
- ],
-
- didInsertElement: function(){
-
- SDL.SDLModel.interactionListWrapper = new iScroll('listWrapper', { hideScrollbar:false, hScrollbar: true, vScrollbar: true, hScroll: true, vScroll: true });
- },
-
- backButton: SDL.Button.extend({
- classNames: [
- 'back-button'
- ],
- target: 'SDL.SDLController',
- action: 'InteractionChoicesDeactivate',
- icon: 'images/media/ico_back.png',
- onDown: false
- }),
-
- input: Ember.TextArea.extend({
- classNameBindings: ['this.parentView.search::hide'],
- tagName: 'input',
- attribute: ['type:text'],
- attributeBindings: ['disabled'],
- disabled: false,
- click: function(){
- SDL.SDLModel.uiShowKeyboard(this);
- },
- search: function(){
- FFW.UI.OnKeyboardInput(SDL.SDLModel.keyboardInputValue, "ENTRY_SUBMITTED");
- this.get('parentView').deactivate("SUCCESS");
- }
- }),
-
- listWrapper: Em.ContainerView.extend({
-
- classNameBindings: ['this.parentView.icon::hide'],
-
- elementId: 'listWrapper',
-
- classNames: 'listWrapper',
-
- childViews: [
- 'naviChoises'
- ],
-
- click: function() {
- if (this._parentView.active) {
- SDL.InteractionChoicesView.timerUpdate();
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
- }
- },
-
- naviChoises: Em.ContainerView.extend({
- classNames: 'naviChoises',
- childViews: [
- 'captionText'
- ],
-
- captionText: SDL.Label.extend({
-
- classNameBindings: ['this.parentView.search:hide'],
- classNames: ['caption-text'],
- contentBinding: 'this.parentView.caption'
- })
-
- })
- }),
-
- captionText: SDL.Label.extend({
-
- classNameBindings: ['this.parentView.search:hide'],
- classNames: ['caption-text'],
- contentBinding: 'this.parentView.caption'
- }),
-
- listOfChoices: SDL.List.extend({
- classNameBindings: ['this.parentView.list::hide'],
- elementId: 'perform_interaction_view_list',
- itemsOnPage: 5,
- items: [],
- click: function() {
- if (this._parentView.active) {
- SDL.InteractionChoicesView.timerUpdate();
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
- }
- }
- }),
-
- timer: null,
-
- timeout: null,
-
- search: false,
-
- list: false,
-
- icon: false,
-
- /**
- * Id of app initiated performInteraction request
- */
- appID: null,
-
- /**
- * Method updates popup timer when data changes through keyboard
- */
- timerUpdate: function (){
- if (this.timeout) {
- clearTimeout(this.timer);
- var self = this;
- this.timer = setTimeout(function () {
-
- self.deactivate("TIMED_OUT");
- }, this.timeout);
- }
- }.observes('this.input.value'),
-
- /**
- * Activate window and set caption text
- *
- * @param text: String
- */
- activate: function (message) {
-
- this.clean();
-
- if (message.params && message.params.initialText) {
- this.set('caption', message.params.initialText.fieldText);
- }
-
- this.appID = message.params.appID;
-
- if (message.params.interactionLayout) {
-
- switch (message.params.interactionLayout) {
- case "ICON_ONLY" : {
-
- this.preformChoicesNavigation(message.params.choiceSet, message.params.timeout);
-
-
- this.set('search', false);
- this.set('list', false);
- this.set('icon', true);
- this.set('active', true);
- break;
- }
- case "ICON_WITH_SEARCH" : {
-
- this.preformChoicesNavigation(message.params.choiceSet, message.params.timeout);
-
- this.set('icon', true);
- this.set('search', true);
- this.set('list', false);
- this.set('active', true);
- break;
- }
- case "LIST_ONLY" : {
-
- this.preformChoices(message.params.choiceSet, message.params.timeout);
-
- this.set('list', true);
- this.set('icon', false);
- this.set('search', false);
- this.set('active', true);
- break;
- }
- case "LIST_WITH_SEARCH" : {
-
- this.preformChoices(message.params.choiceSet, message.params.timeout);
-
- this.set('list', true);
- this.set('search', true);
- this.set('icon', false);
- this.set('active', true);
- break;
- }
- case "KEYBOARD" : {
- this.preformChoices(null, message.params.timeout);
- SDL.SDLModel.uiShowKeyboard(this.input);
-
-
- this.set('list', false);
- this.set('search', false);
- this.set('icon', false);
- // this.set('active', true);
-
- break;
- }
- default:
- {
- // default action
- }
- }
- } else {
-
- if (message.params.choiceSet) {
- this.preformChoices(message.params.choiceSet, message.params.timeout);
-
- this.set('list', true);
- this.set('icon', false);
- this.set('search', false);
- this.set('active', true);
- } else {
-
- this.timer = setTimeout(function () {
- SDL.InteractionChoicesView.deactivate("TIMED_OUT");
- }, message.params.timeout);
- }
- }
-
- },
-
- /**
- * Deactivate window
- */
- deactivate: function (result, choiceID) {
-
- if (SDL.SDLModel.performInteractionSession.length > 0 && result != "ABORTED") {
- this.timerUpdate();
- } else {
-
- clearTimeout(this.timer);
- this.timer = null;
- this.set('active', false);
- SDL.SDLController.VRMove();
- SDL.Keyboard.deactivate();
-
- switch (result) {
- case "ABORTED":
- {
- SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["ABORTED"]);
- break;
- }
- case "TIMED_OUT":
- {
- SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["TIMED_OUT"]);
- break;
- }
- case "SUCCESS":
- {
- SDL.SDLController.interactionChoiseCloseResponse(this.appID, SDL.SDLModel.resultCode["SUCCESS"], choiceID, this.input.value);
- break;
- }
- default:
- {
- // default action
- }
- }
-
- this.appID = null;
-
- SDL.SDLController.onSystemContextChange();
- }
- },
-
- /**
- * Clean choices caption and list before new proform
- */
- clean: function () {
-
- this.input.set('value', null);
- this.set('captionText.content', 'Interaction Choices');
- this.set('timeout', null);
- this.listOfChoices.items = [];
- this.listOfChoices.list.refresh();
- var length = this.get('listWrapper.naviChoises.childViews').length;
- for (var i=0; i < length; i++) {
- SDL.InteractionChoicesView.get('listWrapper.naviChoises.childViews').shiftObject();
- }
- },
-
- /**
- * Update choises list with actual set id
- *
- * @param data:
- * Array
- */
- preformChoices: function (data, timeout) {
-
- this.set('timeout', timeout);
-
- if (data) {
-
- // temp for testing
- for (var i = 0; i < data.length; i++) {
- this.listOfChoices.items
- .push({
- type: SDL.Button,
- params: {
- text: data[i].menuName,
- choiceID: data[i].choiceID,
- action: 'onChoiceInteraction',
- onDown: false,
- target: 'SDL.SDLAppController',
- templateName: data[i].image ? 'rightIcon' : 'text',
- icon: data[i].image ? data[i].image.value : null
- }
- });
- }
-
- this.listOfChoices.list.refresh();
- }
-
- var self = this;
-
- clearTimeout(this.timer);
- this.timer = setTimeout(function () {
-
- self.deactivate("TIMED_OUT");
- }, timeout);
- },
-
- /**
- * Update choises list with actual set id
- *
- * @param data:
- * Array
- */
- preformChoicesNavigation: function (data, timeout) {
-
- this.set('timeout', timeout);
-
- if (data) {
-
- // temp for testing
- for (var i = 0; i < data.length; i++) {
- this.get('listWrapper.naviChoises.childViews').pushObject(SDL.Button.create({
- text: data[i].menuName,
- choiceID: data[i].choiceID,
- action: 'onChoiceInteraction',
- onDown: false,
- target: 'SDL.SDLAppController',
- templateName: data[i].image ? 'rightIcon' : 'text',
- icon: data[i].image ? data[i].image.value : null
- })
- );
- }
-
- }
-
- var self = this;
-
- setTimeout(function(){
-
- SDL.SDLModel.interactionListWrapper.refresh();
- }, 0);
-
- clearTimeout(this.timer);
- this.timer = setTimeout(function () {
- self.deactivate("TIMED_OUT");
- }, timeout);
- }
-});
diff --git a/src/components/HMI/app/view/sdl/shared/keyboard.js b/src/components/HMI/app/view/sdl/shared/keyboard.js
deleted file mode 100644
index e47cc5956a..0000000000
--- a/src/components/HMI/app/view/sdl/shared/keyboard.js
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.Keyboard
- * @desc Slider visual representation
- * @category View
- * @filesource app/view/sdl/shared/keyboard.js
- * @version 1.0
- */
-
-SDL.Keyboard = SDL.SDLAbstractView.create({
-
- elementId: 'keyboard_view',
-
- childViews: [
- 'backButton',
- 'microphone',
- 'searchBar',
- 'controlls',
- 'buttonsAreaQWERTY',
- 'buttonsAreaQWERTZ',
- 'buttonsAreaAZERTY'
- ],
-
- /**
- * Activate keyboard method
- *
- * @param {Object}
- */
- activate: function( element ) {
- if( element.tagName === 'input' ){
-
- this.set( 'active', true );
- this.set('target', element);
- }
- },
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'back-button'
- ],
- action: function() {
-
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.uiPerformInteraction && !SDL.InteractionChoicesView.active) {
- FFW.UI.OnKeyboardInput("", "ENTRY_CANCELLED");
- SDL.InteractionChoicesView.deactivate("ABORTED");
- }
- SDL.Keyboard.deactivate();
- },
- icon: 'images/media/ico_back.png',
- onDown: false
- } ),
-
- /**
- * Extend deactivate method send SUCCESS response on deactivate with current
- * slider value
- */
- deactivate: function () {
-
- this._super();
- this.searchBar.input.set('value', null);
- this.set('target', null);
- },
-
- inputChanges: function (element) {
-
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.activeRequests.uiPerformInteraction) {
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
- }
-
- if (this.searchBar.input.value == null) {
- this.searchBar.input.set('value', "");
- }
-
- switch (element.text) {
- case "Space": {
- this.searchBar.input.set('value', this.searchBar.input.value + " ");
- this.target.set('value', this.searchBar.input.value);
- break;
- }
- case "Search": {
- if (this.target.value == null) {
- this.target.set('value', "");
- }
- this.target.search();
- this.deactivate();
- break;
- }
- default:{
- this.searchBar.input.set('value', this.searchBar.input.value + element.text);
- this.target.set('value', this.searchBar.input.value);
- }
-
- }
- },
-
- clearBtn: function (element) {
- this.searchBar.input.set('value', this.searchBar.input.value.slice(0, -1));
- this.target.set('value', this.searchBar.input.value);
- if (this.searchBar.input.value == "") {
- FFW.UI.OnKeyboardInput("", "ENTRY_CANCELLED");
- }
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.PerformInteraction");
- },
-
- /**
- * Tearget element that initiated keyboard
- */
- target: null,
-
- microphone: SDL.Button.extend({
- classNames: 'microphone',
- text: 'mic'
- }),
-
- searchBar: Em.ContainerView.extend({
-
- classNames: 'searchBar',
-
- childViews: [
- 'input',
- 'clearBtn',
- 'serchIcon'
- ],
-
- clearBtn: SDL.Button.extend({
- classNames: 'clearBtn',
- text: 'X',
- action: 'clearBtn',
- target: 'parentView.parentView'
- }),
-
- serchIcon: Em.View.extend({
- classNames: 'serchIcon'
- }),
-
- input: Ember.TextField.extend({
- elementId: "keyboardInput",
- classNames: "keyboardInput",
- valueBinding: 'SDL.SDLModel.keyboardInputValue'
- })
-
- }),
-
- controlls: Em.ContainerView.extend({
-
- classNames: 'controlls',
-
- childViews: [
- 'numericBtn',
- 'symbolBtn',
- 'spaceBtn',
- 'caseSwitchBtn',
- 'localisationBtn',
- 'searchBtn'
- ],
-
- numericBtn: SDL.Button.extend({
- classNames: 'numericBtn controll',
- text: '123'
- }),
-
- symbolBtn: SDL.Button.extend({
- classNames: 'symbolBtn controll',
- text: '!@#'
- }),
-
- spaceBtn: SDL.Button.extend({
- classNames: 'spaceBtn controll',
- text: 'Space',
- target : 'parentView.parentView',
- action : 'inputChanges'
- }),
-
- caseSwitchBtn: SDL.Button.extend({
- classNames: 'caseSwitchBtn controll',
- text: 'ABC'
- }),
-
- localisationBtn: SDL.Button.extend({
- classNames: 'localisationBtn controll',
- icon: 'images/info/info_leftMenu_apps_ico.png'
- }),
-
- searchBtn: SDL.Button.extend(SDL.PresetEvents, {
- classNames: 'searchBtn controll',
- text: 'Search',
- click: function(){
- this.get('parentView.parentView').inputChanges(this);
- },
- presetName: 'SEARCH'
- })
- }),
-
- disableButtons: function(){
-
- if (SDL.SDLAppController.model) {
- if (!SDL.SDLAppController.model.globalProperties.keyboardProperties) {
- return;
- }
- var list = SDL.SDLAppController.model.globalProperties.keyboardProperties.limitedCharacterList ? SDL.SDLAppController.model.globalProperties.keyboardProperties.limitedCharacterList : [];
-
- for (var i = 0; i < list.length; i++) {
- list[i] = list[i].toLowerCase();
- }
-
- if (SDL.SDLAppController.model && list.length){
-
- for (var i = 0; i < this.buttonsAreaQWERTY._childViews.length; i++) {
-
- if (list.indexOf(this.buttonsAreaQWERTY._childViews[i].text) < 0) {
- this.buttonsAreaQWERTY._childViews[i].set('disabled', true);
- this.buttonsAreaQWERTZ._childViews[i].set('disabled', true);
- this.buttonsAreaAZERTY._childViews[i].set('disabled', true);
- } else {
- this.buttonsAreaQWERTY._childViews[i].set('disabled', false);
- this.buttonsAreaQWERTZ._childViews[i].set('disabled', false);
- this.buttonsAreaAZERTY._childViews[i].set('disabled', false);
- }
- }
- } else if (SDL.SDLAppController.model && !list.length) {
- for (var i = 0; i < this.buttonsAreaQWERTY._childViews.length; i++) {
- this.buttonsAreaQWERTY._childViews[i].set('disabled', false);
- }
- }
- }
-
- }.observes('SDL.SDLAppController.model.globalProperties.keyboardProperties.limitedCharacterList.@each'),
-
- buttonsAreaQWERTY: SDL.QWERTYLayout.create({
-
- classNameBindings: 'this.pQWERTY::hide',
-
- pQWERTY: function(){
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout == "QWERTY") {
- return true;
- } else {
- return false;
- }
- }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout')
-
- }),
-
- buttonsAreaQWERTZ: SDL.QWERTZLayout.create({
-
- classNameBindings: 'this.pQWERTZ::hide',
-
- pQWERTZ: function(){
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout == "QWERTZ") {
- return true;
- } else {
- return false;
- }
- }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout')
-
- }),
-
- buttonsAreaAZERTY: SDL.AZERTYLayout.create({
-
- classNameBindings: 'this.pAZERTY::hide',
-
- pAZERTY: function(){
- if (SDL.SDLAppController.model && SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout == "AZERTY") {
- return true;
- } else {
- return false;
- }
- }.property('SDL.SDLAppController.model.globalProperties.keyboardProperties.keyboardLayout')
-
- })
-
-});
diff --git a/src/components/HMI/app/view/sdl/shared/optionsView.js b/src/components/HMI/app/view/sdl/shared/optionsView.js
deleted file mode 100644
index a4858255a5..0000000000
--- a/src/components/HMI/app/view/sdl/shared/optionsView.js
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.OptionsView
- * @desc Options visual representation
- * @category View
- * @filesource app/view/sdl/shared/optionsView.js
- * @version 1.0
- */
-
-SDL.OptionsView = SDL.SDLAbstractView.create({
-
- elementId: 'sdl_options',
-
- childViews:
- [
- 'backButton',
- 'captionText',
- 'commands'
- ],
-
- // Menu caption text
- captionBinding: 'SDL.SDLAppController.model.currentSubMenuLabel',
-
- commands: SDL.List.extend({
-
- elementId: 'info_nonMedia_options_list',
-
- itemsOnPage: 5,
-
- items: [],
-
- /*
- * itemsDefault: [ { type: SDL.Button,
- *
- * params: { templateName: 'text', text: 'Exit', target:
- * 'this.parentView.parentView.parentView', action: 'deactivate',
- * onDown: false } }, { type: SDL.Button,
- *
- * params: { templateName: 'arrow', text: 'Device Information', } } ],
- */
-
- refreshItems: function() {
-
- if (SDL.SDLAppController.model) {
-
- var commands = SDL.SDLAppController.model.get('currentCommandsList'),
- i,
- len,
- template;
-
- this.items = [];
-
- len = commands.length;
-
- for(i = 0; i < len; i++){
-
- if(commands[i].menuID >= 0){
- template = 'arrow';
- }else{
- template = commands[i].icon ? 'rightText' : 'text';
- }
-
- this.items.push({
- type: SDL.Button,
- params: {
- templateName: template,
- text: commands[i].name,
- commandID: commands[i].commandID,
- menuID: commands[i].menuID,
- icon: commands[i].icon,
- target: 'SDL.SDLAppController',
- action: 'onCommand',
- onDown: false
- }
- })
- }
-
- this.list.refresh();
- }
-
- }.observes('SDL.SDLAppController.model.currentSubMenuId', 'SDL.SDLAppController.model.currentCommandsList.@each')
- }),
-
- activate: function(text) {
- this._super();
-
- SDL.SDLAppController.buttonsSort('top', SDL.SDLAppController.model.appID);
- SDL.OptionsView.commands.refreshItems();
-
- SDL.SDLController.onSystemContextChange();
- },
-
- // Extend deactivate window
- deactivate: function() {
-
- if (SDL.SDLAppController.model) {
-
- if (SDL.SDLAppController.model.get('currentSubMenuId') >= 0) {
- SDL.SDLAppController.onSubMenu('top');
- }else{
- this._super();
- SDL.SDLController.onSystemContextChange();
- }
- }
-
- }
-});
diff --git a/src/components/HMI/app/view/sdl/shared/scrollableMessage.js b/src/components/HMI/app/view/sdl/shared/scrollableMessage.js
deleted file mode 100644
index 3c42378749..0000000000
--- a/src/components/HMI/app/view/sdl/shared/scrollableMessage.js
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.ScrollableMessage
- * @desc ScrollableMessage module visual representation
- * @category View
- * @filesource app/view/sdl/shared/scrollableMessage.js
- * @version 1.0
- */
-
-SDL.ScrollableMessage = SDL.SDLAbstractView.create({
-
- elementId: 'ScrollableMessage',
-
- classNames: 'ScrollableMessage',
-
- classNameBindings: [
- 'active:active'
- ],
-
- /**
- * Id of current request
- *
- * @type {Number}
- */
- messageRequestId: null,
-
- active: false,
-
- appID: null,
-
- timer: null,
-
- timeout: null,
-
- childViews: [
- 'backButton', 'captionText', 'softButtons', 'listOfCommands'
- ],
-
- /**
- * Deactivate View
- *
- * @param {Object} ABORTED Parameter to indicate status for
- * UI.ScrollableMessageResponse
- */
- deactivate: function (ABORTED) {
- clearTimeout(this.timer);
- this.set('active', false);
- this.softButtons.set('page', 0);
-
- this.timeout = null;
-
- SDL.SDLController.scrollableMessageResponse(ABORTED ? SDL.SDLModel.resultCode['ABORTED'] : SDL.SDLModel.resultCode['SUCCESS'], this.messageRequestId);
-
- SDL.SDLController.onSystemContextChange();
- },
-
- activate: function (appName, params, messageRequestId) {
- if (appName) {
-
- var self = this;
-
- if (params.messageText.fieldName == 'scrollableMessageBody') {
- this.set('listOfCommands.items', params.messageText.fieldText);
- }
-
- this.set('messageRequestId', messageRequestId);
- this.set('captionText.content', appName);
- this.softButtons.addItems(params.softButtons, params.appID);
- this.set('active', true);
- clearTimeout(this.timer);
- this.timeout = params.timeout;
- this.timer = setTimeout(function () {
- self.deactivate();
- }, params.timeout);
- }
- },
-
- softButtons: SDL.MenuList.extend({
-
- itemsOnPage: 4,
-
- groupName: "ScrollableMessage",
-
- content: Em.ContainerView.extend({
-
- classNames: [
- 'content'
- ],
-
- attributeBindings: [
- 'parentView.contentPositon:style'
- ]
-
- })
- }),
-
- /**
- * List for option on SDLOptionsView screen
- */
- listOfCommands: SDL.ScrollableText.extend({
-
- elementId: 'scrollable_message_list',
-
- itemsOnPage: 11,
-
- /** Items array */
- items: 'asdasdasd',
-
- /**
- * Reset timeout function
- */
- click: function(){
-
- var self = this._parentView;
-
- clearTimeout(this._parentView.timer);
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.ScrollableMessage");
- this._parentView.timer = setTimeout(function () {
- self.deactivate();
- }, this._parentView.timeout);
- }
- })
-});
diff --git a/src/components/HMI/app/view/sdl/shared/sliderView.js b/src/components/HMI/app/view/sdl/shared/sliderView.js
deleted file mode 100644
index 033ab5ab91..0000000000
--- a/src/components/HMI/app/view/sdl/shared/sliderView.js
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.SliderView
- * @desc Slider visual representation
- * @category View
- * @filesource app/view/sdl/shared/sliderView.js
- * @version 1.0
- */
-
-SDL.SliderView = SDL.SDLAbstractView.create( {
-
- elementId: 'slider_view',
-
- childViews:
- [
- 'backButton',
- 'okButton',
- 'captionText',
- 'headerLabel',
- 'footerLabel',
- 'adjustControl'
- ],
-
- headerLabel: SDL.Label.extend( {
- classNames: 'slider-header',
- content: 'Header Label'
- } ),
-
- footerLabel: SDL.Label.extend( {
- classNames: 'slider-footer',
- content: 'Footer Label',
- data: []
- } ),
-
- /**
- * Identifier of current request
- */
- sliderRequestId: null,
-
- timer: null,
-
- timeout: null,
-
- /**
- * Extend deactivate method send SUCCESS response on deactivate with current
- * slider value
- */
- deactivate: function(timeout) {
- this._super();
- this.timeout = null;
- clearTimeout(this.timer);
- this.timer = null;
-
- if (timeout === true) {
- FFW.UI.sendSliderResult(SDL.SDLModel.resultCode["TIMED_OUT"], this.get('sliderRequestId'));
- } else if (timeout === false) {
- FFW.UI.sendSliderResult(SDL.SDLModel.resultCode["SUCCESS"], this.get('sliderRequestId'), this.get('adjustControl.sliderValue.value'));
- } else {
- FFW.UI.sendSliderResult(SDL.SDLModel.resultCode["ABORTED"], this.get('sliderRequestId'), this.get('adjustControl.sliderValue.value'));
- }
-
- SDL.SDLController.onSystemContextChange();
- },
-
- activate: function(text, timeout) {
- if( text ){
- this.set( 'caption', text );
- }
-
- this.set( 'active', true );
-
- this.set('timeout', timeout);
-
- this.timer = setTimeout(function () {
- if (SDL.SliderView.active) {
- SDL.SliderView.deactivate(true);
- }
- }, timeout);
- },
-
- dataChange: function(){
- if (this.timeout){
- var self = this;
-
- clearTimeout(this.timer);
- SDL.SDLController.onResetTimeout(SDL.SDLAppController.model.appID, "UI.Slider");
- this.timer = setTimeout(function () {
- self.deactivate(true);
- }, this.timeout);
- }
- }.observes('this.adjustControl.sliderValue.value'),
-
- okButton: SDL.Button.extend( {
- classNames: 'okButton',
- text: 'Submit',
- onDown: false,
- click: function() {
- SDL.SliderView.deactivate(false);
- }
- } ),
-
- adjustControl: Em.ContainerView.extend( {
-
- classNames: 'sliderControl',
-
- childViews:
- [
- 'minusBtn',
- 'led',
- 'plusBtn'
- ],
-
- sliderValue: Em.Object.create( {
- range: 10,
- value: 0
- } ),
-
- minusBtn: SDL.Button.extend( {
- classNames: 'control minus',
- icon: 'images/common/minus-ico.png',
- actionDown: function() {
- this._super();
- if (this._parentView.sliderValue.value > 1) {
- this.set( 'parentView.sliderValue.value', this._parentView.sliderValue.value - 1 );
- }
- }
- } ),
-
- led: SDL.Indicator.create( {
- classNames: 'ledContainer ico',
- contentBinding: 'parentView.sliderValue',
- indActiveClass: 'led',
- indDefaultClass: 'led-inactive'
- } ),
-
- plusBtn: SDL.Button.extend( {
- classNames: 'control plus',
- icon: 'images/common/plus-ico.png',
- actionDown: function() {
- this._super();
- if (this._parentView.sliderValue.value < this._parentView.sliderValue.range) {
- this.set( 'parentView.sliderValue.value', this._parentView.sliderValue.value + 1 );
- }
- }
- } )
- } ),
-
- loadData: function( message ) {
-
- var data = message.params;
-
- this.set( 'sliderRequestId', message.id );
-
- this.set( 'headerLabel.content', data.sliderHeader );
- this.get( 'adjustControl.sliderValue' ).set( 'range', data.numTicks );
- this.get( 'adjustControl.sliderValue' ).set( 'value', data.position );
-
- setTimeout( function() {
- SDL.SliderView.adjustControl.rerender();
- }, 1 );
-
- if (!data.sliderFooter) {
- this.set('footerLabel.content', '');
- return;
- }
-
- this.footerLabel.data = data.sliderFooter;
-
- if (data.sliderFooter.length != data.numTicks) {
- this.set( 'footerLabel.content', data.sliderFooter[0] );
- } else {
- // Magick number is array index correction
- this.set( 'footerLabel.content', data.sliderFooter[data.position - 1] );
- }
- },
-
- /**
- * Change footer text depends on current slider position works only for
- * dynamic footer mode
- */
- changeFooterText: function() {
- if( this.footerLabel.data && this.footerLabel.data.length > 1 ){
- this.set( 'footerLabel.content', this.footerLabel.data[this.adjustControl.sliderValue.value - 1] );
- }
- }.observes( 'adjustControl.sliderValue.value' )
-} );
diff --git a/src/components/HMI/app/view/sdl/shared/tbtTurnList.js b/src/components/HMI/app/view/sdl/shared/tbtTurnList.js
deleted file mode 100644
index 6c5a5588c5..0000000000
--- a/src/components/HMI/app/view/sdl/shared/tbtTurnList.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.TBTTurnList
- * @desc TBT Turn List visual representation
- * @category View
- * @filesource app/view/sdl/shared/tbtTurnList.js
- * @version 1.0
- */
-
-SDL.TBTTurnList = SDL.SDLAbstractView.create({
-
- elementId: 'tbtTurnListView',
-
- childViews: [
- 'backButton',
- 'captionText',
- 'tbtTurnListList'
- ],
-
- /**
- * Activate window
- */
- activate: function (appID) {
-
- this.set('active', true);
- this.updateList(appID);
- },
-
- /**
- * Deactivate window if TurnByTurnView window was closed
- */
- closeTurnList: function () {
-
- if (!SDL.TurnByTurnView.get('activeTBT')) {
- this.set('active', false);
- }
- }.observes('SDL.TurnByTurnView.activeTBT'),
-
- /**
- * Title Labes of window
- */
- captionText: SDL.Label.extend({
- classNames: 'caption-text',
-
- content: 'Turn List'
- }),
-
- /**
- * Turn List
- */
- tbtTurnListList: SDL.List.extend({
- elementId : 'tbtTurnListList',
- itemsOnPage: 5,
- items : []
- }),
-
- /**
- * Function updates content of Turn List with data from application's
- * model
- *
- * @type {Number}
- */
- updateList: function (appID) {
-
- this.get('tbtTurnListList.list').removeAllChildren();
-
- this.tbtTurnListList.list.refresh();
-
- var turnListArray = SDL.SDLController.getApplicationModel(appID).turnList,
- length = turnListArray.length;
- for (var i = 0; i < length; i++) {
- this.get('tbtTurnListList.list.childViews').pushObject(SDL.Label.create({
- icon : turnListArray[i].turnIcon ? turnListArray[i].turnIcon.value : "",
- content : turnListArray[i].navigationText ? turnListArray[i].navigationText.fieldText : "",
- classNames : 'list-item',
- templateName: turnListArray[i].turnIcon ? 'icon' : ''
- }));
- }
-
- turnListArray = SDL.SDLController.getApplicationModel(appID).turnListSoftButtons;
- length = turnListArray.length;
-
- for (var i = 0; i < length; i++) {
- this.get('tbtTurnListList.list.childViews').pushObject(SDL.Button.create(SDL.PresetEventsCustom, {
- systemAction : turnListArray[i].systemAction,
- groupName : "TBTList",
- classNameBindings: [
- 'isHighlighted:isHighlighted'
- ],
- isHighlighted : turnListArray[i].isHighlighted ? true : false,
- softButtonID : turnListArray[i].softButtonID,
- icon : turnListArray[i].image ? turnListArray[i].image.value : "",
- text : turnListArray[i].text,
- classNames : 'list-item softButton',
- elementId : 'softButton' + i,
- templateName : turnListArray[i].image ? 'rightIcon' : 'text',
- appID : appID
- }));
- }
- }
- });
diff --git a/src/components/HMI/app/view/sdl/shared/turnByTurnView.js b/src/components/HMI/app/view/sdl/shared/turnByTurnView.js
deleted file mode 100644
index 1cb7ddfad0..0000000000
--- a/src/components/HMI/app/view/sdl/shared/turnByTurnView.js
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.TurnByTurnView
- * @desc TurnByTurnView module visual representation
- * @category View
- * @filesource app/view/sdl/shared/turnByTurnView.js
- * @version 1.0
- */
-
-SDL.TurnByTurnView = SDL.SDLAbstractView.create( {
-
- elementId: 'TurnByTurnView',
-
- classNames: 'TurnByTurnView',
-
- classNameBindings: [
- 'activeTBT:active_state:inactive_state'
- ],
-
- active: false,
-
- activeTBT: false,
-
- childViews: [
- 'captionText',
- 'softButtons',
- 'totalDistanceLabel',
- 'etaLabel',
- 'turnList',
- 'homeScreen',
- 'navigationText2',
- 'turnIconImage',
- 'nextTurnIconImage',
- 'distanceToManeuver',
- 'distanceToManeuverScale',
- 'timeToDestination'
- ],
-
- appID: -1,
- navigationText2: null,
- eta: null,
- totalDistance: null,
- turnIcon: null,
- nextturnIcon: null,
- distanceToManeuver: null,
- distanceToManeuverScale: null,
- timeToDestination: null,
- maneuverComplete: null,
-
- activate: function(appID) {
-
- var naviParams = SDL.SDLController.getApplicationModel(appID).constantTBTParams;
-
- if (naviParams) {
-
- 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;
- }
- }
- }
-
- this.softButtons.addItems(naviParams.softButtons, appID);
-
- if (naviParams.maneuverComplete) {
- this.set('maneuverComplete', naviParams.maneuverComplete);
- }
-
- this.set('appID', naviParams.appID);
-
- if (naviParams.turnIcon) {
-
- this.set('turnIcon', naviParams.turnIcon.value);
- }
-
- if (naviParams.nextTurnIcon) {
-
- this.set('nextTurnIcon', naviParams.nextTurnIcon.value);
- }
- this.set('distanceToManeuver', naviParams.distanceToManeuver);
- this.set('distanceToManeuverScale', naviParams.distanceToManeuverScale);
- this.set('timeToDestination', naviParams.timeToDestination);
-
- this.set('activeTBT', true);
- }
- },
-
- /**
- * Deactivate View
- */
- deactivate: function() {
-
- this.set('activeTBT', false);
- },
-
- totalDistanceLabel: SDL.Label.extend( {
- classNames: 'totalDistanceLabel',
- contentBinding: 'parentView.totalDistance'
- }),
-
- distanceToManeuverScale: SDL.Label.extend( {
- classNames: 'distanceToManeuverScale',
- contentBinding: 'parentView.distanceToManeuverScale'
- }),
-
- distanceToManeuver: SDL.Label.extend( {
- classNames: 'distanceToManeuver',
- contentBinding: 'parentView.distanceToManeuver'
- }),
-
- timeToDestination: SDL.Label.extend( {
- classNames: 'timeToDestination',
- contentBinding: 'parentView.timeToDestination'
- }),
-
- etaLabel: SDL.Label.extend( {
- classNames: 'etaLabel',
- contentBinding: 'parentView.eta'
- }),
-
- turnList: SDL.Button.create( {
- elementID: 'turnList',
- classNames: 'turnList btn',
- text: 'Turn List',
- action: function() {
-
- SDL.SDLController.tbtTurnList(this._parentView.appID);
- },
- target: '',
- onDown: false,
- templateName: 'arrow'
- }),
-
- turnIconImage: Em.View.create( {
- classNames: 'turnIcon btn',
- attributeBindings: [
- 'style'
- ],
- style: function() {
-
- if (this._parentView.turnIcon) {
- return 'background-image: URL(' + this._parentView.turnIcon
- + ');';
- } else {
- return '';
- }
- }.property('this.parentView.turnIcon')
- }),
-
- nextTurnIconImage: Em.View.create( {
- classNames: 'nextTurnIcon btn',
- attributeBindings: [
- 'style'
- ],
- style: function() {
-
- if (this._parentView.nextTurnIcon) {
- return 'background-image: URL(' + this._parentView.nextTurnIcon
- + ');';
- } else {
- return '';
- }
- }.property('this.parentView.nextTurnIcon')
- }),
-
- navigationText2: SDL.Label.extend( {
- classNames: 'navigationText2',
- contentBinding: 'parentView.navigationText2'
- }),
-
- homeScreen: SDL.Button.create( {
- elementId: 'homeScreen',
- classNames: 'homeScreen btn',
- text: 'Home Screen',
- iconBinding: 'SDL.SDLAppController.model.appIcon',
- target: 'this.parentView',
- action: 'deactivate',
- onDown: false
- }),
-
- softButtons: SDL.MenuList.extend( {
-
- itemsOnPage: 3,
-
- groupName: "TurnByTurnView",
-
- content: Em.ContainerView.extend( {
-
- classNames: [
- 'content'
- ]
-
- })
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/sdl/tbtClientStateView.js b/src/components/HMI/app/view/sdl/tbtClientStateView.js
deleted file mode 100644
index 2d2571d372..0000000000
--- a/src/components/HMI/app/view/sdl/tbtClientStateView.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.TBTClientStateView
- * @desc TBTClientStateView module visual representation
- * @category View
- * @filesource app/view/sdl/TBTClientStateView.js
- * @version 1.0
- */
-
-SDL.TBTClientStateView = Em.ContainerView.create( {
-
- elementId: 'tbtClientStateView',
-
- classNames: 'tbtClientStateView',
-
- classNameBindings:
- [
- 'active'
- ],
-
- childViews:
- [
- 'tbtClientStateLabel',
- 'tbtClientState',
- 'tbtClientStateSelect'
- ],
-
- /**
- * Title of VehicleInfo PopUp view
- */
- tbtClientStateLabel: SDL.Label.extend( {
-
- elementId: 'tbtClientStateLabel',
-
- classNames: 'tbtClientStateLabel',
-
- content: 'TBT Client State'
- } ),
-
- /**
- * Property indicates the activity state of TBTClientStateView
- */
- active: false,
-
- /**
- * Title of tbtClientState group of parameters
- */
- tbtClientState: SDL.Label.extend( {
-
- elementId: 'tbtClientState',
-
- classNames: 'tbtClientState',
-
- content: 'Client State'
- } ),
-
- /**
- * HMI element Select with parameters of TBTClientStates
- */
- tbtClientStateSelect: Em.Select.extend( {
-
- elementId: 'tbtClientStateSelect',
-
- classNames: 'tbtClientStateSelect',
-
- contentBinding: 'SDL.SDLModel.tbtClientStates',
-
- optionValuePath: 'content.id',
-
- optionLabelPath: 'content.name',
-
- /**
- * Selected data sent on model for further processing
- */
- click: function() {
-
- SDL.SDLController.tbtClientStateSelected( this.selection.name );
-
- }
- } ),
-
- /**
- * Trigger function that activates and deactivates tbtClientStateView
- */
- toggleActivity: function() {
- this.toggleProperty( 'active' );
- }
-} ); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/appPermissionsListView.js b/src/components/HMI/app/view/settings/policies/appPermissionsListView.js
deleted file mode 100644
index 4fc83ad261..0000000000
--- a/src/components/HMI/app/view/settings/policies/appPermissionsListView.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DeviceConfigView
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/settings/policies/deviceConfigView.js
- * @version 1.0
- */
-
-SDL.AppPermissionsListView = Em.ContainerView.create( {
-
- elementId: 'policies_settings_appPermissionsList',
-
- classNames: 'in_settings_separate_view',
-
- classNameBindings: [
- 'SDL.States.settings.policies.appPermissionsList.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'backButton',
- 'appList',
- 'label'
- ],
-
- globalConfigurationValue: false,
-
- globalConfigurationMessage: function() {
- if (this.globalConfigurationValue === true) {
- return "All devices Allowed";
- } else if (this.globalConfigurationValue === false) {
- return "All devices Not Allowed";
- } else {
- return "All devices manual Configuration";
- }
- }.property('this.globalConfigurationValue'),
-
- /**
- * Label in title
- */
- label: SDL.Label.extend( {
-
- classNames: 'label',
-
- content: 'Choose devices to be allowed for SDL functionality:'
- }),
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'backButton'
- ],
- action: 'onState',
- target: 'SDL.SettingsController',
- goToState: 'policies',
- icon: 'images/media/ico_back.png',
- onDown: false
- } ),
-
- /**
- * Function to add application to application list
- */
- showAppList: function() {
-
- this.get('appList.list').removeAllChildren();
-
- this.appList.list.refresh();
-
- var i,
- appIndex,
- apps = SDL.SDLModel.registeredApps
- len = apps.length;
-
- for (i = 0; i < len; i++) {
-
- appIndex = SDL.SDLModel.registeredApps.indexOf(apps[i]);
-
- this.get('appList.list.childViews').pushObject(SDL.Button.create( {
- action: 'GetListOfPermissions',
- target: 'SDL.SettingsController',
- text: apps[i].appName,
- appID: apps[i].appID,
- classNames: 'list-item button',
- iconBinding: 'SDL.SDLModel.registeredApps.' + appIndex
- + '.appIcon'
- }));
- }
-
- this.appList.list.refresh();
-
- },
-
- appList: SDL.List.extend( {
-
- elementId: 'polocies_app_permissions_list',
-
- itemsOnPage: 5,
-
- /** Items */
- items: new Array()
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/appPermissionsView.js b/src/components/HMI/app/view/settings/policies/appPermissionsView.js
deleted file mode 100644
index 165ae90008..0000000000
--- a/src/components/HMI/app/view/settings/policies/appPermissionsView.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DeviceConfigView
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/settings/policies/deviceConfigView.js
- * @version 1.0
- */
-
-SDL.AppPermissionsView = Em.ContainerView.create( {
-
- elementId: 'policies_settings_appPermissions',
-
- classNames: 'in_settings_separate_view',
-
- classNameBindings: [
- 'SDL.States.settings.policies.appPermissions.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'backButton',
- 'appList',
- 'label'
- ],
-
- currentAppId: null,
-
- /**
- * Label in title
- */
- label: SDL.Label.extend( {
-
- classNames: 'label',
-
- content: 'Choose devices to be allowed for SDL functionality:'
- }),
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'backButton'
- ],
- action: function(element){
-
- SDL.SettingsController.onState(element);
-
- var permissions = [];
-
- for (var i = 0; i < SDL.AppPermissionsView.appList.list._childViews.length; i++) {
- permissions.push({
- "name": SDL.AppPermissionsView.appList.list._childViews[i].name,
- "id": SDL.AppPermissionsView.appList.list._childViews[i].id,
- "allowed": SDL.AppPermissionsView.appList.list._childViews[i].allowed
- });
- }
-
- FFW.BasicCommunication.OnAppPermissionConsent(permissions, "GUI", SDL.AppPermissionsView.currentAppId);
-
- SDL.AppPermissionsView.currentAppId = null;
- },
- goToState: 'policies',
- icon: 'images/media/ico_back.png',
- onDown: false
- } ),
-
- /**
- * Function to add application to application list
- */
- update: function(message, appID) {
-
- SDL.AppPermissionsView.currentAppId = appID;
-
- this.appList.items = [];
-
- for (var i = 0; i < message.length; i++) {
-
- var text = " - Undefined";
-
- if (message[i].allowed === true) {
- text = " - Allowed";
- } else if (message[i].allowed === false) {
- text = " - Not allowed";
- }
-
- this.appList.items.push({
- type: SDL.Button,
- params: {
- action: 'changeAppPermission',
- target: 'SDL.SettingsController',
- text: message[i].name + text,
- name: message[i].name,
- allowed: message[i].allowed,
- id: message[i].id,
- appID: appID
- }
- });
- }
-
- this.appList.list.refresh();
-
- },
-
- appList: SDL.List.extend( {
-
- elementId: 'polocies_app_permissions_list',
-
- itemsOnPage: 5,
-
- /** Items */
- items: new Array()
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/deviceConfigView.js b/src/components/HMI/app/view/settings/policies/deviceConfigView.js
deleted file mode 100644
index 37cb33d338..0000000000
--- a/src/components/HMI/app/view/settings/policies/deviceConfigView.js
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DeviceConfigView
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/settings/policies/deviceConfigView.js
- * @version 1.0
- */
-
-SDL.DeviceConfigView = Em.ContainerView.create( {
-
- elementId: 'policies_settings_deviceConfig',
-
- classNames: 'in_settings_separate_view',
-
- classNameBindings: [
- 'SDL.States.settings.policies.deviceConfig.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'backButton',
- 'listOfDevices',
- 'label'
- ],
-
- globalConfigurationValue: false,
-
- globalConfigurationMessage: function() {
- if (this.globalConfigurationValue === true) {
- return "All devices Allowed";
- } else if (this.globalConfigurationValue === false) {
- return "All devices Not Allowed";
- } else {
- return "All devices manual Configuration";
- }
- }.property('this.globalConfigurationValue'),
-
- /**
- * Label in title
- */
- label: SDL.Label.extend( {
-
- elementId: 'label',
-
- classNames: 'label',
-
- content: 'Choose devices to be allowed for SDL functionality:'
- }),
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'backButton'
- ],
- action: 'onState',
- target: 'SDL.SettingsController',
- goToState: 'policies',
- icon: 'images/media/ico_back.png',
- onDown: false
- } ),
-
- /**
- * Function to add application to application list
- */
- showDeviceList: function() {
-
- this.listOfDevices.items = [];
-
- this.listOfDevices.items.push({
- type: SDL.Button,
- params: {
- action: 'allDeviceAccess',
- target: 'SDL.SettingsController',
- textBinding: 'SDL.DeviceConfigView.globalConfigurationMessage',
- classNameBinding: 'SDL.DeviceConfigView.globalConfigurationValue:disabled'
- }
- });
-
- var dev = SDL.SDLModel.connectedDevices;
-
- for (var key in dev) {
-
- if (dev.hasOwnProperty(key)) {
-
- this.listOfDevices.items.push({
- type: SDL.Button,
- params: {
- action: 'changeDeviceAccess',
- target: 'SDL.SettingsController',
- text: dev[key].allowed ? dev[key].name + " - Allowed" : dev[key].name + " - Not allowed",
- name: dev[key].name,
- id: dev[key].id
- }
- });
- }
- }
-
- this.listOfDevices.list.refresh();
-
- },
-
- listOfDevices: SDL.List.extend( {
-
- elementId: 'polocies_device_list',
-
- itemsOnPage: 5,
-
- /** Items */
- items: new Array()
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js b/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js
deleted file mode 100644
index 44e61066bf..0000000000
--- a/src/components/HMI/app/view/settings/policies/deviceStateChangeView.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DeviceConfigView
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/settings/policies/deviceConfigView.js
- * @version 1.0
- */
-
-SDL.DeviceStateChangeView = Em.ContainerView.create( {
-
- elementId: 'policies_settings_deviceStateChange',
-
- classNames: 'in_settings_separate_view',
-
- classNameBindings: [
- 'SDL.States.settings.policies.deviceStateChange.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'backButton',
- 'listOfDevices',
- 'label'
- ],
-
- /**
- * Label in title
- */
- label: SDL.Label.extend( {
-
- elementId: 'label',
-
- classNames: 'label',
-
- content: 'Choose devices to be Unpaired:'
- }),
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'backButton'
- ],
- action: 'onState',
- target: 'SDL.SettingsController',
- goToState: 'policies',
- icon: 'images/media/ico_back.png',
- onDown: false
- } ),
-
- /**
- * Function to add application to application list
- */
- showDeviceList: function() {
-
- this.listOfDevices.items = [];
-
- var dev = SDL.SDLModel.connectedDevices;
-
- for (var key in dev) {
-
- if (dev.hasOwnProperty(key)) {
-
- this.listOfDevices.items.push({
- type: SDL.Button,
- params: {
- action: 'OnDeviceStateChanged',
- target: 'FFW.BasicCommunication',
- text: dev[key].name,
- deviceName: dev[key].name,
- deviceID: dev[key].id
- }
- });
- }
- }
-
- this.listOfDevices.list.refresh();
-
- },
-
- listOfDevices: SDL.List.extend( {
-
- elementId: 'polocies_device_list',
-
- itemsOnPage: 5,
-
- /** Items */
- items: new Array()
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/statisticsInfoView.js b/src/components/HMI/app/view/settings/policies/statisticsInfoView.js
deleted file mode 100644
index 52ae2847b9..0000000000
--- a/src/components/HMI/app/view/settings/policies/statisticsInfoView.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DeviceConfigView
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/settings/policies/deviceConfigView.js
- * @version 1.0
- */
-
-SDL.StatisticsInfoView = Em.ContainerView.create( {
-
- elementId: 'policies_settings_status_info',
-
- classNames: 'in_settings_separate_view',
-
- classNameBindings: [
- 'SDL.States.settings.policies.statisticsInfo.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'backButton',
- 'label',
- 'listSelect'
- ],
-
- /**
- * HMI element Select with parameters of transmission state from VehicleInfo
- * Model
- */
- listSelect: Em.Select.extend( {
-
- elementId: 'listSelect',
-
- classNames: 'listSelect',
-
- contentBinding: 'SDL.SDLModel.settingsInfoList',
-
- valueBinding: 'SDL.SDLModel.settingsInfoListState'
- } ),
-
- /**
- * Label in title
- */
- label: SDL.Label.extend( {
-
- elementId: 'label',
-
- classNames: 'label',
-
- content: 'Choose devices to be allowed for SDL functionality:'
- }),
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'backButton'
- ],
- action: 'onState',
- target: 'SDL.SettingsController',
- goToState: 'policies',
- icon: 'images/media/ico_back.png',
- onDown: false
- } )
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policies/systemErrorView.js b/src/components/HMI/app/view/settings/policies/systemErrorView.js
deleted file mode 100644
index 2ccae596cf..0000000000
--- a/src/components/HMI/app/view/settings/policies/systemErrorView.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.DeviceConfigView
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/settings/policies/deviceConfigView.js
- * @version 1.0
- */
-
-SDL.SystemErrorView = Em.ContainerView.create( {
-
- elementId: 'policies_settings_system_error',
-
- classNames: 'in_settings_separate_view',
-
- classNameBindings: [
- 'SDL.States.settings.policies.systemError.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'backButton',
- 'label',
- 'listSelect'
- ],
-
- /**
- * HMI element Select with parameters of transmission state from VehicleInfo
- * Model
- */
- listSelect: Em.Select.extend( {
-
- elementId: 'systemErrorListSelect',
-
- classNames: 'listSelect',
-
- contentBinding: 'SDL.SDLModel.systemErrorList',
-
- valueBinding: 'SDL.SDLModel.systemErrorListState'
- } ),
-
- /**
- * Label in title
- */
- label: SDL.Label.extend( {
-
- elementId: 'label',
-
- classNames: 'label',
-
- content: 'Send OnSystemError notification:'
- }),
-
- backButton: SDL.Button.extend( {
- classNames:
- [
- 'backButton'
- ],
- action: 'onState',
- target: 'SDL.SettingsController',
- goToState: 'policies',
- icon: 'images/media/ico_back.png',
- onDown: false
- } )
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settings/policiesView.js b/src/components/HMI/app/view/settings/policiesView.js
deleted file mode 100644
index cb1b59be30..0000000000
--- a/src/components/HMI/app/view/settings/policiesView.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PoliciesSettingsView
- * @desc Info Apps visual representation
- * @category View
- * @filesource app/view/settings/AppsView.js
- * @version 1.0
- */
-
-SDL.PoliciesView = Em.ContainerView.create( {
-
- elementId: 'policies_settings',
-
- classNames: 'in_settings_view',
-
- classNameBindings: [
- 'SDL.States.settings.policies.active:active_state:inactive_state'
- ],
-
- childViews: [
- 'SettingsList'
- ],
-
- SettingsList: SDL.List.extend( {
-
- elementId: 'policies_settings_list',
-
- classNames: 'policies_settings_list',
-
- itemsOnPage: 5,
-
- /** Items */
- items: [
- {
- type: SDL.Button,
- params: {
- goToState: 'policies.deviceConfig',
- text: 'Allow SDL Functionality',
- action: 'onState',
- target: 'SDL.SettingsController',
- templateName: 'arrow',
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'Update SDL',
- action: 'updateSDL',
- target: 'SDL.SettingsController',
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'Policy table update status',
- action: 'getStatusUpdate',
- target: 'SDL.SettingsController',
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'Send request GetURLS',
- action: 'getURLS',
- target: 'SDL.SettingsController',
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'Statistics Info settings',
- action: 'onState',
- target: 'SDL.SettingsController',
- templateName: 'arrow',
- goToState: 'policies.statisticsInfo',
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'App permissions',
- action: 'onState',
- target: 'SDL.SettingsController',
- templateName: 'arrow',
- goToState: 'policies.appPermissionsList',
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'Get list of permissions',
- click: function () {
- FFW.BasicCommunication.GetListOfPermissions();
- },
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'Device state change',
- action: 'onState',
- target: 'SDL.SettingsController',
- templateName: 'arrow',
- goToState: 'policies.deviceStateChange',
- onDown: false
- }
- },
- {
- type: SDL.Button,
- params: {
- text: 'System Error',
- action: 'onState',
- target: 'SDL.SettingsController',
- templateName: 'arrow',
- goToState: 'policies.systemError',
- onDown: false
- }
- }
- ]
- })
-}); \ No newline at end of file
diff --git a/src/components/HMI/app/view/settingsView.js b/src/components/HMI/app/view/settingsView.js
deleted file mode 100644
index 956f75aaa2..0000000000
--- a/src/components/HMI/app/view/settingsView.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * · Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * · Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * · Neither the name of the Ford Motor Company nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.PlayerControllsView
- * @desc Video player visual representation
- * @category View
- * @filesource app/view/player/PlayerView.js
- * @version 1.0
- */
-SDL.SettingsView = Em.ContainerView.create( {
- /** View Id */
- elementId: 'settingsView',
-
- classNameBindings: [
- 'SDL.States.settings.active:active_state:inactive_state'
- ],
-
- /** Settings components */
- childViews:
- [
- 'leftMenu',
- SDL.DeviceStateChangeView,
- SDL.PoliciesView,
- SDL.AppPermissionsListView,
- SDL.AppPermissionsView,
- SDL.DeviceConfigView,
- SDL.StatisticsInfoView,
- SDL.SystemErrorView
- ],
-
- /** Left menu */
- leftMenu: Em.ContainerView.extend( {
- elementId: 'settings_leftMenu',
-
- classNameBindings:
- [
- 'parentView.controller.hiddenLeftMenu:hidden'
- ],
-
- classNames: 'menu-items',
-
- childViews:
- [
- 'border',
- 'items'
- ],
-
- border: Em.View.extend( {
- classNames: 'ls_border'
- } ),
-
- items: Em.ContainerView.extend( {
- classNames: 'ls-items',
-
- childViews:
- [
- 'policies'
- ],
-
- policies: SDL.Button.extend( {
- elementId: 'policies_leftMenu',
- goToState: 'policies',
- classNames: 'menu-item lsp1_p',
- classNameBindings:
- [
- 'SDL.States.settings.policies.active:info_active'
- ],
- text: 'Policies',
- icon: 'images/settings/ico_settings.png',
- action: 'onState',
- target: 'SDL.SettingsController'
- } )
- } )
- } )
-
-});
diff --git a/src/components/HMI/audio/alert.wav b/src/components/HMI/audio/alert.wav
deleted file mode 100644
index bde18695e2..0000000000
--- a/src/components/HMI/audio/alert.wav
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/audio/initial.wav b/src/components/HMI/audio/initial.wav
deleted file mode 100644
index 61a549fbc6..0000000000
--- a/src/components/HMI/audio/initial.wav
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/audio/listen.wav b/src/components/HMI/audio/listen.wav
deleted file mode 100644
index 0f087c8d2e..0000000000
--- a/src/components/HMI/audio/listen.wav
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/audio/positive.wav b/src/components/HMI/audio/positive.wav
deleted file mode 100644
index 464af1f88c..0000000000
--- a/src/components/HMI/audio/positive.wav
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/audio/say.wav b/src/components/HMI/audio/say.wav
deleted file mode 100644
index 0975fe9766..0000000000
--- a/src/components/HMI/audio/say.wav
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/css/buttonControls.css b/src/components/HMI/css/buttonControls.css
deleted file mode 100644
index 39ef852853..0000000000
--- a/src/components/HMI/css/buttonControls.css
+++ /dev/null
@@ -1,546 +0,0 @@
-/**
- * buttonControls module CSS
- *
- * @category Style Sheets
- * @filesource css/buttonControls.css
- * @version 2.0
- */
-#buttonControls.buttonControls {
- width: 270px;
- height: 200px;
- top: 0px;
- left: 790px;
-}
-
-#driverDistractionControl.driverDistractionControl {
- width: 302px;
- height: 20px;
- top: 423px;
- left: 810px;
-}
-
-#driverDistractionControl .driverDistractionControlLabel {
- left: 20px;
-}
-
-#keyboard_view .back-button{
- top: 58px;
-}
-
-#keyboard_view .controlls{
- top: 350px;
- width: 800px;
- height: 75px;
-}
-
-#keyboard_view .controll{
- margin: 10px;
- height: 60px;
- border: 1px solid #333;
- text-align: center;
- line-height: 60px;
- border-radius: 3px;
-}
-
-#keyboard_view .controlls .leftBtn{
- width: 130px;
- left: 0px;
-}
-
-#keyboard_view .controlls .numericBtn{
- width: 60px;
- left: 145px;
-}
-
-#keyboard_view .controlls .symbolBtn{
- width: 60px;
- left: 220px;
-}
-
-#keyboard_view .controlls .spaceBtn{
- width: 215px;
- left: 295px;
-}
-
-#keyboard_view .controlls .caseSwitchBtn{
- width: 60px;
- left: 525px;
-}
-
-#keyboard_view .controlls .localisationBtn{
- width: 60px;
- left: 600px;
-}
-
-#keyboard_view .controlls .searchBtn{
- width: 100px;
- left: 677px;
-}
-
-#keyboard_view .keyboardLayout{
- width: 750px;
- height: 185px;
- top: 170px;
- left: 25px;
-}
-
-#keyboard_view .keyboardLayout.wide{
- left: 5px !important;
-}
-
-#keyboard_view .searchBar{
- top: 58px;
- width: 666px;
- height: 49px;
- left: 120px;
-}
-
-#keyboard_view input{
- width: 597px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
- background: rgba(119, 119, 119, 0.42);
- cursor: pointer;
- font-size: 32px;
- color: #FFF;
- padding-left: 10px;
- padding-right: 10px;
-}
-
-#keyboard_view .microphone{
- text-align: center;
- line-height: 49px;
-}
-
-#keyboard_view .clearBtn{
- right: 0px;
- top: 0px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
- font-size: 32px;
- text-align: center;
- line-height: 50px;
-}
-
-#keyboard_view .microphone{
- left: 63px;
- top: 58px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
-}
-
-#keyboard_view .keyboardLayout .ffw-button{
- width: 60px;
- height: 50px;
- border-radius: 3px;
- border: 1px solid #333;
- margin: 5px;
- font-size: 42px;
- text-align: center;
- line-height: 50px;
-}
-#keyboard_view .keyboardLayout .k1{
- left: 75px;
-}
-#keyboard_view .keyboardLayout .k2{
- left: 150px;
-}
-#keyboard_view .keyboardLayout .k3{
- left: 225px;
-}
-#keyboard_view .keyboardLayout .k4{
- left: 300px;
-}
-#keyboard_view .keyboardLayout .k5{
- left: 375px;
-}
-#keyboard_view .keyboardLayout .k6{
- left: 450px;
-}
-#keyboard_view .keyboardLayout .k7{
- left: 525px;
-}
-#keyboard_view .keyboardLayout .k8{
- left: 600px;
-}
-#keyboard_view .keyboardLayout .k9{
- left: 675px;
-}
-#keyboard_view .keyboardLayout .k10{
- left: 38px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k11{
- left: 113px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k12{
- left: 188px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k13{
- left: 263px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k14{
- left: 338px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k15{
- left: 413px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k16{
- left: 488px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k17{
- left: 563px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k18{
- left: 638px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k19{
- left: 713px;
- top: 62px;
-}
-#keyboard_view .keyboardLayout .k20{
- left: 0px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k21{
- left: 75px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k22{
- left: 150px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k23{
- left: 225px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k24{
- left: 300px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k25{
- left: 375px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k26{
- left: 450px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k27{
- left: 525px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k28{
- left: 600px;
- top: 124px;
-}
-#keyboard_view .keyboardLayout .k29{
- left: 675px;
- top: 124px;
-}
-#infoTable.infoTable {
- width: 400px;
- height: 96px;
- top: 308px;
- left: 801px;
- background-color: #383737;
- color: white;
- border: 1px solid gray;
- overflow: hidden;
-}
-
-#infoTable .sdlGPLabel {
- width: 190px;
- border-right: 1px solid #14100F;
- height: 96px;
- position: relative;
- float: left;
-}
-
-#infoTable .sdlGPData {
- position: relative;
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
- width: 203px;
- height: 18px;
-}
-
-#buttonControls .ContainerControlls {
- left: 34px;
- background:
- url(../images/home/controlButtons/backGroundControllButtons.png)
- no-repeat;
- width: 200px;
- height: 200px;
-}
-
-#buttonControls .UpBtn {
- background: url(../images/home/controlButtons/UpButton.png) no-repeat;
- background-position: -32px 0;
- width: 137px;
- height: 64px;
- left: 32px;
- -webkit-transition: 0.2s;
-}
-
-#TUNEUP.pressed {
- background: url(../images/home/controlButtons/UpButton_pressed.png)
- !important;
- background-position: -32px 0 !important;
- width: 137px !important;
- height: 69px !important;
- left: 32px !important;
-}
-
-#buttonControls .DownBtn {
- background: url(../images/home/controlButtons/DownButton.png) no-repeat;
- background-position: -32px -132px;
- width: 137px;
- height: 65px;
- top: 132px;
- left: 32px;
- -webkit-transition: 0.2s;
-}
-
-#TUNEDOWN.pressed {
- background: url(../images/home/controlButtons/DownButton_pressed.png)
- no-repeat;
- background-position: -32px -132px !important;
- width: 137px !important;
- height: 65px !important;
- top: 132px !important;
- left: 32px !important;
-}
-
-#buttonControls .LeftBtn {
- background: url(../images/home/controlButtons/LeftButton.png) no-repeat;
- width: 63px;
- height: 138px;
- background-position: -3px -31px;
- left: 3px;
- top: 31px;
- -webkit-transition: 0.2s;
-}
-
-#SEEKLEFT.pressed {
- background: url(../images/home/controlButtons/LeftButton_pressed.png)
- no-repeat;
- width: 63px !important;
- height: 138px !important;
- background-position: -3px -31px !important;
- left: 3px !important;
- top: 31px !important;
-}
-
-#buttonControls .RightBtn {
- background: url(../images/home/controlButtons/RightButton.png) no-repeat;
- background-position: -131px -31px;
- width: 68px;
- height: 139px;
- left: 131px;
- top: 31px;
- -webkit-transition: 0.2s;
-}
-
-#SEEKRIGHT.pressed {
- background: url(../images/home/controlButtons/RightButton_pressed.png)
- no-repeat;
- background-position: -131px -31px !important;
- width: 68px !important;
- height: 139px !important;
- left: 131px !important;
- top: 31px !important;
-}
-
-#buttonControls .OkBtn {
- background: url(../images/home/controlButtons/OkButton.png) no-repeat;
- background-position: -55px -55px;
- width: 89px;
- height: 90px;
- left: 55px;
- top: 55px;
- -webkit-transition: 0.2s;
-}
-
-#OK.pressed {
- background: url(../images/home/controlButtons/OkButton_pressed.png)
- no-repeat;
- background-position: -55px -55px !important;
- width: 89px !important;
- height: 90px !important;
- left: 55px !important;
- top: 55px !important;
-}
-
-#app_controlButtons{
- z-index: 2;
-}
-#app_controlButtons .systemRequest {
- top: 252px !important;
- left: 1059px !important;
- width: 135px !important;
- font-size: 16px !important;
- text-align: center;
- line-height: 48px;
-}
-
-#app_controlButtons .btnNotPressed {
- width: 40px;
- height: 40px;
- left: 0px;
- top: 200px;
- -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;
- -webkit-transition: 0.2s;
- font-size: 38px;
- line-height: 42px;
- text-align: center;
- position: relative;
- float: left;
- margin-left: 10px;
- margin-top: 10px;
-}
-
-}
-#app_controlButtons .languageSelect {
- position: absolute;
- width: 150px;
- height: 30px;
- color: white;
- background: #393939;
-}
-
-#app_controlButtons .languageSelect option {
- background: #393939;
-}
-
-#UILanguages.languageSelect {
- top: 110px;
- left: 1028px;
-}
-
-#TTSVRLanguages.languageSelect {
- top: 170px;
- left: 1028px;
-}
-
-#app_controlButtons .UILanguagesLabel {
- top: 91px;
- left: 1028px;
- width: 150px;
-}
-
-#app_controlButtons .TTSVRLanguagesLabel {
- top: 151px;
- left: 1028px;
- width: 160px;
-}
-
-#app_controlButtons .appUILanguagesLabel {
- top: 91px;
- left: 1195px;
- width: 250px;
-}
-
-#app_controlButtons .appTTSVRLanguagesLabel {
- top: 151px;
- left: 1195px;
- width: 250px;
-}
-
-#app_controlButtons .appUILang {
- top: 117px;
- left: 1195px;
- width: 150px;
-}
-
-#app_controlButtons .appTTSVRLang {
- top: 176px;
- left: 1195px;
- width: 150px;
-}
-
-#app_controlButtons .sendDataCheckBox {
- left: 1158px;
- position: absolute;
- top: 275px;
-}
-
-#app_controlButtons .sendDataLabel {
- top: 275px;
- left: 1180px;
- width: 160px;
-}
-
-#buttonControls .btnNotPressed.pressed {
- box-shadow: inset 5px 5px 10px black, inset -3px -3px 10px #383737;
- line-height: 45px;
-}
-
-#app_controlButtons .languageSelect {
- position: absolute;
- width: 150px;
- height: 30px;
- color: white;
- background: #393939;
-}
-
-#app_controlButtons .languageSelect option {
- background: #393939;
-}
-
-#UILanguages.languageSelect {
- top: 110px;
- left: 1028px;
-}
-
-#TTSVRLanguages.languageSelect {
- top: 170px;
- left: 1028px;
-}
-
-#app_controlButtons .UILanguagesLabel {
- top: 91px;
- left: 1028px;
- width: 150px;
-}
-
-#app_controlButtons .TTSVRLanguagesLabel {
- top: 151px;
- left: 1028px;
- width: 160px;
-}
-
-#app_controlButtons .phone_call_button{
- height: 40px;
- width: 163px;
- font-size: 20px;
- line-height: 41px;
- border: 1px solid #FFFF30;
- top: 2px;
- color: #FFFF30;
- padding-left: 10px;
- left: 244px;
- transition: left 2s;
-}
-
-#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
deleted file mode 100644
index 1eab49e6e1..0000000000
--- a/src/components/HMI/css/general.css
+++ /dev/null
@@ -1,1560 +0,0 @@
-/*GENERAL CSS*/
-* {
- /*Reset default browser styles*/
- margin: 0;
- padding: 0;
- border: none;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -webkit-user-select: none;
-}
-
-html, body {
- /*GLOBAL HTML and BODE Dimansions*/
- width: 100%;
- min-height: 100%;
-}
-
-body {
- /*FONT FAMILY*/
- font-family: sans-serif;
- /*Defaul font size*/
- font-size: 16px;
- background-color: #000;
- color: #fff;
- overflow: hidden;
-}
-
-/*Default style for all images*/
-img {
- border-width: 0px;
- border-style: none;
- margin: 0px;
- padding: 0px;
- z-index: 1000;
- pointer-events: none;
-}
-
-/*Default style for all DIVs*/
-div {
- position: absolute;
- margin: 0;
- padding: 0;
-}
-
-.ffw-button {
- cursor: pointer;
- background: url(../images/common/button.png) repeat-x;
-}
-
-.ffw-button.pressed {
- background-position: bottom;
-}
-
-.windowText {
- top: 190px;
- width: 800px;
- font-size: 80px;
- color: white;
- text-align: center;
-}
-
-/* Home view */
-#home {
- background: url(../images/home/home_main_image.png) no-repeat;
- width: 800px;
- height: 369px;
- top: 56px;
-}
-
-/* Climate Status */
-#status_climate {
- bottom: 0px;
- right: 0px;
- text-align: right;
- font-size: 21px;
- width: 324px;
- height: 48px;
- cursor: pointer;
- background: url(../images/common/climate-status-bg.png) no-repeat;
- z-index: 1;
-}
-
-#status_climate_label {
- display: block;
- width: 100%;
- visibility: hidden;
-}
-
-#status_climate_label span {
- padding-right: 11px;
-}
-
-/* Navigation Status */
-#status_nav {
- top: 0px;
- right: 0px;
- text-align: right;
- font-size: 21px;
- width: 324px;
- height: 48px;
- cursor: pointer;
- background: url(../images/common/nav-status-bg.png) no-repeat;
- z-index: 1;
-}
-
-#navigation_status_label {
- width: 100%;
- display: block;
- visibility: hidden;
-}
-
-#navigation_status_label span {
- padding-right: 11px;
-}
-
-/*FORD CONTAINER DEFAULT DIMANSIONS */
-#app {
- /*position:relative;*/
- width: 800px;
- height: 480px;
- /*overflow: hidden;
- Mac font smoothing */
- -webkit-font-smoothing: antialiased;
- /*margin: 25px auto;*/
-}
-
-/* TTS popUp*/
-#TTSPopUp.TTSPopUp {
- opacity: 0;
- left: 500px;
- width: 295px;
- height: 100px;
- z-index: 1;
- border-radius: 10 PX;
- top: 8px;
- -webkit-transition: opacity 1s ease-in-out;
- display: none;
-}
-
-#TTSPopUp .popUp {
- width: 294px;
- height: 98px;
- border: 1px solid black;
- border-radius: 10px;
- background-color: black;
- border: #A6A6A6 solid 2px;
- color: white;
-}
-
-#TTSPopUp .message {
- top: 10px;
- right: 10px;
- width: 278px;
- height: 81px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#TTSPopUp .timerText {
- color: #FFD93F;
- margin-top: 3px;
- right: 5px;
- 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;
- height: 19px;
- padding: 10px;
- border-radius: 4px;
- border: 1px solid white;
-}
-
-#TTSPopUp.active {
- opacity: 1;
- display: block;
- z-index: 10000;
-}
-
-/* Diver Distraction PopUp */
-#driverDistraction.driverDistractionWindow {
- left: 0;
- top: 0;
- width: 800px;
- height: 480px;
- background: rgba(0, 0, 0, 0.7);
- z-index: 30000;
- opacity: 0;
- display: none;
-}
-
-#driverDistraction .driverDistraction {
- left: 200px;
- width: 400px;
- height: 200px;
- z-index: 2;
- top: 140px;
- -webkit-transition: opacity 1s ease-in-out;
- background-color: black;
- border: #A6A6A6 solid 2px;
- border-radius: 6px;
-}
-
-#driverDistraction.active {
- opacity: 1;
- display: block;
-}
-
-#driverDistraction .driverDistractionText {
- top: 224px;
- left: 210px;
- width: 374px;
- height: 20px;
- text-align: center;
- font-size: 28px;
- z-index: 2;
-}
-
-/* UI popUp*/
-/* VR popUp*/
-#VRPopUp.VRPopUp {
- opacity: 0;
- left: 50px;
- width: 700px;
- height: 340px;
- background-color: black;
- z-index: 2;
- border-radius: 10 PX;
- top: 70px;
- -webkit-transition: opacity 1s ease-in-out;
- display: none;
-}
-
-#VRPopUp span {
- margin-left: 15px;
-}
-
-#VRPopUp .popUp {
- width: 698px;
- height: 338px;
- border: 1px solid white;
- border-radius: 10px;
-}
-
-#VRPopUp .message1 {
- top: 10px;
- left: 10px;
- width: 278px;
- height: 81px;
-}
-
-#VRPopUp .message2 {
- top: 40px;
- left: 10px;
- width: 278px;
- height: 81px;
-}
-
-#VRPopUp.active {
- opacity: 1;
- display: block;
- transition: all 1s;
-}
-
-#VRPopUp .list {
- position: absolute;
- width: 629px;
- height: 251px;
- border-radius: 2px;
- left: 35px;
- top: 70px;
-}
-
-#VRPopUp .list-content {
- border: none;
-}
-
-#VRPopUp .list-item {
- position: relative;
- width: 100%;
- height: 48px;
- font-size: 20px;
- line-height: 50px;
- border: 1px solid #393939;
-}
-
-#VRPopUp .list-content {
- width: 578px;
-}
-
-#VRPopUp .VRLabel {
- top: 10px;
- width: 550px;
- left: 35px;
- height: 20px;
- padding: 15px;
- background: #393939;
-}
-
-#VRPopUp .VRImage {
- right: 25px;
- width: 50px;
- height: 50px;
- top: 10px;
- background: url(../images/home/controlButtons/vrImage.png) no-repeat;
- background-size: contain;
-}
-
-/*WRAPER FOR CONTENT VIEW*/
-#app_active_view {
- position: absolute;
- width: 800px;
- height: 480px;
-}
-
-#html5Player {
- position: absolute;
- z-index: 1;
- width: 800px;
- height: 480px;
-}
-
-#html5Player.visible {
- -webkit-transform: translateX(0px) !important;
-}
-
-#mode {
- position: relative;
- margin: 150px auto;
- width: 150px;
-}
-
-/* Image preloader block*/
-#preloader {
- position: absolute;
- left: -9999px;
- top: -9999px;
-}
-
-/*CLOCK*/
-#clock {
- font-size: 28px;
- text-align: center;
- width: 225px;
- height: 50px;
- position: relative;
- float: left;
- pointer-events: all;
- cursor: pointer;
-}
-
-#clock.mcs {
- width: 225px;
-}
-
-#time_num {
- width: 100%;
- padding: 10px;
- margin-left: 5px;
-}
-
-#app_top_menu_cont {
- z-index: 10000;
- top: 0px;
- left: 275px;
- position: relative;
- pointer-events: none;
-}
-
-#top_controls {
- width: 322px;
- height: 58px;
- background: url("../images/common/header_bg.png") no-repeat;
- z-index: 2;
-}
-
-.not-visible {
- visibility: hidden !important;
-}
-
-/* Universal class to show hidden elements */
-.visible {
- visibility: visible !important;
-}
-
-/* Universal class to show transparent elements */
-.show {
- opacity: 1 !important;
-}
-
-.arrow-ico {
- position: absolute;
- right: 10px;
-}
-
-.right_text {
- float: right;
- margin-right: 5px;
-}
-
-.hidden_display {
- display: none !important;
-}
-
-.visible_display {
- display: block !important;
-}
-
-/*STATUS BAR*/
-.status_bar {
- z-index: 2001;
- line-height: 50px;
-}
-
-.selected {
- display: none;
-}
-
-/*BOTTOM Control BUTTONS*/
-#app_bottom_controlls {
- z-index: 11000;
- bottom: 0px;
- left: 275px;
- width: 252px;
- height: 59px;
- /*background: url(../images/common/bottom_cont_bg.png) no-repeat;*/
- overflow: hidden;
- pointer-events: none;
-}
-
-#home_active {
- z-index: 2002;
- bottom: 0px;
- left: 275px;
- width: 250px;
- height: 58px;
- background: url("../../images/common/home_active.png") no-repeat;
-}
-
-#home_but {
- height: 59px;
- width: 73px;
- cursor: pointer;
- z-index: 1000;
- background: url(../images/home/bottom_controlls_full.png) no-repeat;
- background-position: -90px -59px;
- position: relative;
- float: left;
- pointer-events: none;
-}
-
-#home_but.large {
- width: 126px;
- background-position: 0px -177px;
-}
-
-#home_but.large.selected {
- width: 126px;
- background-position: 0px -118px;
-}
-
-#home_but.selected {
- background-position: -90px 0px;
- display: block;
-}
-
-#home_but_click {
- height: 59px;
- width: 73px;
- cursor: pointer;
- z-index: 1001;
- position: absolute;
- pointer-events: all;
-}
-
-#home_but_click.large {
- width: 125px;
- height: 115px;
- -webkit-transform: skew(0deg, -42deg);
-}
-
-/*INFO BUTTON*/
-#info_but_click {
- height: 117px;
- width: 88px;
- cursor: pointer;
- z-index: 1001;
- position: absolute;
- pointer-events: all;
- -webkit-transform: skew(0deg, -52deg);
-}
-
-#info_but {
- height: 59px;
- width: 90px;
- cursor: pointer;
- background: url(../images/home/bottom_controlls_full.png) no-repeat;
- background-position: 0px -59px;
- position: relative;
- float: left;
- z-index: 1001;
- pointer-events: none;
- -webkit-border-top-left-radius: 10px;
-}
-
-#info_but.selected {
- background-position: 0px 0px;
- display: block;
-}
-
-/*SETTINGS BUTTON*/
-#setting_but {
- width: 89px;
- height: 59px;
- cursor: pointer;
- background: url(../images/home/bottom_controlls_full.png) no-repeat;
- background-position: -162px -59px;
- position: relative;
- float: left;
- pointer-events: none;
-}
-
-#setting_but.large {
- width: 126px;
- background-position: -126px -177px;
-}
-
-#setting_but.large.selected {
- width: 126px;
- background-position: -126px -118px;
-}
-
-#setting_but.selected {
- background-position: -162px 0px;
- display: block;
-}
-
-#setting_but_click {
- width: 83px;
- height: 110px;
- cursor: pointer;
- position: absolute;
- -webkit-transform: skew(0deg, 52deg);
- left: 1px;
- top: 4px;
- z-index: 1000;
- pointer-events: all;
-}
-
-#setting_but_click.large {
- width: 158px;
- height: 155px;
-}
-
-/*HIDDEN FOR CONTENT BLOCKS*/
-.hidden {
- -webkit-transform: translateX(-2000px);
- -moz-transform: translateX(-2000px);
-}
-
-/*ACTIVE VISIBLE FOR CONTENT BLOCK*/
-.inactive_state {
- -webkit-transform: translateX(-2000px);
- -moz-transform: translateX(-2000px);
- overflow: hidden;
-}
-
-.active_state {
- -webkit-transform: translateX(0px) !important;
- -moz-transform: translateX(0px) !important;
-}
-
-.passive_button_color {
- color: #999 !important;
-}
-
-/*MEDIA BLOCK CONTAINER*/
-#media {
- width: 800px;
- height: 480px;
- background: url(../images/media/bg.png) no-repeat;
-}
-
-/****************************** FOR MEDIA VIEW************************************************/
-/*#media, #browseUsbHD {
-background: url(../images/media/bg.png) no-repeat;
-}
-
-#media_view {
-width: 800px;
-height: 480px;
-}
-
-#media_view #cntrlMenu {
-position: relative;
-margin-top: 90px;
-}*/
-/*Video Player*/
-/*******Player Controlls View********/
-#video_player_view {
- top: 85px;
- left: 93px;
- z-index: 2002;
- display: block;
-}
-
-/*Holder for all progressbar elements*/
-#video_player_view .progressline_holder {
- display: block;
- width: 537px;
- height: 10px;
- cursor: pointer;
- background: url(../images/player/player_prog_bg.png) no-repeat;
-}
-
-/*Style to fix actual width for progress bar concerning width of progrees bar mark*/
-.progressline_width_fix {
- width: 537px;
- position: absolute;
-}
-
-/*Progressbar*/
-#video_player_view .progressbar {
- display: block;
- height: 10px;
- background: url(../images/player/prog_ind.png) no-repeat;
- position: relative;
- float: left;
-}
-
-/*Current time*/
-.current_time {
- width: 33px;
- height: 15px;
- top: -4px;
- left: -55px;
- font-weight: bold;
-}
-
-/*Total time*/
-.total_time {
- width: 33px;
- height: 15px;
- left: 546px;
- top: -4px;
- font-weight: bold;
-}
-
-/*Drag Area*/
-.drag_area {
- width: 561px;
- position: relative;
- float: left;
- height: 10px;
-}
-
-/*Progress bar mark*/
-#mark {
- position: relative;
- float: left;
- bottom: 19px;
- left: -20px;
- background: url(../images/player/player_free_control.png) no-repeat;
- width: 50px;
- height: 50px;
-}
-
-#mark.active {
- background: url(../images/player/player_active_control.png) no-repeat !important;
- bottom: 20px !important;
- left: -21px !important;
- width: 52px !important;
- height: 52px !important;
-}
-
-/*Back Button*/
-#back {
- width: 80px;
- height: 50px;
- cursor: pointer;
- top: 60px;
- left: 140px;
- border: 1px solid #393939;
-}
-
-#back .ico {
- top: 13px;
- left: 20px;
- position: relative;
-}
-
-/* Forward Button*/
-#frw {
- width: 79px;
- height: 49px;
- cursor: pointer;
- top: 60px;
- left: 347px;
- border: 1px solid #393939;
- -webkit-border-radius: 3px;
-}
-
-#frw .ico {
- top: 13px;
- left: 24px;
- position: relative;
-}
-
-/*Play Button*/
-#play {
- width: 79px;
- height: 49px;
- cursor: pointer;
- top: 60px;
- left: 244px;
- border: 1px solid #393939;
- -webkit-border-radius: 3px;
-}
-
-#play .play {
- top: 13px;
- left: 31px;
- position: relative;
-}
-
-#play .pause {
- top: 10px;
- left: 28px;
- position: relative;
-}
-
-/*Stop Button*/
-#stop {
- width: 79px;
- height: 49px;
- cursor: pointer;
- top: -18px;
- left: 585px;
- border: 1px solid #393939;
- -webkit-border-radius: 3px;
-}
-
-#stop .ico {
- top: 17px;
- left: 18px;
- position: relative;
-}
-
-/********************FOR TEST PURPOSE ONLY********************/
-.centered {
- position: absolute;
- width: 300px;
- height: 200px;
- border: 2px solid #999;
- color: white;
- text-align: center;
- margin: 100px auto;
- line-height: 190px;
- font-size: 24px;
- left: 240px;
-}
-
-/**************************FOR LIST***************************/
-/* List */
-.list {
- position: relative;
- overflow: hidden;
-}
-
-.list-content {
- border-top: 1px solid #393939;
- border-left: 1px solid #393939;
- border-right: 1px solid #393939;
-}
-
-/* List item */
-.list-item {
- position: relative;
- width: 100%;
- height: 49px;
- font-size: 20px;
- line-height: 50px;
- border-bottom: 1px solid #393939;
-}
-
-.list-item .ico {
- height: 49px;
- float: left;
-}
-
-.list-item span {
- /*position: absolute*/
-}
-
-/* List item background */
-.list-item.notpressed {
- background-image: url(../images/list/list_item_bg.png);
-}
-
-.list-item .highLighted {
-
-}
-
-/*************************FOR SCROLLBAR*************************/
-/*
-.scrollBar{
- position: relative;
- width: 48px;
- background: black;
- border: 1px solid #393939;
- border-top-right-radius: 1px;
- border-top-left-radius: 1px;
- border-bottom-right-radius: 1px;
- border-bottom-left-radius: 1px;
- float: right;
-}
-*/
-.scrollbar {
- position: absolute;
- top: 0px;
- right: 0px;
- width: 48px;
- background: black;
- border: 1px solid #393939;
- border-top-right-radius: 2px;
- border-top-left-radius: 2px;
- border-bottom-right-radius: 2px;
- border-bottom-left-radius: 2px;
-}
-
-.sb-content {
- width: 48px;
- background: black;
- border: 1px solid #393939;
- border-top-right-radius: 2px;
- border-top-left-radius: 2px;
- border-bottom-right-radius: 2px;
- border-bottom-left-radius: 2px;
-}
-
-/* Top button */
-.sb-top {
- height: 48px;
- width: 48px;
- border-bottom: #393939 1px solid;
- position: relative;
- cursor: pointer;
-}
-
-/* Background of scrollbar */
-.sb-body {
- height: 148px;
- width: 46px;
- background-color: #262626;
- margin: 1px;
- position: relative;
-}
-
-/* Bar */
-.sb-bar {
- width: 46px;
- height: 146px;
- background: #464646;
- position: relative;
- bottom: 10px;
- -webkit-transition: top 0.2s ease-out;
-}
-
-/* Bottom button */
-.sb-bottom {
- height: 48px;
- width: 48px;
- border-top: #393939 1px solid;
- position: absolute;
- cursor: pointer;
- bottom: 0px;
-}
-
-/* Buttons image position */
-.sb-bottom img, .sb-top img {
- margin-top: 13px;
- margin-left: 13px;
-}
-
-/* List item button background */
-.list-item.pressed {
- background-image: url(../images/list/list_item_pressed.png);
-}
-
-/** Background for pressed button */
-.button.pressed {
- background-image: url(../images/list/list_item_pressed.png);
-}
-
-/* Hide function */
-.is-disabled {
- display: none;
-}
-
-.hide {
- visibility: hidden;
- display: none;
-}
-
-/* Disabled list items */
-.disabled {
- color: #999;
- cursor: default!important;
-}
-
-.disabled .ico, .disabled .right_ico {
- opacity: .3;
-}
-
-.disabled .arrow-ico {
- opacity: .3;
-}
-
-#sing {
- width: 19px;
- height: 27px;
- left: 13px;
- top: 13px;
-}
-
-#sing.white {
- background: url(../images/help/white_help.png) no-repeat;
-}
-
-#sing.yellow {
- background: url(../images/help/yellow_help.png) no-repeat;
-}
-
-/******************** FOR FAQ ********************************/
-#faq_btn {
- cursor: pointer;
- width: 145px;
- height: 53px;
- background: url(../images/help/faq_top_btn.png) no-repeat;
- top: 0;
- left: 110px;
- z-index: 0;
- pointer-events: none;
- -webkit-transition: left 0.5s ease-in-out;
-}
-
-.faq-pressed {
- left: 0px !important;
-}
-
-#faq_btn.pressed {
- background: url(../images/help/faq_top_btn_pressed.png) no-repeat !important;
-}
-
-#faq_btn .ico {
- position: absolute;
- right: 32px;
- top: 8px;
-}
-
-#faq_btn_c {
- width: 118px;
- height: 50px;
- -webkit-transform: skewX(-43deg);
- z-index: 1;
- cursor: pointer;
- pointer-events: all;
-}
-
-#faq_btn .ind_inact {
- background: url(../images/help/ind_vert_def.png) no-repeat;
- position: absolute;
- right: 32px;
- top: 8px;
- width: 19px;
- height: 32px;
-}
-
-#faq_btn .ind_act {
- background: url(../images/help/ind_vert_active.png) no-repeat;
- position: absolute;
- right: 32px;
- top: 8px;
- width: 19px;
- height: 32px;
-}
-
-.button {
- background-image: url(../images/list/list_item_bg.png);
- cursor: pointer;
-}
-
-.button img {
- float: left;
-}
-
-/* default style */
-* {
- margin: 0;
- padding: 0;
- border: 0;
- -webkit-user-select: none;
-}
-
-/******************* For FAQ View *******************/
-#fag_view {
- font-size: 20px;
- display: block;
- background: url(../images/help/faq_bg.png) no-repeat;
- width: 800px;
- height: 384px;
- position: absolute;
- top: 48px;
-}
-
-#faq_view_list {
- position: relative;
- margin-left: 115px;
- margin-top: 34px;
- height: 251px;
- width: 630px;
- float: left;
-}
-
-#faq_view_list .list-content {
- width: 570px;
-}
-
-#fag_view .list-item {
- position: relative;
- width: 570px;
- height: 49px;
- font-size: 20px;
- line-height: 50px;
- border-bottom: 1px solid #393939;
- cursor: pointer;
- float: left;
-}
-
-#fag_view .list-item span {
- left: 5px;
- margin-top: 18px;
- margin-left: 17px;
-}
-
-/* Faq bottom text*/
-#faq_bottom {
- bottom: 19px;
- width: 764px;
- height: 50px;
- font-size: 18px;
- float: left;
- margin-top: 31px;
- margin-left: 36px;
-}
-
-#faq_bottom div {
- float: left;
- width: 764px;
-}
-
-#faq_bottom .second-line {
- top: 22px;
-}
-
-#settings_view {
- width: 800px;
- height: 480px;
-}
-
-.block {
- display: block !important;
-}
-
-.test_blur {
- width: 800px;
- height: 480px;
- top: -55px;
- z-index: 1001;
- opacity: .6;
- background-color: black;
- box-shadow: 3px;
-}
-
-.pointer {
- cursor: pointer !important;
-}
-
-/*CAUTION MESSAGE*/
-#warning_view {
- width: 800px;
- height: 480px;
- z-index: 12001;
- 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 {
- font-size: 23px;
-}
-
-#warning_view .message {
- width: 744px;
- height: 340px;
- position: relative;
- margin: 0 auto;
- top: 15px;
-}
-
-#warning_view .warning_text {
- position: relative;
- margin: 0 auto;
- width: 216px;
- font-size: 42px;
- font-weight: bold;
- top: 20px;
- text-shadow: 1px 1px 3px white;
- color: #CC2A2A;
-}
-
-#warning_view .text {
- font-size: 25px;
- position: relative;
- top: 15px;
- font-weight: bold;
-}
-
-#warning_view .okbut {
- width: 130px;
- height: 51px;
- position: relative;
- top: 30px;
- cursor: pointer;
- float: right;
- margin-right: 83px;
- display: none;
- font-size: 20px;
- text-align: center;
- line-height: 50px;
-}
-
-#warning_view .components{
- margin-top: 20px;
- width: 420px;
-}
-
-#warning_view .component{
- width: 200px;
- height: 20px;
- float: right;
- position: relative;
-}
-
-#warning_view .item{
- position: relative;
- float: left;
- margin-left: 10px;
-}
-
-.hideWarning {
- width: 0px !important;
- overflow: hidden;
- z-index: -1 !important;
-}
-
-.fadeWarning {
- opacity: 0;
- transition: opacity 1s;
- -moz-transition: opacity 1s;
- -webkit-transition: opacity 1s;
- -o-transition: opacity 1s;
-}
-
-#warning_view.fadeAnimation {
- -webkit-animation-name: opacity;
- -webkit-animation-duration: 1s;
- -webkit-animation-timing-function: linear;
- -webkit-animation-fill-mode: forwards;
-}
-
-@
--webkit-keyframes opacity {
-
-from {
- opacity: 1;
-
-}
-
-to {
- opacity: 0;
-}
-
- }
-
-/* Welcome Orientation View*/
-#app_welcome_orientation_view {
- width: 800px;
- height: 480px;
- z-index: 12000;
-}
-
-#app_welcome_orientation_balck_mask_view {
- width: 800px;
- height: 480px;
- background: #000;
- opacity: 0.75;
-}
-
-#app_welcome_orientation_popup_text {
- position: relative;
- margin: 0px auto;
- font-size: 30px;
- text-align: center;
- width: 410px;
- margin-top: 18px;
-}
-
-#app_welcome_orientation_denypopup_text {
- position: relative;
- margin: 0px auto;
- font-size: 28px;
- text-align: center;
- width: 460px;
- margin-top: 53px;
-}
-
-#app_welcome_orientation_popup_buttons {
- width: 266px;
- height: 53px;
- border: 1px solid #333;
- position: relative;
- margin: 20px auto 0px;
-}
-
-#app_welcome_orientation_popup_lable {
- position: relative;
- width: 479px;
- height: 70px;
- border: 1px solid #fff;
- text-align: center;
- margin: 0px auto;
- margin-top: 70px;
- font-size: 25px;
- font-family: Helvetica;
-}
-
-#app_welcome_orientation_popup_lable span {
- position: relative;
- top: 5px;
- width: 432px;
-}
-
-#app_welcome_orientation_popup_view, #wo_denypopup {
- width: 546px;
- height: 346px;
- background: #000;
- z-index: 12002;
- left: 134px;
- top: 46px;
- border: 2px solid #A28542;
- -webkit-border-radius: 4px;
-}
-
-#wo_popup_btn_divider {
- width: 4px;
- height: 48px;
- background: url(../images/common/divider.png) no-repeat;
- left: 131px;
- z-index: 1;
-}
-
-#wo_popup_yes_button, #wo_popup_no_button {
- height: 52px;
- width: 132px;
- cursor: pointer;
- position: relative;
- float: left;
- font-size: 20px;
- text-align: center;
- line-height: 52px;
-}
-
-#wo_popup_yes_button {
- border-right: 1px solid #000;
-}
-
-#wo_popup_no_button {
- border-left: 1px solid #393939;
-}
-
-#wo_popup_denypopup_ok_button {
- width: 238px;
- height: 48px;
- background: url(../images/common/bt_bg.png) repeat-x;
- cursor: pointer;
- position: relative;
- float: left;
- font-size: 20px;
- font-weight: bold;
- text-align: center;
- line-height: 50px;
- border: 1px solid #333;
- left: 155px;
- top: 80px;
- -webkit-border-radius: 4px;
-}
-
-#woSkippButton {
- width: 80px;
- height: 50px;
- cursor: pointer;
- top: 370px;
- left: 710px;
- font-size: 21px;
- text-align: center;
- line-height: 48px;
- z-index: 10000;
- border: 1px solid white;
- -webkit-border-radius: 3px;
- background: url(../images/common/skippbuttonbg_pressed.png) no-repeat;
- opacity: 0.75;
- display: none;
-}
-
-#woSkippButton .right_text {
- margin-top: 2px;
-}
-
-#woSkippButton.pressed {
- background: url(../images/common/skippbuttonbg_pressed.png) no-repeat !important;
-}
-
-#wo_popup_yes_button.pressed, #wo_popup_no_button.pressed, #wo_popup_denypopup_ok_button.pressed {
- background: url(../images/common/bt_bg_pressed.png) repeat-x !important;
-}
-
-/* END Welcome Orientation View*/
-/* Video Error Popup*/
-#video_error_popup {
- background: black;
- border: 1px solid #A03333;
- -webkit-border-radius: 3px;
- font-size: 23px;
- font-weight: bold;
- left: 308px;
- text-align: center;
- top: 170px;
- z-index: 12100;
- position: absolute;
- padding: 10px;
- display: none;
-}
-
-.mft_indicator {
- opacity: 0;
-}
-
-/* Lable plus Button*/
-.lablePlusButton .button {
- float: right;
- right: 0px;
- width: 323px;
- height: 49px;
- border-left: 1px solid #393939;
-}
-
-.lablePlusButton .lable span, .lablePlusButton .button span {
- margin-left: 13px;
-}
-
-.lablePlusButton .button.single {
- width: 148px;
- height: 28px;
- border: 1px solid #393939;
- border-radius: 2px;
- margin-top: 10px;
- margin-right: 10px;
- text-align: center;
- line-height: 28px;
- float: right;
-}
-
-.lablePlusButton .button.single span {
- margin: 0px;
-}
-
-/* ****************Select System Popup *********************** */
-#select_sysytem_view {
- width: 796px;
- height: 475px;
- top: 1px;
- border: 2px solid #926100;
- background: #000;
- z-index: 12002;
- -webkit-border-radius: 4px;
-}
-
-/* header lable*/
-#select_system_heading_lable {
- position: relative;
- font-size: 30px;
- text-align: center;
- margin-top: 25px;
- margin-bottom: 30px;
-}
-
-/* content container*/
-#select_system_container {
- width: 756px;
- height: 200px;
- position: relative;
- margin: 0px auto;
- border: 1px solid #393939;
-}
-
-/* vehicle select list*/
-#settings_list {
- height: 130px;
- position: relative;
-}
-
-/* vehicle select list container*/
-#select_system_list {
- width: 545px;
- position: relative;
- float: right;
- margin-top: 15px;
- margin-right: 20px;
-}
-
-/* vehicle select list buttons*/
-#settings_list .button {
- position: relative;
- width: 135px;
- height: 48px;
- font-size: 20px;
- text-align: center;
- line-height: 48px;
- float: left;
- border-right: 1px solid #393939;
- border-top: 1px solid #393939;
- border-bottom: 1px solid #393939;
-}
-
-#settings_list .button.left-border {
- border-left: 1px solid #393939;
-}
-
-#settings_list .button.active {
- background: url(../images/settings/btn-48h-gray-active.png) repeat-x !important;
- color: #000;
-}
-
-#settings_list .button.bottom {
- margin-top: 2px;
-}
-
-/* select climate style lable*/
-#select_system_label {
- font-size: 20px;
- width: 135px;
- position: relative;
- float: left;
- margin-left: 10px;
- margin-top: 15px;
-}
-
-/* Navigation select block*/
-#navsdcard {
- height: 70px;
- position: relative;
- border-bottom: 1px solid #393939;
-}
-
-/* Navigation select block button container*/
-#sdnav_buttons {
- position: relative;
- float: right;
- margin-top: 10px;
- margin-right: 20px;
-}
-
-/* Navigation select block button*/
-#navsdcard .button {
- width: 120px;
- height: 48px;
- border: 1px solid #393939;
- text-align: center;
- font-size: 20px;
- line-height: 48px;
- font-weight: bold;
-}
-
-#navsdcard .button.active {
- background: url(../images/settings/btn-48h-gray-active.png) repeat-x !important;
- color: #000;
-}
-
-#navsdcard_no_btn {
- position: relative;
- float: right;
-}
-
-#navsdcard_yes_btn {
- position: relative;
- float: left;
-}
-
-/* navigationApp select lable*/
-#sdnav_label {
- position: relative;
- float: left;
- font-size: 20px;
- margin-top: 15px;
- margin-left: 10px;
-}
-
-/* Submit button*/
-#select_system_submit {
- width: 130px;
- height: 50px;
- z-index: 12002;
- position: relative;
- border: 1px solid #393939;
- text-align: center;
- font-size: 25px;
- font-weight: bold;
- line-height: 50px;
- margin: 50px auto;
-}
-
-/* Info Lable*/
-#select_system_info {
- position: relative;
- text-align: center;
- font-size: 25px;
- margin-top: 25px;
-}
-
-#select_system_info span {
- border: 1px solid #fff;
- padding: 5px 15px 5px 15px;
-}
diff --git a/src/components/HMI/css/info.css b/src/components/HMI/css/info.css
deleted file mode 100644
index 34776e6cbf..0000000000
--- a/src/components/HMI/css/info.css
+++ /dev/null
@@ -1,671 +0,0 @@
-#status_info {
- top: 0px;
- right: 0px;
- text-align: right;
- font-size: 21px;
- width: 324px;
- height: 48px;
- cursor: pointer;
- background: url(../images/common/nav-status-bg.png) no-repeat;
- z-index: 1;
-}
-
-#status_info_label {
- width: 100%;
- display: block;
-}
-
-#status_info_label span {
- padding-right: 11px;
-}
-
-#info_view {
- width: 800px;
- height: 480px;
-}
-
-#info_view.green_bg {
- background: url(../images/nav/bg.png) no-repeat;
-}
-
-#info_leftMenu {
- background: #333;
- width: 150px;
- height: 300px;
- top: 90px;
-}
-
-#info_leftMenu .menu-item.info_active {
- background: url("../images/info/menu_active.png") repeat-x;
-}
-
-#info_leftMenu .menu-item {
- z-index: 201;
- position: relative;
- width: 150px;
- height: 50px;
- cursor: pointer;
-}
-
-#info_leftMenu .menu-item span {
- position: absolute;
- left: 50px;
- width: 100px;
- height: 50px;
- font-size: 18px;
- line-height: 50px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-#info_leftMenu .ico {
- height: 50px;
- width: 50px;
-}
-
-#info_leftMenu .settings_active {
- background: url("../images/settings/menu_active.png") repeat-x;
-}
-
-#info_right_menu {
- left: 183px;
- top: 6px;
-}
-
-#info_sync_services {
- font-size: 32px;
- width: 280px;
-}
-
-#info_traff {
- font-size: 20px;
- width: 410px;
- top: 36px;
-}
-
-#info_traffic_report {
- width: 300px;
- top: 85px;
- font-size: 20px;
- color: #a6a6a6;
-}
-
-#info_traffic_pts {
- width: 400px;
- top: 120px;
- font-size: 20px;
- color: #65cdd9;
-}
-
-#info_traffic_hear {
- width: 355px;
- top: 192px;
- font-size: 20px;
- color: #a6a6a6;
-}
-
-#info_connect {
- width: 300px;
- top: 241px;
- font-size: 20px;
- left: 15px;
-}
-
-#info_log {
- width: 500px;
- top: 285px;
- font-size: 20px;
-}
-
-#info_left_menu {
- top: 6px;
-}
-
-#info_left_menu div {
- font-size: 20px;
- left: 49px;
-}
-
-#info_left_services {
- top: 17px;
-}
-
-#info_left_travel_link {
- top: 66px;
- width: 200px;
-}
-
-#info_left_alerts {
- top: 118px;
-}
-
-#info_left_calendar {
- top: 166px;
-}
-
-#info_left_apps {
- top: 216px;
-}
-
-/******************* For Info.Services *******************/
-#info_services_view {
- top: 48px;
- left: 153px;
- background: url(../images/info/info_services_bg.png) no-repeat 0px 39px;
- height: 384px;
- width: 647px;
-}
-
-#info_services_view .inner-content {
- left: 30px;
- top: 49px;
-}
-
-/******************* For Info.travelLink *******************/
-#info_travelLink {
- position: absolute;
- top: 48px;
- left: 153px;
- width: 647px;
- height: 384px;
- float: left;
- z-index: 1001;
-}
-
-#info_travelLink_logo {
- margin-top: 48px;
- margin-left: 22px;
-}
-
-#info_travelLink .inner-content {
- top: 71px;
-}
-
-#info_travelLink .block-header-title {
- top: 21px;
- left: 75px;
-}
-
-#info_travelLink .list {
- width: 308px;
- border-radius: 2px;
- max-height: 248px;
- border: 1px solid #393939;
-}
-
-#info_travelLink .list .list-item:last-of-type {
- height: 50px;
- border: none;
-}
-
-#info_travelLink .list-content {
- position: relative;
- float: left;
- width: 100%;
- border: none;
-}
-
-#info_travelLink_listLeft {
- left: 12px;
- top: 92px;
-}
-
-#info_travelLink_listRight {
- position: absolute;
- top: 43px;
- right: 5px;
- width: 310px;
-}
-
-#info_travelLink_listLeft .list-item span,#info_travelLink_listRight .list-item span
- {
- margin-left: 44px;
-}
-
-#info_travelLink.fr #info_travelLink_listLeft .list-item span,#info_travelLink.fr #info_travelLink_listRight .list-item span
- {
- margin-left: 22px;
-}
-
-#info_travelLink_listRight_item0 span {
- margin-left: 0px !important;
-}
-
-#info_travelLink_listRight_item0 {
- text-align: center;
-}
-
-#info_travelLink_listRight .list-item:first-of-type {
- height: 48px !important;
-}
-
-/******************* For Info.Alerts menu *****************/
- /******************* For Info.Calendar menu ***************/
-#info_calendar {
- left: 153px;
- top: 48px;
- width: 647px;
- height: 384px;
- background-image: url(../images/info/view_info_calendar.png);
- background-repeat: no-repeat;
- background-position: 4px 38px;
-}
-
-#info_calendar .inner-wrapper {
- left: 99px;
- top: 99px;
-}
-
-#info_calendar .c-btn {
- width: 90px;
- height: 34px;
- background: url(../images/info/callendar-btn.png) no-repeat 0px 0px;
- text-align: center;
- line-height: 33px;
-}
-
-#info_calendar .c-btn.active {
- background: #3b3b3b url(../images/common/btn-28h-gray-active.png)
- repeat-x 0 5px !important;
-}
-
-#info_calendar .date {
- white-space: nowrap;
- font-size: 26px;
- top: -43px;
- left: 178px;
-}
-
-#info_calendar .today {
- white-space: nowrap;
- top: -58px;
- left: 414px;
- height: 48px;
- width: 130px;
- font-size: 20px;
- line-height: 48px;
- border: 1px #333 solid;
- text-align: center;
- border-radius: 2px;
-}
-
-#info_calendar .day {
- width: 89px;
- height: 36px;
- text-align: center;
- top: 5px;
- line-height: 25px;
-}
-
-#info_calendar .day.active {
- background: #f28b06;
-}
-
-#info_calendar .day-1 {
- left: -86px;
-}
-
-#info_calendar .day-2 {
- left: 3px;
-}
-
-#info_calendar .day-3 {
- left: 93px;
-}
-
-#info_calendar .day-4 {
- left: 183px;
-}
-
-#info_calendar .day-5 {
- left: 272px;
-}
-
-#info_calendar .day-6 {
- left: 363px;
-}
-
-#info_calendar .day-7 {
- left: 453px;
-}
-
-#info_calendar .btn-1 {
- left: -88px;
- top: 40px;
-}
-
-#info_calendar .btn-8 {
- left: -88px;
- top: 75px;
-}
-
-#info_calendar .btn-15 {
- left: -87px;
- top: 108px;
-}
-
-#info_calendar .btn-22 {
- left: -88px;
- top: 141px;
-}
-
-#info_calendar .btn-29 {
- left: -88px;
- top: 174px;
-}
-
-#info_calendar .btn-7 {
- left: 452px;
- top: 40px;
-}
-
-#info_calendar .btn-14 {
- left: 452px;
- top: 75px;
-}
-
-#info_calendar .btn-21 {
- left: 452px;
- top: 108px;
-}
-
-#info_calendar .btn-28 {
- left: 452px;
- top: 141px;
-}
-
-#info_calendar .btn-6 {
- left: 362px;
- top: 40px;
-}
-
-#info_calendar .btn-13 {
- left: 362px;
- top: 75px;
-}
-
-#info_calendar .btn-20 {
- left: 362px;
- top: 108px;
-}
-
-#info_calendar .btn-27 {
- left: 362px;
- top: 141px;
-}
-
-#info_calendar .btn-5 {
- left: 272px;
- top: 40px;
-}
-
-#info_calendar .btn-12 {
- left: 272px;
- top: 75px;
-}
-
-#info_calendar .btn-19 {
- left: 272px;
- top: 108px;
-}
-
-#info_calendar .btn-26 {
- left: 272px;
- top: 141px;
-}
-
-#info_calendar .btn-4 {
- left: 182px;
- top: 40px;
-}
-
-#info_calendar .btn-11 {
- left: 182px;
- top: 75px;
-}
-
-#info_calendar .btn-18 {
- left: 182px;
- top: 108px;
-}
-
-#info_calendar .btn-25 {
- left: 182px;
- top: 141px;
-}
-
-#info_calendar .btn-3 {
- left: 92px;
- top: 40px;
-}
-
-#info_calendar .btn-10 {
- left: 92px;
- top: 75px;
-}
-
-#info_calendar .btn-17 {
- left: 92px;
- top: 108px;
-}
-
-#info_calendar .btn-24 {
- left: 92px;
- top: 141px;
-}
-
-#info_calendar .btn-31 {
- left: 92px;
- top: 174px;
-}
-
-#info_calendar .btn-2 {
- left: 2px;
- top: 40px;
-}
-
-#info_calendar .btn-9 {
- left: 2px;
- top: 75px;
-}
-
-#info_calendar .btn-16 {
- left: 2px;
- top: 108px;
-}
-
-#info_calendar .btn-23 {
- left: 2px;
- top: 141px;
-}
-
-#info_calendar .btn-30 {
- left: 2px;
- top: 174px;
-}
-
-/******************* For Info.DeviceList *******************/
-#info_view .info_apps_deviceList_view {
- background: black;
- width: 800px;
- height: 480px;
- z-index: 201;
-}
-
-#info_apps_deviceList_view .backButton {
- top: 80px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
- left: 5px;
-}
-
-#info_apps_deviceList_view .backButton .ico {
- margin-top: 13px;
- margin-left: 8px;
-}
-
-#info_apps_deviceList_view .list {
- position: absolute;
- width: 629px;
- height: 251px;
- border-radius: 2px;
- left: 100px;
- top: 154px;
-}
-
-#info_apps_deviceList_view .list-content {
- width: 578px;
- border: none;
-}
-
-#info_apps_deviceList_view .list-item {
- border: 1px solid #393939 !important;
-}
-
-/******************* For Info.Apps menu*******************/
-#info_apps {
- position: absolute;
- top: 48px;
- left: 153px;
- width: 647px;
- height: 384px;
- float: left;
- z-index: 1001;
-}
-
-#info_apps .backButton {
- top: 59px;
-}
-
-#info_apps .block-header-title {
- top: 67px;
- left: 73px;
-}
-
-#info_apps_pushToTalk_buttton {
- top: 80px;
- right: 5px;
- height: 48px;
- width: 48px;
- border: 1px solid #4bffff;
- border-radius: 2px;
-}
-
-#info_apps_list {
- top: 70px;
- left: 13px;
-}
-
-#info_appst {
- height: 250px;
- position: relative;
- float: left;
- margin-top: 5px;
- width: 554px;
-}
-
-#info_apps .list {
- width: 629px;
- height: 251px;
-}
-
-#info_apps_list .list-item .ico {
- width: 50px;
- height: 50px;
- position: absolute;
-}
-
-#info_apps_list .list-item span {
- margin-left: 50px;
-}
-
-#info_apps_list .list-item {
- height: 48px !important;
- border: 1px solid #393939;
-}
-
-#info_apps_list .list-content {
- width: 279px;
- border: none !important;
-}
-
-#info_apps .leftButtons {
- width: 278px;
- float: left;
- margin-right: 10px;
- height: 51px;
- font-size: 20px;
- line-height: 50px;
- border: 1px solid #393939;
- cursor: pointer;
- left: 10px;
-}
-
-#info_apps .vehicleHealthReport {
- top: 70px;
-}
-
-#info_apps .Asist911 {
- top: 122px;
-}
-
-#info_apps .installButton {
- top: 174px;
-}
-
-#info_apps .findNewApps {
- top: 226px;
-}
-
-#info_apps .findNewApps img {
- margin: 9px;
- width: 32px;
-}
-
-#info_apps .getDeviceList {
- top: 278px;
-}
-
-#info_apps .getDeviceList img {
- width: 38px;
- margin: 6px;
-}
-
-#info_apps .list {
- float: right;
- margin-right: 41px;
- width: 330px
-}
-
-#info_apps_install_Button span {
- position: absolute;
-}
-
-#info_apps.fr #info_apps_install_Button span {
- position: absolute;
- line-height: 20px;
- width: 170px;
- top: 3px;
-}
-
-#info_apps .list-item .ico {
- float: left;
-}
-
-#info_apps .list-item span {
- height: 23px;
-}
-
-#info_apps .inner-wrapper {
- left: 100px;
- top: 71px;
-}
-
-#info_apps_install_Button {
- border: 1px solid #393939;
- border-radius: 2px;
- top: 269px;
- left: 303px;
-} \ No newline at end of file
diff --git a/src/components/HMI/css/mcs.css b/src/components/HMI/css/mcs.css
deleted file mode 100644
index 304e2ee8d6..0000000000
--- a/src/components/HMI/css/mcs.css
+++ /dev/null
@@ -1,3703 +0,0 @@
-/*** Multi Contour Seat ** */
-#back-button {
- background: url(../images/common/page-back-button.png) no-repeat center
- 12px, url(../images/common/btn-48h.png);
- width: 48px;
- z-index: 5000;
- left: -107px;
- top: -72px;
-}
-
-#back-button.pressed {
- background: url(../images/common/page-back-button.png) no-repeat center
- 12px, url(../images/common/btn-48h-pressed.png);
-}
-
-#MultiContourSeat_customMassage {
- visibility: hidden;
- background-color: #000;
- z-index: 200;
- width: 800px;
- height: 345px;
- position: absolute;
- top: -60px;
- left: -112px;
-}
-
-#MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#MultiContourSeat_customMassage_caption2 {
- top: 35px;
- width: 350px;
- text-align: center;
- left: 225px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .MultiContourSeat_customMassage_previewButton
- {
- top: 172px;
- left: 620px;
- width: 120px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .MultiContourSeat_customMassage_previewButtonTop
- {
- top: 113px;
- left: 535px;
- width: 120px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .MultiContourSeat_customMassage_previewButtonBottom
- {
- top: 239px;
- left: 535px;
- width: 120px;
- text-align: center;
-}
-
-#MultiContourSeat_customMassage_backButton {
- top: 220px;
- left: 535px;
- width: 120px;
- text-align: center;
-}
-
-#MultiContourSeat_customMassage_backButtonCenter {
- bottom: 10px;
- left: 340px;
- width: 120px;
- text-align: center;
-}
-
-#MultiContourSeatContainer .led {
- width: 12px;
- height: 40px;
- background: url("../images/common/seat-act-led.png") no-repeat;
- position: relative !important;
- float: left;
- background-position: -4px 0;
-}
-
-#MultiContourSeatContainer .led-inactive {
- background: url("../images/common/seat-inact-led.png") no-repeat;
- background-position: 3px 8px;
- width: 12px;
- height: 40px;
- position: relative !important;
- float: left;
-}
-
-#MultiContourSeat_customMassage .led {
- /*background-position: -4px -6px;*/
-
-}
-
-#MultiContourSeat_customMassage .led-inactive {
- /*background-position: 3px 2px;*/
-
-}
-
-#contentMCS {
- top: 83px;
- left: 112px;
-}
-
-#MultiContourSeatContainer {
- position: absolute;
- background-color: black;
- width: 800px;
- height: 384px;
- top: -38px;
- left: -160px;
- z-index: 1001;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .block-header-title {
- font-size: 26px;
- width: 400px;
- top: -72px;
- left: -38px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .view_settings_vehicle_MultiContourSeat-left-s
- {
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat-left-s.png)
- no-repeat;
- width: 193px;
- height: 263px;
- left: -70px;
- top: -40px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .view_settings_vehicle_MultiContourSeat-Massage-left-s
- {
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat-driver_massage_seat.png)
- no-repeat;
- width: 193px;
- height: 263px;
- left: -70px;
- top: -40px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .notActiveSeat {
- opacity: 0.5;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .not_selected .active {
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .driver {
- width: 158px;
- left: -54px;
- top: 226px;
- text-align: center;
- line-height: 49px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .btn-48.active {
- background: url(../images/common/btn-48h-active-gray.png) repeat-x
- !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .btn-28.active {
- background: url(../images/settings/btn-28h-gray-active.png) repeat-x
- !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .adjust {
- width: 158px;
- left: -54px;
- top: 226px;
- text-align: center;
- line-height: 49px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .massage {
- width: 144px;
- left: 299px;
- top: -60px;
- text-align: center;
- line-height: 49px;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-bottomright: 3px;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .adjust {
- width: 144px;
- left: 154px;
- top: -60px;
- text-align: center;
- line-height: 49px;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
- -webkit-border-top-left-radius: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -moz-border-radius-topleft: 3px;
- -moz-border-radius-bottomleft: 3px;
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .passenger {
- width: 158px;
- left: 496px;
- top: 227px;
- text-align: center;
- line-height: 49px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .pressed {
- background: url(../images/common/btn-48h-pressed.png) bottom repeat-x
- !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-1 {
- width: 32px;
- height: 39px;
- left: 414px;
- top: 3px;
- background: url(../images/settings/seats.png) no-repeat;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-2 {
- width: 32px;
- height: 39px;
- left: 414px;
- top: 61px;
- background: url(../images/settings/seats.png) no-repeat 0 -61px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-3 {
- width: 32px;
- height: 39px;
- left: 414px;
- top: 118px;
- background: url(../images/settings/seats.png) no-repeat 0 -117px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-4 {
- width: 32px;
- height: 39px;
- left: 414px;
- top: 179px;
- background: url(../images/settings/seats.png) no-repeat 0 -177px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-5 {
- width: 32px;
- height: 39px;
- left: 414px;
- top: 236px;
- background: url(../images/settings/seats.png) no-repeat 0 -233px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-1 {
- width: 32px;
- height: 38px;
- left: 414px;
- top: 3px;
- background: url(../images/settings/seats-message.png) no-repeat;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-2 {
- width: 32px;
- height: 38px;
- left: 414px;
- top: 63px;
- background: url(../images/settings/seats-message.png) no-repeat 0 -61px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seat-right {
- width: 193px;
- height: 263px;
- left: 480px;
- top: -40px;
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat-right-s.png)
- no-repeat;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .massage-seat-right {
- width: 193px;
- height: 263px;
- left: 480px;
- top: -40px;
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat-Passenger_massage_seat.png)
- no-repeat;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control {
- width: 238px;
- height: 41px;
- border: 1px solid #393939;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-#MultiContourSeat_customMassage .control {
- width: 213px;
- /*height: 28px;*/
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .indButtonMCS.active,#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions.active,#view_settings_vehicle_MultiContourSeat_Adjust .control.active
- {
- border: 1px solid #ff9900;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control .minus {
- width: 58px;
- height: 41px;
- border-right: 1px solid #393939;
- -webkit-border-top-right-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- -moz-border-radius-topright: 3px;
- -moz-border-radius-bottomright: 3px;
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
- top: 0;
- left: 0;
- background: url(../images/common/btn-48h.png);
- position: relative;
- float: left;
- cursor: pointer;
-}
-
-#MultiContourSeat_customMassage .control .minus { /* height: 28px;*/
-
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .ledContainer {
- position: relative;
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control .plus {
- width: 58px;
- height: 41px;
- border-left: 1px solid #393939;
- -webkit-border-top-left-radius: 3px;
- -webkit-border-bottom-left-radius: 3px;
- -moz-border-radius-topleft: 3px;
- -moz-border-radius-bottomleft: 3px;
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
- top: 0px;
- right: 0;
- background: url(../images/common/btn-48h.png);
- cursor: pointer;
-}
-
-#MultiContourSeat_customMassage .control .plus { /* height: 28px;*/
-
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control .minus .ico {
- top: 19px;
- left: 20px;
- position: absolute;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control .plus .ico {
- top: 12px;
- left: 20px;
- position: absolute;
-}
-
-#MultiContourSeat_customMassage .control .minus .ico { /*top: 13px;*/
-
-}
-
-#MultiContourSeat_customMassage .control .plus .ico { /*top: 6px;;*/
-
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control-1 {
- top: 1px;
- left: 155px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control-2 {
- top: 60px;
- left: 155px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control-3 {
- top: 119px;
- left: 155px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control-4 {
- top: 177px;
- left: 155px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .control-5 {
- top: 235px;
- left: 154px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-1 {
- left: 60px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-2 {
- left: 71px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-3 {
- left: 82px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-4 {
- left: 93px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-5 {
- left: 104px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-6 {
- left: 115px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-7 {
- left: 126px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-8 {
- left: 137px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-9 {
- left: 148px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .led-10 {
- left: 159px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions {
- width: 238px;
- height: 48px;
- border: 1px solid #393939;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- left: 154px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions-1
- {
- top: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .seats-message-actions-2
- {
- top: 60px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .quality {
- width: 79px;
- height: 48px;
- background: url(../images/common/btn-48h.png);
- font-size: 20px;
- text-align: center;
- line-height: 48px;
- cursor: pointer;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .delim {
- width: 4px;
- height: 48px;
- background: url(../images/common/delim.png) no-repeat;
- z-index: 100;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .active.quality {
- background: url(../images/common/btn-48h-active-gray.png) !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .delim-0 {
- left: 76px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .delim-1 {
- left: 158px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .button0 {
- left: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .button1 {
- left: 80px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust .button2 {
- left: 159px;
-}
-
-#MultiContourSeatContainer .indButtonMCS {
- width: 84px;
- height: 49px;
- cursor: pointer;
-}
-
-#MultiContourSeatContainer .indButtonMCS .ico {
- top: 1px;
- left: 26px;
- position: absolute;
-}
-
-#MultiContourSeatContainer .indButtonMCS div {
- width: 22px;
- height: 17px;
- top: 35px;
- left: 25px;
- position: relative;
- float: left;
- margin-left: -9px;
-}
-
-#MultiContourSeatContainer .indButtonMCS div.small_ind_def {
- background: url(../images/climate/small_ind_def.png) no-repeat;
-}
-
-#MultiContourSeatContainer .indButtonMCS div.small_ind_active {
- background: url(../images/climate/small_ind_active.png) no-repeat;
-}
-
-#MultiContourSeatContainer .indButtonMCS.notpressed {
- background: url(../images/common/btn-48h.png);
- background-size: contain;
- border-radius: 3px;
- border: 1px solid #393939;
-}
-
-#MultiContourSeatContainer .indButtonMCS.pressed {
- background: url(../images/climate/left_person_control/rb_bg_pressed.png)
- no-repeat;
-}
-
-/* BEGIN concept 1.1 */
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions
- {
- left: 186px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageTop1
- {
- width: 18px;
- height: 27px;
- left: 150px;
- background-image: url(../images/settings/massageTop.png) !important;
- background-repeat: no-repeat;
- top: 8px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageTop2
- {
- width: 30px;
- height: 27px;
- left: 150px;
- background-image: url(../images/settings/massageBottom.png) !important;
- background-repeat: no-repeat;
- top: 52px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageTop3
- {
- width: 30px;
- height: 27px;
- left: 143px;
- background-image: url(../images/settings/massageVertical.png) !important;
- background-repeat: no-repeat;
- top: 96px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .dividerBlocks
- {
- width: 292px;
- height: 0px;
- border: 1px solid #525252;
- left: 154px;
- top: 139px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageBottom1
- {
- width: 29px;
- height: 21px;
- left: 143px;
- background-image: url(../images/settings/MassageCircle.png) !important;
- background-repeat: no-repeat;
- top: 162px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageBottom2
- {
- width: 29px;
- height: 30px;
- left: 144px;
- background-image: url(../images/settings/massageRound.png) !important;
- background-repeat: no-repeat;
- top: 200px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .massageBottom3
- {
- width: 27px;
- height: 30px;
- left: 144px;
- background-image: url(../images/settings/massageHorisontal.png)
- !important;
- background-repeat: no-repeat;
- top: 245px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-1
- {
- top: 46px;
- left: 428px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-2
- {
- top: 196px;
- left: 428px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .quality
- {
- width: 56px;
- height: 38px;
- line-height: 38px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions
- {
- width: 224px;
- height: 38px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-top2
- {
- top: 45px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-top3
- {
- top: 90px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-bottom1
- {
- top: 150px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-bottom2
- {
- top: 195px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .seats-message-actions-bottom3
- {
- top: 240px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim
- {
- height: 38px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim-0
- {
- left: 54px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim-1
- {
- left: 110px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .delim-2
- {
- left: 166px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button0
- {
- left: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button1
- {
- left: 56px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button2
- {
- left: 112px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1 .button3
- {
- left: 168px;
-}
-
-/* END concept 1.1 */ /* BEGIN concept 1.2 */
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions
- {
- left: 154px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-1
- {
- top: 35px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-2
- {
- top: 203px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .quality
- {
- width: 56px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .quality img
- {
- margin-top: 10px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions
- {
- width: 224px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions-top2
- {
- top: 60px;
- left: 210px;
- width: 168px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions-bottom1
- {
- top: 170px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .seats-message-actions-bottom2
- {
- top: 230px;
- left: 210px;
- width: 168px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .delim-0
- {
- left: 54px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .delim-1
- {
- left: 110px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .delim-2
- {
- left: 166px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button0
- {
- left: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button1
- {
- left: 56px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button2
- {
- left: 112px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2 .button3
- {
- left: 168px;
-}
-
-/* END concept 1.2 */ /* BEGIN concept 1.3 */
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .indButtonMCS div.small_ind_active
- {
- background: url(../images/climate/small_ind_green.png) no-repeat;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .patternTextIndicator
- {
- top: -29px;
- width: 80px;
- text-align: center;
- font-size: 18px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .patternTextTop
- {
- left: 280px;
- width: 150px;
- text-align: center;
- font-size: 18px;
- top: 30px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .patternTextBottom
- {
- left: 280px;
- width: 150px;
- text-align: center;
- font-size: 18px;
- top: 140px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions
- {
- left: 154px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-1
- {
- top: 35px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-2
- {
- top: 203px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .quality
- {
- width: 56px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .quality img
- {
- margin-top: 10px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions
- {
- width: 224px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-top1
- {
- left: 159px;
- top: 60px;
- width: 78px;
- height: 20px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-top2
- {
- left: 270px;
- top: 60px;
- width: 168px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-bottom1
- {
- top: 170px;
- left: 159px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .seats-message-actions-bottom2
- {
- top: 170px;
- left: 270px;
- width: 168px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .delim-0
- {
- left: 54px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .delim-1
- {
- left: 110px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .delim-2
- {
- left: 166px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button0
- {
- left: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button1
- {
- left: 56px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button2
- {
- left: 112px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_3 .button3
- {
- left: 168px;
-}
-
-/* END concept 1.3 */ /* BEGIN concept 1.4 */
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternText1
- {
- width: 78px;
- height: 20px;
- top: 65px;
- left: 270px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .pattern1
- {
- background-image: url('../images/settings/massageTop.png');
- background-repeat: no-repeat;
- background-position: 53px 0px;
- background-size: contain;
- width: 83px;
- height: 20px;
- top: 65px;
- left: 209px;
- text-align: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .pattern2
- {
- background-image: url('../images/settings/massageBottom.png');
- background-repeat: no-repeat;
- background-position: 53px 0px;
- background-size: contain;
- width: 83px;
- height: 20px;
- top: 65px;
- left: 209px;
- text-align: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .pattern3
- {
- background-image: url('../images/settings/massageVertical.png');
- background-repeat: no-repeat;
- background-position: 52px 0px;
- background-size: contain;
- width: 83px;
- height: 20px;
- top: 65px;
- left: 202px;
- text-align: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternbottom1
- {
- background-image: url('../images/settings/massageCircle.png');
- background-repeat: no-repeat;
- background-position: 53px 0px;
- background-size: contain;
- width: 83px;
- height: 20px;
- top: 165px;
- left: 196px;
- text-align: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternbottom2
- {
- background-image: url('../images/settings/massageRound.png');
- background-repeat: no-repeat;
- background-position: 55px 0px;
- background-size: contain;
- width: 83px;
- height: 20px;
- top: 165px;
- left: 196px;
- text-align: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternbottom3
- {
- background-image: url('../images/settings/massageHorisontal.png');
- background-repeat: no-repeat;
- background-position: 55px 0px;
- background-size: contain;
- width: 83px;
- height: 20px;
- top: 165px;
- left: 202px;
- text-align: left;
-}
-
-#seatsMassageView1_4 .seatsMassageView1_4_seatLabel {
- top: 172px;
- left: 45px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-2
- {
- top: 105px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .patternText2
- {
- width: 78px;
- height: 20px;
- top: 165px;
- left: 271px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .labelTitle
- {
- width: 600px;
- text-align: left;
- height: 30px;
- line-height: 30px;
- font-size: 26px;
- left: 74px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Settings
- {
- top: 200px;
- left: 197px;
- width: 138px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Settings span
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Settings .ico
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage
- {
- text-align: center;
- height: 48px;
- line-height: 48px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage.button0
- {
- top: 70px;
- left: 45px;
- width: 200px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage.button1
- {
- top: 130px;
- left: 45px;
- width: 200px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Massage.button2
- {
- top: 190px;
- left: 45px;
- width: 200px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5Back
- {
- top: 280px;
- left: 45px;
- width: 200px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .concept1_5SettingsScreen
- {
- top: -60px;
- left: -112px;
- width: 800px;
- height: 345px;
- background: black;
- z-index: 100;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .btn-48
- {
- line-height: 48px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .show
- {
- visibility: visible !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .hide
- {
- visibility: hidden;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .quality
- {
- width: 56px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .quality img
- {
- margin-top: 10px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions-top
- {
- left: 355px;
- top: 120px;
- width: 168px !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions-bottom
- {
- left: 355px;
- top: 210px;
- width: 168px !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions
- {
- width: 224px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .seats-message-actions-2
- {
- top: 100px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .delim-0
- {
- left: 54px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .delim-1
- {
- left: 110px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .delim-2
- {
- left: 166px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button0
- {
- left: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button1
- {
- left: 56px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button2
- {
- left: 112px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 .button3
- {
- left: 168px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 #alternatingMassage .seats-message-1
- {
- width: 32px;
- height: 38px;
- top: 126px;
- background: url(../images/settings/seats-message.png) no-repeat;
- left: 285px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_4 #alternatingMassage .seats-message-2
- {
- width: 32px;
- height: 38px;
- top: 216px;
- left: 285px;
- background: url(../images/settings/seats-message.png) no-repeat 0 -61px;
-}
-
-/* END concept 1.4 */ /* BEGIN concept 1.5 */
-#seatsMassageView1_5 .seatsMassageView1_5_seatLabel {
- top: 160px;
- left: 0px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .labelTitle
- {
- width: 600px;
- text-align: left;
- height: 30px;
- line-height: 30px;
- font-size: 26px;
- left: 74px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .labelText
- {
- top: 97px;
- width: 672px;
- text-align: center;
- left: 140px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Settings
- {
- top: 120px;
- left: 205px;
- width: 138px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Settings span
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Settings .ico
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage
- {
- text-align: center;
- height: 48px;
- line-height: 48px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage.button0
- {
- top: 147px;
- left: 240px;
- width: 150px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage.button1
- {
- top: 147px;
- left: 400px;
- width: 150px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Massage.button2
- {
- top: 147px;
- left: 560px;
- width: 150px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5Back
- {
- top: 280px;
- left: 45px;
- width: 200px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .concept1_5SettingsScreen
- {
- top: -60px;
- left: -112px;
- width: 800px;
- height: 345px;
- background: black;
- z-index: 100;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings .ico
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .btn-48
- {
- line-height: 48px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .show
- {
- visibility: visible !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView1_5 .hide
- {
- visibility: hidden;
-}
-
-/* END concept 1.5 */ /* BEGIN HMI concept 2.1 */
-#seatsMassageView2_1 .seatsMassageView2_1_seatLabel {
- top: 160px;
- left: 0px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#seatsMassageView2_1 .MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#seatsMassageView2_1 .control {
- width: 237px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .quality
- {
- width: 50px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .seats-message-actions
- {
- width: 250px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .delim-0
- {
- left: 48px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .delim-1
- {
- left: 98px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .delim-2
- {
- left: 148px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button0
- {
- left: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button1
- {
- left: 50px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button2
- {
- left: 100px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .button3
- {
- left: 150px;
- width: 100px;
-}
-
-#seatsMassageView2_1_settingsButton {
- width: 210px;
- left: 175px;
- top: 130px;
- line-height: 49px;
-}
-
-#seatsMassageView2_1_settingsButton .ico {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-11
- {
- top: 60px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-12
- {
- top: 105px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-13
- {
- top: 150px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-14
- {
- top: 210px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_1 .control-15
- {
- top: 255px;
- left: 370px;
-}
-
-#seatsMassageView2_1 #MultiContourSeat_customMassage .seats-message-1 {
- left: 150px;
- top: 107px;
-}
-
-#seatsMassageView2_1 #MultiContourSeat_customMassage .seats-message-2 {
- left: 150px;
- top: 234px;
-}
-
-#seatsMassageView2_1_upperLabel {
- top: 73px;
- left: 645px;
-}
-
-#seatsMassageView2_1_middleLabel {
- top: 117px;
- left: 645px;
-}
-
-#seatsMassageView2_1_lowerLabel {
- top: 162px;
- left: 645px;
-}
-
-#seatsMassageView2_1_frontLabel {
- top: 223px;
- left: 645px;
-}
-
-#seatsMassageView2_1_rearLabel {
- top: 266px;
- left: 645px;
-}
-
-/* END HMI concept 2.1 */ /* BEGIN HMI concept 2.2 */
-#seatsMassageView2_2 .MultiContourSeat_customMassage_previewButtonTop {
- top: 134px;
- left: 625px;
- width: 120px;
- text-align: center;
-}
-
-#seatsMassageView2_2 .MultiContourSeat_customMassage_previewButtonBottom
- {
- top: 282px;
- left: 625px;
- width: 120px;
- text-align: center;
-}
-
-#seatsMassageView2_2 .control {
- width: 240px;
- /*height: 28px;*/
-}
-
-#seatsMassageView2_2 .seatsMassageView2_2_seatLabel {
- top: 172px;
- left: 0px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .quality
- {
- width: 100px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .seats-message-actions
- {
- width: 200px;
- left: 198px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .delim-0
- {
- left: 98px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .button0
- {
- left: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .button1
- {
- left: 100px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-11
- {
- top: 80px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-12
- {
- top: 125px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-13
- {
- top: 170px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-14
- {
- top: 253px;
- left: 370px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView2_2 .control-15
- {
- top: 298px;
- left: 370px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-1 {
- left: 230px;
- top: 128px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-2 {
- left: 720px;
- top: 275px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-actions-3
- {
- top: 45px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-actions-4
- {
- top: 218px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .seats-message-actions
- {
- left: 358px;
- width: 265px;
- height: 28px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .quality {
- width: 50px;
- height: 28px;
- line-height: 29px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .delim {
- height: 28px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .delim-0 {
- left: 48px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .delim-1 {
- left: 98px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .delim-2 {
- left: 148px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .button0 {
- left: 0;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .button1 {
- left: 50px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .button2 {
- left: 100px;
-}
-
-#seatsMassageView2_2 #MultiContourSeat_customMassage .button3 {
- left: 150px;
- width: 115px;
-}
-
-#seatsMassageView2_2_upperLabel {
- top: 93px;
- left: 645px;
-}
-
-#seatsMassageView2_2_middleLabel {
- top: 138px;
- left: 645px;
-}
-
-#seatsMassageView2_2_lowerLabel {
- top: 182px;
- left: 645px;
-}
-
-#seatsMassageView2_2_frontLabel {
- top: 266px;
- left: 645px;
-}
-
-#seatsMassageView2_2_rearLabel {
- top: 310px;
- left: 645px;
-}
-
-#seatsMassageView2_2_settingsButton {
- width: 210px;
- left: 192px;
- top: 130px;
- line-height: 49px;
-}
-
-#seatsMassageView2_2_settingsButton .ico {
- float: left;
-}
-
-/* END HMI concept 2.2 */ /* BEGIN HMI concept 4.1 */
-#seatsMassageView4_1 .seatsMassageView4_1_seatLabel {
- top: 172px;
- left: 45px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#seatsMassageView4_1_settingsButton {
- width: 140px;
- left: 200px;
- top: 130px;
- line-height: 49px;
-}
-
-#seatsMassageView4_1_settingsButton .ico {
- float: left;
-}
-
-#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-actions
- {
- left: 280px;
-}
-
-#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-actions-3
- {
- top: 115px;
-}
-
-#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-actions-4
- {
- top: 205px;
-}
-
-#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-3 {
- right: 220px;
- top: 120px;
- width: 32px;
- height: 38px;
- background: url(../images/settings/seats-message.png) no-repeat;
-}
-
-#seatsMassageView4_1 #MultiContourSeat_customMassage .seats-message-4 {
- right: 220px;
- top: 210px;
- width: 32px;
- height: 38px;
- background: url(../images/settings/seats-message.png) no-repeat 0 -61px;
-}
-
-/* END HMI concept 4.1 */ /* BEGIN HMI concept 5.1 */
-#seatsMassageView5_1 .MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#seatsMassageView5_1 .seatsMassageView5_1_seatLabel {
- top: 187px;
- left: 0px;
- font-size: 24px;
- width: 140px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 #MultiContourSeat_customMassage_backButtonCenter
- {
- bottom: 0px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .lableToggleButton
- {
- height: 48px;
- border: 1px solid gray;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .lableToggleButton .btn-48
- {
- height: 46px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .lableToggleButton .lableToggle
- {
- line-height: 30px;
- margin-left: 10px;
- margin-top: 10px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer
- {
- width: 100px;
- margin: 0px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer .toggles
- {
- position: absolute;
- float: left;
- width: 50px;
- height: 28px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .seatsMassageView_settingsButton
- {
- width: 140px;
- left: 200px;
- top: 130px;
- line-height: 49px;
- text-align: left !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .seatsMassageView_settingsButton span
- {
- position: absolute;
- line-height: 50px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer span
- {
- position: absolute;
- width: 50px;
- margin-top: 0px;
- text-align: center;
- line-height: 28px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .seats-message-actions-3
- {
- left: 247px;
- margin-top: 10px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings
- {
- top: 200px;
- left: 197px;
- width: 138px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings span
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Settings .ico
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Massage
- {
- text-align: center;
- height: 48px;
- line-height: 48px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist {
- top: 76px;
- left: 139px;
- height: 251px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-content {
- width: 674px;
- border-right: none;
- border-top: none;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item:first-child,#seatsMassageView5_1 .MCSSettingslist .soundButton:first-child
- {
- border-top: 1px solid #393939;
- height: 48px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item {
- position: relative;
- width: 577px;
- float: left;
- height: 49px;
- border-bottom: 1px solid #393939;
- border-right: 1px solid #393939;
- line-height: 50px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item.soundButton {
- width: 48px;
- border-left: 1px solid #393939;
- margin-left: 10px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item.soundButton .ico {
- border: none;
- margin-top: 12px;
- margin-right: 11px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item.pressed {
- background: url(../images/phone/phone_button_bg_active.png) repeat-x
- !important;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item>span {
- margin-left: 13px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item .ico {
- float: right;
- border: 1px solid #393939;
- border-radius: 2px;
- margin-top: 9px;
- margin-right: 9px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .list-item.big-ico img {
- float: right;
- border: none;
- margin-top: 4px;
- margin-right: 9px;
-}
-
-#seatsMassageView5_1 .MCSSettingslist .toggles,#seatsMassageView5_1 .MCSSettingslist .toggles span
- {
- width: 148px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .MCSSettingslist .button1
- {
- left: 148px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .MCSSettingslist .delim
- {
- height: 29px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .MCSSettingslist .delim-0
- {
- left: 147px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer .button1
- {
- left: 50px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .toogleButtonContainer .delim-0
- {
- left: 48px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5Back
- {
- top: 280px;
- left: 45px;
- width: 200px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .concept1_5SettingsScreen
- {
- top: -60px;
- left: 154px;
- width: 291px;
- height: 345px;
- background: black;
- z-index: 100;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .btn-48
- {
- line-height: 48px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .show
- {
- visibility: visible !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView5_1 .hide
- {
- visibility: hidden;
-}
-
-/* END HMI concept 5.1 */ /* BEGIN HMI concept 5.2 */
-#seatsMassageView5_2_settingsButton {
- width: 140px;
- left: 200px;
- top: 130px;
- line-height: 49px;
-}
-
-#seatsMassageView5_2 .MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#seatsMassageView5_2 .seatsMassageView5_2_seatLabel {
- top: 160px;
- left: 0px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#seatsMassageView5_2_settingsButton .ico {
- float: left;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions
- {
- left: 275px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions-3
- {
- top: 90px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions-4
- {
- top: 190px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .quality {
- width: 50px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .seats-message-actions
- {
- width: 250px;
-}
-
-#MultiContourSeat_customMassage_5_2_topLabel {
- top: 65px;
- left: 275px;
- width: 250px;
- text-align: center;
-}
-
-#MultiContourSeat_customMassage_5_2_bottomLabel {
- top: 165px;
- left: 275px;
- width: 250px;
- text-align: center;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-0 {
- left: 48px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-1 {
- left: 98px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-2 {
- left: 148px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .delim-3 {
- left: 198px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .button0 {
- left: 0;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .button1 {
- left: 50px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .button2 {
- left: 100px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .button3 {
- left: 150px;
-}
-
-#seatsMassageView5_2 #MultiContourSeat_customMassage .button4 {
- left: 200px;
-}
-
-/* END HMI concept 5.2 */ /* BEGIN HMI concept 6.1 */
-#seatsMassageView6_1 #settingsScreen .seatsMassageView6_1_seatLabel {
- top: 13px;
- left: 600px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#seatsMassageView6_1 .mySettingsPopUpTitle {
- width: 143px;
- height: 25px;
- position: absolute;
- top: 163px;
- left: 216px !important;
- background: gray;
- text-align: center;
- line-height: 25px;
- font-size: 16px !important;
- font-weight: bold;
-}
-
-#seatsMassageView6_1 .mySettingsLabel {
- z-index: 100;
- left: 102px;
-}
-
-#seatsMassageView6_1 .MultiContourSeat_customMassage .btn-28.active {
- background: url(../images/common/btn-48h-active-gray.png) repeat-x
- !important;
-}
-
-#seatsMassageView6_1 #settingsScreen .durationButtons .quality,#seatsMassageView6_1 #settingsScreen .pauseButtons .quality
- {
- width: 60px;
-}
-
-#seatsMassageView6_1 #settingsScreen .quality {
- height: 35px;
- width: 130px;
- border: 1px solid #393939;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#seatsMassageView6_1 #settingsScreen .btn-28 {
- text-align: center;
- line-height: 34px;
-}
-
-#seatsMassageView6_1 .settingsScreen {
- width: 800px;
- height: 368px;
- top: -15px;
- background: black;
- visibility: hidden;
-}
-
-#seatsMassageView6_1 .settingsScreen2 {
- width: 800px;
- height: 368px;
- top: -15px;
- background: black;
- visibility: hidden;
-}
-
-#seatsMassageView6_1 #settingsScreen .seats-message-actions {
- height: 39px;
- border: none;
-}
-
-#seatsMassageView6_1 #settingsScreen .button0 {
- left: 0;
-}
-
-#seatsMassageView6_1 #settingsScreen .button1 {
- left: 140px;
-}
-
-#seatsMassageView6_1 #settingsScreen .button2 {
- left: 280px;
-}
-
-#seatsMassageView6_1 #settingsScreen .button3 {
- left: 420px;
-}
-
-#seatsMassageView6_1 #settingsScreen .durationButtons .button0,#seatsMassageView6_1 #settingsScreen .pauseButtons .button0
- {
- left: 0;
-}
-
-#seatsMassageView6_1 #settingsScreen .durationButtons .button1,#seatsMassageView6_1 #settingsScreen .pauseButtons .button1
- {
- left: 70px;
-}
-
-#seatsMassageView6_1 #settingsScreen .durationButtons .button2,#seatsMassageView6_1 #settingsScreen .pauseButtons .button2
- {
- left: 140px;
-}
-
-#seatsMassageView6_1 #settingsScreen .durationButtons .button3,#seatsMassageView6_1 #settingsScreen .pauseButtons .button3
- {
- left: 210px;
-}
-
-#seatsMassageView6_1 #settingsScreen .durationButtons .button4,#seatsMassageView6_1 #settingsScreen .pauseButtons .button4
- {
- left: 280px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-11
- {
- top: 60px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-12
- {
- top: 105px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-13
- {
- top: 150px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-14
- {
- top: 230px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .control-15
- {
- top: 275px;
- left: 350px;
-}
-
-#seatsMassageView6_1 #settingsScreen2 .seats-message-1 {
- left: 280px;
- top: 110px;
-}
-
-#seatsMassageView6_1 #settingsScreen2 .seats-message-2 {
- left: 280px;
- top: 252px;
-}
-
-#seatsMassageView6_1 .seatsMassageView6_1_seatLabel {
- top: 172px;
- left: 45px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#seatsMassageView6_1 .MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#seatsMassageView6_1 .seatsMassageView6_1_upperLabel {
- top: 73px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_1 .seatsMassageView6_1_middleLabel {
- top: 118px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_1 .seatsMassageView6_1_lowerLabel {
- top: 163px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_1 .seatsMassageView6_1_frontLabel {
- top: 243px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_1 .seatsMassageView6_1_rearLabel {
- top: 287px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_1 .label {
- font-size: 26px;
- left: 20px;
-}
-
-#seatsMassageView6_1 .massageLabel {
- top: 51px;
-}
-
-#seatsMassageView6_1 .pattern {
- top: 91px;
-}
-
-#seatsMassageView6_1 .intensity {
- top: 131px;
-}
-
-#seatsMassageView6_1 .speed {
- top: 211px;
-}
-
-#seatsMassageView6_1 .duration {
- top: 251px;
-}
-
-#seatsMassageView6_1 .pause {
- top: 291px;
-}
-
-#seatsMassageView6_1 .editMenu {
- left: 70px;
- width: 240px;
- top: 12px;
- text-align: center;
-}
-
-#seatsMassageView6_1 .massageButtons {
- top: 50px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_1 .massageButtons img {
- height: 34px;
-}
-
-#seatsMassageView6_1 .patternButtons {
- top: 90px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_1 .intensityButtons {
- top: 130px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_1 .intensityEditCustom {
- top: 170px;
- left: 520px;
- width: 270px;
- height: 34px;
-}
-
-#seatsMassageView6_1 .speedButtons {
- top: 210px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_1 .durationButtons {
- top: 250px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_1 .pauseButtons {
- top: 290px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_1 .preview {
- top: 330px;
- left: 289px;
- width: 214px;
- height: 34px;
-}
-
-#seatsMassageView6_1 .MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#seatsMassageView6_1 .settingsScreen2 .MultiContourSeat_customMassage_caption
- {
- top: 14px;
-}
-
-#seatsMassageView6_1 .SettingsBlocks {
- margin-left: auto;
- margin-right: auto;
- width: 315px;
- height: 50px;
- position: relative;
- -webkit-transition: width 1s;
-}
-
-#seatsMassageView6_1 .MultiContourSeat_customMassage {
- visibility: hidden;
- background-color: #000;
- z-index: 200;
- width: 800px;
- height: 345px;
- position: absolute;
- top: -60px;
- left: -112px;
- background-image: url('../images/settings/mcsBlockBackArrow6_1.png');
- background-position: 339px 39px;
- background-repeat: no-repeat;
-}
-
-#seatsMassageView6_1 .btn-48 {
- line-height: 48px;
- text-align: center;
-}
-
-#seatsMassageView6_1 .show {
- visibility: visible !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonUp
- {
- width: 200px;
- left: 560px;
- top: 101px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonDown
- {
- width: 200px;
- left: 560px;
- bottom: 143px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonEdit
- {
- width: 250px;
- left: 275px;
- bottom: 40px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonNew
- {
- width: 100px;
- left: 275px;
- bottom: 0px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButtonTrash
- {
- width: 140px;
- left: 385px;
- bottom: 0px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsBlock
- {
- width: 220px;
- top: 130px;
- text-align: center !important;
- transition: 1s;
- -webkit-transition: top 1s; /* Safari and Chrome */
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButton
- {
- width: 159px;
- left: 154px;
- top: 205px;
- line-height: 49px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButton2
- {
- width: 50px;
- left: 365px;
- top: 205px;
- line-height: 49px;
- text-align: left !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .seatsMassageView_settingsButton3
- {
- width: 50px;
- left: 403px;
- top: 130px;
- line-height: 49px;
- text-align: left !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .hide
- {
- visibility: hidden;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_1 .captionMySettings
- {
- top: 157px;
- left: 138px;
- width: 300px;
- height: 90px;
- border: 1px solid;
- padding: 8px 13px 13px 13px;
- font-size: 26px;
-}
-
-/* END HMI concept 6.1 */ /* BEGIN HMI concept 6.2 */
-#seatsMassageView6_2 #settingsScreen .seatsMassageView6_2_seatLabel {
- top: 13px;
- left: 600px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#seatsMassageView6_2 .MultiContourSeat_customMassage .seatsMassageView6_2_seatLabel_custom
- {
- top: 60px;
- left: 300px !important;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButton
- {
- width: 159px;
- left: 154px;
- top: 205px;
- line-height: 49px;
- z-index: 1;
-}
-
-#seatsMassageView6_2 .mySettingsPopUpTitle {
- width: 143px;
- height: 25px;
- position: absolute;
- top: 163px;
- left: 216px !important;
- background: gray;
- text-align: center;
- line-height: 25px;
- font-size: 16px !important;
- font-weight: bold;
-}
-
-#seatsMassageView6_2 .mySettingsLabel {
- z-index: 100;
- left: 102px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .captionMySettings
- {
- top: 157px;
- left: 138px;
- width: 300px;
- height: 90px;
- border: 1px solid;
- padding: 8px 13px 13px 13px;
- font-size: 26px;
-}
-
-#seatsMassageView6_2 #settingsScreen .durationButtons .quality,#seatsMassageView6_2 #settingsScreen .pauseButtons .quality
- {
- width: 60px;
-}
-
-#seatsMassageView6_2 #settingsScreen .quality {
- height: 35px;
- width: 130px;
- border: 1px solid #393939;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-}
-
-#seatsMassageView6_2 #settingsScreen .btn-28 {
- text-align: center;
- line-height: 34px;
-}
-
-#seatsMassageView6_2 .settingsScreen {
- width: 800px;
- height: 368px;
- top: -15px;
- background: black;
- visibility: hidden;
-}
-
-#seatsMassageView6_2 .settingsScreen2 {
- width: 800px;
- height: 368px;
- top: -15px;
- background: black;
- visibility: hidden;
-}
-
-#seatsMassageView6_2 #settingsScreen .seats-message-actions {
- height: 39px;
- border: none;
-}
-
-#seatsMassageView6_2 #settingsScreen .button0 {
- left: 0;
-}
-
-#seatsMassageView6_2 #settingsScreen .button1 {
- left: 140px;
-}
-
-#seatsMassageView6_2 #settingsScreen .button2 {
- left: 280px;
-}
-
-#seatsMassageView6_2 #settingsScreen .button3 {
- left: 420px;
-}
-
-#seatsMassageView6_2 #settingsScreen .durationButtons .button0,#seatsMassageView6_2 #settingsScreen .pauseButtons .button0
- {
- left: 0;
-}
-
-#seatsMassageView6_2 #settingsScreen .durationButtons .button1,#seatsMassageView6_2 #settingsScreen .pauseButtons .button1
- {
- left: 70px;
-}
-
-#seatsMassageView6_2 #settingsScreen .durationButtons .button2,#seatsMassageView6_2 #settingsScreen .pauseButtons .button2
- {
- left: 140px;
-}
-
-#seatsMassageView6_2 #settingsScreen .durationButtons .button3,#seatsMassageView6_2 #settingsScreen .pauseButtons .button3
- {
- left: 210px;
-}
-
-#seatsMassageView6_2 #settingsScreen .durationButtons .button4,#seatsMassageView6_2 #settingsScreen .pauseButtons .button4
- {
- left: 280px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-11
- {
- top: 60px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-12
- {
- top: 105px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-13
- {
- top: 150px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-14
- {
- top: 230px;
- left: 350px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .control-15
- {
- top: 275px;
- left: 350px;
-}
-
-#seatsMassageView6_2 #settingsScreen2 .seats-message-1 {
- left: 280px;
- top: 110px;
-}
-
-#seatsMassageView6_2 #settingsScreen2 .seats-message-2 {
- left: 280px;
- top: 252px;
-}
-
-#seatsMassageView6_2 .seatsMassageView6_2_seatLabel {
- top: 172px;
- left: 45px;
- font-size: 24px;
- width: 199px;
- text-align: center;
-}
-
-#seatsMassageView6_2 .MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#seatsMassageView6_2 .seatsMassageView6_2_upperLabel {
- top: 73px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_2 .seatsMassageView6_2_middleLabel {
- top: 118px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_2 .seatsMassageView6_2_lowerLabel {
- top: 163px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_2 .seatsMassageView6_2_frontLabel {
- top: 243px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_2 .seatsMassageView6_2_rearLabel {
- top: 287px;
- left: 615px !important;
- font-size: 18px !important;
-}
-
-#seatsMassageView6_2 .label {
- font-size: 26px;
- left: 20px;
-}
-
-#seatsMassageView6_2 .massageLabel {
- top: 51px;
-}
-
-#seatsMassageView6_2 .pattern {
- top: 91px;
-}
-
-#seatsMassageView6_2 .intensity {
- top: 131px;
-}
-
-#seatsMassageView6_2 .speed {
- top: 211px;
-}
-
-#seatsMassageView6_2 .duration {
- top: 251px;
-}
-
-#seatsMassageView6_2 .pause {
- top: 291px;
-}
-
-#seatsMassageView6_2 .editMenu {
- width: 240px;
- top: 12px;
- text-align: center;
- left: 70px;
-}
-
-#seatsMassageView6_2 .massageButtons {
- top: 50px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_2 .massageButtons img {
- height: 34px;
-}
-
-#seatsMassageView6_2 .patternButtons {
- top: 90px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_2 .intensityButtons {
- top: 130px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_2 .intensityEditCustom {
- top: 170px;
- left: 520px;
- width: 270px;
- height: 34px;
-}
-
-#seatsMassageView6_2 .speedButtons {
- top: 210px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_2 .durationButtons {
- top: 250px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_2 .pauseButtons {
- top: 290px;
- left: 240px;
- width: 560px;
-}
-
-#seatsMassageView6_2 .preview {
- top: 330px;
- left: 289px;
- width: 214px;
- height: 34px;
-}
-
-#seatsMassageView6_2 .settingsScreen2 .MultiContourSeat_customMassage_caption
- {
- top: 14px;
-}
-
-#seatsMassageView6_2 .MultiContourSeat_customMassage_caption {
- width: 600px;
- height: 28px;
- line-height: 29px;
- left: 74px;
- font-size: 26px;
-}
-
-#seatsMassageView6_2 .SettingsBlocks {
- margin-left: auto;
- margin-right: auto;
- width: 315px;
- height: 50px;
- position: relative;
- -webkit-transition: width 1s;
-}
-
-#seatsMassageView6_2 .MultiContourSeat_customMassage {
- visibility: hidden;
- background-color: #000;
- z-index: 200;
- width: 800px;
- height: 345px;
- position: absolute;
- top: -60px;
- left: -112px;
- background-image: url('../images/settings/mcsBlockBackArrow6_2.png');
- background-position: 39px 145px;
- background-repeat: no-repeat;
-}
-
-#seatsMassageView6_2 .btn-48 {
- line-height: 48px;
- text-align: center;
-}
-
-#seatsMassageView6_2 .show {
- visibility: visible !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButtonNew
- {
- width: 100px;
- left: 270px;
- bottom: 20px;
- line-height: 49px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButtonTrash
- {
- width: 71px;
- left: 446px;
- bottom: 5px;
- line-height: 49px;
- height: 78px;
- background-image: url("../images/settings/trash.png");
- background-repeat: no-repeat;
- background-size: contain;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButtonSave
- {
- width: 100px;
- left: 480px;
- bottom: 20px;
- line-height: 49px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsBlock
- {
- width: 100px;
- top: 130px;
- line-height: 49px;
- text-align: center !important;
- transition: left 1s;
- -webkit-transition: left 1s; /* Safari and Chrome */
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButton2
- {
- width: 50px;
- left: 365px;
- top: 205px;
- line-height: 49px;
- text-align: left !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .seatsMassageView_settingsButton3
- {
- width: 50px;
- left: 403px;
- top: 130px;
- line-height: 49px;
- text-align: left !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView6_2 .hide
- {
- visibility: hidden;
-}
-
-/* END HMI concept 6.2 */ /* BEGIN HMI concept 7.1 */
-#seatsMassageView7_1_appendix .localBack {
- background: url(../images/common/page-back-button.png) no-repeat center
- 12px, url(../images/common/btn-48h.png);
- width: 48px;
- z-index: 5000;
- left: 5px;
- top: 59px;
- visibility: hidden;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .seatsMassageView_settingsButton2
- {
- width: 50px;
- left: 365px;
- top: 205px;
- line-height: 49px;
- text-align: left !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .seatsMassageView_settingsButton
- {
- width: 159px;
- left: 154px;
- top: 205px;
- line-height: 49px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .captionMySettings
- {
- top: 157px;
- left: 138px;
- width: 300px;
- height: 90px;
- border: 1px solid;
- padding: 8px 13px 13px 13px;
- font-size: 26px;
-}
-
-#seatsMassageView7_1 .mySettingsPopUpTitle {
- width: 143px;
- height: 25px;
- position: absolute;
- top: 163px;
- left: 216px !important;
- background: gray;
- text-align: center;
- line-height: 25px;
- font-size: 16px !important;
- font-weight: bold;
-}
-
-#seatsMassageView7_1 .mySettingsLabel {
- z-index: 100;
- left: 102px;
-}
-
-#seatsMassageView7_1_appendix .btn-48 {
- line-height: 48px;
- text-align: center;
-}
-
-#seatsMassageView7_1_appendix .seats-message-actions-3 {
- top: 165px;
- left: 59px;
-}
-
-#seatsMassageView7_1_appendix .show {
- visibility: visible !important;
-}
-
-#seatsMassageView7_1_appendix {
- z-index: 2003;
-}
-
-#seatsMassageView7_1_appendix .SeatsMassageDialogView {
- visibility: hidden;
- background-color: whiteSmoke;
- width: 350px;
- height: 368px;
- position: absolute;
- top: 56px;
- left: 305px !important;
- background: black;
- border: #A6A6A6 solid 2px;
- border-radius: 6px;
- font-size: 18px;
- font-family: Arial;
-}
-
-#seatsMassageView7_1_appendix .titleQuestion {
- font-size: 21px;
- font-family: Arial;
- width: 350px;
- text-align: center;
- top: 25px;
-}
-
-#seatsMassageView7_1_appendix .question {
- font-size: 18px;
- font-family: Arial;
- width: 350px;
- text-align: center;
- top: 65px;
-}
-
-#seatsMassageView7_1_appendix .titleAnswer {
- font-size: 21px;
- font-family: Arial;
- width: 350px;
- text-align: center;
- top: 103px;
-}
-
-#seatsMassageView7_1_appendix .View1 .seats-message-actions-3 {
- top: 194px;
- left: 7px;
-}
-
-#seatsMassageView7_1_appendix .View1 .titleQuestion {
- left: 0px;
- width: 500px;
- top: 40px;
-}
-
-#seatsMassageView7_1_appendix .View1 .question {
- left: 0px;
- top: 90px;
- text-align: center;
- width: 500px;
-}
-
-#seatsMassageView7_1_appendix .View1 .titleAnswer {
- left: 0px;
- width: 500px;
- top: 134px;
-}
-
-#seatsMassageView7_1_appendix .View1 .button0 {
- left: 0;
- top: 0 !important;
-}
-
-#seatsMassageView7_1_appendix .View1 .button1 {
- left: 0;
- top: 45px !important;
-}
-
-#seatsMassageView7_1_appendix .View1 .button2 {
- left: 0;
- top: 90px !important;
-}
-
-#seatsMassageView7_1_appendix .View1 .button3 {
- left: 258px !important;
- top: 0px !important;
-}
-
-#seatsMassageView7_1_appendix .View1 .button4 {
- left: 258px !important;
- top: 45px !important;
-}
-
-#seatsMassageView7_1_appendix .View1 .button5 {
- left: 258px !important;
- top: 90px !important;
-}
-
-#seatsMassageView7_1_appendix .View1 .btn-48 {
- height: 35px !important;
- line-height: 35px !important;
-}
-
-#seatsMassageView7_1_appendix .seatsMassageDialogView4 {
- visibility: hidden;
- font-size: 26px !important;
- font-family: Arial;
- font-size: 18px;
- font-family: Arial;
- left: 300px;
- top: 140px;
- width: 232px;
- height: 127px;
- background: white;
- border-radius: 6px;
- border: 1px solid gray;
- color: black;
- text-align: center;
- padding: 10px;
-}
-
-#seatsMassageView7_1_appendix .seatsMassageDialogView5 {
- visibility: hidden;
- font-size: 26px !important;
- font-family: Arial;
- font-size: 18px;
- font-family: Arial;
- left: 300px;
- top: 132px;
- width: 326px;
- height: 165px;
- background: white;
- border-radius: 6px;
- border: 1px solid gray;
- color: black;
- text-align: center;
- padding: 10px;
-}
-
-#seatsMassageView7_1_appendix .SeatsMassageDialogView.View1 {
- visibility: hidden;
- background-color: whiteSmoke;
- width: 520px;
- height: 368px;
- position: absolute;
- top: 56px;
- left: 265px !important;
- background: black;
- border: #A6A6A6 solid 2px;
- border-radius: 6px;
-}
-
-#seatsMassageView7_1_appendix .SeatsMassageDialogView .button0 {
- left: 0;
- top: 0;
-}
-
-#seatsMassageView7_1_appendix .SeatsMassageDialogView .button1 {
- left: 0;
- top: 60px;
-}
-
-#seatsMassageView7_1_appendix .SeatsMassageDialogView .button2 {
- left: 0;
- top: 120px;
-}
-
-#seatsMassageView7_1_appendix .SeatsMassageDialogView .button3 {
- left: 0;
- top: 180px;
-}
-
-#seatsMassageView7_1_appendix .SeatsMassageDialogView .button {
- width: 245px;
- border-radius: 3px;
- border: 1px solid #393939;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Settings
- {
- top: 200px;
- left: 197px;
- width: 138px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Settings span
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Settings .ico
- {
- float: left;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5Massage
- {
- text-align: center;
- height: 48px;
- line-height: 48px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .toogleButtonContainer .button1
- {
- left: 50px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .toogleButtonContainer .delim-0
- {
- left: 48px;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .concept1_5SettingsScreen
- {
- top: -60px;
- left: 154px;
- width: 291px;
- height: 345px;
- background: black;
- z-index: 100;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .btn-48
- {
- line-height: 48px;
- text-align: center;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .show
- {
- visibility: visible !important;
-}
-
-#view_settings_vehicle_MultiContourSeat_Adjust #seatsMassageView7_1 .hide
- {
- visibility: hidden;
-}
-
-/* END HMI concept 7.1 */ /* lumbars */ /* driver */
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion1 .active {
- background: url(../images/settings/TopLumbar_WhiteOutline_driver.png)
- no-repeat;
- width: 38px;
- height: 29px;
- top: 70px;
- left: 22px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion2 .active {
- background: url(../images/settings/MiddleLumbar_WhiteOutline_driver.png)
- no-repeat;
- width: 34px;
- height: 30px;
- top: 84px;
- left: 18px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion3 .active {
- background: url(../images/settings/LowerLumbar_WhiteOutline_driver.png)
- no-repeat;
- width: 33px;
- height: 36px;
- top: 99px;
- left: 14px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion4 .active {
- background: url(../images/settings/lumbar_cushion_top-active.png)
- no-repeat;
- width: 70px;
- height: 70px;
- top: 71px;
- left: -2px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion5 .active {
- background: url(../images/settings/lumbar_cushion_bot-active.png)
- no-repeat;
- width: 91px;
- height: 59px;
- top: 112px;
- left: -37px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion6 .active {
- background: url(../images/settings/whiteOutline_driver-lumbar-all.png)
- no-repeat;
- width: 47px;
- height: 68px;
- top: 70px;
- left: 16px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion7 .active {
- background: url(../images/settings/Cushion_WhiteOutline_driver.png)
- no-repeat;
- width: 74px;
- height: 36px;
- top: 119px;
- left: -32px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion1 .lumbar {
- background: url(../images/settings/driver-lumbar-top.png) no-repeat;
- width: 36px;
- height: 31px;
- top: 69px;
- left: 22px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion2 .lumbar {
- background: url(../images/settings/driver-lumbar-mid.png) no-repeat;
- width: 34px;
- height: 31px;
- top: 84px;
- left: 17px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion3 .lumbar {
- background: url(../images/settings/driver-lumbar-low.png) no-repeat;
- width: 31px;
- height: 35px;
- top: 99px;
- left: 15px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion4 .lumbar {
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat_adj1.png)
- no-repeat;
- width: 70px;
- height: 70px;
- top: 68px;
- left: -4px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion5 .lumbar {
- background: url(../images/settings/lumbar_cushion.png) no-repeat;
- width: 91px;
- height: 59px;
- top: 111px;
- left: -36px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion6 .lumbar {
- background: url(../images/settings/driver-lumbar-all.png) no-repeat;
- width: 47px;
- height: 68px;
- top: 68px;
- left: 12px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_driverSeat_cushion7 .lumbar {
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat_adj2.png)
- no-repeat;
- width: 73px;
- height: 37px;
- top: 119px;
- left: -30px;
- opacity: 0;
-}
-
-/* passenger */
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion1 .active {
- background: url(../images/settings/TopLumbar_WhiteOutline_passenger.png)
- no-repeat;
- width: 38px;
- height: 29px;
- top: 70px;
- left: 541px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion2 .active {
- background:
- url(../images/settings/MiddleLumbar_WhiteOutline_passenger.png)
- no-repeat;
- width: 34px;
- height: 30px;
- top: 84px;
- left: 549px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion3 .active {
- background:
- url(../images/settings/LowerLumbar_WhiteOutline_passenger.png)
- no-repeat;
- width: 33px;
- height: 36px;
- top: 99px;
- left: 555px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion4 .active {
- background:
- url(../images/settings/lumbar_cushion_top_passenger-active.png)
- no-repeat;
- width: 70px;
- height: 70px;
- top: 71px;
- left: 535px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion5 .active {
- background:
- url(../images/settings/lumbar_cushion_bot_passanger-active.png)
- no-repeat;
- width: 91px;
- height: 59px;
- top: 112px;
- left: 546px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion6 .active {
- background:
- url(../images/settings/WhiteOutline_passenger-lumbar-all.png)
- no-repeat;
- width: 47px;
- height: 68px;
- top: 70px;
- left: 544px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion7 .active {
- background: url(../images/settings/Cushion_WhiteOutline_passenger.png)
- no-repeat;
- width: 74px;
- height: 36px;
- top: 120px;
- left: 558px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion1 .lumbar {
- background: url(../images/settings/passenger-lumbar-top.png) no-repeat;
- width: 37px;
- height: 31px;
- top: 68px;
- left: 542px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion2 .lumbar {
- background: url(../images/settings/passenger-lumbar-mid.png) no-repeat;
- width: 34px;
- height: 31px;
- top: 84px;
- left: 550px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion3 .lumbar {
- background: url(../images/settings/passenger-lumbar-low.png) no-repeat;
- width: 32px;
- height: 35px;
- top: 99px;
- left: 555px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion4 .lumbar {
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat_adj1_passenger.png)
- no-repeat;
- width: 69px;
- height: 69px;
- top: 70px;
- left: 535px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion5 .lumbar {
- background: url(../images/settings/passenger_lumbar_cushion.png)
- no-repeat;
- width: 91px;
- height: 59px;
- top: 111px;
- left: 546px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion6 .lumbar {
- background: url(../images/settings/passenger-lumbar-all.png) no-repeat;
- width: 47px;
- height: 68px;
- top: 68px;
- left: 540px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_passengerSeat_cushion7 .lumbar {
- background:
- url(../images/settings/view_settings_vehicle_MultiContourSeat_adj2_passenger.png)
- no-repeat;
- width: 72px;
- height: 37px;
- top: 119px;
- left: 559px;
- opacity: 0;
-}
-
-/* CUSTOM MASSAGE */ /* Driver cushions */
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion6 .active
- {
- background: url(../images/settings/TopLumbar_WhiteOutline_driver.png)
- no-repeat;
- width: 38px;
- height: 29px;
- top: 70px;
- left: 22px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion7 .active
- {
- background: url(../images/settings/MiddleLumbar_WhiteOutline_driver.png)
- no-repeat;
- width: 34px;
- height: 30px;
- top: 84px;
- left: 18px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion8 .active
- {
- background: url(../images/settings/LowerLumbar_WhiteOutline_driver.png)
- no-repeat;
- width: 33px;
- height: 36px;
- top: 99px;
- left: 14px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion9 .active
- {
- background: url(../images/settings/driver-lumbar-m-top-selected.png)
- no-repeat;
- width: 77px;
- height: 41px;
- top: 119px;
- left: -30px;
- z-index: 1;
- opacity: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion10 .active
- {
- background: url(../images/settings/driver-lumbar-m-bottom-selected.png)
- no-repeat;
- width: 77px;
- height: 41px;
- top: 119px;
- left: -30px;
- z-index: 1;
- opacity: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion6 .lumbar
- {
- background: url(../images/settings/driver-lumbar-top.png) no-repeat;
- width: 36px;
- height: 31px;
- top: 69px;
- left: 22px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion7 .lumbar
- {
- background: url(../images/settings/driver-lumbar-mid.png) no-repeat;
- width: 34px;
- height: 31px;
- top: 84px;
- left: 17px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion8 .lumbar
- {
- background: url(../images/settings/driver-lumbar-low.png) no-repeat;
- width: 31px;
- height: 35px;
- top: 99px;
- left: 15px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion9 .lumbar
- {
- background: url(../images/settings/driver-lumbar-m-top.png) no-repeat;
- width: 73px;
- height: 37px;
- top: 119px;
- left: -30px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_driverSeat_cushion10 .lumbar
- {
- background: url(../images/settings/driver-lumbar-m-bottom.png) no-repeat;
- width: 73px;
- height: 37px;
- top: 119px;
- left: -30px;
- opacity: 0;
-}
-
-/* Passenger cushions */
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion6 .active
- {
- background: url(../images/settings/TopLumbar_WhiteOutline_passenger.png)
- no-repeat;
- width: 38px;
- height: 29px;
- top: 70px;
- left: 541px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion7 .active
- {
- background:
- url(../images/settings/MiddleLumbar_WhiteOutline_passenger.png)
- no-repeat;
- width: 34px;
- height: 30px;
- top: 84px;
- left: 549px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion8 .active
- {
- background:
- url(../images/settings/LowerLumbar_WhiteOutline_passenger.png)
- no-repeat;
- width: 33px;
- height: 36px;
- top: 99px;
- left: 555px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion9 .active
- {
- background: url(../images/settings/passenger-lumbar-m-top-selected.png)
- no-repeat;
- width: 77px;
- height: 41px;
- top: 120px;
- left: 558px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion10 .active
- {
- background:
- url(../images/settings/passenger-lumbar-m-bottom-selected.png)
- no-repeat;
- width: 77px;
- height: 41px;
- top: 120px;
- left: 558px;
- z-index: 1;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion6 .lumbar
- {
- background: url(../images/settings/passenger-lumbar-top.png) no-repeat;
- width: 36px;
- height: 31px;
- top: 70px;
- left: 541px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion7 .lumbar
- {
- background: url(../images/settings/passenger-lumbar-mid.png) no-repeat;
- width: 34px;
- height: 31px;
- top: 84px;
- left: 549px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion8 .lumbar
- {
- background: url(../images/settings/passenger-lumbar-low.png) no-repeat;
- width: 31px;
- height: 35px;
- top: 99px;
- left: 555px;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion9 .lumbar
- {
- background: url(../images/settings/passenger-lumbar-m-top.png) no-repeat;
- width: 77px;
- height: 41px;
- top: 120px;
- left: 558px;;
- opacity: 0;
-}
-
-#view_settings_vehicle_MultiContourSeat_customMassage_passengerSeat_cushion10 .lumbar
- {
- background: url(../images/settings/passenger-lumbar-m-bottom.png)
- no-repeat;
- width: 77px;
- height: 41px;
- top: 120px;
- left: 558px;
- opacity: 0;
-} \ No newline at end of file
diff --git a/src/components/HMI/css/media.css b/src/components/HMI/css/media.css
deleted file mode 100644
index 85688d5e6b..0000000000
--- a/src/components/HMI/css/media.css
+++ /dev/null
@@ -1,528 +0,0 @@
-#media_leftmenu {
- z-index: 301;
- position: absolute;
- top: 90px;
- left: 0px;
- width: 150px;
- height: 300px;
- background: #333;
-}
-
-#media_cdButton {
- font-size: 18px;
- padding-left: 48px;
- line-height: 48px;
-}
-
-#media_sdlButton {
- font-size: 18px;
- line-height: 48px;
- display: block;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#media_sdlButton span {
- margin-left: 50px;
-}
-
-#media_status {
- bottom: 0px;
- left: 0px;
- font-size: 21px;
- width: 324px;
- height: 48px;
- cursor: pointer;
- background: url(../images/common/media-status-bg.png) no-repeat;
- z-index: 1;
-}
-
-#media_status_homestatus {
- position: absolute;
- visibility: hidden;
- width: 100%;
- line-height: 50px;
-}
-
-#media_status_homestatus span {
- padding-left: 11px;
-}
-
-.ls_border {
- z-index: 201;
- position: absolute;
- top: -3px;
- left: 0px;
- width: 153px;
- height: 306px;
- background: url(../images/common/ls_border.png) no-repeat;
-}
-
-.media-ls-items {
- position: relative;
- width: 150px;
- height: 300px;
-}
-
-.media-ls-item {
- z-index: 201;
- position: relative;
- height: 50px;
- cursor: pointer;
- background: url(../images/media/ls-item_bg.png) no-repeat;
-}
-
-.media-ls-item.active_state {
- background: url(../images/media/ls-item_bg_act.png) no-repeat !important;
-}
-
-.media-ls-item>.bg {
- z-index: 201;
- position: absolute;
- top: 0px;
- left: 0px;
- width: 150px;
- height: 50px;
-}
-
-.media-ls-item>.ico {
- z-index: 299;
- position: absolute;
- left: 0px;
- width: 50px;
- height: 50px;
-}
-
-.media-ls-item>.ico.more {
- left: 50px;
-}
-
-.media-ls-item>p {
- z-index: 298;
- position: absolute;
- left: 48px;
- width: 86px;
- height: 50px;
- font-size: 18px;
- line-height: 50px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.media-ls-item>.led {
- z-index: 299;
- position: absolute;
- top: 0px;
- right: 8px;
- width: 24px;
- height: 50px;
-}
-
-.media-ls-item.empty {
- background: #333333;
-}
-
-.main-preset-buttons-wraper {
- position: relative;
- width: 468px;
- height: 100px;
- float: left;
- left: 165px;
- top: 290px;
- z-index: 503;
-}
-
-.main-preset-buttons-wraper .preset-items {
- position: relative;
- width: 467px;
- height: 99px;
- border: 1px solid #393939;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- z-index: 1;
-}
-
-.main-preset-buttons-wraper .preset-item {
- position: relative;
- display: inline-block;
- vertical-align: top;
- border-right: 1px solid #393939;
- border-bottom: 1px solid #393939;
- width: 92.6px;
- height: 49px;
- cursor: pointer;
-}
-
-.main-preset-buttons-wraper .preset-item.a0 {
- background: url(../images/media/bcs-item_bgL.png) no-repeat;
- border-right: 1px solid #393939;
- border-bottom: 1px solid #393939;
-}
-
-.main-preset-buttons-wraper .preset-item.a0.pressed {
- background: url(../images/media/bcs-item_bgL_pressed.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a0.active {
- background: url(../images/media/bcs-item_bg_act.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a1 {
- background: url(../images/media/bcs-item_bgS.png) no-repeat;
- border-right: 1px solid #393939;
- border-bottom: 1px solid #393939;
- width: 157px;
-}
-
-.main-preset-buttons-wraper .preset-item.a1.pressed {
- background: url(../images/media/bcs-item_bgS_pressed.png) no-repeat;
- width: 157px;
-}
-
-.main-preset-buttons-wraper .preset-item.a1.active {
- background: url(../images/media/bcs-item_bg_act.png) repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a2 {
- background: url(../images/media/bcs-item_bgR.png) no-repeat;
- border-bottom: 1px solid #393939;
- width: 153px;
-}
-
-.main-preset-buttons-wraper .preset-item.a2.pressed {
- background: url(../images/media/bcs-item_bgR_pressed.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a2.active {
- background: url(../images/media/bcs-item_bg_act.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a3 {
- background: url(../images/media/bcs-item_bgL.png) no-repeat;
- border-right: 1px solid #393939;
-}
-
-.main-preset-buttons-wraper .preset-item.a3.pressed {
- background: url(../images/media/bcs-item_bgL_pressed.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a3.active {
- background: url(../images/media/bcs-item_bg_act.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a4 {
- background: url(../images/media/bcs-item_bgS.png) no-repeat;
- border-right: 1px solid #393939;
- width: 157px;
-}
-
-.main-preset-buttons-wraper .preset-item.a4.pressed {
- background: url(../images/media/bcs-item_bgS_pressed.png) no-repeat;
- width: 157px;
-}
-
-.main-preset-buttons-wraper .preset-item.a4.active {
- background: url(../images/media/bcs-item_bg_act.png) repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a5 {
- background: url(../images/media/bcs-item_bgR.png) no-repeat;
- width: 153px;
-}
-
-.main-preset-buttons-wraper .preset-item.a5.pressed {
- background: url(../images/media/bcs-item_bgR_pressed.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item.a5.active {
- background: url(../images/media/bcs-item_bg_act.png) no-repeat;
-}
-
-.main-preset-buttons-wraper .preset-item>.bg {
- z-index: 201;
- position: absolute;
- top: 0px;
- left: 0px;
- width: 155px;
- height: 49px;
-}
-
-.main-preset-buttons-wraper .preset-item>span {
- z-index: 202;
- display: block;
- position: absolute;
- left: 10px;
- width: 30px;
- height: 50px;
- font-size: 32px;
- line-height: 50px;
- white-space: nowrap;
- overflow: hidden;
- color: #999;
-}
-
-.main-preset-buttons-wraper .preset-item>p {
- z-index: 202;
- position: absolute;
- left: 40px;
- width: 100px;
- height: 50px;
- font-size: 18px;
- line-height: 50px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.home-preset-buttons-wraper {
- top: 82px;
- left: 34px;
- z-index: 50;
-}
-
-.home-preset-buttons-wraper .preset-items {
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
- border: 1px solid #393939;
- width: 328px;
- height: 79px;
-}
-
-.bc-item2>p {
- z-index: 202;
- position: absolute;
- left: 40px;
- width: 100px;
- height: 50px;
- font-size: 18px;
- line-height: 50px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-.bc-item-big {
- position: relative;
- float: left;
- width: 156px;
- height: 100px;
- line-height: 100px;
- text-align: center;
- font-size: 20px;
-}
-
-.bc-item-big.prevcd,.bc-item-big.prevusb,.bc-item-big.prevsd,.bc-item-big.prevblue
- {
- width: 155px;
- height: 98px;
- border-right: 1px solid #393939;
- cursor: pointer;
- 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: 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: url(../images/media/cd_play_btn.png) no-repeat;
-}
-
-.playIcon {
- position: absolute;
- left: 66px;
-}
-
-.playIcon.hideicon {
- visibility: hidden;
-}
-
-.playIcon.showicon {
- visibility: visible;
-}
-
-.bc-item-big.playcd.pressed,.bc-item-big.playusb.pressed,.bc-item-big.playsd.pressed,.bc-item-big.playblue.pressed
- {
- 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
- {
- width: 154px;
- height: 98px;
- cursor: pointer;
- 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: url(../images/media/cd-next-btn_pressed.png) no-repeat;
-}
-
-#bt-bg {
- position: relative;
- float: left;
- margin-left: 10px;
- margin-top: -8px;
-}
-
-#bt-dis-controls {
- background: url(../images/media/disabled_player_controls.png) no-repeat;
- width: 470px;
- height: 100px;
- position: relative;
- bottom: 17px;
- float: left;
- margin-left: 13px;
-}
-
-#avin-line {
- z-index: 200;
- position: relative;
- width: 151px;
- height: 297px;
- margin-top: 100px;
- margin-left: 171px;
-}
-
-.player_controlls {
- z-index: 199;
- position: absolute;
- top: 237px;
- 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;
-}
-
-#sdl_view_container .list-content {
- border: none;
-}
-
-#sdl_view_container .list-item {
- position: relative;
- width: 100%;
- height: 48px;
- font-size: 20px;
- line-height: 50px;
- border: 1px solid #393939;
-}
-
-.track-info {
- z-index: 199;
- position: absolute;
- left: 13px;
- width: 470px;
- overflow: hidden;
- height: 237px;
-}
-
-.track-info>.total {
- position: absolute;
- top: 30px;
- left: 10px;
- width: 300px;
- text-align: left;
- font-size: 20px;
- color: #999999;
-}
-
-.track-info>.title {
- top: 110px;
- font-size: 38px;
- left: 7px;
-}
-
-.track-info>.track-number {
- top: 153px;
- font-size: 26px;
- left: 10px;
-}
-
-.track-info>.time {
- top: 190px;
- font-size: 26px;
- left: 10px;
-}
-
-.track-info>.divider_o {
- top: 65px;
-}
-
-.track-info>.device {
- position: absolute;
- top: 30px;
- left: 10px;
- width: 300px;
- text-align: left;
- font-size: 20px;
- color: #999999;
-}
-
-.divider_o {
- position: absolute;
- top: 120px;
- left: 0px;
- width: 470px;
- height: 1px;
- background: url("../images/media/divider_o.png") no-repeat;
-}
-
-.statusInfo {
- width: 275px;
- height: 48px;
-}
-
-.statusInfo .station {
- top: 12px;
- left: 11px;
- text-overflow: ellipsis;
- overflow: hidden;
- height: 21px;
- width: 220px;
-}
-
-.statusInfo .station span {
- display: none;
-}
-
-.statusInfo .icon {
- width: 50px;
- height: 50px;
- left: 224px;
-}
-
-.cdIco {
- background: url(../images/media/ico_cd.png) no-repeat !important
-}
-
-.appIco {
- background: url(../images/info/info_leftMenu_apps_ico.png) no-repeat
- !important
-}
-
-#media_player_view_container {
- background: url(../images/media/player_view.png) no-repeat;
- width: 635px;
- height: 323px;
- top: 70px;
- left: 161px;
- z-index: 501;
-}
-
-#sdl_view_container .ffw_list_menu {
- top: 90px;
- left: 650px;
- width: 140px;
-} \ No newline at end of file
diff --git a/src/components/HMI/css/navigation.css b/src/components/HMI/css/navigation.css
deleted file mode 100644
index 55cab5b140..0000000000
--- a/src/components/HMI/css/navigation.css
+++ /dev/null
@@ -1,102 +0,0 @@
-/*NAVIGATION CSS*/
-#baseNavigation{
- z-index: 2;
- position: absolute;
- top: 48px;
- width: 800px;
- height: 384px;
-}
-#baseNavigation .mainField{
- position: absolute;
- background: rgba(124, 124, 124, 0.3);
- border: 1px solid;
- border-color: rgba(90, 90, 90, 0.31);
- border-radius: 3px;
- box-shadow: inset 2px 2px 10px 0px rgba(112, 112, 112, 0.3), inset -2px -2px 10px 0px rgba(112, 112, 112, 0.3);
- padding-top: 10px;
- padding-left: 10px;
- font-size: 18px;
-}
-#baseNavigation .softButton{
- position: absolute;
- border-radius: 3px;
- border: 1px solid #393939;
-}
-#baseNavigation .mainField1{
- top: 0;
- height: 30px;
- width: 190px;
- left: 0;
-}
-#baseNavigation .mainField2{
- top: 0;
- height: 40px;
- width: 380px;
- left: 204px;
-}
-#baseNavigation .mainField3{
- top: 0;
- height: 30px;
- width: 190px;
- right: 0;
-}
-#baseNavigation .mainField4{
- top: 50px;
- height: 30px;
- width: 90px;
- right: 0;
- overflow: hidden;
- white-space: nowrap;
-}
-#baseNavigation .mainField5{
- top: 100px;
- height: 30px;
- width: 90px;
- right: 0;
-}
-#baseNavigation .mainField6{
- bottom: 0;
- height: 40px;
- width: 280px;
- left: 254px;
-}
-#baseNavigation .softButton1{
- width: 250px;
- bottom: 0;
- left: 0;
- position: absolute!important;
- margin: 0px!important;
- height: 49px!important;
- font-size: 32px;
- line-height: 50px!important;
-}
-#baseNavigation .softButton2{
- width: 250px;
- bottom: 0px;
- right: 0px;
- position: absolute!important;
- margin: 0px!important;
- height: 49px!important;
- font-size: 32px;
- line-height: 50px!important;
-}
-#baseNavigation .softButton3{
- width: 100px;
- top: 100px;
- left: 0;
- position: absolute!important;
- margin: 0px!important;
- height: 49px!important;
- font-size: 32px;
- line-height: 50px!important;
-}
-#baseNavigation .softButton4{
- width: 100px;
- top: 150px;
- left: 0;
- position: absolute!important;
- margin: 0px!important;
- height: 49px!important;
- font-size: 32px;
- line-height: 50px!important;
-} \ No newline at end of file
diff --git a/src/components/HMI/css/phone.css b/src/components/HMI/css/phone.css
deleted file mode 100644
index d8e6855d7a..0000000000
--- a/src/components/HMI/css/phone.css
+++ /dev/null
@@ -1,300 +0,0 @@
-/**
- * Phone module CSS
- *
- * @category Style Sheets
- * @filesource css/phone.css
- * @version 2.0
- */
-#phone {
- width: 800px;
- height: 480px;
- background: url(../images/phone/bg.png) no-repeat;
- background-position: top;
-} /*
-
-
- Backgrpund for active toogleButton
-#phone .toogleButtonContainer .active {
- background: url(../images/phone/bcs-item_bg_act.png);
-}
-
-#phone .delim {
- position: relative;
- float: left;
- border: #393939 1px solid;
- height: 26px;
- width: 0px;
-}
-
- LEFT MENU
-*/
-#phone_menu {
- position: absolute;
- top: 90px;
- left: 0px;
- width: 150px;
- height: 300px;
- background: #333;
-}
-
-.ls_border {
- z-index: 201;
- position: absolute;
- top: -3px;
- left: 0px;
- width: 153px;
- height: 306px;
-}
-
-.ls-items {
- position: relative;
- width: 150px;
- height: 300px;
-}
-
-.ls-item {
- z-index: 201;
- position: relative;
- width: 150px;
-}
-
-/*.ls-item > .bg{z-index:201;position:absolute;top:0px;left:0px;width:150px;height:50px;}
- */
-.ls-item>.ico {
- z-index: 299;
- position: absolute;
- left: 10px;
- width: 30px;
- height: 30px;
- top: 10px;
-} /*
- .ls-item > .ico.more {left:50px;}
- */
-.ls-item span {
- z-index: 298;
- position: absolute;
- left: 50px;
- width: 100px;
- height: 50px;
- font-size: 18px;
- line-height: 50px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-/*.ls-item > .led{z-index:299;position:absolute;top:0px;right:8px;width:24px;height:50px;}
- .ls-item.empty{background:#333333;}
- .firts_item{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;}
- .last_item{-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;}
- */
-.lsp1_p {
- background: url("../images/phone/menu_bg.png") repeat-x bottom;
-}
-
-.phone_active {
- background: url("../images/phone/menu_active.png") repeat-x bottom
- !important;
- border-top: 1px solid #3e3115;
- border-bottom: 1px solid #4a3a17
-}
-
-#phone_menu .ls-item {
- height: 48px;
- border-bottom: 1px solid #656565;
- border-top: 1px solid #393939;
-} /*
- .navigationApp {width:26px;height:25px;background:url("../images/phone/ico_navigation.png") no-repeat;left:60px;top:10px;}
-
-#phone_menu.hide {
- left: -170px;
-}
-
-#phone_menu_quickdialButton,
-#phone_menu_messagingButton,
-#phone_menu_settingsButton {
- z-index: 203;
-}
-
-#phone .list-item.active {
- background: url(../images/phone/phone_button_bg_active.png) repeat-x;
-}
- PHONE STATUS BAR
-*/
-#status_phone {
- top: 0px;
- left: 0px;
- font-size: 21px;
- cursor: pointer;
- width: 324px;
- height: 48px;
- background: url(../images/common/phone-statusbar-bg.png) no-repeat;
- z-index: 1;
-}
-
-#status_phone_label {
- width: 100%;
- display: block;
- visibility: hidden;
-}
-
-#status_phone_label span {
- padding-left: 11px;
-}
-#phone_dialpad_number {
- width: 283px;
- height: 30px;
- position: absolute;
- left: 258px;
- top: 87px;
- text-align: center;
- font-size: 22px;
- padding: 10px 0 0 0;
- background: black;
- border: 1px solid #393939;
- border-radius: 3px;
-}
-
-#phone_dialpad_keypad {
- width: 282px;
- height: 200px;
- position: absolute;
- left: 259px;
- top: 141px;
-}
-
-#phone_dialpad_keypad div {
- font-size: 26px;
- text-align: center;
- line-height: 32px;
-}
-#phone_dialpad_keypad .left {
- left: 0px;
- width: 93px;
- height: 49px;
- border-left: 1px solid #393939;
- border-right: 1px solid #000;
- border-top: 1px solid #393939;
-}
-
-#phone_dialpad_keypad .center {
- left: 95px;
- width: 93px;
- height: 49px;
- border-top: 1px solid #393939;
- border-left: 1px solid #393939;
- border-right: 1px solid #000;
-}
-
-#phone_dialpad_keypad .right {
- left: 190px;
- width: 93px;
- height: 49px;
- border-left: 1px solid #393939;
- border-right: 1px solid #393939;
- border-top: 1px solid #393939;
-}
-
-#phone_dialpad_keypad_key4,#phone_dialpad_keypad_key5,#phone_dialpad_keypad_key6
- {
- top: 50px;
-}
-
-#phone_dialpad_keypad_key7,#phone_dialpad_keypad_key8,#phone_dialpad_keypad_key9
- {
- top: 100px;
-}
-
-#phone_dialpad_keypad_key0,#phone_dialpad_keypad_keyDiez,#phone_dialpad_keypad_keyStar
- {
- top: 150px;
- border-bottom: 1px solid #393939;
-}
-
-#phone_dialpad_keypad_key1 {
- -webkit-border-top-left-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-#phone_dialpad_keypad_key3 {
- -webkit-border-top-right-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-#phone_dialpad_keypad_keyStar {
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-#phone_dialpad_keypad_keyDiez {
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-#phone_dialpad_deleteButton {
- opacity: 0;
- cursor: pointer;
- width: 93px;
- height: 49px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- left: 554px;
- top: 291px;
- border: 1px solid #393939;
-}
-
-#phone_dialpad_deleteButton .ico {
- position: absolute;
- left: 34px;
- top: 15px;
-}
-
-#phone_dialpad_dialButton {
- cursor: pointer;
- border: 1px solid #393939;
- left: 661px;
- top: 241px;
- width: 128px;
- height: 49px;
- -webkit-border-top-left-radius: 3px;
- border-top-left-radius: 3px;
- -webkit-border-top-right-radius: 3px;
- border-top-right-radius: 3px;
-}
-
-#phone_dialpad_dialButton span {
- font-size: 18px;
- position: absolute;
- left: 14px;
- top: 14px;
-}
-
-#phone_dialpad_dialButton .ico {
- position: absolute;
- right: 14px;
- top: 11px;
-}
-
-#phone_dialpad_endButton {
- cursor: pointer;
- border: 1px solid #393939;
- left: 661px;
- top: 291px;
- width: 128px;
- height: 49px;
- -webkit-border-bottom-left-radius: 3px;
- border-bottom-left-radius: 3px;
- -webkit-border-bottom-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-#phone_dialpad_endButton span {
- font-size: 18px;
- position: absolute;
- left: 14px;
- top: 14px;
-}
-
-#phone_dialpad_endButton .ico {
- position: absolute;
- right: 9px;
- top: 16px;
-} \ No newline at end of file
diff --git a/src/components/HMI/css/sdl.css b/src/components/HMI/css/sdl.css
deleted file mode 100644
index e6bf641513..0000000000
--- a/src/components/HMI/css/sdl.css
+++ /dev/null
@@ -1,1254 +0,0 @@
-/**
- * CSS for sdl aplications
- */
-.ffw_list_menu {
- left: 440px;
- width: 158px;
- border: 1px solid #393939;
- overflow: hidden;
-}
-
-.ffw_list_menu .control {
- z-index: 2000;
- text-align: center;
-}
-
-.ffw_list_menu .ffw-button {
- position: relative;
- height: 49px;
- border-bottom: 1px solid #393939;
- line-height: 50px;
- display: -webkit-flex;
- display: -moz-flex;
- display: flex;
-}
-
-.ffw_list_menu .ffw-button span {
- height: 50px;
- overflow: hidden;
- text-overflow: ellipsis;
- padding-left: 10px;
-}
-
-.ffw_list_menu .content {
- position: relative;
-}
-
-.ffw_list_menu .ffw-button.hidden {
- display: none;
-}
-
-.sdl-window {
- width: 800px;
- height: 480px;
- background-color: #000;
- z-index: 1;
-}
-
-/**
- * Important Class for SoftButtons Highlightening
- */
-.isHighlighted{
- color: gold;
-}
-
-.isHighlighted .ico{
- border-style: solid;
- border-color: #FFA300 #F7DA9C;
- border-width: 1px;
-}
-
-.softButton .ico{
- width: 50px;
- height: 49px;
- -webkit-flex: 0 0 50px;
- float: left;
-}
-
-.softButton .right_text{
- padding-left: 5px !important;
-}
-
-.sdl-window .back-button {
- top: 80px;
- left: 5px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
-}
-
-.sdl-window .back-button .ico {
- margin-top: 13px;
- margin-left: 8px;
-}
-
-#info_apps_deviceList_view .deviceListLabel,.sdl-window .caption-text {
- top: 80px;
- left: 75px;
- width: 620px;
- background: #393939;
- overflow: hidden;
- text-overflow: ellipsis;
- line-height: 50px;
- height: 50px;
- padding-left: 15px;
- padding-right: 15px;
-}
-
-#info_apps_deviceList_view .progress{
- top: 175px;
- left: 254px;
- background: URL('../images/sdl/progress.gif') no-repeat;
- width: 300px;
- height: 200px;
-}
-
-#info_nonMedia {
- z-index: 1001;
-}
-
-#info_nonMedia .backButton {
- top: 80px;
- left: 20px;
-}
-
-#info_nonMedia .inner_content {
- left: 180px;
- top: 90px;
- width: 600px;
- height: 300px;
- overflow: hidden;
-}
-
-#info_nonMedia .app_title {
- width: 390px;
- padding: 15px;
- top: 1px;
- background-color: #393939;
-}
-
-#info_nonMedia .app_image {
- top: 60px;
-}
-
-#info_nonMedia .app_fields {
- left: 160px;
- top: 60px;
- width: 260px;
-}
-
-#info_nonMedia .app_fields .label {
- position: relative;
- border: 1px solid #393939;
- padding: 7px;
- margin-bottom: 5px;
-}
-
-#info_nonMedia .presets {
- top: 220px;
- width: 420px;
- height: 80px;
-}
-
-#info_nonMedia .presets .ffw-button {
- width: 82px;
- height: 38px;
- position: relative;
- float: left;
- line-height: 40px;
- border-bottom: 1px solid #393939;
- border-right: 1px solid #393939;
- border-top: 1px solid #222;
- border-left: 1px solid #222;
- text-align: center;
-}
-
-#info_nonMedia .presets .ffw-button .text{
- margin-left: 5px;
- width: 77px;
- position: absolute;
- left: 0;
- overflow: hidden;
- text-overflow: ellipsis;
- text-align: left;
-}
-
-#info_nonMedia .app_image img {
- border: 1px solid #393939;
-}
-
-#sdl_options .list {
- width: 650px;
- height: 251px;
- border-radius: 2px;
- left: 75px;
- top: 150px;
-}
-
-/*#sdl_view_container .list-content,*/
-#sdl_options .list-content {
- width: 590px;
-}
-
-#VRPopUp.move{
- left: 800px;
-}
-
-#VRPopUp span,#info_apps_deviceList_list .list-content span,#sdl_view_container .list-content span,#sdl_options .list-content span
- {
- margin-left: 15px;
- position: relative;
- text-overflow: ellipsis;
- width: 521px;
- overflow: hidden;
- float: left;
-}
-
-#sdl_options .list-content .ico {
- height: 49px;
- width: 49px;
- float: left;
- position: relative;
-}
-
-#info_nonMedia_options_submenu {
- z-index: 11000;
- width: 800px;
- height: 480px;
- background-color: black;
- top: 0px;
- left: 0px;
-}
-
-#sdl_media_presetButtons .preset-item>span {
- z-index: 202;
- display: block;
- position: absolute;
- left: 10px;
- width: 84px;
- height: 50px;
- font-size: 20px;
- line-height: 50px;
- overflow: hidden;
- text-overflow: ellipsis;
- color: white;
-}
-
-#sdl_view_container .preset-items {
- width: 468px;
-}
-
-#sdl_view_container .main-preset-buttons-wraper .preset-item.a3,#sdl_view_container .main-preset-buttons-wraper .preset-item.a6
- {
- width: 155px;
-}
-
-#sdl_view_container .player_controllsV2 {
- top: 241px !important;
- height: 48px;
-}
-
-#sdl_view_container .player_controllsV2 .ffw-button {
- height: 48px;
-}
-
-#sdl_view_container .player_controllsV2 img {
- margin-top: -26px;
-}
-
-/* ScrollableMessage */
-#ScrollableMessage.ScrollableMessage {
- left: 0;
- top: 0;
- width: 800px;
- height: 480px;
- /*z-index: 1000;*/
- background: url(../images/media/bg.png) no-repeat;
-}
-
-#ScrollableMessage.active {
- opacity: 1;
- display: block;
-}
-
-#ScrollableMessage .backButton {
- top: 80px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
-}
-
-#ScrollableMessage .titleText {
- top: 80px;
- left: 75px;
- width: 620px;
- height: 20px;
- background: #393939;
- padding: 15px;
-}
-
-#ScrollableMessage .scrollableText {
- position: absolute;
- width: 525px;
- height: 251px;
- border-radius: 2px;
- left: 200px;
- top: 154px;
- overflow: hidden;
-}
-
-#ScrollableMessage .scrollableText-content {
- border: none;
- width: 474px;
-}
-
-#ScrollableMessage .scrollableText-item {
- position: relative;
- width: 100%;
- height: 48px;
- font-size: 20px;
- line-height: 50px;
- border: 1px solid #393939;
-}
-
-#ScrollableMessage .ffw_list_menu {
- top: 154px !important;
- left: 25px !important;
-}
-
-#ScrollableMessage .scrollableTextArea {
- margin: 0px;
- /*height: 251px;*/
- width: 469px;
- font-family: sans-serif;
- font-size: 16px;
- color: white;
- background-color: transparent;
- resize: none;
- line-height: 23px;
- position: absolute;
-}
-
-/* SDL Slider */
-.slider-header {
- top: 167px;
- left: 145px;
- width: 480px;
- background: #393939;
- line-height: 50px;
- height: 50px;
- padding-left: 15px;
- padding-right: 15px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.slider-footer {
- top: 325px;
- left: 145px;
- width: 480px;
- background: #393939;
- line-height: 50px;
- height: 50px;
- padding-left: 15px;
- padding-right: 15px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#slider_view .okButton{
- top: 379px;
- left: 364px;
- width: 54px;
- height: 17px;
- border: 1px solid #333;
- border-radius: 2px;
- padding: 10px;
-}
-
-#slider_view .sliderControl {
- width: 600px;
- left: 100px;
- top: 250px;
- text-align: center;
-}
-
-#slider_view .control {
- width: 58px;
- height: 38px;
- border: 1px solid #393939;
- position: relative;
- display: inline-block;
-}
-
-#slider_view .ledContainer {
- position: relative;
- display: inline-block;
- border: 1px solid #393939;
- height: 38px;
-}
-
-#slider_view .control.minus .ico {
- top: 19px;
- left: 20px;
- position: absolute;
-}
-
-#slider_view .control.plus .ico {
- top: 12px;
- left: 20px;
- position: absolute;
-}
-
-#slider_view .led {
- width: 12px;
- height: 40px;
- background: url("../images/common/seat-act-led.png") no-repeat;
- position: relative !important;
- background-position: -4px 0;
- display: inline-block;
-}
-
-#slider_view .led-inactive {
- background: url("../images/common/seat-inact-led.png") no-repeat;
- background-position: 3px 8px;
- width: 12px;
- height: 40px;
- position: relative !important;
- display: inline-block;
-}
-
-/* SDL Perform Interaction Choise,
- SDL TBT Turn List */
-#tbtTurnListView .list,
-#perform_interaction_view .list,
-#vr_help_list_view .list {
- position: absolute;
- width: 650px;
- height: 251px;
- border-radius: 2px;
- left: 75px;
- top: 154px;
-}
-
-#tbtTurnListView .list span,
-#perform_interaction_view .list span,
-#vr_help_list_view .list span{
- margin-left: 15px;
-}
-
-#tbtTurnListView .list-content,
-#perform_interaction_view .list-content,
-#vr_help_list_view .list-content {
- width: 578px;
-}
-
-#perform_interaction_view input{
- width: 720px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
- background: rgba(119, 119, 119, 0.42);
- cursor: pointer;
- font-size: 32px;
- color: #FFF;
- top: 80px;
- left: 65px;
- position: absolute;
-}
-#perform_interaction_view .listWrapper{
- top: 140px;
- width: 750px;
- height: 275px;
- left: 25px;
-}
-
-#perform_interaction_view .naviChoises .ffw-button{
- width: 110px;
- height: 110px;
- margin: 20px;
- float: left;
- position: relative;
- border: 1px solid #333;
- border-radius: 2px;
- background-repeat: repeat;
-}
-
-#sdl_view_container .cd_logo {
- position: absolute;
- top: 90px;
- right: 10px;
- border: 1px solid #393939;
- -webkit-border-radius: 2px;
- width: 109px;
- height: 109px;
-}
-
-#sdl_view_container .cd_logoV2 {
- position: absolute;
- top: 70px;
- right: 10px;
- border: 1px solid #393939;
- -webkit-border-radius: 2px;
- width: 109px;
- height: 109px;
-}
-
-#sdl_view_container .timeV2 {
- top: 155px;
-}
-
-#sdl_view_container .textLimit {
- width: 460px;
- text-overflow: ellipsis;
- overflow: hidden;
-}
-
-#VRButton.VRButton {
- background: url(../images/home/controlButtons/vr.png) no-repeat;
- width: 89px;
- height: 90px;
- left: 1024px;;
- top: 2px;
- -webkit-transition: 0.2s;
-}
-
-#VRButton.pressed {
- background: url(../images/home/controlButtons/vr_pressed.png) no-repeat;
-}
-
-#vehicleInfoButton.vehicleInfoButton {
- width: 117px;
- height: 48px;
- left: 1059px;
- top: 206px;
- text-align: center;
- line-height: 48px;
-}
-
-#tbtClientStateButton.tbtClientStateButton {
- width: 158px;
- height: 48px;
- left: 865px;
- top: 418px;
- text-align: center;
- line-height: 48px;
-}
-
-#exitApp.exitApp {
- width: 135px;
- height: 48px;
- left: 1043px;
- top: 418px;
- text-align: center;
- line-height: 48px;
-}
-
-#exitAppView,#tbtClientStateView,#VehicleInfo,#systemRequestView {
- opacity: 0;
- left: 50px;
- width: 700px;
- height: 340px;
- background-color: black;
- z-index: 2;
- border-radius: 10PX;
- top: 70px;
- -webkit-transition: opacity 1s ease-in-out;
- display: none;
- border: 1px solid white;
-}
-
-#exitAppView .exitAppViewLabel,#systemRequestView .systemRequestViewLabel, #tbtClientStateView .tbtClientStateLabel,#VehicleInfo .vehicleInfoLabel
- {
- top: 10px;
- width: 600px;
- left: 35px;
- height: 20px;
- padding: 15px;
- background: #393939;
-}
-
-#exitAppView.active,#systemRequestView.active,#tbtClientStateView.active,#VehicleInfo.active {
- opacity: 1;
- display: block;
-}
-
-#exitAppView .exitAppViewTitle, #systemRequestView .systemRequestViewTitle, #tbtClientStateView .tbtClientState,#VehicleInfo .prndl
- {
- top: 70px;
- width: 600px;
- left: 40px;
- height: 20px;
- padding: 10px;
- background: #535353;
-}
-
-#exitAppView .exitAppViewSelect, #systemRequestView .systemRequestViewSelect, #tbtClientStateView .tbtClientStateSelect,#VehicleInfo .prndlSelect
- {
- top: 125px;
- position: absolute;
- width: 150px;
- left: 275px;
- height: 40px;
- color: white;
- background: #393939;
-}
-
-#exitAppView .exitAppViewSelect option,#tbtClientStateView .tbtClientStateSelect option,#VehicleInfo .prndlSelect option
- {
- 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;
- left: 360px;
- height: 20px;
- padding: 10px;
- background: #535353;
-}
-
-#VehicleInfo .odometrInput{
- width: 265px;
- position: absolute;
- top: 242px;
- left: 373px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
- background: rgba(119, 119, 119, 0.42);
- cursor: pointer;
- font-size: 32px;
- color: #FFF;
- padding-left: 10px;
- 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;
- left: 30px;
- height: 20px;
- padding: 10px;
- background: #535353;
-}
-
-#VehicleInfo .ecu1 {
- top: 233px;
- width: 80px;
- left: 65px;
- height: 20px;
- padding: 10px;
-}
-
-#VehicleInfo .ecu2 {
- top: 265px;
- width: 80px;
- left: 65px;
- height: 20px;
- padding: 10px;
-}
-
-#VehicleInfo .ecu1Data {
- top: 233px;
- width: 155px;
- left: 155px;
- height: 20px;
- padding: 10px;
-}
-
-#VehicleInfo .ecu2Data {
- top: 265px;
- width: 155px;
- left: 155px;
- height: 20px;
- padding: 10px;
-}
-.PopUp{
- left: 200px;
- width: 400px;
- height: 245px;
- z-index: 2;
- top: 110px;
- -webkit-transition: opacity 1s ease-in-out;
- background-color: black;
- border: #A6A6A6 solid 2px;
- border-radius: 6px;
-}
-
-.PopUp .text{
- top: 41px;
- left: 5px;
- width: 390px;
- height: 120px;
- line-height: 20px;
- position: absolute;
- overflow: hidden;
- text-align: center;
- text-overflow: ellipsis;
-}
-
-.PopUp .OkButton{
- top: 190px;
- left: 5px;
- width: 190px;
- border: 1px solid #393939;
-}
-
-.PopUp .OkButton span{
- font-size: 20px;
- line-height: 50px;
- cursor: pointer;
- margin-left: 82px;
-}
-
-.PopUp .CancelButton{
- top: 190px;
- left: 205px;
- width: 190px;
- border: 1px solid #393939;
-}
-
-.PopUp .CancelButton span{
- font-size: 20px;
- line-height: 50px;
- cursor: pointer;
- margin-left: 65px;
-}
-
-/* Alert, AudioPassThruPopUp popup*/
-#AlertManeuverPopUp.AlertManeuverPopUp,#AudioPassThruPopUp.AudioPassThruPopUp,#AlertPopUp.AlertPopUp
- {
- opacity: 0;
- left: 200px;
- width: 400px;
- height: 245px;
- z-index: 2;
- top: 110px;
- -webkit-transition: opacity 1s ease-in-out;
- background-color: black;
- border: #A6A6A6 solid 2px;
- border-radius: 6px;
- display: none;
-}
-
-#AlertManeuverPopUp .applicationName,#AudioPassThruPopUp .applicationName,#AlertPopUp .applicationName
- {
- width: 380px;
- left: 10px;
- text-align: center;
- font-size: 25px;
- line-height: 30px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#AlertPopUp .alertPopUpImage {
- width: 83px;
- height: 74px;
- background: url(../images/sdl/Warning.png) no-repeat;
- top: 45px;
- left: 10px;
-}
-
-#AlertPopUp .progressIndicator {
- width: 50px;
- height: 50px;
- background: url(../images/sdl/progressindicator.gif) no-repeat;
- top: 0px;
- background-size: contain;
- left: 0px;
-}
-
-#AudioPassThruPopUp .audioPassThruImage {
- width: 83px;
- height: 74px;
- background: url(../images/home/controlButtons/vrImage.png) no-repeat;
- top: 45px;
- left: 25px;
-}
-
-#AudioPassThruPopUp .message1,#AlertPopUp .message1 {
- top: 37px;
- left: 105px;
- width: 285px;
- height: 30px;
- text-align: center;
- font-size: 23px;
- line-height: 30px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#AudioPassThruPopUp .message2,#AlertPopUp .message2 {
- top: 70px;
- left: 105px;
- width: 285px;
- height: 28px;
- text-align: center;
- font-size: 23px;
- line-height: 30px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#AudioPassThruPopUp .message3,#AlertPopUp .message3 {
- top: 100px;
- left: 105px;
- width: 285px;
- height: 28px;
- text-align: center;
- font-size: 23px;
- line-height: 30px;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#AlertManeuverPopUp.AlertManeuverActive,#AudioPassThruPopUp.AudioPassThruActive,#AlertPopUp.AlertActive
- {
- opacity: 1;
- display: block;
-}
-
-#baseNavigation .softButton,#AlertManeuverPopUp .softButton,#AudioPassThruPopUp .softButton,#AlertPopUp .softButton
- {
- border: 1px solid #393939;
- border-radius: 3px;
- height: 42px;
- line-height: 42px;
- text-align: center;
- float: left;
- margin: 10px;
- position: relative;
- text-overflow: ellipsis;
- overflow: hidden;
-}
-
-#baseNavigation .naviOptionsBtn{
- border: 1px solid #393939;
- border-radius: 3px;
- height: 42px;
- line-height: 42px;
- text-align: center;
- text-overflow: ellipsis;
- overflow: hidden;
- top: 283px;
- right: 6px;
- width: 105px;
- position: absolute;
-}
-
-#AlertManeuverPopUp .closeButton {
- width: 170px;
- top: 180px;
- left: 110px;
-}
-
-#AlertPopUp .alertSoftButtons {
- margin-left: 8px;
- top: 120px;
- width: 386px;
-}
-
-#AlertManeuverPopUp .one,#softButton0.one {
- margin-top: 42px;
- width: 362px;
-}
-
-#softButton0.two {
- margin-top: 42px;
- width: 170px;
-}
-
-#softButton1.two {
- margin-top: 42px;
- width: 170px;
-}
-
-#softButton0.three {
- width: 170px;
-}
-
-#AudioPassThruPopUp .buttonDone,#softButton1.three {
- width: 170px;
-}
-
-#AudioPassThruPopUp .buttonCancel,#softButton2.three {
- width: 362px;
-}
-
-#softButton0.four {
- width: 170px;
-}
-
-#softButton1.four {
- width: 170px;
-}
-
-#softButton2.four {
- width: 170px;
-}
-
-#softButton3.four {
- width: 170px;
-}
-
-#AudioPassThruPopUp .buttonRetry {
- top: 120px;
- width: 175px;
-}
-
-#AudioPassThruPopUp .buttonDone {
- top: 120px;
- width: 175px;
-}
-
-#AudioPassThruPopUp .buttonCancel {
- top: 120px;
- width: 372px;
-}
-
-#info_leftMenu_sdl {
- font-size: 18px;
- line-height: 48px;
-}
-
-#info_leftMenu_sdl img {
- float: left;
-}
-
-#info_leftMenu_sdl span {
- float: left;
- position: relative;
- width: 100px;
- text-overflow: ellipsis;
- overflow: hidden;
- left: 0;
-}
-
-/* TurnByTurnView */
-#TurnByTurnView.TurnByTurnView {
- top: 48px;
- height: 384px;
- left: 153px;
- width: 647px;
- background: none;
-}
-
-#TurnByTurnView .caption-text {
- left: 5px;
- width: 607px;
- top: 15px;
-}
-
-#TurnByTurnView .label {
- overflow: hidden;
-}
-
-#TurnByTurnView .totalDistanceLabel {
- height: 20px;
- background: #393939;
- padding: 15px;
- left: 5px;
- top: 80px;
- width: 170px;
-}
-
-#TurnByTurnView .etaLabel {
- height: 20px;
- background: #393939;
- padding: 15px;
- left: 206px;
- top: 80px;
- width: 170px;
-}
-
-#TurnByTurnView .turnList {
- left: 5px;
- top: 145px;
- width: 379px;
- padding: 10px;
- text-align: center;
-}
-
-#TurnByTurnView .ffw_list_menu {
- height: 198px;
- top: 200px;
- left: 5px;
- width: 401px;
- border: none;
-}
-
-#TurnByTurnView .ffw-button {
- border-radius: 3px;
- border: 1px solid #393939;
- margin-bottom: 5px;
- text-align: center;
- font-size: 20px;
-}
-
-
-#TurnByTurnView .ffw-button .text {
- margin: auto;
-}
-
-#TurnByTurnView .turnList .arrow-ico {
- margin-top: -13px;
-}
-
-#turnList img {
- margin-top: -10px;
-}
-
-#TurnByTurnView .homeScreen {
- left: 440px;
- top: 312px;
- padding: 0 0 0 5px;
- width: 195px;
-}
-
-#TurnByTurnView .homeScreen span {
- width: 140px;
-}
-
-#TurnByTurnView .homeScreen>img {
- float: left;
- width: 50px;
- height: 50px;
-}
-
-#TurnByTurnView .homeScreen>span {
- float: left;
- line-height: 50px;
- padding-left: 5px;
-}
-
-#TurnByTurnView .navigationText2 {
- left: 440px;
- top: 268px;
- width: 182px;
- padding: 10px;
- height: 20px;
- background: #393939;
-}
-
-#TurnByTurnView .turnIcon,
-#TurnByTurnView .nextTurnIcon {
- border: 1px solid #222;
- left: 540px;
- width: 100px;
- height: 100px;
- background-size: contain;
- background-repeat: no-repeat;
-}
-
-#TurnByTurnView .distanceToManeuver{
- top: 80px;
- left: 419px;
- background: #393939;
- padding: 15px;
-}
-
-#TurnByTurnView .distanceToManeuverScale{
- top: 144px;
- left: 419px;
- background: #393939;
- padding: 15px;
-}
-
-#TurnByTurnView .timeToDestination{
- top: 207px;
- left: 419px;
- background: #393939;
- padding: 15px;
-}
-
-#TurnByTurnView .turnIcon {
- top: 65px;
-}
-
-#TurnByTurnView .nextTurnIcon {
- top: 166px;
-}
-
-#tbtTurnListList .list-content .label>img {
- width: 50px;
- height: 50px;
- float: left;
-}
-
-#info_apps_list .ffw-button {
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-#sdl_view_container {
- z-index: 501;
-}
-
-#sdl_view_container .title {
- top: 79px;
- font-size: 38px;
- left: 7px;
- width: 340px;
- height: 44px;
-}
-
-#sdl_view_container .album {
- top: 123px;
- font-size: 26px;
- left: 10px;
- width: 330px;
- height: 32px;
-}
-
-#sdl_view_container .artist {
- top: 155px;
- font-size: 26px;
- left: 10px;
- width: 330px;
- height: 32px;
-}
-
-#sdl_view_container .player_controlls {
- top: 292px;
- left: 165px;
-}
-
-/* SDL Slider*/
-#media_sdl_slider_view {
- width: 800px;
- height: 480px;
- z-index: 1000;
- background: url(../images/media/bg.png) no-repeat;
-}
-
-#media_sdl_slider_view .backButton {
- top: 80px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
-}
-
-#media_sdl_slider_view .initialText {
- top: 80px;
- left: 75px;
- width: 620px;
- height: 20px;
- background: #393939;
- padding: 15px;
-}
-
-/* SDL Perform Interaction Choise */
-#media_app_perform_interaction_view {
- width: 800px;
- height: 480px;
- z-index: 1000;
- background: url(../images/media/bg.png) no-repeat;
-}
-
-#media_app_perform_interaction_view .backButton {
- top: 80px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
-}
-
-#media_app_perform_interaction_view .list {
- position: absolute;
- width: 629px;
- height: 251px;
- border-radius: 2px;
- left: 100px;
- top: 154px;
-}
-
-#media_app_perform_interaction_view .initialText {
- top: 80px;
- left: 75px;
- width: 620px;
- height: 20px;
- background: #393939;
- padding: 15px;
-}
-
-#media_app_perform_interaction_view .list-content {
- width: 578px;
-}
-
-/* SDL Media Options */
-#media_app_options_view {
- width: 800px;
- height: 480px;
- z-index: 2002;
- background: url(../images/media/bg.png) no-repeat;
-}
-
-#media_app_options_view .backButton {
- top: 80px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
-}
-
-#media_app_options_view .list {
- position: absolute;
- width: 650px;
- height: 251px;
- border-radius: 2px;
- left: 75px;
- top: 154px;
-}
-
-#media_app_options_view .optionsLabel {
- top: 80px;
- left: 75px;
- width: 620px;
- height: 20px;
- background: #393939;
- padding: 15px;
-}
-
-#media_app_options_view .list-content {
- width: 578px;
-} \ No newline at end of file
diff --git a/src/components/HMI/css/settings.css b/src/components/HMI/css/settings.css
deleted file mode 100644
index b8142924bb..0000000000
--- a/src/components/HMI/css/settings.css
+++ /dev/null
@@ -1,129 +0,0 @@
-#settingsView .in_settings_separate_view{
- top: 48px;
- width: 800px;
- height: 382px;
- background: black;
- z-index: 5000;
-}
-
-#settingsView .in_settings_separate_view .backButton {
- top: 35px;
- width: 48px;
- height: 48px;
- border: 1px solid #333;
- border-radius: 2px;
- left: 25px;
-}
-#settingsView .in_settings_separate_view .list{
- height: 251px;
- width: 700px;
- top: 106px;
- left: 50px;
-}
-#settingsView .in_settings_separate_view .list-item{
- width: 639px;
- padding-left: 10px;
-}
-
-#settingsView .in_settings_separate_view .label{
- top: 35px;
- left: 100px;
- width: 620px;
- background: #393939;
- overflow: hidden;
- text-overflow: ellipsis;
- line-height: 50px;
- height: 50px;
- padding-left: 15px;
- padding-right: 15px;
-}
-
-#settingsView .backButton .ico {
- margin-top: 13px;
- margin-left: 8px;
-}
-
-#settings_leftMenu {
- background: #333;
- width: 150px;
- height: 300px;
- top: 90px;
-}
-
-#settings_leftMenu .menu-item.info_active {
- background: url("../images/info/menu_active.png") repeat-x;
-}
-
-#settings_leftMenu .menu-item {
- z-index: 201;
- position: relative;
- width: 150px;
- height: 50px;
- cursor: pointer;
-}
-
-#settings_leftMenu .menu-item span {
- position: absolute;
- left: 50px;
- width: 100px;
- height: 50px;
- font-size: 18px;
- line-height: 50px;
- white-space: nowrap;
- overflow: hidden;
-}
-
-#settings_leftMenu .ico {
- height: 50px;
- width: 50px;
-}
-
-#settings_leftMenu .settings_active {
- background: url("../images/info/menu_active.png") repeat-x;
-}
-
-#settingsView .in_settings_view{
- position: absolute;
- top: 48px;
- left: 153px;
- width: 647px;
- height: 384px;
- float: left;
- z-index: 1001;
- margin-top: 70px;
-}
-
-#settingsView .policies_settings_list{
- height: 251px;
- width: 598px;
- left: 10px;
-}
-
-#policies_settings_list .list-content .ffw-button{
- width: 537px;
- padding-left: 10px;
-}
-
-#settingsView .settingsButton{
- float: left;
- width: 536px;
- margin-right: 10px;
- height: 48px;
- font-size: 20px;
- line-height: 50px;
- border: 1px solid #393939;
- cursor: pointer;
- padding-left: 10px;
- position: relative;
-}
-
-#policies_settings_system_error .listSelect,
-#policies_settings_status_info .listSelect{
- top: 125px;
- position: absolute;
- width: 150px;
- left: 320px;
- height: 40px;
- color: white;
- background: #393939;
-} \ No newline at end of file
diff --git a/src/components/HMI/ffw/BasicCommunicationRPC.js b/src/components/HMI/ffw/BasicCommunicationRPC.js
deleted file mode 100644
index 6ef3fc60fc..0000000000
--- a/src/components/HMI/ffw/BasicCommunicationRPC.js
+++ /dev/null
@@ -1,1339 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * Reference implementation of BasicCommunication component. Interface to get or
- * set some essential information from OS. BasicCommunication responsible for
- * handling the basic commands of non-graphical part such as the registration of
- * mobile apps, geting the list of devices and applications and data transfer.
- */
-
-FFW.BasicCommunication = FFW.RPCObserver
- .create( {
-
- /**
- * access to basic RPC functionality
- */
- client: FFW.RPCClient.create( {
- componentName: "BasicCommunication"
- }),
-
- /**
- * Contains response codes for request that should be processed but there were some kind of errors
- * Error codes will be injected into response.
- */
- errorResponsePull: {},
-
-
- //OnPutFile
-
-
- onPutFileSubscribeRequestID: -1,
- onStatusUpdateSubscribeRequestID: -1,
- onAppPermissionChangedSubscribeRequestID: -1,
- onSDLPersistenceCompleteSubscribeRequestID: -1,
- onFileRemovedSubscribeRequestID: -1,
- onAppRegisteredSubscribeRequestID: -1,
- onAppUnregisteredSubscribeRequestID: -1,
- onPlayToneSubscribeRequestID: -1,
- onSDLCloseSubscribeRequestID: -1,
- onSDLConsentNeededSubscribeRequestID: -1,
- onResumeAudioSourceSubscribeRequestID: -1,
-
- onPutFileUnsubscribeRequestID: -1,
- onStatusUpdateUnsubscribeRequestID: -1,
- onAppPermissionChangedUnsubscribeRequestID: -1,
- onSDLPersistenceCompleteUnsubscribeRequestID: -1,
- onFileRemovedUnsubscribeRequestID: -1,
- onAppRegisteredUnsubscribeRequestID: -1,
- onAppUnregisteredUnsubscribeRequestID: -1,
- onPlayToneUnsubscribeRequestID: -1,
- onSDLCloseUnsubscribeRequestID: -1,
- onSDLConsentNeededUnsubscribeRequestID: -1,
- onResumeAudioSourceUnsubscribeRequestID: -1,
-
- // const
- onStatusUpdateNotification: "SDL.OnStatusUpdate",
- onAppPermissionChangedNotification: "SDL.OnAppPermissionChanged",
- onSDLPersistenceCompleteNotification: "BasicCommunication.OnSDLPersistenceComplete",
- onPutFileNotification: "BasicCommunication.OnPutFile",
- onFileRemovedNotification: "BasicCommunication.OnFileRemoved",
- onAppRegisteredNotification: "BasicCommunication.OnAppRegistered",
- onAppUnregisteredNotification: "BasicCommunication.OnAppUnregistered",
- onPlayToneNotification: "BasicCommunication.PlayTone",
- onSDLCloseNotification: "BasicCommunication.OnSDLClose",
- onSDLConsentNeededNotification: "SDL.OnSDLConsentNeeded",
- onResumeAudioSourceNotification: "BasicCommunication.OnResumeAudioSource",
-
-
- /**
- * init object
- */
- init: function() {
-
- },
-
- /**
- * connect to RPC bus
- */
- connect: function() {
-
- this.client.connect(this, 600); // Magic number is unique identifier
- // for component
- },
-
- /**
- * disconnect from RPC bus
- */
- disconnect: function() {
-
- this.onRPCUnregistered();
- this.client.disconnect();
- },
-
- /**
- * Client is registered - we can send request starting from this point
- * of time
- */
- onRPCRegistered: function() {
-
- Em.Logger.log("FFW.BasicCommunicationRPC.onRPCRegistered");
- this._super();
-
- // subscribe to notifications
- this.onPutFileSubscribeRequestID = this.client
- .subscribeToNotification(this.onPutFileNotification);
- this.onStatusUpdateSubscribeRequestID = this.client
- .subscribeToNotification(this.onStatusUpdateNotification);
- this.onAppPermissionChangedSubscribeRequestID = this.client
- .subscribeToNotification(this.onAppPermissionChangedNotification);
- this.onSDLPersistenceCompleteSubscribeRequestID = this.client
- .subscribeToNotification(this.onSDLPersistenceCompleteNotification);
- this.onFileRemovedSubscribeRequestID = this.client
- .subscribeToNotification(this.onFileRemovedNotification);
- this.onAppRegisteredSubscribeRequestID = this.client
- .subscribeToNotification(this.onAppRegisteredNotification);
- this.onAppUnregisteredSubscribeRequestID = this.client
- .subscribeToNotification(this.onAppUnregisteredNotification);
- this.onPlayToneSubscribeRequestID = this.client
- .subscribeToNotification(this.onPlayToneNotification);
- this.onSDLCloseSubscribeRequestID = this.client
- .subscribeToNotification(this.onSDLCloseNotification);
- this.onSDLConsentNeededSubscribeRequestID = this.client
- .subscribeToNotification(this.onSDLConsentNeededNotification);
- this.onResumeAudioSourceSubscribeRequestID = this.client
- .subscribeToNotification(this.onResumeAudioSourceNotification);
- },
-
- /**
- * Client is unregistered - no more requests
- */
- onRPCUnregistered: function() {
-
- Em.Logger.log("FFW.BasicCommunicationRPC.onRPCUnregistered");
- this._super();
-
- // unsubscribe from notifications
-
- this.onPutFileUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onPutFileNotification);
- this.onStatusUpdateUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onStatusUpdateNotification);
- this.onAppPermissionChangedUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onAppPermissionChangedNotification);
- this.onSDLPersistenceCompleteUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onSDLPersistenceCompleteNotification);
- this.onFileRemovedUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onFileRemovedNotification);
- this.onAppRegisteredUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onAppRegisteredNotification);
- this.onAppUnregisteredUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onAppUnregisteredNotification);
- this.onPlayToneUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onPlayToneNotification);
- this.onSDLCloseUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onSDLCloseNotification);
- this.onSDLConsentNeededUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onSDLConsentNeededNotification);
- this.onResumeAudioSourceUnsubscribeRequestID = this.client
- .unsubscribeFromNotification(this.onResumeAudioSourceNotification);
- },
-
- /**
- * Client disconnected.
- */
- onRPCDisconnected: function() {
-
- if (SDL.SDLAppController) {
- SDL.SDLAppController.onSDLDisconected();
- }
- },
-
- /**
- * when result is received from RPC component this function is called It
- * is the propriate place to check results of reuqest execution Please
- * use previously store reuqestID to determine to which request repsonse
- * belongs to
- */
- onRPCResult: function(response) {
-
- Em.Logger.log("FFW.BasicCommunicationRPC.onRPCResult");
- this._super();
-
- if ("result" in response
- && response.result.code === SDL.SDLModel.resultCode["SUCCESS"]) {
-
- if (response.result.method == "SDL.GetUserFriendlyMessage") {
-
- Em.Logger.log("SDL.GetUserFriendlyMessage: Response from SDL!");
-
- 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];
- }
- }
-
- if (response.result.method == "SDL.ActivateApp") {
-
- Em.Logger.log("SDL.ActivateApp: Response from SDL!");
-
- if (response.id in SDL.SDLModel.activateAppRequestsList) {
-
- var appID = SDL.SDLModel.activateAppRequestsList[response.id].appID,
- popUp = SDL.SDLModel.activateAppRequestsList[response.id].popUp;
-
- popUp.deactivate();
-
- if (response.error && response.error.code === SDL.SDLModel.resultCode["APPLICATION_NOT_REGISTERED"]) {
-
- SDL.PopUp.create().appendTo('body').popupActivate("Activation FAILED!");
- return;
- }
-
- if (!response.result.isSDLAllowed) {
-
- SDL.SettingsController.currentDeviceAllowance = response.result.device;
-
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.AllowSDLFunctionality, appID, ["DataConsent"]);
- }
-
- if (response.result.isPermissionsConsentNeeded) {
-
- this.GetListOfPermissions(appID);
- }
-
- if (response.result.isAppPermissionsRevoked) {
-
- SDL.SDLModel.setAppPermissions(appID, response.result.appRevokedPermissions);
- }
-
- if (response.result.isAppRevoked) {
-
- 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];
- }
- } 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") {
-
- Em.Logger.log("SDL.GetListOfPermissions: Response from SDL!");
-
- SDL.SettingsController.GetListOfPermissionsResponse(response);
- }
-
- if (response.result.method == "SDL.GetStatusUpdate") {
-
- Em.Logger.log("SDL.GetStatusUpdate: Response from SDL!");
-
- SDL.PopUp.create().appendTo('body').popupActivate(response.result);
- }
-
- if (response.result.method == "SDL.GetURLS") {
-
- 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();
-
- }
- } 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;
-
- 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!");
- }
- },
-
- /**
- * handle RPC erros here
- */
- onRPCError: function(error) {
-
- Em.Logger.log("FFW.BasicCommunicationRPC.onRPCError");
- this._super();
- },
-
- /**
- * handle RPC notifications here
- */
- onRPCNotification: function(notification) {
-
- Em.Logger.log("FFW.BasicCommunicationRPC.onRPCNotification");
- this._super();
-
- if (notification.method == this.onFileRemovedNotification) {
- SDL.SDLModel.onFileRemoved(notification.params);
- }
-
- if (notification.method == this.onStatusUpdateNotification) {
-
- SDL.TTSPopUp.ActivateTTS(notification.params.status);
-
- var messageCode = '';
- switch(notification.params.status){
- case "UP_TO_DATE":{
- messageCode = "StatusUpToDate";
- break;
- }
- case "UPDATING":{
- messageCode = "StatusPending";
- break;
- }
- case "UPDATE_NEEDED":{
- messageCode = "StatusNeeded";
- break;
- }
- }
-
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, SDL.SDLAppController.model?SDL.SDLAppController.model.appID:null, [messageCode]);
- }
-
- if (notification.method == this.onAppPermissionChangedNotification) {
-
- if (notification.params.appPermissionsConsentNeeded) {
-
- this.GetListOfPermissions(notification.params.appID);
- }
-
- if (notification.params.isAppPermissionsRevoked) {
-
- SDL.SDLModel.setAppPermissions(notification.params.appID, notification.params.appRevokedPermissions);
- }
-
- if (notification.params.appRevoked) {
-
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, notification.params.appID, ["AppUnsupported"]);
- }
-
- if (notification.params.appUnauthorized) {
-
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.simpleParseUserFriendlyMessageData, notification.params.appID, ["AppUnauthorized"]);
- }
- }
-
- if (notification.method == this.onAppRegisteredNotification) {
- SDL.SDLModel.onAppRegistered(notification.params.application);
- this.OnFindApplications();
- }
-
- if (notification.method == this.onAppUnregisteredNotification) {
- // remove app from list
- SDL.SDLModel.onAppUnregistered(notification.params);
- }
-
- if (notification.method == this.onPlayToneNotification) {
- SDL.SDLModel.onPlayTone();
- }
-
- if (notification.method == this.onSDLCloseNotification) {
- //notification handler method
- }
- if (notification.method == this.onSDLConsentNeededNotification) {
-
- SDL.SettingsController.currentDeviceAllowance = notification.params.device;
- FFW.BasicCommunication.GetUserFriendlyMessage(SDL.SettingsController.AllowSDLFunctionality, null, ["DataConsent"]);
- }
- if (notification.method == this.onResumeAudioSourceNotification) {
-
- SDL.SDLModel.stateLimited = notification.params.device;
- SDL.VRPopUp.updateVR();
- }
- },
-
- /**
- * handle RPC requests here
- */
- onRPCRequest: function(request) {
-
- Em.Logger.log("FFW.BasicCommunicationRPC.onRPCRequest");
- this._super();
-
- if (this.validationCheck(request)) {
-
- if (request.method == "BasicCommunication.MixingAudioSupported") {
- this.MixingAudioSupported(request.id, true);
- }
- if (request.method == "BasicCommunication.AllowAllApps") {
- this.AllowAllApps(true);
- }
- if (request.method == "BasicCommunication.AllowApp") {
- this.AllowApp(request);
- }
- if (request.method == "BasicCommunication.AllowDeviceToConnect") {
- this.AllowDeviceToConnect(request.id, request.method, allow);
- }
- if (request.method == "BasicCommunication.UpdateDeviceList") {
- SDL.SDLModel.onGetDeviceList(request.params);
- this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
- }
- 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") {
-
- SDL.SettingsController.policyUpdateRetry("ABORT");
-
- this.OnReceivedPolicyUpdate(request.params.fileName);
-
- SDL.SettingsController.policyUpdateFile = null;
-
- this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
- }
- if (request.method == "BasicCommunication.DialNumber") {
-
- SDL.PopUp.create().appendTo('body').popupActivate(
- "Would you like to dial " + request.params.number + " ?",
- function (result) {
- if (result) {
-
- FFW.BasicCommunication.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
-
- SDL.SDLModel.onDeactivateApp('call', request.params.appID);
- SDL.States.goToStates('phone.dialpad');
- SDL.PhoneController.incomingCall(request);
- } else {
-
-
- FFW.BasicCommunication.sendError(SDL.SDLModel.resultCode["REJECTED"],
- request.id,
- request.method,
- "No paired device!"
- );
- }
- },
- false);
- }
- if (request.method == "BasicCommunication.ActivateApp") {
-
- if (!request.params.level || request.params.level == "FULL") {
- if ((SDL.SDLAppController.model && SDL.SDLAppController.model.appID != request.params.appID) || (request.params.level == "NONE" || request.params.level == "BACKGROUND")) {
- SDL.States.goToStates('info.apps');
- }
-
- if (SDL.SDLModel.stateLimited == request.params.appID) {
- SDL.SDLModel.stateLimited = null;
- SDL.SDLModel.set('limitedExist', false);
- }
-
- SDL.SDLController.getApplicationModel(request.params.appID).turnOnSDL(request.params.appID);
- }
- this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
- }
- if (request.method == "BasicCommunication.GetSystemInfo") {
-
- Em.Logger.log("BasicCommunication.GetSystemInfo Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum) from SDL protocol
- "method": request.method,
- "ccpu_version": "ccpu_version",
- "language": SDL.SDLModel.hmiUILanguage,
- "wersCountryCode": "wersCountryCode"
- }
- };
- this.client.send(JSONMessage);
- }
- if (request.method == "BasicCommunication.PolicyUpdate") {
- SDL.SettingsController.policyUpdateFile = request.params.file;
-
- SDL.SDLModel.policyUpdateRetry.timeout = request.params.timeout;
- SDL.SDLModel.policyUpdateRetry.retry = request.params.retry;
- SDL.SDLModel.policyUpdateRetry.try = 0;
-
- this.GetURLS(7); //Service type for policies
-
- this.sendBCResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
- }
- }
- },
-
- /********************* Requests *********************/
-
-
- /**
- * Send request if application was activated
- *
- * @param {Number} appID
- */
- ActivateApp: function(appID) {
-
- var itemIndex = this.client.generateId();
-
- 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!");
-
- // send notification
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": itemIndex,
- "method": "SDL.ActivateApp",
- "params": {
- "appID": appID
- }
- };
- 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);
- },
-
- /**
- * Send request if application was activated
- *
- * @param {Number} type
- */
- GetURLS: function(type) {
-
- Em.Logger.log("FFW.SDL.GetURLS: Request from HMI!");
-
- // send notification
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": this.client.generateId(),
- "method": "SDL.GetURLS",
- "params": {
- "service": type
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Request from HMI to find out Policy Table status
- */
- GetStatusUpdate: function() {
-
- Em.Logger.log("SDL.GetStatusUpdate: Request from HMI!");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": this.client.generateId(),
- "method": "SDL.GetStatusUpdate",
- "params": {}
- };
- this.client.send(JSONMessage);
- },
-
- UpdateSDL: function() {
-
- Em.Logger.log("SDL.UpdateSDL: Request from HMI!");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": this.client.generateId(),
- "method": "SDL.UpdateSDL",
- "params": {}
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Request to SDLCore to get user friendly message
- * callback function uses text message came in response from SDLCore
- *
- * @callback callbackFunc
- */
- GetUserFriendlyMessage: function(callbackFunc, appID, messageCodes) {
-
- var itemIndex = this.client.generateId();
-
- SDL.SDLModel.userFriendlyMessagePull[itemIndex] = {"callbackFunc": callbackFunc, "appID": appID};
-
- Em.Logger.log("SDL.GetUserFriendlyMessage: Request from HMI!");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": itemIndex,
- "method": "SDL.GetUserFriendlyMessage",
- "params": {
- "language": SDL.SDLModel.hmiUILanguage,
- "messageCodes": messageCodes
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /**
- * Request to SDLCore to get user friendly message
- * callback function uses text message came in response from SDLCore
- *
- * @param {Number} appID
- */
- GetListOfPermissions: function(appID) {
-
- var itemIndex = this.client.generateId();
-
- SDL.SDLModel.getListOfPermissionsPull[itemIndex] = appID;
-
- Em.Logger.log("SDL.GetListOfPermissions: Request from HMI!");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": itemIndex,
- "method": "SDL.GetListOfPermissions",
- "params": {
- }
- };
-
- if (appID) {
- JSONMessage.params.appID = appID;
- }
-
- this.client.send(JSONMessage);
- },
-
- /********************* Responses *********************/
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendBCResult: function(resultCode, id, method) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": method
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Notifies if functionality was changed
- *
- * @param {Boolean}
- * allowed
- * @param {String}
- * source
- * @param {String}
- * device
- */
- OnAllowSDLFunctionality: function(allowed, source) {
-
- Em.Logger.log("FFW.SDL.OnAllowSDLFunctionality");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "SDL.OnAllowSDLFunctionality",
- "params": {
- "allowed": allowed,
- "source": source
- }
- };
-
- if (SDL.SettingsController.currentDeviceAllowance) {
- JSONMessage.params.device = SDL.SettingsController.currentDeviceAllowance;
- }
-
- this.client.send(JSONMessage);
- },
-
-
- /**
- * Notifies if language was changed
- *
- * @param {String} lang
- */
- OnSystemInfoChanged: function(lang) {
-
- Em.Logger.log("FFW.BasicCommunication.OnSystemInfoChanged");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnSystemInfoChanged",
- "params": {
- "language": lang
- }
- };
-
- this.client.send(JSONMessage);
- },
-
-
- /**
- * Notification of decrypted policy table available
- *
- * @param {String} policyfile
- */
- OnReceivedPolicyUpdate: function(policyfile) {
-
- Em.Logger.log("FFW.SDL.OnReceivedPolicyUpdate");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "SDL.OnReceivedPolicyUpdate",
- "params": {
- "policyfile": policyfile
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /**
- * Notifies if functionality was changed
- *
- * @param {Boolean}
- * allowed
- * @param {String}
- * source
- * @param {String}
- * device
- */
- OnAppPermissionConsent: function(consentedFunctions, source, appID) {
-
- Em.Logger.log("FFW.SDL.OnAppPermissionConsent");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "SDL.OnAppPermissionConsent",
- "params": {
- "consentedFunctions": consentedFunctions,
- "source": source
- }
- };
-
- if (appID) {
- JSONMessage.params.appID = appID;
- }
-
- this.client.send(JSONMessage);
- },
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * id
- * @param {String}
- * method
- * @param {Boolean}
- * allow
- */
- AllowDeviceToConnect: function(id, method, allow) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
- // from SDL
- // protocol
- "method": method,
- "allow": true
- }
- };
- this.client.send(JSONMessage);
-
- },
-
- /**
- * notification that UI is ready BasicCommunication should be sunscribed
- * to this notification
- */
- onReady: function() {
-
- Em.Logger.log("FFW.BasicCommunication.onReady");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnReady"
- };
- this.client.send(JSONMessage);
- },
-
-/**
- * Sent notification to SDL when HMI closes
- */
- OnIgnitionCycleOver: function() {
-
- Em.Logger.log("FFW.BasicCommunication.OnIgnitionCycleOver");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnIgnitionCycleOver"
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Send request if application was activated
- *
- * @param {number} appID
- */
- OnAppActivated: function(appID) {
-
- Em.Logger.log("FFW.BasicCommunication.OnAppActivated");
-
- // send notification
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnAppActivated",
- "params": {
- "appID": appID
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Send request if device was unpaired from HMI
- *
- * @param {number} appID
- */
- OnDeviceStateChanged: function(elemet) {
-
- Em.Logger.log("FFW.SDL.OnDeviceStateChanged");
-
- // send notification
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "SDL.OnDeviceStateChanged",
- "params": {
- "deviceState": "UNPAIRED",
- "deviceInternalId": "",
- "deviceId": {
- "name": elemet.deviceName,
- "id": elemet.deviceID
- }
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * This methos is request to get list of registered apps.
- */
- OnFindApplications: function() {
-
- Em.Logger.log("FFW.BasicCommunication.OnFindApplications");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnFindApplications"
- };
-
- if (SDL.SDLModel.CurrDeviceInfo.name
- || SDL.SDLModel.CurrDeviceInfo.id) {
-
- JSONMessage.params = {
- "deviceInfo": SDL.SDLModel.CurrDeviceInfo
- };
- }
-
- this.client.send(JSONMessage);
- },
-
- /**
- * Send notification to SDL Core about system errors
- */
- OnSystemError: function(error) {
-
- Em.Logger.log("FFW.SDL.OnSystemError");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "SDL.OnSystemError",
- "params": {
- "error": error
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /**
- * This methos is request to get list of registered apps.
- */
- AddStatisticsInfo: function(statisticType) {
-
- Em.Logger.log("FFW.SDL.AddStatisticsInfo");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "SDL.AddStatisticsInfo",
- "params": {
- "statisticType": statisticType
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /**
- * Request for list of avaliable devices
- */
- getDeviceList: function() {
-
- Em.Logger.log("FFW.BasicCommunication.GetDeviceList");
-
- this.getDeviceListRequestID = this.client.generateID();
-
- var JSONMessage = {
- "id": this.getDeviceListRequestID,
- "jsonrpc": "2.0",
- "method": "BasicCommunication.GetDeviceList"
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Invoked by UI component when user switches to any functionality which
- * is not other mobile application.
- *
- * @params {String}
- * @params {Number}
- */
- OnAppDeactivated: function(reason, appID) {
-
- Em.Logger.log("FFW.BasicCommunication.OnAppDeactivated");
-
- // send request
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnAppDeactivated",
- "params": {
- "appID": appID,
- "reason": reason
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Sender: HMI->SDL. When: upon phone-call event started or ended
- *
- * @params {Boolean}
- */
- OnPhoneCall: function(isActive) {
-
- Em.Logger.log("FFW.BasicCommunication.OnPhoneCall");
-
- // send request
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnPhoneCall",
- "params": {
- "isActive": isActive
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Initiated by HMI user. In response optional list of found devices -
- * if not provided, not were found.
- */
- OnStartDeviceDiscovery: function() {
-
- Em.Logger.log("FFW.BasicCommunication.OnStartDeviceDiscovery");
-
- // send request
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnStartDeviceDiscovery"
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * 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}
- */
- ExitApplication: function(appID, reason) {
-
- Em.Logger.log("FFW.BasicCommunication.OnExitApplication");
-
- // send request
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnExitApplication",
- "params": {
- "reason": reason,
- "appID": appID
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Sent by HMI to SDL to close all registered applications.
- *
- * @params {String}
- */
- ExitAllApplications: function(reason) {
-
- Em.Logger.log("FFW.BasicCommunication.OnExitAllApplications");
-
- // send request
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnExitAllApplications",
- "params": {
- "reason": reason
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Response with params of the last one supports mixing audio (ie
- * recording TTS command and playing audio).
- *
- * @params {Number}
- */
- MixingAudioSupported: function(requestid, attenuatedSupported) {
-
- Em.Logger.log("FFW.BasicCommunication.MixingAudioSupportedResponse");
-
- // send request
-
- var JSONMessage = {
- "id": requestid,
- "jsonrpc": "2.0",
- "result": {
- "code": 0,
- "attenuatedSupported": attenuatedSupported,
- "method": "BasicCommunication.MixingAudioSupported"
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Response with Results by user/HMI allowing SDL functionality or
- * disallowing access to all mobile apps.
- *
- * @params {Number}
- */
- AllowAllApps: function(allowed) {
-
- Em.Logger.log("FFW.BasicCommunication.AllowAllAppsResponse");
-
- // send request
-
- var JSONMessage = {
- "id": this.client.idStart,
- "jsonrpc": "2.0",
- "result": {
- "code": 0,
- "method": "BasicCommunication.AllowAllApps",
- "allowed": allowed
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Response with result of allowed application
- *
- * @params {Number}
- */
- AllowApp: function(request) {
-
- Em.Logger.log("FFW.BasicCommunication.AllowAppResponse");
-
- var allowedFunctions = [];
- request.params.appPermissions.forEach(function(entry) {
- allowedFunctions.push(
- {
- name: entry,
- allowed: true
- }
- )
- }
- );
-
- // send request
-
- var JSONMessage = {
- "id": request.id,
- "jsonrpc": "2.0",
- "result": {
- "code": 0,
- "method": "BasicCommunication.AllowApp",
- "allowedFunctions": allowedFunctions
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Notifies if device was choosed
- *
- * @param {String}
- * deviceName
- * @param {Number}
- * appID
- */
- OnDeviceChosen: function(deviceName, appID) {
-
- Em.Logger.log("FFW.BasicCommunication.OnDeviceChosen");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnDeviceChosen",
- "params": {
- "deviceInfo": {
- "name": deviceName,
- "id": appID
- }
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * 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}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendError: function(resultCode, id, method, message) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": {
- "method": method
- }
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Initiated by HMI.
- */
- OnSystemRequest: function(type, appID, fileName, url) {
-
- Em.Logger.log("FFW.BasicCommunication.OnSystemRequest");
-
- // send request
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "BasicCommunication.OnSystemRequest",
- "params":{
- "requestType": type,
- "url": url,
- "fileType": "JSON",
- "offset": 1000,
- "length": 10000,
- "timeout": 500,
- "fileName": fileName ? fileName : document.location.pathname.replace("index.html", "IVSU/PROPRIETARY_REQUEST"),
- "appID": appID ? appID : "default"
- }
- };
- this.client.send(JSONMessage);
- }
-
- })
diff --git a/src/components/HMI/ffw/ButtonsRPC.js b/src/components/HMI/ffw/ButtonsRPC.js
deleted file mode 100644
index d4dc198ce2..0000000000
--- a/src/components/HMI/ffw/ButtonsRPC.js
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Reference implementation of Buttons component.
- *
- * Buttons sends to SDLCore press and hold events of soft buttons, presets and
- * some hard keys.
- */
-
-FFW.Buttons = FFW.RPCObserver.create( {
-
- /*
- * access to basic RPC functionality
- */
- client: FFW.RPCClient.create( {
- componentName: "Buttons"
- }),
-
- /**
- * Contains response codes for request that should be processed but there were some kind of errors
- * Error codes will be injected into response.
- */
- errorResponsePull: {},
-
- /*
- * connect to RPC bus
- */
- connect: function() {
-
- this.client.connect(this, 200); // Magic number is unique identifier for
- // component
- },
-
- /*
- * disconnect from RPC bus
- */
- disconnect: function() {
-
- this.onRPCUnregistered();
- this.client.disconnect();
- },
-
- /*
- * Client is registered - we can send request starting from this point of
- * time
- */
- onRPCRegistered: function() {
-
- Em.Logger.log("FFW.Buttons.onRPCRegistered");
- this._super();
- },
-
- /*
- * Client is unregistered - no more requests
- */
- onRPCUnregistered: function() {
-
- Em.Logger.log("FFW.Buttons.onRPCUnregistered");
- this._super();
- },
-
- /*
- * Client disconnected.
- */
- onRPCDisconnected: function() {
-
- },
-
- /*
- * when result is received from RPC component this function is called It is
- * the propriate place to check results of reuqest execution Please use
- * previously store reuqestID to determine to which request repsonse belongs
- * to
- */
- onRPCResult: function(response) {
-
- Em.Logger.log("FFW.Buttons.onRPCResult");
- this._super();
- },
-
- /*
- * handle RPC erros here
- */
- onRPCError: function(error) {
-
- Em.Logger.log("FFW.Buttons.onRPCError");
- this._super();
- },
-
- /*
- * handle RPC notifications here
- */
- onRPCNotification: function(notification) {
-
- Em.Logger.log("FFW.Buttons.onRPCNotification");
- this._super();
- },
-
- /*
- * handle RPC requests here
- */
- onRPCRequest: function(request) {
-
- Em.Logger.log("FFW.Buttons.onRPCRequest");
- this._super();
-
- if (request.method == "Buttons.GetCapabilities") {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "capabilities": [
- {
- "name": "PRESET_0",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_1",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_2",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_3",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_4",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_5",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_6",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_7",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_8",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_9",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "OK",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "SEEKLEFT",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "SEEKRIGHT",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "TUNEUP",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "TUNEDOWN",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }
- ],
- "presetBankCapabilities": {
- "onScreenPresetsAvailable": true
- },
- "code": 0,
- "method": "Buttons.GetCapabilities"
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendError: function(resultCode, id, method, message) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": {
- "method": method
- }
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /*
- * Notifies the ButtonsRPC that the web is all set. Should be called twice:
- * when the RPC link is up or failed to connect and all the views are
- * rendered.
- */
- buttonPressed: function(id, type) {
-
- Em.Logger.log("FFW.Buttons.buttonPressed " + type);
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "Buttons.OnButtonPress",
- "params": {
- "name": id,
- "mode": type
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /*
- * Notifies the ButtonsRPC that the web is all set. Should be called twice:
- * when the RPC link is up or failed to connect and all the views are
- * rendered.
- */
- buttonEvent: function(id, type) {
-
- Em.Logger.log("FFW.Buttons.OnButtonEvent " + type);
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "Buttons.OnButtonEvent",
- "params": {
- "name": id,
- "mode": type
- }
- };
-
- this.client.send(JSONMessage);
-
- },
-
- /*
- * Notifies the ButtonsRPC that the web is all set. Should be called twice:
- * when the RPC link is up or failed to connect and all the views are
- * rendered.
- */
- buttonPressedCustom: function(name, type, softButtonID, appID) {
-
- Em.Logger.log("FFW.Buttons.OnButtonPress " + type);
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "Buttons.OnButtonPress",
- "params": {
- "name": name,
- "mode": type,
- "customButtonID": softButtonID,
- "appID": appID
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /*
- * Notifies the ButtonsRPC that the web is all set. Should be called twice:
- * when the RPC link is up or failed to connect and all the views are
- * rendered.
- */
- buttonEventCustom: function(name, type, softButtonID, appID) {
-
- Em.Logger.log("FFW.Buttons.OnButtonEvent " + type);
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "Buttons.OnButtonEvent",
- "params": {
- "name": name,
- "mode": type,
- "customButtonID": softButtonID,
- "appID": appID
- }
- };
-
- this.client.send(JSONMessage);
-
- }
-});
diff --git a/src/components/HMI/ffw/Framework.js b/src/components/HMI/ffw/Framework.js
deleted file mode 100644
index 4ab772528f..0000000000
--- a/src/components/HMI/ffw/Framework.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name FFW
- * @desc Setup framework namespace and settings
- * @category Framework
- * @filesource app/Framework.js
- * @version 1.0
- */
-
-FFW = Em.Object.create( {
-
- init: function() {
-
- Em.Logger.log('FFW: Framework init');
- }
-}); \ No newline at end of file
diff --git a/src/components/HMI/ffw/NavigationRPC.js b/src/components/HMI/ffw/NavigationRPC.js
deleted file mode 100644
index 463dbfe976..0000000000
--- a/src/components/HMI/ffw/NavigationRPC.js
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Reference implementation of Navigation component.
- *
- * Interface to get or set some essential information sent from SDLCore.
- * Navigation is responsible for the navigationApp functionality provided by the
- * application: display graphics and multimedia components, is responsible for
- * the transfer of managed manipulations, generated by the user to the server.
- *
- */
-
-FFW.Navigation = FFW.RPCObserver.create( {
-
- /**
- * If true then Navigation is present and ready to communicate with SDL.
- *
- * @type {Boolean}
- */
- isReady: true,
-
- /**
- * Contains response codes for request that should be processed but there were some kind of errors
- * Error codes will be injected into response.
- */
- errorResponsePull: {},
-
- /**
- * access to basic RPC functionality
- */
- client: FFW.RPCClient.create( {
- componentName: "Navigation"
- }),
-
- // temp var for debug
- appID: 1,
-
- /**
- * connect to RPC bus
- */
- connect: function() {
-
- this.client.connect(this, 800); // Magic number is unique identifier for
- // component
- },
-
- /**
- * disconnect from RPC bus
- */
- disconnect: function() {
-
- this.onRPCUnregistered();
- this.client.disconnect();
- },
-
- /**
- * Client is registered - we can send request starting from this point of
- * time
- */
- onRPCRegistered: function() {
-
- Em.Logger.log("FFW.Navigation.onRPCRegistered");
- this._super();
-
- // subscribe to notifications
- },
-
- /**
- * Client is unregistered - no more requests
- */
- onRPCUnregistered: function() {
-
- Em.Logger.log("FFW.Navigation.onRPCUnregistered");
- this._super();
-
- // unsubscribe from notifications
- },
-
- /**
- * Client disconnected.
- */
- onRPCDisconnected: function() {
-
- },
-
- /**
- * when result is received from RPC component this function is called It is
- * the propriate place to check results of request execution Please use
- * previously store reuqestID to determine to which request repsonse belongs
- * to
- */
- onRPCResult: function(response) {
-
- Em.Logger.log("FFW.Navigation.onRPCResult");
- this._super();
- },
-
- /**
- * handle RPC erros here
- */
- onRPCError: function(error) {
-
- Em.Logger.log("FFW.Navigation.onRPCError");
- this._super();
- },
-
- /**
- * handle RPC notifications here
- */
- onRPCNotification: function(notification) {
-
- Em.Logger.log("FFW.Navigation.onRPCNotification");
- this._super();
-
- if (notification.method == this.onStopStreamNotification) {
- SDL.SDLModel.onStopStream(notification.params.appID);
- }
- },
-
- /**
- * handle RPC requests here
- */
- onRPCRequest: function(request) {
-
- Em.Logger.log("FFW.Navigation.onRPCRequest");
- if (this.validationCheck(request)) {
-
- var resultCode = null;
-
- switch (request.method) {
- case "Navigation.IsReady": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "available": this.get('isReady'),
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "Navigation.IsReady"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
- }
- 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);
-
- break;
- }
- 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,
- request.method);
-
- break;
- }
- 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,
- request.method);
-
- break;
- }
- case "Navigation.StartAudioStream": {
-
- SDL.SDLModel.startAudioStream(request);
-
- break;
- }
- case "Navigation.StopAudioStream": {
-
- SDL.SDLModel.stoptAudioStream(request.params.appID);
-
- this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
-
- break;
- }
- case "Navigation.StartStream": {
-
- SDL.SDLModel.startStream(request);
-
- break;
- }
- case "Navigation.StopStream": {
-
- SDL.SDLModel.stopStream(request.params.appID);
-
- this.sendNavigationResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
-
- break;
- }
- 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);
-
- break;
- }
- }
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendError: function(resultCode, id, method, message) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": {
- "method": method
- }
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- 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"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": method
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Notifies if TBTClientState was activated
- *
- * @param {String}
- * state
- * @param {Number}
- * appID
- */
- onTBTClientState: function(state, appID) {
-
- Em.Logger.log("FFW.Navigation.OnTBTClientState");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "Navigation.OnTBTClientState",
- "params": {
- "state": state
- }
- };
- this.client.send(JSONMessage);
- }
-}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/RPCClient.js b/src/components/HMI/ffw/RPCClient.js
deleted file mode 100644
index 5df06334d2..0000000000
--- a/src/components/HMI/ffw/RPCClient.js
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Base class for RPC client
- *
- * Class provides access to basic functionality of RPC components Message Broker
- * as: registerComponent unregisterComponent subscription to notifications logic
- * to calculate request id
- */
-
-FFW.RPCClient = Em.Object
- .extend( {
-
- /*
- * transport layer for messages exchange
- */
- socket: null, // instance of websocket
-
- /*
- * url for message broker
- */
- url: FLAGS.WEBSOCKET_URL,
-
- /*
- * Component name in RPC system It is unique.
- */
- componentName: null,
-
- /*
- * observer of RPC states
- */
- observer: null,
-
- /*
- * these variables are used to have unique request ids for different
- * components in RPC bus idStart is received as a response for
- * registerRPCComponent messages. space for ids for specific RPC
- * component is allocated by message broker
- */
- idStart: -1,
- idRange: 1000,
- requestId: -1,
-
- registerRequestId: -1,
- unregisterRequestId: -1,
-
- /*
- * Open WebSocket and initialize handlers
- */
- connect: function(observer, startId) {
-
- this.observer = observer;
- this.idStart = startId;
-
- this.socket = new WebSocket(this.url);
-
- var self = this;
-
- this.socket.onopen = function(evt) {
-
- self.onWSOpen(evt)
- };
- this.socket.onclose = function(evt) {
-
- self.onWSClose(evt)
- };
- this.socket.onmessage = function(evt) {
-
- self.onWSMessage(evt)
- };
- this.socket.onerror = function(evt) {
-
- self.onWSError(evt)
- };
-
- },
-
- /*
- * Close WebSocket connection Please make sure that component was
- * unregistered in advance
- */
- disconnect: function() {
-
- this.unregisterRPCComponent();
- SDL.SDLController.unregisterComponentStatus(this.observer.client.componentName);
- },
-
- /*
- * WebSocket connection is ready Now RPC component can be registered in
- * message broker
- */
- onWSOpen: function(evt) {
-
- Em.Logger.log("RPCCLient.onWSOpen");
-
- this.registerRPCComponent();
- },
-
- /*
- * when result is received from RPC component this function is called It
- * is the propriate place to check results of reuqest execution Please
- * use previously store reuqestID to determine to which request repsonse
- * belongs to
- */
- onWSMessage: function(evt) {
-
- Em.Logger.log("Message received: " + evt.data);
-
- 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;
- 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) {
- this.requestId = this.idStart = jsonObj.result;
- this.observer.onRPCRegistered();
- }
- // handle component unregistration
- } else if (jsonObj.id == this.unregisterRequestId) {
- if (jsonObj.error == null) {
- this.socket.close();
- this.observer.onRPCUnregistered();
- }
- // handle result, error, notification, requests
- } else {
- if (jsonObj.id == null) {
- this.observer.onRPCNotification(jsonObj);
- } else {
- if (jsonObj.result != null)
- this.observer.onRPCResult(jsonObj);
- else if (jsonObj.error != null)
- this.observer.onRPCError(jsonObj);
- else
- this.observer.onRPCRequest(jsonObj);
- }
- }
- },
-
- /*
- * WebSocket connection is closed Please make sure that RPCComponent was
- * dunregistered in advance
- */
- onWSClose: function(evt) {
-
- Em.Logger.log("RPCClient: Connection is closed");
-
- SDL.SDLController.unregisterComponentStatus(this.observer.client.componentName);
-
- var self = this;
- setTimeout(function(){
- self.connect(self.observer, self.idStart);
- }, 5000);
- this.observer.onRPCDisconnected();
- },
-
- /*
- * WebSocket connection errors handling
- */
- onWSError: function(evt) {
-
- // Em.Logger.log("ERROR: " + evt.data);
- Em.Logger.log("ERROR: ");
- },
-
- /*
- * register component is RPC bus
- */
- registerRPCComponent: function() {
-
- this.registerRequestId = this.idStart;
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": this.registerRequestId,
- "method": "MB.registerComponent",
- "params": {
- "componentName": this.componentName
- }
- };
- this.send(JSONMessage);
- },
-
- /*
- * unregister component is RPC bus
- */
- unregisterRPCComponent: function() {
-
- this.unregisterRequestId = this.generateId();
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": this.unregisterRequestId,
- "method": "MB.unregisterComponent",
- "params": {
- "componentName": this.componentName
- }
- };
- this.send(JSONMessage);
- },
-
- /*
- * Subscribes to notification. Returns the request's id.
- */
- subscribeToNotification: function(notification) {
-
- var msgId = this.generateId();
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": msgId,
- "method": "MB.subscribeTo",
- "params": {
- "propertyName": notification
- }
- };
- this.send(JSONMessage);
- return msgId;
- },
-
- /*
- * Unsubscribes from notification. Returns the request's id.
- */
- unsubscribeFromNotification: function(notification) {
-
- var msgId = this.generateId();
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": msgId,
- "method": "MB.unsubscribeFrom",
- "params": {
- "propertyName": notification
- }
- };
- this.send(JSONMessage);
- return msgId;
- },
-
- /*
- * stringify object and send via socket connection
- */
- send: function(obj) {
-
- if (this.socket.readyState == this.socket.OPEN) {
-
- var strJson = JSON.stringify(obj);
- Em.Logger.log(strJson);
-
- var logTime = new Date();
- console.log(logTime.getHours() + ":" + logTime.getMinutes() + ":" + logTime.getSeconds() + ":" + logTime.getMilliseconds());
-
- this.socket.send(strJson);
- } else {
- Em.Logger
- .error("RPCClient: Can't send message since socket is not ready");
- }
- },
-
- /*
- * Generate id for new request to RPC component Function has to be used
- * as private
- */
- generateId: function() {
-
- this.requestId++;
- if (this.requestId >= this.idStart + this.idRange)
- this.requestId = this.idStart;
- return this.requestId;
- }
-
- })
diff --git a/src/components/HMI/ffw/RPCObserver.js b/src/components/HMI/ffw/RPCObserver.js
deleted file mode 100644
index 76b002aa8b..0000000000
--- a/src/components/HMI/ffw/RPCObserver.js
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @desc Observer of RPCClient
- */
-
-FFW.RPCObserver = Em.Object
- .extend( {
-
- onRPCRegistered: function() {
-
- // request necessary parameters from Backend
- SDL.SDLController.registeredComponentStatus(this.client.componentName);
- },
-
- onRPCUnregistered: function() {
-
- Em.Logger.log("FFW.RPCObserver.onUnregistered");
- },
-
- onRPCDisconnected: function() {
-
- Em.Logger.log("FFW.RPCObserver.onRPCDisconnected");
- },
-
- /*
- * when result is received from RPC component this function is called It
- * is the propriate place to check results of reuqest execution Please
- * use previously store reuqestID to determine to which request repsonse
- * belongs to
- */
- onRPCResult: function(result) {
-
- // parse JSON string and set necessary properties
- },
-
- /*
- */
- onRPCError: function(error) {
-
- // parse JSON string and set necessary properties
- },
-
- /*
- */
- onRPCNotification: function(notification) {
-
- // parse JSON string and set necessary properties
- },
-
- 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) {
- var parsedMethod = request.method.split(/[.]/), validateFunc, result;
-
- //if (request.params && "appID" in request.params && SDL.SDLModel.registeredApps.filterProperty('appID', request.params.appID).length > 0) {
-
- if (request.params && "appID" in request.params && typeof(request.params.appID) == "number" && SDL.SDLModel.registeredApps.filterProperty('appID', request.params.appID).length <= 0) {
- Em.Logger.error('No application registered with current appID!');
- return false;
- }
-
- if (SDL.RPCController[parsedMethod[0]][parsedMethod[1]]) {
- validateFunc = SDL.RPCController[parsedMethod[0]][parsedMethod[1]];
- result = validateFunc(request.params);
-
- if (result.resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
- this.sendError(result.resultCode,
- request.id,
- request.method,
- result.resultMessage);
- return false;
- } else {
- return true;
- }
- } else {
- this.sendError(SDL.SDLModel.resultCode["UNSUPPORTED_REQUEST"],
- request.id,
- request.method,
- 'Unsupported incoming request! ' + parsedMethod[0]
- + '.' + parsedMethod[1]);
- Em.Logger.error('No method "' + parsedMethod[0] + '.'
- + parsedMethod[1] + '"');
- return false;
- }
- }
- }
- });
diff --git a/src/components/HMI/ffw/TTSRPC.js b/src/components/HMI/ffw/TTSRPC.js
deleted file mode 100644
index 0e0b92acd4..0000000000
--- a/src/components/HMI/ffw/TTSRPC.js
+++ /dev/null
@@ -1,476 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Reference implementation of TTS component.
- *
- * TTS is responsible for playing sound data sent from SDLCore to notify user
- * about some events happened.
- */
-
-FFW.TTS = FFW.RPCObserver.create( {
-
- /**
- * If true then TTS is present and ready to communicate with SDL.
- *
- * @type {Boolean}
- */
- isReady: true,
-
- /**
- * Contains response codes for request that should be processed but there were some kind of errors
- * Error codes will be injected into response.
- */
- errorResponsePull: {},
-
- /**
- * Request id of current running Speak request
- *
- * @type {Boolean}
- */
- requestId: null,
-
- /**
- * Flag to determine if Speak request was aborted
- *
- * @type {Boolean}
- */
- aborted: false,
-
- /*
- * access to basic RPC functionality
- */
- client: FFW.RPCClient.create( {
- componentName: "TTS"
- }),
-
- /*
- * connect to RPC bus
- */
- connect: function() {
-
- this.client.connect(this, 300); // Magic number is unique identifier for
- // component
- },
-
- /*
- * disconnect from RPC bus
- */
- disconnect: function() {
-
- this.onRPCUnregistered();
- this.client.disconnect();
- },
-
- /*
- * Client is registered - we can send request starting from this point of
- * time
- */
- onRPCRegistered: function() {
-
- Em.Logger.log("FFW.TTS.onRPCRegistered");
- this._super();
- },
-
- /*
- * Client is unregistered - no more requests
- */
- onRPCUnregistered: function() {
-
- Em.Logger.log("FFW.TTS.onRPCUnregistered");
- this._super();
- },
-
- /*
- * Client disconnected.
- */
- onRPCDisconnected: function() {
-
- },
-
- /*
- * when result is received from RPC component this function is called It is
- * the propriate place to check results of reuqest execution Please use
- * previously store reuqestID to determine to which request repsonse belongs
- * to
- */
- onRPCResult: function(response) {
-
- Em.Logger.log("FFW.TTS.onRPCResult");
- this._super();
- },
-
- /*
- * handle RPC erros here
- */
- onRPCError: function(error) {
-
- Em.Logger.log("FFW.TTS.onRPCError");
- this._super();
- },
-
- /*
- * handle RPC notifications here
- */
- onRPCNotification: function(notification) {
-
- Em.Logger.log("FFW.TTS.onRPCNotification");
- this._super();
- },
-
- /*
- * handle RPC requests here
- */
- onRPCRequest: function(request) {
-
- Em.Logger.log("FFW.TTS.onRPCRequest");
- this._super();
-
- 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 {
- this.requestId = request.id;
- SDL.SDLModel.onPrompt(request.params.ttsChunks, request.params.appID);
- }
-
- break;
- }
- 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"],
- request.id,
- request.method);
-
- break;
- }
- case "TTS.StopSpeaking": {
-
- SDL.SDLModel.TTSStopSpeaking();
-
- this.sendTTSResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
-
- break;
- }
- case "TTS.GetCapabilities": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "speechCapabilities": [
- "TEXT",
- "PRE_RECORDED"
- ],
- "prerecordedSpeechCapabilities": [
- "HELP_JINGLE",
- "INITIAL_JINGLE",
- "LISTEN_JINGLE",
- "POSITIVE_JINGLE",
- "NEGATIVE_JINGLE"
- ],
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
- // from SDL
- // protocol
- "method": "TTS.GetCapabilities"
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
- case "TTS.GetSupportedLanguages": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
- // from SDL
- "method": "TTS.GetSupportedLanguages",
- "languages": SDL.SDLModel.sdlLanguagesList
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
- case "TTS.GetLanguage": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type (enum)
- // from SDL
- "method": "TTS.GetLanguage",
- "language": SDL.SDLModel.hmiTTSVRLanguage
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
- 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"],
- request.id,
- request.method);
-
- break;
- }
-
- case "TTS.IsReady": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "available": this.get('isReady'),
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "TTS.IsReady"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
- }
-
- default: {
- // statements_def
- break;
- }
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendError: function(resultCode, id, method, message) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": {
- "method": method
- }
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- 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"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": method
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /*
- * Notifies if sdl TTS components language was changed
- */
- OnLanguageChange: function(lang) {
-
- Em.Logger.log("FFW.TTS.OnLanguageChange");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "TTS.OnLanguageChange",
- "params": {
- "language": lang
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Initiated by TTS module to let SDL know that TTS session has started.
- */
- Started: function() {
-
- Em.Logger.log("FFW.TTS.Started");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "TTS.Started"
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Sent OnResetTimeout notification to SDLCore to inform when
- * HMI pronounces text longer than 10 seconds
- */
- OnResetTimeout: function(appID, methodName) {
-
- Em.Logger.log("FFW.TTS.OnResetTimeout");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "TTS.OnResetTimeout",
- "params": {
- "appID": appID,
- "methodName": methodName
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Initiated by TTS module to let SDL know that TTS session has stopped.
- */
- Stopped: function() {
-
- Em.Logger.log("FFW.TTS.Stopped");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "TTS.Stopped"
- };
- this.client.send(JSONMessage);
- }
-}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/UIRPC.js b/src/components/HMI/ffw/UIRPC.js
deleted file mode 100644
index 5feb304d20..0000000000
--- a/src/components/HMI/ffw/UIRPC.js
+++ /dev/null
@@ -1,1857 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Reference implementation of UI component.
- *
- * Interface to get or set some essential information sent from SDLCore. UI is
- * responsible for the functionality provided by the application: display
- * graphics and multimedia components, is responsible for the transfer of
- * managed manipulations, generated by the user to the server.
- *
- */
-
-FFW.UI = FFW.RPCObserver.create({
-
- /**
- * If true then UI is present and ready to communicate with SDL.
- *
- * @type {Boolean}
- */
- isReady: true,
-
- /**
- * Contains response codes for request that should be processed but there were some kind of errors
- * Error codes will be injected into response.
- */
- errorResponsePull: {},
-
- /**
- * access to basic RPC functionality
- */
- client: FFW.RPCClient.create({
- componentName: "UI"
- }),
-
- // temp var for debug
- appID: 1,
-
- onRecordStartSubscribeRequestID: -1,
-
- onRecordStartUnsubscribeRequestID: -1,
-
- // const
- onRecordStartNotification: "UI.OnRecordStart",
-
- /**
- * ids for requests AudioPassThru
- */
- performAudioPassThruRequestID: -1,
- endAudioPassThruRequestID: -1,
-
- /**
- * connect to RPC bus
- */
- connect: function () {
-
- this.client.connect(this, 400); // Magic number is unique identifier
- // for component
- },
-
- /**
- * disconnect from RPC bus
- */
- disconnect: function () {
-
- this.onRPCUnregistered();
- this.client.disconnect();
- },
-
- /**
- * Client is registered - we can send request starting from this point
- * of time
- */
- onRPCRegistered: function () {
-
- Em.Logger.log("FFW.UI.onRPCRegistered");
- this._super();
-
- // subscribe to notifications
- this.onRecordStartSubscribeRequestID = this.client.subscribeToNotification(this.onRecordStartNotification);
- },
-
- /**
- * Client is unregistered - no more requests
- */
- onRPCUnregistered: function () {
-
- Em.Logger.log("FFW.UI.onRPCUnregistered");
- this._super();
-
- // unsubscribe from notifications
- this.onRecordStartUnsubscribeRequestID = this.client.unsubscribeFromNotification(this.onRecordStartNotification);
- },
-
- /**
- * Client disconnected.
- */
- onRPCDisconnected: function () {
-
- },
-
- /**
- * when result is received from RPC component this function is called It
- * is the propriate place to check results of request execution Please
- * use previously store reuqestID to determine to which request repsonse
- * belongs to
- */
- onRPCResult: function (response) {
-
- Em.Logger.log("FFW.UI.onRPCResult");
- this._super();
- },
-
- /**
- * handle RPC erros here
- */
- onRPCError: function (error) {
-
- Em.Logger.log("FFW.UI.onRPCError");
- this._super();
- },
-
- /**
- * handle RPC notifications here
- */
- onRPCNotification: function (notification) {
-
- Em.Logger.log("FFW.UI.onRPCNotification");
- this._super();
-
- if (notification.method == this.onRecordStartNotification) {
- SDL.AudioPassThruPopUp.StartAudioPassThruTimer();
- }
- },
-
- /**
- * handle RPC requests here
- */
- onRPCRequest: function (request) {
-
- Em.Logger.log("FFW.UI.onRPCRequest");
-
- if (this.validationCheck(request)) {
-
- switch (request.method) {
- 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);
- }
-
- break;
- }
- 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);
-
- break;
- }
- case "UI.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 ("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);
-
- break;
- }
- 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;
- }
- case "UI.DeleteCommand":
- {
-
- SDL.SDLController.getApplicationModel(request.params.appID).deleteCommand(request.params.cmdID, request.id);
-
- break;
- }
- case "UI.AddSubMenu":
- {
-
- SDL.SDLController.getApplicationModel(request.params.appID).addSubMenu(request);
-
- break;
- }
- case "UI.DeleteSubMenu":
- {
-
- var resultCode = SDL.SDLController.getApplicationModel(request.params.appID).deleteSubMenu(request.params.menuID);
- this.sendUIResult(resultCode, request.id, request.method);
-
- break;
- }
- 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();
- }
-
- break;
- }
- case "UI.SetMediaClockTimer":
- {
-
- var resultCode = SDL.SDLController.getApplicationModel(request.params.appID).sdlSetMediaClockTimer(request.params);
- 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.');
- }
-
- break;
- }
- case "UI.Slider":
- {
-
- if (SDL.SDLModel.uiSlider(request)) {
- SDL.SDLController.onSystemContextChange();
- }
-
- break;
- }
- case "UI.ScrollableMessage":
- {
-
- if (SDL.SDLModel.onSDLScrolableMessage(request, request.id)) {
- SDL.SDLController.onSystemContextChange();
- }
-
- break;
- }
- case "UI.ChangeRegistration":
- {
-
- if (request.params.appName) {
- SDL.SDLController.getApplicationModel(request.params.appID).set('appName',
- request.params.appName);
- }
-
- SDL.SDLModel.changeRegistrationUI(request.params.language,
- request.params.appID,
- request.params.appName);
- this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
-
- break;
- }
- case "UI.SetDisplayLayout":
- {
-
- var senResponseFlag = false;
-
- switch (request.params.displayLayout){
- case "MEDIA": {
- senResponseFlag = true;
- break;
- }
- case "NON-MEDIA": {
- senResponseFlag = true;
- break;
- }
- case "DEFAULT": {
- senResponseFlag = true;
- break;
- }
- case "ONSCREEN_PRESETS": {
- senResponseFlag = true;
- break;
- }
- case "NAV_FULLSCREEN_MAP": {
- senResponseFlag = true;
- break;
- }
- case "NAV_KEYBOARD": {
- senResponseFlag = true;
- break;
- }
- case "NAV_LIST": {
- senResponseFlag = true;
- break;
- }
- }
-
- if (senResponseFlag) {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "displayCapabilities": {
- "displayType": "GEN2_8_DMA",
- "textFields": [{
- "name": "mainField1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField4",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "statusBar",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaClock",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaTrack",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "scrollableMessageBody",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "initialInteractionText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "ETA",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "totalDistance",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderHeader",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderFooter",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "notificationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuName",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "secondaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "tertiaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "timeToDestination",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "turnText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuTitle",
- "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": [
- {
- "name": "softButtonImage",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "choiceImage",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "choiceSecondaryImage",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "vrHelpItem",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "turnIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "menuIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "cmdIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "graphic",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "showConstantTBTIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "showConstantTBTNextTurnIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "showConstantTBTNextTurnIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- }
- ],
- "mediaClockFormats": [
- "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4"
- ],
- "graphicSupported": true,
- "imageCapabilities": ["DYNAMIC", "STATIC"],
- "templatesAvailable": [request.params.displayLayout],
- "screenParams": {
- "resolution": {
- "resolutionWidth": 800,
- "resolutionHeight": 480
- },
- "touchEventAvailable": {
- "pressAvailable": true,
- "multiTouchAvailable": true,
- "doublePressAvailable": false
- }
- },
- "numCustomPresetsAvailable": 10
- },
- "buttonCapabilities": [
- {
- "name": "PRESET_0",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_1",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_2",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_3",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_4",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_5",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_6",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_7",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_8",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "PRESET_9",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "OK",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "SEEKLEFT",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "SEEKRIGHT",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "TUNEUP",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }, {
- "name": "TUNEDOWN",
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true
- }
- ],
- "softButtonCapabilities": [{
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true,
- "imageSupported": true
- }],
- "presetBankCapabilities": {
- "onScreenPresetsAvailable": true
- },
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "UI.SetDisplayLayout"
- }
- };
-
- this.client.send(JSONMessage);
-
- } else {
- this.sendError(SDL.SDLModel.resultCode["UNSUPPORTED_RESOURCE"], request.id, request.method, "Unsupported display layout!")
- }
-
- break;
- }
- 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;
- }
- case "UI.PerformAudioPassThru":
- {
-
- if (this.performAudioPassThruRequestID > 0) {
- this.sendError(
- SDL.SDLModel.resultCode["REJECTED"],
- request.id,
- request.method,
- 'PerformAudioPassThru request aborted!');
- } else {
-
- this.performAudioPassThruRequestID = request.id;
- SDL.SDLModel.UIPerformAudioPassThru(request.params);
-
- SDL.SDLController.onSystemContextChange();
- }
-
- break;
- }
- case "UI.EndAudioPassThru":
- {
-
- this.endAudioPassThruRequestID = request.id;
-
- SDL.SDLModel.UIEndAudioPassThru();
-
- break;
- }
- case "UI.GetSupportedLanguages":
- {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- var JSONMessage = {
- "id": request.id,
- "jsonrpc": "2.0",
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type
- // (enum)
- // from
- // SDL
- "method": "UI.GetSupportedLanguages",
- "languages": SDL.SDLModel.sdlLanguagesList
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
- case "UI.GetLanguage":
- {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type
- // (enum)
- // from
- // SDL
- "method": "UI.GetLanguage",
- "language": SDL.SDLModel.hmiUILanguage
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
- case "UI.GetCapabilities":
- {
-
- Em.Logger.log("FFW." + request.method + "Response");
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "displayCapabilities": {
- "displayType": "GEN2_8_DMA",
- "textFields": [{
- "name": "mainField1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField4",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "statusBar",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaClock",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaTrack",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "scrollableMessageBody",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "initialInteractionText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "ETA",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "totalDistance",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderHeader",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderFooter",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "notificationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuName",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "secondaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "tertiaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "timeToDestination",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "turnText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuTitle",
- "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": [
- {
- "name": "softButtonImage",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "choiceImage",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "choiceSecondaryImage",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "vrHelpItem",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "turnIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "menuIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "cmdIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "graphic",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "showConstantTBTIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "showConstantTBTNextTurnIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- },
- {
- "name": "showConstantTBTNextTurnIcon",
- "imageTypeSupported":
- [
- "GRAPHIC_BMP",
- "GRAPHIC_JPEG",
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth": 64,
- "resolutionHeight": 64
- }
- }
- ],
- "mediaClockFormats": [
- "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4"
- ],
- "graphicSupported": true,
- "imageCapabilities": ["DYNAMIC", "STATIC"],
- "templatesAvailable": ["TEMPLATE"],
- "screenParams": {
- "resolution": {
- "resolutionWidth": 800,
- "resolutionHeight": 480
- },
- "touchEventAvailable": {
- "pressAvailable": true,
- "multiTouchAvailable": true,
- "doublePressAvailable": false
- }
- },
- "numCustomPresetsAvailable": 10
- },
- "audioPassThruCapabilities": {
- "samplingRate": "44KHZ",
- "bitsPerSample": "8_BIT",
- "audioType": "PCM"
- },
- "hmiZoneCapabilities": "FRONT",
- "softButtonCapabilities": {
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true,
- "imageSupported": true
- },
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "UI.GetCapabilities"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
- }
- case "UI.IsReady":
- {
-
- Em.Logger.log("FFW." + request.method + "Response");
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "available": this.get('isReady'),
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "UI.IsReady"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
- }
- case "UI.ClosePopUp":
- {
-
- SDL.SDLController.closePopUp(request.params.methodName);
-
-
- Em.Logger.log("FFW." + request.method + "Response");
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "UI.ClosePopUp"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
- }
- case "UI.ShowVrHelp":
- {
-
- //SDL.SDLModel.ShowVrHelp(request.params);
-
- this.sendUIResult(SDL.SDLModel.resultCode["SUCCESS"], request.id, request.method);
-
- break;
- }
- default:
- {
- // statements_def
- break;
- }
- }
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendError: function (resultCode, id, method, message) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode !== 0) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": {
- "method": method
- }
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- 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"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": method
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- */
- alertResponse: function (resultCode, id) {
-
- Em.Logger.log("FFW.UI.AlertResponse");
-
- switch (resultCode) {
- case SDL.SDLModel.resultCode["SUCCESS"]: {
-
- this.sendUIResult(resultCode, id, 'UI.Alert');
-
- break;
- }
- case SDL.SDLModel.resultCode["ABORTED"]: {
-
- this.sendError(resultCode, id, "UI.Alert", 'Alert request aborted.');
- break;
- }
- case SDL.SDLModel.resultCode["REJECTED"]: {
-
- this.sendError(resultCode, id, "UI.Alert", 'Another Alert is active.');
- break;
- }
- }
- },
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * sliderRequestID
- * @param {Number}
- * sliderPosition
- */
- sendSliderResult: function (resultCode, sliderRequestID, sliderPosition) {
-
-
- Em.Logger.log("FFW.UI.SliderResponse");
-
- if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
-
- this.sendUIResult(resultCode, id, 'UI.Alert');
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": sliderRequestID,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": 'UI.Slider'
- }
- };
-
- if (sliderPosition) {
- JSONMessage.result.sliderPosition = sliderPosition;
- }
- } else {
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": sliderRequestID,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": 'Slider request ABORTED or TIMED OUT.',
- "data": {
- "method": 'UI.Slider'
- }
- }
- };
-
- if (sliderPosition) {
- JSONMessage.error.data.sliderPosition = sliderPosition;
- }
- }
-
- this.client.send(JSONMessage);
- },
-
- /**
- * Notification method to send touch event data to SDLCore
- *
- * @param {Number} appID
- * @param {String} methodName
- */
- onResetTimeout: function (appID, methodName) {
-
- Em.Logger.log("FFW.UI.OnResetTimeout");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnResetTimeout",
- "params": {
- "methodName": methodName,
- "appID": appID
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * send notification when command was triggered
- *
- * @param {Number}
- * commandID
- * @param {Number}
- * appID
- */
- onCommand: function (commandID, appID) {
-
- Em.Logger.log("FFW.UI.onCommand");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnCommand",
- "params": {
- "cmdID": commandID,
- "appID": appID
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Notification method to send touch event data to SDLCore
- *
- * @param {String} type
- * @param {Object} touchLists
- * @param {Object} info
- */
- onTouchEvent: function (type, event) {
-
- Em.Logger.log("FFW.UI.OnTouchEvent");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnTouchEvent",
- "params": {
- "type": type,
- "event": event
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * send notification when command was triggered
- *
- * @param {Number}
- * softButtonID
- * @param {Number}
- * appID
- */
- onCommandSoftButton: function (softButtonID, appID) {
-
- Em.Logger.log("FFW.UI.onCommand");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnCommand",
- "params": {
- "commandID": softButtonID,
- "appID": appID
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * send notification when command was triggered
- *
- * @param {Number} requestID
- * @param {Number} resultCode
- * @param {Number} commandID
- * @param {String} manualTextEntry
- */
- interactionResponse: function (requestID, resultCode, commandID, manualTextEntry) {
-
- 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 = {
- "jsonrpc": "2.0",
- "id": requestID,
- "result": {
- "code": resultCode,
- "method": "UI.PerformInteraction"
- }
- };
-
- if (commandID) {
- JSONMessage.result.choiceID = commandID;
- }
-
- if (manualTextEntry != null) {
- JSONMessage.result.manualTextEntry = manualTextEntry;
- }
- } else {
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": requestID,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": "Perform Interaction error response.",
- "data": {
- "method": "UI.PerformInteraction"
- }
- }
- };
- }
-
- this.client.send(JSONMessage);
- },
-
- /**
- * send notification when DriverDistraction PopUp is visible
- *
- * @param {String}
- * driverDistractionState
- */
- onDriverDistraction: function (driverDistractionState) {
-
- Em.Logger.log("FFW.UI.DriverDistraction");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnDriverDistraction",
- "params": {
- "state": driverDistractionState
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Notifies if system context is changed
- *
- * @param {String}
- * systemContextValue
- */
- OnSystemContext: function (systemContextValue, appID) {
-
- Em.Logger.log("FFW.UI.OnSystemContext");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnSystemContext",
- "params": {
- "systemContext": systemContextValue
- }
- };
-
- if (appID) {
- JSONMessage.params.appID = appID;
- }
-
- this.client.send(JSONMessage);
- },
-
- /**
- * Notifies if sdl UI components language was changed
- *
- * @param {String}
- * lang
- */
- OnLanguageChange: function (lang) {
-
- Em.Logger.log("FFW.UI.OnLanguageChange");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnLanguageChange",
- "params": {
- "language": lang
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Sends notification on SDL Core display keyboard value
- *
- * @param {String}
- *
- */
- OnKeyboardInput: function (value, event) {
-
- Em.Logger.log("FFW.UI.OnKeyboardInput");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "UI.OnKeyboardInput",
- "params": {
- "data": value,
- "event": event
- }
- };
- this.client.send(JSONMessage);
- }
-})
diff --git a/src/components/HMI/ffw/VRRPC.js b/src/components/HMI/ffw/VRRPC.js
deleted file mode 100644
index ce8188b6c0..0000000000
--- a/src/components/HMI/ffw/VRRPC.js
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Reference implementation of VR component.
- *
- * Interface to get or set some essential information sent from SDLCore. VR is
- * responsible for receiving voice commands choosed by user and sending
- * notification of chosen commands to SDLCore.
- *
- */
-
-FFW.VR = FFW.RPCObserver.create( {
-
- /**
- * If true then VR is present and ready to communicate with SDL.
- *
- * @type {Boolean}
- */
- isReady: true,
-
- /**
- * Contains response codes for request that should be processed but there were some kind of errors
- * Error codes will be injected into response.
- */
- errorResponsePull: {},
-
- /*
- * access to basic RPC functionality
- */
- client: FFW.RPCClient.create( {
- componentName: "VR"
- }),
-
- /*
- * connect to RPC bus
- */
- connect: function() {
-
- this.client.connect(this, 500); // Magic number is unique identifier for
- // component
- },
-
- /*
- * disconnect from RPC bus
- */
- disconnect: function() {
-
- this.onRPCUnregistered();
- this.client.disconnect();
- },
-
- /*
- * Client is registered - we can send request starting from this point of
- * time
- */
- onRPCRegistered: function() {
-
- Em.Logger.log("FFW.VR.onRPCRegistered");
- this._super();
- },
-
- /*
- * Client is unregistered - no more requests
- */
- onRPCUnregistered: function() {
-
- Em.Logger.log("FFW.VR.onRPCUnregistered");
- this._super();
- },
-
- /*
- * Client disconnected.
- */
- onRPCDisconnected: function() {
-
- },
-
- /*
- * when result is received from RPC component this function is called It is
- * the propriate place to check results of reuqest execution Please use
- * previously store reuqestID to determine to which request repsonse belongs
- * to
- */
- onRPCResult: function(response) {
-
- Em.Logger.log("FFW.VR.onRPCResult");
- this._super();
- },
-
- /*
- * handle RPC erros here
- */
- onRPCError: function(error) {
-
- Em.Logger.log("FFW.VR.onRPCError");
- this._super();
- },
-
- /*
- * handle RPC notifications here
- */
- onRPCNotification: function(notification) {
-
- Em.Logger.log("FFW.VR.onRPCNotification");
- this._super();
- },
-
- /*
- * send notification when command was triggered
- */
- onCommand: function(element) {
-
- Em.Logger.log("FFW.VR.onCommand");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "VR.OnCommand",
- "params": {
- "commandID": element.commandID
- }
- };
- this.client.send(JSONMessage);
-
- SDL.VRPopUp.set('VRActive', false);
- },
-
- /*
- * handle RPC requests here
- */
- onRPCRequest: function(request) {
-
- Em.Logger.log("FFW.VR.onRPCRequest");
- if (this.validationCheck(request)) {
-
- switch (request.method) {
- case "VR.AddCommand": {
-
- SDL.SDLModel.addCommandVR(request.params);
-
- this.sendVRResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
-
- break;
- }
- case "VR.DeleteCommand": {
-
- SDL.SDLModel.deleteCommandVR(request);
-
- break;
- }
- case "VR.GetSupportedLanguages": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type
- // (enum)
- // from SDL
- "method": "VR.GetSupportedLanguages",
- "languages": SDL.SDLModel.sdlLanguagesList
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
- case "VR.GetLanguage": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"], // type
- // (enum)
- // from SDL
- "method": "VR.GetLanguage",
- "language": SDL.SDLModel.hmiTTSVRLanguage
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
- case "VR.ChangeRegistration": {
-
- SDL.SDLModel.changeRegistrationTTSVR(request.params.language, request.params.appID);
-
- if (request.params.vrSynonyms) {
- SDL.VRPopUp.DeleteCommand(0, request.params.appID);
- SDL.VRPopUp.AddCommand(0, request.params.vrSynonyms, request.params.appID, "Application");
- }
-
- this.sendVRResult(SDL.SDLModel.resultCode["SUCCESS"],
- request.id,
- request.method);
-
- break;
- }
- case "VR.IsReady": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "available": this.get('isReady'),
- "code": 0,
- "method": "VR.IsReady"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
- }
- 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;
- }
- case "VR.GetCapabilities": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "VR.GetCapabilities",
- "vrCapabilities": ["TEXT"]
- }
- };
- this.client.send(JSONMessage);
-
- break;
- }
-
- default: {
- // statements_def
- break;
- }
- }
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendError: function(resultCode, id, method, message) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": {
- "method": method
- }
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * send notification when command was triggered
- *
- * @param {Number} requestID
- * @param {Number} resultCode
- * @param {Number} commandID
- */
- interactionResponse: function (requestID, resultCode, commandID) {
-
- 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 = {
- "jsonrpc": "2.0",
- "id": requestID,
- "result": {
- "code": resultCode,
- "method": "VR.PerformInteraction"
- }
- };
-
- if (commandID) {
- JSONMessage.result.choiceID = commandID;
- }
- } else {
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": requestID,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": "Perform Interaction error response.",
- "data": {
- "method": "VR.PerformInteraction"
- }
- }
- };
- }
-
- SDL.SDLModel.set('performInteractionSession', []);
-
- this.client.send(JSONMessage);
- },
-
- /**
- * send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- 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"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode, // type (enum) from SDL protocol
- "method": method
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /*
- * send notification when command was triggered from VR
- */
- onChoise: function(commandID) {
-
- Em.Logger.log("FFW.VR.PerformInteraction");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "VR.OnChoise",
- "params": {
- "choiceID": commandID
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /**
- * Initiated by VR module to let SDL know that VR session has started.
- */
- Started: function() {
-
- Em.Logger.log("FFW.VR.Started");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "VR.Started"
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Initiated by VR module to let SDL know that VR session has stopped.
- */
- Stopped: function() {
-
- Em.Logger.log("FFW.VR.Stopped");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "VR.Stopped"
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * send notification when command was triggered
- */
- onCommand: function(commandID, appID) {
-
- Em.Logger.log("FFW.VR.onCommand");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "VR.OnCommand",
- "params": {
- "cmdID": commandID,
- "appID": appID
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * Notifies if sdl VR components language was changed
- */
- OnLanguageChange: function(lang) {
-
- Em.Logger.log("FFW.VR.OnLanguageChange");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "VR.OnLanguageChange",
- "params": {
- "language": lang
- }
- };
- this.client.send(JSONMessage);
- }
-}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/VehicleInfoRPC.js b/src/components/HMI/ffw/VehicleInfoRPC.js
deleted file mode 100644
index 8ba6c7e2c7..0000000000
--- a/src/components/HMI/ffw/VehicleInfoRPC.js
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * Reference implementation of VehicleInfo component.
- *
- * Interface to get or set some essential information sent from SDLCore.
- * VehicleInfo is responsible for sending a data about the condition of the
- * vehicle between SDLCore and CAN network. Instead CAN network used
- * VehicleInfoModel.
- *
- */
-
-FFW.VehicleInfo = FFW.RPCObserver.create( {
-
- /**
- * If true then VehicleInfo is present and ready to communicate with SDL.
- *
- * @type {Boolean}
- */
- isReady: true,
-
- /**
- * Contains response codes for request that should be processed but there were some kind of errors
- * Error codes will be injected into response.
- */
- errorResponsePull: {},
-
- /**
- * access to basic RPC functionality
- */
- client: FFW.RPCClient.create( {
- componentName: "VehicleInfo"
- }),
-
- /**
- * connect to RPC bus
- */
- connect: function() {
-
- this.client.connect(this, 700); // Magic number is unique identifier for
- // component
- },
-
- /**
- * disconnect from RPC bus
- */
- disconnect: function() {
-
- this.onRPCUnregistered();
- this.client.disconnect();
- },
-
- /**
- * Client is registered - we can send request starting from this point of
- * time
- */
- onRPCRegistered: function() {
-
- Em.Logger.log("FFW.VehicleInfo.onRPCRegistered");
- this._super();
- },
-
- /**
- * Client is unregistered - no more requests
- */
- onRPCUnregistered: function() {
-
- Em.Logger.log("FFW.VehicleInfo.onRPCUnregistered");
- this._super();
- },
-
- /**
- * Client disconnected.
- */
- onRPCDisconnected: function() {
-
- },
-
- /**
- * when result is received from RPC component this function is called It is
- * the propriate place to check results of reuqest execution Please use
- * previously store reuqestID to determine to which request repsonse belongs
- * to
- */
- onRPCResult: function(response) {
-
- Em.Logger.log("FFW.VehicleInfo.onRPCResult");
- this._super();
- },
-
- /**
- * handle RPC erros here
- */
- onRPCError: function(error) {
-
- Em.Logger.log("FFW.VehicleInfo.onRPCError");
- this._super();
- },
-
- /**
- * handle RPC notifications here
- */
- onRPCNotification: function(notification) {
-
- Em.Logger.log("FFW.VehicleInfo.onRPCNotification");
- this._super();
- },
-
- /**
- * handle RPC requests here
- *
- * @type {Object} request
- */
- onRPCRequest: function(request) {
-
- Em.Logger.log("FFW.VehicleInfo.onRPCRequest");
- if (this.validationCheck(request)) {
-
- switch (request.method) {
- case "VehicleInfo.GetVehicleData": {
-
- SDL.SDLVehicleInfoModel.getVehicleData(request);
-
- break;
- }
-
- case "VehicleInfo.ReadDID": {
-
- SDL.SDLVehicleInfoModel.vehicleInfoReadDID(request.params,
- request.id);
-
- break;
- }
-
- case "VehicleInfo.GetDTCs": {
-
- SDL.SDLVehicleInfoModel.vehicleInfoGetDTCs(request.params,
- request.id);
-
- break;
- }
-
- case "VehicleInfo.DiagnosticMessage": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "messageDataResult": [200],
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "VehicleInfo.DiagnosticMessage"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
-
- break;
- }
-
- case "VehicleInfo.SubscribeVehicleData": {
-
- SDL.SDLVehicleInfoModel.SubscribeVehicleData(request);
-
- break;
- }
-
- case "VehicleInfo.UnsubscribeVehicleData": {
-
- SDL.SDLVehicleInfoModel.UnsubscribeVehicleData(request);
-
- break;
- }
-
- case "VehicleInfo.GetVehicleType": {
-
- SDL.SDLVehicleInfoModel.getVehicleType(request.id);
-
- break;
- }
-
- case "VehicleInfo.IsReady": {
-
- Em.Logger.log("FFW." + request.method + "Response");
-
- // send response
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": request.id,
- "result": {
- "available": this.get('isReady'),
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "VehicleInfo.IsReady"
- }
- };
-
- this.client.send(JSONMessage);
-
- break;
- }
-
- default: {
- // statements_def
- break;
- }
- }
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendError: function(resultCode, id, method, message) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": {
- "method": method
- }
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Send response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendVIResult: function(resultCode, id, method) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": resultCode,
- "method": method
- }
- };
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Send response from onRPCRequest
- *
- * @param {Number} resultCode
- * @param {Number} id
- * @param {String} method
- * @param {Object} data
- */
- sendVISubscribeVehicleDataResult: function(resultCode, id, method, data) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode === SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": data
- };
-
- JSONMessage.result.code = resultCode;
- JSONMessage.result.method = method;
-
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendGetVehicleDataError: function(resultCode, id, method, message, data) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- if (resultCode != SDL.SDLModel.resultCode["SUCCESS"]) {
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "error": {
- "code": resultCode, // type (enum) from SDL protocol
- "message": message,
- "data": data
- }
- };
-
- JSONMessage.error.data.method = method;
- this.client.send(JSONMessage);
- }
- },
-
- /**
- * Send error response from onRPCRequest
- *
- * @param {Number}
- * resultCode
- * @param {Number}
- * id
- * @param {String}
- * method
- */
- sendGetVehicleDataResut: function(resultCode, id, method, data) {
-
- Em.Logger.log("FFW." + method + "Response");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": data
- };
- JSONMessage.result.code = resultCode;
- JSONMessage.result.method = method;
- this.client.send(JSONMessage);
- },
-
- /**
- * Notifies if data was changed
- *
- * @type {Object} params
- */
- OnVehicleData: function(params) {
-
- Em.Logger.log("FFW.VehicleInfo.OnVehicleData");
-
- // send repsonse
- var JSONMessage = {
- "jsonrpc": "2.0",
- "method": "VehicleInfo.OnVehicleData",
- "params": params
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * GetVehicleType Response
- *
- * @type {string} vehicleType
- * @type {int} id
- */
- GetVehicleTypeResponse: function(vehicleType, id) {
-
- Em.Logger.log("FFW.VehicleInfo.GetVehicleTypeResponse");
-
- var JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": SDL.SDLModel.resultCode["SUCCESS"],
- "method": "VehicleInfo.GetVehicleType",
- "vehicleType": vehicleType
- }
- };
-
- this.client.send(JSONMessage);
- },
-
- /**
- * ReadDID Response
- *
- * @type {array} dataResult
- * @type {array} data
- * @type {string} info
- * @type {string} result
- * @type {int} id
- */
- vehicleInfoReadDIDResponse: function(didResult, resultCode, id) {
-
- Em.Logger.log("FFW.VehicleInfo.ReadDIDResponse");
-
- var JSONMessage;
- // send repsonse
- JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": SDL.SDLModel.resultCode[resultCode], // type (enum)
- // from SDL
- // protocol
- "method": "VehicleInfo.ReadDID",
- "didResult": didResult
- }
- };
- this.client.send(JSONMessage);
- },
-
- /**
- * GetDTCs Response
- *
- * @type {Number} ecuHeader
- * @type {Array} dtc
- * @type {String} result
- * @type {Number} id
- */
- vehicleInfoGetDTCsResponse: function(ecuHeader, dtc, result, id) {
-
- Em.Logger.log("FFW.VehicleInfo.GetDTCsResponse");
-
- var JSONMessage;
- // send repsonse
- JSONMessage = {
- "jsonrpc": "2.0",
- "id": id,
- "result": {
- "code": SDL.SDLModel.resultCode[result], // type (enum) from
- // SDL protocol
- "method": "VehicleInfo.GetDTCs",
- "ecuHeader": ecuHeader,
- "dtc": dtc
- }
- };
-
- this.client.send(JSONMessage);
- }
-}) \ No newline at end of file
diff --git a/src/components/HMI/ffw/WebSocket.js b/src/components/HMI/ffw/WebSocket.js
deleted file mode 100644
index 7b508b406a..0000000000
--- a/src/components/HMI/ffw/WebSocket.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/*
- * WebSocket interface mockup
- *
- * Android WebView and browser don't support WebSocket This class provides
- * interface mockup to have seamless code for different platforms
- * JavaScriptFacade is used instead of real WebSocket connection
- *
- */
-
-FFW.WebSocket = Em.Object.extend( {
-
- readyState: 1,
-
- /*
- * add observer of messages from Android
- */
- init: function() {
-
- FFW.WebSocketSimulator.addClient(this);
- },
-
- /*
- * remove observer of Android messages on connection close
- */
- close: function() {
-
- FFW.WebSocketSimulator.removeClient(this);
- // simulate connection is closed
- this.onclose(null);
- },
-
- /*
- * send message to Android native code Java Script facade is used instead of
- * real WebSocket connection
- */
- send: function(jsonMessage) {
-
- FFW.WebSocketSimulator.send(this.clientName, jsonMessage);
- },
-
- // handlers for web socket events
- onclose: null,
- onerror: null,
- onmessage: null,
- onopen: null,
-
- /*
- * used for identification of sender and receiver of particular message
- * from/to Android
- */
- clientName: ''
-});
diff --git a/src/components/HMI/images/common/arr-r-disable.png b/src/components/HMI/images/common/arr-r-disable.png
deleted file mode 100644
index acdfb56f92..0000000000
--- a/src/components/HMI/images/common/arr-r-disable.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/arr-r.png b/src/components/HMI/images/common/arr-r.png
deleted file mode 100644
index 05d8e97972..0000000000
--- a/src/components/HMI/images/common/arr-r.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/arrow_ico.png b/src/components/HMI/images/common/arrow_ico.png
deleted file mode 100644
index 97126966d7..0000000000
--- a/src/components/HMI/images/common/arrow_ico.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/bt_bg.png b/src/components/HMI/images/common/bt_bg.png
deleted file mode 100644
index b69267e44b..0000000000
--- a/src/components/HMI/images/common/bt_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/bt_bg_pressed.png b/src/components/HMI/images/common/bt_bg_pressed.png
deleted file mode 100644
index acd4acbac5..0000000000
--- a/src/components/HMI/images/common/bt_bg_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/btn-28h-gray-active.png b/src/components/HMI/images/common/btn-28h-gray-active.png
deleted file mode 100644
index 2b4b2ee0af..0000000000
--- a/src/components/HMI/images/common/btn-28h-gray-active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/btn-28h.png b/src/components/HMI/images/common/btn-28h.png
deleted file mode 100644
index 034c061bec..0000000000
--- a/src/components/HMI/images/common/btn-28h.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h-active-gray.png b/src/components/HMI/images/common/btn-48h-active-gray.png
deleted file mode 100644
index 3faeff3d7a..0000000000
--- a/src/components/HMI/images/common/btn-48h-active-gray.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h-active.png b/src/components/HMI/images/common/btn-48h-active.png
deleted file mode 100644
index 9515a2172d..0000000000
--- a/src/components/HMI/images/common/btn-48h-active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h-pressed.png b/src/components/HMI/images/common/btn-48h-pressed.png
deleted file mode 100644
index 8f62dd0871..0000000000
--- a/src/components/HMI/images/common/btn-48h-pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/btn-48h.png b/src/components/HMI/images/common/btn-48h.png
deleted file mode 100644
index 89fe73bf38..0000000000
--- a/src/components/HMI/images/common/btn-48h.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/btn-98h.png b/src/components/HMI/images/common/btn-98h.png
deleted file mode 100644
index be25c0c45b..0000000000
--- a/src/components/HMI/images/common/btn-98h.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/button.png b/src/components/HMI/images/common/button.png
deleted file mode 100644
index 04144a6d6e..0000000000
--- a/src/components/HMI/images/common/button.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/button_active_blue.png b/src/components/HMI/images/common/button_active_blue.png
deleted file mode 100644
index e8f6619039..0000000000
--- a/src/components/HMI/images/common/button_active_blue.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/button_large.png b/src/components/HMI/images/common/button_large.png
deleted file mode 100644
index 737f962622..0000000000
--- a/src/components/HMI/images/common/button_large.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/button_small.png b/src/components/HMI/images/common/button_small.png
deleted file mode 100644
index 3f8ec34483..0000000000
--- a/src/components/HMI/images/common/button_small.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/center-button-150.png b/src/components/HMI/images/common/center-button-150.png
deleted file mode 100644
index a696c3ca65..0000000000
--- a/src/components/HMI/images/common/center-button-150.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/center-button.png b/src/components/HMI/images/common/center-button.png
deleted file mode 100644
index fd407b735e..0000000000
--- a/src/components/HMI/images/common/center-button.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/climate-status-bg.png b/src/components/HMI/images/common/climate-status-bg.png
deleted file mode 100644
index dbdddddd5e..0000000000
--- a/src/components/HMI/images/common/climate-status-bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/defaultButtonImage.png b/src/components/HMI/images/common/defaultButtonImage.png
deleted file mode 100644
index 9474142fe0..0000000000
--- a/src/components/HMI/images/common/defaultButtonImage.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/delim.png b/src/components/HMI/images/common/delim.png
deleted file mode 100644
index 98e6516663..0000000000
--- a/src/components/HMI/images/common/delim.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/divider.png b/src/components/HMI/images/common/divider.png
deleted file mode 100644
index c567e5ef21..0000000000
--- a/src/components/HMI/images/common/divider.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/header_bg.png b/src/components/HMI/images/common/header_bg.png
deleted file mode 100644
index f2752149f0..0000000000
--- a/src/components/HMI/images/common/header_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/ico_back.png b/src/components/HMI/images/common/ico_back.png
deleted file mode 100644
index f2cdf410e7..0000000000
--- a/src/components/HMI/images/common/ico_back.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/ind_vert_active.png b/src/components/HMI/images/common/ind_vert_active.png
deleted file mode 100644
index 526fc27467..0000000000
--- a/src/components/HMI/images/common/ind_vert_active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/ind_vert_def.png b/src/components/HMI/images/common/ind_vert_def.png
deleted file mode 100644
index 594852cd13..0000000000
--- a/src/components/HMI/images/common/ind_vert_def.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/ls_border.png b/src/components/HMI/images/common/ls_border.png
deleted file mode 100644
index d59d3afbb7..0000000000
--- a/src/components/HMI/images/common/ls_border.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/media-status-bg.png b/src/components/HMI/images/common/media-status-bg.png
deleted file mode 100644
index b48786c048..0000000000
--- a/src/components/HMI/images/common/media-status-bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/minus-ico.png b/src/components/HMI/images/common/minus-ico.png
deleted file mode 100644
index a5fd7585a7..0000000000
--- a/src/components/HMI/images/common/minus-ico.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/nav-status-bg.png b/src/components/HMI/images/common/nav-status-bg.png
deleted file mode 100644
index afe2168ca9..0000000000
--- a/src/components/HMI/images/common/nav-status-bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/okbut.png b/src/components/HMI/images/common/okbut.png
deleted file mode 100644
index 7762204aa4..0000000000
--- a/src/components/HMI/images/common/okbut.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/okbut_pressed.png b/src/components/HMI/images/common/okbut_pressed.png
deleted file mode 100644
index 7f3262f2d9..0000000000
--- a/src/components/HMI/images/common/okbut_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/page-back-button.png b/src/components/HMI/images/common/page-back-button.png
deleted file mode 100644
index 8cc6ad971b..0000000000
--- a/src/components/HMI/images/common/page-back-button.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/phone-statusbar-bg.png b/src/components/HMI/images/common/phone-statusbar-bg.png
deleted file mode 100644
index 1d63f4898f..0000000000
--- a/src/components/HMI/images/common/phone-statusbar-bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/plus-ico.png b/src/components/HMI/images/common/plus-ico.png
deleted file mode 100644
index 3a3aa21815..0000000000
--- a/src/components/HMI/images/common/plus-ico.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_down.png b/src/components/HMI/images/common/scroll_down.png
deleted file mode 100644
index d160605315..0000000000
--- a/src/components/HMI/images/common/scroll_down.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_down_active.png b/src/components/HMI/images/common/scroll_down_active.png
deleted file mode 100644
index f609ecae65..0000000000
--- a/src/components/HMI/images/common/scroll_down_active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_down_inactive.png b/src/components/HMI/images/common/scroll_down_inactive.png
deleted file mode 100644
index 418379f0b2..0000000000
--- a/src/components/HMI/images/common/scroll_down_inactive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_up.png b/src/components/HMI/images/common/scroll_up.png
deleted file mode 100644
index 6ae4d68368..0000000000
--- a/src/components/HMI/images/common/scroll_up.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/scroll_up_inactive.png b/src/components/HMI/images/common/scroll_up_inactive.png
deleted file mode 100644
index 328ed7a3a0..0000000000
--- a/src/components/HMI/images/common/scroll_up_inactive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/seat-act-led.png b/src/components/HMI/images/common/seat-act-led.png
deleted file mode 100644
index 7acb61359f..0000000000
--- a/src/components/HMI/images/common/seat-act-led.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/seat-inact-led.png b/src/components/HMI/images/common/seat-inact-led.png
deleted file mode 100644
index 40a57e2cc3..0000000000
--- a/src/components/HMI/images/common/seat-inact-led.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/skipbuttonbg.png b/src/components/HMI/images/common/skipbuttonbg.png
deleted file mode 100644
index 9e3b4e97a4..0000000000
--- a/src/components/HMI/images/common/skipbuttonbg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/skippbuttonbg_pressed.png b/src/components/HMI/images/common/skippbuttonbg_pressed.png
deleted file mode 100644
index 27c2a52ced..0000000000
--- a/src/components/HMI/images/common/skippbuttonbg_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/system_settings_btn_bg.png b/src/components/HMI/images/common/system_settings_btn_bg.png
deleted file mode 100644
index ca8a268dda..0000000000
--- a/src/components/HMI/images/common/system_settings_btn_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/system_settings_btn_bg_active.png b/src/components/HMI/images/common/system_settings_btn_bg_active.png
deleted file mode 100644
index b53bd11e84..0000000000
--- a/src/components/HMI/images/common/system_settings_btn_bg_active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/system_settings_btn_h54.png b/src/components/HMI/images/common/system_settings_btn_h54.png
deleted file mode 100644
index 1da6324507..0000000000
--- a/src/components/HMI/images/common/system_settings_btn_h54.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/common/toggle.png b/src/components/HMI/images/common/toggle.png
deleted file mode 100644
index 7162ad36bb..0000000000
--- a/src/components/HMI/images/common/toggle.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/bottom_controlls_full.png b/src/components/HMI/images/home/bottom_controlls_full.png
deleted file mode 100644
index 3fc22b56f1..0000000000
--- a/src/components/HMI/images/home/bottom_controlls_full.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/DownButton.png b/src/components/HMI/images/home/controlButtons/DownButton.png
deleted file mode 100644
index 66e3cc5a7a..0000000000
--- a/src/components/HMI/images/home/controlButtons/DownButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/DownButton_pressed.png b/src/components/HMI/images/home/controlButtons/DownButton_pressed.png
deleted file mode 100644
index b23b077802..0000000000
--- a/src/components/HMI/images/home/controlButtons/DownButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/LeftButton.png b/src/components/HMI/images/home/controlButtons/LeftButton.png
deleted file mode 100644
index a33a09f942..0000000000
--- a/src/components/HMI/images/home/controlButtons/LeftButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/LeftButton_pressed.png b/src/components/HMI/images/home/controlButtons/LeftButton_pressed.png
deleted file mode 100644
index fbc15a5847..0000000000
--- a/src/components/HMI/images/home/controlButtons/LeftButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/OkButton.png b/src/components/HMI/images/home/controlButtons/OkButton.png
deleted file mode 100644
index 809f719de6..0000000000
--- a/src/components/HMI/images/home/controlButtons/OkButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/OkButton_pressed.png b/src/components/HMI/images/home/controlButtons/OkButton_pressed.png
deleted file mode 100644
index 2902de6a34..0000000000
--- a/src/components/HMI/images/home/controlButtons/OkButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/RightButton.png b/src/components/HMI/images/home/controlButtons/RightButton.png
deleted file mode 100644
index 35da46f266..0000000000
--- a/src/components/HMI/images/home/controlButtons/RightButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/RightButton_pressed.png b/src/components/HMI/images/home/controlButtons/RightButton_pressed.png
deleted file mode 100644
index 3a3d247ffa..0000000000
--- a/src/components/HMI/images/home/controlButtons/RightButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/UpButton.png b/src/components/HMI/images/home/controlButtons/UpButton.png
deleted file mode 100644
index 58407ce9ed..0000000000
--- a/src/components/HMI/images/home/controlButtons/UpButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/UpButton_pressed.png b/src/components/HMI/images/home/controlButtons/UpButton_pressed.png
deleted file mode 100644
index 7b853cb2a5..0000000000
--- a/src/components/HMI/images/home/controlButtons/UpButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/backGroundControllButtons.png b/src/components/HMI/images/home/controlButtons/backGroundControllButtons.png
deleted file mode 100644
index 041d49e7e9..0000000000
--- a/src/components/HMI/images/home/controlButtons/backGroundControllButtons.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/vr.png b/src/components/HMI/images/home/controlButtons/vr.png
deleted file mode 100644
index af09282dff..0000000000
--- a/src/components/HMI/images/home/controlButtons/vr.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/vrImage.png b/src/components/HMI/images/home/controlButtons/vrImage.png
deleted file mode 100644
index 2f6bac2d9f..0000000000
--- a/src/components/HMI/images/home/controlButtons/vrImage.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/controlButtons/vr_pressed.png b/src/components/HMI/images/home/controlButtons/vr_pressed.png
deleted file mode 100644
index 9206e42a95..0000000000
--- a/src/components/HMI/images/home/controlButtons/vr_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/home_main_image.png b/src/components/HMI/images/home/home_main_image.png
deleted file mode 100644
index e1b830fbea..0000000000
--- a/src/components/HMI/images/home/home_main_image.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/home/home_phone.png b/src/components/HMI/images/home/home_phone.png
deleted file mode 100644
index dfdd0a577c..0000000000
--- a/src/components/HMI/images/home/home_phone.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/callendar-btn.png b/src/components/HMI/images/info/callendar-btn.png
deleted file mode 100644
index c193f0f21c..0000000000
--- a/src/components/HMI/images/info/callendar-btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/ico_assist.png b/src/components/HMI/images/info/ico_assist.png
deleted file mode 100644
index 1abb26dc1c..0000000000
--- a/src/components/HMI/images/info/ico_assist.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/ico_info_install.png b/src/components/HMI/images/info/ico_info_install.png
deleted file mode 100644
index 5c9d93ad28..0000000000
--- a/src/components/HMI/images/info/ico_info_install.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/ico_vehicle.png b/src/components/HMI/images/info/ico_vehicle.png
deleted file mode 100644
index c4ca30f96c..0000000000
--- a/src/components/HMI/images/info/ico_vehicle.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_apps_ico.png b/src/components/HMI/images/info/info_leftMenu_apps_ico.png
deleted file mode 100644
index 7f648c9a01..0000000000
--- a/src/components/HMI/images/info/info_leftMenu_apps_ico.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_calendar_ico.png b/src/components/HMI/images/info/info_leftMenu_calendar_ico.png
deleted file mode 100644
index 6fb5aec3e0..0000000000
--- a/src/components/HMI/images/info/info_leftMenu_calendar_ico.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_services_ico.png b/src/components/HMI/images/info/info_leftMenu_services_ico.png
deleted file mode 100644
index de36255aa8..0000000000
--- a/src/components/HMI/images/info/info_leftMenu_services_ico.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/info_leftMenu_travelLink_ico.png b/src/components/HMI/images/info/info_leftMenu_travelLink_ico.png
deleted file mode 100644
index 4235c92d07..0000000000
--- a/src/components/HMI/images/info/info_leftMenu_travelLink_ico.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/info_services_bg.png b/src/components/HMI/images/info/info_services_bg.png
deleted file mode 100644
index ef082c739e..0000000000
--- a/src/components/HMI/images/info/info_services_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/info_travelLink_sirius_logo.png b/src/components/HMI/images/info/info_travelLink_sirius_logo.png
deleted file mode 100644
index 0eb328c9c7..0000000000
--- a/src/components/HMI/images/info/info_travelLink_sirius_logo.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/menu_active.png b/src/components/HMI/images/info/menu_active.png
deleted file mode 100644
index b4cf7277a4..0000000000
--- a/src/components/HMI/images/info/menu_active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/info/view_info_calendar.png b/src/components/HMI/images/info/view_info_calendar.png
deleted file mode 100644
index 9e09ae9d62..0000000000
--- a/src/components/HMI/images/info/view_info_calendar.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/list/list_item_bg.png b/src/components/HMI/images/list/list_item_bg.png
deleted file mode 100644
index f5cdcbe343..0000000000
--- a/src/components/HMI/images/list/list_item_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/list/list_item_pressed.png b/src/components/HMI/images/list/list_item_pressed.png
deleted file mode 100644
index 593d697a0e..0000000000
--- a/src/components/HMI/images/list/list_item_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/list/scrollbar/button-down-active.png b/src/components/HMI/images/list/scrollbar/button-down-active.png
deleted file mode 100644
index bcd52150b6..0000000000
--- a/src/components/HMI/images/list/scrollbar/button-down-active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/list/scrollbar/button-up-active.png b/src/components/HMI/images/list/scrollbar/button-up-active.png
deleted file mode 100644
index 5d1bb3f079..0000000000
--- a/src/components/HMI/images/list/scrollbar/button-up-active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgL.png b/src/components/HMI/images/media/bcs-item_bgL.png
deleted file mode 100644
index cbb8dc44b6..0000000000
--- a/src/components/HMI/images/media/bcs-item_bgL.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgR.png b/src/components/HMI/images/media/bcs-item_bgR.png
deleted file mode 100644
index e9aef90896..0000000000
--- a/src/components/HMI/images/media/bcs-item_bgR.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgR_pressed.png b/src/components/HMI/images/media/bcs-item_bgR_pressed.png
deleted file mode 100644
index d7c3f961cb..0000000000
--- a/src/components/HMI/images/media/bcs-item_bgR_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgS.png b/src/components/HMI/images/media/bcs-item_bgS.png
deleted file mode 100644
index 54d70b7f08..0000000000
--- a/src/components/HMI/images/media/bcs-item_bgS.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/bcs-item_bgS_pressed.png b/src/components/HMI/images/media/bcs-item_bgS_pressed.png
deleted file mode 100644
index 8c1563af9b..0000000000
--- a/src/components/HMI/images/media/bcs-item_bgS_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/bg.png b/src/components/HMI/images/media/bg.png
deleted file mode 100644
index b0c24355f6..0000000000
--- a/src/components/HMI/images/media/bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/btn_bg.png b/src/components/HMI/images/media/btn_bg.png
deleted file mode 100644
index 9713aab1e9..0000000000
--- a/src/components/HMI/images/media/btn_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/cd-next-btn.png b/src/components/HMI/images/media/cd-next-btn.png
deleted file mode 100644
index 1973292d42..0000000000
--- a/src/components/HMI/images/media/cd-next-btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/cd-next-btn_pressed.png b/src/components/HMI/images/media/cd-next-btn_pressed.png
deleted file mode 100644
index 8cb1391b8a..0000000000
--- a/src/components/HMI/images/media/cd-next-btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/cd-prev-btn.png b/src/components/HMI/images/media/cd-prev-btn.png
deleted file mode 100644
index 8bdd67d8f5..0000000000
--- a/src/components/HMI/images/media/cd-prev-btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/cd-prev-btn_pressed.png b/src/components/HMI/images/media/cd-prev-btn_pressed.png
deleted file mode 100644
index 3dbdbb9c8e..0000000000
--- a/src/components/HMI/images/media/cd-prev-btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/cd_play_btn.png b/src/components/HMI/images/media/cd_play_btn.png
deleted file mode 100644
index d183119f29..0000000000
--- a/src/components/HMI/images/media/cd_play_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/divider_o.png b/src/components/HMI/images/media/divider_o.png
deleted file mode 100644
index 38cb6bc8e3..0000000000
--- a/src/components/HMI/images/media/divider_o.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico-play.png b/src/components/HMI/images/media/ico-play.png
deleted file mode 100644
index 5e746174c7..0000000000
--- a/src/components/HMI/images/media/ico-play.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico_arrow_down.png b/src/components/HMI/images/media/ico_arrow_down.png
deleted file mode 100644
index 609e4a16c5..0000000000
--- a/src/components/HMI/images/media/ico_arrow_down.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico_arrow_up.png b/src/components/HMI/images/media/ico_arrow_up.png
deleted file mode 100644
index 09b9610f2f..0000000000
--- a/src/components/HMI/images/media/ico_arrow_up.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico_back.png b/src/components/HMI/images/media/ico_back.png
deleted file mode 100644
index f2cdf410e7..0000000000
--- a/src/components/HMI/images/media/ico_back.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico_cd.png b/src/components/HMI/images/media/ico_cd.png
deleted file mode 100644
index b482408f2d..0000000000
--- a/src/components/HMI/images/media/ico_cd.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico_next.png b/src/components/HMI/images/media/ico_next.png
deleted file mode 100644
index 24c19d2bfe..0000000000
--- a/src/components/HMI/images/media/ico_next.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico_pause.png b/src/components/HMI/images/media/ico_pause.png
deleted file mode 100644
index d885c12039..0000000000
--- a/src/components/HMI/images/media/ico_pause.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ico_prew.png b/src/components/HMI/images/media/ico_prew.png
deleted file mode 100644
index a079f6705b..0000000000
--- a/src/components/HMI/images/media/ico_prew.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ls-item_bg.png b/src/components/HMI/images/media/ls-item_bg.png
deleted file mode 100644
index 3863e15c76..0000000000
--- a/src/components/HMI/images/media/ls-item_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/ls-item_bg_act.png b/src/components/HMI/images/media/ls-item_bg_act.png
deleted file mode 100644
index 7b52318a4c..0000000000
--- a/src/components/HMI/images/media/ls-item_bg_act.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/media/player_view.png b/src/components/HMI/images/media/player_view.png
deleted file mode 100644
index fec0f31939..0000000000
--- a/src/components/HMI/images/media/player_view.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/bg.png b/src/components/HMI/images/phone/bg.png
deleted file mode 100644
index ffcf3e6675..0000000000
--- a/src/components/HMI/images/phone/bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/del.png b/src/components/HMI/images/phone/del.png
deleted file mode 100644
index 714b1edb62..0000000000
--- a/src/components/HMI/images/phone/del.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/dial.png b/src/components/HMI/images/phone/dial.png
deleted file mode 100644
index 56b95bfdbf..0000000000
--- a/src/components/HMI/images/phone/dial.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/end.png b/src/components/HMI/images/phone/end.png
deleted file mode 100644
index 2d622bcc70..0000000000
--- a/src/components/HMI/images/phone/end.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/ico_phone.png b/src/components/HMI/images/phone/ico_phone.png
deleted file mode 100644
index 68bcf408db..0000000000
--- a/src/components/HMI/images/phone/ico_phone.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/center_btn.png b/src/components/HMI/images/phone/keypad/center_btn.png
deleted file mode 100644
index 9661ecd18d..0000000000
--- a/src/components/HMI/images/phone/keypad/center_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/center_btn_pressed.png b/src/components/HMI/images/phone/keypad/center_btn_pressed.png
deleted file mode 100644
index 42ac69bb29..0000000000
--- a/src/components/HMI/images/phone/keypad/center_btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/left_btn.png b/src/components/HMI/images/phone/keypad/left_btn.png
deleted file mode 100644
index d043b42555..0000000000
--- a/src/components/HMI/images/phone/keypad/left_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/left_btn_pressed.png b/src/components/HMI/images/phone/keypad/left_btn_pressed.png
deleted file mode 100644
index 287c1eabad..0000000000
--- a/src/components/HMI/images/phone/keypad/left_btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/right_btn.png b/src/components/HMI/images/phone/keypad/right_btn.png
deleted file mode 100644
index 30f7ec9a95..0000000000
--- a/src/components/HMI/images/phone/keypad/right_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/keypad/right_btn_pressed.png b/src/components/HMI/images/phone/keypad/right_btn_pressed.png
deleted file mode 100644
index 9f67dd0012..0000000000
--- a/src/components/HMI/images/phone/keypad/right_btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/menu_active.png b/src/components/HMI/images/phone/menu_active.png
deleted file mode 100644
index 776e857b50..0000000000
--- a/src/components/HMI/images/phone/menu_active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/phone/menu_bg.png b/src/components/HMI/images/phone/menu_bg.png
deleted file mode 100644
index 7de8abeb7f..0000000000
--- a/src/components/HMI/images/phone/menu_bg.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/sdl/Warning.png b/src/components/HMI/images/sdl/Warning.png
deleted file mode 100644
index c91cd31d34..0000000000
--- a/src/components/HMI/images/sdl/Warning.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/sdl/audio_icon.jpg b/src/components/HMI/images/sdl/audio_icon.jpg
deleted file mode 100644
index 22efcfa9df..0000000000
--- a/src/components/HMI/images/sdl/audio_icon.jpg
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/sdl/devices.png b/src/components/HMI/images/sdl/devices.png
deleted file mode 100644
index 91979c58ed..0000000000
--- a/src/components/HMI/images/sdl/devices.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/sdl/new_apps.png b/src/components/HMI/images/sdl/new_apps.png
deleted file mode 100644
index 85a75c2639..0000000000
--- a/src/components/HMI/images/sdl/new_apps.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/sdl/progress.gif b/src/components/HMI/images/sdl/progress.gif
deleted file mode 100644
index 37690fa5b7..0000000000
--- a/src/components/HMI/images/sdl/progress.gif
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/sdl/progressindicator.gif b/src/components/HMI/images/sdl/progressindicator.gif
deleted file mode 100644
index 77d358cae6..0000000000
--- a/src/components/HMI/images/sdl/progressindicator.gif
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/images/settings/ico_settings.png b/src/components/HMI/images/settings/ico_settings.png
deleted file mode 100644
index d65777ee01..0000000000
--- a/src/components/HMI/images/settings/ico_settings.png
+++ /dev/null
Binary files differ
diff --git a/src/components/HMI/index.html b/src/components/HMI/index.html
deleted file mode 100644
index d73412d439..0000000000
--- a/src/components/HMI/index.html
+++ /dev/null
@@ -1,189 +0,0 @@
-<!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" ontouchmove="event.preventDefault();"><html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Ford Smart Device HMI</title>
- <!--Styles-->
- <link rel="stylesheet" type="text/css" href="css/buttonControls.css" />
- <link rel="stylesheet" type="text/css" href="css/general.css" />
- <link rel="stylesheet" type="text/css" href="css/navigation.css" />
- <link rel="stylesheet" type="text/css" href="css/phone.css" />
- <link rel="stylesheet" type="text/css" href="css/info.css" />
- <link rel="stylesheet" type="text/css" href="css/settings.css" />
- <link rel="stylesheet" type="text/css" href="css/media.css" />
- <link rel="stylesheet" type="text/css" href="css/sdl.css" />
-
- <!--Libs-->
-
- <script type="text/javascript" src="lib/handlebars-1.0.0.beta.6.js"></script>
-
- <!-- RELEASE's min versions -->
-
- <script type="text/javascript" src="lib/jquery-1.7.2.min.js"></script>
- <script type="text/javascript" src="lib/ember-1.0.pre.min.js"></script>
- <script type="text/javascript" src="lib/iscroll-lite.js"></script>
-
-
- </head>
- <body ontouchmove="event.preventDefault();">
-
-
- <script type="text/javascript" src="app/Flags.js"></script>
-
- <!-- Framework -->
- <script type="text/javascript" src="ffw/Framework.js"></script>
- <script type="text/javascript" src="ffw/WebSocket.js"></script>
- <script type="text/javascript" src="ffw/RPCObserver.js"></script>
- <script type="text/javascript" src="ffw/RPCClient.js"></script>
- <script type="text/javascript" src="ffw/ButtonsRPC.js"></script>
- <script type="text/javascript" src="ffw/UIRPC.js"></script>
- <script type="text/javascript" src="ffw/NavigationRPC.js"></script>
- <script type="text/javascript" src="ffw/TTSRPC.js"></script>
- <script type="text/javascript" src="ffw/VRRPC.js"></script>
- <script type="text/javascript" src="ffw/VehicleInfoRPC.js"></script>
- <script type="text/javascript" src="ffw/BasicCommunicationRPC.js"></script>
-
- <!-- APP -->
- <script type="text/javascript" src="app/SDLApp.js"></script>
- <!-- locales -->
- <script type="text/javascript" src="locale/eng.js"></script>
- <script type="text/javascript" src="locale/locale.js"></script>
- <script type="text/javascript" src="app/view/WarningView.js"></script>
-
- <script type="text/x-handlebars">
- {{view SDL.warningView}}
- </script>
-
- <!-- UI controlls -->
- <script type="text/javascript" src="app/controlls/Button.js"></script>
- <script type="text/javascript" src="app/controlls/Label.js"></script>
- <script type="text/javascript" src="app/controlls/ScrollBar.js"></script>
- <script type="text/javascript" src="app/controlls/List.js"></script>
- <script type="text/javascript" src="app/controlls/Indicator.js"></script>
- <script type="text/javascript" src="app/controlls/QWERTYLayout.js"></script>
- <script type="text/javascript" src="app/controlls/QWERTZLayout.js"></script>
- <script type="text/javascript" src="app/controlls/AZERTYLayout.js"></script>
- <script type="text/javascript" src="app/controlls/MenuList.js"></script>
- <script type="text/javascript" src="app/controlls/ScrollableText.js"></script>
-
- <!-- utils -->
- <script type="text/javascript" src="app/util/Audio.js"></script>
- <script type="text/javascript" src="app/util/StreamAudio.js"></script>
-
- <!-- Models -->
-
- <script type="text/javascript" src="app/model/media/CDModel.js"></script>
-
- <script type="text/javascript" src="app/model/PhoneModel.js"></script>
-
- <!-- SDL models -->
- <script type="text/javascript" src="app/model/sdl/VehicleInfoModel.js"></script>
- <script type="text/javascript" src="app/model/sdl/AppModel.js"></script>
- <script type="text/javascript" src="app/model/sdl/NonMediaModel.js"></script>
- <script type="text/javascript" src="app/model/sdl/MediaModel.js"></script>
- <script type="text/javascript" src="app/model/sdl/Model.js"></script>
- <!-- SDL models END -->
-
- <!-- Controllers -->
- <!--script type="text/javascript" src="app/controller/AppController.js"></script-->
- <script type="text/javascript" src="app/controller/MediaController.js"></script>
- <script type="text/javascript" src="app/controller/PhoneController.js"></script>
- <script type="text/javascript" src="app/controller/InfoController.js"></script>
- <script type="text/javascript" src="app/controller/SettingsController.js"></script>
-
- <script type="text/javascript" src="app/controller/sdl/Controller.js"></script>
- <script type="text/javascript" src="app/controller/sdl/RPCController.js"></script>
- <script type="text/javascript" src="app/controller/sdl/AppController.js"></script>
- <script type="text/javascript" src="app/controller/sdl/NonMediaController.js"></script>
- <script type="text/javascript" src="app/controller/sdl/MediaController.js"></script>
-
- <!-- Mixins -->
- <script type="text/javascript" src="app/mixins/PresetEvents.js"></script>
- <script type="text/javascript" src="app/mixins/PresetEventCustom.js"></script>
-
- <!-- Views -->
-
- <!-- phone views -->
- <script type="text/javascript" src="app/view/phone/dialpadView.js"></script>
-
- <!-- media views -->
- <script type="text/javascript" src="app/view/media/sdl/controllsView.js"></script>
- <script type="text/javascript" src="app/view/media/common/LeftMenuView.js"></script>
- <script type="text/javascript" src="app/view/media/playerView.js"></script>
- <script type="text/javascript" src="app/view/media/sdlmediaView.js"></script>
-
- <!-- info views -->
- <script type="text/javascript" src="app/view/info/servicesView.js"></script>
- <script type="text/javascript" src="app/view/info/travelLinkView.js"></script>
- <script type="text/javascript" src="app/view/info/calendarView.js"></script>
- <script type="text/javascript" src="app/view/info/appsView.js"></script>
- <script type="text/javascript" src="app/view/info/devicelistView.js"></script>
- <script type="text/javascript" src="app/view/info/nonMediaView.js"></script>
-
- <!-- settings views -->
-
- <script type="text/javascript" src="app/view/settings/policies/appPermissionsListView.js"></script>
- <script type="text/javascript" src="app/view/settings/policies/appPermissionsView.js"></script>
- <script type="text/javascript" src="app/view/settings/policies/deviceConfigView.js"></script>
- <script type="text/javascript" src="app/view/settings/policies/deviceStateChangeView.js"></script>
- <script type="text/javascript" src="app/view/settings/policies/statisticsInfoView.js"></script>
- <script type="text/javascript" src="app/view/settings/policies/systemErrorView.js"></script>
- <script type="text/javascript" src="app/view/settings/policiesView.js"></script>
-
- <script type="text/javascript" src="app/view/homeView.js"></script>
- <script type="text/javascript" src="app/view/mediaView.js"></script>
- <script type="text/javascript" src="app/view/infoView.js"></script>
- <script type="text/javascript" src="app/view/climateView.js"></script>
- <script type="text/javascript" src="app/view/phoneView.js"></script>
- <script type="text/javascript" src="app/view/navigationView.js"></script>
- <script type="text/javascript" src="app/view/settingsView.js"></script>
- <script type="text/javascript" src="app/view/navigationApp/baseNavigationView.js"></script>
- <script type="text/javascript" src="app/view/navigationAppView.js"></script>
-
- <!-- home views -->
- <script type="text/javascript" src="app/view/home/controlButtons.js"></script>
-
- <script type="text/javascript" src="app/view/home/topControls.js"></script>
- <script type="text/javascript" src="app/view/home/bottomControls.js"></script>
- <script type="text/javascript" src="app/view/home/statusMediaView.js"></script>
- <script type="text/javascript" src="app/view/home/statusPhoneView.js"></script>
- <script type="text/javascript" src="app/view/home/statusInfoView.js"></script>
- <script type="text/javascript" src="app/view/home/statusNavigationView.js"></script>
- <script type="text/javascript" src="app/view/home/statusClimateView.js"></script>
- <!-- SDL views -->
- <script type="text/javascript" src="app/view/sdl/shared/AbstractView.js"></script>
- <script type="text/javascript" src="app/view/sdl/shared/interactionChoicesView.js"></script>
- <script type="text/javascript" src="app/view/sdl/shared/sliderView.js"></script>
- <script type="text/javascript" src="app/view/sdl/shared/optionsView.js"></script>
- <script type="text/javascript" src="app/view/sdl/shared/scrollableMessage.js"></script>
- <script type="text/javascript" src="app/view/sdl/shared/turnByTurnView.js"></script>
- <script type="text/javascript" src="app/view/sdl/shared/tbtTurnList.js"></script>
- <script type="text/javascript" src="app/view/sdl/shared/keyboard.js"></script>
- <script type="text/javascript" src="app/view/sdl/TTSPopUp.js"></script>
- <script type="text/javascript" src="app/view/sdl/AlertPopUp.js"></script>
- <script type="text/javascript" src="app/view/sdl/PopUp.js"></script>
- <script type="text/javascript" src="app/view/sdl/AlertManeuverPopUp.js"></script>
- <script type="text/javascript" src="app/view/sdl/AudioPassThruPopUp.js"></script>
- <script type="text/javascript" src="app/view/sdl/VRPopUp.js"></script>
- <script type="text/javascript" src="app/view/sdl/VehicleInfoView.js"></script>
- <script type="text/javascript" src="app/view/sdl/VRHelpListView.js"></script>
- <script type="text/javascript" src="app/view/sdl/tbtClientStateView.js"></script>
- <script type="text/javascript" src="app/view/sdl/driverDistraction.js"></script>
- <script type="text/javascript" src="app/view/sdl/ExitAppView.js"></script>
- <script type="text/javascript" src="app/view/sdl/SystemRequestView.js"></script>
-
-
-
- <script type="text/javascript" src="app/StateManager.js"></script>
-
- <!-- STATE MACHINE -->
- <script type="text/javascript" src="app/AppViews.js"></script>
-
-
- <!-- Big Images Preloader block -->
- <div id="preloader">
- </div>
-
-
- </body>
-</html> \ No newline at end of file
diff --git a/src/components/HMI/lib/ember-1.0.pre.js b/src/components/HMI/lib/ember-1.0.pre.js
deleted file mode 100644
index dc2cb84479..0000000000
--- a/src/components/HMI/lib/ember-1.0.pre.js
+++ /dev/null
@@ -1,20709 +0,0 @@
-// Version: v1.0.pre
-// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
-
-
-(function() {
-/*global __fail__*/
-
-if ('undefined' === typeof Ember) {
- Ember = {};
-
- if ('undefined' !== typeof window) {
- window.Em = window.Ember = Em = Ember;
- }
-}
-
-Ember.ENV = 'undefined' === typeof ENV ? {} : ENV;
-
-if (!('MANDATORY_SETTER' in Ember.ENV)) {
- Ember.ENV.MANDATORY_SETTER = true; // default to true for debug dist
-}
-
-/**
- Define an assertion that will throw an exception if the condition is not
- met. Ember build tools will remove any calls to Ember.assert() when
- doing a production build. Example:
-
- // Test for truthiness
- Ember.assert('Must pass a valid object', obj);
- // Fail unconditionally
- Ember.assert('This code path should never be run')
-
- @static
- @function
- @param {String} desc
- A description of the assertion. This will become the text of the Error
- thrown if the assertion fails.
-
- @param {Boolean} test
- Must be truthy for the assertion to pass. If falsy, an exception will be
- thrown.
-*/
-Ember.assert = function(desc, test) {
- if (!test) throw new Error("assertion failed: "+desc);
-};
-
-
-/**
- Display a warning with the provided message. Ember build tools will
- remove any calls to Ember.warn() when doing a production build.
-
- @static
- @function
- @param {String} message
- A warning to display.
-
- @param {Boolean} test
- An optional boolean. If falsy, the warning will be displayed.
-*/
-Ember.warn = function(message, test) {
- if (!test) {
- Ember.Logger.warn("WARNING: "+message);
- if ('trace' in Ember.Logger) Ember.Logger.trace();
- }
-};
-
-/**
- Display a deprecation warning with the provided message and a stack trace
- (Chrome and Firefox only). Ember build tools will remove any calls to
- Ember.deprecate() when doing a production build.
-
- @static
- @function
- @param {String} message
- A description of the deprecation.
-
- @param {Boolean} test
- An optional boolean. If falsy, the deprecation will be displayed.
-*/
-Ember.deprecate = function(message, test) {
- if (Ember && Ember.TESTING_DEPRECATION) { return; }
-
- if (arguments.length === 1) { test = false; }
- if (test) { return; }
-
- if (Ember && Ember.ENV.RAISE_ON_DEPRECATION) { throw new Error(message); }
-
- var error;
-
- // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome
- try { __fail__.fail(); } catch (e) { error = e; }
-
- if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {
- var stack, stackStr = '';
- if (error['arguments']) {
- // Chrome
- stack = error.stack.replace(/^\s+at\s+/gm, '').
- replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').
- replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n');
- stack.shift();
- } else {
- // Firefox
- stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').
- replace(/^\(/gm, '{anonymous}(').split('\n');
- }
-
- stackStr = "\n " + stack.slice(2).join("\n ");
- message = message + stackStr;
- }
-
- Ember.Logger.warn("DEPRECATION: "+message);
-};
-
-
-
-/**
- Display a deprecation warning with the provided message and a stack trace
- (Chrome and Firefox only) when the wrapped method is called.
-
- Ember build tools will not remove calls to Ember.deprecateFunc(), though
- no warnings will be shown in production.
-
- @static
- @function
- @param {String} message
- A description of the deprecation.
-
- @param {Function} func
- The function to be deprecated.
-*/
-Ember.deprecateFunc = function(message, func) {
- return function() {
- Ember.deprecate(message);
- return func.apply(this, arguments);
- };
-};
-
-
-window.ember_assert = Ember.deprecateFunc("ember_assert is deprecated. Please use Ember.assert instead.", Ember.assert);
-window.ember_warn = Ember.deprecateFunc("ember_warn is deprecated. Please use Ember.warn instead.", Ember.warn);
-window.ember_deprecate = Ember.deprecateFunc("ember_deprecate is deprecated. Please use Ember.deprecate instead.", Ember.deprecate);
-window.ember_deprecateFunc = Ember.deprecateFunc("ember_deprecateFunc is deprecated. Please use Ember.deprecateFunc instead.", Ember.deprecateFunc);
-
-})();
-
-// Version: v1.0.pre
-// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Em:true ENV */
-
-if ('undefined' === typeof Ember) {
- // Create core object. Make it act like an instance of Ember.Namespace so that
- // objects assigned to it are given a sane string representation.
- Ember = {};
-}
-
-/**
- @namespace
- @name Ember
- @version 1.0.pre
-
- All Ember methods and functions are defined inside of this namespace.
- You generally should not add new properties to this namespace as it may be
- overwritten by future versions of Ember.
-
- You can also use the shorthand "Em" instead of "Ember".
-
- Ember-Runtime is a framework that provides core functions for
- Ember including cross-platform functions, support for property
- observing and objects. Its focus is on small size and performance. You can
- use this in place of or along-side other cross-platform libraries such as
- jQuery.
-
- The core Runtime framework is based on the jQuery API with a number of
- performance optimizations.
-*/
-
-// aliases needed to keep minifiers from removing the global context
-if ('undefined' !== typeof window) {
- window.Em = window.Ember = Em = Ember;
-}
-
-// Make sure these are set whether Ember was already defined or not
-
-Ember.isNamespace = true;
-
-Ember.toString = function() { return "Ember"; };
-
-
-/**
- @static
- @type String
- @default '1.0.pre'
- @constant
-*/
-Ember.VERSION = '1.0.pre';
-
-/**
- @static
- @type Hash
- @constant
-
- Standard environmental variables. You can define these in a global `ENV`
- variable before loading Ember to control various configuration
- settings.
-*/
-Ember.ENV = Ember.ENV || ('undefined' === typeof ENV ? {} : ENV);
-
-Ember.config = Ember.config || {};
-
-// ..........................................................
-// BOOTSTRAP
-//
-
-/**
- @static
- @type Boolean
- @default true
- @constant
-
- Determines whether Ember should enhances some built-in object
- prototypes to provide a more friendly API. If enabled, a few methods
- will be added to Function, String, and Array. Object.prototype will not be
- enhanced, which is the one that causes most troubles for people.
-
- In general we recommend leaving this option set to true since it rarely
- conflicts with other code. If you need to turn it off however, you can
- define an ENV.EXTEND_PROTOTYPES config to disable it.
-*/
-Ember.EXTEND_PROTOTYPES = (Ember.ENV.EXTEND_PROTOTYPES !== false);
-
-/**
- @static
- @type Boolean
- @default true
- @constant
-
- Determines whether Ember logs a full stack trace during deprecation warnings
-*/
-Ember.LOG_STACKTRACE_ON_DEPRECATION = (Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION !== false);
-
-/**
- @static
- @type Boolean
- @default Ember.EXTEND_PROTOTYPES
- @constant
-
- Determines whether Ember should add ECMAScript 5 shims to older browsers.
-*/
-Ember.SHIM_ES5 = (Ember.ENV.SHIM_ES5 === false) ? false : Ember.EXTEND_PROTOTYPES;
-
-
-/**
- @static
- @type Boolean
- @default true
- @constant
-
- Determines whether computed properties are cacheable by default.
- This option will be removed for the 1.1 release.
-
- When caching is enabled by default, you can use `volatile()` to disable
- caching on individual computed properties.
-*/
-Ember.CP_DEFAULT_CACHEABLE = (Ember.ENV.CP_DEFAULT_CACHEABLE !== false);
-
-/**
- @static
- @type Boolean
- @default true
- @constant
-
- Determines whether views render their templates using themselves
- as the context, or whether it is inherited from the parent. This option
- will be removed in the 1.1 release.
-
- If you need to update your application to use the new context rules, simply
- prefix property access with `view.`:
-
- // Before:
- {{#each App.photosController}}
- Photo Title: {{title}}
- {{#view App.InfoView contentBinding="this"}}
- {{content.date}}
- {{content.cameraType}}
- {{otherViewProperty}}
- {{/view}}
- {{/each}}
-
- // After:
- {{#each App.photosController}}
- Photo Title: {{title}}
- {{#view App.InfoView}}
- {{date}}
- {{cameraType}}
- {{view.otherViewProperty}}
- {{/view}}
- {{/each}}
-*/
-Ember.VIEW_PRESERVES_CONTEXT = (Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);
-
-/**
- Empty function. Useful for some operations.
-
- @returns {Object}
- @private
-*/
-Ember.K = function() { return this; };
-
-/**
- @namespace
- @name window
- @description The global window object
-*/
-
-
-// Stub out the methods defined by the ember-debug package in case it's not loaded
-
-if ('undefined' === typeof Ember.assert) { Ember.assert = Ember.K; }
-if ('undefined' === typeof Ember.warn) { Ember.warn = Ember.K; }
-if ('undefined' === typeof Ember.deprecate) { Ember.deprecate = Ember.K; }
-if ('undefined' === typeof Ember.deprecateFunc) {
- Ember.deprecateFunc = function(_, func) { return func; };
-}
-
-// These are deprecated but still supported
-
-if ('undefined' === typeof ember_assert) { window.ember_assert = Ember.K; }
-if ('undefined' === typeof ember_warn) { window.ember_warn = Ember.K; }
-if ('undefined' === typeof ember_deprecate) { window.ember_deprecate = Ember.K; }
-if ('undefined' === typeof ember_deprecateFunc) {
- /** @private */
- window.ember_deprecateFunc = function(_, func) { return func; };
-}
-
-
-// ..........................................................
-// LOGGER
-//
-
-/**
- @class
-
- Inside Ember-Metal, simply uses the window.console object.
- Override this to provide more robust logging functionality.
-*/
-Ember.Logger = window.console || { log: Ember.K, warn: Ember.K, error: Ember.K, info: Ember.K, debug: Ember.K };
-
-})();
-
-
-
-(function() {
-/*jshint newcap:false*/
-
-// NOTE: There is a bug in jshint that doesn't recognize `Object()` without `new`
-// as being ok unless both `newcap:false` and not `use strict`.
-// https://github.com/jshint/jshint/issues/392
-
-// Testing this is not ideal, but we want to use native functions
-// if available, but not to use versions created by libraries like Prototype
-/** @private */
-var isNativeFunc = function(func) {
- // This should probably work in all browsers likely to have ES5 array methods
- return func && Function.prototype.toString.call(func).indexOf('[native code]') > -1;
-};
-
-// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/map
-/** @private */
-var arrayMap = isNativeFunc(Array.prototype.map) ? Array.prototype.map : function(fun /*, thisp */) {
- //"use strict";
-
- if (this === void 0 || this === null) {
- throw new TypeError();
- }
-
- var t = Object(this);
- var len = t.length >>> 0;
- if (typeof fun !== "function") {
- throw new TypeError();
- }
-
- var res = new Array(len);
- var thisp = arguments[1];
- for (var i = 0; i < len; i++) {
- if (i in t) {
- res[i] = fun.call(thisp, t[i], i, t);
- }
- }
-
- return res;
-};
-
-// From: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/foreach
-/** @private */
-var arrayForEach = isNativeFunc(Array.prototype.forEach) ? Array.prototype.forEach : function(fun /*, thisp */) {
- //"use strict";
-
- if (this === void 0 || this === null) {
- throw new TypeError();
- }
-
- var t = Object(this);
- var len = t.length >>> 0;
- if (typeof fun !== "function") {
- throw new TypeError();
- }
-
- var thisp = arguments[1];
- for (var i = 0; i < len; i++) {
- if (i in t) {
- fun.call(thisp, t[i], i, t);
- }
- }
-};
-
-/** @private */
-var arrayIndexOf = isNativeFunc(Array.prototype.indexOf) ? Array.prototype.indexOf : function (obj, fromIndex) {
- if (fromIndex === null || fromIndex === undefined) { fromIndex = 0; }
- else if (fromIndex < 0) { fromIndex = Math.max(0, this.length + fromIndex); }
- for (var i = fromIndex, j = this.length; i < j; i++) {
- if (this[i] === obj) { return i; }
- }
- return -1;
-};
-
-Ember.ArrayPolyfills = {
- map: arrayMap,
- forEach: arrayForEach,
- indexOf: arrayIndexOf
-};
-
-var utils = Ember.EnumerableUtils = {
- map: function(obj, callback, thisArg) {
- return obj.map ? obj.map.call(obj, callback, thisArg) : arrayMap.call(obj, callback, thisArg);
- },
-
- forEach: function(obj, callback, thisArg) {
- return obj.forEach ? obj.forEach.call(obj, callback, thisArg) : arrayForEach.call(obj, callback, thisArg);
- },
-
- indexOf: function(obj, element, index) {
- return obj.indexOf ? obj.indexOf.call(obj, element, index) : arrayIndexOf.call(obj, element, index);
- },
-
- indexesOf: function(obj, elements) {
- return elements === undefined ? [] : utils.map(elements, function(item) {
- return utils.indexOf(obj, item);
- });
- },
-
- removeObject: function(array, item) {
- var index = utils.indexOf(array, item);
- if (index !== -1) { array.splice(index, 1); }
- }
-};
-
-
-if (Ember.SHIM_ES5) {
- if (!Array.prototype.map) {
- /** @private */
- Array.prototype.map = arrayMap;
- }
-
- if (!Array.prototype.forEach) {
- /** @private */
- Array.prototype.forEach = arrayForEach;
- }
-
- if (!Array.prototype.indexOf) {
- /** @private */
- Array.prototype.indexOf = arrayIndexOf;
- }
-}
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Node */
-/**
- @class
-
- Platform specific methods and feature detectors needed by the framework.
-
- @name Ember.platform
-*/
-var platform = Ember.platform = {};
-
-/**
- Identical to Object.create(). Implements if not available natively.
- @memberOf Ember.platform
- @name create
-*/
-Ember.create = Object.create;
-
-if (!Ember.create) {
- /** @private */
- var K = function() {};
-
- Ember.create = function(obj, props) {
- K.prototype = obj;
- obj = new K();
- if (props) {
- K.prototype = obj;
- for (var prop in props) {
- K.prototype[prop] = props[prop].value;
- }
- obj = new K();
- }
- K.prototype = null;
-
- return obj;
- };
-
- Ember.create.isSimulated = true;
-}
-
-/** @private */
-var defineProperty = Object.defineProperty;
-var canRedefineProperties, canDefinePropertyOnDOM;
-
-// Catch IE8 where Object.defineProperty exists but only works on DOM elements
-if (defineProperty) {
- try {
- defineProperty({}, 'a',{get:function(){}});
- } catch (e) {
- /** @private */
- defineProperty = null;
- }
-}
-
-if (defineProperty) {
- // Detects a bug in Android <3.2 where you cannot redefine a property using
- // Object.defineProperty once accessors have already been set.
- /** @private */
- canRedefineProperties = (function() {
- var obj = {};
-
- defineProperty(obj, 'a', {
- configurable: true,
- enumerable: true,
- get: function() { },
- set: function() { }
- });
-
- defineProperty(obj, 'a', {
- configurable: true,
- enumerable: true,
- writable: true,
- value: true
- });
-
- return obj.a === true;
- })();
-
- // This is for Safari 5.0, which supports Object.defineProperty, but not
- // on DOM nodes.
- /** @private */
- canDefinePropertyOnDOM = (function(){
- try {
- defineProperty(document.createElement('div'), 'definePropertyOnDOM', {});
- return true;
- } catch(e) { }
-
- return false;
- })();
-
- if (!canRedefineProperties) {
- /** @private */
- defineProperty = null;
- } else if (!canDefinePropertyOnDOM) {
- /** @private */
- defineProperty = function(obj, keyName, desc){
- var isNode;
-
- if (typeof Node === "object") {
- isNode = obj instanceof Node;
- } else {
- isNode = typeof obj === "object" && typeof obj.nodeType === "number" && typeof obj.nodeName === "string";
- }
-
- if (isNode) {
- // TODO: Should we have a warning here?
- return (obj[keyName] = desc.value);
- } else {
- return Object.defineProperty(obj, keyName, desc);
- }
- };
- }
-}
-
-/**
- Identical to Object.defineProperty(). Implements as much functionality
- as possible if not available natively.
-
- @memberOf Ember.platform
- @name defineProperty
- @param {Object} obj The object to modify
- @param {String} keyName property name to modify
- @param {Object} desc descriptor hash
- @returns {void}
-*/
-platform.defineProperty = defineProperty;
-
-/**
- Set to true if the platform supports native getters and setters.
-
- @memberOf Ember.platform
- @name hasPropertyAccessors
-*/
-platform.hasPropertyAccessors = true;
-
-if (!platform.defineProperty) {
- platform.hasPropertyAccessors = false;
-
- platform.defineProperty = function(obj, keyName, desc) {
- if (!desc.get) { obj[keyName] = desc.value; }
- };
-
- platform.defineProperty.isSimulated = true;
-}
-
-if (Ember.ENV.MANDATORY_SETTER && !platform.hasPropertyAccessors) {
- Ember.ENV.MANDATORY_SETTER = false;
-}
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var o_defineProperty = Ember.platform.defineProperty,
- o_create = Ember.create,
- // Used for guid generation...
- GUID_KEY = '__ember'+ (+ new Date()),
- uuid = 0,
- numberCache = [],
- stringCache = {};
-
-var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
-
-/**
- @private
- @static
- @type String
- @constant
-
- A unique key used to assign guids and other private metadata to objects.
- If you inspect an object in your browser debugger you will often see these.
- They can be safely ignored.
-
- On browsers that support it, these properties are added with enumeration
- disabled so they won't show up when you iterate over your properties.
-*/
-Ember.GUID_KEY = GUID_KEY;
-
-var GUID_DESC = {
- writable: false,
- configurable: false,
- enumerable: false,
- value: null
-};
-
-/**
- @private
-
- Generates a new guid, optionally saving the guid to the object that you
- pass in. You will rarely need to use this method. Instead you should
- call Ember.guidFor(obj), which return an existing guid if available.
-
- @param {Object} obj
- Optional object the guid will be used for. If passed in, the guid will
- be saved on the object and reused whenever you pass the same object
- again.
-
- If no object is passed, just generate a new guid.
-
- @param {String} prefix
- Optional prefix to place in front of the guid. Useful when you want to
- separate the guid into separate namespaces.
-
- @returns {String} the guid
-*/
-Ember.generateGuid = function generateGuid(obj, prefix) {
- if (!prefix) prefix = 'ember';
- var ret = (prefix + (uuid++));
- if (obj) {
- GUID_DESC.value = ret;
- o_defineProperty(obj, GUID_KEY, GUID_DESC);
- }
- return ret ;
-};
-
-/**
- @private
-
- Returns a unique id for the object. If the object does not yet have
- a guid, one will be assigned to it. You can call this on any object,
- Ember.Object-based or not, but be aware that it will add a _guid property.
-
- You can also use this method on DOM Element objects.
-
- @method
- @param obj {Object} any object, string, number, Element, or primitive
- @returns {String} the unique guid for this instance.
-*/
-Ember.guidFor = function guidFor(obj) {
-
- // special cases where we don't want to add a key to object
- if (obj === undefined) return "(undefined)";
- if (obj === null) return "(null)";
-
- var cache, ret;
- var type = typeof obj;
-
- // Don't allow prototype changes to String etc. to change the guidFor
- switch(type) {
- case 'number':
- ret = numberCache[obj];
- if (!ret) ret = numberCache[obj] = 'nu'+obj;
- return ret;
-
- case 'string':
- ret = stringCache[obj];
- if (!ret) ret = stringCache[obj] = 'st'+(uuid++);
- return ret;
-
- case 'boolean':
- return obj ? '(true)' : '(false)';
-
- default:
- if (obj[GUID_KEY]) return obj[GUID_KEY];
- if (obj === Object) return '(Object)';
- if (obj === Array) return '(Array)';
- ret = 'ember'+(uuid++);
- GUID_DESC.value = ret;
- o_defineProperty(obj, GUID_KEY, GUID_DESC);
- return ret;
- }
-};
-
-// ..........................................................
-// META
-//
-
-var META_DESC = {
- writable: true,
- configurable: false,
- enumerable: false,
- value: null
-};
-
-var META_KEY = Ember.GUID_KEY+'_meta';
-
-/**
- The key used to store meta information on object for property observing.
-
- @static
- @type String
-*/
-Ember.META_KEY = META_KEY;
-
-// Placeholder for non-writable metas.
-var EMPTY_META = {
- descs: {},
- watching: {}
-};
-
-if (MANDATORY_SETTER) { EMPTY_META.values = {}; }
-
-Ember.EMPTY_META = EMPTY_META;
-
-if (Object.freeze) Object.freeze(EMPTY_META);
-
-var isDefinePropertySimulated = Ember.platform.defineProperty.isSimulated;
-
-function Meta(obj) {
- this.descs = {};
- this.watching = {};
- this.cache = {};
- this.source = obj;
-}
-
-if (isDefinePropertySimulated) {
- // on platforms that don't support enumerable false
- // make meta fail jQuery.isPlainObject() to hide from
- // jQuery.extend() by having a property that fails
- // hasOwnProperty check.
- Meta.prototype.__preventPlainObject__ = true;
-}
-
-/**
- @private
- @function
-
- Retrieves the meta hash for an object. If 'writable' is true ensures the
- hash is writable for this object as well.
-
- The meta object contains information about computed property descriptors as
- well as any watched properties and other information. You generally will
- not access this information directly but instead work with higher level
- methods that manipulate this hash indirectly.
-
- @param {Object} obj
- The object to retrieve meta for
-
- @param {Boolean} writable
- Pass false if you do not intend to modify the meta hash, allowing the
- method to avoid making an unnecessary copy.
-
- @returns {Hash}
-*/
-Ember.meta = function meta(obj, writable) {
-
- var ret = obj[META_KEY];
- if (writable===false) return ret || EMPTY_META;
-
- if (!ret) {
- if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);
-
- ret = new Meta(obj);
-
- if (MANDATORY_SETTER) { ret.values = {}; }
-
- obj[META_KEY] = ret;
-
- // make sure we don't accidentally try to create constructor like desc
- ret.descs.constructor = null;
-
- } else if (ret.source !== obj) {
- if (!isDefinePropertySimulated) o_defineProperty(obj, META_KEY, META_DESC);
-
- ret = o_create(ret);
- ret.descs = o_create(ret.descs);
- ret.watching = o_create(ret.watching);
- ret.cache = {};
- ret.source = obj;
-
- if (MANDATORY_SETTER) { ret.values = o_create(ret.values); }
-
- obj[META_KEY] = ret;
- }
- return ret;
-};
-
-Ember.getMeta = function getMeta(obj, property) {
- var meta = Ember.meta(obj, false);
- return meta[property];
-};
-
-Ember.setMeta = function setMeta(obj, property, value) {
- var meta = Ember.meta(obj, true);
- meta[property] = value;
- return value;
-};
-
-/**
- @private
-
- In order to store defaults for a class, a prototype may need to create
- a default meta object, which will be inherited by any objects instantiated
- from the class's constructor.
-
- However, the properties of that meta object are only shallow-cloned,
- so if a property is a hash (like the event system's `listeners` hash),
- it will by default be shared across all instances of that class.
-
- This method allows extensions to deeply clone a series of nested hashes or
- other complex objects. For instance, the event system might pass
- ['listeners', 'foo:change', 'ember157'] to `prepareMetaPath`, which will
- walk down the keys provided.
-
- For each key, if the key does not exist, it is created. If it already
- exists and it was inherited from its constructor, the constructor's
- key is cloned.
-
- You can also pass false for `writable`, which will simply return
- undefined if `prepareMetaPath` discovers any part of the path that
- shared or undefined.
-
- @param {Object} obj The object whose meta we are examining
- @param {Array} path An array of keys to walk down
- @param {Boolean} writable whether or not to create a new meta
- (or meta property) if one does not already exist or if it's
- shared with its constructor
-*/
-Ember.metaPath = function metaPath(obj, path, writable) {
- var meta = Ember.meta(obj, writable), keyName, value;
-
- for (var i=0, l=path.length; i<l; i++) {
- keyName = path[i];
- value = meta[keyName];
-
- if (!value) {
- if (!writable) { return undefined; }
- value = meta[keyName] = { __ember_source__: obj };
- } else if (value.__ember_source__ !== obj) {
- if (!writable) { return undefined; }
- value = meta[keyName] = o_create(value);
- value.__ember_source__ = obj;
- }
-
- meta = value;
- }
-
- return value;
-};
-
-/**
- @private
-
- Wraps the passed function so that `this._super` will point to the superFunc
- when the function is invoked. This is the primitive we use to implement
- calls to super.
-
- @param {Function} func
- The function to call
-
- @param {Function} superFunc
- The super function.
-
- @returns {Function} wrapped function.
-*/
-Ember.wrap = function(func, superFunc) {
-
- function K() {}
-
- var newFunc = function() {
- var ret, sup = this._super;
- this._super = superFunc || K;
- ret = func.apply(this, arguments);
- this._super = sup;
- return ret;
- };
-
- newFunc.base = func;
- return newFunc;
-};
-
-/**
- Returns true if the passed object is an array or Array-like.
-
- Ember Array Protocol:
-
- - the object has an objectAt property
- - the object is a native Array
- - the object is an Object, and has a length property
-
- Unlike Ember.typeOf this method returns true even if the passed object is
- not formally array but appears to be array-like (i.e. implements Ember.Array)
-
- Ember.isArray(); // false
- Ember.isArray([]); // true
- Ember.isArray( Ember.ArrayProxy.create({ content: [] }) ); // true
-
- @param {Object} obj The object to test
- @returns {Boolean}
-*/
-Ember.isArray = function(obj) {
- if (!obj || obj.setInterval) { return false; }
- if (Array.isArray && Array.isArray(obj)) { return true; }
- if (Ember.Array && Ember.Array.detect(obj)) { return true; }
- if ((obj.length !== undefined) && 'object'===typeof obj) { return true; }
- return false;
-};
-
-/**
- Forces the passed object to be part of an array. If the object is already
- an array or array-like, returns the object. Otherwise adds the object to
- an array. If obj is null or undefined, returns an empty array.
-
- Ember.makeArray(); => []
- Ember.makeArray(null); => []
- Ember.makeArray(undefined); => []
- Ember.makeArray('lindsay'); => ['lindsay']
- Ember.makeArray([1,2,42]); => [1,2,42]
-
- var controller = Ember.ArrayProxy.create({ content: [] });
- Ember.makeArray(controller) === controller; => true
-
- @param {Object} obj the object
- @returns {Array}
-*/
-Ember.makeArray = function(obj) {
- if (obj === null || obj === undefined) { return []; }
- return Ember.isArray(obj) ? obj : [obj];
-};
-
-function canInvoke(obj, methodName) {
- return !!(obj && typeof obj[methodName] === 'function');
-}
-
-/**
- Checks to see if the `methodName` exists on the `obj`.
-
- @function
-
- @param {Object} obj The object to check for the method
- @param {String} methodName The method name to check for
-*/
-Ember.canInvoke = canInvoke;
-
-/**
- Checks to see if the `methodName` exists on the `obj`,
- and if it does, invokes it with the arguments passed.
-
- @function
-
- @param {Object} obj The object to check for the method
- @param {String} methodName The method name to check for
- @param {Array} args The arguments to pass to the method
-
- @returns {Boolean} true if the method does not return false
- @returns {Boolean} false otherwise
-*/
-Ember.tryInvoke = function(obj, methodName, args) {
- if (canInvoke(obj, methodName)) {
- return obj[methodName].apply(obj, args);
- }
-};
-
-})();
-
-
-
-(function() {
-/**
- JavaScript (before ES6) does not have a Map implementation. Objects,
- which are often used as dictionaries, may only have Strings as keys.
-
- Because Ember has a way to get a unique identifier for every object
- via `Ember.guidFor`, we can implement a performant Map with arbitrary
- keys. Because it is commonly used in low-level bookkeeping, Map is
- implemented as a pure JavaScript object for performance.
-
- This implementation follows the current iteration of the ES6 proposal
- for maps (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets),
- with two exceptions. First, because we need our implementation to be
- pleasant on older browsers, we do not use the `delete` name (using
- `remove` instead). Second, as we do not have the luxury of in-VM
- iteration, we implement a forEach method for iteration.
-
- Map is mocked out to look like an Ember object, so you can do
- `Ember.Map.create()` for symmetry with other Ember classes.
-*/
-/** @private */
-var guidFor = Ember.guidFor,
- indexOf = Ember.ArrayPolyfills.indexOf;
-
-var copy = function(obj) {
- var output = {};
-
- for (var prop in obj) {
- if (obj.hasOwnProperty(prop)) { output[prop] = obj[prop]; }
- }
-
- return output;
-};
-
-var copyMap = function(original, newObject) {
- var keys = original.keys.copy(),
- values = copy(original.values);
-
- newObject.keys = keys;
- newObject.values = values;
-
- return newObject;
-};
-
-// This class is used internally by Ember.js and Ember Data.
-// Please do not use it at this time. We plan to clean it up
-// and add many tests soon.
-var OrderedSet = Ember.OrderedSet = function() {
- this.clear();
-};
-
-OrderedSet.create = function() {
- return new OrderedSet();
-};
-
-OrderedSet.prototype = {
- clear: function() {
- this.presenceSet = {};
- this.list = [];
- },
-
- add: function(obj) {
- var guid = guidFor(obj),
- presenceSet = this.presenceSet,
- list = this.list;
-
- if (guid in presenceSet) { return; }
-
- presenceSet[guid] = true;
- list.push(obj);
- },
-
- remove: function(obj) {
- var guid = guidFor(obj),
- presenceSet = this.presenceSet,
- list = this.list;
-
- delete presenceSet[guid];
-
- var index = indexOf.call(list, obj);
- if (index > -1) {
- list.splice(index, 1);
- }
- },
-
- isEmpty: function() {
- return this.list.length === 0;
- },
-
- forEach: function(fn, self) {
- // allow mutation during iteration
- var list = this.list.slice();
-
- for (var i = 0, j = list.length; i < j; i++) {
- fn.call(self, list[i]);
- }
- },
-
- toArray: function() {
- return this.list.slice();
- },
-
- copy: function() {
- var set = new OrderedSet();
-
- set.presenceSet = copy(this.presenceSet);
- set.list = this.list.slice();
-
- return set;
- }
-};
-
-/**
- A Map stores values indexed by keys. Unlike JavaScript's
- default Objects, the keys of a Map can be any JavaScript
- object.
-
- Internally, a Map has two data structures:
-
- `keys`: an OrderedSet of all of the existing keys
- `values`: a JavaScript Object indexed by the
- Ember.guidFor(key)
-
- When a key/value pair is added for the first time, we
- add the key to the `keys` OrderedSet, and create or
- replace an entry in `values`. When an entry is deleted,
- we delete its entry in `keys` and `values`.
-*/
-
-/** @private */
-var Map = Ember.Map = function() {
- this.keys = Ember.OrderedSet.create();
- this.values = {};
-};
-
-Map.create = function() {
- return new Map();
-};
-
-Map.prototype = {
- /**
- Retrieve the value associated with a given key.
-
- @param {anything} key
- @return {anything} the value associated with the key, or undefined
- */
- get: function(key) {
- var values = this.values,
- guid = guidFor(key);
-
- return values[guid];
- },
-
- /**
- Adds a value to the map. If a value for the given key has already been
- provided, the new value will replace the old value.
-
- @param {anything} key
- @param {anything} value
- */
- set: function(key, value) {
- var keys = this.keys,
- values = this.values,
- guid = guidFor(key);
-
- keys.add(key);
- values[guid] = value;
- },
-
- /**
- Removes a value from the map for an associated key.
-
- @param {anything} key
- @returns {Boolean} true if an item was removed, false otherwise
- */
- remove: function(key) {
- // don't use ES6 "delete" because it will be annoying
- // to use in browsers that are not ES6 friendly;
- var keys = this.keys,
- values = this.values,
- guid = guidFor(key),
- value;
-
- if (values.hasOwnProperty(guid)) {
- keys.remove(key);
- value = values[guid];
- delete values[guid];
- return true;
- } else {
- return false;
- }
- },
-
- /**
- Check whether a key is present.
-
- @param {anything} key
- @returns {Boolean} true if the item was present, false otherwise
- */
- has: function(key) {
- var values = this.values,
- guid = guidFor(key);
-
- return values.hasOwnProperty(guid);
- },
-
- /**
- Iterate over all the keys and values. Calls the function once
- for each key, passing in the key and value, in that order.
-
- The keys are guaranteed to be iterated over in insertion order.
-
- @param {Function} callback
- @param {anything} self if passed, the `this` value inside the
- callback. By default, `this` is the map.
- */
- forEach: function(callback, self) {
- var keys = this.keys,
- values = this.values;
-
- keys.forEach(function(key) {
- var guid = guidFor(key);
- callback.call(self, key, values[guid]);
- });
- },
-
- copy: function() {
- return copyMap(this, new Map());
- }
-};
-
-var MapWithDefault = Ember.MapWithDefault = function(options) {
- Map.call(this);
- this.defaultValue = options.defaultValue;
-};
-
-MapWithDefault.create = function(options) {
- if (options) {
- return new MapWithDefault(options);
- } else {
- return new Map();
- }
-};
-
-MapWithDefault.prototype = Ember.create(Map.prototype);
-
-MapWithDefault.prototype.get = function(key) {
- var hasValue = this.has(key);
-
- if (hasValue) {
- return Map.prototype.get.call(this, key);
- } else {
- var defaultValue = this.defaultValue(key);
- this.set(key, defaultValue);
- return defaultValue;
- }
-};
-
-MapWithDefault.prototype.copy = function() {
- return copyMap(this, new MapWithDefault({
- defaultValue: this.defaultValue
- }));
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var META_KEY = Ember.META_KEY, get, set;
-
-var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
-
-/** @private */
-var IS_GLOBAL = /^([A-Z$]|([0-9][A-Z$]))/;
-var IS_GLOBAL_PATH = /^([A-Z$]|([0-9][A-Z$])).*[\.\*]/;
-var HAS_THIS = /^this[\.\*]/;
-var FIRST_KEY = /^([^\.\*]+)/;
-
-// ..........................................................
-// GET AND SET
-//
-// If we are on a platform that supports accessors we can get use those.
-// Otherwise simulate accessors by looking up the property directly on the
-// object.
-
-/** @private */
-get = function get(obj, keyName) {
- // Helpers that operate with 'this' within an #each
- if (keyName === '') {
- return obj;
- }
-
- if (!keyName && 'string'===typeof obj) {
- keyName = obj;
- obj = null;
- }
-
- if (!obj || keyName.indexOf('.') !== -1) {
- return getPath(obj, keyName);
- }
-
- Ember.assert("You need to provide an object and key to `get`.", !!obj && keyName);
-
- var meta = obj[META_KEY], desc = meta && meta.descs[keyName], ret;
- if (desc) {
- return desc.get(obj, keyName);
- } else {
- if (MANDATORY_SETTER && meta && meta.watching[keyName] > 0) {
- ret = meta.values[keyName];
- } else {
- ret = obj[keyName];
- }
-
- if (ret === undefined &&
- 'object' === typeof obj && !(keyName in obj) && 'function' === typeof obj.unknownProperty) {
- return obj.unknownProperty(keyName);
- }
-
- return ret;
- }
-};
-
-/** @private */
-set = function set(obj, keyName, value, tolerant) {
- if (typeof obj === 'string') {
- Ember.assert("Path '" + obj + "' must be global if no obj is given.", IS_GLOBAL.test(obj));
- value = keyName;
- keyName = obj;
- obj = null;
- }
-
- if (!obj || keyName.indexOf('.') !== -1) {
- return setPath(obj, keyName, value, tolerant);
- }
-
- Ember.assert("You need to provide an object and key to `set`.", !!obj && keyName !== undefined);
- Ember.assert('calling set on destroyed object', !obj.isDestroyed);
-
- var meta = obj[META_KEY], desc = meta && meta.descs[keyName],
- isUnknown, currentValue;
- if (desc) {
- desc.set(obj, keyName, value);
- }
- else {
- isUnknown = 'object' === typeof obj && !(keyName in obj);
-
- // setUnknownProperty is called if `obj` is an object,
- // the property does not already exist, and the
- // `setUnknownProperty` method exists on the object
- if (isUnknown && 'function' === typeof obj.setUnknownProperty) {
- obj.setUnknownProperty(keyName, value);
- } else if (meta && meta.watching[keyName] > 0) {
- if (MANDATORY_SETTER) {
- currentValue = meta.values[keyName];
- } else {
- currentValue = obj[keyName];
- }
- // only trigger a change if the value has changed
- if (value !== currentValue) {
- Ember.propertyWillChange(obj, keyName);
- if (MANDATORY_SETTER) {
- if (currentValue === undefined && !(keyName in obj)) {
- Ember.defineProperty(obj, keyName, null, value); // setup mandatory setter
- } else {
- meta.values[keyName] = value;
- }
- } else {
- obj[keyName] = value;
- }
- Ember.propertyDidChange(obj, keyName);
- }
- } else {
- obj[keyName] = value;
- }
- }
- return value;
-};
-
-/** @private */
-function firstKey(path) {
- return path.match(FIRST_KEY)[0];
-}
-
-// assumes path is already normalized
-/** @private */
-function normalizeTuple(target, path) {
- var hasThis = HAS_THIS.test(path),
- isGlobal = !hasThis && IS_GLOBAL_PATH.test(path),
- key;
-
- if (!target || isGlobal) target = window;
- if (hasThis) path = path.slice(5);
-
- if (target === window) {
- key = firstKey(path);
- target = get(target, key);
- path = path.slice(key.length+1);
- }
-
- // must return some kind of path to be valid else other things will break.
- if (!path || path.length===0) throw new Error('Invalid Path');
-
- return [ target, path ];
-}
-
-/** @private */
-function getPath(root, path) {
- var hasThis, parts, tuple, idx, len;
-
- // If there is no root and path is a key name, return that
- // property from the global object.
- // E.g. get('Ember') -> Ember
- if (root === null && path.indexOf('.') === -1) { return get(window, path); }
-
- // detect complicated paths and normalize them
- hasThis = HAS_THIS.test(path);
-
- if (!root || hasThis) {
- tuple = normalizeTuple(root, path);
- root = tuple[0];
- path = tuple[1];
- tuple.length = 0;
- }
-
- parts = path.split(".");
- len = parts.length;
- for (idx=0; root && idx<len; idx++) {
- root = get(root, parts[idx], true);
- if (root && root.isDestroyed) { return undefined; }
- }
- return root;
-}
-
-/** @private */
-function setPath(root, path, value, tolerant) {
- var keyName;
-
- // get the last part of the path
- keyName = path.slice(path.lastIndexOf('.') + 1);
-
- // get the first part of the part
- path = path.slice(0, path.length-(keyName.length+1));
-
- // unless the path is this, look up the first part to
- // get the root
- if (path !== 'this') {
- root = getPath(root, path);
- }
-
- if (!keyName || keyName.length === 0) {
- throw new Error('You passed an empty path');
- }
-
- if (!root) {
- if (tolerant) { return; }
- else { throw new Error('Object in path '+path+' could not be found or was destroyed.'); }
- }
-
- return set(root, keyName, value);
-}
-
-/**
- @private
-
- Normalizes a target/path pair to reflect that actual target/path that should
- be observed, etc. This takes into account passing in global property
- paths (i.e. a path beginning with a captial letter not defined on the
- target) and * separators.
-
- @param {Object} target
- The current target. May be null.
-
- @param {String} path
- A path on the target or a global property path.
-
- @returns {Array} a temporary array with the normalized target/path pair.
-*/
-Ember.normalizeTuple = function(target, path) {
- return normalizeTuple(target, path);
-};
-
-Ember.getWithDefault = function(root, key, defaultValue) {
- var value = get(root, key);
-
- if (value === undefined) { return defaultValue; }
- return value;
-};
-
-
-/**
- @function
-
- Gets the value of a property on an object. If the property is computed,
- the function will be invoked. If the property is not defined but the
- object implements the unknownProperty() method then that will be invoked.
-
- If you plan to run on IE8 and older browsers then you should use this
- method anytime you want to retrieve a property on an object that you don't
- know for sure is private. (My convention only properties beginning with
- an underscore '_' are considered private.)
-
- On all newer browsers, you only need to use this method to retrieve
- properties if the property might not be defined on the object and you want
- to respect the unknownProperty() handler. Otherwise you can ignore this
- method.
-
- Note that if the obj itself is null, this method will simply return
- undefined.
-
- @param {Object} obj
- The object to retrieve from.
-
- @param {String} keyName
- The property key to retrieve
-
- @returns {Object} the property value or null.
-*/
-Ember.get = get;
-Ember.getPath = Ember.deprecateFunc('getPath is deprecated since get now supports paths', Ember.get);
-
-/**
- @function
-
- Sets the value of a property on an object, respecting computed properties
- and notifying observers and other listeners of the change. If the
- property is not defined but the object implements the unknownProperty()
- method then that will be invoked as well.
-
- If you plan to run on IE8 and older browsers then you should use this
- method anytime you want to set a property on an object that you don't
- know for sure is private. (My convention only properties beginning with
- an underscore '_' are considered private.)
-
- On all newer browsers, you only need to use this method to set
- properties if the property might not be defined on the object and you want
- to respect the unknownProperty() handler. Otherwise you can ignore this
- method.
-
- @param {Object} obj
- The object to modify.
-
- @param {String} keyName
- The property key to set
-
- @param {Object} value
- The value to set
-
- @returns {Object} the passed value.
-*/
-Ember.set = set;
-Ember.setPath = Ember.deprecateFunc('setPath is deprecated since set now supports paths', Ember.set);
-
-/**
- Error-tolerant form of Ember.set. Will not blow up if any part of the
- chain is undefined, null, or destroyed.
-
- This is primarily used when syncing bindings, which may try to update after
- an object has been destroyed.
-*/
-Ember.trySet = function(root, path, value) {
- return set(root, path, value, true);
-};
-Ember.trySetPath = Ember.deprecateFunc('trySetPath has been renamed to trySet', Ember.trySet);
-
-/**
- Returns true if the provided path is global (e.g., "MyApp.fooController.bar")
- instead of local ("foo.bar.baz").
-
- @param {String} path
- @returns Boolean
-*/
-Ember.isGlobalPath = function(path) {
- return IS_GLOBAL.test(path);
-};
-
-
-
-if (Ember.config.overrideAccessors) {
- Ember.config.overrideAccessors();
- get = Ember.get;
- set = Ember.set;
-}
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var GUID_KEY = Ember.GUID_KEY,
- META_KEY = Ember.META_KEY,
- EMPTY_META = Ember.EMPTY_META,
- metaFor = Ember.meta,
- o_create = Ember.create,
- objectDefineProperty = Ember.platform.defineProperty;
-
-var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER;
-
-// ..........................................................
-// DESCRIPTOR
-//
-
-/**
- @private
- @constructor
-
- Objects of this type can implement an interface to responds requests to
- get and set. The default implementation handles simple properties.
-
- You generally won't need to create or subclass this directly.
-*/
-var Descriptor = Ember.Descriptor = function() {};
-
-// ..........................................................
-// DEFINING PROPERTIES API
-//
-
-/**
- @private
-
- NOTE: This is a low-level method used by other parts of the API. You almost
- never want to call this method directly. Instead you should use Ember.mixin()
- to define new properties.
-
- Defines a property on an object. This method works much like the ES5
- Object.defineProperty() method except that it can also accept computed
- properties and other special descriptors.
-
- Normally this method takes only three parameters. However if you pass an
- instance of Ember.Descriptor as the third param then you can pass an optional
- value as the fourth parameter. This is often more efficient than creating
- new descriptor hashes for each property.
-
- ## Examples
-
- // ES5 compatible mode
- Ember.defineProperty(contact, 'firstName', {
- writable: true,
- configurable: false,
- enumerable: true,
- value: 'Charles'
- });
-
- // define a simple property
- Ember.defineProperty(contact, 'lastName', undefined, 'Jolley');
-
- // define a computed property
- Ember.defineProperty(contact, 'fullName', Ember.computed(function() {
- return this.firstName+' '+this.lastName;
- }).property('firstName', 'lastName').cacheable());
-*/
-Ember.defineProperty = function(obj, keyName, desc, data, meta) {
- // The first two parameters to defineProperty are mandatory:
- //
- // * obj: the object to define this property on. This may be
- // a prototype.
- // * keyName: the name of the property
- //
- // One and only one of the following two parameters must be
- // provided:
- //
- // * desc: an instance of Ember.Descriptor (typically a
- // computed property) or an ES5 descriptor.
- // * data: something other than a descriptor, that will
- // become the explicit value of this property.
-
- var descs, existingDesc, watching, value;
-
- if (!meta) meta = metaFor(obj);
- descs = meta.descs;
- existingDesc = meta.descs[keyName];
- watching = meta.watching[keyName] > 0;
-
- if (existingDesc instanceof Ember.Descriptor) {
- existingDesc.teardown(obj, keyName);
- }
-
- if (desc instanceof Ember.Descriptor) {
- value = desc;
-
- descs[keyName] = desc;
- if (MANDATORY_SETTER && watching) {
- objectDefineProperty(obj, keyName, {
- configurable: true,
- enumerable: true,
- writable: true,
- value: undefined // make enumerable
- });
- } else {
- obj[keyName] = undefined; // make enumerable
- }
- desc.setup(obj, keyName);
- } else {
- descs[keyName] = undefined; // shadow descriptor in proto
- if (desc == null) {
- value = data;
-
- if (MANDATORY_SETTER && watching) {
- meta.values[keyName] = data;
- objectDefineProperty(obj, keyName, {
- configurable: true,
- enumerable: true,
- set: function() {
- Ember.assert('Must use Ember.set() to access this property', false);
- },
- get: function() {
- var meta = this[META_KEY];
- return meta && meta.values[keyName];
- }
- });
- } else {
- obj[keyName] = data;
- }
- } else {
- value = desc;
-
- // compatibility with ES5
- objectDefineProperty(obj, keyName, desc);
- }
- }
-
- // if key is being watched, override chains that
- // were initialized with the prototype
- if (watching) { Ember.overrideChains(obj, keyName, meta); }
-
- // The `value` passed to the `didDefineProperty` hook is
- // either the descriptor or data, whichever was passed.
- if (obj.didDefineProperty) { obj.didDefineProperty(obj, keyName, value); }
-
- return this;
-};
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var AFTER_OBSERVERS = ':change';
-var BEFORE_OBSERVERS = ':before';
-var guidFor = Ember.guidFor;
-
-var deferred = 0;
-var array_Slice = [].slice;
-
-/** @private */
-var ObserverSet = function () {
- this.targetSet = {};
-};
-ObserverSet.prototype.add = function (target, path) {
- var targetSet = this.targetSet,
- targetGuid = Ember.guidFor(target),
- pathSet = targetSet[targetGuid];
- if (!pathSet) {
- targetSet[targetGuid] = pathSet = {};
- }
- if (pathSet[path]) {
- return false;
- } else {
- return pathSet[path] = true;
- }
-};
-ObserverSet.prototype.clear = function () {
- this.targetSet = {};
-};
-
-/** @private */
-var DeferredEventQueue = function() {
- this.targetSet = {};
- this.queue = [];
-};
-
-DeferredEventQueue.prototype.push = function(target, eventName, keyName) {
- var targetSet = this.targetSet,
- queue = this.queue,
- targetGuid = Ember.guidFor(target),
- eventNameSet = targetSet[targetGuid],
- index;
-
- if (!eventNameSet) {
- targetSet[targetGuid] = eventNameSet = {};
- }
- index = eventNameSet[eventName];
- if (index === undefined) {
- eventNameSet[eventName] = queue.push(Ember.deferEvent(target, eventName, [target, keyName])) - 1;
- } else {
- queue[index] = Ember.deferEvent(target, eventName, [target, keyName]);
- }
-};
-
-DeferredEventQueue.prototype.flush = function() {
- var queue = this.queue;
- this.queue = [];
- this.targetSet = {};
- for (var i=0, len=queue.length; i < len; ++i) {
- queue[i]();
- }
-};
-
-var queue = new DeferredEventQueue(), beforeObserverSet = new ObserverSet();
-
-/** @private */
-function notifyObservers(obj, eventName, keyName, forceNotification) {
- if (deferred && !forceNotification) {
- queue.push(obj, eventName, keyName);
- } else {
- Ember.sendEvent(obj, eventName, [obj, keyName]);
- }
-}
-
-/** @private */
-function flushObserverQueue() {
- beforeObserverSet.clear();
-
- queue.flush();
-}
-
-Ember.beginPropertyChanges = function() {
- deferred++;
- return this;
-};
-
-Ember.endPropertyChanges = function() {
- deferred--;
- if (deferred<=0) flushObserverQueue();
-};
-
-/**
- Make a series of property changes together in an
- exception-safe way.
-
- Ember.changeProperties(function() {
- obj1.set('foo', mayBlowUpWhenSet);
- obj2.set('bar', baz);
- });
-*/
-Ember.changeProperties = function(cb, binding){
- Ember.beginPropertyChanges();
- try {
- cb.call(binding);
- } finally {
- Ember.endPropertyChanges();
- }
-};
-
-/**
- Set a list of properties on an object. These properties are set inside
- a single `beginPropertyChanges` and `endPropertyChanges` batch, so
- observers will be buffered.
-*/
-Ember.setProperties = function(self, hash) {
- Ember.changeProperties(function(){
- for(var prop in hash) {
- if (hash.hasOwnProperty(prop)) Ember.set(self, prop, hash[prop]);
- }
- });
- return self;
-};
-
-
-/** @private */
-function changeEvent(keyName) {
- return keyName+AFTER_OBSERVERS;
-}
-
-/** @private */
-function beforeEvent(keyName) {
- return keyName+BEFORE_OBSERVERS;
-}
-
-Ember.addObserver = function(obj, path, target, method) {
- Ember.addListener(obj, changeEvent(path), target, method);
- Ember.watch(obj, path);
- return this;
-};
-
-/** @private */
-Ember.observersFor = function(obj, path) {
- return Ember.listenersFor(obj, changeEvent(path));
-};
-
-Ember.removeObserver = function(obj, path, target, method) {
- Ember.unwatch(obj, path);
- Ember.removeListener(obj, changeEvent(path), target, method);
- return this;
-};
-
-Ember.addBeforeObserver = function(obj, path, target, method) {
- Ember.addListener(obj, beforeEvent(path), target, method);
- Ember.watch(obj, path);
- return this;
-};
-
-// Suspend observer during callback.
-//
-// This should only be used by the target of the observer
-// while it is setting the observed path.
-/** @private */
-Ember._suspendBeforeObserver = function(obj, path, target, method, callback) {
- return Ember._suspendListener(obj, beforeEvent(path), target, method, callback);
-};
-
-Ember._suspendObserver = function(obj, path, target, method, callback) {
- return Ember._suspendListener(obj, changeEvent(path), target, method, callback);
-};
-
-/** @private */
-Ember.beforeObserversFor = function(obj, path) {
- return Ember.listenersFor(obj, beforeEvent(path));
-};
-
-Ember.removeBeforeObserver = function(obj, path, target, method) {
- Ember.unwatch(obj, path);
- Ember.removeListener(obj, beforeEvent(path), target, method);
- return this;
-};
-
-/** @private */
-Ember.notifyObservers = function(obj, keyName) {
- if (obj.isDestroying) { return; }
-
- notifyObservers(obj, changeEvent(keyName), keyName);
-};
-
-/** @private */
-Ember.notifyBeforeObservers = function(obj, keyName) {
- if (obj.isDestroying) { return; }
-
- var guid, set, forceNotification = false;
-
- if (deferred) {
- if (beforeObserverSet.add(obj, keyName)) {
- forceNotification = true;
- } else {
- return;
- }
- }
-
- notifyObservers(obj, beforeEvent(keyName), keyName, forceNotification);
-};
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var guidFor = Ember.guidFor, // utils.js
- metaFor = Ember.meta, // utils.js
- get = Ember.get, // accessors.js
- set = Ember.set, // accessors.js
- normalizeTuple = Ember.normalizeTuple, // accessors.js
- GUID_KEY = Ember.GUID_KEY, // utils.js
- META_KEY = Ember.META_KEY, // utils.js
- // circular reference observer depends on Ember.watch
- // we should move change events to this file or its own property_events.js
- notifyObservers = Ember.notifyObservers, // observer.js
- forEach = Ember.ArrayPolyfills.forEach, // array.js
- FIRST_KEY = /^([^\.\*]+)/,
- IS_PATH = /[\.\*]/;
-
-var MANDATORY_SETTER = Ember.ENV.MANDATORY_SETTER,
-o_defineProperty = Ember.platform.defineProperty;
-
-/** @private */
-function firstKey(path) {
- return path.match(FIRST_KEY)[0];
-}
-
-// returns true if the passed path is just a keyName
-/** @private */
-function isKeyName(path) {
- return path==='*' || !IS_PATH.test(path);
-}
-
-// ..........................................................
-// DEPENDENT KEYS
-//
-
-var DEP_SKIP = { __emberproto__: true }; // skip some keys and toString
-
-/** @private */
-function iterDeps(method, obj, depKey, seen, meta) {
-
- var guid = guidFor(obj);
- if (!seen[guid]) seen[guid] = {};
- if (seen[guid][depKey]) return;
- seen[guid][depKey] = true;
-
- var deps = meta.deps;
- deps = deps && deps[depKey];
- if (deps) {
- for(var key in deps) {
- if (DEP_SKIP[key]) continue;
- method(obj, key);
- }
- }
-}
-
-
-var WILL_SEEN, DID_SEEN;
-
-// called whenever a property is about to change to clear the cache of any dependent keys (and notify those properties of changes, etc...)
-/** @private */
-function dependentKeysWillChange(obj, depKey, meta) {
- if (obj.isDestroying) { return; }
-
- var seen = WILL_SEEN, top = !seen;
- if (top) { seen = WILL_SEEN = {}; }
- iterDeps(propertyWillChange, obj, depKey, seen, meta);
- if (top) { WILL_SEEN = null; }
-}
-
-// called whenever a property has just changed to update dependent keys
-/** @private */
-function dependentKeysDidChange(obj, depKey, meta) {
- if (obj.isDestroying) { return; }
-
- var seen = DID_SEEN, top = !seen;
- if (top) { seen = DID_SEEN = {}; }
- iterDeps(propertyDidChange, obj, depKey, seen, meta);
- if (top) { DID_SEEN = null; }
-}
-
-// ..........................................................
-// CHAIN
-//
-
-/** @private */
-function addChainWatcher(obj, keyName, node) {
- if (!obj || ('object' !== typeof obj)) return; // nothing to do
- var m = metaFor(obj);
- var nodes = m.chainWatchers;
- if (!nodes || nodes.__emberproto__ !== obj) {
- nodes = m.chainWatchers = { __emberproto__: obj };
- }
-
- if (!nodes[keyName]) { nodes[keyName] = {}; }
- nodes[keyName][guidFor(node)] = node;
- Ember.watch(obj, keyName);
-}
-
-/** @private */
-function removeChainWatcher(obj, keyName, node) {
- if (!obj || 'object' !== typeof obj) { return; } // nothing to do
- var m = metaFor(obj, false),
- nodes = m.chainWatchers;
- if (!nodes || nodes.__emberproto__ !== obj) { return; } //nothing to do
- if (nodes[keyName]) { delete nodes[keyName][guidFor(node)]; }
- Ember.unwatch(obj, keyName);
-}
-
-var pendingQueue = [];
-
-// attempts to add the pendingQueue chains again. If some of them end up
-// back in the queue and reschedule is true, schedules a timeout to try
-// again.
-/** @private */
-function flushPendingChains() {
- if (pendingQueue.length === 0) { return; } // nothing to do
-
- var queue = pendingQueue;
- pendingQueue = [];
-
- forEach.call(queue, function(q) { q[0].add(q[1]); });
-
- Ember.warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);
-}
-
-/** @private */
-function isProto(pvalue) {
- return metaFor(pvalue, false).proto === pvalue;
-}
-
-// A ChainNode watches a single key on an object. If you provide a starting
-// value for the key then the node won't actually watch it. For a root node
-// pass null for parent and key and object for value.
-/** @private */
-var ChainNode = function(parent, key, value, separator) {
- var obj;
- this._parent = parent;
- this._key = key;
-
- // _watching is true when calling get(this._parent, this._key) will
- // return the value of this node.
- //
- // It is false for the root of a chain (because we have no parent)
- // and for global paths (because the parent node is the object with
- // the observer on it)
- this._watching = value===undefined;
-
- this._value = value;
- this._separator = separator || '.';
- this._paths = {};
- if (this._watching) {
- this._object = parent.value();
- if (this._object) { addChainWatcher(this._object, this._key, this); }
- }
-
- // Special-case: the EachProxy relies on immediate evaluation to
- // establish its observers.
- //
- // TODO: Replace this with an efficient callback that the EachProxy
- // can implement.
- if (this._parent && this._parent._key === '@each') {
- this.value();
- }
-};
-
-var ChainNodePrototype = ChainNode.prototype;
-
-ChainNodePrototype.value = function() {
- if (this._value === undefined && this._watching) {
- var obj = this._parent.value();
- this._value = (obj && !isProto(obj)) ? get(obj, this._key) : undefined;
- }
- return this._value;
-};
-
-ChainNodePrototype.destroy = function() {
- if (this._watching) {
- var obj = this._object;
- if (obj) { removeChainWatcher(obj, this._key, this); }
- this._watching = false; // so future calls do nothing
- }
-};
-
-// copies a top level object only
-ChainNodePrototype.copy = function(obj) {
- var ret = new ChainNode(null, null, obj, this._separator),
- paths = this._paths, path;
- for (path in paths) {
- if (paths[path] <= 0) { continue; } // this check will also catch non-number vals.
- ret.add(path);
- }
- return ret;
-};
-
-// called on the root node of a chain to setup watchers on the specified
-// path.
-ChainNodePrototype.add = function(path) {
- var obj, tuple, key, src, separator, paths;
-
- paths = this._paths;
- paths[path] = (paths[path] || 0) + 1;
-
- obj = this.value();
- tuple = normalizeTuple(obj, path);
-
- // the path was a local path
- if (tuple[0] && tuple[0] === obj) {
- path = tuple[1];
- key = firstKey(path);
- path = path.slice(key.length+1);
-
- // global path, but object does not exist yet.
- // put into a queue and try to connect later.
- } else if (!tuple[0]) {
- pendingQueue.push([this, path]);
- tuple.length = 0;
- return;
-
- // global path, and object already exists
- } else {
- src = tuple[0];
- key = path.slice(0, 0-(tuple[1].length+1));
- separator = path.slice(key.length, key.length+1);
- path = tuple[1];
- }
-
- tuple.length = 0;
- this.chain(key, path, src, separator);
-};
-
-// called on the root node of a chain to teardown watcher on the specified
-// path
-ChainNodePrototype.remove = function(path) {
- var obj, tuple, key, src, paths;
-
- paths = this._paths;
- if (paths[path] > 0) { paths[path]--; }
-
- obj = this.value();
- tuple = normalizeTuple(obj, path);
- if (tuple[0] === obj) {
- path = tuple[1];
- key = firstKey(path);
- path = path.slice(key.length+1);
- } else {
- src = tuple[0];
- key = path.slice(0, 0-(tuple[1].length+1));
- path = tuple[1];
- }
-
- tuple.length = 0;
- this.unchain(key, path);
-};
-
-ChainNodePrototype.count = 0;
-
-ChainNodePrototype.chain = function(key, path, src, separator) {
- var chains = this._chains, node;
- if (!chains) { chains = this._chains = {}; }
-
- node = chains[key];
- if (!node) { node = chains[key] = new ChainNode(this, key, src, separator); }
- node.count++; // count chains...
-
- // chain rest of path if there is one
- if (path && path.length>0) {
- key = firstKey(path);
- path = path.slice(key.length+1);
- node.chain(key, path); // NOTE: no src means it will observe changes...
- }
-};
-
-ChainNodePrototype.unchain = function(key, path) {
- var chains = this._chains, node = chains[key];
-
- // unchain rest of path first...
- if (path && path.length>1) {
- key = firstKey(path);
- path = path.slice(key.length+1);
- node.unchain(key, path);
- }
-
- // delete node if needed.
- node.count--;
- if (node.count<=0) {
- delete chains[node._key];
- node.destroy();
- }
-
-};
-
-ChainNodePrototype.willChange = function() {
- var chains = this._chains;
- if (chains) {
- for(var key in chains) {
- if (!chains.hasOwnProperty(key)) { continue; }
- chains[key].willChange();
- }
- }
-
- if (this._parent) { this._parent.chainWillChange(this, this._key, 1); }
-};
-
-ChainNodePrototype.chainWillChange = function(chain, path, depth) {
- if (this._key) { path = this._key + this._separator + path; }
-
- if (this._parent) {
- this._parent.chainWillChange(this, path, depth+1);
- } else {
- if (depth > 1) { Ember.propertyWillChange(this.value(), path); }
- path = 'this.' + path;
- if (this._paths[path] > 0) { Ember.propertyWillChange(this.value(), path); }
- }
-};
-
-ChainNodePrototype.chainDidChange = function(chain, path, depth) {
- if (this._key) { path = this._key + this._separator + path; }
- if (this._parent) {
- this._parent.chainDidChange(this, path, depth+1);
- } else {
- if (depth > 1) { Ember.propertyDidChange(this.value(), path); }
- path = 'this.' + path;
- if (this._paths[path] > 0) { Ember.propertyDidChange(this.value(), path); }
- }
-};
-
-ChainNodePrototype.didChange = function(suppressEvent) {
- // invalidate my own value first.
- if (this._watching) {
- var obj = this._parent.value();
- if (obj !== this._object) {
- removeChainWatcher(this._object, this._key, this);
- this._object = obj;
- addChainWatcher(obj, this._key, this);
- }
- this._value = undefined;
-
- // Special-case: the EachProxy relies on immediate evaluation to
- // establish its observers.
- if (this._parent && this._parent._key === '@each')
- this.value();
- }
-
- // then notify chains...
- var chains = this._chains;
- if (chains) {
- for(var key in chains) {
- if (!chains.hasOwnProperty(key)) { continue; }
- chains[key].didChange(suppressEvent);
- }
- }
-
- if (suppressEvent) { return; }
-
- // and finally tell parent about my path changing...
- if (this._parent) { this._parent.chainDidChange(this, this._key, 1); }
-};
-
-// get the chains for the current object. If the current object has
-// chains inherited from the proto they will be cloned and reconfigured for
-// the current object.
-/** @private */
-function chainsFor(obj) {
- var m = metaFor(obj), ret = m.chains;
- if (!ret) {
- ret = m.chains = new ChainNode(null, null, obj);
- } else if (ret.value() !== obj) {
- ret = m.chains = ret.copy(obj);
- }
- return ret;
-}
-
-/** @private */
-function notifyChains(obj, m, keyName, methodName, arg) {
- var nodes = m.chainWatchers;
-
- if (!nodes || nodes.__emberproto__ !== obj) { return; } // nothing to do
-
- nodes = nodes[keyName];
- if (!nodes) { return; }
-
- for(var key in nodes) {
- if (!nodes.hasOwnProperty(key)) { continue; }
- nodes[key][methodName](arg);
- }
-}
-
-Ember.overrideChains = function(obj, keyName, m) {
- notifyChains(obj, m, keyName, 'didChange', true);
-};
-
-/** @private */
-function chainsWillChange(obj, keyName, m) {
- notifyChains(obj, m, keyName, 'willChange');
-}
-
-/** @private */
-function chainsDidChange(obj, keyName, m) {
- notifyChains(obj, m, keyName, 'didChange');
-}
-
-// ..........................................................
-// WATCH
-//
-
-/**
- @private
-
- Starts watching a property on an object. Whenever the property changes,
- invokes Ember.propertyWillChange and Ember.propertyDidChange. This is the
- primitive used by observers and dependent keys; usually you will never call
- this method directly but instead use higher level methods like
- Ember.addObserver().
-*/
-Ember.watch = function(obj, keyName) {
- // can't watch length on Array - it is special...
- if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }
-
- var m = metaFor(obj), watching = m.watching, desc;
-
- // activate watching first time
- if (!watching[keyName]) {
- watching[keyName] = 1;
- if (isKeyName(keyName)) {
- desc = m.descs[keyName];
- if (desc && desc.willWatch) { desc.willWatch(obj, keyName); }
-
- if ('function' === typeof obj.willWatchProperty) {
- obj.willWatchProperty(keyName);
- }
-
- if (MANDATORY_SETTER && keyName in obj) {
- m.values[keyName] = obj[keyName];
- o_defineProperty(obj, keyName, {
- configurable: true,
- enumerable: true,
- set: function() {
- Ember.assert('Must use Ember.set() to access this property', false);
- },
- get: function() {
- var meta = this[META_KEY];
- return meta && meta.values[keyName];
- }
- });
- }
- } else {
- chainsFor(obj).add(keyName);
- }
-
- } else {
- watching[keyName] = (watching[keyName] || 0) + 1;
- }
- return this;
-};
-
-Ember.isWatching = function isWatching(obj, key) {
- var meta = obj[META_KEY];
- return (meta && meta.watching[key]) > 0;
-};
-
-Ember.watch.flushPending = flushPendingChains;
-
-/** @private */
-Ember.unwatch = function(obj, keyName) {
- // can't watch length on Array - it is special...
- if (keyName === 'length' && Ember.typeOf(obj) === 'array') { return this; }
-
- var m = metaFor(obj), watching = m.watching, desc;
-
- if (watching[keyName] === 1) {
- watching[keyName] = 0;
-
- if (isKeyName(keyName)) {
- desc = m.descs[keyName];
- if (desc && desc.didUnwatch) { desc.didUnwatch(obj, keyName); }
-
- if ('function' === typeof obj.didUnwatchProperty) {
- obj.didUnwatchProperty(keyName);
- }
-
- if (MANDATORY_SETTER && keyName in obj) {
- o_defineProperty(obj, keyName, {
- configurable: true,
- enumerable: true,
- writable: true,
- value: m.values[keyName]
- });
- delete m.values[keyName];
- }
- } else {
- chainsFor(obj).remove(keyName);
- }
-
- } else if (watching[keyName]>1) {
- watching[keyName]--;
- }
-
- return this;
-};
-
-/**
- @private
-
- Call on an object when you first beget it from another object. This will
- setup any chained watchers on the object instance as needed. This method is
- safe to call multiple times.
-*/
-Ember.rewatch = function(obj) {
- var m = metaFor(obj, false), chains = m.chains;
-
- // make sure the object has its own guid.
- if (GUID_KEY in obj && !obj.hasOwnProperty(GUID_KEY)) {
- Ember.generateGuid(obj, 'ember');
- }
-
- // make sure any chained watchers update.
- if (chains && chains.value() !== obj) {
- m.chains = chains.copy(obj);
- }
-
- return this;
-};
-
-Ember.finishChains = function(obj) {
- var m = metaFor(obj, false), chains = m.chains;
- if (chains) {
- if (chains.value() !== obj) {
- m.chains = chains = chains.copy(obj);
- }
- chains.didChange(true);
- }
-};
-
-// ..........................................................
-// PROPERTY CHANGES
-//
-
-/**
- This function is called just before an object property is about to change.
- It will notify any before observers and prepare caches among other things.
-
- Normally you will not need to call this method directly but if for some
- reason you can't directly watch a property you can invoke this method
- manually along with `Ember.propertyDidChange()` which you should call just
- after the property value changes.
-
- @memberOf Ember
-
- @param {Object} obj
- The object with the property that will change
-
- @param {String} keyName
- The property key (or path) that will change.
-
- @returns {void}
-*/
-function propertyWillChange(obj, keyName, value) {
- var m = metaFor(obj, false),
- watching = m.watching[keyName] > 0 || keyName === 'length',
- proto = m.proto,
- desc = m.descs[keyName];
-
- if (!watching) { return; }
- if (proto === obj) { return; }
- if (desc && desc.willChange) { desc.willChange(obj, keyName); }
- dependentKeysWillChange(obj, keyName, m);
- chainsWillChange(obj, keyName, m);
- Ember.notifyBeforeObservers(obj, keyName);
-}
-
-Ember.propertyWillChange = propertyWillChange;
-
-/**
- This function is called just after an object property has changed.
- It will notify any observers and clear caches among other things.
-
- Normally you will not need to call this method directly but if for some
- reason you can't directly watch a property you can invoke this method
- manually along with `Ember.propertyWilLChange()` which you should call just
- before the property value changes.
-
- @memberOf Ember
-
- @param {Object} obj
- The object with the property that will change
-
- @param {String} keyName
- The property key (or path) that will change.
-
- @returns {void}
-*/
-function propertyDidChange(obj, keyName) {
- var m = metaFor(obj, false),
- watching = m.watching[keyName] > 0 || keyName === 'length',
- proto = m.proto,
- desc = m.descs[keyName];
-
- if (proto === obj) { return; }
-
- // shouldn't this mean that we're watching this key?
- if (desc && desc.didChange) { desc.didChange(obj, keyName); }
- if (!watching && keyName !== 'length') { return; }
-
- dependentKeysDidChange(obj, keyName, m);
- chainsDidChange(obj, keyName, m);
- Ember.notifyObservers(obj, keyName);
-}
-
-Ember.propertyDidChange = propertyDidChange;
-
-var NODE_STACK = [];
-
-/**
- Tears down the meta on an object so that it can be garbage collected.
- Multiple calls will have no effect.
-
- @param {Object} obj the object to destroy
- @returns {void}
-*/
-Ember.destroy = function (obj) {
- var meta = obj[META_KEY], node, nodes, key, nodeObject;
- if (meta) {
- obj[META_KEY] = null;
- // remove chainWatchers to remove circular references that would prevent GC
- node = meta.chains;
- if (node) {
- NODE_STACK.push(node);
- // process tree
- while (NODE_STACK.length > 0) {
- node = NODE_STACK.pop();
- // push children
- nodes = node._chains;
- if (nodes) {
- for (key in nodes) {
- if (nodes.hasOwnProperty(key)) {
- NODE_STACK.push(nodes[key]);
- }
- }
- }
- // remove chainWatcher in node object
- if (node._watching) {
- nodeObject = node._object;
- if (nodeObject) {
- removeChainWatcher(nodeObject, node._key, node);
- }
- }
- }
- }
- }
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-Ember.warn("Computed properties will soon be cacheable by default. To enable this in your app, set `ENV.CP_DEFAULT_CACHEABLE = true`.", Ember.CP_DEFAULT_CACHEABLE);
-
-
-var get = Ember.get,
- metaFor = Ember.meta,
- guidFor = Ember.guidFor,
- a_slice = [].slice,
- o_create = Ember.create,
- META_KEY = Ember.META_KEY,
- watch = Ember.watch,
- unwatch = Ember.unwatch;
-
-// ..........................................................
-// DEPENDENT KEYS
-//
-
-// data structure:
-// meta.deps = {
-// 'depKey': {
-// 'keyName': count,
-// __emberproto__: SRC_OBJ [to detect clones]
-// },
-// __emberproto__: SRC_OBJ
-// }
-
-/**
- @private
-
- This function returns a map of unique dependencies for a
- given object and key.
-*/
-function keysForDep(obj, depsMeta, depKey) {
- var keys = depsMeta[depKey];
- if (!keys) {
- // if there are no dependencies yet for a the given key
- // create a new empty list of dependencies for the key
- keys = depsMeta[depKey] = { __emberproto__: obj };
- } else if (keys.__emberproto__ !== obj) {
- // otherwise if the dependency list is inherited from
- // a superclass, clone the hash
- keys = depsMeta[depKey] = o_create(keys);
- keys.__emberproto__ = obj;
- }
- return keys;
-}
-
-/**
- @private
-
- return obj[META_KEY].deps
- */
-function metaForDeps(obj, meta) {
- var deps = meta.deps;
- // If the current object has no dependencies...
- if (!deps) {
- // initialize the dependencies with a pointer back to
- // the current object
- deps = meta.deps = { __emberproto__: obj };
- } else if (deps.__emberproto__ !== obj) {
- // otherwise if the dependencies are inherited from the
- // object's superclass, clone the deps
- deps = meta.deps = o_create(deps);
- deps.__emberproto__ = obj;
- }
- return deps;
-}
-
-/** @private */
-function addDependentKeys(desc, obj, keyName, meta) {
- // the descriptor has a list of dependent keys, so
- // add all of its dependent keys.
- var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;
- if (!depKeys) return;
-
- depsMeta = metaForDeps(obj, meta);
-
- for(idx = 0, len = depKeys.length; idx < len; idx++) {
- depKey = depKeys[idx];
- // Lookup keys meta for depKey
- keys = keysForDep(obj, depsMeta, depKey);
- // Increment the number of times depKey depends on keyName.
- keys[keyName] = (keys[keyName] || 0) + 1;
- // Watch the depKey
- watch(obj, depKey);
- }
-}
-
-/** @private */
-function removeDependentKeys(desc, obj, keyName, meta) {
- // the descriptor has a list of dependent keys, so
- // add all of its dependent keys.
- var depKeys = desc._dependentKeys, depsMeta, idx, len, depKey, keys;
- if (!depKeys) return;
-
- depsMeta = metaForDeps(obj, meta);
-
- for(idx = 0, len = depKeys.length; idx < len; idx++) {
- depKey = depKeys[idx];
- // Lookup keys meta for depKey
- keys = keysForDep(obj, depsMeta, depKey);
- // Increment the number of times depKey depends on keyName.
- keys[keyName] = (keys[keyName] || 0) - 1;
- // Watch the depKey
- unwatch(obj, depKey);
- }
-}
-
-// ..........................................................
-// COMPUTED PROPERTY
-//
-
-/** @private */
-function ComputedProperty(func, opts) {
- this.func = func;
- this._cacheable = (opts && opts.cacheable !== undefined) ? opts.cacheable : Ember.CP_DEFAULT_CACHEABLE;
- this._dependentKeys = opts && opts.dependentKeys;
-}
-
-/**
- @constructor
-*/
-Ember.ComputedProperty = ComputedProperty;
-ComputedProperty.prototype = new Ember.Descriptor();
-
-/**
- @extends Ember.ComputedProperty
- @private
-*/
-var ComputedPropertyPrototype = ComputedProperty.prototype;
-
-/**
- Call on a computed property to set it into cacheable mode. When in this
- mode the computed property will automatically cache the return value of
- your function until one of the dependent keys changes.
-
- MyApp.president = Ember.Object.create({
- fullName: function() {
- return this.get('firstName') + ' ' + this.get('lastName');
-
- // After calculating the value of this function, Ember.js will
- // return that value without re-executing this function until
- // one of the dependent properties change.
- }.property('firstName', 'lastName').cacheable()
- });
-
- Properties are cacheable by default.
-
- @memberOf Ember.ComputedProperty.prototype
- @name cacheable
- @function
- @param {Boolean} aFlag optional set to false to disable caching
- @returns {Ember.ComputedProperty} receiver
-*/
-ComputedPropertyPrototype.cacheable = function(aFlag) {
- this._cacheable = aFlag !== false;
- return this;
-};
-
-/**
- Call on a computed property to set it into non-cached mode. When in this
- mode the computed property will not automatically cache the return value.
-
- MyApp.outsideService = Ember.Object.create({
- value: function() {
- return OutsideService.getValue();
- }.property().volatile()
- });
-
- @memberOf Ember.ComputedProperty.prototype
- @name volatile
- @function
- @returns {Ember.ComputedProperty} receiver
-*/
-ComputedPropertyPrototype.volatile = function() {
- return this.cacheable(false);
-};
-
-/**
- Sets the dependent keys on this computed property. Pass any number of
- arguments containing key paths that this computed property depends on.
-
- MyApp.president = Ember.Object.create({
- fullName: Ember.computed(function() {
- return this.get('firstName') + ' ' + this.get('lastName');
-
- // Tell Ember.js that this computed property depends on firstName
- // and lastName
- }).property('firstName', 'lastName')
- });
-
- @memberOf Ember.ComputedProperty.prototype
- @name property
- @function
- @param {String} path... zero or more property paths
- @returns {Ember.ComputedProperty} receiver
-*/
-ComputedPropertyPrototype.property = function() {
- var args = [];
- for (var i = 0, l = arguments.length; i < l; i++) {
- args.push(arguments[i]);
- }
- this._dependentKeys = args;
- return this;
-};
-
-/**
- In some cases, you may want to annotate computed properties with additional
- metadata about how they function or what values they operate on. For example,
- computed property functions may close over variables that are then no longer
- available for introspection.
-
- You can pass a hash of these values to a computed property like this:
-
- person: function() {
- var personId = this.get('personId');
- return App.Person.create({ id: personId });
- }.property().meta({ type: App.Person })
-
- The hash that you pass to the `meta()` function will be saved on the
- computed property descriptor under the `_meta` key. Ember runtime
- exposes a public API for retrieving these values from classes,
- via the `metaForProperty()` function.
-
- @memberOf Ember.ComputedProperty.prototype
- @name meta
- @function
- @param {Hash} meta
- @returns {Ember.ComputedProperty} property descriptor instance
-*/
-
-ComputedPropertyPrototype.meta = function(meta) {
- if (arguments.length === 0) {
- return this._meta || {};
- } else {
- this._meta = meta;
- return this;
- }
-};
-
-/** @private - impl descriptor API */
-ComputedPropertyPrototype.willWatch = function(obj, keyName) {
- // watch already creates meta for this instance
- var meta = obj[META_KEY];
- Ember.assert('watch should have setup meta to be writable', meta.source === obj);
- if (!(keyName in meta.cache)) {
- addDependentKeys(this, obj, keyName, meta);
- }
-};
-
-ComputedPropertyPrototype.didUnwatch = function(obj, keyName) {
- var meta = obj[META_KEY];
- Ember.assert('unwatch should have setup meta to be writable', meta.source === obj);
- if (!(keyName in meta.cache)) {
- // unwatch already creates meta for this instance
- removeDependentKeys(this, obj, keyName, meta);
- }
-};
-
-/** @private - impl descriptor API */
-ComputedPropertyPrototype.didChange = function(obj, keyName) {
- // _suspended is set via a CP.set to ensure we don't clear
- // the cached value set by the setter
- if (this._cacheable && this._suspended !== obj) {
- var meta = metaFor(obj);
- if (keyName in meta.cache) {
- delete meta.cache[keyName];
- if (!meta.watching[keyName]) {
- removeDependentKeys(this, obj, keyName, meta);
- }
- }
- }
-};
-
-/** @private - impl descriptor API */
-ComputedPropertyPrototype.get = function(obj, keyName) {
- var ret, cache, meta;
- if (this._cacheable) {
- meta = metaFor(obj);
- cache = meta.cache;
- if (keyName in cache) { return cache[keyName]; }
- ret = cache[keyName] = this.func.call(obj, keyName);
- if (!meta.watching[keyName]) {
- addDependentKeys(this, obj, keyName, meta);
- }
- } else {
- ret = this.func.call(obj, keyName);
- }
- return ret;
-};
-
-/** @private - impl descriptor API */
-ComputedPropertyPrototype.set = function(obj, keyName, value) {
- var cacheable = this._cacheable,
- meta = metaFor(obj, cacheable),
- watched = meta.watching[keyName],
- oldSuspended = this._suspended,
- hadCachedValue,
- ret;
-
- this._suspended = obj;
-
- if (watched) { Ember.propertyWillChange(obj, keyName); }
- if (cacheable) {
- if (keyName in meta.cache) {
- delete meta.cache[keyName];
- hadCachedValue = true;
- }
- }
- ret = this.func.call(obj, keyName, value);
- if (cacheable) {
- if (!watched && !hadCachedValue) {
- addDependentKeys(this, obj, keyName, meta);
- }
- meta.cache[keyName] = ret;
- }
- if (watched) { Ember.propertyDidChange(obj, keyName); }
- this._suspended = oldSuspended;
- return ret;
-};
-
-/** @private - called when property is defined */
-ComputedPropertyPrototype.setup = function(obj, keyName) {
- var meta = obj[META_KEY];
- if (meta && meta.watching[keyName]) {
- addDependentKeys(this, obj, keyName, metaFor(obj));
- }
-};
-
-/** @private - called before property is overridden */
-ComputedPropertyPrototype.teardown = function(obj, keyName) {
- var meta = metaFor(obj);
-
- if (meta.watching[keyName] || keyName in meta.cache) {
- removeDependentKeys(this, obj, keyName, meta);
- }
-
- if (this._cacheable) { delete meta.cache[keyName]; }
-
- return null; // no value to restore
-};
-
-/**
- This helper returns a new property descriptor that wraps the passed
- computed property function. You can use this helper to define properties
- with mixins or via Ember.defineProperty().
-
- The function you pass will be used to both get and set property values.
- The function should accept two parameters, key and value. If value is not
- undefined you should set the value first. In either case return the
- current value of the property.
-
- @param {Function} func
- The computed property function.
-
- @returns {Ember.ComputedProperty} property descriptor instance
-*/
-Ember.computed = function(func) {
- var args;
-
- if (arguments.length > 1) {
- args = a_slice.call(arguments, 0, -1);
- func = a_slice.call(arguments, -1)[0];
- }
-
- var cp = new ComputedProperty(func);
-
- if (args) {
- cp.property.apply(cp, args);
- }
-
- return cp;
-};
-
-/**
- Returns the cached value for a property, if one exists.
- This can be useful for peeking at the value of a computed
- property that is generated lazily, without accidentally causing
- it to be created.
-
- @param {Object} obj the object whose property you want to check
- @param {String} key the name of the property whose cached value you want
- to return
-
-*/
-Ember.cacheFor = function cacheFor(obj, key) {
- var cache = metaFor(obj, false).cache;
-
- if (cache && key in cache) {
- return cache[key];
- }
-};
-
-Ember.computed.not = function(dependentKey) {
- return Ember.computed(dependentKey, function(key) {
- return !get(this, dependentKey);
- }).cacheable();
-};
-
-Ember.computed.empty = function(dependentKey) {
- return Ember.computed(dependentKey, function(key) {
- var val = get(this, dependentKey);
- return val === undefined || val === null || val === '' || (Ember.isArray(val) && get(val, 'length') === 0);
- }).cacheable();
-};
-
-Ember.computed.bool = function(dependentKey) {
- return Ember.computed(dependentKey, function(key) {
- return !!get(this, dependentKey);
- }).cacheable();
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var o_create = Ember.create,
- meta = Ember.meta,
- metaPath = Ember.metaPath,
- guidFor = Ember.guidFor,
- a_slice = [].slice;
-
-/**
- The event system uses a series of nested hashes to store listeners on an
- object. When a listener is registered, or when an event arrives, these
- hashes are consulted to determine which target and action pair to invoke.
-
- The hashes are stored in the object's meta hash, and look like this:
-
- // Object's meta hash
- {
- listeners: { // variable name: `listenerSet`
- "foo:changed": { // variable name: `targetSet`
- [targetGuid]: { // variable name: `actionSet`
- [methodGuid]: { // variable name: `action`
- target: [Object object],
- method: [Function function]
- }
- }
- }
- }
- }
-
-*/
-
-// Gets the set of all actions, keyed on the guid of each action's
-// method property.
-/** @private */
-function actionSetFor(obj, eventName, target, writable) {
- return metaPath(obj, ['listeners', eventName, guidFor(target)], writable);
-}
-
-// Gets the set of all targets, keyed on the guid of each action's
-// target property.
-/** @private */
-function targetSetFor(obj, eventName) {
- var listenerSet = meta(obj, false).listeners;
- if (!listenerSet) { return false; }
-
- return listenerSet[eventName] || false;
-}
-
-// TODO: This knowledge should really be a part of the
-// meta system.
-var SKIP_PROPERTIES = { __ember_source__: true };
-
-/** @private */
-function iterateSet(obj, eventName, callback, params) {
- var targetSet = targetSetFor(obj, eventName);
- if (!targetSet) { return false; }
- // Iterate through all elements of the target set
- for(var targetGuid in targetSet) {
- if (SKIP_PROPERTIES[targetGuid]) { continue; }
-
- var actionSet = targetSet[targetGuid];
- if (actionSet) {
- // Iterate through the elements of the action set
- for(var methodGuid in actionSet) {
- if (SKIP_PROPERTIES[methodGuid]) { continue; }
-
- var action = actionSet[methodGuid];
- if (action) {
- if (callback(action, params, obj) === true) {
- return true;
- }
- }
- }
- }
- }
- return false;
-}
-
-/** @private */
-function invokeAction(action, params, sender) {
- var method = action.method, target = action.target;
- // If there is no target, the target is the object
- // on which the event was fired.
- if (!target) { target = sender; }
- if ('string' === typeof method) { method = target[method]; }
- if (params) {
- method.apply(target, params);
- } else {
- method.apply(target);
- }
-}
-
-/**
- The sendEvent arguments > 2 are passed to an event listener.
-
- @memberOf Ember
-*/
-function addListener(obj, eventName, target, method) {
- Ember.assert("You must pass at least an object and event name to Ember.addListener", !!obj && !!eventName);
-
- if (!method && 'function' === typeof target) {
- method = target;
- target = null;
- }
-
- var actionSet = actionSetFor(obj, eventName, target, true),
- methodGuid = guidFor(method);
-
- if (!actionSet[methodGuid]) {
- actionSet[methodGuid] = { target: target, method: method };
- }
-
- if ('function' === typeof obj.didAddListener) {
- obj.didAddListener(eventName, target, method);
- }
-}
-
-/** @memberOf Ember */
-function removeListener(obj, eventName, target, method) {
- Ember.assert("You must pass at least an object and event name to Ember.removeListener", !!obj && !!eventName);
-
- if (!method && 'function' === typeof target) {
- method = target;
- target = null;
- }
-
- var actionSet = actionSetFor(obj, eventName, target, true),
- methodGuid = guidFor(method);
-
- // we can't simply delete this parameter, because if we do, we might
- // re-expose the property from the prototype chain.
- if (actionSet && actionSet[methodGuid]) { actionSet[methodGuid] = null; }
-
- if ('function' === typeof obj.didRemoveListener) {
- obj.didRemoveListener(eventName, target, method);
- }
-}
-
-// Suspend listener during callback.
-//
-// This should only be used by the target of the event listener
-// when it is taking an action that would cause the event, e.g.
-// an object might suspend its property change listener while it is
-// setting that property.
-/** @private */
-function suspendListener(obj, eventName, target, method, callback) {
- if (!method && 'function' === typeof target) {
- method = target;
- target = null;
- }
-
- var actionSet = actionSetFor(obj, eventName, target, true),
- methodGuid = guidFor(method),
- action = actionSet && actionSet[methodGuid];
-
- actionSet[methodGuid] = null;
- try {
- return callback.call(target);
- } finally {
- actionSet[methodGuid] = action;
- }
-}
-
-// returns a list of currently watched events
-/** @memberOf Ember */
-function watchedEvents(obj) {
- var listeners = meta(obj, false).listeners, ret = [];
-
- if (listeners) {
- for(var eventName in listeners) {
- if (!SKIP_PROPERTIES[eventName] && listeners[eventName]) {
- ret.push(eventName);
- }
- }
- }
- return ret;
-}
-
-/** @memberOf Ember */
-function sendEvent(obj, eventName, params) {
- // first give object a chance to handle it
- if (obj !== Ember && 'function' === typeof obj.sendEvent) {
- obj.sendEvent(eventName, params);
- }
-
- iterateSet(obj, eventName, invokeAction, params);
- return true;
-}
-
-/** @memberOf Ember */
-function deferEvent(obj, eventName, params) {
- var actions = [];
- iterateSet(obj, eventName, function (action) {
- actions.push(action);
- });
-
- return function() {
- if (obj.isDestroyed) { return; }
-
- if (obj !== Ember && 'function' === typeof obj.sendEvent) {
- obj.sendEvent(eventName, params);
- }
-
- for (var i=0, len=actions.length; i < len; ++i) {
- invokeAction(actions[i], params, obj);
- }
- };
-}
-
-/** @memberOf Ember */
-function hasListeners(obj, eventName) {
- if (iterateSet(obj, eventName, function() { return true; })) {
- return true;
- }
-
- // no listeners! might as well clean this up so it is faster later.
- var set = metaPath(obj, ['listeners'], true);
- set[eventName] = null;
-
- return false;
-}
-
-/** @memberOf Ember */
-function listenersFor(obj, eventName) {
- var ret = [];
- iterateSet(obj, eventName, function (action) {
- ret.push([action.target, action.method]);
- });
- return ret;
-}
-
-Ember.addListener = addListener;
-Ember.removeListener = removeListener;
-Ember._suspendListener = suspendListener;
-Ember.sendEvent = sendEvent;
-Ember.hasListeners = hasListeners;
-Ember.watchedEvents = watchedEvents;
-Ember.listenersFor = listenersFor;
-Ember.deferEvent = deferEvent;
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2010 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-// Ember.Logger
-// Ember.watch.flushPending
-// Ember.beginPropertyChanges, Ember.endPropertyChanges
-// Ember.guidFor
-
-// ..........................................................
-// HELPERS
-//
-
-var slice = [].slice,
- forEach = Ember.ArrayPolyfills.forEach;
-
-// invokes passed params - normalizing so you can pass target/func,
-// target/string or just func
-/** @private */
-function invoke(target, method, args, ignore) {
-
- if (method === undefined) {
- method = target;
- target = undefined;
- }
-
- if ('string' === typeof method) { method = target[method]; }
- if (args && ignore > 0) {
- args = args.length > ignore ? slice.call(args, ignore) : null;
- }
-
- // Unfortunately in some browsers we lose the backtrace if we rethrow the existing error,
- // so in the event that we don't have an `onerror` handler we don't wrap in a try/catch
- if ('function' === typeof Ember.onerror) {
- try {
- // IE8's Function.prototype.apply doesn't accept undefined/null arguments.
- return method.apply(target || this, args || []);
- } catch (error) {
- Ember.onerror(error);
- }
- } else {
- // IE8's Function.prototype.apply doesn't accept undefined/null arguments.
- return method.apply(target || this, args || []);
- }
-}
-
-
-// ..........................................................
-// RUNLOOP
-//
-
-var timerMark; // used by timers...
-
-/** @private */
-var RunLoop = function(prev) {
- this._prev = prev || null;
- this.onceTimers = {};
-};
-
-RunLoop.prototype = {
- end: function() {
- this.flush();
- },
-
- prev: function() {
- return this._prev;
- },
-
- // ..........................................................
- // Delayed Actions
- //
-
- schedule: function(queueName, target, method) {
- var queues = this._queues, queue;
- if (!queues) { queues = this._queues = {}; }
- queue = queues[queueName];
- if (!queue) { queue = queues[queueName] = []; }
-
- var args = arguments.length > 3 ? slice.call(arguments, 3) : null;
- queue.push({ target: target, method: method, args: args });
- return this;
- },
-
- flush: function(queueName) {
- var queueNames, idx, len, queue, log;
-
- if (!this._queues) { return this; } // nothing to do
-
- function iter(item) {
- invoke(item.target, item.method, item.args);
- }
-
- Ember.watch.flushPending(); // make sure all chained watchers are setup
-
- if (queueName) {
- while (this._queues && (queue = this._queues[queueName])) {
- this._queues[queueName] = null;
-
- // the sync phase is to allow property changes to propagate. don't
- // invoke observers until that is finished.
- if (queueName === 'sync') {
- log = Ember.LOG_BINDINGS;
- if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }
-
- Ember.beginPropertyChanges();
- try {
- forEach.call(queue, iter);
- } finally {
- Ember.endPropertyChanges();
- }
-
- if (log) { Ember.Logger.log('End: Flush Sync Queue'); }
-
- } else {
- forEach.call(queue, iter);
- }
- }
-
- } else {
- queueNames = Ember.run.queues;
- len = queueNames.length;
- idx = 0;
-
- outerloop:
- while (idx < len) {
- queueName = queueNames[idx];
- queue = this._queues && this._queues[queueName];
- delete this._queues[queueName];
-
- if (queue) {
- // the sync phase is to allow property changes to propagate. don't
- // invoke observers until that is finished.
- if (queueName === 'sync') {
- log = Ember.LOG_BINDINGS;
- if (log) { Ember.Logger.log('Begin: Flush Sync Queue'); }
-
- Ember.beginPropertyChanges();
- try {
- forEach.call(queue, iter);
- } finally {
- Ember.endPropertyChanges();
- }
-
- if (log) { Ember.Logger.log('End: Flush Sync Queue'); }
- } else {
- forEach.call(queue, iter);
- }
- }
-
- // Loop through prior queues
- for (var i = 0; i <= idx; i++) {
- if (this._queues && this._queues[queueNames[i]]) {
- // Start over at the first queue with contents
- idx = i;
- continue outerloop;
- }
- }
-
- idx++;
- }
- }
-
- timerMark = null;
-
- return this;
- }
-
-};
-
-Ember.RunLoop = RunLoop;
-
-// ..........................................................
-// Ember.run - this is ideally the only public API the dev sees
-//
-/**
-* @namespace Ember.run is both a function and a namespace for
-* RunLoop-related functions.
-* @name Ember.run
-*/
-
-/**
- Runs the passed target and method inside of a RunLoop, ensuring any
- deferred actions including bindings and views updates are flushed at the
- end.
-
- Normally you should not need to invoke this method yourself. However if
- you are implementing raw event handlers when interfacing with other
- libraries or plugins, you should probably wrap all of your code inside this
- call.
-
- Ember.run(function(){
- // code to be execute within a RunLoop
- });
-
- @name run
- @methodOf Ember.run
- @param {Object} target
- (Optional) target of method to call
-
- @param {Function|String} method
- Method to invoke. May be a function or a string. If you pass a string
- then it will be looked up on the passed target.
-
- @param {Object...} args
- Any additional arguments you wish to pass to the method.
-
- @returns {Object} return value from invoking the passed function.
-*/
-Ember.run = function(target, method) {
- var ret, loop;
- run.begin();
- try {
- if (target || method) { ret = invoke(target, method, arguments, 2); }
- } finally {
- run.end();
- }
- return ret;
-};
-
-/** @private */
-var run = Ember.run;
-
-
-/**
- Begins a new RunLoop. Any deferred actions invoked after the begin will
- be buffered until you invoke a matching call to Ember.run.end(). This is
- an lower-level way to use a RunLoop instead of using Ember.run().
-
- Ember.run.begin();
- // code to be execute within a RunLoop
- Ember.run.end();
-
-
- @returns {void}
-*/
-Ember.run.begin = function() {
- run.currentRunLoop = new RunLoop(run.currentRunLoop);
-};
-
-/**
- Ends a RunLoop. This must be called sometime after you call Ember.run.begin()
- to flush any deferred actions. This is a lower-level way to use a RunLoop
- instead of using Ember.run().
-
- Ember.run.begin();
- // code to be execute within a RunLoop
- Ember.run.end();
-
- @returns {void}
-*/
-Ember.run.end = function() {
- Ember.assert('must have a current run loop', run.currentRunLoop);
- try {
- run.currentRunLoop.end();
- }
- finally {
- run.currentRunLoop = run.currentRunLoop.prev();
- }
-};
-
-/**
- Array of named queues. This array determines the order in which queues
- are flushed at the end of the RunLoop. You can define your own queues by
- simply adding the queue name to this array. Normally you should not need
- to inspect or modify this property.
-
- @type Array
- @default ['sync', 'actions', 'destroy', 'timers']
-*/
-Ember.run.queues = ['sync', 'actions', 'destroy', 'timers'];
-
-/**
- Adds the passed target/method and any optional arguments to the named
- queue to be executed at the end of the RunLoop. If you have not already
- started a RunLoop when calling this method one will be started for you
- automatically.
-
- At the end of a RunLoop, any methods scheduled in this way will be invoked.
- Methods will be invoked in an order matching the named queues defined in
- the run.queues property.
-
- Ember.run.schedule('timers', this, function(){
- // this will be executed at the end of the RunLoop, when timers are run
- console.log("scheduled on timers queue");
- });
- Ember.run.schedule('sync', this, function(){
- // this will be executed at the end of the RunLoop, when bindings are synced
- console.log("scheduled on sync queue");
- });
- // Note the functions will be run in order based on the run queues order. Output would be:
- // scheduled on sync queue
- // scheduled on timers queue
-
- @param {String} queue
- The name of the queue to schedule against. Default queues are 'sync' and
- 'actions'
-
- @param {Object} target
- (Optional) target object to use as the context when invoking a method.
-
- @param {String|Function} method
- The method to invoke. If you pass a string it will be resolved on the
- target object at the time the scheduled item is invoked allowing you to
- change the target function.
-
- @param {Object} arguments...
- Optional arguments to be passed to the queued method.
-
- @returns {void}
-*/
-Ember.run.schedule = function(queue, target, method) {
- var loop = run.autorun();
- loop.schedule.apply(loop, arguments);
-};
-
-var scheduledAutorun;
-/** @private */
-function autorun() {
- scheduledAutorun = null;
- if (run.currentRunLoop) { run.end(); }
-}
-
-// Used by global test teardown
-/** @private */
-Ember.run.hasScheduledTimers = function() {
- return !!(scheduledAutorun || scheduledLater || scheduledNext);
-};
-
-// Used by global test teardown
-/** @private */
-Ember.run.cancelTimers = function () {
- if (scheduledAutorun) {
- clearTimeout(scheduledAutorun);
- scheduledAutorun = null;
- }
- if (scheduledLater) {
- clearTimeout(scheduledLater);
- scheduledLater = null;
- }
- if (scheduledNext) {
- clearTimeout(scheduledNext);
- scheduledNext = null;
- }
- timers = {};
-};
-
-/**
- Begins a new RunLoop if necessary and schedules a timer to flush the
- RunLoop at a later time. This method is used by parts of Ember to
- ensure the RunLoop always finishes. You normally do not need to call this
- method directly. Instead use Ember.run().
-
- Ember.run.autorun();
-
- @returns {Ember.RunLoop} the new current RunLoop
-*/
-Ember.run.autorun = function() {
- if (!run.currentRunLoop) {
- Ember.assert("You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in an Ember.run", !Ember.testing);
-
- run.begin();
-
- if (!scheduledAutorun) {
- scheduledAutorun = setTimeout(autorun, 1);
- }
- }
-
- return run.currentRunLoop;
-};
-
-/**
- Immediately flushes any events scheduled in the 'sync' queue. Bindings
- use this queue so this method is a useful way to immediately force all
- bindings in the application to sync.
-
- You should call this method anytime you need any changed state to propagate
- throughout the app immediately without repainting the UI.
-
- Ember.run.sync();
-
- @returns {void}
-*/
-Ember.run.sync = function() {
- run.autorun();
- run.currentRunLoop.flush('sync');
-};
-
-// ..........................................................
-// TIMERS
-//
-
-var timers = {}; // active timers...
-
-var scheduledLater;
-/** @private */
-function invokeLaterTimers() {
- scheduledLater = null;
- var now = (+ new Date()), earliest = -1;
- for (var key in timers) {
- if (!timers.hasOwnProperty(key)) { continue; }
- var timer = timers[key];
- if (timer && timer.expires) {
- if (now >= timer.expires) {
- delete timers[key];
- invoke(timer.target, timer.method, timer.args, 2);
- } else {
- if (earliest<0 || (timer.expires < earliest)) earliest=timer.expires;
- }
- }
- }
-
- // schedule next timeout to fire...
- if (earliest > 0) { scheduledLater = setTimeout(invokeLaterTimers, earliest-(+ new Date())); }
-}
-
-/**
- Invokes the passed target/method and optional arguments after a specified
- period if time. The last parameter of this method must always be a number
- of milliseconds.
-
- You should use this method whenever you need to run some action after a
- period of time instead of using setTimeout(). This method will ensure that
- items that expire during the same script execution cycle all execute
- together, which is often more efficient than using a real setTimeout.
-
- Ember.run.later(myContext, function(){
- // code here will execute within a RunLoop in about 500ms with this == myContext
- }, 500);
-
- @param {Object} target
- (optional) target of method to invoke
-
- @param {Function|String} method
- The method to invoke. If you pass a string it will be resolved on the
- target at the time the method is invoked.
-
- @param {Object...} args
- Optional arguments to pass to the timeout.
-
- @param {Number} wait
- Number of milliseconds to wait.
-
- @returns {String} a string you can use to cancel the timer in Ember.run.cancel() later.
-*/
-Ember.run.later = function(target, method) {
- var args, expires, timer, guid, wait;
-
- // setTimeout compatibility...
- if (arguments.length===2 && 'function' === typeof target) {
- wait = method;
- method = target;
- target = undefined;
- args = [target, method];
- } else {
- args = slice.call(arguments);
- wait = args.pop();
- }
-
- expires = (+ new Date()) + wait;
- timer = { target: target, method: method, expires: expires, args: args };
- guid = Ember.guidFor(timer);
- timers[guid] = timer;
- run.once(timers, invokeLaterTimers);
- return guid;
-};
-
-/** @private */
-function invokeOnceTimer(guid, onceTimers) {
- if (onceTimers[this.tguid]) { delete onceTimers[this.tguid][this.mguid]; }
- if (timers[guid]) { invoke(this.target, this.method, this.args, 2); }
- delete timers[guid];
-}
-
-/**
- Schedules an item to run one time during the current RunLoop. Calling
- this method with the same target/method combination will have no effect.
-
- Note that although you can pass optional arguments these will not be
- considered when looking for duplicates. New arguments will replace previous
- calls.
-
- Ember.run(function(){
- var doFoo = function() { foo(); }
- Ember.run.once(myContext, doFoo);
- Ember.run.once(myContext, doFoo);
- // doFoo will only be executed once at the end of the RunLoop
- });
-
- @param {Object} target
- (optional) target of method to invoke
-
- @param {Function|String} method
- The method to invoke. If you pass a string it will be resolved on the
- target at the time the method is invoked.
-
- @param {Object...} args
- Optional arguments to pass to the timeout.
-
-
- @returns {Object} timer
-*/
-Ember.run.once = function(target, method) {
- var tguid = Ember.guidFor(target),
- mguid = Ember.guidFor(method),
- onceTimers = run.autorun().onceTimers,
- guid = onceTimers[tguid] && onceTimers[tguid][mguid],
- timer;
-
- if (guid && timers[guid]) {
- timers[guid].args = slice.call(arguments); // replace args
- } else {
- timer = {
- target: target,
- method: method,
- args: slice.call(arguments),
- tguid: tguid,
- mguid: mguid
- };
-
- guid = Ember.guidFor(timer);
- timers[guid] = timer;
- if (!onceTimers[tguid]) { onceTimers[tguid] = {}; }
- onceTimers[tguid][mguid] = guid; // so it isn't scheduled more than once
-
- run.schedule('actions', timer, invokeOnceTimer, guid, onceTimers);
- }
-
- return guid;
-};
-
-var scheduledNext;
-/** @private */
-function invokeNextTimers() {
- scheduledNext = null;
- for(var key in timers) {
- if (!timers.hasOwnProperty(key)) { continue; }
- var timer = timers[key];
- if (timer.next) {
- delete timers[key];
- invoke(timer.target, timer.method, timer.args, 2);
- }
- }
-}
-
-/**
- Schedules an item to run after control has been returned to the system.
- This is often equivalent to calling setTimeout(function...,1).
-
- Ember.run.next(myContext, function(){
- // code to be executed in the next RunLoop, which will be scheduled after the current one
- });
-
- @param {Object} target
- (optional) target of method to invoke
-
- @param {Function|String} method
- The method to invoke. If you pass a string it will be resolved on the
- target at the time the method is invoked.
-
- @param {Object...} args
- Optional arguments to pass to the timeout.
-
- @returns {Object} timer
-*/
-Ember.run.next = function(target, method) {
- var guid,
- timer = {
- target: target,
- method: method,
- args: slice.call(arguments),
- next: true
- };
-
- guid = Ember.guidFor(timer);
- timers[guid] = timer;
-
- if (!scheduledNext) { scheduledNext = setTimeout(invokeNextTimers, 1); }
- return guid;
-};
-
-/**
- Cancels a scheduled item. Must be a value returned by `Ember.run.later()`,
- `Ember.run.once()`, or `Ember.run.next()`.
-
- var runNext = Ember.run.next(myContext, function(){
- // will not be executed
- });
- Ember.run.cancel(runNext);
-
- var runLater = Ember.run.later(myContext, function(){
- // will not be executed
- }, 500);
- Ember.run.cancel(runLater);
-
- var runOnce = Ember.run.once(myContext, function(){
- // will not be executed
- });
- Ember.run.cancel(runOnce);
-
- @param {Object} timer
- Timer object to cancel
-
- @returns {void}
-*/
-Ember.run.cancel = function(timer) {
- delete timers[timer];
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-// Ember.Logger
-// get, set, trySet
-// guidFor, isArray, meta
-// addObserver, removeObserver
-// Ember.run.schedule
-// ..........................................................
-// CONSTANTS
-//
-
-/**
- @static
-
- Debug parameter you can turn on. This will log all bindings that fire to
- the console. This should be disabled in production code. Note that you
- can also enable this from the console or temporarily.
-
- @type Boolean
- @default false
-*/
-Ember.LOG_BINDINGS = false || !!Ember.ENV.LOG_BINDINGS;
-
-var get = Ember.get,
- set = Ember.set,
- guidFor = Ember.guidFor,
- isGlobalPath = Ember.isGlobalPath;
-
-
-/** @private */
-function getWithGlobals(obj, path) {
- return get(isGlobalPath(path) ? window : obj, path);
-}
-
-// ..........................................................
-// BINDING
-//
-
-/** @private */
-var Binding = function(toPath, fromPath) {
- this._direction = 'fwd';
- this._from = fromPath;
- this._to = toPath;
- this._directionMap = Ember.Map.create();
-};
-
-Binding.prototype = /** @scope Ember.Binding.prototype */ {
- /**
- This copies the Binding so it can be connected to another object.
- @returns {Ember.Binding}
- */
- copy: function () {
- var copy = new Binding(this._to, this._from);
- if (this._oneWay) { copy._oneWay = true; }
- return copy;
- },
-
- // ..........................................................
- // CONFIG
- //
-
- /**
- This will set "from" property path to the specified value. It will not
- attempt to resolve this property path to an actual object until you
- connect the binding.
-
- The binding will search for the property path starting at the root object
- you pass when you connect() the binding. It follows the same rules as
- `get()` - see that method for more information.
-
- @param {String} propertyPath the property path to connect to
- @returns {Ember.Binding} receiver
- */
- from: function(path) {
- this._from = path;
- return this;
- },
-
- /**
- This will set the "to" property path to the specified value. It will not
- attempt to resolve this property path to an actual object until you
- connect the binding.
-
- The binding will search for the property path starting at the root object
- you pass when you connect() the binding. It follows the same rules as
- `get()` - see that method for more information.
-
- @param {String|Tuple} propertyPath A property path or tuple
- @returns {Ember.Binding} this
- */
- to: function(path) {
- this._to = path;
- return this;
- },
-
- /**
- Configures the binding as one way. A one-way binding will relay changes
- on the "from" side to the "to" side, but not the other way around. This
- means that if you change the "to" side directly, the "from" side may have
- a different value.
-
- @returns {Ember.Binding} receiver
- */
- oneWay: function() {
- this._oneWay = true;
- return this;
- },
-
- /** @private */
- toString: function() {
- var oneWay = this._oneWay ? '[oneWay]' : '';
- return "Ember.Binding<" + guidFor(this) + ">(" + this._from + " -> " + this._to + ")" + oneWay;
- },
-
- // ..........................................................
- // CONNECT AND SYNC
- //
-
- /**
- Attempts to connect this binding instance so that it can receive and relay
- changes. This method will raise an exception if you have not set the
- from/to properties yet.
-
- @param {Object} obj The root object for this binding.
- @returns {Ember.Binding} this
- */
- connect: function(obj) {
- Ember.assert('Must pass a valid object to Ember.Binding.connect()', !!obj);
-
- var fromPath = this._from, toPath = this._to;
- Ember.trySet(obj, toPath, getWithGlobals(obj, fromPath));
-
- // add an observer on the object to be notified when the binding should be updated
- Ember.addObserver(obj, fromPath, this, this.fromDidChange);
-
- // if the binding is a two-way binding, also set up an observer on the target
- if (!this._oneWay) { Ember.addObserver(obj, toPath, this, this.toDidChange); }
-
- this._readyToSync = true;
-
- return this;
- },
-
- /**
- Disconnects the binding instance. Changes will no longer be relayed. You
- will not usually need to call this method.
-
- @param {Object} obj
- The root object you passed when connecting the binding.
-
- @returns {Ember.Binding} this
- */
- disconnect: function(obj) {
- Ember.assert('Must pass a valid object to Ember.Binding.disconnect()', !!obj);
-
- var twoWay = !this._oneWay;
-
- // remove an observer on the object so we're no longer notified of
- // changes that should update bindings.
- Ember.removeObserver(obj, this._from, this, this.fromDidChange);
-
- // if the binding is two-way, remove the observer from the target as well
- if (twoWay) { Ember.removeObserver(obj, this._to, this, this.toDidChange); }
-
- this._readyToSync = false; // disable scheduled syncs...
- return this;
- },
-
- // ..........................................................
- // PRIVATE
- //
-
- /** @private - called when the from side changes */
- fromDidChange: function(target) {
- this._scheduleSync(target, 'fwd');
- },
-
- /** @private - called when the to side changes */
- toDidChange: function(target) {
- this._scheduleSync(target, 'back');
- },
-
- /** @private */
- _scheduleSync: function(obj, dir) {
- var directionMap = this._directionMap;
- var existingDir = directionMap.get(obj);
-
- // if we haven't scheduled the binding yet, schedule it
- if (!existingDir) {
- Ember.run.schedule('sync', this, this._sync, obj);
- directionMap.set(obj, dir);
- }
-
- // If both a 'back' and 'fwd' sync have been scheduled on the same object,
- // default to a 'fwd' sync so that it remains deterministic.
- if (existingDir === 'back' && dir === 'fwd') {
- directionMap.set(obj, 'fwd');
- }
- },
-
- /** @private */
- _sync: function(obj) {
- var log = Ember.LOG_BINDINGS;
-
- // don't synchronize destroyed objects or disconnected bindings
- if (obj.isDestroyed || !this._readyToSync) { return; }
-
- // get the direction of the binding for the object we are
- // synchronizing from
- var directionMap = this._directionMap;
- var direction = directionMap.get(obj);
-
- var fromPath = this._from, toPath = this._to;
-
- directionMap.remove(obj);
-
- // if we're synchronizing from the remote object...
- if (direction === 'fwd') {
- var fromValue = getWithGlobals(obj, this._from);
- if (log) {
- Ember.Logger.log(' ', this.toString(), '->', fromValue, obj);
- }
- if (this._oneWay) {
- Ember.trySet(obj, toPath, fromValue);
- } else {
- Ember._suspendObserver(obj, toPath, this, this.toDidChange, function () {
- Ember.trySet(obj, toPath, fromValue);
- });
- }
- // if we're synchronizing *to* the remote object
- } else if (direction === 'back') {
- var toValue = get(obj, this._to);
- if (log) {
- Ember.Logger.log(' ', this.toString(), '<-', toValue, obj);
- }
- Ember._suspendObserver(obj, fromPath, this, this.fromDidChange, function () {
- Ember.trySet(Ember.isGlobalPath(fromPath) ? window : obj, fromPath, toValue);
- });
- }
- }
-
-};
-
-/** @private */
-function mixinProperties(to, from) {
- for (var key in from) {
- if (from.hasOwnProperty(key)) {
- to[key] = from[key];
- }
- }
-}
-
-mixinProperties(Binding,
-/** @scope Ember.Binding */ {
-
- /**
- @see Ember.Binding.prototype.from
- */
- from: function() {
- var C = this, binding = new C();
- return binding.from.apply(binding, arguments);
- },
-
- /**
- @see Ember.Binding.prototype.to
- */
- to: function() {
- var C = this, binding = new C();
- return binding.to.apply(binding, arguments);
- },
-
- /**
- Creates a new Binding instance and makes it apply in a single direction.
- A one-way binding will relay changes on the "from" side object (supplies
- as the `from` argument) the "to" side, but not the other way around.
- This means that if you change the "to" side directly, the "from" side may have
- a different value.
-
- @param {String} from from path.
- @param {Boolean} [flag] (Optional) passing nothing here will make the binding oneWay. You can
- instead pass false to disable oneWay, making the binding two way again.
-
- @see Ember.Binding.prototype.oneWay
- */
- oneWay: function(from, flag) {
- var C = this, binding = new C(null, from);
- return binding.oneWay(flag);
- }
-
-});
-
-/**
- @class
-
- An Ember.Binding connects the properties of two objects so that whenever the
- value of one property changes, the other property will be changed also.
-
- ## Automatic Creation of Bindings with `/^*Binding/`-named Properties
- You do not usually create Binding objects directly but instead describe
- bindings in your class or object definition using automatic binding detection.
-
- Properties ending in a `Binding` suffix will be converted to Ember.Binding instances.
- The value of this property should be a string representing a path to another object or
- a custom binding instanced created using Binding helpers (see "Customizing Your Bindings"):
-
- valueBinding: "MyApp.someController.title"
-
- This will create a binding from `MyApp.someController.title` to the `value`
- property of your object instance automatically. Now the two values will be
- kept in sync.
-
- ## One Way Bindings
-
- One especially useful binding customization you can use is the `oneWay()`
- helper. This helper tells Ember that you are only interested in
- receiving changes on the object you are binding from. For example, if you
- are binding to a preference and you want to be notified if the preference
- has changed, but your object will not be changing the preference itself, you
- could do:
-
- bigTitlesBinding: Ember.Binding.oneWay("MyApp.preferencesController.bigTitles")
-
- This way if the value of MyApp.preferencesController.bigTitles changes the
- "bigTitles" property of your object will change also. However, if you
- change the value of your "bigTitles" property, it will not update the
- preferencesController.
-
- One way bindings are almost twice as fast to setup and twice as fast to
- execute because the binding only has to worry about changes to one side.
-
- You should consider using one way bindings anytime you have an object that
- may be created frequently and you do not intend to change a property; only
- to monitor it for changes. (such as in the example above).
-
- ## Adding Bindings Manually
-
- All of the examples above show you how to configure a custom binding, but
- the result of these customizations will be a binding template, not a fully
- active Binding instance. The binding will actually become active only when you
- instantiate the object the binding belongs to. It is useful however, to
- understand what actually happens when the binding is activated.
-
- For a binding to function it must have at least a "from" property and a "to"
- property. The from property path points to the object/key that you want to
- bind from while the to path points to the object/key you want to bind to.
-
- When you define a custom binding, you are usually describing the property
- you want to bind from (such as "MyApp.someController.value" in the examples
- above). When your object is created, it will automatically assign the value
- you want to bind "to" based on the name of your binding key. In the
- examples above, during init, Ember objects will effectively call
- something like this on your binding:
-
- binding = Ember.Binding.from(this.valueBinding).to("value");
-
- This creates a new binding instance based on the template you provide, and
- sets the to path to the "value" property of the new object. Now that the
- binding is fully configured with a "from" and a "to", it simply needs to be
- connected to become active. This is done through the connect() method:
-
- binding.connect(this);
-
- Note that when you connect a binding you pass the object you want it to be
- connected to. This object will be used as the root for both the from and
- to side of the binding when inspecting relative paths. This allows the
- binding to be automatically inherited by subclassed objects as well.
-
- Now that the binding is connected, it will observe both the from and to side
- and relay changes.
-
- If you ever needed to do so (you almost never will, but it is useful to
- understand this anyway), you could manually create an active binding by
- using the Ember.bind() helper method. (This is the same method used by
- to setup your bindings on objects):
-
- Ember.bind(MyApp.anotherObject, "value", "MyApp.someController.value");
-
- Both of these code fragments have the same effect as doing the most friendly
- form of binding creation like so:
-
- MyApp.anotherObject = Ember.Object.create({
- valueBinding: "MyApp.someController.value",
-
- // OTHER CODE FOR THIS OBJECT...
-
- });
-
- Ember's built in binding creation method makes it easy to automatically
- create bindings for you. You should always use the highest-level APIs
- available, even if you understand how it works underneath.
-
- @since Ember 0.9
-*/
-Ember.Binding = Binding;
-
-/**
- Global helper method to create a new binding. Just pass the root object
- along with a to and from path to create and connect the binding.
-
- @param {Object} obj
- The root object of the transform.
-
- @param {String} to
- The path to the 'to' side of the binding. Must be relative to obj.
-
- @param {String} from
- The path to the 'from' side of the binding. Must be relative to obj or
- a global path.
-
- @returns {Ember.Binding} binding instance
-*/
-Ember.bind = function(obj, to, from) {
- return new Ember.Binding(to, from).connect(obj);
-};
-
-Ember.oneWay = function(obj, to, from) {
- return new Ember.Binding(to, from).oneWay().connect(obj);
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var Mixin, REQUIRED, Alias,
- classToString, superClassString,
- a_map = Ember.ArrayPolyfills.map,
- a_indexOf = Ember.ArrayPolyfills.indexOf,
- a_forEach = Ember.ArrayPolyfills.forEach,
- a_slice = [].slice,
- EMPTY_META = {}, // dummy for non-writable meta
- META_SKIP = { __emberproto__: true, __ember_count__: true },
- o_create = Ember.create,
- defineProperty = Ember.defineProperty,
- guidFor = Ember.guidFor;
-
-/** @private */
-function mixinsMeta(obj) {
- var m = Ember.meta(obj, true), ret = m.mixins;
- if (!ret) {
- ret = m.mixins = { __emberproto__: obj };
- } else if (ret.__emberproto__ !== obj) {
- ret = m.mixins = o_create(ret);
- ret.__emberproto__ = obj;
- }
- return ret;
-}
-
-/** @private */
-function initMixin(mixin, args) {
- if (args && args.length > 0) {
- mixin.mixins = a_map.call(args, function(x) {
- if (x instanceof Mixin) { return x; }
-
- // Note: Manually setup a primitive mixin here. This is the only
- // way to actually get a primitive mixin. This way normal creation
- // of mixins will give you combined mixins...
- var mixin = new Mixin();
- mixin.properties = x;
- return mixin;
- });
- }
- return mixin;
-}
-
-/** @private */
-function isMethod(obj) {
- return 'function' === typeof obj &&
- obj.isMethod !== false &&
- obj !== Boolean && obj !== Object && obj !== Number && obj !== Array && obj !== Date && obj !== String;
-}
-
-/** @private */
-function mergeMixins(mixins, m, descs, values, base) {
- var len = mixins.length, idx, mixin, guid, props, value, key, ovalue, concats;
-
- /** @private */
- function removeKeys(keyName) {
- delete descs[keyName];
- delete values[keyName];
- }
-
- for(idx=0; idx < len; idx++) {
- mixin = mixins[idx];
- Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');
-
- if (mixin instanceof Mixin) {
- guid = guidFor(mixin);
- if (m[guid]) { continue; }
- m[guid] = mixin;
- props = mixin.properties;
- } else {
- props = mixin; // apply anonymous mixin properties
- }
-
- if (props) {
- // reset before adding each new mixin to pickup concats from previous
- concats = values.concatenatedProperties || base.concatenatedProperties;
- if (props.concatenatedProperties) {
- concats = concats ? concats.concat(props.concatenatedProperties) : props.concatenatedProperties;
- }
-
- for (key in props) {
- if (!props.hasOwnProperty(key)) { continue; }
- value = props[key];
- if (value instanceof Ember.Descriptor) {
- if (value === REQUIRED && descs[key]) { continue; }
-
- descs[key] = value;
- values[key] = undefined;
- } else {
- // impl super if needed...
- if (isMethod(value)) {
- ovalue = descs[key] === undefined && values[key];
- if (!ovalue) { ovalue = base[key]; }
- if ('function' !== typeof ovalue) { ovalue = null; }
- if (ovalue) {
- var o = value.__ember_observes__, ob = value.__ember_observesBefore__;
- value = Ember.wrap(value, ovalue);
- value.__ember_observes__ = o;
- value.__ember_observesBefore__ = ob;
- }
- } else if ((concats && a_indexOf.call(concats, key) >= 0) || key === 'concatenatedProperties') {
- var baseValue = values[key] || base[key];
- value = baseValue ? baseValue.concat(value) : Ember.makeArray(value);
- }
-
- descs[key] = undefined;
- values[key] = value;
- }
- }
-
- // manually copy toString() because some JS engines do not enumerate it
- if (props.hasOwnProperty('toString')) {
- base.toString = props.toString;
- }
-
- } else if (mixin.mixins) {
- mergeMixins(mixin.mixins, m, descs, values, base);
- if (mixin._without) { a_forEach.call(mixin._without, removeKeys); }
- }
- }
-}
-
-/** @private */
-function writableReq(obj) {
- var m = Ember.meta(obj), req = m.required;
- if (!req || req.__emberproto__ !== obj) {
- req = m.required = req ? o_create(req) : { __ember_count__: 0 };
- req.__emberproto__ = obj;
- }
- return req;
-}
-
-var IS_BINDING = Ember.IS_BINDING = /^.+Binding$/;
-
-/** @private */
-function detectBinding(obj, key, value, m) {
- if (IS_BINDING.test(key)) {
- var bindings = m.bindings;
- if (!bindings) {
- bindings = m.bindings = { __emberproto__: obj };
- } else if (bindings.__emberproto__ !== obj) {
- bindings = m.bindings = o_create(m.bindings);
- bindings.__emberproto__ = obj;
- }
- bindings[key] = value;
- }
-}
-
-/** @private */
-function connectBindings(obj, m) {
- // TODO Mixin.apply(instance) should disconnect binding if exists
- var bindings = m.bindings, key, binding, to;
- if (bindings) {
- for (key in bindings) {
- binding = key !== '__emberproto__' && bindings[key];
- if (binding) {
- to = key.slice(0, -7); // strip Binding off end
- if (binding instanceof Ember.Binding) {
- binding = binding.copy(); // copy prototypes' instance
- binding.to(to);
- } else { // binding is string path
- binding = new Ember.Binding(to, binding);
- }
- binding.connect(obj);
- obj[key] = binding;
- }
- }
- // mark as applied
- m.bindings = { __emberproto__: obj };
- }
-}
-
-function finishPartial(obj, m) {
- connectBindings(obj, m || Ember.meta(obj));
- return obj;
-}
-
-/** @private */
-function applyMixin(obj, mixins, partial) {
- var descs = {}, values = {}, m = Ember.meta(obj), req = m.required,
- key, value, desc, prevValue, paths, len, idx;
-
- // Go through all mixins and hashes passed in, and:
- //
- // * Handle concatenated properties
- // * Set up _super wrapping if necessary
- // * Set up computed property descriptors
- // * Copying `toString` in broken browsers
- mergeMixins(mixins, mixinsMeta(obj), descs, values, obj);
-
- for(key in values) {
- if (key === 'contructor') { continue; }
- if (!values.hasOwnProperty(key)) { continue; }
-
- desc = descs[key];
- value = values[key];
-
- if (desc === REQUIRED) {
- if (!(key in obj)) {
- Ember.assert('Required property not defined: '+key, !!partial);
-
- // for partial applies add to hash of required keys
- req = writableReq(obj);
- req.__ember_count__++;
- req[key] = true;
- }
- } else {
- while (desc && desc instanceof Alias) {
- var altKey = desc.methodName;
- if (descs[altKey] || values[altKey]) {
- value = values[altKey];
- desc = descs[altKey];
- } else if (m.descs[altKey]) {
- desc = m.descs[altKey];
- value = undefined;
- } else {
- desc = undefined;
- value = obj[altKey];
- }
- }
-
- if (desc === undefined && value === undefined) { continue; }
-
- prevValue = obj[key];
-
- if ('function' === typeof prevValue) {
- if ((paths = prevValue.__ember_observesBefore__)) {
- len = paths.length;
- for (idx=0; idx < len; idx++) {
- Ember.removeBeforeObserver(obj, paths[idx], null, key);
- }
- } else if ((paths = prevValue.__ember_observes__)) {
- len = paths.length;
- for (idx=0; idx < len; idx++) {
- Ember.removeObserver(obj, paths[idx], null, key);
- }
- }
- }
-
- detectBinding(obj, key, value, m);
-
- defineProperty(obj, key, desc, value, m);
-
- if ('function' === typeof value) {
- if (paths = value.__ember_observesBefore__) {
- len = paths.length;
- for (idx=0; idx < len; idx++) {
- Ember.addBeforeObserver(obj, paths[idx], null, key);
- }
- } else if (paths = value.__ember_observes__) {
- len = paths.length;
- for (idx=0; idx < len; idx++) {
- Ember.addObserver(obj, paths[idx], null, key);
- }
- }
- }
-
- if (req && req[key]) {
- req = writableReq(obj);
- req.__ember_count__--;
- req[key] = false;
- }
- }
- }
-
- if (!partial) { // don't apply to prototype
- finishPartial(obj, m);
- }
-
- // Make sure no required attrs remain
- if (!partial && req && req.__ember_count__>0) {
- var keys = [];
- for (key in req) {
- if (META_SKIP[key]) { continue; }
- keys.push(key);
- }
- // TODO: Remove surrounding if clause from production build
- Ember.assert('Required properties not defined: '+keys.join(','));
- }
- return obj;
-}
-
-Ember.mixin = function(obj) {
- var args = a_slice.call(arguments, 1);
- applyMixin(obj, args, false);
- return obj;
-};
-
-/**
- @class
-
- The `Ember.Mixin` class allows you to create mixins, whose properties can be
- added to other classes. For instance,
-
- App.Editable = Ember.Mixin.create({
- edit: function() {
- console.log('starting to edit');
- this.set('isEditing', true);
- },
- isEditing: false
- });
-
- // Mix mixins into classes by passing them as the first arguments to
- // .extend or .create.
- App.CommentView = Ember.View.extend(App.Editable, {
- template: Ember.Handlebars.compile('{{#if isEditing}}...{{else}}...{{/if}}')
- });
-
- commentView = App.CommentView.create();
- commentView.edit(); // => outputs 'starting to edit'
-
- Note that Mixins are created with `Ember.Mixin.create`, not
- `Ember.Mixin.extend`.
-*/
-Ember.Mixin = function() { return initMixin(this, arguments); };
-
-/** @private */
-Mixin = Ember.Mixin;
-
-/** @private */
-Mixin._apply = applyMixin;
-
-Mixin.applyPartial = function(obj) {
- var args = a_slice.call(arguments, 1);
- return applyMixin(obj, args, true);
-};
-
-Mixin.finishPartial = finishPartial;
-
-Mixin.create = function() {
- classToString.processed = false;
- var M = this;
- return initMixin(new M(), arguments);
-};
-
-var MixinPrototype = Mixin.prototype;
-
-MixinPrototype.reopen = function() {
- var mixin, tmp;
-
- if (this.properties) {
- mixin = Mixin.create();
- mixin.properties = this.properties;
- delete this.properties;
- this.mixins = [mixin];
- } else if (!this.mixins) {
- this.mixins = [];
- }
-
- var len = arguments.length, mixins = this.mixins, idx;
-
- for(idx=0; idx < len; idx++) {
- mixin = arguments[idx];
- Ember.assert('Expected hash or Mixin instance, got ' + Object.prototype.toString.call(mixin), typeof mixin === 'object' && mixin !== null && Object.prototype.toString.call(mixin) !== '[object Array]');
-
- if (mixin instanceof Mixin) {
- mixins.push(mixin);
- } else {
- tmp = Mixin.create();
- tmp.properties = mixin;
- mixins.push(tmp);
- }
- }
-
- return this;
-};
-
-MixinPrototype.apply = function(obj) {
- return applyMixin(obj, [this], false);
-};
-
-MixinPrototype.applyPartial = function(obj) {
- return applyMixin(obj, [this], true);
-};
-
-/** @private */
-function _detect(curMixin, targetMixin, seen) {
- var guid = guidFor(curMixin);
-
- if (seen[guid]) { return false; }
- seen[guid] = true;
-
- if (curMixin === targetMixin) { return true; }
- var mixins = curMixin.mixins, loc = mixins ? mixins.length : 0;
- while (--loc >= 0) {
- if (_detect(mixins[loc], targetMixin, seen)) { return true; }
- }
- return false;
-}
-
-MixinPrototype.detect = function(obj) {
- if (!obj) { return false; }
- if (obj instanceof Mixin) { return _detect(obj, this, {}); }
- var mixins = Ember.meta(obj, false).mixins;
- if (mixins) {
- return !!mixins[guidFor(this)];
- }
- return false;
-};
-
-MixinPrototype.without = function() {
- var ret = new Mixin(this);
- ret._without = a_slice.call(arguments);
- return ret;
-};
-
-/** @private */
-function _keys(ret, mixin, seen) {
- if (seen[guidFor(mixin)]) { return; }
- seen[guidFor(mixin)] = true;
-
- if (mixin.properties) {
- var props = mixin.properties;
- for (var key in props) {
- if (props.hasOwnProperty(key)) { ret[key] = true; }
- }
- } else if (mixin.mixins) {
- a_forEach.call(mixin.mixins, function(x) { _keys(ret, x, seen); });
- }
-}
-
-MixinPrototype.keys = function() {
- var keys = {}, seen = {}, ret = [];
- _keys(keys, this, seen);
- for(var key in keys) {
- if (keys.hasOwnProperty(key)) { ret.push(key); }
- }
- return ret;
-};
-
-/** @private - make Mixin's have nice displayNames */
-
-var NAME_KEY = Ember.GUID_KEY+'_name';
-var get = Ember.get;
-
-/** @private */
-function processNames(paths, root, seen) {
- var idx = paths.length;
- for(var key in root) {
- if (!root.hasOwnProperty || !root.hasOwnProperty(key)) { continue; }
- var obj = root[key];
- paths[idx] = key;
-
- if (obj && obj.toString === classToString) {
- obj[NAME_KEY] = paths.join('.');
- } else if (obj && get(obj, 'isNamespace')) {
- if (seen[guidFor(obj)]) { continue; }
- seen[guidFor(obj)] = true;
- processNames(paths, obj, seen);
- }
- }
- paths.length = idx; // cut out last item
-}
-
-/** @private */
-function findNamespaces() {
- var Namespace = Ember.Namespace, obj, isNamespace;
-
- if (Namespace.PROCESSED) { return; }
-
- for (var prop in window) {
- // get(window.globalStorage, 'isNamespace') would try to read the storage for domain isNamespace and cause exception in Firefox.
- // globalStorage is a storage obsoleted by the WhatWG storage specification. See https://developer.mozilla.org/en/DOM/Storage#globalStorage
- if (prop === "globalStorage" && window.StorageList && window.globalStorage instanceof window.StorageList) { continue; }
- // Unfortunately, some versions of IE don't support window.hasOwnProperty
- if (window.hasOwnProperty && !window.hasOwnProperty(prop)) { continue; }
-
- // At times we are not allowed to access certain properties for security reasons.
- // There are also times where even if we can access them, we are not allowed to access their properties.
- try {
- obj = window[prop];
- isNamespace = obj && get(obj, 'isNamespace');
- } catch (e) {
- continue;
- }
-
- if (isNamespace) {
- Ember.deprecate("Namespaces should not begin with lowercase.", /^[A-Z]/.test(prop));
- obj[NAME_KEY] = prop;
- }
- }
-}
-
-Ember.identifyNamespaces = findNamespaces;
-
-/** @private */
-superClassString = function(mixin) {
- var superclass = mixin.superclass;
- if (superclass) {
- if (superclass[NAME_KEY]) { return superclass[NAME_KEY]; }
- else { return superClassString(superclass); }
- } else {
- return;
- }
-};
-
-/** @private */
-classToString = function() {
- var Namespace = Ember.Namespace, namespace;
-
- // TODO: Namespace should really be in Metal
- if (Namespace) {
- if (!this[NAME_KEY] && !classToString.processed) {
- if (!Namespace.PROCESSED) {
- findNamespaces();
- Namespace.PROCESSED = true;
- }
-
- classToString.processed = true;
-
- var namespaces = Namespace.NAMESPACES;
- for (var i=0, l=namespaces.length; i<l; i++) {
- namespace = namespaces[i];
- processNames([namespace.toString()], namespace, {});
- }
- }
- }
-
- if (this[NAME_KEY]) {
- return this[NAME_KEY];
- } else {
- var str = superClassString(this);
- if (str) {
- return "(subclass of " + str + ")";
- } else {
- return "(unknown mixin)";
- }
- }
-};
-
-MixinPrototype.toString = classToString;
-
-// returns the mixins currently applied to the specified object
-// TODO: Make Ember.mixin
-Mixin.mixins = function(obj) {
- var ret = [], mixins = Ember.meta(obj, false).mixins, key, mixin;
- if (mixins) {
- for(key in mixins) {
- if (META_SKIP[key]) { continue; }
- mixin = mixins[key];
-
- // skip primitive mixins since these are always anonymous
- if (!mixin.properties) { ret.push(mixins[key]); }
- }
- }
- return ret;
-};
-
-REQUIRED = new Ember.Descriptor();
-REQUIRED.toString = function() { return '(Required Property)'; };
-
-Ember.required = function() {
- return REQUIRED;
-};
-
-/** @private */
-Alias = function(methodName) {
- this.methodName = methodName;
-};
-Alias.prototype = new Ember.Descriptor();
-
-Ember.alias = function(methodName) {
- return new Alias(methodName);
-};
-
-// ..........................................................
-// OBSERVER HELPER
-//
-
-Ember.observer = function(func) {
- var paths = a_slice.call(arguments, 1);
- func.__ember_observes__ = paths;
- return func;
-};
-
-// If observers ever become asynchronous, Ember.immediateObserver
-// must remain synchronous.
-Ember.immediateObserver = function() {
- for (var i=0, l=arguments.length; i<l; i++) {
- var arg = arguments[i];
- Ember.assert("Immediate observers must observe internal properties only, not properties on other objects.", typeof arg !== "string" || arg.indexOf('.') === -1);
- }
-
- return Ember.observer.apply(this, arguments);
-};
-
-Ember.beforeObserver = function(func) {
- var paths = a_slice.call(arguments, 1);
- func.__ember_observesBefore__ = paths;
- return func;
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Metal
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-(function() {
-/**
- * @license
- * ==========================================================================
- * Ember
- * Copyright ©2006-2011, Strobe Inc. and contributors.
- * Portions copyright ©2008-2011 Apple Inc. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * For more information about Ember, visit http://www.emberjs.com
- *
- * ==========================================================================
- */
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals ENV */
-var indexOf = Ember.EnumerableUtils.indexOf;
-
-// ........................................
-// TYPING & ARRAY MESSAGING
-//
-
-var TYPE_MAP = {};
-var t = "Boolean Number String Function Array Date RegExp Object".split(" ");
-Ember.ArrayPolyfills.forEach.call(t, function(name) {
- TYPE_MAP[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-var toString = Object.prototype.toString;
-
-/**
- Returns a consistent type for the passed item.
-
- Use this instead of the built-in Ember.typeOf() to get the type of an item.
- It will return the same result across all browsers and includes a bit
- more detail. Here is what will be returned:
-
- | Return Value | Meaning |
- |---------------|------------------------------------------------------|
- | 'string' | String primitive |
- | 'number' | Number primitive |
- | 'boolean' | Boolean primitive |
- | 'null' | Null value |
- | 'undefined' | Undefined value |
- | 'function' | A function |
- | 'array' | An instance of Array |
- | 'class' | A Ember class (created using Ember.Object.extend()) |
- | 'instance' | A Ember object instance |
- | 'error' | An instance of the Error object |
- | 'object' | A JavaScript object not inheriting from Ember.Object |
-
- Examples:
-
- Ember.typeOf(); => 'undefined'
- Ember.typeOf(null); => 'null'
- Ember.typeOf(undefined); => 'undefined'
- Ember.typeOf('michael'); => 'string'
- Ember.typeOf(101); => 'number'
- Ember.typeOf(true); => 'boolean'
- Ember.typeOf(Ember.makeArray); => 'function'
- Ember.typeOf([1,2,90]); => 'array'
- Ember.typeOf(Ember.Object.extend()); => 'class'
- Ember.typeOf(Ember.Object.create()); => 'instance'
- Ember.typeOf(new Error('teamocil')); => 'error'
-
- // "normal" JavaScript object
- Ember.typeOf({a: 'b'}); => 'object'
-
- @param item {Object} the item to check
- @returns {String} the type
-*/
-Ember.typeOf = function(item) {
- var ret;
-
- ret = (item === null || item === undefined) ? String(item) : TYPE_MAP[toString.call(item)] || 'object';
-
- if (ret === 'function') {
- if (Ember.Object && Ember.Object.detect(item)) ret = 'class';
- } else if (ret === 'object') {
- if (item instanceof Error) ret = 'error';
- else if (Ember.Object && item instanceof Ember.Object) ret = 'instance';
- else ret = 'object';
- }
-
- return ret;
-};
-
-/**
- Returns true if the passed value is null or undefined. This avoids errors
- from JSLint complaining about use of ==, which can be technically
- confusing.
-
- Ember.none(); => true
- Ember.none(null); => true
- Ember.none(undefined); => true
- Ember.none(''); => false
- Ember.none([]); => false
- Ember.none(function(){}); => false
-
- @param {Object} obj Value to test
- @returns {Boolean}
-*/
-Ember.none = function(obj) {
- return obj === null || obj === undefined;
-};
-
-/**
- Verifies that a value is null or an empty string | array | function.
-
- Constrains the rules on `Ember.none` by returning false for empty
- string and empty arrays.
-
- Ember.empty(); => true
- Ember.empty(null); => true
- Ember.empty(undefined); => true
- Ember.empty(''); => true
- Ember.empty([]); => true
- Ember.empty('tobias fünke'); => false
- Ember.empty([0,1,2]); => false
-
- @param {Object} obj Value to test
- @returns {Boolean}
-*/
-Ember.empty = function(obj) {
- return obj === null || obj === undefined || (obj.length === 0 && typeof obj !== 'function');
-};
-
-/**
- This will compare two javascript values of possibly different types.
- It will tell you which one is greater than the other by returning:
-
- - -1 if the first is smaller than the second,
- - 0 if both are equal,
- - 1 if the first is greater than the second.
-
- The order is calculated based on Ember.ORDER_DEFINITION, if types are different.
- In case they have the same type an appropriate comparison for this type is made.
-
- Ember.compare('hello', 'hello'); => 0
- Ember.compare('abc', 'dfg'); => -1
- Ember.compare(2, 1); => 1
-
- @param {Object} v First value to compare
- @param {Object} w Second value to compare
- @returns {Number} -1 if v < w, 0 if v = w and 1 if v > w.
-*/
-Ember.compare = function compare(v, w) {
- if (v === w) { return 0; }
-
- var type1 = Ember.typeOf(v);
- var type2 = Ember.typeOf(w);
-
- var Comparable = Ember.Comparable;
- if (Comparable) {
- if (type1==='instance' && Comparable.detect(v.constructor)) {
- return v.constructor.compare(v, w);
- }
-
- if (type2 === 'instance' && Comparable.detect(w.constructor)) {
- return 1-w.constructor.compare(w, v);
- }
- }
-
- // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION,
- // do so now.
- var mapping = Ember.ORDER_DEFINITION_MAPPING;
- if (!mapping) {
- var order = Ember.ORDER_DEFINITION;
- mapping = Ember.ORDER_DEFINITION_MAPPING = {};
- var idx, len;
- for (idx = 0, len = order.length; idx < len; ++idx) {
- mapping[order[idx]] = idx;
- }
-
- // We no longer need Ember.ORDER_DEFINITION.
- delete Ember.ORDER_DEFINITION;
- }
-
- var type1Index = mapping[type1];
- var type2Index = mapping[type2];
-
- if (type1Index < type2Index) { return -1; }
- if (type1Index > type2Index) { return 1; }
-
- // types are equal - so we have to check values now
- switch (type1) {
- case 'boolean':
- case 'number':
- if (v < w) { return -1; }
- if (v > w) { return 1; }
- return 0;
-
- case 'string':
- var comp = v.localeCompare(w);
- if (comp < 0) { return -1; }
- if (comp > 0) { return 1; }
- return 0;
-
- case 'array':
- var vLen = v.length;
- var wLen = w.length;
- var l = Math.min(vLen, wLen);
- var r = 0;
- var i = 0;
- while (r === 0 && i < l) {
- r = compare(v[i],w[i]);
- i++;
- }
- if (r !== 0) { return r; }
-
- // all elements are equal now
- // shorter array should be ordered first
- if (vLen < wLen) { return -1; }
- if (vLen > wLen) { return 1; }
- // arrays are equal now
- return 0;
-
- case 'instance':
- if (Ember.Comparable && Ember.Comparable.detect(v)) {
- return v.compare(v, w);
- }
- return 0;
-
- case 'date':
- var vNum = v.getTime();
- var wNum = w.getTime();
- if (vNum < wNum) { return -1; }
- if (vNum > wNum) { return 1; }
- return 0;
-
- default:
- return 0;
- }
-};
-
-/** @private */
-function _copy(obj, deep, seen, copies) {
- var ret, loc, key;
-
- // primitive data types are immutable, just return them.
- if ('object' !== typeof obj || obj===null) return obj;
-
- // avoid cyclical loops
- if (deep && (loc=indexOf(seen, obj))>=0) return copies[loc];
-
- Ember.assert('Cannot clone an Ember.Object that does not implement Ember.Copyable', !(obj instanceof Ember.Object) || (Ember.Copyable && Ember.Copyable.detect(obj)));
-
- // IMPORTANT: this specific test will detect a native array only. Any other
- // object will need to implement Copyable.
- if (Ember.typeOf(obj) === 'array') {
- ret = obj.slice();
- if (deep) {
- loc = ret.length;
- while(--loc>=0) ret[loc] = _copy(ret[loc], deep, seen, copies);
- }
- } else if (Ember.Copyable && Ember.Copyable.detect(obj)) {
- ret = obj.copy(deep, seen, copies);
- } else {
- ret = {};
- for(key in obj) {
- if (!obj.hasOwnProperty(key)) continue;
- ret[key] = deep ? _copy(obj[key], deep, seen, copies) : obj[key];
- }
- }
-
- if (deep) {
- seen.push(obj);
- copies.push(ret);
- }
-
- return ret;
-}
-
-/**
- Creates a clone of the passed object. This function can take just about
- any type of object and create a clone of it, including primitive values
- (which are not actually cloned because they are immutable).
-
- If the passed object implements the clone() method, then this function
- will simply call that method and return the result.
-
- @param {Object} object The object to clone
- @param {Boolean} deep If true, a deep copy of the object is made
- @returns {Object} The cloned object
-*/
-Ember.copy = function(obj, deep) {
- // fast paths
- if ('object' !== typeof obj || obj===null) return obj; // can't copy primitives
- if (Ember.Copyable && Ember.Copyable.detect(obj)) return obj.copy(deep);
- return _copy(obj, deep, deep ? [] : null, deep ? [] : null);
-};
-
-/**
- Convenience method to inspect an object. This method will attempt to
- convert the object into a useful string description.
-
- @param {Object} obj The object you want to inspect.
- @returns {String} A description of the object
-*/
-Ember.inspect = function(obj) {
- var v, ret = [];
- for(var key in obj) {
- if (obj.hasOwnProperty(key)) {
- v = obj[key];
- if (v === 'toString') { continue; } // ignore useless items
- if (Ember.typeOf(v) === 'function') { v = "function() { ... }"; }
- ret.push(key + ": " + v);
- }
- }
- return "{" + ret.join(" , ") + "}";
-};
-
-/**
- Compares two objects, returning true if they are logically equal. This is
- a deeper comparison than a simple triple equal. For sets it will compare the
- internal objects. For any other object that implements `isEqual()` it will
- respect that method.
-
- Ember.isEqual('hello', 'hello'); => true
- Ember.isEqual(1, 2); => false
- Ember.isEqual([4,2], [4,2]); => false
-
- @param {Object} a first object to compare
- @param {Object} b second object to compare
- @returns {Boolean}
-*/
-Ember.isEqual = function(a, b) {
- if (a && 'function'===typeof a.isEqual) return a.isEqual(b);
- return a === b;
-};
-
-/**
- @private
- Used by Ember.compare
-*/
-Ember.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [
- 'undefined',
- 'null',
- 'boolean',
- 'number',
- 'string',
- 'array',
- 'object',
- 'instance',
- 'function',
- 'class',
- 'date'
-];
-
-/**
- Returns all of the keys defined on an object or hash. This is useful
- when inspecting objects for debugging. On browsers that support it, this
- uses the native Object.keys implementation.
-
- @function
- @param {Object} obj
- @returns {Array} Array containing keys of obj
-*/
-Ember.keys = Object.keys;
-
-if (!Ember.keys) {
- Ember.keys = function(obj) {
- var ret = [];
- for(var key in obj) {
- if (obj.hasOwnProperty(key)) { ret.push(key); }
- }
- return ret;
- };
-}
-
-// ..........................................................
-// ERROR
-//
-
-/**
- @class
-
- A subclass of the JavaScript Error object for use in Ember.
-*/
-Ember.Error = function() {
- var tmp = Error.prototype.constructor.apply(this, arguments);
-
- for (var p in tmp) {
- if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
- }
- this.message = tmp.message;
-};
-
-Ember.Error.prototype = Ember.create(Error.prototype);
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-/** @private **/
-var STRING_DASHERIZE_REGEXP = (/[ _]/g);
-var STRING_DASHERIZE_CACHE = {};
-var STRING_DECAMELIZE_REGEXP = (/([a-z])([A-Z])/g);
-var STRING_CAMELIZE_REGEXP = (/(\-|_|\s)+(.)?/g);
-var STRING_UNDERSCORE_REGEXP_1 = (/([a-z\d])([A-Z]+)/g);
-var STRING_UNDERSCORE_REGEXP_2 = (/\-|\s+/g);
-
-/**
- Defines the hash of localized strings for the current language. Used by
- the `Ember.String.loc()` helper. To localize, add string values to this
- hash.
-
- @type Hash
-*/
-Ember.STRINGS = {};
-
-/**
- Defines string helper methods including string formatting and localization.
- Unless Ember.EXTEND_PROTOTYPES = false these methods will also be added to the
- String.prototype as well.
-
- @namespace
-*/
-Ember.String = {
-
- /**
- Apply formatting options to the string. This will look for occurrences
- of %@ in your string and substitute them with the arguments you pass into
- this method. If you want to control the specific order of replacement,
- you can add a number after the key as well to indicate which argument
- you want to insert.
-
- Ordered insertions are most useful when building loc strings where values
- you need to insert may appear in different orders.
-
- "Hello %@ %@".fmt('John', 'Doe') => "Hello John Doe"
- "Hello %@2, %@1".fmt('John', 'Doe') => "Hello Doe, John"
-
- @param {Object...} [args]
- @returns {String} formatted string
- */
- fmt: function(str, formats) {
- // first, replace any ORDERED replacements.
- var idx = 0; // the current index for non-numerical replacements
- return str.replace(/%@([0-9]+)?/g, function(s, argIndex) {
- argIndex = (argIndex) ? parseInt(argIndex,0) - 1 : idx++ ;
- s = formats[argIndex];
- return ((s === null) ? '(null)' : (s === undefined) ? '' : s).toString();
- }) ;
- },
-
- /**
- Formats the passed string, but first looks up the string in the localized
- strings hash. This is a convenient way to localize text. See
- `Ember.String.fmt()` for more information on formatting.
-
- Note that it is traditional but not required to prefix localized string
- keys with an underscore or other character so you can easily identify
- localized strings.
-
- Ember.STRINGS = {
- '_Hello World': 'Bonjour le monde',
- '_Hello %@ %@': 'Bonjour %@ %@'
- };
-
- Ember.String.loc("_Hello World");
- => 'Bonjour le monde';
-
- Ember.String.loc("_Hello %@ %@", ["John", "Smith"]);
- => "Bonjour John Smith";
-
- @param {String} str
- The string to format
-
- @param {Array} formats
- Optional array of parameters to interpolate into string.
-
- @returns {String} formatted string
- */
- loc: function(str, formats) {
- str = Ember.STRINGS[str] || str;
- return Ember.String.fmt(str, formats) ;
- },
-
- /**
- Splits a string into separate units separated by spaces, eliminating any
- empty strings in the process. This is a convenience method for split that
- is mostly useful when applied to the String.prototype.
-
- Ember.String.w("alpha beta gamma").forEach(function(key) {
- console.log(key);
- });
- > alpha
- > beta
- > gamma
-
- @param {String} str
- The string to split
-
- @returns {String} split string
- */
- w: function(str) { return str.split(/\s+/); },
-
- /**
- Converts a camelized string into all lower case separated by underscores.
-
- 'innerHTML'.decamelize() => 'inner_html'
- 'action_name'.decamelize() => 'action_name'
- 'css-class-name'.decamelize() => 'css-class-name'
- 'my favorite items'.decamelize() => 'my favorite items'
-
- @param {String} str
- The string to decamelize.
-
- @returns {String} the decamelized string.
- */
- decamelize: function(str) {
- return str.replace(STRING_DECAMELIZE_REGEXP, '$1_$2').toLowerCase();
- },
-
- /**
- Replaces underscores or spaces with dashes.
-
- 'innerHTML'.dasherize() => 'inner-html'
- 'action_name'.dasherize() => 'action-name'
- 'css-class-name'.dasherize() => 'css-class-name'
- 'my favorite items'.dasherize() => 'my-favorite-items'
-
- @param {String} str
- The string to dasherize.
-
- @returns {String} the dasherized string.
- */
- dasherize: function(str) {
- var cache = STRING_DASHERIZE_CACHE,
- ret = cache[str];
-
- if (ret) {
- return ret;
- } else {
- ret = Ember.String.decamelize(str).replace(STRING_DASHERIZE_REGEXP,'-');
- cache[str] = ret;
- }
-
- return ret;
- },
-
- /**
- Returns the lowerCaseCamel form of a string.
-
- 'innerHTML'.camelize() => 'innerHTML'
- 'action_name'.camelize() => 'actionName'
- 'css-class-name'.camelize() => 'cssClassName'
- 'my favorite items'.camelize() => 'myFavoriteItems'
-
- @param {String} str
- The string to camelize.
-
- @returns {String} the camelized string.
- */
- camelize: function(str) {
- return str.replace(STRING_CAMELIZE_REGEXP, function(match, separator, chr) {
- return chr ? chr.toUpperCase() : '';
- });
- },
-
- /**
- Returns the UpperCamelCase form of a string.
-
- 'innerHTML'.classify() => 'InnerHTML'
- 'action_name'.classify() => 'ActionName'
- 'css-class-name'.classify() => 'CssClassName'
- 'my favorite items'.classift() => 'MyFavoriteItems'
- */
- classify: function(str) {
- var camelized = Ember.String.camelize(str);
- return camelized.charAt(0).toUpperCase() + camelized.substr(1);
- },
-
- /**
- More general than decamelize. Returns the lower_case_and_underscored
- form of a string.
-
- 'innerHTML'.underscore() => 'inner_html'
- 'action_name'.underscore() => 'action_name'
- 'css-class-name'.underscore() => 'css_class_name'
- 'my favorite items'.underscore() => 'my_favorite_items'
-
- @param {String} str
- The string to underscore.
-
- @returns {String} the underscored string.
- */
- underscore: function(str) {
- return str.replace(STRING_UNDERSCORE_REGEXP_1, '$1_$2').
- replace(STRING_UNDERSCORE_REGEXP_2, '_').toLowerCase();
- }
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var fmt = Ember.String.fmt,
- w = Ember.String.w,
- loc = Ember.String.loc,
- camelize = Ember.String.camelize,
- decamelize = Ember.String.decamelize,
- dasherize = Ember.String.dasherize,
- underscore = Ember.String.underscore;
-
-if (Ember.EXTEND_PROTOTYPES) {
-
- /**
- @see Ember.String.fmt
- */
- String.prototype.fmt = function() {
- return fmt(this, arguments);
- };
-
- /**
- @see Ember.String.w
- */
- String.prototype.w = function() {
- return w(this);
- };
-
- /**
- @see Ember.String.loc
- */
- String.prototype.loc = function() {
- return loc(this, arguments);
- };
-
- /**
- @see Ember.String.camelize
- */
- String.prototype.camelize = function() {
- return camelize(this);
- };
-
- /**
- @see Ember.String.decamelize
- */
- String.prototype.decamelize = function() {
- return decamelize(this);
- };
-
- /**
- @see Ember.String.dasherize
- */
- String.prototype.dasherize = function() {
- return dasherize(this);
- };
-
- /**
- @see Ember.String.underscore
- */
- String.prototype.underscore = function() {
- return underscore(this);
- };
-
-}
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var a_slice = Array.prototype.slice;
-
-if (Ember.EXTEND_PROTOTYPES) {
-
- /**
- The `property` extension of Javascript's Function prototype is available
- when Ember.EXTEND_PROTOTYPES is true, which is the default.
-
- Computed properties allow you to treat a function like a property:
-
- MyApp.president = Ember.Object.create({
- firstName: "Barack",
- lastName: "Obama",
-
- fullName: function() {
- return this.get('firstName') + ' ' + this.get('lastName');
-
- // Call this flag to mark the function as a property
- }.property()
- });
-
- MyApp.president.get('fullName'); => "Barack Obama"
-
- Treating a function like a property is useful because they can work with
- bindings, just like any other property.
-
- Many computed properties have dependencies on other properties. For
- example, in the above example, the `fullName` property depends on
- `firstName` and `lastName` to determine its value. You can tell Ember.js
- about these dependencies like this:
-
- MyApp.president = Ember.Object.create({
- firstName: "Barack",
- lastName: "Obama",
-
- fullName: function() {
- return this.get('firstName') + ' ' + this.get('lastName');
-
- // Tell Ember.js that this computed property depends on firstName
- // and lastName
- }.property('firstName', 'lastName')
- });
-
- Make sure you list these dependencies so Ember.js knows when to update
- bindings that connect to a computed property. Changing a dependency
- will not immediately trigger an update of the computed property, but
- will instead clear the cache so that it is updated when the next `get`
- is called on the property.
-
- Note: you will usually want to use `property(...)` with `cacheable()`.
-
- @see Ember.ComputedProperty
- @see Ember.computed
- */
- Function.prototype.property = function() {
- var ret = Ember.computed(this);
- return ret.property.apply(ret, arguments);
- };
-
- /**
- The `observes` extension of Javascript's Function prototype is available
- when Ember.EXTEND_PROTOTYPES is true, which is the default.
-
- You can observe property changes simply by adding the `observes`
- call to the end of your method declarations in classes that you write.
- For example:
-
- Ember.Object.create({
- valueObserver: function() {
- // Executes whenever the "value" property changes
- }.observes('value')
- });
-
- @see Ember.Observable
- */
- Function.prototype.observes = function() {
- this.__ember_observes__ = a_slice.call(arguments);
- return this;
- };
-
- /**
- The `observesBefore` extension of Javascript's Function prototype is
- available when Ember.EXTEND_PROTOTYPES is true, which is the default.
-
- You can get notified when a property changes is about to happen by
- by adding the `observesBefore` call to the end of your method
- declarations in classes that you write. For example:
-
- Ember.Object.create({
- valueObserver: function() {
- // Executes whenever the "value" property is about to change
- }.observesBefore('value')
- });
-
- @see Ember.Observable
- */
- Function.prototype.observesBefore = function() {
- this.__ember_observesBefore__ = a_slice.call(arguments);
- return this;
- };
-
-}
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-
-
-
-
-// ..........................................................
-// HELPERS
-//
-
-var get = Ember.get, set = Ember.set;
-var a_slice = Array.prototype.slice;
-var a_indexOf = Ember.EnumerableUtils.indexOf;
-
-var contexts = [];
-/** @private */
-function popCtx() {
- return contexts.length===0 ? {} : contexts.pop();
-}
-
-/** @private */
-function pushCtx(ctx) {
- contexts.push(ctx);
- return null;
-}
-
-/** @private */
-function iter(key, value) {
- var valueProvided = arguments.length === 2;
-
- function i(item) {
- var cur = get(item, key);
- return valueProvided ? value===cur : !!cur;
- }
- return i ;
-}
-
-/**
- @class
-
- This mixin defines the common interface implemented by enumerable objects
- in Ember. Most of these methods follow the standard Array iteration
- API defined up to JavaScript 1.8 (excluding language-specific features that
- cannot be emulated in older versions of JavaScript).
-
- This mixin is applied automatically to the Array class on page load, so you
- can use any of these methods on simple arrays. If Array already implements
- one of these methods, the mixin will not override them.
-
- h3. Writing Your Own Enumerable
-
- To make your own custom class enumerable, you need two items:
-
- 1. You must have a length property. This property should change whenever
- the number of items in your enumerable object changes. If you using this
- with an Ember.Object subclass, you should be sure to change the length
- property using set().
-
- 2. If you must implement nextObject(). See documentation.
-
- Once you have these two methods implement, apply the Ember.Enumerable mixin
- to your class and you will be able to enumerate the contents of your object
- like any other collection.
-
- h3. Using Ember Enumeration with Other Libraries
-
- Many other libraries provide some kind of iterator or enumeration like
- facility. This is often where the most common API conflicts occur.
- Ember's API is designed to be as friendly as possible with other
- libraries by implementing only methods that mostly correspond to the
- JavaScript 1.8 API.
-
- @extends Ember.Mixin
- @since Ember 0.9
-*/
-Ember.Enumerable = Ember.Mixin.create(
- /** @scope Ember.Enumerable.prototype */ {
-
- /** @private - compatibility */
- isEnumerable: true,
-
- /**
- Implement this method to make your class enumerable.
-
- This method will be call repeatedly during enumeration. The index value
- will always begin with 0 and increment monotonically. You don't have to
- rely on the index value to determine what object to return, but you should
- always check the value and start from the beginning when you see the
- requested index is 0.
-
- The previousObject is the object that was returned from the last call
- to nextObject for the current iteration. This is a useful way to
- manage iteration if you are tracing a linked list, for example.
-
- Finally the context parameter will always contain a hash you can use as
- a "scratchpad" to maintain any other state you need in order to iterate
- properly. The context object is reused and is not reset between
- iterations so make sure you setup the context with a fresh state whenever
- the index parameter is 0.
-
- Generally iterators will continue to call nextObject until the index
- reaches the your current length-1. If you run out of data before this
- time for some reason, you should simply return undefined.
-
- The default implementation of this method simply looks up the index.
- This works great on any Array-like objects.
-
- @param {Number} index the current index of the iteration
- @param {Object} previousObject the value returned by the last call to nextObject.
- @param {Object} context a context object you can use to maintain state.
- @returns {Object} the next object in the iteration or undefined
- */
- nextObject: Ember.required(Function),
-
- /**
- Helper method returns the first object from a collection. This is usually
- used by bindings and other parts of the framework to extract a single
- object if the enumerable contains only one item.
-
- If you override this method, you should implement it so that it will
- always return the same value each time it is called. If your enumerable
- contains only one object, this method should always return that object.
- If your enumerable is empty, this method should return undefined.
-
- var arr = ["a", "b", "c"];
- arr.firstObject(); => "a"
-
- var arr = [];
- arr.firstObject(); => undefined
-
- @returns {Object} the object or undefined
- */
- firstObject: Ember.computed(function() {
- if (get(this, 'length')===0) return undefined ;
-
- // handle generic enumerables
- var context = popCtx(), ret;
- ret = this.nextObject(0, null, context);
- pushCtx(context);
- return ret ;
- }).property('[]').cacheable(),
-
- /**
- Helper method returns the last object from a collection. If your enumerable
- contains only one object, this method should always return that object.
- If your enumerable is empty, this method should return undefined.
-
- var arr = ["a", "b", "c"];
- arr.lastObject(); => "c"
-
- var arr = [];
- arr.lastObject(); => undefined
-
- @returns {Object} the last object or undefined
- */
- lastObject: Ember.computed(function() {
- var len = get(this, 'length');
- if (len===0) return undefined ;
- var context = popCtx(), idx=0, cur, last = null;
- do {
- last = cur;
- cur = this.nextObject(idx++, last, context);
- } while (cur !== undefined);
- pushCtx(context);
- return last;
- }).property('[]').cacheable(),
-
- /**
- Returns true if the passed object can be found in the receiver. The
- default version will iterate through the enumerable until the object
- is found. You may want to override this with a more efficient version.
-
- var arr = ["a", "b", "c"];
- arr.contains("a"); => true
- arr.contains("z"); => false
-
- @param {Object} obj
- The object to search for.
-
- @returns {Boolean} true if object is found in enumerable.
- */
- contains: function(obj) {
- return this.find(function(item) { return item===obj; }) !== undefined;
- },
-
- /**
- Iterates through the enumerable, calling the passed function on each
- item. This method corresponds to the forEach() method defined in
- JavaScript 1.6.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
-
- function(item, index, enumerable);
-
- - *item* is the current item in the iteration.
- - *index* is the current index in the iteration
- - *enumerable* is the enumerable object itself.
-
- Note that in addition to a callback, you can also pass an optional target
- object that will be set as "this" on the context. This is a good way
- to give your iterator function access to the current object.
-
- @param {Function} callback The callback to execute
- @param {Object} [target] The target object to use
- @returns {Object} receiver
- */
- forEach: function(callback, target) {
- if (typeof callback !== "function") throw new TypeError() ;
- var len = get(this, 'length'), last = null, context = popCtx();
-
- if (target === undefined) target = null;
-
- for(var idx=0;idx<len;idx++) {
- var next = this.nextObject(idx, last, context) ;
- callback.call(target, next, idx, this);
- last = next ;
- }
- last = null ;
- context = pushCtx(context);
- return this ;
- },
-
- /**
- Alias for mapProperty
-
- @param {String} key name of the property
- @returns {Array} The mapped array.
- */
- getEach: function(key) {
- return this.mapProperty(key);
- },
-
- /**
- Sets the value on the named property for each member. This is more
- efficient than using other methods defined on this helper. If the object
- implements Ember.Observable, the value will be changed to set(), otherwise
- it will be set directly. null objects are skipped.
-
- @param {String} key The key to set
- @param {Object} value The object to set
- @returns {Object} receiver
- */
- setEach: function(key, value) {
- return this.forEach(function(item) {
- set(item, key, value);
- });
- },
-
- /**
- Maps all of the items in the enumeration to another value, returning
- a new array. This method corresponds to map() defined in JavaScript 1.6.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
-
- function(item, index, enumerable);
-
- - *item* is the current item in the iteration.
- - *index* is the current index in the iteration
- - *enumerable* is the enumerable object itself.
-
- It should return the mapped value.
-
- Note that in addition to a callback, you can also pass an optional target
- object that will be set as "this" on the context. This is a good way
- to give your iterator function access to the current object.
-
- @param {Function} callback The callback to execute
- @param {Object} [target] The target object to use
- @returns {Array} The mapped array.
- */
- map: function(callback, target) {
- var ret = [];
- this.forEach(function(x, idx, i) {
- ret[idx] = callback.call(target, x, idx,i);
- });
- return ret ;
- },
-
- /**
- Similar to map, this specialized function returns the value of the named
- property on all items in the enumeration.
-
- @param {String} key name of the property
- @returns {Array} The mapped array.
- */
- mapProperty: function(key) {
- return this.map(function(next) {
- return get(next, key);
- });
- },
-
- /**
- Returns an array with all of the items in the enumeration that the passed
- function returns true for. This method corresponds to filter() defined in
- JavaScript 1.6.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
-
- function(item, index, enumerable);
-
- - *item* is the current item in the iteration.
- - *index* is the current index in the iteration
- - *enumerable* is the enumerable object itself.
-
- It should return the true to include the item in the results, false otherwise.
-
- Note that in addition to a callback, you can also pass an optional target
- object that will be set as "this" on the context. This is a good way
- to give your iterator function access to the current object.
-
- @param {Function} callback The callback to execute
- @param {Object} [target] The target object to use
- @returns {Array} A filtered array.
- */
- filter: function(callback, target) {
- var ret = [];
- this.forEach(function(x, idx, i) {
- if (callback.call(target, x, idx, i)) ret.push(x);
- });
- return ret ;
- },
-
- /**
- Returns an array with just the items with the matched property. You
- can pass an optional second argument with the target value. Otherwise
- this will match any property that evaluates to true.
-
- @param {String} key the property to test
- @param {String} [value] optional value to test against.
- @returns {Array} filtered array
- */
- filterProperty: function(key, value) {
- return this.filter(iter.apply(this, arguments));
- },
-
- /**
- Returns the first item in the array for which the callback returns true.
- This method works similar to the filter() method defined in JavaScript 1.6
- except that it will stop working on the array once a match is found.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
-
- function(item, index, enumerable);
-
- - *item* is the current item in the iteration.
- - *index* is the current index in the iteration
- - *enumerable* is the enumerable object itself.
-
- It should return the true to include the item in the results, false otherwise.
-
- Note that in addition to a callback, you can also pass an optional target
- object that will be set as "this" on the context. This is a good way
- to give your iterator function access to the current object.
-
- @param {Function} callback The callback to execute
- @param {Object} [target] The target object to use
- @returns {Object} Found item or null.
- */
- find: function(callback, target) {
- var len = get(this, 'length') ;
- if (target === undefined) target = null;
-
- var last = null, next, found = false, ret ;
- var context = popCtx();
- for(var idx=0;idx<len && !found;idx++) {
- next = this.nextObject(idx, last, context) ;
- if (found = callback.call(target, next, idx, this)) ret = next ;
- last = next ;
- }
- next = last = null ;
- context = pushCtx(context);
- return ret ;
- },
-
- /**
- Returns the first item with a property matching the passed value. You
- can pass an optional second argument with the target value. Otherwise
- this will match any property that evaluates to true.
-
- This method works much like the more generic find() method.
-
- @param {String} key the property to test
- @param {String} [value] optional value to test against.
- @returns {Object} found item or null
- */
- findProperty: function(key, value) {
- return this.find(iter.apply(this, arguments));
- },
-
- /**
- Returns true if the passed function returns true for every item in the
- enumeration. This corresponds with the every() method in JavaScript 1.6.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
-
- function(item, index, enumerable);
-
- - *item* is the current item in the iteration.
- - *index* is the current index in the iteration
- - *enumerable* is the enumerable object itself.
-
- It should return the true or false.
-
- Note that in addition to a callback, you can also pass an optional target
- object that will be set as "this" on the context. This is a good way
- to give your iterator function access to the current object.
-
- Example Usage:
-
- if (people.every(isEngineer)) { Paychecks.addBigBonus(); }
-
- @param {Function} callback The callback to execute
- @param {Object} [target] The target object to use
- @returns {Boolean}
- */
- every: function(callback, target) {
- return !this.find(function(x, idx, i) {
- return !callback.call(target, x, idx, i);
- });
- },
-
- /**
- Returns true if the passed property resolves to true for all items in the
- enumerable. This method is often simpler/faster than using a callback.
-
- @param {String} key the property to test
- @param {String} [value] optional value to test against.
- @returns {Array} filtered array
- */
- everyProperty: function(key, value) {
- return this.every(iter.apply(this, arguments));
- },
-
-
- /**
- Returns true if the passed function returns true for any item in the
- enumeration. This corresponds with the every() method in JavaScript 1.6.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
-
- function(item, index, enumerable);
-
- - *item* is the current item in the iteration.
- - *index* is the current index in the iteration
- - *enumerable* is the enumerable object itself.
-
- It should return the true to include the item in the results, false otherwise.
-
- Note that in addition to a callback, you can also pass an optional target
- object that will be set as "this" on the context. This is a good way
- to give your iterator function access to the current object.
-
- Usage Example:
-
- if (people.some(isManager)) { Paychecks.addBiggerBonus(); }
-
- @param {Function} callback The callback to execute
- @param {Object} [target] The target object to use
- @returns {Array} A filtered array.
- */
- some: function(callback, target) {
- return !!this.find(function(x, idx, i) {
- return !!callback.call(target, x, idx, i);
- });
- },
-
- /**
- Returns true if the passed property resolves to true for any item in the
- enumerable. This method is often simpler/faster than using a callback.
-
- @param {String} key the property to test
- @param {String} [value] optional value to test against.
- @returns {Boolean} true
- */
- someProperty: function(key, value) {
- return this.some(iter.apply(this, arguments));
- },
-
- /**
- This will combine the values of the enumerator into a single value. It
- is a useful way to collect a summary value from an enumeration. This
- corresponds to the reduce() method defined in JavaScript 1.8.
-
- The callback method you provide should have the following signature (all
- parameters are optional):
-
- function(previousValue, item, index, enumerable);
-
- - *previousValue* is the value returned by the last call to the iterator.
- - *item* is the current item in the iteration.
- - *index* is the current index in the iteration
- - *enumerable* is the enumerable object itself.
-
- Return the new cumulative value.
-
- In addition to the callback you can also pass an initialValue. An error
- will be raised if you do not pass an initial value and the enumerator is
- empty.
-
- Note that unlike the other methods, this method does not allow you to
- pass a target object to set as this for the callback. It's part of the
- spec. Sorry.
-
- @param {Function} callback The callback to execute
- @param {Object} initialValue Initial value for the reduce
- @param {String} reducerProperty internal use only.
- @returns {Object} The reduced value.
- */
- reduce: function(callback, initialValue, reducerProperty) {
- if (typeof callback !== "function") { throw new TypeError(); }
-
- var ret = initialValue;
-
- this.forEach(function(item, i) {
- ret = callback.call(null, ret, item, i, this, reducerProperty);
- }, this);
-
- return ret;
- },
-
- /**
- Invokes the named method on every object in the receiver that
- implements it. This method corresponds to the implementation in
- Prototype 1.6.
-
- @param {String} methodName the name of the method
- @param {Object...} args optional arguments to pass as well.
- @returns {Array} return values from calling invoke.
- */
- invoke: function(methodName) {
- var args, ret = [];
- if (arguments.length>1) args = a_slice.call(arguments, 1);
-
- this.forEach(function(x, idx) {
- var method = x && x[methodName];
- if ('function' === typeof method) {
- ret[idx] = args ? method.apply(x, args) : method.call(x);
- }
- }, this);
-
- return ret;
- },
-
- /**
- Simply converts the enumerable into a genuine array. The order is not
- guaranteed. Corresponds to the method implemented by Prototype.
-
- @returns {Array} the enumerable as an array.
- */
- toArray: function() {
- var ret = [];
- this.forEach(function(o, idx) { ret[idx] = o; });
- return ret ;
- },
-
- /**
- Returns a copy of the array with all null elements removed.
-
- var arr = ["a", null, "c", null];
- arr.compact(); => ["a", "c"]
-
- @returns {Array} the array without null elements.
- */
- compact: function() { return this.without(null); },
-
- /**
- Returns a new enumerable that excludes the passed value. The default
- implementation returns an array regardless of the receiver type unless
- the receiver does not contain the value.
-
- var arr = ["a", "b", "a", "c"];
- arr.without("a"); => ["b", "c"]
-
- @param {Object} value
- @returns {Ember.Enumerable}
- */
- without: function(value) {
- if (!this.contains(value)) return this; // nothing to do
- var ret = [] ;
- this.forEach(function(k) {
- if (k !== value) ret[ret.length] = k;
- }) ;
- return ret ;
- },
-
- /**
- Returns a new enumerable that contains only unique values. The default
- implementation returns an array regardless of the receiver type.
-
- var arr = ["a", "a", "b", "b"];
- arr.uniq(); => ["a", "b"]
-
- @returns {Ember.Enumerable}
- */
- uniq: function() {
- var ret = [];
- this.forEach(function(k){
- if (a_indexOf(ret, k)<0) ret.push(k);
- });
- return ret;
- },
-
- /**
- This property will trigger anytime the enumerable's content changes.
- You can observe this property to be notified of changes to the enumerables
- content.
-
- For plain enumerables, this property is read only. Ember.Array overrides
- this method.
-
- @type Ember.Array
- */
- '[]': Ember.computed(function(key, value) {
- return this;
- }).property().cacheable(),
-
- // ..........................................................
- // ENUMERABLE OBSERVERS
- //
-
- /**
- Registers an enumerable observer. Must implement Ember.EnumerableObserver
- mixin.
- */
- addEnumerableObserver: function(target, opts) {
- var willChange = (opts && opts.willChange) || 'enumerableWillChange',
- didChange = (opts && opts.didChange) || 'enumerableDidChange';
-
- var hasObservers = get(this, 'hasEnumerableObservers');
- if (!hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');
- Ember.addListener(this, '@enumerable:before', target, willChange);
- Ember.addListener(this, '@enumerable:change', target, didChange);
- if (!hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');
- return this;
- },
-
- /**
- Removes a registered enumerable observer.
- */
- removeEnumerableObserver: function(target, opts) {
- var willChange = (opts && opts.willChange) || 'enumerableWillChange',
- didChange = (opts && opts.didChange) || 'enumerableDidChange';
-
- var hasObservers = get(this, 'hasEnumerableObservers');
- if (hasObservers) Ember.propertyWillChange(this, 'hasEnumerableObservers');
- Ember.removeListener(this, '@enumerable:before', target, willChange);
- Ember.removeListener(this, '@enumerable:change', target, didChange);
- if (hasObservers) Ember.propertyDidChange(this, 'hasEnumerableObservers');
- return this;
- },
-
- /**
- Becomes true whenever the array currently has observers watching changes
- on the array.
-
- @type Boolean
- */
- hasEnumerableObservers: Ember.computed(function() {
- return Ember.hasListeners(this, '@enumerable:change') || Ember.hasListeners(this, '@enumerable:before');
- }).property().cacheable(),
-
-
- /**
- Invoke this method just before the contents of your enumerable will
- change. You can either omit the parameters completely or pass the objects
- to be removed or added if available or just a count.
-
- @param {Ember.Enumerable|Number} removing
- An enumerable of the objects to be removed or the number of items to
- be removed.
-
- @param {Ember.Enumerable|Number} adding
- An enumerable of the objects to be added or the number of items to be
- added.
-
- @returns {Ember.Enumerable} receiver
- */
- enumerableContentWillChange: function(removing, adding) {
-
- var removeCnt, addCnt, hasDelta;
-
- if ('number' === typeof removing) removeCnt = removing;
- else if (removing) removeCnt = get(removing, 'length');
- else removeCnt = removing = -1;
-
- if ('number' === typeof adding) addCnt = adding;
- else if (adding) addCnt = get(adding,'length');
- else addCnt = adding = -1;
-
- hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;
-
- if (removing === -1) removing = null;
- if (adding === -1) adding = null;
-
- Ember.propertyWillChange(this, '[]');
- if (hasDelta) Ember.propertyWillChange(this, 'length');
- Ember.sendEvent(this, '@enumerable:before', [this, removing, adding]);
-
- return this;
- },
-
- /**
- Invoke this method when the contents of your enumerable has changed.
- This will notify any observers watching for content changes. If your are
- implementing an ordered enumerable (such as an array), also pass the
- start and end values where the content changed so that it can be used to
- notify range observers.
-
- @param {Number} start
- optional start offset for the content change. For unordered
- enumerables, you should always pass -1.
-
- @param {Ember.Enumerable|Number} removing
- An enumerable of the objects to be removed or the number of items to
- be removed.
-
- @param {Ember.Enumerable|Number} adding
- An enumerable of the objects to be added or the number of items to be
- added.
-
- @returns {Object} receiver
- */
- enumerableContentDidChange: function(removing, adding) {
- var notify = this.propertyDidChange, removeCnt, addCnt, hasDelta;
-
- if ('number' === typeof removing) removeCnt = removing;
- else if (removing) removeCnt = get(removing, 'length');
- else removeCnt = removing = -1;
-
- if ('number' === typeof adding) addCnt = adding;
- else if (adding) addCnt = get(adding, 'length');
- else addCnt = adding = -1;
-
- hasDelta = addCnt<0 || removeCnt<0 || addCnt-removeCnt!==0;
-
- if (removing === -1) removing = null;
- if (adding === -1) adding = null;
-
- Ember.sendEvent(this, '@enumerable:change', [this, removing, adding]);
- if (hasDelta) Ember.propertyDidChange(this, 'length');
- Ember.propertyDidChange(this, '[]');
-
- return this ;
- }
-
-}) ;
-
-
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-// ..........................................................
-// HELPERS
-//
-
-var get = Ember.get, set = Ember.set, meta = Ember.meta, map = Ember.EnumerableUtils.map, cacheFor = Ember.cacheFor;
-
-/** @private */
-function none(obj) { return obj===null || obj===undefined; }
-
-// ..........................................................
-// ARRAY
-//
-/**
- @namespace
-
- This module implements Observer-friendly Array-like behavior. This mixin is
- picked up by the Array class as well as other controllers, etc. that want to
- appear to be arrays.
-
- Unlike Ember.Enumerable, this mixin defines methods specifically for
- collections that provide index-ordered access to their contents. When you
- are designing code that needs to accept any kind of Array-like object, you
- should use these methods instead of Array primitives because these will
- properly notify observers of changes to the array.
-
- Although these methods are efficient, they do add a layer of indirection to
- your application so it is a good idea to use them only when you need the
- flexibility of using both true JavaScript arrays and "virtual" arrays such
- as controllers and collections.
-
- You can use the methods defined in this module to access and modify array
- contents in a KVO-friendly way. You can also be notified whenever the
- membership if an array changes by changing the syntax of the property to
- .observes('*myProperty.[]') .
-
- To support Ember.Array in your own class, you must override two
- primitives to use it: replace() and objectAt().
-
- Note that the Ember.Array mixin also incorporates the Ember.Enumerable mixin. All
- Ember.Array-like objects are also enumerable.
-
- @extends Ember.Enumerable
- @since Ember 0.9.0
-*/
-Ember.Array = Ember.Mixin.create(Ember.Enumerable, /** @scope Ember.Array.prototype */ {
-
- /** @private - compatibility */
- isSCArray: true,
-
- /**
- @field {Number} length
-
- Your array must support the length property. Your replace methods should
- set this property whenever it changes.
- */
- length: Ember.required(),
-
- /**
- Returns the object at the given index. If the given index is negative or
- is greater or equal than the array length, returns `undefined`.
-
- This is one of the primitives you must implement to support `Ember.Array`.
- If your object supports retrieving the value of an array item using `get()`
- (i.e. `myArray.get(0)`), then you do not need to implement this method
- yourself.
-
- var arr = ['a', 'b', 'c', 'd'];
- arr.objectAt(0); => "a"
- arr.objectAt(3); => "d"
- arr.objectAt(-1); => undefined
- arr.objectAt(4); => undefined
- arr.objectAt(5); => undefined
-
- @param {Number} idx
- The index of the item to return.
- */
- objectAt: function(idx) {
- if ((idx < 0) || (idx>=get(this, 'length'))) return undefined ;
- return get(this, idx);
- },
-
- /**
- This returns the objects at the specified indexes, using `objectAt`.
-
- var arr = ['a', 'b', 'c', 'd'];
- arr.objectsAt([0, 1, 2]) => ["a", "b", "c"]
- arr.objectsAt([2, 3, 4]) => ["c", "d", undefined]
-
- @param {Array} indexes
- An array of indexes of items to return.
- */
- objectsAt: function(indexes) {
- var self = this;
- return map(indexes, function(idx){ return self.objectAt(idx); });
- },
-
- /** @private (nodoc) - overrides Ember.Enumerable version */
- nextObject: function(idx) {
- return this.objectAt(idx);
- },
-
- /**
- @field []
-
- This is the handler for the special array content property. If you get
- this property, it will return this. If you set this property it a new
- array, it will replace the current content.
-
- This property overrides the default property defined in Ember.Enumerable.
- */
- '[]': Ember.computed(function(key, value) {
- if (value !== undefined) this.replace(0, get(this, 'length'), value) ;
- return this ;
- }).property().cacheable(),
-
- firstObject: Ember.computed(function() {
- return this.objectAt(0);
- }).property().cacheable(),
-
- lastObject: Ember.computed(function() {
- return this.objectAt(get(this, 'length')-1);
- }).property().cacheable(),
-
- /** @private (nodoc) - optimized version from Enumerable */
- contains: function(obj){
- return this.indexOf(obj) >= 0;
- },
-
- // Add any extra methods to Ember.Array that are native to the built-in Array.
- /**
- Returns a new array that is a slice of the receiver. This implementation
- uses the observable array methods to retrieve the objects for the new
- slice.
-
- var arr = ['red', 'green', 'blue'];
- arr.slice(0); => ['red', 'green', 'blue']
- arr.slice(0, 2); => ['red', 'green']
- arr.slice(1, 100); => ['green', 'blue']
-
- @param beginIndex {Integer} (Optional) index to begin slicing from.
- @param endIndex {Integer} (Optional) index to end the slice at.
- @returns {Array} New array with specified slice
- */
- slice: function(beginIndex, endIndex) {
- var ret = [];
- var length = get(this, 'length') ;
- if (none(beginIndex)) beginIndex = 0 ;
- if (none(endIndex) || (endIndex > length)) endIndex = length ;
- while(beginIndex < endIndex) {
- ret[ret.length] = this.objectAt(beginIndex++) ;
- }
- return ret ;
- },
-
- /**
- Returns the index of the given object's first occurrence.
- If no startAt argument is given, the starting location to
- search is 0. If it's negative, will count backward from
- the end of the array. Returns -1 if no match is found.
-
- var arr = ["a", "b", "c", "d", "a"];
- arr.indexOf("a"); => 0
- arr.indexOf("z"); => -1
- arr.indexOf("a", 2); => 4
- arr.indexOf("a", -1); => 4
- arr.indexOf("b", 3); => -1
- arr.indexOf("a", 100); => -1
-
- @param {Object} object the item to search for
- @param {Number} startAt optional starting location to search, default 0
- @returns {Number} index or -1 if not found
- */
- indexOf: function(object, startAt) {
- var idx, len = get(this, 'length');
-
- if (startAt === undefined) startAt = 0;
- if (startAt < 0) startAt += len;
-
- for(idx=startAt;idx<len;idx++) {
- if (this.objectAt(idx, true) === object) return idx ;
- }
- return -1;
- },
-
- /**
- Returns the index of the given object's last occurrence.
- If no startAt argument is given, the search starts from
- the last position. If it's negative, will count backward
- from the end of the array. Returns -1 if no match is found.
-
- var arr = ["a", "b", "c", "d", "a"];
- arr.lastIndexOf("a"); => 4
- arr.lastIndexOf("z"); => -1
- arr.lastIndexOf("a", 2); => 0
- arr.lastIndexOf("a", -1); => 4
- arr.lastIndexOf("b", 3); => 1
- arr.lastIndexOf("a", 100); => 4
-
- @param {Object} object the item to search for
- @param {Number} startAt optional starting location to search, default 0
- @returns {Number} index or -1 if not found
- */
- lastIndexOf: function(object, startAt) {
- var idx, len = get(this, 'length');
-
- if (startAt === undefined || startAt >= len) startAt = len-1;
- if (startAt < 0) startAt += len;
-
- for(idx=startAt;idx>=0;idx--) {
- if (this.objectAt(idx) === object) return idx ;
- }
- return -1;
- },
-
- // ..........................................................
- // ARRAY OBSERVERS
- //
-
- /**
- Adds an array observer to the receiving array. The array observer object
- normally must implement two methods:
-
- * `arrayWillChange(start, removeCount, addCount)` - This method will be
- called just before the array is modified.
- * `arrayDidChange(start, removeCount, addCount)` - This method will be
- called just after the array is modified.
-
- Both callbacks will be passed the starting index of the change as well a
- a count of the items to be removed and added. You can use these callbacks
- to optionally inspect the array during the change, clear caches, or do
- any other bookkeeping necessary.
-
- In addition to passing a target, you can also include an options hash
- which you can use to override the method names that will be invoked on the
- target.
-
- @param {Object} target
- The observer object.
-
- @param {Hash} opts
- Optional hash of configuration options including willChange, didChange,
- and a context option.
-
- @returns {Ember.Array} receiver
- */
- addArrayObserver: function(target, opts) {
- var willChange = (opts && opts.willChange) || 'arrayWillChange',
- didChange = (opts && opts.didChange) || 'arrayDidChange';
-
- var hasObservers = get(this, 'hasArrayObservers');
- if (!hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');
- Ember.addListener(this, '@array:before', target, willChange);
- Ember.addListener(this, '@array:change', target, didChange);
- if (!hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');
- return this;
- },
-
- /**
- Removes an array observer from the object if the observer is current
- registered. Calling this method multiple times with the same object will
- have no effect.
-
- @param {Object} target
- The object observing the array.
-
- @returns {Ember.Array} receiver
- */
- removeArrayObserver: function(target, opts) {
- var willChange = (opts && opts.willChange) || 'arrayWillChange',
- didChange = (opts && opts.didChange) || 'arrayDidChange';
-
- var hasObservers = get(this, 'hasArrayObservers');
- if (hasObservers) Ember.propertyWillChange(this, 'hasArrayObservers');
- Ember.removeListener(this, '@array:before', target, willChange);
- Ember.removeListener(this, '@array:change', target, didChange);
- if (hasObservers) Ember.propertyDidChange(this, 'hasArrayObservers');
- return this;
- },
-
- /**
- Becomes true whenever the array currently has observers watching changes
- on the array.
-
- @type Boolean
- */
- hasArrayObservers: Ember.computed(function() {
- return Ember.hasListeners(this, '@array:change') || Ember.hasListeners(this, '@array:before');
- }).property().cacheable(),
-
- /**
- If you are implementing an object that supports Ember.Array, call this
- method just before the array content changes to notify any observers and
- invalidate any related properties. Pass the starting index of the change
- as well as a delta of the amounts to change.
-
- @param {Number} startIdx
- The starting index in the array that will change.
-
- @param {Number} removeAmt
- The number of items that will be removed. If you pass null assumes 0
-
- @param {Number} addAmt
- The number of items that will be added. If you pass null assumes 0.
-
- @returns {Ember.Array} receiver
- */
- arrayContentWillChange: function(startIdx, removeAmt, addAmt) {
-
- // if no args are passed assume everything changes
- if (startIdx===undefined) {
- startIdx = 0;
- removeAmt = addAmt = -1;
- } else {
- if (removeAmt === undefined) removeAmt=-1;
- if (addAmt === undefined) addAmt=-1;
- }
-
- // Make sure the @each proxy is set up if anyone is observing @each
- if (Ember.isWatching(this, '@each')) { get(this, '@each'); }
-
- Ember.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);
-
- var removing, lim;
- if (startIdx>=0 && removeAmt>=0 && get(this, 'hasEnumerableObservers')) {
- removing = [];
- lim = startIdx+removeAmt;
- for(var idx=startIdx;idx<lim;idx++) removing.push(this.objectAt(idx));
- } else {
- removing = removeAmt;
- }
-
- this.enumerableContentWillChange(removing, addAmt);
-
- return this;
- },
-
- arrayContentDidChange: function(startIdx, removeAmt, addAmt) {
-
- // if no args are passed assume everything changes
- if (startIdx===undefined) {
- startIdx = 0;
- removeAmt = addAmt = -1;
- } else {
- if (removeAmt === undefined) removeAmt=-1;
- if (addAmt === undefined) addAmt=-1;
- }
-
- var adding, lim;
- if (startIdx>=0 && addAmt>=0 && get(this, 'hasEnumerableObservers')) {
- adding = [];
- lim = startIdx+addAmt;
- for(var idx=startIdx;idx<lim;idx++) adding.push(this.objectAt(idx));
- } else {
- adding = addAmt;
- }
-
- this.enumerableContentDidChange(removeAmt, adding);
- Ember.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);
-
- var length = get(this, 'length'),
- cachedFirst = cacheFor(this, 'firstObject'),
- cachedLast = cacheFor(this, 'lastObject');
- if (this.objectAt(0) !== cachedFirst) {
- Ember.propertyWillChange(this, 'firstObject');
- Ember.propertyDidChange(this, 'firstObject');
- }
- if (this.objectAt(length-1) !== cachedLast) {
- Ember.propertyWillChange(this, 'lastObject');
- Ember.propertyDidChange(this, 'lastObject');
- }
-
- return this;
- },
-
- // ..........................................................
- // ENUMERATED PROPERTIES
- //
-
- /**
- Returns a special object that can be used to observe individual properties
- on the array. Just get an equivalent property on this object and it will
- return an enumerable that maps automatically to the named key on the
- member objects.
- */
- '@each': Ember.computed(function() {
- if (!this.__each) this.__each = new Ember.EachProxy(this);
- return this.__each;
- }).property().cacheable()
-
-}) ;
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/**
- @namespace
-
- Implements some standard methods for comparing objects. Add this mixin to
- any class you create that can compare its instances.
-
- You should implement the compare() method.
-
- @extends Ember.Mixin
- @since Ember 0.9
-*/
-Ember.Comparable = Ember.Mixin.create( /** @scope Ember.Comparable.prototype */{
-
- /**
- walk like a duck. Indicates that the object can be compared.
-
- @type Boolean
- @default true
- @constant
- */
- isComparable: true,
-
- /**
- Override to return the result of the comparison of the two parameters. The
- compare method should return:
-
- - `-1` if `a < b`
- - `0` if `a == b`
- - `1` if `a > b`
-
- Default implementation raises an exception.
-
- @param a {Object} the first object to compare
- @param b {Object} the second object to compare
- @returns {Integer} the result of the comparison
- */
- compare: Ember.required(Function)
-
-});
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2010 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-/**
- @namespace
-
- Implements some standard methods for copying an object. Add this mixin to
- any object you create that can create a copy of itself. This mixin is
- added automatically to the built-in array.
-
- You should generally implement the copy() method to return a copy of the
- receiver.
-
- Note that frozenCopy() will only work if you also implement Ember.Freezable.
-
- @extends Ember.Mixin
- @since Ember 0.9
-*/
-Ember.Copyable = Ember.Mixin.create(
-/** @scope Ember.Copyable.prototype */ {
-
- /**
- Override to return a copy of the receiver. Default implementation raises
- an exception.
-
- @function
- @param deep {Boolean} if true, a deep copy of the object should be made
- @returns {Object} copy of receiver
- */
- copy: Ember.required(Function),
-
- /**
- If the object implements Ember.Freezable, then this will return a new copy
- if the object is not frozen and the receiver if the object is frozen.
-
- Raises an exception if you try to call this method on a object that does
- not support freezing.
-
- You should use this method whenever you want a copy of a freezable object
- since a freezable object can simply return itself without actually
- consuming more memory.
-
- @returns {Object} copy of receiver or receiver
- */
- frozenCopy: function() {
- if (Ember.Freezable && Ember.Freezable.detect(this)) {
- return get(this, 'isFrozen') ? this : this.copy().freeze();
- } else {
- throw new Error(Ember.String.fmt("%@ does not support freezing", [this]));
- }
- }
-});
-
-
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2010 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-
-
-
-
-var get = Ember.get, set = Ember.set;
-
-/**
- @namespace
-
- The Ember.Freezable mixin implements some basic methods for marking an object
- as frozen. Once an object is frozen it should be read only. No changes
- may be made the internal state of the object.
-
- ## Enforcement
-
- To fully support freezing in your subclass, you must include this mixin and
- override any method that might alter any property on the object to instead
- raise an exception. You can check the state of an object by checking the
- isFrozen property.
-
- Although future versions of JavaScript may support language-level freezing
- object objects, that is not the case today. Even if an object is freezable,
- it is still technically possible to modify the object, even though it could
- break other parts of your application that do not expect a frozen object to
- change. It is, therefore, very important that you always respect the
- isFrozen property on all freezable objects.
-
- ## Example Usage
-
- The example below shows a simple object that implement the Ember.Freezable
- protocol.
-
- Contact = Ember.Object.extend(Ember.Freezable, {
-
- firstName: null,
-
- lastName: null,
-
- // swaps the names
- swapNames: function() {
- if (this.get('isFrozen')) throw Ember.FROZEN_ERROR;
- var tmp = this.get('firstName');
- this.set('firstName', this.get('lastName'));
- this.set('lastName', tmp);
- return this;
- }
-
- });
-
- c = Context.create({ firstName: "John", lastName: "Doe" });
- c.swapNames(); => returns c
- c.freeze();
- c.swapNames(); => EXCEPTION
-
- ## Copying
-
- Usually the Ember.Freezable protocol is implemented in cooperation with the
- Ember.Copyable protocol, which defines a frozenCopy() method that will return
- a frozen object, if the object implements this method as well.
-
- @extends Ember.Mixin
- @since Ember 0.9
-*/
-Ember.Freezable = Ember.Mixin.create(
-/** @scope Ember.Freezable.prototype */ {
-
- /**
- Set to true when the object is frozen. Use this property to detect whether
- your object is frozen or not.
-
- @type Boolean
- */
- isFrozen: false,
-
- /**
- Freezes the object. Once this method has been called the object should
- no longer allow any properties to be edited.
-
- @returns {Object} receiver
- */
- freeze: function() {
- if (get(this, 'isFrozen')) return this;
- set(this, 'isFrozen', true);
- return this;
- }
-
-});
-
-Ember.FROZEN_ERROR = "Frozen object cannot be modified.";
-
-
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var forEach = Ember.EnumerableUtils.forEach;
-
-/**
- @class
-
- This mixin defines the API for modifying generic enumerables. These methods
- can be applied to an object regardless of whether it is ordered or
- unordered.
-
- Note that an Enumerable can change even if it does not implement this mixin.
- For example, a MappedEnumerable cannot be directly modified but if its
- underlying enumerable changes, it will change also.
-
- ## Adding Objects
-
- To add an object to an enumerable, use the addObject() method. This
- method will only add the object to the enumerable if the object is not
- already present and the object if of a type supported by the enumerable.
-
- set.addObject(contact);
-
- ## Removing Objects
-
- To remove an object form an enumerable, use the removeObject() method. This
- will only remove the object if it is already in the enumerable, otherwise
- this method has no effect.
-
- set.removeObject(contact);
-
- ## Implementing In Your Own Code
-
- If you are implementing an object and want to support this API, just include
- this mixin in your class and implement the required methods. In your unit
- tests, be sure to apply the Ember.MutableEnumerableTests to your object.
-
- @extends Ember.Mixin
- @extends Ember.Enumerable
-*/
-Ember.MutableEnumerable = Ember.Mixin.create(Ember.Enumerable,
- /** @scope Ember.MutableEnumerable.prototype */ {
-
- /**
- __Required.__ You must implement this method to apply this mixin.
-
- Attempts to add the passed object to the receiver if the object is not
- already present in the collection. If the object is present, this method
- has no effect.
-
- If the passed object is of a type not supported by the receiver
- then this method should raise an exception.
-
- @function
-
- @param {Object} object
- The object to add to the enumerable.
-
- @returns {Object} the passed object
- */
- addObject: Ember.required(Function),
-
- /**
- Adds each object in the passed enumerable to the receiver.
-
- @param {Ember.Enumerable} objects the objects to add.
- @returns {Object} receiver
- */
- addObjects: function(objects) {
- Ember.beginPropertyChanges(this);
- forEach(objects, function(obj) { this.addObject(obj); }, this);
- Ember.endPropertyChanges(this);
- return this;
- },
-
- /**
- __Required.__ You must implement this method to apply this mixin.
-
- Attempts to remove the passed object from the receiver collection if the
- object is in present in the collection. If the object is not present,
- this method has no effect.
-
- If the passed object is of a type not supported by the receiver
- then this method should raise an exception.
-
- @function
-
- @param {Object} object
- The object to remove from the enumerable.
-
- @returns {Object} the passed object
- */
- removeObject: Ember.required(Function),
-
-
- /**
- Removes each objects in the passed enumerable from the receiver.
-
- @param {Ember.Enumerable} objects the objects to remove
- @returns {Object} receiver
- */
- removeObjects: function(objects) {
- Ember.beginPropertyChanges(this);
- forEach(objects, function(obj) { this.removeObject(obj); }, this);
- Ember.endPropertyChanges(this);
- return this;
- }
-
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-// ..........................................................
-// CONSTANTS
-//
-
-var OUT_OF_RANGE_EXCEPTION = "Index out of range" ;
-var EMPTY = [];
-
-// ..........................................................
-// HELPERS
-//
-
-var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;
-
-/**
- @class
-
- This mixin defines the API for modifying array-like objects. These methods
- can be applied only to a collection that keeps its items in an ordered set.
-
- Note that an Array can change even if it does not implement this mixin.
- For example, one might implement a SparseArray that cannot be directly
- modified, but if its underlying enumerable changes, it will change also.
-
- @extends Ember.Mixin
- @extends Ember.Array
- @extends Ember.MutableEnumerable
-*/
-Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
- /** @scope Ember.MutableArray.prototype */ {
-
- /**
- __Required.__ You must implement this method to apply this mixin.
-
- This is one of the primitives you must implement to support Ember.Array. You
- should replace amt objects started at idx with the objects in the passed
- array. You should also call this.enumerableContentDidChange() ;
-
- @function
-
- @param {Number} idx
- Starting index in the array to replace. If idx >= length, then append
- to the end of the array.
-
- @param {Number} amt
- Number of elements that should be removed from the array, starting at
- *idx*.
-
- @param {Array} objects
- An array of zero or more objects that should be inserted into the array
- at *idx*
- */
- replace: Ember.required(),
-
- /**
- Remove all elements from self. This is useful if you
- want to reuse an existing array without having to recreate it.
-
- var colors = ["red", "green", "blue"];
- color.length(); => 3
- colors.clear(); => []
- colors.length(); => 0
-
- @returns {Ember.Array} An empty Array.
- */
- clear: function () {
- var len = get(this, 'length');
- if (len === 0) return this;
- this.replace(0, len, EMPTY);
- return this;
- },
-
- /**
- This will use the primitive replace() method to insert an object at the
- specified index.
-
- var colors = ["red", "green", "blue"];
- colors.insertAt(2, "yellow"); => ["red", "green", "yellow", "blue"]
- colors.insertAt(5, "orange"); => Error: Index out of range
-
- @param {Number} idx index of insert the object at.
- @param {Object} object object to insert
- */
- insertAt: function(idx, object) {
- if (idx > get(this, 'length')) throw new Error(OUT_OF_RANGE_EXCEPTION) ;
- this.replace(idx, 0, [object]) ;
- return this ;
- },
-
- /**
- Remove an object at the specified index using the replace() primitive
- method. You can pass either a single index, or a start and a length.
-
- If you pass a start and length that is beyond the
- length this method will throw an Ember.OUT_OF_RANGE_EXCEPTION
-
- var colors = ["red", "green", "blue", "yellow", "orange"];
- colors.removeAt(0); => ["green", "blue", "yellow", "orange"]
- colors.removeAt(2, 2); => ["green", "blue"]
- colors.removeAt(4, 2); => Error: Index out of range
-
- @param {Number} start index, start of range
- @param {Number} len length of passing range
- @returns {Object} receiver
- */
- removeAt: function(start, len) {
-
- var delta = 0;
-
- if ('number' === typeof start) {
-
- if ((start < 0) || (start >= get(this, 'length'))) {
- throw new Error(OUT_OF_RANGE_EXCEPTION);
- }
-
- // fast case
- if (len === undefined) len = 1;
- this.replace(start, len, EMPTY);
- }
-
- return this ;
- },
-
- /**
- Push the object onto the end of the array. Works just like push() but it
- is KVO-compliant.
-
- var colors = ["red", "green", "blue"];
- colors.pushObject("black"); => ["red", "green", "blue", "black"]
- colors.pushObject(["yellow", "orange"]); => ["red", "green", "blue", "black", ["yellow", "orange"]]
-
- */
- pushObject: function(obj) {
- this.insertAt(get(this, 'length'), obj) ;
- return obj ;
- },
-
- /**
- Add the objects in the passed numerable to the end of the array. Defers
- notifying observers of the change until all objects are added.
-
- var colors = ["red", "green", "blue"];
- colors.pushObjects("black"); => ["red", "green", "blue", "black"]
- colors.pushObjects(["yellow", "orange"]); => ["red", "green", "blue", "black", "yellow", "orange"]
-
- @param {Ember.Enumerable} objects the objects to add
- @returns {Ember.Array} receiver
- */
- pushObjects: function(objects) {
- this.replace(get(this, 'length'), 0, objects);
- return this;
- },
-
- /**
- Pop object from array or nil if none are left. Works just like pop() but
- it is KVO-compliant.
-
- var colors = ["red", "green", "blue"];
- colors.popObject(); => "blue"
- console.log(colors); => ["red", "green"]
-
- */
- popObject: function() {
- var len = get(this, 'length') ;
- if (len === 0) return null ;
-
- var ret = this.objectAt(len-1) ;
- this.removeAt(len-1, 1) ;
- return ret ;
- },
-
- /**
- Shift an object from start of array or nil if none are left. Works just
- like shift() but it is KVO-compliant.
-
- var colors = ["red", "green", "blue"];
- colors.shiftObject(); => "red"
- console.log(colors); => ["green", "blue"]
-
- */
- shiftObject: function() {
- if (get(this, 'length') === 0) return null ;
- var ret = this.objectAt(0) ;
- this.removeAt(0) ;
- return ret ;
- },
-
- /**
- Unshift an object to start of array. Works just like unshift() but it is
- KVO-compliant.
-
- var colors = ["red", "green", "blue"];
- colors.unshiftObject("yellow"); => ["yellow", "red", "green", "blue"]
- colors.unshiftObject(["black", "white"]); => [["black", "white"], "yellow", "red", "green", "blue"]
-
- */
- unshiftObject: function(obj) {
- this.insertAt(0, obj) ;
- return obj ;
- },
-
- /**
- Adds the named objects to the beginning of the array. Defers notifying
- observers until all objects have been added.
-
- var colors = ["red", "green", "blue"];
- colors.unshiftObjects(["black", "white"]); => ["black", "white", "red", "green", "blue"]
- colors.unshiftObjects("yellow"); => Type Error: 'undefined' is not a function
-
- @param {Ember.Enumerable} objects the objects to add
- @returns {Ember.Array} receiver
- */
- unshiftObjects: function(objects) {
- this.replace(0, 0, objects);
- return this;
- },
-
- /**
- Reverse objects in the array. Works just like reverse() but it is
- KVO-compliant.
-
- @return {Ember.Array} receiver
- */
- reverseObjects: function() {
- var len = get(this, 'length');
- if (len === 0) return this;
- var objects = this.toArray().reverse();
- this.replace(0, len, objects);
- return this;
- },
-
- // ..........................................................
- // IMPLEMENT Ember.MutableEnumerable
- //
-
- /** @private (nodoc) */
- removeObject: function(obj) {
- var loc = get(this, 'length') || 0;
- while(--loc >= 0) {
- var curObject = this.objectAt(loc) ;
- if (curObject === obj) this.removeAt(loc) ;
- }
- return this ;
- },
-
- /** @private (nodoc) */
- addObject: function(obj) {
- if (!this.contains(obj)) this.pushObject(obj);
- return this ;
- }
-
-});
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
-
-/**
- @class
-
- ## Overview
-
- This mixin provides properties and property observing functionality, core
- features of the Ember object model.
-
- Properties and observers allow one object to observe changes to a
- property on another object. This is one of the fundamental ways that
- models, controllers and views communicate with each other in an Ember
- application.
-
- Any object that has this mixin applied can be used in observer
- operations. That includes Ember.Object and most objects you will
- interact with as you write your Ember application.
-
- Note that you will not generally apply this mixin to classes yourself,
- but you will use the features provided by this module frequently, so it
- is important to understand how to use it.
-
- ## Using get() and set()
-
- Because of Ember's support for bindings and observers, you will always
- access properties using the get method, and set properties using the
- set method. This allows the observing objects to be notified and
- computed properties to be handled properly.
-
- More documentation about `get` and `set` are below.
-
- ## Observing Property Changes
-
- You typically observe property changes simply by adding the `observes`
- call to the end of your method declarations in classes that you write.
- For example:
-
- Ember.Object.create({
- valueObserver: function() {
- // Executes whenever the "value" property changes
- }.observes('value')
- });
-
- Although this is the most common way to add an observer, this capability
- is actually built into the Ember.Object class on top of two methods
- defined in this mixin: `addObserver` and `removeObserver`. You can use
- these two methods to add and remove observers yourself if you need to
- do so at runtime.
-
- To add an observer for a property, call:
-
- object.addObserver('propertyKey', targetObject, targetAction)
-
- This will call the `targetAction` method on the `targetObject` to be called
- whenever the value of the `propertyKey` changes.
-
- Note that if `propertyKey` is a computed property, the observer will be
- called when any of the property dependencies are changed, even if the
- resulting value of the computed property is unchanged. This is necessary
- because computed properties are not computed until `get` is called.
-
- @extends Ember.Mixin
-*/
-Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
-
- /** @private - compatibility */
- isObserverable: true,
-
- /**
- Retrieves the value of a property from the object.
-
- This method is usually similar to using object[keyName] or object.keyName,
- however it supports both computed properties and the unknownProperty
- handler.
-
- Because `get` unifies the syntax for accessing all these kinds
- of properties, it can make many refactorings easier, such as replacing a
- simple property with a computed property, or vice versa.
-
- ### Computed Properties
-
- Computed properties are methods defined with the `property` modifier
- declared at the end, such as:
-
- fullName: function() {
- return this.getEach('firstName', 'lastName').compact().join(' ');
- }.property('firstName', 'lastName')
-
- When you call `get` on a computed property, the function will be
- called and the return value will be returned instead of the function
- itself.
-
- ### Unknown Properties
-
- Likewise, if you try to call `get` on a property whose value is
- undefined, the unknownProperty() method will be called on the object.
- If this method returns any value other than undefined, it will be returned
- instead. This allows you to implement "virtual" properties that are
- not defined upfront.
-
- @param {String} key The property to retrieve
- @returns {Object} The property value or undefined.
- */
- get: function(keyName) {
- return get(this, keyName);
- },
-
- /**
- To get multiple properties at once, call getProperties
- with a list of strings or an array:
-
- record.getProperties('firstName', 'lastName', 'zipCode'); // => { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
-
- is equivalent to:
-
- record.getProperties(['firstName', 'lastName', 'zipCode']); // => { firstName: 'John', lastName: 'Doe', zipCode: '10011' }
-
- @param {String...|Array} list of keys to get
- @returns {Hash}
- */
- getProperties: function() {
- var ret = {};
- var propertyNames = arguments;
- if (arguments.length === 1 && Ember.typeOf(arguments[0]) === 'array') {
- propertyNames = arguments[0];
- }
- for(var i = 0; i < propertyNames.length; i++) {
- ret[propertyNames[i]] = get(this, propertyNames[i]);
- }
- return ret;
- },
-
- /**
- Sets the provided key or path to the value.
-
- This method is generally very similar to calling object[key] = value or
- object.key = value, except that it provides support for computed
- properties, the unknownProperty() method and property observers.
-
- ### Computed Properties
-
- If you try to set a value on a key that has a computed property handler
- defined (see the get() method for an example), then set() will call
- that method, passing both the value and key instead of simply changing
- the value itself. This is useful for those times when you need to
- implement a property that is composed of one or more member
- properties.
-
- ### Unknown Properties
-
- If you try to set a value on a key that is undefined in the target
- object, then the unknownProperty() handler will be called instead. This
- gives you an opportunity to implement complex "virtual" properties that
- are not predefined on the object. If unknownProperty() returns
- undefined, then set() will simply set the value on the object.
-
- ### Property Observers
-
- In addition to changing the property, set() will also register a
- property change with the object. Unless you have placed this call
- inside of a beginPropertyChanges() and endPropertyChanges(), any "local"
- observers (i.e. observer methods declared on the same object), will be
- called immediately. Any "remote" observers (i.e. observer methods
- declared on another object) will be placed in a queue and called at a
- later time in a coalesced manner.
-
- ### Chaining
-
- In addition to property changes, set() returns the value of the object
- itself so you can do chaining like this:
-
- record.set('firstName', 'Charles').set('lastName', 'Jolley');
-
- @param {String} key The property to set
- @param {Object} value The value to set or null.
- @returns {Ember.Observable}
- */
- set: function(keyName, value) {
- set(this, keyName, value);
- return this;
- },
-
- /**
- To set multiple properties at once, call setProperties
- with a Hash:
-
- record.setProperties({ firstName: 'Charles', lastName: 'Jolley' });
-
- @param {Hash} hash the hash of keys and values to set
- @returns {Ember.Observable}
- */
- setProperties: function(hash) {
- return Ember.setProperties(this, hash);
- },
-
- /**
- Begins a grouping of property changes.
-
- You can use this method to group property changes so that notifications
- will not be sent until the changes are finished. If you plan to make a
- large number of changes to an object at one time, you should call this
- method at the beginning of the changes to begin deferring change
- notifications. When you are done making changes, call endPropertyChanges()
- to deliver the deferred change notifications and end deferring.
-
- @returns {Ember.Observable}
- */
- beginPropertyChanges: function() {
- Ember.beginPropertyChanges();
- return this;
- },
-
- /**
- Ends a grouping of property changes.
-
- You can use this method to group property changes so that notifications
- will not be sent until the changes are finished. If you plan to make a
- large number of changes to an object at one time, you should call
- beginPropertyChanges() at the beginning of the changes to defer change
- notifications. When you are done making changes, call this method to
- deliver the deferred change notifications and end deferring.
-
- @returns {Ember.Observable}
- */
- endPropertyChanges: function() {
- Ember.endPropertyChanges();
- return this;
- },
-
- /**
- Notify the observer system that a property is about to change.
-
- Sometimes you need to change a value directly or indirectly without
- actually calling get() or set() on it. In this case, you can use this
- method and propertyDidChange() instead. Calling these two methods
- together will notify all observers that the property has potentially
- changed value.
-
- Note that you must always call propertyWillChange and propertyDidChange as
- a pair. If you do not, it may get the property change groups out of order
- and cause notifications to be delivered more often than you would like.
-
- @param {String} key The property key that is about to change.
- @returns {Ember.Observable}
- */
- propertyWillChange: function(keyName){
- Ember.propertyWillChange(this, keyName);
- return this;
- },
-
- /**
- Notify the observer system that a property has just changed.
-
- Sometimes you need to change a value directly or indirectly without
- actually calling get() or set() on it. In this case, you can use this
- method and propertyWillChange() instead. Calling these two methods
- together will notify all observers that the property has potentially
- changed value.
-
- Note that you must always call propertyWillChange and propertyDidChange as
- a pair. If you do not, it may get the property change groups out of order
- and cause notifications to be delivered more often than you would like.
-
- @param {String} keyName The property key that has just changed.
- @returns {Ember.Observable}
- */
- propertyDidChange: function(keyName) {
- Ember.propertyDidChange(this, keyName);
- return this;
- },
-
- /**
- Convenience method to call `propertyWillChange` and `propertyDidChange` in
- succession.
-
- @param {String} keyName The property key to be notified about.
- @returns {Ember.Observable}
- */
- notifyPropertyChange: function(keyName) {
- this.propertyWillChange(keyName);
- this.propertyDidChange(keyName);
- return this;
- },
-
- addBeforeObserver: function(key, target, method) {
- Ember.addBeforeObserver(this, key, target, method);
- },
-
- /**
- Adds an observer on a property.
-
- This is the core method used to register an observer for a property.
-
- Once you call this method, anytime the key's value is set, your observer
- will be notified. Note that the observers are triggered anytime the
- value is set, regardless of whether it has actually changed. Your
- observer should be prepared to handle that.
-
- You can also pass an optional context parameter to this method. The
- context will be passed to your observer method whenever it is triggered.
- Note that if you add the same target/method pair on a key multiple times
- with different context parameters, your observer will only be called once
- with the last context you passed.
-
- ### Observer Methods
-
- Observer methods you pass should generally have the following signature if
- you do not pass a "context" parameter:
-
- fooDidChange: function(sender, key, value, rev);
-
- The sender is the object that changed. The key is the property that
- changes. The value property is currently reserved and unused. The rev
- is the last property revision of the object when it changed, which you can
- use to detect if the key value has really changed or not.
-
- If you pass a "context" parameter, the context will be passed before the
- revision like so:
-
- fooDidChange: function(sender, key, value, context, rev);
-
- Usually you will not need the value, context or revision parameters at
- the end. In this case, it is common to write observer methods that take
- only a sender and key value as parameters or, if you aren't interested in
- any of these values, to write an observer that has no parameters at all.
-
- @param {String} key The key to observer
- @param {Object} target The target object to invoke
- @param {String|Function} method The method to invoke.
- @returns {Ember.Object} self
- */
- addObserver: function(key, target, method) {
- Ember.addObserver(this, key, target, method);
- },
-
- /**
- Remove an observer you have previously registered on this object. Pass
- the same key, target, and method you passed to addObserver() and your
- target will no longer receive notifications.
-
- @param {String} key The key to observer
- @param {Object} target The target object to invoke
- @param {String|Function} method The method to invoke.
- @returns {Ember.Observable} receiver
- */
- removeObserver: function(key, target, method) {
- Ember.removeObserver(this, key, target, method);
- },
-
- /**
- Returns true if the object currently has observers registered for a
- particular key. You can use this method to potentially defer performing
- an expensive action until someone begins observing a particular property
- on the object.
-
- @param {String} key Key to check
- @returns {Boolean}
- */
- hasObserverFor: function(key) {
- return Ember.hasListeners(this, key+':change');
- },
-
- /**
- This method will be called when a client attempts to get the value of a
- property that has not been defined in one of the typical ways. Override
- this method to create "virtual" properties.
-
- @param {String} key The name of the unknown property that was requested.
- @returns {Object} The property value or undefined. Default is undefined.
- */
- unknownProperty: function(key) {
- return undefined;
- },
-
- /**
- This method will be called when a client attempts to set the value of a
- property that has not been defined in one of the typical ways. Override
- this method to create "virtual" properties.
-
- @param {String} key The name of the unknown property to be set.
- @param {Object} value The value the unknown property is to be set to.
- */
- setUnknownProperty: function(key, value) {
- defineProperty(this, key);
- set(this, key, value);
- },
-
- /**
- @deprecated
- @param {String} path The property path to retrieve
- @returns {Object} The property value or undefined.
- */
- getPath: function(path) {
- Ember.deprecate("getPath is deprecated since get now supports paths");
- return this.get(path);
- },
-
- /**
- @deprecated
- @param {String} path The path to the property that will be set
- @param {Object} value The value to set or null.
- @returns {Ember.Observable}
- */
- setPath: function(path, value) {
- Ember.deprecate("setPath is deprecated since set now supports paths");
- return this.set(path, value);
- },
-
- /**
- Retrieves the value of a property, or a default value in the case that the property
- returns undefined.
-
- person.getWithDefault('lastName', 'Doe');
-
- @param {String} keyName The name of the property to retrieve
- @param {Object} defaultValue The value to return if the property value is undefined
- @returns {Object} The property value or the defaultValue.
- */
- getWithDefault: function(keyName, defaultValue) {
- return Ember.getWithDefault(this, keyName, defaultValue);
- },
-
- /**
- Set the value of a property to the current value plus some amount.
-
- person.incrementProperty('age');
- team.incrementProperty('score', 2);
-
- @param {String} keyName The name of the property to increment
- @param {Object} increment The amount to increment by. Defaults to 1
- @returns {Object} The new property value
- */
- incrementProperty: function(keyName, increment) {
- if (!increment) { increment = 1; }
- set(this, keyName, (get(this, keyName) || 0)+increment);
- return get(this, keyName);
- },
-
- /**
- Set the value of a property to the current value minus some amount.
-
- player.decrementProperty('lives');
- orc.decrementProperty('health', 5);
-
- @param {String} keyName The name of the property to decrement
- @param {Object} increment The amount to decrement by. Defaults to 1
- @returns {Object} The new property value
- */
- decrementProperty: function(keyName, increment) {
- if (!increment) { increment = 1; }
- set(this, keyName, (get(this, keyName) || 0)-increment);
- return get(this, keyName);
- },
-
- /**
- Set the value of a boolean property to the opposite of it's
- current value.
-
- starship.toggleProperty('warpDriveEnaged');
-
- @param {String} keyName The name of the property to toggle
- @returns {Object} The new property value
- */
- toggleProperty: function(keyName) {
- set(this, keyName, !get(this, keyName));
- return get(this, keyName);
- },
-
- /**
- Returns the cached value of a computed property, if it exists.
- This allows you to inspect the value of a computed property
- without accidentally invoking it if it is intended to be
- generated lazily.
-
- @param {String} keyName
- @returns {Object} The cached value of the computed property, if any
- */
- cacheFor: function(keyName) {
- return Ember.cacheFor(this, keyName);
- },
-
- /** @private - intended for debugging purposes */
- observersForKey: function(keyName) {
- return Ember.observersFor(this, keyName);
- }
-});
-
-
-
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-Ember.TargetActionSupport = Ember.Mixin.create({
- target: null,
- action: null,
-
- targetObject: Ember.computed(function() {
- var target = get(this, 'target');
-
- if (Ember.typeOf(target) === "string") {
- var value = get(this, target);
- if (value === undefined) { value = get(window, target); }
- return value;
- } else {
- return target;
- }
- }).property('target').cacheable(),
-
- triggerAction: function() {
- var action = get(this, 'action'),
- target = get(this, 'targetObject');
-
- if (target && action) {
- var ret;
-
- if (typeof target.send === 'function') {
- ret = target.send(action, this);
- } else {
- if (typeof action === 'string') {
- action = target[action];
- }
- ret = action.call(target, this);
- }
- if (ret !== false) ret = true;
-
- return ret;
- } else {
- return false;
- }
- }
-});
-
-})();
-
-
-
-(function() {
-/**
- @class
-
- @extends Ember.Mixin
- */
-Ember.Evented = Ember.Mixin.create(
- /** @scope Ember.Evented.prototype */ {
- on: function(name, target, method) {
- Ember.addListener(this, name, target, method);
- },
-
- one: function(name, target, method) {
- if (!method) {
- method = target;
- target = null;
- }
-
- var self = this;
- var wrapped = function() {
- Ember.removeListener(self, name, target, wrapped);
-
- if ('string' === typeof method) { method = this[method]; }
-
- // Internally, a `null` target means that the target is
- // the first parameter to addListener. That means that
- // the `this` passed into this function is the target
- // determined by the event system.
- method.apply(this, arguments);
- };
-
- this.on(name, target, wrapped);
- },
-
- trigger: function(name) {
- var args = [], i, l;
- for (i = 1, l = arguments.length; i < l; i++) {
- args.push(arguments[i]);
- }
- Ember.sendEvent(this, name, args);
- },
-
- fire: function(name) {
- Ember.deprecate("Ember.Evented#fire() has been deprecated in favor of trigger() for compatibility with jQuery. It will be removed in 1.0. Please update your code to call trigger() instead.");
- this.trigger.apply(this, arguments);
- },
-
- off: function(name, target, method) {
- Ember.removeListener(this, name, target, method);
- },
-
- has: function(name) {
- return Ember.hasListeners(this, name);
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-
-
-// NOTE: this object should never be included directly. Instead use Ember.
-// Ember.Object. We only define this separately so that Ember.Set can depend on it
-
-
-
-var classToString = Ember.Mixin.prototype.toString;
-var set = Ember.set, get = Ember.get;
-var o_create = Ember.create,
- o_defineProperty = Ember.platform.defineProperty,
- a_slice = Array.prototype.slice,
- meta = Ember.meta,
- rewatch = Ember.rewatch,
- finishChains = Ember.finishChains,
- finishPartial = Ember.Mixin.finishPartial,
- reopen = Ember.Mixin.prototype.reopen;
-
-var undefinedDescriptor = {
- configurable: true,
- writable: true,
- enumerable: false,
- value: undefined
-};
-
-/** @private */
-function makeCtor() {
-
- // Note: avoid accessing any properties on the object since it makes the
- // method a lot faster. This is glue code so we want it to be as fast as
- // possible.
-
- var wasApplied = false, initMixins;
-
- var Class = function() {
- if (!wasApplied) {
- Class.proto(); // prepare prototype...
- }
- var m = Ember.meta(this);
- m.proto = this;
- if (initMixins) {
- this.reopen.apply(this, initMixins);
- initMixins = null;
- }
- o_defineProperty(this, Ember.GUID_KEY, undefinedDescriptor);
- o_defineProperty(this, '_super', undefinedDescriptor);
- finishPartial(this, m);
- delete m.proto;
- finishChains(this);
- this.init.apply(this, arguments);
- };
-
- Class.toString = classToString;
- Class.willReopen = function() {
- if (wasApplied) {
- Class.PrototypeMixin = Ember.Mixin.create(Class.PrototypeMixin);
- }
-
- wasApplied = false;
- };
- Class._initMixins = function(args) { initMixins = args; };
-
- Class.proto = function() {
- var superclass = Class.superclass;
- if (superclass) { superclass.proto(); }
-
- if (!wasApplied) {
- wasApplied = true;
- Class.PrototypeMixin.applyPartial(Class.prototype);
- rewatch(Class.prototype);
- }
-
- return this.prototype;
- };
-
- return Class;
-
-}
-
-var CoreObject = makeCtor();
-
-CoreObject.PrototypeMixin = Ember.Mixin.create(
-/** @scope Ember.CoreObject.prototype */ {
-
- reopen: function() {
- Ember.Mixin._apply(this, arguments, true);
- return this;
- },
-
- isInstance: true,
-
- /** @private */
- init: function() {},
-
- /** @field */
- isDestroyed: false,
-
- /** @field */
- isDestroying: false,
-
- /**
- Destroys an object by setting the isDestroyed flag and removing its
- metadata, which effectively destroys observers and bindings.
-
- If you try to set a property on a destroyed object, an exception will be
- raised.
-
- Note that destruction is scheduled for the end of the run loop and does not
- happen immediately.
-
- @returns {Ember.Object} receiver
- */
- destroy: function() {
- if (this.isDestroying) { return; }
-
- this.isDestroying = true;
-
- if (this.willDestroy) { this.willDestroy(); }
-
- set(this, 'isDestroyed', true);
- Ember.run.schedule('destroy', this, this._scheduledDestroy);
- return this;
- },
-
- /**
- Invoked by the run loop to actually destroy the object. This is
- scheduled for execution by the `destroy` method.
-
- @private
- */
- _scheduledDestroy: function() {
- Ember.destroy(this);
- if (this.didDestroy) { this.didDestroy(); }
- },
-
- bind: function(to, from) {
- if (!(from instanceof Ember.Binding)) { from = Ember.Binding.from(from); }
- from.to(to).connect(this);
- return from;
- },
-
- toString: function() {
- return '<'+this.constructor.toString()+':'+Ember.guidFor(this)+'>';
- }
-});
-
-if (Ember.config.overridePrototypeMixin) {
- Ember.config.overridePrototypeMixin(CoreObject.PrototypeMixin);
-}
-
-CoreObject.__super__ = null;
-
-var ClassMixin = Ember.Mixin.create(
-/** @scope Ember.ClassMixin.prototype */ {
-
- ClassMixin: Ember.required(),
-
- PrototypeMixin: Ember.required(),
-
- isClass: true,
-
- isMethod: false,
-
- extend: function() {
- var Class = makeCtor(), proto;
- Class.ClassMixin = Ember.Mixin.create(this.ClassMixin);
- Class.PrototypeMixin = Ember.Mixin.create(this.PrototypeMixin);
-
- Class.ClassMixin.ownerConstructor = Class;
- Class.PrototypeMixin.ownerConstructor = Class;
-
- reopen.apply(Class.PrototypeMixin, arguments);
-
- Class.superclass = this;
- Class.__super__ = this.prototype;
-
- proto = Class.prototype = o_create(this.prototype);
- proto.constructor = Class;
- Ember.generateGuid(proto, 'ember');
- meta(proto).proto = proto; // this will disable observers on prototype
-
- Class.ClassMixin.apply(Class);
- return Class;
- },
-
- create: function() {
- var C = this;
- if (arguments.length>0) { this._initMixins(arguments); }
- return new C();
- },
-
- reopen: function() {
- this.willReopen();
- reopen.apply(this.PrototypeMixin, arguments);
- return this;
- },
-
- reopenClass: function() {
- reopen.apply(this.ClassMixin, arguments);
- Ember.Mixin._apply(this, arguments, false);
- return this;
- },
-
- detect: function(obj) {
- if ('function' !== typeof obj) { return false; }
- while(obj) {
- if (obj===this) { return true; }
- obj = obj.superclass;
- }
- return false;
- },
-
- detectInstance: function(obj) {
- return obj instanceof this;
- },
-
- /**
- In some cases, you may want to annotate computed properties with additional
- metadata about how they function or what values they operate on. For example,
- computed property functions may close over variables that are then no longer
- available for introspection.
-
- You can pass a hash of these values to a computed property like this:
-
- person: function() {
- var personId = this.get('personId');
- return App.Person.create({ id: personId });
- }.property().meta({ type: App.Person })
-
- Once you've done this, you can retrieve the values saved to the computed
- property from your class like this:
-
- MyClass.metaForProperty('person');
-
- This will return the original hash that was passed to `meta()`.
- */
- metaForProperty: function(key) {
- var desc = meta(this.proto(), false).descs[key];
-
- Ember.assert("metaForProperty() could not find a computed property with key '"+key+"'.", !!desc && desc instanceof Ember.ComputedProperty);
- return desc._meta || {};
- },
-
- /**
- Iterate over each computed property for the class, passing its name
- and any associated metadata (see `metaForProperty`) to the callback.
- */
- eachComputedProperty: function(callback, binding) {
- var proto = this.proto(),
- descs = meta(proto).descs,
- empty = {},
- property;
-
- for (var name in descs) {
- property = descs[name];
-
- if (property instanceof Ember.ComputedProperty) {
- callback.call(binding || this, name, property._meta || empty);
- }
- }
- }
-
-});
-
-if (Ember.config.overrideClassMixin) {
- Ember.config.overrideClassMixin(ClassMixin);
-}
-
-CoreObject.ClassMixin = ClassMixin;
-ClassMixin.apply(CoreObject);
-
-/**
- @class
-*/
-Ember.CoreObject = CoreObject;
-
-
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set, guidFor = Ember.guidFor, none = Ember.none;
-
-/**
- @class
-
- An unordered collection of objects.
-
- A Set works a bit like an array except that its items are not ordered.
- You can create a set to efficiently test for membership for an object. You
- can also iterate through a set just like an array, even accessing objects
- by index, however there is no guarantee as to their order.
-
- All Sets are observable via the Enumerable Observer API - which works
- on any enumerable object including both Sets and Arrays.
-
- ## Creating a Set
-
- You can create a set like you would most objects using
- `new Ember.Set()`. Most new sets you create will be empty, but you can
- also initialize the set with some content by passing an array or other
- enumerable of objects to the constructor.
-
- Finally, you can pass in an existing set and the set will be copied. You
- can also create a copy of a set by calling `Ember.Set#copy()`.
-
- #js
- // creates a new empty set
- var foundNames = new Ember.Set();
-
- // creates a set with four names in it.
- var names = new Ember.Set(["Charles", "Tom", "Juan", "Alex"]); // :P
-
- // creates a copy of the names set.
- var namesCopy = new Ember.Set(names);
-
- // same as above.
- var anotherNamesCopy = names.copy();
-
- ## Adding/Removing Objects
-
- You generally add or remove objects from a set using `add()` or
- `remove()`. You can add any type of object including primitives such as
- numbers, strings, and booleans.
-
- Unlike arrays, objects can only exist one time in a set. If you call `add()`
- on a set with the same object multiple times, the object will only be added
- once. Likewise, calling `remove()` with the same object multiple times will
- remove the object the first time and have no effect on future calls until
- you add the object to the set again.
-
- NOTE: You cannot add/remove null or undefined to a set. Any attempt to do so
- will be ignored.
-
- In addition to add/remove you can also call `push()`/`pop()`. Push behaves
- just like `add()` but `pop()`, unlike `remove()` will pick an arbitrary
- object, remove it and return it. This is a good way to use a set as a job
- queue when you don't care which order the jobs are executed in.
-
- ## Testing for an Object
-
- To test for an object's presence in a set you simply call
- `Ember.Set#contains()`.
-
- ## Observing changes
-
- When using `Ember.Set`, you can observe the `"[]"` property to be
- alerted whenever the content changes. You can also add an enumerable
- observer to the set to be notified of specific objects that are added and
- removed from the set. See `Ember.Enumerable` for more information on
- enumerables.
-
- This is often unhelpful. If you are filtering sets of objects, for instance,
- it is very inefficient to re-filter all of the items each time the set
- changes. It would be better if you could just adjust the filtered set based
- on what was changed on the original set. The same issue applies to merging
- sets, as well.
-
- ## Other Methods
-
- `Ember.Set` primary implements other mixin APIs. For a complete reference
- on the methods you will use with `Ember.Set`, please consult these mixins.
- The most useful ones will be `Ember.Enumerable` and
- `Ember.MutableEnumerable` which implement most of the common iterator
- methods you are used to on Array.
-
- Note that you can also use the `Ember.Copyable` and `Ember.Freezable`
- APIs on `Ember.Set` as well. Once a set is frozen it can no longer be
- modified. The benefit of this is that when you call frozenCopy() on it,
- Ember will avoid making copies of the set. This allows you to write
- code that can know with certainty when the underlying set data will or
- will not be modified.
-
- @extends Ember.Enumerable
- @extends Ember.MutableEnumerable
- @extends Ember.Copyable
- @extends Ember.Freezable
-
- @since Ember 0.9
-*/
-Ember.Set = Ember.CoreObject.extend(Ember.MutableEnumerable, Ember.Copyable, Ember.Freezable,
- /** @scope Ember.Set.prototype */ {
-
- // ..........................................................
- // IMPLEMENT ENUMERABLE APIS
- //
-
- /**
- This property will change as the number of objects in the set changes.
-
- @type number
- @default 0
- */
- length: 0,
-
- /**
- Clears the set. This is useful if you want to reuse an existing set
- without having to recreate it.
-
- var colors = new Ember.Set(["red", "green", "blue"]);
- colors.length; => 3
- colors.clear();
- colors.length; => 0
-
- @returns {Ember.Set} An empty Set
- */
- clear: function() {
- if (this.isFrozen) { throw new Error(Ember.FROZEN_ERROR); }
-
- var len = get(this, 'length');
- if (len === 0) { return this; }
-
- var guid;
-
- this.enumerableContentWillChange(len, 0);
- Ember.propertyWillChange(this, 'firstObject');
- Ember.propertyWillChange(this, 'lastObject');
-
- for (var i=0; i < len; i++){
- guid = guidFor(this[i]);
- delete this[guid];
- delete this[i];
- }
-
- set(this, 'length', 0);
-
- Ember.propertyDidChange(this, 'firstObject');
- Ember.propertyDidChange(this, 'lastObject');
- this.enumerableContentDidChange(len, 0);
-
- return this;
- },
-
- /**
- Returns true if the passed object is also an enumerable that contains the
- same objects as the receiver.
-
- var colors = ["red", "green", "blue"],
- same_colors = new Ember.Set(colors);
- same_colors.isEqual(colors); => true
- same_colors.isEqual(["purple", "brown"]); => false
-
- @param {Ember.Set} obj the other object.
- @returns {Boolean}
- */
- isEqual: function(obj) {
- // fail fast
- if (!Ember.Enumerable.detect(obj)) return false;
-
- var loc = get(this, 'length');
- if (get(obj, 'length') !== loc) return false;
-
- while(--loc >= 0) {
- if (!obj.contains(this[loc])) return false;
- }
-
- return true;
- },
-
- /**
- Adds an object to the set. Only non-null objects can be added to a set
- and those can only be added once. If the object is already in the set or
- the passed value is null this method will have no effect.
-
- This is an alias for `Ember.MutableEnumerable.addObject()`.
-
- var colors = new Ember.Set();
- colors.add("blue"); => ["blue"]
- colors.add("blue"); => ["blue"]
- colors.add("red"); => ["blue", "red"]
- colors.add(null); => ["blue", "red"]
- colors.add(undefined); => ["blue", "red"]
-
- @function
- @param {Object} obj The object to add.
- @returns {Ember.Set} The set itself.
- */
- add: Ember.alias('addObject'),
-
- /**
- Removes the object from the set if it is found. If you pass a null value
- or an object that is already not in the set, this method will have no
- effect. This is an alias for `Ember.MutableEnumerable.removeObject()`.
-
- var colors = new Ember.Set(["red", "green", "blue"]);
- colors.remove("red"); => ["blue", "green"]
- colors.remove("purple"); => ["blue", "green"]
- colors.remove(null); => ["blue", "green"]
-
- @function
- @param {Object} obj The object to remove
- @returns {Ember.Set} The set itself.
- */
- remove: Ember.alias('removeObject'),
-
- /**
- Removes the last element from the set and returns it, or null if it's empty.
-
- var colors = new Ember.Set(["green", "blue"]);
- colors.pop(); => "blue"
- colors.pop(); => "green"
- colors.pop(); => null
-
- @returns {Object} The removed object from the set or null.
- */
- pop: function() {
- if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
- var obj = this.length > 0 ? this[this.length-1] : null;
- this.remove(obj);
- return obj;
- },
-
- /**
- Inserts the given object on to the end of the set. It returns
- the set itself.
-
- This is an alias for `Ember.MutableEnumerable.addObject()`.
-
- var colors = new Ember.Set();
- colors.push("red"); => ["red"]
- colors.push("green"); => ["red", "green"]
- colors.push("blue"); => ["red", "green", "blue"]
-
- @function
- @returns {Ember.Set} The set itself.
- */
- push: Ember.alias('addObject'),
-
- /**
- Removes the last element from the set and returns it, or null if it's empty.
-
- This is an alias for `Ember.Set.pop()`.
-
- var colors = new Ember.Set(["green", "blue"]);
- colors.shift(); => "blue"
- colors.shift(); => "green"
- colors.shift(); => null
-
- @function
- @returns {Object} The removed object from the set or null.
- */
- shift: Ember.alias('pop'),
-
- /**
- Inserts the given object on to the end of the set. It returns
- the set itself.
-
- This is an alias of `Ember.Set.push()`
-
- var colors = new Ember.Set();
- colors.unshift("red"); => ["red"]
- colors.unshift("green"); => ["red", "green"]
- colors.unshift("blue"); => ["red", "green", "blue"]
-
- @function
- @returns {Ember.Set} The set itself.
- */
- unshift: Ember.alias('push'),
-
- /**
- Adds each object in the passed enumerable to the set.
-
- This is an alias of `Ember.MutableEnumerable.addObjects()`
-
- var colors = new Ember.Set();
- colors.addEach(["red", "green", "blue"]); => ["red", "green", "blue"]
-
- @function
- @param {Ember.Enumerable} objects the objects to add.
- @returns {Ember.Set} The set itself.
- */
- addEach: Ember.alias('addObjects'),
-
- /**
- Removes each object in the passed enumerable to the set.
-
- This is an alias of `Ember.MutableEnumerable.removeObjects()`
-
- var colors = new Ember.Set(["red", "green", "blue"]);
- colors.removeEach(["red", "blue"]); => ["green"]
-
- @function
- @param {Ember.Enumerable} objects the objects to remove.
- @returns {Ember.Set} The set itself.
- */
- removeEach: Ember.alias('removeObjects'),
-
- // ..........................................................
- // PRIVATE ENUMERABLE SUPPORT
- //
-
- /** @private */
- init: function(items) {
- this._super();
- if (items) this.addObjects(items);
- },
-
- /** @private (nodoc) - implement Ember.Enumerable */
- nextObject: function(idx) {
- return this[idx];
- },
-
- /** @private - more optimized version */
- firstObject: Ember.computed(function() {
- return this.length > 0 ? this[0] : undefined;
- }).property().cacheable(),
-
- /** @private - more optimized version */
- lastObject: Ember.computed(function() {
- return this.length > 0 ? this[this.length-1] : undefined;
- }).property().cacheable(),
-
- /** @private (nodoc) - implements Ember.MutableEnumerable */
- addObject: function(obj) {
- if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
- if (none(obj)) return this; // nothing to do
-
- var guid = guidFor(obj),
- idx = this[guid],
- len = get(this, 'length'),
- added ;
-
- if (idx>=0 && idx<len && (this[idx] === obj)) return this; // added
-
- added = [obj];
-
- this.enumerableContentWillChange(null, added);
- Ember.propertyWillChange(this, 'lastObject');
-
- len = get(this, 'length');
- this[guid] = len;
- this[len] = obj;
- set(this, 'length', len+1);
-
- Ember.propertyDidChange(this, 'lastObject');
- this.enumerableContentDidChange(null, added);
-
- return this;
- },
-
- /** @private (nodoc) - implements Ember.MutableEnumerable */
- removeObject: function(obj) {
- if (get(this, 'isFrozen')) throw new Error(Ember.FROZEN_ERROR);
- if (none(obj)) return this; // nothing to do
-
- var guid = guidFor(obj),
- idx = this[guid],
- len = get(this, 'length'),
- isFirst = idx === 0,
- isLast = idx === len-1,
- last, removed;
-
-
- if (idx>=0 && idx<len && (this[idx] === obj)) {
- removed = [obj];
-
- this.enumerableContentWillChange(removed, null);
- if (isFirst) { Ember.propertyWillChange(this, 'firstObject'); }
- if (isLast) { Ember.propertyWillChange(this, 'lastObject'); }
-
- // swap items - basically move the item to the end so it can be removed
- if (idx < len-1) {
- last = this[len-1];
- this[idx] = last;
- this[guidFor(last)] = idx;
- }
-
- delete this[guid];
- delete this[len-1];
- set(this, 'length', len-1);
-
- if (isFirst) { Ember.propertyDidChange(this, 'firstObject'); }
- if (isLast) { Ember.propertyDidChange(this, 'lastObject'); }
- this.enumerableContentDidChange(removed, null);
- }
-
- return this;
- },
-
- /** @private (nodoc) - optimized version */
- contains: function(obj) {
- return this[guidFor(obj)]>=0;
- },
-
- /** @private (nodoc) */
- copy: function() {
- var C = this.constructor, ret = new C(), loc = get(this, 'length');
- set(ret, 'length', loc);
- while(--loc>=0) {
- ret[loc] = this[loc];
- ret[guidFor(this[loc])] = loc;
- }
- return ret;
- },
-
- /** @private */
- toString: function() {
- var len = this.length, idx, array = [];
- for(idx = 0; idx < len; idx++) {
- array[idx] = this[idx];
- }
- return "Ember.Set<%@>".fmt(array.join(','));
- }
-
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/**
- @class
-
- `Ember.Object` is the main base class for all Ember objects. It is a subclass
- of `Ember.CoreObject` with the `Ember.Observable` mixin applied. For details,
- see the documentation for each of these.
-
- @extends Ember.CoreObject
- @extends Ember.Observable
-*/
-Ember.Object = Ember.CoreObject.extend(Ember.Observable);
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var indexOf = Ember.ArrayPolyfills.indexOf;
-
-/**
- @private
- A Namespace is an object usually used to contain other objects or methods
- such as an application or framework. Create a namespace anytime you want
- to define one of these new containers.
-
- # Example Usage
-
- MyFramework = Ember.Namespace.create({
- VERSION: '1.0.0'
- });
-
-*/
-Ember.Namespace = Ember.Object.extend({
- isNamespace: true,
-
- init: function() {
- Ember.Namespace.NAMESPACES.push(this);
- Ember.Namespace.PROCESSED = false;
- },
-
- toString: function() {
- Ember.identifyNamespaces();
- return this[Ember.GUID_KEY+'_name'];
- },
-
- destroy: function() {
- var namespaces = Ember.Namespace.NAMESPACES;
- window[this.toString()] = undefined;
- namespaces.splice(indexOf.call(namespaces, this), 1);
- this._super();
- }
-});
-
-Ember.Namespace.NAMESPACES = [Ember];
-Ember.Namespace.PROCESSED = false;
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/**
- @private
-
- Defines a namespace that will contain an executable application. This is
- very similar to a normal namespace except that it is expected to include at
- least a 'ready' function which can be run to initialize the application.
-
- Currently Ember.Application is very similar to Ember.Namespace. However, this
- class may be augmented by additional frameworks so it is important to use
- this instance when building new applications.
-
- # Example Usage
-
- MyApp = Ember.Application.create({
- VERSION: '1.0.0',
- store: Ember.Store.create().from(Ember.fixtures)
- });
-
- MyApp.ready = function() {
- //..init code goes here...
- }
-
-*/
-Ember.Application = Ember.Namespace.extend();
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- An ArrayProxy wraps any other object that implements Ember.Array and/or
- Ember.MutableArray, forwarding all requests. This makes it very useful for
- a number of binding use cases or other cases where being able to swap
- out the underlying array is useful.
-
- A simple example of usage:
-
- var pets = ['dog', 'cat', 'fish'];
- var ap = Ember.ArrayProxy.create({ content: Ember.A(pets) });
- ap.get('firstObject'); // => 'dog'
- ap.set('content', ['amoeba', 'paramecium']);
- ap.get('firstObject'); // => 'amoeba'
-
- This class can also be useful as a layer to transform the contents of
- an array, as they are accessed. This can be done by overriding
- `objectAtContent`:
-
- var pets = ['dog', 'cat', 'fish'];
- var ap = Ember.ArrayProxy.create({
- content: Ember.A(pets),
- objectAtContent: function(idx) {
- return this.get('content').objectAt(idx).toUpperCase();
- }
- });
- ap.get('firstObject'); // => 'DOG'
-
-
- @extends Ember.Object
- @extends Ember.Array
- @extends Ember.MutableArray
-*/
-Ember.ArrayProxy = Ember.Object.extend(Ember.MutableArray,
-/** @scope Ember.ArrayProxy.prototype */ {
-
- /**
- The content array. Must be an object that implements Ember.Array and/or
- Ember.MutableArray.
-
- @type Ember.Array
- */
- content: null,
-
- /**
- The array that the proxy pretends to be. In the default `ArrayProxy`
- implementation, this and `content` are the same. Subclasses of `ArrayProxy`
- can override this property to provide things like sorting and filtering.
- */
- arrangedContent: Ember.computed('content', function() {
- return get(this, 'content');
- }).cacheable(),
-
- /**
- Should actually retrieve the object at the specified index from the
- content. You can override this method in subclasses to transform the
- content item to something new.
-
- This method will only be called if content is non-null.
-
- @param {Number} idx
- The index to retrieve.
-
- @returns {Object} the value or undefined if none found
- */
- objectAtContent: function(idx) {
- return get(this, 'arrangedContent').objectAt(idx);
- },
-
- /**
- Should actually replace the specified objects on the content array.
- You can override this method in subclasses to transform the content item
- into something new.
-
- This method will only be called if content is non-null.
-
- @param {Number} idx
- The starting index
-
- @param {Number} amt
- The number of items to remove from the content.
-
- @param {Array} objects
- Optional array of objects to insert or null if no objects.
-
- @returns {void}
- */
- replaceContent: function(idx, amt, objects) {
- get(this, 'arrangedContent').replace(idx, amt, objects);
- },
-
- /**
- Invoked when the content property is about to change. Notifies observers that the
- entire array content will change.
- */
- _contentWillChange: Ember.beforeObserver(function() {
- var content = get(this, 'content');
-
- if (content) {
- content.removeArrayObserver(this, {
- willChange: 'contentArrayWillChange',
- didChange: 'contentArrayDidChange'
- });
- }
- }, 'content'),
-
-
- contentArrayWillChange: Ember.K,
- contentArrayDidChange: Ember.K,
-
- /**
- Invoked when the content property changes. Notifies observers that the
- entire array content has changed.
- */
- _contentDidChange: Ember.observer(function() {
- var content = get(this, 'content'),
- len = content ? get(content, 'length') : 0;
-
- Ember.assert("Can't set ArrayProxy's content to itself", content !== this);
-
- if (content) {
- content.addArrayObserver(this, {
- willChange: 'contentArrayWillChange',
- didChange: 'contentArrayDidChange'
- });
- }
- }, 'content'),
-
- _arrangedContentWillChange: Ember.beforeObserver(function() {
- var arrangedContent = get(this, 'arrangedContent'),
- len = arrangedContent ? get(arrangedContent, 'length') : 0;
-
- this.arrangedContentArrayWillChange(this, 0, len, undefined);
-
- if (arrangedContent) {
- arrangedContent.removeArrayObserver(this, {
- willChange: 'arrangedContentArrayWillChange',
- didChange: 'arrangedContentArrayDidChange'
- });
- }
- }, 'arrangedContent'),
-
- _arrangedContentDidChange: Ember.observer(function() {
- var arrangedContent = get(this, 'arrangedContent'),
- len = arrangedContent ? get(arrangedContent, 'length') : 0;
-
- Ember.assert("Can't set ArrayProxy's content to itself", arrangedContent !== this);
-
- if (arrangedContent) {
- arrangedContent.addArrayObserver(this, {
- willChange: 'arrangedContentArrayWillChange',
- didChange: 'arrangedContentArrayDidChange'
- });
- }
-
- this.arrangedContentArrayDidChange(this, 0, undefined, len);
- }, 'arrangedContent'),
-
- /** @private (nodoc) */
- objectAt: function(idx) {
- return get(this, 'content') && this.objectAtContent(idx);
- },
-
- /** @private (nodoc) */
- length: Ember.computed(function() {
- var arrangedContent = get(this, 'arrangedContent');
- return arrangedContent ? get(arrangedContent, 'length') : 0;
- // No dependencies since Enumerable notifies length of change
- }).property().cacheable(),
-
- /** @private (nodoc) */
- replace: function(idx, amt, objects) {
- if (get(this, 'content')) this.replaceContent(idx, amt, objects);
- return this;
- },
-
- /** @private (nodoc) */
- arrangedContentArrayWillChange: function(item, idx, removedCnt, addedCnt) {
- this.arrayContentWillChange(idx, removedCnt, addedCnt);
- },
-
- /** @private (nodoc) */
- arrangedContentArrayDidChange: function(item, idx, removedCnt, addedCnt) {
- this.arrayContentDidChange(idx, removedCnt, addedCnt);
- },
-
- /** @private (nodoc) */
- init: function() {
- this._super();
- this._contentWillChange();
- this._contentDidChange();
- this._arrangedContentWillChange();
- this._arrangedContentDidChange();
- }
-
-});
-
-
-
-
-})();
-
-
-
-(function() {
-var get = Ember.get,
- set = Ember.set,
- fmt = Ember.String.fmt,
- addBeforeObserver = Ember.addBeforeObserver,
- addObserver = Ember.addObserver,
- removeBeforeObserver = Ember.removeBeforeObserver,
- removeObserver = Ember.removeObserver,
- propertyWillChange = Ember.propertyWillChange,
- propertyDidChange = Ember.propertyDidChange;
-
-function contentPropertyWillChange(content, contentKey) {
- var key = contentKey.slice(8); // remove "content."
- if (key in this) { return; } // if shadowed in proxy
- propertyWillChange(this, key);
-}
-
-function contentPropertyDidChange(content, contentKey) {
- var key = contentKey.slice(8); // remove "content."
- if (key in this) { return; } // if shadowed in proxy
- propertyDidChange(this, key);
-}
-
-/**
- @class
-
- `Ember.ObjectProxy` forwards all properties not defined by the proxy itself
- to a proxied `content` object.
-
- object = Ember.Object.create({
- name: 'Foo'
- });
- proxy = Ember.ObjectProxy.create({
- content: object
- });
-
- // Access and change existing properties
- proxy.get('name') // => 'Foo'
- proxy.set('name', 'Bar');
- object.get('name') // => 'Bar'
-
- // Create new 'description' property on `object`
- proxy.set('description', 'Foo is a whizboo baz');
- object.get('description') // => 'Foo is a whizboo baz'
-
- While `content` is unset, setting a property to be delegated will throw an Error.
-
- proxy = Ember.ObjectProxy.create({
- content: null,
- flag: null
- });
- proxy.set('flag', true);
- proxy.get('flag'); // => true
- proxy.get('foo'); // => undefined
- proxy.set('foo', 'data'); // throws Error
-
- Delegated properties can be bound to and will change when content is updated.
-
- Computed properties on the proxy itself can depend on delegated properties.
-
- ProxyWithComputedProperty = Ember.ObjectProxy.extend({
- fullName: function () {
- var firstName = this.get('firstName'),
- lastName = this.get('lastName');
- if (firstName && lastName) {
- return firstName + ' ' + lastName;
- }
- return firstName || lastName;
- }.property('firstName', 'lastName')
- });
- proxy = ProxyWithComputedProperty.create();
- proxy.get('fullName'); => undefined
- proxy.set('content', {
- firstName: 'Tom', lastName: 'Dale'
- }); // triggers property change for fullName on proxy
- proxy.get('fullName'); => 'Tom Dale'
-*/
-Ember.ObjectProxy = Ember.Object.extend(
-/** @scope Ember.ObjectProxy.prototype */ {
- /**
- The object whose properties will be forwarded.
-
- @type Ember.Object
- @default null
- */
- content: null,
- _contentDidChange: Ember.observer(function() {
- Ember.assert("Can't set ObjectProxy's content to itself", this.get('content') !== this);
- }, 'content'),
- /** @private */
- willWatchProperty: function (key) {
- var contentKey = 'content.' + key;
- addBeforeObserver(this, contentKey, null, contentPropertyWillChange);
- addObserver(this, contentKey, null, contentPropertyDidChange);
- },
- /** @private */
- didUnwatchProperty: function (key) {
- var contentKey = 'content.' + key;
- removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);
- removeObserver(this, contentKey, null, contentPropertyDidChange);
- },
- /** @private */
- unknownProperty: function (key) {
- var content = get(this, 'content');
- if (content) {
- return get(content, key);
- }
- },
- /** @private */
- setUnknownProperty: function (key, value) {
- var content = get(this, 'content');
- Ember.assert(fmt("Cannot delegate set('%@', %@) to the 'content' property of object proxy %@: its 'content' is undefined.", [key, value, this]), content);
- return set(content, key, value);
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var set = Ember.set, get = Ember.get, guidFor = Ember.guidFor;
-var forEach = Ember.EnumerableUtils.forEach;
-
-var EachArray = Ember.Object.extend(Ember.Array, {
-
- init: function(content, keyName, owner) {
- this._super();
- this._keyName = keyName;
- this._owner = owner;
- this._content = content;
- },
-
- objectAt: function(idx) {
- var item = this._content.objectAt(idx);
- return item && get(item, this._keyName);
- },
-
- length: Ember.computed(function() {
- var content = this._content;
- return content ? get(content, 'length') : 0;
- }).property().cacheable()
-
-});
-
-var IS_OBSERVER = /^.+:(before|change)$/;
-
-/** @private */
-function addObserverForContentKey(content, keyName, proxy, idx, loc) {
- var objects = proxy._objects, guid;
- if (!objects) objects = proxy._objects = {};
-
- while(--loc>=idx) {
- var item = content.objectAt(loc);
- if (item) {
- Ember.addBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
- Ember.addObserver(item, keyName, proxy, 'contentKeyDidChange');
-
- // keep track of the indicies each item was found at so we can map
- // it back when the obj changes.
- guid = guidFor(item);
- if (!objects[guid]) objects[guid] = [];
- objects[guid].push(loc);
- }
- }
-}
-
-/** @private */
-function removeObserverForContentKey(content, keyName, proxy, idx, loc) {
- var objects = proxy._objects;
- if (!objects) objects = proxy._objects = {};
- var indicies, guid;
-
- while(--loc>=idx) {
- var item = content.objectAt(loc);
- if (item) {
- Ember.removeBeforeObserver(item, keyName, proxy, 'contentKeyWillChange');
- Ember.removeObserver(item, keyName, proxy, 'contentKeyDidChange');
-
- guid = guidFor(item);
- indicies = objects[guid];
- indicies[indicies.indexOf(loc)] = null;
- }
- }
-}
-
-/**
- @private
- @class
-
- This is the object instance returned when you get the @each property on an
- array. It uses the unknownProperty handler to automatically create
- EachArray instances for property names.
-
- @extends Ember.Object
-*/
-Ember.EachProxy = Ember.Object.extend({
-
- init: function(content) {
- this._super();
- this._content = content;
- content.addArrayObserver(this);
-
- // in case someone is already observing some keys make sure they are
- // added
- forEach(Ember.watchedEvents(this), function(eventName) {
- this.didAddListener(eventName);
- }, this);
- },
-
- /**
- You can directly access mapped properties by simply requesting them.
- The unknownProperty handler will generate an EachArray of each item.
- */
- unknownProperty: function(keyName, value) {
- var ret;
- ret = new EachArray(this._content, keyName, this);
- Ember.defineProperty(this, keyName, null, ret);
- this.beginObservingContentKey(keyName);
- return ret;
- },
-
- // ..........................................................
- // ARRAY CHANGES
- // Invokes whenever the content array itself changes.
-
- arrayWillChange: function(content, idx, removedCnt, addedCnt) {
- var keys = this._keys, key, array, lim;
-
- lim = removedCnt>0 ? idx+removedCnt : -1;
- Ember.beginPropertyChanges(this);
-
- for(key in keys) {
- if (!keys.hasOwnProperty(key)) { continue; }
-
- if (lim>0) removeObserverForContentKey(content, key, this, idx, lim);
-
- Ember.propertyWillChange(this, key);
- }
-
- Ember.propertyWillChange(this._content, '@each');
- Ember.endPropertyChanges(this);
- },
-
- arrayDidChange: function(content, idx, removedCnt, addedCnt) {
- var keys = this._keys, key, array, lim;
-
- lim = addedCnt>0 ? idx+addedCnt : -1;
- Ember.beginPropertyChanges(this);
-
- for(key in keys) {
- if (!keys.hasOwnProperty(key)) { continue; }
-
- if (lim>0) addObserverForContentKey(content, key, this, idx, lim);
-
- Ember.propertyDidChange(this, key);
- }
-
- Ember.propertyDidChange(this._content, '@each');
- Ember.endPropertyChanges(this);
- },
-
- // ..........................................................
- // LISTEN FOR NEW OBSERVERS AND OTHER EVENT LISTENERS
- // Start monitoring keys based on who is listening...
-
- didAddListener: function(eventName) {
- if (IS_OBSERVER.test(eventName)) {
- this.beginObservingContentKey(eventName.slice(0, -7));
- }
- },
-
- didRemoveListener: function(eventName) {
- if (IS_OBSERVER.test(eventName)) {
- this.stopObservingContentKey(eventName.slice(0, -7));
- }
- },
-
- // ..........................................................
- // CONTENT KEY OBSERVING
- // Actual watch keys on the source content.
-
- beginObservingContentKey: function(keyName) {
- var keys = this._keys;
- if (!keys) keys = this._keys = {};
- if (!keys[keyName]) {
- keys[keyName] = 1;
- var content = this._content,
- len = get(content, 'length');
- addObserverForContentKey(content, keyName, this, 0, len);
- } else {
- keys[keyName]++;
- }
- },
-
- stopObservingContentKey: function(keyName) {
- var keys = this._keys;
- if (keys && (keys[keyName]>0) && (--keys[keyName]<=0)) {
- var content = this._content,
- len = get(content, 'length');
- removeObserverForContentKey(content, keyName, this, 0, len);
- }
- },
-
- contentKeyWillChange: function(obj, keyName) {
- Ember.propertyWillChange(this, keyName);
- },
-
- contentKeyDidChange: function(obj, keyName) {
- Ember.propertyDidChange(this, keyName);
- }
-
-});
-
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-// Add Ember.Array to Array.prototype. Remove methods with native
-// implementations and supply some more optimized versions of generic methods
-// because they are so common.
-var NativeArray = Ember.Mixin.create(Ember.MutableArray, Ember.Observable, Ember.Copyable, {
-
- // because length is a built-in property we need to know to just get the
- // original property.
- get: function(key) {
- if (key==='length') return this.length;
- else if ('number' === typeof key) return this[key];
- else return this._super(key);
- },
-
- objectAt: function(idx) {
- return this[idx];
- },
-
- // primitive for array support.
- replace: function(idx, amt, objects) {
-
- if (this.isFrozen) throw Ember.FROZEN_ERROR ;
-
- // if we replaced exactly the same number of items, then pass only the
- // replaced range. Otherwise, pass the full remaining array length
- // since everything has shifted
- var len = objects ? get(objects, 'length') : 0;
- this.arrayContentWillChange(idx, amt, len);
-
- if (!objects || objects.length === 0) {
- this.splice(idx, amt) ;
- } else {
- var args = [idx, amt].concat(objects) ;
- this.splice.apply(this,args) ;
- }
-
- this.arrayContentDidChange(idx, amt, len);
- return this ;
- },
-
- // If you ask for an unknown property, then try to collect the value
- // from member items.
- unknownProperty: function(key, value) {
- var ret;// = this.reducedProperty(key, value) ;
- if ((value !== undefined) && ret === undefined) {
- ret = this[key] = value;
- }
- return ret ;
- },
-
- // If browser did not implement indexOf natively, then override with
- // specialized version
- indexOf: function(object, startAt) {
- var idx, len = this.length;
-
- if (startAt === undefined) startAt = 0;
- else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
- if (startAt < 0) startAt += len;
-
- for(idx=startAt;idx<len;idx++) {
- if (this[idx] === object) return idx ;
- }
- return -1;
- },
-
- lastIndexOf: function(object, startAt) {
- var idx, len = this.length;
-
- if (startAt === undefined) startAt = len-1;
- else startAt = (startAt < 0) ? Math.ceil(startAt) : Math.floor(startAt);
- if (startAt < 0) startAt += len;
-
- for(idx=startAt;idx>=0;idx--) {
- if (this[idx] === object) return idx ;
- }
- return -1;
- },
-
- copy: function() {
- return this.slice();
- }
-});
-
-// Remove any methods implemented natively so we don't override them
-var ignore = ['length'];
-Ember.EnumerableUtils.forEach(NativeArray.keys(), function(methodName) {
- if (Array.prototype[methodName]) ignore.push(methodName);
-});
-
-if (ignore.length>0) {
- NativeArray = NativeArray.without.apply(NativeArray, ignore);
-}
-
-/**
- The NativeArray mixin contains the properties needed to to make the native
- Array support Ember.MutableArray and all of its dependent APIs. Unless you
- have Ember.EXTEND_PROTOTYPES set to false, this will be applied automatically.
- Otherwise you can apply the mixin at anytime by calling
- `Ember.NativeArray.activate`.
-
- @namespace
- @extends Ember.MutableArray
- @extends Ember.Array
- @extends Ember.Enumerable
- @extends Ember.MutableEnumerable
- @extends Ember.Copyable
- @extends Ember.Freezable
-*/
-Ember.NativeArray = NativeArray;
-
-/**
- Creates an Ember.NativeArray from an Array like object.
- Does not modify the original object.
-
- @returns {Ember.NativeArray}
-*/
-Ember.A = function(arr){
- if (arr === undefined) { arr = []; }
- return Ember.NativeArray.apply(arr);
-};
-
-/**
- Activates the mixin on the Array.prototype if not already applied. Calling
- this method more than once is safe.
-
- @returns {void}
-*/
-Ember.NativeArray.activate = function() {
- NativeArray.apply(Array.prototype);
-
- Ember.A = function(arr) { return arr || []; };
-};
-
-if (Ember.EXTEND_PROTOTYPES) Ember.NativeArray.activate();
-
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-Ember._PromiseChain = Ember.Object.extend({
- promises: null,
- failureCallback: Ember.K,
- successCallback: Ember.K,
- abortCallback: Ember.K,
- promiseSuccessCallback: Ember.K,
-
- /**
- @private
- */
- runNextPromise: function() {
- if (get(this, 'isDestroyed')) { return; }
-
- var item = get(this, 'promises').shiftObject();
- if (item) {
- var promise = get(item, 'promise') || item;
- Ember.assert("Cannot find promise to invoke", Ember.canInvoke(promise, 'then'));
-
- var self = this;
-
- var successCallback = function() {
- self.promiseSuccessCallback.call(this, item, arguments);
- self.runNextPromise();
- };
-
- var failureCallback = get(self, 'failureCallback');
-
- promise.then(successCallback, failureCallback);
- } else {
- this.successCallback();
- }
- },
-
- start: function() {
- this.runNextPromise();
- return this;
- },
-
- abort: function() {
- this.abortCallback();
- this.destroy();
- },
-
- init: function() {
- set(this, 'promises', Ember.A(get(this, 'promises')));
- this._super();
- }
-});
-
-
-})();
-
-
-
-(function() {
-var loadHooks = {};
-var loaded = {};
-
-Ember.onLoad = function(name, callback) {
- var object;
-
- loadHooks[name] = loadHooks[name] || Ember.A();
- loadHooks[name].pushObject(callback);
-
- if (object = loaded[name]) {
- callback(object);
- }
-};
-
-Ember.runLoadHooks = function(name, object) {
- var hooks;
-
- loaded[name] = object;
-
- if (hooks = loadHooks[name]) {
- loadHooks[name].forEach(function(callback) {
- callback(object);
- });
- }
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-Ember.ControllerMixin = Ember.Mixin.create({
- /**
- The object to which events from the view should be sent.
-
- For example, when a Handlebars template uses the `{{action}}` helper,
- it will attempt to send the event to the view's controller's `target`.
-
- By default, a controller's `target` is set to the router after it is
- instantiated by `Ember.Application#initialize`.
- */
- target: null,
- store: null
-});
-
-Ember.Controller = Ember.Object.extend(Ember.ControllerMixin);
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set, forEach = Ember.EnumerableUtils.forEach;
-
-/**
- @class
-
- @extends Ember.Mixin
- @extends Ember.MutableEnumerable
-*/
-Ember.SortableMixin = Ember.Mixin.create(Ember.MutableEnumerable,
- /** @scope Ember.Observable.prototype */ {
- sortProperties: null,
- sortAscending: true,
-
- addObject: function(obj) {
- var content = get(this, 'content');
- content.pushObject(obj);
- },
-
- removeObject: function(obj) {
- var content = get(this, 'content');
- content.removeObject(obj);
- },
-
- orderBy: function(item1, item2) {
- var result = 0,
- sortProperties = get(this, 'sortProperties'),
- sortAscending = get(this, 'sortAscending');
-
- Ember.assert("you need to define `sortProperties`", !!sortProperties);
-
- forEach(sortProperties, function(propertyName) {
- if (result === 0) {
- result = Ember.compare(get(item1, propertyName), get(item2, propertyName));
- if ((result !== 0) && !sortAscending) {
- result = (-1) * result;
- }
- }
- });
-
- return result;
- },
-
- destroy: function() {
- var content = get(this, 'content'),
- sortProperties = get(this, 'sortProperties');
-
- if (content && sortProperties) {
- forEach(content, function(item) {
- forEach(sortProperties, function(sortProperty) {
- Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
- }, this);
- }, this);
- }
-
- return this._super();
- },
-
- isSorted: Ember.computed('sortProperties', function() {
- return !!get(this, 'sortProperties');
- }),
-
- arrangedContent: Ember.computed('content', 'sortProperties.@each', function(key, value) {
- var content = get(this, 'content'),
- isSorted = get(this, 'isSorted'),
- sortProperties = get(this, 'sortProperties'),
- self = this;
-
- if (content && isSorted) {
- content = content.slice();
- content.sort(function(item1, item2) {
- return self.orderBy(item1, item2);
- });
- forEach(content, function(item) {
- forEach(sortProperties, function(sortProperty) {
- Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
- }, this);
- }, this);
- return Ember.A(content);
- }
-
- return content;
- }).cacheable(),
-
- _contentWillChange: Ember.beforeObserver(function() {
- var content = get(this, 'content'),
- sortProperties = get(this, 'sortProperties');
-
- if (content && sortProperties) {
- forEach(content, function(item) {
- forEach(sortProperties, function(sortProperty) {
- Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
- }, this);
- }, this);
- }
-
- this._super();
- }, 'content'),
-
- sortAscendingWillChange: Ember.beforeObserver(function() {
- this._lastSortAscending = get(this, 'sortAscending');
- }, 'sortAscending'),
-
- sortAscendingDidChange: Ember.observer(function() {
- if (get(this, 'sortAscending') !== this._lastSortAscending) {
- var arrangedContent = get(this, 'arrangedContent');
- arrangedContent.reverseObjects();
- }
- }, 'sortAscending'),
-
- contentArrayWillChange: function(array, idx, removedCount, addedCount) {
- var isSorted = get(this, 'isSorted');
-
- if (isSorted) {
- var arrangedContent = get(this, 'arrangedContent');
- var removedObjects = array.slice(idx, idx+removedCount);
- var sortProperties = get(this, 'sortProperties');
-
- forEach(removedObjects, function(item) {
- arrangedContent.removeObject(item);
-
- forEach(sortProperties, function(sortProperty) {
- Ember.removeObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
- }, this);
- });
- }
-
- return this._super(array, idx, removedCount, addedCount);
- },
-
- contentArrayDidChange: function(array, idx, removedCount, addedCount) {
- var isSorted = get(this, 'isSorted'),
- sortProperties = get(this, 'sortProperties');
-
- if (isSorted) {
- var addedObjects = array.slice(idx, idx+addedCount);
- var arrangedContent = get(this, 'arrangedContent');
-
- forEach(addedObjects, function(item) {
- this.insertItemSorted(item);
-
- forEach(sortProperties, function(sortProperty) {
- Ember.addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange');
- }, this);
- }, this);
- }
-
- return this._super(array, idx, removedCount, addedCount);
- },
-
- insertItemSorted: function(item) {
- var arrangedContent = get(this, 'arrangedContent');
- var length = get(arrangedContent, 'length');
-
- var idx = this._binarySearch(item, 0, length);
- arrangedContent.insertAt(idx, item);
- },
-
- contentItemSortPropertyDidChange: function(item) {
- var arrangedContent = get(this, 'arrangedContent'),
- index = arrangedContent.indexOf(item);
-
- arrangedContent.removeObject(item);
- this.insertItemSorted(item);
- },
-
- _binarySearch: function(item, low, high) {
- var mid, midItem, res, arrangedContent;
-
- if (low === high) {
- return low;
- }
-
- arrangedContent = get(this, 'arrangedContent');
-
- mid = low + Math.floor((high - low) / 2);
- midItem = arrangedContent.objectAt(mid);
-
- res = this.orderBy(midItem, item);
-
- if (res < 0) {
- return this._binarySearch(item, mid+1, high);
- } else if (res > 0) {
- return this._binarySearch(item, low, mid);
- }
-
- return mid;
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- Ember.ArrayController provides a way for you to publish a collection of objects
- so that you can easily bind to the collection from a Handlebars #each helper,
- an Ember.CollectionView, or other controllers.
-
- The advantage of using an ArrayController is that you only have to set up
- your view bindings once; to change what's displayed, simply swap out the
- `content` property on the controller.
-
- For example, imagine you wanted to display a list of items fetched via an XHR
- request. Create an Ember.ArrayController and set its `content` property:
-
- MyApp.listController = Ember.ArrayController.create();
-
- $.get('people.json', function(data) {
- MyApp.listController.set('content', data);
- });
-
- Then, create a view that binds to your new controller:
-
- {{#each MyApp.listController}}
- {{firstName}} {{lastName}}
- {{/each}}
-
- Although you are binding to the controller, the behavior of this controller
- is to pass through any methods or properties to the underlying array. This
- capability comes from `Ember.ArrayProxy`, which this class inherits from.
-
- Note: As of this writing, `ArrayController` does not add any functionality
- to its superclass, `ArrayProxy`. The Ember team plans to add additional
- controller-specific functionality in the future, e.g. single or multiple
- selection support. If you are creating something that is conceptually a
- controller, use this class.
-
- @extends Ember.ArrayProxy
-*/
-
-Ember.ArrayController = Ember.ArrayProxy.extend(Ember.ControllerMixin,
- Ember.SortableMixin);
-
-})();
-
-
-
-(function() {
-Ember.ObjectController = Ember.ObjectProxy.extend(Ember.ControllerMixin);
-
-})();
-
-
-
-(function() {
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Runtime
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- An Ember.Application instance serves as the namespace in which you define your
- application's classes. You can also override the configuration of your
- application.
-
- By default, Ember.Application will begin listening for events on the document.
- If your application is embedded inside a page, instead of controlling the
- entire document, you can specify which DOM element to attach to by setting
- the `rootElement` property:
-
- MyApp = Ember.Application.create({
- rootElement: $('#my-app')
- });
-
- The root of an Ember.Application must not be removed during the course of the
- page's lifetime. If you have only a single conceptual application for the
- entire page, and are not embedding any third-party Ember applications
- in your page, use the default document root for your application.
-
- You only need to specify the root if your page contains multiple instances
- of Ember.Application.
-
- @extends Ember.Object
-*/
-Ember.Application = Ember.Namespace.extend(
-/** @scope Ember.Application.prototype */{
-
- /**
- The root DOM element of the Application.
-
- Can be specified as DOMElement or a selector string.
-
- @type DOMElement
- @default 'body'
- */
- rootElement: 'body',
-
- /**
- @type Ember.EventDispatcher
- @default null
- */
- eventDispatcher: null,
-
- /**
- @type Object
- @default null
- */
- customEvents: null,
-
- /** @private */
- init: function() {
- var eventDispatcher,
- rootElement = get(this, 'rootElement');
- this._super();
-
- eventDispatcher = Ember.EventDispatcher.create({
- rootElement: rootElement
- });
-
- set(this, 'eventDispatcher', eventDispatcher);
-
- // jQuery 1.7 doesn't call the ready callback if already ready
- if (Ember.$.isReady) {
- Ember.run.once(this, this.didBecomeReady);
- } else {
- var self = this;
- Ember.$(document).ready(function() {
- Ember.run.once(self, self.didBecomeReady);
- });
- }
- },
-
- /**
- Instantiate all controllers currently available on the namespace
- and inject them onto a router.
-
- Example:
-
- App.PostsController = Ember.ArrayController.extend();
- App.CommentsController = Ember.ArrayController.extend();
-
- var router = Ember.Router.create({
- ...
- });
-
- App.initialize(router);
-
- router.get('postsController') // <App.PostsController:ember1234>
- router.get('commentsController') // <App.CommentsController:ember1235>
-
- router.get('postsController.router') // router
- */
- initialize: function(router) {
- var properties = Ember.A(Ember.keys(this)),
- injections = get(this.constructor, 'injections'),
- namespace = this, controller, name;
-
- if (!router && Ember.Router.detect(namespace['Router'])) {
- router = namespace['Router'].create();
- this._createdRouter = router;
- }
-
- if (router) {
- set(this, 'router', router);
-
- // By default, the router's namespace is the current application.
- //
- // This allows it to find model classes when a state has a
- // route like `/posts/:post_id`. In that case, it would first
- // convert `post_id` into `Post`, and then look it up on its
- // namespace.
- set(router, 'namespace', this);
- }
-
- Ember.runLoadHooks('application', this);
-
- injections.forEach(function(injection) {
- properties.forEach(function(property) {
- injection[1](namespace, router, property);
- });
- });
-
- if (router && router instanceof Ember.Router) {
- this.startRouting(router);
- }
- },
-
- /** @private */
- didBecomeReady: function() {
- var eventDispatcher = get(this, 'eventDispatcher'),
- customEvents = get(this, 'customEvents');
-
- eventDispatcher.setup(customEvents);
-
- this.ready();
- },
-
- /**
- @private
-
- If the application has a router, use it to route to the current URL, and
- trigger a new call to `route` whenever the URL changes.
- */
- startRouting: function(router) {
- var location = get(router, 'location'),
- rootElement = get(this, 'rootElement'),
- applicationController = get(router, 'applicationController');
-
- Ember.assert("ApplicationView and ApplicationController must be defined on your application", (this.ApplicationView && applicationController) );
-
- var applicationView = this.ApplicationView.create({
- controller: applicationController
- });
- this._createdApplicationView = applicationView;
-
- applicationView.appendTo(rootElement);
-
- router.route(location.getURL());
- location.onUpdateURL(function(url) {
- router.route(url);
- });
- },
-
- /**
- Called when the Application has become ready.
- The call will be delayed until the DOM has become ready.
- */
- ready: Ember.K,
-
- /** @private */
- willDestroy: function() {
- get(this, 'eventDispatcher').destroy();
- if (this._createdRouter) { this._createdRouter.destroy(); }
- if (this._createdApplicationView) { this._createdApplicationView.destroy(); }
- },
-
- registerInjection: function(options) {
- this.constructor.registerInjection(options);
- }
-});
-
-Ember.Application.reopenClass({
- concatenatedProperties: ['injections'],
- injections: Ember.A(),
- registerInjection: function(options) {
- var injections = get(this, 'injections'),
- before = options.before,
- name = options.name,
- injection = options.injection,
- location;
-
- if (before) {
- location = injections.find(function(item) {
- if (item[0] === before) { return true; }
- });
- location = injections.indexOf(location);
- } else {
- location = get(injections, 'length');
- }
-
- injections.splice(location, 0, [name, injection]);
- }
-});
-
-Ember.Application.registerInjection({
- name: 'controllers',
- injection: function(app, router, property) {
- if (!/^[A-Z].*Controller$/.test(property)) { return; }
-
- var name = property.charAt(0).toLowerCase() + property.substr(1),
- controller = app[property].create();
-
- router.set(name, controller);
-
- controller.setProperties({
- target: router,
- controllers: router,
- namespace: app
- });
- }
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-/**
- This file implements the `location` API used by Ember's router.
-
- That API is:
-
- getURL: returns the current URL
- setURL(path): sets the current URL
- onUpdateURL(callback): triggers the callback when the URL changes
- formatURL(url): formats `url` to be placed into `href` attribute
-
- Calling setURL will not trigger onUpdateURL callbacks.
-
- TODO: This, as well as the Ember.Location documentation below, should
- perhaps be moved so that it's visible in the JsDoc output.
-*/
-/**
- @class
-
- Ember.Location returns an instance of the correct implementation of
- the `location` API.
-
- You can pass it a `implementation` ('hash', 'history', 'none') to force a
- particular implementation.
-*/
-Ember.Location = {
- create: function(options) {
- var implementation = options && options.implementation;
- Ember.assert("Ember.Location.create: you must specify a 'implementation' option", !!implementation);
-
- var implementationClass = this.implementations[implementation];
- Ember.assert("Ember.Location.create: " + implementation + " is not a valid implementation", !!implementationClass);
-
- return implementationClass.create.apply(implementationClass, arguments);
- },
-
- registerImplementation: function(name, implementation) {
- this.implementations[name] = implementation;
- },
-
- implementations: {}
-};
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- Ember.HashLocation implements the location API using the browser's
- hash. At present, it relies on a hashchange event existing in the
- browser.
-
- @extends Ember.Object
-*/
-Ember.HashLocation = Ember.Object.extend(
-/** @scope Ember.HashLocation.prototype */ {
-
- /** @private */
- init: function() {
- set(this, 'location', get(this, 'location') || window.location);
- },
-
- /**
- @private
-
- Returns the current `location.hash`, minus the '#' at the front.
- */
- getURL: function() {
- return get(this, 'location').hash.substr(1);
- },
-
- /**
- @private
-
- Set the `location.hash` and remembers what was set. This prevents
- `onUpdateURL` callbacks from triggering when the hash was set by
- `HashLocation`.
- */
- setURL: function(path) {
- get(this, 'location').hash = path;
- set(this, 'lastSetURL', path);
- },
-
- /**
- @private
-
- Register a callback to be invoked when the hash changes. These
- callbacks will execute when the user presses the back or forward
- button, but not after `setURL` is invoked.
- */
- onUpdateURL: function(callback) {
- var self = this;
- var guid = Ember.guidFor(this);
-
- Ember.$(window).bind('hashchange.ember-location-'+guid, function() {
- var path = location.hash.substr(1);
- if (get(self, 'lastSetURL') === path) { return; }
-
- set(self, 'lastSetURL', null);
-
- callback(location.hash.substr(1));
- });
- },
-
- /**
- @private
-
- Given a URL, formats it to be placed into the page as part
- of an element's `href` attribute.
-
- This is used, for example, when using the {{action}} helper
- to generate a URL based on an event.
- */
- formatURL: function(url) {
- return '#'+url;
- },
-
- /** @private */
- willDestroy: function() {
- var guid = Ember.guidFor(this);
-
- Ember.$(window).unbind('hashchange.ember-location-'+guid);
- }
-});
-
-Ember.Location.registerImplementation('hash', Ember.HashLocation);
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- Ember.HistoryLocation implements the location API using the browser's
- history.pushState API.
-
- @extends Ember.Object
-*/
-Ember.HistoryLocation = Ember.Object.extend(
-/** @scope Ember.HistoryLocation.prototype */ {
-
- /** @private */
- init: function() {
- set(this, 'location', get(this, 'location') || window.location);
- set(this, '_initialURL', get(this, 'location').pathname);
- },
-
- /**
- Will be pre-pended to path upon state change
- */
- rootURL: '/',
-
- /**
- @private
-
- Used to give history a starting reference
- */
- _initialURL: null,
-
- /**
- @private
-
- Returns the current `location.pathname`.
- */
- getURL: function() {
- return get(this, 'location').pathname;
- },
-
- /**
- @private
-
- Uses `history.pushState` to update the url without a page reload.
- */
- setURL: function(path) {
- var state = window.history.state,
- initialURL = get(this, '_initialURL');
-
- path = this.formatPath(path);
-
- if ((initialURL !== path && !state) || (state && state.path !== path)) {
- window.history.pushState({ path: path }, null, path);
- }
- },
-
- /**
- @private
-
- Register a callback to be invoked whenever the browser
- history changes, including using forward and back buttons.
- */
- onUpdateURL: function(callback) {
- var guid = Ember.guidFor(this);
-
- Ember.$(window).bind('popstate.ember-location-'+guid, function(e) {
- callback(location.pathname);
- });
- },
-
- /**
- @private
-
- returns the given path appended to rootURL
- */
- formatPath: function(path) {
- var rootURL = get(this, 'rootURL');
-
- if (path !== '') {
- rootURL = rootURL.replace(/\/$/, '');
- }
-
- return rootURL + path;
- },
-
- /**
- @private
-
- Used when using {{action}} helper. Since no formatting
- is required we just return the url given.
- */
- formatURL: function(url) {
- return url;
- },
-
- /** @private */
- willDestroy: function() {
- var guid = Ember.guidFor(this);
-
- Ember.$(window).unbind('popstate.ember-location-'+guid);
- }
-});
-
-Ember.Location.registerImplementation('history', Ember.HistoryLocation);
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- Ember.NoneLocation does not interact with the browser. It is useful for
- testing, or when you need to manage state with your Router, but temporarily
- don't want it to muck with the URL (for example when you embed your
- application in a larger page).
-
- @extends Ember.Object
-*/
-Ember.NoneLocation = Ember.Object.extend(
-/** @scope Ember.NoneLocation.prototype */ {
- path: '',
-
- getURL: function() {
- return get(this, 'path');
- },
-
- setURL: function(path) {
- set(this, 'path', path);
- },
-
- onUpdateURL: function(callback) {
- // We are not wired up to the browser, so we'll never trigger the callback.
- },
-
- formatURL: function(url) {
- // The return value is not overly meaningful, but we do not want to throw
- // errors when test code renders templates containing {{action href=true}}
- // helpers.
- return url;
- }
-});
-
-Ember.Location.registerImplementation('none', Ember.NoneLocation);
-
-})();
-
-
-
-(function() {
-
-})();
-
-
-
-(function() {
-
-})();
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-Ember.assert("Ember Views require jQuery 1.7", window.jQuery && (window.jQuery().jquery.match(/^1\.7(\.\d+)?(pre|rc\d?)?/) || Ember.ENV.FORCE_JQUERY));
-Ember.$ = window.jQuery;
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents
-var dragEvents = Ember.String.w('dragstart drag dragenter dragleave dragover drop dragend');
-
-// Copies the `dataTransfer` property from a browser event object onto the
-// jQuery event object for the specified events
-Ember.EnumerableUtils.forEach(dragEvents, function(eventName) {
- Ember.$.event.fixHooks[eventName] = { props: ['dataTransfer'] };
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-var get = Ember.get, set = Ember.set;
-var indexOf = Ember.ArrayPolyfills.indexOf;
-
-/** @private */
-var ClassSet = function() {
- this.seen = {};
- this.list = [];
-};
-
-ClassSet.prototype = {
- add: function(string) {
- if (string in this.seen) { return; }
- this.seen[string] = true;
-
- this.list.push(string);
- },
-
- toDOM: function() {
- return this.list.join(" ");
- }
-};
-
-/**
- @class
-
- Ember.RenderBuffer gathers information regarding the a view and generates the
- final representation. Ember.RenderBuffer will generate HTML which can be pushed
- to the DOM.
-
- @extends Ember.Object
-*/
-Ember.RenderBuffer = function(tagName) {
- return new Ember._RenderBuffer(tagName);
-};
-
-Ember._RenderBuffer = function(tagName) {
- this.elementTag = tagName;
- this.childBuffers = [];
-};
-
-Ember._RenderBuffer.prototype =
-/** @scope Ember.RenderBuffer.prototype */ {
-
- /**
- Array of class-names which will be applied in the class="" attribute
-
- You should not maintain this array yourself, rather, you should use
- the addClass() method of Ember.RenderBuffer.
-
- @type Array
- @default []
- */
- elementClasses: null,
-
- /**
- The id in of the element, to be applied in the id="" attribute
-
- You should not set this property yourself, rather, you should use
- the id() method of Ember.RenderBuffer.
-
- @type String
- @default null
- */
- elementId: null,
-
- /**
- A hash keyed on the name of the attribute and whose value will be
- applied to that attribute. For example, if you wanted to apply a
- data-view="Foo.bar" property to an element, you would set the
- elementAttributes hash to {'data-view':'Foo.bar'}
-
- You should not maintain this hash yourself, rather, you should use
- the attr() method of Ember.RenderBuffer.
-
- @type Hash
- @default {}
- */
- elementAttributes: null,
-
- /**
- The tagname of the element an instance of Ember.RenderBuffer represents.
-
- Usually, this gets set as the first parameter to Ember.RenderBuffer. For
- example, if you wanted to create a `p` tag, then you would call
-
- Ember.RenderBuffer('p')
-
- @type String
- @default null
- */
- elementTag: null,
-
- /**
- A hash keyed on the name of the style attribute and whose value will
- be applied to that attribute. For example, if you wanted to apply a
- background-color:black;" style to an element, you would set the
- elementStyle hash to {'background-color':'black'}
-
- You should not maintain this hash yourself, rather, you should use
- the style() method of Ember.RenderBuffer.
-
- @type Hash
- @default {}
- */
- elementStyle: null,
-
- /**
- Nested RenderBuffers will set this to their parent RenderBuffer
- instance.
-
- @type Ember._RenderBuffer
- */
- parentBuffer: null,
-
- /**
- Adds a string of HTML to the RenderBuffer.
-
- @param {String} string HTML to push into the buffer
- @returns {Ember.RenderBuffer} this
- */
- push: function(string) {
- this.childBuffers.push(String(string));
- return this;
- },
-
- /**
- Adds a class to the buffer, which will be rendered to the class attribute.
-
- @param {String} className Class name to add to the buffer
- @returns {Ember.RenderBuffer} this
- */
- addClass: function(className) {
- // lazily create elementClasses
- var elementClasses = this.elementClasses = (this.elementClasses || new ClassSet());
- this.elementClasses.add(className);
-
- return this;
- },
-
- /**
- Sets the elementID to be used for the element.
-
- @param {String} id
- @returns {Ember.RenderBuffer} this
- */
- id: function(id) {
- this.elementId = id;
- return this;
- },
-
- // duck type attribute functionality like jQuery so a render buffer
- // can be used like a jQuery object in attribute binding scenarios.
-
- /**
- Adds an attribute which will be rendered to the element.
-
- @param {String} name The name of the attribute
- @param {String} value The value to add to the attribute
- @returns {Ember.RenderBuffer|String} this or the current attribute value
- */
- attr: function(name, value) {
- var attributes = this.elementAttributes = (this.elementAttributes || {});
-
- if (arguments.length === 1) {
- return attributes[name];
- } else {
- attributes[name] = value;
- }
-
- return this;
- },
-
- /**
- Remove an attribute from the list of attributes to render.
-
- @param {String} name The name of the attribute
- @returns {Ember.RenderBuffer} this
- */
- removeAttr: function(name) {
- var attributes = this.elementAttributes;
- if (attributes) { delete attributes[name]; }
-
- return this;
- },
-
- /**
- Adds a style to the style attribute which will be rendered to the element.
-
- @param {String} name Name of the style
- @param {String} value
- @returns {Ember.RenderBuffer} this
- */
- style: function(name, value) {
- var style = this.elementStyle = (this.elementStyle || {});
-
- this.elementStyle[name] = value;
- return this;
- },
-
- /**
- Create a new child render buffer from a parent buffer. Optionally set
- additional properties on the buffer. Optionally invoke a callback
- with the newly created buffer.
-
- This is a primitive method used by other public methods: `begin`,
- `prepend`, `replaceWith`, `insertAfter`.
-
- @private
- @param {String} tagName Tag name to use for the child buffer's element
- @param {Ember._RenderBuffer} parent The parent render buffer that this
- buffer should be appended to.
- @param {Function} fn A callback to invoke with the newly created buffer.
- @param {Object} other Additional properties to add to the newly created
- buffer.
- */
- newBuffer: function(tagName, parent, fn, other) {
- var buffer = new Ember._RenderBuffer(tagName);
- buffer.parentBuffer = parent;
-
- if (other) { Ember.$.extend(buffer, other); }
- if (fn) { fn.call(this, buffer); }
-
- return buffer;
- },
-
- /**
- Replace the current buffer with a new buffer. This is a primitive
- used by `remove`, which passes `null` for `newBuffer`, and `replaceWith`,
- which passes the new buffer it created.
-
- @private
- @param {Ember._RenderBuffer} buffer The buffer to insert in place of
- the existing buffer.
- */
- replaceWithBuffer: function(newBuffer) {
- var parent = this.parentBuffer;
- if (!parent) { return; }
-
- var childBuffers = parent.childBuffers;
-
- var index = indexOf.call(childBuffers, this);
-
- if (newBuffer) {
- childBuffers.splice(index, 1, newBuffer);
- } else {
- childBuffers.splice(index, 1);
- }
- },
-
- /**
- Creates a new Ember.RenderBuffer object with the provided tagName as
- the element tag and with its parentBuffer property set to the current
- Ember.RenderBuffer.
-
- @param {String} tagName Tag name to use for the child buffer's element
- @returns {Ember.RenderBuffer} A new RenderBuffer object
- */
- begin: function(tagName) {
- return this.newBuffer(tagName, this, function(buffer) {
- this.childBuffers.push(buffer);
- });
- },
-
- /**
- Prepend a new child buffer to the current render buffer.
-
- @param {String} tagName Tag name to use for the child buffer's element
- */
- prepend: function(tagName) {
- return this.newBuffer(tagName, this, function(buffer) {
- this.childBuffers.splice(0, 0, buffer);
- });
- },
-
- /**
- Replace the current buffer with a new render buffer.
-
- @param {String} tagName Tag name to use for the new buffer's element
- */
- replaceWith: function(tagName) {
- var parentBuffer = this.parentBuffer;
-
- return this.newBuffer(tagName, parentBuffer, function(buffer) {
- this.replaceWithBuffer(buffer);
- });
- },
-
- /**
- Insert a new render buffer after the current render buffer.
-
- @param {String} tagName Tag name to use for the new buffer's element
- */
- insertAfter: function(tagName) {
- var parentBuffer = get(this, 'parentBuffer');
-
- return this.newBuffer(tagName, parentBuffer, function(buffer) {
- var siblings = parentBuffer.childBuffers;
- var index = indexOf.call(siblings, this);
- siblings.splice(index + 1, 0, buffer);
- });
- },
-
- /**
- Closes the current buffer and adds its content to the parentBuffer.
-
- @returns {Ember.RenderBuffer} The parentBuffer, if one exists. Otherwise, this
- */
- end: function() {
- var parent = this.parentBuffer;
- return parent || this;
- },
-
- remove: function() {
- this.replaceWithBuffer(null);
- },
-
- /**
- @returns {DOMElement} The element corresponding to the generated HTML
- of this buffer
- */
- element: function() {
- return Ember.$(this.string())[0];
- },
-
- /**
- Generates the HTML content for this buffer.
-
- @returns {String} The generated HTMl
- */
- string: function() {
- var content = '', tag = this.elementTag, openTag;
-
- if (tag) {
- var id = this.elementId,
- classes = this.elementClasses,
- attrs = this.elementAttributes,
- style = this.elementStyle,
- styleBuffer = '', prop;
-
- openTag = ["<" + tag];
-
- if (id) { openTag.push('id="' + this._escapeAttribute(id) + '"'); }
- if (classes) { openTag.push('class="' + this._escapeAttribute(classes.toDOM()) + '"'); }
-
- if (style) {
- for (prop in style) {
- if (style.hasOwnProperty(prop)) {
- styleBuffer += (prop + ':' + this._escapeAttribute(style[prop]) + ';');
- }
- }
-
- openTag.push('style="' + styleBuffer + '"');
- }
-
- if (attrs) {
- for (prop in attrs) {
- if (attrs.hasOwnProperty(prop)) {
- openTag.push(prop + '="' + this._escapeAttribute(attrs[prop]) + '"');
- }
- }
- }
-
- openTag = openTag.join(" ") + '>';
- }
-
- var childBuffers = this.childBuffers;
-
- Ember.ArrayPolyfills.forEach.call(childBuffers, function(buffer) {
- var stringy = typeof buffer === 'string';
- content += (stringy ? buffer : buffer.string());
- });
-
- if (tag) {
- return openTag + content + "</" + tag + ">";
- } else {
- return content;
- }
- },
-
- _escapeAttribute: function(value) {
- // Stolen shamelessly from Handlebars
-
- var escape = {
- "<": "&lt;",
- ">": "&gt;",
- '"': "&quot;",
- "'": "&#x27;",
- "`": "&#x60;"
- };
-
- var badChars = /&(?!\w+;)|[<>"'`]/g;
- var possible = /[&<>"'`]/;
-
- var escapeChar = function(chr) {
- return escape[chr] || "&amp;";
- };
-
- var string = value.toString();
-
- if(!possible.test(string)) { return string; }
- return string.replace(badChars, escapeChar);
- }
-
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
-
-/**
- @ignore
-
- Ember.EventDispatcher handles delegating browser events to their corresponding
- Ember.Views. For example, when you click on a view, Ember.EventDispatcher ensures
- that that view's `mouseDown` method gets called.
-*/
-Ember.EventDispatcher = Ember.Object.extend(
-/** @scope Ember.EventDispatcher.prototype */{
-
- /**
- @private
-
- The root DOM element to which event listeners should be attached. Event
- listeners will be attached to the document unless this is overridden.
-
- Can be specified as a DOMElement or a selector string.
-
- The default body is a string since this may be evaluated before document.body
- exists in the DOM.
-
- @type DOMElement
- @default 'body'
- */
- rootElement: 'body',
-
- /**
- @private
-
- Sets up event listeners for standard browser events.
-
- This will be called after the browser sends a DOMContentReady event. By
- default, it will set up all of the listeners on the document body. If you
- would like to register the listeners on a different element, set the event
- dispatcher's `root` property.
- */
- setup: function(addedEvents) {
- var event, events = {
- touchstart : 'touchStart',
- touchmove : 'touchMove',
- touchend : 'touchEnd',
- touchcancel : 'touchCancel',
- keydown : 'keyDown',
- keyup : 'keyUp',
- keypress : 'keyPress',
- mousedown : 'mouseDown',
- mouseup : 'mouseUp',
- contextmenu : 'contextMenu',
- click : 'click',
- dblclick : 'doubleClick',
- mousemove : 'mouseMove',
- focusin : 'focusIn',
- focusout : 'focusOut',
- mouseenter : 'mouseEnter',
- mouseleave : 'mouseLeave',
- submit : 'submit',
- input : 'input',
- change : 'change',
- dragstart : 'dragStart',
- drag : 'drag',
- dragenter : 'dragEnter',
- dragleave : 'dragLeave',
- dragover : 'dragOver',
- drop : 'drop',
- dragend : 'dragEnd'
- };
-
- Ember.$.extend(events, addedEvents || {});
-
- var rootElement = Ember.$(get(this, 'rootElement'));
-
- Ember.assert(fmt('You cannot use the same root element (%@) multiple times in an Ember.Application', [rootElement.selector || rootElement[0].tagName]), !rootElement.is('.ember-application'));
- Ember.assert('You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application', !rootElement.closest('.ember-application').length);
- Ember.assert('You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application', !rootElement.find('.ember-application').length);
-
- rootElement.addClass('ember-application');
-
- Ember.assert('Unable to add "ember-application" class to rootElement. Make sure you set rootElement to the body or an element in the body.', rootElement.is('.ember-application'));
-
- for (event in events) {
- if (events.hasOwnProperty(event)) {
- this.setupHandler(rootElement, event, events[event]);
- }
- }
- },
-
- /**
- @private
-
- Registers an event listener on the document. If the given event is
- triggered, the provided event handler will be triggered on the target
- view.
-
- If the target view does not implement the event handler, or if the handler
- returns false, the parent view will be called. The event will continue to
- bubble to each successive parent view until it reaches the top.
-
- For example, to have the `mouseDown` method called on the target view when
- a `mousedown` event is received from the browser, do the following:
-
- setupHandler('mousedown', 'mouseDown');
-
- @param {String} event the browser-originated event to listen to
- @param {String} eventName the name of the method to call on the view
- */
- setupHandler: function(rootElement, event, eventName) {
- var self = this;
-
- rootElement.delegate('.ember-view', event + '.ember', function(evt, triggeringManager) {
-
- var view = Ember.View.views[this.id],
- result = true, manager = null;
-
- manager = self._findNearestEventManager(view,eventName);
-
- if (manager && manager !== triggeringManager) {
- result = self._dispatchEvent(manager, evt, eventName, view);
- } else if (view) {
- result = self._bubbleEvent(view,evt,eventName);
- } else {
- evt.stopPropagation();
- }
-
- return result;
- });
-
- rootElement.delegate('[data-ember-action]', event + '.ember', function(evt) {
- var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),
- action = Ember.Handlebars.ActionHelper.registeredActions[actionId],
- handler = action.handler;
-
- if (action.eventName === eventName) {
- return handler(evt);
- }
- });
- },
-
- /** @private */
- _findNearestEventManager: function(view, eventName) {
- var manager = null;
-
- while (view) {
- manager = get(view, 'eventManager');
- if (manager && manager[eventName]) { break; }
-
- view = get(view, 'parentView');
- }
-
- return manager;
- },
-
- /** @private */
- _dispatchEvent: function(object, evt, eventName, view) {
- var result = true;
-
- var handler = object[eventName];
- if (Ember.typeOf(handler) === 'function') {
- result = handler.call(object, evt, view);
- // Do not preventDefault in eventManagers.
- evt.stopPropagation();
- }
- else {
- result = this._bubbleEvent(view, evt, eventName);
- }
-
- return result;
- },
-
- /** @private */
- _bubbleEvent: function(view, evt, eventName) {
- return Ember.run(function() {
- return view.handleEvent(eventName, evt);
- });
- },
-
- /** @private */
- destroy: function() {
- var rootElement = get(this, 'rootElement');
- Ember.$(rootElement).undelegate('.ember').removeClass('ember-application');
- return this._super();
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-// Add a new named queue for rendering views that happens
-// after bindings have synced.
-var queues = Ember.run.queues;
-queues.splice(Ember.$.inArray('actions', queues)+1, 0, 'render');
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-Ember.ControllerMixin.reopen({
-
- target: null,
- controllers: null,
- namespace: null,
- view: null,
-
- /**
- `connectOutlet` creates a new instance of a provided view
- class, wires it up to its associated controller, and
- assigns the new view to a property on the current controller.
-
- The purpose of this method is to enable views that use
- outlets to quickly assign new views for a given outlet.
-
- For example, an application view's template may look like
- this:
-
- <h1>My Blog</h1>
- {{outlet}}
-
- The view for this outlet is specified by assigning a
- `view` property to the application's controller. The
- following code will assign a new `App.PostsView` to
- that outlet:
-
- applicationController.connectOutlet('posts');
-
- In general, you will also want to assign a controller
- to the newly created view. By convention, a controller
- named `postsController` will be assigned as the view's
- controller.
-
- In an application initialized using `app.initialize(router)`,
- `connectOutlet` will look for `postsController` on the
- router. The initialization process will automatically
- create an instance of `App.PostsController` called
- `postsController`, so you don't need to do anything
- beyond `connectOutlet` to assign your view and wire it
- up to its associated controller.
-
- You can supply a `content` for the controller by supplying
- a final argument after the view class:
-
- applicationController.connectOutlet('posts', App.Post.find());
-
- You can specify a particular outlet to use. For example, if your main
- template looks like:
-
- <h1>My Blog</h1>
- {{outlet master}}
- {{outlet detail}}
-
- You can assign an `App.PostsView` to the master outlet:
-
- applicationController.connectOutlet({
- name: 'posts',
- outletName: 'master',
- context: App.Post.find()
- });
-
- You can write this as:
-
- applicationController.connectOutlet('master', 'posts', App.Post.find());
-
- @param {String} outletName a name for the outlet to set
- @param {String} name a view/controller pair name
- @param {Object} context a context object to assign to the
- controller's `content` property, if a controller can be
- found (optional)
- */
- connectOutlet: function(name, context) {
- // Normalize arguments. Supported arguments:
- //
- // name
- // name, context
- // outletName, name
- // outletName, name, context
- // options
- //
- // The options hash has the following keys:
- //
- // name: the name of the controller and view
- // to use. If this is passed, the name
- // determines the view and controller.
- // outletName: the name of the outlet to
- // fill in. default: 'view'
- // viewClass: the class of the view to instantiate
- // controller: the controller instance to pass
- // to the view
- // context: an object that should become the
- // controller's `content` and thus the
- // template's context.
-
- var outletName, viewClass, view, controller, options;
-
- if (Ember.typeOf(context) === 'string') {
- outletName = name;
- name = context;
- context = arguments[2];
- }
-
- if (arguments.length === 1) {
- if (Ember.typeOf(name) === 'object') {
- options = name;
- outletName = options.outletName;
- name = options.name;
- viewClass = options.viewClass;
- controller = options.controller;
- context = options.context;
- }
- } else {
- options = {};
- }
-
- outletName = outletName || 'view';
-
- Ember.assert("You must supply a name or a view class to connectOutlets, but not both", (!!name && !viewClass && !controller) || (!name && !!viewClass));
-
- if (name) {
- var namespace = get(this, 'namespace'),
- controllers = get(this, 'controllers');
-
- var viewClassName = name.charAt(0).toUpperCase() + name.substr(1) + "View";
- viewClass = get(namespace, viewClassName);
- controller = get(controllers, name + 'Controller');
-
- Ember.assert("The name you supplied " + name + " did not resolve to a view " + viewClassName, !!viewClass);
- Ember.assert("The name you supplied " + name + " did not resolve to a controller " + name + 'Controller', (!!controller && !!context) || !context);
- }
-
- if (controller && context) { controller.set('content', context); }
- view = viewClass.create();
- if (controller) { set(view, 'controller', controller); }
- set(this, outletName, view);
-
- return view;
- },
-
- /**
- Convenience method to connect controllers. This method makes other controllers
- available on the controller the method was invoked on.
-
- For example, to make the `personController` and the `postController` available
- on the `overviewController`, you would call:
-
- overviewController.connectControllers('person', 'post');
-
- @param {String...} controllerNames the controllers to make available
- */
- connectControllers: function() {
- var controllers = get(this, 'controllers'),
- controllerNames = Array.prototype.slice.apply(arguments),
- controllerName;
-
- for (var i=0, l=controllerNames.length; i<l; i++) {
- controllerName = controllerNames[i] + 'Controller';
- set(this, controllerName, get(controllers, controllerName));
- }
- }
-});
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set, addObserver = Ember.addObserver;
-var meta = Ember.meta, fmt = Ember.String.fmt;
-var a_slice = [].slice;
-var a_forEach = Ember.EnumerableUtils.forEach;
-
-var childViewsProperty = Ember.computed(function() {
- var childViews = this._childViews;
-
- var ret = Ember.A();
-
- a_forEach(childViews, function(view) {
- if (view.isVirtual) {
- ret.pushObjects(get(view, 'childViews'));
- } else {
- ret.push(view);
- }
- });
-
- return ret;
-}).property().cacheable();
-
-var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
-Ember.warn("The way that the {{view}} helper affects templates is about to change. Previously, templates inside child views would use the new view as the context. Soon, views will preserve their parent context when rendering their template. You can opt-in early to the new behavior by setting `ENV.VIEW_PRESERVES_CONTEXT = true`. For more information, see https://gist.github.com/2494968. You should update your templates as soon as possible; this default will change soon, and the option will be eliminated entirely before the 1.0 release.", VIEW_PRESERVES_CONTEXT);
-
-/**
- @static
-
- Global hash of shared templates. This will automatically be populated
- by the build tools so that you can store your Handlebars templates in
- separate files that get loaded into JavaScript at buildtime.
-
- @type Hash
-*/
-Ember.TEMPLATES = {};
-
-var invokeForState = {
- preRender: {},
- inBuffer: {},
- hasElement: {},
- inDOM: {},
- destroyed: {}
-};
-
-/**
- @class
-
- `Ember.View` is the class in Ember responsible for encapsulating templates of HTML
- content, combining templates with data to render as sections of a page's DOM, and
- registering and responding to user-initiated events.
-
- ## HTML Tag
- The default HTML tag name used for a view's DOM representation is `div`. This can be
- customized by setting the `tagName` property. The following view class:
-
- ParagraphView = Ember.View.extend({
- tagName: 'em'
- })
-
- Would result in instances with the following HTML:
-
- <em id="ember1" class="ember-view"></em>
-
- ## HTML `class` Attribute
- The HTML `class` attribute of a view's tag can be set by providing a `classNames` property
- that is set to an array of strings:
-
- MyView = Ember.View.extend({
- classNames: ['my-class', 'my-other-class']
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view my-class my-other-class"></div>
-
- `class` attribute values can also be set by providing a `classNameBindings` property
- set to an array of properties names for the view. The return value of these properties
- will be added as part of the value for the view's `class` attribute. These properties
- can be computed properties:
-
- MyView = Ember.View.extend({
- classNameBindings: ['propertyA', 'propertyB'],
- propertyA: 'from-a',
- propertyB: function(){
- if(someLogic){ return 'from-b'; }
- }.property()
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view from-a from-b"></div>
-
- If the value of a class name binding returns a boolean the property name itself
- will be used as the class name if the property is true. The class name will
- not be added if the value is `false` or `undefined`.
-
- MyView = Ember.View.extend({
- classNameBindings: ['hovered'],
- hovered: true
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view hovered"></div>
-
- When using boolean class name bindings you can supply a string value other than the
- property name for use as the `class` HTML attribute by appending the preferred value after
- a ":" character when defining the binding:
-
- MyView = Ember.View.extend({
- classNameBindings: ['awesome:so-very-cool'],
- awesome: true
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view so-very-cool"></div>
-
-
- Boolean value class name bindings whose property names are in a camelCase-style
- format will be converted to a dasherized format:
-
- MyView = Ember.View.extend({
- classNameBindings: ['isUrgent'],
- isUrgent: true
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view is-urgent"></div>
-
-
- Class name bindings can also refer to object values that are found by
- traversing a path relative to the view itself:
-
- MyView = Ember.View.extend({
- classNameBindings: ['messages.empty']
- messages: Ember.Object.create({
- empty: true
- })
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view empty"></div>
-
-
- If you want to add a class name for a property which evaluates to true and
- and a different class name if it evaluates to false, you can pass a binding
- like this:
-
- // Applies 'enabled' class when isEnabled is true and 'disabled' when isEnabled is false
- Ember.View.create({
- classNameBindings: ['isEnabled:enabled:disabled']
- isEnabled: true
- });
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view enabled"></div>
-
- When isEnabled is `false`, the resulting HTML reprensentation looks like this:
-
- <div id="ember1" class="ember-view disabled"></div>
-
- This syntax offers the convenience to add a class if a property is `false`:
-
- // Applies no class when isEnabled is true and class 'disabled' when isEnabled is false
- Ember.View.create({
- classNameBindings: ['isEnabled::disabled']
- isEnabled: true
- });
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view"></div>
-
- When the `isEnabled` property on the view is set to `false`, it will result
- in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view disabled"></div>
-
-
- Updates to the the value of a class name binding will result in automatic update
- of the HTML `class` attribute in the view's rendered HTML representation.
- If the value becomes `false` or `undefined` the class name will be removed.
-
- Both `classNames` and `classNameBindings` are concatenated properties.
- See `Ember.Object` documentation for more information about concatenated properties.
-
- ## HTML Attributes
- The HTML attribute section of a view's tag can be set by providing an `attributeBindings`
- property set to an array of property names on the view. The return value of these properties
- will be used as the value of the view's HTML associated attribute:
-
- AnchorView = Ember.View.extend({
- tagName: 'a',
- attributeBindings: ['href'],
- href: 'http://google.com'
- })
-
- Will result in view instances with an HTML representation of:
-
- <a id="ember1" class="ember-view" href="http://google.com"></a>
-
- If the return value of an `attributeBindings` monitored property is a boolean
- the property will follow HTML's pattern of repeating the attribute's name as
- its value:
-
- MyTextInput = Ember.View.extend({
- tagName: 'input',
- attributeBindings: ['disabled'],
- disabled: true
- })
-
- Will result in view instances with an HTML representation of:
-
- <input id="ember1" class="ember-view" disabled="disabled" />
-
- `attributeBindings` can refer to computed properties:
-
- MyTextInput = Ember.View.extend({
- tagName: 'input',
- attributeBindings: ['disabled'],
- disabled: function(){
- if (someLogic) {
- return true;
- } else {
- return false;
- }
- }.property()
- })
-
- Updates to the the property of an attribute binding will result in automatic update
- of the HTML attribute in the view's rendered HTML representation.
-
- `attributeBindings` is a concatenated property. See `Ember.Object` documentation
- for more information about concatenated properties.
-
- ## Templates
- The HTML contents of a view's rendered representation are determined by its template.
- Templates can be any function that accepts an optional context parameter and returns
- a string of HTML that will be inserted within the view's tag. Most
- typically in Ember this function will be a compiled Ember.Handlebars template.
-
- AView = Ember.View.extend({
- template: Ember.Handlebars.compile('I am the template')
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view">I am the template</div>
-
- The default context of the compiled template will be the view instance itself:
-
- AView = Ember.View.extend({
- template: Ember.Handlebars.compile('Hello {{excitedGreeting}}')
- })
-
- aView = AView.create({
- content: Ember.Object.create({
- firstName: 'Barry'
- })
- excitedGreeting: function(){
- return this.get("content.firstName") + "!!!"
- }
- })
-
- Will result in an HTML representation of:
-
- <div id="ember1" class="ember-view">Hello Barry!!!</div>
-
- Within an Ember application is more common to define a Handlebars templates as
- part of a page:
-
- <script type='text/x-handlebars' data-template-name='some-template'>
- Hello
- </script>
-
- And associate it by name using a view's `templateName` property:
-
- AView = Ember.View.extend({
- templateName: 'some-template'
- })
-
- Using a value for `templateName` that does not have a Handlebars template with a
- matching `data-template-name` attribute will throw an error.
-
- Assigning a value to both `template` and `templateName` properties will throw an error.
-
- For views classes that may have a template later defined (e.g. as the block portion of a `{{view}}`
- Handlebars helper call in another template or in a subclass), you can provide a `defaultTemplate`
- property set to compiled template function. If a template is not later provided for the view
- instance the `defaultTemplate` value will be used:
-
- AView = Ember.View.extend({
- defaultTemplate: Ember.Handlebars.compile('I was the default'),
- template: null,
- templateName: null
- })
-
- Will result in instances with an HTML representation of:
-
- <div id="ember1" class="ember-view">I was the default</div>
-
- If a `template` or `templateName` is provided it will take precedence over `defaultTemplate`:
-
- AView = Ember.View.extend({
- defaultTemplate: Ember.Handlebars.compile('I was the default')
- })
-
- aView = AView.create({
- template: Ember.Handlebars.compile('I was the template, not default')
- })
-
- Will result in the following HTML representation when rendered:
-
- <div id="ember1" class="ember-view">I was the template, not default</div>
-
- ## Layouts
- Views can have a secondary template that wraps their main template. Like
- primary templates, layouts can be any function that accepts an optional context
- parameter and returns a string of HTML that will be inserted inside view's tag. Views whose HTML
- element is self closing (e.g. `<input />`) cannot have a layout and this property will be ignored.
-
- Most typically in Ember a layout will be a compiled Ember.Handlebars template.
-
- A view's layout can be set directly with the `layout` property or reference an
- existing Handlebars template by name with the `layoutName` property.
-
- A template used as a layout must contain a single use of the Handlebars `{{yield}}`
- helper. The HTML contents of a view's rendered `template` will be inserted at this location:
-
- AViewWithLayout = Ember.View.extend({
- layout: Ember.Handlebars.compile("<div class='my-decorative-class'>{{yield}}</div>")
- template: Ember.Handlebars.compile("I got wrapped"),
- })
-
- Will result in view instances with an HTML representation of:
-
- <div id="ember1" class="ember-view">
- <div class="my-decorative-class">
- I got wrapped
- </div>
- </div>
-
- See `Handlebars.helpers.yield` for more information.
-
- ## Responding to Browser Events
- Views can respond to user-initiated events in one of three ways: method implementation,
- through an event manager, and through `{{action}}` helper use in their template or layout.
-
- ### Method Implementation
- Views can respond to user-initiated events by implementing a method that matches the
- event name. A `jQuery.Event` object will be passed as the argument to this method.
-
- AView = Ember.View.extend({
- click: function(event){
- // will be called when when an instance's
- // rendered element is clicked
- }
- })
-
- ### Event Managers
- Views can define an object as their `eventManager` property. This object can then
- implement methods that match the desired event names. Matching events that occur
- on the view's rendered HTML or the rendered HTML of any of its DOM descendants
- will trigger this method. A `jQuery.Event` object will be passed as the first
- argument to the method and an `Ember.View` object as the second. The `Ember.View`
- will be the view whose rendered HTML was interacted with. This may be the view with
- the `eventManager` property or one of its descendent views.
-
- AView = Ember.View.extend({
- eventManager: Ember.Object.create({
- doubleClick: function(event, view){
- // will be called when when an instance's
- // rendered element or any rendering
- // of this views's descendent
- // elements is clicked
- }
- })
- })
-
-
- An event defined for an event manager takes precedence over events of the same
- name handled through methods on the view.
-
-
- AView = Ember.View.extend({
- mouseEnter: function(event){
- // will never trigger.
- },
- eventManager: Ember.Object.create({
- mouseEnter: function(event, view){
- // takes presedence over AView#mouseEnter
- }
- })
- })
-
- Similarly a view's event manager will take precedence for events of any views
- rendered as a descendent. A method name that matches an event name will not be called
- if the view instance was rendered inside the HTML representation of a view that has
- an `eventManager` property defined that handles events of the name. Events not handled
- by the event manager will still trigger method calls on the descendent.
-
- OuterView = Ember.View.extend({
- template: Ember.Handlebars.compile("outer {{#view InnerView}}inner{{/view}} outer"),
- eventManager: Ember.Object.create({
- mouseEnter: function(event, view){
- // view might be instance of either
- // OutsideView or InnerView depending on
- // where on the page the user interaction occured
- }
- })
- })
-
- InnerView = Ember.View.extend({
- click: function(event){
- // will be called if rendered inside
- // an OuterView because OuterView's
- // eventManager doesn't handle click events
- },
- mouseEnter: function(event){
- // will never be called if rendered inside
- // an OuterView.
- }
- })
-
- ### Handlebars `{{action}}` Helper
- See `Handlebars.helpers.action`.
-
- ### Event Names
- Possible events names for any of the responding approaches described above are:
-
- Touch events: 'touchStart', 'touchMove', 'touchEnd', 'touchCancel'
-
- Keyboard events: 'keyDown', 'keyUp', 'keyPress'
-
- Mouse events: 'mouseDown', 'mouseUp', 'contextMenu', 'click', 'doubleClick', 'mouseMove',
- 'focusIn', 'focusOut', 'mouseEnter', 'mouseLeave'
-
- Form events: 'submit', 'change', 'focusIn', 'focusOut', 'input'
-
- HTML5 drag and drop events: 'dragStart', 'drag', 'dragEnter', 'dragLeave', 'drop', 'dragEnd'
-
- ## Handlebars `{{view}}` Helper
- Other `Ember.View` instances can be included as part of a view's template by using the `{{view}}`
- Handlebars helper. See `Handlebars.helpers.view` for additional information.
-
- @extends Ember.Object
- @extends Ember.Evented
-*/
-Ember.View = Ember.Object.extend(Ember.Evented,
-/** @scope Ember.View.prototype */ {
-
- /** @private */
- concatenatedProperties: ['classNames', 'classNameBindings', 'attributeBindings'],
-
- /**
- @type Boolean
- @default true
- @constant
- */
- isView: true,
-
- // ..........................................................
- // TEMPLATE SUPPORT
- //
-
- /**
- The name of the template to lookup if no template is provided.
-
- Ember.View will look for a template with this name in this view's
- `templates` object. By default, this will be a global object
- shared in `Ember.TEMPLATES`.
-
- @type String
- @default null
- */
- templateName: null,
-
- /**
- The name of the layout to lookup if no layout is provided.
-
- Ember.View will look for a template with this name in this view's
- `templates` object. By default, this will be a global object
- shared in `Ember.TEMPLATES`.
-
- @type String
- @default null
- */
- layoutName: null,
-
- /**
- The hash in which to look for `templateName`.
-
- @type Ember.Object
- @default Ember.TEMPLATES
- */
- templates: Ember.TEMPLATES,
-
- /**
- The template used to render the view. This should be a function that
- accepts an optional context parameter and returns a string of HTML that
- will be inserted into the DOM relative to its parent view.
-
- In general, you should set the `templateName` property instead of setting
- the template yourself.
-
- @field
- @type Function
- */
- template: Ember.computed(function(key, value) {
- if (value !== undefined) { return value; }
-
- var templateName = get(this, 'templateName'),
- template = this.templateForName(templateName, 'template');
-
- return template || get(this, 'defaultTemplate');
- }).property('templateName').cacheable(),
-
- /**
- The controller managing this view. If this property is set, it will be
- made available for use by the template.
-
- @type Object
- */
- controller: Ember.computed(function(key, value) {
- var parentView;
-
- if (arguments.length === 2) {
- return value;
- } else {
- parentView = get(this, 'parentView');
- return parentView ? get(parentView, 'controller') : null;
- }
- }).property().cacheable(),
-
- /**
- A view may contain a layout. A layout is a regular template but
- supersedes the `template` property during rendering. It is the
- responsibility of the layout template to retrieve the `template`
- property from the view (or alternatively, call `Handlebars.helpers.yield`,
- `{{yield}}`) to render it in the correct location.
-
- This is useful for a view that has a shared wrapper, but which delegates
- the rendering of the contents of the wrapper to the `template` property
- on a subclass.
-
- @field
- @type Function
- */
- layout: Ember.computed(function(key, value) {
- if (arguments.length === 2) { return value; }
-
- var layoutName = get(this, 'layoutName'),
- layout = this.templateForName(layoutName, 'layout');
-
- return layout || get(this, 'defaultLayout');
- }).property('layoutName').cacheable(),
-
- templateForName: function(name, type) {
- if (!name) { return; }
-
- var templates = get(this, 'templates'),
- template = get(templates, name);
-
- if (!template) {
- throw new Ember.Error(fmt('%@ - Unable to find %@ "%@".', [this, type, name]));
- }
-
- return template;
- },
-
- /**
- The object from which templates should access properties.
-
- This object will be passed to the template function each time the render
- method is called, but it is up to the individual function to decide what
- to do with it.
-
- By default, this will be the view itself.
-
- @type Object
- */
- context: Ember.computed(function(key, value) {
- if (arguments.length === 2) {
- set(this, '_context', value);
- return value;
- } else {
- return get(this, '_context');
- }
- }).cacheable(),
-
- /**
- @private
-
- Private copy of the view's template context. This can be set directly
- by Handlebars without triggering the observer that causes the view
- to be re-rendered.
-
- The context of a view is looked up as follows:
-
- 1. Specified controller
- 2. Supplied context (usually by Handlebars)
- 3. `parentView`'s context (for a child of a ContainerView)
-
- The code in Handlebars that overrides the `_context` property first
- checks to see whether the view has a specified controller. This is
- something of a hack and should be revisited.
- */
- _context: Ember.computed(function(key, value) {
- var parentView, controller, context;
-
- if (arguments.length === 2) {
- return value;
- }
-
- if (VIEW_PRESERVES_CONTEXT) {
- if (controller = get(this, 'controller')) {
- return controller;
- }
-
- parentView = get(this, '_parentView');
- if (parentView) {
- return get(parentView, '_context');
- }
- }
-
- return this;
- }).cacheable(),
-
- /**
- If a value that affects template rendering changes, the view should be
- re-rendered to reflect the new value.
-
- @private
- */
- _displayPropertyDidChange: Ember.observer(function() {
- this.rerender();
- }, 'context', 'controller'),
-
- /**
- If the view is currently inserted into the DOM of a parent view, this
- property will point to the parent of the view.
-
- @type Ember.View
- @default null
- */
- parentView: Ember.computed(function() {
- var parent = get(this, '_parentView');
-
- if (parent && parent.isVirtual) {
- return get(parent, 'parentView');
- } else {
- return parent;
- }
- }).property('_parentView').volatile(),
-
- _parentView: null,
-
- // return the current view, not including virtual views
- concreteView: Ember.computed(function() {
- if (!this.isVirtual) { return this; }
- else { return get(this, 'parentView'); }
- }).property('_parentView').volatile(),
-
- /**
- If false, the view will appear hidden in DOM.
-
- @type Boolean
- @default null
- */
- isVisible: true,
-
- /**
- Array of child views. You should never edit this array directly.
- Instead, use appendChild and removeFromParent.
-
- @private
- @type Array
- @default []
- */
- childViews: childViewsProperty,
-
- _childViews: [],
-
- /**
- When it's a virtual view, we need to notify the parent that their
- childViews will change.
- */
- _childViewsWillChange: Ember.beforeObserver(function() {
- if (this.isVirtual) {
- var parentView = get(this, 'parentView');
- if (parentView) { Ember.propertyWillChange(parentView, 'childViews'); }
- }
- }, 'childViews'),
-
- /**
- When it's a virtual view, we need to notify the parent that their
- childViews did change.
- */
- _childViewsDidChange: Ember.observer(function() {
- if (this.isVirtual) {
- var parentView = get(this, 'parentView');
- if (parentView) { Ember.propertyDidChange(parentView, 'childViews'); }
- }
- }, 'childViews'),
-
- /**
- Return the nearest ancestor that is an instance of the provided
- class.
-
- @param {Class} klass Subclass of Ember.View (or Ember.View itself)
- @returns Ember.View
- */
- nearestInstanceOf: function(klass) {
- var view = get(this, 'parentView');
-
- while (view) {
- if(view instanceof klass) { return view; }
- view = get(view, 'parentView');
- }
- },
-
- /**
- Return the nearest ancestor that has a given property.
-
- @param {String} property A property name
- @returns Ember.View
- */
- nearestWithProperty: function(property) {
- var view = get(this, 'parentView');
-
- while (view) {
- if (property in view) { return view; }
- view = get(view, 'parentView');
- }
- },
-
- /**
- Return the nearest ancestor whose parent is an instance of
- `klass`.
-
- @param {Class} klass Subclass of Ember.View (or Ember.View itself)
- @returns Ember.View
- */
- nearestChildOf: function(klass) {
- var view = get(this, 'parentView');
-
- while (view) {
- if(get(view, 'parentView') instanceof klass) { return view; }
- view = get(view, 'parentView');
- }
- },
-
- /**
- Return the nearest ancestor that is an Ember.CollectionView
-
- @returns Ember.CollectionView
- */
- collectionView: Ember.computed(function() {
- return this.nearestInstanceOf(Ember.CollectionView);
- }).cacheable(),
-
- /**
- Return the nearest ancestor that is a direct child of
- an Ember.CollectionView
-
- @returns Ember.View
- */
- itemView: Ember.computed(function() {
- return this.nearestChildOf(Ember.CollectionView);
- }).cacheable(),
-
- /**
- Return the nearest ancestor that has the property
- `content`.
-
- @returns Ember.View
- */
- contentView: Ember.computed(function() {
- return this.nearestWithProperty('content');
- }).cacheable(),
-
- /**
- @private
-
- When the parent view changes, recursively invalidate
- collectionView, itemView, and contentView
- */
- _parentViewDidChange: Ember.observer(function() {
- if (this.isDestroying) { return; }
-
- this.invokeRecursively(function(view) {
- view.propertyDidChange('collectionView');
- view.propertyDidChange('itemView');
- view.propertyDidChange('contentView');
- });
-
- if (get(this, 'parentView.controller') && !get(this, 'controller')) {
- this.notifyPropertyChange('controller');
- }
- }, '_parentView'),
-
- _controllerDidChange: Ember.observer(function() {
- if (this.isDestroying) { return; }
-
- this.forEachChildView(function(view) {
- view.propertyDidChange('controller');
- });
- }, 'controller'),
-
- cloneKeywords: function() {
- var templateData = get(this, 'templateData');
-
- var keywords = templateData ? Ember.copy(templateData.keywords) : {};
- set(keywords, 'view', get(this, 'concreteView'));
- set(keywords, 'controller', get(this, 'controller'));
-
- return keywords;
- },
-
- /**
- Called on your view when it should push strings of HTML into a
- Ember.RenderBuffer. Most users will want to override the `template`
- or `templateName` properties instead of this method.
-
- By default, Ember.View will look for a function in the `template`
- property and invoke it with the value of `context`. The value of
- `context` will be the view's controller unless you override it.
-
- @param {Ember.RenderBuffer} buffer The render buffer
- */
- render: function(buffer) {
- // If this view has a layout, it is the responsibility of the
- // the layout to render the view's template. Otherwise, render the template
- // directly.
- var template = get(this, 'layout') || get(this, 'template');
-
- if (template) {
- var context = get(this, '_context');
- var keywords = this.cloneKeywords();
-
- var data = {
- view: this,
- buffer: buffer,
- isRenderData: true,
- keywords: keywords
- };
-
- // Invoke the template with the provided template context, which
- // is the view by default. A hash of data is also passed that provides
- // the template with access to the view and render buffer.
-
- Ember.assert('template must be a function. Did you mean to call Ember.Handlebars.compile("...") or specify templateName instead?', typeof template === 'function');
- // The template should write directly to the render buffer instead
- // of returning a string.
- var output = template(context, { data: data });
-
- // If the template returned a string instead of writing to the buffer,
- // push the string onto the buffer.
- if (output !== undefined) { buffer.push(output); }
- }
- },
-
- invokeForState: function(name) {
- var stateName = this.state, args, fn;
-
- // try to find the function for the state in the cache
- if (fn = invokeForState[stateName][name]) {
- args = a_slice.call(arguments);
- args[0] = this;
-
- return fn.apply(this, args);
- }
-
- // otherwise, find and cache the function for this state
- var parent = this, states = parent.states, state;
-
- while (states) {
- state = states[stateName];
-
- while (state) {
- fn = state[name];
-
- if (fn) {
- invokeForState[stateName][name] = fn;
-
- args = a_slice.call(arguments, 1);
- args.unshift(this);
-
- return fn.apply(this, args);
- }
-
- state = state.parentState;
- }
-
- states = states.parent;
- }
- },
-
- /**
- Renders the view again. This will work regardless of whether the
- view is already in the DOM or not. If the view is in the DOM, the
- rendering process will be deferred to give bindings a chance
- to synchronize.
-
- If children were added during the rendering process using `appendChild`,
- `rerender` will remove them, because they will be added again
- if needed by the next `render`.
-
- In general, if the display of your view changes, you should modify
- the DOM element directly instead of manually calling `rerender`, which can
- be slow.
- */
- rerender: function() {
- return this.invokeForState('rerender');
- },
-
- clearRenderedChildren: function() {
- var lengthBefore = this.lengthBeforeRender,
- lengthAfter = this.lengthAfterRender;
-
- // If there were child views created during the last call to render(),
- // remove them under the assumption that they will be re-created when
- // we re-render.
-
- // VIEW-TODO: Unit test this path.
- var childViews = this._childViews;
- for (var i=lengthAfter-1; i>=lengthBefore; i--) {
- if (childViews[i]) { childViews[i].destroy(); }
- }
- },
-
- /**
- @private
-
- Iterates over the view's `classNameBindings` array, inserts the value
- of the specified property into the `classNames` array, then creates an
- observer to update the view's element if the bound property ever changes
- in the future.
- */
- _applyClassNameBindings: function() {
- var classBindings = get(this, 'classNameBindings'),
- classNames = get(this, 'classNames'),
- elem, newClass, dasherizedClass;
-
- if (!classBindings) { return; }
-
- // Loop through all of the configured bindings. These will be either
- // property names ('isUrgent') or property paths relative to the view
- // ('content.isUrgent')
- a_forEach(classBindings, function(binding) {
-
- // Variable in which the old class value is saved. The observer function
- // closes over this variable, so it knows which string to remove when
- // the property changes.
- var oldClass;
-
- // Set up an observer on the context. If the property changes, toggle the
- // class name.
- var observer = function() {
- // Get the current value of the property
- newClass = this._classStringForProperty(binding);
- elem = this.$();
-
- // If we had previously added a class to the element, remove it.
- if (oldClass) {
- elem.removeClass(oldClass);
- // Also remove from classNames so that if the view gets rerendered,
- // the class doesn't get added back to the DOM.
- classNames.removeObject(oldClass);
- }
-
- // If necessary, add a new class. Make sure we keep track of it so
- // it can be removed in the future.
- if (newClass) {
- elem.addClass(newClass);
- oldClass = newClass;
- } else {
- oldClass = null;
- }
- };
-
- // Get the class name for the property at its current value
- dasherizedClass = this._classStringForProperty(binding);
-
- if (dasherizedClass) {
- // Ensure that it gets into the classNames array
- // so it is displayed when we render.
- classNames.push(dasherizedClass);
-
- // Save a reference to the class name so we can remove it
- // if the observer fires. Remember that this variable has
- // been closed over by the observer.
- oldClass = dasherizedClass;
- }
-
- // Extract just the property name from bindings like 'foo:bar'
- var parsedPath = Ember.View._parsePropertyPath(binding);
- addObserver(this, parsedPath.path, observer);
- }, this);
- },
-
- /**
- Iterates through the view's attribute bindings, sets up observers for each,
- then applies the current value of the attributes to the passed render buffer.
-
- @param {Ember.RenderBuffer} buffer
- */
- _applyAttributeBindings: function(buffer) {
- var attributeBindings = get(this, 'attributeBindings'),
- attributeValue, elem, type;
-
- if (!attributeBindings) { return; }
-
- a_forEach(attributeBindings, function(binding) {
- var split = binding.split(':'),
- property = split[0],
- attributeName = split[1] || property;
-
- // Create an observer to add/remove/change the attribute if the
- // JavaScript property changes.
- var observer = function() {
- elem = this.$();
- if (!elem) { return; }
-
- attributeValue = get(this, property);
-
- Ember.View.applyAttributeBindings(elem, attributeName, attributeValue);
- };
-
- addObserver(this, property, observer);
-
- // Determine the current value and add it to the render buffer
- // if necessary.
- attributeValue = get(this, property);
- Ember.View.applyAttributeBindings(buffer, attributeName, attributeValue);
- }, this);
- },
-
- /**
- @private
-
- Given a property name, returns a dasherized version of that
- property name if the property evaluates to a non-falsy value.
-
- For example, if the view has property `isUrgent` that evaluates to true,
- passing `isUrgent` to this method will return `"is-urgent"`.
- */
- _classStringForProperty: function(property) {
- var parsedPath = Ember.View._parsePropertyPath(property);
- var path = parsedPath.path;
-
- var val = get(this, path);
- if (val === undefined && Ember.isGlobalPath(path)) {
- val = get(window, path);
- }
-
- return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);
- },
-
- // ..........................................................
- // ELEMENT SUPPORT
- //
-
- /**
- Returns the current DOM element for the view.
-
- @field
- @type DOMElement
- */
- element: Ember.computed(function(key, value) {
- if (value !== undefined) {
- return this.invokeForState('setElement', value);
- } else {
- return this.invokeForState('getElement');
- }
- }).property('_parentView').cacheable(),
-
- /**
- Returns a jQuery object for this view's element. If you pass in a selector
- string, this method will return a jQuery object, using the current element
- as its buffer.
-
- For example, calling `view.$('li')` will return a jQuery object containing
- all of the `li` elements inside the DOM element of this view.
-
- @param {String} [selector] a jQuery-compatible selector string
- @returns {Ember.CoreQuery} the CoreQuery object for the DOM node
- */
- $: function(sel) {
- return this.invokeForState('$', sel);
- },
-
- /** @private */
- mutateChildViews: function(callback) {
- var childViews = this._childViews,
- idx = childViews.length,
- view;
-
- while(--idx >= 0) {
- view = childViews[idx];
- callback.call(this, view, idx);
- }
-
- return this;
- },
-
- /** @private */
- forEachChildView: function(callback) {
- var childViews = this._childViews;
-
- if (!childViews) { return this; }
-
- var len = childViews.length,
- view, idx;
-
- for(idx = 0; idx < len; idx++) {
- view = childViews[idx];
- callback.call(this, view);
- }
-
- return this;
- },
-
- /**
- Appends the view's element to the specified parent element.
-
- If the view does not have an HTML representation yet, `createElement()`
- will be called automatically.
-
- Note that this method just schedules the view to be appended; the DOM
- element will not be appended to the given element until all bindings have
- finished synchronizing.
-
- This is not typically a function that you will need to call directly
- when building your application. You might consider using Ember.ContainerView
- instead. If you do need to use appendTo, be sure that the target element you
- are providing is associated with an Ember.Application and does not have an
- ancestor element that is associated with an Ember view.
-
- @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object
- @returns {Ember.View} receiver
- */
- appendTo: function(target) {
- // Schedule the DOM element to be created and appended to the given
- // element after bindings have synchronized.
- this._insertElementLater(function() {
- Ember.assert("You cannot append to an existing Ember.View. Consider using Ember.ContainerView instead.", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));
- this.$().appendTo(target);
- });
-
- return this;
- },
-
- /**
- Replaces the content of the specified parent element with this view's element.
- If the view does not have an HTML representation yet, `createElement()`
- will be called automatically.
-
- Note that this method just schedules the view to be appended; the DOM
- element will not be appended to the given element until all bindings have
- finished synchronizing
-
- @param {String|DOMElement|jQuery} A selector, element, HTML string, or jQuery object
- @returns {Ember.View} received
- */
- replaceIn: function(target) {
- Ember.assert("You cannot replace an existing Ember.View. Consider using Ember.ContainerView instead.", !Ember.$(target).is('.ember-view') && !Ember.$(target).parents().is('.ember-view'));
-
- this._insertElementLater(function() {
- Ember.$(target).empty();
- this.$().appendTo(target);
- });
-
- return this;
- },
-
- /**
- @private
-
- Schedules a DOM operation to occur during the next render phase. This
- ensures that all bindings have finished synchronizing before the view is
- rendered.
-
- To use, pass a function that performs a DOM operation..
-
- Before your function is called, this view and all child views will receive
- the `willInsertElement` event. After your function is invoked, this view
- and all of its child views will receive the `didInsertElement` event.
-
- view._insertElementLater(function() {
- this.createElement();
- this.$().appendTo('body');
- });
-
- @param {Function} fn the function that inserts the element into the DOM
- */
- _insertElementLater: function(fn) {
- this._lastInsert = Ember.guidFor(fn);
- Ember.run.schedule('render', this, this.invokeForState, 'insertElement', fn);
- },
-
- /**
- Appends the view's element to the document body. If the view does
- not have an HTML representation yet, `createElement()` will be called
- automatically.
-
- Note that this method just schedules the view to be appended; the DOM
- element will not be appended to the document body until all bindings have
- finished synchronizing.
-
- @returns {Ember.View} receiver
- */
- append: function() {
- return this.appendTo(document.body);
- },
-
- /**
- Removes the view's element from the element to which it is attached.
-
- @returns {Ember.View} receiver
- */
- remove: function() {
- // What we should really do here is wait until the end of the run loop
- // to determine if the element has been re-appended to a different
- // element.
- // In the interim, we will just re-render if that happens. It is more
- // important than elements get garbage collected.
- this.destroyElement();
- this.invokeRecursively(function(view) {
- view.clearRenderedChildren();
- });
- },
-
- /**
- The ID to use when trying to locate the element in the DOM. If you do not
- set the elementId explicitly, then the view's GUID will be used instead.
- This ID must be set at the time the view is created.
-
- @type String
- @readOnly
- */
- elementId: Ember.computed(function(key, value) {
- return value !== undefined ? value : Ember.guidFor(this);
- }).cacheable(),
-
- /**
- @private
-
- TODO: Perhaps this should be removed from the production build somehow.
- */
- _elementIdDidChange: Ember.beforeObserver(function() {
- throw "Changing a view's elementId after creation is not allowed.";
- }, 'elementId'),
-
- /**
- Attempts to discover the element in the parent element. The default
- implementation looks for an element with an ID of elementId (or the view's
- guid if elementId is null). You can override this method to provide your
- own form of lookup. For example, if you want to discover your element
- using a CSS class name instead of an ID.
-
- @param {DOMElement} parentElement The parent's DOM element
- @returns {DOMElement} The discovered element
- */
- findElementInParentElement: function(parentElem) {
- var id = "#" + get(this, 'elementId');
- return Ember.$(id)[0] || Ember.$(id, parentElem)[0];
- },
-
- /**
- Creates a new renderBuffer with the passed tagName. You can override this
- method to provide further customization to the buffer if needed. Normally
- you will not need to call or override this method.
-
- @returns {Ember.RenderBuffer}
- */
- renderBuffer: function(tagName) {
- tagName = tagName || get(this, 'tagName');
-
- // Explicitly check for null or undefined, as tagName
- // may be an empty string, which would evaluate to false.
- if (tagName === null || tagName === undefined) {
- tagName = 'div';
- }
-
- return Ember.RenderBuffer(tagName);
- },
-
- /**
- Creates a DOM representation of the view and all of its
- child views by recursively calling the `render()` method.
-
- After the element has been created, `didInsertElement` will
- be called on this view and all of its child views.
-
- @returns {Ember.View} receiver
- */
- createElement: function() {
- if (get(this, 'element')) { return this; }
-
- var buffer = this.renderToBuffer();
- set(this, 'element', buffer.element());
-
- return this;
- },
-
- /**
- Called when a view is going to insert an element into the DOM.
- */
- willInsertElement: Ember.K,
-
- /**
- Called when the element of the view has been inserted into the DOM.
- Override this function to do any set up that requires an element in the
- document body.
- */
- didInsertElement: Ember.K,
-
- /**
- Called when the view is about to rerender, but before anything has
- been torn down. This is a good opportunity to tear down any manual
- observers you have installed based on the DOM state
- */
- willRerender: Ember.K,
-
- /**
- Run this callback on the current view and recursively on child views.
-
- @private
- */
- invokeRecursively: function(fn) {
- fn.call(this, this);
-
- this.forEachChildView(function(view) {
- view.invokeRecursively(fn);
- });
- },
-
- /**
- Invalidates the cache for a property on all child views.
- */
- invalidateRecursively: function(key) {
- this.forEachChildView(function(view) {
- view.propertyDidChange(key);
- });
- },
-
- /**
- @private
-
- Invokes the receiver's willInsertElement() method if it exists and then
- invokes the same on all child views.
-
- NOTE: In some cases this was called when the element existed. This no longer
- works so we let people know. We can remove this warning code later.
- */
- _notifyWillInsertElement: function() {
- this.invokeRecursively(function(view) {
- view.trigger('willInsertElement');
- });
- },
-
- /**
- @private
-
- Invokes the receiver's didInsertElement() method if it exists and then
- invokes the same on all child views.
- */
- _notifyDidInsertElement: function() {
- this.invokeRecursively(function(view) {
- view.trigger('didInsertElement');
- });
- },
-
- /**
- @private
-
- Invokes the receiver's willRerender() method if it exists and then
- invokes the same on all child views.
- */
- _notifyWillRerender: function() {
- this.invokeRecursively(function(view) {
- view.trigger('willRerender');
- });
- },
-
- /**
- Destroys any existing element along with the element for any child views
- as well. If the view does not currently have a element, then this method
- will do nothing.
-
- If you implement willDestroyElement() on your view, then this method will
- be invoked on your view before your element is destroyed to give you a
- chance to clean up any event handlers, etc.
-
- If you write a willDestroyElement() handler, you can assume that your
- didInsertElement() handler was called earlier for the same element.
-
- Normally you will not call or override this method yourself, but you may
- want to implement the above callbacks when it is run.
-
- @returns {Ember.View} receiver
- */
- destroyElement: function() {
- return this.invokeForState('destroyElement');
- },
-
- /**
- Called when the element of the view is going to be destroyed. Override
- this function to do any teardown that requires an element, like removing
- event listeners.
- */
- willDestroyElement: function() {},
-
- /**
- @private
-
- Invokes the `willDestroyElement` callback on the view and child views.
- */
- _notifyWillDestroyElement: function() {
- this.invokeRecursively(function(view) {
- view.trigger('willDestroyElement');
- });
- },
-
- /** @private (nodoc) */
- _elementWillChange: Ember.beforeObserver(function() {
- this.forEachChildView(function(view) {
- Ember.propertyWillChange(view, 'element');
- });
- }, 'element'),
-
- /**
- @private
-
- If this view's element changes, we need to invalidate the caches of our
- child views so that we do not retain references to DOM elements that are
- no longer needed.
-
- @observes element
- */
- _elementDidChange: Ember.observer(function() {
- this.forEachChildView(function(view) {
- Ember.propertyDidChange(view, 'element');
- });
- }, 'element'),
-
- /**
- Called when the parentView property has changed.
-
- @function
- */
- parentViewDidChange: Ember.K,
-
- /**
- @private
-
- Invoked by the view system when this view needs to produce an HTML
- representation. This method will create a new render buffer, if needed,
- then apply any default attributes, such as class names and visibility.
- Finally, the `render()` method is invoked, which is responsible for
- doing the bulk of the rendering.
-
- You should not need to override this method; instead, implement the
- `template` property, or if you need more control, override the `render`
- method.
-
- @param {Ember.RenderBuffer} buffer the render buffer. If no buffer is
- passed, a default buffer, using the current view's `tagName`, will
- be used.
- */
- renderToBuffer: function(parentBuffer, bufferOperation) {
- var buffer;
-
- Ember.run.sync();
-
- // Determine where in the parent buffer to start the new buffer.
- // By default, a new buffer will be appended to the parent buffer.
- // The buffer operation may be changed if the child views array is
- // mutated by Ember.ContainerView.
- bufferOperation = bufferOperation || 'begin';
-
- // If this is the top-most view, start a new buffer. Otherwise,
- // create a new buffer relative to the original using the
- // provided buffer operation (for example, `insertAfter` will
- // insert a new buffer after the "parent buffer").
- if (parentBuffer) {
- var tagName = get(this, 'tagName');
- if (tagName === null || tagName === undefined) {
- tagName = 'div';
- }
-
- buffer = parentBuffer[bufferOperation](tagName);
- } else {
- buffer = this.renderBuffer();
- }
-
- this.buffer = buffer;
- this.transitionTo('inBuffer', false);
-
- this.lengthBeforeRender = this._childViews.length;
-
- this.beforeRender(buffer);
- this.render(buffer);
- this.afterRender(buffer);
-
- this.lengthAfterRender = this._childViews.length;
-
- return buffer;
- },
-
- beforeRender: function(buffer) {
- this.applyAttributesToBuffer(buffer);
- },
-
- afterRender: Ember.K,
-
- /**
- @private
- */
- applyAttributesToBuffer: function(buffer) {
- // Creates observers for all registered class name and attribute bindings,
- // then adds them to the element.
- this._applyClassNameBindings();
-
- // Pass the render buffer so the method can apply attributes directly.
- // This isn't needed for class name bindings because they use the
- // existing classNames infrastructure.
- this._applyAttributeBindings(buffer);
-
-
- a_forEach(get(this, 'classNames'), function(name){ buffer.addClass(name); });
- buffer.id(get(this, 'elementId'));
-
- var role = get(this, 'ariaRole');
- if (role) {
- buffer.attr('role', role);
- }
-
- if (get(this, 'isVisible') === false) {
- buffer.style('display', 'none');
- }
- },
-
- // ..........................................................
- // STANDARD RENDER PROPERTIES
- //
-
- /**
- Tag name for the view's outer element. The tag name is only used when
- an element is first created. If you change the tagName for an element, you
- must destroy and recreate the view element.
-
- By default, the render buffer will use a `<div>` tag for views.
-
- @type String
- @default null
- */
-
- // We leave this null by default so we can tell the difference between
- // the default case and a user-specified tag.
- tagName: null,
-
- /**
- The WAI-ARIA role of the control represented by this view. For example, a
- button may have a role of type 'button', or a pane may have a role of
- type 'alertdialog'. This property is used by assistive software to help
- visually challenged users navigate rich web applications.
-
- The full list of valid WAI-ARIA roles is available at:
- http://www.w3.org/TR/wai-aria/roles#roles_categorization
-
- @type String
- @default null
- */
- ariaRole: null,
-
- /**
- Standard CSS class names to apply to the view's outer element. This
- property automatically inherits any class names defined by the view's
- superclasses as well.
-
- @type Array
- @default ['ember-view']
- */
- classNames: ['ember-view'],
-
- /**
- A list of properties of the view to apply as class names. If the property
- is a string value, the value of that string will be applied as a class
- name.
-
- // Applies the 'high' class to the view element
- Ember.View.create({
- classNameBindings: ['priority']
- priority: 'high'
- });
-
- If the value of the property is a Boolean, the name of that property is
- added as a dasherized class name.
-
- // Applies the 'is-urgent' class to the view element
- Ember.View.create({
- classNameBindings: ['isUrgent']
- isUrgent: true
- });
-
- If you would prefer to use a custom value instead of the dasherized
- property name, you can pass a binding like this:
-
- // Applies the 'urgent' class to the view element
- Ember.View.create({
- classNameBindings: ['isUrgent:urgent']
- isUrgent: true
- });
-
- This list of properties is inherited from the view's superclasses as well.
-
- @type Array
- @default []
- */
- classNameBindings: [],
-
- /**
- A list of properties of the view to apply as attributes. If the property is
- a string value, the value of that string will be applied as the attribute.
-
- // Applies the type attribute to the element
- // with the value "button", like <div type="button">
- Ember.View.create({
- attributeBindings: ['type'],
- type: 'button'
- });
-
- If the value of the property is a Boolean, the name of that property is
- added as an attribute.
-
- // Renders something like <div enabled="enabled">
- Ember.View.create({
- attributeBindings: ['enabled'],
- enabled: true
- });
- */
- attributeBindings: [],
-
- state: 'preRender',
-
- // .......................................................
- // CORE DISPLAY METHODS
- //
-
- /**
- @private
-
- Setup a view, but do not finish waking it up.
- - configure childViews
- - register the view with the global views hash, which is used for event
- dispatch
- */
- init: function() {
- this._super();
-
- // Register the view for event handling. This hash is used by
- // Ember.EventDispatcher to dispatch incoming events.
- if (!this.isVirtual) Ember.View.views[get(this, 'elementId')] = this;
-
- // setup child views. be sure to clone the child views array first
- this._childViews = this._childViews.slice();
-
- Ember.assert("Only arrays are allowed for 'classNameBindings'", Ember.typeOf(this.classNameBindings) === 'array');
- this.classNameBindings = Ember.A(this.classNameBindings.slice());
-
- Ember.assert("Only arrays are allowed for 'classNames'", Ember.typeOf(this.classNames) === 'array');
- this.classNames = Ember.A(this.classNames.slice());
-
- var viewController = get(this, 'viewController');
- if (viewController) {
- viewController = get(viewController);
- if (viewController) {
- set(viewController, 'view', this);
- }
- }
- },
-
- appendChild: function(view, options) {
- return this.invokeForState('appendChild', view, options);
- },
-
- /**
- Removes the child view from the parent view.
-
- @param {Ember.View} view
- @returns {Ember.View} receiver
- */
- removeChild: function(view) {
- // If we're destroying, the entire subtree will be
- // freed, and the DOM will be handled separately,
- // so no need to mess with childViews.
- if (this.isDestroying) { return; }
-
- // update parent node
- set(view, '_parentView', null);
-
- // remove view from childViews array.
- var childViews = this._childViews;
-
- Ember.EnumerableUtils.removeObject(childViews, view);
-
- this.propertyDidChange('childViews'); // HUH?! what happened to will change?
-
- return this;
- },
-
- /**
- Removes all children from the parentView.
-
- @returns {Ember.View} receiver
- */
- removeAllChildren: function() {
- return this.mutateChildViews(function(view) {
- this.removeChild(view);
- });
- },
-
- destroyAllChildren: function() {
- return this.mutateChildViews(function(view) {
- view.destroy();
- });
- },
-
- /**
- Removes the view from its parentView, if one is found. Otherwise
- does nothing.
-
- @returns {Ember.View} receiver
- */
- removeFromParent: function() {
- var parent = get(this, '_parentView');
-
- // Remove DOM element from parent
- this.remove();
-
- if (parent) { parent.removeChild(this); }
- return this;
- },
-
- /**
- You must call `destroy` on a view to destroy the view (and all of its
- child views). This will remove the view from any parent node, then make
- sure that the DOM element managed by the view can be released by the
- memory manager.
- */
- willDestroy: function() {
- // calling this._super() will nuke computed properties and observers,
- // so collect any information we need before calling super.
- var childViews = this._childViews,
- parent = get(this, '_parentView'),
- childLen;
-
- // destroy the element -- this will avoid each child view destroying
- // the element over and over again...
- if (!this.removedFromDOM) { this.destroyElement(); }
-
- // remove from non-virtual parent view if viewName was specified
- if (this.viewName) {
- var nonVirtualParentView = get(this, 'parentView');
- if (nonVirtualParentView) {
- set(nonVirtualParentView, this.viewName, null);
- }
- }
-
- // remove from parent if found. Don't call removeFromParent,
- // as removeFromParent will try to remove the element from
- // the DOM again.
- if (parent) { parent.removeChild(this); }
-
- this.state = 'destroyed';
-
- childLen = childViews.length;
- for (var i=childLen-1; i>=0; i--) {
- childViews[i].removedFromDOM = true;
- childViews[i].destroy();
- }
-
- // next remove view from global hash
- if (!this.isVirtual) delete Ember.View.views[get(this, 'elementId')];
- },
-
- /**
- Instantiates a view to be added to the childViews array during view
- initialization. You generally will not call this method directly unless
- you are overriding createChildViews(). Note that this method will
- automatically configure the correct settings on the new view instance to
- act as a child of the parent.
-
- @param {Class} viewClass
- @param {Hash} [attrs] Attributes to add
- @returns {Ember.View} new instance
- @test in createChildViews
- */
- createChildView: function(view, attrs) {
- if (Ember.View.detect(view)) {
- attrs = attrs || {};
- attrs._parentView = this;
- attrs.templateData = attrs.templateData || get(this, 'templateData');
-
- view = view.create(attrs);
-
- // don't set the property on a virtual view, as they are invisible to
- // consumers of the view API
- if (view.viewName) { set(get(this, 'concreteView'), view.viewName, view); }
- } else {
- Ember.assert('You must pass instance or subclass of View', view instanceof Ember.View);
- Ember.assert("You can only pass attributes when a class is provided", !attrs);
-
- if (!get(view, 'templateData')) {
- set(view, 'templateData', get(this, 'templateData'));
- }
-
- set(view, '_parentView', this);
- }
-
- return view;
- },
-
- becameVisible: Ember.K,
- becameHidden: Ember.K,
-
- /**
- @private
-
- When the view's `isVisible` property changes, toggle the visibility
- element of the actual DOM element.
- */
- _isVisibleDidChange: Ember.observer(function() {
- var $el = this.$();
- if (!$el) { return; }
-
- var isVisible = get(this, 'isVisible');
-
- $el.toggle(isVisible);
-
- if (this._isAncestorHidden()) { return; }
-
- if (isVisible) {
- this._notifyBecameVisible();
- } else {
- this._notifyBecameHidden();
- }
- }, 'isVisible'),
-
- _notifyBecameVisible: function() {
- this.trigger('becameVisible');
-
- this.forEachChildView(function(view) {
- var isVisible = get(view, 'isVisible');
-
- if (isVisible || isVisible === null) {
- view._notifyBecameVisible();
- }
- });
- },
-
- _notifyBecameHidden: function() {
- this.trigger('becameHidden');
- this.forEachChildView(function(view) {
- var isVisible = get(view, 'isVisible');
-
- if (isVisible || isVisible === null) {
- view._notifyBecameHidden();
- }
- });
- },
-
- _isAncestorHidden: function() {
- var parent = get(this, 'parentView');
-
- while (parent) {
- if (get(parent, 'isVisible') === false) { return true; }
-
- parent = get(parent, 'parentView');
- }
-
- return false;
- },
-
- clearBuffer: function() {
- this.invokeRecursively(function(view) {
- this.buffer = null;
- });
- },
-
- transitionTo: function(state, children) {
- this.state = state;
-
- if (children !== false) {
- this.forEachChildView(function(view) {
- view.transitionTo(state);
- });
- }
- },
-
- /**
- @private
-
- Override the default event firing from Ember.Evented to
- also call methods with the given name.
- */
- trigger: function(name) {
- this._super.apply(this, arguments);
- var method = this[name];
- if (method) {
- var args = [], i, l;
- for (i = 1, l = arguments.length; i < l; i++) {
- args.push(arguments[i]);
- }
- return method.apply(this, args);
- }
- },
-
- has: function(name) {
- return Ember.typeOf(this[name]) === 'function' || this._super(name);
- },
-
- // .......................................................
- // EVENT HANDLING
- //
-
- /**
- @private
-
- Handle events from `Ember.EventDispatcher`
- */
- handleEvent: function(eventName, evt) {
- return this.invokeForState('handleEvent', eventName, evt);
- }
-
-});
-
-/**
- Describe how the specified actions should behave in the various
- states that a view can exist in. Possible states:
-
- * preRender: when a view is first instantiated, and after its
- element was destroyed, it is in the preRender state
- * inBuffer: once a view has been rendered, but before it has
- been inserted into the DOM, it is in the inBuffer state
- * inDOM: once a view has been inserted into the DOM it is in
- the inDOM state. A view spends the vast majority of its
- existence in this state.
- * destroyed: once a view has been destroyed (using the destroy
- method), it is in this state. No further actions can be invoked
- on a destroyed view.
-*/
-
- // in the destroyed state, everything is illegal
-
- // before rendering has begun, all legal manipulations are noops.
-
- // inside the buffer, legal manipulations are done on the buffer
-
- // once the view has been inserted into the DOM, legal manipulations
- // are done on the DOM element.
-
-/** @private */
-var DOMManager = {
- prepend: function(view, childView) {
- childView._insertElementLater(function() {
- var element = view.$();
- element.prepend(childView.$());
- });
- },
-
- after: function(view, nextView) {
- nextView._insertElementLater(function() {
- var element = view.$();
- element.after(nextView.$());
- });
- },
-
- replace: function(view) {
- var element = get(view, 'element');
-
- set(view, 'element', null);
-
- view._insertElementLater(function() {
- Ember.$(element).replaceWith(get(view, 'element'));
- });
- },
-
- remove: function(view) {
- var elem = get(view, 'element');
-
- set(view, 'element', null);
- view._lastInsert = null;
-
- Ember.$(elem).remove();
- },
-
- empty: function(view) {
- view.$().empty();
- }
-};
-
-Ember.View.reopen({
- states: Ember.View.states,
- domManager: DOMManager
-});
-
-Ember.View.reopenClass({
-
- /**
- @private
-
- Parse a path and return an object which holds the parsed properties.
-
- For example a path like "content.isEnabled:enabled:disabled" wil return the
- following object:
-
- {
- path: "content.isEnabled",
- className: "enabled",
- falsyClassName: "disabled",
- classNames: ":enabled:disabled"
- }
-
- */
- _parsePropertyPath: function(path) {
- var split = path.split(/:/),
- propertyPath = split[0],
- classNames = "",
- className,
- falsyClassName;
-
- // check if the property is defined as prop:class or prop:trueClass:falseClass
- if (split.length > 1) {
- className = split[1];
- if (split.length === 3) { falsyClassName = split[2]; }
-
- classNames = ':' + className;
- if (falsyClassName) { classNames += ":" + falsyClassName; }
- }
-
- return {
- path: propertyPath,
- classNames: classNames,
- className: (className === '') ? undefined : className,
- falsyClassName: falsyClassName
- };
- },
-
- /**
- @private
-
- Get the class name for a given value, based on the path, optional className
- and optional falsyClassName.
-
- - if the value is truthy and a className is defined, the className is returned
- - if the value is true, the dasherized last part of the supplied path is returned
- - if the value is false and a falsyClassName is supplied, the falsyClassName is returned
- - if the value is truthy, the value is returned
- - if none of the above rules apply, null is returned
-
- */
- _classStringForValue: function(path, val, className, falsyClassName) {
- // If the value is truthy and we're using the colon syntax,
- // we should return the className directly
- if (!!val && className) {
- return className;
-
- // If value is a Boolean and true, return the dasherized property
- // name.
- } else if (val === true) {
- // catch syntax like isEnabled::not-enabled
- if (val === true && !className && falsyClassName) { return null; }
-
- // Normalize property path to be suitable for use
- // as a class name. For exaple, content.foo.barBaz
- // becomes bar-baz.
- var parts = path.split('.');
- return Ember.String.dasherize(parts[parts.length-1]);
-
- // If the value is false and a falsyClassName is specified, return it
- } else if (val === false && falsyClassName) {
- return falsyClassName;
-
- // If the value is not false, undefined, or null, return the current
- // value of the property.
- } else if (val !== false && val !== undefined && val !== null) {
- return val;
-
- // Nothing to display. Return null so that the old class is removed
- // but no new class is added.
- } else {
- return null;
- }
- }
-});
-
-// Create a global view hash.
-Ember.View.views = {};
-
-// If someone overrides the child views computed property when
-// defining their class, we want to be able to process the user's
-// supplied childViews and then restore the original computed property
-// at view initialization time. This happens in Ember.ContainerView's init
-// method.
-Ember.View.childViewsProperty = childViewsProperty;
-
-Ember.View.applyAttributeBindings = function(elem, name, value) {
- var type = Ember.typeOf(value);
- var currentValue = elem.attr(name);
-
- // if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js
- if ((type === 'string' || (type === 'number' && !isNaN(value))) && value !== currentValue) {
- elem.attr(name, value);
- } else if (value && type === 'boolean') {
- elem.attr(name, name);
- } else if (!value) {
- elem.removeAttr(name);
- }
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-Ember.View.states = {
- _default: {
- // appendChild is only legal while rendering the buffer.
- appendChild: function() {
- throw "You can't use appendChild outside of the rendering process";
- },
-
- $: function() {
- return undefined;
- },
-
- getElement: function() {
- return null;
- },
-
- // Handle events from `Ember.EventDispatcher`
- handleEvent: function() {
- return true; // continue event propagation
- },
-
- destroyElement: function(view) {
- set(view, 'element', null);
- view._lastInsert = null;
- return view;
- }
- }
-};
-
-Ember.View.reopen({
- states: Ember.View.states
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-Ember.View.states.preRender = {
- parentState: Ember.View.states._default,
-
- // a view leaves the preRender state once its element has been
- // created (createElement).
- insertElement: function(view, fn) {
- if (view._lastInsert !== Ember.guidFor(fn)){
- return;
- }
- view.createElement();
- view._notifyWillInsertElement();
- // after createElement, the view will be in the hasElement state.
- fn.call(view);
- view.transitionTo('inDOM');
- view._notifyDidInsertElement();
- },
-
- empty: Ember.K,
-
- setElement: function(view, value) {
- if (value !== null) {
- view.transitionTo('hasElement');
- }
- return value;
- }
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set, meta = Ember.meta;
-
-Ember.View.states.inBuffer = {
- parentState: Ember.View.states._default,
-
- $: function(view, sel) {
- // if we don't have an element yet, someone calling this.$() is
- // trying to update an element that isn't in the DOM. Instead,
- // rerender the view to allow the render method to reflect the
- // changes.
- view.rerender();
- return Ember.$();
- },
-
- // when a view is rendered in a buffer, rerendering it simply
- // replaces the existing buffer with a new one
- rerender: function(view) {
- Ember.deprecate("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM. Because this is avoidable and the cause of significant performance issues in applications, this behavior is deprecated. If you want to use the debugger to find out what caused this, you can set ENV.RAISE_ON_DEPRECATION to true.");
-
- view._notifyWillRerender();
-
- view.clearRenderedChildren();
- view.renderToBuffer(view.buffer, 'replaceWith');
- },
-
- // when a view is rendered in a buffer, appending a child
- // view will render that view and append the resulting
- // buffer into its buffer.
- appendChild: function(view, childView, options) {
- var buffer = view.buffer;
-
- childView = this.createChildView(childView, options);
- view._childViews.push(childView);
-
- childView.renderToBuffer(buffer);
-
- view.propertyDidChange('childViews');
-
- return childView;
- },
-
- // when a view is rendered in a buffer, destroying the
- // element will simply destroy the buffer and put the
- // state back into the preRender state.
- destroyElement: function(view) {
- view.clearBuffer();
- view._notifyWillDestroyElement();
- view.transitionTo('preRender');
-
- return view;
- },
-
- empty: function() {
- Ember.assert("Emptying a view in the inBuffer state is not allowed and should not happen under normal circumstances. Most likely there is a bug in your application. This may be due to excessive property change notifications.");
- },
-
- // It should be impossible for a rendered view to be scheduled for
- // insertion.
- insertElement: function() {
- throw "You can't insert an element that has already been rendered";
- },
-
- setElement: function(view, value) {
- if (value === null) {
- view.transitionTo('preRender');
- } else {
- view.clearBuffer();
- view.transitionTo('hasElement');
- }
-
- return value;
- }
-};
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set, meta = Ember.meta;
-
-Ember.View.states.hasElement = {
- parentState: Ember.View.states._default,
-
- $: function(view, sel) {
- var elem = get(view, 'element');
- return sel ? Ember.$(sel, elem) : Ember.$(elem);
- },
-
- getElement: function(view) {
- var parent = get(view, 'parentView');
- if (parent) { parent = get(parent, 'element'); }
- if (parent) { return view.findElementInParentElement(parent); }
- return Ember.$("#" + get(view, 'elementId'))[0];
- },
-
- setElement: function(view, value) {
- if (value === null) {
- view.transitionTo('preRender');
- } else {
- throw "You cannot set an element to a non-null value when the element is already in the DOM.";
- }
-
- return value;
- },
-
- // once the view has been inserted into the DOM, rerendering is
- // deferred to allow bindings to synchronize.
- rerender: function(view) {
- view._notifyWillRerender();
-
- view.clearRenderedChildren();
-
- view.domManager.replace(view);
- return view;
- },
-
- // once the view is already in the DOM, destroying it removes it
- // from the DOM, nukes its element, and puts it back into the
- // preRender state if inDOM.
-
- destroyElement: function(view) {
- view._notifyWillDestroyElement();
- view.domManager.remove(view);
- return view;
- },
-
- empty: function(view) {
- var _childViews = view._childViews, len, idx;
- if (_childViews) {
- len = _childViews.length;
- for (idx = 0; idx < len; idx++) {
- _childViews[idx]._notifyWillDestroyElement();
- }
- }
- view.domManager.empty(view);
- },
-
- // Handle events from `Ember.EventDispatcher`
- handleEvent: function(view, eventName, evt) {
- if (view.has(eventName)) {
- // Handler should be able to re-dispatch events, so we don't
- // preventDefault or stopPropagation.
- return view.trigger(eventName, evt);
- } else {
- return true; // continue event propagation
- }
- }
-};
-
-Ember.View.states.inDOM = {
- parentState: Ember.View.states.hasElement,
-
- insertElement: function(view, fn) {
- if (view._lastInsert !== Ember.guidFor(fn)){
- return;
- }
- throw "You can't insert an element into the DOM that has already been inserted";
- }
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var destroyedError = "You can't call %@ on a destroyed view", fmt = Ember.String.fmt;
-
-Ember.View.states.destroyed = {
- parentState: Ember.View.states._default,
-
- appendChild: function() {
- throw fmt(destroyedError, ['appendChild']);
- },
- rerender: function() {
- throw fmt(destroyedError, ['rerender']);
- },
- destroyElement: function() {
- throw fmt(destroyedError, ['destroyElement']);
- },
- empty: function() {
- throw fmt(destroyedError, ['empty']);
- },
-
- setElement: function() {
- throw fmt(destroyedError, ["set('element', ...)"]);
- },
-
- // Since element insertion is scheduled, don't do anything if
- // the view has been destroyed between scheduling and execution
- insertElement: Ember.K
-};
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set, meta = Ember.meta;
-var forEach = Ember.EnumerableUtils.forEach;
-
-var childViewsProperty = Ember.computed(function() {
- return get(this, '_childViews');
-}).property('_childViews').cacheable();
-
-/**
- @class
-
- A `ContainerView` is an `Ember.View` subclass that allows for manual or programatic
- management of a view's `childViews` array that will correctly update the `ContainerView`
- instance's rendered DOM representation.
-
- ## Setting Initial Child Views
- The initial array of child views can be set in one of two ways. You can provide
- a `childViews` property at creation time that contains instance of `Ember.View`:
-
-
- aContainer = Ember.ContainerView.create({
- childViews: [Ember.View.create(), Ember.View.create()]
- })
-
- You can also provide a list of property names whose values are instances of `Ember.View`:
-
- aContainer = Ember.ContainerView.create({
- childViews: ['aView', 'bView', 'cView'],
- aView: Ember.View.create(),
- bView: Ember.View.create()
- cView: Ember.View.create()
- })
-
- The two strategies can be combined:
-
- aContainer = Ember.ContainerView.create({
- childViews: ['aView', Ember.View.create()],
- aView: Ember.View.create()
- })
-
- Each child view's rendering will be inserted into the container's rendered HTML in the same
- order as its position in the `childViews` property.
-
- ## Adding and Removing Child Views
- The views in a container's `childViews` array should be added and removed by manipulating
- the `childViews` property directly.
-
- To remove a view pass that view into a `removeObject` call on the container's `childViews` property.
-
- Given an empty `<body>` the following code
-
- aContainer = Ember.ContainerView.create({
- classNames: ['the-container'],
- childViews: ['aView', 'bView'],
- aView: Ember.View.create({
- template: Ember.Handlebars.compile("A")
- }),
- bView: Ember.View.create({
- template: Ember.Handlebars.compile("B")
- })
- })
-
- aContainer.appendTo('body')
-
- Results in the HTML
-
- <div class="ember-view the-container">
- <div class="ember-view">A</div>
- <div class="ember-view">B</div>
- </div>
-
- Removing a view
-
- aContainer.get('childViews') // [aContainer.aView, aContainer.bView]
- aContainer.get('childViews').removeObject(aContainer.get('bView'))
- aContainer.get('childViews') // [aContainer.aView]
-
- Will result in the following HTML
-
- <div class="ember-view the-container">
- <div class="ember-view">A</div>
- </div>
-
-
- Similarly, adding a child view is accomplished by adding `Ember.View` instances to the
- container's `childViews` property.
-
- Given an empty `<body>` the following code
-
- aContainer = Ember.ContainerView.create({
- classNames: ['the-container'],
- childViews: ['aView', 'bView'],
- aView: Ember.View.create({
- template: Ember.Handlebars.compile("A")
- }),
- bView: Ember.View.create({
- template: Ember.Handlebars.compile("B")
- })
- })
-
- aContainer.appendTo('body')
-
- Results in the HTML
-
- <div class="ember-view the-container">
- <div class="ember-view">A</div>
- <div class="ember-view">B</div>
- </div>
-
- Adding a view
-
- AnotherViewClass = Ember.View.extend({
- template: Ember.Handlebars.compile("Another view")
- })
-
- aContainer.get('childViews') // [aContainer.aView, aContainer.bView]
- aContainer.get('childViews').pushObject(AnotherViewClass.create())
- aContainer.get('childViews') // [aContainer.aView, aContainer.bView, <AnotherViewClass instance>]
-
- Will result in the following HTML
-
- <div class="ember-view the-container">
- <div class="ember-view">A</div>
- <div class="ember-view">B</div>
- <div class="ember-view">Another view</div>
- </div>
-
-
- Direct manipulation of childViews presence or absence in the DOM via calls to
- `remove` or `removeFromParent` or calls to a container's `removeChild` may not behave
- correctly.
-
- Calling `remove()` on a child view will remove the view's HTML, but it will remain as part of its
- container's `childView`s property.
-
- Calling `removeChild()` on the container will remove the passed view instance from the container's
- `childView`s but keep its HTML within the container's rendered view.
-
- Calling `removeFromParent()` behaves as expected but should be avoided in favor of direct
- manipulation of a container's `childViews` property.
-
- aContainer = Ember.ContainerView.create({
- classNames: ['the-container'],
- childViews: ['aView', 'bView'],
- aView: Ember.View.create({
- template: Ember.Handlebars.compile("A")
- }),
- bView: Ember.View.create({
- template: Ember.Handlebars.compile("B")
- })
- })
-
- aContainer.appendTo('body')
-
- Results in the HTML
-
- <div class="ember-view the-container">
- <div class="ember-view">A</div>
- <div class="ember-view">B</div>
- </div>
-
- Calling `aContainer.get('aView').removeFromParent()` will result in the following HTML
-
- <div class="ember-view the-container">
- <div class="ember-view">B</div>
- </div>
-
- And the `Ember.View` instance stored in `aContainer.aView` will be removed from `aContainer`'s
- `childViews` array.
-
- ## Templates and Layout
- A `template`, `templateName`, `defaultTemplate`, `layout`, `layoutName` or `defaultLayout`
- property on a container view will not result in the template or layout being rendered.
- The HTML contents of a `Ember.ContainerView`'s DOM representation will only be the rendered HTML
- of its child views.
-
- ## Binding a View to Display
-
- If you would like to display a single view in your ContainerView, you can set its `currentView`
- property. When the `currentView` property is set to a view instance, it will be added to the
- ContainerView's `childViews` array. If the `currentView` property is later changed to a
- different view, the new view will replace the old view. If `currentView` is set to `null`, the
- last `currentView` will be removed.
-
- This functionality is useful for cases where you want to bind the display of a ContainerView to
- a controller or state manager. For example, you can bind the `currentView` of a container to
- a controller like this:
-
- // Controller
- App.appController = Ember.Object.create({
- view: Ember.View.create({
- templateName: 'person_template'
- })
- });
-
- // Handlebars template
- {{view Ember.ContainerView currentViewBinding="App.appController.view"}}
-
- @extends Ember.View
-*/
-
-Ember.ContainerView = Ember.View.extend({
-
- init: function() {
- this._super();
-
- var childViews = get(this, 'childViews');
- Ember.defineProperty(this, 'childViews', childViewsProperty);
-
- var _childViews = this._childViews;
-
- forEach(childViews, function(viewName, idx) {
- var view;
-
- if ('string' === typeof viewName) {
- view = get(this, viewName);
- view = this.createChildView(view);
- set(this, viewName, view);
- } else {
- view = this.createChildView(viewName);
- }
-
- _childViews[idx] = view;
- }, this);
-
- var currentView = get(this, 'currentView');
- if (currentView) _childViews.push(this.createChildView(currentView));
-
- // Make the _childViews array observable
- Ember.A(_childViews);
-
- // Sets up an array observer on the child views array. This
- // observer will detect when child views are added or removed
- // and update the DOM to reflect the mutation.
- get(this, 'childViews').addArrayObserver(this, {
- willChange: 'childViewsWillChange',
- didChange: 'childViewsDidChange'
- });
- },
-
- /**
- Instructs each child view to render to the passed render buffer.
-
- @param {Ember.RenderBuffer} buffer the buffer to render to
- @private
- */
- render: function(buffer) {
- this.forEachChildView(function(view) {
- view.renderToBuffer(buffer);
- });
- },
-
- /**
- When the container view is destroyed, tear down the child views
- array observer.
-
- @private
- */
- willDestroy: function() {
- get(this, 'childViews').removeArrayObserver(this, {
- willChange: 'childViewsWillChange',
- didChange: 'childViewsDidChange'
- });
-
- this._super();
- },
-
- /**
- When a child view is removed, destroy its element so that
- it is removed from the DOM.
-
- The array observer that triggers this action is set up in the
- `renderToBuffer` method.
-
- @private
- @param {Ember.Array} views the child views array before mutation
- @param {Number} start the start position of the mutation
- @param {Number} removed the number of child views removed
- **/
- childViewsWillChange: function(views, start, removed) {
- if (removed === 0) { return; }
-
- var changedViews = views.slice(start, start+removed);
- this.initializeViews(changedViews, null, null);
-
- this.invokeForState('childViewsWillChange', views, start, removed);
- },
-
- /**
- When a child view is added, make sure the DOM gets updated appropriately.
-
- If the view has already rendered an element, we tell the child view to
- create an element and insert it into the DOM. If the enclosing container view
- has already written to a buffer, but not yet converted that buffer into an
- element, we insert the string representation of the child into the appropriate
- place in the buffer.
-
- @private
- @param {Ember.Array} views the array of child views afte the mutation has occurred
- @param {Number} start the start position of the mutation
- @param {Number} removed the number of child views removed
- @param {Number} the number of child views added
- */
- childViewsDidChange: function(views, start, removed, added) {
- var len = get(views, 'length');
-
- // No new child views were added; bail out.
- if (added === 0) return;
-
- var changedViews = views.slice(start, start+added);
- this.initializeViews(changedViews, this, get(this, 'templateData'));
-
- // Let the current state handle the changes
- this.invokeForState('childViewsDidChange', views, start, added);
- },
-
- initializeViews: function(views, parentView, templateData) {
- forEach(views, function(view) {
- set(view, '_parentView', parentView);
-
- if (!get(view, 'templateData')) {
- set(view, 'templateData', templateData);
- }
- });
- },
-
- /**
- Schedules a child view to be inserted into the DOM after bindings have
- finished syncing for this run loop.
-
- @param {Ember.View} view the child view to insert
- @param {Ember.View} prev the child view after which the specified view should
- be inserted
- @private
- */
- _scheduleInsertion: function(view, prev) {
- if (prev) {
- prev.domManager.after(prev, view);
- } else {
- this.domManager.prepend(this, view);
- }
- },
-
- currentView: null,
-
- _currentViewWillChange: Ember.beforeObserver(function() {
- var childViews = get(this, 'childViews'),
- currentView = get(this, 'currentView');
-
- if (currentView) {
- childViews.removeObject(currentView);
- currentView.destroy();
- }
- }, 'currentView'),
-
- _currentViewDidChange: Ember.observer(function() {
- var childViews = get(this, 'childViews'),
- currentView = get(this, 'currentView');
-
- if (currentView) {
- childViews.pushObject(currentView);
- }
- }, 'currentView')
-});
-
-// Ember.ContainerView extends the default view states to provide different
-// behavior for childViewsWillChange and childViewsDidChange.
-Ember.ContainerView.states = {
- parent: Ember.View.states,
-
- inBuffer: {
- childViewsDidChange: function(parentView, views, start, added) {
- var buffer = parentView.buffer,
- startWith, prev, prevBuffer, view;
-
- // Determine where to begin inserting the child view(s) in the
- // render buffer.
- if (start === 0) {
- // If views were inserted at the beginning, prepend the first
- // view to the render buffer, then begin inserting any
- // additional views at the beginning.
- view = views[start];
- startWith = start + 1;
- view.renderToBuffer(buffer, 'prepend');
- } else {
- // Otherwise, just insert them at the same place as the child
- // views mutation.
- view = views[start - 1];
- startWith = start;
- }
-
- for (var i=startWith; i<start+added; i++) {
- prev = view;
- view = views[i];
- prevBuffer = prev.buffer;
- view.renderToBuffer(prevBuffer, 'insertAfter');
- }
- }
- },
-
- hasElement: {
- childViewsWillChange: function(view, views, start, removed) {
- for (var i=start; i<start+removed; i++) {
- views[i].remove();
- }
- },
-
- childViewsDidChange: function(view, views, start, added) {
- // If the DOM element for this container view already exists,
- // schedule each child view to insert its DOM representation after
- // bindings have finished syncing.
- var prev = start === 0 ? null : views[start-1];
-
- for (var i=start; i<start+added; i++) {
- view = views[i];
- this._scheduleInsertion(view, prev);
- prev = view;
- }
- }
- }
-};
-
-Ember.ContainerView.states.inDOM = {
- parentState: Ember.ContainerView.states.hasElement
-};
-
-Ember.ContainerView.reopen({
- states: Ember.ContainerView.states
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
-
-/**
- @class
-
- `Ember.CollectionView` is an `Ember.View` descendent responsible for managing a
- collection (an array or array-like object) by maintaing a child view object and
- associated DOM representation for each item in the array and ensuring that child
- views and their associated rendered HTML are updated when items in the array
- are added, removed, or replaced.
-
- ## Setting content
- The managed collection of objects is referenced as the `Ember.CollectionView` instance's
- `content` property.
-
- someItemsView = Ember.CollectionView.create({
- content: ['A', 'B','C']
- })
-
- The view for each item in the collection will have its `content` property set
- to the item.
-
- ## Specifying itemViewClass
- By default the view class for each item in the managed collection will be an instance
- of `Ember.View`. You can supply a different class by setting the `CollectionView`'s
- `itemViewClass` property.
-
- Given an empty `<body>` and the following code:
-
-
- someItemsView = Ember.CollectionView.create({
- classNames: ['a-collection'],
- content: ['A','B','C'],
- itemViewClass: Ember.View.extend({
- template: Ember.Handlebars.compile("the letter: {{view.content}}")
- })
- })
-
- someItemsView.appendTo('body')
-
- Will result in the following HTML structure
-
- <div class="ember-view a-collection">
- <div class="ember-view">the letter: A</div>
- <div class="ember-view">the letter: B</div>
- <div class="ember-view">the letter: C</div>
- </div>
-
- ## Automatic matching of parent/child tagNames
-
- Setting the `tagName` property of a `CollectionView` to any of
- "ul", "ol", "table", "thead", "tbody", "tfoot", "tr", or "select" will result
- in the item views receiving an appropriately matched `tagName` property.
-
-
- Given an empty `<body>` and the following code:
-
- anUndorderedListView = Ember.CollectionView.create({
- tagName: 'ul',
- content: ['A','B','C'],
- itemViewClass: Ember.View.extend({
- template: Ember.Handlebars.compile("the letter: {{view.content}}")
- })
- })
-
- anUndorderedListView.appendTo('body')
-
- Will result in the following HTML structure
-
- <ul class="ember-view a-collection">
- <li class="ember-view">the letter: A</li>
- <li class="ember-view">the letter: B</li>
- <li class="ember-view">the letter: C</li>
- </ul>
-
- Additional tagName pairs can be provided by adding to `Ember.CollectionView.CONTAINER_MAP `
-
- Ember.CollectionView.CONTAINER_MAP['article'] = 'section'
-
-
- ## Empty View
- You can provide an `Ember.View` subclass to the `Ember.CollectionView` instance as its
- `emptyView` property. If the `content` property of a `CollectionView` is set to `null`
- or an empty array, an instance of this view will be the `CollectionView`s only child.
-
- aListWithNothing = Ember.CollectionView.create({
- classNames: ['nothing']
- content: null,
- emptyView: Ember.View.extend({
- template: Ember.Handlebars.compile("The collection is empty")
- })
- })
-
- aListWithNothing.appendTo('body')
-
- Will result in the following HTML structure
-
- <div class="ember-view nothing">
- <div class="ember-view">
- The collection is empty
- </div>
- </div>
-
- ## Adding and Removing items
- The `childViews` property of a `CollectionView` should not be directly manipulated. Instead,
- add, remove, replace items from its `content` property. This will trigger
- appropriate changes to its rendered HTML.
-
- ## Use in templates via the `{{collection}}` Ember.Handlebars helper
- Ember.Handlebars provides a helper specifically for adding `CollectionView`s to templates.
- See `Ember.Handlebars.collection` for more details
-
- @since Ember 0.9
- @extends Ember.ContainerView
-*/
-Ember.CollectionView = Ember.ContainerView.extend(
-/** @scope Ember.CollectionView.prototype */ {
-
- /**
- A list of items to be displayed by the Ember.CollectionView.
-
- @type Ember.Array
- @default null
- */
- content: null,
-
- /**
- @private
-
- This provides metadata about what kind of empty view class this
- collection would like if it is being instantiated from another
- system (like Handlebars)
- */
- emptyViewClass: Ember.View,
-
- /**
- An optional view to display if content is set to an empty array.
-
- @type Ember.View
- @default null
- */
- emptyView: null,
-
- /**
- @type Ember.View
- @default Ember.View
- */
- itemViewClass: Ember.View,
-
- /** @private */
- init: function() {
- var ret = this._super();
- this._contentDidChange();
- return ret;
- },
-
- _contentWillChange: Ember.beforeObserver(function() {
- var content = this.get('content');
-
- if (content) { content.removeArrayObserver(this); }
- var len = content ? get(content, 'length') : 0;
- this.arrayWillChange(content, 0, len);
- }, 'content'),
-
- /**
- @private
-
- Check to make sure that the content has changed, and if so,
- update the children directly. This is always scheduled
- asynchronously, to allow the element to be created before
- bindings have synchronized and vice versa.
- */
- _contentDidChange: Ember.observer(function() {
- var content = get(this, 'content');
-
- if (content) {
- Ember.assert(fmt("an Ember.CollectionView's content must implement Ember.Array. You passed %@", [content]), Ember.Array.detect(content));
- content.addArrayObserver(this);
- }
-
- var len = content ? get(content, 'length') : 0;
- this.arrayDidChange(content, 0, null, len);
- }, 'content'),
-
- willDestroy: function() {
- var content = get(this, 'content');
- if (content) { content.removeArrayObserver(this); }
-
- this._super();
- },
-
- arrayWillChange: function(content, start, removedCount) {
- // If the contents were empty before and this template collection has an
- // empty view remove it now.
- var emptyView = get(this, 'emptyView');
- if (emptyView && emptyView instanceof Ember.View) {
- emptyView.removeFromParent();
- }
-
- // Loop through child views that correspond with the removed items.
- // Note that we loop from the end of the array to the beginning because
- // we are mutating it as we go.
- var childViews = get(this, 'childViews'), childView, idx, len;
-
- len = get(childViews, 'length');
-
- var removingAll = removedCount === len;
-
- if (removingAll) {
- this.invokeForState('empty');
- }
-
- for (idx = start + removedCount - 1; idx >= start; idx--) {
- childView = childViews[idx];
- if (removingAll) { childView.removedFromDOM = true; }
- childView.destroy();
- }
- },
-
- /**
- Called when a mutation to the underlying content array occurs.
-
- This method will replay that mutation against the views that compose the
- Ember.CollectionView, ensuring that the view reflects the model.
-
- This array observer is added in contentDidChange.
-
- @param {Array} addedObjects
- the objects that were added to the content
-
- @param {Array} removedObjects
- the objects that were removed from the content
-
- @param {Number} changeIndex
- the index at which the changes occurred
- */
- arrayDidChange: function(content, start, removed, added) {
- var itemViewClass = get(this, 'itemViewClass'),
- childViews = get(this, 'childViews'),
- addedViews = [], view, item, idx, len, itemTagName;
-
- if ('string' === typeof itemViewClass) {
- itemViewClass = get(itemViewClass);
- }
-
- Ember.assert(fmt("itemViewClass must be a subclass of Ember.View, not %@", [itemViewClass]), Ember.View.detect(itemViewClass));
-
- len = content ? get(content, 'length') : 0;
- if (len) {
- for (idx = start; idx < start+added; idx++) {
- item = content.objectAt(idx);
-
- view = this.createChildView(itemViewClass, {
- content: item,
- contentIndex: idx
- });
-
- addedViews.push(view);
- }
- } else {
- var emptyView = get(this, 'emptyView');
- if (!emptyView) { return; }
-
- emptyView = this.createChildView(emptyView);
- addedViews.push(emptyView);
- set(this, 'emptyView', emptyView);
- }
- childViews.replace(start, 0, addedViews);
- },
-
- createChildView: function(view, attrs) {
- view = this._super(view, attrs);
-
- var itemTagName = get(view, 'tagName');
- var tagName = (itemTagName === null || itemTagName === undefined) ? Ember.CollectionView.CONTAINER_MAP[get(this, 'tagName')] : itemTagName;
-
- set(view, 'tagName', tagName);
-
- return view;
- }
-});
-
-/**
- @static
-
- A map of parent tags to their default child tags. You can add
- additional parent tags if you want collection views that use
- a particular parent tag to default to a child tag.
-
- @type Hash
- @constant
-*/
-Ember.CollectionView.CONTAINER_MAP = {
- ul: 'li',
- ol: 'li',
- table: 'tr',
- thead: 'tr',
- tbody: 'tr',
- tfoot: 'tr',
- tr: 'td',
- select: 'option'
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-/*globals jQuery*/
-
-})();
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- @extends Ember.Object
-*/
-Ember.State = Ember.Object.extend(Ember.Evented,
-/** @scope Ember.State.prototype */{
- isState: true,
-
- /**
- A reference to the parent state.
-
- @type Ember.State
- */
- parentState: null,
- start: null,
-
- /**
- The name of this state.
-
- @type String
- */
- name: null,
-
- /**
- The full path to this state.
-
- @type String
- @readOnly
- */
- path: Ember.computed(function() {
- var parentPath = get(this, 'parentState.path'),
- path = get(this, 'name');
-
- if (parentPath) {
- path = parentPath + '.' + path;
- }
-
- return path;
- }).property().cacheable(),
-
- /**
- @private
-
- Override the default event firing from Ember.Evented to
- also call methods with the given name.
- */
- trigger: function(name) {
- if (this[name]) {
- this[name].apply(this, [].slice.call(arguments, 1));
- }
- this._super.apply(this, arguments);
- },
-
- /** @private */
- init: function() {
- var states = get(this, 'states'), foundStates;
- set(this, 'childStates', Ember.A());
- set(this, 'eventTransitions', get(this, 'eventTransitions') || {});
-
- var name, value, transitionTarget;
-
- // As a convenience, loop over the properties
- // of this state and look for any that are other
- // Ember.State instances or classes, and move them
- // to the `states` hash. This avoids having to
- // create an explicit separate hash.
-
- if (!states) {
- states = {};
-
- for (name in this) {
- if (name === "constructor") { continue; }
-
- if (value = this[name]) {
- if (transitionTarget = value.transitionTarget) {
- this.eventTransitions[name] = transitionTarget;
- }
-
- this.setupChild(states, name, value);
- }
- }
-
- set(this, 'states', states);
- } else {
- for (name in states) {
- this.setupChild(states, name, states[name]);
- }
- }
-
- set(this, 'pathsCache', {});
- set(this, 'pathsCacheNoContext', {});
- },
-
- /** @private */
- setupChild: function(states, name, value) {
- if (!value) { return false; }
-
- if (value.isState) {
- set(value, 'name', name);
- } else if (Ember.State.detect(value)) {
- value = value.create({
- name: name
- });
- }
-
- if (value.isState) {
- set(value, 'parentState', this);
- get(this, 'childStates').pushObject(value);
- states[name] = value;
- }
- },
-
- lookupEventTransition: function(name) {
- var path, state = this;
-
- while(state && !path) {
- path = state.eventTransitions[name];
- state = state.get('parentState');
- }
-
- return path;
- },
-
- /**
- A Boolean value indicating whether the state is a leaf state
- in the state hierarchy. This is false if the state has child
- states; otherwise it is true.
-
- @type Boolean
- */
- isLeaf: Ember.computed(function() {
- return !get(this, 'childStates').length;
- }).cacheable(),
-
- /**
- A boolean value indicating whether the state takes a context.
- By default we assume all states take contexts.
- */
- hasContext: true,
-
- /**
- This is the default transition event.
-
- @event
- @param {Ember.StateManager} manager
- @param context
- @see Ember.StateManager#transitionEvent
- */
- setup: Ember.K,
-
- /**
- This event fires when the state is entered.
-
- @event
- @param {Ember.StateManager} manager
- */
- enter: Ember.K,
-
- /**
- This event fires when the state is exited.
-
- @event
- @param {Ember.StateManager} manager
- */
- exit: Ember.K
-});
-
-var Event = Ember.$ && Ember.$.Event;
-
-Ember.State.reopenClass(
-/** @scope Ember.State */{
-
- /**
- @static
-
- Creates an action function for transitioning to the named state while preserving context.
-
- The following example StateManagers are equivalent:
-
- aManager = Ember.StateManager.create({
- stateOne: Ember.State.create({
- changeToStateTwo: Ember.State.transitionTo('stateTwo')
- }),
- stateTwo: Ember.State.create({})
- })
-
- bManager = Ember.StateManager.create({
- stateOne: Ember.State.create({
- changeToStateTwo: function(manager, context){
- manager.transitionTo('stateTwo', context)
- }
- }),
- stateTwo: Ember.State.create({})
- })
-
- @param {String} target
- */
- transitionTo: function(target) {
- var event = function(stateManager, context) {
- if (Event && context instanceof Event) {
- if (context.hasOwnProperty('context')) {
- context = context.context;
- } else {
- // If we received an event and it doesn't contain
- // a context, don't pass along a superfluous
- // context to the target of the event.
- return stateManager.transitionTo(target);
- }
- }
-
- stateManager.transitionTo(target, context);
- };
-
- event.transitionTarget = target;
-
- return event;
- }
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
-var arrayForEach = Ember.ArrayPolyfills.forEach;
-/**
- @private
-
- A Transition takes the enter, exit and resolve states and normalizes
- them:
-
- * takes any passed in contexts into consideration
- * adds in `initialState`s
-*/
-var Transition = function(raw) {
- this.enterStates = raw.enterStates.slice();
- this.exitStates = raw.exitStates.slice();
- this.resolveState = raw.resolveState;
-
- this.finalState = raw.enterStates[raw.enterStates.length - 1] || raw.resolveState;
-};
-
-Transition.prototype = {
- /**
- @private
-
- Normalize the passed in enter, exit and resolve states.
-
- This process also adds `finalState` and `contexts` to the Transition object.
-
- @param {Ember.StateManager} manager the state manager running the transition
- @param {Array} contexts a list of contexts passed into `transitionTo`
- */
- normalize: function(manager, contexts) {
- this.matchContextsToStates(contexts);
- this.addInitialStates();
- this.removeUnchangedContexts(manager);
- return this;
- },
-
- /**
- @private
-
- Match each of the contexts passed to `transitionTo` to a state.
- This process may also require adding additional enter and exit
- states if there are more contexts than enter states.
-
- @param {Array} contexts a list of contexts passed into `transitionTo`
- */
- matchContextsToStates: function(contexts) {
- var stateIdx = this.enterStates.length - 1,
- matchedContexts = [],
- state,
- context;
-
- // Next, we will match the passed in contexts to the states they
- // represent.
- //
- // First, assign a context to each enter state in reverse order. If
- // any contexts are left, add a parent state to the list of states
- // to enter and exit, and assign a context to the parent state.
- //
- // If there are still contexts left when the state manager is
- // reached, raise an exception.
- //
- // This allows the following:
- //
- // |- root
- // | |- post
- // | | |- comments
- // | |- about (* current state)
- //
- // For `transitionTo('post.comments', post, post.get('comments')`,
- // the first context (`post`) will be assigned to `root.post`, and
- // the second context (`post.get('comments')`) will be assigned
- // to `root.post.comments`.
- //
- // For the following:
- //
- // |- root
- // | |- post
- // | | |- index (* current state)
- // | | |- comments
- //
- // For `transitionTo('post.comments', otherPost, otherPost.get('comments')`,
- // the `<root.post>` state will be added to the list of enter and exit
- // states because its context has changed.
-
- while (contexts.length > 0) {
- if (stateIdx >= 0) {
- state = this.enterStates[stateIdx--];
- } else {
- if (this.enterStates.length) {
- state = get(this.enterStates[0], 'parentState');
- if (!state) { throw "Cannot match all contexts to states"; }
- } else {
- // If re-entering the current state with a context, the resolve
- // state will be the current state.
- state = this.resolveState;
- }
-
- this.enterStates.unshift(state);
- this.exitStates.unshift(state);
- }
-
- // in routers, only states with dynamic segments have a context
- if (get(state, 'hasContext')) {
- context = contexts.pop();
- } else {
- context = null;
- }
-
- matchedContexts.unshift(context);
- }
-
- this.contexts = matchedContexts;
- },
-
- /**
- @private
-
- Add any `initialState`s to the list of enter states.
- */
- addInitialStates: function() {
- var finalState = this.finalState, initialState;
-
- while(true) {
- initialState = get(finalState, 'initialState') || 'start';
- finalState = get(finalState, 'states.' + initialState);
-
- if (!finalState) { break; }
-
- this.finalState = finalState;
- this.enterStates.push(finalState);
- this.contexts.push(undefined);
- }
- },
-
- /**
- @private
-
- Remove any states that were added because the number of contexts
- exceeded the number of explicit enter states, but the context has
- not changed since the last time the state was entered.
-
- @param {Ember.StateManager} manager passed in to look up the last
- context for a states
- */
- removeUnchangedContexts: function(manager) {
- // Start from the beginning of the enter states. If the state was added
- // to the list during the context matching phase, make sure the context
- // has actually changed since the last time the state was entered.
- while (this.enterStates.length > 0) {
- if (this.enterStates[0] !== this.exitStates[0]) { break; }
-
- if (this.enterStates.length === this.contexts.length) {
- if (manager.getStateMeta(this.enterStates[0], 'context') !== this.contexts[0]) { break; }
- this.contexts.shift();
- }
-
- this.resolveState = this.enterStates.shift();
- this.exitStates.shift();
- }
- }
-};
-
-/**
- @class
-
- StateManager is part of Ember's implementation of a finite state machine. A StateManager
- instance manages a number of properties that are instances of `Ember.State`,
- tracks the current active state, and triggers callbacks when states have changed.
-
- ## Defining States
-
- The states of StateManager can be declared in one of two ways. First, you can define
- a `states` property that contains all the states:
-
- managerA = Ember.StateManager.create({
- states: {
- stateOne: Ember.State.create(),
- stateTwo: Ember.State.create()
- }
- })
-
- managerA.get('states')
- // {
- // stateOne: Ember.State.create(),
- // stateTwo: Ember.State.create()
- // }
-
- You can also add instances of `Ember.State` (or an `Ember.State` subclass) directly as properties
- of a StateManager. These states will be collected into the `states` property for you.
-
- managerA = Ember.StateManager.create({
- stateOne: Ember.State.create(),
- stateTwo: Ember.State.create()
- })
-
- managerA.get('states')
- // {
- // stateOne: Ember.State.create(),
- // stateTwo: Ember.State.create()
- // }
-
- ## The Initial State
- When created a StateManager instance will immediately enter into the state
- defined as its `start` property or the state referenced by name in its
- `initialState` property:
-
- managerA = Ember.StateManager.create({
- start: Ember.State.create({})
- })
-
- managerA.get('currentState.name') // 'start'
-
- managerB = Ember.StateManager.create({
- initialState: 'beginHere',
- beginHere: Ember.State.create({})
- })
-
- managerB.get('currentState.name') // 'beginHere'
-
- Because it is a property you may also provide a computed function if you wish to derive
- an `initialState` programmatically:
-
- managerC = Ember.StateManager.create({
- initialState: function(){
- if (someLogic) {
- return 'active';
- } else {
- return 'passive';
- }
- }.property(),
- active: Ember.State.create({}),
- passive: Ember.State.create({})
- })
-
- ## Moving Between States
- A StateManager can have any number of Ember.State objects as properties
- and can have a single one of these states as its current state.
-
- Calling `transitionTo` transitions between states:
-
- robotManager = Ember.StateManager.create({
- initialState: 'poweredDown',
- poweredDown: Ember.State.create({}),
- poweredUp: Ember.State.create({})
- })
-
- robotManager.get('currentState.name') // 'poweredDown'
- robotManager.transitionTo('poweredUp')
- robotManager.get('currentState.name') // 'poweredUp'
-
- Before transitioning into a new state the existing `currentState` will have its
- `exit` method called with the StateManager instance as its first argument and
- an object representing the transition as its second argument.
-
- After transitioning into a new state the new `currentState` will have its
- `enter` method called with the StateManager instance as its first argument and
- an object representing the transition as its second argument.
-
- robotManager = Ember.StateManager.create({
- initialState: 'poweredDown',
- poweredDown: Ember.State.create({
- exit: function(stateManager){
- console.log("exiting the poweredDown state")
- }
- }),
- poweredUp: Ember.State.create({
- enter: function(stateManager){
- console.log("entering the poweredUp state. Destroy all humans.")
- }
- })
- })
-
- robotManager.get('currentState.name') // 'poweredDown'
- robotManager.transitionTo('poweredUp')
- // will log
- // 'exiting the poweredDown state'
- // 'entering the poweredUp state. Destroy all humans.'
-
-
- Once a StateManager is already in a state, subsequent attempts to enter that state will
- not trigger enter or exit method calls. Attempts to transition into a state that the
- manager does not have will result in no changes in the StateManager's current state:
-
- robotManager = Ember.StateManager.create({
- initialState: 'poweredDown',
- poweredDown: Ember.State.create({
- exit: function(stateManager){
- console.log("exiting the poweredDown state")
- }
- }),
- poweredUp: Ember.State.create({
- enter: function(stateManager){
- console.log("entering the poweredUp state. Destroy all humans.")
- }
- })
- })
-
- robotManager.get('currentState.name') // 'poweredDown'
- robotManager.transitionTo('poweredUp')
- // will log
- // 'exiting the poweredDown state'
- // 'entering the poweredUp state. Destroy all humans.'
- robotManager.transitionTo('poweredUp') // no logging, no state change
-
- robotManager.transitionTo('someUnknownState') // silently fails
- robotManager.get('currentState.name') // 'poweredUp'
-
-
- Each state property may itself contain properties that are instances of Ember.State.
- The StateManager can transition to specific sub-states in a series of transitionTo method calls or
- via a single transitionTo with the full path to the specific state. The StateManager will also
- keep track of the full path to its currentState
-
- robotManager = Ember.StateManager.create({
- initialState: 'poweredDown',
- poweredDown: Ember.State.create({
- charging: Ember.State.create(),
- charged: Ember.State.create()
- }),
- poweredUp: Ember.State.create({
- mobile: Ember.State.create(),
- stationary: Ember.State.create()
- })
- })
-
- robotManager.get('currentState.name') // 'poweredDown'
-
- robotManager.transitionTo('poweredUp')
- robotManager.get('currentState.name') // 'poweredUp'
-
- robotManager.transitionTo('mobile')
- robotManager.get('currentState.name') // 'mobile'
-
- // transition via a state path
- robotManager.transitionTo('poweredDown.charging')
- robotManager.get('currentState.name') // 'charging'
-
- robotManager.get('currentState.path') // 'poweredDown.charging'
-
- Enter transition methods will be called for each state and nested child state in their
- hierarchical order. Exit methods will be called for each state and its nested states in
- reverse hierarchical order.
-
- Exit transitions for a parent state are not called when entering into one of its child states,
- only when transitioning to a new section of possible states in the hierarchy.
-
- robotManager = Ember.StateManager.create({
- initialState: 'poweredDown',
- poweredDown: Ember.State.create({
- enter: function(){},
- exit: function(){
- console.log("exited poweredDown state")
- },
- charging: Ember.State.create({
- enter: function(){},
- exit: function(){}
- }),
- charged: Ember.State.create({
- enter: function(){
- console.log("entered charged state")
- },
- exit: function(){
- console.log("exited charged state")
- }
- })
- }),
- poweredUp: Ember.State.create({
- enter: function(){
- console.log("entered poweredUp state")
- },
- exit: function(){},
- mobile: Ember.State.create({
- enter: function(){
- console.log("entered mobile state")
- },
- exit: function(){}
- }),
- stationary: Ember.State.create({
- enter: function(){},
- exit: function(){}
- })
- })
- })
-
-
- robotManager.get('currentState.path') // 'poweredDown'
- robotManager.transitionTo('charged')
- // logs 'entered charged state'
- // but does *not* log 'exited poweredDown state'
- robotManager.get('currentState.name') // 'charged
-
- robotManager.transitionTo('poweredUp.mobile')
- // logs
- // 'exited charged state'
- // 'exited poweredDown state'
- // 'entered poweredUp state'
- // 'entered mobile state'
-
- During development you can set a StateManager's `enableLogging` property to `true` to
- receive console messages of state transitions.
-
- robotManager = Ember.StateManager.create({
- enableLogging: true
- })
-
- ## Managing currentState with Actions
- To control which transitions between states are possible for a given state, StateManager
- can receive and route action messages to its states via the `send` method. Calling to `send` with
- an action name will begin searching for a method with the same name starting at the current state
- and moving up through the parent states in a state hierarchy until an appropriate method is found
- or the StateManager instance itself is reached.
-
- If an appropriately named method is found it will be called with the state manager as the first
- argument and an optional `context` object as the second argument.
-
- managerA = Ember.StateManager.create({
- initialState: 'stateOne.substateOne.subsubstateOne',
- stateOne: Ember.State.create({
- substateOne: Ember.State.create({
- anAction: function(manager, context){
- console.log("an action was called")
- },
- subsubstateOne: Ember.State.create({})
- })
- })
- })
-
- managerA.get('currentState.name') // 'subsubstateOne'
- managerA.send('anAction')
- // 'stateOne.substateOne.subsubstateOne' has no anAction method
- // so the 'anAction' method of 'stateOne.substateOne' is called
- // and logs "an action was called"
- // with managerA as the first argument
- // and no second argument
-
- someObject = {}
- managerA.send('anAction', someObject)
- // the 'anAction' method of 'stateOne.substateOne' is called again
- // with managerA as the first argument and
- // someObject as the second argument.
-
-
- If the StateManager attempts to send an action but does not find an appropriately named
- method in the current state or while moving upwards through the state hierarchy
- it will throw a new Ember.Error. Action detection only moves upwards through the state hierarchy
- from the current state. It does not search in other portions of the hierarchy.
-
- managerB = Ember.StateManager.create({
- initialState: 'stateOne.substateOne.subsubstateOne',
- stateOne: Ember.State.create({
- substateOne: Ember.State.create({
- subsubstateOne: Ember.State.create({})
- })
- }),
- stateTwo: Ember.State.create({
- anAction: function(manager, context){
- // will not be called below because it is
- // not a parent of the current state
- }
- })
- })
-
- managerB.get('currentState.name') // 'subsubstateOne'
- managerB.send('anAction')
- // Error: <Ember.StateManager:ember132> could not
- // respond to event anAction in state stateOne.substateOne.subsubstateOne.
-
- Inside of an action method the given state should delegate `transitionTo` calls on its
- StateManager.
-
- robotManager = Ember.StateManager.create({
- initialState: 'poweredDown.charging',
- poweredDown: Ember.State.create({
- charging: Ember.State.create({
- chargeComplete: function(manager, context){
- manager.transitionTo('charged')
- }
- }),
- charged: Ember.State.create({
- boot: function(manager, context){
- manager.transitionTo('poweredUp')
- }
- })
- }),
- poweredUp: Ember.State.create({
- beginExtermination: function(manager, context){
- manager.transitionTo('rampaging')
- },
- rampaging: Ember.State.create()
- })
- })
-
- robotManager.get('currentState.name') // 'charging'
- robotManager.send('boot') // throws error, no boot action
- // in current hierarchy
- robotManager.get('currentState.name') // remains 'charging'
-
- robotManager.send('beginExtermination') // throws error, no beginExtermination
- // action in current hierarchy
- robotManager.get('currentState.name') // remains 'charging'
-
- robotManager.send('chargeComplete')
- robotManager.get('currentState.name') // 'charged'
-
- robotManager.send('boot')
- robotManager.get('currentState.name') // 'poweredUp'
-
- robotManager.send('beginExtermination', allHumans)
- robotManager.get('currentState.name') // 'rampaging'
-
- Transition actions can also be created using the `transitionTo` method of the Ember.State class. The
- following example StateManagers are equivalent:
-
- aManager = Ember.StateManager.create({
- stateOne: Ember.State.create({
- changeToStateTwo: Ember.State.transitionTo('stateTwo')
- }),
- stateTwo: Ember.State.create({})
- })
-
- bManager = Ember.StateManager.create({
- stateOne: Ember.State.create({
- changeToStateTwo: function(manager, context){
- manager.transitionTo('stateTwo', context)
- }
- }),
- stateTwo: Ember.State.create({})
- })
-**/
-Ember.StateManager = Ember.State.extend(
-/** @scope Ember.StateManager.prototype */ {
-
- /**
- When creating a new statemanager, look for a default state to transition
- into. This state can either be named `start`, or can be specified using the
- `initialState` property.
- */
- init: function() {
- this._super();
-
- set(this, 'stateMeta', Ember.Map.create());
-
- var initialState = get(this, 'initialState');
-
- if (!initialState && get(this, 'states.start')) {
- initialState = 'start';
- }
-
- if (initialState) {
- this.transitionTo(initialState);
- Ember.assert('Failed to transition to initial state "' + initialState + '"', !!get(this, 'currentState'));
- }
- },
-
- stateMetaFor: function(state) {
- var meta = get(this, 'stateMeta'),
- stateMeta = meta.get(state);
-
- if (!stateMeta) {
- stateMeta = {};
- meta.set(state, stateMeta);
- }
-
- return stateMeta;
- },
-
- setStateMeta: function(state, key, value) {
- return set(this.stateMetaFor(state), key, value);
- },
-
- getStateMeta: function(state, key) {
- return get(this.stateMetaFor(state), key);
- },
-
- /**
- The current state from among the manager's possible states. This property should
- not be set directly. Use `transitionTo` to move between states by name.
-
- @type Ember.State
- @readOnly
- */
- currentState: null,
-
- /**
- The name of transitionEvent that this stateManager will dispatch
-
- @property {String}
- @default 'setup'
- */
- transitionEvent: 'setup',
-
- /**
- If set to true, `errorOnUnhandledEvents` will cause an exception to be
- raised if you attempt to send an event to a state manager that is not
- handled by the current state or any of its parent states.
-
- @type Boolean
- @default true
- */
- errorOnUnhandledEvent: true,
-
- send: function(event, context) {
- Ember.assert('Cannot send event "' + event + '" while currentState is ' + get(this, 'currentState'), get(this, 'currentState'));
- return this.sendRecursively(event, get(this, 'currentState'), context);
- },
-
- sendRecursively: function(event, currentState, context) {
- var log = this.enableLogging,
- action = currentState[event];
-
- // Test to see if the action is a method that
- // can be invoked. Don't blindly check just for
- // existence, because it is possible the state
- // manager has a child state of the given name,
- // and we should still raise an exception in that
- // case.
- if (typeof action === 'function') {
- if (log) { Ember.Logger.log(fmt("STATEMANAGER: Sending event '%@' to state %@.", [event, get(currentState, 'path')])); }
- return action.call(currentState, this, context);
- } else {
- var parentState = get(currentState, 'parentState');
- if (parentState) {
- return this.sendRecursively(event, parentState, context);
- } else if (get(this, 'errorOnUnhandledEvent')) {
- throw new Ember.Error(this.toString() + " could not respond to event " + event + " in state " + get(this, 'currentState.path') + ".");
- }
- }
- },
-
- /**
- Finds a state by its state path.
-
- Example:
-
- manager = Ember.StateManager.create({
- root: Ember.State.create({
- dashboard: Ember.State.create()
- })
- });
-
- manager.getStateByPath(manager, "root.dashboard")
-
- // returns the dashboard state
-
- @param {Ember.State} root the state to start searching from
- @param {String} path the state path to follow
- @returns {Ember.State} the state at the end of the path
- */
- getStateByPath: function(root, path) {
- var parts = path.split('.'),
- state = root;
-
- for (var i=0, l=parts.length; i<l; i++) {
- state = get(get(state, 'states'), parts[i]);
- if (!state) { break; }
- }
-
- return state;
- },
-
- findStateByPath: function(state, path) {
- var possible;
-
- while (!possible && state) {
- possible = this.getStateByPath(state, path);
- state = get(state, 'parentState');
- }
-
- return possible;
- },
-
- /**
- @private
-
- A state stores its child states in its `states` hash.
- This code takes a path like `posts.show` and looks
- up `origin.states.posts.states.show`.
-
- It returns a list of all of the states from the
- origin, which is the list of states to call `enter`
- on.
- */
- findStatesByPath: function(origin, path) {
- if (!path || path === "") { return undefined; }
- var r = path.split('.'),
- ret = [];
-
- for (var i=0, len = r.length; i < len; i++) {
- var states = get(origin, 'states');
-
- if (!states) { return undefined; }
-
- var s = get(states, r[i]);
- if (s) { origin = s; ret.push(s); }
- else { return undefined; }
- }
-
- return ret;
- },
-
- goToState: function() {
- // not deprecating this yet so people don't constantly need to
- // make trivial changes for little reason.
- return this.transitionTo.apply(this, arguments);
- },
-
- transitionTo: function(path, context) {
- // XXX When is transitionTo called with no path
- if (Ember.empty(path)) { return; }
-
- // The ES6 signature of this function is `path, ...contexts`
- var contexts = context ? Array.prototype.slice.call(arguments, 1) : [],
- currentState = get(this, 'currentState') || this;
-
- // First, get the enter, exit and resolve states for the current state
- // and specified path. If possible, use an existing cache.
- var hash = this.contextFreeTransition(currentState, path);
-
- // Next, process the raw state information for the contexts passed in.
- var transition = new Transition(hash).normalize(this, contexts);
-
- this.enterState(transition);
- this.triggerSetupContext(transition);
- },
-
- contextFreeTransition: function(currentState, path) {
- var cache = currentState.pathsCache[path];
- if (cache) { return cache; }
-
- var enterStates = this.findStatesByPath(currentState, path),
- exitStates = [],
- resolveState = currentState;
-
- // Walk up the states. For each state, check whether a state matching
- // the `path` is nested underneath. This will find the closest
- // parent state containing `path`.
- //
- // This allows the user to pass in a relative path. For example, for
- // the following state hierarchy:
- //
- // | |root
- // | |- posts
- // | | |- show (* current)
- // | |- comments
- // | | |- show
- //
- // If the current state is `<root.posts.show>`, an attempt to
- // transition to `comments.show` will match `<root.comments.show>`.
- //
- // First, this code will look for root.posts.show.comments.show.
- // Next, it will look for root.posts.comments.show. Finally,
- // it will look for `root.comments.show`, and find the state.
- //
- // After this process, the following variables will exist:
- //
- // * resolveState: a common parent state between the current
- // and target state. In the above example, `<root>` is the
- // `resolveState`.
- // * enterStates: a list of all of the states represented
- // by the path from the `resolveState`. For example, for
- // the path `root.comments.show`, `enterStates` would have
- // `[<root.comments>, <root.comments.show>]`
- // * exitStates: a list of all of the states from the
- // `resolveState` to the `currentState`. In the above
- // example, `exitStates` would have
- // `[<root.posts>`, `<root.posts.show>]`.
- while (resolveState && !enterStates) {
- exitStates.unshift(resolveState);
-
- resolveState = get(resolveState, 'parentState');
- if (!resolveState) {
- enterStates = this.findStatesByPath(this, path);
- if (!enterStates) {
- Ember.assert('Could not find state for path: "'+path+'"');
- return;
- }
- }
- enterStates = this.findStatesByPath(resolveState, path);
- }
-
- // If the path contains some states that are parents of both the
- // current state and the target state, remove them.
- //
- // For example, in the following hierarchy:
- //
- // |- root
- // | |- post
- // | | |- index (* current)
- // | | |- show
- //
- // If the `path` is `root.post.show`, the three variables will
- // be:
- //
- // * resolveState: `<state manager>`
- // * enterStates: `[<root>, <root.post>, <root.post.show>]`
- // * exitStates: `[<root>, <root.post>, <root.post.index>]`
- //
- // The goal of this code is to remove the common states, so we
- // have:
- //
- // * resolveState: `<root.post>`
- // * enterStates: `[<root.post.show>]`
- // * exitStates: `[<root.post.index>]`
- //
- // This avoid unnecessary calls to the enter and exit transitions.
- while (enterStates.length > 0 && enterStates[0] === exitStates[0]) {
- resolveState = enterStates.shift();
- exitStates.shift();
- }
-
- // Cache the enterStates, exitStates, and resolveState for the
- // current state and the `path`.
- var transitions = currentState.pathsCache[path] = {
- exitStates: exitStates,
- enterStates: enterStates,
- resolveState: resolveState
- };
-
- return transitions;
- },
-
- triggerSetupContext: function(transitions) {
- var contexts = transitions.contexts,
- offset = transitions.enterStates.length - contexts.length,
- enterStates = transitions.enterStates,
- transitionEvent = get(this, 'transitionEvent');
-
- Ember.assert("More contexts provided than states", offset >= 0);
-
- arrayForEach.call(enterStates, function(state, idx) {
- state.trigger(transitionEvent, this, contexts[idx-offset]);
- }, this);
- },
-
- getState: function(name) {
- var state = get(this, name),
- parentState = get(this, 'parentState');
-
- if (state) {
- return state;
- } else if (parentState) {
- return parentState.getState(name);
- }
- },
-
- enterState: function(transition) {
- var log = this.enableLogging;
-
- var exitStates = transition.exitStates.slice(0).reverse();
- arrayForEach.call(exitStates, function(state) {
- state.trigger('exit', this);
- }, this);
-
- arrayForEach.call(transition.enterStates, function(state) {
- if (log) { Ember.Logger.log("STATEMANAGER: Entering " + get(state, 'path')); }
- state.trigger('enter', this);
- }, this);
-
- set(this, 'currentState', transition.finalState);
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Statecharts
-// Copyright: ©2011 Living Social Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-(function() {
-var get = Ember.get;
-
-Ember._ResolvedState = Ember.Object.extend({
- manager: null,
- state: null,
- match: null,
-
- object: Ember.computed(function(key, value) {
- if (arguments.length === 2) {
- this._object = value;
- return value;
- } else {
- if (this._object) {
- return this._object;
- } else {
- var state = get(this, 'state'),
- match = get(this, 'match'),
- manager = get(this, 'manager');
- return state.deserialize(manager, match.hash);
- }
- }
- }).property(),
-
- hasPromise: Ember.computed(function() {
- return Ember.canInvoke(get(this, 'object'), 'then');
- }).property('object'),
-
- promise: Ember.computed(function() {
- var object = get(this, 'object');
- if (Ember.canInvoke(object, 'then')) {
- return object;
- } else {
- return {
- then: function(success) { success(object); }
- };
- }
- }).property('object'),
-
- transition: function() {
- var manager = get(this, 'manager'),
- path = get(this, 'state.path'),
- object = get(this, 'object');
- manager.transitionTo(path, object);
- }
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get;
-
-// The Ember Routable mixin assumes the existance of a simple
-// routing shim that supports the following three behaviors:
-//
-// * .getURL() - this is called when the page loads
-// * .setURL(newURL) - this is called from within the state
-// manager when the state changes to a routable state
-// * .onURLChange(callback) - this happens when the user presses
-// the back or forward button
-
-var paramForClass = function(classObject) {
- var className = classObject.toString(),
- parts = className.split("."),
- last = parts[parts.length - 1];
-
- return Ember.String.underscore(last) + "_id";
-};
-
-var merge = function(original, hash) {
- for (var prop in hash) {
- if (!hash.hasOwnProperty(prop)) { continue; }
- if (original.hasOwnProperty(prop)) { continue; }
-
- original[prop] = hash[prop];
- }
-};
-
-/**
- @class
- @extends Ember.Mixin
-*/
-Ember.Routable = Ember.Mixin.create({
- init: function() {
- var redirection;
- this.on('connectOutlets', this, this.stashContext);
-
- if (redirection = get(this, 'redirectsTo')) {
- Ember.assert("You cannot use `redirectsTo` if you already have a `connectOutlets` method", this.connectOutlets === Ember.K);
-
- this.connectOutlets = function(router) {
- router.transitionTo(redirection);
- };
- }
-
- // normalize empty route to '/'
- var route = get(this, 'route');
- if (route === '') {
- route = '/';
- }
-
- this._super();
-
- Ember.assert("You cannot use `redirectsTo` on a state that has child states", !redirection || (!!redirection && !!get(this, 'isLeaf')));
- },
-
- /**
- @private
-
- Whenever a routable state is entered, the context it was entered with
- is stashed so that we can regenerate the state's `absoluteURL` on
- demand.
- */
- stashContext: function(manager, context) {
- var serialized = this.serialize(manager, context);
- Ember.assert('serialize must return a hash', !serialized || typeof serialized === 'object');
-
- manager.setStateMeta(this, 'context', context);
- manager.setStateMeta(this, 'serialized', serialized);
-
- if (get(this, 'isRoutable') && !get(manager, 'isRouting')) {
- this.updateRoute(manager, get(manager, 'location'));
- }
- },
-
- /**
- @private
-
- Whenever a routable state is entered, the router's location object
- is notified to set the URL to the current absolute path.
-
- In general, this will update the browser's URL.
- */
- updateRoute: function(manager, location) {
- if (get(this, 'isLeafRoute')) {
- var path = this.absoluteRoute(manager);
- location.setURL(path);
- }
- },
-
- /**
- @private
-
- Get the absolute route for the current state and a given
- hash.
-
- This method is private, as it expects a serialized hash,
- not the original context object.
- */
- absoluteRoute: function(manager, hash) {
- var parentState = get(this, 'parentState');
- var path = '', generated;
-
- // If the parent state is routable, use its current path
- // as this route's prefix.
- if (get(parentState, 'isRoutable')) {
- path = parentState.absoluteRoute(manager, hash);
- }
-
- var matcher = get(this, 'routeMatcher'),
- serialized = manager.getStateMeta(this, 'serialized');
-
- // merge the existing serialized object in with the passed
- // in hash.
- hash = hash || {};
- merge(hash, serialized);
-
- generated = matcher && matcher.generate(hash);
-
- if (generated) {
- path = path + '/' + generated;
- }
-
- return path;
- },
-
- /**
- @private
-
- At the moment, a state is routable if it has a string `route`
- property. This heuristic may change.
- */
- isRoutable: Ember.computed(function() {
- return typeof get(this, 'route') === 'string';
- }).cacheable(),
-
- /**
- @private
-
- Determine if this is the last routeable state
- */
- isLeafRoute: Ember.computed(function() {
- if (get(this, 'isLeaf')) { return true; }
- return !get(this, 'childStates').findProperty('isRoutable');
- }).cacheable(),
-
- /**
- @private
-
- A _RouteMatcher object generated from the current route's `route`
- string property.
- */
- routeMatcher: Ember.computed(function() {
- var route = get(this, 'route');
- if (route) {
- return Ember._RouteMatcher.create({ route: route });
- }
- }).cacheable(),
-
- /**
- @private
-
- Check whether the route has dynamic segments and therefore takes
- a context.
- */
- hasContext: Ember.computed(function() {
- var routeMatcher = get(this, 'routeMatcher');
- if (routeMatcher) {
- return routeMatcher.identifiers.length > 0;
- }
- }).cacheable(),
-
- /**
- @private
-
- The model class associated with the current state. This property
- uses the `modelType` property, in order to allow it to be
- specified as a String.
- */
- modelClass: Ember.computed(function() {
- var modelType = get(this, 'modelType');
-
- if (typeof modelType === 'string') {
- return Ember.get(window, modelType);
- } else {
- return modelType;
- }
- }).cacheable(),
-
- /**
- @private
-
- Get the model class for the state. The heuristic is:
-
- * The state must have a single dynamic segment
- * The dynamic segment must end in `_id`
- * A dynamic segment like `blog_post_id` is converted into `BlogPost`
- * The name is then looked up on the passed in namespace
-
- The process of initializing an application with a router will
- pass the application's namespace into the router, which will be
- used here.
- */
- modelClassFor: function(namespace) {
- var modelClass, routeMatcher, identifiers, match, className;
-
- // if an explicit modelType was specified, use that
- if (modelClass = get(this, 'modelClass')) { return modelClass; }
-
- // if the router has no lookup namespace, we won't be able to guess
- // the modelType
- if (!namespace) { return; }
-
- // make sure this state is actually a routable state
- routeMatcher = get(this, 'routeMatcher');
- if (!routeMatcher) { return; }
-
- // only guess modelType for states with a single dynamic segment
- // (no more, no fewer)
- identifiers = routeMatcher.identifiers;
- if (identifiers.length !== 2) { return; }
-
- // extract the `_id` from the end of the dynamic segment; if the
- // dynamic segment does not end in `_id`, we can't guess the
- // modelType
- match = identifiers[1].match(/^(.*)_id$/);
- if (!match) { return; }
-
- // convert the underscored type into a class form and look it up
- // on the router's namespace
- className = Ember.String.classify(match[1]);
- return get(namespace, className);
- },
-
- /**
- The default method that takes a `params` object and converts
- it into an object.
-
- By default, a params hash that looks like `{ post_id: 1 }`
- will be looked up as `namespace.Post.find(1)`. This is
- designed to work seamlessly with Ember Data, but will work
- fine with any class that has a `find` method.
- */
- deserialize: function(manager, params) {
- var modelClass, routeMatcher, param;
-
- if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {
- Ember.assert("Expected "+modelClass.toString()+" to implement `find` for use in '"+this.get('path')+"' `deserialize`. Please implement the `find` method or overwrite `deserialize`.", modelClass.find);
- return modelClass.find(params[paramForClass(modelClass)]);
- }
-
- return params;
- },
-
- /**
- The default method that takes an object and converts it into
- a params hash.
-
- By default, if there is a single dynamic segment named
- `blog_post_id` and the object is a `BlogPost` with an
- `id` of `12`, the serialize method will produce:
-
- { blog_post_id: 12 }
- */
- serialize: function(manager, context) {
- var modelClass, routeMatcher, namespace, param, id;
-
- if (Ember.empty(context)) { return ''; }
-
- if (modelClass = this.modelClassFor(get(manager, 'namespace'))) {
- param = paramForClass(modelClass);
- id = get(context, 'id');
- context = {};
- context[param] = id;
- }
-
- return context;
- },
-
- /**
- @private
- */
- resolvePath: function(manager, path) {
- if (get(this, 'isLeafRoute')) { return Ember.A(); }
-
- var childStates = get(this, 'childStates'), match;
-
- childStates = Ember.A(childStates.filterProperty('isRoutable'));
-
- childStates = childStates.sort(function(a, b) {
- var aDynamicSegments = get(a, 'routeMatcher.identifiers.length'),
- bDynamicSegments = get(b, 'routeMatcher.identifiers.length'),
- aRoute = get(a, 'route'),
- bRoute = get(b, 'route');
-
- if (aRoute.indexOf(bRoute) === 0) {
- return -1;
- } else if (bRoute.indexOf(aRoute) === 0) {
- return 1;
- }
-
- if (aDynamicSegments !== bDynamicSegments) {
- return aDynamicSegments - bDynamicSegments;
- }
-
- return get(b, 'route.length') - get(a, 'route.length');
- });
-
- var state = childStates.find(function(state) {
- var matcher = get(state, 'routeMatcher');
- if (match = matcher.match(path)) { return true; }
- });
-
- Ember.assert("Could not find state for path " + path, !!state);
-
- var resolvedState = Ember._ResolvedState.create({
- manager: manager,
- state: state,
- match: match
- });
-
- var states = state.resolvePath(manager, match.remaining);
-
- return Ember.A([resolvedState]).pushObjects(states);
- },
-
- /**
- @private
-
- Once `unroute` has finished unwinding, `routePath` will be called
- with the remainder of the route.
-
- For example, if you were in the /posts/1/comments state, and you
- moved into the /posts/2/comments state, `routePath` will be called
- on the state whose path is `/posts` with the path `/2/comments`.
- */
- routePath: function(manager, path) {
- if (get(this, 'isLeafRoute')) { return; }
-
- var resolvedStates = this.resolvePath(manager, path),
- hasPromises = resolvedStates.some(function(s) { return get(s, 'hasPromise'); });
-
- function runTransition() {
- resolvedStates.forEach(function(rs) { rs.transition(); });
- }
-
- if (hasPromises) {
- manager.transitionTo('loading');
-
- Ember.assert('Loading state should be the child of a route', Ember.Routable.detect(get(manager, 'currentState.parentState')));
- Ember.assert('Loading state should not be a route', !Ember.Routable.detect(get(manager, 'currentState')));
-
- manager.handleStatePromises(resolvedStates, runTransition);
- } else {
- runTransition();
- }
- },
-
- /**
- @private
-
- When you move to a new route by pressing the back
- or forward button, this method is called first.
-
- Its job is to move the state manager into a parent
- state of the state it will eventually move into.
- */
- unroutePath: function(router, path) {
- var parentState = get(this, 'parentState');
-
- // If we're at the root state, we're done
- if (parentState === router) {
- return;
- }
-
- path = path.replace(/^(?=[^\/])/, "/");
- var absolutePath = this.absoluteRoute(router);
-
- var route = get(this, 'route');
-
- // If the current path is empty, move up one state,
- // because the index ('/') state must be a leaf node.
- if (route !== '/') {
- // If the current path is a prefix of the path we're trying
- // to go to, we're done.
- var index = path.indexOf(absolutePath),
- next = path.charAt(absolutePath.length);
-
- if (index === 0 && (next === "/" || next === "")) {
- return;
- }
- }
-
- // Transition to the parent and call unroute again.
- router.enterState({
- exitStates: [this],
- enterStates: [],
- finalState: parentState
- });
-
- router.send('unroutePath', path);
- },
-
- /**
- The `connectOutlets` event will be triggered once a
- state has been entered. It will be called with the
- route's context.
- */
- connectOutlets: Ember.K,
-
- /**
- The `navigateAway` event will be triggered when the
- URL changes due to the back/forward button
- */
- navigateAway: Ember.K
-});
-
-})();
-
-
-
-(function() {
-/**
- @class
- @extends Ember.Routable
-*/
-Ember.Route = Ember.State.extend(Ember.Routable);
-
-})();
-
-
-
-(function() {
-var escapeForRegex = function(text) {
- return text.replace(/[\-\[\]{}()*+?.,\\\^\$|#\s]/g, "\\$&");
-};
-
-Ember._RouteMatcher = Ember.Object.extend({
- state: null,
-
- init: function() {
- var route = this.route,
- identifiers = [],
- count = 1,
- escaped;
-
- // Strip off leading slash if present
- if (route.charAt(0) === '/') {
- route = this.route = route.substr(1);
- }
-
- escaped = escapeForRegex(route);
-
- var regex = escaped.replace(/:([a-z_]+)(?=$|\/)/gi, function(match, id) {
- identifiers[count++] = id;
- return "([^/]+)";
- });
-
- this.identifiers = identifiers;
- this.regex = new RegExp("^/?" + regex);
- },
-
- match: function(path) {
- var match = path.match(this.regex);
-
- if (match) {
- var identifiers = this.identifiers,
- hash = {};
-
- for (var i=1, l=identifiers.length; i<l; i++) {
- hash[identifiers[i]] = match[i];
- }
-
- return {
- remaining: path.substr(match[0].length),
- hash: identifiers.length > 0 ? hash : null
- };
- }
- },
-
- generate: function(hash) {
- var identifiers = this.identifiers, route = this.route, id;
- for (var i=1, l=identifiers.length; i<l; i++) {
- id = identifiers[i];
- route = route.replace(new RegExp(":" + id), hash[id]);
- }
- return route;
- }
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-var merge = function(original, hash) {
- for (var prop in hash) {
- if (!hash.hasOwnProperty(prop)) { continue; }
- if (original.hasOwnProperty(prop)) { continue; }
-
- original[prop] = hash[prop];
- }
-};
-
-/**
- @class
-
- `Ember.Router` is the subclass of `Ember.StateManager` responsible for providing URL-based
- application state detection. The `Ember.Router` instance of an application detects the browser URL
- at application load time and attempts to match it to a specific application state. Additionally
- the router will update the URL to reflect an application's state changes over time.
-
- ## Adding a Router Instance to Your Application
- An instance of Ember.Router can be associated with an instance of Ember.Application in one of two ways:
-
- You can provide a subclass of Ember.Router as the `Router` property of your application. An instance
- of this Router class will be instantiated and route detection will be enabled when the application's
- `initialize` method is called. The Router instance will be available as the `router` property
- of the application:
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({ ... })
- });
-
- App.initialize();
- App.get('router') // an instance of App.Router
-
- If you want to define a Router instance elsewhere, you can pass the instance to the application's
- `initialize` method:
-
- App = Ember.Application.create();
- aRouter = Ember.Router.create({ ... });
-
- App.initialize(aRouter);
- App.get('router') // aRouter
-
- ## Adding Routes to a Router
- The `initialState` property of Ember.Router instances is named `root`. The state stored in this
- property must be a subclass of Ember.Route. The `root` route acts as the container for the
- set of routable states but is not routable itself. It should have states that are also subclasses
- of Ember.Route which each have a `route` property describing the URL pattern you would like to detect.
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- index: Ember.Route.extend({
- route: '/'
- }),
- ... additional Ember.Routes ...
- })
- })
- });
- App.initialize();
-
-
- When an application loads, Ember will parse the URL and attempt to find an Ember.Route within
- the application's states that matches. (The example URL-matching below will use the default
- 'hash syntax' provided by `Ember.HashLocation`.)
-
- In the following route structure:
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/'
- }),
- bRoute: Ember.Route.extend({
- route: '/alphabeta'
- })
- })
- })
- });
- App.initialize();
-
- Loading the page at the URL '#/' will detect the route property of 'root.aRoute' ('/') and
- transition the router first to the state named 'root' and then to the substate 'aRoute'.
-
- Respectively, loading the page at the URL '#/alphabeta' would detect the route property of
- 'root.bRoute' ('/alphabeta') and transition the router first to the state named 'root' and
- then to the substate 'bRoute'.
-
- ## Adding Nested Routes to a Router
- Routes can contain nested subroutes each with their own `route` property describing the nested
- portion of the URL they would like to detect and handle. Router, like all instances of StateManager,
- cannot call `transitonTo` with an intermediary state. To avoid transitioning the Router into an
- intermediary state when detecting URLs, a Route with nested routes must define both a base `route`
- property for itself and a child Route with a `route` property of `'/'` which will be transitioned
- to when the base route is detected in the URL:
-
- Given the following application code:
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/theBaseRouteForThisSet',
-
- indexSubRoute: Ember.Route.extend({
- route: '/',
- }),
-
- subRouteOne: Ember.Route.extend({
- route: '/subroute1
- }),
-
- subRouteTwo: Ember.Route.extend({
- route: '/subRoute2'
- })
-
- })
- })
- })
- });
- App.initialize();
-
- When the application is loaded at '/theBaseRouteForThisSet' the Router will transition to the route
- at path 'root.aRoute' and then transition to state 'indexSubRoute'.
-
- When the application is loaded at '/theBaseRouteForThisSet/subRoute1' the Router will transition to
- the route at path 'root.aRoute' and then transition to state 'subRouteOne'.
-
- ## Route Transition Events
- Transitioning between Ember.Route instances (including the transition into the detected
- route when loading the application) triggers the same transition events as state transitions for
- base `Ember.State`s. However, the default `setup` transition event is named `connectOutlets` on
- Ember.Router instances (see 'Changing View Hierarchy in Response To State Change').
-
- The following route structure when loaded with the URL "#/"
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/',
- enter: function(router) {
- console.log("entering root.aRoute from", router.get('currentState.name'));
- },
- connectOutlets: function(router) {
- console.log("entered root.aRoute, fully transitioned to", router.get('currentState.path'));
- }
- })
- })
- })
- });
- App.initialize();
-
- Will result in console output of:
-
- 'entering root.aRoute from root'
- 'entered root.aRoute, fully transitioned to root.aRoute '
-
- Ember.Route has two additional callbacks for handling URL serialization and deserialization. See
- 'Serializing/Deserializing URLs'
-
- ## Routes With Dynamic Segments
- An Ember.Route's `route` property can reference dynamic sections of the URL by prefacing a URL segment
- with the ':' character. The values of these dynamic segments will be passed as a hash to the
- `deserialize` method of the matching Route (see 'Serializing/Deserializing URLs').
-
- ## Serializing/Deserializing URLs
- Ember.Route has two callbacks for associating a particular object context with a URL: `serialize`
- for converting an object into a parameters hash to fill dynamic segments of a URL and `deserialize`
- for converting a hash of dynamic segments from the URL into the appropriate object.
-
- ### Deserializing A URL's Dynamic Segments
- When an application is first loaded or the URL is changed manually (e.g. through the browser's
- back button) the `deserialize` method of the URL's matching Ember.Route will be called with
- the application's router as its first argument and a hash of the URLs dynamic segments and values
- as its second argument.
-
- The following route structure when loaded with the URL "#/fixed/thefirstvalue/anotherFixed/thesecondvalue":
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/fixed/:dynamicSectionA/anotherFixed/:dynamicSectionB',
- deserialize: function(router, params) {}
- })
- })
- })
- });
- App.initialize();
-
- Will call the 'deserialize' method of the Route instance at the path 'root.aRoute' with the
- following hash as its second argument:
-
- {
- dynamicSectionA: 'thefirstvalue',
- dynamicSectionB: 'thesecondvalue'
- }
-
- Within `deserialize` you should use this information to retrieve or create an appropriate context
- object for the given URL (e.g. by loading from a remote API or accessing the browser's
- `localStorage`). This object must be the `return` value of `deserialize` and will be
- passed to the Route's `connectOutlets` and `serialize` methods.
-
- When an application's state is changed from within the application itself, the context provided for
- the transition will be passed and `deserialize` is not called (see 'Transitions Between States').
-
- ### Serializing An Object For URLs with Dynamic Segments
- When transitioning into a Route whose `route` property contains dynamic segments the Route's
- `serialize` method is called with the Route's router as the first argument and the Route's
- context as the second argument. The return value of `serialize` will be use to populate the
- dynamic segments and should be a object with keys that match the names of the dynamic sections.
-
- Given the following route structure:
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/'
- }),
- bRoute: Ember.Route.extend({
- route: '/staticSection/:someDynamicSegment',
- serialize: function(router, context) {
- return {
- someDynamicSegment: context.get('name')
- }
- }
- })
- })
- })
- });
- App.initialize();
-
-
- Transitioning to "root.bRoute" with a context of `Object.create({name: 'Yehuda'})` will call
- the Route's `serialize` method with the context as its second argument and update the URL to
- '#/staticSection/Yehuda'.
-
- ## Transitions Between States
- Once a routed application has initialized its state based on the entry URL, subsequent transitions to other
- states will update the URL if the entered Route has a `route` property. Given the following route structure
- loaded at the URL '#/':
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/',
- moveElsewhere: Ember.Route.transitionTo('bRoute')
- }),
- bRoute: Ember.Route.extend({
- route: '/someOtherLocation'
- })
- })
- })
- });
- App.initialize();
-
- And application code:
-
- App.get('router').send('moveElsewhere');
-
- Will transition the application's state to 'root.bRoute' and trigger an update of the URL to
- '#/someOtherLocation'.
-
- For URL patterns with dynamic segments a context can be supplied as the second argument to `send`.
- The router will match dynamic segments names to keys on this object and fill in the URL with the
- supplied values. Given the following state structure loaded at the URL '#/':
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/',
- moveElsewhere: Ember.Route.transitionTo('bRoute')
- }),
- bRoute: Ember.Route.extend({
- route: '/a/route/:dynamicSection/:anotherDynamicSection',
- connectOutlets: function(router, context) {},
- })
- })
- })
- });
- App.initialize();
-
- And application code:
-
- App.get('router').send('moveElsewhere', {
- dynamicSection: '42',
- anotherDynamicSection: 'Life'
- });
-
- Will transition the application's state to 'root.bRoute' and trigger an update of the URL to
- '#/a/route/42/Life'.
-
- The context argument will also be passed as the second argument to the `serialize` method call.
-
- ## Injection of Controller Singletons
- During application initialization Ember will detect properties of the application ending in 'Controller',
- create singleton instances of each class, and assign them as a properties on the router. The property name
- will be the UpperCamel name converted to lowerCamel format. These controller classes should be subclasses
- of Ember.ObjectController, Ember.ArrayController, Ember.Controller, or a custom Ember.Object that includes the
- Ember.ControllerMixin mixin.
-
- App = Ember.Application.create({
- FooController: Ember.Object.create(Ember.ControllerMixin),
- Router: Ember.Router.extend({ ... })
- });
-
- App.get('router.fooController'); // instance of App.FooController
-
- The controller singletons will have their `namespace` property set to the application and their `target`
- property set to the application's router singleton for easy integration with Ember's user event system.
- See 'Changing View Hierarchy in Response To State Change' and 'Responding to User-initiated Events'
-
- ## Responding to User-initiated Events
- Controller instances injected into the router at application initialization have their `target` property
- set to the application's router instance. These controllers will also be the default `context` for their
- associated views. Uses of the `{{action}}` helper will automatically target the application's router.
-
- Given the following application entered at the URL '#/':
-
- App = Ember.Application.create({
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/',
- anActionOnTheRouter: function(router, context) {
- router.transitionTo('anotherState', context);
- }
- })
- anotherState: Ember.Route.extend({
- route: '/differentUrl',
- connectOutlets: function(router, context) {
-
- }
- })
- })
- })
- });
- App.initialize();
-
- The following template:
-
- <script type="text/x-handlebars" data-template-name="aView">
- <h1><a {{action anActionOnTheRouter}}>{{title}}</a></h1>
- </script>
-
- Will delegate `click` events on the rendered `h1` to the application's router instance. In this case the
- `anActionOnTheRouter` method of the state at 'root.aRoute' will be called with the view's controller
- as the context argument. This context will be passed to the `connectOutlets` as its second argument.
-
- Different `context` can be supplied from within the `{{action}}` helper, allowing specific context passing
- between application states:
-
- <script type="text/x-handlebars" data-template-name="photos">
- {{#each photo in controller}}
- <h1><a {{action showPhoto photo}}>{{title}}</a></h1>
- {{/each}}
- </script>
-
- See Handlebars.helpers.action for additional usage examples.
-
-
- ## Changing View Hierarchy in Response To State Change
- Changes in application state that change the URL should be accompanied by associated changes in view
- hierarchy. This can be accomplished by calling 'connectOutlet' on the injected controller singletons from
- within the 'connectOutlets' event of an Ember.Route:
-
- App = Ember.Application.create({
- OneController: Ember.ObjectController.extend(),
- OneView: Ember.View.extend(),
-
- AnotherController: Ember.ObjectController.extend(),
- AnotherView: Ember.View.extend(),
-
- Router: Ember.Router.extend({
- root: Ember.Route.extend({
- aRoute: Ember.Route.extend({
- route: '/',
- connectOutlets: function(router, context) {
- router.get('oneController').connectOutlet('another');
- },
- })
- })
- })
- });
- App.initialize();
-
-
- This will detect the '{{outlet}}' portion of `oneController`'s view (an instance of `App.OneView`) and
- fill it with a rendered instance of `App.AnotherView` whose `context` will be the single instance of
- `App.AnotherController` stored on the router in the `anotherController` property.
-
- For more information about Outlets, see `Ember.Handlebars.helpers.outlet`. For additional information on
- the `connectOutlet` method, see `Ember.Controller.connectOutlet`. For more information on
- controller injections, see `Ember.Application#initialize()`. For additional information about view context,
- see `Ember.View`.
-
- @extends Ember.StateManager
-*/
-Ember.Router = Ember.StateManager.extend(
-/** @scope Ember.Router.prototype */ {
-
- /**
- @property {String}
- @default 'root'
- */
- initialState: 'root',
-
- /**
- The `Ember.Location` implementation to be used to manage the application
- URL state. The following values are supported:
-
- * 'hash': Uses URL fragment identifiers (like #/blog/1) for routing.
- * 'none': Does not read or set the browser URL, but still allows for
- routing to happen. Useful for testing.
-
- @type String
- @default 'hash'
- */
- location: 'hash',
-
- /**
- This is only used when a history location is used so that applications that
- don't live at the root of the domain can append paths to their root.
-
- @type String
- @default '/'
- */
-
- rootURL: '/',
-
- /**
- On router, transitionEvent should be called connectOutlets
-
- @property {String}
- @default 'connectOutlets'
- */
- transitionEvent: 'connectOutlets',
-
- transitionTo: function() {
- this.abortRoutingPromises();
- this._super.apply(this, arguments);
- },
-
- route: function(path) {
- this.abortRoutingPromises();
-
- set(this, 'isRouting', true);
-
- var routableState;
-
- try {
- path = path.replace(/^(?=[^\/])/, "/");
-
- this.send('navigateAway');
- this.send('unroutePath', path);
-
- routableState = get(this, 'currentState');
- while (routableState && !routableState.get('isRoutable')) {
- routableState = get(routableState, 'parentState');
- }
- var currentURL = routableState ? routableState.absoluteRoute(this) : '';
- var rest = path.substr(currentURL.length);
-
- this.send('routePath', rest);
- } finally {
- set(this, 'isRouting', false);
- }
-
- routableState = get(this, 'currentState');
- while (routableState && !routableState.get('isRoutable')) {
- routableState = get(routableState, 'parentState');
- }
-
- if (routableState) {
- routableState.updateRoute(this, get(this, 'location'));
- }
- },
-
- urlFor: function(path, hash) {
- var currentState = get(this, 'currentState') || this,
- state = this.findStateByPath(currentState, path);
-
- Ember.assert(Ember.String.fmt("Could not find route with path '%@'", [path]), !!state);
- Ember.assert("To get a URL for a state, it must have a `route` property.", !!get(state, 'routeMatcher'));
-
- var location = get(this, 'location'),
- absoluteRoute = state.absoluteRoute(this, hash);
-
- return location.formatURL(absoluteRoute);
- },
-
- urlForEvent: function(eventName) {
- var contexts = Array.prototype.slice.call(arguments, 1);
- var currentState = get(this, 'currentState');
- var targetStateName = currentState.lookupEventTransition(eventName);
-
- Ember.assert(Ember.String.fmt("You must specify a target state for event '%@' in order to link to it in the current state '%@'.", [eventName, get(currentState, 'path')]), !!targetStateName);
-
- var targetState = this.findStateByPath(currentState, targetStateName);
-
- Ember.assert("Your target state name " + targetStateName + " for event " + eventName + " did not resolve to a state", !!targetState);
-
- var hash = this.serializeRecursively(targetState, contexts, {});
-
- return this.urlFor(targetStateName, hash);
- },
-
- /** @private */
- serializeRecursively: function(state, contexts, hash) {
- var parentState,
- context = get(state, 'hasContext') ? contexts.pop() : null;
- merge(hash, state.serialize(this, context));
- parentState = state.get("parentState");
- if (parentState && parentState instanceof Ember.Route) {
- return this.serializeRecursively(parentState, contexts, hash);
- } else {
- return hash;
- }
- },
-
- abortRoutingPromises: function() {
- if (this._routingPromises) {
- this._routingPromises.abort();
- this._routingPromises = null;
- }
- },
-
- /**
- @private
- */
- handleStatePromises: function(states, complete) {
- this.abortRoutingPromises();
-
- this.set('isLocked', true);
-
- var manager = this;
-
- this._routingPromises = Ember._PromiseChain.create({
- promises: states.slice(),
-
- successCallback: function() {
- manager.set('isLocked', false);
- complete();
- },
-
- failureCallback: function() {
- throw "Unable to load object";
- },
-
- promiseSuccessCallback: function(item, args) {
- set(item, 'object', args[0]);
- },
-
- abortCallback: function() {
- manager.set('isLocked', false);
- }
- }).start();
- },
-
- /** @private */
- init: function() {
- this._super();
-
- var location = get(this, 'location'),
- rootURL = get(this, 'rootURL');
-
- if ('string' === typeof location) {
- set(this, 'location', Ember.Location.create({
- implementation: location,
- rootURL: rootURL
- }));
- }
- },
-
- /** @private */
- willDestroy: function() {
- get(this, 'location').destroy();
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Routing
-// Copyright: ©2012 Tilde Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-(function() {
-var get = Ember.get;
-
-Ember.StateManager.reopen(
-/** @scope Ember.StateManager.prototype */ {
-
- /**
- If the current state is a view state or the descendent of a view state,
- this property will be the view associated with it. If there is no
- view state active in this state manager, this value will be null.
-
- @type Ember.View
- */
- currentView: Ember.computed(function() {
- var currentState = get(this, 'currentState'),
- view;
-
- while (currentState) {
- // TODO: Remove this when view state is removed
- if (get(currentState, 'isViewState')) {
- view = get(currentState, 'view');
- if (view) { return view; }
- }
-
- currentState = get(currentState, 'parentState');
- }
-
- return null;
- }).property('currentState').cacheable()
-
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-/**
- @class
- @deprecated
-
- Ember.ViewState extends Ember.State to control the presence of a childView within a
- container based on the current state of the ViewState's StateManager.
-
- ## Interactions with Ember's View System.
- When combined with instances of `Ember.StateManager`, ViewState is designed to
- interact with Ember's view system to control which views are added to
- and removed from the DOM based on the manager's current state.
-
- By default, a StateManager will manage views inside the 'body' element. This can be
- customized by setting the `rootElement` property to a CSS selector of an existing
- HTML element you would prefer to receive view rendering.
-
-
- viewStates = Ember.StateManager.create({
- rootElement: '#some-other-element'
- })
-
- You can also specify a particular instance of `Ember.ContainerView` you would like to receive
- view rendering by setting the `rootView` property. You will be responsible for placing
- this element into the DOM yourself.
-
- aLayoutView = Ember.ContainerView.create()
-
- // make sure this view instance is added to the browser
- aLayoutView.appendTo('body')
-
- App.viewStates = Ember.StateManager.create({
- rootView: aLayoutView
- })
-
-
- Once you have an instance of StateManager controlling a view, you can provide states
- that are instances of `Ember.ViewState`. When the StateManager enters a state
- that is an instance of `Ember.ViewState` that `ViewState`'s `view` property will be
- instantiated and inserted into the StateManager's `rootView` or `rootElement`.
- When a state is exited, the `ViewState`'s view will be removed from the StateManager's
- view.
-
- ContactListView = Ember.View.extend({
- classNames: ['my-contacts-css-class'],
- template: Ember.Handlebars.compile('<h2>People</h2>')
- })
-
- PhotoListView = Ember.View.extend({
- classNames: ['my-photos-css-class'],
- template: Ember.Handlebars.compile('<h2>Photos</h2>')
- })
-
- viewStates = Ember.StateManager.create({
- showingPeople: Ember.ViewState.create({
- view: ContactListView
- }),
- showingPhotos: Ember.ViewState.create({
- view: PhotoListView
- })
- })
-
- viewStates.transitionTo('showingPeople')
-
- The above code will change the rendered HTML from
-
- <body></body>
-
- to
-
- <body>
- <div id="ember1" class="ember-view my-contacts-css-class">
- <h2>People</h2>
- </div>
- </body>
-
- Changing the current state via `transitionTo` from `showingPeople` to
- `showingPhotos` will remove the `showingPeople` view and add the `showingPhotos` view:
-
- viewStates.transitionTo('showingPhotos')
-
- will change the rendered HTML to
-
- <body>
- <div id="ember2" class="ember-view my-photos-css-class">
- <h2>Photos</h2>
- </div>
- </body>
-
-
- When entering nested `ViewState`s, each state's view will be draw into the the StateManager's
- `rootView` or `rootElement` as siblings.
-
-
- ContactListView = Ember.View.extend({
- classNames: ['my-contacts-css-class'],
- template: Ember.Handlebars.compile('<h2>People</h2>')
- })
-
- EditAContactView = Ember.View.extend({
- classNames: ['editing-a-contact-css-class'],
- template: Ember.Handlebars.compile('Editing...')
- })
-
- viewStates = Ember.StateManager.create({
- showingPeople: Ember.ViewState.create({
- view: ContactListView,
-
- withEditingPanel: Ember.ViewState.create({
- view: EditAContactView
- })
- })
- })
-
-
- viewStates.transitionTo('showingPeople.withEditingPanel')
-
-
- Will result in the following rendered HTML:
-
- <body>
- <div id="ember2" class="ember-view my-contacts-css-class">
- <h2>People</h2>
- </div>
-
- <div id="ember2" class="ember-view editing-a-contact-css-class">
- Editing...
- </div>
- </body>
-
-
- ViewState views are added and removed from their StateManager's view via their
- `enter` and `exit` methods. If you need to override these methods, be sure to call
- `_super` to maintain the adding and removing behavior:
-
- viewStates = Ember.StateManager.create({
- aState: Ember.ViewState.create({
- view: Ember.View.extend({}),
- enter: function(manager){
- // calling _super ensures this view will be
- // properly inserted
- this._super(manager);
-
- // now you can do other things
- }
- })
- })
-
- ## Managing Multiple Sections of A Page With States
- Multiple StateManagers can be combined to control multiple areas of an application's rendered views.
- Given the following HTML body:
-
- <body>
- <div id='sidebar-nav'>
- </div>
- <div id='content-area'>
- </div>
- </body>
-
- You could separately manage view state for each section with two StateManagers
-
- navigationStates = Ember.StateManager.create({
- rootElement: '#sidebar-nav',
- userAuthenticated: Em.ViewState.create({
- view: Ember.View.extend({})
- }),
- userNotAuthenticated: Em.ViewState.create({
- view: Ember.View.extend({})
- })
- })
-
- contentStates = Ember.StateManager.create({
- rootElement: '#content-area',
- books: Em.ViewState.create({
- view: Ember.View.extend({})
- }),
- music: Em.ViewState.create({
- view: Ember.View.extend({})
- })
- })
-
-
- If you prefer to start with an empty body and manage state programmatically you
- can also take advantage of StateManager's `rootView` property and the ability of
- `Ember.ContainerView`s to manually manage their child views.
-
-
- dashboard = Ember.ContainerView.create({
- childViews: ['navigationAreaView', 'contentAreaView'],
- navigationAreaView: Ember.ContainerView.create({}),
- contentAreaView: Ember.ContainerView.create({})
- })
-
- navigationStates = Ember.StateManager.create({
- rootView: dashboard.get('navigationAreaView'),
- userAuthenticated: Em.ViewState.create({
- view: Ember.View.extend({})
- }),
- userNotAuthenticated: Em.ViewState.create({
- view: Ember.View.extend({})
- })
- })
-
- contentStates = Ember.StateManager.create({
- rootView: dashboard.get('contentAreaView'),
- books: Em.ViewState.create({
- view: Ember.View.extend({})
- }),
- music: Em.ViewState.create({
- view: Ember.View.extend({})
- })
- })
-
- dashboard.appendTo('body')
-
- ## User Manipulation of State via `{{action}}` Helpers
- The Handlebars `{{action}}` helper is StateManager-aware and will use StateManager action sending
- to connect user interaction to action-based state transitions.
-
- Given the following body and handlebars template
-
- <body>
- <script type='text/x-handlebars'>
- <a href="#" {{action "anAction" target="App.appStates"}}> Go </a>
- </script>
- </body>
-
- And application code
-
- App = Ember.Application.create()
- App.appStates = Ember.StateManager.create({
- initialState: 'aState',
- aState: Ember.State.create({
- anAction: function(manager, context){}
- }),
- bState: Ember.State.create({})
- })
-
- A user initiated click or touch event on "Go" will trigger the 'anAction' method of
- `App.appStates.aState` with `App.appStates` as the first argument and a
- `jQuery.Event` object as the second object. The `jQuery.Event` will include a property
- `view` that references the `Ember.View` object that was interacted with.
-
-**/
-Ember.ViewState = Ember.State.extend(
-/** @scope Ember.ViewState.prototype */ {
- isViewState: true,
-
- init: function() {
- Ember.deprecate("Ember.ViewState is deprecated and will be removed from future releases. Consider using the outlet pattern to display nested views instead. For more information, see http://emberjs.com/guides/outlets/.");
- return this._super();
- },
-
- enter: function(stateManager) {
- var view = get(this, 'view'), root, childViews;
-
- if (view) {
- if (Ember.View.detect(view)) {
- view = view.create();
- set(this, 'view', view);
- }
-
- Ember.assert('view must be an Ember.View', view instanceof Ember.View);
-
- root = stateManager.get('rootView');
-
- if (root) {
- childViews = get(root, 'childViews');
- childViews.pushObject(view);
- } else {
- root = stateManager.get('rootElement') || 'body';
- view.appendTo(root);
- }
- }
- },
-
- exit: function(stateManager) {
- var view = get(this, 'view');
-
- if (view) {
- // If the view has a parent view, then it is
- // part of a view hierarchy and should be removed
- // from its parent.
- if (get(view, 'parentView')) {
- view.removeFromParent();
- } else {
-
- // Otherwise, the view is a "root view" and
- // was appended directly to the DOM.
- view.remove();
- }
- }
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Statecharts
-// Copyright: ©2011 Living Social Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-(function() {
-// ==========================================================================
-// Project: metamorph
-// Copyright: ©2011 My Company Inc. All rights reserved.
-// ==========================================================================
-
-(function(window) {
-
- var K = function(){},
- guid = 0,
- document = window.document,
-
- // Feature-detect the W3C range API, the extended check is for IE9 which only partially supports ranges
- supportsRange = ('createRange' in document) && (typeof Range !== 'undefined') && Range.prototype.createContextualFragment,
-
- // Internet Explorer prior to 9 does not allow setting innerHTML if the first element
- // is a "zero-scope" element. This problem can be worked around by making
- // the first node an invisible text node. We, like Modernizr, use &shy;
- needsShy = (function(){
- var testEl = document.createElement('div');
- testEl.innerHTML = "<div></div>";
- testEl.firstChild.innerHTML = "<script></script>";
- return testEl.firstChild.innerHTML === '';
- })();
-
- // Constructor that supports either Metamorph('foo') or new
- // Metamorph('foo');
- //
- // Takes a string of HTML as the argument.
-
- var Metamorph = function(html) {
- var self;
-
- if (this instanceof Metamorph) {
- self = this;
- } else {
- self = new K();
- }
-
- self.innerHTML = html;
- var myGuid = 'metamorph-'+(guid++);
- self.start = myGuid + '-start';
- self.end = myGuid + '-end';
-
- return self;
- };
-
- K.prototype = Metamorph.prototype;
-
- var rangeFor, htmlFunc, removeFunc, outerHTMLFunc, appendToFunc, afterFunc, prependFunc, startTagFunc, endTagFunc;
-
- outerHTMLFunc = function() {
- return this.startTag() + this.innerHTML + this.endTag();
- };
-
- startTagFunc = function() {
- return "<script id='" + this.start + "' type='text/x-placeholder'></script>";
- };
-
- endTagFunc = function() {
- return "<script id='" + this.end + "' type='text/x-placeholder'></script>";
- };
-
- // If we have the W3C range API, this process is relatively straight forward.
- if (supportsRange) {
-
- // Get a range for the current morph. Optionally include the starting and
- // ending placeholders.
- rangeFor = function(morph, outerToo) {
- var range = document.createRange();
- var before = document.getElementById(morph.start);
- var after = document.getElementById(morph.end);
-
- if (outerToo) {
- range.setStartBefore(before);
- range.setEndAfter(after);
- } else {
- range.setStartAfter(before);
- range.setEndBefore(after);
- }
-
- return range;
- };
-
- htmlFunc = function(html, outerToo) {
- // get a range for the current metamorph object
- var range = rangeFor(this, outerToo);
-
- // delete the contents of the range, which will be the
- // nodes between the starting and ending placeholder.
- range.deleteContents();
-
- // create a new document fragment for the HTML
- var fragment = range.createContextualFragment(html);
-
- // insert the fragment into the range
- range.insertNode(fragment);
- };
-
- removeFunc = function() {
- // get a range for the current metamorph object including
- // the starting and ending placeholders.
- var range = rangeFor(this, true);
-
- // delete the entire range.
- range.deleteContents();
- };
-
- appendToFunc = function(node) {
- var range = document.createRange();
- range.setStart(node);
- range.collapse(false);
- var frag = range.createContextualFragment(this.outerHTML());
- node.appendChild(frag);
- };
-
- afterFunc = function(html) {
- var range = document.createRange();
- var after = document.getElementById(this.end);
-
- range.setStartAfter(after);
- range.setEndAfter(after);
-
- var fragment = range.createContextualFragment(html);
- range.insertNode(fragment);
- };
-
- prependFunc = function(html) {
- var range = document.createRange();
- var start = document.getElementById(this.start);
-
- range.setStartAfter(start);
- range.setEndAfter(start);
-
- var fragment = range.createContextualFragment(html);
- range.insertNode(fragment);
- };
-
- } else {
- /**
- * This code is mostly taken from jQuery, with one exception. In jQuery's case, we
- * have some HTML and we need to figure out how to convert it into some nodes.
- *
- * In this case, jQuery needs to scan the HTML looking for an opening tag and use
- * that as the key for the wrap map. In our case, we know the parent node, and
- * can use its type as the key for the wrap map.
- **/
- var wrapMap = {
- select: [ 1, "<select multiple='multiple'>", "</select>" ],
- fieldset: [ 1, "<fieldset>", "</fieldset>" ],
- table: [ 1, "<table>", "</table>" ],
- tbody: [ 2, "<table><tbody>", "</tbody></table>" ],
- tr: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
- colgroup: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- map: [ 1, "<map>", "</map>" ],
- _default: [ 0, "", "" ]
- };
-
- /**
- * Given a parent node and some HTML, generate a set of nodes. Return the first
- * node, which will allow us to traverse the rest using nextSibling.
- *
- * We need to do this because innerHTML in IE does not really parse the nodes.
- **/
- var firstNodeFor = function(parentNode, html) {
- var arr = wrapMap[parentNode.tagName.toLowerCase()] || wrapMap._default;
- var depth = arr[0], start = arr[1], end = arr[2];
-
- if (needsShy) { html = '&shy;'+html; }
-
- var element = document.createElement('div');
- element.innerHTML = start + html + end;
-
- for (var i=0; i<=depth; i++) {
- element = element.firstChild;
- }
-
- // Look for &shy; to remove it.
- if (needsShy) {
- var shyElement = element;
-
- // Sometimes we get nameless elements with the shy inside
- while (shyElement.nodeType === 1 && !shyElement.nodeName) {
- shyElement = shyElement.firstChild;
- }
-
- // At this point it's the actual unicode character.
- if (shyElement.nodeType === 3 && shyElement.nodeValue.charAt(0) === "\u00AD") {
- shyElement.nodeValue = shyElement.nodeValue.slice(1);
- }
- }
-
- return element;
- };
-
- /**
- * In some cases, Internet Explorer can create an anonymous node in
- * the hierarchy with no tagName. You can create this scenario via:
- *
- * div = document.createElement("div");
- * div.innerHTML = "<table>&shy<script></script><tr><td>hi</td></tr></table>";
- * div.firstChild.firstChild.tagName //=> ""
- *
- * If our script markers are inside such a node, we need to find that
- * node and use *it* as the marker.
- **/
- var realNode = function(start) {
- while (start.parentNode.tagName === "") {
- start = start.parentNode;
- }
-
- return start;
- };
-
- /**
- * When automatically adding a tbody, Internet Explorer inserts the
- * tbody immediately before the first <tr>. Other browsers create it
- * before the first node, no matter what.
- *
- * This means the the following code:
- *
- * div = document.createElement("div");
- * div.innerHTML = "<table><script id='first'></script><tr><td>hi</td></tr><script id='last'></script></table>
- *
- * Generates the following DOM in IE:
- *
- * + div
- * + table
- * - script id='first'
- * + tbody
- * + tr
- * + td
- * - "hi"
- * - script id='last'
- *
- * Which means that the two script tags, even though they were
- * inserted at the same point in the hierarchy in the original
- * HTML, now have different parents.
- *
- * This code reparents the first script tag by making it the tbody's
- * first child.
- **/
- var fixParentage = function(start, end) {
- if (start.parentNode !== end.parentNode) {
- end.parentNode.insertBefore(start, end.parentNode.firstChild);
- }
- };
-
- htmlFunc = function(html, outerToo) {
- // get the real starting node. see realNode for details.
- var start = realNode(document.getElementById(this.start));
- var end = document.getElementById(this.end);
- var parentNode = end.parentNode;
- var node, nextSibling, last;
-
- // make sure that the start and end nodes share the same
- // parent. If not, fix it.
- fixParentage(start, end);
-
- // remove all of the nodes after the starting placeholder and
- // before the ending placeholder.
- node = start.nextSibling;
- while (node) {
- nextSibling = node.nextSibling;
- last = node === end;
-
- // if this is the last node, and we want to remove it as well,
- // set the `end` node to the next sibling. This is because
- // for the rest of the function, we insert the new nodes
- // before the end (note that insertBefore(node, null) is
- // the same as appendChild(node)).
- //
- // if we do not want to remove it, just break.
- if (last) {
- if (outerToo) { end = node.nextSibling; } else { break; }
- }
-
- node.parentNode.removeChild(node);
-
- // if this is the last node and we didn't break before
- // (because we wanted to remove the outer nodes), break
- // now.
- if (last) { break; }
-
- node = nextSibling;
- }
-
- // get the first node for the HTML string, even in cases like
- // tables and lists where a simple innerHTML on a div would
- // swallow some of the content.
- node = firstNodeFor(start.parentNode, html);
-
- // copy the nodes for the HTML between the starting and ending
- // placeholder.
- while (node) {
- nextSibling = node.nextSibling;
- parentNode.insertBefore(node, end);
- node = nextSibling;
- }
- };
-
- // remove the nodes in the DOM representing this metamorph.
- //
- // this includes the starting and ending placeholders.
- removeFunc = function() {
- var start = realNode(document.getElementById(this.start));
- var end = document.getElementById(this.end);
-
- this.html('');
- start.parentNode.removeChild(start);
- end.parentNode.removeChild(end);
- };
-
- appendToFunc = function(parentNode) {
- var node = firstNodeFor(parentNode, this.outerHTML());
-
- while (node) {
- nextSibling = node.nextSibling;
- parentNode.appendChild(node);
- node = nextSibling;
- }
- };
-
- afterFunc = function(html) {
- // get the real starting node. see realNode for details.
- var end = document.getElementById(this.end);
- var insertBefore = end.nextSibling;
- var parentNode = end.parentNode;
- var nextSibling;
- var node;
-
- // get the first node for the HTML string, even in cases like
- // tables and lists where a simple innerHTML on a div would
- // swallow some of the content.
- node = firstNodeFor(parentNode, html);
-
- // copy the nodes for the HTML between the starting and ending
- // placeholder.
- while (node) {
- nextSibling = node.nextSibling;
- parentNode.insertBefore(node, insertBefore);
- node = nextSibling;
- }
- };
-
- prependFunc = function(html) {
- var start = document.getElementById(this.start);
- var parentNode = start.parentNode;
- var nextSibling;
- var node;
-
- node = firstNodeFor(parentNode, html);
- var insertBefore = start.nextSibling;
-
- while (node) {
- nextSibling = node.nextSibling;
- parentNode.insertBefore(node, insertBefore);
- node = nextSibling;
- }
- }
- }
-
- Metamorph.prototype.html = function(html) {
- this.checkRemoved();
- if (html === undefined) { return this.innerHTML; }
-
- htmlFunc.call(this, html);
-
- this.innerHTML = html;
- };
-
- Metamorph.prototype.replaceWith = function(html) {
- this.checkRemoved();
- htmlFunc.call(this, html, true);
- };
-
- Metamorph.prototype.remove = removeFunc;
- Metamorph.prototype.outerHTML = outerHTMLFunc;
- Metamorph.prototype.appendTo = appendToFunc;
- Metamorph.prototype.after = afterFunc;
- Metamorph.prototype.prepend = prependFunc;
- Metamorph.prototype.startTag = startTagFunc;
- Metamorph.prototype.endTag = endTagFunc;
-
- Metamorph.prototype.isRemoved = function() {
- var before = document.getElementById(this.start);
- var after = document.getElementById(this.end);
-
- return !before || !after;
- };
-
- Metamorph.prototype.checkRemoved = function() {
- if (this.isRemoved()) {
- throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.");
- }
- };
-
- window.Metamorph = Metamorph;
-})(this);
-
-
-})();
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Handlebars */
-var objectCreate = Ember.create;
-
-/**
- @namespace
- @name Handlebars
- @private
-*/
-
-/**
- @namespace
- @name Handlebars.helpers
- @description Helpers for Handlebars templates
-*/
-
-Ember.assert("Ember Handlebars requires Handlebars 1.0.beta.5 or greater", window.Handlebars && window.Handlebars.VERSION.match(/^1\.0\.beta\.[56789]$|^1\.0\.rc\.[123456789]+/));
-
-/**
- @class
-
- Prepares the Handlebars templating library for use inside Ember's view
- system.
-
- The Ember.Handlebars object is the standard Handlebars library, extended to use
- Ember's get() method instead of direct property access, which allows
- computed properties to be used inside templates.
-
- To create an Ember.Handlebars template, call Ember.Handlebars.compile(). This will
- return a function that can be used by Ember.View for rendering.
-*/
-Ember.Handlebars = objectCreate(Handlebars);
-
-Ember.Handlebars.helpers = objectCreate(Handlebars.helpers);
-
-/**
- Override the the opcode compiler and JavaScript compiler for Handlebars.
- @private
-*/
-Ember.Handlebars.Compiler = function() {};
-Ember.Handlebars.Compiler.prototype = objectCreate(Handlebars.Compiler.prototype);
-Ember.Handlebars.Compiler.prototype.compiler = Ember.Handlebars.Compiler;
-
-/** @private */
-Ember.Handlebars.JavaScriptCompiler = function() {};
-Ember.Handlebars.JavaScriptCompiler.prototype = objectCreate(Handlebars.JavaScriptCompiler.prototype);
-Ember.Handlebars.JavaScriptCompiler.prototype.compiler = Ember.Handlebars.JavaScriptCompiler;
-Ember.Handlebars.JavaScriptCompiler.prototype.namespace = "Ember.Handlebars";
-
-
-Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer = function() {
- return "''";
-};
-
-/**
- Override the default buffer for Ember Handlebars. By default, Handlebars creates
- an empty String at the beginning of each invocation and appends to it. Ember's
- Handlebars overrides this to append to a single shared buffer.
-
- @private
-*/
-Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer = function(string) {
- return "data.buffer.push("+string+");";
-};
-
-/**
- Rewrite simple mustaches from {{foo}} to {{bind "foo"}}. This means that all simple
- mustaches in Ember's Handlebars will also set up an observer to keep the DOM
- up to date when the underlying property changes.
-
- @private
-*/
-Ember.Handlebars.Compiler.prototype.mustache = function(mustache) {
- if (mustache.params.length || mustache.hash) {
- return Handlebars.Compiler.prototype.mustache.call(this, mustache);
- } else {
- var id = new Handlebars.AST.IdNode(['_triageMustache']);
-
- // Update the mustache node to include a hash value indicating whether the original node
- // was escaped. This will allow us to properly escape values when the underlying value
- // changes and we need to re-render the value.
- if(!mustache.escaped) {
- mustache.hash = mustache.hash || new Handlebars.AST.HashNode([]);
- mustache.hash.pairs.push(["unescaped", new Handlebars.AST.StringNode("true")]);
- }
- mustache = new Handlebars.AST.MustacheNode([id].concat([mustache.id]), mustache.hash, !mustache.escaped);
- return Handlebars.Compiler.prototype.mustache.call(this, mustache);
- }
-};
-
-/**
- Used for precompilation of Ember Handlebars templates. This will not be used during normal
- app execution.
-
- @param {String} string The template to precompile
-*/
-Ember.Handlebars.precompile = function(string) {
- var ast = Handlebars.parse(string);
-
- var options = {
- knownHelpers: {
- action: true,
- unbound: true,
- bindAttr: true,
- template: true,
- view: true,
- _triageMustache: true
- },
- data: true,
- stringParams: true
- };
-
- var environment = new Ember.Handlebars.Compiler().compile(ast, options);
- return new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
-};
-
-/**
- The entry point for Ember Handlebars. This replaces the default Handlebars.compile and turns on
- template-local data and String parameters.
-
- @param {String} string The template to compile
-*/
-Ember.Handlebars.compile = function(string) {
- var ast = Handlebars.parse(string);
- var options = { data: true, stringParams: true };
- var environment = new Ember.Handlebars.Compiler().compile(ast, options);
- var templateSpec = new Ember.Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
-
- return Handlebars.template(templateSpec);
-};
-
-/**
- If a path starts with a reserved keyword, returns the root
- that should be used.
-
- @private
-*/
-var normalizePath = Ember.Handlebars.normalizePath = function(root, path, data) {
- var keywords = (data && data.keywords) || {},
- keyword, isKeyword;
-
- // Get the first segment of the path. For example, if the
- // path is "foo.bar.baz", returns "foo".
- keyword = path.split('.', 1)[0];
-
- // Test to see if the first path is a keyword that has been
- // passed along in the view's data hash. If so, we will treat
- // that object as the new root.
- if (keywords.hasOwnProperty(keyword)) {
- // Look up the value in the template's data hash.
- root = keywords[keyword];
- isKeyword = true;
-
- // Handle cases where the entire path is the reserved
- // word. In that case, return the object itself.
- if (path === keyword) {
- path = '';
- } else {
- // Strip the keyword from the path and look up
- // the remainder from the newly found root.
- path = path.substr(keyword.length+1);
- }
- }
-
- return { root: root, path: path, isKeyword: isKeyword };
-};
-/**
- Lookup both on root and on window. If the path starts with
- a keyword, the corresponding object will be looked up in the
- template's data hash and used to resolve the path.
-
- @param {Object} root The object to look up the property on
- @param {String} path The path to be lookedup
- @param {Object} options The template's option hash
-*/
-
-Ember.Handlebars.getPath = function(root, path, options) {
- var data = options && options.data,
- normalizedPath = normalizePath(root, path, data),
- value;
-
- // In cases where the path begins with a keyword, change the
- // root to the value represented by that keyword, and ensure
- // the path is relative to it.
- root = normalizedPath.root;
- path = normalizedPath.path;
-
- value = Ember.get(root, path);
-
- if (value === undefined && root !== window && Ember.isGlobalPath(path)) {
- value = Ember.get(window, path);
- }
- return value;
-};
-
-/**
- Registers a helper in Handlebars that will be called if no property with the
- given name can be found on the current context object, and no helper with
- that name is registered.
-
- This throws an exception with a more helpful error message so the user can
- track down where the problem is happening.
-
- @name Handlebars.helpers.helperMissing
- @param {String} path
- @param {Hash} options
-*/
-Ember.Handlebars.registerHelper('helperMissing', function(path, options) {
- var error, view = "";
-
- error = "%@ Handlebars error: Could not find property '%@' on object %@.";
- if (options.data){
- view = options.data.view;
- }
- throw new Ember.Error(Ember.String.fmt(error, [view, path, this]));
-});
-
-
-})();
-
-
-
-(function() {
-
-Ember.String.htmlSafe = function(str) {
- return new Handlebars.SafeString(str);
-};
-
-var htmlSafe = Ember.String.htmlSafe;
-
-if (Ember.EXTEND_PROTOTYPES) {
-
- /**
- @see Ember.String.htmlSafe
- */
- String.prototype.htmlSafe = function() {
- return htmlSafe(this);
- };
-
-}
-
-})();
-
-
-
-(function() {
-/*jshint newcap:false*/
-var set = Ember.set, get = Ember.get;
-
-var DOMManager = {
- remove: function(view) {
- var morph = view.morph;
- if (morph.isRemoved()) { return; }
- set(view, 'element', null);
- view._lastInsert = null;
- morph.remove();
- },
-
- prepend: function(view, childView) {
- childView._insertElementLater(function() {
- var morph = view.morph;
- morph.prepend(childView.outerHTML);
- childView.outerHTML = null;
- });
- },
-
- after: function(view, nextView) {
- nextView._insertElementLater(function() {
- var morph = view.morph;
- morph.after(nextView.outerHTML);
- nextView.outerHTML = null;
- });
- },
-
- replace: function(view) {
- var morph = view.morph;
-
- view.transitionTo('preRender');
- view.clearRenderedChildren();
- var buffer = view.renderToBuffer();
-
- Ember.run.schedule('render', this, function() {
- if (get(view, 'isDestroyed')) { return; }
- view.invalidateRecursively('element');
- view._notifyWillInsertElement();
- morph.replaceWith(buffer.string());
- view.transitionTo('inDOM');
- view._notifyDidInsertElement();
- });
- },
-
- empty: function(view) {
- view.morph.html("");
- }
-};
-
-// The `morph` and `outerHTML` properties are internal only
-// and not observable.
-
-Ember._Metamorph = Ember.Mixin.create({
- isVirtual: true,
- tagName: '',
-
- init: function() {
- this._super();
- this.morph = Metamorph();
- },
-
- beforeRender: function(buffer) {
- buffer.push(this.morph.startTag());
- },
-
- afterRender: function(buffer) {
- buffer.push(this.morph.endTag());
- },
-
- createElement: function() {
- var buffer = this.renderToBuffer();
- this.outerHTML = buffer.string();
- this.clearBuffer();
- },
-
- domManager: DOMManager
-});
-
-Ember._MetamorphView = Ember.View.extend(Ember._Metamorph);
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Handlebars */
-
-var get = Ember.get, set = Ember.set, getPath = Ember.Handlebars.getPath;
-/**
- @ignore
- @private
- @class
-
- Ember._HandlebarsBoundView is a private view created by the Handlebars `{{bind}}`
- helpers that is used to keep track of bound properties.
-
- Every time a property is bound using a `{{mustache}}`, an anonymous subclass
- of Ember._HandlebarsBoundView is created with the appropriate sub-template and
- context set up. When the associated property changes, just the template for
- this view will re-render.
-*/
-Ember._HandlebarsBoundView = Ember._MetamorphView.extend({
-/** @scope Ember._HandlebarsBoundView.prototype */
-
- /**
- The function used to determine if the `displayTemplate` or
- `inverseTemplate` should be rendered. This should be a function that takes
- a value and returns a Boolean.
-
- @type Function
- @default null
- */
- shouldDisplayFunc: null,
-
- /**
- Whether the template rendered by this view gets passed the context object
- of its parent template, or gets passed the value of retrieving `path`
- from the `pathRoot`.
-
- For example, this is true when using the `{{#if}}` helper, because the
- template inside the helper should look up properties relative to the same
- object as outside the block. This would be false when used with `{{#with
- foo}}` because the template should receive the object found by evaluating
- `foo`.
-
- @type Boolean
- @default false
- */
- preserveContext: false,
-
- /**
- If `preserveContext` is true, this is the object that will be used
- to render the template.
-
- @type Object
- */
- previousContext: null,
-
- /**
- The template to render when `shouldDisplayFunc` evaluates to true.
-
- @type Function
- @default null
- */
- displayTemplate: null,
-
- /**
- The template to render when `shouldDisplayFunc` evaluates to false.
-
- @type Function
- @default null
- */
- inverseTemplate: null,
-
-
- /**
- The path to look up on `pathRoot` that is passed to
- `shouldDisplayFunc` to determine which template to render.
-
- In addition, if `preserveContext` is false, the object at this path will
- be passed to the template when rendering.
-
- @type String
- @default null
- */
- path: null,
-
- /**
- The object from which the `path` will be looked up. Sometimes this is the
- same as the `previousContext`, but in cases where this view has been generated
- for paths that start with a keyword such as `view` or `controller`, the
- path root will be that resolved object.
-
- @type Object
- */
- pathRoot: null,
-
- normalizedValue: Ember.computed(function() {
- var path = get(this, 'path'),
- pathRoot = get(this, 'pathRoot'),
- valueNormalizer = get(this, 'valueNormalizerFunc'),
- result, templateData;
-
- // Use the pathRoot as the result if no path is provided. This
- // happens if the path is `this`, which gets normalized into
- // a `pathRoot` of the current Handlebars context and a path
- // of `''`.
- if (path === '') {
- result = pathRoot;
- } else {
- templateData = get(this, 'templateData');
- result = getPath(pathRoot, path, { data: templateData });
- }
-
- return valueNormalizer ? valueNormalizer(result) : result;
- }).property('path', 'pathRoot', 'valueNormalizerFunc').volatile(),
-
- rerenderIfNeeded: function() {
- if (!get(this, 'isDestroyed') && get(this, 'normalizedValue') !== this._lastNormalizedValue) {
- this.rerender();
- }
- },
-
- /**
- Determines which template to invoke, sets up the correct state based on
- that logic, then invokes the default Ember.View `render` implementation.
-
- This method will first look up the `path` key on `pathRoot`,
- then pass that value to the `shouldDisplayFunc` function. If that returns
- true, the `displayTemplate` function will be rendered to DOM. Otherwise,
- `inverseTemplate`, if specified, will be rendered.
-
- For example, if this Ember._HandlebarsBoundView represented the {{#with foo}}
- helper, it would look up the `foo` property of its context, and
- `shouldDisplayFunc` would always return true. The object found by looking
- up `foo` would be passed to `displayTemplate`.
-
- @param {Ember.RenderBuffer} buffer
- */
- render: function(buffer) {
- // If not invoked via a triple-mustache ({{{foo}}}), escape
- // the content of the template.
- var escape = get(this, 'isEscaped');
-
- var shouldDisplay = get(this, 'shouldDisplayFunc'),
- preserveContext = get(this, 'preserveContext'),
- context = get(this, 'previousContext');
-
- var inverseTemplate = get(this, 'inverseTemplate'),
- displayTemplate = get(this, 'displayTemplate');
-
- var result = get(this, 'normalizedValue');
- this._lastNormalizedValue = result;
-
- // First, test the conditional to see if we should
- // render the template or not.
- if (shouldDisplay(result)) {
- set(this, 'template', displayTemplate);
-
- // If we are preserving the context (for example, if this
- // is an #if block, call the template with the same object.
- if (preserveContext) {
- set(this, '_context', context);
- } else {
- // Otherwise, determine if this is a block bind or not.
- // If so, pass the specified object to the template
- if (displayTemplate) {
- set(this, '_context', result);
- } else {
- // This is not a bind block, just push the result of the
- // expression to the render context and return.
- if (result === null || result === undefined) {
- result = "";
- } else if (!(result instanceof Handlebars.SafeString)) {
- result = String(result);
- }
-
- if (escape) { result = Handlebars.Utils.escapeExpression(result); }
- buffer.push(result);
- return;
- }
- }
- } else if (inverseTemplate) {
- set(this, 'template', inverseTemplate);
-
- if (preserveContext) {
- set(this, '_context', context);
- } else {
- set(this, '_context', result);
- }
- } else {
- set(this, 'template', function() { return ''; });
- }
-
- return this._super(buffer);
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
-var getPath = Ember.Handlebars.getPath, normalizePath = Ember.Handlebars.normalizePath;
-var forEach = Ember.ArrayPolyfills.forEach;
-
-var EmberHandlebars = Ember.Handlebars, helpers = EmberHandlebars.helpers;
-
-// Binds a property into the DOM. This will create a hook in DOM that the
-// KVO system will look for and update if the property changes.
-/** @private */
-function bind(property, options, preserveContext, shouldDisplay, valueNormalizer) {
- var data = options.data,
- fn = options.fn,
- inverse = options.inverse,
- view = data.view,
- currentContext = this,
- pathRoot, path, normalized;
-
- normalized = normalizePath(currentContext, property, data);
-
- pathRoot = normalized.root;
- path = normalized.path;
-
- // Set up observers for observable objects
- if ('object' === typeof this) {
- // Create the view that will wrap the output of this template/property
- // and add it to the nearest view's childViews array.
- // See the documentation of Ember._HandlebarsBoundView for more.
- var bindView = view.createChildView(Ember._HandlebarsBoundView, {
- preserveContext: preserveContext,
- shouldDisplayFunc: shouldDisplay,
- valueNormalizerFunc: valueNormalizer,
- displayTemplate: fn,
- inverseTemplate: inverse,
- path: path,
- pathRoot: pathRoot,
- previousContext: currentContext,
- isEscaped: !options.hash.unescaped,
- templateData: options.data
- });
-
- view.appendChild(bindView);
-
- /** @private */
- var observer = function() {
- Ember.run.once(bindView, 'rerenderIfNeeded');
- };
-
- // Observes the given property on the context and
- // tells the Ember._HandlebarsBoundView to re-render. If property
- // is an empty string, we are printing the current context
- // object ({{this}}) so updating it is not our responsibility.
- if (path !== '') {
- Ember.addObserver(pathRoot, path, observer);
- }
- } else {
- // The object is not observable, so just render it out and
- // be done with it.
- data.buffer.push(getPath(pathRoot, path, options));
- }
-}
-
-/**
- '_triageMustache' is used internally select between a binding and helper for
- the given context. Until this point, it would be hard to determine if the
- mustache is a property reference or a regular helper reference. This triage
- helper resolves that.
-
- This would not be typically invoked by directly.
-
- @private
- @name Handlebars.helpers._triageMustache
- @param {String} property Property/helperID to triage
- @param {Function} fn Context to provide for rendering
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('_triageMustache', function(property, fn) {
- Ember.assert("You cannot pass more than one argument to the _triageMustache helper", arguments.length <= 2);
- if (helpers[property]) {
- return helpers[property].call(this, fn);
- }
- else {
- return helpers.bind.apply(this, arguments);
- }
-});
-
-/**
- `bind` can be used to display a value, then update that value if it
- changes. For example, if you wanted to print the `title` property of
- `content`:
-
- {{bind "content.title"}}
-
- This will return the `title` property as a string, then create a new
- observer at the specified path. If it changes, it will update the value in
- DOM. Note that if you need to support IE7 and IE8 you must modify the
- model objects properties using Ember.get() and Ember.set() for this to work as
- it relies on Ember's KVO system. For all other browsers this will be handled
- for you automatically.
-
- @private
- @name Handlebars.helpers.bind
- @param {String} property Property to bind
- @param {Function} fn Context to provide for rendering
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('bind', function(property, fn) {
- Ember.assert("You cannot pass more than one argument to the bind helper", arguments.length <= 2);
-
- var context = (fn.contexts && fn.contexts[0]) || this;
-
- return bind.call(context, property, fn, false, function(result) {
- return !Ember.none(result);
- });
-});
-
-/**
- Use the `boundIf` helper to create a conditional that re-evaluates
- whenever the bound value changes.
-
- {{#boundIf "content.shouldDisplayTitle"}}
- {{content.title}}
- {{/boundIf}}
-
- @private
- @name Handlebars.helpers.boundIf
- @param {String} property Property to bind
- @param {Function} fn Context to provide for rendering
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('boundIf', function(property, fn) {
- var context = (fn.contexts && fn.contexts[0]) || this;
- var func = function(result) {
- if (Ember.typeOf(result) === 'array') {
- return get(result, 'length') !== 0;
- } else {
- return !!result;
- }
- };
-
- return bind.call(context, property, fn, true, func, func);
-});
-
-/**
- @name Handlebars.helpers.with
- @param {Function} context
- @param {Hash} options
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('with', function(context, options) {
- if (arguments.length === 4) {
- var keywordName, path, rootPath, normalized;
-
- Ember.assert("If you pass more than one argument to the with helper, it must be in the form #with foo as bar", arguments[1] === "as");
- options = arguments[3];
- keywordName = arguments[2];
- path = arguments[0];
-
- Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
-
- if (Ember.isGlobalPath(path)) {
- Ember.bind(options.data.keywords, keywordName, path);
- } else {
- normalized = normalizePath(this, path, options.data);
- path = normalized.path;
- rootPath = normalized.root;
-
- // This is a workaround for the fact that you cannot bind separate objects
- // together. When we implement that functionality, we should use it here.
- var contextKey = Ember.$.expando + Ember.guidFor(rootPath);
- options.data.keywords[contextKey] = rootPath;
-
- // if the path is '' ("this"), just bind directly to the current context
- var contextPath = path ? contextKey + '.' + path : contextKey;
- Ember.bind(options.data.keywords, keywordName, contextPath);
- }
-
- return bind.call(this, path, options.fn, true, function(result) {
- return !Ember.none(result);
- });
- } else {
- Ember.assert("You must pass exactly one argument to the with helper", arguments.length === 2);
- Ember.assert("You must pass a block to the with helper", options.fn && options.fn !== Handlebars.VM.noop);
- return helpers.bind.call(options.contexts[0], context, options);
- }
-});
-
-
-/**
- @name Handlebars.helpers.if
- @param {Function} context
- @param {Hash} options
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('if', function(context, options) {
- Ember.assert("You must pass exactly one argument to the if helper", arguments.length === 2);
- Ember.assert("You must pass a block to the if helper", options.fn && options.fn !== Handlebars.VM.noop);
-
- return helpers.boundIf.call(options.contexts[0], context, options);
-});
-
-/**
- @name Handlebars.helpers.unless
- @param {Function} context
- @param {Hash} options
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('unless', function(context, options) {
- Ember.assert("You must pass exactly one argument to the unless helper", arguments.length === 2);
- Ember.assert("You must pass a block to the unless helper", options.fn && options.fn !== Handlebars.VM.noop);
-
- var fn = options.fn, inverse = options.inverse;
-
- options.fn = inverse;
- options.inverse = fn;
-
- return helpers.boundIf.call(options.contexts[0], context, options);
-});
-
-/**
- `bindAttr` allows you to create a binding between DOM element attributes and
- Ember objects. For example:
-
- <img {{bindAttr src="imageUrl" alt="imageTitle"}}>
-
- @name Handlebars.helpers.bindAttr
- @param {Hash} options
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('bindAttr', function(options) {
-
- var attrs = options.hash;
-
- Ember.assert("You must specify at least one hash argument to bindAttr", !!Ember.keys(attrs).length);
-
- var view = options.data.view;
- var ret = [];
- var ctx = this;
-
- // Generate a unique id for this element. This will be added as a
- // data attribute to the element so it can be looked up when
- // the bound property changes.
- var dataId = ++Ember.$.uuid;
-
- // Handle classes differently, as we can bind multiple classes
- var classBindings = attrs['class'];
- if (classBindings !== null && classBindings !== undefined) {
- var classResults = EmberHandlebars.bindClasses(this, classBindings, view, dataId, options);
- ret.push('class="' + Handlebars.Utils.escapeExpression(classResults.join(' ')) + '"');
- delete attrs['class'];
- }
-
- var attrKeys = Ember.keys(attrs);
-
- // For each attribute passed, create an observer and emit the
- // current value of the property as an attribute.
- forEach.call(attrKeys, function(attr) {
- var path = attrs[attr],
- pathRoot, normalized;
-
- Ember.assert(fmt("You must provide a String for a bound attribute, not %@", [path]), typeof path === 'string');
-
- normalized = normalizePath(ctx, path, options.data);
-
- pathRoot = normalized.root;
- path = normalized.path;
-
- var value = (path === 'this') ? pathRoot : getPath(pathRoot, path, options),
- type = Ember.typeOf(value);
-
- Ember.assert(fmt("Attributes must be numbers, strings or booleans, not %@", [value]), value === null || value === undefined || type === 'number' || type === 'string' || type === 'boolean');
-
- var observer, invoker;
-
- /** @private */
- observer = function observer() {
- var result = getPath(pathRoot, path, options);
-
- Ember.assert(fmt("Attributes must be numbers, strings or booleans, not %@", [result]), result === null || result === undefined || typeof result === 'number' || typeof result === 'string' || typeof result === 'boolean');
-
- var elem = view.$("[data-bindattr-" + dataId + "='" + dataId + "']");
-
- // If we aren't able to find the element, it means the element
- // to which we were bound has been removed from the view.
- // In that case, we can assume the template has been re-rendered
- // and we need to clean up the observer.
- if (elem.length === 0) {
- Ember.removeObserver(pathRoot, path, invoker);
- return;
- }
-
- Ember.View.applyAttributeBindings(elem, attr, result);
- };
-
- /** @private */
- invoker = function() {
- Ember.run.once(observer);
- };
-
- // Add an observer to the view for when the property changes.
- // When the observer fires, find the element using the
- // unique data id and update the attribute to the new value.
- if (path !== 'this') {
- Ember.addObserver(pathRoot, path, invoker);
- }
-
- // if this changes, also change the logic in ember-views/lib/views/view.js
- if ((type === 'string' || (type === 'number' && !isNaN(value)))) {
- ret.push(attr + '="' + Handlebars.Utils.escapeExpression(value) + '"');
- } else if (value && type === 'boolean') {
- // The developer controls the attr name, so it should always be safe
- ret.push(attr + '="' + attr + '"');
- }
- }, this);
-
- // Add the unique identifier
- // NOTE: We use all lower-case since Firefox has problems with mixed case in SVG
- ret.push('data-bindattr-' + dataId + '="' + dataId + '"');
- return new EmberHandlebars.SafeString(ret.join(' '));
-});
-
-/**
- Helper that, given a space-separated string of property paths and a context,
- returns an array of class names. Calling this method also has the side
- effect of setting up observers at those property paths, such that if they
- change, the correct class name will be reapplied to the DOM element.
-
- For example, if you pass the string "fooBar", it will first look up the
- "fooBar" value of the context. If that value is true, it will add the
- "foo-bar" class to the current element (i.e., the dasherized form of
- "fooBar"). If the value is a string, it will add that string as the class.
- Otherwise, it will not add any new class name.
-
- @param {Ember.Object} context
- The context from which to lookup properties
-
- @param {String} classBindings
- A string, space-separated, of class bindings to use
-
- @param {Ember.View} view
- The view in which observers should look for the element to update
-
- @param {Srting} bindAttrId
- Optional bindAttr id used to lookup elements
-
- @returns {Array} An array of class names to add
-*/
-EmberHandlebars.bindClasses = function(context, classBindings, view, bindAttrId, options) {
- var ret = [], newClass, value, elem;
-
- // Helper method to retrieve the property from the context and
- // determine which class string to return, based on whether it is
- // a Boolean or not.
- var classStringForPath = function(root, parsedPath, options) {
- var val,
- path = parsedPath.path;
-
- if (path === 'this') {
- val = root;
- } else if (path === '') {
- val = true;
- } else {
- val = getPath(root, path, options);
- }
-
- return Ember.View._classStringForValue(path, val, parsedPath.className, parsedPath.falsyClassName);
- };
-
- // For each property passed, loop through and setup
- // an observer.
- forEach.call(classBindings.split(' '), function(binding) {
-
- // Variable in which the old class value is saved. The observer function
- // closes over this variable, so it knows which string to remove when
- // the property changes.
- var oldClass;
-
- var observer, invoker;
-
- var parsedPath = Ember.View._parsePropertyPath(binding),
- path = parsedPath.path,
- pathRoot = context,
- normalized;
-
- if (path !== '' && path !== 'this') {
- normalized = normalizePath(context, path, options.data);
-
- pathRoot = normalized.root;
- path = normalized.path;
- }
-
- // Set up an observer on the context. If the property changes, toggle the
- // class name.
- /** @private */
- observer = function() {
- // Get the current value of the property
- newClass = classStringForPath(pathRoot, parsedPath, options);
- elem = bindAttrId ? view.$("[data-bindattr-" + bindAttrId + "='" + bindAttrId + "']") : view.$();
-
- // If we can't find the element anymore, a parent template has been
- // re-rendered and we've been nuked. Remove the observer.
- if (elem.length === 0) {
- Ember.removeObserver(pathRoot, path, invoker);
- } else {
- // If we had previously added a class to the element, remove it.
- if (oldClass) {
- elem.removeClass(oldClass);
- }
-
- // If necessary, add a new class. Make sure we keep track of it so
- // it can be removed in the future.
- if (newClass) {
- elem.addClass(newClass);
- oldClass = newClass;
- } else {
- oldClass = null;
- }
- }
- };
-
- /** @private */
- invoker = function() {
- Ember.run.once(observer);
- };
-
- if (path !== '' && path !== 'this') {
- Ember.addObserver(pathRoot, path, invoker);
- }
-
- // We've already setup the observer; now we just need to figure out the
- // correct behavior right now on the first pass through.
- value = classStringForPath(pathRoot, parsedPath, options);
-
- if (value) {
- ret.push(value);
-
- // Make sure we save the current value so that it can be removed if the
- // observer fires.
- oldClass = value;
- }
- });
-
- return ret;
-};
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Handlebars */
-
-// TODO: Don't require the entire module
-var get = Ember.get, set = Ember.set;
-var PARENT_VIEW_PATH = /^parentView\./;
-var EmberHandlebars = Ember.Handlebars;
-var VIEW_PRESERVES_CONTEXT = Ember.VIEW_PRESERVES_CONTEXT;
-
-/** @private */
-EmberHandlebars.ViewHelper = Ember.Object.create({
-
- propertiesFromHTMLOptions: function(options, thisContext) {
- var hash = options.hash, data = options.data;
- var extensions = {},
- classes = hash['class'],
- dup = false;
-
- if (hash.id) {
- extensions.elementId = hash.id;
- dup = true;
- }
-
- if (classes) {
- classes = classes.split(' ');
- extensions.classNames = classes;
- dup = true;
- }
-
- if (hash.classBinding) {
- extensions.classNameBindings = hash.classBinding.split(' ');
- dup = true;
- }
-
- if (hash.classNameBindings) {
- if (extensions.classNameBindings === undefined) extensions.classNameBindings = [];
- extensions.classNameBindings = extensions.classNameBindings.concat(hash.classNameBindings.split(' '));
- dup = true;
- }
-
- if (hash.attributeBindings) {
- Ember.assert("Setting 'attributeBindings' via Handlebars is not allowed. Please subclass Ember.View and set it there instead.");
- extensions.attributeBindings = null;
- dup = true;
- }
-
- if (dup) {
- hash = Ember.$.extend({}, hash);
- delete hash.id;
- delete hash['class'];
- delete hash.classBinding;
- }
-
- // Set the proper context for all bindings passed to the helper. This applies to regular attribute bindings
- // as well as class name bindings. If the bindings are local, make them relative to the current context
- // instead of the view.
- var path;
-
- // Evaluate the context of regular attribute bindings:
- for (var prop in hash) {
- if (!hash.hasOwnProperty(prop)) { continue; }
-
- // Test if the property ends in "Binding"
- if (Ember.IS_BINDING.test(prop) && typeof hash[prop] === 'string') {
- path = this.contextualizeBindingPath(hash[prop], data);
- if (path) { hash[prop] = path; }
- }
- }
-
- // Evaluate the context of class name bindings:
- if (extensions.classNameBindings) {
- for (var b in extensions.classNameBindings) {
- var full = extensions.classNameBindings[b];
- if (typeof full === 'string') {
- // Contextualize the path of classNameBinding so this:
- //
- // classNameBinding="isGreen:green"
- //
- // is converted to this:
- //
- // classNameBinding="bindingContext.isGreen:green"
- var parsedPath = Ember.View._parsePropertyPath(full);
- path = this.contextualizeBindingPath(parsedPath.path, data);
- if (path) { extensions.classNameBindings[b] = path + parsedPath.classNames; }
- }
- }
- }
-
- // Make the current template context available to the view
- // for the bindings set up above.
- extensions.bindingContext = thisContext;
-
- return Ember.$.extend(hash, extensions);
- },
-
- // Transform bindings from the current context to a context that can be evaluated within the view.
- // Returns null if the path shouldn't be changed.
- //
- // TODO: consider the addition of a prefix that would allow this method to return `path`.
- contextualizeBindingPath: function(path, data) {
- var normalized = Ember.Handlebars.normalizePath(null, path, data);
- if (normalized.isKeyword) {
- return 'templateData.keywords.' + path;
- } else if (Ember.isGlobalPath(path)) {
- return null;
- } else if (path === 'this') {
- return 'bindingContext';
- } else {
- return 'bindingContext.' + path;
- }
- },
-
- helper: function(thisContext, path, options) {
- var inverse = options.inverse,
- data = options.data,
- view = data.view,
- fn = options.fn,
- hash = options.hash,
- newView;
-
- if ('string' === typeof path) {
- newView = EmberHandlebars.getPath(thisContext, path, options);
- Ember.assert("Unable to find view at path '" + path + "'", !!newView);
- } else {
- newView = path;
- }
-
- Ember.assert(Ember.String.fmt('You must pass a view class to the #view helper, not %@ (%@)', [path, newView]), Ember.View.detect(newView));
-
- var viewOptions = this.propertiesFromHTMLOptions(options, thisContext);
- var currentView = data.view;
- viewOptions.templateData = options.data;
-
- if (fn) {
- Ember.assert("You cannot provide a template block if you also specified a templateName", !get(viewOptions, 'templateName') && !get(newView.proto(), 'templateName'));
- viewOptions.template = fn;
- }
-
- // We only want to override the `_context` computed property if there is
- // no specified controller. See View#_context for more information.
- if (VIEW_PRESERVES_CONTEXT && !newView.proto().controller && !newView.proto().controllerBinding && !viewOptions.controller && !viewOptions.controllerBinding) {
- viewOptions._context = thisContext;
- }
-
- currentView.appendChild(newView, viewOptions);
- }
-});
-
-/**
- `{{view}}` inserts a new instance of `Ember.View` into a template passing its options
- to the `Ember.View`'s `create` method and using the supplied block as the view's own template.
-
- An empty `<body>` and the following template:
-
- <script type="text/x-handlebars">
- A span:
- {{#view tagName="span"}}
- hello.
- {{/view}}
- </script>
-
- Will result in HTML structure:
-
- <body>
- <!-- Note: the handlebars template script
- also results in a rendered Ember.View
- which is the outer <div> here -->
-
- <div class="ember-view">
- A span:
- <span id="ember1" class="ember-view">
- Hello.
- </span>
- </div>
- </body>
-
- ### parentView setting
-
- The `parentView` property of the new `Ember.View` instance created through `{{view}}`
- will be set to the `Ember.View` instance of the template where `{{view}}` was called.
-
- aView = Ember.View.create({
- template: Ember.Handlebars.compile("{{#view}} my parent: {{parentView.elementId}} {{/view}}")
- })
-
- aView.appendTo('body')
-
- Will result in HTML structure:
-
- <div id="ember1" class="ember-view">
- <div id="ember2" class="ember-view">
- my parent: ember1
- </div>
- </div>
-
- ### Setting CSS id and class attributes
-
- The HTML `id` attribute can be set on the `{{view}}`'s resulting element with the `id` option.
- This option will _not_ be passed to `Ember.View.create`.
-
- <script type="text/x-handlebars">
- {{#view tagName="span" id="a-custom-id"}}
- hello.
- {{/view}}
- </script>
-
- Results in the following HTML structure:
-
- <div class="ember-view">
- <span id="a-custom-id" class="ember-view">
- hello.
- </span>
- </div>
-
- The HTML `class` attribute can be set on the `{{view}}`'s resulting element with
- the `class` or `classNameBindings` options. The `class` option
- will directly set the CSS `class` attribute and will not be passed to
- `Ember.View.create`. `classNameBindings` will be passed to `create` and use
- `Ember.View`'s class name binding functionality:
-
- <script type="text/x-handlebars">
- {{#view tagName="span" class="a-custom-class"}}
- hello.
- {{/view}}
- </script>
-
- Results in the following HTML structure:
-
- <div class="ember-view">
- <span id="ember2" class="ember-view a-custom-class">
- hello.
- </span>
- </div>
-
- ### Supplying a different view class
- `{{view}}` can take an optional first argument before its supplied options to specify a
- path to a custom view class.
-
- <script type="text/x-handlebars">
- {{#view "MyApp.CustomView"}}
- hello.
- {{/view}}
- </script>
-
- The first argument can also be a relative path. Ember will search for the view class
- starting at the `Ember.View` of the template where `{{view}}` was used as the root object:
-
- MyApp = Ember.Application.create({})
- MyApp.OuterView = Ember.View.extend({
- innerViewClass: Ember.View.extend({
- classNames: ['a-custom-view-class-as-property']
- }),
- template: Ember.Handlebars.compile('{{#view "innerViewClass"}} hi {{/view}}')
- })
-
- MyApp.OuterView.create().appendTo('body')
-
-Will result in the following HTML:
-
- <div id="ember1" class="ember-view">
- <div id="ember2" class="ember-view a-custom-view-class-as-property">
- hi
- </div>
- </div>
-
- ### Blockless use
-
- If you supply a custom `Ember.View` subclass that specifies its own template
- or provide a `templateName` option to `{{view}}` it can be used without supplying a block.
- Attempts to use both a `templateName` option and supply a block will throw an error.
-
- <script type="text/x-handlebars">
- {{view "MyApp.ViewWithATemplateDefined"}}
- </script>
-
- ### viewName property
-
- You can supply a `viewName` option to `{{view}}`. The `Ember.View` instance will
- be referenced as a property of its parent view by this name.
-
- aView = Ember.View.create({
- template: Ember.Handlebars.compile('{{#view viewName="aChildByName"}} hi {{/view}}')
- })
-
- aView.appendTo('body')
- aView.get('aChildByName') // the instance of Ember.View created by {{view}} helper
-
- @name Handlebars.helpers.view
- @param {String} path
- @param {Hash} options
- @returns {String} HTML string
-*/
-EmberHandlebars.registerHelper('view', function(path, options) {
- Ember.assert("The view helper only takes a single argument", arguments.length <= 2);
-
- // If no path is provided, treat path param as options.
- if (path && path.data && path.data.isRenderData) {
- options = path;
- path = "Ember.View";
- }
-
- return EmberHandlebars.ViewHelper.helper(this, path, options);
-});
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Handlebars */
-
-// TODO: Don't require all of this module
-var get = Ember.get, getPath = Ember.Handlebars.getPath, fmt = Ember.String.fmt;
-
-/**
- `{{collection}}` is a `Ember.Handlebars` helper for adding instances of
- `Ember.CollectionView` to a template. See `Ember.CollectionView` for additional
- information on how a `CollectionView` functions.
-
- `{{collection}}`'s primary use is as a block helper with a `contentBinding` option
- pointing towards an `Ember.Array`-compatible object. An `Ember.View` instance will
- be created for each item in its `content` property. Each view will have its own
- `content` property set to the appropriate item in the collection.
-
- The provided block will be applied as the template for each item's view.
-
- Given an empty `<body>` the following template:
-
- <script type="text/x-handlebars">
- {{#collection contentBinding="App.items"}}
- Hi {{content.name}}
- {{/collection}}
- </script>
-
- And the following application code
-
- App = Ember.Application.create()
- App.items = [
- Ember.Object.create({name: 'Dave'}),
- Ember.Object.create({name: 'Mary'}),
- Ember.Object.create({name: 'Sara'})
- ]
-
- Will result in the HTML structure below
-
- <div class="ember-view">
- <div class="ember-view">Hi Dave</div>
- <div class="ember-view">Hi Mary</div>
- <div class="ember-view">Hi Sara</div>
- </div>
-
- ### Blockless Use
- If you provide an `itemViewClass` option that has its own `template` you can omit
- the block.
-
- The following template:
-
- <script type="text/x-handlebars">
- {{collection contentBinding="App.items" itemViewClass="App.AnItemView"}}
- </script>
-
- And application code
-
- App = Ember.Application.create()
- App.items = [
- Ember.Object.create({name: 'Dave'}),
- Ember.Object.create({name: 'Mary'}),
- Ember.Object.create({name: 'Sara'})
- ]
-
- App.AnItemView = Ember.View.extend({
- template: Ember.Handlebars.compile("Greetings {{content.name}}")
- })
-
- Will result in the HTML structure below
-
- <div class="ember-view">
- <div class="ember-view">Greetings Dave</div>
- <div class="ember-view">Greetings Mary</div>
- <div class="ember-view">Greetings Sara</div>
- </div>
-
- ### Specifying a CollectionView subclass
- By default the `{{collection}}` helper will create an instance of `Ember.CollectionView`.
- You can supply a `Ember.CollectionView` subclass to the helper by passing it
- as the first argument:
-
- <script type="text/x-handlebars">
- {{#collection App.MyCustomCollectionClass contentBinding="App.items"}}
- Hi {{content.name}}
- {{/collection}}
- </script>
-
-
- ### Forwarded `item.*`-named Options
- As with the `{{view}}`, helper options passed to the `{{collection}}` will be set on
- the resulting `Ember.CollectionView` as properties. Additionally, options prefixed with
- `item` will be applied to the views rendered for each item (note the camelcasing):
-
- <script type="text/x-handlebars">
- {{#collection contentBinding="App.items"
- itemTagName="p"
- itemClassNames="greeting"}}
- Howdy {{content.name}}
- {{/collection}}
- </script>
-
- Will result in the following HTML structure:
-
- <div class="ember-view">
- <p class="ember-view greeting">Howdy Dave</p>
- <p class="ember-view greeting">Howdy Mary</p>
- <p class="ember-view greeting">Howdy Sara</p>
- </div>
-
- @name Handlebars.helpers.collection
- @param {String} path
- @param {Hash} options
- @returns {String} HTML string
-*/
-Ember.Handlebars.registerHelper('collection', function(path, options) {
- // If no path is provided, treat path param as options.
- if (path && path.data && path.data.isRenderData) {
- options = path;
- path = undefined;
- Ember.assert("You cannot pass more than one argument to the collection helper", arguments.length === 1);
- } else {
- Ember.assert("You cannot pass more than one argument to the collection helper", arguments.length === 2);
- }
-
- var fn = options.fn;
- var data = options.data;
- var inverse = options.inverse;
-
- // If passed a path string, convert that into an object.
- // Otherwise, just default to the standard class.
- var collectionClass;
- collectionClass = path ? getPath(this, path, options) : Ember.CollectionView;
- Ember.assert(fmt("%@ #collection: Could not find collection class %@", [data.view, path]), !!collectionClass);
-
- var hash = options.hash, itemHash = {}, match;
-
- // Extract item view class if provided else default to the standard class
- var itemViewClass, itemViewPath = hash.itemViewClass;
- var collectionPrototype = collectionClass.proto();
- delete hash.itemViewClass;
- itemViewClass = itemViewPath ? getPath(collectionPrototype, itemViewPath, options) : collectionPrototype.itemViewClass;
- Ember.assert(fmt("%@ #collection: Could not find itemViewClass %@", [data.view, itemViewPath]), !!itemViewClass);
-
- // Go through options passed to the {{collection}} helper and extract options
- // that configure item views instead of the collection itself.
- for (var prop in hash) {
- if (hash.hasOwnProperty(prop)) {
- match = prop.match(/^item(.)(.*)$/);
-
- if(match) {
- // Convert itemShouldFoo -> shouldFoo
- itemHash[match[1].toLowerCase() + match[2]] = hash[prop];
- // Delete from hash as this will end up getting passed to the
- // {{view}} helper method.
- delete hash[prop];
- }
- }
- }
-
- var tagName = hash.tagName || collectionPrototype.tagName;
-
- if (fn) {
- itemHash.template = fn;
- delete options.fn;
- }
-
- var emptyViewClass;
- if (inverse && inverse !== Handlebars.VM.noop) {
- emptyViewClass = get(collectionPrototype, 'emptyViewClass');
- emptyViewClass = emptyViewClass.extend({
- template: inverse,
- tagName: itemHash.tagName
- });
- } else if (hash.emptyViewClass) {
- emptyViewClass = getPath(this, hash.emptyViewClass, options);
- }
- hash.emptyView = emptyViewClass;
-
- if (hash.eachHelper === 'each') {
- itemHash._context = Ember.computed(function() {
- return get(this, 'content');
- }).property('content');
- delete hash.eachHelper;
- }
-
- var viewOptions = Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({ data: data, hash: itemHash }, this);
- hash.itemViewClass = itemViewClass.extend(viewOptions);
-
- return Ember.Handlebars.helpers.view.call(this, collectionClass, options);
-});
-
-
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Handlebars */
-var getPath = Ember.Handlebars.getPath;
-
-/**
- `unbound` allows you to output a property without binding. *Important:* The
- output will not be updated if the property changes. Use with caution.
-
- <div>{{unbound somePropertyThatDoesntChange}}</div>
-
- @name Handlebars.helpers.unbound
- @param {String} property
- @returns {String} HTML string
-*/
-Ember.Handlebars.registerHelper('unbound', function(property, fn) {
- var context = (fn.contexts && fn.contexts[0]) || this;
- return getPath(context, property, fn);
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-/*jshint debug:true*/
-var getPath = Ember.Handlebars.getPath, normalizePath = Ember.Handlebars.normalizePath;
-
-/**
- `log` allows you to output the value of a value in the current rendering
- context.
-
- {{log myVariable}}
-
- @name Handlebars.helpers.log
- @param {String} property
-*/
-Ember.Handlebars.registerHelper('log', function(property, options) {
- var context = (options.contexts && options.contexts[0]) || this,
- normalized = normalizePath(context, property, options.data),
- pathRoot = normalized.root,
- path = normalized.path,
- value = (path === 'this') ? pathRoot : getPath(pathRoot, path, options);
- Ember.Logger.log(value);
-});
-
-/**
- The `debugger` helper executes the `debugger` statement in the current
- context.
-
- {{debugger}}
-
- @name Handlebars.helpers.debugger
- @param {String} property
-*/
-Ember.Handlebars.registerHelper('debugger', function() {
- debugger;
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-Ember.Handlebars.EachView = Ember.CollectionView.extend(Ember._Metamorph, {
- itemViewClass: Ember._MetamorphView,
- emptyViewClass: Ember._MetamorphView,
-
- createChildView: function(view, attrs) {
- view = this._super(view, attrs);
-
- // At the moment, if a container view subclass wants
- // to insert keywords, it is responsible for cloning
- // the keywords hash. This will be fixed momentarily.
- var keyword = get(this, 'keyword');
-
- if (keyword) {
- var data = get(view, 'templateData');
-
- data = Ember.copy(data);
- data.keywords = view.cloneKeywords();
- set(view, 'templateData', data);
-
- var content = get(view, 'content');
-
- // In this case, we do not bind, because the `content` of
- // a #each item cannot change.
- data.keywords[keyword] = content;
- }
-
- return view;
- }
-});
-
-Ember.Handlebars.registerHelper('each', function(path, options) {
- if (arguments.length === 4) {
- Ember.assert("If you pass more than one argument to the each helper, it must be in the form #each foo in bar", arguments[1] === "in");
-
- var keywordName = arguments[0];
-
- options = arguments[3];
- path = arguments[2];
- if (path === '') { path = "this"; }
-
- options.hash.keyword = keywordName;
- } else {
- options.hash.eachHelper = 'each';
- }
-
- Ember.assert("You must pass a block to the each helper", options.fn && options.fn !== Handlebars.VM.noop);
-
- options.hash.contentBinding = path;
- // Set up emptyView as a metamorph with no tag
- //options.hash.emptyViewClass = Ember._MetamorphView;
-
- return Ember.Handlebars.helpers.collection.call(this, 'Ember.Handlebars.EachView', options);
-});
-
-})();
-
-
-
-(function() {
-/**
- `template` allows you to render a template from inside another template.
- This allows you to re-use the same template in multiple places. For example:
-
- <script type="text/x-handlebars">
- {{#with loggedInUser}}
- Last Login: {{lastLogin}}
- User Info: {{template "user_info"}}
- {{/with}}
- </script>
-
- <script type="text/x-handlebars" data-template-name="user_info">
- Name: <em>{{name}}</em>
- Karma: <em>{{karma}}</em>
- </script>
-
- This helper looks for templates in the global Ember.TEMPLATES hash. If you
- add &lt;script&gt; tags to your page with the `data-template-name` attribute set,
- they will be compiled and placed in this hash automatically.
-
- You can also manually register templates by adding them to the hash:
-
- Ember.TEMPLATES["my_cool_template"] = Ember.Handlebars.compile('<b>{{user}}</b>');
-
- @name Handlebars.helpers.template
- @param {String} templateName the template to render
-*/
-
-Ember.Handlebars.registerHelper('template', function(name, options) {
- var template = Ember.TEMPLATES[name];
-
- Ember.assert("Unable to find template with name '"+name+"'.", !!template);
-
- Ember.TEMPLATES[name](this, { data: options.data });
-});
-
-})();
-
-
-
-(function() {
-var EmberHandlebars = Ember.Handlebars,
- getPath = EmberHandlebars.getPath,
- get = Ember.get,
- a_slice = Array.prototype.slice;
-
-var ActionHelper = EmberHandlebars.ActionHelper = {
- registeredActions: {}
-};
-
-ActionHelper.registerAction = function(actionName, options) {
- var actionId = (++Ember.$.uuid).toString();
-
- ActionHelper.registeredActions[actionId] = {
- eventName: options.eventName,
- handler: function(event) {
- var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey,
- secondaryClick = event.which > 1, // IE9 may return undefined
- nonStandard = modifier || secondaryClick;
-
- if (options.link && nonStandard) {
- // Allow the browser to handle special link clicks normally
- return;
- }
-
- event.preventDefault();
-
- event.view = options.view;
-
- if (options.hasOwnProperty('context')) {
- event.context = options.context;
- }
-
- if (options.hasOwnProperty('contexts')) {
- event.contexts = options.contexts;
- }
-
- var target = options.target;
-
- // Check for StateManager (or compatible object)
- if (target.isState && typeof target.send === 'function') {
- return target.send(actionName, event);
- } else {
- Ember.assert(Ember.String.fmt('Target %@ does not have action %@', [target, actionName]), target[actionName]);
- return target[actionName].call(target, event);
- }
- }
- };
-
- options.view.on('willRerender', function() {
- delete ActionHelper.registeredActions[actionId];
- });
-
- return actionId;
-};
-
-/**
- The `{{action}}` helper registers an HTML element within a template for
- DOM event handling and forwards that interaction to the Application's router,
- the template's `Ember.View` instance, or supplied `target` option (see 'Specifiying a Target').
-
- User interaction with that element will invoke the supplied action name on
- the appropriate target.
-
- Given the following Handlebars template on the page
-
- <script type="text/x-handlebars" data-template-name='a-template'>
- <div {{action anActionName}}>
- click me
- </div>
- </script>
-
- And application code
-
- AView = Ember.View.extend({
- templateName; 'a-template',
- anActionName: function(event){}
- });
-
- aView = AView.create();
- aView.appendTo('body');
-
- Will results in the following rendered HTML
-
- <div class="ember-view">
- <div data-ember-action="1">
- click me
- </div>
- </div>
-
- Clicking "click me" will trigger the `anActionName` method of the `aView`
- object with a `jQuery.Event` object as its argument. The `jQuery.Event`
- object will be extended to include a `view` property that is set to the
- original view interacted with (in this case the `aView` object).
-
- ### Event Propagation
-
- Events triggered through the action helper will automatically have
- `.preventDefault()` called on them. You do not need to do so in your event
- handlers. To stop propagation of the event, simply return `false` from your
- handler.
-
- If you need the default handler to trigger you should either register your
- own event handler, or use event methods on your view class. See Ember.View
- 'Responding to Browser Events' for more information.
-
- ### Specifying DOM event type
-
- By default the `{{action}}` helper registers for DOM `click` events. You can
- supply an `on` option to the helper to specify a different DOM event name:
-
- <script type="text/x-handlebars" data-template-name='a-template'>
- <div {{action anActionName on="doubleClick"}}>
- click me
- </div>
- </script>
-
- See Ember.View 'Responding to Browser Events' for a list of
- acceptable DOM event names.
-
- Because `{{action}}` depends on Ember's event dispatch system it will only
- function if an `Ember.EventDispatcher` instance is available. An
- `Ember.EventDispatcher` instance will be created when a new
- `Ember.Application` is created. Having an instance of `Ember.Application`
- will satisfy this requirement.
-
-
- ### Specifying a Target
- There are several possible target objects for `{{action}}` helpers:
-
- In a typical `Ember.Router`-backed Application where views are managed
- through use of the `{{outlet}}` helper, actions will be forwarded to the
- current state of the Applications's Router. See Ember.Router 'Responding
- to User-initiated Events' for more information.
-
- If you manaully set the `target` property on the controller of a template's
- `Ember.View` instance, the specifed `controller.target` will become the target
- for any actions. Likely custom values for a controller's `target` are the
- controller itself or a StateManager other than the Application's Router.
-
- If the templates's view lacks a controller property the view itself is the target.
-
- Finally, a `target` option can be provided to the helper to change which object
- will receive the method call. This option must be a string representing a
- path to an object:
-
- <script type="text/x-handlebars" data-template-name='a-template'>
- <div {{action anActionName target="MyApplication.someObject"}}>
- click me
- </div>
- </script>
-
- Clicking "click me" in the rendered HTML of the above template will trigger
- the `anActionName` method of the object at `MyApplication.someObject`.
- The first argument to this method will be a `jQuery.Event` extended to
- include a `view` property that is set to the original view interacted with.
-
- A path relative to the template's `Ember.View` instance can also be used as
- a target:
-
- <script type="text/x-handlebars" data-template-name='a-template'>
- <div {{action anActionName target="parentView"}}>
- click me
- </div>
- </script>
-
- Clicking "click me" in the rendered HTML of the above template will trigger
- the `anActionName` method of the view's parent view.
-
- The `{{action}}` helper is `Ember.StateManager` aware. If the target of the
- action is an `Ember.StateManager` instance `{{action}}` will use the `send`
- functionality of StateManagers. The documentation for `Ember.StateManager`
- has additional information about this use.
-
- If an action's target does not implement a method that matches the supplied
- action name an error will be thrown.
-
- <script type="text/x-handlebars" data-template-name='a-template'>
- <div {{action aMethodNameThatIsMissing}}>
- click me
- </div>
- </script>
-
- With the following application code
-
- AView = Ember.View.extend({
- templateName; 'a-template',
- // note: no method 'aMethodNameThatIsMissing'
- anActionName: function(event){}
- });
-
- aView = AView.create();
- aView.appendTo('body');
-
- Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when
- "click me" is clicked.
-
- ### Specifying a context
-
- By default the `{{action}}` helper passes the current Handlebars context
- along in the `jQuery.Event` object. You may specify an alternate object to
- pass as the context by providing a property path:
-
- <script type="text/x-handlebars" data-template-name='a-template'>
- {{#each person in people}}
- <div {{action edit person}}>
- click me
- </div>
- {{/each}}
- </script>
-
- @name Handlebars.helpers.action
- @param {String} actionName
- @param {Object...} contexts
- @param {Hash} options
-*/
-EmberHandlebars.registerHelper('action', function(actionName) {
- var options = arguments[arguments.length - 1],
- contexts = a_slice.call(arguments, 1, -1);
-
- var hash = options.hash,
- view = options.data.view,
- target, controller, link;
-
- // create a hash to pass along to registerAction
- var action = {
- eventName: hash.on || "click"
- };
-
- action.view = view = get(view, 'concreteView');
-
- if (hash.target) {
- target = getPath(this, hash.target, options);
- } else if (controller = options.data.keywords.controller) {
- target = get(controller, 'target');
- }
-
- action.target = target = target || view;
-
- if (contexts.length) {
- action.contexts = contexts = Ember.EnumerableUtils.map(contexts, function(context) {
- return getPath(this, context, options);
- }, this);
- action.context = contexts[0];
- }
-
- var output = [], url;
-
- if (hash.href && target.urlForEvent) {
- url = target.urlForEvent.apply(target, [actionName].concat(contexts));
- output.push('href="' + url + '"');
- action.link = true;
- }
-
- var actionId = ActionHelper.registerAction(actionName, action);
- output.push('data-ember-action="' + actionId + '"');
-
- return new EmberHandlebars.SafeString(output.join(" "));
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get, set = Ember.set;
-
-/**
-
- When used in a Handlebars template that is assigned to an `Ember.View` instance's
- `layout` property Ember will render the layout template first, inserting the view's
- own rendered output at the `{{ yield }}` location.
-
- An empty `<body>` and the following application code:
-
- AView = Ember.View.extend({
- classNames: ['a-view-with-layout'],
- layout: Ember.Handlebars.compile('<div class="wrapper">{{ yield }}</div>'),
- template: Ember.Handlebars.compile('<span>I am wrapped</span>')
- })
-
- aView = AView.create()
- aView.appendTo('body')
-
- Will result in the following HTML output:
-
- <body>
- <div class='ember-view a-view-with-layout'>
- <div class="wrapper">
- <span>I am wrapped</span>
- </div>
- </div>
- </body>
-
- The yield helper cannot be used outside of a template assigned to an `Ember.View`'s `layout` property
- and will throw an error if attempted.
-
- BView = Ember.View.extend({
- classNames: ['a-view-with-layout'],
- template: Ember.Handlebars.compile('{{yield}}')
- })
-
- bView = BView.create()
- bView.appendTo('body')
-
- // throws
- // Uncaught Error: assertion failed: You called yield in a template that was not a layout
-
- @name Handlebars.helpers.yield
- @param {Hash} options
- @returns {String} HTML string
-*/
-Ember.Handlebars.registerHelper('yield', function(options) {
- var view = options.data.view, template;
-
- while (view && !get(view, 'layout')) {
- view = get(view, 'parentView');
- }
-
- Ember.assert("You called yield in a template that was not a layout", !!view);
-
- template = get(view, 'template');
-
- if (template) { template(this, options); }
-});
-
-})();
-
-
-
-(function() {
-/**
- The `outlet` helper allows you to specify that the current
- view's controller will fill in the view for a given area.
-
- {{outlet}}
-
- By default, when the the current controller's `view`
- property changes, the outlet will replace its current
- view with the new view.
-
- controller.set('view', someView);
-
- You can also specify a particular name, other than view:
-
- {{outlet masterView}}
- {{outlet detailView}}
-
- Then, you can control several outlets from a single
- controller:
-
- controller.set('masterView', postsView);
- controller.set('detailView', postView);
-
- @name Handlebars.helpers.outlet
- @param {String} property the property on the controller
- that holds the view for this outlet
-*/
-Ember.Handlebars.registerHelper('outlet', function(property, options) {
- if (property && property.data && property.data.isRenderData) {
- options = property;
- property = 'view';
- }
-
- options.hash.currentViewBinding = "controller." + property;
-
- return Ember.Handlebars.helpers.view.call(this, Ember.ContainerView, options);
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var set = Ember.set, get = Ember.get;
-
-/**
- @class
-
- Creates an HTML input of type 'checkbox' with HTML related properties
- applied directly to the input.
-
- {{view Ember.Checkbox classNames="applicaton-specific-checkbox"}}
-
- <input id="ember1" class="ember-view ember-checkbox applicaton-specific-checkbox" type="checkbox">
-
- You can add a `label` tag yourself in the template where the Ember.Checkbox is being used.
-
- <label>
- Some Title
- {{view Ember.Checkbox classNames="applicaton-specific-checkbox"}}
- </label>
-
-
- The `checked` attribute of an Ember.Checkbox object should always be set
- through the Ember object or by interacting with its rendered element representation
- via the mouse, keyboard, or touch. Updating the value of the checkbox via jQuery will
- result in the checked value of the object and its element losing synchronization.
-
- ## Layout and LayoutName properties
- Because HTML `input` elements are self closing `layout` and `layoutName` properties will
- not be applied. See `Ember.View`'s layout section for more information.
-
- @extends Ember.View
-*/
-Ember.Checkbox = Ember.View.extend({
- classNames: ['ember-checkbox'],
-
- tagName: 'input',
-
- attributeBindings: ['type', 'checked', 'disabled', 'tabindex'],
-
- type: "checkbox",
- checked: false,
- disabled: false,
-
- init: function() {
- this._super();
- this.on("change", this, this._updateElementValue);
- },
-
- /**
- @private
- */
- _updateElementValue: function() {
- set(this, 'checked', this.$().prop('checked'));
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-/** @class */
-Ember.TextSupport = Ember.Mixin.create(
-/** @scope Ember.TextSupport.prototype */ {
-
- value: "",
-
- attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex'],
- placeholder: null,
- disabled: false,
- maxlength: null,
-
- insertNewline: Ember.K,
- cancel: Ember.K,
-
- /** @private */
- init: function() {
- this._super();
- this.on("focusOut", this, this._elementValueDidChange);
- this.on("change", this, this._elementValueDidChange);
- this.on("keyUp", this, this.interpretKeyEvents);
- },
-
- /**
- @private
- */
- interpretKeyEvents: function(event) {
- var map = Ember.TextSupport.KEY_EVENTS;
- var method = map[event.keyCode];
-
- this._elementValueDidChange();
- if (method) { return this[method](event); }
- },
-
- _elementValueDidChange: function() {
- set(this, 'value', this.$().val());
- }
-
-});
-
-Ember.TextSupport.KEY_EVENTS = {
- 13: 'insertNewline',
- 27: 'cancel'
-};
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- The `Ember.TextField` view class renders a text
- [input](https://developer.mozilla.org/en/HTML/Element/Input) element. It
- allows for binding Ember properties to the text field contents (`value`),
- live-updating as the user inputs text.
-
- Example:
-
- {{view Ember.TextField valueBinding="firstName"}}
-
- ## Layout and LayoutName properties
- Because HTML `input` elements are self closing `layout` and `layoutName` properties will
- not be applied. See `Ember.View`'s layout section for more information.
-
- @extends Ember.View
- @extends Ember.TextSupport
-*/
-Ember.TextField = Ember.View.extend(Ember.TextSupport,
- /** @scope Ember.TextField.prototype */ {
-
- classNames: ['ember-text-field'],
- tagName: "input",
- attributeBindings: ['type', 'value', 'size'],
-
- /**
- The value attribute of the input element. As the user inputs text, this
- property is updated live.
-
- @type String
- @default ""
- */
- value: "",
-
- /**
- The type attribute of the input element.
-
- @type String
- @default "text"
- */
- type: "text",
-
- /**
- The size of the text field in characters.
-
- @type String
- @default null
- */
- size: null
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-Ember.Button = Ember.View.extend(Ember.TargetActionSupport, {
- classNames: ['ember-button'],
- classNameBindings: ['isActive'],
-
- tagName: 'button',
-
- propagateEvents: false,
-
- attributeBindings: ['type', 'disabled', 'href', 'tabindex'],
-
- /** @private
- Overrides TargetActionSupport's targetObject computed
- property to use Handlebars-specific path resolution.
- */
- targetObject: Ember.computed(function() {
- var target = get(this, 'target'),
- root = get(this, 'context'),
- data = get(this, 'templateData');
-
- if (typeof target !== 'string') { return target; }
-
- return Ember.Handlebars.getPath(root, target, { data: data });
- }).property('target').cacheable(),
-
- // Defaults to 'button' if tagName is 'input' or 'button'
- type: Ember.computed(function(key, value) {
- var tagName = this.get('tagName');
- if (value !== undefined) { this._type = value; }
- if (this._type !== undefined) { return this._type; }
- if (tagName === 'input' || tagName === 'button') { return 'button'; }
- }).property('tagName').cacheable(),
-
- disabled: false,
-
- // Allow 'a' tags to act like buttons
- href: Ember.computed(function() {
- return this.get('tagName') === 'a' ? '#' : null;
- }).property('tagName').cacheable(),
-
- mouseDown: function() {
- if (!get(this, 'disabled')) {
- set(this, 'isActive', true);
- this._mouseDown = true;
- this._mouseEntered = true;
- }
- return get(this, 'propagateEvents');
- },
-
- mouseLeave: function() {
- if (this._mouseDown) {
- set(this, 'isActive', false);
- this._mouseEntered = false;
- }
- },
-
- mouseEnter: function() {
- if (this._mouseDown) {
- set(this, 'isActive', true);
- this._mouseEntered = true;
- }
- },
-
- mouseUp: function(event) {
- if (get(this, 'isActive')) {
- // Actually invoke the button's target and action.
- // This method comes from the Ember.TargetActionSupport mixin.
- this.triggerAction();
- set(this, 'isActive', false);
- }
-
- this._mouseDown = false;
- this._mouseEntered = false;
- return get(this, 'propagateEvents');
- },
-
- keyDown: function(event) {
- // Handle space or enter
- if (event.keyCode === 13 || event.keyCode === 32) {
- this.mouseDown();
- }
- },
-
- keyUp: function(event) {
- // Handle space or enter
- if (event.keyCode === 13 || event.keyCode === 32) {
- this.mouseUp();
- }
- },
-
- // TODO: Handle proper touch behavior. Including should make inactive when
- // finger moves more than 20x outside of the edge of the button (vs mouse
- // which goes inactive as soon as mouse goes out of edges.)
-
- touchStart: function(touch) {
- return this.mouseDown(touch);
- },
-
- touchEnd: function(touch) {
- return this.mouseUp(touch);
- },
-
- init: function() {
- Ember.deprecate("Ember.Button is deprecated and will be removed from future releases. Consider using the `{{action}}` helper.");
- this._super();
- }
-});
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-var get = Ember.get, set = Ember.set;
-
-/**
- @class
-
- The `Ember.TextArea` view class renders a
- [textarea](https://developer.mozilla.org/en/HTML/Element/textarea) element.
- It allows for binding Ember properties to the text area contents (`value`),
- live-updating as the user inputs text.
-
- ## Layout and LayoutName properties
-
- Because HTML `textarea` elements do not contain inner HTML the `layout` and `layoutName`
- properties will not be applied. See `Ember.View`'s layout section for more information.
-
- @extends Ember.View
- @extends Ember.TextSupport
-*/
-Ember.TextArea = Ember.View.extend(Ember.TextSupport,
-/** @scope Ember.TextArea.prototype */ {
-
- classNames: ['ember-text-area'],
-
- tagName: "textarea",
- attributeBindings: ['rows', 'cols'],
- rows: null,
- cols: null,
-
- _updateElementValue: Ember.observer(function() {
- // We do this check so cursor position doesn't get affected in IE
- var value = get(this, 'value'),
- $el = this.$();
- if ($el && value !== $el.val()) {
- $el.val(value);
- }
- }, 'value'),
-
- /** @private */
- init: function() {
- this._super();
- this.on("didInsertElement", this, this._updateElementValue);
- }
-
-});
-
-})();
-
-
-
-(function() {
-Ember.TabContainerView = Ember.View.extend({
- init: function() {
- Ember.deprecate("Ember.TabContainerView is deprecated and will be removed from future releases.");
- this._super();
- }
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get;
-
-Ember.TabPaneView = Ember.View.extend({
- tabsContainer: Ember.computed(function() {
- return this.nearestInstanceOf(Ember.TabContainerView);
- }).property().volatile(),
-
- isVisible: Ember.computed(function() {
- return get(this, 'viewName') === get(this, 'tabsContainer.currentView');
- }).property('tabsContainer.currentView').volatile(),
-
- init: function() {
- Ember.deprecate("Ember.TabPaneView is deprecated and will be removed from future releases.");
- this._super();
- }
-});
-
-})();
-
-
-
-(function() {
-var get = Ember.get, setPath = Ember.setPath;
-
-Ember.TabView = Ember.View.extend({
- tabsContainer: Ember.computed(function() {
- return this.nearestInstanceOf(Ember.TabContainerView);
- }).property().volatile(),
-
- mouseUp: function() {
- setPath(this, 'tabsContainer.currentView', get(this, 'value'));
- },
-
- init: function() {
- Ember.deprecate("Ember.TabView is deprecated and will be removed from future releases.");
- this._super();
- }
-});
-
-})();
-
-
-
-(function() {
-
-})();
-
-
-
-(function() {
-/*jshint eqeqeq:false */
-
-var set = Ember.set, get = Ember.get;
-var indexOf = Ember.EnumerableUtils.indexOf, indexesOf = Ember.EnumerableUtils.indexesOf;
-
-/**
- @class
-
- The Ember.Select view class renders a
- [select](https://developer.mozilla.org/en/HTML/Element/select) HTML element,
- allowing the user to choose from a list of options. The selected option(s)
- are updated live in the `selection` property, while the corresponding value
- is updated in the `value` property.
-
- ### Using Strings
- The simplest version of an Ember.Select takes an array of strings for the options
- of a select box and a valueBinding to set the value.
-
- Example:
-
- App.controller = Ember.Object.create({
- selected: null,
- content: [
- "Yehuda",
- "Tom"
- ]
- })
-
- {{view Ember.Select
- contentBinding="App.controller.content"
- valueBinding="App.controller.selected"
- }}
-
- Would result in the following HTML:
-
- <select class="ember-select">
- <option value="Yehuda">Yehuda</option>
- <option value="Tom">Tom</option>
- </select>
-
- Selecting Yehuda from the select box will set `App.controller.selected` to "Yehuda"
-
- ### Using Objects
- An Ember.Select can also take an array of JS or Ember objects.
-
- When using objects you need to supply optionLabelPath and optionValuePath parameters
- which will be used to get the label and value for each of the options.
-
- Usually you will bind to either the selection or the value attribute of the select.
-
- Use selectionBinding if you would like to set the whole object as a property on the target.
- Use valueBinding if you would like to set just the value.
-
- Example using selectionBinding:
-
- App.controller = Ember.Object.create({
- selectedPerson: null,
- selectedPersonId: null,
- content: [
- Ember.Object.create({firstName: "Yehuda", id: 1}),
- Ember.Object.create({firstName: "Tom", id: 2})
- ]
- })
-
- {{view Ember.Select
- contentBinding="App.controller.content"
- optionLabelPath="content.firstName"
- optionValuePath="content.id"
- selectionBinding="App.controller.selectedPerson"
- prompt="Please Select"}}
-
- <select class="ember-select">
- <option value>Please Select</option>
- <option value="1">Yehuda</option>
- <option value="2">Tom</option>
- </select>
-
- Selecting Yehuda here will set `App.controller.selectedPerson` to
- the Yehuda object.
-
- Example using valueBinding:
-
- {{view Ember.Select
- contentBinding="App.controller.content"
- optionLabelPath="content.firstName"
- optionValuePath="content.id"
- valueBinding="App.controller.selectedPersonId"
- prompt="Please Select"}}
-
- Selecting Yehuda in this case will set `App.controller.selectedPersonId` to 1.
-
- @extends Ember.View
-*/
-Ember.Select = Ember.View.extend(
- /** @scope Ember.Select.prototype */ {
-
- tagName: 'select',
- classNames: ['ember-select'],
- defaultTemplate: Ember.Handlebars.compile('{{#if view.prompt}}<option value>{{view.prompt}}</option>{{/if}}{{#each view.content}}{{view Ember.SelectOption contentBinding="this"}}{{/each}}'),
- attributeBindings: ['multiple', 'tabindex'],
-
- /**
- The `multiple` attribute of the select element. Indicates whether multiple
- options can be selected.
-
- @type Boolean
- @default false
- */
- multiple: false,
-
- /**
- The list of options.
-
- If `optionLabelPath` and `optionValuePath` are not overridden, this should
- be a list of strings, which will serve simultaneously as labels and values.
-
- Otherwise, this should be a list of objects. For instance:
-
- content: Ember.A([
- { id: 1, firstName: 'Yehuda' },
- { id: 2, firstName: 'Tom' }
- ]),
- optionLabelPath: 'content.firstName',
- optionValuePath: 'content.id'
-
- @type Array
- @default null
- */
- content: null,
-
- /**
- When `multiple` is false, the element of `content` that is currently
- selected, if any.
-
- When `multiple` is true, an array of such elements.
-
- @type Object or Array
- @default null
- */
- selection: null,
-
- /**
- In single selection mode (when `multiple` is false), value can be used to get
- the current selection's value or set the selection by it's value.
-
- It is not currently supported in multiple selection mode.
-
- @type String
- @default null
- */
- value: Ember.computed(function(key, value) {
- if (arguments.length === 2) { return value; }
-
- var valuePath = get(this, 'optionValuePath').replace(/^content\.?/, '');
- return valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection');
- }).property('selection').cacheable(),
-
- /**
- If given, a top-most dummy option will be rendered to serve as a user
- prompt.
-
- @type String
- @default null
- */
- prompt: null,
-
- /**
- The path of the option labels. See `content`.
-
- @type String
- @default 'content'
- */
- optionLabelPath: 'content',
-
- /**
- The path of the option values. See `content`.
-
- @type String
- @default 'content'
- */
- optionValuePath: 'content',
-
- _change: function() {
- if (get(this, 'multiple')) {
- this._changeMultiple();
- } else {
- this._changeSingle();
- }
- },
-
- selectionDidChange: Ember.observer(function() {
- var selection = get(this, 'selection'),
- isArray = Ember.isArray(selection);
- if (get(this, 'multiple')) {
- if (!isArray) {
- set(this, 'selection', Ember.A([selection]));
- return;
- }
- this._selectionDidChangeMultiple();
- } else {
- this._selectionDidChangeSingle();
- }
- }, 'selection'),
-
- valueDidChange: Ember.observer(function() {
- var content = get(this, 'content'),
- value = get(this, 'value'),
- valuePath = get(this, 'optionValuePath').replace(/^content\.?/, ''),
- selectedValue = (valuePath ? get(this, 'selection.' + valuePath) : get(this, 'selection')),
- selection;
-
- if (value !== selectedValue) {
- selection = content.find(function(obj) {
- return value === (valuePath ? get(obj, valuePath) : obj);
- });
-
- this.set('selection', selection);
- }
- }, 'value'),
-
-
- _triggerChange: function() {
- var selection = get(this, 'selection');
-
- if (selection) { this.selectionDidChange(); }
-
- this._change();
- },
-
- _changeSingle: function() {
- var selectedIndex = this.$()[0].selectedIndex,
- content = get(this, 'content'),
- prompt = get(this, 'prompt');
-
- if (!content) { return; }
- if (prompt && selectedIndex === 0) { set(this, 'selection', null); return; }
-
- if (prompt) { selectedIndex -= 1; }
- set(this, 'selection', content.objectAt(selectedIndex));
- },
-
- _changeMultiple: function() {
- var options = this.$('option:selected'),
- prompt = get(this, 'prompt'),
- offset = prompt ? 1 : 0,
- content = get(this, 'content');
-
- if (!content){ return; }
- if (options) {
- var selectedIndexes = options.map(function(){
- return this.index - offset;
- }).toArray();
- set(this, 'selection', content.objectsAt(selectedIndexes));
- }
- },
-
- _selectionDidChangeSingle: function() {
- var el = this.get('element');
- if (!el) { return; }
-
- var content = get(this, 'content'),
- selection = get(this, 'selection'),
- selectionIndex = content ? indexOf(content, selection) : -1,
- prompt = get(this, 'prompt');
-
- if (prompt) { selectionIndex += 1; }
- if (el) { el.selectedIndex = selectionIndex; }
- },
-
- _selectionDidChangeMultiple: function() {
- var content = get(this, 'content'),
- selection = get(this, 'selection'),
- selectedIndexes = content ? indexesOf(content, selection) : [-1],
- prompt = get(this, 'prompt'),
- offset = prompt ? 1 : 0,
- options = this.$('option'),
- adjusted;
-
- if (options) {
- options.each(function() {
- adjusted = this.index > -1 ? this.index + offset : -1;
- this.selected = indexOf(selectedIndexes, adjusted) > -1;
- });
- }
- },
-
- init: function() {
- this._super();
- this.on("didInsertElement", this, this._triggerChange);
- this.on("change", this, this._change);
- }
-});
-
-Ember.SelectOption = Ember.View.extend({
- tagName: 'option',
- attributeBindings: ['value', 'selected'],
-
- defaultTemplate: function(context, options) {
- options = { data: options.data, hash: {} };
- Ember.Handlebars.helpers.bind.call(context, "view.label", options);
- },
-
- init: function() {
- this.labelPathDidChange();
- this.valuePathDidChange();
-
- this._super();
- },
-
- selected: Ember.computed(function() {
- var content = get(this, 'content'),
- selection = get(this, 'parentView.selection');
- if (get(this, 'parentView.multiple')) {
- return selection && indexOf(selection, content) > -1;
- } else {
- // Primitives get passed through bindings as objects... since
- // `new Number(4) !== 4`, we use `==` below
- return content == selection;
- }
- }).property('content', 'parentView.selection').volatile(),
-
- labelPathDidChange: Ember.observer(function() {
- var labelPath = get(this, 'parentView.optionLabelPath');
-
- if (!labelPath) { return; }
-
- Ember.defineProperty(this, 'label', Ember.computed(function() {
- return get(this, labelPath);
- }).property(labelPath).cacheable());
- }, 'parentView.optionLabelPath'),
-
- valuePathDidChange: Ember.observer(function() {
- var valuePath = get(this, 'parentView.optionValuePath');
-
- if (!valuePath) { return; }
-
- Ember.defineProperty(this, 'value', Ember.computed(function() {
- return get(this, valuePath);
- }).property(valuePath).cacheable());
- }, 'parentView.optionValuePath')
-});
-
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-/*globals Handlebars */
-// Find templates stored in the head tag as script tags and make them available
-// to Ember.CoreView in the global Ember.TEMPLATES object. This will be run as as
-// jQuery DOM-ready callback.
-//
-// Script tags with "text/x-handlebars" will be compiled
-// with Ember's Handlebars and are suitable for use as a view's template.
-// Those with type="text/x-raw-handlebars" will be compiled with regular
-// Handlebars and are suitable for use in views' computed properties.
-Ember.Handlebars.bootstrap = function(ctx) {
- var selectors = 'script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';
-
- Ember.$(selectors, ctx)
- .each(function() {
- // Get a reference to the script tag
- var script = Ember.$(this),
- type = script.attr('type');
-
- var compile = (script.attr('type') === 'text/x-raw-handlebars') ?
- Ember.$.proxy(Handlebars.compile, Handlebars) :
- Ember.$.proxy(Ember.Handlebars.compile, Ember.Handlebars),
- // Get the name of the script, used by Ember.View's templateName property.
- // First look for data-template-name attribute, then fall back to its
- // id if no name is found.
- templateName = script.attr('data-template-name') || script.attr('id'),
- template = compile(script.html()),
- view, viewPath, elementId, options;
-
- if (templateName) {
- // For templates which have a name, we save them and then remove them from the DOM
- Ember.TEMPLATES[templateName] = template;
-
- // Remove script tag from DOM
- script.remove();
- } else {
- if (script.parents('head').length !== 0) {
- // don't allow inline templates in the head
- throw new Ember.Error("Template found in <head> without a name specified. " +
- "Please provide a data-template-name attribute.\n" +
- script.html());
- }
-
- // For templates which will be evaluated inline in the HTML document, instantiates a new
- // view, and replaces the script tag holding the template with the new
- // view's DOM representation.
- //
- // Users can optionally specify a custom view subclass to use by setting the
- // data-view attribute of the script tag.
- viewPath = script.attr('data-view');
- view = viewPath ? Ember.get(viewPath) : Ember.View;
-
- // Get the id of the script, used by Ember.View's elementId property,
- // Look for data-element-id attribute.
- elementId = script.attr('data-element-id');
-
- options = { template: template };
- if (elementId) { options.elementId = elementId; }
-
- view = view.create(options);
-
- view._insertElementLater(function() {
- script.replaceWith(this.$());
-
- // Avoid memory leak in IE
- script = null;
- });
- }
- });
-};
-
-/** @private */
-function bootstrap() {
- Ember.Handlebars.bootstrap( Ember.$(document) );
-}
-
-/*
- We tie this to application.load to ensure that we've at least
- attempted to bootstrap at the point that the application is loaded.
-
- We also tie this to document ready since we're guaranteed that all
- the inline templates are present at this point.
-
- There's no harm to running this twice, since we remove the templates
- from the DOM after processing.
-*/
-
-Ember.$(document).ready(bootstrap);
-Ember.onLoad('application', bootstrap);
-
-})();
-
-
-
-(function() {
-// ==========================================================================
-// Project: Ember Handlebars Views
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
-// Version: v1.0.pre
-// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
-
-
-(function() {
-// ==========================================================================
-// Project: Ember
-// Copyright: ©2011 Strobe Inc. and contributors.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-})();
-
diff --git a/src/components/HMI/lib/ember-1.0.pre.min.js b/src/components/HMI/lib/ember-1.0.pre.min.js
deleted file mode 100644
index 73375a7d56..0000000000
--- a/src/components/HMI/lib/ember-1.0.pre.min.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2011-2012 Tilde Inc. and contributors
-// Portions ©2006-2011 Strobe Inc.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-
-// Version: v1.0.pre
-// Last commit: 7955b85 (2012-08-03 14:50:17 -0700)
-
-
-(function(){"undefined"==typeof Ember&&(Ember={}),"undefined"!=typeof window&&(window.Em=window.Ember=Em=Ember),Ember.isNamespace=!0,Ember.toString=function(){return"Ember"},Ember.VERSION="1.0.pre",Ember.ENV=Ember.ENV||("undefined"==typeof ENV?{}:ENV),Ember.config=Ember.config||{},Ember.EXTEND_PROTOTYPES=Ember.ENV.EXTEND_PROTOTYPES!==!1,Ember.LOG_STACKTRACE_ON_DEPRECATION=Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION!==!1,Ember.SHIM_ES5=Ember.ENV.SHIM_ES5===!1?!1:Ember.EXTEND_PROTOTYPES,Ember.CP_DEFAULT_CACHEABLE=Ember.ENV.CP_DEFAULT_CACHEABLE!==!1,Ember.VIEW_PRESERVES_CONTEXT=Ember.ENV.VIEW_PRESERVES_CONTEXT!==!1,Ember.K=function(){return this},"undefined"==typeof Ember.assert&&(Ember.assert=Ember.K),"undefined"==typeof Ember.warn&&(Ember.warn=Ember.K),"undefined"==typeof Ember.deprecate&&(Ember.deprecate=Ember.K),"undefined"==typeof Ember.deprecateFunc&&(Ember.deprecateFunc=function(a,b){return b}),"undefined"==typeof ember_assert&&(window.ember_assert=Ember.K),"undefined"==typeof ember_warn&&(window.ember_warn=Ember.K),"undefined"==typeof ember_deprecate&&(window.ember_deprecate=Ember.K),"undefined"==typeof ember_deprecateFunc&&(window.ember_deprecateFunc=function(a,b){return b}),Ember.Logger=window.console||{log:Ember.K,warn:Ember.K,error:Ember.K,info:Ember.K,debug:Ember.K}})(),function(){var a=function(a){return a&&Function.prototype.toString.call(a).indexOf("[native code]")>-1},b=a(Array.prototype.map)?Array.prototype.map:function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;var d=new Array(c),e=arguments[1];for(var f=0;f<c;f++)f in b&&(d[f]=a.call(e,b[f],f,b));return d},c=a(Array.prototype.forEach)?Array.prototype.forEach:function(a){if(this===void 0||this===null)throw new TypeError;var b=Object(this),c=b.length>>>0;if(typeof a!="function")throw new TypeError;var d=arguments[1];for(var e=0;e<c;e++)e in b&&a.call(d,b[e],e,b)},d=a(Array.prototype.indexOf)?Array.prototype.indexOf:function(a,b){b===null||b===undefined?b=0:b<0&&(b=Math.max(0,this.length+b));for(var c=b,d=this.length;c<d;c++)if(this[c]===a)return c;return-1};Ember.ArrayPolyfills={map:b,forEach:c,indexOf:d};var e=Ember.EnumerableUtils={map:function(a,c,d){return a.map?a.map.call(a,c,d):b.call(a,c,d)},forEach:function(a,b,d){return a.forEach?a.forEach.call(a,b,d):c.call(a,b,d)},indexOf:function(a,b,c){return a.indexOf?a.indexOf.call(a,b,c):d.call(a,b,c)},indexesOf:function(a,b){return b===undefined?[]:e.map(b,function(b){return e.indexOf(a,b)})},removeObject:function(a,b){var c=e.indexOf(a,b);c!==-1&&a.splice(c,1)}};Ember.SHIM_ES5&&(Array.prototype.map||(Array.prototype.map=b),Array.prototype.forEach||(Array.prototype.forEach=c),Array.prototype.indexOf||(Array.prototype.indexOf=d))}(),function(){var a=Ember.platform={};Ember.create=Object.create;if(!Ember.create){var b=function(){};Ember.create=function(a,c){b.prototype=a,a=new b;if(c){b.prototype=a;for(var d in c)b.prototype[d]=c[d].value;a=new b}return b.prototype=null,a},Ember.create.isSimulated=!0}var c=Object.defineProperty,d,e;if(c)try{c({},"a",{get:function(){}})}catch(f){c=null}c&&(d=function(){var a={};return c(a,"a",{configurable:!0,enumerable:!0,get:function(){},set:function(){}}),c(a,"a",{configurable:!0,enumerable:!0,writable:!0,value:!0}),a.a===!0}(),e=function(){try{return c(document.createElement("div"),"definePropertyOnDOM",{}),!0}catch(a){}return!1}(),d?e||(c=function(a,b,c){var d;return typeof Node=="object"?d=a instanceof Node:d=typeof a=="object"&&typeof a.nodeType=="number"&&typeof a.nodeName=="string",d?a[b]=c.value:Object.defineProperty(a,b,c)}):c=null),a.defineProperty=c,a.hasPropertyAccessors=!0,a.defineProperty||(a.hasPropertyAccessors=!1,a.defineProperty=function(a,b,c){c.get||(a[b]=c.value)},a.defineProperty.isSimulated=!0),Ember.ENV.MANDATORY_SETTER&&!a.hasPropertyAccessors&&(Ember.ENV.MANDATORY_SETTER=!1)}(),function(){function m(a){this.descs={},this.watching={},this.cache={},this.source=a}function n(a,b){return!!a&&typeof a[b]=="function"}var a=Ember.platform.defineProperty,b=Ember.create,c="__ember"+ +(new Date),d=0,e=[],f={},g=Ember.ENV.MANDATORY_SETTER;Ember.GUID_KEY=c;var h={writable:!1,configurable:!1,enumerable:!1,value:null};Ember.generateGuid=function(e,f){f||(f="ember");var g=f+d++;return e&&(h.value=g,a(e,c,h)),g},Ember.guidFor=function(g){if(g===undefined)return"(undefined)";if(g===null)return"(null)";var i,j,k=typeof g;switch(k){case"number":return j=e[g],j||(j=e[g]="nu"+g),j;case"string":return j=f[g],j||(j=f[g]="st"+d++),j;case"boolean":return g?"(true)":"(false)";default:if(g[c])return g[c];if(g===Object)return"(Object)";if(g===Array)return"(Array)";return j="ember"+d++,h.value=j,a(g,c,h),j}};var i={writable:!0,configurable:!1,enumerable:!1,value:null},j=Ember.GUID_KEY+"_meta";Ember.META_KEY=j;var k={descs:{},watching:{}};g&&(k.values={}),Ember.EMPTY_META=k,Object.freeze&&Object.freeze(k);var l=Ember.platform.defineProperty.isSimulated;l&&(m.prototype.__preventPlainObject__=!0),Ember.meta=function(d,e){var f=d[j];return e===!1?f||k:(f?f.source!==d&&(l||a(d,j,i),f=b(f),f.descs=b(f.descs),f.watching=b(f.watching),f.cache={},f.source=d,g&&(f.values=b(f.values)),d[j]=f):(l||a(d,j,i),f=new m(d),g&&(f.values={}),d[j]=f,f.descs.constructor=null),f)},Ember.getMeta=function(b,c){var d=Ember.meta(b,!1);return d[c]},Ember.setMeta=function(b,c,d){var e=Ember.meta(b,!0);return e[c]=d,d},Ember.metaPath=function(c,d,e){var f=Ember.meta(c,e),g,h;for(var i=0,j=d.length;i<j;i++){g=d[i],h=f[g];if(!h){if(!e)return undefined;h=f[g]={__ember_source__:c}}else if(h.__ember_source__!==c){if(!e)return undefined;h=f[g]=b(h),h.__ember_source__=c}f=h}return h},Ember.wrap=function(a,b){function c(){}var d=function(){var d,e=this._super;return this._super=b||c,d=a.apply(this,arguments),this._super=e,d};return d.base=a,d},Ember.isArray=function(a){return!a||a.setInterval?!1:Array.isArray&&Array.isArray(a)?!0:Ember.Array&&Ember.Array.detect(a)?!0:a.length!==undefined&&"object"==typeof a?!0:!1},Ember.makeArray=function(a){return a===null||a===undefined?[]:Ember.isArray(a)?a:[a]},Ember.canInvoke=n,Ember.tryInvoke=function(a,b,c){if(n(a,b))return a[b].apply(a,c)}}(),function(){var a=Ember.guidFor,b=Ember.ArrayPolyfills.indexOf,c=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},d=function(a,b){var d=a.keys.copy(),e=c(a.values);return b.keys=d,b.values=e,b},e=Ember.OrderedSet=function(){this.clear()};e.create=function(){return new e},e.prototype={clear:function(){this.presenceSet={},this.list=[]},add:function(b){var c=a(b),d=this.presenceSet,e=this.list;if(c in d)return;d[c]=!0,e.push(b)},remove:function(c){var d=a(c),e=this.presenceSet,f=this.list;delete e[d];var g=b.call(f,c);g>-1&&f.splice(g,1)},isEmpty:function(){return this.list.length===0},forEach:function(a,b){var c=this.list.slice();for(var d=0,e=c.length;d<e;d++)a.call(b,c[d])},toArray:function(){return this.list.slice()},copy:function(){var a=new e;return a.presenceSet=c(this.presenceSet),a.list=this.list.slice(),a}};var f=Ember.Map=function(){this.keys=Ember.OrderedSet.create(),this.values={}};f.create=function(){return new f},f.prototype={get:function(b){var c=this.values,d=a(b);return c[d]},set:function(b,c){var d=this.keys,e=this.values,f=a(b);d.add(b),e[f]=c},remove:function(b){var c=this.keys,d=this.values,e=a(b),f;return d.hasOwnProperty(e)?(c.remove(b),f=d[e],delete d[e],!0):!1},has:function(b){var c=this.values,d=a(b);return c.hasOwnProperty(d)},forEach:function(b,c){var d=this.keys,e=this.values;d.forEach(function(d){var f=a(d);b.call(c,d,e[f])})},copy:function(){return d(this,new f)}};var g=Ember.MapWithDefault=function(a){f.call(this),this.defaultValue=a.defaultValue};g.create=function(a){return a?new g(a):new f},g.prototype=Ember.create(f.prototype),g.prototype.get=function(a){var b=this.has(a);if(b)return f.prototype.get.call(this,a);var c=this.defaultValue(a);return this.set(a,c),c},g.prototype.copy=function(){return d(this,new g({defaultValue:this.defaultValue}))}}(),function(){function i(a){return a.match(h)[0]}function j(a,c){var d=g.test(c),e=!d&&f.test(c),h;if(!a||e)a=window;d&&(c=c.slice(5)),a===window&&(h=i(c),a=b(a,h),c=c.slice(h.length+1));if(!c||c.length===0)throw new Error("Invalid Path");return[a,c]}function k(a,c){var d,e,f,h,i;if(a===null&&c.indexOf(".")===-1)return b(window,c);d=g.test(c);if(!a||d)f=j(a,c),a=f[0],c=f[1],f.length=0;e=c.split("."),i=e.length;for(h=0;a&&h<i;h++){a=b(a,e[h],!0);if(a&&a.isDestroyed)return undefined}return a}function l(a,b,d,e){var f;f=b.slice(b.lastIndexOf(".")+1),b=b.slice(0,b.length-(f.length+1)),b!=="this"&&(a=k(a,b));if(!f||f.length===0)throw new Error("You passed an empty path");if(!a){if(e)return;throw new Error("Object in path "+b+" could not be found or was destroyed.")}return c(a,f,d)}var a=Ember.META_KEY,b,c,d=Ember.ENV.MANDATORY_SETTER,e=/^([A-Z$]|([0-9][A-Z$]))/,f=/^([A-Z$]|([0-9][A-Z$])).*[\.\*]/,g=/^this[\.\*]/,h=/^([^\.\*]+)/;b=function(c,e){if(e==="")return c;!e&&"string"==typeof c&&(e=c,c=null);if(!c||e.indexOf(".")!==-1)return k(c,e);var f=c[a],g=f&&f.descs[e],h;return g?g.get(c,e):(d&&f&&f.watching[e]>0?h=f.values[e]:h=c[e],h!==undefined||"object"!=typeof c||e in c||"function"!=typeof c.unknownProperty?h:c.unknownProperty(e))},c=function(c,e,f,g){typeof c=="string"&&(f=e,e=c,c=null);if(!c||e.indexOf(".")!==-1)return l(c,e,f,g);var h=c[a],i=h&&h.descs[e],j,k;return i?i.set(c,e,f):(j="object"==typeof c&&!(e in c),j&&"function"==typeof c.setUnknownProperty?c.setUnknownProperty(e,f):h&&h.watching[e]>0?(d?k=h.values[e]:k=c[e],f!==k&&(Ember.propertyWillChange(c,e),d?k!==undefined||e in c?h.values[e]=f:Ember.defineProperty(c,e,null,f):c[e]=f,Ember.propertyDidChange(c,e))):c[e]=f),f},Ember.normalizeTuple=function(a,b){return j(a,b)},Ember.getWithDefault=function(a,c,d){var e=b(a,c);return e===undefined?d:e},Ember.get=b,Ember.getPath=Ember.deprecateFunc("getPath is deprecated since get now supports paths",Ember.get),Ember.set=c,Ember.setPath=Ember.deprecateFunc("setPath is deprecated since set now supports paths",Ember.set),Ember.trySet=function(a,b,d){return c(a,b,d,!0)},Ember.trySetPath=Ember.deprecateFunc("trySetPath has been renamed to trySet",Ember.trySet),Ember.isGlobalPath=function(a){return e.test(a)},Ember.config.overrideAccessors&&(Ember.config.overrideAccessors(),b=Ember.get,c=Ember.set)}(),function(){var a=Ember.GUID_KEY,b=Ember.META_KEY,c=Ember.EMPTY_META,d=Ember.meta,e=Ember.create,f=Ember.platform.defineProperty,g=Ember.ENV.MANDATORY_SETTER,h=Ember.Descriptor=function(){};Ember.defineProperty=function(a,c,e,h,i){var j,k,l,m;return i||(i=d(a)),j=i.descs,k=i.descs[c],l=i.watching[c]>0,k instanceof Ember.Descriptor&&k.teardown(a,c),e instanceof Ember.Descriptor?(m=e,j[c]=e,g&&l?f(a,c,{configurable:!0,enumerable:!0,writable:!0,value:undefined}):a[c]=undefined,e.setup(a,c)):(j[c]=undefined,e==null?(m=h,g&&l?(i.values[c]=h,f(a,c,{configurable:!0,enumerable:!0,set:function(){},get:function(){var a=this[b];return a&&a.values[c]}})):a[c]=h):(m=e,f(a,c,e))),l&&Ember.overrideChains(a,c,i),a.didDefineProperty&&a.didDefineProperty(a,c,m),this}}(),function(){function j(a,b,c,e){d&&!e?h.push(a,b,c):Ember.sendEvent(a,b,[a,c])}function k(){i.clear(),h.flush()}function l(b){return b+a}function m(a){return a+b}var a=":change",b=":before",c=Ember.guidFor,d=0,e=[].slice,f=function(){this.targetSet={}};f.prototype.add=function(a,b){var c=this.targetSet,d=Ember.guidFor(a),e=c[d];return e||(c[d]=e={}),e[b]?!1:e[b]=!0},f.prototype.clear=function(){this.targetSet={}};var g=function(){this.targetSet={},this.queue=[]};g.prototype.push=function(a,b,c){var d=this.targetSet,e=this.queue,f=Ember.guidFor(a),g=d[f],h;g||(d[f]=g={}),h=g[b],h===undefined?g[b]=e.push(Ember.deferEvent(a,b,[a,c]))-1:e[h]=Ember.deferEvent(a,b,[a,c])},g.prototype.flush=function(){var a=this.queue;this.queue=[],this.targetSet={};for(var b=0,c=a.length;b<c;++b)a[b]()};var h=new g,i=new f;Ember.beginPropertyChanges=function(){return d++,this},Ember.endPropertyChanges=function(){d--,d<=0&&k()},Ember.changeProperties=function(a,b){Ember.beginPropertyChanges();try{a.call(b)}finally{Ember.endPropertyChanges()}},Ember.setProperties=function(a,b){return Ember.changeProperties(function(){for(var c in b)b.hasOwnProperty(c)&&Ember.set(a,c,b[c])}),a},Ember.addObserver=function(a,b,c,d){return Ember.addListener(a,l(b),c,d),Ember.watch(a,b),this},Ember.observersFor=function(a,b){return Ember.listenersFor(a,l(b))},Ember.removeObserver=function(a,b,c,d){return Ember.unwatch(a,b),Ember.removeListener(a,l(b),c,d),this},Ember.addBeforeObserver=function(a,b,c,d){return Ember.addListener(a,m(b),c,d),Ember.watch(a,b),this},Ember._suspendBeforeObserver=function(a,b,c,d,e){return Ember._suspendListener(a,m(b),c,d,e)},Ember._suspendObserver=function(a,b,c,d,e){return Ember._suspendListener(a,l(b),c,d,e)},Ember.beforeObserversFor=function(a,b){return Ember.listenersFor(a,m(b))},Ember.removeBeforeObserver=function(a,b,c,d){return Ember.unwatch(a,b),Ember.removeListener(a,m(b),c,d),this},Ember.notifyObservers=function(a,b){if(a.isDestroying)return;j(a,l(b),b)},Ember.notifyBeforeObservers=function(a,b){if(a.isDestroying)return;var c,e,f=!1;if(d){if(!i.add(a,b))return;f=!0}j(a,m(b),b,f)}}(),function(){function n(a){return a.match(j)[0]}function o(a){return a==="*"||!k.test(a)}function q(b,c,d,e,f){var g=a(c);e[g]||(e[g]={});if(e[g][d])return;e[g][d]=!0;var h=f.deps;h=h&&h[d];if(h)for(var i in h){if(p[i])continue;b(c,i)}}function t(a,b,c){if(a.isDestroying)return;var d=r,e=!d;e&&(d=r={}),q(G,a,b,d,c),e&&(r=null)}function u(a,b,c){if(a.isDestroying)return;var d=s,e=!d;e&&(d=s={}),q(H,a,b,d,c),e&&(s=null)}function v(c,d,e){if(!c||"object"!=typeof c)return;var f=b(c),g=f.chainWatchers;if(!g||g.__emberproto__!==c)g=f.chainWatchers={__emberproto__:c};g[d]||(g[d]={}),g[d][a(e)]=e,Ember.watch(c,d)}function w(c,d,e){if(!c||"object"!=typeof c)return;var f=b(c,!1),g=f.chainWatchers;if(!g||g.__emberproto__!==c)return;g[d]&&delete g[d][a(e)],Ember.unwatch(c,d)}function y(){if(x.length===0)return;var a=x;x=[],i.call(a,function(a){a[0].add(a[1])})}function z(a){return b(a,!1).proto===a}function C(a){var c=b(a),d=c.chains;return d?d.value()!==a&&(d=c.chains=d.copy(a)):d=c.chains=new A(null,null,a),d}function D(a,b,c,d,e){var f=b.chainWatchers;if(!f||f.__emberproto__!==a)return;f=f[c];if(!f)return;for(var g in f){if(!f.hasOwnProperty(g))continue;f[g][d](e)}}function E(a,b,c){D(a,c,b,"willChange")}function F(a,b,c){D(a,c,b,"didChange")}function G(a,c,d){var e=b(a,!1),f=e.watching[c]>0||c==="length",g=e.proto,h=e.descs[c];if(!f)return;if(g===a)return;h&&h.willChange&&h.willChange(a,c),t(a,c,e),E(a,c,e),Ember.notifyBeforeObservers(a,c)}function H(a,c){var d=b(a,!1),e=d.watching[c]>0||c==="length",f=d.proto,g=d.descs[c];if(f===a)return;g&&g.didChange&&g.didChange(a,c);if(!e&&c!=="length")return;u(a,c,d),F(a,c,d),Ember.notifyObservers(a,c)}var a=Ember.guidFor,b=Ember.meta,c=Ember.get,d=Ember.set,e=Ember.normalizeTuple,f=Ember.GUID_KEY,g=Ember.META_KEY,h=Ember.notifyObservers,i=Ember.ArrayPolyfills.forEach,j=/^([^\.\*]+)/,k=/[\.\*]/,l=Ember.ENV.MANDATORY_SETTER,m=Ember.platform.defineProperty,p={__emberproto__:!0},r,s,x=[],A=function(a,b,c,d){var e;this._parent=a,this._key=b,this._watching=c===undefined,this._value=c,this._separator=d||".",this._paths={},this._watching&&(this._object=a.value(),this._object&&v(this._object,this._key,this)),this._parent&&this._parent._key==="@each"&&this.value()},B=A.prototype;B.value=function(){if(this._value===undefined&&this._watching){var a=this._parent.value();this._value=a&&!z(a)?c(a,this._key):undefined}return this._value},B.destroy=function(){if(this._watching){var a=this._object;a&&w(a,this._key,this),this._watching=!1}},B.copy=function(a){var b=new A(null,null,a,this._separator),c=this._paths,d;for(d in c){if(c[d]<=0)continue;b.add(d)}return b},B.add=function(a){var b,c,d,f,g,h;h=this._paths,h[a]=(h[a]||0)+1,b=this.value(),c=e(b,a);if(c[0]&&c[0]===b)a=c[1],d=n(a),a=a.slice(d.length+1);else{if(!c[0]){x.push([this,a]),c.length=0;return}f=c[0],d=a.slice(0,0-(c[1].length+1)),g=a.slice(d.length,d.length+1),a=c[1]}c.length=0,this.chain(d,a,f,g)},B.remove=function(a){var b,c,d,f,g;g=this._paths,g[a]>0&&g[a]--,b=this.value(),c=e(b,a),c[0]===b?(a=c[1],d=n(a),a=a.slice(d.length+1)):(f=c[0],d=a.slice(0,0-(c[1].length+1)),a=c[1]),c.length=0,this.unchain(d,a)},B.count=0,B.chain=function(a,b,c,d){var e=this._chains,f;e||(e=this._chains={}),f=e[a],f||(f=e[a]=new A(this,a,c,d)),f.count++,b&&b.length>0&&(a=n(b),b=b.slice(a.length+1),f.chain(a,b))},B.unchain=function(a,b){var c=this._chains,d=c[a];b&&b.length>1&&(a=n(b),b=b.slice(a.length+1),d.unchain(a,b)),d.count--,d.count<=0&&(delete c[d._key],d.destroy())},B.willChange=function(){var a=this._chains;if(a)for(var b in a){if(!a.hasOwnProperty(b))continue;a[b].willChange()}this._parent&&this._parent.chainWillChange(this,this._key,1)},B.chainWillChange=function(a,b,c){this._key&&(b=this._key+this._separator+b),this._parent?this._parent.chainWillChange(this,b,c+1):(c>1&&Ember.propertyWillChange(this.value(),b),b="this."+b,this._paths[b]>0&&Ember.propertyWillChange(this.value(),b))},B.chainDidChange=function(a,b,c){this._key&&(b=this._key+this._separator+b),this._parent?this._parent.chainDidChange(this,b,c+1):(c>1&&Ember.propertyDidChange(this.value(),b),b="this."+b,this._paths[b]>0&&Ember.propertyDidChange(this.value(),b))},B.didChange=function(a){if(this._watching){var b=this._parent.value();b!==this._object&&(w(this._object,this._key,this),this._object=b,v(b,this._key,this)),this._value=undefined,this._parent&&this._parent._key==="@each"&&this.value()}var c=this._chains;if(c)for(var d in c){if(!c.hasOwnProperty(d))continue;c[d].didChange(a)}if(a)return;this._parent&&this._parent.chainDidChange(this,this._key,1)},Ember.overrideChains=function(a,b,c){D(a,c,b,"didChange",!0)},Ember.watch=function(a,c){if(c==="length"&&Ember.typeOf(a)==="array")return this;var d=b(a),e=d.watching,f;return e[c]?e[c]=(e[c]||0)+1:(e[c]=1,o(c)?(f=d.descs[c],f&&f.willWatch&&f.willWatch(a,c),"function"==typeof a.willWatchProperty&&a.willWatchProperty(c),l&&c in a&&(d.values[c]=a[c],m(a,c,{configurable:!0,enumerable:!0,set:function(){},get:function(){var a=this[g];return a&&a.values[c]}}))):C(a).add(c)),this},Ember.isWatching=function(b,c){var d=b[g];return(d&&d.watching[c])>0},Ember.watch.flushPending=y,Ember.unwatch=function(a,c){if(c==="length"&&Ember.typeOf(a)==="array")return this;var d=b(a),e=d.watching,f;return e[c]===1?(e[c]=0,o(c)?(f=d.descs[c],f&&f.didUnwatch&&f.didUnwatch(a,c),"function"==typeof a.didUnwatchProperty&&a.didUnwatchProperty(c),l&&c in a&&(m(a,c,{configurable:!0,enumerable:!0,writable:!0,value:d.values[c]}),delete d.values[c])):C(a).remove(c)):e[c]>1&&e[c]--,this},Ember.rewatch=function(a){var c=b(a,!1),d=c.chains;return f in a&&!a.hasOwnProperty(f)&&Ember.generateGuid(a,"ember"),d&&d.value()!==a&&(c.chains=d.copy(a)),this},Ember.finishChains=function(a){var c=b(a,!1),d=c.chains;d&&(d.value()!==a&&(c.chains=d=d.copy(a)),d.didChange(!0))},Ember.propertyWillChange=G,Ember.propertyDidChange=H;var I=[];Ember.destroy=function(a){var b=a[g],c,d,e,f;if(b){a[g]=null,c=b.chains;if(c){I.push(c);while(I.length>0){c=I.pop(),d=c._chains;if(d)for(e in d)d.hasOwnProperty(e)&&I.push(d[e]);c._watching&&(f=c._object,f&&w(f,c._key,c))}}}}}(),function(){function i(a,b,c){var d=b[c];return d?d.__emberproto__!==a&&(d=b[c]=e(d),d.__emberproto__=a):d=b[c]={__emberproto__:a},d}function j(a,b){var c=b.deps;return c?c.__emberproto__!==a&&(c=b.deps=e(c),c.__emberproto__=a):c=b.deps={__emberproto__:a},c}function k(a,b,c,d){var e=a._dependentKeys,f,h,k,l,m;if(!e)return;f=j(b,d);for(h=0,k=e.length;h<k;h++)l=e[h],m=i(b,f,l),m[c]=(m[c]||0)+1,g(b,l)}function l(a,b,c,d){var e=a._dependentKeys,f,g,k,l,m;if(!e)return;f=j(b,d);for(g=0,k=e.length;g<k;g++)l=e[g],m=i(b,f,l),m[c]=(m[c]||0)-1,h(b,l)}function m(a,b){this.func=a,this._cacheable=b&&b.cacheable!==undefined?b.cacheable:Ember.CP_DEFAULT_CACHEABLE,this._dependentKeys=b&&b.dependentKeys}var a=Ember.get,b=Ember.meta,c=Ember.guidFor,d=[].slice,e=Ember.create,f=Ember.META_KEY,g=Ember.watch,h=Ember.unwatch;Ember.ComputedProperty=m,m.prototype=new Ember.Descriptor;var n=m.prototype;n.cacheable=function(a){return this._cacheable=a!==!1,this},n.volatile=function(){return this.cacheable(!1)},n.property=function(){var a=[];for(var b=0,c=arguments.length;b<c;b++)a.push(arguments[b]);return this._dependentKeys=a,this},n.meta=function(a){return arguments.length===0?this._meta||{}:(this._meta=a,this)},n.willWatch=function(a,b){var c=a[f];b in c.cache||k(this,a,b,c)},n.didUnwatch=function(a,b){var c=a[f];b in c.cache||l(this,a,b,c)},n.didChange=function(a,c){if(this._cacheable&&this._suspended!==a){var d=b(a);c in d.cache&&(delete d.cache[c],d.watching[c]||l(this,a,c,d))}},n.get=function(a,c){var d,e,f;if(this._cacheable){f=b(a),e=f.cache;if(c in e)return e[c];d=e[c]=this.func.call(a,c),f.watching[c]||k(this,a,c,f)}else d=this.func.call(a,c);return d},n.set=function(a,c,d){var e=this._cacheable,f=b(a,e),g=f.watching[c],h=this._suspended,i,j;return this._suspended=a,g&&Ember.propertyWillChange(a,c),e&&c in f.cache&&(delete f.cache[c],i=!0),j=this.func.call(a,c,d),e&&(!g&&!i&&k(this,a,c,f),f.cache[c]=j),g&&Ember.propertyDidChange(a,c),this._suspended=h,j},n.setup=function(a,c){var d=a[f];d&&d.watching[c]&&k(this,a,c,b(a))},n.teardown=function(a,c){var d=b(a);return(d.watching[c]||c in d.cache)&&l(this,a,c,d),this._cacheable&&delete d.cache[c],null},Ember.computed=function(a){var b;arguments.length>1&&(b=d.call(arguments,0,-1),a=d.call(arguments,-1)[0]);var c=new m(a);return b&&c.property.apply(c,b),c},Ember.cacheFor=function(c,d){var e=b(c,!1).cache;if(e&&d in e)return e[d]},Ember.computed.not=function(b){return Ember.computed(b,function(c){return!a(this,b)}).cacheable()},Ember.computed.empty=function(b){return Ember.computed(b,function(c){var d=a(this,b);return d===undefined||d===null||d===""||Ember.isArray(d)&&a(d,"length")===0}).cacheable()},Ember.computed.bool=function(b){return Ember.computed(b,function(c){return!!a(this,b)}).cacheable()}}(),function(){function f(a,b,e,f){return c(a,["listeners",b,d(e)],f)}function g(a,c){var d=b(a,!1).listeners;return d?d[c]||!1:!1}function i(a,b,c,d){var e=g(a,b);if(!e)return!1;for(var f in e){if(h[f])continue;var i=e[f];if(i)for(var j in i){if(h[j])continue;var k=i[j];if(k&&c(k,d,a)===!0)return!0}}return!1}function j(a,b,c){var d=a.method,e=a.target;e||(e=c),"string"==typeof d&&(d=e[d]),b?d.apply(e,b):d.apply(e)}function k(a,b,c,e){!e&&"function"==typeof c&&(e=c,c=null);var g=f(a,b,c,!0),h=d(e);g[h]||(g[h]={target:c,method:e}),"function"==typeof a.didAddListener&&a.didAddListener(b,c,e)}function l(a,b,c,e){!e&&"function"==typeof c&&(e=c,c=null);var g=f(a,b,c,!0),h=d(e);g&&g[h]&&(g[h]=null),"function"==typeof a.didRemoveListener&&a.didRemoveListener(b,c,e)}function m(a,b,c,e,g){!e&&"function"==typeof c&&(e=c,c=null);var h=f(a,b,c,!0),i=d(e),j=h&&h[i];h[i]=null;try{return g.call(c)}finally{h[i]=j}}function n(a){var c=b(a,!1).listeners,d=[];if(c)for(var e in c)!h[e]&&c[e]&&d.push(e);return d}function o(a,b,c){return a!==Ember&&"function"==typeof a.sendEvent&&a.sendEvent(b,c),i(a,b,j,c),!0}function p(a,b,c){var d=[];return i(a,b,function(a){d.push(a)}),function(){if(a.isDestroyed)return;a!==Ember&&"function"==typeof a.sendEvent&&a.sendEvent(b,c);for(var e=0,f=d.length;e<f;++e)j(d[e],c,a)}}function q(a,b){if(i(a,b,function(){return!0}))return!0;var d=c(a,["listeners"],!0);return d[b]=null,!1}function r(a,b){var c=[];return i(a,b,function(a){c.push([a.target,a.method])}),c}var a=Ember.create,b=Ember.meta,c=Ember.metaPath,d=Ember.guidFor,e=[].slice,h={__ember_source__:!0};Ember.addListener=k,Ember.removeListener=l,Ember._suspendListener=m,Ember.sendEvent=o,Ember.hasListeners=q,Ember.watchedEvents=n,Ember.listenersFor=r,Ember.deferEvent=p}(),function(){function c(b,c,d,e){c===undefined&&(c=b,b=undefined),"string"==typeof c&&(c=b[c]),d&&e>0&&(d=d.length>e?a.call(d,e):null);if("function"!=typeof Ember.onerror)return c.apply(b||this,d||[]);try{return c.apply(b||this,d||[])}catch(f){Ember.onerror(f)}}function h(){g=null,f.currentRunLoop&&f.end()}function k(){j=null;var a=+(new Date),b=-1;for(var d in i){if(!i.hasOwnProperty(d))continue;var e=i[d];if(e&&e.expires)if(a>=e.expires)delete i[d],c(e.target,e.method,e.args,2);else if(b<0||e.expires<b)b=e.expires}b>0&&(j=setTimeout(k,b- +(new Date)))}function l(a,b){b[this.tguid]&&delete b[this.tguid][this.mguid],i[a]&&c(this.target,this.method,this.args,2),delete i[a]}function n(){m=null;for(var a in i){if(!i.hasOwnProperty(a))continue;var b=i[a];b.next&&(delete i[a],c(b.target,b.method,b.args,2))}}var a=[].slice,b=Ember.ArrayPolyfills.forEach,d,e=function(a){this._prev=a||null,this.onceTimers={}};e.prototype={end:function(){this.flush()},prev:function(){return this._prev},schedule:function(b,c,d){var e=this._queues,f;e||(e=this._queues={}),f=e[b],f||(f=e[b]=[]);var g=arguments.length>3?a.call(arguments,3):null;return f.push({target:c,method:d,args:g}),this},flush:function(a){function j(a){c(a.target,a.method,a.args)}var e,f,g,h,i;if(!this._queues)return this;Ember.watch.flushPending();if(a)while(this._queues&&(h=this._queues[a])){this._queues[a]=null;if(a==="sync"){i=Ember.LOG_BINDINGS,i&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges();try{b.call(h,j)}finally{Ember.endPropertyChanges()}i&&Ember.Logger.log("End: Flush Sync Queue")}else b.call(h,j)}else{e=Ember.run.queues,g=e.length,f=0;a:while(f<g){a=e[f],h=this._queues&&this._queues[a],delete this._queues[a];if(h)if(a==="sync"){i=Ember.LOG_BINDINGS,i&&Ember.Logger.log("Begin: Flush Sync Queue"),Ember.beginPropertyChanges();try{b.call(h,j)}finally{Ember.endPropertyChanges()}i&&Ember.Logger.log("End: Flush Sync Queue")}else b.call(h,j);for(var k=0;k<=f;k++)if(this._queues&&this._queues[e[k]]){f=k;continue a}f++}}return d=null,this}},Ember.RunLoop=e,Ember.run=function(a,b){var d,e;f.begin();try{if(a||b)d=c(a,b,arguments,2)}finally{f.end()}return d};var f=Ember.run;Ember.run.begin=function(){f.currentRunLoop=new e(f.currentRunLoop)},Ember.run.end=function(){try{f.currentRunLoop.end()}finally{f.currentRunLoop=f.currentRunLoop.prev()}},Ember.run.queues=["sync","actions","destroy","timers"],Ember.run.schedule=function(a,b,c){var d=f.autorun();d.schedule.apply(d,arguments)};var g;Ember.run.hasScheduledTimers=function(){return!!(g||j||m)},Ember.run.cancelTimers=function(){g&&(clearTimeout(g),g=null),j&&(clearTimeout(j),j=null),m&&(clearTimeout(m),m=null),i={}},Ember.run.autorun=function(){return f.currentRunLoop||(f.begin(),g||(g=setTimeout(h,1))),f.currentRunLoop},Ember.run.sync=function(){f.autorun(),f.currentRunLoop.flush("sync")};var i={},j;Ember.run.later=function(b,c){var d,e,g,h,j;return arguments.length===2&&"function"==typeof b?(j=c,c=b,b=undefined,d=[b,c]):(d=a.call(arguments),j=d.pop()),e=+(new Date)+j,g={target:b,method:c,expires:e,args:d},h=Ember.guidFor(g),i[h]=g,f.once(i,k),h},Ember.run.once=function(b,c){var d=Ember.guidFor(b),e=Ember.guidFor(c),g=f.autorun().onceTimers,h=g[d]&&g[d][e],j;return h&&i[h]?i[h].args=a.call(arguments):(j={target:b,method:c,args:a.call(arguments),tguid:d,mguid:e},h=Ember.guidFor(j),i[h]=j,g[d]||(g[d]={}),g[d][e]=h,f.schedule("actions",j,l,h,g)),h};var m;Ember.run.next=function(b,c){var d,e={target:b,method:c,args:a.call(arguments),next:!0};return d=Ember.guidFor(e),i[d]=e,m||(m=setTimeout(n,1)),d},Ember.run.cancel=function(a){delete i[a]}}(),function(){function e(b,c){return a(d(c)?window:b,c)}function g(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}Ember.LOG_BINDINGS=!!Ember.ENV.LOG_BINDINGS;var a=Ember.get,b=Ember.set,c=Ember.guidFor,d=Ember.isGlobalPath,f=function(a,b){this._direction="fwd",this._from=b,this._to=a,this._directionMap=Ember.Map.create()};f.prototype={copy:function(){var a=new f(this._to,this._from);return this._oneWay&&(a._oneWay=!0),a},from:function(a){return this._from=a,this},to:function(a){return this._to=a,this},oneWay:function(){return this._oneWay=!0,this},toString:function(){var a=this._oneWay?"[oneWay]":"";return"Ember.Binding<"+c(this)+">("+this._from+" -> "+this._to+")"+a},connect:function(a){var b=this._from,c=this._to;return Ember.trySet(a,c,e(a,b)),Ember.addObserver(a,b,this,this.fromDidChange),this._oneWay||Ember.addObserver(a,c,this,this.toDidChange),this._readyToSync=!0,this},disconnect:function(a){var b=!this._oneWay;return Ember.removeObserver(a,this._from,this,this.fromDidChange),b&&Ember.removeObserver(a,this._to,this,this.toDidChange),this._readyToSync=!1,this},fromDidChange:function(a){this._scheduleSync(a,"fwd")},toDidChange:function(a){this._scheduleSync(a,"back")},_scheduleSync:function(a,b){var c=this._directionMap,d=c.get(a);d||(Ember.run.schedule("sync",this,this._sync,a),c.set(a,b)),d==="back"&&b==="fwd"&&c.set(a,"fwd")},_sync:function(b){var c=Ember.LOG_BINDINGS;if(b.isDestroyed||!this._readyToSync)return;var d=this._directionMap,f=d.get(b),g=this._from,h=this._to;d.remove(b);if(f==="fwd"){var i=e(b,this._from);c&&Ember.Logger.log(" ",this.toString(),"->",i,b),this._oneWay?Ember.trySet(b,h,i):Ember._suspendObserver(b,h,this,this.toDidChange,function(){Ember.trySet(b,h,i)})}else if(f==="back"){var j=a(b,this._to);c&&Ember.Logger.log(" ",this.toString(),"<-",j,b),Ember._suspendObserver(b,g,this,this.fromDidChange,function(){Ember.trySet(Ember.isGlobalPath(g)?window:b,g,j)})}}},g(f,{from:function(){var a=this,b=new a;return b.from.apply(b,arguments)},to:function(){var a=this,b=new a;return b.to.apply(b,arguments)},oneWay:function(a,b){var c=this,d=new c(null,a);return d.oneWay(b)}}),Ember.Binding=f,Ember.bind=function(a,b,c){return(new Ember.Binding(b,c)).connect(a)},Ember.oneWay=function(a,b,c){return(new Ember.Binding(b,c)).oneWay().connect(a)}}(),function(){function o(a){var b=Ember.meta(a,!0),c=b.mixins;return c?c.__emberproto__!==a&&(c=b.mixins=l(c),c.__emberproto__=a):c=b.mixins={__emberproto__:a},c}function p(b,c){return c&&c.length>0&&(b.mixins=f.call(c,function(b){if(b instanceof a)return b;var c=new a;return c.properties=b,c})),b}function q(a){return"function"==typeof a&&a.isMethod!==!1&&a!==Boolean&&a!==Object&&a!==Number&&a!==Array&&a!==Date&&a!==String}function r(c,d,e,f,i){function v(a){delete e[a],delete f[a]}var j=c.length,k,l,m,o,p,s,t,u;for(k=0;k<j;k++){l=c[k];if(l instanceof a){m=n(l);if(d[m])continue;d[m]=l,o=l.properties}else o=l;if(o){u=f.concatenatedProperties||i.concatenatedProperties,o.concatenatedProperties&&(u=u?u.concat(o.concatenatedProperties):o.concatenatedProperties);for(s in o){if(!o.hasOwnProperty(s))continue;p=o[s];if(p instanceof Ember.Descriptor){if(p===b&&e[s])continue;e[s]=p,f[s]=undefined}else{if(q(p)){t=e[s]===undefined&&f[s],t||(t=i[s]),"function"!=typeof t&&(t=null);if(t){var w=p.__ember_observes__,x=p.__ember_observesBefore__;p=Ember.wrap(p,t),p.__ember_observes__=w,p.__ember_observesBefore__=x}}else if(u&&g.call(u,s)>=0||s==="concatenatedProperties"){var y=f[s]||i[s];p=y?y.concat(p):Ember.makeArray(p)}e[s]=undefined,f[s]=p}}o.hasOwnProperty("toString")&&(i.toString=o.toString)}else l.mixins&&(r(l.mixins,d,e,f,i),l._without&&h.call(l._without,v))}}function s(a){var b=Ember.meta(a),c=b.required;if(!c||c.__emberproto__!==a)c=b.required=c?l(c):{__ember_count__:0},c.__emberproto__=a;return c}function u(a,b,c,d){if(t.test(b)){var e=d.bindings;e?e.__emberproto__!==a&&(e=d.bindings=l(d.bindings),e.__emberproto__=a):e=d.bindings={__emberproto__:a},e[b]=c}}function v(a,b){var c=b.bindings,d,e,f;if(c){for(d in c)e=d!=="__emberproto__"&&c[d],e&&(f=d.slice(0,-7),e instanceof Ember.Binding?(e=e.copy(),e.to(f)):e=new Ember.Binding(f,e),e.connect(a),a[d]=e);b.bindings={__emberproto__:a}}}function w(a,b){return v(a,b||Ember.meta(a)),a}function x(a,d,e){var f={},g={},h=Ember.meta(a),i=h.required,j,l,n,p,q,t,v;r(d,o(a),f,g,a);for(j in g){if(j==="contructor")continue;if(!g.hasOwnProperty(j))continue;n=f[j],l=g[j];if(n===b)j in a||(i=s(a),i.__ember_count__++,i[j]=!0);else{while(n&&n instanceof c){var x=n.methodName;f[x]||g[x]?(l=g[x],n=f[x]):h.descs[x]?(n=h.descs[x],l=undefined):(n=undefined,l=a[x])}if(n===undefined&&l===undefined)continue;p=a[j];if("function"==typeof p)if(q=p.__ember_observesBefore__){t=q.length;for(v=0;v<t;v++)Ember.removeBeforeObserver(a,q[v],null,j)}else if(q=p.__ember_observes__){t=q.length;for(v=0;v<t;v++)Ember.removeObserver(a,q[v],null,j)}u(a,j,l,h),m(a,j,n,l,h);if("function"==typeof l)if(q=l.__ember_observesBefore__){t=q.length;for(v=0;v<t;v++)Ember.addBeforeObserver(a,q[v],null,j)}else if(q=l.__ember_observes__){t=q.length;for(v=0;v<t;v++)Ember.addObserver(a,q[v],null,j)}i&&i[j]&&(i=s(a),i.__ember_count__--,i[j]=!1)}}e||w(a,h);if(!e&&i&&i.__ember_count__>0){var y=[];for(j in i){if(k[j])continue;y.push(j)}}return a
-}function z(a,b,c){var d=n(a);if(c[d])return!1;c[d]=!0;if(a===b)return!0;var e=a.mixins,f=e?e.length:0;while(--f>=0)if(z(e[f],b,c))return!0;return!1}function A(a,b,c){if(c[n(b)])return;c[n(b)]=!0;if(b.properties){var d=b.properties;for(var e in d)d.hasOwnProperty(e)&&(a[e]=!0)}else b.mixins&&h.call(b.mixins,function(b){A(a,b,c)})}function D(a,b,c){var e=a.length;for(var f in b){if(!b.hasOwnProperty||!b.hasOwnProperty(f))continue;var g=b[f];a[e]=f;if(g&&g.toString===d)g[B]=a.join(".");else if(g&&C(g,"isNamespace")){if(c[n(g)])continue;c[n(g)]=!0,D(a,g,c)}}a.length=e}function E(){var a=Ember.Namespace,b,c;if(a.PROCESSED)return;for(var d in window){if(d==="globalStorage"&&window.StorageList&&window.globalStorage instanceof window.StorageList)continue;if(window.hasOwnProperty&&!window.hasOwnProperty(d))continue;try{b=window[d],c=b&&C(b,"isNamespace")}catch(e){continue}c&&(b[B]=d)}}var a,b,c,d,e,f=Ember.ArrayPolyfills.map,g=Ember.ArrayPolyfills.indexOf,h=Ember.ArrayPolyfills.forEach,i=[].slice,j={},k={__emberproto__:!0,__ember_count__:!0},l=Ember.create,m=Ember.defineProperty,n=Ember.guidFor,t=Ember.IS_BINDING=/^.+Binding$/;Ember.mixin=function(a){var b=i.call(arguments,1);return x(a,b,!1),a},Ember.Mixin=function(){return p(this,arguments)},a=Ember.Mixin,a._apply=x,a.applyPartial=function(a){var b=i.call(arguments,1);return x(a,b,!0)},a.finishPartial=w,a.create=function(){d.processed=!1;var a=this;return p(new a,arguments)};var y=a.prototype;y.reopen=function(){var b,c;this.properties?(b=a.create(),b.properties=this.properties,delete this.properties,this.mixins=[b]):this.mixins||(this.mixins=[]);var d=arguments.length,e=this.mixins,f;for(f=0;f<d;f++)b=arguments[f],b instanceof a?e.push(b):(c=a.create(),c.properties=b,e.push(c));return this},y.apply=function(a){return x(a,[this],!1)},y.applyPartial=function(a){return x(a,[this],!0)},y.detect=function(b){if(!b)return!1;if(b instanceof a)return z(b,this,{});var c=Ember.meta(b,!1).mixins;return c?!!c[n(this)]:!1},y.without=function(){var b=new a(this);return b._without=i.call(arguments),b},y.keys=function(){var a={},b={},c=[];A(a,this,b);for(var d in a)a.hasOwnProperty(d)&&c.push(d);return c};var B=Ember.GUID_KEY+"_name",C=Ember.get;Ember.identifyNamespaces=E,e=function(a){var b=a.superclass;if(b)return b[B]?b[B]:e(b);return},d=function(){var a=Ember.Namespace,b;if(a&&!this[B]&&!d.processed){a.PROCESSED||(E(),a.PROCESSED=!0),d.processed=!0;var c=a.NAMESPACES;for(var f=0,g=c.length;f<g;f++)b=c[f],D([b.toString()],b,{})}if(this[B])return this[B];var h=e(this);return h?"(subclass of "+h+")":"(unknown mixin)"},y.toString=d,a.mixins=function(a){var b=[],c=Ember.meta(a,!1).mixins,d,e;if(c)for(d in c){if(k[d])continue;e=c[d],e.properties||b.push(c[d])}return b},b=new Ember.Descriptor,b.toString=function(){return"(Required Property)"},Ember.required=function(){return b},c=function(a){this.methodName=a},c.prototype=new Ember.Descriptor,Ember.alias=function(a){return new c(a)},Ember.observer=function(a){var b=i.call(arguments,1);return a.__ember_observes__=b,a},Ember.immediateObserver=function(){for(var a=0,b=arguments.length;a<b;a++)var c=arguments[a];return Ember.observer.apply(this,arguments)},Ember.beforeObserver=function(a){var b=i.call(arguments,1);return a.__ember_observesBefore__=b,a}}(),function(){}(),function(){}(),function(){function e(b,c,d,f){var g,h,i;if("object"!=typeof b||b===null)return b;if(c&&(h=a(d,b))>=0)return f[h];if(Ember.typeOf(b)==="array"){g=b.slice();if(c){h=g.length;while(--h>=0)g[h]=e(g[h],c,d,f)}}else if(Ember.Copyable&&Ember.Copyable.detect(b))g=b.copy(c,d,f);else{g={};for(i in b){if(!b.hasOwnProperty(i))continue;g[i]=c?e(b[i],c,d,f):b[i]}}return c&&(d.push(b),f.push(g)),g}var a=Ember.EnumerableUtils.indexOf,b={},c="Boolean Number String Function Array Date RegExp Object".split(" ");Ember.ArrayPolyfills.forEach.call(c,function(a){b["[object "+a+"]"]=a.toLowerCase()});var d=Object.prototype.toString;Ember.typeOf=function(a){var c;return c=a===null||a===undefined?String(a):b[d.call(a)]||"object",c==="function"?Ember.Object&&Ember.Object.detect(a)&&(c="class"):c==="object"&&(a instanceof Error?c="error":Ember.Object&&a instanceof Ember.Object?c="instance":c="object"),c},Ember.none=function(a){return a===null||a===undefined},Ember.empty=function(a){return a===null||a===undefined||a.length===0&&typeof a!="function"},Ember.compare=function f(a,b){if(a===b)return 0;var c=Ember.typeOf(a),d=Ember.typeOf(b),e=Ember.Comparable;if(e){if(c==="instance"&&e.detect(a.constructor))return a.constructor.compare(a,b);if(d==="instance"&&e.detect(b.constructor))return 1-b.constructor.compare(b,a)}var g=Ember.ORDER_DEFINITION_MAPPING;if(!g){var h=Ember.ORDER_DEFINITION;g=Ember.ORDER_DEFINITION_MAPPING={};var i,j;for(i=0,j=h.length;i<j;++i)g[h[i]]=i;delete Ember.ORDER_DEFINITION}var k=g[c],l=g[d];if(k<l)return-1;if(k>l)return 1;switch(c){case"boolean":case"number":if(a<b)return-1;if(a>b)return 1;return 0;case"string":var m=a.localeCompare(b);if(m<0)return-1;if(m>0)return 1;return 0;case"array":var n=a.length,o=b.length,p=Math.min(n,o),q=0,r=0;while(q===0&&r<p)q=f(a[r],b[r]),r++;if(q!==0)return q;if(n<o)return-1;if(n>o)return 1;return 0;case"instance":if(Ember.Comparable&&Ember.Comparable.detect(a))return a.compare(a,b);return 0;case"date":var s=a.getTime(),t=b.getTime();if(s<t)return-1;if(s>t)return 1;return 0;default:return 0}},Ember.copy=function(a,b){return"object"!=typeof a||a===null?a:Ember.Copyable&&Ember.Copyable.detect(a)?a.copy(b):e(a,b,b?[]:null,b?[]:null)},Ember.inspect=function(a){var b,c=[];for(var d in a)if(a.hasOwnProperty(d)){b=a[d];if(b==="toString")continue;Ember.typeOf(b)==="function"&&(b="function() { ... }"),c.push(d+": "+b)}return"{"+c.join(" , ")+"}"},Ember.isEqual=function(a,b){return a&&"function"==typeof a.isEqual?a.isEqual(b):a===b},Ember.ORDER_DEFINITION=Ember.ENV.ORDER_DEFINITION||["undefined","null","boolean","number","string","array","object","instance","function","class","date"],Ember.keys=Object.keys,Ember.keys||(Ember.keys=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b}),Ember.Error=function(){var a=Error.prototype.constructor.apply(this,arguments);for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);this.message=a.message},Ember.Error.prototype=Ember.create(Error.prototype)}(),function(){var a=/[ _]/g,b={},c=/([a-z])([A-Z])/g,d=/(\-|_|\s)+(.)?/g,e=/([a-z\d])([A-Z]+)/g,f=/\-|\s+/g;Ember.STRINGS={},Ember.String={fmt:function(a,b){var c=0;return a.replace(/%@([0-9]+)?/g,function(a,d){return d=d?parseInt(d,0)-1:c++,a=b[d],(a===null?"(null)":a===undefined?"":a).toString()})},loc:function(a,b){return a=Ember.STRINGS[a]||a,Ember.String.fmt(a,b)},w:function(a){return a.split(/\s+/)},decamelize:function(a){return a.replace(c,"$1_$2").toLowerCase()},dasherize:function(c){var d=b,e=d[c];return e?e:(e=Ember.String.decamelize(c).replace(a,"-"),d[c]=e,e)},camelize:function(a){return a.replace(d,function(a,b,c){return c?c.toUpperCase():""})},classify:function(a){var b=Ember.String.camelize(a);return b.charAt(0).toUpperCase()+b.substr(1)},underscore:function(a){return a.replace(e,"$1_$2").replace(f,"_").toLowerCase()}}}(),function(){var a=Ember.String.fmt,b=Ember.String.w,c=Ember.String.loc,d=Ember.String.camelize,e=Ember.String.decamelize,f=Ember.String.dasherize,g=Ember.String.underscore;Ember.EXTEND_PROTOTYPES&&(String.prototype.fmt=function(){return a(this,arguments)},String.prototype.w=function(){return b(this)},String.prototype.loc=function(){return c(this,arguments)},String.prototype.camelize=function(){return d(this)},String.prototype.decamelize=function(){return e(this)},String.prototype.dasherize=function(){return f(this)},String.prototype.underscore=function(){return g(this)})}(),function(){var a=Array.prototype.slice;Ember.EXTEND_PROTOTYPES&&(Function.prototype.property=function(){var a=Ember.computed(this);return a.property.apply(a,arguments)},Function.prototype.observes=function(){return this.__ember_observes__=a.call(arguments),this},Function.prototype.observesBefore=function(){return this.__ember_observesBefore__=a.call(arguments),this})}(),function(){}(),function(){function f(){return e.length===0?{}:e.pop()}function g(a){return e.push(a),null}function h(b,c){function e(e){var f=a(e,b);return d?c===f:!!f}var d=arguments.length===2;return e}var a=Ember.get,b=Ember.set,c=Array.prototype.slice,d=Ember.EnumerableUtils.indexOf,e=[];Ember.Enumerable=Ember.Mixin.create({isEnumerable:!0,nextObject:Ember.required(Function),firstObject:Ember.computed(function(){if(a(this,"length")===0)return undefined;var b=f(),c;return c=this.nextObject(0,null,b),g(b),c}).property("[]").cacheable(),lastObject:Ember.computed(function(){var b=a(this,"length");if(b===0)return undefined;var c=f(),d=0,e,h=null;do h=e,e=this.nextObject(d++,h,c);while(e!==undefined);return g(c),h}).property("[]").cacheable(),contains:function(a){return this.find(function(b){return b===a})!==undefined},forEach:function(b,c){if(typeof b!="function")throw new TypeError;var d=a(this,"length"),e=null,h=f();c===undefined&&(c=null);for(var i=0;i<d;i++){var j=this.nextObject(i,e,h);b.call(c,j,i,this),e=j}return e=null,h=g(h),this},getEach:function(a){return this.mapProperty(a)},setEach:function(a,c){return this.forEach(function(d){b(d,a,c)})},map:function(a,b){var c=[];return this.forEach(function(d,e,f){c[e]=a.call(b,d,e,f)}),c},mapProperty:function(b){return this.map(function(c){return a(c,b)})},filter:function(a,b){var c=[];return this.forEach(function(d,e,f){a.call(b,d,e,f)&&c.push(d)}),c},filterProperty:function(a,b){return this.filter(h.apply(this,arguments))},find:function(b,c){var d=a(this,"length");c===undefined&&(c=null);var e=null,h,i=!1,j,k=f();for(var l=0;l<d&&!i;l++){h=this.nextObject(l,e,k);if(i=b.call(c,h,l,this))j=h;e=h}return h=e=null,k=g(k),j},findProperty:function(a,b){return this.find(h.apply(this,arguments))},every:function(a,b){return!this.find(function(c,d,e){return!a.call(b,c,d,e)})},everyProperty:function(a,b){return this.every(h.apply(this,arguments))},some:function(a,b){return!!this.find(function(c,d,e){return!!a.call(b,c,d,e)})},someProperty:function(a,b){return this.some(h.apply(this,arguments))},reduce:function(a,b,c){if(typeof a!="function")throw new TypeError;var d=b;return this.forEach(function(b,e){d=a.call(null,d,b,e,this,c)},this),d},invoke:function(a){var b,d=[];return arguments.length>1&&(b=c.call(arguments,1)),this.forEach(function(c,e){var f=c&&c[a];"function"==typeof f&&(d[e]=b?f.apply(c,b):f.call(c))},this),d},toArray:function(){var a=[];return this.forEach(function(b,c){a[c]=b}),a},compact:function(){return this.without(null)},without:function(a){if(!this.contains(a))return this;var b=[];return this.forEach(function(c){c!==a&&(b[b.length]=c)}),b},uniq:function(){var a=[];return this.forEach(function(b){d(a,b)<0&&a.push(b)}),a},"[]":Ember.computed(function(a,b){return this}).property().cacheable(),addEnumerableObserver:function(b,c){var d=c&&c.willChange||"enumerableWillChange",e=c&&c.didChange||"enumerableDidChange",f=a(this,"hasEnumerableObservers");return f||Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.addListener(this,"@enumerable:before",b,d),Ember.addListener(this,"@enumerable:change",b,e),f||Ember.propertyDidChange(this,"hasEnumerableObservers"),this},removeEnumerableObserver:function(b,c){var d=c&&c.willChange||"enumerableWillChange",e=c&&c.didChange||"enumerableDidChange",f=a(this,"hasEnumerableObservers");return f&&Ember.propertyWillChange(this,"hasEnumerableObservers"),Ember.removeListener(this,"@enumerable:before",b,d),Ember.removeListener(this,"@enumerable:change",b,e),f&&Ember.propertyDidChange(this,"hasEnumerableObservers"),this},hasEnumerableObservers:Ember.computed(function(){return Ember.hasListeners(this,"@enumerable:change")||Ember.hasListeners(this,"@enumerable:before")}).property().cacheable(),enumerableContentWillChange:function(b,c){var d,e,f;return"number"==typeof b?d=b:b?d=a(b,"length"):d=b=-1,"number"==typeof c?e=c:c?e=a(c,"length"):e=c=-1,f=e<0||d<0||e-d!==0,b===-1&&(b=null),c===-1&&(c=null),Ember.propertyWillChange(this,"[]"),f&&Ember.propertyWillChange(this,"length"),Ember.sendEvent(this,"@enumerable:before",[this,b,c]),this},enumerableContentDidChange:function(b,c){var d=this.propertyDidChange,e,f,g;return"number"==typeof b?e=b:b?e=a(b,"length"):e=b=-1,"number"==typeof c?f=c:c?f=a(c,"length"):f=c=-1,g=f<0||e<0||f-e!==0,b===-1&&(b=null),c===-1&&(c=null),Ember.sendEvent(this,"@enumerable:change",[this,b,c]),g&&Ember.propertyDidChange(this,"length"),Ember.propertyDidChange(this,"[]"),this}})}(),function(){function f(a){return a===null||a===undefined}var a=Ember.get,b=Ember.set,c=Ember.meta,d=Ember.EnumerableUtils.map,e=Ember.cacheFor;Ember.Array=Ember.Mixin.create(Ember.Enumerable,{isSCArray:!0,length:Ember.required(),objectAt:function(b){return b<0||b>=a(this,"length")?undefined:a(this,b)},objectsAt:function(a){var b=this;return d(a,function(a){return b.objectAt(a)})},nextObject:function(a){return this.objectAt(a)},"[]":Ember.computed(function(b,c){return c!==undefined&&this.replace(0,a(this,"length"),c),this}).property().cacheable(),firstObject:Ember.computed(function(){return this.objectAt(0)}).property().cacheable(),lastObject:Ember.computed(function(){return this.objectAt(a(this,"length")-1)}).property().cacheable(),contains:function(a){return this.indexOf(a)>=0},slice:function(b,c){var d=[],e=a(this,"length");f(b)&&(b=0);if(f(c)||c>e)c=e;while(b<c)d[d.length]=this.objectAt(b++);return d},indexOf:function(b,c){var d,e=a(this,"length");c===undefined&&(c=0),c<0&&(c+=e);for(d=c;d<e;d++)if(this.objectAt(d,!0)===b)return d;return-1},lastIndexOf:function(b,c){var d,e=a(this,"length");if(c===undefined||c>=e)c=e-1;c<0&&(c+=e);for(d=c;d>=0;d--)if(this.objectAt(d)===b)return d;return-1},addArrayObserver:function(b,c){var d=c&&c.willChange||"arrayWillChange",e=c&&c.didChange||"arrayDidChange",f=a(this,"hasArrayObservers");return f||Ember.propertyWillChange(this,"hasArrayObservers"),Ember.addListener(this,"@array:before",b,d),Ember.addListener(this,"@array:change",b,e),f||Ember.propertyDidChange(this,"hasArrayObservers"),this},removeArrayObserver:function(b,c){var d=c&&c.willChange||"arrayWillChange",e=c&&c.didChange||"arrayDidChange",f=a(this,"hasArrayObservers");return f&&Ember.propertyWillChange(this,"hasArrayObservers"),Ember.removeListener(this,"@array:before",b,d),Ember.removeListener(this,"@array:change",b,e),f&&Ember.propertyDidChange(this,"hasArrayObservers"),this},hasArrayObservers:Ember.computed(function(){return Ember.hasListeners(this,"@array:change")||Ember.hasListeners(this,"@array:before")}).property().cacheable(),arrayContentWillChange:function(b,c,d){b===undefined?(b=0,c=d=-1):(c===undefined&&(c=-1),d===undefined&&(d=-1)),Ember.isWatching(this,"@each")&&a(this,"@each"),Ember.sendEvent(this,"@array:before",[this,b,c,d]);var e,f;if(b>=0&&c>=0&&a(this,"hasEnumerableObservers")){e=[],f=b+c;for(var g=b;g<f;g++)e.push(this.objectAt(g))}else e=c;return this.enumerableContentWillChange(e,d),this},arrayContentDidChange:function(b,c,d){b===undefined?(b=0,c=d=-1):(c===undefined&&(c=-1),d===undefined&&(d=-1));var f,g;if(b>=0&&d>=0&&a(this,"hasEnumerableObservers")){f=[],g=b+d;for(var h=b;h<g;h++)f.push(this.objectAt(h))}else f=d;this.enumerableContentDidChange(c,f),Ember.sendEvent(this,"@array:change",[this,b,c,d]);var i=a(this,"length"),j=e(this,"firstObject"),k=e(this,"lastObject");return this.objectAt(0)!==j&&(Ember.propertyWillChange(this,"firstObject"),Ember.propertyDidChange(this,"firstObject")),this.objectAt(i-1)!==k&&(Ember.propertyWillChange(this,"lastObject"),Ember.propertyDidChange(this,"lastObject")),this},"@each":Ember.computed(function(){return this.__each||(this.__each=new Ember.EachProxy(this)),this.__each}).property().cacheable()})}(),function(){Ember.Comparable=Ember.Mixin.create({isComparable:!0,compare:Ember.required(Function)})}(),function(){var a=Ember.get,b=Ember.set;Ember.Copyable=Ember.Mixin.create({copy:Ember.required(Function),frozenCopy:function(){if(Ember.Freezable&&Ember.Freezable.detect(this))return a(this,"isFrozen")?this:this.copy().freeze();throw new Error(Ember.String.fmt("%@ does not support freezing",[this]))}})}(),function(){var a=Ember.get,b=Ember.set;Ember.Freezable=Ember.Mixin.create({isFrozen:!1,freeze:function(){return a(this,"isFrozen")?this:(b(this,"isFrozen",!0),this)}}),Ember.FROZEN_ERROR="Frozen object cannot be modified."}(),function(){var a=Ember.EnumerableUtils.forEach;Ember.MutableEnumerable=Ember.Mixin.create(Ember.Enumerable,{addObject:Ember.required(Function),addObjects:function(b){return Ember.beginPropertyChanges(this),a(b,function(a){this.addObject(a)},this),Ember.endPropertyChanges(this),this},removeObject:Ember.required(Function),removeObjects:function(b){return Ember.beginPropertyChanges(this),a(b,function(a){this.removeObject(a)},this),Ember.endPropertyChanges(this),this}})}(),function(){var a="Index out of range",b=[],c=Ember.get,d=Ember.set,e=Ember.EnumerableUtils.forEach;Ember.MutableArray=Ember.Mixin.create(Ember.Array,Ember.MutableEnumerable,{replace:Ember.required(),clear:function(){var a=c(this,"length");return a===0?this:(this.replace(0,a,b),this)},insertAt:function(b,d){if(b>c(this,"length"))throw new Error(a);return this.replace(b,0,[d]),this},removeAt:function(d,e){var f=0;if("number"==typeof d){if(d<0||d>=c(this,"length"))throw new Error(a);e===undefined&&(e=1),this.replace(d,e,b)}return this},pushObject:function(a){return this.insertAt(c(this,"length"),a),a},pushObjects:function(a){return this.replace(c(this,"length"),0,a),this},popObject:function(){var a=c(this,"length");if(a===0)return null;var b=this.objectAt(a-1);return this.removeAt(a-1,1),b},shiftObject:function(){if(c(this,"length")===0)return null;var a=this.objectAt(0);return this.removeAt(0),a},unshiftObject:function(a){return this.insertAt(0,a),a},unshiftObjects:function(a){return this.replace(0,0,a),this},reverseObjects:function(){var a=c(this,"length");if(a===0)return this;var b=this.toArray().reverse();return this.replace(0,a,b),this},removeObject:function(a){var b=c(this,"length")||0;while(--b>=0){var d=this.objectAt(b);d===a&&this.removeAt(b)}return this},addObject:function(a){return this.contains(a)||this.pushObject(a),this}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.defineProperty;Ember.Observable=Ember.Mixin.create({isObserverable:!0,get:function(b){return a(this,b)},getProperties:function(){var b={},c=arguments;arguments.length===1&&Ember.typeOf(arguments[0])==="array"&&(c=arguments[0]);for(var d=0;d<c.length;d++)b[c[d]]=a(this,c[d]);return b},set:function(a,c){return b(this,a,c),this},setProperties:function(a){return Ember.setProperties(this,a)},beginPropertyChanges:function(){return Ember.beginPropertyChanges(),this},endPropertyChanges:function(){return Ember.endPropertyChanges(),this},propertyWillChange:function(a){return Ember.propertyWillChange(this,a),this},propertyDidChange:function(a){return Ember.propertyDidChange(this,a),this},notifyPropertyChange:function(a){return this.propertyWillChange(a),this.propertyDidChange(a),this},addBeforeObserver:function(a,b,c){Ember.addBeforeObserver(this,a,b,c)},addObserver:function(a,b,c){Ember.addObserver(this,a,b,c)},removeObserver:function(a,b,c){Ember.removeObserver(this,a,b,c)},hasObserverFor:function(a){return Ember.hasListeners(this,a+":change")},unknownProperty:function(a){return undefined},setUnknownProperty:function(a,d){c(this,a),b(this,a,d)},getPath:function(a){return this.get(a)},setPath:function(a,b){return this.set(a,b)},getWithDefault:function(a,b){return Ember.getWithDefault(this,a,b)},incrementProperty:function(c,d){return d||(d=1),b(this,c,(a(this,c)||0)+d),a(this,c)},decrementProperty:function(c,d){return d||(d=1),b(this,c,(a(this,c)||0)-d),a(this,c)},toggleProperty:function(c){return b(this,c,!a(this,c)),a(this,c)},cacheFor:function(a){return Ember.cacheFor(this,a)},observersForKey:function(a){return Ember.observersFor(this,a)}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TargetActionSupport=Ember.Mixin.create({target:null,action:null,targetObject:Ember.computed(function(){var b=a(this,"target");if(Ember.typeOf(b)==="string"){var c=a(this,b);return c===undefined&&(c=a(window,b)),c}return b}).property("target").cacheable(),triggerAction:function(){var b=a(this,"action"),c=a(this,"targetObject");if(c&&b){var d;return typeof c.send=="function"?d=c.send(b,this):(typeof b=="string"&&(b=c[b]),d=b.call(c,this)),d!==!1&&(d=!0),d}return!1}})}(),function(){Ember.Evented=Ember.Mixin.create({on:function(a,b,c){Ember.addListener(this,a,b,c)},one:function(a,b,c){c||(c=b,b=null);var d=this,e=function(){Ember.removeListener(d,a,b,e),"string"==typeof c&&(c=this[c]),c.apply(this,arguments)};this.on(a,b,e)},trigger:function(a){var b=[],c,d;for(c=1,d=arguments.length;c<d;c++)b.push(arguments[c]);Ember.sendEvent(this,a,b)},fire:function(a){this.trigger.apply(this,arguments)},off:function(a,b,c){Ember.removeListener(this,a,b,c)},has:function(a){return Ember.hasListeners(this,a)}})}(),function(){}(),function(){function m(){var b=!1,c,d=function(){b||d.proto();var a=Ember.meta(this);a.proto=this,c&&(this.reopen.apply(this,c),c=null),e(this,Ember.GUID_KEY,l),e(this,"_super",l),j(this,a),delete a.proto,i(this),this.init.apply(this,arguments)};return d.toString=a,d.willReopen=function(){b&&(d.PrototypeMixin=Ember.Mixin.create(d.PrototypeMixin)),b=!1},d._initMixins=function(a){c=a},d.proto=function(){var a=d.superclass;return a&&a.proto(),b||(b=!0,d.PrototypeMixin.applyPartial(d.prototype),h(d.prototype)),this.prototype},d}var a=Ember.Mixin.prototype.toString,b=Ember.set,c=Ember.get,d=Ember.create,e=Ember.platform.defineProperty,f=Array.prototype.slice,g=Ember.meta,h=Ember.rewatch,i=Ember.finishChains,j=Ember.Mixin.finishPartial,k=Ember.Mixin.prototype.reopen,l={configurable:!0,writable:!0,enumerable:!1,value:undefined},n=m();n.PrototypeMixin=Ember.Mixin.create({reopen:function(){return Ember.Mixin._apply(this,arguments,!0),this},isInstance:!0,init:function(){},isDestroyed:!1,isDestroying:!1,destroy:function(){if(this.isDestroying)return;return this.isDestroying=!0,this.willDestroy&&this.willDestroy(),b(this,"isDestroyed",!0),Ember.run.schedule("destroy",this,this._scheduledDestroy),this},_scheduledDestroy:function(){Ember.destroy(this),this.didDestroy&&this.didDestroy()},bind:function(a,b){return b instanceof Ember.Binding||(b=Ember.Binding.from(b)),b.to(a).connect(this),b},toString:function(){return"<"+this.constructor.toString()+":"+Ember.guidFor(this)+">"}}),Ember.config.overridePrototypeMixin&&Ember.config.overridePrototypeMixin(n.PrototypeMixin),n.__super__=null;var o=Ember.Mixin.create({ClassMixin:Ember.required(),PrototypeMixin:Ember.required(),isClass:!0,isMethod:!1,extend:function(){var a=m(),b;return a.ClassMixin=Ember.Mixin.create(this.ClassMixin),a.PrototypeMixin=Ember.Mixin.create(this.PrototypeMixin),a.ClassMixin.ownerConstructor=a,a.PrototypeMixin.ownerConstructor=a,k.apply(a.PrototypeMixin,arguments),a.superclass=this,a.__super__=this.prototype,b=a.prototype=d(this.prototype),b.constructor=a,Ember.generateGuid(b,"ember"),g(b).proto=b,a.ClassMixin.apply(a),a},create:function(){var a=this;return arguments.length>0&&this._initMixins(arguments),new a},reopen:function(){return this.willReopen(),k.apply(this.PrototypeMixin,arguments),this},reopenClass:function(){return k.apply(this.ClassMixin,arguments),Ember.Mixin._apply(this,arguments,!1),this},detect:function(a){if("function"!=typeof a)return!1;while(a){if(a===this)return!0;a=a.superclass}return!1},detectInstance:function(a){return a instanceof this},metaForProperty:function(a){var b=g(this.proto(),!1).descs[a];return b._meta||{}},eachComputedProperty:function(a,b){var c=this.proto(),d=g(c).descs,e={},f;for(var h in d)f=d[h],f instanceof Ember.ComputedProperty&&a.call(b||this,h,f._meta||e)}});Ember.config.overrideClassMixin&&Ember.config.overrideClassMixin(o),n.ClassMixin=o,o.apply(n),Ember.CoreObject=n}(),function(){var a=Ember.get,b=Ember.set,c=Ember.guidFor,d=Ember.none;Ember.Set=Ember.CoreObject.extend(Ember.MutableEnumerable,Ember.Copyable,Ember.Freezable,{length:0,clear:function(){if(this.isFrozen)throw new Error(Ember.FROZEN_ERROR);var d=a(this,"length");if(d===0)return this;var e;this.enumerableContentWillChange(d,0),Ember.propertyWillChange(this,"firstObject"),Ember.propertyWillChange(this,"lastObject");for(var f=0;f<d;f++)e=c(this[f]),delete this[e],delete this[f];return b(this,"length",0),Ember.propertyDidChange(this,"firstObject"),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(d,0),this},isEqual:function(b){if(!Ember.Enumerable.detect(b))return!1;var c=a(this,"length");if(a(b,"length")!==c)return!1;while(--c>=0)if(!b.contains(this[c]))return!1;return!0},add:Ember.alias("addObject"),remove:Ember.alias("removeObject"),pop:function(){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);var b=this.length>0?this[this.length-1]:null;return this.remove(b),b},push:Ember.alias("addObject"),shift:Ember.alias("pop"),unshift:Ember.alias("push"),addEach:Ember.alias("addObjects"),removeEach:Ember.alias("removeObjects"),init:function(a){this._super(),a&&this.addObjects(a)},nextObject:function(a){return this[a]},firstObject:Ember.computed(function(){return this.length>0?this[0]:undefined}).property().cacheable(),lastObject:Ember.computed(function(){return this.length>0?this[this.length-1]:undefined}).property().cacheable(),addObject:function(e){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(d(e))return this;var f=c(e),g=this[f],h=a(this,"length"),i;return g>=0&&g<h&&this[g]===e?this:(i=[e],this.enumerableContentWillChange(null,i),Ember.propertyWillChange(this,"lastObject"),h=a(this,"length"),this[f]=h,this[h]=e,b(this,"length",h+1),Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(null,i),this)},removeObject:function(e){if(a(this,"isFrozen"))throw new Error(Ember.FROZEN_ERROR);if(d(e))return this;var f=c(e),g=this[f],h=a(this,"length"),i=g===0,j=g===h-1,k,l;return g>=0&&g<h&&this[g]===e&&(l=[e],this.enumerableContentWillChange(l,null),i&&Ember.propertyWillChange(this,"firstObject"),j&&Ember.propertyWillChange(this,"lastObject"),g<h-1&&(k=this[h-1],this[g]=k,this[c(k)]=g),delete this[f],delete this[h-1],b(this,"length",h-1),i&&Ember.propertyDidChange(this,"firstObject"),j&&Ember.propertyDidChange(this,"lastObject"),this.enumerableContentDidChange(l,null)),this},contains:function(a){return this[c(a)]>=0},copy:function(){var d=this.constructor,e=new d,f=a(this,"length");b(e,"length",f);while(--f>=0)e[f]=this[f],e[c(this[f])]=f;return e},toString:function(){var a=this.length,b,c=[];for(b=0;b<a;b++)c[b]=this[b];return"Ember.Set<%@>".fmt(c.join(","))}})}(),function(){Ember.Object=Ember.CoreObject.extend(Ember.Observable)}(),function(){var a=Ember.ArrayPolyfills.indexOf;Ember.Namespace=Ember.Object.extend({isNamespace:!0,init:function(){Ember.Namespace.NAMESPACES.push(this),Ember.Namespace.PROCESSED=!1},toString:function(){return Ember.identifyNamespaces(),this[Ember.GUID_KEY+"_name"]},destroy:function(){var b=Ember.Namespace.NAMESPACES;window[this.toString()]=undefined,b.splice(a.call(b,this),1),this._super()}}),Ember.Namespace.NAMESPACES=[Ember],Ember.Namespace.PROCESSED=!1}(),function(){Ember.Application=Ember.Namespace.extend()}(),function(){var a=Ember.get,b=Ember.set;Ember.ArrayProxy=Ember.Object.extend(Ember.MutableArray,{content:null,arrangedContent:Ember.computed("content",function(){return a(this,"content")}).cacheable(),objectAtContent:function(b){return a(this,"arrangedContent").objectAt(b)},replaceContent:function(b,c,d){a(this,"arrangedContent").replace(b,c,d)},_contentWillChange:Ember.beforeObserver(function(){var b=a(this,"content");b&&b.removeArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},"content"),contentArrayWillChange:Ember.K,contentArrayDidChange:Ember.K,_contentDidChange:Ember.observer(function(){var b=a(this,"content"),c=b?a(b,"length"):0;b&&b.addArrayObserver(this,{willChange:"contentArrayWillChange",didChange:"contentArrayDidChange"})},"content"),_arrangedContentWillChange:Ember.beforeObserver(function(){var b=a(this,"arrangedContent"),c=b?a(b,"length"):0;this.arrangedContentArrayWillChange(this,0,c,undefined),b&&b.removeArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"})},"arrangedContent"),_arrangedContentDidChange:Ember.observer(function(){var b=a(this,"arrangedContent"),c=b?a(b,"length"):0;b&&b.addArrayObserver(this,{willChange:"arrangedContentArrayWillChange",didChange:"arrangedContentArrayDidChange"}),this.arrangedContentArrayDidChange(this,0,undefined,c)},"arrangedContent"),objectAt:function(b){return a(this,"content")&&this.objectAtContent(b)},length:Ember.computed(function(){var b=a(this,"arrangedContent");return b?a(b,"length"):0}).property().cacheable(),replace:function(b,c,d){return a(this,"content")&&this.replaceContent(b,c,d),this},arrangedContentArrayWillChange:function(a,b,c,d){this.arrayContentWillChange(b,c,d)},arrangedContentArrayDidChange:function(a,b,c,d){this.arrayContentDidChange(b,c,d)},init:function(){this._super(),this._contentWillChange(),this._contentDidChange(),this._arrangedContentWillChange(),this._arrangedContentDidChange()}})}(),function(){function j(a,b){var c=b.slice(8);if(c in this)return;h(this,c)}function k(a,b){var c=b.slice(8);if(c in this)return;i(this,c)}var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.addBeforeObserver,e=Ember.addObserver,f=Ember.removeBeforeObserver,g=Ember.removeObserver,h=Ember.propertyWillChange,i=Ember.propertyDidChange;Ember.ObjectProxy=Ember.Object.extend({content:null,_contentDidChange:Ember.observer(function(){},"content"),willWatchProperty:function(a){var b="content."+a;d(this,b,null,j),e(this,b,null,k)},didUnwatchProperty:function(a){var b="content."+a;f(this,b,null,j),g(this,b,null,k)},unknownProperty:function(b){var c=a(this,"content");if(c)return a(c,b)},setUnknownProperty:function(c,d){var e=a(this,"content");return b(e,c,d)}})}(),function(){function g(a,b,d,e,f){var g=d._objects,h;g||(g=d._objects={});while(--f>=e){var i=a.objectAt(f);i&&(Ember.addBeforeObserver(i,b,d,"contentKeyWillChange"),Ember.addObserver(i,b,d,"contentKeyDidChange"),h=c(i),g[h]||(g[h]=[]),g[h].push(f))}}function h(a,b,d,e,f){var g=d._objects;g||(g=d._objects={});var h,i;while(--f>=e){var j=a.objectAt(f);j&&(Ember.removeBeforeObserver(j,b,d,"contentKeyWillChange"),Ember.removeObserver(j,b,d,"contentKeyDidChange"),i=c(j),h=g[i],h[h.indexOf(f)]=null)}}var a=Ember.set,b=Ember.get,c=Ember.guidFor,d=Ember.EnumerableUtils.forEach,e=Ember.Object.extend(Ember.Array,{init:function(a,b,c){this._super(),this._keyName=b,this._owner=c,this._content=a},objectAt:function(a){var c=this._content.objectAt(a);return c&&b(c,this._keyName)},length:Ember.computed(function(){var a=this._content;return a?b(a,"length"):0}).property().cacheable()}),f=/^.+:(before|change)$/;Ember.EachProxy=Ember.Object.extend({init:function(a){this._super(),this._content=a,a.addArrayObserver(this),d(Ember.watchedEvents(this),function(a){this.didAddListener(a)},this)},unknownProperty:function(a,b){var c;return c=new e(this._content,a,this),Ember.defineProperty(this,a,null,c),this.beginObservingContentKey(a),c},arrayWillChange:function(a,b,c,d){var e=this._keys,f,g,i;i=c>0?b+c:-1,Ember.beginPropertyChanges(this);for(f in e){if(!e.hasOwnProperty(f))continue;i>0&&h(a,f,this,b,i),Ember.propertyWillChange(this,f)}Ember.propertyWillChange(this._content,"@each"),Ember.endPropertyChanges(this)},arrayDidChange:function(a,b,c,d){var e=this._keys,f,h,i;i=d>0?b+d:-1,Ember.beginPropertyChanges(this);for(f in e){if(!e.hasOwnProperty(f))continue;i>0&&g(a,f,this,b,i),Ember.propertyDidChange(this,f)}Ember.propertyDidChange(this._content,"@each"),Ember.endPropertyChanges(this)},didAddListener:function(a){f.test(a)&&this.beginObservingContentKey(a.slice(0,-7))},didRemoveListener:function(a){f.test(a)&&this.stopObservingContentKey(a.slice(0,-7))},beginObservingContentKey:function(a){var c=this._keys;c||(c=this._keys={});if(!c[a]){c[a]=1;var d=this._content,e=b(d,"length");g(d,a,this,0,e)}else c[a]++},stopObservingContentKey:function(a){var c=this._keys;if(c&&c[a]>0&&--c[a]<=0){var d=this._content,e=b(d,"length");h(d,a,this,0,e)}},contentKeyWillChange:function(a,b){Ember.propertyWillChange(this,b)},contentKeyDidChange:function(a,b){Ember.propertyDidChange(this,b)}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.Mixin.create(Ember.MutableArray,Ember.Observable,Ember.Copyable,{get:function(a){return a==="length"?this.length:"number"==typeof a?this[a]:this._super(a)},objectAt:function(a){return this[a]},replace:function(b,c,d){if(this.isFrozen)throw Ember.FROZEN_ERROR;var e=
-d?a(d,"length"):0;this.arrayContentWillChange(b,c,e);if(!d||d.length===0)this.splice(b,c);else{var f=[b,c].concat(d);this.splice.apply(this,f)}return this.arrayContentDidChange(b,c,e),this},unknownProperty:function(a,b){var c;return b!==undefined&&c===undefined&&(c=this[a]=b),c},indexOf:function(a,b){var c,d=this.length;b===undefined?b=0:b=b<0?Math.ceil(b):Math.floor(b),b<0&&(b+=d);for(c=b;c<d;c++)if(this[c]===a)return c;return-1},lastIndexOf:function(a,b){var c,d=this.length;b===undefined?b=d-1:b=b<0?Math.ceil(b):Math.floor(b),b<0&&(b+=d);for(c=b;c>=0;c--)if(this[c]===a)return c;return-1},copy:function(){return this.slice()}}),d=["length"];Ember.EnumerableUtils.forEach(c.keys(),function(a){Array.prototype[a]&&d.push(a)}),d.length>0&&(c=c.without.apply(c,d)),Ember.NativeArray=c,Ember.A=function(a){return a===undefined&&(a=[]),Ember.NativeArray.apply(a)},Ember.NativeArray.activate=function(){c.apply(Array.prototype),Ember.A=function(a){return a||[]}},Ember.EXTEND_PROTOTYPES&&Ember.NativeArray.activate()}(),function(){var a=Ember.get,b=Ember.set;Ember._PromiseChain=Ember.Object.extend({promises:null,failureCallback:Ember.K,successCallback:Ember.K,abortCallback:Ember.K,promiseSuccessCallback:Ember.K,runNextPromise:function(){if(a(this,"isDestroyed"))return;var b=a(this,"promises").shiftObject();if(b){var c=a(b,"promise")||b,d=this,e=function(){d.promiseSuccessCallback.call(this,b,arguments),d.runNextPromise()},f=a(d,"failureCallback");c.then(e,f)}else this.successCallback()},start:function(){return this.runNextPromise(),this},abort:function(){this.abortCallback(),this.destroy()},init:function(){b(this,"promises",Ember.A(a(this,"promises"))),this._super()}})}(),function(){var a={},b={};Ember.onLoad=function(c,d){var e;a[c]=a[c]||Ember.A(),a[c].pushObject(d),(e=b[c])&&d(e)},Ember.runLoadHooks=function(c,d){var e;b[c]=d,(e=a[c])&&a[c].forEach(function(a){a(d)})}}(),function(){}(),function(){Ember.ControllerMixin=Ember.Mixin.create({target:null,store:null}),Ember.Controller=Ember.Object.extend(Ember.ControllerMixin)}(),function(){var a=Ember.get,b=Ember.set,c=Ember.EnumerableUtils.forEach;Ember.SortableMixin=Ember.Mixin.create(Ember.MutableEnumerable,{sortProperties:null,sortAscending:!0,addObject:function(b){var c=a(this,"content");c.pushObject(b)},removeObject:function(b){var c=a(this,"content");c.removeObject(b)},orderBy:function(b,d){var e=0,f=a(this,"sortProperties"),g=a(this,"sortAscending");return c(f,function(c){e===0&&(e=Ember.compare(a(b,c),a(d,c)),e!==0&&!g&&(e=-1*e))}),e},destroy:function(){var b=a(this,"content"),d=a(this,"sortProperties");return b&&d&&c(b,function(a){c(d,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},isSorted:Ember.computed("sortProperties",function(){return!!a(this,"sortProperties")}),arrangedContent:Ember.computed("content","sortProperties.@each",function(b,d){var e=a(this,"content"),f=a(this,"isSorted"),g=a(this,"sortProperties"),h=this;return e&&f?(e=e.slice(),e.sort(function(a,b){return h.orderBy(a,b)}),c(e,function(a){c(g,function(b){Ember.addObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),Ember.A(e)):e}).cacheable(),_contentWillChange:Ember.beforeObserver(function(){var b=a(this,"content"),d=a(this,"sortProperties");b&&d&&c(b,function(a){c(d,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this),this._super()},"content"),sortAscendingWillChange:Ember.beforeObserver(function(){this._lastSortAscending=a(this,"sortAscending")},"sortAscending"),sortAscendingDidChange:Ember.observer(function(){if(a(this,"sortAscending")!==this._lastSortAscending){var b=a(this,"arrangedContent");b.reverseObjects()}},"sortAscending"),contentArrayWillChange:function(b,d,e,f){var g=a(this,"isSorted");if(g){var h=a(this,"arrangedContent"),i=b.slice(d,d+e),j=a(this,"sortProperties");c(i,function(a){h.removeObject(a),c(j,function(b){Ember.removeObserver(a,b,this,"contentItemSortPropertyDidChange")},this)})}return this._super(b,d,e,f)},contentArrayDidChange:function(b,d,e,f){var g=a(this,"isSorted"),h=a(this,"sortProperties");if(g){var i=b.slice(d,d+f),j=a(this,"arrangedContent");c(i,function(a){this.insertItemSorted(a),c(h,function(b){Ember.addObserver(a,b,this,"contentItemSortPropertyDidChange")},this)},this)}return this._super(b,d,e,f)},insertItemSorted:function(b){var c=a(this,"arrangedContent"),d=a(c,"length"),e=this._binarySearch(b,0,d);c.insertAt(e,b)},contentItemSortPropertyDidChange:function(b){var c=a(this,"arrangedContent"),d=c.indexOf(b);c.removeObject(b),this.insertItemSorted(b)},_binarySearch:function(b,c,d){var e,f,g,h;return c===d?c:(h=a(this,"arrangedContent"),e=c+Math.floor((d-c)/2),f=h.objectAt(e),g=this.orderBy(f,b),g<0?this._binarySearch(b,e+1,d):g>0?this._binarySearch(b,c,e):e)}})}(),function(){var a=Ember.get,b=Ember.set;Ember.ArrayController=Ember.ArrayProxy.extend(Ember.ControllerMixin,Ember.SortableMixin)}(),function(){Ember.ObjectController=Ember.ObjectProxy.extend(Ember.ControllerMixin)}(),function(){}(),function(){}(),function(){var a=Ember.get,b=Ember.set;Ember.Application=Ember.Namespace.extend({rootElement:"body",eventDispatcher:null,customEvents:null,init:function(){var c,d=a(this,"rootElement");this._super(),c=Ember.EventDispatcher.create({rootElement:d}),b(this,"eventDispatcher",c);if(Ember.$.isReady)Ember.run.once(this,this.didBecomeReady);else{var e=this;Ember.$(document).ready(function(){Ember.run.once(e,e.didBecomeReady)})}},initialize:function(c){var d=Ember.A(Ember.keys(this)),e=a(this.constructor,"injections"),f=this,g,h;!c&&Ember.Router.detect(f.Router)&&(c=f.Router.create(),this._createdRouter=c),c&&(b(this,"router",c),b(c,"namespace",this)),Ember.runLoadHooks("application",this),e.forEach(function(a){d.forEach(function(b){a[1](f,c,b)})}),c&&c instanceof Ember.Router&&this.startRouting(c)},didBecomeReady:function(){var b=a(this,"eventDispatcher"),c=a(this,"customEvents");b.setup(c),this.ready()},startRouting:function(b){var c=a(b,"location"),d=a(this,"rootElement"),e=a(b,"applicationController"),f=this.ApplicationView.create({controller:e});this._createdApplicationView=f,f.appendTo(d),b.route(c.getURL()),c.onUpdateURL(function(a){b.route(a)})},ready:Ember.K,willDestroy:function(){a(this,"eventDispatcher").destroy(),this._createdRouter&&this._createdRouter.destroy(),this._createdApplicationView&&this._createdApplicationView.destroy()},registerInjection:function(a){this.constructor.registerInjection(a)}}),Ember.Application.reopenClass({concatenatedProperties:["injections"],injections:Ember.A(),registerInjection:function(b){var c=a(this,"injections"),d=b.before,e=b.name,f=b.injection,g;d?(g=c.find(function(a){if(a[0]===d)return!0}),g=c.indexOf(g)):g=a(c,"length"),c.splice(g,0,[e,f])}}),Ember.Application.registerInjection({name:"controllers",injection:function(a,b,c){if(!/^[A-Z].*Controller$/.test(c))return;var d=c.charAt(0).toLowerCase()+c.substr(1),e=a[c].create();b.set(d,e),e.setProperties({target:b,controllers:b,namespace:a})}})}(),function(){var a=Ember.get,b=Ember.set;Ember.Location={create:function(a){var b=a&&a.implementation,c=this.implementations[b];return c.create.apply(c,arguments)},registerImplementation:function(a,b){this.implementations[a]=b},implementations:{}}}(),function(){var a=Ember.get,b=Ember.set;Ember.HashLocation=Ember.Object.extend({init:function(){b(this,"location",a(this,"location")||window.location)},getURL:function(){return a(this,"location").hash.substr(1)},setURL:function(c){a(this,"location").hash=c,b(this,"lastSetURL",c)},onUpdateURL:function(c){var d=this,e=Ember.guidFor(this);Ember.$(window).bind("hashchange.ember-location-"+e,function(){var e=location.hash.substr(1);if(a(d,"lastSetURL")===e)return;b(d,"lastSetURL",null),c(location.hash.substr(1))})},formatURL:function(a){return"#"+a},willDestroy:function(){var a=Ember.guidFor(this);Ember.$(window).unbind("hashchange.ember-location-"+a)}}),Ember.Location.registerImplementation("hash",Ember.HashLocation)}(),function(){var a=Ember.get,b=Ember.set;Ember.HistoryLocation=Ember.Object.extend({init:function(){b(this,"location",a(this,"location")||window.location),b(this,"_initialURL",a(this,"location").pathname)},rootURL:"/",_initialURL:null,getURL:function(){return a(this,"location").pathname},setURL:function(b){var c=window.history.state,d=a(this,"_initialURL");b=this.formatPath(b),(d!==b&&!c||c&&c.path!==b)&&window.history.pushState({path:b},null,b)},onUpdateURL:function(a){var b=Ember.guidFor(this);Ember.$(window).bind("popstate.ember-location-"+b,function(b){a(location.pathname)})},formatPath:function(b){var c=a(this,"rootURL");return b!==""&&(c=c.replace(/\/$/,"")),c+b},formatURL:function(a){return a},willDestroy:function(){var a=Ember.guidFor(this);Ember.$(window).unbind("popstate.ember-location-"+a)}}),Ember.Location.registerImplementation("history",Ember.HistoryLocation)}(),function(){var a=Ember.get,b=Ember.set;Ember.NoneLocation=Ember.Object.extend({path:"",getURL:function(){return a(this,"path")},setURL:function(a){b(this,"path",a)},onUpdateURL:function(a){},formatURL:function(a){return a}}),Ember.Location.registerImplementation("none",Ember.NoneLocation)}(),function(){}(),function(){}(),function(){Ember.$=window.jQuery}(),function(){var a=Ember.String.w("dragstart drag dragenter dragleave dragover drop dragend");Ember.EnumerableUtils.forEach(a,function(a){Ember.$.event.fixHooks[a]={props:["dataTransfer"]}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.ArrayPolyfills.indexOf,d=function(){this.seen={},this.list=[]};d.prototype={add:function(a){if(a in this.seen)return;this.seen[a]=!0,this.list.push(a)},toDOM:function(){return this.list.join(" ")}},Ember.RenderBuffer=function(a){return new Ember._RenderBuffer(a)},Ember._RenderBuffer=function(a){this.elementTag=a,this.childBuffers=[]},Ember._RenderBuffer.prototype={elementClasses:null,elementId:null,elementAttributes:null,elementTag:null,elementStyle:null,parentBuffer:null,push:function(a){return this.childBuffers.push(String(a)),this},addClass:function(a){var b=this.elementClasses=this.elementClasses||new d;return this.elementClasses.add(a),this},id:function(a){return this.elementId=a,this},attr:function(a,b){var c=this.elementAttributes=this.elementAttributes||{};return arguments.length===1?c[a]:(c[a]=b,this)},removeAttr:function(a){var b=this.elementAttributes;return b&&delete b[a],this},style:function(a,b){var c=this.elementStyle=this.elementStyle||{};return this.elementStyle[a]=b,this},newBuffer:function(a,b,c,d){var e=new Ember._RenderBuffer(a);return e.parentBuffer=b,d&&Ember.$.extend(e,d),c&&c.call(this,e),e},replaceWithBuffer:function(a){var b=this.parentBuffer;if(!b)return;var d=b.childBuffers,e=c.call(d,this);a?d.splice(e,1,a):d.splice(e,1)},begin:function(a){return this.newBuffer(a,this,function(a){this.childBuffers.push(a)})},prepend:function(a){return this.newBuffer(a,this,function(a){this.childBuffers.splice(0,0,a)})},replaceWith:function(a){var b=this.parentBuffer;return this.newBuffer(a,b,function(a){this.replaceWithBuffer(a)})},insertAfter:function(b){var d=a(this,"parentBuffer");return this.newBuffer(b,d,function(a){var b=d.childBuffers,e=c.call(b,this);b.splice(e+1,0,a)})},end:function(){var a=this.parentBuffer;return a||this},remove:function(){this.replaceWithBuffer(null)},element:function(){return Ember.$(this.string())[0]},string:function(){var a="",b=this.elementTag,c;if(b){var d=this.elementId,e=this.elementClasses,f=this.elementAttributes,g=this.elementStyle,h="",i;c=["<"+b],d&&c.push('id="'+this._escapeAttribute(d)+'"'),e&&c.push('class="'+this._escapeAttribute(e.toDOM())+'"');if(g){for(i in g)g.hasOwnProperty(i)&&(h+=i+":"+this._escapeAttribute(g[i])+";");c.push('style="'+h+'"')}if(f)for(i in f)f.hasOwnProperty(i)&&c.push(i+'="'+this._escapeAttribute(f[i])+'"');c=c.join(" ")+">"}var j=this.childBuffers;return Ember.ArrayPolyfills.forEach.call(j,function(b){var c=typeof b=="string";a+=c?b:b.string()}),b?c+a+"</"+b+">":a},_escapeAttribute:function(a){var b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[<>"'`]/g,d=/[&<>"'`]/,e=function(a){return b[a]||"&amp;"},f=a.toString();return d.test(f)?f.replace(c,e):f}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt;Ember.EventDispatcher=Ember.Object.extend({rootElement:"body",setup:function(b){var c,d={touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",keydown:"keyDown",keyup:"keyUp",keypress:"keyPress",mousedown:"mouseDown",mouseup:"mouseUp",contextmenu:"contextMenu",click:"click",dblclick:"doubleClick",mousemove:"mouseMove",focusin:"focusIn",focusout:"focusOut",mouseenter:"mouseEnter",mouseleave:"mouseLeave",submit:"submit",input:"input",change:"change",dragstart:"dragStart",drag:"drag",dragenter:"dragEnter",dragleave:"dragLeave",dragover:"dragOver",drop:"drop",dragend:"dragEnd"};Ember.$.extend(d,b||{});var e=Ember.$(a(this,"rootElement"));e.addClass("ember-application");for(c in d)d.hasOwnProperty(c)&&this.setupHandler(e,c,d[c])},setupHandler:function(a,b,c){var d=this;a.delegate(".ember-view",b+".ember",function(a,b){var e=Ember.View.views[this.id],f=!0,g=null;return g=d._findNearestEventManager(e,c),g&&g!==b?f=d._dispatchEvent(g,a,c,e):e?f=d._bubbleEvent(e,a,c):a.stopPropagation(),f}),a.delegate("[data-ember-action]",b+".ember",function(a){var b=Ember.$(a.currentTarget).attr("data-ember-action"),d=Ember.Handlebars.ActionHelper.registeredActions[b],e=d.handler;if(d.eventName===c)return e(a)})},_findNearestEventManager:function(b,c){var d=null;while(b){d=a(b,"eventManager");if(d&&d[c])break;b=a(b,"parentView")}return d},_dispatchEvent:function(a,b,c,d){var e=!0,f=a[c];return Ember.typeOf(f)==="function"?(e=f.call(a,b,d),b.stopPropagation()):e=this._bubbleEvent(d,b,c),e},_bubbleEvent:function(a,b,c){return Ember.run(function(){return a.handleEvent(c,b)})},destroy:function(){var b=a(this,"rootElement");return Ember.$(b).undelegate(".ember").removeClass("ember-application"),this._super()}})}(),function(){var a=Ember.run.queues;a.splice(Ember.$.inArray("actions",a)+1,0,"render")}(),function(){var a=Ember.get,b=Ember.set;Ember.ControllerMixin.reopen({target:null,controllers:null,namespace:null,view:null,connectOutlet:function(c,d){var e,f,g,h,i;Ember.typeOf(d)==="string"&&(e=c,c=d,d=arguments[2]),arguments.length===1?Ember.typeOf(c)==="object"&&(i=c,e=i.outletName,c=i.name,f=i.viewClass,h=i.controller,d=i.context):i={},e=e||"view";if(c){var j=a(this,"namespace"),k=a(this,"controllers"),l=c.charAt(0).toUpperCase()+c.substr(1)+"View";f=a(j,l),h=a(k,c+"Controller")}return h&&d&&h.set("content",d),g=f.create(),h&&b(g,"controller",h),b(this,e,g),g},connectControllers:function(){var c=a(this,"controllers"),d=Array.prototype.slice.apply(arguments),e;for(var f=0,g=d.length;f<g;f++)e=d[f]+"Controller",b(this,e,a(c,e))}})}(),function(){}(),function(){var a=Ember.get,b=Ember.set,c=Ember.addObserver,d=Ember.meta,e=Ember.String.fmt,f=[].slice,g=Ember.EnumerableUtils.forEach,h=Ember.computed(function(){var b=this._childViews,c=Ember.A();return g(b,function(b){b.isVirtual?c.pushObjects(a(b,"childViews")):c.push(b)}),c}).property().cacheable(),i=Ember.VIEW_PRESERVES_CONTEXT;Ember.TEMPLATES={};var j={preRender:{},inBuffer:{},hasElement:{},inDOM:{},destroyed:{}};Ember.View=Ember.Object.extend(Ember.Evented,{concatenatedProperties:["classNames","classNameBindings","attributeBindings"],isView:!0,templateName:null,layoutName:null,templates:Ember.TEMPLATES,template:Ember.computed(function(b,c){if(c!==undefined)return c;var d=a(this,"templateName"),e=this.templateForName(d,"template");return e||a(this,"defaultTemplate")}).property("templateName").cacheable(),controller:Ember.computed(function(b,c){var d;return arguments.length===2?c:(d=a(this,"parentView"),d?a(d,"controller"):null)}).property().cacheable(),layout:Ember.computed(function(b,c){if(arguments.length===2)return c;var d=a(this,"layoutName"),e=this.templateForName(d,"layout");return e||a(this,"defaultLayout")}).property("layoutName").cacheable(),templateForName:function(b,c){if(!b)return;var d=a(this,"templates"),f=a(d,b);if(!f)throw new Ember.Error(e('%@ - Unable to find %@ "%@".',[this,c,b]));return f},context:Ember.computed(function(c,d){return arguments.length===2?(b(this,"_context",d),d):a(this,"_context")}).cacheable(),_context:Ember.computed(function(b,c){var d,e,f;if(arguments.length===2)return c;if(i){if(e=a(this,"controller"))return e;d=a(this,"_parentView");if(d)return a(d,"_context")}return this}).cacheable(),_displayPropertyDidChange:Ember.observer(function(){this.rerender()},"context","controller"),parentView:Ember.computed(function(){var b=a(this,"_parentView");return b&&b.isVirtual?a(b,"parentView"):b}).property("_parentView").volatile(),_parentView:null,concreteView:Ember.computed(function(){return this.isVirtual?a(this,"parentView"):this}).property("_parentView").volatile(),isVisible:!0,childViews:h,_childViews:[],_childViewsWillChange:Ember.beforeObserver(function(){if(this.isVirtual){var b=a(this,"parentView");b&&Ember.propertyWillChange(b,"childViews")}},"childViews"),_childViewsDidChange:Ember.observer(function(){if(this.isVirtual){var b=a(this,"parentView");b&&Ember.propertyDidChange(b,"childViews")}},"childViews"),nearestInstanceOf:function(b){var c=a(this,"parentView");while(c){if(c instanceof b)return c;c=a(c,"parentView")}},nearestWithProperty:function(b){var c=a(this,"parentView");while(c){if(b in c)return c;c=a(c,"parentView")}},nearestChildOf:function(b){var c=a(this,"parentView");while(c){if(a(c,"parentView")instanceof b)return c;c=a(c,"parentView")}},collectionView:Ember.computed(function(){return this.nearestInstanceOf(Ember.CollectionView)}).cacheable(),itemView:Ember.computed(function(){return this.nearestChildOf(Ember.CollectionView)}).cacheable(),contentView:Ember.computed(function(){return this.nearestWithProperty("content")}).cacheable(),_parentViewDidChange:Ember.observer(function(){if(this.isDestroying)return;this.invokeRecursively(function(a){a.propertyDidChange("collectionView"),a.propertyDidChange("itemView"),a.propertyDidChange("contentView")}),a(this,"parentView.controller")&&!a(this,"controller")&&this.notifyPropertyChange("controller")},"_parentView"),_controllerDidChange:Ember.observer(function(){if(this.isDestroying)return;this.forEachChildView(function(a){a.propertyDidChange("controller")})},"controller"),cloneKeywords:function(){var c=a(this,"templateData"),d=c?Ember.copy(c.keywords):{};return b(d,"view",a(this,"concreteView")),b(d,"controller",a(this,"controller")),d},render:function(b){var c=a(this,"layout")||a(this,"template");if(c){var d=a(this,"_context"),e=this.cloneKeywords(),f={view:this,buffer:b,isRenderData:!0,keywords:e},g=c(d,{data:f});g!==undefined&&b.push(g)}},invokeForState:function(a){var b=this.state,c,d;if(d=j[b][a])return c=f.call(arguments),c[0]=this,d.apply(this,c);var e=this,g=e.states,h;while(g){h=g[b];while(h){d=h[a];if(d)return j[b][a]=d,c=f.call(arguments,1),c.unshift(this),d.apply(this,c);h=h.parentState}g=g.parent}},rerender:function(){return this.invokeForState("rerender")},clearRenderedChildren:function(){var a=this.lengthBeforeRender,b=this.lengthAfterRender,c=this._childViews;for(var d=b-1;d>=a;d--)c[d]&&c[d].destroy()},_applyClassNameBindings:function(){var b=a(this,"classNameBindings"),d=a(this,"classNames"),e,f,h;if(!b)return;g(b,function(a){var b,g=function(){f=this._classStringForProperty(a),e=this.$(),b&&(e.removeClass(b),d.removeObject(b)),f?(e.addClass(f),b=f):b=null};h=this._classStringForProperty(a),h&&(d.push(h),b=h);var i=Ember.View._parsePropertyPath(a);c(this,i.path,g)},this)},_applyAttributeBindings:function(b){var d=a(this,"attributeBindings"),e,f,h;if(!d)return;g(d,function(d){var g=d.split(":"),h=g[0],i=g[1]||h,j=function(){f=this.$();if(!f)return;e=a(this,h),Ember.View.applyAttributeBindings(f,i,e)};c(this,h,j),e=a(this,h),Ember.View.applyAttributeBindings(b,i,e)},this)},_classStringForProperty:function(b){var c=Ember.View._parsePropertyPath(b),d=c.path,e=a(this,d);return e===undefined&&Ember.isGlobalPath(d)&&(e=a(window,d)),Ember.View._classStringForValue(d,e,c.className,c.falsyClassName)},element:Ember.computed(function(a,b){return b!==undefined?this.invokeForState("setElement",b):this.invokeForState("getElement")}).property("_parentView").cacheable(),$:function(a){return this.invokeForState("$",a)},mutateChildViews:function(a){var b=this._childViews,c=b.length,d;while(--c>=0)d=b[c],a.call(this,d,c);return this},forEachChildView:function(a){var b=this._childViews;if(!b)return this;var c=b.length,d,e;for(e=0;e<c;e++)d=b[e],a.call(this,d);return this},appendTo:function(a){return this._insertElementLater(function(){this.$().appendTo(a)}),this},replaceIn:function(a){return this._insertElementLater(function(){Ember.$(a).empty(),this.$().appendTo(a)}),this},_insertElementLater:function(a){this._lastInsert=Ember.guidFor(a),Ember.run.schedule("render",this,this.invokeForState,"insertElement",a)},append:function(){return this.appendTo(document.body)},remove:function(){this.destroyElement(),this.invokeRecursively(function(a){a.clearRenderedChildren()})},elementId:Ember.computed(function(a,b){return b!==undefined?b:Ember.guidFor(this)}).cacheable(),_elementIdDidChange:Ember.beforeObserver(function(){throw"Changing a view's elementId after creation is not allowed."},"elementId"),findElementInParentElement:function(b){var c="#"+a(this,"elementId");return Ember.$(c)[0]||Ember.$(c,b)[0]},renderBuffer:function(b){b=b||a(this,"tagName");if(b===null||b===undefined)b="div";return Ember.RenderBuffer(b)},createElement:function(){if(a(this,"element"))return this;var c=this.renderToBuffer();return b(this,"element",c.element()),this},willInsertElement:Ember.K,didInsertElement:Ember.K,willRerender:Ember.K,invokeRecursively:function(a){a.call(this,this),this.forEachChildView(function(b){b.invokeRecursively(a)})},invalidateRecursively:function(a){this.forEachChildView(function(b){b.propertyDidChange(a)})},_notifyWillInsertElement:function(){this.invokeRecursively(function(a){a.trigger("willInsertElement")})},_notifyDidInsertElement:function(){this.invokeRecursively(function(a){a.trigger("didInsertElement")})},_notifyWillRerender:function(){this.invokeRecursively(function(a){a.trigger("willRerender")})},destroyElement:function(){return this.invokeForState("destroyElement")},willDestroyElement:function(){},_notifyWillDestroyElement:function(){this.invokeRecursively(function(a){a.trigger("willDestroyElement")})},_elementWillChange:Ember.beforeObserver(function(){this.forEachChildView(function(a){Ember.propertyWillChange(a,"element")})},"element"),_elementDidChange:Ember.observer(function(){this.forEachChildView(function(a){Ember.propertyDidChange(a,"element")})},"element"),parentViewDidChange:Ember.K,renderToBuffer:function(b,c){var d;Ember.run.sync(),c=c||"begin";if(b){var e=a(this,"tagName");if(e===null||e===undefined)e="div";d=b[c](e)}else d=this.renderBuffer();return this.buffer=d,this.transitionTo("inBuffer",!1),this.lengthBeforeRender=this._childViews.length,this.beforeRender(d),this.render(d),this.afterRender(d),this.lengthAfterRender=this._childViews.length,d},beforeRender:function(a){this.applyAttributesToBuffer(a)},afterRender:Ember.K,applyAttributesToBuffer:function(b){this._applyClassNameBindings(),this._applyAttributeBindings(b),g(a(this,"classNames"),function(a){b.addClass(a)}),b.id(a(this,"elementId"));var c=a(this,"ariaRole");c&&b.attr("role",c),a(this,"isVisible")===!1&&b.style("display","none")},tagName:null,ariaRole:null,classNames:["ember-view"],classNameBindings:[],attributeBindings:[],state:"preRender",init:function(){this._super(),this.isVirtual||(Ember.View.views[a(this,"elementId")]=this),this._childViews=this._childViews.slice(),this.classNameBindings=Ember.A(this.classNameBindings.slice()),this.classNames=Ember.A(this.classNames.slice());var c=a(this,"viewController");c&&(c=a(c),c&&b(c,"view",this))},appendChild:function(a,b){return this.invokeForState("appendChild",a,b)},removeChild:function(a){if(this.isDestroying)return;b(a,"_parentView",null);var c=this._childViews;return Ember.EnumerableUtils.removeObject(c,a),this.propertyDidChange("childViews"),this},removeAllChildren:function(){return this.mutateChildViews(function(a){this.removeChild(a)})},destroyAllChildren:function(){return this.mutateChildViews(function(a){a.destroy()})},removeFromParent:function(){var b=a(this,"_parentView");return this.remove(),b&&b.removeChild(this),this},willDestroy:function(){var c=this._childViews,d=a(this,"_parentView"),e;this.removedFromDOM||this.destroyElement();if(this.viewName){var f=a(this,"parentView");f&&b(f,this.viewName,null)}d&&d.removeChild(this),this.state="destroyed",e=c.length;for(var g=e-1;g>=0;g--)c[g].removedFromDOM=!0,c[g].destroy();this.isVirtual||delete Ember.View.views[a(this,"elementId")]},createChildView:function(c,d){return Ember.View.detect(c)?(d=d||{},d._parentView=this,d.templateData=d.templateData||a(this,"templateData"),c=c.create(d),c.viewName&&b(a(this,"concreteView"),c.viewName,c)):(a(c,"templateData")||b(c,"templateData",a(this,"templateData")),b(c,"_parentView",this)),c},becameVisible:Ember.K,becameHidden:Ember.K,_isVisibleDidChange:Ember.observer(function(){var b=this.$();if(!b)return;var c=a(this,"isVisible");b.toggle(c);if(this._isAncestorHidden())return;c?this._notifyBecameVisible():this._notifyBecameHidden()},"isVisible"),_notifyBecameVisible:function(){this.trigger("becameVisible"),this.forEachChildView(function(b){var c=a(b,"isVisible");(c||c===null)&&b._notifyBecameVisible()})},_notifyBecameHidden:function(){this.trigger("becameHidden"),this.forEachChildView(function(b){var c=a(b,"isVisible");(c||c===null)&&b._notifyBecameHidden()})},_isAncestorHidden:function(){var b=a(this,"parentView");while(b){if(a(b,"isVisible")===!1)return!0;b=a(b,"parentView")}return!1},clearBuffer:function(){this.invokeRecursively(function(a){this.buffer=null})},transitionTo:function(a,b){this.state=a,b!==!1&&this.forEachChildView(function(b){b.transitionTo(a)})},trigger:function(a){this._super.apply(this,arguments);var b=this[a];if(b){var c=[],d,e;for(d=1,e=arguments.length;d<e;d++)c.push(arguments[d]);return b.apply(this,c)}},has:function(a){return Ember.typeOf(this[a])==="function"||this._super(a)},handleEvent:function(a,b){return this.invokeForState("handleEvent",a,b)}});var k={prepend:function(a,b){b._insertElementLater(function(){var c=a.$();c.prepend(b.$())})},after:function(a,b){b._insertElementLater(function(){var c=a.$();c.after(b.$())})},replace:function(c){var d=a(c,"element");b(c,"element",null),c._insertElementLater(function(){Ember.$(d).replaceWith(a(c,"element"))})},remove:function(c){var d=a(c,"element");b(c,"element",null),c._lastInsert=null,Ember.$(d).remove()},empty:function(a){a.$().empty()}};Ember.View.reopen({states:Ember.View.states,domManager:k}),Ember.View.reopenClass({_parsePropertyPath:function(a){var b=a.split(/:/),c=b[0],d="",e,f;return b.length>1&&(e=b[1],b.length===3&&(f=b[2]),d=":"+e,f&&(d+=":"+f)),{path:c,classNames:d,className:e===""?undefined:e,falsyClassName:f}},_classStringForValue:function(a,b,c,d){if(!!b&&c)return c;if(b===!0){if(b===!0&&!c&&d)return null;var e=a.split(".");return Ember.String.dasherize(e[e.length-1])}return b===!1&&d?d:b!==!1&&b!==undefined&&b!==null?b:null}}),Ember.View.views={},Ember.View.childViewsProperty=h,Ember.View.applyAttributeBindings=function(a,b,c){var d=Ember.typeOf(c),e=a.attr(b);(d==="string"||d==="number"&&!isNaN(c))&&c!==e?a.attr(b,c):c&&d==="boolean"?a.attr(b,b):c||a.removeAttr(b)}}(),function(){var a=Ember.get,b=Ember.set;Ember.View.states={_default:{appendChild:function(){throw"You can't use appendChild outside of the rendering process"},$:function(){return undefined},getElement:function(){return null},handleEvent:function(){return!0},destroyElement:function(a){return b(a,"element",null),a._lastInsert=null,a}}},Ember.View.reopen({states:Ember.View.states})}(),function(){Ember.View.states.preRender={parentState:Ember.View.states._default,insertElement:function(a,b){if(a._lastInsert!==Ember.guidFor(b))return;a.createElement(),a._notifyWillInsertElement(),b.call(a),a.transitionTo("inDOM"),a._notifyDidInsertElement()},empty:Ember.K,setElement:function(a,b){return b!==null&&a.transitionTo("hasElement"),b}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta;Ember.View.states.inBuffer={parentState:Ember.View.states._default,$:function(a,b){return a.rerender(),Ember.$()},rerender:function(a){a._notifyWillRerender(),a.clearRenderedChildren(),a.renderToBuffer(a.buffer,"replaceWith")},appendChild:function(a,b,c){var d=a.buffer;return b=this.createChildView(b,c),a._childViews.push(b),b.renderToBuffer(d),a.propertyDidChange("childViews"),b},destroyElement:function(a){return a.clearBuffer(),a._notifyWillDestroyElement(),a.transitionTo("preRender"),a},empty:function(){},insertElement:function(){throw"You can't insert an element that has already been rendered"},setElement:function(a,b){return b===null?a.transitionTo("preRender"):(a.clearBuffer(),a.transitionTo("hasElement")),b}}}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta;Ember.View.states.hasElement={parentState:Ember.View.states._default,$:function(b,c){var d=a(b,"element");return c?Ember.$(c,d):Ember.$(d)},getElement:function(b){var c=a(b,"parentView");return c&&(c=a(c,"element")),c?b.findElementInParentElement(c):Ember.$("#"+a(b,"elementId"))[0]},setElement:function(a,b){if(b!==null)throw"You cannot set an element to a non-null value when the element is already in the DOM.";return a.transitionTo("preRender"),b},rerender:function(a){return a._notifyWillRerender(),a.clearRenderedChildren(),a.domManager.replace(a),a},destroyElement:function(a){return a._notifyWillDestroyElement(),a.domManager.remove(a),a},empty:function(a){var b=a._childViews,c,d;if(b){c=b.length;for(d=0;d<c;d++)b[d]._notifyWillDestroyElement()}a.domManager.empty(a)},handleEvent:function(a,b,c){return a.has(b)?a.trigger(b,c):!0}},Ember.View.states.inDOM={parentState:Ember.View.states.hasElement,insertElement:function(a,b){if(a._lastInsert!==Ember.guidFor(b))return;throw"You can't insert an element into the DOM that has already been inserted"}}}(),function(){var a="You can't call %@ on a destroyed view",b=Ember.String.fmt;Ember.View.states.destroyed={parentState:Ember.View.states._default,appendChild:function(){throw b(a,["appendChild"])},rerender:function(){throw b(a,["rerender"])},destroyElement:function(){throw b(a,["destroyElement"])},empty:function(){throw b(a,["empty"])},setElement:function(){throw b(a,["set('element', ...)"])},insertElement:Ember.K}}(),function(){}(),function(){var a=Ember.get,b=Ember.set,c=Ember.meta,d=Ember.EnumerableUtils.forEach,e=Ember.computed(function(){return a(this,"_childViews")}).property("_childViews").cacheable();Ember.ContainerView=Ember.View.extend({init:function(){this._super();var c=a(this,"childViews");Ember.defineProperty(this,"childViews",e);var f=this._childViews;d(c,function(c,d){var e;"string"==typeof c?(e=a(this,c),e=this.createChildView(e),b(this,c,e)):e=this.createChildView(c),f[d]=e},this);var g=a(this,"currentView");g&&f.push(this.createChildView(g)),Ember.A(f),a(this,"childViews").addArrayObserver(this,{willChange:"childViewsWillChange",didChange:"childViewsDidChange"})},render:function(a){this.forEachChildView(function(b){b.renderToBuffer(a)})},willDestroy:function(){a(this,"childViews").removeArrayObserver(this,{willChange:"childViewsWillChange",didChange:"childViewsDidChange"}),this._super()},childViewsWillChange:function(a,b,c){if(c===0)return;var d=a.slice(b,b+c);this.initializeViews(d,null,null),this.invokeForState("childViewsWillChange",a,b,c)},childViewsDidChange:function(b,c,d,e){var f=a(b,"length");if(e===0)return;var g=b.slice(c,c+e);this.initializeViews(g,this,a(this,"templateData")),this.invokeForState("childViewsDidChange",b,c,e)},initializeViews:function(c,e,f){d(c,function(c){b(c,"_parentView",e),a(c,"templateData")||b(c,"templateData",f)})},_scheduleInsertion:function(a,b){b?b.domManager.after(b,a):this.domManager.prepend(this,a)},currentView:null,_currentViewWillChange:Ember.beforeObserver(function(){var b=a(this,"childViews"),c=a(this,"currentView");c&&(b.removeObject(c),c.destroy())},"currentView"),_currentViewDidChange:Ember.observer(function(){var b=a(this,"childViews"),c=a(this,"currentView");c&&b.pushObject(c)},"currentView")}),Ember.ContainerView.states={parent:Ember.View.states,inBuffer:{childViewsDidChange:function(a,b,c,d){var e=a.buffer,f,g,h,i;c===0?(i=b[c],f=c+1,i.renderToBuffer(e,"prepend")):(i=b[c-1],f=c);for(var j=f;j<c+d;j++)g=i,i=b[j],h=g.buffer,i.renderToBuffer(h,"insertAfter")}},hasElement:{childViewsWillChange:function(a,b,c,d){for(var e=c;e<c+d;e++)b[e].remove()},childViewsDidChange
-:function(a,b,c,d){var e=c===0?null:b[c-1];for(var f=c;f<c+d;f++)a=b[f],this._scheduleInsertion(a,e),e=a}}},Ember.ContainerView.states.inDOM={parentState:Ember.ContainerView.states.hasElement},Ember.ContainerView.reopen({states:Ember.ContainerView.states})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt;Ember.CollectionView=Ember.ContainerView.extend({content:null,emptyViewClass:Ember.View,emptyView:null,itemViewClass:Ember.View,init:function(){var a=this._super();return this._contentDidChange(),a},_contentWillChange:Ember.beforeObserver(function(){var b=this.get("content");b&&b.removeArrayObserver(this);var c=b?a(b,"length"):0;this.arrayWillChange(b,0,c)},"content"),_contentDidChange:Ember.observer(function(){var b=a(this,"content");b&&b.addArrayObserver(this);var c=b?a(b,"length"):0;this.arrayDidChange(b,0,null,c)},"content"),willDestroy:function(){var b=a(this,"content");b&&b.removeArrayObserver(this),this._super()},arrayWillChange:function(b,c,d){var e=a(this,"emptyView");e&&e instanceof Ember.View&&e.removeFromParent();var f=a(this,"childViews"),g,h,i;i=a(f,"length");var j=d===i;j&&this.invokeForState("empty");for(h=c+d-1;h>=c;h--)g=f[h],j&&(g.removedFromDOM=!0),g.destroy()},arrayDidChange:function(c,d,e,f){var g=a(this,"itemViewClass"),h=a(this,"childViews"),i=[],j,k,l,m,n;"string"==typeof g&&(g=a(g)),m=c?a(c,"length"):0;if(m)for(l=d;l<d+f;l++)k=c.objectAt(l),j=this.createChildView(g,{content:k,contentIndex:l}),i.push(j);else{var o=a(this,"emptyView");if(!o)return;o=this.createChildView(o),i.push(o),b(this,"emptyView",o)}h.replace(d,0,i)},createChildView:function(c,d){c=this._super(c,d);var e=a(c,"tagName"),f=e===null||e===undefined?Ember.CollectionView.CONTAINER_MAP[a(this,"tagName")]:e;return b(c,"tagName",f),c}}),Ember.CollectionView.CONTAINER_MAP={ul:"li",ol:"li",table:"tr",thead:"tr",tbody:"tr",tfoot:"tr",tr:"td",select:"option"}}(),function(){}(),function(){}(),function(){var a=Ember.get,b=Ember.set;Ember.State=Ember.Object.extend(Ember.Evented,{isState:!0,parentState:null,start:null,name:null,path:Ember.computed(function(){var b=a(this,"parentState.path"),c=a(this,"name");return b&&(c=b+"."+c),c}).property().cacheable(),trigger:function(a){this[a]&&this[a].apply(this,[].slice.call(arguments,1)),this._super.apply(this,arguments)},init:function(){var c=a(this,"states"),d;b(this,"childStates",Ember.A()),b(this,"eventTransitions",a(this,"eventTransitions")||{});var e,f,g;if(!c){c={};for(e in this){if(e==="constructor")continue;if(f=this[e]){if(g=f.transitionTarget)this.eventTransitions[e]=g;this.setupChild(c,e,f)}}b(this,"states",c)}else for(e in c)this.setupChild(c,e,c[e]);b(this,"pathsCache",{}),b(this,"pathsCacheNoContext",{})},setupChild:function(c,d,e){if(!e)return!1;e.isState?b(e,"name",d):Ember.State.detect(e)&&(e=e.create({name:d})),e.isState&&(b(e,"parentState",this),a(this,"childStates").pushObject(e),c[d]=e)},lookupEventTransition:function(a){var b,c=this;while(c&&!b)b=c.eventTransitions[a],c=c.get("parentState");return b},isLeaf:Ember.computed(function(){return!a(this,"childStates").length}).cacheable(),hasContext:!0,setup:Ember.K,enter:Ember.K,exit:Ember.K});var c=Ember.$&&Ember.$.Event;Ember.State.reopenClass({transitionTo:function(a){var b=function(b,d){if(c&&d instanceof c){if(!d.hasOwnProperty("context"))return b.transitionTo(a);d=d.context}b.transitionTo(a,d)};return b.transitionTarget=a,b}})}(),function(){var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.ArrayPolyfills.forEach,e=function(a){this.enterStates=a.enterStates.slice(),this.exitStates=a.exitStates.slice(),this.resolveState=a.resolveState,this.finalState=a.enterStates[a.enterStates.length-1]||a.resolveState};e.prototype={normalize:function(a,b){return this.matchContextsToStates(b),this.addInitialStates(),this.removeUnchangedContexts(a),this},matchContextsToStates:function(b){var c=this.enterStates.length-1,d=[],e,f;while(b.length>0){if(c>=0)e=this.enterStates[c--];else{if(this.enterStates.length){e=a(this.enterStates[0],"parentState");if(!e)throw"Cannot match all contexts to states"}else e=this.resolveState;this.enterStates.unshift(e),this.exitStates.unshift(e)}a(e,"hasContext")?f=b.pop():f=null,d.unshift(f)}this.contexts=d},addInitialStates:function(){var b=this.finalState,c;for(;;){c=a(b,"initialState")||"start",b=a(b,"states."+c);if(!b)break;this.finalState=b,this.enterStates.push(b),this.contexts.push(undefined)}},removeUnchangedContexts:function(a){while(this.enterStates.length>0){if(this.enterStates[0]!==this.exitStates[0])break;if(this.enterStates.length===this.contexts.length){if(a.getStateMeta(this.enterStates[0],"context")!==this.contexts[0])break;this.contexts.shift()}this.resolveState=this.enterStates.shift(),this.exitStates.shift()}}},Ember.StateManager=Ember.State.extend({init:function(){this._super(),b(this,"stateMeta",Ember.Map.create());var c=a(this,"initialState");!c&&a(this,"states.start")&&(c="start"),c&&this.transitionTo(c)},stateMetaFor:function(b){var c=a(this,"stateMeta"),d=c.get(b);return d||(d={},c.set(b,d)),d},setStateMeta:function(a,c,d){return b(this.stateMetaFor(a),c,d)},getStateMeta:function(b,c){return a(this.stateMetaFor(b),c)},currentState:null,transitionEvent:"setup",errorOnUnhandledEvent:!0,send:function(b,c){return this.sendRecursively(b,a(this,"currentState"),c)},sendRecursively:function(b,d,e){var f=this.enableLogging,g=d[b];if(typeof g=="function")return f&&Ember.Logger.log(c("STATEMANAGER: Sending event '%@' to state %@.",[b,a(d,"path")])),g.call(d,this,e);var h=a(d,"parentState");if(h)return this.sendRecursively(b,h,e);if(a(this,"errorOnUnhandledEvent"))throw new Ember.Error(this.toString()+" could not respond to event "+b+" in state "+a(this,"currentState.path")+".")},getStateByPath:function(b,c){var d=c.split("."),e=b;for(var f=0,g=d.length;f<g;f++){e=a(a(e,"states"),d[f]);if(!e)break}return e},findStateByPath:function(b,c){var d;while(!d&&b)d=this.getStateByPath(b,c),b=a(b,"parentState");return d},findStatesByPath:function(b,c){if(!c||c==="")return undefined;var d=c.split("."),e=[];for(var f=0,g=d.length;f<g;f++){var h=a(b,"states");if(!h)return undefined;var i=a(h,d[f]);if(!i)return undefined;b=i,e.push(i)}return e},goToState:function(){return this.transitionTo.apply(this,arguments)},transitionTo:function(b,c){if(Ember.empty(b))return;var d=c?Array.prototype.slice.call(arguments,1):[],f=a(this,"currentState")||this,g=this.contextFreeTransition(f,b),h=(new e(g)).normalize(this,d);this.enterState(h),this.triggerSetupContext(h)},contextFreeTransition:function(b,c){var d=b.pathsCache[c];if(d)return d;var e=this.findStatesByPath(b,c),f=[],g=b;while(g&&!e){f.unshift(g),g=a(g,"parentState");if(!g){e=this.findStatesByPath(this,c);if(!e)return}e=this.findStatesByPath(g,c)}while(e.length>0&&e[0]===f[0])g=e.shift(),f.shift();var h=b.pathsCache[c]={exitStates:f,enterStates:e,resolveState:g};return h},triggerSetupContext:function(b){var c=b.contexts,e=b.enterStates.length-c.length,f=b.enterStates,g=a(this,"transitionEvent");d.call(f,function(a,b){a.trigger(g,this,c[b-e])},this)},getState:function(b){var c=a(this,b),d=a(this,"parentState");if(c)return c;if(d)return d.getState(b)},enterState:function(c){var e=this.enableLogging,f=c.exitStates.slice(0).reverse();d.call(f,function(a){a.trigger("exit",this)},this),d.call(c.enterStates,function(b){e&&Ember.Logger.log("STATEMANAGER: Entering "+a(b,"path")),b.trigger("enter",this)},this),b(this,"currentState",c.finalState)}})}(),function(){}(),function(){var a=Ember.get;Ember._ResolvedState=Ember.Object.extend({manager:null,state:null,match:null,object:Ember.computed(function(b,c){if(arguments.length===2)return this._object=c,c;if(this._object)return this._object;var d=a(this,"state"),e=a(this,"match"),f=a(this,"manager");return d.deserialize(f,e.hash)}).property(),hasPromise:Ember.computed(function(){return Ember.canInvoke(a(this,"object"),"then")}).property("object"),promise:Ember.computed(function(){var b=a(this,"object");return Ember.canInvoke(b,"then")?b:{then:function(a){a(b)}}}).property("object"),transition:function(){var b=a(this,"manager"),c=a(this,"state.path"),d=a(this,"object");b.transitionTo(c,d)}})}(),function(){var a=Ember.get,b=function(a){var b=a.toString(),c=b.split("."),d=c[c.length-1];return Ember.String.underscore(d)+"_id"},c=function(a,b){for(var c in b){if(!b.hasOwnProperty(c))continue;if(a.hasOwnProperty(c))continue;a[c]=b[c]}};Ember.Routable=Ember.Mixin.create({init:function(){var b;this.on("connectOutlets",this,this.stashContext);if(b=a(this,"redirectsTo"))this.connectOutlets=function(a){a.transitionTo(b)};var c=a(this,"route");c===""&&(c="/"),this._super()},stashContext:function(b,c){var d=this.serialize(b,c);b.setStateMeta(this,"context",c),b.setStateMeta(this,"serialized",d),a(this,"isRoutable")&&!a(b,"isRouting")&&this.updateRoute(b,a(b,"location"))},updateRoute:function(b,c){if(a(this,"isLeafRoute")){var d=this.absoluteRoute(b);c.setURL(d)}},absoluteRoute:function(b,d){var e=a(this,"parentState"),f="",g;a(e,"isRoutable")&&(f=e.absoluteRoute(b,d));var h=a(this,"routeMatcher"),i=b.getStateMeta(this,"serialized");return d=d||{},c(d,i),g=h&&h.generate(d),g&&(f=f+"/"+g),f},isRoutable:Ember.computed(function(){return typeof a(this,"route")=="string"}).cacheable(),isLeafRoute:Ember.computed(function(){return a(this,"isLeaf")?!0:!a(this,"childStates").findProperty("isRoutable")}).cacheable(),routeMatcher:Ember.computed(function(){var b=a(this,"route");if(b)return Ember._RouteMatcher.create({route:b})}).cacheable(),hasContext:Ember.computed(function(){var b=a(this,"routeMatcher");if(b)return b.identifiers.length>0}).cacheable(),modelClass:Ember.computed(function(){var b=a(this,"modelType");return typeof b=="string"?Ember.get(window,b):b}).cacheable(),modelClassFor:function(b){var c,d,e,f,g;if(c=a(this,"modelClass"))return c;if(!b)return;d=a(this,"routeMatcher");if(!d)return;e=d.identifiers;if(e.length!==2)return;f=e[1].match(/^(.*)_id$/);if(!f)return;return g=Ember.String.classify(f[1]),a(b,g)},deserialize:function(c,d){var e,f,g;return(e=this.modelClassFor(a(c,"namespace")))?e.find(d[b(e)]):d},serialize:function(c,d){var e,f,g,h,i;if(Ember.empty(d))return"";if(e=this.modelClassFor(a(c,"namespace")))h=b(e),i=a(d,"id"),d={},d[h]=i;return d},resolvePath:function(b,c){if(a(this,"isLeafRoute"))return Ember.A();var d=a(this,"childStates"),e;d=Ember.A(d.filterProperty("isRoutable")),d=d.sort(function(b,c){var d=a(b,"routeMatcher.identifiers.length"),e=a(c,"routeMatcher.identifiers.length"),f=a(b,"route"),g=a(c,"route");return f.indexOf(g)===0?-1:g.indexOf(f)===0?1:d!==e?d-e:a(c,"route.length")-a(b,"route.length")});var f=d.find(function(b){var d=a(b,"routeMatcher");if(e=d.match(c))return!0}),g=Ember._ResolvedState.create({manager:b,state:f,match:e}),h=f.resolvePath(b,e.remaining);return Ember.A([g]).pushObjects(h)},routePath:function(b,c){function f(){d.forEach(function(a){a.transition()})}if(a(this,"isLeafRoute"))return;var d=this.resolvePath(b,c),e=d.some(function(b){return a(b,"hasPromise")});e?(b.transitionTo("loading"),b.handleStatePromises(d,f)):f()},unroutePath:function(b,c){var d=a(this,"parentState");if(d===b)return;c=c.replace(/^(?=[^\/])/,"/");var e=this.absoluteRoute(b),f=a(this,"route");if(f!=="/"){var g=c.indexOf(e),h=c.charAt(e.length);if(g===0&&(h==="/"||h===""))return}b.enterState({exitStates:[this],enterStates:[],finalState:d}),b.send("unroutePath",c)},connectOutlets:Ember.K,navigateAway:Ember.K})}(),function(){Ember.Route=Ember.State.extend(Ember.Routable)}(),function(){var a=function(a){return a.replace(/[\-\[\]{}()*+?.,\\\^\$|#\s]/g,"\\$&")};Ember._RouteMatcher=Ember.Object.extend({state:null,init:function(){var b=this.route,c=[],d=1,e;b.charAt(0)==="/"&&(b=this.route=b.substr(1)),e=a(b);var f=e.replace(/:([a-z_]+)(?=$|\/)/gi,function(a,b){return c[d++]=b,"([^/]+)"});this.identifiers=c,this.regex=new RegExp("^/?"+f)},match:function(a){var b=a.match(this.regex);if(b){var c=this.identifiers,d={};for(var e=1,f=c.length;e<f;e++)d[c[e]]=b[e];return{remaining:a.substr(b[0].length),hash:c.length>0?d:null}}},generate:function(a){var b=this.identifiers,c=this.route,d;for(var e=1,f=b.length;e<f;e++)d=b[e],c=c.replace(new RegExp(":"+d),a[d]);return c}})}(),function(){var a=Ember.get,b=Ember.set,c=function(a,b){for(var c in b){if(!b.hasOwnProperty(c))continue;if(a.hasOwnProperty(c))continue;a[c]=b[c]}};Ember.Router=Ember.StateManager.extend({initialState:"root",location:"hash",rootURL:"/",transitionEvent:"connectOutlets",transitionTo:function(){this.abortRoutingPromises(),this._super.apply(this,arguments)},route:function(c){this.abortRoutingPromises(),b(this,"isRouting",!0);var d;try{c=c.replace(/^(?=[^\/])/,"/"),this.send("navigateAway"),this.send("unroutePath",c),d=a(this,"currentState");while(d&&!d.get("isRoutable"))d=a(d,"parentState");var e=d?d.absoluteRoute(this):"",f=c.substr(e.length);this.send("routePath",f)}finally{b(this,"isRouting",!1)}d=a(this,"currentState");while(d&&!d.get("isRoutable"))d=a(d,"parentState");d&&d.updateRoute(this,a(this,"location"))},urlFor:function(b,c){var d=a(this,"currentState")||this,e=this.findStateByPath(d,b),f=a(this,"location"),g=e.absoluteRoute(this,c);return f.formatURL(g)},urlForEvent:function(b){var c=Array.prototype.slice.call(arguments,1),d=a(this,"currentState"),e=d.lookupEventTransition(b),f=this.findStateByPath(d,e),g=this.serializeRecursively(f,c,{});return this.urlFor(e,g)},serializeRecursively:function(b,d,e){var f,g=a(b,"hasContext")?d.pop():null;return c(e,b.serialize(this,g)),f=b.get("parentState"),f&&f instanceof Ember.Route?this.serializeRecursively(f,d,e):e},abortRoutingPromises:function(){this._routingPromises&&(this._routingPromises.abort(),this._routingPromises=null)},handleStatePromises:function(a,c){this.abortRoutingPromises(),this.set("isLocked",!0);var d=this;this._routingPromises=Ember._PromiseChain.create({promises:a.slice(),successCallback:function(){d.set("isLocked",!1),c()},failureCallback:function(){throw"Unable to load object"},promiseSuccessCallback:function(a,c){b(a,"object",c[0])},abortCallback:function(){d.set("isLocked",!1)}}).start()},init:function(){this._super();var c=a(this,"location"),d=a(this,"rootURL");"string"==typeof c&&b(this,"location",Ember.Location.create({implementation:c,rootURL:d}))},willDestroy:function(){a(this,"location").destroy()}})}(),function(){}(),function(){var a=Ember.get;Ember.StateManager.reopen({currentView:Ember.computed(function(){var b=a(this,"currentState"),c;while(b){if(a(b,"isViewState")){c=a(b,"view");if(c)return c}b=a(b,"parentState")}return null}).property("currentState").cacheable()})}(),function(){var a=Ember.get,b=Ember.set;Ember.ViewState=Ember.State.extend({isViewState:!0,init:function(){return this._super()},enter:function(c){var d=a(this,"view"),e,f;d&&(Ember.View.detect(d)&&(d=d.create(),b(this,"view",d)),e=c.get("rootView"),e?(f=a(e,"childViews"),f.pushObject(d)):(e=c.get("rootElement")||"body",d.appendTo(e)))},exit:function(b){var c=a(this,"view");c&&(a(c,"parentView")?c.removeFromParent():c.remove())}})}(),function(){}(),function(){(function(a){var b=function(){},c=0,d=a.document,e="createRange"in d&&typeof Range!="undefined"&&Range.prototype.createContextualFragment,f=function(){var a=d.createElement("div");return a.innerHTML="<div></div>",a.firstChild.innerHTML="<script></script>",a.firstChild.innerHTML===""}(),g=function(a){var d;this instanceof g?d=this:d=new b,d.innerHTML=a;var e="metamorph-"+c++;return d.start=e+"-start",d.end=e+"-end",d};b.prototype=g.prototype;var h,i,j,k,l,m,n,o,p;k=function(){return this.startTag()+this.innerHTML+this.endTag()},o=function(){return"<script id='"+this.start+"' type='text/x-placeholder'></script>"},p=function(){return"<script id='"+this.end+"' type='text/x-placeholder'></script>"};if(e)h=function(a,b){var c=d.createRange(),e=d.getElementById(a.start),f=d.getElementById(a.end);return b?(c.setStartBefore(e),c.setEndAfter(f)):(c.setStartAfter(e),c.setEndBefore(f)),c},i=function(a,b){var c=h(this,b);c.deleteContents();var d=c.createContextualFragment(a);c.insertNode(d)},j=function(){var a=h(this,!0);a.deleteContents()},l=function(a){var b=d.createRange();b.setStart(a),b.collapse(!1);var c=b.createContextualFragment(this.outerHTML());a.appendChild(c)},m=function(a){var b=d.createRange(),c=d.getElementById(this.end);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)},n=function(a){var b=d.createRange(),c=d.getElementById(this.start);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)};else{var q={select:[1,"<select multiple='multiple'>","</select>"],fieldset:[1,"<fieldset>","</fieldset>"],table:[1,"<table>","</table>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"],colgroup:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],map:[1,"<map>","</map>"],_default:[0,"",""]},r=function(a,b){var c=q[a.tagName.toLowerCase()]||q._default,e=c[0],g=c[1],h=c[2];f&&(b="&shy;"+b);var i=d.createElement("div");i.innerHTML=g+b+h;for(var j=0;j<=e;j++)i=i.firstChild;if(f){var k=i;while(k.nodeType===1&&!k.nodeName)k=k.firstChild;k.nodeType===3&&k.nodeValue.charAt(0)==="­"&&(k.nodeValue=k.nodeValue.slice(1))}return i},s=function(a){while(a.parentNode.tagName==="")a=a.parentNode;return a},t=function(a,b){a.parentNode!==b.parentNode&&b.parentNode.insertBefore(a,b.parentNode.firstChild)};i=function(a,b){var c=s(d.getElementById(this.start)),e=d.getElementById(this.end),f=e.parentNode,g,h,i;t(c,e),g=c.nextSibling;while(g){h=g.nextSibling,i=g===e;if(i){if(!b)break;e=g.nextSibling}g.parentNode.removeChild(g);if(i)break;g=h}g=r(c.parentNode,a);while(g)h=g.nextSibling,f.insertBefore(g,e),g=h},j=function(){var a=s(d.getElementById(this.start)),b=d.getElementById(this.end);this.html(""),a.parentNode.removeChild(a),b.parentNode.removeChild(b)},l=function(a){var b=r(a,this.outerHTML());while(b)nextSibling=b.nextSibling,a.appendChild(b),b=nextSibling},m=function(a){var b=d.getElementById(this.end),c=b.nextSibling,e=b.parentNode,f,g;g=r(e,a);while(g)f=g.nextSibling,e.insertBefore(g,c),g=f},n=function(a){var b=d.getElementById(this.start),c=b.parentNode,e,f;f=r(c,a);var g=b.nextSibling;while(f)e=f.nextSibling,c.insertBefore(f,g),f=e}}g.prototype.html=function(a){this.checkRemoved();if(a===undefined)return this.innerHTML;i.call(this,a),this.innerHTML=a},g.prototype.replaceWith=function(a){this.checkRemoved(),i.call(this,a,!0)},g.prototype.remove=j,g.prototype.outerHTML=k,g.prototype.appendTo=l,g.prototype.after=m,g.prototype.prepend=n,g.prototype.startTag=o,g.prototype.endTag=p,g.prototype.isRemoved=function(){var a=d.getElementById(this.start),b=d.getElementById(this.end);return!a||!b},g.prototype.checkRemoved=function(){if(this.isRemoved())throw new Error("Cannot perform operations on a Metamorph that is not in the DOM.")},a.Metamorph=g})(this)}(),function(){var a=Ember.create;Ember.Handlebars=a(Handlebars),Ember.Handlebars.helpers=a(Handlebars.helpers),Ember.Handlebars.Compiler=function(){},Ember.Handlebars.Compiler.prototype=a(Handlebars.Compiler.prototype),Ember.Handlebars.Compiler.prototype.compiler=Ember.Handlebars.Compiler,Ember.Handlebars.JavaScriptCompiler=function(){},Ember.Handlebars.JavaScriptCompiler.prototype=a(Handlebars.JavaScriptCompiler.prototype),Ember.Handlebars.JavaScriptCompiler.prototype.compiler=Ember.Handlebars.JavaScriptCompiler,Ember.Handlebars.JavaScriptCompiler.prototype.namespace="Ember.Handlebars",Ember.Handlebars.JavaScriptCompiler.prototype.initializeBuffer=function(){return"''"},Ember.Handlebars.JavaScriptCompiler.prototype.appendToBuffer=function(a){return"data.buffer.push("+a+");"},Ember.Handlebars.Compiler.prototype.mustache=function(a){if(a.params.length||a.hash)return Handlebars.Compiler.prototype.mustache.call(this,a);var b=new Handlebars.AST.IdNode(["_triageMustache"]);return a.escaped||(a.hash=a.hash||new Handlebars.AST.HashNode([]),a.hash.pairs.push(["unescaped",new Handlebars.AST.StringNode("true")])),a=new Handlebars.AST.MustacheNode([b].concat([a.id]),a.hash,!a.escaped),Handlebars.Compiler.prototype.mustache.call(this,a)},Ember.Handlebars.precompile=function(a){var b=Handlebars.parse(a),c={knownHelpers:{action:!0,unbound:!0,bindAttr:!0,template:!0,view:!0,_triageMustache:!0},data:!0,stringParams:!0},d=(new Ember.Handlebars.Compiler).compile(b,c);return(new Ember.Handlebars.JavaScriptCompiler).compile(d,c,undefined,!0)},Ember.Handlebars.compile=function(a){var b=Handlebars.parse(a),c={data:!0,stringParams:!0},d=(new Ember.Handlebars.Compiler).compile(b,c),e=(new Ember.Handlebars.JavaScriptCompiler).compile(d,c,undefined,!0);return Handlebars.template(e)};var b=Ember.Handlebars.normalizePath=function(a,b,c){var d=c&&c.keywords||{},e,f;return e=b.split(".",1)[0],d.hasOwnProperty(e)&&(a=d[e],f=!0,b===e?b="":b=b.substr(e.length+1)),{root:a,path:b,isKeyword:f}};Ember.Handlebars.getPath=function(a,c,d){var e=d&&d.data,f=b(a,c,e),g;return a=f.root,c=f.path,g=Ember.get(a,c),g===undefined&&a!==window&&Ember.isGlobalPath(c)&&(g=Ember.get(window,c)),g},Ember.Handlebars.registerHelper("helperMissing",function(a,b){var c,d="";throw c="%@ Handlebars error: Could not find property '%@' on object %@.",b.data&&(d=b.data.view),new Ember.Error(Ember.String.fmt(c,[d,a,this]))})}(),function(){Ember.String.htmlSafe=function(a){return new Handlebars.SafeString(a)};var a=Ember.String.htmlSafe;Ember.EXTEND_PROTOTYPES&&(String.prototype.htmlSafe=function(){return a(this)})}(),function(){var a=Ember.set,b=Ember.get,c={remove:function(b){var c=b.morph;if(c.isRemoved())return;a(b,"element",null),b._lastInsert=null,c.remove()},prepend:function(a,b){b._insertElementLater(function(){var c=a.morph;c.prepend(b.outerHTML),b.outerHTML=null})},after:function(a,b){b._insertElementLater(function(){var c=a.morph;c.after(b.outerHTML),b.outerHTML=null})},replace:function(a){var c=a.morph;a.transitionTo("preRender"),a.clearRenderedChildren();var d=a.renderToBuffer();Ember.run.schedule("render",this,function(){if(b(a,"isDestroyed"))return;a.invalidateRecursively("element"),a._notifyWillInsertElement(),c.replaceWith(d.string()),a.transitionTo("inDOM"),a._notifyDidInsertElement()})},empty:function(a){a.morph.html("")}};Ember._Metamorph=Ember.Mixin.create({isVirtual:!0,tagName:"",init:function(){this._super(),this.morph=Metamorph()},beforeRender:function(a){a.push(this.morph.startTag())},afterRender:function(a){a.push(this.morph.endTag())},createElement:function(){var a=this.renderToBuffer();this.outerHTML=a.string(),this.clearBuffer()},domManager:c}),Ember._MetamorphView=Ember.View.extend(Ember._Metamorph)}(),function(){var a=Ember.get,b=Ember.set,c=Ember.Handlebars.getPath;Ember._HandlebarsBoundView=Ember._MetamorphView.extend({shouldDisplayFunc:null,preserveContext:!1,previousContext:null,displayTemplate:null,inverseTemplate:null,path:null,pathRoot:null,normalizedValue:Ember.computed(function(){var b=a(this,"path"),d=a(this,"pathRoot"),e=a(this,"valueNormalizerFunc"),f,g;return b===""?f=d:(g=a(this,"templateData"),f=c(d,b,{data:g})),e?e(f):f}).property("path","pathRoot","valueNormalizerFunc").volatile(),rerenderIfNeeded:function(){!a(this,"isDestroyed")&&a(this,"normalizedValue")!==this._lastNormalizedValue&&this.rerender()},render:function(c){var d=a(this,"isEscaped"),e=a(this,"shouldDisplayFunc"),f=a(this,"preserveContext"),g=a(this,"previousContext"),h=a(this,"inverseTemplate"),i=a(this,"displayTemplate"),j=a(this,"normalizedValue");this._lastNormalizedValue=j;if(e(j)){b(this,"template",i);if(f)b(this,"_context",g);else{if(!i){j===null||j===undefined?j="":j instanceof Handlebars.SafeString||(j=String(j)),d&&(j=Handlebars.Utils.escapeExpression(j)),c.push(j);return}b(this,"_context",j)}}else h?(b(this,"template",h),f?b(this,"_context",g):b(this,"_context",j)):b(this,"template",function(){return""});return this._super(c)}})}(),function(){function i(a,b,c,f,g){var h=b.data,i=b.fn,j=b.inverse,k=h.view,l=this,m,n,o;o=e(l,a,h),m=o.root,n=o.path;if("object"==typeof this){var p=k.createChildView(Ember._HandlebarsBoundView,{preserveContext:c,shouldDisplayFunc:f,valueNormalizerFunc:g,displayTemplate:i,inverseTemplate:j,path:n,pathRoot:m,previousContext:l,isEscaped:!b.hash.unescaped,templateData:b.data});k.appendChild(p);var q=function(){Ember.run.once(p,"rerenderIfNeeded")};n!==""&&Ember.addObserver(m,n,q)}else h.buffer.push(d(m,n,b))}var a=Ember.get,b=Ember.set,c=Ember.String.fmt,d=Ember.Handlebars.getPath,e=Ember.Handlebars.normalizePath,f=Ember.ArrayPolyfills.forEach,g=Ember.Handlebars,h=g.helpers;g.registerHelper("_triageMustache",function(a,b){return h[a]?h[a].call(this,b):h.bind.apply(this,arguments)}),g.registerHelper("bind",function(a,b){var c=b.contexts&&b.contexts[0]||this;return i.call(c,a,b,!1,function(a){return!Ember.none(a)})}),g.registerHelper("boundIf",function(b,c){var d=c.contexts&&c.contexts[0]||this,e=function(b){return Ember.typeOf(b)==="array"?a(b,"length")!==0:!!b};return i.call(d,b,c,!0,e,e)}),g.registerHelper("with",function(a,b){if(arguments.length===4){var c,d,f,g;b=arguments[3],c=arguments[2],d=arguments[0];if(Ember.isGlobalPath(d))Ember.bind(b.data.keywords,c,d);else{g=e(this,d,b.data),d=g.path,f=g.root;var j=Ember.$.expando+Ember.guidFor(f);b.data.keywords[j]=f;var k=d?j+"."+d:j;Ember.bind(b.data.keywords,c,k)}return i.call(this,d,b.fn,!0,function(a){return!Ember.none(a)})}return h.bind.call(b.contexts[0],a,b)}),g.registerHelper("if",function(a,b){return h.boundIf.call(b.contexts[0],a,b)}),g.registerHelper("unless",function(a,b){var c=b.fn,d=b.inverse;return b.fn=d,b.inverse=c,h.boundIf.call(b.contexts[0],a,b)}),g.registerHelper("bindAttr",function(a){var b=a.hash,c=a.data.view,h=[],i=this,j=++Ember.$.uuid,k=b["class"];if(k!==null&&k!==undefined){var l=g.bindClasses(this,k,c,j,a);h.push('class="'+Handlebars.Utils.escapeExpression(l.join(" "))+'"'),delete b["class"]}var m=Ember.keys(b);return f.call(m,function(f){var g=b[f],k,l;l=e(i,g,a.data),k=l.root,g=l.path;var m=g==="this"?k:d(k,g,a),n=Ember.typeOf(m),o,p;o=function(){var e=d(k,g,a),h=c.$("[data-bindattr-"+j+"='"+j+"']");if(h.length===0){Ember.removeObserver(k,g,p);return}Ember.View.applyAttributeBindings(h,f,e)},p=function(){Ember.run.once(o)},g!=="this"&&Ember.addObserver(k,g,p),n==="string"||n==="number"&&!isNaN(m)?h.push(f+'="'+Handlebars.Utils.escapeExpression(m)+'"'):m&&n==="boolean"&&h.push(f+'="'+f+'"')},this),h.push("data-bindattr-"+j+'="'+j+'"'),new g.SafeString(h.join(" "))}),g.bindClasses=function(a,b,c,g,h){var i=[],j,k,l,m=function(a,b,c){var e,f=b.path;return f==="this"?e=a:f===""?e=!0:e=d(a,f,c),Ember.View._classStringForValue(f,e,b.className,b.falsyClassName)};return f.call(b.split(" "),function(b){var d,f,n,o=Ember.View._parsePropertyPath(b),p=o.path,q=a,r;p!==""&&p!=="this"&&(r=e(a,p,h.data),q=r.root,p=r.path),f=function(){j=m(q,o,h),l=g?c.$("[data-bindattr-"+g+"='"+g+"']"):c.$(),l.length===0?Ember.removeObserver(q,p,n):(d&&l.removeClass(d),j?(l.addClass(j),d=j):d=null)},n=function(){Ember.run.once(f)},p!==""&&p!=="this"&&Ember.addObserver(q,p,n),k=m(q,o,h),k&&(i.push(k),d=k)}),i}}(),function(){var a=Ember.get,b=Ember.set,c=/^parentView\./,d=Ember.Handlebars,e=Ember.VIEW_PRESERVES_CONTEXT;d.ViewHelper=Ember.Object.create({propertiesFromHTMLOptions:function(a,b){var c=a.hash,d=a.data,e={},f=c["class"],g=!1;c.id&&(e.elementId=c.id,g=!0),f&&(f=f.split(" "),e.classNames=f,g=!0),c.classBinding&&(e.classNameBindings=c.classBinding.split(" "),g=!0),c.classNameBindings&&(e.classNameBindings===undefined&&(e.classNameBindings=[]),e.classNameBindings=e.classNameBindings.concat(c.classNameBindings.split(" ")),g=!0),c.attributeBindings&&(e.attributeBindings=null,g=!0),g&&(c=Ember.$.extend({},c),delete c.id,delete c["class"],delete c.classBinding);var h;for(var i in c){if(!c.hasOwnProperty(i))continue;Ember.IS_BINDING.test(i)&&typeof c[i]=="string"&&(h=this.contextualizeBindingPath(c[i],d),h&&(c[i]=h))}if(e.classNameBindings)for(var j in e.classNameBindings){var k=e.classNameBindings[j];if(typeof k=="string"){var l=Ember.View._parsePropertyPath(k);h=this.contextualizeBindingPath(l.path,d),h&&(e.classNameBindings[j]=h+l.classNames)}}return e.bindingContext=b,Ember.$.extend(c,e)},contextualizeBindingPath:function(a,b){var c=Ember.Handlebars.normalizePath(null,a,b);return c.isKeyword?"templateData.keywords."+a:Ember.isGlobalPath(a)?null:a==="this"?"bindingContext":"bindingContext."+a},helper:function(a,b,c){var f=c.inverse,g=c.data,h=g.view,i=c.fn,j=c.hash,k;"string"==typeof b?k=d.getPath(a,b,c):k=b;var l=this.propertiesFromHTMLOptions(c,a),m=g.view;l.templateData=c.data,i&&(l.template=i),e&&!k.proto().controller&&!k.proto().controllerBinding&&!l.controller&&!l.controllerBinding&&(l._context=a),m.appendChild(k,l)}}),d.registerHelper("view",function(a,b){return a&&a.data&&a.data.isRenderData&&(b=a,a="Ember.View"),d.ViewHelper.helper(this,a,b)})}(),function(){var a=Ember.get,b=Ember.Handlebars.getPath,c=Ember.String.fmt;Ember.Handlebars.registerHelper("collection",function(c,d){c&&c.data&&c.data.isRenderData&&(d=c,c=undefined);var e=d.fn,f=d.data,g=d.inverse,h;h=c?b(this,c,d):Ember.CollectionView;var i=d.hash,j={},k,l,m=i.itemViewClass,n=h.proto();delete i.itemViewClass,l=m?b(n,m,d):n.itemViewClass;for(var o in i)i.hasOwnProperty(o)&&(k=o.match(/^item(.)(.*)$/),k&&(j[k[1].toLowerCase()+k[2]]=i[o],delete i[o]));var p=i.tagName||n.tagName;e&&(j.template=e,delete d.fn);var q;g&&g!==Handlebars.VM.noop?(q=a(n,"emptyViewClass"),q=q.extend({template:g,tagName:j.tagName})):i.emptyViewClass&&(q=b(this,i.emptyViewClass,d)),i.emptyView=q,i.eachHelper==="each"&&(j._context=Ember.computed(function(){return a(this,"content")}).property("content"),delete i.eachHelper);var r=Ember.Handlebars.ViewHelper.propertiesFromHTMLOptions({data:f,hash:j},this);return i.itemViewClass=l.extend(r),Ember.Handlebars.helpers.view.call(this,h,d)})}(),function(){var a=Ember.Handlebars.getPath;Ember.Handlebars.registerHelper("unbound",function(b,c){var d=c.contexts&&c.contexts[0]||this;return a(d,b,c)})}(),function(){var a=Ember.Handlebars.getPath,b=Ember.Handlebars.normalizePath;Ember.Handlebars.registerHelper("log",function(c,d){var e=d.contexts&&d.contexts[0]||this,f=b(e,c,d.data),g=f.root,h=f.path,i=h==="this"?g:a(g,h,d);Ember.Logger.log(i)}),Ember.Handlebars.registerHelper("debugger",function(){debugger})}(),function(){var a=Ember.get,b=Ember.set;Ember.Handlebars.EachView=Ember.CollectionView.extend(Ember._Metamorph,{itemViewClass:Ember._MetamorphView,emptyViewClass:Ember._MetamorphView,createChildView:function(c,d){c=this._super(c,d);var e=a(this,"keyword");if(e){var f=a(c,"templateData");f=Ember.copy(f),f.keywords=c.cloneKeywords(),b(c,"templateData",f);var g=a(c,"content");f.keywords[e]=g}return c}}),Ember.Handlebars.registerHelper("each",function(a,b){if(arguments.length===4){var c=arguments[0];b=arguments[3],a=arguments[2],a===""&&(a="this"),b.hash.keyword=c}else b.hash.eachHelper="each";return b.hash.contentBinding=a,Ember.Handlebars.helpers.collection.call(this,"Ember.Handlebars.EachView",b)})}(),function(){Ember.Handlebars.registerHelper("template",function(a,b){var c=Ember.TEMPLATES[a];Ember.TEMPLATES[a](this,{data:b.data})})}(),function(){var a=Ember.Handlebars,b=a.getPath,c=Ember.get,d=Array.prototype.slice,e=a.ActionHelper={registeredActions:{}};e.registerAction=function(a,b){var c=(++Ember.$.uuid).toString();return e.registeredActions[c]={eventName:b.eventName,handler:function(c){var d=c.shiftKey||c.metaKey||c.altKey||c.ctrlKey,e=c.which>1,f=d||e;if(b.link&&f)return;c.preventDefault(),c.view=b.view,b.hasOwnProperty("context")&&(c.context=b.context),b.hasOwnProperty("contexts")&&(c.contexts=b.contexts);var g=b.target;return g.isState&&typeof g.send=="function"?g.send(a,c):g[a].call(g,c)}},b.view.on("willRerender",function(){delete e.registeredActions[c]}),c},a.registerHelper("action",function(f){var g=arguments[arguments.length-1],h=d.call(arguments,1,-1),i=g.hash,j=g.data.view,k,l,m,n={eventName:i.on||"click"};n.view=j=c(j,"concreteView");if(i.target)k=b(this,i.target,g);else if(l=g.data.keywords.controller)k=c(l,"target");n.target=k=k||j,h.length&&(n.contexts=h=Ember.EnumerableUtils.map(h,function(a){return b(this,a,g)},this),n.context=h[0]);var o=[],p;i.href&&k.urlForEvent&&(p=k.urlForEvent.apply(k,[f].concat(h)),o.push('href="'+p+'"'),n.link=!0);var q=e.registerAction(f,n);return o.push('data-ember-action="'+q+'"'),new a.SafeString(o.join(" "))})}(),function(){var a=Ember.get,b=Ember.set;Ember.Handlebars.registerHelper("yield",function(b){var c=b.data.view,d;while(c&&!a(c,"layout"))c=a(c,"parentView");d=a(c,"template"),d&&d(this,b)})}(),function(){Ember.Handlebars.registerHelper("outlet",function(a,b){return a&&a.data&&a.data.isRenderData&&(b=a,a="view"),b.hash.currentViewBinding="controller."+a,Ember.Handlebars
-.helpers.view.call(this,Ember.ContainerView,b)})}(),function(){}(),function(){}(),function(){var a=Ember.set,b=Ember.get;Ember.Checkbox=Ember.View.extend({classNames:["ember-checkbox"],tagName:"input",attributeBindings:["type","checked","disabled","tabindex"],type:"checkbox",checked:!1,disabled:!1,init:function(){this._super(),this.on("change",this,this._updateElementValue)},_updateElementValue:function(){a(this,"checked",this.$().prop("checked"))}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TextSupport=Ember.Mixin.create({value:"",attributeBindings:["placeholder","disabled","maxlength","tabindex"],placeholder:null,disabled:!1,maxlength:null,insertNewline:Ember.K,cancel:Ember.K,init:function(){this._super(),this.on("focusOut",this,this._elementValueDidChange),this.on("change",this,this._elementValueDidChange),this.on("keyUp",this,this.interpretKeyEvents)},interpretKeyEvents:function(a){var b=Ember.TextSupport.KEY_EVENTS,c=b[a.keyCode];this._elementValueDidChange();if(c)return this[c](a)},_elementValueDidChange:function(){b(this,"value",this.$().val())}}),Ember.TextSupport.KEY_EVENTS={13:"insertNewline",27:"cancel"}}(),function(){var a=Ember.get,b=Ember.set;Ember.TextField=Ember.View.extend(Ember.TextSupport,{classNames:["ember-text-field"],tagName:"input",attributeBindings:["type","value","size"],value:"",type:"text",size:null})}(),function(){var a=Ember.get,b=Ember.set;Ember.Button=Ember.View.extend(Ember.TargetActionSupport,{classNames:["ember-button"],classNameBindings:["isActive"],tagName:"button",propagateEvents:!1,attributeBindings:["type","disabled","href","tabindex"],targetObject:Ember.computed(function(){var b=a(this,"target"),c=a(this,"context"),d=a(this,"templateData");return typeof b!="string"?b:Ember.Handlebars.getPath(c,b,{data:d})}).property("target").cacheable(),type:Ember.computed(function(a,b){var c=this.get("tagName");b!==undefined&&(this._type=b);if(this._type!==undefined)return this._type;if(c==="input"||c==="button")return"button"}).property("tagName").cacheable(),disabled:!1,href:Ember.computed(function(){return this.get("tagName")==="a"?"#":null}).property("tagName").cacheable(),mouseDown:function(){return a(this,"disabled")||(b(this,"isActive",!0),this._mouseDown=!0,this._mouseEntered=!0),a(this,"propagateEvents")},mouseLeave:function(){this._mouseDown&&(b(this,"isActive",!1),this._mouseEntered=!1)},mouseEnter:function(){this._mouseDown&&(b(this,"isActive",!0),this._mouseEntered=!0)},mouseUp:function(c){return a(this,"isActive")&&(this.triggerAction(),b(this,"isActive",!1)),this._mouseDown=!1,this._mouseEntered=!1,a(this,"propagateEvents")},keyDown:function(a){(a.keyCode===13||a.keyCode===32)&&this.mouseDown()},keyUp:function(a){(a.keyCode===13||a.keyCode===32)&&this.mouseUp()},touchStart:function(a){return this.mouseDown(a)},touchEnd:function(a){return this.mouseUp(a)},init:function(){this._super()}})}(),function(){var a=Ember.get,b=Ember.set;Ember.TextArea=Ember.View.extend(Ember.TextSupport,{classNames:["ember-text-area"],tagName:"textarea",attributeBindings:["rows","cols"],rows:null,cols:null,_updateElementValue:Ember.observer(function(){var b=a(this,"value"),c=this.$();c&&b!==c.val()&&c.val(b)},"value"),init:function(){this._super(),this.on("didInsertElement",this,this._updateElementValue)}})}(),function(){Ember.TabContainerView=Ember.View.extend({init:function(){this._super()}})}(),function(){var a=Ember.get;Ember.TabPaneView=Ember.View.extend({tabsContainer:Ember.computed(function(){return this.nearestInstanceOf(Ember.TabContainerView)}).property().volatile(),isVisible:Ember.computed(function(){return a(this,"viewName")===a(this,"tabsContainer.currentView")}).property("tabsContainer.currentView").volatile(),init:function(){this._super()}})}(),function(){var a=Ember.get,b=Ember.setPath;Ember.TabView=Ember.View.extend({tabsContainer:Ember.computed(function(){return this.nearestInstanceOf(Ember.TabContainerView)}).property().volatile(),mouseUp:function(){b(this,"tabsContainer.currentView",a(this,"value"))},init:function(){this._super()}})}(),function(){}(),function(){var a=Ember.set,b=Ember.get,c=Ember.EnumerableUtils.indexOf,d=Ember.EnumerableUtils.indexesOf;Ember.Select=Ember.View.extend({tagName:"select",classNames:["ember-select"],defaultTemplate:Ember.Handlebars.template(function(b,c,d,e,f){function q(a,b){var c="",e,f,g,h;return b.buffer.push("<option value>"),e=a,f="view.prompt",g={},h="true",g.escaped=h,h=d._triageMustache||a._triageMustache,k={},k.hash=g,k.contexts=[],k.contexts.push(e),k.data=b,typeof h===m?e=h.call(a,f,k):h===o?e=n.call(a,"_triageMustache",f,k):e=h,b.buffer.push(p(e)+"</option>"),c}function r(a,b){var c,e,f,g;c=a,e="Ember.SelectOption",f={},g="this",f.contentBinding=g,g=d.view||a.view,k={},k.hash=f,k.contexts=[],k.contexts.push(c),k.data=b,typeof g===m?c=g.call(a,e,k):g===o?c=n.call(a,"view",e,k):c=g,b.buffer.push(p(c))}d=d||Ember.Handlebars.helpers;var g="",h,i,j,k,l=this,m="function",n=d.helperMissing,o=void 0,p=this.escapeExpression;return h=c,i="view.prompt",j=d["if"],k=l.program(1,q,f),k.hash={},k.contexts=[],k.contexts.push(h),k.fn=k,k.inverse=l.noop,k.data=f,h=j.call(c,i,k),(h||h===0)&&f.buffer.push(h),h=c,i="view.content",j=d.each,k=l.program(3,r,f),k.hash={},k.contexts=[],k.contexts.push(h),k.fn=k,k.inverse=l.noop,k.data=f,h=j.call(c,i,k),(h||h===0)&&f.buffer.push(h),g}),attributeBindings:["multiple","tabindex"],multiple:!1,content:null,selection:null,value:Ember.computed(function(a,c){if(arguments.length===2)return c;var d=b(this,"optionValuePath").replace(/^content\.?/,"");return d?b(this,"selection."+d):b(this,"selection")}).property("selection").cacheable(),prompt:null,optionLabelPath:"content",optionValuePath:"content",_change:function(){b(this,"multiple")?this._changeMultiple():this._changeSingle()},selectionDidChange:Ember.observer(function(){var c=b(this,"selection"),d=Ember.isArray(c);if(b(this,"multiple")){if(!d){a(this,"selection",Ember.A([c]));return}this._selectionDidChangeMultiple()}else this._selectionDidChangeSingle()},"selection"),valueDidChange:Ember.observer(function(){var a=b(this,"content"),c=b(this,"value"),d=b(this,"optionValuePath").replace(/^content\.?/,""),e=d?b(this,"selection."+d):b(this,"selection"),f;c!==e&&(f=a.find(function(a){return c===(d?b(a,d):a)}),this.set("selection",f))},"value"),_triggerChange:function(){var a=b(this,"selection");a&&this.selectionDidChange(),this._change()},_changeSingle:function(){var c=this.$()[0].selectedIndex,d=b(this,"content"),e=b(this,"prompt");if(!d)return;if(e&&c===0){a(this,"selection",null);return}e&&(c-=1),a(this,"selection",d.objectAt(c))},_changeMultiple:function(){var c=this.$("option:selected"),d=b(this,"prompt"),e=d?1:0,f=b(this,"content");if(!f)return;if(c){var g=c.map(function(){return this.index-e}).toArray();a(this,"selection",f.objectsAt(g))}},_selectionDidChangeSingle:function(){var a=this.get("element");if(!a)return;var d=b(this,"content"),e=b(this,"selection"),f=d?c(d,e):-1,g=b(this,"prompt");g&&(f+=1),a&&(a.selectedIndex=f)},_selectionDidChangeMultiple:function(){var a=b(this,"content"),e=b(this,"selection"),f=a?d(a,e):[-1],g=b(this,"prompt"),h=g?1:0,i=this.$("option"),j;i&&i.each(function(){j=this.index>-1?this.index+h:-1,this.selected=c(f,j)>-1})},init:function(){this._super(),this.on("didInsertElement",this,this._triggerChange),this.on("change",this,this._change)}}),Ember.SelectOption=Ember.View.extend({tagName:"option",attributeBindings:["value","selected"],defaultTemplate:function(a,b){b={data:b.data,hash:{}},Ember.Handlebars.helpers.bind.call(a,"view.label",b)},init:function(){this.labelPathDidChange(),this.valuePathDidChange(),this._super()},selected:Ember.computed(function(){var a=b(this,"content"),d=b(this,"parentView.selection");return b(this,"parentView.multiple")?d&&c(d,a)>-1:a==d}).property("content","parentView.selection").volatile(),labelPathDidChange:Ember.observer(function(){var a=b(this,"parentView.optionLabelPath");if(!a)return;Ember.defineProperty(this,"label",Ember.computed(function(){return b(this,a)}).property(a).cacheable())},"parentView.optionLabelPath"),valuePathDidChange:Ember.observer(function(){var a=b(this,"parentView.optionValuePath");if(!a)return;Ember.defineProperty(this,"value",Ember.computed(function(){return b(this,a)}).property(a).cacheable())},"parentView.optionValuePath")})}(),function(){}(),function(){function a(){Ember.Handlebars.bootstrap(Ember.$(document))}Ember.Handlebars.bootstrap=function(a){var b='script[type="text/x-handlebars"], script[type="text/x-raw-handlebars"]';Ember.$(b,a).each(function(){var a=Ember.$(this),b=a.attr("type"),c=a.attr("type")==="text/x-raw-handlebars"?Ember.$.proxy(Handlebars.compile,Handlebars):Ember.$.proxy(Ember.Handlebars.compile,Ember.Handlebars),d=a.attr("data-template-name")||a.attr("id"),e=c(a.html()),f,g,h,i;if(d)Ember.TEMPLATES[d]=e,a.remove();else{if(a.parents("head").length!==0)throw new Ember.Error("Template found in <head> without a name specified. Please provide a data-template-name attribute.\n"+a.html());g=a.attr("data-view"),f=g?Ember.get(g):Ember.View,h=a.attr("data-element-id"),i={template:e},h&&(i.elementId=h),f=f.create(i),f._insertElementLater(function(){a.replaceWith(this.$()),a=null})}})},Ember.$(document).ready(a),Ember.onLoad("application",a)}(),function(){}(); \ No newline at end of file
diff --git a/src/components/HMI/lib/handlebars-1.0.0.beta.6.js b/src/components/HMI/lib/handlebars-1.0.0.beta.6.js
deleted file mode 100644
index 70665b1c37..0000000000
--- a/src/components/HMI/lib/handlebars-1.0.0.beta.6.js
+++ /dev/null
@@ -1,1550 +0,0 @@
-// lib/handlebars/base.js
-var Handlebars = {};
-
-Handlebars.VERSION = "1.0.beta.6";
-
-Handlebars.helpers = {};
-Handlebars.partials = {};
-
-Handlebars.registerHelper = function(name, fn, inverse) {
- if(inverse) { fn.not = inverse; }
- this.helpers[name] = fn;
-};
-
-Handlebars.registerPartial = function(name, str) {
- this.partials[name] = str;
-};
-
-Handlebars.registerHelper('helperMissing', function(arg) {
- if(arguments.length === 2) {
- return undefined;
- } else {
- throw new Error("Could not find property '" + arg + "'");
- }
-});
-
-var toString = Object.prototype.toString, functionType = "[object Function]";
-
-Handlebars.registerHelper('blockHelperMissing', function(context, options) {
- var inverse = options.inverse || function() {}, fn = options.fn;
-
-
- var ret = "";
- var type = toString.call(context);
-
- if(type === functionType) { context = context.call(this); }
-
- if(context === true) {
- return fn(this);
- } else if(context === false || context == null) {
- return inverse(this);
- } else if(type === "[object Array]") {
- if(context.length > 0) {
- for(var i=0, j=context.length; i<j; i++) {
- ret = ret + fn(context[i]);
- }
- } else {
- ret = inverse(this);
- }
- return ret;
- } else {
- return fn(context);
- }
-});
-
-Handlebars.registerHelper('each', function(context, options) {
- var fn = options.fn, inverse = options.inverse;
- var ret = "";
-
- if(context && context.length > 0) {
- for(var i=0, j=context.length; i<j; i++) {
- ret = ret + fn(context[i]);
- }
- } else {
- ret = inverse(this);
- }
- return ret;
-});
-
-Handlebars.registerHelper('if', function(context, options) {
- var type = toString.call(context);
- if(type === functionType) { context = context.call(this); }
-
- if(!context || Handlebars.Utils.isEmpty(context)) {
- return options.inverse(this);
- } else {
- return options.fn(this);
- }
-});
-
-Handlebars.registerHelper('unless', function(context, options) {
- var fn = options.fn, inverse = options.inverse;
- options.fn = inverse;
- options.inverse = fn;
-
- return Handlebars.helpers['if'].call(this, context, options);
-});
-
-Handlebars.registerHelper('with', function(context, options) {
- return options.fn(context);
-});
-
-Handlebars.registerHelper('log', function(context) {
- Handlebars.log(context);
-});
-;
-// lib/handlebars/compiler/parser.js
-/* Jison generated parser */
-var handlebars = (function(){
-
-var parser = {trace: function trace() { },
-yy: {},
-symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"param":27,"STRING":28,"INTEGER":29,"BOOLEAN":30,"hashSegments":31,"hashSegment":32,"ID":33,"EQUALS":34,"pathSegments":35,"SEP":36,"$accept":0,"$end":1},
-terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},
-productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],
-performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
-
-var $0 = $$.length - 1;
-switch (yystate) {
-case 1: return $$[$0-1]
-break;
-case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0])
-break;
-case 3: this.$ = new yy.ProgramNode($$[$0])
-break;
-case 4: this.$ = new yy.ProgramNode([])
-break;
-case 5: this.$ = [$$[$0]]
-break;
-case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
-break;
-case 7: this.$ = new yy.InverseNode($$[$0-2], $$[$0-1], $$[$0])
-break;
-case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0])
-break;
-case 9: this.$ = $$[$0]
-break;
-case 10: this.$ = $$[$0]
-break;
-case 11: this.$ = new yy.ContentNode($$[$0])
-break;
-case 12: this.$ = new yy.CommentNode($$[$0])
-break;
-case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
-break;
-case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
-break;
-case 15: this.$ = $$[$0-1]
-break;
-case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
-break;
-case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true)
-break;
-case 18: this.$ = new yy.PartialNode($$[$0-1])
-break;
-case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1])
-break;
-case 20:
-break;
-case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]
-break;
-case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]
-break;
-case 23: this.$ = [[$$[$0-1]], $$[$0]]
-break;
-case 24: this.$ = [[$$[$0]], null]
-break;
-case 25: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
-break;
-case 26: this.$ = [$$[$0]]
-break;
-case 27: this.$ = $$[$0]
-break;
-case 28: this.$ = new yy.StringNode($$[$0])
-break;
-case 29: this.$ = new yy.IntegerNode($$[$0])
-break;
-case 30: this.$ = new yy.BooleanNode($$[$0])
-break;
-case 31: this.$ = new yy.HashNode($$[$0])
-break;
-case 32: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
-break;
-case 33: this.$ = [$$[$0]]
-break;
-case 34: this.$ = [$$[$0-2], $$[$0]]
-break;
-case 35: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]
-break;
-case 36: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]
-break;
-case 37: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]
-break;
-case 38: this.$ = new yy.IdNode($$[$0])
-break;
-case 39: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
-break;
-case 40: this.$ = [$$[$0]]
-break;
-}
-},
-table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],
-defaultActions: {16:[2,1],37:[2,23],53:[2,21]},
-parseError: function parseError(str, hash) {
- throw new Error(str);
-},
-parse: function parse(input) {
- var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
- this.lexer.setInput(input);
- this.lexer.yy = this.yy;
- this.yy.lexer = this.lexer;
- if (typeof this.lexer.yylloc == "undefined")
- this.lexer.yylloc = {};
- var yyloc = this.lexer.yylloc;
- lstack.push(yyloc);
- if (typeof this.yy.parseError === "function")
- this.parseError = this.yy.parseError;
- function popStack(n) {
- stack.length = stack.length - 2 * n;
- vstack.length = vstack.length - n;
- lstack.length = lstack.length - n;
- }
- function lex() {
- var token;
- token = self.lexer.lex() || 1;
- if (typeof token !== "number") {
- token = self.symbols_[token] || token;
- }
- return token;
- }
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
- while (true) {
- state = stack[stack.length - 1];
- if (this.defaultActions[state]) {
- action = this.defaultActions[state];
- } else {
- if (symbol == null)
- symbol = lex();
- action = table[state] && table[state][symbol];
- }
- if (typeof action === "undefined" || !action.length || !action[0]) {
- if (!recovering) {
- expected = [];
- for (p in table[state])
- if (this.terminals_[p] && p > 2) {
- expected.push("'" + this.terminals_[p] + "'");
- }
- var errStr = "";
- if (this.lexer.showPosition) {
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'";
- } else {
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
- }
- this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
- }
- }
- if (action[0] instanceof Array && action.length > 1) {
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
- }
- switch (action[0]) {
- case 1:
- stack.push(symbol);
- vstack.push(this.lexer.yytext);
- lstack.push(this.lexer.yylloc);
- stack.push(action[1]);
- symbol = null;
- if (!preErrorSymbol) {
- yyleng = this.lexer.yyleng;
- yytext = this.lexer.yytext;
- yylineno = this.lexer.yylineno;
- yyloc = this.lexer.yylloc;
- if (recovering > 0)
- recovering--;
- } else {
- symbol = preErrorSymbol;
- preErrorSymbol = null;
- }
- break;
- case 2:
- len = this.productions_[action[1]][1];
- yyval.$ = vstack[vstack.length - len];
- yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
- r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
- if (typeof r !== "undefined") {
- return r;
- }
- if (len) {
- stack = stack.slice(0, -1 * len * 2);
- vstack = vstack.slice(0, -1 * len);
- lstack = lstack.slice(0, -1 * len);
- }
- stack.push(this.productions_[action[1]][0]);
- vstack.push(yyval.$);
- lstack.push(yyval._$);
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
- stack.push(newState);
- break;
- case 3:
- return true;
- }
- }
- return true;
-}
-};/* Jison generated lexer */
-var lexer = (function(){
-
-var lexer = ({EOF:1,
-parseError:function parseError(str, hash) {
- if (this.yy.parseError) {
- this.yy.parseError(str, hash);
- } else {
- throw new Error(str);
- }
- },
-setInput:function (input) {
- this._input = input;
- this._more = this._less = this.done = false;
- this.yylineno = this.yyleng = 0;
- this.yytext = this.matched = this.match = '';
- this.conditionStack = ['INITIAL'];
- this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
- return this;
- },
-input:function () {
- var ch = this._input[0];
- this.yytext+=ch;
- this.yyleng++;
- this.match+=ch;
- this.matched+=ch;
- var lines = ch.match(/\n/);
- if (lines) this.yylineno++;
- this._input = this._input.slice(1);
- return ch;
- },
-unput:function (ch) {
- this._input = ch + this._input;
- return this;
- },
-more:function () {
- this._more = true;
- return this;
- },
-pastInput:function () {
- var past = this.matched.substr(0, this.matched.length - this.match.length);
- return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
- },
-upcomingInput:function () {
- var next = this.match;
- if (next.length < 20) {
- next += this._input.substr(0, 20-next.length);
- }
- return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
- },
-showPosition:function () {
- var pre = this.pastInput();
- var c = new Array(pre.length + 1).join("-");
- return pre + this.upcomingInput() + "\n" + c+"^";
- },
-next:function () {
- if (this.done) {
- return this.EOF;
- }
- if (!this._input) this.done = true;
-
- var token,
- match,
- col,
- lines;
- if (!this._more) {
- this.yytext = '';
- this.match = '';
- }
- var rules = this._currentRules();
- for (var i=0;i < rules.length; i++) {
- match = this._input.match(this.rules[rules[i]]);
- if (match) {
- lines = match[0].match(/\n.*/g);
- if (lines) this.yylineno += lines.length;
- this.yylloc = {first_line: this.yylloc.last_line,
- last_line: this.yylineno+1,
- first_column: this.yylloc.last_column,
- last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
- this.yytext += match[0];
- this.match += match[0];
- this.matches = match;
- this.yyleng = this.yytext.length;
- this._more = false;
- this._input = this._input.slice(match[0].length);
- this.matched += match[0];
- token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);
- if (token) return token;
- else return;
- }
- }
- if (this._input === "") {
- return this.EOF;
- } else {
- this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
- {text: "", token: null, line: this.yylineno});
- }
- },
-lex:function lex() {
- var r = this.next();
- if (typeof r !== 'undefined') {
- return r;
- } else {
- return this.lex();
- }
- },
-begin:function begin(condition) {
- this.conditionStack.push(condition);
- },
-popState:function popState() {
- return this.conditionStack.pop();
- },
-_currentRules:function _currentRules() {
- return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
- },
-topState:function () {
- return this.conditionStack[this.conditionStack.length-2];
- },
-pushState:function begin(condition) {
- this.begin(condition);
- }});
-lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
-
-var YYSTATE=YY_START
-switch($avoiding_name_collisions) {
-case 0:
- if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
- if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
- if(yy_.yytext) return 14;
-
-break;
-case 1: return 14;
-break;
-case 2: this.popState(); return 14;
-break;
-case 3: return 24;
-break;
-case 4: return 16;
-break;
-case 5: return 20;
-break;
-case 6: return 19;
-break;
-case 7: return 19;
-break;
-case 8: return 23;
-break;
-case 9: return 23;
-break;
-case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
-break;
-case 11: return 22;
-break;
-case 12: return 34;
-break;
-case 13: return 33;
-break;
-case 14: return 33;
-break;
-case 15: return 36;
-break;
-case 16: /*ignore whitespace*/
-break;
-case 17: this.popState(); return 18;
-break;
-case 18: this.popState(); return 18;
-break;
-case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 28;
-break;
-case 20: return 30;
-break;
-case 21: return 30;
-break;
-case 22: return 29;
-break;
-case 23: return 33;
-break;
-case 24: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 33;
-break;
-case 25: return 'INVALID';
-break;
-case 26: return 5;
-break;
-}
-};
-lexer.rules = [/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/];
-lexer.conditions = {"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,26],"inclusive":true}};return lexer;})()
-parser.lexer = lexer;
-return parser;
-})();
-if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
-exports.parser = handlebars;
-exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }
-exports.main = function commonjsMain(args) {
- if (!args[1])
- throw new Error('Usage: '+args[0]+' FILE');
- if (typeof process !== 'undefined') {
- var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
- } else {
- var cwd = require("file").path(require("file").cwd());
- var source = cwd.join(args[1]).read({charset: "utf-8"});
- }
- return exports.parser.parse(source);
-}
-if (typeof module !== 'undefined' && require.main === module) {
- exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
-}
-};
-;
-// lib/handlebars/compiler/base.js
-Handlebars.Parser = handlebars;
-
-Handlebars.parse = function(string) {
- Handlebars.Parser.yy = Handlebars.AST;
- return Handlebars.Parser.parse(string);
-};
-
-Handlebars.print = function(ast) {
- return new Handlebars.PrintVisitor().accept(ast);
-};
-
-Handlebars.logger = {
- DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
-
- // override in the host environment
- log: function(level, str) {}
-};
-
-Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
-;
-// lib/handlebars/compiler/ast.js
-(function() {
-
- Handlebars.AST = {};
-
- Handlebars.AST.ProgramNode = function(statements, inverse) {
- this.type = "program";
- this.statements = statements;
- if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
- };
-
- Handlebars.AST.MustacheNode = function(params, hash, unescaped) {
- this.type = "mustache";
- this.id = params[0];
- this.params = params.slice(1);
- this.hash = hash;
- this.escaped = !unescaped;
- };
-
- Handlebars.AST.PartialNode = function(id, context) {
- this.type = "partial";
-
- // TODO: disallow complex IDs
-
- this.id = id;
- this.context = context;
- };
-
- var verifyMatch = function(open, close) {
- if(open.original !== close.original) {
- throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
- }
- };
-
- Handlebars.AST.BlockNode = function(mustache, program, close) {
- verifyMatch(mustache.id, close);
- this.type = "block";
- this.mustache = mustache;
- this.program = program;
- };
-
- Handlebars.AST.InverseNode = function(mustache, program, close) {
- verifyMatch(mustache.id, close);
- this.type = "inverse";
- this.mustache = mustache;
- this.program = program;
- };
-
- Handlebars.AST.ContentNode = function(string) {
- this.type = "content";
- this.string = string;
- };
-
- Handlebars.AST.HashNode = function(pairs) {
- this.type = "hash";
- this.pairs = pairs;
- };
-
- Handlebars.AST.IdNode = function(parts) {
- this.type = "ID";
- this.original = parts.join(".");
-
- var dig = [], depth = 0;
-
- for(var i=0,l=parts.length; i<l; i++) {
- var part = parts[i];
-
- if(part === "..") { depth++; }
- else if(part === "." || part === "this") { this.isScoped = true; }
- else { dig.push(part); }
- }
-
- this.parts = dig;
- this.string = dig.join('.');
- this.depth = depth;
- this.isSimple = (dig.length === 1) && (depth === 0);
- };
-
- Handlebars.AST.StringNode = function(string) {
- this.type = "STRING";
- this.string = string;
- };
-
- Handlebars.AST.IntegerNode = function(integer) {
- this.type = "INTEGER";
- this.integer = integer;
- };
-
- Handlebars.AST.BooleanNode = function(bool) {
- this.type = "BOOLEAN";
- this.bool = bool;
- };
-
- Handlebars.AST.CommentNode = function(comment) {
- this.type = "comment";
- this.comment = comment;
- };
-
-})();;
-// lib/handlebars/utils.js
-Handlebars.Exception = function(message) {
- var tmp = Error.prototype.constructor.apply(this, arguments);
-
- for (var p in tmp) {
- if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
- }
-
- this.message = tmp.message;
-};
-Handlebars.Exception.prototype = new Error;
-
-// Build out our basic SafeString type
-Handlebars.SafeString = function(string) {
- this.string = string;
-};
-Handlebars.SafeString.prototype.toString = function() {
- return this.string.toString();
-};
-
-(function() {
- var escape = {
- "<": "&lt;",
- ">": "&gt;",
- '"': "&quot;",
- "'": "&#x27;",
- "`": "&#x60;"
- };
-
- var badChars = /&(?!\w+;)|[<>"'`]/g;
- var possible = /[&<>"'`]/;
-
- var escapeChar = function(chr) {
- return escape[chr] || "&amp;";
- };
-
- Handlebars.Utils = {
- escapeExpression: function(string) {
- // don't escape SafeStrings, since they're already safe
- if (string instanceof Handlebars.SafeString) {
- return string.toString();
- } else if (string == null || string === false) {
- return "";
- }
-
- if(!possible.test(string)) { return string; }
- return string.replace(badChars, escapeChar);
- },
-
- isEmpty: function(value) {
- if (typeof value === "undefined") {
- return true;
- } else if (value === null) {
- return true;
- } else if (value === false) {
- return true;
- } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
- return true;
- } else {
- return false;
- }
- }
- };
-})();;
-// lib/handlebars/compiler/compiler.js
-Handlebars.Compiler = function() {};
-Handlebars.JavaScriptCompiler = function() {};
-
-(function(Compiler, JavaScriptCompiler) {
- Compiler.OPCODE_MAP = {
- appendContent: 1,
- getContext: 2,
- lookupWithHelpers: 3,
- lookup: 4,
- append: 5,
- invokeMustache: 6,
- appendEscaped: 7,
- pushString: 8,
- truthyOrFallback: 9,
- functionOrFallback: 10,
- invokeProgram: 11,
- invokePartial: 12,
- push: 13,
- assignToHash: 15,
- pushStringParam: 16
- };
-
- Compiler.MULTI_PARAM_OPCODES = {
- appendContent: 1,
- getContext: 1,
- lookupWithHelpers: 2,
- lookup: 1,
- invokeMustache: 3,
- pushString: 1,
- truthyOrFallback: 1,
- functionOrFallback: 1,
- invokeProgram: 3,
- invokePartial: 1,
- push: 1,
- assignToHash: 1,
- pushStringParam: 1
- };
-
- Compiler.DISASSEMBLE_MAP = {};
-
- for(var prop in Compiler.OPCODE_MAP) {
- var value = Compiler.OPCODE_MAP[prop];
- Compiler.DISASSEMBLE_MAP[value] = prop;
- }
-
- Compiler.multiParamSize = function(code) {
- return Compiler.MULTI_PARAM_OPCODES[Compiler.DISASSEMBLE_MAP[code]];
- };
-
- Compiler.prototype = {
- compiler: Compiler,
-
- disassemble: function() {
- var opcodes = this.opcodes, opcode, nextCode;
- var out = [], str, name, value;
-
- for(var i=0, l=opcodes.length; i<l; i++) {
- opcode = opcodes[i];
-
- if(opcode === 'DECLARE') {
- name = opcodes[++i];
- value = opcodes[++i];
- out.push("DECLARE " + name + " = " + value);
- } else {
- str = Compiler.DISASSEMBLE_MAP[opcode];
-
- var extraParams = Compiler.multiParamSize(opcode);
- var codes = [];
-
- for(var j=0; j<extraParams; j++) {
- nextCode = opcodes[++i];
-
- if(typeof nextCode === "string") {
- nextCode = "\"" + nextCode.replace("\n", "\\n") + "\"";
- }
-
- codes.push(nextCode);
- }
-
- str = str + " " + codes.join(" ");
-
- out.push(str);
- }
- }
-
- return out.join("\n");
- },
-
- guid: 0,
-
- compile: function(program, options) {
- this.children = [];
- this.depths = {list: []};
- this.options = options;
-
- // These changes will propagate to the other compiler components
- var knownHelpers = this.options.knownHelpers;
- this.options.knownHelpers = {
- 'helperMissing': true,
- 'blockHelperMissing': true,
- 'each': true,
- 'if': true,
- 'unless': true,
- 'with': true,
- 'log': true
- };
- if (knownHelpers) {
- for (var name in knownHelpers) {
- this.options.knownHelpers[name] = knownHelpers[name];
- }
- }
-
- return this.program(program);
- },
-
- accept: function(node) {
- return this[node.type](node);
- },
-
- program: function(program) {
- var statements = program.statements, statement;
- this.opcodes = [];
-
- for(var i=0, l=statements.length; i<l; i++) {
- statement = statements[i];
- this[statement.type](statement);
- }
- this.isSimple = l === 1;
-
- this.depths.list = this.depths.list.sort(function(a, b) {
- return a - b;
- });
-
- return this;
- },
-
- compileProgram: function(program) {
- var result = new this.compiler().compile(program, this.options);
- var guid = this.guid++;
-
- this.usePartial = this.usePartial || result.usePartial;
-
- this.children[guid] = result;
-
- for(var i=0, l=result.depths.list.length; i<l; i++) {
- depth = result.depths.list[i];
-
- if(depth < 2) { continue; }
- else { this.addDepth(depth - 1); }
- }
-
- return guid;
- },
-
- block: function(block) {
- var mustache = block.mustache;
- var depth, child, inverse, inverseGuid;
-
- var params = this.setupStackForMustache(mustache);
-
- var programGuid = this.compileProgram(block.program);
-
- if(block.program.inverse) {
- inverseGuid = this.compileProgram(block.program.inverse);
- this.declare('inverse', inverseGuid);
- }
-
- this.opcode('invokeProgram', programGuid, params.length, !!mustache.hash);
- this.declare('inverse', null);
- this.opcode('append');
- },
-
- inverse: function(block) {
- var params = this.setupStackForMustache(block.mustache);
-
- var programGuid = this.compileProgram(block.program);
-
- this.declare('inverse', programGuid);
-
- this.opcode('invokeProgram', null, params.length, !!block.mustache.hash);
- this.declare('inverse', null);
- this.opcode('append');
- },
-
- hash: function(hash) {
- var pairs = hash.pairs, pair, val;
-
- this.opcode('push', '{}');
-
- for(var i=0, l=pairs.length; i<l; i++) {
- pair = pairs[i];
- val = pair[1];
-
- this.accept(val);
- this.opcode('assignToHash', pair[0]);
- }
- },
-
- partial: function(partial) {
- var id = partial.id;
- this.usePartial = true;
-
- if(partial.context) {
- this.ID(partial.context);
- } else {
- this.opcode('push', 'depth0');
- }
-
- this.opcode('invokePartial', id.original);
- this.opcode('append');
- },
-
- content: function(content) {
- this.opcode('appendContent', content.string);
- },
-
- mustache: function(mustache) {
- var params = this.setupStackForMustache(mustache);
-
- this.opcode('invokeMustache', params.length, mustache.id.original, !!mustache.hash);
-
- if(mustache.escaped && !this.options.noEscape) {
- this.opcode('appendEscaped');
- } else {
- this.opcode('append');
- }
- },
-
- ID: function(id) {
- this.addDepth(id.depth);
-
- this.opcode('getContext', id.depth);
-
- this.opcode('lookupWithHelpers', id.parts[0] || null, id.isScoped || false);
-
- for(var i=1, l=id.parts.length; i<l; i++) {
- this.opcode('lookup', id.parts[i]);
- }
- },
-
- STRING: function(string) {
- this.opcode('pushString', string.string);
- },
-
- INTEGER: function(integer) {
- this.opcode('push', integer.integer);
- },
-
- BOOLEAN: function(bool) {
- this.opcode('push', bool.bool);
- },
-
- comment: function() {},
-
- // HELPERS
- pushParams: function(params) {
- var i = params.length, param;
-
- while(i--) {
- param = params[i];
-
- if(this.options.stringParams) {
- if(param.depth) {
- this.addDepth(param.depth);
- }
-
- this.opcode('getContext', param.depth || 0);
- this.opcode('pushStringParam', param.string);
- } else {
- this[param.type](param);
- }
- }
- },
-
- opcode: function(name, val1, val2, val3) {
- this.opcodes.push(Compiler.OPCODE_MAP[name]);
- if(val1 !== undefined) { this.opcodes.push(val1); }
- if(val2 !== undefined) { this.opcodes.push(val2); }
- if(val3 !== undefined) { this.opcodes.push(val3); }
- },
-
- declare: function(name, value) {
- this.opcodes.push('DECLARE');
- this.opcodes.push(name);
- this.opcodes.push(value);
- },
-
- addDepth: function(depth) {
- if(depth === 0) { return; }
-
- if(!this.depths[depth]) {
- this.depths[depth] = true;
- this.depths.list.push(depth);
- }
- },
-
- setupStackForMustache: function(mustache) {
- var params = mustache.params;
-
- this.pushParams(params);
-
- if(mustache.hash) {
- this.hash(mustache.hash);
- }
-
- this.ID(mustache.id);
-
- return params;
- }
- };
-
- JavaScriptCompiler.prototype = {
- // PUBLIC API: You can override these methods in a subclass to provide
- // alternative compiled forms for name lookup and buffering semantics
- nameLookup: function(parent, name, type) {
- if (/^[0-9]+$/.test(name)) {
- return parent + "[" + name + "]";
- } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
- return parent + "." + name;
- }
- else {
- return parent + "['" + name + "']";
- }
- },
-
- appendToBuffer: function(string) {
- if (this.environment.isSimple) {
- return "return " + string + ";";
- } else {
- return "buffer += " + string + ";";
- }
- },
-
- initializeBuffer: function() {
- return this.quotedString("");
- },
-
- namespace: "Handlebars",
- // END PUBLIC API
-
- compile: function(environment, options, context, asObject) {
- this.environment = environment;
- this.options = options || {};
-
- this.name = this.environment.name;
- this.isChild = !!context;
- this.context = context || {
- programs: [],
- aliases: { self: 'this' },
- registers: {list: []}
- };
-
- this.preamble();
-
- this.stackSlot = 0;
- this.stackVars = [];
-
- this.compileChildren(environment, options);
-
- var opcodes = environment.opcodes, opcode;
-
- this.i = 0;
-
- for(l=opcodes.length; this.i<l; this.i++) {
- opcode = this.nextOpcode(0);
-
- if(opcode[0] === 'DECLARE') {
- this.i = this.i + 2;
- this[opcode[1]] = opcode[2];
- } else {
- this.i = this.i + opcode[1].length;
- this[opcode[0]].apply(this, opcode[1]);
- }
- }
-
- return this.createFunctionContext(asObject);
- },
-
- nextOpcode: function(n) {
- var opcodes = this.environment.opcodes, opcode = opcodes[this.i + n], name, val;
- var extraParams, codes;
-
- if(opcode === 'DECLARE') {
- name = opcodes[this.i + 1];
- val = opcodes[this.i + 2];
- return ['DECLARE', name, val];
- } else {
- name = Compiler.DISASSEMBLE_MAP[opcode];
-
- extraParams = Compiler.multiParamSize(opcode);
- codes = [];
-
- for(var j=0; j<extraParams; j++) {
- codes.push(opcodes[this.i + j + 1 + n]);
- }
-
- return [name, codes];
- }
- },
-
- eat: function(opcode) {
- this.i = this.i + opcode.length;
- },
-
- preamble: function() {
- var out = [];
-
- // this register will disambiguate helper lookup from finding a function in
- // a context. This is necessary for mustache compatibility, which requires
- // that context functions in blocks are evaluated by blockHelperMissing, and
- // then proceed as if the resulting value was provided to blockHelperMissing.
- this.useRegister('foundHelper');
-
- if (!this.isChild) {
- var namespace = this.namespace;
- var copies = "helpers = helpers || " + namespace + ".helpers;";
- if(this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
- out.push(copies);
- } else {
- out.push('');
- }
-
- if (!this.environment.isSimple) {
- out.push(", buffer = " + this.initializeBuffer());
- } else {
- out.push("");
- }
-
- // track the last context pushed into place to allow skipping the
- // getContext opcode when it would be a noop
- this.lastContext = 0;
- this.source = out;
- },
-
- createFunctionContext: function(asObject) {
- var locals = this.stackVars;
- if (!this.isChild) {
- locals = locals.concat(this.context.registers.list);
- }
-
- if(locals.length > 0) {
- this.source[1] = this.source[1] + ", " + locals.join(", ");
- }
-
- // Generate minimizer alias mappings
- if (!this.isChild) {
- var aliases = []
- for (var alias in this.context.aliases) {
- this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
- }
- }
-
- if (this.source[1]) {
- this.source[1] = "var " + this.source[1].substring(2) + ";";
- }
-
- // Merge children
- if (!this.isChild) {
- this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
- }
-
- if (!this.environment.isSimple) {
- this.source.push("return buffer;");
- }
-
- var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
-
- for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
- params.push("depth" + this.environment.depths.list[i]);
- }
-
- if (asObject) {
- params.push(this.source.join("\n "));
-
- return Function.apply(this, params);
- } else {
- var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + this.source.join("\n ") + '}';
- Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
- return functionSource;
- }
- },
-
- appendContent: function(content) {
- this.source.push(this.appendToBuffer(this.quotedString(content)));
- },
-
- append: function() {
- var local = this.popStack();
- this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
- if (this.environment.isSimple) {
- this.source.push("else { " + this.appendToBuffer("''") + " }");
- }
- },
-
- appendEscaped: function() {
- var opcode = this.nextOpcode(1), extra = "";
- this.context.aliases.escapeExpression = 'this.escapeExpression';
-
- if(opcode[0] === 'appendContent') {
- extra = " + " + this.quotedString(opcode[1][0]);
- this.eat(opcode);
- }
-
- this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")" + extra));
- },
-
- getContext: function(depth) {
- if(this.lastContext !== depth) {
- this.lastContext = depth;
- }
- },
-
- lookupWithHelpers: function(name, isScoped) {
- if(name) {
- var topStack = this.nextStack();
-
- this.usingKnownHelper = false;
-
- var toPush;
- if (!isScoped && this.options.knownHelpers[name]) {
- toPush = topStack + " = " + this.nameLookup('helpers', name, 'helper');
- this.usingKnownHelper = true;
- } else if (isScoped || this.options.knownHelpersOnly) {
- toPush = topStack + " = " + this.nameLookup('depth' + this.lastContext, name, 'context');
- } else {
- this.register('foundHelper', this.nameLookup('helpers', name, 'helper'));
- toPush = topStack + " = foundHelper || " + this.nameLookup('depth' + this.lastContext, name, 'context');
- }
-
- toPush += ';';
- this.source.push(toPush);
- } else {
- this.pushStack('depth' + this.lastContext);
- }
- },
-
- lookup: function(name) {
- var topStack = this.topStack();
- this.source.push(topStack + " = (" + topStack + " === null || " + topStack + " === undefined || " + topStack + " === false ? " +
- topStack + " : " + this.nameLookup(topStack, name, 'context') + ");");
- },
-
- pushStringParam: function(string) {
- this.pushStack('depth' + this.lastContext);
- this.pushString(string);
- },
-
- pushString: function(string) {
- this.pushStack(this.quotedString(string));
- },
-
- push: function(name) {
- this.pushStack(name);
- },
-
- invokeMustache: function(paramSize, original, hasHash) {
- this.populateParams(paramSize, this.quotedString(original), "{}", null, hasHash, function(nextStack, helperMissingString, id) {
- if (!this.usingKnownHelper) {
- this.context.aliases.helperMissing = 'helpers.helperMissing';
- this.context.aliases.undef = 'void 0';
- this.source.push("else if(" + id + "=== undef) { " + nextStack + " = helperMissing.call(" + helperMissingString + "); }");
- if (nextStack !== id) {
- this.source.push("else { " + nextStack + " = " + id + "; }");
- }
- }
- });
- },
-
- invokeProgram: function(guid, paramSize, hasHash) {
- var inverse = this.programExpression(this.inverse);
- var mainProgram = this.programExpression(guid);
-
- this.populateParams(paramSize, null, mainProgram, inverse, hasHash, function(nextStack, helperMissingString, id) {
- if (!this.usingKnownHelper) {
- this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
- this.source.push("else { " + nextStack + " = blockHelperMissing.call(" + helperMissingString + "); }");
- }
- });
- },
-
- populateParams: function(paramSize, helperId, program, inverse, hasHash, fn) {
- var needsRegister = hasHash || this.options.stringParams || inverse || this.options.data;
- var id = this.popStack(), nextStack;
- var params = [], param, stringParam, stringOptions;
-
- if (needsRegister) {
- this.register('tmp1', program);
- stringOptions = 'tmp1';
- } else {
- stringOptions = '{ hash: {} }';
- }
-
- if (needsRegister) {
- var hash = (hasHash ? this.popStack() : '{}');
- this.source.push('tmp1.hash = ' + hash + ';');
- }
-
- if(this.options.stringParams) {
- this.source.push('tmp1.contexts = [];');
- }
-
- for(var i=0; i<paramSize; i++) {
- param = this.popStack();
- params.push(param);
-
- if(this.options.stringParams) {
- this.source.push('tmp1.contexts.push(' + this.popStack() + ');');
- }
- }
-
- if(inverse) {
- this.source.push('tmp1.fn = tmp1;');
- this.source.push('tmp1.inverse = ' + inverse + ';');
- }
-
- if(this.options.data) {
- this.source.push('tmp1.data = data;');
- }
-
- params.push(stringOptions);
-
- this.populateCall(params, id, helperId || id, fn, program !== '{}');
- },
-
- populateCall: function(params, id, helperId, fn, program) {
- var paramString = ["depth0"].concat(params).join(", ");
- var helperMissingString = ["depth0"].concat(helperId).concat(params).join(", ");
-
- var nextStack = this.nextStack();
-
- if (this.usingKnownHelper) {
- this.source.push(nextStack + " = " + id + ".call(" + paramString + ");");
- } else {
- this.context.aliases.functionType = '"function"';
- var condition = program ? "foundHelper && " : ""
- this.source.push("if(" + condition + "typeof " + id + " === functionType) { " + nextStack + " = " + id + ".call(" + paramString + "); }");
- }
- fn.call(this, nextStack, helperMissingString, id);
- this.usingKnownHelper = false;
- },
-
- invokePartial: function(context) {
- params = [this.nameLookup('partials', context, 'partial'), "'" + context + "'", this.popStack(), "helpers", "partials"];
-
- if (this.options.data) {
- params.push("data");
- }
-
- this.pushStack("self.invokePartial(" + params.join(", ") + ");");
- },
-
- assignToHash: function(key) {
- var value = this.popStack();
- var hash = this.topStack();
-
- this.source.push(hash + "['" + key + "'] = " + value + ";");
- },
-
- // HELPERS
-
- compiler: JavaScriptCompiler,
-
- compileChildren: function(environment, options) {
- var children = environment.children, child, compiler;
-
- for(var i=0, l=children.length; i<l; i++) {
- child = children[i];
- compiler = new this.compiler();
-
- this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
- var index = this.context.programs.length;
- child.index = index;
- child.name = 'program' + index;
- this.context.programs[index] = compiler.compile(child, options, this.context);
- }
- },
-
- programExpression: function(guid) {
- if(guid == null) { return "self.noop"; }
-
- var child = this.environment.children[guid],
- depths = child.depths.list;
- var programParams = [child.index, child.name, "data"];
-
- for(var i=0, l = depths.length; i<l; i++) {
- depth = depths[i];
-
- if(depth === 1) { programParams.push("depth0"); }
- else { programParams.push("depth" + (depth - 1)); }
- }
-
- if(depths.length === 0) {
- return "self.program(" + programParams.join(", ") + ")";
- } else {
- programParams.shift();
- return "self.programWithDepth(" + programParams.join(", ") + ")";
- }
- },
-
- register: function(name, val) {
- this.useRegister(name);
- this.source.push(name + " = " + val + ";");
- },
-
- useRegister: function(name) {
- if(!this.context.registers[name]) {
- this.context.registers[name] = true;
- this.context.registers.list.push(name);
- }
- },
-
- pushStack: function(item) {
- this.source.push(this.nextStack() + " = " + item + ";");
- return "stack" + this.stackSlot;
- },
-
- nextStack: function() {
- this.stackSlot++;
- if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
- return "stack" + this.stackSlot;
- },
-
- popStack: function() {
- return "stack" + this.stackSlot--;
- },
-
- topStack: function() {
- return "stack" + this.stackSlot;
- },
-
- quotedString: function(str) {
- return '"' + str
- .replace(/\\/g, '\\\\')
- .replace(/"/g, '\\"')
- .replace(/\n/g, '\\n')
- .replace(/\r/g, '\\r') + '"';
- }
- };
-
- var reservedWords = (
- "break else new var" +
- " case finally return void" +
- " catch for switch while" +
- " continue function this with" +
- " default if throw" +
- " delete in try" +
- " do instanceof typeof" +
- " abstract enum int short" +
- " boolean export interface static" +
- " byte extends long super" +
- " char final native synchronized" +
- " class float package throws" +
- " const goto private transient" +
- " debugger implements protected volatile" +
- " double import public let yield"
- ).split(" ");
-
- var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
-
- for(var i=0, l=reservedWords.length; i<l; i++) {
- compilerWords[reservedWords[i]] = true;
- }
-
- JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
- if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
- return true;
- }
- return false;
- }
-
-})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
-
-Handlebars.precompile = function(string, options) {
- options = options || {};
-
- var ast = Handlebars.parse(string);
- var environment = new Handlebars.Compiler().compile(ast, options);
- return new Handlebars.JavaScriptCompiler().compile(environment, options);
-};
-
-Handlebars.compile = function(string, options) {
- options = options || {};
-
- var compiled;
- function compile() {
- var ast = Handlebars.parse(string);
- var environment = new Handlebars.Compiler().compile(ast, options);
- var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
- return Handlebars.template(templateSpec);
- }
-
- // Template is only compiled on first use and cached after that point.
- return function(context, options) {
- if (!compiled) {
- compiled = compile();
- }
- return compiled.call(this, context, options);
- };
-};
-;
-// lib/handlebars/runtime.js
-Handlebars.VM = {
- template: function(templateSpec) {
- // Just add water
- var container = {
- escapeExpression: Handlebars.Utils.escapeExpression,
- invokePartial: Handlebars.VM.invokePartial,
- programs: [],
- program: function(i, fn, data) {
- var programWrapper = this.programs[i];
- if(data) {
- return Handlebars.VM.program(fn, data);
- } else if(programWrapper) {
- return programWrapper;
- } else {
- programWrapper = this.programs[i] = Handlebars.VM.program(fn);
- return programWrapper;
- }
- },
- programWithDepth: Handlebars.VM.programWithDepth,
- noop: Handlebars.VM.noop
- };
-
- return function(context, options) {
- options = options || {};
- return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
- };
- },
-
- programWithDepth: function(fn, data, $depth) {
- var args = Array.prototype.slice.call(arguments, 2);
-
- return function(context, options) {
- options = options || {};
-
- return fn.apply(this, [context, options.data || data].concat(args));
- };
- },
- program: function(fn, data) {
- return function(context, options) {
- options = options || {};
-
- return fn(context, options.data || data);
- };
- },
- noop: function() { return ""; },
- invokePartial: function(partial, name, context, helpers, partials, data) {
- options = { helpers: helpers, partials: partials, data: data };
-
- if(partial === undefined) {
- throw new Handlebars.Exception("The partial " + name + " could not be found");
- } else if(partial instanceof Function) {
- return partial(context, options);
- } else if (!Handlebars.compile) {
- throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
- } else {
- partials[name] = Handlebars.compile(partial);
- return partials[name](context, options);
- }
- }
-};
-
-Handlebars.template = Handlebars.VM.template;
-;
diff --git a/src/components/HMI/lib/iscroll-lite.js b/src/components/HMI/lib/iscroll-lite.js
deleted file mode 100644
index 3a6cab7d2c..0000000000
--- a/src/components/HMI/lib/iscroll-lite.js
+++ /dev/null
@@ -1,594 +0,0 @@
-/*!
- * iScroll Lite base on iScroll v4.1.6 ~ Copyright (c) 2011 Matteo Spinelli, http://cubiq.org
- * Released under MIT license, http://cubiq.org/license
- */
-
-(function(){
-var m = Math,
- mround = function (r) { return r >> 0; },
- vendor = (/webkit/i).test(navigator.appVersion) ? 'webkit' :
- (/firefox/i).test(navigator.userAgent) ? 'Moz' :
- 'opera' in window ? 'O' : '',
-
- // Browser capabilities
- isAndroid = (/android/gi).test(navigator.appVersion),
- isIDevice = (/iphone|ipad/gi).test(navigator.appVersion),
- isPlaybook = (/playbook/gi).test(navigator.appVersion),
- isTouchPad = (/hp-tablet/gi).test(navigator.appVersion),
-
- has3d = 'WebKitCSSMatrix' in window && 'm11' in new WebKitCSSMatrix(),
- hasTouch = 'ontouchstart' in window && !isTouchPad,
- hasTransform = vendor + 'Transform' in document.documentElement.style,
- hasTransitionEnd = isIDevice || isPlaybook,
-
- nextFrame = (function() {
- return window.requestAnimationFrame
- || window.webkitRequestAnimationFrame
- || window.mozRequestAnimationFrame
- || window.oRequestAnimationFrame
- || window.msRequestAnimationFrame
- || function(callback) { return setTimeout(callback, 17); }
- })(),
- cancelFrame = (function () {
- return window.cancelRequestAnimationFrame
- || window.webkitCancelAnimationFrame
- || window.webkitCancelRequestAnimationFrame
- || window.mozCancelRequestAnimationFrame
- || window.oCancelRequestAnimationFrame
- || window.msCancelRequestAnimationFrame
- || clearTimeout
- })(),
-
- // Events
- RESIZE_EV = 'onorientationchange' in window ? 'orientationchange' : 'resize',
- START_EV = hasTouch ? 'touchstart' : 'mousedown',
- MOVE_EV = hasTouch ? 'touchmove' : 'mousemove',
- END_EV = hasTouch ? 'touchend' : 'mouseup',
- CANCEL_EV = hasTouch ? 'touchcancel' : 'mouseup',
-
- // Helpers
- trnOpen = 'translate' + (has3d ? '3d(' : '('),
- trnClose = has3d ? ',0)' : ')',
-
- // Constructor
- iScroll = function (el, options) {
- var that = this,
- doc = document,
- i;
-
- that.wrapper = typeof el == 'object' ? el : doc.getElementById(el);
- that.wrapper.style.overflow = 'hidden';
- that.scroller = that.wrapper.children[0];
-
- // Default options
- that.options = {
- hScroll: true,
- vScroll: true,
- x: 0,
- y: 0,
- bounce: true,
- bounceLock: false,
- momentum: true,
- lockDirection: true,
- useTransform: true,
- useTransition: false,
-
- // Events
- onRefresh: null,
- onBeforeScrollStart: function (e) { e.preventDefault(); },
- onScrollStart: null,
- onBeforeScrollMove: null,
- onScrollMove: null,
- onBeforeScrollEnd: null,
- onScrollEnd: null,
- onTouchEnd: null,
- onDestroy: null
- };
-
- // User defined options
- for (i in options) that.options[i] = options[i];
-
- // Set starting position
- that.x = that.options.x;
- that.y = that.options.y;
-
- // Normalize options
- that.options.useTransform = hasTransform ? that.options.useTransform : false;
- that.options.hScrollbar = that.options.hScroll && that.options.hScrollbar;
- that.options.vScrollbar = that.options.vScroll && that.options.vScrollbar;
- that.options.useTransition = hasTransitionEnd && that.options.useTransition;
-
- // Set some default styles
- that.scroller.style[vendor + 'TransitionProperty'] = that.options.useTransform ? '-' + vendor.toLowerCase() + '-transform' : 'top left';
- that.scroller.style[vendor + 'TransitionDuration'] = '0';
- that.scroller.style[vendor + 'TransformOrigin'] = '0 0';
- if (that.options.useTransition) that.scroller.style[vendor + 'TransitionTimingFunction'] = 'cubic-bezier(0.33,0.66,0.66,1)';
-
- if (that.options.useTransform) that.scroller.style[vendor + 'Transform'] = trnOpen + that.x + 'px,' + that.y + 'px' + trnClose;
- else that.scroller.style.cssText += ';position:absolute;top:' + that.y + 'px;left:' + that.x + 'px';
-
- that.refresh();
-
- that._bind(RESIZE_EV, window);
- that._bind(START_EV);
- if (!hasTouch) that._bind('mouseout', that.wrapper);
- };
-
-// Prototype
-iScroll.prototype = {
- enabled: true,
- x: 0,
- y: 0,
- steps: [],
- scale: 1,
-
- handleEvent: function (e) {
- var that = this;
- switch(e.type) {
- case START_EV:
- if (!hasTouch && e.button !== 0) return;
- that._start(e);
- break;
- case MOVE_EV: that._move(e); break;
- case END_EV:
- case CANCEL_EV: that._end(e); break;
- case RESIZE_EV: that._resize(); break;
- case 'mouseout': that._mouseout(e); break;
- case 'webkitTransitionEnd': that._transitionEnd(e); break;
- }
- },
-
- _resize: function () {
- this.refresh();
- },
-
- _pos: function (x, y) {
- x = this.hScroll ? x : 0;
- y = this.vScroll ? y : 0;
-
- if (this.options.useTransform) {
- this.scroller.style[vendor + 'Transform'] = trnOpen + x + 'px,' + y + 'px' + trnClose + ' scale(' + this.scale + ')';
- } else {
- x = mround(x);
- y = mround(y);
- this.scroller.style.left = x + 'px';
- this.scroller.style.top = y + 'px';
- }
-
- this.x = x;
- this.y = y;
- },
-
- _start: function (e) {
- var that = this,
- point = hasTouch ? e.touches[0] : e,
- matrix, x, y;
-
- if (!that.enabled) return;
-
- if (that.options.onBeforeScrollStart) that.options.onBeforeScrollStart.call(that, e);
-
- if (that.options.useTransition) that._transitionTime(0);
-
- that.moved = false;
- that.animating = false;
- that.zoomed = false;
- that.distX = 0;
- that.distY = 0;
- that.absDistX = 0;
- that.absDistY = 0;
- that.dirX = 0;
- that.dirY = 0;
-
- if (that.options.momentum) {
- if (that.options.useTransform) {
- // Very lame general purpose alternative to CSSMatrix
- matrix = getComputedStyle(that.scroller, null)[vendor + 'Transform'].replace(/[^0-9-.,]/g, '').split(',');
- x = matrix[4] * 1;
- y = matrix[5] * 1;
- } else {
- x = getComputedStyle(that.scroller, null).left.replace(/[^0-9-]/g, '') * 1;
- y = getComputedStyle(that.scroller, null).top.replace(/[^0-9-]/g, '') * 1;
- }
-
- if (x != that.x || y != that.y) {
- if (that.options.useTransition) that._unbind('webkitTransitionEnd');
- else cancelFrame(that.aniTime);
- that.steps = [];
- that._pos(x, y);
- }
- }
-
- that.startX = that.x;
- that.startY = that.y;
- that.pointX = point.pageX;
- that.pointY = point.pageY;
-
- that.startTime = e.timeStamp || Date.now();
-
- if (that.options.onScrollStart) that.options.onScrollStart.call(that, e);
-
- that._bind(MOVE_EV);
- that._bind(END_EV);
- that._bind(CANCEL_EV);
- },
-
- _move: function (e) {
- var that = this,
- point = hasTouch ? e.touches[0] : e,
- deltaX = point.pageX - that.pointX,
- deltaY = point.pageY - that.pointY,
- newX = that.x + deltaX,
- newY = that.y + deltaY,
- timestamp = e.timeStamp || Date.now();
-
- if (that.options.onBeforeScrollMove) that.options.onBeforeScrollMove.call(that, e);
-
- that.pointX = point.pageX;
- that.pointY = point.pageY;
-
- // Slow down if outside of the boundaries
- if (newX > 0 || newX < that.maxScrollX) {
- newX = that.options.bounce ? that.x + (deltaX / 2) : newX >= 0 || that.maxScrollX >= 0 ? 0 : that.maxScrollX;
- }
- if (newY > 0 || newY < that.maxScrollY) {
- newY = that.options.bounce ? that.y + (deltaY / 2) : newY >= 0 || that.maxScrollY >= 0 ? 0 : that.maxScrollY;
- }
-
- that.distX += deltaX;
- that.distY += deltaY;
- that.absDistX = m.abs(that.distX);
- that.absDistY = m.abs(that.distY);
-
- if (that.absDistX < 6 && that.absDistY < 6) {
- return;
- }
-
- // Lock direction
- if (that.options.lockDirection) {
- if (that.absDistX > that.absDistY + 5) {
- newY = that.y;
- deltaY = 0;
- } else if (that.absDistY > that.absDistX + 5) {
- newX = that.x;
- deltaX = 0;
- }
- }
-
- that.moved = true;
- that._pos(newX, newY);
- that.dirX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;
- that.dirY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;
-
- if (timestamp - that.startTime > 300) {
- that.startTime = timestamp;
- that.startX = that.x;
- that.startY = that.y;
- }
-
- if (that.options.onScrollMove) that.options.onScrollMove.call(that, e);
- },
-
- _end: function (e) {
- if (hasTouch && e.touches.length != 0) return;
-
- var that = this,
- point = hasTouch ? e.changedTouches[0] : e,
- target, ev,
- momentumX = { dist:0, time:0 },
- momentumY = { dist:0, time:0 },
- duration = (e.timeStamp || Date.now()) - that.startTime,
- newPosX = that.x,
- newPosY = that.y,
- newDuration;
-
- that._unbind(MOVE_EV);
- that._unbind(END_EV);
- that._unbind(CANCEL_EV);
-
- if (that.options.onBeforeScrollEnd) that.options.onBeforeScrollEnd.call(that, e);
-
- if (!that.moved) {
- if (hasTouch) {
- // Find the last touched element
- target = point.target;
- while (target.nodeType != 1) target = target.parentNode;
-
- if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA') {
- ev = document.createEvent('MouseEvents');
- ev.initMouseEvent('click', true, true, e.view, 1,
- point.screenX, point.screenY, point.clientX, point.clientY,
- e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
- 0, null);
- ev._fake = true;
- target.dispatchEvent(ev);
- }
- }
-
- that._resetPos(200);
-
- if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
- return;
- }
-
- if (duration < 300 && that.options.momentum) {
- momentumX = newPosX ? that._momentum(newPosX - that.startX, duration, -that.x, that.scrollerW - that.wrapperW + that.x, that.options.bounce ? that.wrapperW : 0) : momentumX;
- momentumY = newPosY ? that._momentum(newPosY - that.startY, duration, -that.y, (that.maxScrollY < 0 ? that.scrollerH - that.wrapperH + that.y : 0), that.options.bounce ? that.wrapperH : 0) : momentumY;
-
- newPosX = that.x + momentumX.dist;
- newPosY = that.y + momentumY.dist;
-
- if ((that.x > 0 && newPosX > 0) || (that.x < that.maxScrollX && newPosX < that.maxScrollX)) momentumX = { dist:0, time:0 };
- if ((that.y > 0 && newPosY > 0) || (that.y < that.maxScrollY && newPosY < that.maxScrollY)) momentumY = { dist:0, time:0 };
- }
-
- if (momentumX.dist || momentumY.dist) {
- newDuration = m.max(m.max(momentumX.time, momentumY.time), 10);
-
- that.scrollTo(mround(newPosX), mround(newPosY), newDuration);
-
- if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
- return;
- }
-
- that._resetPos(200);
- if (that.options.onTouchEnd) that.options.onTouchEnd.call(that, e);
- },
-
- _resetPos: function (time) {
- var that = this,
- resetX = that.x >= 0 ? 0 : that.x < that.maxScrollX ? that.maxScrollX : that.x,
- resetY = that.y >= 0 || that.maxScrollY > 0 ? 0 : that.y < that.maxScrollY ? that.maxScrollY : that.y;
-
- if (resetX == that.x && resetY == that.y) {
- if (that.moved) {
- if (that.options.onScrollEnd) that.options.onScrollEnd.call(that); // Execute custom code on scroll end
- that.moved = false;
- }
-
- return;
- }
-
- that.scrollTo(resetX, resetY, time || 0);
- },
-
- _mouseout: function (e) {
- var t = e.relatedTarget;
-
- if (!t) {
- this._end(e);
- return;
- }
-
- while (t = t.parentNode) if (t == this.wrapper) return;
-
- this._end(e);
- },
-
- _transitionEnd: function (e) {
- var that = this;
-
- if (e.target != that.scroller) return;
-
- that._unbind('webkitTransitionEnd');
-
- that._startAni();
- },
-
- /**
- *
- * Utilities
- *
- */
- _startAni: function () {
- var that = this,
- startX = that.x, startY = that.y,
- startTime = Date.now(),
- step, easeOut,
- animate;
-
- if (that.animating) return;
-
- if (!that.steps.length) {
- that._resetPos(400);
- return;
- }
-
- step = that.steps.shift();
-
- if (step.x == startX && step.y == startY) step.time = 0;
-
- that.animating = true;
- that.moved = true;
-
- if (that.options.useTransition) {
- that._transitionTime(step.time);
- that._pos(step.x, step.y);
- that.animating = false;
- if (step.time) that._bind('webkitTransitionEnd');
- else that._resetPos(0);
- return;
- }
-
- animate = function () {
- var now = Date.now(),
- newX, newY;
-
- if (now >= startTime + step.time) {
- that._pos(step.x, step.y);
- that.animating = false;
- if (that.options.onAnimationEnd) that.options.onAnimationEnd.call(that); // Execute custom code on animation end
- that._startAni();
- return;
- }
-
- now = (now - startTime) / step.time - 1;
- easeOut = m.sqrt(1 - now * now);
- newX = (step.x - startX) * easeOut + startX;
- newY = (step.y - startY) * easeOut + startY;
- that._pos(newX, newY);
- if (that.animating) that.aniTime = nextFrame(animate);
- };
-
- animate();
- },
-
- _transitionTime: function (time) {
- this.scroller.style[vendor + 'TransitionDuration'] = time + 'ms';
- },
-
- _momentum: function (dist, time, maxDistUpper, maxDistLower, size) {
- var deceleration = 0.0006,
- speed = m.abs(dist) / time,
- newDist = (speed * speed) / (2 * deceleration),
- newTime = 0, outsideDist = 0;
-
- // Proportinally reduce speed if we are outside of the boundaries
- if (dist > 0 && newDist > maxDistUpper) {
- outsideDist = size / (6 / (newDist / speed * deceleration));
- maxDistUpper = maxDistUpper + outsideDist;
- speed = speed * maxDistUpper / newDist;
- newDist = maxDistUpper;
- } else if (dist < 0 && newDist > maxDistLower) {
- outsideDist = size / (6 / (newDist / speed * deceleration));
- maxDistLower = maxDistLower + outsideDist;
- speed = speed * maxDistLower / newDist;
- newDist = maxDistLower;
- }
-
- newDist = newDist * (dist < 0 ? -1 : 1);
- newTime = speed / deceleration;
-
- return { dist: newDist, time: mround(newTime) };
- },
-
- _offset: function (el) {
- var left = -el.offsetLeft,
- top = -el.offsetTop;
-
- while (el = el.offsetParent) {
- left -= el.offsetLeft;
- top -= el.offsetTop;
- }
-
- return { left: left, top: top };
- },
-
- _bind: function (type, el, bubble) {
- (el || this.scroller).addEventListener(type, this, !!bubble);
- },
-
- _unbind: function (type, el, bubble) {
- (el || this.scroller).removeEventListener(type, this, !!bubble);
- },
-
-
- /**
- *
- * Public methods
- *
- */
- destroy: function () {
- var that = this;
-
- that.scroller.style[vendor + 'Transform'] = '';
-
- // Remove the event listeners
- that._unbind(RESIZE_EV, window);
- that._unbind(START_EV);
- that._unbind(MOVE_EV);
- that._unbind(END_EV);
- that._unbind(CANCEL_EV);
- that._unbind('mouseout', that.wrapper);
- if (that.options.useTransition) that._unbind('webkitTransitionEnd');
-
- if (that.options.onDestroy) that.options.onDestroy.call(that);
- },
-
- refresh: function () {
- var that = this,
- offset;
-
- that.wrapperW = that.wrapper.clientWidth;
- that.wrapperH = that.wrapper.clientHeight;
-
- that.scrollerW = that.scroller.offsetWidth;
- that.scrollerH = that.scroller.offsetHeight;
- that.maxScrollX = that.wrapperW - that.scrollerW;
- that.maxScrollY = that.wrapperH - that.scrollerH;
- that.dirX = 0;
- that.dirY = 0;
-
- that.hScroll = that.options.hScroll && that.maxScrollX < 0;
- that.vScroll = that.options.vScroll && (!that.options.bounceLock && !that.hScroll || that.scrollerH > that.wrapperH);
-
- offset = that._offset(that.wrapper);
- that.wrapperOffsetLeft = -offset.left;
- that.wrapperOffsetTop = -offset.top;
-
-
- that.scroller.style[vendor + 'TransitionDuration'] = '0';
-
- that._resetPos(200);
- },
-
- scrollTo: function (x, y, time, relative) {
- var that = this,
- step = x,
- i, l;
-
- that.stop();
-
- if (!step.length) step = [{ x: x, y: y, time: time, relative: relative }];
-
- for (i=0, l=step.length; i<l; i++) {
- if (step[i].relative) { step[i].x = that.x - step[i].x; step[i].y = that.y - step[i].y; }
- that.steps.push({ x: step[i].x, y: step[i].y, time: step[i].time || 0 });
- }
-
- that._startAni();
- },
-
- scrollToElement: function (el, time) {
- var that = this, pos;
- el = el.nodeType ? el : that.scroller.querySelector(el);
- if (!el) return;
-
- pos = that._offset(el);
- pos.left += that.wrapperOffsetLeft;
- pos.top += that.wrapperOffsetTop;
-
- pos.left = pos.left > 0 ? 0 : pos.left < that.maxScrollX ? that.maxScrollX : pos.left;
- pos.top = pos.top > 0 ? 0 : pos.top < that.maxScrollY ? that.maxScrollY : pos.top;
- time = time === undefined ? m.max(m.abs(pos.left)*2, m.abs(pos.top)*2) : time;
-
- that.scrollTo(pos.left, pos.top, time);
- },
-
- disable: function () {
- this.stop();
- this._resetPos(0);
- this.enabled = false;
-
- // If disabled after touchstart we make sure that there are no left over events
- this._unbind(MOVE_EV);
- this._unbind(END_EV);
- this._unbind(CANCEL_EV);
- },
-
- enable: function () {
- this.enabled = true;
- },
-
- stop: function () {
- cancelFrame(this.aniTime);
- this.steps = [];
- this.moved = false;
- this.animating = false;
- }
-};
-
-if (typeof exports !== 'undefined') exports.iScroll = iScroll;
-else window.iScroll = iScroll;
-
-})();
diff --git a/src/components/HMI/lib/jquery-1.7.2.js b/src/components/HMI/lib/jquery-1.7.2.js
deleted file mode 100644
index 0073dfc8c3..0000000000
--- a/src/components/HMI/lib/jquery-1.7.2.js
+++ /dev/null
@@ -1,9404 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.7.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Wed Mar 21 12:46:34 2012 -0700
- */
-(function( window, undefined ) {
-
-// Use the correct document accordingly with window argument (sandbox)
-var document = window.document,
- navigator = window.navigator,
- location = window.location;
-var jQuery = (function() {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context, rootjQuery );
- },
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // A simple way to check for HTML strings or ID strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
- // Check if a string has a non-whitespace character in it
- rnotwhite = /\S/,
-
- // Used for trimming whitespace
- trimLeft = /^\s+/,
- trimRight = /\s+$/,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
- // JSON RegExp
- rvalidchars = /^[\],:{}\s]*$/,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
- // Useragent RegExp
- rwebkit = /(webkit)[ \/]([\w.]+)/,
- ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
- rmsie = /(msie) ([\w.]+)/,
- rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
-
- // Matches dashed string for camelizing
- rdashAlpha = /-([a-z]|[0-9])/ig,
- rmsPrefix = /^-ms-/,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return ( letter + "" ).toUpperCase();
- },
-
- // Keep a UserAgent string for use with jQuery.browser
- userAgent = navigator.userAgent,
-
- // For matching the engine and version of the browser
- browserMatch,
-
- // The deferred used on DOM ready
- readyList,
-
- // The ready event handler
- DOMContentLoaded,
-
- // Save a reference to some core methods
- toString = Object.prototype.toString,
- hasOwn = Object.prototype.hasOwnProperty,
- push = Array.prototype.push,
- slice = Array.prototype.slice,
- trim = String.prototype.trim,
- indexOf = Array.prototype.indexOf,
-
- // [[Class]] -> type pairs
- class2type = {};
-
-jQuery.fn = jQuery.prototype = {
- constructor: jQuery,
- init: function( selector, context, rootjQuery ) {
- var match, elem, ret, doc;
-
- // Handle $(""), $(null), or $(undefined)
- if ( !selector ) {
- return this;
- }
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
- // The body element only exists once, optimize finding it
- if ( selector === "body" && !context && document.body ) {
- this.context = document;
- this[0] = document.body;
- this.selector = selector;
- this.length = 1;
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = quickExpr.exec( selector );
- }
-
- // Verify a match, and that no context was specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- context = context instanceof jQuery ? context[0] : context;
- doc = ( context ? context.ownerDocument || context : document );
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- ret = rsingleTag.exec( selector );
-
- if ( ret ) {
- if ( jQuery.isPlainObject( context ) ) {
- selector = [ document.createElement( ret[1] ) ];
- jQuery.fn.attr.call( selector, context, true );
-
- } else {
- selector = [ doc.createElement( ret[1] ) ];
- }
-
- } else {
- ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
- selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
- }
-
- return jQuery.merge( this, selector );
-
- // HANDLE: $("#id")
- } else {
- elem = document.getElementById( match[2] );
-
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id !== match[2] ) {
- return rootjQuery.find( selector );
- }
-
- // Otherwise, we inject the element directly into the jQuery object
- this.length = 1;
- this[0] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || rootjQuery ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.7.2",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- toArray: function() {
- return slice.call( this, 0 );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num == null ?
-
- // Return a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this[ this.length + num ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = this.constructor();
-
- if ( jQuery.isArray( elems ) ) {
- push.apply( ret, elems );
-
- } else {
- jQuery.merge( ret, elems );
- }
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" ) {
- ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- // Attach the listeners
- jQuery.bindReady();
-
- // Add the callback
- readyList.add( fn );
-
- return this;
- },
-
- eq: function( i ) {
- i = +i;
- return i === -1 ?
- this.slice( i ) :
- this.slice( i, i + 1 );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ),
- "slice", slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- return this.prevObject || this.constructor(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: [].sort,
- splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( length === i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend({
- noConflict: function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Hold (or release) the ready event
- holdReady: function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- },
-
- // Handle when the DOM is ready
- ready: function( wait ) {
- // Either a released hold or an DOMready/load event and not yet ready
- if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 1 );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.fireWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.trigger ) {
- jQuery( document ).trigger( "ready" ).off( "ready" );
- }
- }
- },
-
- bindReady: function() {
- if ( readyList ) {
- return;
- }
-
- readyList = jQuery.Callbacks( "once memory" );
-
- // Catch cases where $(document).ready() is called after the
- // browser event has already occurred.
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- return setTimeout( jQuery.ready, 1 );
- }
-
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", jQuery.ready, false );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var toplevel = false;
-
- try {
- toplevel = window.frameElement == null;
- } catch(e) {}
-
- if ( document.documentElement.doScroll && toplevel ) {
- doScrollCheck();
- }
- }
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return jQuery.type(obj) === "function";
- },
-
- isArray: Array.isArray || function( obj ) {
- return jQuery.type(obj) === "array";
- },
-
- isWindow: function( obj ) {
- return obj != null && obj == obj.window;
- },
-
- isNumeric: function( obj ) {
- return !isNaN( parseFloat(obj) ) && isFinite( obj );
- },
-
- type: function( obj ) {
- return obj == null ?
- String( obj ) :
- class2type[ toString.call(obj) ] || "object";
- },
-
- isPlainObject: function( obj ) {
- // Must be an Object.
- // Because of IE, we also have to check the presence of the constructor property.
- // Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- try {
- // Not own constructor property must be Object
- if ( obj.constructor &&
- !hasOwn.call(obj, "constructor") &&
- !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
- } catch ( e ) {
- // IE8,9 Will throw exceptions on certain host objects #9897
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || hasOwn.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- for ( var name in obj ) {
- return false;
- }
- return true;
- },
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- parseJSON: function( data ) {
- if ( typeof data !== "string" || !data ) {
- return null;
- }
-
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
- data = jQuery.trim( data );
-
- // Attempt to parse using the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- return window.JSON.parse( data );
- }
-
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
- .replace( rvalidtokens, "]" )
- .replace( rvalidbraces, "")) ) {
-
- return ( new Function( "return " + data ) )();
-
- }
- jQuery.error( "Invalid JSON: " + data );
- },
-
- // Cross-browser xml parsing
- parseXML: function( data ) {
- if ( typeof data !== "string" || !data ) {
- return null;
- }
- var xml, tmp;
- try {
- if ( window.DOMParser ) { // Standard
- tmp = new DOMParser();
- xml = tmp.parseFromString( data , "text/xml" );
- } else { // IE
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
- xml.async = "false";
- xml.loadXML( data );
- }
- } catch( e ) {
- xml = undefined;
- }
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- },
-
- noop: function() {},
-
- // Evaluates a script in a global context
- // Workarounds based on findings by Jim Driscoll
- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
- globalEval: function( data ) {
- if ( data && rnotwhite.test( data ) ) {
- // We use execScript on Internet Explorer
- // We use an anonymous function so that context is window
- // rather than jQuery in Firefox
- ( window.execScript || function( data ) {
- window[ "eval" ].call( window, data );
- } )( data );
- }
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
- },
-
- // args is for internal usage only
- each: function( object, callback, args ) {
- var name, i = 0,
- length = object.length,
- isObj = length === undefined || jQuery.isFunction( object );
-
- if ( args ) {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.apply( object[ name ], args ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.apply( object[ i++ ], args ) === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
- break;
- }
- }
- }
- }
-
- return object;
- },
-
- // Use native String.trim function wherever possible
- trim: trim ?
- function( text ) {
- return text == null ?
- "" :
- trim.call( text );
- } :
-
- // Otherwise use our own trimming functionality
- function( text ) {
- return text == null ?
- "" :
- text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
- },
-
- // results is for internal usage only
- makeArray: function( array, results ) {
- var ret = results || [];
-
- if ( array != null ) {
- // The window, strings (and functions) also have 'length'
- // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
- var type = jQuery.type( array );
-
- if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
- push.call( ret, array );
- } else {
- jQuery.merge( ret, array );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, array, i ) {
- var len;
-
- if ( array ) {
- if ( indexOf ) {
- return indexOf.call( array, elem, i );
- }
-
- len = array.length;
- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
- for ( ; i < len; i++ ) {
- // Skip accessing in sparse arrays
- if ( i in array && array[ i ] === elem ) {
- return i;
- }
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- var i = first.length,
- j = 0;
-
- if ( typeof second.length === "number" ) {
- for ( var l = second.length; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- var ret = [], retVal;
- inv = !!inv;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- retVal = !!callback( elems[ i ], i );
- if ( inv !== retVal ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var value, key, ret = [],
- i = 0,
- length = elems.length,
- // jquery objects are treated as arrays
- isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
- // Go through the array, translating each of the items to their
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( key in elems ) {
- value = callback( elems[ key ], key, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
- }
-
- // Flatten any nested arrays
- return ret.concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- if ( typeof context === "string" ) {
- var tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- var args = slice.call( arguments, 2 ),
- proxy = function() {
- return fn.apply( context, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
-
- return proxy;
- },
-
- // Mutifunctional method to get and set values to a collection
- // The value/s can optionally be executed if it's a function
- access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
- var exec,
- bulk = key == null,
- i = 0,
- length = elems.length;
-
- // Sets many values
- if ( key && typeof key === "object" ) {
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
- }
- chainable = 1;
-
- // Sets one value
- } else if ( value !== undefined ) {
- // Optionally, function values get executed if exec is true
- exec = pass === undefined && jQuery.isFunction( value );
-
- if ( bulk ) {
- // Bulk operations only iterate when executing function values
- if ( exec ) {
- exec = fn;
- fn = function( elem, key, value ) {
- return exec.call( jQuery( elem ), value );
- };
-
- // Otherwise they run against the entire set
- } else {
- fn.call( elems, value );
- fn = null;
- }
- }
-
- if ( fn ) {
- for (; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
- }
- }
-
- chainable = 1;
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- length ? fn( elems[0], key ) : emptyGet;
- },
-
- now: function() {
- return ( new Date() ).getTime();
- },
-
- // Use of jQuery.browser is frowned upon.
- // More details: http://docs.jquery.com/Utilities/jQuery.browser
- uaMatch: function( ua ) {
- ua = ua.toLowerCase();
-
- var match = rwebkit.exec( ua ) ||
- ropera.exec( ua ) ||
- rmsie.exec( ua ) ||
- ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
- [];
-
- return { browser: match[1] || "", version: match[2] || "0" };
- },
-
- sub: function() {
- function jQuerySub( selector, context ) {
- return new jQuerySub.fn.init( selector, context );
- }
- jQuery.extend( true, jQuerySub, this );
- jQuerySub.superclass = this;
- jQuerySub.fn = jQuerySub.prototype = this();
- jQuerySub.fn.constructor = jQuerySub;
- jQuerySub.sub = this.sub;
- jQuerySub.fn.init = function init( selector, context ) {
- if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
- context = jQuerySub( context );
- }
-
- return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
- };
- jQuerySub.fn.init.prototype = jQuerySub.fn;
- var rootjQuerySub = jQuerySub(document);
- return jQuerySub;
- },
-
- browser: {}
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
- jQuery.browser[ browserMatch.browser ] = true;
- jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
- jQuery.browser.safari = true;
-}
-
-// IE doesn't match non-breaking spaces with \s
-if ( rnotwhite.test( "\xA0" ) ) {
- trimLeft = /^[\s\xA0]+/;
- trimRight = /[\s\xA0]+$/;
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
- DOMContentLoaded = function() {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- };
-
-} else if ( document.attachEvent ) {
- DOMContentLoaded = function() {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
- }
- };
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
- if ( jQuery.isReady ) {
- return;
- }
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch(e) {
- setTimeout( doScrollCheck, 1 );
- return;
- }
-
- // and execute any waiting functions
- jQuery.ready();
-}
-
-return jQuery;
-
-})();
-
-
-// String to Object flags format cache
-var flagsCache = {};
-
-// Convert String-formatted flags into Object-formatted ones and store in cache
-function createFlags( flags ) {
- var object = flagsCache[ flags ] = {},
- i, length;
- flags = flags.split( /\s+/ );
- for ( i = 0, length = flags.length; i < length; i++ ) {
- object[ flags[i] ] = true;
- }
- return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- * flags: an optional list of space-separated flags that will change how
- * the callback list behaves
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible flags:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( flags ) {
-
- // Convert flags from String-formatted to Object-formatted
- // (we check in cache first)
- flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
-
- var // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = [],
- // Last fire value (for non-forgettable lists)
- memory,
- // Flag to know if list was already fired
- fired,
- // Flag to know if list is currently firing
- firing,
- // First callback to fire (used internally by add and fireWith)
- firingStart,
- // End of the loop when firing
- firingLength,
- // Index of currently firing callback (modified by remove if needed)
- firingIndex,
- // Add one or several callbacks to the list
- add = function( args ) {
- var i,
- length,
- elem,
- type,
- actual;
- for ( i = 0, length = args.length; i < length; i++ ) {
- elem = args[ i ];
- type = jQuery.type( elem );
- if ( type === "array" ) {
- // Inspect recursively
- add( elem );
- } else if ( type === "function" ) {
- // Add if not in unique mode and callback is not in
- if ( !flags.unique || !self.has( elem ) ) {
- list.push( elem );
- }
- }
- }
- },
- // Fire callbacks
- fire = function( context, args ) {
- args = args || [];
- memory = !flags.memory || [ context, args ];
- fired = true;
- firing = true;
- firingIndex = firingStart || 0;
- firingStart = 0;
- firingLength = list.length;
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
- memory = true; // Mark as halted
- break;
- }
- }
- firing = false;
- if ( list ) {
- if ( !flags.once ) {
- if ( stack && stack.length ) {
- memory = stack.shift();
- self.fireWith( memory[ 0 ], memory[ 1 ] );
- }
- } else if ( memory === true ) {
- self.disable();
- } else {
- list = [];
- }
- }
- },
- // Actual Callbacks object
- self = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
- var length = list.length;
- add( arguments );
- // Do we need to add the callbacks to the
- // current firing batch?
- if ( firing ) {
- firingLength = list.length;
- // With memory, if we're not firing then
- // we should call right away, unless previous
- // firing was halted (stopOnFalse)
- } else if ( memory && memory !== true ) {
- firingStart = length;
- fire( memory[ 0 ], memory[ 1 ] );
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- if ( list ) {
- var args = arguments,
- argIndex = 0,
- argLength = args.length;
- for ( ; argIndex < argLength ; argIndex++ ) {
- for ( var i = 0; i < list.length; i++ ) {
- if ( args[ argIndex ] === list[ i ] ) {
- // Handle firingIndex and firingLength
- if ( firing ) {
- if ( i <= firingLength ) {
- firingLength--;
- if ( i <= firingIndex ) {
- firingIndex--;
- }
- }
- }
- // Remove the element
- list.splice( i--, 1 );
- // If we have some unicity property then
- // we only need to do this once
- if ( flags.unique ) {
- break;
- }
- }
- }
- }
- }
- return this;
- },
- // Control if a given callback is in the list
- has: function( fn ) {
- if ( list ) {
- var i = 0,
- length = list.length;
- for ( ; i < length; i++ ) {
- if ( fn === list[ i ] ) {
- return true;
- }
- }
- }
- return false;
- },
- // Remove all callbacks from the list
- empty: function() {
- list = [];
- return this;
- },
- // Have the list do nothing anymore
- disable: function() {
- list = stack = memory = undefined;
- return this;
- },
- // Is it disabled?
- disabled: function() {
- return !list;
- },
- // Lock the list in its current state
- lock: function() {
- stack = undefined;
- if ( !memory || memory === true ) {
- self.disable();
- }
- return this;
- },
- // Is it locked?
- locked: function() {
- return !stack;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( stack ) {
- if ( firing ) {
- if ( !flags.once ) {
- stack.push( [ context, args ] );
- }
- } else if ( !( flags.once && memory ) ) {
- fire( context, args );
- }
- }
- return this;
- },
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
-};
-
-
-
-
-var // Static reference to slice
- sliceDeferred = [].slice;
-
-jQuery.extend({
-
- Deferred: function( func ) {
- var doneList = jQuery.Callbacks( "once memory" ),
- failList = jQuery.Callbacks( "once memory" ),
- progressList = jQuery.Callbacks( "memory" ),
- state = "pending",
- lists = {
- resolve: doneList,
- reject: failList,
- notify: progressList
- },
- promise = {
- done: doneList.add,
- fail: failList.add,
- progress: progressList.add,
-
- state: function() {
- return state;
- },
-
- // Deprecated
- isResolved: doneList.fired,
- isRejected: failList.fired,
-
- then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
- deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
- return this;
- },
- always: function() {
- deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
- return this;
- },
- pipe: function( fnDone, fnFail, fnProgress ) {
- return jQuery.Deferred(function( newDefer ) {
- jQuery.each( {
- done: [ fnDone, "resolve" ],
- fail: [ fnFail, "reject" ],
- progress: [ fnProgress, "notify" ]
- }, function( handler, data ) {
- var fn = data[ 0 ],
- action = data[ 1 ],
- returned;
- if ( jQuery.isFunction( fn ) ) {
- deferred[ handler ](function() {
- returned = fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
- } else {
- newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
- }
- });
- } else {
- deferred[ handler ]( newDefer[ action ] );
- }
- });
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- if ( obj == null ) {
- obj = promise;
- } else {
- for ( var key in promise ) {
- obj[ key ] = promise[ key ];
- }
- }
- return obj;
- }
- },
- deferred = promise.promise({}),
- key;
-
- for ( key in lists ) {
- deferred[ key ] = lists[ key ].fire;
- deferred[ key + "With" ] = lists[ key ].fireWith;
- }
-
- // Handle state
- deferred.done( function() {
- state = "resolved";
- }, failList.disable, progressList.lock ).fail( function() {
- state = "rejected";
- }, doneList.disable, progressList.lock );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( firstParam ) {
- var args = sliceDeferred.call( arguments, 0 ),
- i = 0,
- length = args.length,
- pValues = new Array( length ),
- count = length,
- pCount = length,
- deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
- firstParam :
- jQuery.Deferred(),
- promise = deferred.promise();
- function resolveFunc( i ) {
- return function( value ) {
- args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
- if ( !( --count ) ) {
- deferred.resolveWith( deferred, args );
- }
- };
- }
- function progressFunc( i ) {
- return function( value ) {
- pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
- deferred.notifyWith( promise, pValues );
- };
- }
- if ( length > 1 ) {
- for ( ; i < length; i++ ) {
- if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
- args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
- } else {
- --count;
- }
- }
- if ( !count ) {
- deferred.resolveWith( deferred, args );
- }
- } else if ( deferred !== firstParam ) {
- deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
- }
- return promise;
- }
-});
-
-
-
-
-jQuery.support = (function() {
-
- var support,
- all,
- a,
- select,
- opt,
- input,
- fragment,
- tds,
- events,
- eventName,
- i,
- isSupported,
- div = document.createElement( "div" ),
- documentElement = document.documentElement;
-
- // Preliminary tests
- div.setAttribute("className", "t");
- div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
- all = div.getElementsByTagName( "*" );
- a = div.getElementsByTagName( "a" )[ 0 ];
-
- // Can't get basic test support
- if ( !all || !all.length || !a ) {
- return {};
- }
-
- // First batch of supports tests
- select = document.createElement( "select" );
- opt = select.appendChild( document.createElement("option") );
- input = div.getElementsByTagName( "input" )[ 0 ];
-
- support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText instead)
- style: /top/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.55/.test( a.style.opacity ),
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: ( input.value === "on" ),
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: opt.selected,
-
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
- getSetAttribute: div.className !== "t",
-
- // Tests for enctype support on a form(#6743)
- enctype: !!document.createElement("form").enctype,
-
- // Makes sure cloning an html5 element does not cause problems
- // Where outerHTML is undefined, this still works
- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
- // Will be defined later
- submitBubbles: true,
- changeBubbles: true,
- focusinBubbles: false,
- deleteExpando: true,
- noCloneEvent: true,
- inlineBlockNeedsLayout: false,
- shrinkWrapBlocks: false,
- reliableMarginRight: true,
- pixelMargin: true
- };
-
- // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
- jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
-
- // Make sure checked status is properly cloned
- input.checked = true;
- support.noCloneChecked = input.cloneNode( true ).checked;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Test to see if it's possible to delete an expando from an element
- // Fails in Internet Explorer
- try {
- delete div.test;
- } catch( e ) {
- support.deleteExpando = false;
- }
-
- if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
- div.attachEvent( "onclick", function() {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- support.noCloneEvent = false;
- });
- div.cloneNode( true ).fireEvent( "onclick" );
- }
-
- // Check if a radio maintains its value
- // after being appended to the DOM
- input = document.createElement("input");
- input.value = "t";
- input.setAttribute("type", "radio");
- support.radioValue = input.value === "t";
-
- input.setAttribute("checked", "checked");
-
- // #11217 - WebKit loses check when the name is after the checked attribute
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
- fragment = document.createDocumentFragment();
- fragment.appendChild( div.lastChild );
-
- // WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Check if a disconnected checkbox will retain its checked
- // value of true after appended to the DOM (IE6/7)
- support.appendChecked = input.checked;
-
- fragment.removeChild( input );
- fragment.appendChild( div );
-
- // Technique from Juriy Zaytsev
- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
- // We only care about the case where non-standard event systems
- // are used, namely in IE. Short-circuiting here helps us to
- // avoid an eval call (in setAttribute) which can cause CSP
- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
- if ( div.attachEvent ) {
- for ( i in {
- submit: 1,
- change: 1,
- focusin: 1
- }) {
- eventName = "on" + i;
- isSupported = ( eventName in div );
- if ( !isSupported ) {
- div.setAttribute( eventName, "return;" );
- isSupported = ( typeof div[ eventName ] === "function" );
- }
- support[ i + "Bubbles" ] = isSupported;
- }
- }
-
- fragment.removeChild( div );
-
- // Null elements to avoid leaks in IE
- fragment = select = opt = div = input = null;
-
- // Run tests that need a body at doc ready
- jQuery(function() {
- var container, outer, inner, table, td, offsetSupport,
- marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
- paddingMarginBorderVisibility, paddingMarginBorder,
- body = document.getElementsByTagName("body")[0];
-
- if ( !body ) {
- // Return for frameset docs that don't have a body
- return;
- }
-
- conMarginTop = 1;
- paddingMarginBorder = "padding:0;margin:0;border:";
- positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
- paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
- style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
- html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
- "<table " + style + "' cellpadding='0' cellspacing='0'>" +
- "<tr><td></td></tr></table>";
-
- container = document.createElement("div");
- container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
- body.insertBefore( container, body.firstChild );
-
- // Construct the test element
- div = document.createElement("div");
- container.appendChild( div );
-
- // Check if table cells still have offsetWidth/Height when they are set
- // to display:none and there are still other visible table cells in a
- // table row; if so, offsetWidth/Height are not reliable for use when
- // determining if an element has been hidden directly using
- // display:none (it is still safe to use offsets if a parent element is
- // hidden; don safety goggles and see bug #4512 for more information).
- // (only IE 8 fails this test)
- div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
- tds = div.getElementsByTagName( "td" );
- isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
- tds[ 0 ].style.display = "";
- tds[ 1 ].style.display = "none";
-
- // Check if empty table cells still have offsetWidth/Height
- // (IE <= 8 fail this test)
- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. For more
- // info see bug #3333
- // Fails in WebKit before Feb 2011 nightlies
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- if ( window.getComputedStyle ) {
- div.innerHTML = "";
- marginDiv = document.createElement( "div" );
- marginDiv.style.width = "0";
- marginDiv.style.marginRight = "0";
- div.style.width = "2px";
- div.appendChild( marginDiv );
- support.reliableMarginRight =
- ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
- }
-
- if ( typeof div.style.zoom !== "undefined" ) {
- // Check if natively block-level elements act like inline-block
- // elements when setting their display to 'inline' and giving
- // them layout
- // (IE < 8 does this)
- div.innerHTML = "";
- div.style.width = div.style.padding = "1px";
- div.style.border = 0;
- div.style.overflow = "hidden";
- div.style.display = "inline";
- div.style.zoom = 1;
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
- // Check if elements with layout shrink-wrap their children
- // (IE 6 does this)
- div.style.display = "block";
- div.style.overflow = "visible";
- div.innerHTML = "<div style='width:5px;'></div>";
- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
- }
-
- div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
- div.innerHTML = html;
-
- outer = div.firstChild;
- inner = outer.firstChild;
- td = outer.nextSibling.firstChild.firstChild;
-
- offsetSupport = {
- doesNotAddBorder: ( inner.offsetTop !== 5 ),
- doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
- };
-
- inner.style.position = "fixed";
- inner.style.top = "20px";
-
- // safari subtracts parent border width here which is 5px
- offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
- inner.style.position = inner.style.top = "";
-
- outer.style.overflow = "hidden";
- outer.style.position = "relative";
-
- offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
- offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
-
- if ( window.getComputedStyle ) {
- div.style.marginTop = "1%";
- support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
- }
-
- if ( typeof container.style.zoom !== "undefined" ) {
- container.style.zoom = 1;
- }
-
- body.removeChild( container );
- marginDiv = div = container = null;
-
- jQuery.extend( support, offsetSupport );
- });
-
- return support;
-})();
-
-
-
-
-var rbrace = /^(?:\{.*\}|\[.*\])$/,
- rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
- cache: {},
-
- // Please use with caution
- uuid: 0,
-
- // Unique for each copy of jQuery on the page
- // Non-digits removed to match rinlinejQuery
- expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- // Ban all objects except for Flash (which handle expandos)
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- "applet": true
- },
-
- hasData: function( elem ) {
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
- return !!elem && !isEmptyDataObject( elem );
- },
-
- data: function( elem, name, data, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var privateCache, thisCache, ret,
- internalKey = jQuery.expando,
- getByName = typeof name === "string",
-
- // We have to handle DOM nodes and JS objects differently because IE6-7
- // can't GC object references properly across the DOM-JS boundary
- isNode = elem.nodeType,
-
- // Only DOM nodes need the global jQuery cache; JS object data is
- // attached directly to the object so GC can occur automatically
- cache = isNode ? jQuery.cache : elem,
-
- // Only defining an ID for JS objects if its cache already exists allows
- // the code to shortcut on the same path as a DOM node with no cache
- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
- isEvents = name === "events";
-
- // Avoid doing any more work than we need to when trying to get data on an
- // object that has no data at all
- if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
- return;
- }
-
- if ( !id ) {
- // Only DOM nodes need a new unique ID for each element since their data
- // ends up in the global cache
- if ( isNode ) {
- elem[ internalKey ] = id = ++jQuery.uuid;
- } else {
- id = internalKey;
- }
- }
-
- if ( !cache[ id ] ) {
- cache[ id ] = {};
-
- // Avoids exposing jQuery metadata on plain JS objects when the object
- // is serialized using JSON.stringify
- if ( !isNode ) {
- cache[ id ].toJSON = jQuery.noop;
- }
- }
-
- // An object can be passed to jQuery.data instead of a key/value pair; this gets
- // shallow copied over onto the existing cache
- if ( typeof name === "object" || typeof name === "function" ) {
- if ( pvt ) {
- cache[ id ] = jQuery.extend( cache[ id ], name );
- } else {
- cache[ id ].data = jQuery.extend( cache[ id ].data, name );
- }
- }
-
- privateCache = thisCache = cache[ id ];
-
- // jQuery data() is stored in a separate object inside the object's internal data
- // cache in order to avoid key collisions between internal data and user-defined
- // data.
- if ( !pvt ) {
- if ( !thisCache.data ) {
- thisCache.data = {};
- }
-
- thisCache = thisCache.data;
- }
-
- if ( data !== undefined ) {
- thisCache[ jQuery.camelCase( name ) ] = data;
- }
-
- // Users should not attempt to inspect the internal events object using jQuery.data,
- // it is undocumented and subject to change. But does anyone listen? No.
- if ( isEvents && !thisCache[ name ] ) {
- return privateCache.events;
- }
-
- // Check for both converted-to-camel and non-converted data property names
- // If a data property was specified
- if ( getByName ) {
-
- // First Try to find as-is property data
- ret = thisCache[ name ];
-
- // Test for null|undefined property data
- if ( ret == null ) {
-
- // Try to find the camelCased property
- ret = thisCache[ jQuery.camelCase( name ) ];
- }
- } else {
- ret = thisCache;
- }
-
- return ret;
- },
-
- removeData: function( elem, name, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, i, l,
-
- // Reference to internal data cache key
- internalKey = jQuery.expando,
-
- isNode = elem.nodeType,
-
- // See jQuery.data for more information
- cache = isNode ? jQuery.cache : elem,
-
- // See jQuery.data for more information
- id = isNode ? elem[ internalKey ] : internalKey;
-
- // If there is already no cache entry for this object, there is no
- // purpose in continuing
- if ( !cache[ id ] ) {
- return;
- }
-
- if ( name ) {
-
- thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
- if ( thisCache ) {
-
- // Support array or space separated string names for data keys
- if ( !jQuery.isArray( name ) ) {
-
- // try the string as a key before any manipulation
- if ( name in thisCache ) {
- name = [ name ];
- } else {
-
- // split the camel cased version by spaces unless a key with the spaces exists
- name = jQuery.camelCase( name );
- if ( name in thisCache ) {
- name = [ name ];
- } else {
- name = name.split( " " );
- }
- }
- }
-
- for ( i = 0, l = name.length; i < l; i++ ) {
- delete thisCache[ name[i] ];
- }
-
- // If there is no data left in the cache, we want to continue
- // and let the cache object itself get destroyed
- if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
- return;
- }
- }
- }
-
- // See jQuery.data for more information
- if ( !pvt ) {
- delete cache[ id ].data;
-
- // Don't destroy the parent cache unless the internal data object
- // had been the only thing left in it
- if ( !isEmptyDataObject(cache[ id ]) ) {
- return;
- }
- }
-
- // Browsers that fail expando deletion also refuse to delete expandos on
- // the window, but it will allow it on all other JS objects; other browsers
- // don't care
- // Ensure that `cache` is not a window object #10080
- if ( jQuery.support.deleteExpando || !cache.setInterval ) {
- delete cache[ id ];
- } else {
- cache[ id ] = null;
- }
-
- // We destroyed the cache and need to eliminate the expando on the node to avoid
- // false lookups in the cache for entries that no longer exist
- if ( isNode ) {
- // IE does not allow us to delete expando properties from nodes,
- // nor does it have a removeAttribute function on Document nodes;
- // we must handle all of these cases
- if ( jQuery.support.deleteExpando ) {
- delete elem[ internalKey ];
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( internalKey );
- } else {
- elem[ internalKey ] = null;
- }
- }
- },
-
- // For internal use only.
- _data: function( elem, name, data ) {
- return jQuery.data( elem, name, data, true );
- },
-
- // A method for determining if a DOM node can handle the data expando
- acceptData: function( elem ) {
- if ( elem.nodeName ) {
- var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- if ( match ) {
- return !(match === true || elem.getAttribute("classid") !== match);
- }
- }
-
- return true;
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- var parts, part, attr, name, l,
- elem = this[0],
- i = 0,
- data = null;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = jQuery.data( elem );
-
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
- attr = elem.attributes;
- for ( l = attr.length; i < l; i++ ) {
- name = attr[i].name;
-
- if ( name.indexOf( "data-" ) === 0 ) {
- name = jQuery.camelCase( name.substring(5) );
-
- dataAttr( elem, name, data[ name ] );
- }
- }
- jQuery._data( elem, "parsedAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each(function() {
- jQuery.data( this, key );
- });
- }
-
- parts = key.split( ".", 2 );
- parts[1] = parts[1] ? "." + parts[1] : "";
- part = parts[1] + "!";
-
- return jQuery.access( this, function( value ) {
-
- if ( value === undefined ) {
- data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
- // Try to fetch any internally stored data first
- if ( data === undefined && elem ) {
- data = jQuery.data( elem, key );
- data = dataAttr( elem, key, data );
- }
-
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- }
-
- parts[1] = value;
- this.each(function() {
- var self = jQuery( this );
-
- self.triggerHandler( "setData" + part, parts );
- jQuery.data( this, key, value );
- self.triggerHandler( "changeData" + part, parts );
- });
- }, null, value, arguments.length > 1, null, false );
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
-});
-
-function dataAttr( elem, key, data ) {
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
-
- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
- jQuery.isNumeric( data ) ? +data :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
- data;
- } catch( e ) {}
-
- // Make sure we set the data so it isn't changed later
- jQuery.data( elem, key, data );
-
- } else {
- data = undefined;
- }
- }
-
- return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
- for ( var name in obj ) {
-
- // if the public data object is empty, the private is still empty
- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
- continue;
- }
- if ( name !== "toJSON" ) {
- return false;
- }
- }
-
- return true;
-}
-
-
-
-
-function handleQueueMarkDefer( elem, type, src ) {
- var deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- defer = jQuery._data( elem, deferDataKey );
- if ( defer &&
- ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
- ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
- // Give room for hard-coded callbacks to fire first
- // and eventually mark/queue something else on the element
- setTimeout( function() {
- if ( !jQuery._data( elem, queueDataKey ) &&
- !jQuery._data( elem, markDataKey ) ) {
- jQuery.removeData( elem, deferDataKey, true );
- defer.fire();
- }
- }, 0 );
- }
-}
-
-jQuery.extend({
-
- _mark: function( elem, type ) {
- if ( elem ) {
- type = ( type || "fx" ) + "mark";
- jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
- }
- },
-
- _unmark: function( force, elem, type ) {
- if ( force !== true ) {
- type = elem;
- elem = force;
- force = false;
- }
- if ( elem ) {
- type = type || "fx";
- var key = type + "mark",
- count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
- if ( count ) {
- jQuery._data( elem, key, count );
- } else {
- jQuery.removeData( elem, key, true );
- handleQueueMarkDefer( elem, type, "mark" );
- }
- }
- },
-
- queue: function( elem, type, data ) {
- var q;
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- q = jQuery._data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !q || jQuery.isArray(data) ) {
- q = jQuery._data( elem, type, jQuery.makeArray(data) );
- } else {
- q.push( data );
- }
- }
- return q || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- fn = queue.shift(),
- hooks = {};
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- }
-
- if ( fn ) {
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- jQuery._data( elem, type + ".run", hooks );
- fn.call( elem, function() {
- jQuery.dequeue( elem, type );
- }, hooks );
- }
-
- if ( !queue.length ) {
- jQuery.removeData( elem, type + "queue " + type + ".run", true );
- handleQueueMarkDefer( elem, type, "queue" );
- }
- }
-});
-
-jQuery.fn.extend({
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[0], type );
- }
-
- return data === undefined ?
- this :
- this.each(function() {
- var queue = jQuery.queue( this, type, data );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = setTimeout( next, time );
- hooks.stop = function() {
- clearTimeout( timeout );
- };
- });
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, object ) {
- if ( typeof type !== "string" ) {
- object = type;
- type = undefined;
- }
- type = type || "fx";
- var defer = jQuery.Deferred(),
- elements = this,
- i = elements.length,
- count = 1,
- deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- tmp;
- function resolve() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- }
- while( i-- ) {
- if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
- ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
- jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
- jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
- count++;
- tmp.add( resolve );
- }
- }
- resolve();
- return defer.promise( object );
- }
-});
-
-
-
-
-var rclass = /[\n\t\r]/g,
- rspace = /\s+/,
- rreturn = /\r/g,
- rtype = /^(?:button|input)$/i,
- rfocusable = /^(?:button|input|object|select|textarea)$/i,
- rclickable = /^a(?:rea)?$/i,
- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- getSetAttribute = jQuery.support.getSetAttribute,
- nodeHook, boolHook, fixSpecified;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each(function() {
- jQuery.removeAttr( this, name );
- });
- },
-
- prop: function( name, value ) {
- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- name = jQuery.propFix[ name ] || name;
- return this.each(function() {
- // try/catch handles cases where IE balks (such as removing a property on window)
- try {
- this[ name ] = undefined;
- delete this[ name ];
- } catch( e ) {}
- });
- },
-
- addClass: function( value ) {
- var classNames, i, l, elem,
- setClass, c, cl;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call(this, j, this.className) );
- });
- }
-
- if ( value && typeof value === "string" ) {
- classNames = value.split( rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
-
- if ( elem.nodeType === 1 ) {
- if ( !elem.className && classNames.length === 1 ) {
- elem.className = value;
-
- } else {
- setClass = " " + elem.className + " ";
-
- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
- setClass += classNames[ c ] + " ";
- }
- }
- elem.className = jQuery.trim( setClass );
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classNames, i, l, elem, className, c, cl;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call(this, j, this.className) );
- });
- }
-
- if ( (value && typeof value === "string") || value === undefined ) {
- classNames = ( value || "" ).split( rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
-
- if ( elem.nodeType === 1 && elem.className ) {
- if ( value ) {
- className = (" " + elem.className + " ").replace( rclass, " " );
- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- className = className.replace(" " + classNames[ c ] + " ", " ");
- }
- elem.className = jQuery.trim( className );
-
- } else {
- elem.className = "";
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value,
- isBool = typeof stateVal === "boolean";
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- state = stateVal,
- classNames = value.split( rspace );
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space seperated list
- state = isBool ? state : !self.hasClass( className );
- self[ state ? "addClass" : "removeClass" ]( className );
- }
-
- } else if ( type === "undefined" || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery._data( this, "__className__", this.className );
- }
-
- // toggle whole className
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
- return true;
- }
- }
-
- return false;
- },
-
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[0];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each(function( i ) {
- var self = jQuery(this), val;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, self.val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
- } else if ( typeof val === "number" ) {
- val += "";
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map(val, function ( value ) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- // attributes.value is undefined in Blackberry 4.7 but
- // uses .value. See #6932
- var val = elem.attributes.value;
- return !val || val.specified ? elem.value : elem.text;
- }
- },
- select: {
- get: function( elem ) {
- var value, i, max, option,
- index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type === "select-one";
-
- // Nothing was selected
- if ( index < 0 ) {
- return null;
- }
-
- // Loop through all the selected options
- i = one ? index : 0;
- max = one ? index + 1 : options.length;
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // Don't return options that are disabled or in a disabled optgroup
- if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
- (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
- if ( one && !values.length && options.length ) {
- return jQuery( options[ index ] ).val();
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var values = jQuery.makeArray( value );
-
- jQuery(elem).find("option").each(function() {
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
- });
-
- if ( !values.length ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- },
-
- attrFn: {
- val: true,
- css: true,
- html: true,
- text: true,
- data: true,
- width: true,
- height: true,
- offset: true
- },
-
- attr: function( elem, name, value, pass ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- if ( pass && name in jQuery.attrFn ) {
- return jQuery( elem )[ name ]( value );
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === "undefined" ) {
- return jQuery.prop( elem, name, value );
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if ( notxml ) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
- }
-
- if ( value !== undefined ) {
-
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
- return;
-
- } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- elem.setAttribute( name, "" + value );
- return value;
- }
-
- } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
-
- ret = elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret === null ?
- undefined :
- ret;
- }
- },
-
- removeAttr: function( elem, value ) {
- var propName, attrNames, name, l, isBool,
- i = 0;
-
- if ( value && elem.nodeType === 1 ) {
- attrNames = value.toLowerCase().split( rspace );
- l = attrNames.length;
-
- for ( ; i < l; i++ ) {
- name = attrNames[ i ];
-
- if ( name ) {
- propName = jQuery.propFix[ name ] || name;
- isBool = rboolean.test( name );
-
- // See #9699 for explanation of this approach (setting first, then removal)
- // Do not do this for boolean attributes (see #10870)
- if ( !isBool ) {
- jQuery.attr( elem, name, "" );
- }
- elem.removeAttribute( getSetAttribute ? name : propName );
-
- // Set corresponding property to false for boolean attributes
- if ( isBool && propName in elem ) {
- elem[ propName ] = false;
- }
- }
- }
- }
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
- jQuery.error( "type property can't be changed" );
- } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
- // Setting the type on a radio button after the value resets the value in IE6-9
- // Reset value to it's default in case type is set after value
- // This is for element creation
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- },
- // Use the value property for back compat
- // Use the nodeHook for button elements in IE6/7 (#1954)
- value: {
- get: function( elem, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.get( elem, name );
- }
- return name in elem ?
- elem.value :
- null;
- },
- set: function( elem, value, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.set( elem, value, name );
- }
- // Does not return so that setAttribute is also used
- elem.value = value;
- }
- }
- },
-
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
-
- prop: function( elem, name, value ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set properties on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- if ( notxml ) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- return ( elem[ name ] = value );
- }
-
- } else {
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
- return elem[ name ];
- }
- }
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- var attributeNode = elem.getAttributeNode("tabindex");
-
- return attributeNode && attributeNode.specified ?
- parseInt( attributeNode.value, 10 ) :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- undefined;
- }
- }
- }
-});
-
-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
-jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
-
-// Hook for boolean attributes
-boolHook = {
- get: function( elem, name ) {
- // Align boolean attributes with corresponding properties
- // Fall back to attribute presence where some booleans are not supported
- var attrNode,
- property = jQuery.prop( elem, name );
- return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
- name.toLowerCase() :
- undefined;
- },
- set: function( elem, value, name ) {
- var propName;
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- // value is true since we know at this point it's type boolean and not false
- // Set boolean attributes to the same name and set the DOM property
- propName = jQuery.propFix[ name ] || name;
- if ( propName in elem ) {
- // Only set the IDL specifically if it already exists on the element
- elem[ propName ] = true;
- }
-
- elem.setAttribute( name, name.toLowerCase() );
- }
- return name;
- }
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
- fixSpecified = {
- name: true,
- id: true,
- coords: true
- };
-
- // Use this for any attribute in IE6/7
- // This fixes almost every IE6/7 issue
- nodeHook = jQuery.valHooks.button = {
- get: function( elem, name ) {
- var ret;
- ret = elem.getAttributeNode( name );
- return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
- ret.nodeValue :
- undefined;
- },
- set: function( elem, value, name ) {
- // Set the existing or create a new attribute node
- var ret = elem.getAttributeNode( name );
- if ( !ret ) {
- ret = document.createAttribute( name );
- elem.setAttributeNode( ret );
- }
- return ( ret.nodeValue = value + "" );
- }
- };
-
- // Apply the nodeHook to tabindex
- jQuery.attrHooks.tabindex.set = nodeHook.set;
-
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
- // This is for removals
- jQuery.each([ "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- set: function( elem, value ) {
- if ( value === "" ) {
- elem.setAttribute( name, "auto" );
- return value;
- }
- }
- });
- });
-
- // Set contenteditable to false on removals(#10429)
- // Setting to empty string throws an error as an invalid value
- jQuery.attrHooks.contenteditable = {
- get: nodeHook.get,
- set: function( elem, value, name ) {
- if ( value === "" ) {
- value = "false";
- }
- nodeHook.set( elem, value, name );
- }
- };
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- get: function( elem ) {
- var ret = elem.getAttribute( name, 2 );
- return ret === null ? undefined : ret;
- }
- });
- });
-}
-
-if ( !jQuery.support.style ) {
- jQuery.attrHooks.style = {
- get: function( elem ) {
- // Return undefined in the case of empty string
- // Normalize to lowercase since IE uppercases css property names
- return elem.style.cssText.toLowerCase() || undefined;
- },
- set: function( elem, value ) {
- return ( elem.style.cssText = "" + value );
- }
- };
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
- get: function( elem ) {
- var parent = elem.parentNode;
-
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- return null;
- }
- });
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
- jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
- jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- get: function( elem ) {
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
- };
- });
-}
-jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
- }
- }
- });
-});
-
-
-
-
-var rformElems = /^(?:textarea|input|select)$/i,
- rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
- rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
- quickParse = function( selector ) {
- var quick = rquickIs.exec( selector );
- if ( quick ) {
- // 0 1 2 3
- // [ _, tag, id, class ]
- quick[1] = ( quick[1] || "" ).toLowerCase();
- quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
- }
- return quick;
- },
- quickIs = function( elem, m ) {
- var attrs = elem.attributes || {};
- return (
- (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
- (!m[2] || (attrs.id || {}).value === m[2]) &&
- (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
- );
- },
- hoverHack = function( events ) {
- return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
- };
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
- add: function( elem, types, handler, data, selector ) {
-
- var elemData, eventHandle, events,
- t, tns, type, namespaces, handleObj,
- handleObjIn, quick, handlers, special;
-
- // Don't attach events to noData or text/comment nodes (allow plain objects tho)
- if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- events = elemData.events;
- if ( !events ) {
- elemData.events = events = {};
- }
- eventHandle = elemData.handle;
- if ( !eventHandle ) {
- elemData.handle = eventHandle = function( e ) {
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
- undefined;
- };
- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
- eventHandle.elem = elem;
- }
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- types = jQuery.trim( hoverHack(types) ).split( " " );
- for ( t = 0; t < types.length; t++ ) {
-
- tns = rtypenamespace.exec( types[t] ) || [];
- type = tns[1];
- namespaces = ( tns[2] || "" ).split( "." ).sort();
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend({
- type: type,
- origType: tns[1],
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- quick: selector && quickParse( selector ),
- namespace: namespaces.join(".")
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- handlers = events[ type ];
- if ( !handlers ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener/attachEvent if the special events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
- // Bind the global event handler to the element
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle, false );
-
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- global: {},
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
- t, tns, type, origType, namespaces, origCount,
- j, events, special, handle, eventType, handleObj;
-
- if ( !elemData || !(events = elemData.events) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
- for ( t = 0; t < types.length; t++ ) {
- tns = rtypenamespace.exec( types[t] ) || [];
- type = origType = tns[1];
- namespaces = tns[2];
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector? special.delegateType : special.bindType ) || type;
- eventType = events[ type ] || [];
- origCount = eventType.length;
- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-
- // Remove matching events
- for ( j = 0; j < eventType.length; j++ ) {
- handleObj = eventType[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
- eventType.splice( j--, 1 );
-
- if ( handleObj.selector ) {
- eventType.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( eventType.length === 0 && origCount !== eventType.length ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- handle = elemData.handle;
- if ( handle ) {
- handle.elem = null;
- }
-
- // removeData also checks for emptiness and clears the expando if empty
- // so use it instead of delete
- jQuery.removeData( elem, [ "events", "handle" ], true );
- }
- },
-
- // Events that are safe to short-circuit if no handlers are attached.
- // Native DOM events should not be added, they may have inline handlers.
- customEvent: {
- "getData": true,
- "setData": true,
- "changeData": true
- },
-
- trigger: function( event, data, elem, onlyHandlers ) {
- // Don't do events on text and comment nodes
- if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
- return;
- }
-
- // Event object or event type
- var type = event.type || event,
- namespaces = [],
- cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf( "!" ) >= 0 ) {
- // Exclusive events trigger only for the exact event (no namespaces)
- type = type.slice(0, -1);
- exclusive = true;
- }
-
- if ( type.indexOf( "." ) >= 0 ) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
-
- if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
- // No jQuery handlers for this event type, and it can't have inline handlers
- return;
- }
-
- // Caller can pass in an Event, Object, or just an event type string
- event = typeof event === "object" ?
- // jQuery.Event object
- event[ jQuery.expando ] ? event :
- // Object literal
- new jQuery.Event( type, event ) :
- // Just the event type (string)
- new jQuery.Event( type );
-
- event.type = type;
- event.isTrigger = true;
- event.exclusive = exclusive;
- event.namespace = namespaces.join( "." );
- event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
- ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
- // Handle a global trigger
- if ( !elem ) {
-
- // TODO: Stop taunting the data cache; remove global events and always attach to document
- cache = jQuery.cache;
- for ( i in cache ) {
- if ( cache[ i ].events && cache[ i ].events[ type ] ) {
- jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
- }
- }
- return;
- }
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data != null ? jQuery.makeArray( data ) : [];
- data.unshift( event );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- eventPath = [[ elem, special.bindType || type ]];
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
- old = null;
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push([ cur, bubbleType ]);
- old = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( old && old === elem.ownerDocument ) {
- eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
- }
- }
-
- // Fire handlers on the event path
- for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
- cur = eventPath[i][0];
- event.type = eventPath[i][1];
-
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
- // Note that this is a bare JS function and not a jQuery handler
- handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
- event.preventDefault();
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name name as the event.
- // Can't use an .isFunction() check here because IE6/7 fails that test.
- // Don't do default actions on window, that's where global variables be (#6170)
- // IE<9 dies on focus/blur to hidden element (#1486)
- if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- old = elem[ ontype ];
-
- if ( old ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- elem[ type ]();
- jQuery.event.triggered = undefined;
-
- if ( old ) {
- elem[ ontype ] = old;
- }
- }
- }
- }
-
- return event.result;
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event || window.event );
-
- var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
- delegateCount = handlers.delegateCount,
- args = [].slice.call( arguments, 0 ),
- run_all = !event.exclusive && !event.namespace,
- special = jQuery.event.special[ event.type ] || {},
- handlerQueue = [],
- i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[0] = event;
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers that should run if there are delegated events
- // Avoid non-left-click bubbling in Firefox (#3861)
- if ( delegateCount && !(event.button && event.type === "click") ) {
-
- // Pregenerate a single jQuery object for reuse with .is()
- jqcur = jQuery(this);
- jqcur.context = this.ownerDocument || this;
-
- for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
- // Don't process events on disabled elements (#6911, #8165)
- if ( cur.disabled !== true ) {
- selMatch = {};
- matches = [];
- jqcur[0] = cur;
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
- sel = handleObj.selector;
-
- if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = (
- handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
- );
- }
- if ( selMatch[ sel ] ) {
- matches.push( handleObj );
- }
- }
- if ( matches.length ) {
- handlerQueue.push({ elem: cur, matches: matches });
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- if ( handlers.length > delegateCount ) {
- handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
- }
-
- // Run delegates first; they may want to stop propagation beneath us
- for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
- matched = handlerQueue[ i ];
- event.currentTarget = matched.elem;
-
- for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
- handleObj = matched.matches[ j ];
-
- // Triggered event must either 1) be non-exclusive and have no namespace, or
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
- if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
- event.data = handleObj.data;
- event.handleObj = handleObj;
-
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
- .apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- event.result = ret;
- if ( ret === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- // Includes some event props shared by KeyEvent and MouseEvent
- // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
- fixHooks: {},
-
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function( event, original ) {
-
- // Add which for key events
- if ( event.which == null ) {
- event.which = original.charCode != null ? original.charCode : original.keyCode;
- }
-
- return event;
- }
- },
-
- mouseHooks: {
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function( event, original ) {
- var eventDoc, doc, body,
- button = original.button,
- fromElement = original.fromElement;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && original.clientX != null ) {
- eventDoc = event.target.ownerDocument || document;
- doc = eventDoc.documentElement;
- body = eventDoc.body;
-
- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
- }
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && fromElement ) {
- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- // Note: button is not normalized, so don't use it
- if ( !event.which && button !== undefined ) {
- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
- }
-
- return event;
- }
- },
-
- fix: function( event ) {
- if ( event[ jQuery.expando ] ) {
- return event;
- }
-
- // Create a writable copy of the event object and normalize some properties
- var i, prop,
- originalEvent = event,
- fixHook = jQuery.event.fixHooks[ event.type ] || {},
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
- event = jQuery.Event( originalEvent );
-
- for ( i = copy.length; i; ) {
- prop = copy[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
- if ( !event.target ) {
- event.target = originalEvent.srcElement || document;
- }
-
- // Target should not be a text node (#504, Safari)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
- if ( event.metaKey === undefined ) {
- event.metaKey = event.ctrlKey;
- }
-
- return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
- },
-
- special: {
- ready: {
- // Make sure the ready event is setup
- setup: jQuery.bindReady
- },
-
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
-
- focus: {
- delegateType: "focusin"
- },
- blur: {
- delegateType: "focusout"
- },
-
- beforeunload: {
- setup: function( data, namespaces, eventHandle ) {
- // We only want to do this special case on windows
- if ( jQuery.isWindow( this ) ) {
- this.onbeforeunload = eventHandle;
- }
- },
-
- teardown: function( namespaces, eventHandle ) {
- if ( this.onbeforeunload === eventHandle ) {
- this.onbeforeunload = null;
- }
- }
- }
- },
-
- simulate: function( type, elem, event, bubble ) {
- // Piggyback on a donor event to simulate a different one.
- // Fake originalEvent to avoid donor's stopPropagation, but if the
- // simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- { type: type,
- isSimulated: true,
- originalEvent: {}
- }
- );
- if ( bubble ) {
- jQuery.event.trigger( e, null, elem );
- } else {
- jQuery.event.dispatch.call( elem, e );
- }
- if ( e.isDefaultPrevented() ) {
- event.preventDefault();
- }
- }
-};
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
-jQuery.event.handle = jQuery.event.dispatch;
-
-jQuery.removeEvent = document.removeEventListener ?
- function( elem, type, handle ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle, false );
- }
- } :
- function( elem, type, handle ) {
- if ( elem.detachEvent ) {
- elem.detachEvent( "on" + type, handle );
- }
- };
-
-jQuery.Event = function( src, props ) {
- // Allow instantiation without the 'new' keyword
- if ( !(this instanceof jQuery.Event) ) {
- return new jQuery.Event( src, props );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
- src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if ( props ) {
- jQuery.extend( this, props );
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || jQuery.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
-};
-
-function returnFalse() {
- return false;
-}
-function returnTrue() {
- return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
-
- // if preventDefault exists run it on the original event
- if ( e.preventDefault ) {
- e.preventDefault();
-
- // otherwise set the returnValue property of the original event to false (IE)
- } else {
- e.returnValue = false;
- }
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
- // if stopPropagation exists run it on the original event
- if ( e.stopPropagation ) {
- e.stopPropagation();
- }
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj,
- selector = handleObj.selector,
- ret;
-
- // For mousenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply( this, arguments );
- event.type = fix;
- }
- return ret;
- }
- };
-});
-
-// IE submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
- jQuery.event.special.submit = {
- setup: function() {
- // Only need this for delegated form submit events
- if ( jQuery.nodeName( this, "form" ) ) {
- return false;
- }
-
- // Lazy-add a submit handler when a descendant form may potentially be submitted
- jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
- // Node name check avoids a VML-related crash in IE (#9807)
- var elem = e.target,
- form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
- if ( form && !form._submit_attached ) {
- jQuery.event.add( form, "submit._submit", function( event ) {
- event._submit_bubble = true;
- });
- form._submit_attached = true;
- }
- });
- // return undefined since we don't need an event listener
- },
-
- postDispatch: function( event ) {
- // If form was submitted by the user, bubble the event up the tree
- if ( event._submit_bubble ) {
- delete event._submit_bubble;
- if ( this.parentNode && !event.isTrigger ) {
- jQuery.event.simulate( "submit", this.parentNode, event, true );
- }
- }
- },
-
- teardown: function() {
- // Only need this for delegated form submit events
- if ( jQuery.nodeName( this, "form" ) ) {
- return false;
- }
-
- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
- jQuery.event.remove( this, "._submit" );
- }
- };
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !jQuery.support.changeBubbles ) {
-
- jQuery.event.special.change = {
-
- setup: function() {
-
- if ( rformElems.test( this.nodeName ) ) {
- // IE doesn't fire change on a check/radio until blur; trigger it on click
- // after a propertychange. Eat the blur-change in special.change.handle.
- // This still fires onchange a second time for check/radio after blur.
- if ( this.type === "checkbox" || this.type === "radio" ) {
- jQuery.event.add( this, "propertychange._change", function( event ) {
- if ( event.originalEvent.propertyName === "checked" ) {
- this._just_changed = true;
- }
- });
- jQuery.event.add( this, "click._change", function( event ) {
- if ( this._just_changed && !event.isTrigger ) {
- this._just_changed = false;
- jQuery.event.simulate( "change", this, event, true );
- }
- });
- }
- return false;
- }
- // Delegated event; lazy-add a change handler on descendant inputs
- jQuery.event.add( this, "beforeactivate._change", function( e ) {
- var elem = e.target;
-
- if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
- jQuery.event.add( elem, "change._change", function( event ) {
- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
- jQuery.event.simulate( "change", this.parentNode, event, true );
- }
- });
- elem._change_attached = true;
- }
- });
- },
-
- handle: function( event ) {
- var elem = event.target;
-
- // Swallow native change events from checkbox/radio, we already triggered them above
- if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
- return event.handleObj.handler.apply( this, arguments );
- }
- },
-
- teardown: function() {
- jQuery.event.remove( this, "._change" );
-
- return rformElems.test( this.nodeName );
- }
- };
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler while someone wants focusin/focusout
- var attaches = 0,
- handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- if ( attaches++ === 0 ) {
- document.addEventListener( orig, handler, true );
- }
- },
- teardown: function() {
- if ( --attaches === 0 ) {
- document.removeEventListener( orig, handler, true );
- }
- }
- };
- });
-}
-
-jQuery.fn.extend({
-
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) { // && selector != null
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- this.on( type, selector, data, types[ type ], one );
- }
- return this;
- }
-
- if ( data == null && fn == null ) {
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return this;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return this.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- });
- },
- one: function( types, selector, data, fn ) {
- return this.on( types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- if ( types && types.preventDefault && types.handleObj ) {
- // ( event ) dispatched jQuery.Event
- var handleObj = types.handleObj;
- jQuery( types.delegateTarget ).off(
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if ( typeof types === "object" ) {
- // ( types-object [, selector] )
- for ( var type in types ) {
- this.off( type, selector, types[ type ] );
- }
- return this;
- }
- if ( selector === false || typeof selector === "function" ) {
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if ( fn === false ) {
- fn = returnFalse;
- }
- return this.each(function() {
- jQuery.event.remove( this, types, fn, selector );
- });
- },
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- live: function( types, data, fn ) {
- jQuery( this.context ).on( types, this.selector, data, fn );
- return this;
- },
- die: function( types, fn ) {
- jQuery( this.context ).off( types, this.selector || "**", fn );
- return this;
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
- },
-
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
- triggerHandler: function( type, data ) {
- if ( this[0] ) {
- return jQuery.event.trigger( type, data, this[0], true );
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments,
- guid = fn.guid || jQuery.guid++,
- i = 0,
- toggler = function( event ) {
- // Figure out which function to execute
- var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
- jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply( this, arguments ) || false;
- };
-
- // link all the functions, so any of them can unbind this click handler
- toggler.guid = guid;
- while ( i < args.length ) {
- args[ i++ ].guid = guid;
- }
-
- return this.click( toggler );
- },
-
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- }
-});
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- if ( fn == null ) {
- fn = data;
- data = null;
- }
-
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
-
- if ( jQuery.attrFn ) {
- jQuery.attrFn[ name ] = true;
- }
-
- if ( rkeyEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
- }
-
- if ( rmouseEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
- }
-});
-
-
-
-/*!
- * Sizzle CSS Selector Engine
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
- expando = "sizcache" + (Math.random() + '').replace('.', ''),
- done = 0,
- toString = Object.prototype.toString,
- hasDuplicate = false,
- baseHasDuplicate = true,
- rBackslash = /\\/g,
- rReturn = /\r\n/g,
- rNonWord = /\W/;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-// Thus far that includes Google Chrome.
-[0, 0].sort(function() {
- baseHasDuplicate = false;
- return 0;
-});
-
-var Sizzle = function( selector, context, results, seed ) {
- results = results || [];
- context = context || document;
-
- var origContext = context;
-
- if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
- return [];
- }
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- var m, set, checkSet, extra, ret, cur, pop, i,
- prune = true,
- contextXML = Sizzle.isXML( context ),
- parts = [],
- soFar = selector;
-
- // Reset the position of the chunker regexp (start from head)
- do {
- chunker.exec( "" );
- m = chunker.exec( soFar );
-
- if ( m ) {
- soFar = m[3];
-
- parts.push( m[1] );
-
- if ( m[2] ) {
- extra = m[3];
- break;
- }
- }
- } while ( m );
-
- if ( parts.length > 1 && origPOS.exec( selector ) ) {
-
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
- set = posProcess( parts[0] + parts[1], context, seed );
-
- } else {
- set = Expr.relative[ parts[0] ] ?
- [ context ] :
- Sizzle( parts.shift(), context );
-
- while ( parts.length ) {
- selector = parts.shift();
-
- if ( Expr.relative[ selector ] ) {
- selector += parts.shift();
- }
-
- set = posProcess( selector, set, seed );
- }
- }
-
- } else {
- // Take a shortcut and set the context if the root selector is an ID
- // (but not if it'll be faster if the inner selector is an ID)
- if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-
- ret = Sizzle.find( parts.shift(), context, contextXML );
- context = ret.expr ?
- Sizzle.filter( ret.expr, ret.set )[0] :
- ret.set[0];
- }
-
- if ( context ) {
- ret = seed ?
- { expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-
- set = ret.expr ?
- Sizzle.filter( ret.expr, ret.set ) :
- ret.set;
-
- if ( parts.length > 0 ) {
- checkSet = makeArray( set );
-
- } else {
- prune = false;
- }
-
- while ( parts.length ) {
- cur = parts.pop();
- pop = cur;
-
- if ( !Expr.relative[ cur ] ) {
- cur = "";
- } else {
- pop = parts.pop();
- }
-
- if ( pop == null ) {
- pop = context;
- }
-
- Expr.relative[ cur ]( checkSet, pop, contextXML );
- }
-
- } else {
- checkSet = parts = [];
- }
- }
-
- if ( !checkSet ) {
- checkSet = set;
- }
-
- if ( !checkSet ) {
- Sizzle.error( cur || selector );
- }
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
-
- } else if ( context && context.nodeType === 1 ) {
- for ( i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
-
- } else {
- for ( i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] );
- }
- }
- }
-
- } else {
- makeArray( checkSet, results );
- }
-
- if ( extra ) {
- Sizzle( extra, origContext, results, seed );
- Sizzle.uniqueSort( results );
- }
-
- return results;
-};
-
-Sizzle.uniqueSort = function( results ) {
- if ( sortOrder ) {
- hasDuplicate = baseHasDuplicate;
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[ i - 1 ] ) {
- results.splice( i--, 1 );
- }
- }
- }
- }
-
- return results;
-};
-
-Sizzle.matches = function( expr, set ) {
- return Sizzle( expr, null, null, set );
-};
-
-Sizzle.matchesSelector = function( node, expr ) {
- return Sizzle( expr, null, null, [node] ).length > 0;
-};
-
-Sizzle.find = function( expr, context, isXML ) {
- var set, i, len, match, type, left;
-
- if ( !expr ) {
- return [];
- }
-
- for ( i = 0, len = Expr.order.length; i < len; i++ ) {
- type = Expr.order[i];
-
- if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
- left = match[1];
- match.splice( 1, 1 );
-
- if ( left.substr( left.length - 1 ) !== "\\" ) {
- match[1] = (match[1] || "").replace( rBackslash, "" );
- set = Expr.find[ type ]( match, context, isXML );
-
- if ( set != null ) {
- expr = expr.replace( Expr.match[ type ], "" );
- break;
- }
- }
- }
- }
-
- if ( !set ) {
- set = typeof context.getElementsByTagName !== "undefined" ?
- context.getElementsByTagName( "*" ) :
- [];
- }
-
- return { set: set, expr: expr };
-};
-
-Sizzle.filter = function( expr, set, inplace, not ) {
- var match, anyFound,
- type, found, item, filter, left,
- i, pass,
- old = expr,
- result = [],
- curLoop = set,
- isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
-
- while ( expr && set.length ) {
- for ( type in Expr.filter ) {
- if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
- filter = Expr.filter[ type ];
- left = match[1];
-
- anyFound = false;
-
- match.splice(1,1);
-
- if ( left.substr( left.length - 1 ) === "\\" ) {
- continue;
- }
-
- if ( curLoop === result ) {
- result = [];
- }
-
- if ( Expr.preFilter[ type ] ) {
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
- if ( !match ) {
- anyFound = found = true;
-
- } else if ( match === true ) {
- continue;
- }
- }
-
- if ( match ) {
- for ( i = 0; (item = curLoop[i]) != null; i++ ) {
- if ( item ) {
- found = filter( item, match, i, curLoop );
- pass = not ^ found;
-
- if ( inplace && found != null ) {
- if ( pass ) {
- anyFound = true;
-
- } else {
- curLoop[i] = false;
- }
-
- } else if ( pass ) {
- result.push( item );
- anyFound = true;
- }
- }
- }
- }
-
- if ( found !== undefined ) {
- if ( !inplace ) {
- curLoop = result;
- }
-
- expr = expr.replace( Expr.match[ type ], "" );
-
- if ( !anyFound ) {
- return [];
- }
-
- break;
- }
- }
- }
-
- // Improper expression
- if ( expr === old ) {
- if ( anyFound == null ) {
- Sizzle.error( expr );
-
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Utility function for retreiving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-var getText = Sizzle.getText = function( elem ) {
- var i, node,
- nodeType = elem.nodeType,
- ret = "";
-
- if ( nodeType ) {
- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent || innerText for elements
- if ( typeof elem.textContent === 'string' ) {
- return elem.textContent;
- } else if ( typeof elem.innerText === 'string' ) {
- // Replace IE's carriage returns
- return elem.innerText.replace( rReturn, '' );
- } else {
- // Traverse it's children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- } else {
-
- // If no nodeType, this is expected to be an array
- for ( i = 0; (node = elem[i]); i++ ) {
- // Do not traverse comment nodes
- if ( node.nodeType !== 8 ) {
- ret += getText( node );
- }
- }
- }
- return ret;
-};
-
-var Expr = Sizzle.selectors = {
- order: [ "ID", "NAME", "TAG" ],
-
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
- },
-
- leftMatch: {},
-
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
-
- attrHandle: {
- href: function( elem ) {
- return elem.getAttribute( "href" );
- },
- type: function( elem ) {
- return elem.getAttribute( "type" );
- }
- },
-
- relative: {
- "+": function(checkSet, part){
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !rNonWord.test( part ),
- isPartStrNotTag = isPartStr && !isTag;
-
- if ( isTag ) {
- part = part.toLowerCase();
- }
-
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
- if ( (elem = checkSet[i]) ) {
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
- elem || false :
- elem === part;
- }
- }
-
- if ( isPartStrNotTag ) {
- Sizzle.filter( part, checkSet, true );
- }
- },
-
- ">": function( checkSet, part ) {
- var elem,
- isPartStr = typeof part === "string",
- i = 0,
- l = checkSet.length;
-
- if ( isPartStr && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
-
- for ( ; i < l; i++ ) {
- elem = checkSet[i];
-
- if ( elem ) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
- }
- }
-
- } else {
- for ( ; i < l; i++ ) {
- elem = checkSet[i];
-
- if ( elem ) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
- }
- }
-
- if ( isPartStr ) {
- Sizzle.filter( part, checkSet, true );
- }
- }
- },
-
- "": function(checkSet, part, isXML){
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
-
- if ( typeof part === "string" && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
- }
-
- checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
- },
-
- "~": function( checkSet, part, isXML ) {
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
-
- if ( typeof part === "string" && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
- }
-
- checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
- }
- },
-
- find: {
- ID: function( match, context, isXML ) {
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [m] : [];
- }
- },
-
- NAME: function( match, context ) {
- if ( typeof context.getElementsByName !== "undefined" ) {
- var ret = [],
- results = context.getElementsByName( match[1] );
-
- for ( var i = 0, l = results.length; i < l; i++ ) {
- if ( results[i].getAttribute("name") === match[1] ) {
- ret.push( results[i] );
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
-
- TAG: function( match, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( match[1] );
- }
- }
- },
- preFilter: {
- CLASS: function( match, curLoop, inplace, result, not, isXML ) {
- match = " " + match[1].replace( rBackslash, "" ) + " ";
-
- if ( isXML ) {
- return match;
- }
-
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
- if ( elem ) {
- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
- if ( !inplace ) {
- result.push( elem );
- }
-
- } else if ( inplace ) {
- curLoop[i] = false;
- }
- }
- }
-
- return false;
- },
-
- ID: function( match ) {
- return match[1].replace( rBackslash, "" );
- },
-
- TAG: function( match, curLoop ) {
- return match[1].replace( rBackslash, "" ).toLowerCase();
- },
-
- CHILD: function( match ) {
- if ( match[1] === "nth" ) {
- if ( !match[2] ) {
- Sizzle.error( match[0] );
- }
-
- match[2] = match[2].replace(/^\+|\s*/g, '');
-
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
- else if ( match[2] ) {
- Sizzle.error( match[0] );
- }
-
- // TODO: Move to normal caching system
- match[0] = done++;
-
- return match;
- },
-
- ATTR: function( match, curLoop, inplace, result, not, isXML ) {
- var name = match[1] = match[1].replace( rBackslash, "" );
-
- if ( !isXML && Expr.attrMap[name] ) {
- match[1] = Expr.attrMap[name];
- }
-
- // Handle if an un-quoted value was used
- match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
-
- if ( match[2] === "~=" ) {
- match[4] = " " + match[4] + " ";
- }
-
- return match;
- },
-
- PSEUDO: function( match, curLoop, inplace, result, not ) {
- if ( match[1] === "not" ) {
- // If we're dealing with a complex expression, or a simple one
- if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
- match[3] = Sizzle(match[3], null, null, curLoop);
-
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
- if ( !inplace ) {
- result.push.apply( result, ret );
- }
-
- return false;
- }
-
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
- return true;
- }
-
- return match;
- },
-
- POS: function( match ) {
- match.unshift( true );
-
- return match;
- }
- },
-
- filters: {
- enabled: function( elem ) {
- return elem.disabled === false && elem.type !== "hidden";
- },
-
- disabled: function( elem ) {
- return elem.disabled === true;
- },
-
- checked: function( elem ) {
- return elem.checked === true;
- },
-
- selected: function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- parent: function( elem ) {
- return !!elem.firstChild;
- },
-
- empty: function( elem ) {
- return !elem.firstChild;
- },
-
- has: function( elem, i, match ) {
- return !!Sizzle( match[3], elem ).length;
- },
-
- header: function( elem ) {
- return (/h\d/i).test( elem.nodeName );
- },
-
- text: function( elem ) {
- var attr = elem.getAttribute( "type" ), type = elem.type;
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
- // use getAttribute instead to test this case
- return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
- },
-
- radio: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
- },
-
- checkbox: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
- },
-
- file: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
- },
-
- password: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
- },
-
- submit: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "submit" === elem.type;
- },
-
- image: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
- },
-
- reset: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "reset" === elem.type;
- },
-
- button: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && "button" === elem.type || name === "button";
- },
-
- input: function( elem ) {
- return (/input|select|textarea|button/i).test( elem.nodeName );
- },
-
- focus: function( elem ) {
- return elem === elem.ownerDocument.activeElement;
- }
- },
- setFilters: {
- first: function( elem, i ) {
- return i === 0;
- },
-
- last: function( elem, i, match, array ) {
- return i === array.length - 1;
- },
-
- even: function( elem, i ) {
- return i % 2 === 0;
- },
-
- odd: function( elem, i ) {
- return i % 2 === 1;
- },
-
- lt: function( elem, i, match ) {
- return i < match[3] - 0;
- },
-
- gt: function( elem, i, match ) {
- return i > match[3] - 0;
- },
-
- nth: function( elem, i, match ) {
- return match[3] - 0 === i;
- },
-
- eq: function( elem, i, match ) {
- return match[3] - 0 === i;
- }
- },
- filter: {
- PSEUDO: function( elem, match, i, array ) {
- var name = match[1],
- filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
-
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
-
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var j = 0, l = not.length; j < l; j++ ) {
- if ( not[j] === elem ) {
- return false;
- }
- }
-
- return true;
-
- } else {
- Sizzle.error( name );
- }
- },
-
- CHILD: function( elem, match ) {
- var first, last,
- doneName, parent, cache,
- count, diff,
- type = match[1],
- node = elem;
-
- switch ( type ) {
- case "only":
- case "first":
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- if ( type === "first" ) {
- return true;
- }
-
- node = elem;
-
- /* falls through */
- case "last":
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- return true;
-
- case "nth":
- first = match[2];
- last = match[3];
-
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- doneName = match[0];
- parent = elem.parentNode;
-
- if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
- count = 0;
-
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
-
- parent[ expando ] = doneName;
- }
-
- diff = elem.nodeIndex - last;
-
- if ( first === 0 ) {
- return diff === 0;
-
- } else {
- return ( diff % first === 0 && diff / first >= 0 );
- }
- }
- },
-
- ID: function( elem, match ) {
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
- },
-
- TAG: function( elem, match ) {
- return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
- },
-
- CLASS: function( elem, match ) {
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf( match ) > -1;
- },
-
- ATTR: function( elem, match ) {
- var name = match[1],
- result = Sizzle.attr ?
- Sizzle.attr( elem, name ) :
- Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ]( elem ) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute( name ),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- !type && Sizzle.attr ?
- result != null :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value !== check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
- },
-
- POS: function( elem, match, i, array ) {
- var name = match[2],
- filter = Expr.setFilters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- }
- }
- }
-};
-
-var origPOS = Expr.match.POS,
- fescape = function(all, num){
- return "\\" + (num - 0 + 1);
- };
-
-for ( var type in Expr.match ) {
- Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
- Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
-}
-// Expose origPOS
-// "global" as in regardless of relation to brackets/parens
-Expr.match.globalPOS = origPOS;
-
-var makeArray = function( array, results ) {
- array = Array.prototype.slice.call( array, 0 );
-
- if ( results ) {
- results.push.apply( results, array );
- return results;
- }
-
- return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-// Also verifies that the returned array holds DOM nodes
-// (which is not the case in the Blackberry browser)
-try {
- Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
-
-// Provide a fallback method if it does not work
-} catch( e ) {
- makeArray = function( array, results ) {
- var i = 0,
- ret = results || [];
-
- if ( toString.call(array) === "[object Array]" ) {
- Array.prototype.push.apply( ret, array );
-
- } else {
- if ( typeof array.length === "number" ) {
- for ( var l = array.length; i < l; i++ ) {
- ret.push( array[i] );
- }
-
- } else {
- for ( ; array[i]; i++ ) {
- ret.push( array[i] );
- }
- }
- }
-
- return ret;
- };
-}
-
-var sortOrder, siblingCheck;
-
-if ( document.documentElement.compareDocumentPosition ) {
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
- return a.compareDocumentPosition ? -1 : 1;
- }
-
- return a.compareDocumentPosition(b) & 4 ? -1 : 1;
- };
-
-} else {
- sortOrder = function( a, b ) {
- // The nodes are identical, we can exit early
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
-
- // Fallback to using sourceIndex (in IE) if it's available on both nodes
- } else if ( a.sourceIndex && b.sourceIndex ) {
- return a.sourceIndex - b.sourceIndex;
- }
-
- var al, bl,
- ap = [],
- bp = [],
- aup = a.parentNode,
- bup = b.parentNode,
- cur = aup;
-
- // If the nodes are siblings (or identical) we can do a quick check
- if ( aup === bup ) {
- return siblingCheck( a, b );
-
- // If no parents were found then the nodes are disconnected
- } else if ( !aup ) {
- return -1;
-
- } else if ( !bup ) {
- return 1;
- }
-
- // Otherwise they're somewhere else in the tree so we need
- // to build up a full list of the parentNodes for comparison
- while ( cur ) {
- ap.unshift( cur );
- cur = cur.parentNode;
- }
-
- cur = bup;
-
- while ( cur ) {
- bp.unshift( cur );
- cur = cur.parentNode;
- }
-
- al = ap.length;
- bl = bp.length;
-
- // Start walking down the tree looking for a discrepancy
- for ( var i = 0; i < al && i < bl; i++ ) {
- if ( ap[i] !== bp[i] ) {
- return siblingCheck( ap[i], bp[i] );
- }
- }
-
- // We ended someplace up the tree so do a sibling check
- return i === al ?
- siblingCheck( a, bp[i], -1 ) :
- siblingCheck( ap[i], b, 1 );
- };
-
- siblingCheck = function( a, b, ret ) {
- if ( a === b ) {
- return ret;
- }
-
- var cur = a.nextSibling;
-
- while ( cur ) {
- if ( cur === b ) {
- return -1;
- }
-
- cur = cur.nextSibling;
- }
-
- return 1;
- };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("div"),
- id = "script" + (new Date()).getTime(),
- root = document.documentElement;
-
- form.innerHTML = "<a name='" + id + "'/>";
-
- // Inject it into the root element, check its status, and remove it quickly
- root.insertBefore( form, root.firstChild );
-
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if ( document.getElementById( id ) ) {
- Expr.find.ID = function( match, context, isXML ) {
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
-
- return m ?
- m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
- [m] :
- undefined :
- [];
- }
- };
-
- Expr.filter.ID = function( elem, match ) {
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
-
- root.removeChild( form );
-
- // release memory in IE
- root = form = null;
-})();
-
-(function(){
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
-
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild( document.createComment("") );
-
- // Make sure no comments are found
- if ( div.getElementsByTagName("*").length > 0 ) {
- Expr.find.TAG = function( match, context ) {
- var results = context.getElementsByTagName( match[1] );
-
- // Filter out possible comments
- if ( match[1] === "*" ) {
- var tmp = [];
-
- for ( var i = 0; results[i]; i++ ) {
- if ( results[i].nodeType === 1 ) {
- tmp.push( results[i] );
- }
- }
-
- results = tmp;
- }
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "<a href='#'></a>";
-
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#" ) {
-
- Expr.attrHandle.href = function( elem ) {
- return elem.getAttribute( "href", 2 );
- };
- }
-
- // release memory in IE
- div = null;
-})();
-
-if ( document.querySelectorAll ) {
- (function(){
- var oldSizzle = Sizzle,
- div = document.createElement("div"),
- id = "__sizzle__";
-
- div.innerHTML = "<p class='TEST'></p>";
-
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- return;
- }
-
- Sizzle = function( query, context, extra, seed ) {
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if ( !seed && !Sizzle.isXML(context) ) {
- // See if we find a selector to speed up
- var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
-
- if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
- // Speed-up: Sizzle("TAG")
- if ( match[1] ) {
- return makeArray( context.getElementsByTagName( query ), extra );
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
- return makeArray( context.getElementsByClassName( match[2] ), extra );
- }
- }
-
- if ( context.nodeType === 9 ) {
- // Speed-up: Sizzle("body")
- // The body element only exists once, optimize finding it
- if ( query === "body" && context.body ) {
- return makeArray( [ context.body ], extra );
-
- // Speed-up: Sizzle("#ID")
- } else if ( match && match[3] ) {
- var elem = context.getElementById( match[3] );
-
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id === match[3] ) {
- return makeArray( [ elem ], extra );
- }
-
- } else {
- return makeArray( [], extra );
- }
- }
-
- try {
- return makeArray( context.querySelectorAll(query), extra );
- } catch(qsaError) {}
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- var oldContext = context,
- old = context.getAttribute( "id" ),
- nid = old || id,
- hasParent = context.parentNode,
- relativeHierarchySelector = /^\s*[+~]/.test( query );
-
- if ( !old ) {
- context.setAttribute( "id", nid );
- } else {
- nid = nid.replace( /'/g, "\\$&" );
- }
- if ( relativeHierarchySelector && hasParent ) {
- context = context.parentNode;
- }
-
- try {
- if ( !relativeHierarchySelector || hasParent ) {
- return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
- }
-
- } catch(pseudoError) {
- } finally {
- if ( !old ) {
- oldContext.removeAttribute( "id" );
- }
- }
- }
- }
-
- return oldSizzle(query, context, extra, seed);
- };
-
- for ( var prop in oldSizzle ) {
- Sizzle[ prop ] = oldSizzle[ prop ];
- }
-
- // release memory in IE
- div = null;
- })();
-}
-
-(function(){
- var html = document.documentElement,
- matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
-
- if ( matches ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9 fails this)
- var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
- pseudoWorks = false;
-
- try {
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( document.documentElement, "[test!='']:sizzle" );
-
- } catch( pseudoError ) {
- pseudoWorks = true;
- }
-
- Sizzle.matchesSelector = function( node, expr ) {
- // Make sure that attribute selectors are quoted
- expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
-
- if ( !Sizzle.isXML( node ) ) {
- try {
- if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
- var ret = matches.call( node, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || !disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9, so check for that
- node.document && node.document.nodeType !== 11 ) {
- return ret;
- }
- }
- } catch(e) {}
- }
-
- return Sizzle(expr, null, null, [node]).length > 0;
- };
- }
-})();
-
-(function(){
- var div = document.createElement("div");
-
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
- // Opera can't find a second classname (in 9.6)
- // Also, make sure that getElementsByClassName actually exists
- if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
- return;
- }
-
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if ( div.getElementsByClassName("e").length === 1 ) {
- return;
- }
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function( match, context, isXML ) {
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
- return context.getElementsByClassName(match[1]);
- }
- };
-
- // release memory in IE
- div = null;
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
-
- if ( elem ) {
- var match = false;
-
- elem = elem[dir];
-
- while ( elem ) {
- if ( elem[ expando ] === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 && !isXML ){
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
-
- if ( elem.nodeName.toLowerCase() === cur ) {
- match = elem;
- break;
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
-
- if ( elem ) {
- var match = false;
-
- elem = elem[dir];
-
- while ( elem ) {
- if ( elem[ expando ] === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 ) {
- if ( !isXML ) {
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
-
- if ( typeof cur !== "string" ) {
- if ( elem === cur ) {
- match = true;
- break;
- }
-
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
- match = elem;
- break;
- }
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-if ( document.documentElement.contains ) {
- Sizzle.contains = function( a, b ) {
- return a !== b && (a.contains ? a.contains(b) : true);
- };
-
-} else if ( document.documentElement.compareDocumentPosition ) {
- Sizzle.contains = function( a, b ) {
- return !!(a.compareDocumentPosition(b) & 16);
- };
-
-} else {
- Sizzle.contains = function() {
- return false;
- };
-}
-
-Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
-
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-var posProcess = function( selector, context, seed ) {
- var match,
- tmpSet = [],
- later = "",
- root = context.nodeType ? [context] : context;
-
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
- later += match[0];
- selector = selector.replace( Expr.match.PSEUDO, "" );
- }
-
- selector = Expr.relative[selector] ? selector + "*" : selector;
-
- for ( var i = 0, l = root.length; i < l; i++ ) {
- Sizzle( selector, root[i], tmpSet, seed );
- }
-
- return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-// Override sizzle attribute retrieval
-Sizzle.attr = jQuery.attr;
-Sizzle.selectors.attrMap = {};
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})();
-
-
-var runtil = /Until$/,
- rparentsprev = /^(?:parents|prevUntil|prevAll)/,
- // Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/,
- isSimple = /^.[^:#\[\.,]*$/,
- slice = Array.prototype.slice,
- POS = jQuery.expr.match.globalPOS,
- // methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
-jQuery.fn.extend({
- find: function( selector ) {
- var self = this,
- i, l;
-
- if ( typeof selector !== "string" ) {
- return jQuery( selector ).filter(function() {
- for ( i = 0, l = self.length; i < l; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- });
- }
-
- var ret = this.pushStack( "", "find", selector ),
- length, n, r;
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- length = ret.length;
- jQuery.find( selector, this[i], ret );
-
- if ( i > 0 ) {
- // Make sure that the results are unique
- for ( n = length; n < ret.length; n++ ) {
- for ( r = 0; r < length; r++ ) {
- if ( ret[r] === ret[n] ) {
- ret.splice(n--, 1);
- break;
- }
- }
- }
- }
- }
-
- return ret;
- },
-
- has: function( target ) {
- var targets = jQuery( target );
- return this.filter(function() {
- for ( var i = 0, l = targets.length; i < l; i++ ) {
- if ( jQuery.contains( this, targets[i] ) ) {
- return true;
- }
- }
- });
- },
-
- not: function( selector ) {
- return this.pushStack( winnow(this, selector, false), "not", selector);
- },
-
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector, true), "filter", selector );
- },
-
- is: function( selector ) {
- return !!selector && (
- typeof selector === "string" ?
- // If this is a positional selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- POS.test( selector ) ?
- jQuery( selector, this.context ).index( this[0] ) >= 0 :
- jQuery.filter( selector, this ).length > 0 :
- this.filter( selector ).length > 0 );
- },
-
- closest: function( selectors, context ) {
- var ret = [], i, l, cur = this[0];
-
- // Array (deprecated as of jQuery 1.7)
- if ( jQuery.isArray( selectors ) ) {
- var level = 1;
-
- while ( cur && cur.ownerDocument && cur !== context ) {
- for ( i = 0; i < selectors.length; i++ ) {
-
- if ( jQuery( cur ).is( selectors[ i ] ) ) {
- ret.push({ selector: selectors[ i ], elem: cur, level: level });
- }
- }
-
- cur = cur.parentNode;
- level++;
- }
-
- return ret;
- }
-
- // String
- var pos = POS.test( selectors ) || typeof selectors !== "string" ?
- jQuery( selectors, context || this.context ) :
- 0;
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- cur = this[i];
-
- while ( cur ) {
- if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
- ret.push( cur );
- break;
-
- } else {
- cur = cur.parentNode;
- if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
- break;
- }
- }
- }
- }
-
- ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
-
- return this.pushStack( ret, "closest", selectors );
- },
-
- // Determine the position of an element within
- // the matched set of elements
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
- }
-
- // index in selector
- if ( typeof elem === "string" ) {
- return jQuery.inArray( this[0], jQuery( elem ) );
- }
-
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem, this );
- },
-
- add: function( selector, context ) {
- var set = typeof selector === "string" ?
- jQuery( selector, context ) :
- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
- all = jQuery.merge( this.get(), set );
-
- return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
- all :
- jQuery.unique( all ) );
- },
-
- andSelf: function() {
- return this.add( this.prevObject );
- }
-});
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
- return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-jQuery.each({
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return jQuery.nth( elem, 2, "nextSibling" );
- },
- prev: function( elem ) {
- return jQuery.nth( elem, 2, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( elem.firstChild );
- },
- contents: function( elem ) {
- return jQuery.nodeName( elem, "iframe" ) ?
- elem.contentDocument || elem.contentWindow.document :
- jQuery.makeArray( elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var ret = jQuery.map( this, fn, until );
-
- if ( !runtil.test( name ) ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- ret = jQuery.filter( selector, ret );
- }
-
- ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
-
- if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
- ret = ret.reverse();
- }
-
- return this.pushStack( ret, name, slice.call( arguments ).join(",") );
- };
-});
-
-jQuery.extend({
- filter: function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 ?
- jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
- jQuery.find.matches(expr, elems);
- },
-
- dir: function( elem, dir, until ) {
- var matched = [],
- cur = elem[ dir ];
-
- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
- if ( cur.nodeType === 1 ) {
- matched.push( cur );
- }
- cur = cur[dir];
- }
- return matched;
- },
-
- nth: function( cur, result, dir, elem ) {
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] ) {
- if ( cur.nodeType === 1 && ++num === result ) {
- break;
- }
- }
-
- return cur;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- r.push( n );
- }
- }
-
- return r;
- }
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, keep ) {
-
- // Can't pass null or undefined to indexOf in Firefox 4
- // Set to 0 to skip string check
- qualifier = qualifier || 0;
-
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep(elements, function( elem, i ) {
- var retVal = !!qualifier.call( elem, i, elem );
- return retVal === keep;
- });
-
- } else if ( qualifier.nodeType ) {
- return jQuery.grep(elements, function( elem, i ) {
- return ( elem === qualifier ) === keep;
- });
-
- } else if ( typeof qualifier === "string" ) {
- var filtered = jQuery.grep(elements, function( elem ) {
- return elem.nodeType === 1;
- });
-
- if ( isSimple.test( qualifier ) ) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter( qualifier, filtered );
- }
- }
-
- return jQuery.grep(elements, function( elem, i ) {
- return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
- });
-}
-
-
-
-
-function createSafeFragment( document ) {
- var list = nodeNames.split( "|" ),
- safeFrag = document.createDocumentFragment();
-
- if ( safeFrag.createElement ) {
- while ( list.length ) {
- safeFrag.createElement(
- list.pop()
- );
- }
- }
- return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
- rtagName = /<([\w:]+)/,
- rtbody = /<tbody/i,
- rhtml = /<|&#?\w+;/,
- rnoInnerhtml = /<(?:script|style)/i,
- rnocache = /<(?:script|object|embed|option|style)/i,
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rscriptType = /\/(java|ecma)script/i,
- rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
- wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- area: [ 1, "<map>", "</map>" ],
- _default: [ 0, "", "" ]
- },
- safeFragment = createSafeFragment( document );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
- text: function( value ) {
- return jQuery.access( this, function( value ) {
- return value === undefined ?
- jQuery.text( this ) :
- this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
- }, null, value, arguments.length );
- },
-
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapInner( html.call(this, i) );
- });
- }
-
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
-
- return this.each(function(i) {
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- },
-
- append: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.insertBefore( elem, this.firstChild );
- }
- });
- },
-
- before: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this );
- });
- } else if ( arguments.length ) {
- var set = jQuery.clean( arguments );
- set.push.apply( set, this.toArray() );
- return this.pushStack( set, "before", arguments );
- }
- },
-
- after: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- } else if ( arguments.length ) {
- var set = this.pushStack( this, "after", arguments );
- set.push.apply( set, jQuery.clean(arguments) );
- return set;
- }
- },
-
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
- if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
- if ( !keepData && elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- jQuery.cleanData( [ elem ] );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- }
- }
-
- return this;
- },
-
- empty: function() {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( elem.firstChild ) {
- elem.removeChild( elem.firstChild );
- }
- }
-
- return this;
- },
-
- clone: function( dataAndEvents, deepDataAndEvents ) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
- return this.map( function () {
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
- });
- },
-
- html: function( value ) {
- return jQuery.access( this, function( value ) {
- var elem = this[0] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined ) {
- return elem.nodeType === 1 ?
- elem.innerHTML.replace( rinlinejQuery, "" ) :
- null;
- }
-
-
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
- value = value.replace( rxhtmlTag, "<$1></$2>" );
-
- try {
- for (; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- elem = this[i] || {};
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName( "*" ) );
- elem.innerHTML = value;
- }
- }
-
- elem = 0;
-
- // If using innerHTML throws an exception, use the fallback method
- } catch(e) {}
- }
-
- if ( elem ) {
- this.empty().append( value );
- }
- }, null, value, arguments.length );
- },
-
- replaceWith: function( value ) {
- if ( this[0] && this[0].parentNode ) {
- // Make sure that the elements are removed from the DOM before they are inserted
- // this can help fix replacing a parent with child elements
- if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this), old = self.html();
- self.replaceWith( value.call( this, i, old ) );
- });
- }
-
- if ( typeof value !== "string" ) {
- value = jQuery( value ).detach();
- }
-
- return this.each(function() {
- var next = this.nextSibling,
- parent = this.parentNode;
-
- jQuery( this ).remove();
-
- if ( next ) {
- jQuery(next).before( value );
- } else {
- jQuery(parent).append( value );
- }
- });
- } else {
- return this.length ?
- this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
- this;
- }
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, table, callback ) {
- var results, first, fragment, parent,
- value = args[0],
- scripts = [];
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
- return this.each(function() {
- jQuery(this).domManip( args, table, callback, true );
- });
- }
-
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- args[0] = value.call(this, i, table ? self.html() : undefined);
- self.domManip( args, table, callback );
- });
- }
-
- if ( this[0] ) {
- parent = value && value.parentNode;
-
- // If we're in a fragment, just use that instead of building a new one
- if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
- results = { fragment: parent };
-
- } else {
- results = jQuery.buildFragment( args, this, scripts );
- }
-
- fragment = results.fragment;
-
- if ( fragment.childNodes.length === 1 ) {
- first = fragment = fragment.firstChild;
- } else {
- first = fragment.firstChild;
- }
-
- if ( first ) {
- table = table && jQuery.nodeName( first, "tr" );
-
- for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
- callback.call(
- table ?
- root(this[i], first) :
- this[i],
- // Make sure that we do not leak memory by inadvertently discarding
- // the original fragment (which might have attached data) instead of
- // using it; in addition, use the original fragment object for the last
- // item instead of first because it can end up being emptied incorrectly
- // in certain situations (Bug #8070).
- // Fragments from the fragment cache must always be cloned and never used
- // in place.
- results.cacheable || ( l > 1 && i < lastIndex ) ?
- jQuery.clone( fragment, true, true ) :
- fragment
- );
- }
- }
-
- if ( scripts.length ) {
- jQuery.each( scripts, function( i, elem ) {
- if ( elem.src ) {
- jQuery.ajax({
- type: "GET",
- global: false,
- url: elem.src,
- async: false,
- dataType: "script"
- });
- } else {
- jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- });
- }
- }
-
- return this;
- }
-});
-
-function root( elem, cur ) {
- return jQuery.nodeName(elem, "table") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- elem;
-}
-
-function cloneCopyEvent( src, dest ) {
-
- if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
- return;
- }
-
- var type, i, l,
- oldData = jQuery._data( src ),
- curData = jQuery._data( dest, oldData ),
- events = oldData.events;
-
- if ( events ) {
- delete curData.handle;
- curData.events = {};
-
- for ( type in events ) {
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type, events[ type ][ i ] );
- }
- }
- }
-
- // make the cloned public data object a copy from the original
- if ( curData.data ) {
- curData.data = jQuery.extend( {}, curData.data );
- }
-}
-
-function cloneFixAttributes( src, dest ) {
- var nodeName;
-
- // We do not need to do anything for non-Elements
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // clearAttributes removes the attributes, which we don't want,
- // but also removes the attachEvent events, which we *do* want
- if ( dest.clearAttributes ) {
- dest.clearAttributes();
- }
-
- // mergeAttributes, in contrast, only merges back on the
- // original attributes, not the events
- if ( dest.mergeAttributes ) {
- dest.mergeAttributes( src );
- }
-
- nodeName = dest.nodeName.toLowerCase();
-
- // IE6-8 fail to clone children inside object elements that use
- // the proprietary classid attribute value (rather than the type
- // attribute) to identify the type of content to display
- if ( nodeName === "object" ) {
- dest.outerHTML = src.outerHTML;
-
- } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
- // IE6-8 fails to persist the checked state of a cloned checkbox
- // or radio button. Worse, IE6-7 fail to give the cloned element
- // a checked appearance if the defaultChecked value isn't also set
- if ( src.checked ) {
- dest.defaultChecked = dest.checked = src.checked;
- }
-
- // IE6-7 get confused and end up setting the value of a cloned
- // checkbox/radio button to an empty string instead of "on"
- if ( dest.value !== src.value ) {
- dest.value = src.value;
- }
-
- // IE6-8 fails to return the selected option to the default selected
- // state when cloning options
- } else if ( nodeName === "option" ) {
- dest.selected = src.defaultSelected;
-
- // IE6-8 fails to set the defaultValue to the correct value when
- // cloning other types of input fields
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
- dest.defaultValue = src.defaultValue;
-
- // IE blanks contents when cloning scripts
- } else if ( nodeName === "script" && dest.text !== src.text ) {
- dest.text = src.text;
- }
-
- // Event data gets referenced instead of copied if the expando
- // gets copied too
- dest.removeAttribute( jQuery.expando );
-
- // Clear flags for bubbling special change/submit events, they must
- // be reattached when the newly cloned events are first activated
- dest.removeAttribute( "_submit_attached" );
- dest.removeAttribute( "_change_attached" );
-}
-
-jQuery.buildFragment = function( args, nodes, scripts ) {
- var fragment, cacheable, cacheresults, doc,
- first = args[ 0 ];
-
- // nodes may contain either an explicit document object,
- // a jQuery collection or context object.
- // If nodes[0] contains a valid object to assign to doc
- if ( nodes && nodes[0] ) {
- doc = nodes[0].ownerDocument || nodes[0];
- }
-
- // Ensure that an attr object doesn't incorrectly stand in as a document object
- // Chrome and Firefox seem to allow this to occur and will throw exception
- // Fixes #8950
- if ( !doc.createDocumentFragment ) {
- doc = document;
- }
-
- // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
- // Cloning options loses the selected state, so don't cache them
- // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
- // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
- // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
- if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
- first.charAt(0) === "<" && !rnocache.test( first ) &&
- (jQuery.support.checkClone || !rchecked.test( first )) &&
- (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
-
- cacheable = true;
-
- cacheresults = jQuery.fragments[ first ];
- if ( cacheresults && cacheresults !== 1 ) {
- fragment = cacheresults;
- }
- }
-
- if ( !fragment ) {
- fragment = doc.createDocumentFragment();
- jQuery.clean( args, doc, fragment, scripts );
- }
-
- if ( cacheable ) {
- jQuery.fragments[ first ] = cacheresults ? fragment : 1;
- }
-
- return { fragment: fragment, cacheable: cacheable };
-};
-
-jQuery.fragments = {};
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var ret = [],
- insert = jQuery( selector ),
- parent = this.length === 1 && this[0].parentNode;
-
- if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
- insert[ original ]( this[0] );
- return this;
-
- } else {
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = ( i > 0 ? this.clone(true) : this ).get();
- jQuery( insert[i] )[ original ]( elems );
- ret = ret.concat( elems );
- }
-
- return this.pushStack( ret, name, insert.selector );
- }
- };
-});
-
-function getAll( elem ) {
- if ( typeof elem.getElementsByTagName !== "undefined" ) {
- return elem.getElementsByTagName( "*" );
-
- } else if ( typeof elem.querySelectorAll !== "undefined" ) {
- return elem.querySelectorAll( "*" );
-
- } else {
- return [];
- }
-}
-
-// Used in clean, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
- if ( elem.type === "checkbox" || elem.type === "radio" ) {
- elem.defaultChecked = elem.checked;
- }
-}
-// Finds all inputs and passes them to fixDefaultChecked
-function findInputs( elem ) {
- var nodeName = ( elem.nodeName || "" ).toLowerCase();
- if ( nodeName === "input" ) {
- fixDefaultChecked( elem );
- // Skip scripts, get other children
- } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
- jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
- }
-}
-
-// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
-function shimCloneNode( elem ) {
- var div = document.createElement( "div" );
- safeFragment.appendChild( div );
-
- div.innerHTML = elem.outerHTML;
- return div.firstChild;
-}
-
-jQuery.extend({
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var srcElements,
- destElements,
- i,
- // IE<=8 does not properly clone detached, unknown element nodes
- clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
- elem.cloneNode( true ) :
- shimCloneNode( elem );
-
- if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
- (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
- // IE copies events bound via attachEvent when using cloneNode.
- // Calling detachEvent on the clone will also remove the events
- // from the original. In order to get around this, we use some
- // proprietary methods to clear the events. Thanks to MooTools
- // guys for this hotness.
-
- cloneFixAttributes( elem, clone );
-
- // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
- srcElements = getAll( elem );
- destElements = getAll( clone );
-
- // Weird iteration because IE will replace the length property
- // with an element if you are cloning the body and one of the
- // elements on the page has a name or id of "length"
- for ( i = 0; srcElements[i]; ++i ) {
- // Ensure that the destination node is not null; Fixes #9587
- if ( destElements[i] ) {
- cloneFixAttributes( srcElements[i], destElements[i] );
- }
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- cloneCopyEvent( elem, clone );
-
- if ( deepDataAndEvents ) {
- srcElements = getAll( elem );
- destElements = getAll( clone );
-
- for ( i = 0; srcElements[i]; ++i ) {
- cloneCopyEvent( srcElements[i], destElements[i] );
- }
- }
- }
-
- srcElements = destElements = null;
-
- // Return the cloned set
- return clone;
- },
-
- clean: function( elems, context, fragment, scripts ) {
- var checkScriptType, script, j,
- ret = [];
-
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" ) {
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
- }
-
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- if ( typeof elem === "number" ) {
- elem += "";
- }
-
- if ( !elem ) {
- continue;
- }
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" ) {
- if ( !rhtml.test( elem ) ) {
- elem = context.createTextNode( elem );
- } else {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(rxhtmlTag, "<$1></$2>");
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
- wrap = wrapMap[ tag ] || wrapMap._default,
- depth = wrap[0],
- div = context.createElement("div"),
- safeChildNodes = safeFragment.childNodes,
- remove;
-
- // Append wrapper element to unknown element safe doc fragment
- if ( context === document ) {
- // Use the fragment we've already created for this document
- safeFragment.appendChild( div );
- } else {
- // Use a fragment created with the owner document
- createSafeFragment( context ).appendChild( div );
- }
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( depth-- ) {
- div = div.lastChild;
- }
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- var hasBody = rtbody.test(elem),
- tbody = tag === "table" && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] === "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( j = tbody.length - 1; j >= 0 ; --j ) {
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- }
- }
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
- div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
- }
-
- elem = div.childNodes;
-
- // Clear elements from DocumentFragment (safeFragment or otherwise)
- // to avoid hoarding elements. Fixes #11356
- if ( div ) {
- div.parentNode.removeChild( div );
-
- // Guard against -1 index exceptions in FF3.6
- if ( safeChildNodes.length > 0 ) {
- remove = safeChildNodes[ safeChildNodes.length - 1 ];
-
- if ( remove && remove.parentNode ) {
- remove.parentNode.removeChild( remove );
- }
- }
- }
- }
- }
-
- // Resets defaultChecked for any radios and checkboxes
- // about to be appended to the DOM in IE 6/7 (#8060)
- var len;
- if ( !jQuery.support.appendChecked ) {
- if ( elem[0] && typeof (len = elem.length) === "number" ) {
- for ( j = 0; j < len; j++ ) {
- findInputs( elem[j] );
- }
- } else {
- findInputs( elem );
- }
- }
-
- if ( elem.nodeType ) {
- ret.push( elem );
- } else {
- ret = jQuery.merge( ret, elem );
- }
- }
-
- if ( fragment ) {
- checkScriptType = function( elem ) {
- return !elem.type || rscriptType.test( elem.type );
- };
- for ( i = 0; ret[i]; i++ ) {
- script = ret[i];
- if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
- scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
-
- } else {
- if ( script.nodeType === 1 ) {
- var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
-
- ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
- }
- fragment.appendChild( script );
- }
- }
- }
-
- return ret;
- },
-
- cleanData: function( elems ) {
- var data, id,
- cache = jQuery.cache,
- special = jQuery.event.special,
- deleteExpando = jQuery.support.deleteExpando;
-
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- continue;
- }
-
- id = elem[ jQuery.expando ];
-
- if ( id ) {
- data = cache[ id ];
-
- if ( data && data.events ) {
- for ( var type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
-
- // This is a shortcut to avoid jQuery.event.remove's overhead
- } else {
- jQuery.removeEvent( elem, type, data.handle );
- }
- }
-
- // Null the DOM reference to avoid IE6/7/8 leak (#7054)
- if ( data.handle ) {
- data.handle.elem = null;
- }
- }
-
- if ( deleteExpando ) {
- delete elem[ jQuery.expando ];
-
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( jQuery.expando );
- }
-
- delete cache[ id ];
- }
- }
- }
-});
-
-
-
-
-var ralpha = /alpha\([^)]*\)/i,
- ropacity = /opacity=([^)]*)/,
- // fixed for IE9, see #8346
- rupper = /([A-Z]|^ms)/g,
- rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
- rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
- rrelNum = /^([\-+])=([\-+.\de]+)/,
- rmargin = /^margin/,
-
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-
- // order is important!
- cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-
- curCSS,
-
- getComputedStyle,
- currentStyle;
-
-jQuery.fn.css = function( name, value ) {
- return jQuery.access( this, function( elem, name, value ) {
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
-};
-
-jQuery.extend({
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
-
- } else {
- return elem.style.opacity;
- }
- }
- }
- },
-
- // Exclude the following css properties to add px
- cssNumber: {
- "fillOpacity": true,
- "fontWeight": true,
- "lineHeight": true,
- "opacity": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {
- // normalize float css property
- "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
- },
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, origName = jQuery.camelCase( name ),
- style = elem.style, hooks = jQuery.cssHooks[ origName ];
-
- name = jQuery.cssProps[ origName ] || origName;
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // convert relative number strings (+= or -=) to relative numbers. #7345
- if ( type === "string" && (ret = rrelNum.exec( value )) ) {
- value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that NaN and null values aren't set. See: #7116
- if ( value == null || type === "number" && isNaN( value ) ) {
- return;
- }
-
- // If a number was passed in, add 'px' to the (except for certain CSS properties)
- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
- value += "px";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
- // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
- // Fixes bug #5509
- try {
- style[ name ] = value;
- } catch(e) {}
- }
-
- } else {
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra ) {
- var ret, hooks;
-
- // Make sure that we're working with the right name
- name = jQuery.camelCase( name );
- hooks = jQuery.cssHooks[ name ];
- name = jQuery.cssProps[ name ] || name;
-
- // cssFloat needs a special treatment
- if ( name === "cssFloat" ) {
- name = "float";
- }
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
- return ret;
-
- // Otherwise, if a way to get the computed value exists, use that
- } else if ( curCSS ) {
- return curCSS( elem, name );
- }
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {},
- ret, name;
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.call( elem );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
- }
-});
-
-// DEPRECATED in 1.3, Use jQuery.css() instead
-jQuery.curCSS = jQuery.css;
-
-if ( document.defaultView && document.defaultView.getComputedStyle ) {
- getComputedStyle = function( elem, name ) {
- var ret, defaultView, computedStyle, width,
- style = elem.style;
-
- name = name.replace( rupper, "-$1" ).toLowerCase();
-
- if ( (defaultView = elem.ownerDocument.defaultView) &&
- (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
-
- ret = computedStyle.getPropertyValue( name );
- if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
- ret = jQuery.style( elem, name );
- }
- }
-
- // A tribute to the "awesome hack by Dean Edwards"
- // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
- // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
- if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
- width = style.width;
- style.width = ret;
- ret = computedStyle.width;
- style.width = width;
- }
-
- return ret;
- };
-}
-
-if ( document.documentElement.currentStyle ) {
- currentStyle = function( elem, name ) {
- var left, rsLeft, uncomputed,
- ret = elem.currentStyle && elem.currentStyle[ name ],
- style = elem.style;
-
- // Avoid setting ret to empty string here
- // so we don't default to auto
- if ( ret == null && style && (uncomputed = style[ name ]) ) {
- ret = uncomputed;
- }
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( rnumnonpx.test( ret ) ) {
-
- // Remember the original values
- left = style.left;
- rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- if ( rsLeft ) {
- elem.runtimeStyle.left = elem.currentStyle.left;
- }
- style.left = name === "fontSize" ? "1em" : ret;
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- if ( rsLeft ) {
- elem.runtimeStyle.left = rsLeft;
- }
- }
-
- return ret === "" ? "auto" : ret;
- };
-}
-
-curCSS = getComputedStyle || currentStyle;
-
-function getWidthOrHeight( elem, name, extra ) {
-
- // Start with offset property
- var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
- i = name === "width" ? 1 : 0,
- len = 4;
-
- if ( val > 0 ) {
- if ( extra !== "border" ) {
- for ( ; i < len; i += 2 ) {
- if ( !extra ) {
- val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
- }
- if ( extra === "margin" ) {
- val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
- } else {
- val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
- }
- }
- }
-
- return val + "px";
- }
-
- // Fall back to computed then uncomputed css if necessary
- val = curCSS( elem, name );
- if ( val < 0 || val == null ) {
- val = elem.style[ name ];
- }
-
- // Computed unit is not pixels. Stop here and return.
- if ( rnumnonpx.test(val) ) {
- return val;
- }
-
- // Normalize "", auto, and prepare for extra
- val = parseFloat( val ) || 0;
-
- // Add padding, border, margin
- if ( extra ) {
- for ( ; i < len; i += 2 ) {
- val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
- if ( extra !== "padding" ) {
- val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
- }
- if ( extra === "margin" ) {
- val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
- }
- }
- }
-
- return val + "px";
-}
-
-jQuery.each([ "height", "width" ], function( i, name ) {
- jQuery.cssHooks[ name ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
- if ( elem.offsetWidth !== 0 ) {
- return getWidthOrHeight( elem, name, extra );
- } else {
- return jQuery.swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, name, extra );
- });
- }
- }
- },
-
- set: function( elem, value ) {
- return rnum.test( value ) ?
- value + "px" :
- value;
- }
- };
-});
-
-if ( !jQuery.support.opacity ) {
- jQuery.cssHooks.opacity = {
- get: function( elem, computed ) {
- // IE uses filters for opacity
- return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
- ( parseFloat( RegExp.$1 ) / 100 ) + "" :
- computed ? "1" : "";
- },
-
- set: function( elem, value ) {
- var style = elem.style,
- currentStyle = elem.currentStyle,
- opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
- filter = currentStyle && currentStyle.filter || style.filter || "";
-
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- style.zoom = 1;
-
- // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
- if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
-
- // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
- // if "filter:" is present at all, clearType is disabled, we want to avoid this
- // style.removeAttribute is IE Only, but so apparently is this code path...
- style.removeAttribute( "filter" );
-
- // if there there is no filter style applied in a css rule, we are done
- if ( currentStyle && !currentStyle.filter ) {
- return;
- }
- }
-
- // otherwise, set new filter values
- style.filter = ralpha.test( filter ) ?
- filter.replace( ralpha, opacity ) :
- filter + " " + opacity;
- }
- };
-}
-
-jQuery(function() {
- // This hook cannot be added until DOM ready because the support test
- // for it is not run until after DOM ready
- if ( !jQuery.support.reliableMarginRight ) {
- jQuery.cssHooks.marginRight = {
- get: function( elem, computed ) {
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- // Work around by temporarily setting element display to inline-block
- return jQuery.swap( elem, { "display": "inline-block" }, function() {
- if ( computed ) {
- return curCSS( elem, "margin-right" );
- } else {
- return elem.style.marginRight;
- }
- });
- }
- };
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.hidden = function( elem ) {
- var width = elem.offsetWidth,
- height = elem.offsetHeight;
-
- return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
- };
-
- jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
- };
-}
-
-// These hooks are used by animate to expand properties
-jQuery.each({
- margin: "",
- padding: "",
- border: "Width"
-}, function( prefix, suffix ) {
-
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i,
-
- // assumes a single number if not a string
- parts = typeof value === "string" ? value.split(" ") : [ value ],
- expanded = {};
-
- for ( i = 0; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-});
-
-
-
-
-var r20 = /%20/g,
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rhash = /#.*$/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
- rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
- rquery = /\?/,
- rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
- rselectTextarea = /^(?:select|textarea)/i,
- rspacesAjax = /\s+/,
- rts = /([?&])_=[^&]*/,
- rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
-
- // Keep a copy of the old load method
- _load = jQuery.fn.load,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Document location
- ajaxLocation,
-
- // Document location segments
- ajaxLocParts,
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = ["*/"] + ["*"];
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
- ajaxLocation = location.href;
-} catch( e ) {
- // Use the href attribute of an A element
- // since IE will modify it given document.location
- ajaxLocation = document.createElement( "a" );
- ajaxLocation.href = "";
- ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- if ( jQuery.isFunction( func ) ) {
- var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
- i = 0,
- length = dataTypes.length,
- dataType,
- list,
- placeBefore;
-
- // For each dataType in the dataTypeExpression
- for ( ; i < length; i++ ) {
- dataType = dataTypes[ i ];
- // We control if we're asked to add before
- // any existing element
- placeBefore = /^\+/.test( dataType );
- if ( placeBefore ) {
- dataType = dataType.substr( 1 ) || "*";
- }
- list = structure[ dataType ] = structure[ dataType ] || [];
- // then we add to the structure accordingly
- list[ placeBefore ? "unshift" : "push" ]( func );
- }
- }
- };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
- dataType /* internal */, inspected /* internal */ ) {
-
- dataType = dataType || options.dataTypes[ 0 ];
- inspected = inspected || {};
-
- inspected[ dataType ] = true;
-
- var list = structure[ dataType ],
- i = 0,
- length = list ? list.length : 0,
- executeOnly = ( structure === prefilters ),
- selection;
-
- for ( ; i < length && ( executeOnly || !selection ); i++ ) {
- selection = list[ i ]( options, originalOptions, jqXHR );
- // If we got redirected to another dataType
- // we try there if executing only and not done already
- if ( typeof selection === "string" ) {
- if ( !executeOnly || inspected[ selection ] ) {
- selection = undefined;
- } else {
- options.dataTypes.unshift( selection );
- selection = inspectPrefiltersOrTransports(
- structure, options, originalOptions, jqXHR, selection, inspected );
- }
- }
- }
- // If we're only executing or nothing was selected
- // we try the catchall dataType if not done already
- if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
- selection = inspectPrefiltersOrTransports(
- structure, options, originalOptions, jqXHR, "*", inspected );
- }
- // unnecessary when only executing (prefilters)
- // but it'll be ignored by the caller in that case
- return selection;
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-}
-
-jQuery.fn.extend({
- load: function( url, params, callback ) {
- if ( typeof url !== "string" && _load ) {
- return _load.apply( this, arguments );
-
- // Don't do a request if no elements are being requested
- } else if ( !this.length ) {
- return this;
- }
-
- var off = url.indexOf( " " );
- if ( off >= 0 ) {
- var selector = url.slice( off, url.length );
- url = url.slice( 0, off );
- }
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params ) {
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = undefined;
-
- // Otherwise, build a param string
- } else if ( typeof params === "object" ) {
- params = jQuery.param( params, jQuery.ajaxSettings.traditional );
- type = "POST";
- }
- }
-
- var self = this;
-
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- // Complete callback (responseText is used internally)
- complete: function( jqXHR, status, responseText ) {
- // Store the response as specified by the jqXHR object
- responseText = jqXHR.responseText;
- // If successful, inject the HTML into all the matched elements
- if ( jqXHR.isResolved() ) {
- // #4825: Get the actual response in case
- // a dataFilter is present in ajaxSettings
- jqXHR.done(function( r ) {
- responseText = r;
- });
- // See if a selector was specified
- self.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div>")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(responseText.replace(rscript, ""))
-
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- responseText );
- }
-
- if ( callback ) {
- self.each( callback, [ responseText, status, jqXHR ] );
- }
- }
- });
-
- return this;
- },
-
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
-
- serializeArray: function() {
- return this.map(function(){
- return this.elements ? jQuery.makeArray( this.elements ) : this;
- })
- .filter(function(){
- return this.name && !this.disabled &&
- ( this.checked || rselectTextarea.test( this.nodeName ) ||
- rinput.test( this.type ) );
- })
- .map(function( i, elem ){
- var val = jQuery( this ).val();
-
- return val == null ?
- null :
- jQuery.isArray( val ) ?
- jQuery.map( val, function( val, i ){
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }) :
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }).get();
- }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
- jQuery.fn[ o ] = function( f ){
- return this.on( o, f );
- };
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
- // shift arguments if data argument was omitted
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- return jQuery.ajax({
- type: method,
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- };
-});
-
-jQuery.extend({
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- if ( settings ) {
- // Building a settings object
- ajaxExtend( target, jQuery.ajaxSettings );
- } else {
- // Extending ajaxSettings
- settings = target;
- target = jQuery.ajaxSettings;
- }
- ajaxExtend( target, settings );
- return target;
- },
-
- ajaxSettings: {
- url: ajaxLocation,
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- text: "text/plain",
- json: "application/json, text/javascript",
- "*": allTypes
- },
-
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText"
- },
-
- // List of data converters
- // 1) key format is "source_type destination_type" (a single space in-between)
- // 2) the catchall symbol "*" can be used for source_type
- converters: {
-
- // Convert anything to text
- "* text": window.String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": jQuery.parseJSON,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- context: true,
- url: true
- }
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
- // Callbacks context
- callbackContext = s.context || s,
- // Context for global events
- // It's the callbackContext if one was provided in the options
- // and if it's a DOM node or a jQuery collection
- globalEventContext = callbackContext !== s &&
- ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
- jQuery( callbackContext ) : jQuery.event,
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks( "once memory" ),
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
- // ifModified key
- ifModifiedKey,
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
- // Response headers
- responseHeadersString,
- responseHeaders,
- // transport
- transport,
- // timeout handle
- timeoutTimer,
- // Cross-domain detection vars
- parts,
- // The jqXHR state
- state = 0,
- // To know if global events are to be dispatched
- fireGlobals,
- // Loop variable
- i,
- // Fake xhr
- jqXHR = {
-
- readyState: 0,
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- if ( !state ) {
- var lname = name.toLowerCase();
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return state === 2 ? responseHeadersString : null;
- },
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( state === 2 ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
- }
- }
- match = responseHeaders[ key.toLowerCase() ];
- }
- return match === undefined ? null : match;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( !state ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- statusText = statusText || "abort";
- if ( transport ) {
- transport.abort( statusText );
- }
- done( 0, statusText );
- return this;
- }
- };
-
- // Callback for when everything is done
- // It is defined here because jslint complains if it is declared
- // at the end of the function (which would be more logical and readable)
- function done( status, nativeStatusText, responses, headers ) {
-
- // Called once
- if ( state === 2 ) {
- return;
- }
-
- // State is "done" now
- state = 2;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- var isSuccess,
- success,
- error,
- statusText = nativeStatusText,
- response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
- lastModified,
- etag;
-
- // If successful, handle type chaining
- if ( status >= 200 && status < 300 || status === 304 ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
-
- if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
- jQuery.lastModified[ ifModifiedKey ] = lastModified;
- }
- if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
- jQuery.etag[ ifModifiedKey ] = etag;
- }
- }
-
- // If not modified
- if ( status === 304 ) {
-
- statusText = "notmodified";
- isSuccess = true;
-
- // If we have data
- } else {
-
- try {
- success = ajaxConvert( s, response );
- statusText = "success";
- isSuccess = true;
- } catch(e) {
- // We have a parsererror
- statusText = "parsererror";
- error = e;
- }
- }
- } else {
- // We extract error from statusText
- // then normalize statusText and status for non-aborts
- error = statusText;
- if ( !statusText || status ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = "" + ( nativeStatusText || statusText );
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
- }
-
- // Attach deferreds
- deferred.promise( jqXHR );
- jqXHR.success = jqXHR.done;
- jqXHR.error = jqXHR.fail;
- jqXHR.complete = completeDeferred.add;
-
- // Status-dependent callbacks
- jqXHR.statusCode = function( map ) {
- if ( map ) {
- var tmp;
- if ( state < 2 ) {
- for ( tmp in map ) {
- statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
- }
- } else {
- tmp = map[ jqXHR.status ];
- jqXHR.then( tmp, tmp );
- }
- }
- return this;
- };
-
- // Remove hash character (#7531: and string promotion)
- // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
- // We also use the url parameter if available
- s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
- // Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
-
- // Determine if a cross-domain request is in order
- if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
- );
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( state === 2 ) {
- return false;
- }
-
- // We can fire global events as of now if asked to
- fireGlobals = s.global;
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // If data is available, append data to url
- if ( s.data ) {
- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Get ifModifiedKey before adding the anti-cache parameter
- ifModifiedKey = s.url;
-
- // Add anti-cache in url if needed
- if ( s.cache === false ) {
-
- var ts = jQuery.now(),
- // try replacing _= if it is there
- ret = s.url.replace( rts, "$1_=" + ts );
-
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- ifModifiedKey = ifModifiedKey || s.url;
- if ( jQuery.lastModified[ ifModifiedKey ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
- }
- if ( jQuery.etag[ ifModifiedKey ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
- }
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
- // Abort if not done already
- jqXHR.abort();
- return false;
-
- }
-
- // Install callbacks on deferreds
- for ( i in { success: 1, error: 1, complete: 1 } ) {
- jqXHR[ i ]( s[ i ] );
- }
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = setTimeout( function(){
- jqXHR.abort( "timeout" );
- }, s.timeout );
- }
-
- try {
- state = 1;
- transport.send( requestHeaders, done );
- } catch (e) {
- // Propagate exception as error if not done
- if ( state < 2 ) {
- done( -1, e );
- // Simply rethrow otherwise
- } else {
- throw e;
- }
- }
- }
-
- return jqXHR;
- },
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a, traditional ) {
- var s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction( value ) ? value() : value;
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
- };
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings.traditional;
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( var prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" ).replace( r20, "+" );
- }
-});
-
-function buildParams( prefix, obj, traditional, add ) {
- if ( jQuery.isArray( obj ) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
- }
- });
-
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
- // Serialize object item.
- for ( var name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
-}
-
-// This is still on the jQuery object... for now
-// Want to move this to jQuery.ajax some day
-jQuery.extend({
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {}
-
-});
-
-/* Handles responses to an ajax request:
- * - sets all responseXXX fields accordingly
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var contents = s.contents,
- dataTypes = s.dataTypes,
- responseFields = s.responseFields,
- ct,
- type,
- finalDataType,
- firstDataType;
-
- // Fill responseXXX fields
- for ( type in responseFields ) {
- if ( type in responses ) {
- jqXHR[ responseFields[type] ] = responses[ type ];
- }
- }
-
- // Remove auto dataType and get content-type in the process
- while( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
-}
-
-// Chain conversions given the request and the original response
-function ajaxConvert( s, response ) {
-
- // Apply the dataFilter if provided
- if ( s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- var dataTypes = s.dataTypes,
- converters = {},
- i,
- key,
- length = dataTypes.length,
- tmp,
- // Current and previous dataTypes
- current = dataTypes[ 0 ],
- prev,
- // Conversion expression
- conversion,
- // Conversion function
- conv,
- // Conversion functions (transitive conversion)
- conv1,
- conv2;
-
- // For each dataType in the chain
- for ( i = 1; i < length; i++ ) {
-
- // Create converters map
- // with lowercased keys
- if ( i === 1 ) {
- for ( key in s.converters ) {
- if ( typeof key === "string" ) {
- converters[ key.toLowerCase() ] = s.converters[ key ];
- }
- }
- }
-
- // Get the dataTypes
- prev = current;
- current = dataTypes[ i ];
-
- // If current is auto dataType, update it to prev
- if ( current === "*" ) {
- current = prev;
- // If no auto and dataTypes are actually different
- } else if ( prev !== "*" && prev !== current ) {
-
- // Get the converter
- conversion = prev + " " + current;
- conv = converters[ conversion ] || converters[ "* " + current ];
-
- // If there is no direct converter, search transitively
- if ( !conv ) {
- conv2 = undefined;
- for ( conv1 in converters ) {
- tmp = conv1.split( " " );
- if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
- conv2 = converters[ tmp[1] + " " + current ];
- if ( conv2 ) {
- conv1 = converters[ conv1 ];
- if ( conv1 === true ) {
- conv = conv2;
- } else if ( conv2 === true ) {
- conv = conv1;
- }
- break;
- }
- }
- }
- }
- // If we found no converter, dispatch an error
- if ( !( conv || conv2 ) ) {
- jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
- }
- // If found converter is not an equivalence
- if ( conv !== true ) {
- // Convert with 1 or 2 converters accordingly
- response = conv ? conv( response ) : conv2( conv1(response) );
- }
- }
- }
- return response;
-}
-
-
-
-
-var jsc = jQuery.now(),
- jsre = /(\=)\?(&|$)|\?\?/i;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- return jQuery.expando + "_" + ( jsc++ );
- }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
- var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
-
- if ( s.dataTypes[ 0 ] === "jsonp" ||
- s.jsonp !== false && ( jsre.test( s.url ) ||
- inspectData && jsre.test( s.data ) ) ) {
-
- var responseContainer,
- jsonpCallback = s.jsonpCallback =
- jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
- previous = window[ jsonpCallback ],
- url = s.url,
- data = s.data,
- replace = "$1" + jsonpCallback + "$2";
-
- if ( s.jsonp !== false ) {
- url = url.replace( jsre, replace );
- if ( s.url === url ) {
- if ( inspectData ) {
- data = data.replace( jsre, replace );
- }
- if ( s.data === data ) {
- // Add callback manually
- url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
- }
- }
- }
-
- s.url = url;
- s.data = data;
-
- // Install callback
- window[ jsonpCallback ] = function( response ) {
- responseContainer = [ response ];
- };
-
- // Clean-up function
- jqXHR.always(function() {
- // Set callback back to previous value
- window[ jsonpCallback ] = previous;
- // Call if it was a function and we have a response
- if ( responseContainer && jQuery.isFunction( previous ) ) {
- window[ jsonpCallback ]( responseContainer[ 0 ] );
- }
- });
-
- // Use data converter to retrieve json after script execution
- s.converters["script json"] = function() {
- if ( !responseContainer ) {
- jQuery.error( jsonpCallback + " was not called" );
- }
- return responseContainer[ 0 ];
- };
-
- // force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Delegate to script
- return "script";
- }
-});
-
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /javascript|ecmascript/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- s.global = false;
- }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
-
- var script,
- head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
-
- return {
-
- send: function( _, callback ) {
-
- script = document.createElement( "script" );
-
- script.async = "async";
-
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
-
- script.src = s.url;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function( _, isAbort ) {
-
- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
-
- // Remove the script
- if ( head && script.parentNode ) {
- head.removeChild( script );
- }
-
- // Dereference the script
- script = undefined;
-
- // Callback if not abort
- if ( !isAbort ) {
- callback( 200, "success" );
- }
- }
- };
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709 and #4378).
- head.insertBefore( script, head.firstChild );
- },
-
- abort: function() {
- if ( script ) {
- script.onload( 0, 1 );
- }
- }
- };
- }
-});
-
-
-
-
-var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
- xhrOnUnloadAbort = window.ActiveXObject ? function() {
- // Abort all pending requests
- for ( var key in xhrCallbacks ) {
- xhrCallbacks[ key ]( 0, 1 );
- }
- } : false,
- xhrId = 0,
- xhrCallbacks;
-
-// Functions to create xhrs
-function createStandardXHR() {
- try {
- return new window.XMLHttpRequest();
- } catch( e ) {}
-}
-
-function createActiveXHR() {
- try {
- return new window.ActiveXObject( "Microsoft.XMLHTTP" );
- } catch( e ) {}
-}
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
- /* Microsoft failed to properly
- * implement the XMLHttpRequest in IE7 (can't request local files),
- * so we use the ActiveXObject when it is available
- * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
- * we need a fallback.
- */
- function() {
- return !this.isLocal && createStandardXHR() || createActiveXHR();
- } :
- // For all other browsers, use the standard XMLHttpRequest object
- createStandardXHR;
-
-// Determine support properties
-(function( xhr ) {
- jQuery.extend( jQuery.support, {
- ajax: !!xhr,
- cors: !!xhr && ( "withCredentials" in xhr )
- });
-})( jQuery.ajaxSettings.xhr() );
-
-// Create transport if the browser can provide an xhr
-if ( jQuery.support.ajax ) {
-
- jQuery.ajaxTransport(function( s ) {
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( !s.crossDomain || jQuery.support.cors ) {
-
- var callback;
-
- return {
- send: function( headers, complete ) {
-
- // Get a new xhr
- var xhr = s.xhr(),
- handle,
- i;
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if ( s.username ) {
- xhr.open( s.type, s.url, s.async, s.username, s.password );
- } else {
- xhr.open( s.type, s.url, s.async );
- }
-
- // Apply custom fields if provided
- if ( s.xhrFields ) {
- for ( i in s.xhrFields ) {
- xhr[ i ] = s.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( s.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( s.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !s.crossDomain && !headers["X-Requested-With"] ) {
- headers[ "X-Requested-With" ] = "XMLHttpRequest";
- }
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
- } catch( _ ) {}
-
- // Do send the request
- // This may raise an exception which is actually
- // handled in jQuery.ajax (so no try/catch here)
- xhr.send( ( s.hasContent && s.data ) || null );
-
- // Listener
- callback = function( _, isAbort ) {
-
- var status,
- statusText,
- responseHeaders,
- responses,
- xml;
-
- // Firefox throws exceptions when accessing properties
- // of an xhr when a network error occured
- // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
- try {
-
- // Was never called and is aborted or complete
- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
- // Only called once
- callback = undefined;
-
- // Do not keep as active anymore
- if ( handle ) {
- xhr.onreadystatechange = jQuery.noop;
- if ( xhrOnUnloadAbort ) {
- delete xhrCallbacks[ handle ];
- }
- }
-
- // If it's an abort
- if ( isAbort ) {
- // Abort it manually if needed
- if ( xhr.readyState !== 4 ) {
- xhr.abort();
- }
- } else {
- status = xhr.status;
- responseHeaders = xhr.getAllResponseHeaders();
- responses = {};
- xml = xhr.responseXML;
-
- // Construct response list
- if ( xml && xml.documentElement /* #4958 */ ) {
- responses.xml = xml;
- }
-
- // When requesting binary data, IE6-9 will throw an exception
- // on any attempt to access responseText (#11426)
- try {
- responses.text = xhr.responseText;
- } catch( _ ) {
- }
-
- // Firefox throws an exception when accessing
- // statusText for faulty cross-domain requests
- try {
- statusText = xhr.statusText;
- } catch( e ) {
- // We normalize with Webkit giving an empty statusText
- statusText = "";
- }
-
- // Filter status for non standard behaviors
-
- // If the request is local and we have data: assume a success
- // (success with no data won't get notified, that's the best we
- // can do given current implementations)
- if ( !status && s.isLocal && !s.crossDomain ) {
- status = responses.text ? 200 : 404;
- // IE - #1450: sometimes returns 1223 when it should be 204
- } else if ( status === 1223 ) {
- status = 204;
- }
- }
- }
- } catch( firefoxAccessException ) {
- if ( !isAbort ) {
- complete( -1, firefoxAccessException );
- }
- }
-
- // Call complete if needed
- if ( responses ) {
- complete( status, statusText, responses, responseHeaders );
- }
- };
-
- // if we're in sync mode or it's in cache
- // and has been retrieved directly (IE6 & IE7)
- // we need to manually fire the callback
- if ( !s.async || xhr.readyState === 4 ) {
- callback();
- } else {
- handle = ++xhrId;
- if ( xhrOnUnloadAbort ) {
- // Create the active xhrs callbacks list if needed
- // and attach the unload handler
- if ( !xhrCallbacks ) {
- xhrCallbacks = {};
- jQuery( window ).unload( xhrOnUnloadAbort );
- }
- // Add to list of active xhrs callbacks
- xhrCallbacks[ handle ] = callback;
- }
- xhr.onreadystatechange = callback;
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback(0,1);
- }
- }
- };
- }
- });
-}
-
-
-
-
-var elemdisplay = {},
- iframe, iframeDoc,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ],
- fxNow;
-
-jQuery.fn.extend({
- show: function( speed, easing, callback ) {
- var elem, display;
-
- if ( speed || speed === 0 ) {
- return this.animate( genFx("show", 3), speed, easing, callback );
-
- } else {
- for ( var i = 0, j = this.length; i < j; i++ ) {
- elem = this[ i ];
-
- if ( elem.style ) {
- display = elem.style.display;
-
- // Reset the inline display of this element to learn if it is
- // being hidden by cascaded rules or not
- if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
- display = elem.style.display = "";
- }
-
- // Set elements which have been overridden with display: none
- // in a stylesheet to whatever the default browser style is
- // for such an element
- if ( (display === "" && jQuery.css(elem, "display") === "none") ||
- !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
- jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
- }
- }
- }
-
- // Set the display of most of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- elem = this[ i ];
-
- if ( elem.style ) {
- display = elem.style.display;
-
- if ( display === "" || display === "none" ) {
- elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
- }
- }
- }
-
- return this;
- }
- },
-
- hide: function( speed, easing, callback ) {
- if ( speed || speed === 0 ) {
- return this.animate( genFx("hide", 3), speed, easing, callback);
-
- } else {
- var elem, display,
- i = 0,
- j = this.length;
-
- for ( ; i < j; i++ ) {
- elem = this[i];
- if ( elem.style ) {
- display = jQuery.css( elem, "display" );
-
- if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
- jQuery._data( elem, "olddisplay", display );
- }
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- if ( this[i].style ) {
- this[i].style.display = "none";
- }
- }
-
- return this;
- }
- },
-
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
-
- toggle: function( fn, fn2, callback ) {
- var bool = typeof fn === "boolean";
-
- if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
- this._toggle.apply( this, arguments );
-
- } else if ( fn == null || bool ) {
- this.each(function() {
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- });
-
- } else {
- this.animate(genFx("toggle", 3), fn, fn2, callback);
- }
-
- return this;
- },
-
- fadeTo: function( speed, to, easing, callback ) {
- return this.filter(":hidden").css("opacity", 0).show().end()
- .animate({opacity: to}, speed, easing, callback);
- },
-
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed( speed, easing, callback );
-
- if ( jQuery.isEmptyObject( prop ) ) {
- return this.each( optall.complete, [ false ] );
- }
-
- // Do not change referenced properties as per-property easing will be lost
- prop = jQuery.extend( {}, prop );
-
- function doAnimation() {
- // XXX 'this' does not always have a nodeName when running the
- // test suite
-
- if ( optall.queue === false ) {
- jQuery._mark( this );
- }
-
- var opt = jQuery.extend( {}, optall ),
- isElement = this.nodeType === 1,
- hidden = isElement && jQuery(this).is(":hidden"),
- name, val, p, e, hooks, replace,
- parts, start, end, unit,
- method;
-
- // will store per property easing and be used to determine when an animation is complete
- opt.animatedProperties = {};
-
- // first pass over propertys to expand / normalize
- for ( p in prop ) {
- name = jQuery.camelCase( p );
- if ( p !== name ) {
- prop[ name ] = prop[ p ];
- delete prop[ p ];
- }
-
- if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
- replace = hooks.expand( prop[ name ] );
- delete prop[ name ];
-
- // not quite $.extend, this wont overwrite keys already present.
- // also - reusing 'p' from above because we have the correct "name"
- for ( p in replace ) {
- if ( ! ( p in prop ) ) {
- prop[ p ] = replace[ p ];
- }
- }
- }
- }
-
- for ( name in prop ) {
- val = prop[ name ];
- // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
- if ( jQuery.isArray( val ) ) {
- opt.animatedProperties[ name ] = val[ 1 ];
- val = prop[ name ] = val[ 0 ];
- } else {
- opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
- }
-
- if ( val === "hide" && hidden || val === "show" && !hidden ) {
- return opt.complete.call( this );
- }
-
- if ( isElement && ( name === "height" || name === "width" ) ) {
- // Make sure that nothing sneaks out
- // Record all 3 overflow attributes because IE does not
- // change the overflow attribute when overflowX and
- // overflowY are set to the same value
- opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
-
- // Set display property to inline-block for height/width
- // animations on inline elements that are having width/height animated
- if ( jQuery.css( this, "display" ) === "inline" &&
- jQuery.css( this, "float" ) === "none" ) {
-
- // inline-level elements accept inline-block;
- // block-level elements need to be inline with layout
- if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
- this.style.display = "inline-block";
-
- } else {
- this.style.zoom = 1;
- }
- }
- }
- }
-
- if ( opt.overflow != null ) {
- this.style.overflow = "hidden";
- }
-
- for ( p in prop ) {
- e = new jQuery.fx( this, opt, p );
- val = prop[ p ];
-
- if ( rfxtypes.test( val ) ) {
-
- // Tracks whether to show or hide based on private
- // data attached to the element
- method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
- if ( method ) {
- jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
- e[ method ]();
- } else {
- e[ val ]();
- }
-
- } else {
- parts = rfxnum.exec( val );
- start = e.cur();
-
- if ( parts ) {
- end = parseFloat( parts[2] );
- unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
-
- // We need to compute starting value
- if ( unit !== "px" ) {
- jQuery.style( this, p, (end || 1) + unit);
- start = ( (end || 1) / e.cur() ) * start;
- jQuery.style( this, p, start + unit);
- }
-
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] ) {
- end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
- }
-
- e.custom( start, end, unit );
-
- } else {
- e.custom( start, val, "" );
- }
- }
- }
-
- // For JS strict compliance
- return true;
- }
-
- return optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
-
- stop: function( type, clearQueue, gotoEnd ) {
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each(function() {
- var index,
- hadTimers = false,
- timers = jQuery.timers,
- data = jQuery._data( this );
-
- // clear marker counters if we know they won't be
- if ( !gotoEnd ) {
- jQuery._unmark( true, this );
- }
-
- function stopQueue( elem, data, index ) {
- var hooks = data[ index ];
- jQuery.removeData( elem, index, true );
- hooks.stop( gotoEnd );
- }
-
- if ( type == null ) {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
- stopQueue( this, data, index );
- }
- }
- } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
- stopQueue( this, data, index );
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
- if ( gotoEnd ) {
-
- // force the next step to be the last
- timers[ index ]( true );
- } else {
- timers[ index ].saveState();
- }
- hadTimers = true;
- timers.splice( index, 1 );
- }
- }
-
- // start the next in the queue if the last step wasn't forced
- // timers currently will call their complete callbacks, which will dequeue
- // but only if they were gotoEnd
- if ( !( gotoEnd && hadTimers ) ) {
- jQuery.dequeue( this, type );
- }
- });
- }
-
-});
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
- setTimeout( clearFxNow, 0 );
- return ( fxNow = jQuery.now() );
-}
-
-function clearFxNow() {
- fxNow = undefined;
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, num ) {
- var obj = {};
-
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
- obj[ this ] = type;
- });
-
- return obj;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx( "show", 1 ),
- slideUp: genFx( "hide", 1 ),
- slideToggle: genFx( "toggle", 1 ),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
-});
-
-jQuery.extend({
- speed: function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
- // normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function( noUnmark ) {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- } else if ( noUnmark !== false ) {
- jQuery._unmark( this );
- }
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
- }
- },
-
- timers: [],
-
- fx: function( elem, options, prop ) {
- this.options = options;
- this.elem = elem;
- this.prop = prop;
-
- options.orig = options.orig || {};
- }
-
-});
-
-jQuery.fx.prototype = {
- // Simple function for setting a style value
- update: function() {
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
- },
-
- // Get the current size
- cur: function() {
- if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
- return this.elem[ this.prop ];
- }
-
- var parsed,
- r = jQuery.css( this.elem, this.prop );
- // Empty strings, null, undefined and "auto" are converted to 0,
- // complex values such as "rotate(1rad)" are returned as is,
- // simple values such as "10px" are parsed to Float.
- return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
- },
-
- // Start an animation from one number to another
- custom: function( from, to, unit ) {
- var self = this,
- fx = jQuery.fx;
-
- this.startTime = fxNow || createFxNow();
- this.end = to;
- this.now = this.start = from;
- this.pos = this.state = 0;
- this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
-
- function t( gotoEnd ) {
- return self.step( gotoEnd );
- }
-
- t.queue = this.options.queue;
- t.elem = this.elem;
- t.saveState = function() {
- if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
- if ( self.options.hide ) {
- jQuery._data( self.elem, "fxshow" + self.prop, self.start );
- } else if ( self.options.show ) {
- jQuery._data( self.elem, "fxshow" + self.prop, self.end );
- }
- }
- };
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval( fx.tick, fx.interval );
- }
- },
-
- // Simple 'show' function
- show: function() {
- var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
-
- // Remember where we started, so that we can go back to it later
- this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
- this.options.show = true;
-
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any flash of content
- if ( dataShow !== undefined ) {
- // This show is picking up where a previous hide or show left off
- this.custom( this.cur(), dataShow );
- } else {
- this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
- }
-
- // Start by showing the element
- jQuery( this.elem ).show();
- },
-
- // Simple 'hide' function
- hide: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
- this.options.hide = true;
-
- // Begin the animation
- this.custom( this.cur(), 0 );
- },
-
- // Each step of an animation
- step: function( gotoEnd ) {
- var p, n, complete,
- t = fxNow || createFxNow(),
- done = true,
- elem = this.elem,
- options = this.options;
-
- if ( gotoEnd || t >= options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- options.animatedProperties[ this.prop ] = true;
-
- for ( p in options.animatedProperties ) {
- if ( options.animatedProperties[ p ] !== true ) {
- done = false;
- }
- }
-
- if ( done ) {
- // Reset the overflow
- if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
-
- jQuery.each( [ "", "X", "Y" ], function( index, value ) {
- elem.style[ "overflow" + value ] = options.overflow[ index ];
- });
- }
-
- // Hide the element if the "hide" operation was done
- if ( options.hide ) {
- jQuery( elem ).hide();
- }
-
- // Reset the properties, if the item has been hidden or shown
- if ( options.hide || options.show ) {
- for ( p in options.animatedProperties ) {
- jQuery.style( elem, p, options.orig[ p ] );
- jQuery.removeData( elem, "fxshow" + p, true );
- // Toggle data is no longer needed
- jQuery.removeData( elem, "toggle" + p, true );
- }
- }
-
- // Execute the complete function
- // in the event that the complete function throws an exception
- // we must ensure it won't be called twice. #5684
-
- complete = options.complete;
- if ( complete ) {
-
- options.complete = false;
- complete.call( elem );
- }
- }
-
- return false;
-
- } else {
- // classical easing cannot be used with an Infinity duration
- if ( options.duration == Infinity ) {
- this.now = t;
- } else {
- n = t - this.startTime;
- this.state = n / options.duration;
-
- // Perform the easing function, defaults to swing
- this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
- this.now = this.start + ( (this.end - this.start) * this.pos );
- }
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
- }
-};
-
-jQuery.extend( jQuery.fx, {
- tick: function() {
- var timer,
- timers = jQuery.timers,
- i = 0;
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- },
-
- interval: 13,
-
- stop: function() {
- clearInterval( timerId );
- timerId = null;
- },
-
- speeds: {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
-
- step: {
- opacity: function( fx ) {
- jQuery.style( fx.elem, "opacity", fx.now );
- },
-
- _default: function( fx ) {
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
- fx.elem.style[ fx.prop ] = fx.now + fx.unit;
- } else {
- fx.elem[ fx.prop ] = fx.now;
- }
- }
- }
-});
-
-// Ensure props that can't be negative don't go there on undershoot easing
-jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
- // exclude marginTop, marginLeft, marginBottom and marginRight from this list
- if ( prop.indexOf( "margin" ) ) {
- jQuery.fx.step[ prop ] = function( fx ) {
- jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
- };
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
- };
-}
-
-// Try to restore the default display value of an element
-function defaultDisplay( nodeName ) {
-
- if ( !elemdisplay[ nodeName ] ) {
-
- var body = document.body,
- elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
- display = elem.css( "display" );
- elem.remove();
-
- // If the simple way fails,
- // get element's real default display by attaching it to a temp iframe
- if ( display === "none" || display === "" ) {
- // No iframe to use yet, so create it
- if ( !iframe ) {
- iframe = document.createElement( "iframe" );
- iframe.frameBorder = iframe.width = iframe.height = 0;
- }
-
- body.appendChild( iframe );
-
- // Create a cacheable copy of the iframe document on first call.
- // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
- // document to it; WebKit & Firefox won't allow reusing the iframe document.
- if ( !iframeDoc || !iframe.createElement ) {
- iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
- iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
- iframeDoc.close();
- }
-
- elem = iframeDoc.createElement( nodeName );
-
- iframeDoc.body.appendChild( elem );
-
- display = jQuery.css( elem, "display" );
- body.removeChild( iframe );
- }
-
- // Store the correct default display
- elemdisplay[ nodeName ] = display;
- }
-
- return elemdisplay[ nodeName ];
-}
-
-
-
-
-var getOffset,
- rtable = /^t(?:able|d|h)$/i,
- rroot = /^(?:body|html)$/i;
-
-if ( "getBoundingClientRect" in document.documentElement ) {
- getOffset = function( elem, doc, docElem, box ) {
- try {
- box = elem.getBoundingClientRect();
- } catch(e) {}
-
- // Make sure we're not dealing with a disconnected DOM node
- if ( !box || !jQuery.contains( docElem, elem ) ) {
- return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
- }
-
- var body = doc.body,
- win = getWindow( doc ),
- clientTop = docElem.clientTop || body.clientTop || 0,
- clientLeft = docElem.clientLeft || body.clientLeft || 0,
- scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
- scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
- top = box.top + scrollTop - clientTop,
- left = box.left + scrollLeft - clientLeft;
-
- return { top: top, left: left };
- };
-
-} else {
- getOffset = function( elem, doc, docElem ) {
- var computedStyle,
- offsetParent = elem.offsetParent,
- prevOffsetParent = elem,
- body = doc.body,
- defaultView = doc.defaultView,
- prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
- top = elem.offsetTop,
- left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
- break;
- }
-
- computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
- top -= elem.scrollTop;
- left -= elem.scrollLeft;
-
- if ( elem === offsetParent ) {
- top += elem.offsetTop;
- left += elem.offsetLeft;
-
- if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevOffsetParent = offsetParent;
- offsetParent = elem.offsetParent;
- }
-
- if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevComputedStyle = computedStyle;
- }
-
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
- top += body.offsetTop;
- left += body.offsetLeft;
- }
-
- if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
- top += Math.max( docElem.scrollTop, body.scrollTop );
- left += Math.max( docElem.scrollLeft, body.scrollLeft );
- }
-
- return { top: top, left: left };
- };
-}
-
-jQuery.fn.offset = function( options ) {
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- var elem = this[0],
- doc = elem && elem.ownerDocument;
-
- if ( !doc ) {
- return null;
- }
-
- if ( elem === doc.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- return getOffset( elem, doc, doc.documentElement );
-};
-
-jQuery.offset = {
-
- bodyOffset: function( body ) {
- var top = body.offsetTop,
- left = body.offsetLeft;
-
- if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
- top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
- left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
- }
-
- return { top: top, left: left };
- },
-
- setOffset: function( elem, options, i ) {
- var position = jQuery.css( elem, "position" );
-
- // set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- var curElem = jQuery( elem ),
- curOffset = curElem.offset(),
- curCSSTop = jQuery.css( elem, "top" ),
- curCSSLeft = jQuery.css( elem, "left" ),
- calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
- props = {}, curPosition = {}, curTop, curLeft;
-
- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-
-jQuery.fn.extend({
-
- position: function() {
- if ( !this[0] ) {
- return null;
- }
-
- var elem = this[0],
-
- // Get *real* offsetParent
- offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
- offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
-
- // Add offsetParent borders
- parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
- parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
-
- // Subtract the two offsets
- return {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || document.body;
- while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent;
- });
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
- var top = /Y/.test( prop );
-
- jQuery.fn[ method ] = function( val ) {
- return jQuery.access( this, function( elem, method, val ) {
- var win = getWindow( elem );
-
- if ( val === undefined ) {
- return win ? (prop in win) ? win[ prop ] :
- jQuery.support.boxModel && win.document.documentElement[ method ] ||
- win.document.body[ method ] :
- elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : jQuery( win ).scrollLeft(),
- top ? val : jQuery( win ).scrollTop()
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length, null );
- };
-});
-
-function getWindow( elem ) {
- return jQuery.isWindow( elem ) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-
-
-
-
-// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- var clientProp = "client" + name,
- scrollProp = "scroll" + name,
- offsetProp = "offset" + name;
-
- // innerHeight and innerWidth
- jQuery.fn[ "inner" + name ] = function() {
- var elem = this[0];
- return elem ?
- elem.style ?
- parseFloat( jQuery.css( elem, type, "padding" ) ) :
- this[ type ]() :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn[ "outer" + name ] = function( margin ) {
- var elem = this[0];
- return elem ?
- elem.style ?
- parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
- this[ type ]() :
- null;
- };
-
- jQuery.fn[ type ] = function( value ) {
- return jQuery.access( this, function( elem, type, value ) {
- var doc, docElemProp, orig, ret;
-
- if ( jQuery.isWindow( elem ) ) {
- // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
- doc = elem.document;
- docElemProp = doc.documentElement[ clientProp ];
- return jQuery.support.boxModel && docElemProp ||
- doc.body && doc.body[ clientProp ] || docElemProp;
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- doc = elem.documentElement;
-
- // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
- // so we can't use max, as it'll choose the incorrect offset[Width/Height]
- // instead we use the correct client[Width/Height]
- // support:IE6
- if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
- return doc[ clientProp ];
- }
-
- return Math.max(
- elem.body[ scrollProp ], doc[ scrollProp ],
- elem.body[ offsetProp ], doc[ offsetProp ]
- );
- }
-
- // Get width or height on the element
- if ( value === undefined ) {
- orig = jQuery.css( elem, type );
- ret = parseFloat( orig );
- return jQuery.isNumeric( ret ) ? ret : orig;
- }
-
- // Set the width or height on the element
- jQuery( elem ).css( type, value );
- }, type, value, arguments.length, null );
- };
-});
-
-
-
-
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-// Expose jQuery as an AMD module, but only for AMD loaders that
-// understand the issues with loading multiple versions of jQuery
-// in a page that all might call define(). The loader will indicate
-// they have special allowances for multiple jQuery versions by
-// specifying define.amd.jQuery = true. Register as a named module,
-// since jQuery can be concatenated with other files that may use define,
-// but not use a proper concatenation script that understands anonymous
-// AMD modules. A named AMD is safest and most robust way to register.
-// Lowercase jquery is used because AMD module names are derived from
-// file names, and jQuery is normally delivered in a lowercase file name.
-// Do this after creating the global so that if an AMD module wants to call
-// noConflict to hide this version of jQuery, it will work.
-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
- define( "jquery", [], function () { return jQuery; } );
-}
-
-
-
-})( window );
diff --git a/src/components/HMI/lib/jquery-1.7.2.min.js b/src/components/HMI/lib/jquery-1.7.2.min.js
deleted file mode 100644
index 1775c9c031..0000000000
--- a/src/components/HMI/lib/jquery-1.7.2.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.7.2 jquery.com | jquery.org/license */
-(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
-a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
-.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file
diff --git a/src/components/HMI/locale/eng.js b/src/components/HMI/locale/eng.js
deleted file mode 100644
index 75c7e200d1..0000000000
--- a/src/components/HMI/locale/eng.js
+++ /dev/null
@@ -1,62 +0,0 @@
-SDL.eng = {
-
- view_warning: 'WARNING!',
- view_warning_paragraph1: 'This application is intended to be used as a demonstrative aid only, while the vehicle is parked. Don&apos;t use it while driving.',
- view_warning_paragraph2: 'Use extreme caution when using any device that takes your attention off the road. Ford recommends against the use of any hand-held device while driving and that you comply with all applicable laws. Your primary responsibility is the safe operation of the vehicle.',
-
- view_mediaStatus_entertainment: 'Entertainment',
-
- view_info_alerts_sort: 'Sort By',
-
- view_info_alerts_dateIcon: [
- 'Date', 'Icon'
- ],
- view_info_alerts_911Assist: '911 Assist Set To OFF 2012',
- view_info_alerts_view: 'View',
- view_info_alerts_delete: 'Delete',
- view_info_alerts_deleteAll: 'Delete All',
- view_info_apps_911Assist: '911 Assist',
- view_info_apps_vehicle_VehicleHealthReport: 'Vehicle Health Report',
- view_info_apps_vehicle_InstallApplicationsUp: 'Install Applications/Up',
- view_info_apps_vehicle_FindNewApplications: 'Find New Apps',
- view_info_apps_vehicle_GetDeviceList: 'Change Devices',
-
- view_info_calendar_date: 'Jul, 2012',
- view_info_calendar_today: 'Go to Today',
- view_info_calendar_day1: 'SUN',
- view_info_calendar_day2: 'MON',
- view_info_calendar_day3: 'TUE',
- view_info_calendar_day4: 'WED',
- view_info_calendar_day5: 'THU',
- view_info_calendar_day6: 'FRI',
- view_info_calendar_day7: 'SAT',
-
- view_info_services_syncServices: 'SYNC Services',
- view_info_services_trafficDirectionsAndInformation: 'TRAFFIC, DIRECTIONS AND INFORMATION',
- view_info_services_getTheLatestTrafficRreport: 'Get the latest traffic report',
- view_info_services_findBusinessesAndDownloadSaved: 'Find Businesses and Download Saved ',
- view_info_services_hearPersonalizedInformationMore: 'Hear Personalized Information & More',
- view_info_services_connecttoServices: 'Connect to Services',
- view_info_services_toActivate: 'To activate, log onto www.SyncMyRide.com',
-
- view_info_travelLink_trafficOnRoute: 'Traffic on Route',
- view_info_travelLink_trafficNearby: 'Traffic Nearby',
- view_info_travelLink_fuelPrices: 'Fuel Prices',
- view_info_travelLink_movieListings: 'Movie Listings',
- view_info_travelLink_subscriptionInfo: 'Subscription Info',
- view_info_travelLink_weather: 'Weather',
- view_info_travelLink_sportsInfo: 'Sports Info',
- view_info_travelLink_skiConditions: 'Ski Conditions',
-
- view_info_leftmenu_services: 'Services',
- view_info_leftmenu_travelLink: 'Travel Link',
- view_info_leftmenu_alerts: 'Alerts',
- view_info_leftmenu_calendar: 'Calendar',
- view_info_leftmenu_apps: 'Apps',
-
- view_media_cd: 'CD',
- view_phone_dial: 'Dial',
- view_phone_end: 'End',
- view_phone_phone: 'Phone',
- view_phone_popUp_callEnded: 'Call Ended'
-}; \ No newline at end of file
diff --git a/src/components/HMI/locale/locale.js b/src/components/HMI/locale/locale.js
deleted file mode 100644
index 486fe75260..0000000000
--- a/src/components/HMI/locale/locale.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met: ·
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer. · Redistributions in binary
- * form must reproduce the above copyright notice, this list of conditions and
- * the following disclaimer in the documentation and/or other materials provided
- * with the distribution. · Neither the name of the Ford Motor Company nor the
- * names of its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-/**
- * @name SDL.locale
- * @desc SDL localization object
- * @category Localization
- * @filesource locale/locale.js
- * @version 1.0
- */
-
-SDL.locale = Em.Object.create( {
-
- label: SDL[SDL.localization],
-
- setLang: function(lang) {
-
- this.set('label', SDL[SDL.localization]);
- }.observes('SDL.localization')
-}); \ No newline at end of file
diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index 32848b1c6d..e9f2f8ec7b 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -1,6 +1,9 @@
# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
+# Copyright (c) 2017 Xevo Inc.
+# All rights reserved.
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@@ -12,7 +15,7 @@
# disclaimer in the documentation and/or other materials provided with the
# distribution.
#
-# Neither the name of the Ford Motor Company nor the names of its contributors
+# Neither the name of the copyright holders nor the names of their contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
@@ -28,6 +31,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
set (AM_SOURCE_DIR ${COMPONENTS_DIR}/application_manager)
set (AM_TEST_DIR ${AM_SOURCE_DIR}/test)
@@ -36,25 +41,27 @@ set (AM_MOCK_DIR ${AM_TEST_DIR}/mock)
include_directories (
include/
${COMPONENTS_DIR}
+ ${COMPONENTS_DIR}/functional_module/include/
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/protocol_handler/include/
${COMPONENTS_DIR}/smart_objects/include/
${COMPONENTS_DIR}/hmi_message_handler/include
- ${COMPONENTS_DIR}/media_manager/include/
- ${COMPONENTS_DIR}/connection_handler/include/
- ${COMPONENTS_DIR}/config_profile/include/
- ${COMPONENTS_DIR}/request_watchdog/include/
- ${COMPONENTS_DIR}/resumption/include/
- ${COMPONENTS_DIR}/app_launch/include/
- ${COMPONENTS_DIR}/rpc_base/include/
+ ${COMPONENTS_DIR}/media_manager/include
+ ${COMPONENTS_DIR}/connection_handler/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/request_watchdog/include
+ ${COMPONENTS_DIR}/resumption/include
+ ${COMPONENTS_DIR}/rpc_base/include
${COMPONENTS_DIR}/interfaces
+ ${POLICY_PATH}/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/policy/include/
${JSONCPP_INCLUDE_DIRECTORY}
${ENCRYPTION_INCLUDE_DIRECTORY}
${MESSAGE_BROKER_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BSON_INCLUDE_DIRECTORY}
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -69,48 +76,60 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
)
endif()
-file (GLOB SOURCES
- ${AM_SOURCE_DIR}/src/*
+set (MESSAGE_HELPER_SOURCE_DIR
+ ${AM_SOURCE_DIR}/src/message_helper
)
-set (MESSAGE_HELPER_SOURCES
- ${AM_SOURCE_DIR}/src/message_helper/message_helper.cc
+set (MESSAGE_HELPER_PATHS
+ ${MESSAGE_HELPER_SOURCE_DIR}
)
+collect_sources(MESSAGE_HELPER_SOURCES "${MESSAGE_HELPER_PATHS}")
-set (POLICIES_MANAGER
-${AM_SOURCE_DIR}/src/policies/policy_handler.cc
-${AM_SOURCE_DIR}/src/usage_statistics.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
+
+set (POLICIES_SOURCE_DIR
+ ${AM_SOURCE_DIR}/src/policies
)
- include_directories(
- ${COMPONENTS_DIR}/policy/src/policy/policy_table/table_struct
- )
-file (GLOB EVENT_ENGINE
- ${AM_SOURCE_DIR}/src/event_engine/*
+set (POLICIES_MANAGER_SOURCES
+ ${POLICIES_SOURCE_DIR}/policy_handler.cc
+ ${POLICIES_SOURCE_DIR}/policy_event_observer.cc
+ ${POLICIES_SOURCE_DIR}/delegates/app_permission_delegate.cc
+ ${POLICIES_SOURCE_DIR}/delegates/statistics_delegate.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/usage_statistics.cc
+)
+
+include_directories(
+ ${POLICY_PATH}/src/policy/policy_table/table_struct
)
-file (GLOB RESUMPTION
- ${AM_SOURCE_DIR}/src/resumption/*
+set (EVENT_ENGINE_SOURCE_DIR
+ ${AM_SOURCE_DIR}/src/event_engine
)
-file (GLOB APP_LAUNCH
- ${AM_SOURCE_DIR}/src/app_launch/*
+set (EVENT_ENGINE_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/application_manager/event_engine
+ ${EVENT_ENGINE_SOURCE_DIR}
)
+collect_sources(EVENT_ENGINE_SOURCES "${EVENT_ENGINE_PATHS}")
set (COMMANDS_SOURCE_DIR
${AM_SOURCE_DIR}/src/commands
)
+collect_sources(POLICIES_SOURCES "${POLICIES_PATHS}")
-file (GLOB MOBILE_COMMANDS_SOURCES
- ${COMMANDS_SOURCE_DIR}/*
- ${COMMANDS_SOURCE_DIR}/mobile/*
+set(MOBILE_COMMANDS_EXCLUDE_PATHS
+ ${COMMANDS_SOURCE_DIR}/hmi
)
+set (MOBILE_COMMANDS_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/application_manager/commands
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/application_manager/commands/mobile
+ ${COMMANDS_SOURCE_DIR}
+ ${COMMANDS_SOURCE_DIR}/mobile
+)
+collect_sources(MOBILE_COMMANDS_SOURCES "${MOBILE_COMMANDS_PATHS}" "${MOBILE_COMMANDS_EXCLUDE_PATHS}")
- set (HMI_COMMANDS_SOURCES
+set (HMI_COMMANDS_SOURCES
${COMMANDS_SOURCE_DIR}/hmi/request_to_hmi.cc
${COMMANDS_SOURCE_DIR}/hmi/response_from_hmi.cc
${COMMANDS_SOURCE_DIR}/hmi/request_from_hmi.cc
@@ -292,6 +311,8 @@ file (GLOB MOBILE_COMMANDS_SOURCES
${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_response.cc
${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_request.cc
${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_set_video_config_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/navi_set_video_config_response.cc
${COMMANDS_SOURCE_DIR}/hmi/on_system_request_notification.cc
${COMMANDS_SOURCE_DIR}/hmi/on_put_file_notification.cc
${COMMANDS_SOURCE_DIR}/hmi/on_resume_audio_source_notification.cc
@@ -303,6 +324,7 @@ file (GLOB MOBILE_COMMANDS_SOURCES
${COMMANDS_SOURCE_DIR}/hmi/on_system_error_notification.cc
${COMMANDS_SOURCE_DIR}/hmi/basic_communication_system_request.cc
${COMMANDS_SOURCE_DIR}/hmi/basic_communication_system_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/basic_communication_on_awake_sdl.cc
${COMMANDS_SOURCE_DIR}/hmi/sdl_policy_update.cc
${COMMANDS_SOURCE_DIR}/hmi/sdl_policy_update_response.cc
${COMMANDS_SOURCE_DIR}/hmi/on_received_policy_update.cc
@@ -314,9 +336,15 @@ file (GLOB MOBILE_COMMANDS_SOURCES
${COMMANDS_SOURCE_DIR}/hmi/dial_number_request.cc
${COMMANDS_SOURCE_DIR}/hmi/dial_number_response.cc
${COMMANDS_SOURCE_DIR}/hmi/on_event_changed_notification.cc
-)
-
-set (HMI_COMMANDS_SOURCES_JSON
+ ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_set_icon_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/rc_is_ready_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/rc_is_ready_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_response.cc
${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_request.cc
${COMMANDS_SOURCE_DIR}/hmi/vi_get_vehicle_data_response.cc
${COMMANDS_SOURCE_DIR}/hmi/vi_subscribe_vehicle_data_request.cc
@@ -326,6 +354,9 @@ set (HMI_COMMANDS_SOURCES_JSON
${COMMANDS_SOURCE_DIR}/hmi/on_vi_vehicle_data_notification.cc
)
+set (HMI_COMMANDS_SOURCES_JSON
+)
+
set (HMI_COMMANDS_SOURCES_DBUS
${COMMANDS_SOURCE_DIR}/hmi/on_vi_gps_data_notification.cc
${COMMANDS_SOURCE_DIR}/hmi/on_vi_speed_notification.cc
@@ -351,13 +382,30 @@ set (HMI_COMMANDS_SOURCES_DBUS
)
if (${HMI_JSON_API})
- set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON})
+ set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_JSON})
endif (${HMI_JSON_API})
-if (${HMI_DBUS_API})
- set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_DBUS})
-endif (${HMI_DBUS_API})
-SET (LIBRARIES
+set (HMI_COMMANDS_SOURCES ${HMI_COMMANDS_SOURCES} ${HMI_COMMANDS_SOURCES_DBUS})
+
+set(EXCLUDE_PATHS
+ ${COMMANDS_SOURCE_DIR}
+ ${EVENT_ENGINE_SOURCE_DIR}
+ ${MESSAGE_HELPER_SOURCE_DIR}
+ ${POLICIES_SOURCE_DIR}
+)
+
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+
+if (NOT REMOTE_CONTROL)
+ list(REMOVE_ITEM SOURCES
+ ${COMPONENTS_DIR}/application_manager/src/core_service.cc)
+endif()
+
+set(LIBRARIES
HMI_API
MOBILE_API
v4_protocol_v1_2_no_extra
@@ -367,43 +415,57 @@ SET (LIBRARIES
dl
formatters
dbms
+ Utils
+ bson -L${BSON_LIBS_DIRECTORY}
+ emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
+if(REMOTE_CONTROL)
+ SET (LIBRARIES
+ ${LIBRARIES}
+ FunctionalModule
+ )
+endif(REMOTE_CONTROL)
+
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBRARIES sqlite3)
endif ()
-IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
+if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
list(REMOVE_ITEM LIBRARIES dl)
endif()
-add_library("AMEventEngine" ${EVENT_ENGINE})
+add_library("AMEventEngine" ${EVENT_ENGINE_SOURCES})
target_link_libraries("AMEventEngine" ${LIBRARIES})
-
-add_library("AMPolicyLibrary" ${POLICIES_MANAGER} )
+add_library("AMPolicyLibrary" ${POLICIES_MANAGER_SOURCES} )
target_link_libraries("AMPolicyLibrary" ${LIBRARIES} AMEventEngine)
add_library("AMHMICommandsLibrary" ${HMI_COMMANDS_SOURCES})
target_link_libraries("AMHMICommandsLibrary" ${LIBRARIES} AMEventEngine)
add_library("MessageHelper" ${MESSAGE_HELPER_SOURCES})
+target_link_libraries("MessageHelper" ${LIBRARIES})
add_library("AMMobileCommandsLibrary" ${MOBILE_COMMANDS_SOURCES} )
target_link_libraries("AMMobileCommandsLibrary" ${LIBRARIES} AMEventEngine)
-add_library("ApplicationManager" ${SOURCES} ${RESUMPTION} ${APP_LAUNCH})
+add_library("ApplicationManager" ${SOURCES})
-target_link_libraries("ApplicationManager" ${LIBRARIES} AMHMICommandsLibrary
- AMMobileCommandsLibrary
- AMEventEngine
- AMPolicyLibrary)
+list(APPEND LIBRARIES
+ AMEventEngine
+ AMPolicyLibrary
+ AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+)
if(ENABLE_LOG)
- target_link_libraries("ApplicationManager" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
+add_dependencies("ApplicationManager" libbson)
+target_link_libraries("ApplicationManager" ${LIBRARIES})
+
if(BUILD_TESTS)
add_subdirectory(test)
- add_subdirectory(test/message_helper)
endif()
diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h
new file mode 100644
index 0000000000..221601a307
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/app_extension.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
+
+#include "utils/shared_ptr.h"
+
+namespace application_manager {
+
+typedef int AppExtensionUID;
+
+class AppExtension {
+ public:
+ explicit AppExtension(AppExtensionUID uid) : kUid_(uid) {}
+ virtual ~AppExtension() {}
+ AppExtensionUID uid() const {
+ return kUid_;
+ }
+
+ private:
+ const AppExtensionUID kUid_;
+};
+
+typedef utils::SharedPtr<AppExtension> AppExtensionPtr;
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h
index 3ec667d911..0c93f7447b 100644
--- a/src/components/application_manager/include/application_manager/application.h
+++ b/src/components/application_manager/include/application_manager/application.h
@@ -37,28 +37,22 @@
#include <map>
#include <set>
#include <list>
+#include <vector>
#include "utils/shared_ptr.h"
#include "utils/data_accessor.h"
#include "interfaces/MOBILE_API.h"
#include "connection_handler/device.h"
+#include "application_manager/app_extension.h"
#include "application_manager/message.h"
#include "application_manager/hmi_state.h"
#include "application_manager/application_state.h"
#include "protocol_handler/protocol_handler.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-
-class SmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
+#include "utils/macro.h"
namespace application_manager {
namespace mobile_api = mobile_apis;
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
namespace custom_str = utils::custom_string;
typedef int32_t ErrorCode;
@@ -87,7 +81,10 @@ struct Version {
struct AppFile {
// need to use in std::map;
- AppFile() {}
+ AppFile()
+ : is_persistent(false)
+ , is_download_complete(false)
+ , file_type(mobile_apis::FileType::INVALID_ENUM) {}
AppFile(const std::string& name,
bool persistent,
bool download_complete,
@@ -165,13 +162,18 @@ typedef std::set<uint32_t> SoftButtonID;
/**
* @brief Defines set of vehicle info types
*/
-typedef std::set<uint32_t> VehicleInfoSubscriptions;
+typedef std::set<mobile_apis::VehicleDataType::eType> VehicleInfoSubscriptions;
/**
* @brief Defines set of buttons subscription
*/
typedef std::set<mobile_apis::ButtonName::eType> ButtonSubscriptions;
+/**
+ * @breif Collection for the mobile command smart object.
+ */
+typedef std::vector<smart_objects::SmartObjectSPtr> MobileMessageQueue;
+
class DynamicApplicationData {
public:
virtual ~DynamicApplicationData() {}
@@ -218,9 +220,16 @@ class DynamicApplicationData {
virtual void set_video_stream_retry_number(
const uint32_t& video_stream_retry_number) = 0;
- /*
- * @brief Adds a command to the in application menu
+ /**
+ * @brief Checks if application is media, voice communication or navigation
+ * @return true if application is media, voice communication or navigation,
+ * false otherwise
*/
+ virtual bool is_audio() const = 0;
+
+ /*
+ * @brief Adds a command to the in application menu
+ */
virtual void AddCommand(uint32_t cmd_id,
const smart_objects::SmartObject& command) = 0;
@@ -382,7 +391,6 @@ class Application : public virtual InitialApplicationData,
public:
enum ApplicationRegisterState { kRegistered = 0, kWaitingForRegistration };
- public:
Application() : is_greyed_out_(false) {}
virtual ~Application() {}
@@ -407,6 +415,20 @@ class Application : public virtual InitialApplicationData,
virtual void UpdateHash() = 0;
/**
+ * @brief checks is hashID was changed during suspended state
+ * @return Returns TRUE if hashID was changed during suspended state
+ * otherwise returns FALSE.
+ */
+ virtual bool IsHashChangedDuringSuspend() const = 0;
+
+ /**
+ * @brief changes state of the flag which tracks is hashID was changed during
+ * suspended state or not
+ * @param state new state of the flag
+ */
+ virtual void SetHashChangedDuringSuspend(const bool state) = 0;
+
+ /**
* @brief method is called when SDL is saving application data for resumption
* @return TRUE if data of application need to save for resumption, otherwise
* return FALSE
@@ -426,6 +448,9 @@ class Application : public virtual InitialApplicationData,
virtual bool is_navi() const = 0;
virtual void set_is_navi(bool allow) = 0;
+ virtual void set_mobile_projection_enabled(bool option) = 0;
+ virtual bool mobile_projection_enabled() const = 0;
+
virtual bool video_streaming_approved() const = 0;
virtual void set_video_streaming_approved(bool state) = 0;
virtual bool audio_streaming_approved() const = 0;
@@ -437,6 +462,15 @@ class Application : public virtual InitialApplicationData,
virtual void set_audio_streaming_allowed(bool state) = 0;
/**
+ * @brief Sends SetVideoConfig request to HMI to configure streaming
+ * @param service_type Type of streaming service, should be kMobileNav
+ * @param params parameters of video streaming in key-value format
+ * @return true if SetVideoConfig is sent, false otherwise
+ */
+ virtual bool SetVideoConfig(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params) = 0;
+
+ /**
* @brief Starts streaming service for application
* @param service_type Type of streaming service
*/
@@ -533,13 +567,14 @@ class Application : public virtual InitialApplicationData,
virtual void increment_list_files_in_none_count() = 0;
virtual bool set_app_icon_path(const std::string& file_name) = 0;
virtual void set_app_allowed(const bool allowed) = 0;
- virtual void set_device(connection_handler::DeviceHandle device) = 0;
+ DEPRECATED 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;
+ const protocol_handler::MajorProtocolVersion& protocol_version) = 0;
+ virtual protocol_handler::MajorProtocolVersion protocol_version() const = 0;
virtual void set_is_resuming(bool is_resuming) = 0;
virtual bool is_resuming() const = 0;
@@ -590,6 +625,13 @@ class Application : public virtual InitialApplicationData,
virtual UsageStatistics& usage_report() = 0;
/**
+ * @brief SetInitialState sets initial HMI state for application on
+ * registration
+ * @param state Hmi state value
+ */
+ virtual void SetInitialState(HmiStatePtr state) = 0;
+
+ /**
* @brief SetRegularState set permanent state of application
*
* @param state state to setup
@@ -679,6 +721,16 @@ class Application : public virtual InitialApplicationData,
virtual bool IsAudioApplication() const = 0;
/**
+ * DEPRECATED
+ * @brief GetDeviceId allows to obtain device id which posseses
+ * by this application.
+ * @return device the device id.
+ */
+ std::string GetDeviceId() const {
+ return device_id_;
+ }
+
+ /**
* @brief IsRegistered allows to distinguish if this
* application has been registered.
*
@@ -736,16 +788,6 @@ class Application : public virtual InitialApplicationData,
}
/**
- * @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 {
@@ -772,6 +814,75 @@ class Application : public virtual InitialApplicationData,
*/
virtual uint32_t GetAvailableDiskSpace() = 0;
+ /**
+ * @brief Allows to save mobile's command smart object in order to perform
+ * this command later.
+ * @param mobile_message the message smart_object.
+ */
+ virtual void PushMobileMessage(
+ smart_objects::SmartObjectSPtr mobile_message) = 0;
+
+ /**
+ * @brief Allows to obtain the whole list of pending commands in order to
+ * process them.
+ * @param mobile_message the messages array which is filled by the method.
+ */
+ virtual void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) = 0;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief set_system_context Set system context for application
+ * @param system_context Current context
+ */
+ virtual void set_system_context(
+ const mobile_api::SystemContext::eType& system_context) = 0;
+
+ /**
+ * @brief set_audio_streaming_state Set audio streaming state for application
+ * @param state Current audio streaming state
+ */
+ virtual void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) = 0;
+
+ /**
+ * @brief set_hmi_level Set HMI level for application
+ * @param hmi_level Current HMI level
+ */
+ virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0;
+
+ /**
+ * @brief Return pointer to extension by uid
+ * @param uid uid of extension
+ * @return Pointer to extension, if extension was initialized, otherwise NULL
+ */
+ virtual AppExtensionPtr QueryInterface(AppExtensionUID uid) = 0;
+
+ /**
+ * @brief Add extension to application
+ * @param extension pointer to extension
+ * @return true if success, false if extension already initialized
+ */
+ virtual bool AddExtension(AppExtensionPtr extention) = 0;
+
+ /**
+ * @brief Remove extension from application
+ * @param uid uid of extension
+ * @return true if success, false if extension is not present
+ */
+ virtual bool RemoveExtension(AppExtensionUID uid) = 0;
+
+ /**
+ * @brief Removes all extensions
+ */
+ virtual void RemoveExtensions() = 0;
+
+ /**
+ * @brief Get list of subscriptions to vehicle info notifications
+ * @return list of subscriptions to vehicle info notifications
+ */
+ virtual const VehicleInfoSubscriptions& SubscribesIVI() const = 0;
+#endif // SDL_REMOTE_CONTROL
+
protected:
mutable sync_primitives::Lock hmi_states_lock_;
@@ -786,6 +897,7 @@ class Application : public virtual InitialApplicationData,
typedef utils::SharedPtr<Application> ApplicationSharedPtr;
typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr;
+typedef uint32_t ApplicationId;
} // namespace application_manager
diff --git a/src/components/application_manager/include/application_manager/application_data_impl.h b/src/components/application_manager/include/application_manager/application_data_impl.h
index 465e4e010a..64b5f8780b 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
@@ -316,4 +316,4 @@ inline int32_t DynamicApplicationDataImpl::perform_interaction_mode() const {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_DATA_IMPL_H_
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 8658963aef..50e0a209cf 100644
--- a/src/components/application_manager/include/application_manager/application_impl.h
+++ b/src/components/application_manager/include/application_manager/application_impl.h
@@ -38,6 +38,7 @@
#include <vector>
#include <utility>
#include <list>
+#include <forward_list>
#include <stdint.h>
#include "utils/date_time.h"
@@ -51,6 +52,7 @@
#include "utils/atomic_object.h"
#include "utils/custom_string.h"
#include "utils/timer.h"
+#include "utils/macro.h"
namespace usage_statistics {
@@ -64,13 +66,36 @@ using namespace timer;
namespace mobile_api = mobile_apis;
namespace custom_str = custom_string;
-class ApplicationImpl : public virtual InitialApplicationDataImpl,
+/**
+ * @brief SwitchApplicationParameters updates application internal parameters
+ * on transport switch. Must be used only for switching flow.
+ * @param app Pointer to switched application
+ * @param app_id New application id (connection key)
+ * @param device_id New device id
+ * @param mac_address New device MAC address
+ */
+void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address);
+
+class ApplicationImpl : public virtual Application,
+ public virtual InitialApplicationDataImpl,
public virtual DynamicApplicationDataImpl {
public:
ApplicationImpl(
uint32_t application_id,
const std::string& policy_app_id,
const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
+ const custom_str::CustomString& app_name,
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ ApplicationManager& application_manager);
+
+ DEPRECATED ApplicationImpl(
+ uint32_t application_id,
+ const std::string& policy_app_id,
+ const std::string& mac_address,
const custom_str::CustomString& app_name,
utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager);
@@ -96,6 +121,10 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
}
void set_is_navi(bool allow);
+ void set_mobile_projection_enabled(bool option);
+
+ bool mobile_projection_enabled() const;
+
bool video_streaming_approved() const;
void set_video_streaming_approved(bool state);
bool audio_streaming_approved() const;
@@ -106,6 +135,8 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
bool audio_streaming_allowed() const;
void set_audio_streaming_allowed(bool state);
+ bool SetVideoConfig(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params);
void StartStreaming(protocol_handler::ServiceType service_type);
void StopStreamingForce(protocol_handler::ServiceType service_type);
void StopStreaming(protocol_handler::ServiceType service_type);
@@ -156,9 +187,11 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
void set_device(connection_handler::DeviceHandle device);
virtual uint32_t get_grammar_id() const;
virtual void set_grammar_id(uint32_t value);
+ bool is_audio() const OVERRIDE;
- virtual void set_protocol_version(const ProtocolVersion& protocol_version);
- virtual ProtocolVersion protocol_version() const;
+ virtual void set_protocol_version(
+ const protocol_handler::MajorProtocolVersion& protocol_version);
+ virtual protocol_handler::MajorProtocolVersion protocol_version() const;
virtual void set_is_resuming(bool is_resuming);
virtual bool is_resuming() const;
@@ -183,22 +216,33 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
/**
* @brief ResetDataInNone reset data counters in NONE
*/
- virtual void ResetDataInNone();
+ virtual void ResetDataInNone() OVERRIDE;
virtual DataAccessor<ButtonSubscriptions> SubscribedButtons() const OVERRIDE;
virtual const std::string& curHash() const;
-#ifdef CUSTOMER_PASA
- virtual bool flag_sending_hash_change_after_awake() const;
- virtual void set_flag_sending_hash_change_after_awake(bool flag);
-#endif // CUSTOMER_PASA
- /**
- * @brief Change Hash for current application
- * and send notification to mobile
- * @return updated_hash
- */
+
+ /**
+ * @brief Change Hash for current application
+ * and send notification to mobile
+ * @return updated_hash
+ */
virtual void UpdateHash();
+ /**
+ * @brief checks is hashID was changed during suspended state
+ * @return Returns TRUE if hashID was changed during suspended state
+ * otherwise returns FALSE.
+ */
+ bool IsHashChangedDuringSuspend() const OVERRIDE;
+
+ /**
+ * @brief changes state of the flag which tracks is hashID was changed during
+ * suspended state or not
+ * @param state new state of the flag
+ */
+ void SetHashChangedDuringSuspend(const bool state) OVERRIDE;
+
UsageStatistics& usage_report();
bool AreCommandLimitsExceeded(mobile_apis::FunctionID::eType cmd_id,
@@ -222,6 +266,13 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
virtual bool IsAudioApplication() const;
/**
+ * @brief SetInitialState sets initial HMI state for application on
+ * registration
+ * @param state Hmi state value
+ */
+ void SetInitialState(HmiStatePtr state) FINAL;
+
+ /**
* @brief SetRegularState set permanent state of application
*
* @param state state to setup
@@ -298,6 +349,44 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
*/
uint32_t GetAvailableDiskSpace() OVERRIDE;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Sets current system context
+ * @param system_context new system context
+ */
+ void set_system_context(
+ const mobile_api::SystemContext::eType& system_context) OVERRIDE;
+ /**
+ * @brief Sets current audio streaming state
+ * @param state new audio streaming state
+ */
+ void set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) OVERRIDE;
+ /**
+ * @brief Sets current HMI level
+ * @param hmi_level new HMI level
+ */
+ void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) OVERRIDE;
+
+ /**
+ * @brief Get list of subscriptions to vehicle info notifications
+ * @return list of subscriptions to vehicle info notifications
+ */
+ const VehicleInfoSubscriptions& SubscribesIVI() const OVERRIDE;
+
+ /**
+ * @brief Return pointer to extension by uid
+ * @param uid uid of extension
+ * @return Pointer to extension, if extension was initialized, otherwise NULL
+ */
+ AppExtensionPtr QueryInterface(AppExtensionUID uid) OVERRIDE;
+#endif
+
+ void PushMobileMessage(
+ smart_objects::SmartObjectSPtr mobile_message) OVERRIDE;
+
+ void SwapMobileMessageQueue(MobileMessageQueue& mobile_messages) OVERRIDE;
+
protected:
/**
* @brief Clean up application folder. Persistent files will stay
@@ -327,6 +416,27 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
*/
void OnAudioStreamSuspend();
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Add extension to application
+ * @param extension pointer to extension
+ * @return true if success, false if extension already initialized
+ */
+ bool AddExtension(AppExtensionPtr extention) OVERRIDE;
+
+ /**
+ * @brief Remove extension from application
+ * @param uid uid of extension
+ * @return true if success, false if extension is not present
+ */
+ bool RemoveExtension(AppExtensionUID uid) OVERRIDE;
+
+ /**
+ * @brief Removes all extensions
+ */
+ void RemoveExtensions() OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+
std::string hash_val_;
uint32_t grammar_id_;
@@ -337,6 +447,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
smart_objects::SmartObject* active_message_;
bool is_media_;
bool is_navi_;
+ bool mobile_projection_enabled_;
bool video_streaming_approved_;
bool audio_streaming_approved_;
@@ -357,16 +468,17 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
uint32_t delete_file_in_none_count_;
uint32_t list_files_in_none_count_;
std::string app_icon_path_;
- connection_handler::DeviceHandle device_;
- const std::string mac_address_;
+ std::string mac_address_;
+ connection_handler::DeviceHandle device_id_;
std::string bundle_id_;
AppFilesMap app_files_;
std::set<mobile_apis::ButtonName::eType> subscribed_buttons_;
VehicleInfoSubscriptions subscribed_vehicle_info_;
UsageStatistics usage_report_;
- ProtocolVersion protocol_version_;
+ protocol_handler::MajorProtocolVersion protocol_version_;
bool is_voice_communication_application_;
sync_primitives::atomic_bool is_resuming_;
+ bool is_hash_changed_during_suspend_;
uint32_t video_stream_retry_number_;
uint32_t audio_stream_retry_number_;
@@ -375,6 +487,10 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
Timer video_stream_suspend_timer_;
Timer audio_stream_suspend_timer_;
+#ifdef SDL_REMOTE_CONTROL
+ std::list<AppExtensionPtr> extensions_;
+#endif // SDL_REMOTE_CONTROL
+
/**
* @brief Defines number per time in seconds limits
*/
@@ -398,6 +514,15 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
sync_primitives::Lock button_lock_;
std::string folder_name_;
ApplicationManager& application_manager_;
+
+ sync_primitives::Lock mobile_message_lock_;
+ MobileMessageQueue mobile_message_queue_;
+
+ friend void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address);
+
DISALLOW_COPY_AND_ASSIGN(ApplicationImpl);
};
diff --git a/src/components/application_manager/include/application_manager/application_manager.h b/src/components/application_manager/include/application_manager/application_manager.h
deleted file mode 100644
index e67864b9b1..0000000000
--- a/src/components/application_manager/include/application_manager/application_manager.h
+++ /dev/null
@@ -1,597 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
-
-#include <string>
-#include <vector>
-#include <set>
-#include "vehicle_info_data.h"
-#include "application_manager/application.h"
-#include "application_manager/hmi_capabilities.h"
-#include "application_manager/commands/command.h"
-#include "connection_handler/connection_handler.h"
-#include "utils/data_accessor.h"
-#include "utils/shared_ptr.h"
-#include "telemetry_monitor/telemetry_observable.h"
-#include "application_manager/policies/policy_handler_interface.h"
-#include "application_manager/application_manager_settings.h"
-#include "application_manager/state_controller.h"
-#include "application_manager/hmi_interfaces.h"
-
-namespace resumption {
-class LastState;
-}
-
-namespace app_launch {
-class AppLaunchCtrl;
-} // namespace app_launch
-namespace media_manager {
-class MediaManager;
-}
-
-// Other compomnents class declaration
-namespace hmi_message_handler {
-class HMIMessageHandler;
-}
-namespace protocol_handler {
-class ProtocolHandler;
-}
-namespace connection_handler {
-class ConnectionHandler;
-}
-namespace resumption {
-class ResumeCtrl;
-}
-
-namespace application_manager {
-
-namespace event_engine {
-class EventDispatcher;
-}
-
-class Application;
-class StateControllerImpl;
-struct CommandParametersPermissions;
-typedef std::vector<std::string> RPCParams;
-
-struct ApplicationsAppIdSorter {
- bool operator()(const ApplicationSharedPtr lhs,
- const ApplicationSharedPtr rhs) const {
- return lhs->app_id() < rhs->app_id();
- }
-};
-
-struct ApplicationsPolicyAppIdSorter {
- bool operator()(const ApplicationSharedPtr lhs,
- const ApplicationSharedPtr rhs) {
- if (lhs->policy_app_id() == rhs->policy_app_id()) {
- return lhs->device() < rhs->device();
- }
- return lhs->policy_app_id() < rhs->policy_app_id();
- }
-};
-
-typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplicationSet;
-
-typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter>
- AppsWaitRegistrationSet;
-
-// typedef for Applications list iterator
-typedef ApplicationSet::iterator ApplicationSetIt;
-
-// typedef for Applications list const iterator
-typedef ApplicationSet::const_iterator ApplicationSetConstIt;
-
-class ApplicationManager {
- public:
- virtual ~ApplicationManager() {}
-
- /**
- * Inits application manager
- */
- virtual bool Init(resumption::LastState& last_state,
- media_manager::MediaManager* media_manager) = 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;
-
- virtual DataAccessor<ApplicationSet> applications() const = 0;
-
- virtual ApplicationSharedPtr application(uint32_t app_id) const = 0;
- virtual ApplicationSharedPtr active_application() const = 0;
-
- /**
- * Function used only by HMI request/response/notification base classes
- * to change HMI app id to Mobile app id and vice versa.
- * Don't use it inside Core
- */
- virtual ApplicationSharedPtr application_by_hmi_app(
- uint32_t hmi_app_id) const = 0;
-
- virtual ApplicationSharedPtr application_by_policy_id(
- const std::string& policy_app_id) const = 0;
-
- virtual std::vector<ApplicationSharedPtr> applications_by_button(
- uint32_t button) = 0;
- virtual std::vector<ApplicationSharedPtr> applications_with_navi() = 0;
-
- /**
- * @brief Returns media application with LIMITED HMI Level if exists
- *
- * @return Shared pointer to application if application does not
- * exist returns empty shared pointer.
- */
- virtual ApplicationSharedPtr get_limited_media_application() const = 0;
-
- /**
- * @brief Returns navigation application with LIMITED HMI Level if exists
- *
- * @return Shared pointer to application if application does not
- * exist returns empty shared pointer
- */
- virtual ApplicationSharedPtr get_limited_navi_application() const = 0;
-
- /**
- * @brief Returns voice communication application with
- * LIMITED HMI Level if exists
- *
- * @return Shared pointer to application if application does not
- * exist returns empty shared pointer
- */
- virtual ApplicationSharedPtr get_limited_voice_application() const = 0;
-
- /**
- * @brief Retrieves application id associated with correlation id
- *
- * @param correlation_id Correlation ID of the HMI request
- *
- * @return application id associated with correlation id
- */
- virtual uint32_t application_id(const int32_t correlation_id) = 0;
-
- /**
- * @brief Sets application id correlation id
- *
- * @param correlation_id Correlation ID of the HMI request
- * @param app_id Application ID
- */
- virtual void set_application_id(const int32_t correlation_id,
- const uint32_t app_id) = 0;
-
- /**
- * @brief OnHMILevelChanged the callback that allows SDL to react when
- * application's HMI level has been changed.
- *
- * @param app_id application identifier for which HMILevel has been chaned.
- *
- * @param from previous HMILevel.
- * @param to current HMILevel.
- */
- virtual void OnHMILevelChanged(uint32_t app_id,
- mobile_apis::HMILevel::eType from,
- mobile_apis::HMILevel::eType to) = 0;
-
- /**
- * @brief Sends HMI status notification to mobile
- *
- * @param application_impl application with changed HMI status
- *
- **/
- virtual void SendHMIStatusNotification(
- const utils::SharedPtr<Application> app) = 0;
-
- /**
- * @brief Checks if Application is subscribed for way points
- * @param Application AppID
- * @return true if Application is subscribed for way points
- * otherwise false
- */
- virtual bool IsAppSubscribedForWayPoints(const uint32_t app_id) const = 0;
-
- /**
- * @brief Subscribe Application for way points
- * @param Application AppID
- */
- virtual void SubscribeAppForWayPoints(const uint32_t app_id) = 0;
-
- /**
- * @brief Unsubscribe Application for way points
- * @param Application AppID
- */
- virtual void UnsubscribeAppFromWayPoints(const uint32_t app_id) = 0;
-
- /**
- * @brief Is Any Application is subscribed for way points
- * @return true if some app is subscribed otherwise false
- */
- virtual bool IsAnyAppSubscribedForWayPoints() const = 0;
-
- /**
- * @brief Get subscribed for way points
- * @return reference to set of subscribed apps for way points
- */
- virtual const std::set<int32_t> GetAppsSubscribedForWayPoints() const = 0;
-
- virtual void SendMessageToMobile(const commands::MessageSharedPtr message,
- bool final_message = false) = 0;
-
- virtual void SendMessageToHMI(const commands::MessageSharedPtr message) = 0;
-
- virtual bool ManageHMICommand(const commands::MessageSharedPtr message) = 0;
- virtual bool ManageMobileCommand(const commands::MessageSharedPtr message,
- commands::Command::CommandOrigin origin) = 0;
- virtual mobile_api::HMILevel::eType GetDefaultHmiLevel(
- ApplicationConstSharedPtr application) const = 0;
- /**
- * @brief hmi_capabilities return capabilities of hmi
- * @return capabilities of hmi
- */
- virtual HMICapabilities& hmi_capabilities() = 0;
-
- virtual const HMICapabilities& hmi_capabilities() const = 0;
-
- virtual void ProcessQueryApp(const smart_objects::SmartObject& sm_object,
- const uint32_t connection_key) = 0;
-
- virtual bool is_attenuated_supported() const = 0;
-
- /**
- * @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
- */
- virtual bool IsAppTypeExistsInFullOrLimited(
- ApplicationConstSharedPtr app) const = 0;
-
- /**
- * @brief Sets default HMI level and configure application after its
- * registration
- * @param app Application
- */
- virtual void OnApplicationRegistered(ApplicationSharedPtr app) = 0;
-
- virtual connection_handler::ConnectionHandler& connection_handler() const = 0;
- virtual protocol_handler::ProtocolHandler& protocol_handler() const = 0;
- virtual policy::PolicyHandlerInterface& GetPolicyHandler() = 0;
-
- virtual uint32_t GetNextHMICorrelationID() = 0;
- virtual uint32_t GenerateNewHMIAppID() = 0;
-
- /**
- * @brief Ends opened navi services (audio/video) for application
- * @param app_id Application id
- */
- virtual void EndNaviServices(uint32_t app_id) = 0;
-
- /* @brief Starts audio passthru process
- *
- * @return true on success, false if passthru is already in process
- */
- virtual bool BeginAudioPassThrough() = 0;
-
- /*
- * @brief Finishes already started audio passthru process
- *
- * @return true on success, false if passthru is not active
- */
- virtual bool EndAudioPassThrough() = 0;
-
- virtual void ConnectToDevice(const std::string& device_mac) = 0;
-
- virtual void OnHMIStartedCooperation() = 0;
-
- virtual bool IsHMICooperating() const = 0;
- /**
- * @brief Notifies all components interested in Vehicle Data update
- * i.e. new value of odometer etc and returns list of applications
- * subscribed for event.
- * @param vehicle_info Enum value of type of vehicle data
- * @param new value (for integer values currently) of vehicle data
- */
- virtual std::vector<ApplicationSharedPtr> IviInfoUpdated(
- VehicleDataType vehicle_info, int value) = 0;
-
- virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
- smart_objects::SmartObject>& request_for_registration) = 0;
-
- virtual void SendUpdateAppList() = 0;
-
- virtual void MarkAppsGreyOut(const connection_handler::DeviceHandle handle,
- bool is_greyed_out) = 0;
-
- /**
- * @brief Returns pointer to application-to-be-registered (from QUERY_APP
- * list)
- * @param hmi_id HMI application id
- * @return Pointer to application or uninitialized shared pointer
- */
- virtual ApplicationConstSharedPtr WaitingApplicationByID(
- const uint32_t hmi_id) const = 0;
-
- /**
- * @brief Returns list of applications-to-be-registered (QUERY_APP list)
- * @return Locked list of applications
- */
- virtual DataAccessor<AppsWaitRegistrationSet> AppsWaitingForRegistration()
- const = 0;
-
- virtual bool IsAppsQueriedFrom(
- const connection_handler::DeviceHandle handle) const = 0;
-
- virtual bool IsStopping() const = 0;
-
- virtual void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) = 0;
-
- virtual mobile_apis::Result::eType SaveBinary(
- const std::vector<uint8_t>& binary_data,
- const std::string& file_path,
- const std::string& file_name,
- const int64_t offset) = 0;
- /*
- * @brief Sets SDL access to all mobile apps
- *
- * @param allowed SDL access to all mobile apps
- */
- virtual void SetAllAppsAllowed(const bool allowed) = 0;
-
- /*
- * @brief Sets state for driver distraction
- *
- * @param state New state to be set
- */
- virtual void set_driver_distraction(bool is_distracting) = 0;
-
- /*
- * @brief Starts audio pass thru thread
- *
- * @param session_key Session key of connection for Mobile side
- * @param correlation_id Correlation id for response for Mobile side
- * @param max_duration Max duration of audio recording in milliseconds
- * @param sampling_rate Value for rate(8, 16, 22, 44 kHz)
- * @param bits_per_sample The quality the audio is recorded.
- * @param audio_type Type of audio data
- */
- virtual void 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) = 0;
-
- virtual void StartDevicesDiscovery() = 0;
-
- virtual void StopAudioPassThru(int32_t application_key) = 0;
-
- /**
- * @brief TerminateRequest forces termination of request
- * @param connection_key - application id of request
- * @param corr_id correlation id of request
- * @param function_id function id of request
- */
- virtual void TerminateRequest(const uint32_t connection_key,
- const uint32_t corr_id,
- const int32_t function_id) = 0;
-
- /*
- * @brief Closes application by id
- *
- * @param app_id Application id
- * @param reason reason of unregistering application
- * @param is_resuming describes - is this unregister
- * is normal or need to be resumed\
- * @param is_unexpected_disconnect
- * Indicates if connection was unexpectedly lost(TM layer, HB)
- */
- virtual void UnregisterApplication(const uint32_t& app_id,
- mobile_apis::Result::eType reason,
- bool is_resuming = false,
- bool is_unexpected_disconnect = false) = 0;
-
- /**
- * @ Updates request timeout
- *
- * @param connection_key Connection key of application
- * @param mobile_correlation_id Correlation ID of the mobile request
- * @param new_timeout_value New timeout in milliseconds to be set
- */
- virtual void updateRequestTimeout(uint32_t connection_key,
- uint32_t mobile_correlation_id,
- uint32_t new_timeout_value) = 0;
-
- virtual StateController& state_controller() = 0;
-
- virtual void SetUnregisterAllApplicationsReason(
- mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0;
-
- /*
- * @brief Called on Master_reset or Factory_defaults
- * when User chooses to reset HU.
- * Resets Policy Table if applicable.
- */
- virtual void HeadUnitReset(
- mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0;
-
- /**
- * @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
- */
- virtual bool HMILevelAllowsStreaming(
- uint32_t app_id, protocol_handler::ServiceType service_type) const = 0;
-
- /**
- * @brief Checks, if given RPC is allowed at current HMI level for specific
- * application in policy table
- * @param policy_app_id Application id
- * @param hmi_level Current HMI level of application
- * @param function_id FunctionID of RPC
- * @param params_permissions Permissions for RPC parameters (e.g.
- * SubscribeVehicleData) defined in policy table
- * @return SUCCESS, if allowed, otherwise result code of check
- */
- virtual mobile_apis::Result::eType CheckPolicyPermissions(
- const std::string& policy_app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::FunctionID::eType function_id,
- const RPCParams& rpc_params,
- CommandParametersPermissions* params_permissions = NULL) = 0;
-
- /**
- * @brief IsApplicationForbidden allows to distinguish if application is
- * not allowed to register, because of spamming.
- *
- * @param connection_key the connection key ofthe required application
- *
- * @param policy_app_id application's mobile(policy) identifier.
- *
- * @return true in case application is allowed to register, false otherwise.
- */
- virtual bool IsApplicationForbidden(
- uint32_t connection_key, const std::string& policy_app_id) const = 0;
-
- virtual resumption::ResumeCtrl& resume_controller() = 0;
-
- /**
- * @brief hmi_interfaces getter for hmi_interfaces component, that handle
- * hmi_instrfaces state
- * @return reference to hmi_interfaces component
- */
- virtual HmiInterfaces& hmi_interfaces() = 0;
-
- virtual app_launch::AppLaunchCtrl& app_launch_ctrl() = 0;
-
- /*
- * @brief Converts connection string transport type representation
- * to HMI Common_TransportType
- *
- * @param transport_type String representing connection type
- *
- * @return Corresponding HMI TransporType value
- */
- virtual hmi_apis::Common_TransportType::eType GetDeviceTransportType(
- const std::string& transport_type) = 0;
-
- /**
- * @brief method adds application
- * to tts_global_properties_app_list_
- * @param app_id contains application which will
- * send TTS global properties after timeout
- */
- virtual void AddAppToTTSGlobalPropertiesList(const uint32_t app_id) = 0;
-
- /**
- * Generate grammar ID
- *
- * @return New grammar ID
- */
- virtual uint32_t GenerateGrammarID() = 0;
-
- virtual policy::DeviceConsent GetUserConsentForDevice(
- const std::string& device_id) const = 0;
-
- /**
- * @brief Handle sequence for unauthorized application
- * @param app_id Application id
- */
- virtual void OnAppUnauthorized(const uint32_t& app_id) = 0;
-
- virtual bool ActivateApplication(ApplicationSharedPtr app) = 0;
-
- /**
- * @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
- */
- virtual void OnAppStreaming(uint32_t app_id,
- protocol_handler::ServiceType service_type,
- bool state) = 0;
-
- /**
- * @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
- */
- virtual HmiStatePtr CreateRegularState(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context) const = 0;
-
- virtual void SendAudioPassThroughNotification(
- uint32_t session_key, std::vector<uint8_t>& binary_data) = 0;
-
- /**
- * @brief Checks if application can stream (streaming service is started and
- * streaming is enabled in application)
- * @param app_id Application id
- * @param service_type Service type to check
- * @return True if streaming is allowed, false in other case
- */
- virtual bool CanAppStream(
- uint32_t app_id, protocol_handler::ServiceType service_type) const = 0;
-
- /**
- * @brief ForbidStreaming forbid the stream over the certain application.
- * @param app_id the application's id which should stop streaming.
- */
- virtual void ForbidStreaming(uint32_t app_id) = 0;
-
- virtual const ApplicationManagerSettings& get_settings() const = 0;
-
- virtual event_engine::EventDispatcher& event_dispatcher() = 0;
-};
-
-} // namespace application_manager
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h
index be52046888..78fe938568 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
@@ -48,17 +48,18 @@
#include "application_manager/message_helper.h"
#include "application_manager/request_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/state_controller_impl.h"
#include "application_manager/app_launch/app_launch_data.h"
#include "application_manager/application_manager_settings.h"
#include "application_manager/event_engine/event_dispatcher_impl.h"
#include "application_manager/hmi_interfaces_impl.h"
+#include "application_manager/command_holder.h"
#include "protocol_handler/protocol_observer.h"
#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_observer.h"
#include "hmi_message_handler/hmi_message_sender.h"
+#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/policy_handler_observer.h"
#include "connection_handler/connection_handler.h"
#include "connection_handler/connection_handler_observer.h"
@@ -91,13 +92,9 @@
#include "utils/lock.h"
#include "utils/data_accessor.h"
#include "utils/timer.h"
+#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+struct BsonObject;
namespace threads {
class Thread;
@@ -193,7 +190,6 @@ typedef std::queue<AudioData> RawAudioDataQueue;
typedef threads::MessageLoopThread<RawAudioDataQueue> AudioPassThruQueue;
}
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
-typedef std::vector<std::string> RPCParams;
typedef utils::SharedPtr<timer::Timer> TimerSPtr;
class ApplicationManagerImpl
@@ -250,10 +246,14 @@ class ApplicationManagerImpl
std::vector<ApplicationSharedPtr> applications_by_button(
uint32_t button) OVERRIDE;
std::vector<ApplicationSharedPtr> applications_with_navi() OVERRIDE;
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection()
+ OVERRIDE;
ApplicationSharedPtr get_limited_media_application() const OVERRIDE;
ApplicationSharedPtr get_limited_navi_application() const OVERRIDE;
ApplicationSharedPtr get_limited_voice_application() const OVERRIDE;
+ ApplicationSharedPtr get_limited_mobile_projection_application()
+ const OVERRIDE;
uint32_t application_id(const int32_t correlation_id) OVERRIDE;
void set_application_id(const int32_t correlation_id,
@@ -265,6 +265,40 @@ class ApplicationManagerImpl
void SendHMIStatusNotification(
const utils::SharedPtr<Application> app) OVERRIDE;
+
+#ifdef SDL_REMOTE_CONTROL
+ ApplicationSharedPtr application(
+ const std::string& device_id,
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief ChangeAppsHMILevel the function that will change application's
+ * hmi level.
+ *
+ * @param app_id id of the application whose hmi level should be changed.
+ *
+ * @param level new hmi level for certain application.
+ */
+ void ChangeAppsHMILevel(uint32_t app_id, mobile_apis::HMILevel::eType level);
+
+ void Erase(ApplicationSharedPtr app_to_remove) {
+ DCHECK(app_to_remove);
+ app_to_remove->RemoveExtensions();
+ applications_.erase(app_to_remove);
+ }
+
+ virtual functional_modules::PluginManager& GetPluginManager() OVERRIDE {
+ return plugin_manager_;
+ }
+
+ std::vector<std::string> devices(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ virtual void SendPostMessageToMobile(const MessagePtr& message) OVERRIDE;
+
+ virtual void SendPostMessageToHMI(const MessagePtr& message) OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+
/**
* @brief Checks if application with the same HMI type
* (media, voice communication or navi) exists
@@ -277,6 +311,7 @@ class ApplicationManagerImpl
bool IsAppTypeExistsInFullOrLimited(ApplicationConstSharedPtr app) const;
/**
+ * DEPRECATED
* @brief Checks if Application is subscribed for way points
* @param Application AppID
* @return true if Application is subscribed for way points
@@ -285,18 +320,40 @@ class ApplicationManagerImpl
bool IsAppSubscribedForWayPoints(const uint32_t app_id) const OVERRIDE;
/**
+ * DEPRECATED
* @brief Subscribe Application for way points
* @param Application AppID
*/
void SubscribeAppForWayPoints(const uint32_t app_id) OVERRIDE;
/**
+ * DEPRECATED
* @brief Unsubscribe Application for way points
* @param Application AppID
*/
void UnsubscribeAppFromWayPoints(const uint32_t app_id) OVERRIDE;
/**
+ * @brief Checks if Application is subscribed for way points
+ * @param Application pointer
+ * @return true if Application is subscribed for way points
+ * otherwise false
+ */
+ bool IsAppSubscribedForWayPoints(ApplicationSharedPtr app) const OVERRIDE;
+
+ /**
+ * @brief Subscribe Application for way points
+ * @param Application pointer
+ */
+ void SubscribeAppForWayPoints(ApplicationSharedPtr app) OVERRIDE;
+
+ /**
+ * @brief Unsubscribe Application for way points
+ * @param Application pointer
+ */
+ void UnsubscribeAppFromWayPoints(ApplicationSharedPtr app) OVERRIDE;
+
+ /**
* @brief Is Any Application is subscribed for way points
* @return true if some app is subscribed otherwise false
*/
@@ -315,11 +372,18 @@ class ApplicationManagerImpl
* @param vehicle_info Enum value of type of vehicle data
* @param new value (for integer values currently) of vehicle data
*/
- std::vector<ApplicationSharedPtr> IviInfoUpdated(VehicleDataType vehicle_info,
- int value) OVERRIDE;
+ std::vector<ApplicationSharedPtr> IviInfoUpdated(
+ mobile_apis::VehicleDataType::eType vehicle_info, int value) OVERRIDE;
void OnApplicationRegistered(ApplicationSharedPtr app) OVERRIDE;
+ /**
+ * @brief OnApplicationSwitched starts processing of commands collected
+ * during device switching process
+ * @param app Application
+ */
+ void OnApplicationSwitched(ApplicationSharedPtr app) OVERRIDE;
+
HMICapabilities& hmi_capabilities() OVERRIDE;
const HMICapabilities& hmi_capabilities() const OVERRIDE;
@@ -389,8 +453,9 @@ class ApplicationManagerImpl
*/
void UnregisterAllApplications();
- bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
- bool LoadAppDataToHMI(ApplicationSharedPtr app);
+ DEPRECATED bool RemoveAppDataFromHMI(ApplicationSharedPtr app);
+
+ DEPRECATED bool LoadAppDataToHMI(ApplicationSharedPtr app);
bool ActivateApplication(ApplicationSharedPtr app) OVERRIDE;
/**
@@ -430,16 +495,19 @@ class ApplicationManagerImpl
*
* @return Current state of the distraction state
*/
- inline bool driver_distraction() const;
+ hmi_apis::Common_DriverDistractionState::eType driver_distraction_state()
+ const;
/*
* @brief Sets state for driver distraction
*
* @param state New state to be set
*/
- void set_driver_distraction(const bool is_distracting) OVERRIDE;
+ void set_driver_distraction_state(
+ const hmi_apis::Common_DriverDistractionState::eType state) OVERRIDE;
/*
+ * DEPRECATED
* @brief Retrieves if VR session has started
*
* @return Current VR session state (started, stopped)
@@ -447,6 +515,7 @@ class ApplicationManagerImpl
inline bool vr_session_started() const;
/*
+ * DEPRECATED
* @brief Sets VR session state
*
* @param state Current HMI VR session state
@@ -469,13 +538,28 @@ class ApplicationManagerImpl
/**
* @brief CreateRegularState create regular HMI state for application
- * @param app_id
+ * @param app Application
* @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(
+ utils::SharedPtr<Application> app,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::SystemContext::eType system_context) const OVERRIDE;
+
+ /**
+ * DEPRECATED
+ * @brief CreateRegularState create regular HMI state for application
+ * @param app_id Application id
+ * @param hmi_level of returned state
+ * @param audio_state of returned state
+ * @param system_context of returned state
+ * @return new regular HMI state
+ */
+ DEPRECATED HmiStatePtr CreateRegularState(
uint32_t app_id,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
@@ -515,6 +599,67 @@ class ApplicationManagerImpl
}
/**
+ * @brief Checks, if given RPC is allowed at current HMI level for specific
+ * application in policy table
+ * @param app Application
+ * @param hmi_level Current HMI level of application
+ * @param function_id FunctionID of RPC
+ * @param params_permissions Permissions for RPC parameters (e.g.
+ * SubscribeVehicleData) defined in policy table
+ * @return SUCCESS, if allowed, otherwise result code of check
+ */
+ mobile_apis::Result::eType CheckPolicyPermissions(
+ const ApplicationSharedPtr app,
+ const std::string& function_id,
+ const RPCParams& rpc_params,
+ CommandParametersPermissions* params_permissions = NULL) OVERRIDE;
+
+ /**
+ * @brief IsApplicationForbidden allows to distinguish if application is
+ * not allowed to register, becuase of spaming.
+ *
+ * @param connection_key the conection key ofthe required application
+ *
+ * @param mobile_app_id application's mobile(policy) identifier.
+ *
+ * @return true in case application is allowed to register, false otherwise.
+ */
+ bool IsApplicationForbidden(uint32_t connection_key,
+ const std::string& mobile_app_id);
+
+ 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->policy_app_id() == rhs->policy_app_id()) {
+ return lhs->device() < rhs->device();
+ }
+ return lhs->policy_app_id() < rhs->policy_app_id();
+ }
+ };
+
+ // typedef for Applications list
+ typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplictionSet;
+
+ typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter>
+ AppsWaitRegistrationSet;
+
+ // typedef for Applications list iterator
+ typedef ApplictionSet::iterator ApplictionSetIt;
+
+ // typedef for Applications list const iterator
+ typedef ApplictionSet::const_iterator ApplictionSetConstIt;
+
+ DataAccessor<AppsWaitRegistrationSet> apps_waiting_for_registration() const;
+ ApplicationConstSharedPtr waiting_app(const uint32_t hmi_id) const;
+
+ /**
* @brief SetState Change regular audio state
* @param app appication to setup regular State
* @param audio_state of new regular state
@@ -640,6 +785,12 @@ class ApplicationManagerImpl
void OnUpdateHMIAppType(
std::map<std::string, std::vector<std::string> > app_hmi_types) OVERRIDE;
+ /**
+ * @brief OnPTUFinished is called on policy table update coming
+ * @param ptu_result True if PTU is succeeded, otherwise - false
+ */
+ void OnPTUFinished(const bool ptu_result) FINAL;
+
/*
* @brief Starts audio pass thru thread
*
@@ -703,6 +854,9 @@ class ApplicationManagerImpl
void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE;
+ void RemoveHMIFakeParameters(
+ application_manager::MessagePtr& message) OVERRIDE;
+
bool ManageMobileCommand(const commands::MessageSharedPtr message,
commands::Command::CommandOrigin origin) OVERRIDE;
bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE;
@@ -734,25 +888,78 @@ class ApplicationManagerImpl
void OnFindNewApplicationsRequest() OVERRIDE;
void RemoveDevice(
const connection_handler::DeviceHandle& device_handle) OVERRIDE;
- bool OnServiceStartedCallback(
+
+ /**
+ * @brief OnDeviceSwitchingStart is invoked on device transport switching
+ * start (e.g. from Bluetooth to USB) and creates waiting list of applications
+ * expected to be re-registered after switching is complete
+ * @param device_from device params being switched to the new transport
+ * @param device_to device params on the new transport
+ */
+ void OnDeviceSwitchingStart(
+ const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to) FINAL;
+
+ /**
+ * @brief OnDeviceSwitchingFinish is invoked on device trasport switching end
+ * i.e. timeout for switching is expired, unregisters applications from
+ * waiting list which haven't been re-registered and clears the waiting list
+ * @param device_uid UID of device being switched
+ */
+ void OnDeviceSwitchingFinish(const std::string& device_uid) FINAL;
+
+ DEPRECATED bool OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
const protocol_handler::ServiceType& type) OVERRIDE;
+ void OnServiceStartedCallback(
+ const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params) OVERRIDE;
void OnServiceEndedCallback(
const int32_t& session_key,
const protocol_handler::ServiceType& type,
const connection_handler::CloseSessionReason& close_reason) OVERRIDE;
#ifdef ENABLE_SECURITY
- // Overriden SecurityManagerListener method
+ /**
+ * @brief Notification about protection result
+ * @param connection_key Unique key of session which triggers handshake
+ * @param result result of connection protection
+ * @return true on success notification handling or false otherwise
+ */
bool OnHandshakeDone(
uint32_t connection_key,
- security_manager::SSLContext::HandshakeResult result) OVERRIDE FINAL;
+ security_manager::SSLContext::HandshakeResult result) OVERRIDE;
- void OnCertificateUpdateRequired() OVERRIDE FINAL;
+ /**
+ * @brief Notification that certificate update is required.
+ */
+ void OnCertificateUpdateRequired() OVERRIDE;
+
+ /**
+ * @brief Get certificate data from policy
+ * @param reference to string where to save certificate data
+ * @return true if listener saved some data to string otherwise false
+ */
+ bool GetPolicyCertificateData(std::string& data) const OVERRIDE;
+ /**
+ * @brief Get unique handshake context by application id
+ * @param key id of application
+ * @return generated handshake context or empty context if application with
+ * provided id does not exist
+ */
security_manager::SSLContext::HandshakeContext GetHandshakeContext(
- uint32_t key) const OVERRIDE FINAL;
+ uint32_t key) const OVERRIDE;
+
+ /**
+ * @brief Check if application with specified app_id has NAVIGATION HMI type
+ * @param app_id id of application to check
+ * @return true if application is navi otherwise returns false
+ */
+ bool CheckAppIsNavi(const uint32_t app_id) const OVERRIDE;
#endif // ENABLE_SECURITY
/**
@@ -828,6 +1035,20 @@ class ApplicationManagerImpl
void ForbidStreaming(uint32_t app_id) OVERRIDE;
/**
+ * @brief Called when application completes streaming configuration
+ * @param app_id Streaming application id
+ * @param service_type Streaming service type
+ * @param result true if configuration is successful, false otherwise
+ * @param rejected_params list of rejected parameters' name. Valid
+ * only when result is false.
+ */
+ void OnStreamingConfigured(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params) OVERRIDE;
+
+ /**
* @brief Callback calls when application starts/stops data streaming
* @param app_id Streaming application id
* @param service_type Streaming service type
@@ -867,15 +1088,15 @@ class ApplicationManagerImpl
uint32_t GenerateNewHMIAppID() OVERRIDE;
/**
+ * DERPECATED
* @brief Parse smartObject and replace mobile app Id by HMI app ID
- *
* @param message Smartobject to be parsed
*/
void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
/**
+ * DEPRECATED
* @brief Parse smartObject and replace HMI app ID by mobile app Id
- *
* @param message Smartobject to be parsed
*/
void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
@@ -932,6 +1153,7 @@ class ApplicationManagerImpl
void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) OVERRIDE;
/**
+ * DEPRECATED
* @brief method adds application in FULL and LIMITED state
* to on_phone_call_app_list_.
* Also OnHMIStateNotification with BACKGROUND state sent for these apps
@@ -939,6 +1161,7 @@ class ApplicationManagerImpl
void CreatePhoneCallAppList();
/**
+ * DEPRECATED
* @brief method removes application from on_phone_call_app_list_.
*
* Also OnHMIStateNotification with previous HMI state sent for these apps
@@ -950,24 +1173,14 @@ class ApplicationManagerImpl
protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE;
virtual policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE {
- return policy_handler_;
+ return *policy_handler_;
}
- /**
- * @brief Checks, if given RPC is allowed at current HMI level for specific
- * application in policy table
- * @param policy_app_id Application id
- * @param hmi_level Current HMI level of application
- * @param function_id FunctionID of RPC
- * @param params_permissions Permissions for RPC parameters (e.g.
- * SubscribeVehicleData) defined in policy table
- * @return SUCCESS, if allowed, otherwise result code of check
- */
- mobile_apis::Result::eType CheckPolicyPermissions(
- const std::string& policy_app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::FunctionID::eType function_id,
- const RPCParams& rpc_params,
- CommandParametersPermissions* params_permissions = NULL) OVERRIDE;
+
+ virtual const policy::PolicyHandlerInterface& GetPolicyHandler()
+ const OVERRIDE {
+ return *policy_handler_;
+ }
+
/*
* @brief Function Should be called when Low Voltage is occured
*/
@@ -994,13 +1207,6 @@ class ApplicationManagerImpl
policy::DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
- struct ApplicationsAppIdSorter {
- bool operator()(const ApplicationSharedPtr lhs,
- const ApplicationSharedPtr rhs) {
- return lhs->app_id() < rhs->app_id();
- }
- };
-
// typedef for Applications list
typedef std::set<std::string> ForbiddenApps;
@@ -1045,7 +1251,10 @@ class ApplicationManagerImpl
bool operator()(const ApplicationSharedPtr app) const {
return app
? handle_ == app->device() &&
- ProtocolVersion::kV4 == app->protocol_version()
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::
+ PROTOCOL_VERSION_4,
+ app->protocol_version())
: false;
}
};
@@ -1059,15 +1268,6 @@ class ApplicationManagerImpl
}
};
- 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;
- }
- };
-
struct GrammarIdPredicate {
uint32_t grammar_id_;
GrammarIdPredicate(uint32_t grammar_id) : grammar_id_(grammar_id) {}
@@ -1104,10 +1304,36 @@ class ApplicationManagerImpl
bool IsAppsQueriedFrom(
const connection_handler::DeviceHandle handle) const OVERRIDE;
+ /**
+ * @brief IsAppInReconnectMode check if application belongs to session
+ * affected by transport switching at the moment by checking internal
+ * waiting list prepared on switching start
+ * @param policy_app_id Application id
+ * @return True if application is in the waiting list, otherwise - false
+ */
+ bool IsAppInReconnectMode(const std::string& policy_app_id) const FINAL;
+
bool IsStopping() const OVERRIDE {
return is_stopping_;
}
+ /**
+ * @brief ProcessReconnection handles reconnection flow for application on
+ * transport switch
+ * @param application Pointer to switched application, must be validated
+ * before passing
+ * @param connection_key Connection key from registration request of
+ * switched
+ * application
+ */
+ void ProcessReconnection(ApplicationSharedPtr application,
+ const uint32_t connection_key) FINAL;
+
+ /**
+ * @brief Clears all applications' persistent data
+ */
+ void ClearAppsPersistentData();
+
StateController& state_controller() OVERRIDE;
const ApplicationManagerSettings& get_settings() const OVERRIDE;
virtual event_engine::EventDispatcher& event_dispatcher() OVERRIDE;
@@ -1150,6 +1376,10 @@ class ApplicationManagerImpl
smart_objects::SmartObject& output);
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
Message& output);
+
+ MessageValidationResult ValidateMessageBySchema(
+ const Message& message) OVERRIDE;
+
utils::SharedPtr<Message> ConvertRawMsgToMessage(
const ::protocol_handler::RawMessagePtr message);
@@ -1235,6 +1465,32 @@ class ApplicationManagerImpl
*/
bool IsLowVoltage();
+ /**
+ * @brief Allows to process postponed commands for application
+ * when its HMI level has been changed.
+ * @param app_id the application id for processing.
+ * @param from the old HMILevel.
+ * @param to the new HMILevel for the certain app.
+ */
+ void ProcessPostponedMessages(const uint32_t app_id);
+
+ /**
+ * @brief Allows to process applications after HMILevel has been changed.
+ * @param app_id the application id for processing.
+ * @param from the old HMILevel.
+ * @param to the new HMILevel for the certain app.
+ */
+ void ProcessApp(const uint32_t app_id,
+ const mobile_apis::HMILevel::eType from,
+ const mobile_apis::HMILevel::eType to);
+
+ /**
+ * @brief Allows to send appropriate message to mobile device.
+ * @param message The smart object which contains all neccesary info to send
+ * notification.
+ */
+ void SendMobileMessage(smart_objects::SmartObjectSPtr message);
+
private:
/*
* NaviServiceStatusMap shows which navi service (audio/video) is opened
@@ -1283,8 +1539,20 @@ class ApplicationManagerImpl
* @param service_type Type of service to start
* @return True on success, false on fail
*/
+ DEPRECATED bool StartNaviService(uint32_t app_id,
+ protocol_handler::ServiceType service_type);
+
+ /**
+ * @brief Starts specified navi service for application
+ * @param app_id Application to proceed
+ * @param service_type Type of service to start
+ * @param params configuration parameters specified by mobile
+ * @return True if service is immediately started or configuration
+ * parameters are sent to HMI, false on other cases
+ */
bool StartNaviService(uint32_t app_id,
- protocol_handler::ServiceType service_type);
+ protocol_handler::ServiceType service_type,
+ const BsonObject* params);
/**
* @brief Stops specified navi service for application
@@ -1312,7 +1580,15 @@ class ApplicationManagerImpl
* @brief Function returns supported SDL Protocol Version
* @return protocol version depends on parameters from smartDeviceLink.ini.
*/
- ProtocolVersion SupportedSDLVersion() const;
+ protocol_handler::MajorProtocolVersion SupportedSDLVersion() const;
+
+ /**
+ * @brief Checks if driver distraction state is valid, creates message
+ * and puts it to postponed message.
+ * @param application contains registered application.
+ */
+ void PutDriverDistractionMessageToPostponed(
+ ApplicationSharedPtr application) const;
/**
* @brief Types of directories used by Application Manager
@@ -1355,6 +1631,46 @@ class ApplicationManagerImpl
void ClearTTSGlobalPropertiesList();
+ /**
+ * @brief EraseAppFromReconnectionList drops application from reconnection
+ * list on transport switch success
+ * @param app Pointer to application
+ */
+ void EraseAppFromReconnectionList(const ApplicationSharedPtr& app);
+
+ /**
+ * @brief SwitchApplication updates parameters of switched application and
+ * internal applications list
+ * @param app Pointer to switched application, must be validated before
+ * passing in
+ * @param connection_key Connection key of switched application from its
+ * registration request
+ * @param device_id Device id of switched application
+ * @param mac_address New device mac address
+ */
+ void SwitchApplication(ApplicationSharedPtr app,
+ const uint32_t connection_key,
+ const size_t device_id,
+ const std::string& mac_address);
+
+ /**
+ * @brief Converts BSON object containing video parameters to
+ * smart object's map object
+ * @param output the smart object to add video parameters
+ * @param input BSON object to read parameters from
+ */
+ static void ConvertVideoParamsToSO(smart_objects::SmartObject& output,
+ const BsonObject* input);
+
+ /**
+ * @brief Converts rejected parameters' names acquired from HMI to
+ * SDL protocol's parameter names
+ * @param list of rejected parameters' names
+ * @return converted parameters' names
+ */
+ static std::vector<std::string> ConvertRejectedParamList(
+ const std::vector<std::string>& input);
+
private:
const ApplicationManagerSettings& settings_;
/**
@@ -1388,7 +1704,7 @@ class ApplicationManagerImpl
bool audio_pass_thru_active_;
sync_primitives::Lock audio_pass_thru_lock_;
sync_primitives::Lock tts_global_properties_app_list_lock_;
- bool is_distracting_driver_;
+ hmi_apis::Common_DriverDistractionState::eType driver_distraction_state_;
bool is_vr_session_strated_;
bool hmi_cooperating_;
bool is_all_apps_allowed_;
@@ -1398,10 +1714,32 @@ class ApplicationManagerImpl
hmi_message_handler::HMIMessageHandler* hmi_handler_;
connection_handler::ConnectionHandler* connection_handler_;
- policy::PolicyHandler policy_handler_;
+ std::auto_ptr<policy::PolicyHandlerInterface> policy_handler_;
protocol_handler::ProtocolHandler* protocol_handler_;
request_controller::RequestController request_ctrl_;
+#ifdef SDL_REMOTE_CONTROL
+ functional_modules::PluginManager plugin_manager_;
+
+ /**
+ * @brief Map contains apps with HMI state before incoming call
+ * After incoming call ends previous HMI state must restore
+ *
+ */
+ 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;
+ };
+#endif // SDL_REMOTE_CONTROL
+
hmi_apis::HMI_API* hmi_so_factory_;
mobile_apis::MOBILE_API* mobile_so_factory_;
@@ -1435,6 +1773,7 @@ class ApplicationManagerImpl
HmiInterfacesImpl hmi_interfaces_;
NaviServiceStatusMap navi_service_status_;
+ sync_primitives::Lock navi_service_status_lock_;
std::deque<uint32_t> navi_app_to_stop_;
std::deque<uint32_t> navi_app_to_end_stream_;
uint32_t navi_close_app_timeout_;
@@ -1447,6 +1786,15 @@ class ApplicationManagerImpl
std::auto_ptr<app_launch::AppLaunchData> app_launch_dto_;
std::auto_ptr<app_launch::AppLaunchCtrl> app_launch_ctrl_;
+ /**
+ * @brief ReregisterWaitList is list of applications expected to be
+ * re-registered after transport switching is complete
+ */
+ typedef std::vector<ApplicationSharedPtr> ReregisterWaitList;
+ ReregisterWaitList reregister_wait_list_;
+
+ mutable sync_primitives::Lock reregister_wait_list_lock_;
+
#ifdef TELEMETRY_MONITOR
AMTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
@@ -1457,19 +1805,31 @@ class ApplicationManagerImpl
bool is_low_voltage_;
+ uint32_t apps_size_;
+
volatile bool is_stopping_;
+ std::unique_ptr<CommandHolder> commands_holder_;
+
+#ifdef BUILD_TESTS
+ public:
+ /**
+ * @brief register a mock application without going through the formal
+ * registration process. Only for unit testing.
+ * @param mock_app the mock app to be registered
+ */
+ void AddMockApplication(ApplicationSharedPtr mock_app);
+
+ private:
+#endif
+
DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl);
};
-bool ApplicationManagerImpl::vr_session_started() const {
+DEPRECATED bool ApplicationManagerImpl::vr_session_started() const {
return is_vr_session_strated_;
}
-bool ApplicationManagerImpl::driver_distraction() const {
- return is_distracting_driver_;
-}
-
inline bool ApplicationManagerImpl::all_apps_allowed() const {
return is_all_apps_allowed_;
}
diff --git a/src/components/application_manager/include/application_manager/command_holder.h b/src/components/application_manager/include/application_manager/command_holder.h
new file mode 100644
index 0000000000..d3171aedbb
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/command_holder.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_H_
+
+#include <string>
+#include "application_manager/application.h"
+#include "smart_objects/smart_object.h"
+#include "utils/shared_ptr.h"
+
+namespace application_manager {
+/**
+ * @brief The CommandHolder class should hold commands for particular
+ * application until certain event happens
+ */
+class CommandHolder {
+ public:
+ /**
+ * @brief The CommandType enum defines type of command to suspend or resume
+ */
+ enum class CommandType { kHmiCommand, kMobileCommand };
+
+ /**
+ * @brief ~CommandsHolder destructor
+ */
+ virtual ~CommandHolder() {}
+
+ /**
+ * @brief Suspend collects command for specific application policy id
+ * internally
+ * @param application Application pointer
+ * @param type Command type
+ * @param command Command
+ */
+ virtual void Suspend(ApplicationSharedPtr application,
+ CommandType type,
+ smart_objects::SmartObjectSPtr command) = 0;
+
+ /**
+ * @brief Resume send all collected commands for further processing and
+ * removes them afterward
+ * @param application Application pointer
+ * @param type Command type
+ */
+ virtual void Resume(ApplicationSharedPtr application, CommandType type) = 0;
+
+ /**
+ * @brief Clear removes all collected commands w/o processing
+ * @param application Application pointer
+ */
+ virtual void Clear(ApplicationSharedPtr application) = 0;
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_H_
diff --git a/src/components/application_manager/include/application_manager/command_holder_impl.h b/src/components/application_manager/include/application_manager/command_holder_impl.h
new file mode 100644
index 0000000000..ed5f6baa62
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/command_holder_impl.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_IMPL_H_
+
+#include "application_manager/command_holder.h"
+
+#include <string>
+#include <vector>
+#include <map>
+#include "application_manager/application.h"
+#include "smart_objects/smart_object.h"
+#include "utils/lock.h"
+#include "utils/shared_ptr.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+class ApplicationManager;
+/**
+ * @brief The CommandHolderImpl class should hold commands for particular
+ * application during application transport switching process and sends for
+ * processing after switching is completed successfully or drops otherwise
+ */
+class CommandHolderImpl : public CommandHolder {
+ public:
+ /**
+ * @brief CommandHolderImpl constructor
+ */
+
+ explicit CommandHolderImpl(ApplicationManager& app_manager);
+
+ /**
+ * @brief Suspend collects command for specific application id internally
+ * @param application Application pointer
+ * @param type Command type
+ * @param command Command
+ */
+ void Suspend(ApplicationSharedPtr application,
+ CommandType type,
+ smart_objects::SmartObjectSPtr command) FINAL;
+
+ /**
+ * @brief Resume sends all collected HMI commands to ApplicationManager
+ * for further processing
+ * @param application Application pointer
+ * @param type Command type
+ */
+ void Resume(ApplicationSharedPtr application, CommandType type) FINAL;
+
+ /**
+ * @brief Clear removes all commands collected for specific application id
+ * @param application Application pointer
+ */
+ void Clear(ApplicationSharedPtr application) FINAL;
+
+ private:
+ /**
+ * @brief ResumeHmiCommand sends suspended HMI commands for processing
+ * @param application Application which commands to process
+ */
+ void ResumeHmiCommand(ApplicationSharedPtr app);
+
+ /**
+ * @brief ResumeMobileCommand sends suspended mobile commands for processing
+ * @param application Application which commands to process
+ */
+ void ResumeMobileCommand(ApplicationSharedPtr application);
+
+ using AppCommands =
+ std::map<ApplicationSharedPtr,
+ std::vector<utils::SharedPtr<smart_objects::SmartObject> > >;
+
+ ApplicationManager& app_manager_;
+ sync_primitives::Lock commands_lock_;
+ AppCommands app_mobile_commands_;
+ AppCommands app_hmi_commands_;
+};
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMAND_HOLDER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h
index fb2bc6d78f..cc090defa0 100644
--- a/src/components/application_manager/include/application_manager/commands/command.h
+++ b/src/components/application_manager/include/application_manager/commands/command.h
@@ -37,7 +37,6 @@
#include "utils/shared_ptr.h"
namespace application_manager {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
namespace commands {
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 439b1756ef..5fee7500ce 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
@@ -46,9 +46,9 @@ namespace application_manager {
* table
*/
struct CommandParametersPermissions {
- std::vector<std::string> allowed_params;
- std::vector<std::string> disallowed_params;
- std::vector<std::string> undefined_params;
+ RPCParams allowed_params;
+ RPCParams disallowed_params;
+ RPCParams undefined_params;
};
namespace commands {
@@ -142,16 +142,30 @@ class CommandImpl : public Command {
protected:
/**
- * @brief Parse smartObject and replace mobile app Id by HMI app ID
- *
- * @param message Smartobject to be parsed
+ * @brief Parses mobile message and replaces mobile app id with HMI app id
+ * @param message Message to replace its ids
+ * @return True if replacement succeeded, otherwise - false
+ */
+ bool ReplaceMobileWithHMIAppId(smart_objects::SmartObject& message);
+
+ /**
+ * DEPRECATED
+ * @brief Parses mobile message and replaces mobile app id with HMI app id
+ * @param message Message to replace its ids
*/
void ReplaceMobileByHMIAppId(smart_objects::SmartObject& message);
/**
- * @brief Parse smartObject and replace HMI app ID by mobile app Id
- *
- * @param message Smartobject to be parsed
+ * @brief Parses message from HMI and replaces HMI app id with mobile app id
+ * @param message Message to replace its ids
+ * @return True if replacement succeeded, otherwise - false
+ */
+ bool ReplaceHMIWithMobileAppId(smart_objects::SmartObject& message);
+
+ /**
+ * DEPRECATED
+ * @brief Parses message from HMI and replaces HMI app id with mobile app id
+ * @param message Message to replace its ids
*/
void ReplaceHMIByMobileAppId(smart_objects::SmartObject& message);
diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
index 2f3b809274..e8a0399c9d 100644
--- a/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_from_mobile_impl.h
@@ -34,12 +34,7 @@
#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;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
index 25a2a18aca..dabbe4fe31 100644
--- a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h
@@ -34,12 +34,7 @@
#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;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
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 5b86bfa851..74a884a223 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
@@ -37,38 +37,24 @@
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
#include "utils/lock.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
namespace commands {
struct ResponseInfo {
- ResponseInfo()
- : result_code(hmi_apis::Common_Result::INVALID_ENUM)
- , interface(HmiInterfaces::HMI_INTERFACE_INVALID_ENUM)
- , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
- , is_ok(false)
- , is_unsupported_resource(false)
- , is_invalid_enum(false) {}
- ResponseInfo(hmi_apis::Common_Result::eType result,
- HmiInterfaces::InterfaceID interface)
- : result_code(result)
- , interface(interface)
- , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
- , is_ok(false)
- , is_unsupported_resource(false)
- , is_invalid_enum(false) {}
+ DEPRECATED ResponseInfo(hmi_apis::Common_Result::eType result,
+ HmiInterfaces::InterfaceID interface);
+ ResponseInfo();
+ ResponseInfo(const hmi_apis::Common_Result::eType result,
+ const HmiInterfaces::InterfaceID hmi_interface,
+ ApplicationManager& application_manager);
hmi_apis::Common_Result::eType result_code;
HmiInterfaces::InterfaceID interface;
HmiInterfaces::InterfaceState interface_state;
bool is_ok;
bool is_unsupported_resource;
- bool is_invalid_enum;
+ bool is_not_used;
};
namespace NsSmart = NsSmartDeviceLink::NsSmartObjects;
@@ -117,13 +103,36 @@ class CommandRequestImpl : public CommandImpl,
public:
enum RequestState { kAwaitingHMIResponse = 0, kTimedOut, kCompleted };
+ /**
+ * @brief The HashUpdateMode enum defines whether request has to update
+ * hash after its execution is finished
+ */
+ enum HashUpdateMode { kSkipHashUpdate, kDoHashUpdate };
+
CommandRequestImpl(const MessageSharedPtr& message,
ApplicationManager& application_manager);
- virtual ~CommandRequestImpl();
- virtual bool CheckPermissions();
- virtual bool Init();
- virtual bool CleanUp();
- virtual void Run();
+
+ ~CommandRequestImpl();
+
+ /**
+ * @brief Checks command permissions according to policy table
+ */
+ bool CheckPermissions() OVERRIDE;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() OVERRIDE;
+
+ /**
+ * @brief Cleanup all resources used by command
+ **/
+ bool CleanUp() OVERRIDE;
+
+ /**
+ * @brief Execute corresponding command by calling the action on reciever
+ **/
+ void Run() OVERRIDE;
/*
* @brief Function is called by RequestController when request execution time
@@ -198,6 +207,14 @@ class CommandRequestImpl : public CommandImpl,
bool CheckAllowedParameters();
/**
+ * @brief Checks HMI capabilities for specified button support
+ * @param button Button to check
+ * @return true if button is present in HMI capabilities
+ * otherwise returns false
+ */
+ bool CheckHMICapabilities(const mobile_apis::ButtonName::eType button) const;
+
+ /**
* @brief Remove from current message parameters disallowed by policy table
*/
void RemoveDisallowedParameters();
@@ -264,6 +281,19 @@ class CommandRequestImpl : public CommandImpl,
mobile_apis::Result::eType PrepareResultCodeForResponse(
const ResponseInfo& first, const ResponseInfo& second);
+ /**
+ * @brief Resolves if the return code must be
+ * UNSUPPORTED_RESOURCE
+ * @param first contains result_code from HMI response and
+ * interface that returns response
+ * @param second contains result_code from HMI response and
+ * interface that returns response.
+ * @return True, if the communication return code must be
+ * UNSUPPORTED_RESOURCE, otherwise false.
+ */
+ bool IsResultCodeUnsupported(const ResponseInfo& first,
+ const ResponseInfo& second) const;
+
protected:
/**
* @brief Returns policy parameters permissions
@@ -271,11 +301,46 @@ class CommandRequestImpl : public CommandImpl,
*/
const CommandParametersPermissions& parameters_permissions() const;
+ /**
+ * @brief Adds interface to be awaited for by sdl request command
+ @param interface_id interface which SDL expects to response in given time
+ */
+ void StartAwaitForInterface(const HmiInterfaces::InterfaceID interface_id);
+
+ /**
+ * @brief Gets interface await state.
+ * @param interface_id interface which SDL awaits for response in given time
+ * @return true if SDL awaits for response from given interface in
+ * interface_id
+ */
+ bool IsInterfaceAwaited(const HmiInterfaces::InterfaceID& interface_id) const;
+
+ /**
+ * @brief Sets given HMI interface await status to false
+ * @param interface_id interface which SDL no longer awaits for response in
+ * given time
+ */
+ void EndAwaitForInterface(const HmiInterfaces::InterfaceID& interface_id);
+
+ /**
+ * @brief This set stores all the interfaces which are awaited by SDL to
+ * return a response on some request
+ */
+ std::set<HmiInterfaces::InterfaceID> awaiting_response_interfaces_;
+
+ mutable sync_primitives::Lock awaiting_response_interfaces_lock_;
+
RequestState current_state_;
sync_primitives::Lock state_lock_;
CommandParametersPermissions parameters_permissions_;
CommandParametersPermissions removed_parameters_permissions_;
+ /**
+ * @brief hash_update_mode_ Defines whether request must update hash value of
+ * application or not
+ */
+ HashUpdateMode hash_update_mode_;
+
private:
DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl);
@@ -297,6 +362,26 @@ class CommandRequestImpl : public CommandImpl,
bool ProcessHMIInterfacesAvailability(
const uint32_t hmi_correlation_id,
const hmi_apis::FunctionID::eType& function_id);
+
+ /**
+ * @brief UpdateHash updates hash field for application and sends
+ * OnHashChanged notification to mobile side in case of approriate hash mode
+ * is set
+ */
+ void UpdateHash();
+
+ /**
+ * @brief is_success_result_ Defines whether request succeded, at the moment
+ * it is value of 'success' field of appropriate response sent to mobile
+ */
+ bool is_success_result_;
+
+ /**
+ * @brief Add information for the component of response in case of timeout
+ * @param response Response message, which info should be extended
+ */
+ void AddTimeOutComponentInfoToMessage(
+ smart_objects::SmartObject& response) const;
};
} // namespace commands
diff --git a/src/components/application_manager/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
index 2b52ea5a58..44c58a8102 100644
--- a/src/components/application_manager/include/application_manager/commands/command_response_impl.h
+++ b/src/components/application_manager/include/application_manager/commands/command_response_impl.h
@@ -35,12 +35,7 @@
#include "application_manager/commands/command_impl.h"
#include "interfaces/MOBILE_API.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
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 090a77b9ed..fd4cc12468 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
@@ -70,4 +70,4 @@ class ActivateAppRequest : public RequestToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h
index 471de1135e..1470bf8651 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
@@ -70,4 +70,4 @@ class ActivateAppResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
index f789a14780..daa71e68b5 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_on_awake_sdl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,3 +29,45 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
+
+#include "application_manager/commands/hmi/notification_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief OnAwakeSDLNotification command class
+ **/
+class OnAwakeSDLNotification : public NotificationFromHMI {
+ public:
+ /**
+ * @brief OnAwakeSDLNotification class constructor
+ * @param message Incoming SmartObject message
+ * @param application_manager reference to ApplicationManager instance
+ **/
+ OnAwakeSDLNotification(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief OnAwakeSDLNotification class destructor
+ **/
+ virtual ~OnAwakeSDLNotification();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() FINAL;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OnAwakeSDLNotification);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_ON_AWAKE_SDL_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h
index d9aaff7797..bdfdfffd66 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
@@ -70,4 +70,4 @@ class BasicCommunicationSystemRequest : public RequestToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h
index b7d4f8f689..de433568b1 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
@@ -70,4 +70,4 @@ class BasicCommunicationSystemResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_BASIC_COMMUNICATION_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h
index 6dccad7b57..fdba83d3b6 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
@@ -30,8 +30,8 @@
* 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_
+#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"
@@ -70,4 +70,4 @@ class ClosePopupResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP__RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_CLOSE_POPUP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h
new file mode 100644
index 0000000000..8688698883
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_request.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DecryptCertificateRequest command class
+ **/
+class DecryptCertificateRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief DecryptCertificateRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DecryptCertificateRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DecryptCertificateRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h
new file mode 100644
index 0000000000..45c2258489
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/decrypt_certificate_response.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief DecryptCertificateResponse command class
+ **/
+class DecryptCertificateResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief DecryptCertificateResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ DecryptCertificateResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief DecryptCertificateResponse class destructor
+ **/
+ virtual ~DecryptCertificateResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DecryptCertificateResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_DECRYPT_CERTIFICATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h
index f4e421473c..0e0c271eef 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
@@ -70,4 +70,4 @@ class GetSystemInfoRequest : public RequestToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h
index 766a2869d9..10e28a839e 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
@@ -80,4 +80,4 @@ class GetSystemInfoResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_SYSTEM_INFO_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h
index 5f75f42d5c..1fcc1e626a 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
@@ -35,10 +35,10 @@
#include "application_manager/commands/hmi/request_from_hmi.h"
#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
namespace application_manager {
namespace commands {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
/**
* @brief GetUrls command class
**/
@@ -63,13 +63,13 @@ class GetUrls : public RequestFromHMI {
void Run() OVERRIDE;
private:
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
/**
* @brief Processes URLs collecting for policy service
* @param endpoints Endpoints section of policy table
*/
void ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints);
-#endif
+#endif // PROPRIETARY_MODE
/**
* @brief Process URLs collecting for service
@@ -83,18 +83,10 @@ class GetUrls : public RequestFromHMI {
*/
void SendResponseToHMI(hmi_apis::Common_Result::eType result);
- /**
- * @brief fills structure for sending to HMI with default urls
- * @param urls structure for filling
- * @param endpoints Endpoints section of policy table
- */
- void FillSODefaultUrls(smart_objects::SmartObject& urls,
- const policy::EndpointUrls& endpoints);
-
DISALLOW_COPY_AND_ASSIGN(GetUrls);
};
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h
index 1ca9ba93db..ba058a0ec9 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
@@ -65,4 +65,4 @@ class GetUrlsResponse : public ResponseToHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_URLS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h
index 77ce48a2cc..08826743cc 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
@@ -76,4 +76,4 @@ class NaviIsReadyRequest : public RequestToHMI,
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVIGATION_IS_READY_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h
new file mode 100644
index 0000000000..0788a5595e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviSetVideoConfigRequest command class
+ **/
+class NaviSetVideoConfigRequest : public RequestToHMI,
+ public event_engine::EventObserver {
+ public:
+ /**
+ * @brief NaviSetVideoConfigRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ NaviSetVideoConfigRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief NaviSetVideoConfigRequest class destructor
+ **/
+ virtual ~NaviSetVideoConfigRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut callback
+ */
+ void onTimeOut() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h
new file mode 100644
index 0000000000..3c53687a93
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief NaviSetVideoConfigResponse command class
+ **/
+class NaviSetVideoConfigResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief NaviSetVideoConfigResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ NaviSetVideoConfigResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief NaviSetVideoConfigResponse class destructor
+ **/
+ virtual ~NaviSetVideoConfigResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h
index c74108ccf0..ccf3e6d7f3 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
@@ -35,19 +35,12 @@
#include "application_manager/commands/command_impl.h"
#include "interfaces/HMI_API.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class CSmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
namespace commands {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
class NotificationFromHMI : public CommandImpl {
public:
NotificationFromHMI(const MessageSharedPtr& message,
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 ee7d22b859..8d8d2d8eb0 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
@@ -70,4 +70,4 @@ class OnAllowSDLFunctionalityNotification : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_ALLOW_SDL_FUNCTIONALITY_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h
index a1de12b4d6..6772d49781 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
@@ -70,4 +70,4 @@ class OnAppActivatedNotification : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_ACTIVATED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h
index bdaf6d1119..236e1b5071 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
@@ -70,4 +70,4 @@ class OnAppPermissionChangedNotification : public NotificationToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h
index 5cafe0c1b5..21f96fc055 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
@@ -70,4 +70,4 @@ class OnAppPermissionConsentNotification : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_APP_PERMISSION_CONSENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h
index 980e558d6f..f49dac071f 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
@@ -55,12 +55,22 @@ class OnAppUnregisteredNotification : public NotificationToHMI {
/**
* @brief OnAppUnregisteredNotification class destructor
**/
- virtual ~OnAppUnregisteredNotification();
+ ~OnAppUnregisteredNotification() FINAL;
+
+ /**
+ * @brief Init overrides and skips replacement of app id with hmi id since
+ * 1) at the moment this notification is being sent there is no application
+ * registered in application manager
+ * 2) hmi id is already used whenever this message is being constructed, so
+ * its already there
+ * @return True in any case
+ */
+ bool Init() FINAL;
/**
* @brief Execute command
**/
- virtual void Run();
+ virtual void Run() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(OnAppUnregisteredNotification);
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
index 121367ed90..13fa41ac22 100644
--- 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
@@ -70,4 +70,4 @@ class OnAudioDataStreamingNotification : public NotificationToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_
+#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_event_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h
index e066332d4c..cbe301179d 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h
@@ -70,4 +70,4 @@ class OnEventChangedNotification : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EVENT_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h
index ad10a58bff..92ef97a4aa 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
#include "application_manager/commands/hmi/notification_from_hmi.h"
@@ -60,7 +60,7 @@ class OnExitAllApplicationsNotification : public NotificationFromHMI {
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
private:
/**
@@ -75,4 +75,4 @@ class OnExitAllApplicationsNotification : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_ALL_APPLICATIONS_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_ALL_APPLICATIONS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h
index 275b266b98..bb96a4f14e 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
#include "application_manager/commands/hmi/notification_from_hmi.h"
@@ -70,4 +70,4 @@ class OnExitApplicationNotification : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_EXIT_APPLICATION_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_EXIT_APPLICATION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h
index 32db73c2f5..70347cc44f 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
#include "application_manager/commands/hmi/notification_from_hmi.h"
@@ -70,4 +70,4 @@ class OnFindApplications : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_DEVICE_LIST_UPDATED_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_FIND_APPLICATIONS_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h
index d4380048ee..5569131c2b 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
@@ -64,4 +64,4 @@ class OnPolicyUpdate : public NotificationFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h
index 4c2eacdae3..cec707b44f 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
@@ -67,4 +67,4 @@ class OnReceivedPolicyUpdate : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_RECEIVED_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h
index e54daab96f..5b0f4a1667 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
@@ -70,4 +70,4 @@ class OnSDLConsentNeededNotification : public NotificationToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_CONSENT_NEEDED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h
index 6ac04b488b..1d91faece6 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
@@ -70,4 +70,4 @@ class OnSDLPersistenceCompleteNotification : public NotificationToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SDL_PERSISTENCE_COMPLETE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h
index dc40c1a614..2e523924db 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
#include "application_manager/commands/hmi/notification_from_hmi.h"
@@ -70,4 +70,4 @@ class OnStartDeviceDiscovery : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_START_DEVICE_DISCOVERY_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_START_DEVICE_DISCOVERY_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h
index 62ee38c473..05cb5a4931 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
#include "application_manager/commands/hmi/notification_to_hmi.h"
@@ -70,4 +70,4 @@ class OnStatusUpdateNotification : public NotificationToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_STATUS_UPDATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h
index d709a5267c..1c2bf0266f 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
@@ -70,4 +70,4 @@ class OnSystemInfoChangedNotification : public NotificationFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_SYSTEM_INFO_CHANGED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h
index 02c65df4e9..81493a0a33 100644
--- 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
@@ -70,4 +70,4 @@ class OnVideoDataStreamingNotification : public NotificationToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_
+#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/rc_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h
new file mode 100644
index 0000000000..58654d81d9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.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_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesRequest command class
+ **/
+class RCGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCGetCapabilitiesRequest class destructor
+ **/
+ virtual ~RCGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h
new file mode 100644
index 0000000000..006f38cbb5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_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_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesResponse command class
+ **/
+class RCGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCGetCapabilitiesResponse class destructor
+ **/
+ virtual ~RCGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h
new file mode 100644
index 0000000000..40e05c2b1f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyRequest command class
+ **/
+class RCIsReadyRequest : public RequestToHMI,
+ public event_engine::EventObserver {
+ public:
+ /**
+ * @brief RCIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCIsReadyRequest class destructor
+ **/
+ virtual ~RCIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h
new file mode 100644
index 0000000000..547b89a30d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_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_HMI_RC_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyResponse command class
+ **/
+class RCIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief RCIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCIsReadyResponse class destructor
+ **/
+ virtual ~RCIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h
index c435c41c47..628d3257d9 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
@@ -35,12 +35,7 @@
#include "application_manager/commands/command_impl.h"
#include "interfaces/HMI_API.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
@@ -68,9 +63,29 @@ class RequestFromHMI : public CommandImpl, public event_engine::EventObserver {
const hmi_apis::FunctionID::eType function_id,
const hmi_apis::Common_Result::eType result_code);
- void FillCommonParametersOfSO(smart_objects::SmartObject* message,
- uint32_t correlation_id,
- hmi_apis::FunctionID::eType function_id);
+ /**
+ * @brief SendResponse allows to send error response to hmi
+ * @param correlation_id the correlation id for the response.
+ * @param function_id the function id for which response will be sent
+ * @param result_code the result code.
+ * @param error_message info message for error.
+ */
+ void SendErrorResponse(const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const std::string error_message);
+
+ private:
+ /**
+ * @brief Fills common parameters for SO
+ * @param message Contains SO for filling
+ * @param correlation_id the correlation id for the response.
+ * @param function_id the function id for which response will be sent
+ */
+ void FillCommonParametersOfSO(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& message,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id);
private:
DISALLOW_COPY_AND_ASSIGN(RequestFromHMI);
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 a5d41252f5..05fd23adf0 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
@@ -37,18 +37,10 @@
#include "application_manager/application_manager.h"
#include "interfaces/HMI_API.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
namespace application_manager {
namespace commands {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
class ResponseFromHMI : public CommandImpl {
public:
ResponseFromHMI(const MessageSharedPtr& message,
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
index f00e57ff3a..1dd0657815 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h
@@ -36,12 +36,7 @@
#include "application_manager/commands/command_impl.h"
#include "interfaces/HMI_API.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
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 0dff904955..9ce15a0970 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
@@ -107,4 +107,4 @@ class SDLActivateAppRequest : public RequestFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h
index f35a295581..50bc319569 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
@@ -69,4 +69,4 @@ class SDLActivateAppResponse : public ResponseToHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_ACTIVATE_APP_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h
index 4f8d598322..69e4ec227c 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
#include "application_manager/commands/hmi/request_from_hmi.h"
@@ -69,4 +69,4 @@ class SDLGetListOfPermissionsRequest : public RequestFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h
index e00e613e70..b82f16e113 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
#include "application_manager/commands/hmi/response_to_hmi.h"
@@ -70,4 +70,4 @@ class SDLGetListOfPermissionsResponse : public ResponseToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h
index cfc0d55b54..4f5ce887bd 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
@@ -69,4 +69,4 @@ class SDLGetStatusUpdateRequest : public RequestFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h
index c25008bd90..f8aeb6135f 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
@@ -69,4 +69,4 @@ class SDLGetStatusUpdateResponse : public ResponseToHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_STATUS_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h
index 7d9fec337c..9837e6af09 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
#include "application_manager/commands/hmi/request_from_hmi.h"
#include "application_manager/application_manager.h"
@@ -70,4 +70,4 @@ class SDLGetUserFriendlyMessageRequest : public RequestFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h
index 43c440c277..bb2fba8433 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
#include "application_manager/commands/hmi/response_to_hmi.h"
@@ -70,4 +70,4 @@ class SDLGetUserFriendlyMessageResponse : public ResponseToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_GET_USER_FRIENDLY_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h
index 6cf4646163..99b627431c 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
@@ -64,4 +64,4 @@ class SDLPolicyUpdate : public RequestToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h
index 53e9e796bf..12850f4b8a 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
@@ -67,4 +67,4 @@ class SDLPolicyUpdateResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_SDL_POLICY_UPDATE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h
index d9ae72a319..8232043395 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
@@ -70,4 +70,4 @@ class UIPerformInteractionRequest : public RequestToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_CREATE_INTERACTION_SET_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h
new file mode 100644
index 0000000000..b697176a36
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISendHapticDataRequest command class
+ **/
+class UISendHapticDataRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief UISendHapticDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ UISendHapticDataRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief UISendHapticDataRequest class destructor
+ **/
+ ~UISendHapticDataRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISendHapticDataRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h
new file mode 100644
index 0000000000..96abe4665d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief UISendHapticDataResponse command class
+ **/
+class UISendHapticDataResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief UISendHapticDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ UISendHapticDataResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief UISendHapticDataResponse class destructor
+ **/
+ ~UISendHapticDataResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UISendHapticDataResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h
index c016cf7cda..b1025035d6 100644
--- 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
#include "application_manager/commands/hmi/request_to_hmi.h"
@@ -70,4 +70,4 @@ class UISetAppIconRequest : public RequestToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h
index 640e43c9f4..6ad80bc9fe 100644
--- 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
#include "application_manager/commands/hmi/response_from_hmi.h"
@@ -70,4 +70,4 @@ class UISetAppIconResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_ICON_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h
index 7b8098fdf5..595ee93c30 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
@@ -70,4 +70,4 @@ class UiSetDisplayLayoutResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SET_DISPLAY_LAYOUT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
index 34bef8a989..b7d759916e 100644
--- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
+++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_icon_request.h
@@ -49,7 +49,8 @@ class UISetIconRequest : public RequestToHMI {
*
* @param message Incoming SmartObject message
**/
- UISetIconRequest(const MessageSharedPtr& message);
+ UISetIconRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
/**
* @brief UISetIconRequest class destructor
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 c52ec96075..f304f404a1 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
#include "application_manager/commands/hmi/request_to_hmi.h"
#include "application_manager/event_engine/event_observer.h"
@@ -90,4 +90,4 @@ class UpdateDeviceListRequest : public RequestToHMI,
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_DEVICE_LIST_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h
index 1928b81207..9320de1387 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
@@ -70,4 +70,4 @@ class UpdateDeviceListResponse : public ResponseFromHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_DEVICE_LIST_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/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 a11c763021..6e90656600 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
#include "application_manager/event_engine/event.h"
#include "application_manager/commands/hmi/request_to_hmi.h"
@@ -70,4 +70,4 @@ class VIGetVehicleDataRequestTemplate : public RequestToHMI {
} // namespace commands
} // namespace application_manager
-#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h
index a1c143baed..557c33df13 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
-#define HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
#include "application_manager/event_engine/event.h"
#include "application_manager/commands/hmi/response_from_hmi.h"
@@ -71,4 +71,4 @@ class VIGetVehicleDataResponseTemplate : public ResponseFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // HMI_VI_GETBSCRIBE_VEHICLE_DATA_REQUEST_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_GET_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h
index 7fefe0dbe2..76245af0f9 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
#include "application_manager/event_engine/event.h"
#include "application_manager/commands/hmi/request_to_hmi.h"
@@ -70,4 +70,4 @@ class VISubscribeVehicleDataRequestTemplate : public RequestToHMI {
} // namespace commands
} // namespace application_manager
-#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h
index 7790c57092..e8272971e2 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
#include "application_manager/event_engine/event.h"
#include "application_manager/commands/hmi/response_from_hmi.h"
@@ -70,4 +70,4 @@ class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_SUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h
index b9367a372e..2014896f11 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
-#define HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
#include "application_manager/event_engine/event.h"
#include "application_manager/commands/hmi/request_to_hmi.h"
@@ -70,4 +70,4 @@ class VIUnsubscribeVehicleDataRequestTemplate : public RequestToHMI {
} // namespace commands
} // namespace application_manager
-#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_REQUEST_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h
index 9d943b838d..0817ca90af 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
-#define HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
#include "application_manager/event_engine/event.h"
#include "application_manager/commands/hmi/response_from_hmi.h"
@@ -72,4 +72,4 @@ class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI {
} // namespace commands
} // namespace application_manager
-#endif // HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VI_UNSUBSCRIBE_VEHICLE_DATA_RESPONSE_TEMPLATE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h
index 35a7e80b06..1f54d29beb 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
@@ -70,4 +70,4 @@ class VRPerformInteractionRequest : public RequestToHMI {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_VR_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h
index 17758d66fc..2aed94c448 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
@@ -31,8 +31,9 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
+
#include <string>
#include "application_manager/application.h"
@@ -59,25 +60,30 @@ class AddCommandRequest : public CommandRequestImpl {
/**
* @brief AddCommandRequest class destructor
**/
- virtual ~AddCommandRequest();
+ ~AddCommandRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
/**
* @brief Function is called by RequestController when request execution time
* has exceed it's limit
*/
- virtual void onTimeOut();
+ void onTimeOut() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
/*
@@ -156,4 +162,4 @@ class AddCommandRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
index 84bcdebc31..b385b3bc5c 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class AddCommandResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_COMMAND_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
index 1f12523953..36b0b38464 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -57,19 +57,24 @@ class AddSubMenuRequest : public CommandRequestImpl {
/**
* @brief AddSubMenuRequest class destructor
**/
- virtual ~AddSubMenuRequest();
+ ~AddSubMenuRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
/*
@@ -85,4 +90,4 @@ class AddSubMenuRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
index 4d71e5f017..b09254369f 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class AddSubMenuResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ADD_SUB_MENU_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ADD_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
index 92211b54a2..17ad75b7a6 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/commands/pending.h"
@@ -103,4 +103,4 @@ class AlertManeuverRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
index c02322e298..2d45435a8b 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class AlertManeuverResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_MANEUVER_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_MANEUVER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
index 84241f8f80..01b9782662 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
#include <string>
@@ -72,13 +72,6 @@ class AlertRequest : public CommandRequestImpl {
**/
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
*
@@ -154,4 +147,4 @@ class AlertRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
index acac21d738..e03dad7564 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class AlertResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ALERT_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ALERT_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h
index f783af12b3..2cd8e386e0 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
@@ -167,6 +167,16 @@ class ChangeRegistrationRequest : public CommandRequestImpl {
std::string vr_response_info_;
std::string tts_response_info_;
+ void SendVRRequest(ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params);
+
+ void SendTTSRequest(ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params);
+
+ void SendUIRequest(ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params,
+ const int32_t hmi_language);
+
DISALLOW_COPY_AND_ASSIGN(ChangeRegistrationRequest);
};
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
index 6ff3fd9a4a..995764a15f 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class ChangeRegistrationResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CHANGE_REGISTRATION_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CHANGE_REGISTRATION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h
index fffbab567f..c00d310e7d 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
@@ -64,31 +64,36 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
/**
* @brief CreateInteractionChoiceSetRequest class destructor
**/
- virtual ~CreateInteractionChoiceSetRequest();
+ ~CreateInteractionChoiceSetRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- virtual void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
/**
* @brief Function is called by RequestController when request execution time
* has exceed it's limit
*/
- virtual void onTimeOut();
+ void onTimeOut() FINAL;
+
/**
- * @brief DeleteChoices allows to walk through the sent commands collection
- * in order to sent appropriate DeleteCommand request.
+ * @brief Init sets hash update mode for request
*/
+ bool Init() FINAL;
private:
+ /**
+ * @brief DeleteChoices allows to walk through the sent commands collection
+ * in order to sent appropriate DeleteCommand request.
+ */
void DeleteChoices();
/**
@@ -104,7 +109,7 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl {
* processing deleting sent commands if error from HMI received
*/
struct VRCommandInfo {
- VRCommandInfo() {}
+ VRCommandInfo() : cmd_id_(0), succesful_response_received_(false) {}
VRCommandInfo(uint32_t cmd_id)
: cmd_id_(cmd_id), succesful_response_received_(false) {}
uint32_t cmd_id_;
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
index 6a7faf705c..bb2083e0b5 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class CreateInteractionChoiceSetResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_CREATE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
index 4e392f3857..afb2e226f6 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h
@@ -31,8 +31,9 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
+
#include <string>
#include "application_manager/commands/command_request_impl.h"
@@ -58,19 +59,24 @@ class DeleteCommandRequest : public CommandRequestImpl {
/**
* @brief DeleteCommandRequest class destructor
**/
- virtual ~DeleteCommandRequest();
+ ~DeleteCommandRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest);
@@ -106,4 +112,4 @@ class DeleteCommandRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
index b61035ca1b..a6a25f9cd5 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class DeleteCommandResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_COMMAND_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_COMMAND_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
index adaf2686bc..beb8ae73cd 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -75,4 +75,4 @@ class DeleteFileRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
index e001e46a22..08f734ec13 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class DeleteFileResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_FILE_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
index 716a1d82de..ead60be1af 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
@@ -58,12 +58,17 @@ class DeleteInteractionChoiceSetRequest : public CommandRequestImpl {
/**
* @brief DeleteInteractionChoiceSetRequest class destructor
**/
- virtual ~DeleteInteractionChoiceSetRequest();
+ ~DeleteInteractionChoiceSetRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
/*
@@ -81,4 +86,4 @@ class DeleteInteractionChoiceSetRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
index 86e20bc6d4..7a926399ee 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class DeleteInteractionChoiceSetResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_INTERACTION_CHOICE_SET_RESPONSE_COMMAND_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_INTERACTION_CHOICE_SET_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
index 20342ba5c1..37863598ac 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application.h"
@@ -58,19 +58,24 @@ class DeleteSubMenuRequest : public CommandRequestImpl {
/**
* @brief DeleteSubMenuRequest class destructor
**/
- virtual ~DeleteSubMenuRequest();
+ ~DeleteSubMenuRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
/*
@@ -97,4 +102,4 @@ class DeleteSubMenuRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
index 76232aee4b..4319d88ea0 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class DeleteSubMenuResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DELETE_SUB_MENU_RESPONSE_COMMAND_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DELETE_SUB_MENU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
index 34c8b0e872..d55bce6613 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -78,4 +78,4 @@ class DiagnosticMessageRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
index 439f11a57e..7ac810eabf 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class DiagnosticMessageResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAGNOSTIC_MESSAGE_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAGNOSTIC_MESSAGE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
index 1b945fc5fb..c8ae2b2cd9 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h
@@ -30,8 +30,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -88,4 +88,4 @@ class DialNumberRequest : public CommandRequestImpl {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h
index 4a6980bd04..688c9a7207 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h
@@ -31,8 +31,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_RESPONSE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_RESPONSE_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class DialNumberResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_DIAL_NUMBER_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_DIAL_NUMBER_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
index add6d2497e..04f4fa53ab 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -78,4 +78,4 @@ class EndAudioPassThruRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
index 381a397fbd..ca756cf5d7 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class EndAudioPassThruResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_END_AUDIO_PASS_THRU_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_END_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h
index 9ccef12152..6cfc6e5891 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "application_manager/message.h"
@@ -66,4 +66,4 @@ class GenericResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GENERIC_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GENERIC_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
index d962937e39..b70c04bcca 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -78,4 +78,4 @@ class GetDTCsRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
index abe970d60f..10d0d0f86d 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class GetDTCsResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_DTCS_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_DTCS_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h
new file mode 100644
index 0000000000..ba55a6b4cd
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h
@@ -0,0 +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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_
+
+#include "application_manager/commands/command_request_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class GetSystemCapabilityRequest : public CommandRequestImpl {
+ public:
+ GetSystemCapabilityRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ virtual ~GetSystemCapabilityRequest();
+
+ virtual void Run() OVERRIDE;
+
+ virtual void on_event(const event_engine::Event& event);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest);
+
+}; // GetSystemCapabilityRequest
+} // commands
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ \ No newline at end of file
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h
new file mode 100644
index 0000000000..9fa6f9b5bb
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h
@@ -0,0 +1,60 @@
+/*
+
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+#include "utils/macro.h"
+
+namespace application_manager {
+
+namespace commands {
+
+class GetSystemCapabilityResponse : public CommandResponseImpl {
+ public:
+ GetSystemCapabilityResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ virtual ~GetSystemCapabilityResponse();
+
+ virtual void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse);
+
+}; // GetSystemCapabilityResponse
+} // commands
+} // application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ \ No newline at end of file
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
index eda77e59b0..030a3afedc 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -91,4 +91,4 @@ class GetVehicleDataRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
index 4fadaf2b01..11691d1f84 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class GetVehicleDataResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_GET_VEHICLE_DATA_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_VEHICLE_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
index d8d28b7e9d..f1e9204eea 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class ListFilesRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
index a211ee5968..81165c9bc4 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class ListFilesResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_LIST_FILES_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_LIST_FILES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
index 7ef2e7e5d2..758fdaf760 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_app_interface_unregistered_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class OnAppInterfaceUnregisteredNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_APP_INTERFACE_UNREGISTERED_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
index b74d8fbe41..68e1d4f548 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -73,4 +73,4 @@ class OnAudioPassThruNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_AUDIO_PASS_THRU_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
index 80355993e1..d6a15caf4b 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application.h"
@@ -84,4 +84,4 @@ class OnButtonEventNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_EVENT_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_EVENT_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
index 1443e58a70..9acd31f8da 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application.h"
@@ -83,4 +83,4 @@ class OnButtonPressNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_BUTTON_PRESS_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_BUTTON_PRESS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
index 3f9a0ad6c2..e2faf9b05c 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -74,4 +74,4 @@ class OnCommandNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_COMMAND_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_COMMAND_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
index ee3c19c707..1f9ee4ed8c 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -75,4 +75,4 @@ class OnDriverDistractionNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_DRIVER_DISTRACTION_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
index 9f9fad16d4..07544c573f 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -73,4 +73,4 @@ class OnHashChangeNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HASH_CHANGE_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HASH_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h
index a82182eea0..58659cbc4b 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
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class OnHMIStatusNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h
index 878f4fa720..b2802e9fe9 100644
--- 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
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
#include "application_manager/commands/command_notification_from_mobile_impl.h"
#include "application_manager/application_manager.h"
@@ -74,4 +74,4 @@ class OnHMIStatusNotificationFromMobile
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_HMI_STATUS_NOTIFICATION_FROM_MOBILE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
index c62652ff67..bbd7679a6b 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class OnLanguageChangeNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_LANGUAGE_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
index d5f7aa96b8..9fd2832218 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class OnPermissionsChangeNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_PERMISSIONS_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h
index 143b076033..d42e42649a 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
@@ -30,8 +30,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include <vector>
@@ -67,14 +67,14 @@ class OnSystemRequestNotification : public CommandNotificationImpl {
void Run() OVERRIDE;
private:
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
/**
* @brief Adds HTTP header to message
* @param message Message
*/
void AddHeader(BinaryMessage& message) const;
size_t ParsePTString(std::string& pt_string) const;
-#endif
+#endif // PROPRIETARY_MODE
DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification);
};
@@ -83,4 +83,4 @@ class OnSystemRequestNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_SYSTEM_REQUEST_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
index e7b895dceb..42a81043f9 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class OnTBTClientStateNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_TBT_CLIENT_STATE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
index de6172de64..efe2ce8c55 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "application_manager/application.h"
@@ -80,4 +80,4 @@ class OnVehicleDataNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_VEHICLE_DATA_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h
index c204e1669c..e33de74fd8 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
#include "application_manager/commands/command_notification_impl.h"
#include "utils/macro.h"
@@ -66,4 +66,4 @@ class OnWayPointChangeNotification : public CommandNotificationImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_ON_WAY_POINT_CHANGE_NOTIFICATION_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
index aff7430c6a..efe1f107f3 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -87,12 +87,38 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
private:
/**
* @brief Prepare result code, result and info for sending to mobile
+ * @brief Response params
+ * success for sending to mobile application
+ * result code for sending to mobile application
+ * info for sending to mobile application
+ */
+ struct ResponseParams {
+ bool success;
+ mobile_apis::Result::eType result_code;
+ std::string info;
+ ResponseParams()
+ : success(false), result_code(mobile_apis::Result::INVALID_ENUM) {}
+ };
+
+ ResponseParams response_params_;
+
+ /**
+ * @brief Prepare result code, result and info for sending to mobile
* application
* @param result_code contains result code for sending to mobile application
* @return result for sending to mobile application.
+ * @deprecated
*/
- bool PrepareResponseParameters(mobile_apis::Result::eType& result_code,
- std::string& info);
+ DEPRECATED bool PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info);
+ /**
+ * @brief Prepare result code, 'success' result and info for sending
+ * to mobile application
+ * @param result_code contains result code for sending to mobile application
+ * @return result for sending to mobile application.
+ */
+ const ResponseParams& PrepareResponseParameters();
+
/**
* @brief Sends TTS Speak request
*/
@@ -133,10 +159,23 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
*/
bool IsWaitingHMIResponse();
- /* flag display state of speak and ui perform audio
- during perform audio pass thru*/
- bool awaiting_tts_speak_response_;
- bool awaiting_ui_response_;
+ /**
+ * @brief Pair of result_code and success for mobile app
+ */
+ typedef std::pair<mobile_apis::Result::eType, bool> AudioPassThruResults;
+
+ /**
+ * @brief Checks result code from HMI for splitted RPC
+ * and returns parameter for sending to mobile app in
+ * audioPassThru communication.
+ * @param ui_response contains result_code from UI
+ * @param tts_response contains result_code from TTS
+ * @return pair of result code (UI error code has precedence than TTS's,
+ * error_code from TTS is turned to WARNINGS) and
+ * result for mobile app
+ */
+ AudioPassThruResults PrepareAudioPassThruResultCodeForResponse(
+ const ResponseInfo& ui_response, const ResponseInfo& tts_response);
hmi_apis::Common_Result::eType result_tts_speak_;
hmi_apis::Common_Result::eType result_ui_;
@@ -149,4 +188,4 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
index d227c4fef3..29005d7b01 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class PerformAudioPassThruResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_AUDIO_PASS_THRU_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h
index 5ba85b0cb7..c482e2d548 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
@@ -31,8 +31,9 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
+
#include <string>
#include "application_manager/commands/command_request_impl.h"
@@ -237,4 +238,4 @@ class PerformInteractionRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
index 1274996747..209b469d0d 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class PerformInteractionResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PERFORM_INTERACTION_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PERFORM_INTERACTION_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
index e3af8ac69b..ad13f0ee52 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -79,4 +79,4 @@ class PutFileRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
index f561f9fdbc..aa407c8d83 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class PutFileResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_PUT_FILE_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_PUT_FILE_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h
index cc3d5b685c..5713e2e814 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
@@ -78,14 +78,29 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
virtual void Run();
/**
- * @brief Sends RegisterAppInterface response to mobile
- *
- *@param application_impl application
- *
+ * @brief Prepares and sends RegisterAppInterface response to mobile
+ * considering application type
**/
void SendRegisterAppInterfaceResponseToMobile();
private:
+ /**
+ * @brief The AppicationType enum defines whether application is newly
+ * registered or existing and being switched over another transport
+ */
+ enum class ApplicationType {
+ kNewApplication,
+ kSwitchedApplicationHashOk,
+ kSwitchedApplicationWrongHashId
+ };
+
+ /**
+ * @brief Prepares and sends RegisterAppInterface response to mobile
+ * considering application type
+ * @param app_type Type of application
+ **/
+ void SendRegisterAppInterfaceResponseToMobile(ApplicationType app_type);
+
smart_objects::SmartObjectSPtr GetLockScreenIconUrlNotification(
const uint32_t connection_key, ApplicationSharedPtr app);
@@ -184,6 +199,15 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl {
*/
void SendSubscribeCustomButtonNotification();
+ /**
+ * @brief IsApplicationSwitched checks whether application is switched from
+ * another transport. If application id is found, but not in reconnection
+ * list, returns 'already registered' code. Otherwise - proceed with
+ * switching.
+ * @return True if application is detected as switched, otherwise false.
+ */
+ bool IsApplicationSwitched();
+
private:
std::string response_info_;
mobile_apis::Result::eType result_checking_app_hmi_type_;
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
index 0053c14f3c..c16a014c9f 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h
@@ -58,19 +58,24 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl {
/**
* @brief ResetGlobalPropertiesRequest class destructor
**/
- virtual ~ResetGlobalPropertiesRequest();
+ ~ResetGlobalPropertiesRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
/*
@@ -108,6 +113,16 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl {
application_manager::ApplicationSharedPtr const app);
/*
+ * @brief Prepare result for sending to mobile application
+ * @param out_result_code contains result code for sending to mobile
+ * application
+ * @param out_response_info contains info for sending to mobile applicaion
+ * @return result for sending to mobile application.
+ */
+ bool PrepareResponseParameters(mobile_apis::Result::eType& out_result_code,
+ std::string& out_response_info);
+
+ /*
* @brief Check if there some not delivered hmi responses exist
*
* @return true if all responses received
@@ -116,14 +131,10 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl {
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_;
+ std::string ui_response_info_;
+ std::string tts_response_info_;
};
} // namespace commands
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h
new file mode 100644
index 0000000000..13ed06cce6
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
+
+#include <string>
+#include "application_manager/commands/command_request_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SendHapticDataRequest command class
+ **/
+class SendHapticDataRequest : public CommandRequestImpl {
+ public:
+ /**
+ * @brief SendHapticDataRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ SendHapticDataRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief SendHapticDataRequest class destructor
+ **/
+ ~SendHapticDataRequest() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendHapticDataRequest);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h
new file mode 100644
index 0000000000..2a60746c61
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
+
+#include "application_manager/commands/command_response_impl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief SendHapticDataResponse command class
+ **/
+class SendHapticDataResponse : public CommandResponseImpl {
+ public:
+ /**
+ * @brief SendHapticDataResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ * @param application_manager Reference of application manager
+ **/
+ SendHapticDataResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief SendHapticDataResponse class destructor
+ **/
+ ~SendHapticDataResponse() OVERRIDE;
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SendHapticDataResponse);
+};
+
+} // namespace commands
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h
index 42eedad19b..4735d89fb0 100644
--- 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
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
#include "application_manager/commands/command_request_impl.h"
#include "utils/macro.h"
@@ -109,4 +109,4 @@ class SetAppIconRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h
index 6061cf5702..742332742b 100644
--- 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
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
#include "utils/macro.h"
@@ -71,4 +71,4 @@ class SetAppIconResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_ICON_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SET_APP_ICON_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
index 0300245af8..da28d33de8 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h
@@ -57,19 +57,24 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl {
/**
* @brief SetGlobalPropertiesRequest class destructor
**/
- virtual ~SetGlobalPropertiesRequest();
+ ~SetGlobalPropertiesRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
// Verify correctness VrHelptitle value
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
index cbe2ca396a..a10997bacd 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h
@@ -78,6 +78,17 @@ class ShowRequest : public CommandRequestImpl {
*/
bool CheckStringsOfShowRequest();
+ /**
+ * @brief Handle the conversion of metadata information from the incoming
+ * mobile json message format to the outgoing hmi json message format
+ */
+ void HandleMetadata(const char* field_id,
+ int32_t field_index,
+ smart_objects::SmartObject& msg_params);
+
+ mobile_apis::Result::eType core_result_code_;
+ std::string core_response_info_;
+
DISALLOW_COPY_AND_ASSIGN(ShowRequest);
};
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 b5a22d40a9..cf65e2a6a4 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
@@ -58,12 +58,17 @@ class SubscribeButtonRequest : public CommandRequestImpl {
/**
* @brief SubscribeButtonRequest class destructor
**/
- virtual ~SubscribeButtonRequest();
+ ~SubscribeButtonRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
/**
@@ -85,12 +90,6 @@ class SubscribeButtonRequest : public CommandRequestImpl {
*/
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/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
index fb21823b3a..719c514729 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h
@@ -3,6 +3,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -58,19 +61,24 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl {
/**
* @brief SubscribeButtonCommandRequest class destructor
**/
- virtual ~SubscribeVehicleDataRequest();
+ ~SubscribeVehicleDataRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- virtual void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
#ifdef HMI_DBUS_API
private:
@@ -112,6 +120,13 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl {
ApplicationSharedPtr app,
const smart_objects::SmartObject& msg_params) const;
+ DEPRECATED void CheckVISubscribtions(
+ ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result);
/**
* @brief Checks if current application and other applications
* were subscribed to VI, prepare data that need to send to mobile app
@@ -125,7 +140,7 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl {
* HMI
* @param result contains result that SDL sends to mobile app.
*/
- void CheckVISubscribtions(ApplicationSharedPtr app,
+ void CheckVISubscriptions(ApplicationSharedPtr app,
std::string& out_info,
mobile_apis::Result::eType& out_result_code,
smart_objects::SmartObject& out_response_params,
@@ -143,6 +158,11 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl {
*/
VehicleInfoSubscriptions vi_already_subscribed_by_this_app_;
+ /**
+ * @brief VI parameters which wait for subscribe after HMI respond
+ */
+ VehicleInfoSubscriptions vi_waiting_for_subscribe_;
+
DISALLOW_COPY_AND_ASSIGN(SubscribeVehicleDataRequest);
};
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h
index 50b3a6f2cb..f392dd6dd1 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h
@@ -53,18 +53,23 @@ class SubscribeWayPointsRequest : public CommandRequestImpl {
/**
* \brief SubscribeWayPointsRequest class destructor
**/
- virtual ~SubscribeWayPointsRequest();
+ ~SubscribeWayPointsRequest();
/**
* @brief Execute command
**/
- virtual void Run() OVERRIDE;
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- virtual void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest);
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 de87512e92..1d163b6cd8 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
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
#include <string>
#include "application_manager/commands/command_request_impl.h"
@@ -40,12 +40,6 @@
#include "application_manager/event_engine/event.h"
#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
-
namespace application_manager {
namespace commands {
@@ -97,4 +91,4 @@ class SystemRequest : public CommandRequestImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_REQUEST_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
index 3f48db7f0e..efee210b7b 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h
@@ -31,8 +31,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
#include "application_manager/commands/command_response_impl.h"
@@ -70,4 +70,4 @@ class SystemResponse : public CommandResponseImpl {
} // namespace commands
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_SYSTEM_RESPONSE_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SYSTEM_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h
index 62600d51d7..b0206c4407 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
@@ -57,12 +57,17 @@ class UnsubscribeButtonRequest : public CommandRequestImpl {
/**
* @brief UnsubscribeButtonRequest class destructor
**/
- virtual ~UnsubscribeButtonRequest();
+ ~UnsubscribeButtonRequest() FINAL;
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
/**
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
index a6bade2fd6..1c7d80797d 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h
@@ -58,19 +58,24 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl {
/**
* @brief UnsubscribeVehicleDataRequest class destructor
**/
- virtual ~UnsubscribeVehicleDataRequest();
+ ~UnsubscribeVehicleDataRequest();
/**
* @brief Execute command
**/
- virtual void Run();
+ void Run() FINAL;
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- virtual void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
#ifdef HMI_DBUS_API
private:
@@ -103,11 +108,6 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl {
void AddAlreadyUnsubscribedVI(smart_objects::SmartObject& response) const;
/**
- * @brief Allows to update hash after sending response to mobile.
- */
- void UpdateHash() const;
-
- /**
* @brief VI parameters which still being subscribed by another apps after
* particular app had been unsubscribed from these parameters
*/
diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h
index 2831551667..0b5462b7b5 100644
--- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h
+++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h
@@ -50,18 +50,24 @@ class UnSubscribeWayPointsRequest : public CommandRequestImpl {
/**
* \brief UnSubscribeWayPointsRequest class destructor
**/
- virtual ~UnSubscribeWayPointsRequest();
+ ~UnSubscribeWayPointsRequest();
/**
* @brief Execute command
**/
- virtual void Run() OVERRIDE;
+ void Run() FINAL;
+
/**
* @brief Interface method that is called whenever new event received
*
* @param event The received event
*/
- virtual void on_event(const event_engine::Event& event);
+ void on_event(const event_engine::Event& event) FINAL;
+
+ /**
+ * @brief Init sets hash update mode for request
+ */
+ bool Init() FINAL;
private:
DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest);
diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h
new file mode 100644
index 0000000000..5e95ecd245
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/core_service.h
@@ -0,0 +1,214 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_
+
+#include <string>
+#include <vector>
+#include "application_manager/service.h"
+#include "application_manager/application.h"
+#include "policy/policy_types.h"
+
+namespace Json {
+class Value;
+}
+
+namespace application_manager {
+
+struct CommandParametersPermissions;
+
+/**
+ * @brief Class through which the plug-in can interact with the core
+ */
+class CoreService : public Service {
+ public:
+ /**
+ * @brief CoreService class destructor
+ */
+ explicit CoreService(ApplicationManager& application_manager);
+
+ /**
+ * @brief CoreService class destructor
+ */
+ virtual ~CoreService();
+
+ /**
+ * @brief Checks message permissions and cuts parameters according
+ * to policy table permissions
+ * @param msg message to cut disallowed parameters
+ * @return result according by mobile API
+ */
+ mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) FINAL;
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ bool CheckModule(const ApplicationId& app_id,
+ const std::string& module) FINAL;
+
+ /**
+ * Checks if application has remote control functions
+ * @param app application
+ * @return true if application has remote control functions
+ */
+ bool IsRemoteControlApplication(ApplicationSharedPtr app) const FINAL;
+
+ /**
+ * @brief Gets current state of the specified interface
+ * @param interface which state to get
+ * @return true if specified interface available otherwise false
+ */
+ bool IsInterfaceAvailable(
+ const HmiInterfaces::InterfaceID interface) const FINAL;
+
+ /**
+ * Removes fake parameters from request to HMI
+ * @param message message to handle
+ */
+ void RemoveHMIFakeParameters(application_manager::MessagePtr& message) FINAL;
+
+ /**
+ * @brief Get pointer to application by application id
+ * @param app_id application id
+ * return pointer to application
+ */
+ ApplicationSharedPtr GetApplication(ApplicationId app_id) FINAL;
+
+ /**
+ * @brief Send message to HMI
+ * @param message Message to HMI
+ */
+ void SendMessageToHMI(const MessagePtr& message) FINAL;
+
+ /**
+ * @brief Send message to mobile device
+ * @param message Message to mobile
+ */
+ void SendMessageToMobile(const MessagePtr& message) FINAL;
+
+ /**
+ * @brief Returns unique correlation ID for next HMI request
+ *
+ * @return Unique correlation ID
+ */
+ uint32_t GetNextCorrelationID() FINAL;
+
+ /**
+ * @brief Returns all applications
+ *
+ * @return List with shared pointers to applications
+ */
+ std::vector<ApplicationSharedPtr> GetApplications(AppExtensionUID uid) FINAL;
+
+ /**
+ * @brief Change hmi level of app and notify it
+ * @param app Application to be changed and notified
+ * @param level New HMI level of app
+ */
+ void ChangeNotifyHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) FINAL;
+
+ const smart_objects::SmartObject* GetRCCapabilities() const FINAL;
+ /**
+ * @brief Notify HMI about app changing HMI Level
+ * only NONE, BACKGROUND and LIMITED levels are sent
+ * @param app Application to be changed and notified
+ * @param level New HMI level of app
+ */
+ void NotifyHMIAboutHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) FINAL;
+
+ /**
+ * Gets all allowed module types
+ * @param app_id unique identifier of application
+ * @param list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const FINAL;
+
+ /**
+ * @brief ValidateMessageBySchema Checks whether message is valid according
+ * to API
+ * @param message Message to check
+ * @return Check result
+ */
+ MessageValidationResult ValidateMessageBySchema(const Message& message) FINAL;
+
+ /**
+ * @brief Gets application manager settings structure
+ * @return reference to application manager settings structure
+ */
+ const ApplicationManagerSettings& GetSettings() const FINAL;
+
+ private:
+ /**
+ * @brief AreParametersAllowed Checks message parameters across current policy
+ * permissions
+ * @param msg Message having parameters
+ * @param params Parameters sorted by permissions
+ * @return True if allowed, otherwise - false
+ */
+ bool AreParametersAllowed(MessagePtr msg,
+ const CommandParametersPermissions& params);
+
+ /**
+ * @brief CheckParams Checks object params with allowed parameters received
+ * from policy
+ * @param object Message object
+ * @param allowed_params Parameters allowed by policy
+ * @return True if all parameters allowed, otherwise - false
+ */
+ bool CheckParams(const Json::Value& object,
+ const policy::RPCParams& allowed_params);
+
+ /**
+ * @brief IsAllowed Checks particular parameter among allowed list
+ * @param name Parameter name
+ * @param allowed_params List of allowed parameters
+ * @return True if found, otherwise - false
+ */
+ bool IsAllowed(const std::string& name,
+ const policy::RPCParams& allowed_params);
+
+ ApplicationManager& application_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(CoreService);
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_
diff --git a/src/components/application_manager/include/application_manager/event_engine/event.h b/src/components/application_manager/include/application_manager/event_engine/event.h
index 4b8a4088bf..68ee508a9b 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
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_H_
#include <interfaces/HMI_API.h>
@@ -43,8 +43,6 @@ namespace event_engine {
class EventDispatcher;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
class Event {
public:
// Typedef for possible Event ID's from mobile_apis functionID enum
@@ -146,4 +144,4 @@ int32_t Event::smart_object_type() const {
} // namespace event_engine
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_H_
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 3d236b9c0f..813dda0295 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
@@ -30,8 +30,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_H_
#include <list>
#include "application_manager/event_engine/event.h"
@@ -86,4 +86,4 @@ class EventDispatcher {
} // namespace event_engine
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_H_
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
index 9a13ad608b..4cdbb902de 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_dispatcher_impl.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_IMPL_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_IMPL_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_IMPL_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_IMPL_H_
#include <vector>
#include <map>
@@ -126,4 +126,4 @@ class EventDispatcherImpl : public EventDispatcher {
} // namespace event_engine
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_DISPATCHER_IMPL_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_DISPATCHER_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/event_engine/event_observer.h b/src/components/application_manager/include/application_manager/event_engine/event_observer.h
index 3e910edfa9..593f1df657 100644
--- a/src/components/application_manager/include/application_manager/event_engine/event_observer.h
+++ b/src/components/application_manager/include/application_manager/event_engine/event_observer.h
@@ -30,8 +30,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_OBSERVER_H_
#include <string>
#include "application_manager/event_engine/event.h"
@@ -110,4 +110,4 @@ const EventObserver::ObserverID& EventObserver::id() const {
} // namespace event_engine
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_ENGINE_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/helpers/application_helper.h b/src/components/application_manager/include/application_manager/helpers/application_helper.h
new file mode 100644
index 0000000000..cecda0cd6f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/helpers/application_helper.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELPERS_APPLICATION_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELPERS_APPLICATION_HELPER_H_
+
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+
+/*
+ * This file is for code w/o direct usage of ApplicationManagerImpl internals
+ */
+namespace application_manager {
+
+/**
+ * Helper function for lookup through applications list and returning first
+ * application satisfying predicate logic
+ */
+template <class UnaryPredicate>
+ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor,
+ UnaryPredicate finder) {
+ ApplicationSet::iterator it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ if (accessor.GetData().end() == it) {
+ return ApplicationSharedPtr();
+ }
+ ApplicationSharedPtr app = *it;
+ return app;
+}
+
+/**
+ * Helper function for lookup through applications list and returning all
+ * applications satisfying predicate logic
+ */
+template <class UnaryPredicate>
+std::vector<ApplicationSharedPtr> FindAllApps(
+ DataAccessor<ApplicationSet> accessor, UnaryPredicate finder) {
+ std::vector<ApplicationSharedPtr> result;
+ ApplicationSetConstIt it = std::find_if(
+ accessor.GetData().begin(), accessor.GetData().end(), finder);
+ while (it != accessor.GetData().end()) {
+ result.push_back(*it);
+ it = std::find_if(++it, accessor.GetData().end(), finder);
+ }
+ return result;
+}
+
+/**
+ * @brief The SubscribedToIVIPredicate is predicate for lookup within
+ * applications list for apps subscribed for specific vehicle data
+ */
+struct SubscribedToIVIPredicate {
+ uint32_t vehicle_info_;
+ explicit SubscribedToIVIPredicate(uint32_t vehicle_info);
+ bool operator()(const ApplicationSharedPtr app) const;
+};
+
+/**
+ * @brief RecallApplicationData cleans up data within application instance to
+ * its initial state and notifies HMI to delete same data on its side
+ * @param app Application to clean its data
+ * @param app_manager Application manager
+ */
+void DeleteApplicationData(ApplicationSharedPtr app,
+ ApplicationManager& app_manager);
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HELPERS_APPLICATION_HELPER_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
index ec7bbcebbd..9380fb41ac 100644
--- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
+++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
@@ -39,19 +39,12 @@
#include "json/json.h"
#include "utils/macro.h"
#include "application_manager/hmi_language_handler.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-} // namespace NsSmartObjects
-} // namespace NsSmartDeviceLink
+#include "smart_objects/smart_object.h"
namespace resumption {
class LastState;
} // namespace resumption
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
namespace application_manager {
class ApplicationManager;
@@ -98,6 +91,9 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool is_ivi_cooperating() const OVERRIDE;
void set_is_ivi_cooperating(const bool value) OVERRIDE;
+ bool is_rc_cooperating() const OVERRIDE;
+ void set_is_rc_cooperating(const bool value) OVERRIDE;
+
/*
* @brief Interface used to store information about software version of the
*target
@@ -414,6 +410,89 @@ class HMICapabilitiesImpl : public HMICapabilities {
*/
bool phone_call_supported() const OVERRIDE;
+ /*
+ * @brief Interface to store whether HMI supports video streaming
+ *
+ * @param supported Indicates whether video streaming is supported by HMI
+ */
+ void set_video_streaming_supported(const bool supported) OVERRIDE;
+
+ /*
+ * @brief Retrieves whether HMI supports video streaming
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool video_streaming_supported() const OVERRIDE;
+
+ /*
+ * @brief Interface to store whether HMI supports remote control
+ *
+ * @param supported Indicates whether video streaming is supported by HMI
+ */
+ void set_rc_supported(const bool supported) OVERRIDE;
+
+ /*
+ * @brief Retrieves whether HMI supports remote control
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ bool rc_supported() const OVERRIDE;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the navigation "System Capability"
+ *
+ * @param navigation_capability contains information related
+ * to the navigation system capability.
+ */
+ void set_navigation_capability(
+ const smart_objects::SmartObject& navigation_capability) OVERRIDE;
+
+ /*
+ * @brief Retrieves information regarding the navigation system capability
+ *
+ * @return NAVIGATION system capability
+ */
+ const smart_objects::SmartObject* navigation_capability() const OVERRIDE;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the phone "System Capability"
+ *
+ * @param phone_capability contains information related
+ * to the phone system capability.
+ */
+ void set_phone_capability(
+ const smart_objects::SmartObject& phone_capability) OVERRIDE;
+
+ /*
+ * @brief Retrieves information regarding the phone call system capability
+ *
+ * @return PHONE_CALL system capability
+ */
+
+ const smart_objects::SmartObject* phone_capability() const OVERRIDE;
+
+ /*
+ * @brief Sets HMI's video streaming related capability information
+ *
+ * @param video_streaming_capability the video streaming related capabilities
+ */
+ void set_video_streaming_capability(
+ const smart_objects::SmartObject& video_streaming_capability) OVERRIDE;
+
+ /*
+ * @brief Retrieves HMI's video streaming related capabilities
+ *
+ * @return HMI's video streaming related capability information
+ */
+ const smart_objects::SmartObject* video_streaming_capability() const OVERRIDE;
+
+ void set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) OVERRIDE;
+
+ const smart_objects::SmartObject* rc_capability() const OVERRIDE;
+
void Init(resumption::LastState* last_state) OVERRIDE;
/*
@@ -469,6 +548,7 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool is_ui_cooperating_;
bool is_navi_cooperating_;
bool is_ivi_cooperating_;
+ bool is_rc_cooperating_;
bool attenuated_supported_;
hmi_apis::Common_Language::eType ui_language_;
@@ -490,7 +570,13 @@ class HMICapabilitiesImpl : public HMICapabilities {
smart_objects::SmartObject* prerecorded_speech_;
bool is_navigation_supported_;
bool is_phone_call_supported_;
+ bool is_video_streaming_supported_;
+ bool is_rc_supported_;
std::string ccpu_version_;
+ smart_objects::SmartObject* navigation_capability_;
+ smart_objects::SmartObject* phone_capability_;
+ smart_objects::SmartObject* video_streaming_capability_;
+ smart_objects::SmartObject* rc_capability_;
ApplicationManager& app_mngr_;
HMILanguageHandler hmi_language_handler_;
@@ -500,4 +586,4 @@ class HMICapabilitiesImpl : public HMICapabilities {
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_CAPABILITIES_IMPL_H_
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces.h b/src/components/application_manager/include/application_manager/hmi_interfaces.h
index df1e2a9067..59ec32694a 100644
--- a/src/components/application_manager/include/application_manager/hmi_interfaces.h
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h
@@ -59,7 +59,8 @@ class HmiInterfaces {
HMI_INTERFACE_UI,
HMI_INTERFACE_Navigation,
HMI_INTERFACE_VehicleInfo,
- HMI_INTERFACE_SDL
+ HMI_INTERFACE_SDL,
+ HMI_INTERFACE_RC
};
/**
diff --git a/src/components/application_manager/include/application_manager/hmi_language_handler.h b/src/components/application_manager/include/application_manager/hmi_language_handler.h
index e8af02c189..6158cb4585 100644
--- a/src/components/application_manager/include/application_manager/hmi_language_handler.h
+++ b/src/components/application_manager/include/application_manager/hmi_language_handler.h
@@ -36,6 +36,8 @@
#include "application_manager/event_engine/event_observer.h"
#include "utils/lock.h"
#include "interfaces/HMI_API.h"
+#include "smart_objects/smart_object.h"
+
namespace resumption {
class LastState;
}
@@ -84,8 +86,7 @@ class HMILanguageHandler : public event_engine::EventObserver {
* @brief Trigger waiting for response
* @param request Request object
*/
- void set_handle_response_for(
- const event_engine::smart_objects::SmartObject& request);
+ void set_handle_response_for(const smart_objects::SmartObject& request);
/**
* @brief Sets default languages from HMI capabilities
diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h
index 31da7647fa..f2d665d998 100644
--- a/src/components/application_manager/include/application_manager/hmi_state.h
+++ b/src/components/application_manager/include/application_manager/hmi_state.h
@@ -30,17 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMISTATE_H
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMISTATE_H
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
#include <list>
#include "interfaces/MOBILE_API.h"
#include "utils/shared_ptr.h"
+#include "utils/macro.h"
namespace application_manager {
class HmiState;
class ApplicationManager;
+class Application;
typedef utils::SharedPtr<HmiState> HmiStatePtr;
@@ -70,7 +72,39 @@ class HmiState {
STATE_ID_EMBEDDED_NAVI
};
+ /**
+ * @brief HmiState constructor
+ * @param app Application pointer
+ * @param app_mngr Application manager
+ */
+ HmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ /**
+ * @brief HmiState constructor
+ * @param app Application pointer
+ * @param app_mngr Application manager
+ * @param state_id HMI state to assign
+ */
+ HmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr,
+ StateID state_id);
+
+ /**
+ * DEPRECATED
+ * @brief HmiState constructor
+ * @param app_id Application id
+ * @param app_mngr Application manager
+ */
HmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+
+ /**
+ * DEPRECATED
+ * @brief HmiState constructor
+ * @param app_id Application id
+ * @param app_mngr Application manager
+ * @param state_id HMI state to assign
+ */
HmiState(uint32_t app_id,
const ApplicationManager& app_mngr,
StateID state_id);
@@ -166,7 +200,7 @@ class HmiState {
}
protected:
- uint32_t app_id_;
+ utils::SharedPtr<Application> app_;
StateID state_id_;
const ApplicationManager& app_mngr_;
HmiStatePtr parent_;
@@ -177,24 +211,28 @@ class HmiState {
protected:
/**
* @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;
+ bool is_navi_app() const;
/**
* @brief is_media_app check if app is media
- * @param app_id application id
* @return true if media_app, otherwise return false
*/
- bool is_media_app(const uint32_t app_id) const;
+ bool is_media_app() const;
/**
* @brief is_voice_communicationn_app check if app is voice comunication
- * @param app_id application id
* @return true if voice_communicationn_app, otherwise return false
*/
- bool is_voice_communication_app(const uint32_t app_id) const;
+ bool is_voice_communication_app() const;
+
+ /**
+ * @brief is_mobile_projection_app checks if application of 'projection'
+ * HMI type
+ * @return True if application is of 'projection' HMI type, otherwise - false
+ */
+ bool is_mobile_projection_app() const;
private:
void operator=(const HmiState&);
@@ -207,7 +245,10 @@ class VRHmiState : public HmiState {
public:
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
- VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ VRHmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
};
/**
@@ -215,7 +256,11 @@ class VRHmiState : public HmiState {
*/
class TTSHmiState : public HmiState {
public:
- TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ TTSHmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+
virtual mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
};
@@ -226,7 +271,12 @@ class TTSHmiState : public HmiState {
*/
class NaviStreamingHmiState : public HmiState {
public:
- NaviStreamingHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ NaviStreamingHmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED NaviStreamingHmiState(uint32_t app_id,
+ const ApplicationManager& app_mngr);
+
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE;
};
@@ -237,7 +287,12 @@ class NaviStreamingHmiState : public HmiState {
*/
class PhoneCallHmiState : public HmiState {
public:
- PhoneCallHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ PhoneCallHmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED PhoneCallHmiState(uint32_t app_id,
+ const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -251,7 +306,12 @@ class PhoneCallHmiState : public HmiState {
*/
class SafetyModeHmiState : public HmiState {
public:
- SafetyModeHmiState(uint32_t app_id, const ApplicationManager& app_mngr);
+ SafetyModeHmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED SafetyModeHmiState(uint32_t app_id,
+ const ApplicationManager& app_mngr);
+
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
return mobile_apis::AudioStreamingState::NOT_AUDIBLE;
@@ -264,7 +324,11 @@ class SafetyModeHmiState : public HmiState {
*/
class DeactivateHMI : public HmiState {
public:
- DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr);
+ DeactivateHMI(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -278,7 +342,11 @@ class DeactivateHMI : public HmiState {
*/
class AudioSource : public HmiState {
public:
- AudioSource(uint32_t app_id, const ApplicationManager& app_mngr);
+ AudioSource(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED AudioSource(uint32_t app_id, const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -293,7 +361,11 @@ class AudioSource : public HmiState {
*/
class EmbeddedNavi : public HmiState {
public:
- EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr);
+ EmbeddedNavi(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr);
+
+ DEPRECATED EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr);
+
mobile_apis::HMILevel::eType hmi_level() const OVERRIDE;
mobile_apis::AudioStreamingState::eType audio_streaming_state()
const OVERRIDE {
@@ -301,4 +373,4 @@ class EmbeddedNavi : public HmiState {
}
};
}
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMISTATE_H
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_STATE_H_
diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h
index 521e0baca5..f399da6870 100644
--- a/src/components/application_manager/include/application_manager/message.h
+++ b/src/components/application_manager/include/application_manager/message.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,10 +39,9 @@
#include "utils/shared_ptr.h"
#include "protocol/message_priority.h"
#include "protocol/rpc_type.h"
+#include "protocol/common.h"
#include "smart_objects/smart_object.h"
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
namespace application_manager {
typedef std::vector<uint8_t> BinaryData;
@@ -59,30 +58,24 @@ enum MessageType {
// Map PrcType to corresponding MessageType
MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type);
-enum ProtocolVersion {
- kUnknownProtocol = -1,
- kHMI = 0,
- kV1 = 1,
- kV2 = 2,
- kV3 = 3,
- kV4 = 4
-};
-
class Message {
public:
- Message(protocol_handler::MessagePriority priority);
+ explicit Message(protocol_handler::MessagePriority priority);
Message(const Message& message);
Message& operator=(const Message& message);
- bool operator==(const Message& message);
+ bool operator==(const Message& message) const;
~Message();
//! --------------------------------------------------------------------------
int32_t function_id() const;
+#ifdef SDL_REMOTE_CONTROL
+ std::string function_name() const;
+#endif // SDL_REMOTE_CONTROL
int32_t correlation_id() const;
int32_t connection_key() const;
MessageType type() const;
- ProtocolVersion protocol_version() const;
+ protocol_handler::MajorProtocolVersion protocol_version() const;
const std::string& json_message() const;
const BinaryData* binary_data() const;
@@ -91,18 +84,27 @@ class Message {
size_t payload_size() const;
const smart_objects::SmartObject& smart_object() const;
- //! --------------------------------------------------------------------------
+ //!
+ //--------------------------------------------------------------------------.
void set_function_id(int32_t id);
+#ifdef SDL_REMOTE_CONTROL
+ void set_function_name(const std::string& name);
+#endif // SDL_REMOTE_CONTROL
void set_correlation_id(int32_t id);
void set_connection_key(int32_t key);
void set_message_type(MessageType type);
- void set_binary_data(BinaryData* data);
+ DEPRECATED void set_binary_data(BinaryData* data);
+ void set_binary_data(const BinaryData* data);
void set_json_message(const std::string& json_message);
- void set_protocol_version(ProtocolVersion version);
+ void set_protocol_version(protocol_handler::MajorProtocolVersion 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);
+ static bool is_sufficient_version(
+ protocol_handler::MajorProtocolVersion minVersion,
+ protocol_handler::MajorProtocolVersion version);
+
protocol_handler::MessagePriority Priority() const {
return priority_;
}
@@ -111,6 +113,9 @@ class Message {
int32_t function_id_; // @remark protocol V2.
int32_t correlation_id_; // @remark protocol V2.
MessageType type_; // @remark protocol V2.
+#ifdef SDL_REMOTE_CONTROL
+ std::string function_name_;
+#endif // SDL_REMOTE_CONTROL
// Pre-calculated message priority, higher priority messages are
// Processed first
@@ -124,8 +129,11 @@ class Message {
BinaryData* binary_data_;
size_t data_size_;
size_t payload_size_;
- ProtocolVersion version_;
+ protocol_handler::MajorProtocolVersion version_;
};
+
+typedef utils::SharedPtr<application_manager::Message> MobileMessage;
+typedef utils::SharedPtr<application_manager::Message> MessagePtr;
} // namespace application_manager
#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_
diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h
index a423ea7507..4edcd36486 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -2,6 +2,9 @@
Copyright (c) 2015, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -42,16 +45,10 @@
#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"
#include "protocol_handler/session_observer.h"
#include "application_manager/policies/policy_handler_interface.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
namespace policy {
class PolicyHandlerInterface;
@@ -59,7 +56,6 @@ class PolicyHandlerInterface;
namespace application_manager {
namespace mobile_api = mobile_apis;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
/*
* @brief Typedef for VehicleData
@@ -67,7 +63,7 @@ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
* @param const char* Name of the parameter in mobile request
* @param VehicleDataType Enum for vehicle data
*/
-typedef std::map<std::string, VehicleDataType> VehicleData;
+typedef std::map<std::string, mobile_apis::VehicleDataType::eType> VehicleData;
/**
* @brief MessageHelper class
@@ -103,6 +99,13 @@ class MessageHelper {
*/
static void SendOnLanguageChangeToMobile(uint32_t connection_key);
+ /**
+ * @brief Sends DecryptCertificate request to HMI
+ * @param file_name path to file containing encrypted certificate
+ */
+ static void SendDecryptCertificateToHMI(const std::string& file_name,
+ ApplicationManager& app_mngr);
+
/*
* @brief Retrieve vehicle data map for param name in mobile request
* to VehicleDataType
@@ -136,6 +139,8 @@ class MessageHelper {
static std::string MobileResultToString(
mobile_apis::Result::eType mobile_result);
+ static std::string GetDeviceMacAddressForHandle(
+ const uint32_t device_handle, const ApplicationManager& app_mngr);
/**
* @brief Converts string to mobile Result enum value
* @param mobile_result stringified value
@@ -177,7 +182,7 @@ class MessageHelper {
* @param hmi_level Desired HMI Level
*/
static std::string StringifiedHMILevel(
- mobile_apis::HMILevel::eType hmi_level);
+ const mobile_apis::HMILevel::eType hmi_level);
/*
* @brief Used to obtain function name by its id
@@ -210,10 +215,12 @@ class MessageHelper {
static smart_objects::SmartObjectSPtr CreateSetAppIcon(
const std::string& path_to_icon, uint32_t app_id);
+ DEPRECATED static bool SendIVISubscribtions(const uint32_t app_id,
+ ApplicationManager& app_mngr);
/**
* @brief Sends IVI subscription requests
*/
- static bool SendIVISubscribtions(const uint32_t app_id,
+ static bool SendIVISubscriptions(const uint32_t app_id,
ApplicationManager& app_mngr);
/**
@@ -340,11 +347,11 @@ class MessageHelper {
* @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 timeout Timeout to wait for PTU in seconds
* @param retries Seconds between retries
*/
static void SendPolicyUpdate(const std::string& file_path,
- int timeout,
+ const uint32_t timeout,
const std::vector<int>& retries,
ApplicationManager& app_mngr);
@@ -358,15 +365,36 @@ class MessageHelper {
uint32_t correlation_id,
ApplicationManager& app_mngr);
- /**
- * @brief Send GetListOfPermissions response to HMI
- * @param permissions Array of groups permissions
- * @param correlation_id Correlation id of request
- */
+/**
+ * @brief Send GetListOfPermissions response to HMI
+ * @param permissions Array of groups permissions
+ * @param external_consent_status External user consent status
+ * @param correlation_id Correlation id of request
+ */
+#ifdef EXTERNAL_PROPRIETARY_MODE
static void SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
- uint32_t correlation_id,
+ const policy::ExternalConsentStatus& external_consent_status,
+ const uint32_t correlation_id,
ApplicationManager& app_mngr);
+#else
+ static void SendGetListOfPermissionsResponse(
+ const std::vector<policy::FunctionalGroupPermission>& permissions,
+ const uint32_t correlation_id,
+ ApplicationManager& app_mngr);
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+ /*
+ * @brief Sends SetVideoConfig request to HMI to negotiate video parameters
+ *
+ * @param app_id the application which will start video streaming
+ * @param app_mngr reference of application manager
+ * @param video_params parameters of video streaming, notified by mobile
+ */
+ static void SendNaviSetVideoConfig(
+ int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params);
/*
* @brief Sends notification to HMI to start video streaming
@@ -518,6 +546,18 @@ class MessageHelper {
const uint32_t correlation_id,
int32_t result_code);
+ /**
+ * @brief Verify image and add image file full path
+ * and add path, although the image doesn't exist
+ * @param SmartObject with image
+ * @param app current application
+ * @return verification result
+ */
+ static mobile_apis::Result::eType VerifyImageApplyPath(
+ smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr);
+
/*
* @brief Verify image and add image file full path
*
@@ -666,13 +706,106 @@ class MessageHelper {
int32_t connection_key,
mobile_api::AppInterfaceUnregisteredReason::eType reason);
+ /**
+ * @brief SendDeleteCommandRequest sends requests to HMI to remove UI/VR
+ * command data depending on command parameters
+ * @param cmd Command data
+ * @param application Application owning the command data
+ * @param app_mngr Application manager
+ */
+ static void SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendDeleteSubmenuRequest sends UI/VR requests to HMI to remove
+ * submenues-related data depending on command parameters
+ * @param cmd Command data
+ * @param application Application owning the commmand data
+ * @param app_mngr Application manager
+ */
+ static void SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendDeleteChoiceSetRequest sends requests to HMI to remove
+ * choice sets - related data depending on command parameters
+ * @param cmd Command data
+ * @param application Application owning command data
+ * @param app_mngr Application manager
+ */
+ static void SendDeleteChoiceSetRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendResetPropertiesRequest sends requests to HMI to remove/reset
+ * global properties for application
+ * @param application Application to remove/reset global properties for
+ * @param app_mngr Application manager
+ */
+ static void SendResetPropertiesRequest(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendUnsubscribeButtonNotification sends notification to HMI to
+ * remove button subscription for application
+ * @param button Button type
+ * @param application Application to unsubscribe
+ * @param app_mngr Application manager
+ */
+ static void SendUnsubscribeButtonNotification(
+ mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+ /**
+ * @brief SendUnsubscribeIVIRequest sends request to HMI to remove vehicle
+ * data subscription for application
+ * @param ivi_id Vehicle data item id
+ * @param application Application to unsubscribe
+ * @param app_mngr Application manager
+ */
+ static void SendUnsubscribeIVIRequest(int32_t ivi_id,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr);
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Sends HMI status notification to mobile
+ * @param application_impl application with changed HMI status
+ **/
+ static void SendHMIStatusNotification(
+ const Application& application_impl,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief SendActivateAppToHMI Sends BasicCommunication.ActivateApp request to
+ * HMI
+ * @param app_id Application id
+ * @param application_manager Application manager
+ * @param level Application HMI level
+ * @param send_policy_priority Defines whether to send "priority" field with
+ * request
+ */
+ static void SendActivateAppToHMI(
+ uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL,
+ bool send_policy_priority = true);
+#endif // SDL_REMOTE_CONTROL
+
private:
/**
- * @brief Creates new request object and fill its header
- * @return New request object
+ * @brief CreateMessageForHMI Creates HMI message with prepared header
+ * acccoring to message type
+ * @param message_type Message type
+ * @param correlation_id Correlation id
+ * @return HMI message object with filled header
*/
- static smart_objects::SmartObjectSPtr CreateRequestObject(
- const uint32_t correlation_id);
+ static smart_objects::SmartObjectSPtr CreateMessageForHMI(
+ hmi_apis::messageType::eType message_type, const uint32_t correlation_id);
/**
* @brief Allows to fill SO according to the current permissions.
diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h
index 6b62258b23..ad660d0b66 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
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_H_
#include "utils/macro.h"
#include "protocol/common.h"
@@ -66,4 +66,4 @@ class MobileMessageHandler {
};
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_IMPL_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MOBILE_MESSAGE_HANDLER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h
index 6913f5038e..d836600ae3 100644
--- a/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h
+++ b/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h
@@ -1,82 +1,5 @@
-/*
- 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"
-#include "application_manager/policies/policy_handler_interface.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,
- policy::PolicyHandlerInterface& policy_handler);
-
- /**
- * @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_;
- policy::PolicyHandlerInterface& policy_handler_;
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "application_manager/policies/external/delegates/app_permission_delegate.h"
+#else
+#include "application_manager/policies/regular/delegates/app_permission_delegate.h"
+#endif
diff --git a/src/components/application_manager/include/application_manager/policies/delegates/statistics_delegate.h b/src/components/application_manager/include/application_manager/policies/delegates/statistics_delegate.h
index 3dc9ad925c..54e034f916 100644
--- a/src/components/application_manager/include/application_manager/policies/delegates/statistics_delegate.h
+++ b/src/components/application_manager/include/application_manager/policies/delegates/statistics_delegate.h
@@ -1,86 +1,5 @@
-/*
- 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 PolicyHandler;
-
-class StatisticsDelegate : public threads::ThreadDelegate {
- enum StatisticType { INCREMENT_GLOBAL, INCREMENT_APP, SET, ADD };
-
- public:
- StatisticsDelegate(PolicyHandler& policy_handler,
- usage_statistics::GlobalCounterId type);
-
- StatisticsDelegate(PolicyHandler& policy_handler,
- const std::string& app_id,
- usage_statistics::AppCounterId type);
-
- StatisticsDelegate(PolicyHandler& policy_handler,
- const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value);
-
- StatisticsDelegate(PolicyHandler& policy_handler,
- 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_;
- PolicyHandler& policy_handler_;
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_STATISTICS_DELEGATE_H_
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "application_manager/policies/external/delegates/statistics_delegate.h"
+#else
+#include "application_manager/policies/regular/delegates/statistics_delegate.h"
+#endif
diff --git a/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h
new file mode 100644
index 0000000000..f501598e0f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/external/delegates/app_permission_delegate.h
@@ -0,0 +1,85 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_APP_PERMISSION_DELEGATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_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"
+#include "application_manager/policies/policy_handler_interface.h"
+
+namespace policy {
+class PolicyHandler;
+/**
+*@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,
+ const ExternalConsentStatus& external_consent_status,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @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_;
+ ExternalConsentStatus external_consent_status_;
+ policy::PolicyHandlerInterface& policy_handler_;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_APP_PERMISSION_DELEGATE_H_
diff --git a/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h b/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h
new file mode 100644
index 0000000000..2fe4265f54
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/external/delegates/statistics_delegate.h
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_STATISTICS_DELEGATE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_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 PolicyHandler;
+
+class StatisticsDelegate : public threads::ThreadDelegate {
+ enum StatisticType { INCREMENT_GLOBAL, INCREMENT_APP, SET, ADD };
+
+ public:
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ usage_statistics::GlobalCounterId type);
+
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ const std::string& app_id,
+ usage_statistics::AppCounterId type);
+
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value);
+
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ 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_;
+ PolicyHandler& policy_handler_;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_DELEGATES_STATISTICS_DELEGATE_H_
diff --git a/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h
new file mode 100644
index 0000000000..8c904bf513
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/external/policy_event_observer.h
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
+
+#include "smart_objects/smart_object.h"
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/lock.h"
+
+namespace policy {
+
+class PolicyHandlerInterface;
+class PolicyEventObserver
+ : public application_manager::event_engine::EventObserver {
+ public:
+ explicit PolicyEventObserver(
+ policy::PolicyHandlerInterface* const policy_handler,
+ application_manager::event_engine::EventDispatcher& event_dispatcher);
+ void set_policy_handler(policy::PolicyHandlerInterface* const policy_handler);
+ void on_event(const application_manager::event_engine::Event& event);
+ void subscribe_on_event(
+ const application_manager::event_engine::Event::EventID& event_id,
+ int32_t hmi_correlation_id = 0);
+
+ private:
+ sync_primitives::Lock policy_handler_lock_;
+ PolicyHandlerInterface* policy_handler_;
+ void ProcessOdometerEvent(const ::smart_objects::SmartObject& message);
+};
+
+} // namespace policy
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
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 13f070a1ec..6f2bd37075 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
@@ -1,63 +1,5 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
-
-#include "application_manager/event_engine/event_observer.h"
-#include "utils/lock.h"
-
-namespace policy {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-class PolicyHandlerInterface;
-
-class PolicyEventObserver
- : public application_manager::event_engine::EventObserver {
- public:
- PolicyEventObserver(
- policy::PolicyHandlerInterface* const policy_handler,
- application_manager::event_engine::EventDispatcher& event_dispatcher);
- void set_policy_handler(policy::PolicyHandlerInterface* const policy_handler);
- void on_event(const application_manager::event_engine::Event& event);
- void subscribe_on_event(
- const application_manager::event_engine::Event::EventID& event_id,
- int32_t hmi_correlation_id = 0);
-
- private:
- sync_primitives::Lock policy_handler_lock_;
- PolicyHandlerInterface* policy_handler_;
- void ProcessOdometerEvent(const smart_objects::SmartObject& message);
-};
-
-} // namespace policy
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "application_manager/policies/external/policy_event_observer.h"
+#else
+#include "application_manager/policies/regular/policy_event_observer.h"
+#endif
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 6f36408444..ce5c0818f1 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
@@ -30,8 +30,8 @@
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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_H_
#include <string>
#include <map>
@@ -41,6 +41,7 @@
#include <stdint.h>
#include "policy/policy_manager.h"
+#include "application_manager/application.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/policies/policy_event_observer.h"
#include "application_manager/policies/delegates/statistics_delegate.h"
@@ -64,6 +65,7 @@ class ApplicationManager;
}
namespace policy {
+
typedef std::vector<uint32_t> AppIds;
typedef std::vector<uint32_t> DeviceHandles;
namespace custom_str = utils::custom_string;
@@ -92,30 +94,114 @@ class PolicyHandler : public PolicyHandlerInterface,
virtual void OnPermissionsUpdated(const std::string& policy_app_id,
const Permissions& permissions) OVERRIDE;
- virtual void OnSnapshotCreated(const BinaryMessage& pt_string) OVERRIDE;
-
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ void OnSnapshotCreated(const BinaryMessage& pt_string,
+ const std::vector<int>& retry_delay_seconds,
+ uint32_t timeout_exchange) OVERRIDE;
+#else // EXTERNAL_PROPRIETARY_MODE
+ void OnSnapshotCreated(const BinaryMessage& pt_string) OVERRIDE;
+#endif // EXTERNAL_PROPRIETARY_MODE
virtual bool GetPriority(const std::string& policy_app_id,
std::string* priority) const OVERRIDE;
- void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result) OVERRIDE;
+ virtual void CheckPermissions(
+ const application_manager::ApplicationSharedPtr app,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
virtual DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Sets HMI default type for specified application
+ * @param application_id ID application
+ * @param app_types list of HMI types
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const smart_objects::SmartObject* app_types) OVERRIDE;
+
+ /**
+ * Checks if application has HMI type
+ * @param application_id ID application
+ * @param hmi HMI type to check
+ * @param app_types additional list of HMI type to search in it
+ * @return true if hmi is contained in policy or app_types
+ */
+ bool CheckHMIType(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types) OVERRIDE;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) OVERRIDE;
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Notifies Remote apps about change in HMI status
+ * @param device_id Device on which app is running
+ * @param policy_app_id ID of application
+ * @param hmi_level new HMI level for this application
+ */
+ void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) OVERRIDE;
+
+ /**
+ * Gets all allowed module types
+ * @param app_id unique identifier of application
+ * @param list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+
bool GetDefaultHmi(const std::string& policy_app_id,
std::string* default_hmi) const OVERRIDE;
bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
StringArray* app_hmi_types = NULL) OVERRIDE;
- void GetServiceUrls(const std::string& service_type,
- EndpointUrls& end_points) OVERRIDE;
+ void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+ void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
virtual std::string GetLockScreenIconUrl() const OVERRIDE;
- void ResetRetrySequence() OVERRIDE;
uint32_t NextRetryTimeout() OVERRIDE;
- int TimeoutExchange() OVERRIDE;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeSec() const OVERRIDE;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in miliseconds
+ */
+ uint32_t TimeoutExchangeMSec() const OVERRIDE;
void OnExceededTimeout() OVERRIDE;
void OnSystemReady() OVERRIDE;
void PTUpdatedAt(Counters counter, int value) OVERRIDE;
@@ -150,11 +236,11 @@ class PolicyHandler : public PolicyHandlerInterface,
/**
* @brief Process user consent on mobile data connection access
- * @param Device id or empty string, if concern to all SDL functionality
- * @param User consent from response
+ * @param is_allowed - user consent from response
+ * @param device_mac - mac adress of device
*/
void OnAllowSDLFunctionalityNotification(
- bool is_allowed, const std::string& device_id) OVERRIDE;
+ bool is_allowed, const std::string& device_mac) OVERRIDE;
/**
* @brief Increment counter for ignition cycles
@@ -185,14 +271,32 @@ class PolicyHandler : public PolicyHandlerInterface,
void SetDeviceInfo(const std::string& device_id,
const DeviceInfo& device_info) OVERRIDE;
- /**
- * @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
- */
+/**
+ * @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
+ */
+
+/**
+ * @brief Processes permissions changes received from system via
+ * OnAppPermissionConsent notification
+ * @param connection_key Connection key of application, 0 if no key has been
+ * provided by notification
+ * @param permissions Structure containing group permissions changes
+ * @param external_consent_status Structure containig customer connectivity
+ * settings
+ * changes
+ */
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ void OnAppPermissionConsent(
+ const uint32_t connection_key,
+ const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status) OVERRIDE;
+#else
void OnAppPermissionConsent(const uint32_t connection_key,
const PermissionConsent& permissions) OVERRIDE;
+#endif
/**
* @brief Get appropriate message parameters and send them with response
@@ -287,8 +391,9 @@ class PolicyHandler : public PolicyHandlerInterface,
void OnSystemError(int code) OVERRIDE;
/**
- * @brief Choose application id to be used for snapshot sending
- * @return Application id or 0, if there are no applications registered
+ * @brief Chooses random application id to be used for snapshot sending
+ * considering HMI level
+ * @return Application id or 0, if there are no suitable applications
*/
uint32_t GetAppIdForSending() const OVERRIDE;
@@ -300,7 +405,9 @@ class PolicyHandler : public PolicyHandlerInterface,
virtual void OnCertificateUpdated(
const std::string& certificate_data) OVERRIDE;
-
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ void OnCertificateDecrypted(bool is_succeeded) OVERRIDE;
+#endif // EXTERNAL_PROPRIETARY_MODE
virtual bool CanUpdate() OVERRIDE;
virtual void OnDeviceConsentChanged(const std::string& device_id,
@@ -318,8 +425,12 @@ class PolicyHandler : public PolicyHandlerInterface,
* @brief Allows to add new or update existed application during
* registration process
* @param application_id The policy aplication id.
+ * @param hmi_types list of hmi types
+ * @return function that will notify update manager about new application
*/
- void AddApplication(const std::string& application_id) OVERRIDE;
+ StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
/**
* Checks whether application is revoked
@@ -354,7 +465,16 @@ class PolicyHandler : public PolicyHandlerInterface,
/**
* @brief Handler on applications search completed
*/
- void OnAppsSearchCompleted() OVERRIDE;
+ void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
+
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU.
+ *
+ * @param application_id registered application.
+ */
+ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
/**
* @brief Checks if certain request type is allowed for application
@@ -380,25 +500,24 @@ class PolicyHandler : public PolicyHandlerInterface,
*/
const VehicleInfo GetVehicleInfo() const OVERRIDE;
+#ifdef EXTERNAL_PROPRIETARY_MODE
/**
- * @brief OnAppRegisteredOnMobile allows to handle event when application were
- * succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU.
- *
- * @param application_id registered application.
+ * @brief Gets meta information
+ * @return meta information
*/
- void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+ const policy::MetaInfo GetMetaInfo() const OVERRIDE;
+#endif // EXTERNAL_PROPRIETARY_MODE
// TODO(AKutsan) REMOVE THIS UGLY HOTFIX
- virtual void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
- virtual void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type) OVERRIDE;
- virtual void Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value) OVERRIDE;
- virtual void Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds) OVERRIDE;
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) OVERRIDE;
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) OVERRIDE;
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) OVERRIDE;
#ifdef BUILD_TESTS
void SetPolicyManager(utils::SharedPtr<PolicyManager> pm) {
@@ -412,6 +531,17 @@ class PolicyHandler : public PolicyHandlerInterface,
const PolicySettings& get_settings() const OVERRIDE;
+ virtual void OnPTUFinished(const bool ptu_result) OVERRIDE;
+
+ /**
+ * @brief OnDeviceSwitching Notifies policy manager on device switch event so
+ * policy permissions should be processed accordingly
+ * @param device_id_from Id of device being switched
+ * @param device_id_to Id of device on the new transport
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) FINAL;
+
protected:
/**
* Starts next retry exchange policy table
@@ -439,21 +569,70 @@ class PolicyHandler : public PolicyHandlerInterface,
*/
bool CheckStealFocus(const std::string& policy_app_id) const;
- /**
- * @brief OnAppPermissionConsentInternal reacts on permission changing
- *
- * @param connection_key connection key
- *
- * @param permissions new permissions.
- */
- void OnAppPermissionConsentInternal(const uint32_t connection_key,
- PermissionConsent& permissions) OVERRIDE;
+/**
+ * @brief Processes data received via OnAppPermissionChanged notification
+ * from. Being started asyncronously from AppPermissionDelegate class.
+ * Sets updated permissions and ExternalConsent for registered applications
+ * and
+ * applications which already have appropriate group assigned which related to
+ * devices already known by policy
+ * @param connection_key Connection key of application, 0 if no key has been
+ * provided within notification
+ * @param external_consent_status Customer connectivity settings changes to
+ * process
+ * @param permissions Permissions changes to process
+ */
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ void OnAppPermissionConsentInternal(
+ const uint32_t connection_key,
+ const ExternalConsentStatus& external_consent_status,
+ PermissionConsent& out_permissions) OVERRIDE;
+#else
+ void OnAppPermissionConsentInternal(
+ const uint32_t connection_key,
+ PermissionConsent& out_permissions) OVERRIDE;
+#endif
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Updates HMI level for specified application and send notification
+ * @param app application where HMI level was changed
+ * @param level new HMI level
+ */
+ void UpdateHMILevel(application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level);
+ std::vector<std::string> GetDevicesIds(
+ const std::string& policy_app_id) OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
/**
* @brief Sets days after epoch on successful policy update
*/
void SetDaysAfterEpoch();
+ /**
+ * @brief Link all currently registered applications
+ */
+ void LinkAppsToDevice();
+
+ typedef std::vector<application_manager::ApplicationSharedPtr> Applications;
+
+ /**
+ * @brief Checks application registration status (SDL4.0) and device consent
+ * to find out whether application is suitable
+ * @param value Item from applications collection
+ * @return true if application is suitable, otherwise - false
+ */
+ bool IsAppSuitableForPolicyUpdate(const Applications::value_type value) const;
+
+ /**
+ * @brief Chooses random application from list using
+ * IsAppSuitableForPolicyUpdate
+ * @param app_list Application collection
+ * @return Application id if suitable is found, otherwise - zero
+ */
+ uint32_t ChooseRandomAppForPolicyUpdate(Applications& app_list) const;
+
private:
class StatisticManagerImpl : public usage_statistics::StatisticsManager {
public:
@@ -462,26 +641,26 @@ class PolicyHandler : public PolicyHandlerInterface,
DCHECK(policy_handler_);
}
// TODO(AKutsan) REMOVE THIS UGLY HOTFIX
- virtual void Increment(usage_statistics::GlobalCounterId type) {
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE {
policy_handler_->AsyncRun(new StatisticsDelegate(*policy_handler_, type));
}
void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type) {
+ usage_statistics::AppCounterId type) OVERRIDE {
policy_handler_->AsyncRun(
new StatisticsDelegate(*policy_handler_, app_id, type));
}
void Set(const std::string& app_id,
usage_statistics::AppInfoId type,
- const std::string& value) {
+ const std::string& value) OVERRIDE {
policy_handler_->AsyncRun(
new StatisticsDelegate(*policy_handler_, app_id, type, value));
}
void Add(const std::string& app_id,
usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds) {
+ int32_t timespan_seconds) OVERRIDE {
policy_handler_->AsyncRun(new StatisticsDelegate(
*policy_handler_, app_id, type, timespan_seconds));
}
@@ -489,13 +668,42 @@ class PolicyHandler : public PolicyHandlerInterface,
private:
PolicyHandler* policy_handler_;
};
-
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ void OnEmptyCertificateArrived() const;
+#endif // EXTERNAL_PROPRIETARY_MODE
bool SaveSnapshot(const BinaryMessage& pt_string, std::string& snap_path);
+
+ /**
+ * @brief Collects permissions for all currently registered applications on
+ * all devices
+ * @return consolidated permissions list or empty list if no
+ * applications/devices currently present
+ */
+ std::vector<FunctionalGroupPermission> CollectRegisteredAppsPermissions();
+
+ /**
+ * @brief Collects permissions for application with certain connection key
+ * @param connection_key Connection key of application to look for
+ * @return list of application permissions or empty list if no such
+ * application found
+ */
+ std::vector<FunctionalGroupPermission> CollectAppPermissions(
+ const uint32_t connection_key);
+
+ private:
static const std::string kLibrary;
+
+ /**
+ * @brief Collects currently registered applications ids linked to their
+ * device id
+ * @param out_links Collection of device_id-to-app_id links
+ */
+ void GetRegisteredLinks(std::map<std::string, std::string>& out_links) const;
+
+ private:
mutable sync_primitives::RWLock policy_manager_lock_;
utils::SharedPtr<PolicyManager> policy_manager_;
void* dl_handle_;
- AppIds last_used_app_ids_;
utils::SharedPtr<PolicyEventObserver> event_observer_;
uint32_t last_activated_app_id_;
@@ -508,11 +716,12 @@ class PolicyHandler : public PolicyHandlerInterface,
typedef std::list<PolicyHandlerObserver*> HandlersCollection;
HandlersCollection listeners_;
- sync_primitives::Lock listeners_lock_;
+ mutable sync_primitives::Lock listeners_lock_;
/**
- * @brief Application-to-device map is used for getting/setting user consents
- * for all apps
+ * @brief Application-to-device links are used for collecting their current
+ * consents to provide for HMI request and process response with possible
+ * changes done by user
*/
std::map<std::string, std::string> app_to_device_link_;
@@ -524,9 +733,19 @@ class PolicyHandler : public PolicyHandlerInterface,
application_manager::ApplicationManager& application_manager_;
friend class AppPermissionDelegate;
+ /**
+ * @brief Checks if the application with the given policy
+ * application id is registered or it is default id
+ * @param app_idx Application idx from EndpointUrls vector
+ * @param urls EndpointUrls vector
+ * @return TRUE if the vector with URLs with given idx is not empty
+ * and is related to a registered application or these are default URLs,
+ * otherwise FALSE
+ */
+ bool IsUrlAppIdValid(const uint32_t app_idx, const EndpointUrls& urls) const;
DISALLOW_COPY_AND_ASSIGN(PolicyHandler);
};
} // namespace policy
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_H_
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
deleted file mode 100644
index 794da0cdfb..0000000000
--- a/src/components/application_manager/include/application_manager/policies/policy_handler_observer.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
-
-#include <vector>
-#include <string>
-#include <map>
-
-namespace policy {
-
-class PolicyHandlerObserver {
- public:
- virtual void OnUpdateHMIAppType(
- std::map<std::string, std::vector<std::string> > app_hmi_types) {}
- virtual bool OnCertificateUpdated(const std::string& certificate_data) {
- return false;
- }
- virtual ~PolicyHandlerObserver() {}
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h b/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h
index f1a9ff55b8..334a7b3a2d 100644
--- a/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h
+++ b/src/components/application_manager/include/application_manager/policies/policy_retry_sequence.h
@@ -1,54 +1,5 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY 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_
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#error "policy_handler_observer.h is not available in policy external"
+#else
+#include "application_manager/policies/regular/policy_handler_observer.h"
+#endif
diff --git a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h
index 4e543eae96..81c5a708f2 100644
--- a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h
+++ b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler.h
@@ -1,47 +1,5 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#error "pt_exchange_handler.h is not available in policy external"
+#else
+#include "application_manager/policies/regular/pt_exchange_handler.h"
+#endif
diff --git a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h
index 05aec0c3e9..962b9c4009 100644
--- a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h
+++ b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_ext.h
@@ -1,52 +1,5 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#error "pt_exchange_handler_ext.h is not available in policy external"
+#else
+#include "application_manager/policies/regular/pt_exchange_handler_ext.h"
+#endif
diff --git a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h
index 29c74aa96e..004e87461e 100644
--- a/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h
+++ b/src/components/application_manager/include/application_manager/policies/pt_exchange_handler_impl.h
@@ -1,61 +1,5 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#error "pt_exchange_handler_impl.h is not available in policy external"
+#else
+#include "application_manager/policies/regular/pt_exchange_handler_impl.h"
+#endif
diff --git a/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h
new file mode 100644
index 0000000000..6913f5038e
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/regular/delegates/app_permission_delegate.h
@@ -0,0 +1,82 @@
+/*
+ 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"
+#include "application_manager/policies/policy_handler_interface.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,
+ policy::PolicyHandlerInterface& policy_handler);
+
+ /**
+ * @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_;
+ policy::PolicyHandlerInterface& policy_handler_;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_
diff --git a/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h b/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h
new file mode 100644
index 0000000000..3dc9ad925c
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/regular/delegates/statistics_delegate.h
@@ -0,0 +1,86 @@
+/*
+ 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 PolicyHandler;
+
+class StatisticsDelegate : public threads::ThreadDelegate {
+ enum StatisticType { INCREMENT_GLOBAL, INCREMENT_APP, SET, ADD };
+
+ public:
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ usage_statistics::GlobalCounterId type);
+
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ const std::string& app_id,
+ usage_statistics::AppCounterId type);
+
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value);
+
+ StatisticsDelegate(PolicyHandler& policy_handler,
+ 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_;
+ PolicyHandler& policy_handler_;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_STATISTICS_DELEGATE_H_
diff --git a/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h
new file mode 100644
index 0000000000..f4924111b3
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/regular/policy_event_observer.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
+
+#include "application_manager/event_engine/event_observer.h"
+#include "utils/lock.h"
+
+namespace policy {
+
+class PolicyHandlerInterface;
+
+class PolicyEventObserver
+ : public application_manager::event_engine::EventObserver {
+ public:
+ PolicyEventObserver(
+ policy::PolicyHandlerInterface* const policy_handler,
+ application_manager::event_engine::EventDispatcher& event_dispatcher);
+ void set_policy_handler(policy::PolicyHandlerInterface* const policy_handler);
+ void on_event(const application_manager::event_engine::Event& event);
+ void subscribe_on_event(
+ const application_manager::event_engine::Event::EventID& event_id,
+ int32_t hmi_correlation_id = 0);
+
+ private:
+ sync_primitives::Lock policy_handler_lock_;
+ PolicyHandlerInterface* policy_handler_;
+ void ProcessOdometerEvent(const ::smart_objects::SmartObject& message);
+};
+
+} // namespace policy
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h b/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h
new file mode 100644
index 0000000000..07d234f036
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/regular/policy_handler_observer.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
+
+#include <vector>
+#include <string>
+#include <map>
+
+namespace policy {
+
+class PolicyHandlerObserver {
+ public:
+ virtual void OnUpdateHMIAppType(
+ std::map<std::string, std::vector<std::string> > app_hmi_types) {}
+
+ virtual bool OnCertificateUpdated(const std::string& certificate_data) {
+ return false;
+ }
+
+ virtual void OnPTUFinished(const bool ptu_result) {}
+
+ virtual ~PolicyHandlerObserver() {}
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_POLICY_HANDLER_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h b/src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h
new file mode 100644
index 0000000000..f1a9ff55b8
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/policies/regular/policy_retry_sequence.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY 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_
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 479ebb217e..d3a5a0b821 100644
--- a/src/components/application_manager/include/application_manager/request_controller.h
+++ b/src/components/application_manager/include/application_manager/request_controller.h
@@ -49,6 +49,7 @@
#include "application_manager/request_info.h"
#include "application_manager/request_controller_settings.h"
+#include "application_manager/request_tracker.h"
namespace application_manager {
@@ -229,11 +230,15 @@ class RequestController {
void terminateWaitingForResponseAppRequests(const uint32_t& app_id);
/**
- * @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
+ * @brief Checks whether all constraints are met before adding of request into
+ * processing queue. Verifies amount of pending requests, amount of requests
+ * per time scale for different HMI levels
+ * @param request - request to check constraints for
+ * @param level - HMI level in which request has been issued
+ * @return Appropriate result code of verification
*/
- TResult CheckPosibilitytoAdd(const RequestPtr request);
+ TResult CheckPosibilitytoAdd(const RequestPtr request,
+ const mobile_api::HMILevel::eType level);
/**
* @brief Check Posibility to add new requests, or limits was exceeded
@@ -274,6 +279,12 @@ class RequestController {
RequestInfoSet waiting_for_response_;
/**
+ * @brief Tracker verifying time scale and maximum requests amount in
+ * different HMI levels
+ */
+ RequestTracker request_tracker_;
+
+ /**
* @brief Set of HMI notifications with timeout.
*/
std::list<RequestPtr> notification_list_;
diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h
index 193699be78..5ebcac71f8 100644
--- a/src/components/application_manager/include/application_manager/request_info.h
+++ b/src/components/application_manager/include/application_manager/request_info.h
@@ -55,17 +55,22 @@ namespace request_controller {
typedef utils::SharedPtr<commands::Command> RequestPtr;
struct RequestInfo {
- enum RequestType { MobileRequest, HMIRequest };
+ enum RequestType { RequestNone, MobileRequest, HMIRequest };
- RequestInfo() {}
+ RequestInfo()
+ : timeout_msec_(0)
+ , app_id_(0)
+ , requst_type_(RequestNone)
+ , correlation_id_(0) {
+ start_time_ = date_time::DateTime::getCurrentTime();
+ updateEndTime();
+ }
virtual ~RequestInfo() {}
RequestInfo(RequestPtr request,
const RequestType requst_type,
const uint64_t timeout_msec)
- : request_(request)
- , timeout_msec_(timeout_msec)
- , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM) {
+ : request_(request), timeout_msec_(timeout_msec), correlation_id_(0) {
start_time_ = date_time::DateTime::getCurrentTime();
updateEndTime();
requst_type_ = requst_type;
@@ -106,14 +111,6 @@ struct RequestInfo {
return app_id_;
}
- mobile_apis::HMILevel::eType hmi_level() {
- return hmi_level_;
- }
-
- void set_hmi_level(const mobile_apis::HMILevel::eType& level) {
- hmi_level_ = level;
- }
-
RequestType requst_type() const {
return requst_type_;
}
@@ -135,7 +132,6 @@ struct RequestInfo {
uint64_t timeout_msec_;
TimevalStruct end_time_;
uint32_t app_id_;
- mobile_apis::HMILevel::eType hmi_level_;
RequestType requst_type_;
uint32_t correlation_id_;
};
@@ -234,34 +230,6 @@ class RequestInfoSet {
*/
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
@@ -329,47 +297,6 @@ struct TimeScale {
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
diff --git a/src/components/application_manager/include/application_manager/request_tracker.h b/src/components/application_manager/include/application_manager/request_tracker.h
new file mode 100644
index 0000000000..36ab3eaefb
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/request_tracker.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TRACKER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TRACKER_H_
+
+#include <string>
+#include <map>
+#include <vector>
+#include "application_manager/request_controller_settings.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/date_time.h"
+
+namespace application_manager {
+
+namespace request_controller {
+
+/**
+ * @brief The TrackResult enum defines results of application request tracking
+ */
+enum class TrackResult {
+ kSuccess,
+ kNoneLevelMaxRequestsExceeded,
+ kMaxRequestsExceeded
+};
+
+/**
+ * @brief The RequestTracker class tracks requests per time constraints.
+ * There are several parameters in configuration file defining maximum
+ * requests
+ * number and time scale for that number, so application must consider that,
+ * otherwise it will be disconnected and won't be registered till next
+ * ignition
+ * cycle.
+ */
+class RequestTracker {
+ public:
+ typedef uint32_t ApplicationID;
+
+ /**
+ * @brief RequestTracker class constructor
+ * @param settings Settings instance having time scale and maximum requests
+ * values
+ */
+ explicit RequestTracker(const RequestControlerSettings& settings);
+
+ /**
+ * @brief Tracks amount of requests per defined time considering HMI level
+ * Currently there is a separate restrictions can be set for NONE level.
+ * Other levels tracked by single constraint.
+ * @param app_id Unique application id
+ * @param level HMI level of request
+ * @return Success if constraints are not exceeded, otherwise - exceeded
+ * error code (depends on HMI level)
+ */
+ TrackResult Track(const ApplicationID& app_id,
+ const mobile_apis::HMILevel::eType level);
+
+ private:
+ typedef std::vector<TimevalStruct> RequestAddedAt;
+ typedef std::map<ApplicationID, RequestAddedAt> ApplicationsRequestsTracker;
+
+ /**
+ * @brief Checks whether maximum requests number is exceeded per defined
+ * time
+ * scale.
+ * @param app_id Unique application id
+ * @param time_scale Time scale defined in configuration file
+ * @param max_requests Maximum requests number defined in configuration file
+ * @param tracker Container tracking applications requests amount and their
+ * time of addition into processing
+ * @return
+ */
+ bool Track(const ApplicationID& app_id,
+ const uint32_t time_scale,
+ const uint32_t max_requests,
+ ApplicationsRequestsTracker& tracker);
+
+ /**
+ * @brief settings_ having time scale and maximum requests values
+ */
+ const RequestControlerSettings& settings_;
+
+ /**
+ * @brief Tracker for applications requests done in NONE level
+ */
+ ApplicationsRequestsTracker none_level_tracker_;
+
+ /**
+ * @brief Tracker for applications requests done in other than NONE level
+ */
+ ApplicationsRequestsTracker tracker_;
+};
+
+} // namespace request_controller
+} // namespace application_manager
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_REQUEST_TRACKER_H_
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
index 26b1739a38..0ec58f2419 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h
@@ -115,11 +115,25 @@ class ResumeCtrl {
virtual void OnSuspend() = 0;
/**
+ * @brief Processes resumption data after receiving signal "Ignition Off"
+ */
+ virtual void OnIgnitionOff() = 0;
+
+ /**
* @brief Processes resumption data after receiving signal "Awake"
*/
virtual void OnAwake() = 0;
/**
+ * @brief Checks if SDL has already received OnExitAllApplication notification
+ * with "SUSPEND" reason
+ *
+ * @return Returns TRUE if SDL has received OnExitAllApplication notification
+ * with reason "SUSPEND" otherwise returns FALSE
+ */
+ virtual bool is_suspended() const = 0;
+
+ /**
* @brief Method stops timer "RsmCtrlPercist" when SDL
* receives OnExitAllApplication notification
* with reason "SUSPEND"
diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
index b7512df28b..d7ff621c95 100644
--- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
+++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h
@@ -129,11 +129,25 @@ class ResumeCtrlImpl : public ResumeCtrl,
void OnSuspend() OVERRIDE;
/**
+ * @brief Processes resumption data after receiving signal "Ignition Off"
+ */
+ void OnIgnitionOff() OVERRIDE;
+
+ /**
* @brief Processes resumption data after receiving signal "Awake"
*/
void OnAwake() OVERRIDE;
/**
+ * @brief Checks if SDL has already received OnExitAllApplication notification
+ * with "SUSPEND" reason
+ *
+ * @return Returns TRUE if SDL has received OnExitAllApplication notification
+ * with reason "SUSPEND" otherwise returns FALSE
+ */
+ bool is_suspended() const OVERRIDE;
+
+ /**
* @brief Method stops timer "RsmCtrlPercist" when SDL
* receives OnExitAllApplication notification
* with reason "SUSPEND"
@@ -301,6 +315,12 @@ class ResumeCtrlImpl : public ResumeCtrl,
void SaveDataOnTimer();
/**
+ * @brief FinalPersistData persists ResumptionData last time and stops
+ * persistent data timer to avoid further persisting
+ */
+ void FinalPersistData();
+
+ /**
* @brief AddFiles allows to add files for the application
* which should be resumed
* @param application application which will be resumed
@@ -380,8 +400,8 @@ class ResumeCtrlImpl : public ResumeCtrl,
/**
* @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
+ * then N seconds ago. N will be readed from profile.
+ * @return true if SDL started N seconds ago, otherwise return false
*/
bool CheckDelayAfterIgnOn();
@@ -491,6 +511,7 @@ class ResumeCtrlImpl : public ResumeCtrl,
WaitingForTimerList waiting_for_timer_;
bool is_resumption_active_;
bool is_data_saved_;
+ bool is_suspended_;
time_t launch_time_;
utils::SharedPtr<ResumptionData> resumption_storage_;
application_manager::ApplicationManager& application_manager_;
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data.h b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
index 469be2c902..bee2bce570 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data.h
@@ -36,6 +36,7 @@
#include "smart_objects/smart_object.h"
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
+#include "utils/macro.h"
namespace application_manager {
class ApplicationManagerSettings;
@@ -43,7 +44,6 @@ class ApplicationManagerSettings;
namespace resumption {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
namespace app_mngr = application_manager;
/**
@@ -92,7 +92,23 @@ class ResumptionData {
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
*/
- virtual void OnSuspend() = 0;
+ virtual void IncrementIgnOffCount() = 0;
+
+ /**
+ * @brief Increments ignition counter for all registered applications
+ * and remember ign_off time stamp
+ */
+ DEPRECATED virtual void OnSuspend() = 0;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ virtual void DecrementIgnOffCount() = 0;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ DEPRECATED virtual void OnAwake() = 0;
/**
* @brief Retrieves hash ID for the given mobile app ID
@@ -109,12 +125,6 @@ class ResumptionData {
std::string& hash_id) const = 0;
/**
- * @brief Increments ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- virtual void OnAwake() = 0;
-
- /**
* @brief Retrieves data of saved application for the given mobile app ID
* and device ID
* @param policy_app_id - mobile application id
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
index d08ecc2ae1..780aac82c1 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_DATA_DB_H_
#include "application_manager/resumption/resumption_data.h"
-#include "sql_database.h"
-#include "sql_query.h"
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
namespace resumption {
@@ -55,6 +55,7 @@ struct ApplicationParams {
mobile_apis::HMILevel::eType m_hmi_level;
bool m_is_media_application;
bool m_is_valid;
+ app_mngr::ApplicationSharedPtr app_ptr;
};
/**
@@ -113,7 +114,23 @@ class ResumptionDataDB : public ResumptionData {
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
*/
- virtual void OnSuspend();
+ DEPRECATED void OnSuspend() FINAL;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ DEPRECATED void OnAwake() FINAL;
+
+ /**
+ * @brief Increments ignition counter for all registered applications
+ * and remember ign_off time stamp
+ */
+ void IncrementIgnOffCount() FINAL;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ void DecrementIgnOffCount() FINAL;
/**
* @brief Retrieves hash ID for the given mobile app ID
@@ -130,12 +147,6 @@ class ResumptionDataDB : public ResumptionData {
std::string& hash_id) const;
/**
- * @brief Decrements ignition counter for all registered applications
- * and remember ign_off time stamp
- */
- virtual void OnAwake();
-
- /**
* @brief Retrieves data of saved application for the given mobile app ID
* and device ID
* @param policy_app_id - mobile application id
@@ -672,7 +683,7 @@ class ResumptionDataDB : public ResumptionData {
smart_objects::SmartObject& saved_app) const;
/**
- * @brief Selects data from applicationSubscribtionsArray table
+ * @brief Selects data from applicationSubscriptionsArray table
* @param policy_app_id contains mobile application id of application
* @param device_id contains id of device on which is running application
* @param saved_app will contain subscriptions
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
index 0be6d64db2..82ec1d9e5c 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h
@@ -85,13 +85,23 @@ class ResumptionDataJson : public ResumptionData {
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
*/
- virtual void OnSuspend();
+ DEPRECATED void OnSuspend() FINAL;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ DEPRECATED void OnAwake() FINAL;
/**
* @brief Increments ignition counter for all registered applications
* and remember ign_off time stamp
*/
- virtual void OnAwake();
+ void IncrementIgnOffCount() FINAL;
+
+ /**
+ * @brief Decrements ignition counter for all registered applications
+ */
+ void DecrementIgnOffCount() FINAL;
/**
* @brief Retrieves hash ID for the given mobile app ID
diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
index 3f8ca3a416..33d62740f7 100644
--- a/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
+++ b/src/components/application_manager/include/application_manager/resumption/resumption_sql_queries.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_SQL_QUERY_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_SQL_QUERY_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_SQL_QUERIES_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_SQL_QUERIES_H_
#include <string>
@@ -62,7 +62,7 @@ extern const std::string kDeleteFile;
extern const std::string kDeleteApplicationFilesArray;
extern const std::string kDeleteSubMenu;
extern const std::string kDeleteApplicationSubMenuArray;
-extern const std::string kDeleteApplicationSubscribtionsArray;
+extern const std::string kDeleteApplicationSubscriptionsArray;
extern const std::string kDeleteImageFromCommands;
extern const std::string kDeleteVrCommands;
extern const std::string kDeleteCommands;
@@ -135,4 +135,4 @@ extern const std::string kSelectSubscribedForWayPoints;
extern const std::string kDeleteSubscribedForWayPoints;
} // namespace resumption
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_SQL_QUERY_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUMPTION_SQL_QUERIES_H_
diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h
new file mode 100644
index 0000000000..da08957afa
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/service.h
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_
+
+#include <string>
+#include <sstream>
+#include <vector>
+#include "application_manager/application.h"
+#include "application_manager/application_manager_settings.h"
+#include "application_manager/message.h"
+#include "application_manager/hmi_interfaces.h"
+
+namespace application_manager {
+
+enum TypeAccess { kDisallowed, kAllowed };
+
+enum MessageValidationResult {
+ SUCCESS = 0,
+ INVALID_JSON,
+ INVALID_METADATA,
+ SCHEMA_MISMATCH,
+ UNSUPPORTED_PROTOCOL
+};
+
+typedef std::string PluginFunctionID;
+
+/**
+ * @brief Interface to core service
+ */
+class Service {
+ public:
+ virtual ~Service() {}
+
+ /**
+ * @brief Checks message permissions and cuts parameters according
+ * to policy table permissions
+ * @param msg message to cut disallowed parameters
+ * @return result according by mobile API
+ */
+ virtual mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) = 0;
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ virtual bool CheckModule(const ApplicationId& app_id,
+ const std::string& module) = 0;
+
+ /**
+ * @brief Get pointer to application by application id
+ * @param app_id application id
+ * return pointer to application
+ */
+ virtual ApplicationSharedPtr GetApplication(ApplicationId app_id) = 0;
+
+ /**
+ * Removes parameters not listed in HMI API from HMI request
+ * @param message message to handle
+ */
+ virtual void RemoveHMIFakeParameters(
+ application_manager::MessagePtr& message) = 0;
+ /**
+ * @brief Send message to HMI
+ * @param message Message to HMI
+ */
+ virtual void SendMessageToHMI(const MessagePtr& message) = 0;
+
+ /**
+ * @brief Send message to mobile device
+ * @param message Message to mobile
+ */
+ virtual void SendMessageToMobile(const MessagePtr& message) = 0;
+
+ /**
+ * @brief Returns unique correlation ID for next HMI request
+ *
+ * @return Unique correlation ID
+ */
+ virtual uint32_t GetNextCorrelationID() = 0;
+
+ /**
+ * @brief Returns all applications related to plugin
+ * @param uid ID provided by plugin to its extension to app.
+ * @return List with shared pointers to applications
+ */
+ virtual std::vector<ApplicationSharedPtr> GetApplications(
+ AppExtensionUID uid) = 0;
+
+ /**
+ * @brief Change hmi level of app and notify it
+ * @param app Application to be changed and notified
+ * @param level New HMI level of app
+ */
+ virtual void ChangeNotifyHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) = 0;
+
+ /**
+ * @brief Notify HMI about app changing HMI Level
+ * only NONE, BACKGROUND and LIMITED levels are sent
+ * @param app Application to be changed and notified
+ * @param level New HMI level of app
+ */
+ virtual void NotifyHMIAboutHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) = 0;
+
+ virtual const smart_objects::SmartObject* GetRCCapabilities() const = 0;
+ /**
+ * Checks if application has remote control functions
+ * @param app application
+ * @return true if application has remote control functions
+ */
+ virtual bool IsRemoteControlApplication(ApplicationSharedPtr app) const = 0;
+
+ /**
+ * @brief Gets current state of the specified interface
+ * @param interface which state to get
+ * @return true if specified interface available otherwise false
+ */
+ virtual bool IsInterfaceAvailable(
+ const HmiInterfaces::InterfaceID interface) const = 0;
+
+ /**
+ * Gets all allowed module types
+ * @param app_id unique identifier of application
+ * @param list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
+ /**
+ * @brief ValidateMessageBySchema validates message by xml schema
+ * @param message message for validation
+ * @return true if message is valid according to schema, otherwise false
+ */
+ virtual MessageValidationResult ValidateMessageBySchema(
+ const Message& message) = 0;
+
+ /**
+ * @brief Gets application manager settings structure
+ * @return reference to application manager settings structure
+ */
+ virtual const ApplicationManagerSettings& GetSettings() const = 0;
+};
+
+typedef utils::SharedPtr<Service> ServicePtr;
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index a1639eebd8..32a2315f23 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -2,6 +2,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017 Xevo Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -13,7 +16,7 @@
disclaimer in the documentation and/or other materials provided with the
distribution.
- Neither the name of the Ford Motor Company nor the names of its contributors
+ Neither the name of the copyright holders nor the names of their contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
@@ -69,6 +72,7 @@ extern const char* success;
extern const char* sync_msg_version;
extern const char* major_version;
extern const char* minor_version;
+extern const char* patch_version;
extern const char* app_name;
extern const char* ngn_media_screen_app_name;
extern const char* vr_synonyms;
@@ -89,6 +93,7 @@ extern const char* main_field_1;
extern const char* main_field_2;
extern const char* main_field_3;
extern const char* main_field_4;
+extern const char* metadata_tags;
extern const char* eta;
extern const char* time_to_destination;
extern const char* total_distance;
@@ -164,6 +169,15 @@ extern const char* speech_capabilities;
extern const char* vr_capabilities;
extern const char* audio_pass_thru_capabilities;
extern const char* pcm_stream_capabilities;
+extern const char* audio_pass_thru_icon;
+extern const char* way_points;
+extern const char* system_capability;
+extern const char* system_capability_type;
+extern const char* system_capabilities;
+extern const char* navigation_capability;
+extern const char* phone_capability;
+extern const char* video_streaming_capability;
+extern const char* rc_capability;
// PutFile
extern const char* sync_file_name;
@@ -255,6 +269,8 @@ extern const char* supported_diag_modes;
extern const char* hmi_capabilities;
extern const char* navigation;
extern const char* phone_call;
+extern const char* video_streaming;
+extern const char* remote_control;
extern const char* sdl_version;
extern const char* system_software_version;
extern const char* priority;
@@ -266,7 +282,7 @@ extern const char* application_choice_sets;
extern const char* application_global_properties;
extern const char* application_vehicle_info;
extern const char* application_buttons;
-extern const char* application_subscribtions;
+extern const char* application_subscriptions;
extern const char* application_files;
extern const char* application_show;
extern const char* resumption;
@@ -307,6 +323,44 @@ extern const char* is_suscribed;
extern const char* message_data;
extern const char* delivery_mode;
+
+extern const char* audio_streaming_indicator;
+
+// keys for default parameters loaded from hmi_capabilities.json:
+extern const char* const keyboard_properties_default;
+extern const char* const language_default;
+extern const char* const keyboard_layout_default;
+extern const char* const keypress_mode_default;
+
+// keys for supported parameters loaded from hmi_capabilities.json:
+extern const char* const keyboard_properties_supported;
+extern const char* const language_supported;
+extern const char* const keyboard_layout_supported;
+extern const char* const keypress_mode_supported;
+extern const char* const limited_characters_list_supported;
+extern const char* const auto_complete_text_supported;
+extern const char* const entity_type;
+extern const char* const entity_id;
+extern const char* const status;
+extern const char* const external_consent_status;
+extern const char* const consented_functions;
+extern const char* const source;
+extern const char* const config;
+extern const char* const protocol;
+extern const char* const codec;
+extern const char* const width;
+extern const char* const height;
+extern const char* const rejected_params;
+extern const char* const preferred_resolution;
+extern const char* const resolution_width;
+extern const char* const resolution_height;
+extern const char* const max_bitrate;
+extern const char* const supported_formats;
+extern const char* const haptic_spatial_data_supported;
+extern const char* const haptic_rect_data;
+extern const char* const rect;
+extern const char* const x;
+extern const char* const y;
} // namespace strings
namespace json {
@@ -358,6 +412,7 @@ namespace hmi_request {
extern const char* parent_id;
extern const char* field_name;
extern const char* field_text;
+extern const char* field_types;
extern const char* alert_strings;
extern const char* duration;
extern const char* soft_buttons;
@@ -380,6 +435,7 @@ extern const char* keyboard_layout;
extern const char* limited_character_list;
extern const char* auto_complete_text;
extern const char* file;
+extern const char* file_name;
extern const char* retry;
extern const char* service;
} // namespace hmi_request
diff --git a/src/components/application_manager/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h
index f2f9fb39a4..1b2033f5a8 100644
--- a/src/components/application_manager/include/application_manager/state_controller_impl.h
+++ b/src/components/application_manager/include/application_manager/state_controller_impl.h
@@ -289,7 +289,7 @@ class StateControllerImpl : public event_engine::EventObserver,
void HMIStateStarted(ApplicationSharedPtr app) {
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr old_hmi_state = app->CurrentHmiState();
- HmiStatePtr new_hmi_state = CreateHmiState(app->app_id(), ID);
+ HmiStatePtr new_hmi_state = CreateHmiState(app, ID);
DCHECK_OR_RETURN_VOID(new_hmi_state);
DCHECK_OR_RETURN_VOID(new_hmi_state->state_id() !=
HmiState::STATE_ID_REGULAR);
@@ -326,7 +326,7 @@ class StateControllerImpl : public event_engine::EventObserver,
DCHECK_OR_RETURN_VOID(app);
HmiStatePtr cur = app->CurrentHmiState();
HmiStatePtr old_hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, 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());
@@ -431,7 +431,8 @@ class StateControllerImpl : public event_engine::EventObserver,
* @param state_id state id
* @return
*/
- HmiStatePtr CreateHmiState(uint32_t app_id, HmiState::StateID state_id) const;
+ HmiStatePtr CreateHmiState(utils::SharedPtr<Application> app,
+ HmiState::StateID state_id) const;
mobile_apis::AudioStreamingState::eType CalcAudioState(
ApplicationSharedPtr app,
diff --git a/src/components/application_manager/include/application_manager/telemetry_observer.h b/src/components/application_manager/include/application_manager/telemetry_observer.h
index ab995fcf91..20b3aaca5a 100644
--- a/src/components/application_manager/include/application_manager/telemetry_observer.h
+++ b/src/components/application_manager/include/application_manager/telemetry_observer.h
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
@@ -39,7 +39,6 @@
#include "utils/shared_ptr.h"
#include "utils/date_time.h"
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
namespace application_manager {
class AMTelemetryObserver {
@@ -55,4 +54,4 @@ class AMTelemetryObserver {
virtual ~AMTelemetryObserver() {}
};
} // application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_USAGE_STATISTICS_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_TELEMETRY_OBSERVER_H_
diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h
index b84c820a60..886389b05c 100644
--- a/src/components/application_manager/include/application_manager/usage_statistics.h
+++ b/src/components/application_manager/include/application_manager/usage_statistics.h
@@ -62,6 +62,7 @@ class UsageStatistics {
void RecordAppUserSelection();
void RecordRunAttemptsWhileRevoked();
void RecordRemovalsForBadBehavior();
+ void RecordRejectionsSyncOutOfMemory();
void RecordTLSError();
private:
@@ -74,6 +75,7 @@ class UsageStatistics {
usage_statistics::AppCounter count_of_run_attempts_while_revoked_;
usage_statistics::AppCounter count_of_removals_for_bad_behavior_;
usage_statistics::AppCounter count_of_tls_error_;
+ usage_statistics::AppCounter count_of_rejections_sync_out_of_memory_;
DISALLOW_COPY_AND_ASSIGN(UsageStatistics);
};
diff --git a/src/components/application_manager/include/application_manager/vehicle_info_data.h b/src/components/application_manager/include/application_manager/vehicle_info_data.h
deleted file mode 100644
index 390a1707c8..0000000000
--- a/src/components/application_manager/include/application_manager/vehicle_info_data.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_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_
diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
index 260dde7205..7599dcccb3 100644
--- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -70,10 +70,9 @@ Json::Value& AppLaunchDataJson::GetApplicationData() const {
using namespace application_manager;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock autolock(app_launch_json_lock_);
- Json::Value& dictionary = last_state().dictionary;
+ Json::Value& dictionary = last_state().get_dictionary();
if (!dictionary.isMember(strings::app_launch)) {
- last_state().dictionary[strings::app_launch] =
- Json::Value(Json::objectValue);
+ dictionary[strings::app_launch] = Json::Value(Json::objectValue);
LOG4CXX_WARN(logger_, "app_launch section is missed");
}
Json::Value& app_launch = dictionary[strings::app_launch];
@@ -276,7 +275,7 @@ bool AppLaunchDataJson::DeleteOldestAppData() {
bool AppLaunchDataJson::Persist() {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock autolock(app_launch_json_lock_);
- last_state().SaveToFileSystem();
+ last_state().SaveStateToFileSystem();
return true;
}
diff --git a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
index 950bcd44fa..cc4765e6c9 100644
--- a/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_sql_queries.cc
@@ -36,7 +36,7 @@ namespace app_launch {
const std::string kCreateSchema =
"CREATE TABLE IF NOT EXISTS `app_launch`( "
" `deviceMac` TEXT, "
- " `appID` TEXT,"
+ " `appID` TEXT collate nocase,"
" `bundleID` TEXT,"
" `last_session` DATETIME, "
" PRIMARY KEY(`deviceMac`, `appID`, `bundleID`)"
diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc
index 41465ae985..bf3ce1e0a9 100644
--- a/src/components/application_manager/src/app_launch/apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/apps_launcher.cc
@@ -95,7 +95,8 @@ AppsLauncher::Launcher::Launcher(
connection_handler::ConnectionHandler& connection_handler,
const uint16_t app_launch_max_retry_attempt,
const uint16_t app_launch_retry_wait_time)
- : retry_timer_(
+ : retry_index_(0)
+ , retry_timer_(
"AppsLauncherTimer",
new timer::TimerTaskImpl<Launcher>(this, &Launcher::LaunchNow))
, app_launch_max_retry_attempt_(app_launch_max_retry_attempt)
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index e06497f1da..22a0f2628e 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -41,9 +41,11 @@
#include "utils/file_system.h"
#include "utils/logger.h"
#include "utils/gen_hash.h"
+#include "utils/shared_ptr.h"
#include "utils/make_shared.h"
#include "utils/timer_task_impl.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/resumption/resume_ctrl.h"
namespace {
@@ -75,10 +77,23 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
namespace application_manager {
+void SwitchApplicationParameters(ApplicationSharedPtr app,
+ const uint32_t app_id,
+ const size_t device_id,
+ const std::string& mac_address) {
+ utils::SharedPtr<ApplicationImpl> application =
+ ApplicationSharedPtr::dynamic_pointer_cast<ApplicationImpl>(app);
+ DCHECK_OR_RETURN_VOID(application);
+ application->app_id_ = app_id;
+ application->device_id_ = device_id;
+ application->mac_address_ = mac_address;
+}
+
ApplicationImpl::ApplicationImpl(
uint32_t application_id,
const std::string& mobile_app_id,
const std::string& mac_address,
+ const connection_handler::DeviceHandle device_id,
const custom_str::CustomString& app_name,
utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
ApplicationManager& application_manager)
@@ -88,6 +103,7 @@ ApplicationImpl::ApplicationImpl(
, active_message_(NULL)
, is_media_(false)
, is_navi_(false)
+ , mobile_projection_enabled_(false)
, video_streaming_approved_(false)
, audio_streaming_approved_(false)
, video_streaming_allowed_(false)
@@ -103,12 +119,14 @@ ApplicationImpl::ApplicationImpl(
, put_file_in_none_count_(0)
, delete_file_in_none_count_(0)
, list_files_in_none_count_(0)
- , device_(0)
, mac_address_(mac_address)
+ , device_id_(device_id)
, usage_report_(mobile_app_id, statistics_manager)
- , protocol_version_(ProtocolVersion::kV3)
+ , protocol_version_(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3)
, is_voice_communication_application_(false)
, is_resuming_(false)
+ , is_hash_changed_during_suspend_(false)
, video_stream_retry_number_(0)
, audio_stream_retry_number_(0)
, video_stream_suspend_timer_(
@@ -133,12 +151,6 @@ ApplicationImpl::ApplicationImpl(
SubscribeToButton(mobile_apis::ButtonName::CUSTOM_BUTTON);
// load persistent files
LoadPersistentFiles();
- HmiStatePtr initial_state = application_manager_.CreateRegularState(
- app_id(),
- mobile_apis::HMILevel::INVALID_ENUM,
- mobile_apis::AudioStreamingState::INVALID_ENUM,
- mobile_api::SystemContext::SYSCTXT_MAIN);
- state_.InitState(initial_state);
video_stream_suspend_timeout_ =
application_manager_.get_settings().video_data_stopped_timeout();
@@ -171,9 +183,15 @@ bool ApplicationImpl::IsFullscreen() const {
return mobile_api::HMILevel::HMI_FULL == hmi_level();
}
+bool ApplicationImpl::is_audio() const {
+ return is_media_application() || is_voice_communication_supported() ||
+ is_navi();
+}
+
void ApplicationImpl::ChangeSupportingAppHMIType() {
is_navi_ = false;
is_voice_communication_application_ = false;
+ mobile_projection_enabled_ = false;
const smart_objects::SmartObject& array_app_types = *app_types_;
uint32_t lenght_app_types = array_app_types.length();
@@ -188,6 +206,11 @@ void ApplicationImpl::ChangeSupportingAppHMIType() {
array_app_types[i].asUInt())) {
is_voice_communication_application_ = true;
}
+ if (mobile_apis::AppHMIType::PROJECTION ==
+ static_cast<mobile_apis::AppHMIType::eType>(
+ array_app_types[i].asUInt())) {
+ mobile_projection_enabled_ = true;
+ }
}
}
@@ -223,6 +246,15 @@ void ApplicationImpl::SetPostponedState(HmiStatePtr state) {
state_.AddState(state);
}
+void ApplicationImpl::set_mobile_projection_enabled(bool option) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ mobile_projection_enabled_ = option;
+}
+
+bool ApplicationImpl::mobile_projection_enabled() const {
+ return mobile_projection_enabled_;
+}
+
struct StateIDComparator {
HmiState::StateID state_id_;
StateIDComparator(HmiState::StateID state_id) : state_id_(state_id) {}
@@ -323,7 +355,7 @@ const std::string& ApplicationImpl::bundle_id() const {
}
connection_handler::DeviceHandle ApplicationImpl::device() const {
- return device_;
+ return device_id_;
}
const std::string& ApplicationImpl::mac_address() const {
@@ -394,6 +426,24 @@ bool ApplicationImpl::audio_streaming_allowed() const {
return audio_streaming_allowed_;
}
+bool ApplicationImpl::SetVideoConfig(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (ServiceType::kMobileNav == service_type) {
+ // See StartStreaming(). We issue SetVideoConfig and StartStream
+ // only when streaming is not approved yet
+ if (!video_streaming_approved()) {
+ LOG4CXX_TRACE(logger_, "Video streaming not approved");
+ MessageHelper::SendNaviSetVideoConfig(
+ app_id(), application_manager_, params);
+ return true;
+ }
+ }
+ return false;
+}
+
void ApplicationImpl::StartStreaming(
protocol_handler::ServiceType service_type) {
using namespace protocol_handler;
@@ -565,7 +615,7 @@ void ApplicationImpl::set_app_allowed(const bool allowed) {
}
void ApplicationImpl::set_device(connection_handler::DeviceHandle device) {
- device_ = device;
+ device_id_ = device;
}
uint32_t ApplicationImpl::get_grammar_id() const {
@@ -596,11 +646,12 @@ bool ApplicationImpl::set_activated(bool is_active) {
}
void ApplicationImpl::set_protocol_version(
- const ProtocolVersion& protocol_version) {
+ const protocol_handler::MajorProtocolVersion& protocol_version) {
protocol_version_ = protocol_version;
}
-ProtocolVersion ApplicationImpl::protocol_version() const {
+protocol_handler::MajorProtocolVersion ApplicationImpl::protocol_version()
+ const {
return protocol_version_;
}
@@ -679,19 +730,23 @@ bool ApplicationImpl::UnsubscribeFromButton(
bool ApplicationImpl::SubscribeToIVI(uint32_t vehicle_info_type) {
sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_.insert(vehicle_info_type).second;
+ return subscribed_vehicle_info_
+ .insert(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type))
+ .second;
}
bool ApplicationImpl::IsSubscribedToIVI(uint32_t vehicle_info_type) const {
sync_primitives::AutoLock lock(vi_lock_);
- VehicleInfoSubscriptions::const_iterator it =
- subscribed_vehicle_info_.find(vehicle_info_type);
+ VehicleInfoSubscriptions::const_iterator it = subscribed_vehicle_info_.find(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type));
return (subscribed_vehicle_info_.end() != it);
}
bool ApplicationImpl::UnsubscribeFromIVI(uint32_t vehicle_info_type) {
sync_primitives::AutoLock lock(vi_lock_);
- return subscribed_vehicle_info_.erase(vehicle_info_type);
+ return subscribed_vehicle_info_.erase(
+ static_cast<mobile_apis::VehicleDataType::eType>(vehicle_info_type));
}
UsageStatistics& ApplicationImpl::usage_report() {
@@ -816,6 +871,10 @@ bool ApplicationImpl::is_application_data_changed() const {
return is_application_data_changed_;
}
+void ApplicationImpl::SetInitialState(HmiStatePtr state) {
+ state_.InitState(state);
+}
+
void ApplicationImpl::set_is_application_data_changed(
bool state_application_data) {
is_application_data_changed_ = state_application_data;
@@ -827,7 +886,19 @@ void ApplicationImpl::UpdateHash() {
utils::gen_hash(application_manager_.get_settings().hash_string_size());
set_is_application_data_changed(true);
- MessageHelper::SendHashUpdateNotification(app_id(), application_manager_);
+ if (!application_manager_.resume_controller().is_suspended()) {
+ MessageHelper::SendHashUpdateNotification(app_id(), application_manager_);
+ } else {
+ is_hash_changed_during_suspend_ = true;
+ }
+}
+
+bool ApplicationImpl::IsHashChangedDuringSuspend() const {
+ return is_hash_changed_during_suspend_;
+}
+
+void ApplicationImpl::SetHashChangedDuringSuspend(const bool state) {
+ is_hash_changed_during_suspend_ = state;
}
void ApplicationImpl::CleanupFiles() {
@@ -967,4 +1038,93 @@ void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) {
}
}
+#ifdef SDL_REMOTE_CONTROL
+
+void ApplicationImpl::set_system_context(
+ const mobile_api::SystemContext::eType& system_context) {
+ const HmiStatePtr hmi_state = CurrentHmiState();
+ hmi_state->set_system_context(system_context);
+}
+
+void ApplicationImpl::set_audio_streaming_state(
+ const mobile_api::AudioStreamingState::eType& state) {
+ if (!(is_media_application() || is_navi()) &&
+ 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;
+ }
+ CurrentHmiState()->set_audio_streaming_state(state);
+}
+
+void ApplicationImpl::set_hmi_level(
+ const mobile_api::HMILevel::eType& new_hmi_level) {
+ using namespace mobile_apis;
+ const HMILevel::eType current_hmi_level = hmi_level();
+ if (HMILevel::HMI_NONE != current_hmi_level &&
+ HMILevel::HMI_NONE == new_hmi_level) {
+ put_file_in_none_count_ = 0;
+ delete_file_in_none_count_ = 0;
+ list_files_in_none_count_ = 0;
+ }
+ ApplicationSharedPtr app = application_manager_.application(app_id());
+ DCHECK_OR_RETURN_VOID(app)
+ application_manager_.state_controller().SetRegularState(app, new_hmi_level);
+ LOG4CXX_INFO(logger_, "hmi_level = " << new_hmi_level);
+ usage_report_.RecordHmiStateChanged(new_hmi_level);
+}
+
+const VehicleInfoSubscriptions& ApplicationImpl::SubscribesIVI() const {
+ return subscribed_vehicle_info_;
+}
+
+AppExtensionPtr ApplicationImpl::QueryInterface(AppExtensionUID uid) {
+ std::list<AppExtensionPtr>::const_iterator it = extensions_.begin();
+ for (; it != extensions_.end(); ++it) {
+ if ((*it)->uid() == uid) {
+ return (*it);
+ }
+ }
+
+ return AppExtensionPtr();
+}
+
+bool ApplicationImpl::AddExtension(AppExtensionPtr extension) {
+ if (!QueryInterface(extension->uid())) {
+ extensions_.push_back(extension);
+ return true;
+ }
+ return false;
+}
+
+bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) {
+ for (std::list<AppExtensionPtr>::iterator it = extensions_.begin();
+ extensions_.end() != it;
+ ++it) {
+ if ((*it)->uid() == uid) {
+ extensions_.erase(it);
+ return true;
+ }
+ }
+ return false;
+}
+
+void ApplicationImpl::RemoveExtensions() {
+ application_manager_.GetPluginManager().RemoveAppExtension(app_id_);
+}
+#endif // SDL_REMOTE_CONTROL
+
+void ApplicationImpl::PushMobileMessage(
+ smart_objects::SmartObjectSPtr mobile_message) {
+ sync_primitives::AutoLock lock(mobile_message_lock_);
+ mobile_message_queue_.push_back(mobile_message);
+}
+
+void ApplicationImpl::SwapMobileMessageQueue(
+ MobileMessageQueue& mobile_messages) {
+ sync_primitives::AutoLock lock(mobile_message_lock_);
+ mobile_messages.swap(mobile_message_queue_);
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc
index 97dcce10bf..a2703aca75 100644
--- a/src/components/application_manager/src/application_manager_impl.cc
+++ b/src/components/application_manager/src/application_manager_impl.cc
@@ -36,6 +36,7 @@
#include <string>
#include <fstream>
#include <utility>
+#include <bson_object.h>
#include "application_manager/application_manager_impl.h"
#include "application_manager/mobile_command_factory.h"
@@ -49,12 +50,15 @@
#include "application_manager/app_launch/app_launch_ctrl_impl.h"
#include "application_manager/app_launch/app_launch_data_db.h"
#include "application_manager/app_launch/app_launch_data_json.h"
+#include "application_manager/helpers/application_helper.h"
#include "protocol_handler/protocol_handler.h"
#include "hmi_message_handler/hmi_message_handler.h"
+#include "application_manager/command_holder_impl.h"
#include "connection_handler/connection_handler_impl.h"
#include "formatters/formatter_json_rpc.h"
#include "formatters/CFormatterJsonSDLRPCv2.h"
#include "formatters/CFormatterJsonSDLRPCv1.h"
+#include "protocol/bson_object_keys.h"
#include "utils/threads/thread.h"
#include "utils/file_system.h"
@@ -69,6 +73,12 @@
#include "utils/custom_string.h"
#include <time.h>
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/usage_statistics/counter.h"
+#include "functional_module/plugin_manager.h"
+#include "application_manager/core_service.h"
+#endif // SDL_REMOTE_CONTROL
+
namespace {
int get_rand_from_range(uint32_t from = 0, int to = RAND_MAX) {
return std::rand() % to + from;
@@ -85,9 +95,40 @@ DeviceTypes devicesType = {
hmi_apis::Common_TransportType::USB_IOS),
std::make_pair(std::string("BLUETOOTH"),
hmi_apis::Common_TransportType::BLUETOOTH),
+ std::make_pair(std::string("BLUETOOTH_IOS"),
+ hmi_apis::Common_TransportType::BLUETOOTH),
std::make_pair(std::string("WIFI"), hmi_apis::Common_TransportType::WIFI)};
}
+/**
+ * @brief device_id_comparator is predicate to compare application device id
+ * @param device_id Device id to compare with
+ * @param app Application pointer
+ * @return True if device id of application matches to device id passed
+ */
+bool device_id_comparator(const std::string& device_id,
+ ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ LOG4CXX_DEBUG(logger_,
+ "Data to compare: device_id : " << device_id << " app mac: "
+ << app->mac_address());
+
+ return device_id == app->mac_address();
+}
+
+/**
+ * @brief policy_app_id_comparator is predicate to compare policy application
+ * ids
+ * @param policy_app_id Policy id of application
+ * @param app Application pointer
+ * @return True if policy id of application matches to policy id passed
+ */
+bool policy_app_id_comparator(const std::string& policy_app_id,
+ ApplicationSharedPtr app) {
+ DCHECK_OR_RETURN(app, false);
+ return app->policy_app_id() == policy_app_id;
+}
+
uint32_t ApplicationManagerImpl::corelation_id_ = 0;
const uint32_t ApplicationManagerImpl::max_corelation_id_ = UINT_MAX;
@@ -102,14 +143,15 @@ ApplicationManagerImpl::ApplicationManagerImpl(
: settings_(am_settings)
, applications_list_lock_(true)
, audio_pass_thru_active_(false)
- , is_distracting_driver_(false)
+ , driver_distraction_state_(
+ hmi_apis::Common_DriverDistractionState::INVALID_ENUM)
, is_vr_session_strated_(false)
, hmi_cooperating_(false)
, is_all_apps_allowed_(true)
, media_manager_(NULL)
, hmi_handler_(NULL)
, connection_handler_(NULL)
- , policy_handler_(policy_settings, *this)
+ , policy_handler_(new policy::PolicyHandler(policy_settings, *this))
, protocol_handler_(NULL)
, request_ctrl_(am_settings)
, hmi_so_factory_(NULL)
@@ -139,6 +181,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::OnTimerSendTTSGlobalProperties))
, is_low_voltage_(false)
+ , apps_size_(0)
, is_stopping_(false) {
std::srand(std::time(0));
AddPolicyObserver(this);
@@ -155,6 +198,7 @@ ApplicationManagerImpl::ApplicationManagerImpl(
const uint32_t timeout_ms = 10000u;
clearing_timer->Start(timeout_ms, timer::kSingleShot);
timer_pool_.push_back(clearing_timer);
+ commands_holder_.reset(new CommandHolderImpl(*this));
}
ApplicationManagerImpl::~ApplicationManagerImpl() {
@@ -184,33 +228,6 @@ ApplicationManagerImpl::~ApplicationManagerImpl() {
navi_app_to_end_stream_.clear();
}
-template <class UnaryPredicate>
-ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor,
- UnaryPredicate finder) {
- ApplicationSet::iterator it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- if (accessor.GetData().end() == it) {
- LOG4CXX_DEBUG(logger_, "Unable to find application");
- return ApplicationSharedPtr();
- }
- ApplicationSharedPtr app = *it;
- LOG4CXX_DEBUG(logger_, " Found Application app_id = " << app->app_id());
- return app;
-}
-
-template <class UnaryPredicate>
-std::vector<ApplicationSharedPtr> FindAllApps(
- DataAccessor<ApplicationSet> accessor, UnaryPredicate finder) {
- std::vector<ApplicationSharedPtr> result;
- ApplicationSetConstIt it = std::find_if(
- accessor.GetData().begin(), accessor.GetData().end(), finder);
- while (it != accessor.GetData().end()) {
- result.push_back(*it);
- it = std::find_if(++it, accessor.GetData().end(), finder);
- }
- return result;
-}
-
DataAccessor<ApplicationSet> ApplicationManagerImpl::applications() const {
DataAccessor<ApplicationSet> accessor(applications_, applications_list_lock_);
return accessor;
@@ -290,6 +307,29 @@ ApplicationManagerImpl::applications_with_navi() {
DataAccessor<ApplicationSet> accessor = applications();
return FindAllApps(accessor, NaviAppPredicate);
}
+
+bool LimitedMobileProjectionPredicate(const ApplicationSharedPtr app) {
+ return app ? (app->mobile_projection_enabled() &&
+ app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)
+ : false;
+}
+
+ApplicationSharedPtr
+ApplicationManagerImpl::get_limited_mobile_projection_application() const {
+ DataAccessor<ApplicationSet> accessor = applications();
+ return FindApp(accessor, LimitedMobileProjectionPredicate);
+}
+
+bool MobileProjectionPredicate(const ApplicationSharedPtr app) {
+ return app ? app->mobile_projection_enabled() : false;
+}
+
+std::vector<ApplicationSharedPtr>
+ApplicationManagerImpl::applications_with_mobile_projection() {
+ DataAccessor<ApplicationSet> accessor = applications();
+ return FindAllApps(accessor, MobileProjectionPredicate);
+}
+
std::vector<ApplicationSharedPtr>
ApplicationManagerImpl::applications_by_button(uint32_t button) {
SubscribedToButtonPredicate finder(
@@ -298,28 +338,33 @@ ApplicationManagerImpl::applications_by_button(uint32_t button) {
return FindAllApps(accessor, finder);
}
-struct SubscribedToIVIPredicate {
- int32_t vehicle_info_;
- SubscribedToIVIPredicate(int32_t vehicle_info)
- : vehicle_info_(vehicle_info) {}
+struct IsApplication {
+ IsApplication(connection_handler::DeviceHandle device_handle,
+ const std::string& policy_app_id)
+ : device_handle_(device_handle), policy_app_id_(policy_app_id) {}
bool operator()(const ApplicationSharedPtr app) const {
- return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
+ return app && app->device() == device_handle_ &&
+ app->policy_app_id() == policy_app_id_;
}
+
+ private:
+ connection_handler::DeviceHandle device_handle_;
+ const std::string& policy_app_id_;
};
std::vector<ApplicationSharedPtr> ApplicationManagerImpl::IviInfoUpdated(
- VehicleDataType vehicle_info, int value) {
+ mobile_apis::VehicleDataType::eType vehicle_info, int value) {
// Notify Policy Manager if available about info it's interested in,
// i.e. odometer etc
switch (vehicle_info) {
- case ODOMETER:
+ case mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER:
GetPolicyHandler().KmsChanged(value);
break;
default:
break;
}
- SubscribedToIVIPredicate finder(static_cast<int32_t>(vehicle_info));
+ SubscribedToIVIPredicate finder(vehicle_info);
DataAccessor<ApplicationSet> accessor = applications();
return FindAllApps(accessor, finder);
}
@@ -347,11 +392,18 @@ void ApplicationManagerImpl::OnApplicationRegistered(ApplicationSharedPtr app) {
event.raise(event_dispatcher());
}
+void ApplicationManagerImpl::OnApplicationSwitched(ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ commands_holder_->Resume(app, CommandHolder::CommandType::kMobileCommand);
+ commands_holder_->Resume(app, CommandHolder::CommandType::kHmiCommand);
+}
+
bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
ApplicationConstSharedPtr app) const {
bool voice_state = app->is_voice_communication_supported();
bool media_state = app->is_media_application();
bool navi_state = app->is_navi();
+ bool mobile_projection_state = app->mobile_projection_enabled();
ApplicationSharedPtr active_app = active_application();
// Check app in FULL level
if (active_app.valid()) {
@@ -373,6 +425,10 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
if (navi_state && active_app->is_navi()) {
return true;
}
+
+ if (mobile_projection_state && active_app->mobile_projection_enabled()) {
+ return true;
+ }
}
// Check LIMITED apps
@@ -397,6 +453,14 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited(
}
}
+ if (mobile_projection_state) {
+ if (get_limited_mobile_projection_application().valid() &&
+ (get_limited_mobile_projection_application()->app_id() !=
+ app->app_id())) {
+ return true;
+ }
+ }
+
return false;
}
@@ -413,10 +477,10 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
// original app_id can be received via ApplicationImpl::mobile_app_id()
uint32_t app_id = 0;
std::list<int32_t> sessions_list;
- uint32_t device_id = 0;
+ connection_handler::DeviceHandle device_id = 0;
DCHECK_OR_RETURN(connection_handler_, ApplicationSharedPtr());
- if (connection_handler().GetDataOnSessionKey(
+ if (connection_handler().get_session_observer().GetDataOnSessionKey(
connection_key, &app_id, &sessions_list, &device_id) == -1) {
LOG4CXX_ERROR(logger_, "Failed to create application: no connection info.");
utils::SharedPtr<smart_objects::SmartObject> response(
@@ -429,6 +493,20 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
return ApplicationSharedPtr();
}
+ smart_objects::SmartObject& params = message[strings::msg_params];
+ const std::string& policy_app_id = params[strings::app_id].asString();
+ const custom_str::CustomString& app_name =
+ message[strings::msg_params][strings::app_name].asCustomString();
+ std::string device_mac;
+ std::string connection_type;
+ if (connection_handler().get_session_observer().GetDataOnDeviceID(
+ device_id, NULL, NULL, &device_mac, &connection_type) == -1) {
+ LOG4CXX_DEBUG(logger_, "Failed to extract device mac for id " << device_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Device mac for id" << device_id << " is " << device_mac);
+ }
+
LOG4CXX_DEBUG(logger_, "Restarting application list update timer");
GetPolicyHandler().OnAppsSearchStarted();
uint32_t timeout = get_settings().application_list_update_timeout();
@@ -447,32 +525,15 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
return ApplicationSharedPtr();
}
- smart_objects::SmartObject& params = message[strings::msg_params];
- const std::string& policy_app_id = params[strings::app_id].asString();
- const custom_str::CustomString& app_name =
- message[strings::msg_params][strings::app_name].asCustomString();
- std::string device_mac = "";
- if (connection_handler().get_session_observer().GetDataOnDeviceID(
- device_id, NULL, NULL, &device_mac, NULL) == -1) {
- LOG4CXX_ERROR(logger_, "Failed to extract device mac for id " << device_id);
- } else {
- LOG4CXX_DEBUG(logger_,
- "Device mac for id" << device_id << " is " << device_mac);
- }
ApplicationSharedPtr application(
new ApplicationImpl(app_id,
policy_app_id,
device_mac,
+ device_id,
app_name,
GetPolicyHandler().GetStatisticManager(),
*this));
if (!application) {
- usage_statistics::AppCounter count_of_rejections_sync_out_of_memory(
- GetPolicyHandler().GetStatisticManager(),
- policy_app_id,
- usage_statistics::REJECTIONS_SYNC_OUT_OF_MEMORY);
- ++count_of_rejections_sync_out_of_memory;
-
utils::SharedPtr<smart_objects::SmartObject> response(
MessageHelper::CreateNegativeResponse(
connection_key,
@@ -483,12 +544,19 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
return ApplicationSharedPtr();
}
+ HmiStatePtr initial_state =
+ CreateRegularState(utils::SharedPtr<Application>(application),
+ mobile_apis::HMILevel::INVALID_ENUM,
+ mobile_apis::AudioStreamingState::INVALID_ENUM,
+ mobile_api::SystemContext::SYSCTXT_MAIN);
+
+ application->SetInitialState(initial_state);
+
application->set_folder_name(policy_app_id + "_" +
application->mac_address());
// To load persistent files, app folder name must be known first, which is now
// depends on device_id and mobile_app_id
application->LoadPersistentFiles();
- application->set_device(device_id);
application->set_grammar_id(GenerateGrammarID());
mobile_api::Language::eType launguage_desired =
@@ -515,15 +583,18 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
version.max_supported_api_version = static_cast<APIVersion>(max_version);
application->set_version(version);
- ProtocolVersion protocol_version = static_cast<ProtocolVersion>(
- message[strings::params][strings::protocol_version].asInt());
+ protocol_handler::MajorProtocolVersion protocol_version =
+ static_cast<protocol_handler::MajorProtocolVersion>(
+ message[strings::params][strings::protocol_version].asInt());
application->set_protocol_version(protocol_version);
- if (ProtocolVersion::kUnknownProtocol != protocol_version) {
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN !=
+ protocol_version) {
connection_handler().BindProtocolVersionWithSession(
connection_key, static_cast<uint8_t>(protocol_version));
}
- if ((protocol_version == ProtocolVersion::kV3) &&
+ if ((protocol_version ==
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3) &&
(get_settings().heart_beat_timeout() != 0)) {
connection_handler().StartSessionHeartBeat(connection_key);
}
@@ -551,6 +622,8 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
const std::string& bundle_id = app_info[strings::bundle_id].asString();
application->set_bundle_id(bundle_id);
}
+ PutDriverDistractionMessageToPostponed(application);
+
// Stops timer of saving data to resumption in order to
// doesn't erase data from resumption storage.
// Timer will be started after hmi level resumption.
@@ -562,18 +635,19 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication(
applications_list_lock_.Acquire();
application->MarkRegistered();
applications_.insert(application);
+ apps_size_ = applications_.size();
applications_list_lock_.Release();
- GetPolicyHandler().AddApplication(application->policy_app_id());
-
return application;
}
-bool ApplicationManagerImpl::RemoveAppDataFromHMI(ApplicationSharedPtr app) {
+DEPRECATED bool ApplicationManagerImpl::RemoveAppDataFromHMI(
+ ApplicationSharedPtr app) {
return true;
}
-bool ApplicationManagerImpl::LoadAppDataToHMI(ApplicationSharedPtr app) {
+DEPRECATED bool ApplicationManagerImpl::LoadAppDataToHMI(
+ ApplicationSharedPtr app) {
return true;
}
@@ -670,6 +744,13 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() {
hmi_apis::FunctionID::VehicleInfo_IsReady, *this));
ManageHMICommand(is_ivi_ready);
+#ifdef SDL_REMOTE_CONTROL
+ utils::SharedPtr<smart_objects::SmartObject> is_rc_ready(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady,
+ *this));
+ ManageHMICommand(is_rc_ready);
+#endif
+
utils::SharedPtr<smart_objects::SmartObject> button_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Buttons_GetCapabilities, *this));
@@ -713,11 +794,18 @@ bool ApplicationManagerImpl::EndAudioPassThrough() {
}
}
-void ApplicationManagerImpl::set_driver_distraction(const bool is_distracting) {
- is_distracting_driver_ = is_distracting;
+hmi_apis::Common_DriverDistractionState::eType
+ApplicationManagerImpl::driver_distraction_state() const {
+ return driver_distraction_state_;
+}
+
+void ApplicationManagerImpl::set_driver_distraction_state(
+ const hmi_apis::Common_DriverDistractionState::eType state) {
+ driver_distraction_state_ = state;
}
-void ApplicationManagerImpl::set_vr_session_started(const bool state) {
+DEPRECATED void ApplicationManagerImpl::set_vr_session_started(
+ const bool state) {
is_vr_session_strated_ = state;
}
@@ -726,6 +814,18 @@ void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) {
}
HmiStatePtr ApplicationManagerImpl::CreateRegularState(
+ utils::SharedPtr<Application> app,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::SystemContext::eType system_context) const {
+ HmiStatePtr state(new HmiState(app, *this));
+ state->set_hmi_level(hmi_level);
+ state->set_audio_streaming_state(audio_state);
+ state->set_system_context(system_context);
+ return state;
+}
+
+HmiStatePtr ApplicationManagerImpl::CreateRegularState(
uint32_t app_id,
mobile_apis::HMILevel::eType hmi_level,
mobile_apis::AudioStreamingState::eType audio_state,
@@ -982,16 +1082,115 @@ void ApplicationManagerImpl::RemoveDevice(
LOG4CXX_DEBUG(logger_, "device_handle " << device_handle);
}
+void ApplicationManagerImpl::OnDeviceSwitchingStart(
+ const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ auto apps_data_accessor = applications();
+
+ std::copy_if(apps_data_accessor.GetData().begin(),
+ apps_data_accessor.GetData().end(),
+ std::back_inserter(reregister_wait_list_),
+ std::bind1st(std::ptr_fun(&device_id_comparator),
+ device_from.mac_address()));
+ }
+
+ {
+ // During sending of UpdateDeviceList this lock is acquired also so making
+ // it scoped
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+ for (auto i = reregister_wait_list_.begin();
+ reregister_wait_list_.end() != i;
+ ++i) {
+ auto app = *i;
+ request_ctrl_.terminateAppRequests(app->app_id());
+ resume_ctrl_->SaveApplication(app);
+ }
+ }
+
+ policy_handler_->OnDeviceSwitching(device_from.mac_address(),
+ device_to.mac_address());
+
+ connection_handler::DeviceMap device_list;
+ device_list.insert(std::make_pair(device_to.device_handle(), device_to));
+
+ smart_objects::SmartObjectSPtr msg_params =
+ MessageHelper::CreateDeviceListSO(device_list, GetPolicyHandler(), *this);
+ if (!msg_params) {
+ LOG4CXX_ERROR(logger_, "Can't create UpdateDeviceList notification");
+ return;
+ }
+
+ auto update_list = utils::MakeShared<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;
+ so_to_send[jhs::S_PARAMS][jhs::S_MESSAGE_TYPE] =
+ hmi_apis::messageType::request;
+ so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_VERSION] = 2;
+ so_to_send[jhs::S_PARAMS][jhs::S_PROTOCOL_TYPE] = 1;
+ so_to_send[jhs::S_PARAMS][jhs::S_CORRELATION_ID] = GetNextHMICorrelationID();
+ so_to_send[jhs::S_MSG_PARAMS] = *msg_params;
+ ManageHMICommand(update_list);
+}
+
+void ApplicationManagerImpl::OnDeviceSwitchingFinish(
+ const std::string& device_uid) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ UNUSED(device_uid);
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+
+ const bool unexpected_disonnect = true;
+ const bool is_resuming = true;
+ for (auto app_it = reregister_wait_list_.begin();
+ app_it != reregister_wait_list_.end();
+ ++app_it) {
+ auto app = *app_it;
+ UnregisterApplication(app->app_id(),
+ mobile_apis::Result::INVALID_ENUM,
+ is_resuming,
+ unexpected_disonnect);
+ }
+ reregister_wait_list_.clear();
+}
+
+void ApplicationManagerImpl::SwitchApplication(ApplicationSharedPtr app,
+ const uint32_t connection_key,
+ const size_t device_id,
+ const std::string& mac_address) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+ sync_primitives::AutoLock lock(applications_list_lock_);
+ DCHECK_OR_RETURN_VOID(1 == applications_.erase(app));
+
+ LOG4CXX_DEBUG(logger_,
+ "Changing app id to " << connection_key
+ << ". Changing device id to "
+ << device_id);
+
+ SwitchApplicationParameters(app, connection_key, device_id, mac_address);
+
+ // Normally this is done during registration, however since switched apps are
+ // not being registered again need to set protocol version on session.
+ connection_handler().BindProtocolVersionWithSession(
+ connection_key, static_cast<uint8_t>(app->protocol_version()));
+
+ // Application need to be re-inserted in order to keep sorting in applications
+ // container. Otherwise data loss on erasing is possible.
+ applications_.insert(app);
+}
+
mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel(
ApplicationConstSharedPtr application) const {
using namespace mobile_apis;
LOG4CXX_AUTO_TRACE(logger_);
HMILevel::eType default_hmi = HMILevel::HMI_NONE;
- if (policy_handler_.PolicyEnabled()) {
+ if (GetPolicyHandler().PolicyEnabled()) {
const std::string policy_app_id = application->policy_app_id();
std::string default_hmi_string = "";
- if (policy_handler_.GetDefaultHmi(policy_app_id, &default_hmi_string)) {
+ if (GetPolicyHandler().GetDefaultHmi(policy_app_id, &default_hmi_string)) {
if ("BACKGROUND" == default_hmi_string) {
default_hmi = HMILevel::HMI_BACKGROUND;
} else if ("FULL" == default_hmi_string) {
@@ -1136,20 +1335,134 @@ bool ApplicationManagerImpl::StartNaviService(
return false;
}
+bool ApplicationManagerImpl::StartNaviService(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ const BsonObject* params) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (HMILevelAllowsStreaming(app_id, service_type)) {
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ std::pair<NaviServiceStatusMap::iterator, bool> res =
+ navi_service_status_.insert(
+ std::pair<uint32_t, std::pair<bool, bool> >(
+ app_id, std::make_pair(false, false)));
+ if (!res.second) {
+ LOG4CXX_WARN(logger_, "Navi service refused");
+ return false;
+ }
+ it = res.first;
+ }
+ }
+
+ if (service_type == ServiceType::kMobileNav) {
+ smart_objects::SmartObject converted_params(smart_objects::SmartType_Map);
+ ConvertVideoParamsToSO(converted_params, params);
+ std::vector<std::string> rejected_params;
+ if (converted_params.keyExists(strings::codec) &&
+ converted_params[strings::codec] ==
+ hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM) {
+ rejected_params.push_back(strings::codec);
+ }
+ if (converted_params.keyExists(strings::protocol) &&
+ converted_params[strings::protocol] ==
+ hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM) {
+ rejected_params.push_back(strings::protocol);
+ }
+
+ if (!rejected_params.empty()) {
+ OnStreamingConfigured(app_id, service_type, false, rejected_params);
+ return false;
+ } else if (!converted_params.empty()) {
+ LOG4CXX_INFO(logger_, "Sending video configuration params");
+#ifdef DEBUG
+ MessageHelper::PrintSmartObject(converted_params);
+#endif
+ bool request_sent =
+ application(app_id)->SetVideoConfig(service_type, converted_params);
+ if (request_sent) {
+ return true;
+ }
+ }
+ }
+ // no configuration is needed, or SetVideoConfig is not sent
+ std::vector<std::string> empty;
+ OnStreamingConfigured(app_id, service_type, true, empty);
+ return true;
+
+ } else {
+ LOG4CXX_WARN(logger_, "Refused navi service by HMI level");
+ }
+ std::vector<std::string> empty;
+ OnStreamingConfigured(app_id, service_type, false, empty);
+ return false;
+}
+
+void ApplicationManagerImpl::OnStreamingConfigured(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params) {
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ LOG4CXX_INFO(logger_,
+ "OnStreamingConfigured called for service "
+ << service_type << ", result=" << result);
+
+ if (result) {
+ std::vector<std::string> empty;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ LOG4CXX_WARN(logger_, "Application not found in navi status map");
+ connection_handler().NotifyServiceStartedResult(app_id, false, empty);
+ return;
+ }
+
+ // 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);
+ connection_handler().NotifyServiceStartedResult(app_id, true, empty);
+ } else {
+ std::vector<std::string> converted_params =
+ ConvertRejectedParamList(rejected_params);
+ connection_handler().NotifyServiceStartedResult(
+ app_id, false, converted_params);
+ }
+}
+
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;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ 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);
@@ -1161,6 +1474,9 @@ void ApplicationManagerImpl::StopNaviService(
app->StopStreaming(service_type);
}
+// Suppress warning for deprecated method used within another deprecated method
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
bool ApplicationManagerImpl::OnServiceStartedCallback(
const connection_handler::DeviceHandle& device_handle,
const int32_t& session_key,
@@ -1196,6 +1512,50 @@ bool ApplicationManagerImpl::OnServiceStartedCallback(
}
return false;
}
+#pragma GCC diagnostic pop
+
+void ApplicationManagerImpl::OnServiceStartedCallback(
+ const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params) {
+ using namespace helpers;
+ using namespace protocol_handler;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "ServiceType = " << type << ". Session = " << std::hex
+ << session_key);
+ std::vector<std::string> empty;
+
+ if (type == kRpc) {
+ LOG4CXX_DEBUG(logger_, "RPC service is about to be started.");
+ connection_handler().NotifyServiceStartedResult(session_key, true, empty);
+ return;
+ }
+ ApplicationSharedPtr app = application(session_key);
+ if (!app) {
+ LOG4CXX_WARN(logger_,
+ "The application with id:" << session_key
+ << " doesn't exists.");
+ connection_handler().NotifyServiceStartedResult(session_key, false, empty);
+ return;
+ }
+
+ if (Compare<ServiceType, EQ, ONE>(
+ type, ServiceType::kMobileNav, ServiceType::kAudio)) {
+ if (app->is_navi() || app->mobile_projection_enabled()) {
+ if (!StartNaviService(session_key, type, params)) {
+ LOG4CXX_WARN(logger_, "Starting Navigation service failed");
+ }
+ return;
+ } else {
+ LOG4CXX_WARN(logger_, "Refuse not navi/projection application");
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Refuse unknown service");
+ }
+ connection_handler().NotifyServiceStartedResult(session_key, false, empty);
+}
void ApplicationManagerImpl::OnServiceEndedCallback(
const int32_t& session_key,
@@ -1211,6 +1571,17 @@ void ApplicationManagerImpl::OnServiceEndedCallback(
<< type << " with reason " << close_reason
<< " in session 0x" << std::hex << session_key);
+ auto app = application(static_cast<uint32_t>(session_key));
+ if (!app) {
+ return;
+ }
+
+ if (IsAppInReconnectMode(app->policy_app_id())) {
+ LOG4CXX_DEBUG(logger_,
+ "Application is in reconnection list and won't be closed.");
+ return;
+ }
+
if (type == kRpc) {
LOG4CXX_INFO(logger_, "Remove application.");
/* In case it was unexpected disconnect or some special case
@@ -1293,6 +1664,12 @@ void ApplicationManagerImpl::OnCertificateUpdateRequired() {
GetPolicyHandler().OnPTExchangeNeeded();
}
+bool ApplicationManagerImpl::GetPolicyCertificateData(std::string& data) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ data = GetPolicyHandler().RetrieveCertificate();
+ return true;
+}
+
security_manager::SSLContext::HandshakeContext
ApplicationManagerImpl::GetHandshakeContext(uint32_t key) const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1304,6 +1681,15 @@ ApplicationManagerImpl::GetHandshakeContext(uint32_t key) const {
}
return SSLContext::HandshakeContext();
}
+
+bool ApplicationManagerImpl::CheckAppIsNavi(const uint32_t app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app = application(app_id);
+ if (app) {
+ return app->is_navi();
+ }
+ return false;
+}
#endif // ENABLE_SECURITY
void ApplicationManagerImpl::set_hmi_message_handler(
@@ -1353,13 +1739,16 @@ void ApplicationManagerImpl::SendMessageToMobile(
ApplicationSharedPtr app = application(
(*message)[strings::params][strings::connection_key].asUInt());
+ const bool is_result_code_exists =
+ (*message)[strings::msg_params].keyExists(strings::result_code);
+
if (!app) {
LOG4CXX_ERROR(logger_, "No application associated with connection key");
- if ((*message)[strings::msg_params].keyExists(strings::result_code) &&
+ if (is_result_code_exists &&
((*message)[strings::msg_params][strings::result_code] ==
NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION)) {
(*message)[strings::params][strings::protocol_version] =
- ProtocolVersion::kV1;
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1;
} else {
(*message)[strings::params][strings::protocol_version] =
SupportedSDLVersion();
@@ -1369,6 +1758,12 @@ void ApplicationManagerImpl::SendMessageToMobile(
app->protocol_version();
}
+ if (app && is_result_code_exists &&
+ (*message)[strings::msg_params][strings::result_code] ==
+ mobile_apis::Result::OUT_OF_MEMORY) {
+ app->usage_report().RecordRejectionsSyncOutOfMemory();
+ }
+
mobile_so_factory().attachSchema(*message, false);
LOG4CXX_DEBUG(
logger_,
@@ -1390,6 +1785,19 @@ void ApplicationManagerImpl::SendMessageToMobile(
msg_to_mobile[strings::params][strings::correlation_id].asUInt(),
msg_to_mobile[strings::params][strings::connection_key].asUInt(),
msg_to_mobile[strings::params][strings::function_id].asInt());
+#ifdef SDL_REMOTE_CONTROL
+ const mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asUInt());
+ if (function_id == mobile_apis::FunctionID::RegisterAppInterfaceID &&
+ (*message)[strings::msg_params][strings::success].asBool()) {
+ LOG4CXX_INFO(logger_,
+ "Registered app "
+ << app->app_id() << " is "
+ << (plugin_manager_.IsAppForPlugins(app) ? "" : "not ")
+ << "for plugins.");
+ }
+#endif // SDL_REMOTE_CONTROL
} else if (app) {
mobile_apis::FunctionID::eType function_id =
static_cast<mobile_apis::FunctionID::eType>(
@@ -1404,20 +1812,32 @@ void ApplicationManagerImpl::SendMessageToMobile(
for (; iter != iter_end; ++iter) {
if (true == iter->second.asBool()) {
LOG4CXX_INFO(logger_, "Request's param: " << iter->first);
- params.push_back(iter->first);
+ params.insert(iter->first);
}
}
}
- const mobile_apis::Result::eType check_result = CheckPolicyPermissions(
- app->policy_app_id(), app->hmi_level(), function_id, params);
+ const std::string string_functionID =
+ MessageHelper::StringifiedFunctionID(function_id);
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions(app, string_functionID, params);
if (mobile_apis::Result::SUCCESS != check_result) {
- const std::string string_functionID =
- MessageHelper::StringifiedFunctionID(function_id);
LOG4CXX_WARN(logger_,
"Function \"" << string_functionID << "\" (#" << function_id
<< ") not allowed by policy");
return;
}
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ if (function_id == mobile_apis::FunctionID::OnSystemRequestID) {
+ mobile_apis::RequestType::eType request_type =
+ static_cast<mobile_apis::RequestType::eType>(
+ (*message)[strings::msg_params][strings::request_type].asUInt());
+ if (mobile_apis::RequestType::PROPRIETARY == request_type ||
+ mobile_apis::RequestType::HTTP == request_type) {
+ GetPolicyHandler().OnUpdateRequestSentToMobile();
+ }
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
}
if (message_to_send->binary_data()) {
@@ -1439,7 +1859,6 @@ bool ApplicationManagerImpl::ManageMobileCommand(
const commands::MessageSharedPtr message,
commands::Command::CommandOrigin origin) {
LOG4CXX_AUTO_TRACE(logger_);
-
if (!message) {
LOG4CXX_WARN(logger_, "Null-pointer message received.");
return false;
@@ -1463,6 +1882,16 @@ bool ApplicationManagerImpl::ManageMobileCommand(
return false;
}
+ const uint32_t connection_key = static_cast<uint32_t>(
+ (*message)[strings::params][strings::connection_key].asUInt());
+
+ auto app_ptr = application(connection_key);
+ if (app_ptr && IsAppInReconnectMode(app_ptr->policy_app_id())) {
+ commands_holder_->Suspend(
+ app_ptr, CommandHolder::CommandType::kMobileCommand, message);
+ return true;
+ }
+
mobile_apis::FunctionID::eType function_id =
static_cast<mobile_apis::FunctionID::eType>(
(*message)[strings::params][strings::function_id].asInt());
@@ -1473,9 +1902,6 @@ bool ApplicationManagerImpl::ManageMobileCommand(
? (*message)[strings::params][strings::correlation_id].asUInt()
: 0;
- uint32_t connection_key =
- (*message)[strings::params][strings::connection_key].asUInt();
-
int32_t protocol_type =
(*message)[strings::params][strings::protocol_type].asUInt();
@@ -1610,6 +2036,25 @@ bool ApplicationManagerImpl::ManageMobileCommand(
return false;
}
+void ApplicationManagerImpl::RemoveHMIFakeParameters(
+ application_manager::MessagePtr& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ using namespace NsSmartDeviceLink::NsJSONHandler;
+ SmartObject so;
+
+ Formatters::FormatterJsonRpc::FromString<hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(
+ message->json_message(), so);
+
+ std::string formatted_message;
+ namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
+ hmi_apis::HMI_API factory;
+ factory.attachSchema(so, true);
+ Formatters::FormatterJsonRpc::ToString(so, formatted_message);
+ message->set_json_message(formatted_message);
+}
+
void ApplicationManagerImpl::SendMessageToHMI(
const commands::MessageSharedPtr message) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1673,8 +2118,21 @@ bool ApplicationManagerImpl::ManageHMICommand(
return false;
}
+ if ((*message).keyExists(strings::msg_params) &&
+ (*message)[strings::msg_params].keyExists(strings::app_id)) {
+ const auto connection_key =
+ (*message)[strings::msg_params][strings::app_id].asUInt();
+
+ auto app = application(static_cast<uint32_t>(connection_key));
+ if (app && IsAppInReconnectMode(app->policy_app_id())) {
+ commands_holder_->Suspend(
+ app, CommandHolder::CommandType::kHmiCommand, message);
+ return true;
+ }
+ }
+
int32_t message_type =
- (*(message.get()))[strings::params][strings::message_type].asInt();
+ (*message)[strings::params][strings::message_type].asInt();
if (kRequest == message_type) {
LOG4CXX_DEBUG(logger_, "ManageHMICommand");
@@ -1685,9 +2143,9 @@ bool ApplicationManagerImpl::ManageHMICommand(
command->Run();
if (kResponse == message_type) {
const uint32_t correlation_id =
- (*(message.get()))[strings::params][strings::correlation_id].asUInt();
+ (*message)[strings::params][strings::correlation_id].asUInt();
const int32_t function_id =
- (*(message.get()))[strings::params][strings::function_id].asInt();
+ (*message)[strings::params][strings::function_id].asInt();
request_ctrl_.OnHMIResponse(correlation_id, function_id);
}
return true;
@@ -1754,6 +2212,17 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state,
app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl(
*app_launch_dto_.get(), *this, settings_));
+#ifdef SDL_REMOTE_CONTROL
+ if (!hmi_handler_) {
+ LOG4CXX_ERROR(logger_, "HMI message handler was not initialized");
+ return false;
+ }
+ plugin_manager_.SetServiceHandler(utils::MakeShared<CoreService>(*this));
+ plugin_manager_.LoadPlugins(settings_.plugins_folder());
+ plugin_manager_.OnServiceStateChanged(
+ functional_modules::ServiceState::HMI_ADAPTER_INITIALIZED);
+#endif // SDL_REMOTE_CONTROL
+
return true;
}
@@ -1787,9 +2256,10 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
<< message.json_message());
switch (message.protocol_version()) {
- case ProtocolVersion::kV4:
- case ProtocolVersion::kV3:
- case ProtocolVersion::kV2: {
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2: {
const bool conversion_result =
formatters::CFormatterJsonSDLRPCv2::fromString(
message.json_message(),
@@ -1797,9 +2267,12 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
message.function_id(),
message.type(),
message.correlation_id());
+
+ rpc::ValidationReport report("RPC");
+
if (!conversion_result ||
!mobile_so_factory().attachSchema(output, true) ||
- ((output.validate() != smart_objects::Errors::OK))) {
+ ((output.validate(&report) != smart_objects::Errors::OK))) {
LOG4CXX_WARN(logger_,
"Failed to parse string to smart object :"
<< message.json_message());
@@ -1809,6 +2282,9 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
message.function_id(),
message.correlation_id(),
mobile_apis::Result::INVALID_DATA));
+
+ (*response)[strings::msg_params][strings::info] =
+ rpc::PrettyFormat(report);
ManageMobileCommand(response, commands::Command::ORIGIN_SDL);
return false;
}
@@ -1841,7 +2317,7 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
}
break;
}
- case ProtocolVersion::kHMI: {
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI: {
#ifdef ENABLE_LOG
int32_t result =
#endif
@@ -1856,30 +2332,23 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
LOG4CXX_WARN(logger_, "Failed to attach schema to object.");
return false;
}
- if (output.validate() != smart_objects::Errors::OK) {
- 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;
- }
+ rpc::ValidationReport report("RPC");
- if (application_manager::MessageType::kRequest ==
- output[strings::params][strings::message_type].asInt()) {
- LOG4CXX_ERROR(logger_, "Ignore wrong HMI request");
- return false;
- }
+ if (output.validate(&report) != smart_objects::Errors::OK) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect parameter from HMI"
+ << rpc::PrettyFormat(report));
output.erase(strings::msg_params);
output[strings::params][hmi_response::code] =
hmi_apis::Common_Result::INVALID_DATA;
- output[strings::msg_params][strings::info] =
- std::string("Received invalid data on HMI response");
+ output[strings::msg_params][strings::info] = rpc::PrettyFormat(report);
+ return false;
}
break;
}
- case ProtocolVersion::kV1: {
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1: {
static NsSmartDeviceLinkRPC::V1::v4_protocol_v1_2_no_extra v1_shema;
if (message.function_id() == 0 || message.type() == kUnknownType) {
@@ -1917,8 +2386,6 @@ bool ApplicationManagerImpl::ConvertMessageToSO(
break;
}
default:
- // TODO(PV):
- // removed NOTREACHED() because some app can still have vesion 1.
LOG4CXX_WARN(logger_,
"Application used unsupported protocol :"
<< message.protocol_version() << ".");
@@ -1960,7 +2427,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
- output.set_protocol_version(application_manager::kV1);
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
} else {
if (!formatters::CFormatterJsonSDLRPCv2::toString(message,
output_string)) {
@@ -1968,7 +2436,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
return false;
}
output.set_protocol_version(
- static_cast<ProtocolVersion>(protocol_version));
+ static_cast<protocol_handler::MajorProtocolVersion>(
+ protocol_version));
}
break;
@@ -1978,7 +2447,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
LOG4CXX_WARN(logger_, "Failed to serialize smart object");
return false;
}
- output.set_protocol_version(application_manager::kHMI);
+ output.set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
break;
}
default:
@@ -2013,23 +2483,79 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
}
if (message.getElement(jhs::S_PARAMS).keyExists(strings::binary_data)) {
- application_manager::BinaryData* binaryData =
- new application_manager::BinaryData(
- message.getElement(jhs::S_PARAMS)
- .getElement(strings::binary_data)
- .asBinary());
-
- if (NULL == binaryData) {
- LOG4CXX_ERROR(logger_, "Null pointer");
- return false;
- }
- output.set_binary_data(binaryData);
+ const application_manager::BinaryData binaryData(
+ message.getElement(jhs::S_PARAMS)
+ .getElement(strings::binary_data)
+ .asBinary());
+
+ output.set_binary_data(&binaryData);
}
LOG4CXX_DEBUG(logger_, "Successfully parsed smart object into message");
return true;
}
+MessageValidationResult ApplicationManagerImpl::ValidateMessageBySchema(
+ const Message& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject so;
+ using namespace protocol_handler;
+ switch (message.protocol_version()) {
+ case MajorProtocolVersion::PROTOCOL_VERSION_5:
+ case MajorProtocolVersion::PROTOCOL_VERSION_4:
+ case MajorProtocolVersion::PROTOCOL_VERSION_3:
+ case MajorProtocolVersion::PROTOCOL_VERSION_2: {
+ const bool conversion_result =
+ formatters::CFormatterJsonSDLRPCv2::fromString(
+ message.json_message(),
+ so,
+ message.function_id(),
+ message.type(),
+ message.correlation_id());
+ if (!conversion_result) {
+ return INVALID_JSON;
+ }
+
+ if (!mobile_so_factory().attachSchema(so, true)) {
+ return INVALID_METADATA;
+ }
+ rpc::ValidationReport report("RPC");
+ if (so.validate(&report) != smart_objects::Errors::OK) {
+ LOG4CXX_WARN(logger_,
+ "validate() failed for Mobile message - "
+ << rpc::PrettyFormat(report));
+ return SCHEMA_MISMATCH;
+ }
+ break;
+ }
+ case MajorProtocolVersion::PROTOCOL_VERSION_HMI: {
+ const int32_t conversion_result = formatters::FormatterJsonRpc::
+ FromString<hmi_apis::FunctionID::eType, hmi_apis::messageType::eType>(
+ message.json_message(), so);
+ if (0 != conversion_result) {
+ LOG4CXX_WARN(logger_,
+ "Failed to parse json from HMI: " << conversion_result);
+ return INVALID_JSON;
+ }
+
+ if (!hmi_so_factory().attachSchema(so, true)) {
+ return INVALID_METADATA;
+ }
+
+ rpc::ValidationReport report("RPC");
+ if (so.validate(&report) != smart_objects::Errors::OK) {
+ LOG4CXX_WARN(logger_,
+ "validate() failed for HMI message - "
+ << rpc::PrettyFormat(report));
+ return SCHEMA_MISMATCH;
+ }
+ break;
+ }
+ default: { return UNSUPPORTED_PROTOCOL; }
+ }
+ return SUCCESS;
+}
+
utils::SharedPtr<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
const ::protocol_handler::RawMessagePtr message) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2105,8 +2631,17 @@ void ApplicationManagerImpl::ProcessMessageFromHMI(
*smart_object = message->smart_object();
#else
if (!ConvertMessageToSO(*message, *smart_object)) {
- LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
- return;
+ if (application_manager::MessageType::kResponse ==
+ (*smart_object)[strings::params][strings::message_type].asInt()) {
+ (*smart_object).erase(strings::msg_params);
+ (*smart_object)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_DATA;
+ (*smart_object)[strings::msg_params][strings::info] =
+ std::string("Received invalid data on HMI response");
+ } else {
+ LOG4CXX_ERROR(logger_, "Cannot create smart object from message");
+ return;
+ }
}
#endif // HMI_DBUS_API
@@ -2259,10 +2794,10 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
const std::string app_icon_dir(settings_.app_icons_folder());
const std::string full_icon_path(app_icon_dir + "/" + policy_app_id);
- uint32_t device_id = 0;
+ connection_handler::DeviceHandle device_id = 0;
if (-1 ==
- connection_handler().GetDataOnSessionKey(
+ connection_handler().get_session_observer().GetDataOnSessionKey(
connection_key, NULL, NULL, &device_id)) {
LOG4CXX_ERROR(logger_,
"Failed to create application: no connection info.");
@@ -2284,6 +2819,7 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
new ApplicationImpl(0,
policy_app_id,
device_mac,
+ device_id,
appName,
GetPolicyHandler().GetStatisticManager(),
*this));
@@ -2292,7 +2828,6 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array,
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);
@@ -2394,32 +2929,38 @@ void ApplicationManagerImpl::RemovePolicyObserver(
void ApplicationManagerImpl::SetUnregisterAllApplicationsReason(
mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_TRACE(logger_, "reason = " << reason);
unregister_reason_ = reason;
}
void ApplicationManagerImpl::HeadUnitReset(
mobile_api::AppInterfaceUnregisteredReason::eType reason) {
+ LOG4CXX_AUTO_TRACE(logger_);
stopping_application_mng_lock_.Acquire();
is_stopping_ = true;
stopping_application_mng_lock_.Release();
switch (reason) {
case mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET: {
+ LOG4CXX_TRACE(logger_, "Performing MASTER_RESET");
UnregisterAllApplications();
GetPolicyHandler().ResetPolicyTable();
GetPolicyHandler().UnloadPolicyLibrary();
resume_controller().StopSavePersistentDataTimer();
- file_system::remove_directory_content(
- get_settings().app_storage_folder());
+
+ const std::string storage_folder = get_settings().app_storage_folder();
+ file_system::RemoveDirectory(storage_folder, true);
+ ClearAppsPersistentData();
break;
}
case mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS: {
+ LOG4CXX_TRACE(logger_, "Performing FACTORY_DEFAULTS");
GetPolicyHandler().ClearUserConsent();
resume_controller().StopSavePersistentDataTimer();
- file_system::remove_directory_content(
- get_settings().app_storage_folder());
+
+ ClearAppsPersistentData();
break;
}
default: {
@@ -2429,6 +2970,43 @@ void ApplicationManagerImpl::HeadUnitReset(
}
}
+void ApplicationManagerImpl::ClearAppsPersistentData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ typedef std::vector<std::string> FilesList;
+ const std::string apps_info_storage_file = get_settings().app_info_storage();
+ file_system::DeleteFile(apps_info_storage_file);
+
+ const std::string storage_folder = get_settings().app_storage_folder();
+
+ FilesList files = file_system::ListFiles(storage_folder);
+ FilesList::iterator element_to_skip =
+ std::find(files.begin(), files.end(), "policy.sqlite");
+ if (element_to_skip != files.end()) {
+ files.erase(element_to_skip);
+ }
+
+ FilesList::iterator it = files.begin();
+ for (; it != files.end(); ++it) {
+ const std::string path_to_item = storage_folder + "/";
+ const std::string item_to_remove = path_to_item + (*it);
+ LOG4CXX_TRACE(logger_, "Removing : " << item_to_remove);
+ if (file_system::IsDirectory(item_to_remove)) {
+ LOG4CXX_TRACE(logger_,
+ "Removal result : " << file_system::RemoveDirectory(
+ item_to_remove, true));
+ } else {
+ LOG4CXX_TRACE(
+ logger_,
+ "Removal result : " << file_system::DeleteFile(item_to_remove));
+ }
+ }
+
+ const std::string apps_icons_folder = get_settings().app_icons_folder();
+ if (storage_folder != apps_icons_folder) {
+ file_system::RemoveDirectory(apps_icons_folder, true);
+ }
+}
+
void ApplicationManagerImpl::SendOnSDLClose() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2512,7 +3090,7 @@ void ApplicationManagerImpl::UnregisterAllApplications() {
}
}
if (is_ignition_off) {
- resume_controller().OnSuspend();
+ resume_controller().OnIgnitionOff();
}
request_ctrl_.terminateAllHMIRequests();
}
@@ -2559,9 +3137,13 @@ void ApplicationManagerImpl::UnregisterApplication(
MessageHelper::SendUnsubscribedWayPoints(*this);
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() != it) {
- navi_service_status_.erase(it);
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ 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_
@@ -2600,13 +3182,14 @@ void ApplicationManagerImpl::UnregisterApplication(
ApplicationSharedPtr app_to_remove;
connection_handler::DeviceHandle handle = 0;
{
- DataAccessor<ApplicationSet> accessor(applications());
- ApplicationSetConstIt it = accessor.GetData().begin();
- for (; it != accessor.GetData().end(); ++it) {
- if ((*it)->app_id() == app_id) {
- app_to_remove = *it;
- handle = app_to_remove->device();
- break;
+ sync_primitives::AutoLock lock(applications_list_lock_);
+ auto it_app = applications_.begin();
+ while (applications_.end() != it_app) {
+ if (app_id == (*it_app)->app_id()) {
+ app_to_remove = *it_app;
+ applications_.erase(it_app++);
+ } else {
+ ++it_app;
}
}
if (!app_to_remove) {
@@ -2624,11 +3207,10 @@ void ApplicationManagerImpl::UnregisterApplication(
} else {
resume_controller().RemoveApplicationFromSaved(app_to_remove);
}
- applications_.erase(app_to_remove);
(hmi_capabilities_->get_hmi_language_handler())
.OnUnregisterApplication(app_id);
AppV4DevicePredicate finder(handle);
- ApplicationSharedPtr app = FindApp(accessor, finder);
+ ApplicationSharedPtr app = FindApp(applications(), finder);
if (!app) {
LOG4CXX_DEBUG(
logger_, "There is no more SDL4 apps with device handle: " << handle);
@@ -2637,6 +3219,9 @@ void ApplicationManagerImpl::UnregisterApplication(
SendUpdateAppList();
}
}
+
+ commands_holder_->Clear(app_to_remove);
+
if (audio_pass_thru_active_) {
// May be better to put this code in MessageHelper?
EndAudioPassThrough();
@@ -2644,6 +3229,12 @@ void ApplicationManagerImpl::UnregisterApplication(
MessageHelper::SendStopAudioPathThru(*this);
}
+#ifdef SDL_REMOTE_CONTROL
+ plugin_manager_.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationUnregistered,
+ app_to_remove);
+#endif
+
MessageHelper::SendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect, *this);
request_ctrl_.terminateAppRequests(app_id);
@@ -2667,6 +3258,15 @@ void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) {
LOG4CXX_INFO(logger_, "Application manager is stopping");
return;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (plugin_manager_.IsMessageForPlugin(message)) {
+ if (functional_modules::ProcessResult::PROCESSED ==
+ plugin_manager_.ProcessMessage(message)) {
+ LOG4CXX_INFO(logger_, "Message is processed by plugin.");
+ return;
+ }
+ }
+#endif
ProcessMessageFromMobile(message);
}
@@ -2712,6 +3312,18 @@ void ApplicationManagerImpl::Handle(const impl::MessageFromHmi message) {
return;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (plugin_manager_.IsHMIMessageForPlugin(message)) {
+ functional_modules::ProcessResult result =
+ plugin_manager_.ProcessHMIMessage(message);
+ if (functional_modules::ProcessResult::PROCESSED == result ||
+ functional_modules::ProcessResult::FAILED == result) {
+ LOG4CXX_INFO(logger_, "Message is processed by plugin.");
+ return;
+ }
+ }
+#endif
+
ProcessMessageFromHMI(message);
}
@@ -2760,38 +3372,27 @@ void ApplicationManagerImpl::Handle(const impl::AudioData message) {
return;
}
- command->Init();
- command->Run();
- command->CleanUp();
+ if (command->Init()) {
+ command->Run();
+ command->CleanUp();
+ }
}
mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
- const std::string& policy_app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::FunctionID::eType function_id,
+ const ApplicationSharedPtr app,
+ const std::string& function_id,
const RPCParams& rpc_params,
CommandParametersPermissions* params_permissions) {
- LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "CheckPolicyPermissions");
// TODO(AOleynik): Remove check of policy_enable, when this flag will be
// unused in config file
if (!GetPolicyHandler().PolicyEnabled()) {
return mobile_apis::Result::SUCCESS;
}
- const std::string stringified_functionID =
- MessageHelper::StringifiedFunctionID(function_id);
- const std::string stringified_hmi_level =
- MessageHelper::StringifiedHMILevel(hmi_level);
- LOG4CXX_DEBUG(logger_,
- "Checking permissions for " << policy_app_id << " in "
- << stringified_hmi_level << " rpc "
- << stringified_functionID);
+ DCHECK(app);
policy::CheckPermissionResult result;
- GetPolicyHandler().CheckPermissions(policy_app_id,
- stringified_hmi_level,
- stringified_functionID,
- rpc_params,
- result);
+ GetPolicyHandler().CheckPermissions(app, function_id, rpc_params, result);
if (NULL != params_permissions) {
params_permissions->allowed_params = result.list_of_allowed_params;
@@ -2799,30 +3400,22 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions(
params_permissions->undefined_params = result.list_of_undefined_params;
}
- if (hmi_level == mobile_apis::HMILevel::HMI_NONE &&
- function_id != mobile_apis::FunctionID::UnregisterAppInterfaceID) {
- 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;
- }
+ if (app->hmi_level() == mobile_apis::HMILevel::HMI_NONE &&
+ function_id != MessageHelper::StringifiedFunctionID(
+ mobile_apis::FunctionID::UnregisterAppInterfaceID)) {
if (result.hmi_level_permitted != policy::kRpcAllowed) {
app->usage_report().RecordRpcSentInHMINone();
}
}
- const std::string log_msg = "Application: " + policy_app_id + ", RPC: " +
- stringified_functionID + ", HMI status: " +
- stringified_hmi_level;
-
+#ifdef ENABLE_LOG
+ const std::string log_msg =
+ "Application: " + app->policy_app_id() + ", RPC: " + function_id +
+ ", HMI status: " + MessageHelper::StringifiedHMILevel(app->hmi_level());
+#endif // ENABLE_LOG
if (result.hmi_level_permitted != policy::kRpcAllowed) {
LOG4CXX_WARN(logger_, "Request is blocked by policies. " << log_msg);
- 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) {
@@ -2851,8 +3444,9 @@ bool ApplicationManagerImpl::IsLowVoltage() {
std::string ApplicationManagerImpl::GetHashedAppID(
uint32_t connection_key, const std::string& mobile_app_id) const {
- uint32_t device_id = 0;
- connection_handler().GetDataOnSessionKey(connection_key, 0, NULL, &device_id);
+ connection_handler::DeviceHandle device_id = 0;
+ connection_handler().get_session_observer().GetDataOnSessionKey(
+ connection_key, 0, NULL, &device_id);
std::string device_name;
connection_handler().get_session_observer().GetDataOnDeviceID(
device_id, &device_name, NULL, NULL, NULL);
@@ -2904,8 +3498,10 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
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);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "There is no navi or projection application with id: " << app_id);
return;
}
@@ -2919,9 +3515,17 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) {
return;
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it ||
- (!it->second.first && !it->second.second)) {
+ bool unregister = false;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it ||
+ (!it->second.first && !it->second.second)) {
+ unregister = true;
+ }
+ }
+ if (unregister) {
ManageMobileCommand(
MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
app_id, PROTOCOL_VIOLATION),
@@ -2938,8 +3542,10 @@ void ApplicationManagerImpl::OnAppStreaming(
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);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ " There is no navi or projection application with id: " << app_id);
return;
}
DCHECK_OR_RETURN_VOID(media_manager_);
@@ -2958,24 +3564,34 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
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);
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "There is no navi or projection application with id: " << app_id);
return;
}
- NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
- if (navi_service_status_.end() == it) {
- LOG4CXX_ERROR(logger_, "No info about navi servicies for app");
- return;
+ bool end_video = false;
+ bool end_audio = false;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() == it) {
+ LOG4CXX_ERROR(logger_, "No info about navi servicies for app");
+ return;
+ }
+ end_video = it->second.first;
+ end_audio = it->second.second;
}
if (connection_handler_) {
- if (it->second.first) {
+ if (end_video) {
LOG4CXX_DEBUG(logger_, "Going to end video service");
connection_handler().SendEndService(app_id, ServiceType::kMobileNav);
app->StopStreamingForce(ServiceType::kMobileNav);
}
- if (it->second.second) {
+ if (end_audio) {
LOG4CXX_DEBUG(logger_, "Going to end audio service");
connection_handler().SendEndService(app_id, ServiceType::kAudio);
app->StopStreamingForce(ServiceType::kAudio);
@@ -2988,7 +3604,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) {
"CloseNaviAppTimer",
new TimerTaskImpl<ApplicationManagerImpl>(
this, &ApplicationManagerImpl::CloseNaviApp)));
- close_timer->Start(navi_close_app_timeout_, timer::kPeriodic);
+ close_timer->Start(navi_close_app_timeout_, timer::kSingleShot);
sync_primitives::AutoLock lock(timer_pool_lock_);
timer_pool_.push_back(close_timer);
@@ -3000,6 +3616,41 @@ void ApplicationManagerImpl::OnHMILevelChanged(
mobile_apis::HMILevel::eType from,
mobile_apis::HMILevel::eType to) {
LOG4CXX_AUTO_TRACE(logger_);
+ ProcessPostponedMessages(app_id);
+ ProcessApp(app_id, from, to);
+}
+
+void ApplicationManagerImpl::ProcessPostponedMessages(const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application(app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_, "The app with id: " << app_id << " does not exist");
+ return;
+ }
+ MobileMessageQueue messages;
+ app->SwapMobileMessageQueue(messages);
+ auto push_allowed_messages =
+ [this, &app](smart_objects::SmartObjectSPtr message) {
+ const std::string function_id = MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*message)[strings::params][strings::function_id].asUInt()));
+ const RPCParams params;
+ const mobile_apis::Result::eType check_result =
+ CheckPolicyPermissions(app, function_id, params);
+ if (mobile_api::Result::SUCCESS == check_result) {
+ ManageMobileCommand(message,
+ commands::Command::CommandOrigin::ORIGIN_SDL);
+ } else {
+ app->PushMobileMessage(message);
+ }
+ };
+ std::for_each(messages.begin(), messages.end(), push_allowed_messages);
+}
+
+void ApplicationManagerImpl::ProcessApp(const uint32_t app_id,
+ const mobile_apis::HMILevel::eType from,
+ const mobile_apis::HMILevel::eType to) {
using namespace mobile_apis::HMILevel;
using namespace helpers;
@@ -3009,8 +3660,8 @@ void ApplicationManagerImpl::OnHMILevelChanged(
}
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection application not found");
return;
}
@@ -3093,22 +3744,30 @@ void ApplicationManagerImpl::CloseNaviApp() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace mobile_apis::AppInterfaceUnregisteredReason;
using namespace mobile_apis::Result;
-
+ DCHECK_OR_RETURN_VOID(!navi_app_to_stop_.empty());
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) {
- LOG4CXX_INFO(logger_,
- "App haven't answered for EndService. Unregister it.");
- ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id, PROTOCOL_VIOLATION),
- commands::Command::ORIGIN_SDL);
- UnregisterApplication(app_id, ABORTED);
+ bool unregister = false;
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id);
+ if (navi_service_status_.end() != it) {
+ if (it->second.first || it->second.second) {
+ unregister = true;
+ }
}
}
+ if (unregister) {
+ LOG4CXX_INFO(logger_,
+ "App haven't answered for EndService. Unregister it.");
+ ManageMobileCommand(
+ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
+ app_id, PROTOCOL_VIOLATION),
+ commands::Command::ORIGIN_SDL);
+ UnregisterApplication(app_id, ABORTED);
+ }
}
void ApplicationManagerImpl::EndNaviStreaming() {
@@ -3132,18 +3791,22 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection 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);
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ 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);
+ }
}
}
}
@@ -3153,18 +3816,22 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) {
LOG4CXX_AUTO_TRACE(logger_);
ApplicationSharedPtr app = application(app_id);
- if (!app || !app->is_navi()) {
- LOG4CXX_ERROR(logger_, "Navi application not found");
+ if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) {
+ LOG4CXX_ERROR(logger_, "Navi/Projection 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);
+ {
+ sync_primitives::AutoLock lock(navi_service_status_lock_);
+
+ 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);
+ }
}
}
}
@@ -3175,9 +3842,20 @@ bool ApplicationManagerImpl::IsApplicationForbidden(
return forbidden_applications.find(name) != forbidden_applications.end();
}
+bool ApplicationManagerImpl::IsAppInReconnectMode(
+ const std::string& policy_app_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+ return reregister_wait_list_.end() !=
+ std::find_if(reregister_wait_list_.begin(),
+ reregister_wait_list_.end(),
+ std::bind1st(std::ptr_fun(&policy_app_id_comparator),
+ policy_app_id));
+}
+
policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice(
const std::string& device_id) const {
- return policy_handler_.GetUserConsentForDevice(device_id);
+ return GetPolicyHandler().GetUserConsentForDevice(device_id);
}
void ApplicationManagerImpl::OnWakeUp() {
@@ -3268,8 +3946,12 @@ bool ApplicationManagerImpl::IsHMICooperating() const {
void ApplicationManagerImpl::OnApplicationListUpdateTimer() {
LOG4CXX_DEBUG(logger_, "Application list update timer finished");
+
+ apps_to_register_list_lock_.Acquire();
+ const bool trigger_ptu = apps_size_ != applications_.size();
+ apps_to_register_list_lock_.Release();
SendUpdateAppList();
- GetPolicyHandler().OnAppsSearchCompleted();
+ GetPolicyHandler().OnAppsSearchCompleted(trigger_ptu);
}
void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() {
@@ -3454,24 +4136,85 @@ void ApplicationManagerImpl::OnUpdateHMIAppType(
}
}
-ProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const {
+void ApplicationManagerImpl::EraseAppFromReconnectionList(
+ const ApplicationSharedPtr& app) {
LOG4CXX_AUTO_TRACE(logger_);
- bool heart_beat_support = get_settings().heart_beat_timeout();
- bool sdl4_support = protocol_handler_->get_settings().enable_protocol_4();
+ if (!app) {
+ LOG4CXX_WARN(logger_, "Application is not valid.");
+ return;
+ }
- if (sdl4_support) {
- LOG4CXX_DEBUG(logger_,
- "SDL Supported protocol version " << ProtocolVersion::kV4);
- return ProtocolVersion::kV4;
+ const auto policy_app_id = app->policy_app_id();
+ sync_primitives::AutoLock lock(reregister_wait_list_lock_);
+ auto app_it = std::find_if(
+ reregister_wait_list_.begin(),
+ reregister_wait_list_.end(),
+ std::bind1st(std::ptr_fun(&policy_app_id_comparator), policy_app_id));
+ if (reregister_wait_list_.end() != app_it) {
+ reregister_wait_list_.erase(app_it);
}
- if (heart_beat_support) {
- LOG4CXX_DEBUG(logger_,
- "SDL Supported protocol version " << ProtocolVersion::kV3);
- return ProtocolVersion::kV3;
+}
+
+void ApplicationManagerImpl::ProcessReconnection(
+ ApplicationSharedPtr application, const uint32_t connection_key) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+
+ connection_handler::DeviceHandle new_device_id = 0;
+ connection_handler().get_session_observer().GetDataOnSessionKey(
+ connection_key, NULL, NULL, &new_device_id);
+ DCHECK_OR_RETURN_VOID(new_device_id);
+
+ std::string device_mac;
+ std::string connection_type;
+ connection_handler().get_session_observer().GetDataOnDeviceID(
+ new_device_id, NULL, NULL, &device_mac, &connection_type);
+
+ EraseAppFromReconnectionList(application);
+
+ SwitchApplication(application, connection_key, new_device_id, device_mac);
+
+ // Update connection type for existed device.
+ GetPolicyHandler().AddDevice(device_mac, connection_type);
+}
+
+void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) {
+#ifdef SDL_REMOTE_CONTROL
+ if (!ptu_result) {
+ return;
}
- LOG4CXX_DEBUG(logger_,
- "SDL Supported protocol version " << ProtocolVersion::kV2);
- return ProtocolVersion::kV2;
+ plugin_manager_.OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationPolicyUpdated);
+#endif // SDL_REMOTE_CONTROL
+}
+
+void ApplicationManagerImpl::PutDriverDistractionMessageToPostponed(
+ ApplicationSharedPtr application) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (hmi_apis::Common_DriverDistractionState::INVALID_ENUM ==
+ driver_distraction_state()) {
+ LOG4CXX_WARN(logger_, "DriverDistractionState is INVALID_ENUM");
+ return;
+ }
+ smart_objects::SmartObjectSPtr on_driver_distraction =
+ utils::MakeShared<smart_objects::SmartObject>();
+
+ (*on_driver_distraction)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+ (*on_driver_distraction)[strings::params][strings::function_id] =
+ mobile_api::FunctionID::OnDriverDistractionID;
+ (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
+ driver_distraction_state();
+ (*on_driver_distraction)[strings::params][strings::connection_key] =
+ application->app_id();
+ application->PushMobileMessage(on_driver_distraction);
+}
+
+protocol_handler::MajorProtocolVersion
+ApplicationManagerImpl::SupportedSDLVersion() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return static_cast<protocol_handler::MajorProtocolVersion>(
+ get_settings().max_supported_protocol_version());
}
event_engine::EventDispatcher& ApplicationManagerImpl::event_dispatcher() {
@@ -3557,9 +4300,46 @@ void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(
subscribed_way_points_apps_list_.erase(app_id);
}
+bool ApplicationManagerImpl::IsAppSubscribedForWayPoints(
+ ApplicationSharedPtr app) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
+ if (subscribed_way_points_apps_list_.find(app) ==
+ subscribed_way_points_apps_list_.end()) {
+ return false;
+ }
+ return true;
+}
+
+void ApplicationManagerImpl::SubscribeAppForWayPoints(
+ ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
+ subscribed_way_points_apps_list_.insert(app);
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
+}
+
+void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(
+ ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
+ subscribed_way_points_apps_list_.erase(app);
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
+}
+
bool ApplicationManagerImpl::IsAnyAppSubscribedForWayPoints() const {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "There are applications subscribed: "
+ << subscribed_way_points_apps_list_.size());
return !subscribed_way_points_apps_list_.empty();
}
@@ -3570,4 +4350,180 @@ const std::set<int32_t> ApplicationManagerImpl::GetAppsSubscribedForWayPoints()
return subscribed_way_points_apps_list_;
}
+static hmi_apis::Common_VideoStreamingProtocol::eType ConvertVideoProtocol(
+ const char* str) {
+ if (strcmp(str, "RAW") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RAW;
+ } else if (strcmp(str, "RTP") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RTP;
+ } else if (strcmp(str, "RTSP") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RTSP;
+ } else if (strcmp(str, "RTMP") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::RTMP;
+ } else if (strcmp(str, "WEBM") == 0) {
+ return hmi_apis::Common_VideoStreamingProtocol::WEBM;
+ }
+ return hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM;
+}
+
+static hmi_apis::Common_VideoStreamingCodec::eType ConvertVideoCodec(
+ const char* str) {
+ if (strcmp(str, "H264") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::H264;
+ } else if (strcmp(str, "H265") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::H265;
+ } else if (strcmp(str, "Theora") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::Theora;
+ } else if (strcmp(str, "VP8") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::VP8;
+ } else if (strcmp(str, "VP9") == 0) {
+ return hmi_apis::Common_VideoStreamingCodec::VP9;
+ }
+ return hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM;
+}
+
+// static
+void ApplicationManagerImpl::ConvertVideoParamsToSO(
+ smart_objects::SmartObject& output, const BsonObject* input) {
+ if (input == NULL) {
+ return;
+ }
+ BsonObject* obj = const_cast<BsonObject*>(input);
+
+ const char* protocol =
+ bson_object_get_string(obj, protocol_handler::strings::video_protocol);
+ if (protocol != NULL) {
+ output[strings::protocol] = ConvertVideoProtocol(protocol);
+ }
+ const char* codec =
+ bson_object_get_string(obj, protocol_handler::strings::video_codec);
+ if (codec != NULL) {
+ output[strings::codec] = ConvertVideoCodec(codec);
+ }
+ BsonElement* element =
+ bson_object_get(obj, protocol_handler::strings::height);
+ if (element != NULL && element->type == TYPE_INT32) {
+ output[strings::height] =
+ bson_object_get_int32(obj, protocol_handler::strings::height);
+ }
+ element = bson_object_get(obj, protocol_handler::strings::width);
+ if (element != NULL && element->type == TYPE_INT32) {
+ output[strings::width] =
+ bson_object_get_int32(obj, protocol_handler::strings::width);
+ }
+}
+
+// static
+std::vector<std::string> ApplicationManagerImpl::ConvertRejectedParamList(
+ const std::vector<std::string>& input) {
+ std::vector<std::string> output;
+ for (std::vector<std::string>::const_iterator it = input.begin();
+ it != input.end();
+ ++it) {
+ if (*it == strings::protocol) {
+ output.push_back(protocol_handler::strings::video_protocol);
+ } else if (*it == strings::codec) {
+ output.push_back(protocol_handler::strings::video_codec);
+ } else if (*it == strings::height) {
+ output.push_back(protocol_handler::strings::height);
+ } else if (*it == strings::width) {
+ output.push_back(protocol_handler::strings::width);
+ }
+ // ignore unknown parameters
+ }
+ return output;
+}
+
+#ifdef BUILD_TESTS
+void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) {
+ applications_list_lock_.Acquire();
+ applications_.insert(mock_app);
+ apps_size_ = applications_.size();
+ applications_list_lock_.Release();
+}
+#endif // BUILD_TESTS
+#ifdef SDL_REMOTE_CONTROL
+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->policy_app_id() : false;
+ }
+};
+
+struct TakeDeviceHandle {
+ public:
+ TakeDeviceHandle(const ApplicationManager& app_mngr) : app_mngr_(app_mngr) {}
+ std::string operator()(ApplicationSharedPtr& app) {
+ DCHECK_OR_RETURN(app, "");
+ return MessageHelper::GetDeviceMacAddressForHandle(app->device(),
+ app_mngr_);
+ }
+
+ private:
+ const ApplicationManager& app_mngr_;
+};
+
+ApplicationSharedPtr ApplicationManagerImpl::application(
+ const std::string& device_id, const std::string& policy_app_id) const {
+ connection_handler::DeviceHandle device_handle;
+ if (!connection_handler().GetDeviceID(device_id, &device_handle)) {
+ LOG4CXX_DEBUG(logger_, "No such device : " << device_id);
+ return ApplicationSharedPtr();
+ }
+
+ DataAccessor<ApplicationSet> accessor = applications();
+ ApplicationSharedPtr app =
+ FindApp(accessor, IsApplication(device_handle, policy_app_id));
+
+ LOG4CXX_DEBUG(logger_,
+ " policy_app_id << " << policy_app_id << "Found = " << app);
+ return app;
+}
+
+std::vector<std::string> ApplicationManagerImpl::devices(
+ const std::string& policy_app_id) const {
+ MobileAppIdPredicate matcher(policy_app_id);
+ AppSharedPtrs apps = FindAllApps(applications(), matcher);
+ std::vector<std::string> devices;
+ std::transform(apps.begin(),
+ apps.end(),
+ std::back_inserter(devices),
+ TakeDeviceHandle(*this));
+ return devices;
+}
+
+void ApplicationManagerImpl::ChangeAppsHMILevel(
+ uint32_t app_id, mobile_apis::HMILevel::eType level) {
+ using namespace mobile_apis::HMILevel;
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "AppID to change: " << app_id << " -> " << level);
+ ApplicationSharedPtr app = application(app_id);
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "There is no app with id: " << app_id);
+ return;
+ }
+ eType old_level = app->hmi_level();
+ if (old_level != level) {
+ app->set_hmi_level(level);
+ OnHMILevelChanged(app_id, old_level, level);
+
+ plugin_manager_.OnAppHMILevelChanged(app, old_level);
+ } else {
+ LOG4CXX_WARN(logger_, "Redudant changing HMI level : " << level);
+ }
+}
+
+void ApplicationManagerImpl::SendPostMessageToMobile(
+ const MessagePtr& message) {
+ messages_to_mobile_.PostMessage(impl::MessageToMobile(message, false));
+}
+
+void ApplicationManagerImpl::SendPostMessageToHMI(const MessagePtr& message) {
+ messages_to_hmi_.PostMessage(impl::MessageToHmi(message));
+}
+
+#endif // SDL_REMOTE_CONTROL
+
} // namespace application_manager
diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc
new file mode 100644
index 0000000000..afdaa2f1f4
--- /dev/null
+++ b/src/components/application_manager/src/command_holder_impl.cc
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/command_holder_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command.h"
+
+namespace application_manager {
+CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
+
+CommandHolderImpl::CommandHolderImpl(ApplicationManager& app_manager)
+ : app_manager_(app_manager) {}
+
+void CommandHolderImpl::Suspend(
+ ApplicationSharedPtr application,
+ CommandType type,
+ utils::SharedPtr<smart_objects::SmartObject> command) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ LOG4CXX_DEBUG(logger_,
+ "Suspending command(s) for application: "
+ << application->policy_app_id());
+ sync_primitives::AutoLock lock(commands_lock_);
+
+ if (CommandType::kHmiCommand == type) {
+ app_hmi_commands_[application].push_back(command);
+ LOG4CXX_DEBUG(logger_,
+ "Suspended HMI command(s): " << app_hmi_commands_.size());
+ } else {
+ app_mobile_commands_[application].push_back(command);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Suspended mobile command(s): " << app_mobile_commands_.size());
+ }
+}
+
+void CommandHolderImpl::Resume(ApplicationSharedPtr application,
+ CommandType type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Resuming command(s) for application: " << application->policy_app_id());
+ if (CommandType::kHmiCommand == type) {
+ ResumeHmiCommand(application);
+ } else {
+ ResumeMobileCommand(application);
+ }
+}
+
+void CommandHolderImpl::Clear(ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(application);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing command(s) for application: " << application->policy_app_id());
+ sync_primitives::AutoLock lock(commands_lock_);
+ auto app_hmi_commands = app_hmi_commands_.find(application);
+ if (app_hmi_commands_.end() != app_hmi_commands) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing HMI command(s): " << app_hmi_commands->second.size());
+ app_hmi_commands_.erase(app_hmi_commands);
+ }
+
+ auto app_mobile_commands = app_mobile_commands_.find(application);
+ if (app_mobile_commands_.end() != app_mobile_commands) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Clearing mobile command(s): " << app_mobile_commands->second.size());
+ app_mobile_commands_.erase(app_mobile_commands);
+ }
+}
+
+void CommandHolderImpl::ResumeHmiCommand(ApplicationSharedPtr application) {
+ DCHECK_OR_RETURN_VOID(application);
+ sync_primitives::AutoLock lock(commands_lock_);
+ auto app_commands = app_hmi_commands_.find(application);
+ if (app_hmi_commands_.end() == app_commands) {
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Resuming HMI command(s): " << app_hmi_commands_.size());
+
+ for (auto cmd : app_commands->second) {
+ (*cmd)[strings::msg_params][strings::app_id] = application->hmi_app_id();
+ app_manager_.ManageHMICommand(cmd);
+ }
+
+ app_hmi_commands_.erase(app_commands);
+}
+
+void CommandHolderImpl::ResumeMobileCommand(ApplicationSharedPtr application) {
+ DCHECK_OR_RETURN_VOID(application);
+ sync_primitives::AutoLock lock(commands_lock_);
+ auto app_commands = app_mobile_commands_.find(application);
+ if (app_mobile_commands_.end() == app_commands) {
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Resuming mobile command(s): " << app_mobile_commands_.size());
+
+ for (auto cmd : app_commands->second) {
+ (*cmd)[strings::params][strings::connection_key] = application->app_id();
+ app_manager_.ManageMobileCommand(
+ cmd, commands::Command::CommandOrigin::ORIGIN_MOBILE);
+ }
+
+ app_mobile_commands_.erase(app_commands);
+}
+} // 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 0a3e65a790..b928184148 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -94,25 +94,30 @@ void CommandImpl::SetAllowedToTerminate(const bool allowed) {
allowed_to_terminate_ = allowed;
}
-void CommandImpl::ReplaceMobileByHMIAppId(
+bool CommandImpl::ReplaceMobileWithHMIAppId(
NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
application_manager_.application(message[strings::app_id].asUInt());
- if (application.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceMobileByHMIAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->hmi_app_id());
- message[strings::app_id] = application->hmi_app_id();
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Substitution mobile --> HMI id is failed.");
+ return false;
}
+ LOG4CXX_DEBUG(logger_,
+ "ReplaceMobileWithHMIAppId from "
+ << message[strings::app_id].asInt() << " to "
+ << application->hmi_app_id());
+ message[strings::app_id] = application->hmi_app_id();
} else {
switch (message.getType()) {
case smart_objects::SmartType::SmartType_Array: {
smart_objects::SmartArray* message_array = message.asArray();
smart_objects::SmartArray::iterator it = message_array->begin();
for (; it != message_array->end(); ++it) {
- ReplaceMobileByHMIAppId(*it);
+ if (!ReplaceMobileWithHMIAppId(*it)) {
+ break;
+ }
}
break;
}
@@ -121,36 +126,51 @@ void CommandImpl::ReplaceMobileByHMIAppId(
std::set<std::string>::const_iterator key = keys.begin();
for (; key != keys.end(); ++key) {
std::string k = *key;
- ReplaceMobileByHMIAppId(message[*key]);
+ if (!ReplaceMobileWithHMIAppId(message[*key])) {
+ break;
+ }
}
break;
}
default: { break; }
}
}
+
+ return true;
+}
+
+DEPRECATED void CommandImpl::ReplaceMobileByHMIAppId(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+ if (!ReplaceMobileWithHMIAppId(message)) {
+ LOG4CXX_ERROR(logger_, "Substitution mobile --> HMI id is failed.");
+ }
}
-void CommandImpl::ReplaceHMIByMobileAppId(
+bool CommandImpl::ReplaceHMIWithMobileAppId(
NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
if (message.keyExists(strings::app_id)) {
ApplicationSharedPtr application =
application_manager_.application_by_hmi_app(
message[strings::app_id].asUInt());
- if (application.valid()) {
- LOG4CXX_DEBUG(logger_,
- "ReplaceHMIByMobileAppId from "
- << message[strings::app_id].asInt() << " to "
- << application->app_id());
- message[strings::app_id] = application->app_id();
+ if (!application) {
+ LOG4CXX_ERROR(logger_, "Substitution HMI --> mobile id is failed.");
+ return false;
}
+ LOG4CXX_DEBUG(logger_,
+ "ReplaceHMIWithMobileAppId from "
+ << message[strings::app_id].asInt() << " to "
+ << application->app_id());
+ message[strings::app_id] = application->app_id();
} else {
switch (message.getType()) {
case smart_objects::SmartType::SmartType_Array: {
smart_objects::SmartArray* message_array = message.asArray();
smart_objects::SmartArray::iterator it = message_array->begin();
for (; it != message_array->end(); ++it) {
- ReplaceHMIByMobileAppId(*it);
+ if (!ReplaceHMIWithMobileAppId(*it)) {
+ break;
+ }
}
break;
}
@@ -158,13 +178,24 @@ void CommandImpl::ReplaceHMIByMobileAppId(
std::set<std::string> keys = message.enumerate();
std::set<std::string>::const_iterator key = keys.begin();
for (; key != keys.end(); ++key) {
- ReplaceHMIByMobileAppId(message[*key]);
+ if (!ReplaceHMIWithMobileAppId(message[*key])) {
+ break;
+ }
}
break;
}
default: { break; }
}
}
+
+ return true;
+}
+
+DEPRECATED void CommandImpl::ReplaceHMIByMobileAppId(
+ NsSmartDeviceLink::NsSmartObjects::SmartObject& message) {
+ if (!ReplaceHMIWithMobileAppId(message)) {
+ LOG4CXX_ERROR(logger_, "Substitution HMI --> mobile id is failed.");
+ }
}
} // namespace commands
diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index d8f14fa844..515d8a998c 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -31,8 +31,10 @@
*/
#include <algorithm>
+#include <numeric>
#include <string>
#include "utils/macro.h"
+#include "utils/make_shared.h"
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
#include "application_manager/message_helper.h"
@@ -89,6 +91,9 @@ const std::string CreateInfoForUnsupportedResult(
case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VehicleInfo): {
return "VehicleInfo is not supported by system";
}
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_RC): {
+ return "Remote control is not supported by system";
+ }
default:
#ifdef ENABLE_LOG
CREATE_LOGGERPTR_LOCAL(logger, "Commands");
@@ -102,20 +107,29 @@ const std::string CreateInfoForUnsupportedResult(
}
bool CheckResultCode(const ResponseInfo& first, const ResponseInfo& second) {
- if (first.is_ok && second.is_unsupported_resource &&
- second.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) {
+ if (first.is_ok && second.is_unsupported_resource) {
+ return true;
+ }
+ if (first.is_ok && second.is_not_used) {
+ return true;
+ }
+ if (first.is_ok && second.is_ok) {
return true;
}
return false;
}
-bool IsResultCodeUnsupported(const ResponseInfo& first,
- const ResponseInfo& second) {
- return ((first.is_ok || first.is_invalid_enum) &&
- second.is_unsupported_resource) ||
- ((second.is_ok || second.is_invalid_enum) &&
- first.is_unsupported_resource) ||
- (first.is_unsupported_resource && second.is_unsupported_resource);
+bool IsResultCodeWarning(const ResponseInfo& first,
+ const ResponseInfo& second) {
+ const bool first_is_ok_second_is_warn =
+ (first.is_ok || first.is_not_used) &&
+ hmi_apis::Common_Result::WARNINGS == second.result_code;
+
+ const bool both_warnings =
+ hmi_apis::Common_Result::WARNINGS == first.result_code &&
+ hmi_apis::Common_Result::WARNINGS == second.result_code;
+
+ return first_is_ok_second_is_warn || both_warnings;
}
struct DisallowedParamsInserter {
@@ -143,13 +157,53 @@ struct DisallowedParamsInserter {
mobile_apis::VehicleDataResultCode::eType code_;
};
+ResponseInfo::ResponseInfo()
+ : result_code(hmi_apis::Common_Result::INVALID_ENUM)
+ , interface(HmiInterfaces::HMI_INTERFACE_INVALID_ENUM)
+ , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
+ , is_ok(false)
+ , is_unsupported_resource(false)
+ , is_not_used(false) {}
+
+ResponseInfo::ResponseInfo(const hmi_apis::Common_Result::eType result,
+ const HmiInterfaces::InterfaceID hmi_interface,
+ ApplicationManager& application_manager)
+ : result_code(result)
+ , interface(hmi_interface)
+ , interface_state(HmiInterfaces::STATE_NOT_RESPONSE)
+ , is_ok(false)
+ , is_unsupported_resource(false)
+ , is_not_used(false) {
+ using namespace helpers;
+
+ interface_state =
+ application_manager.hmi_interfaces().GetInterfaceState(hmi_interface);
+
+ is_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+ result_code,
+ hmi_apis::Common_Result::SUCCESS,
+ hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::WRONG_LANGUAGE,
+ hmi_apis::Common_Result::RETRY,
+ hmi_apis::Common_Result::SAVED);
+
+ is_not_used = hmi_apis::Common_Result::INVALID_ENUM == result_code;
+
+ is_unsupported_resource =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == result_code;
+}
+
CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message,
ApplicationManager& application_manager)
: CommandImpl(message, application_manager)
, EventObserver(application_manager.event_dispatcher())
- , current_state_(kAwaitingHMIResponse) {}
+ , current_state_(kAwaitingHMIResponse)
+ , hash_update_mode_(kSkipHashUpdate)
+ , is_success_result_(false) {}
-CommandRequestImpl::~CommandRequestImpl() {}
+CommandRequestImpl::~CommandRequestImpl() {
+ UpdateHash();
+}
bool CommandRequestImpl::Init() {
return true;
@@ -186,7 +240,7 @@ void CommandRequestImpl::onTimeOut() {
function_id(),
correlation_id(),
mobile_api::Result::GENERIC_ERROR);
-
+ AddTimeOutComponentInfoToMessage(*response);
application_manager_.ManageMobileCommand(response, ORIGIN_SDL);
}
@@ -197,6 +251,7 @@ void CommandRequestImpl::SendResponse(
const mobile_apis::Result::eType& result_code,
const char* info,
const smart_objects::SmartObject* response_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
{
sync_primitives::AutoLock auto_lock(state_lock_);
if (kTimedOut == current_state_) {
@@ -207,11 +262,9 @@ void CommandRequestImpl::SendResponse(
current_state_ = kCompleted;
}
- smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject;
- if (!result) {
- LOG4CXX_ERROR(logger_, "Memory allocation failed.");
- return;
- }
+ smart_objects::SmartObjectSPtr result =
+ utils::MakeShared<smart_objects::SmartObject>();
+
smart_objects::SmartObject& response = *result;
response[strings::params][strings::message_type] = MessageType::kResponse;
@@ -249,6 +302,8 @@ void CommandRequestImpl::SendResponse(
response[strings::msg_params][strings::success] = success;
response[strings::msg_params][strings::result_code] = result_code;
+ is_success_result_ = success;
+
application_manager_.ManageMobileCommand(result, ORIGIN_SDL);
}
@@ -308,6 +363,46 @@ bool CommandRequestImpl::ProcessHMIInterfacesAvailability(
return true;
}
+void CommandRequestImpl::UpdateHash() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (hash_update_mode_ == kSkipHashUpdate) {
+ LOG4CXX_DEBUG(logger_, "Hash update is disabled for " << function_id());
+ return;
+ }
+
+ if (HmiInterfaces::InterfaceState::STATE_NOT_RESPONSE ==
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI)) {
+ LOG4CXX_ERROR(logger_,
+ "UI interface has not responded. Hash won't be updated.");
+ return;
+ }
+
+ if (!is_success_result_) {
+ LOG4CXX_WARN(logger_, "Command is not succeeded. Hash won't be updated.");
+ return;
+ }
+
+ ApplicationSharedPtr application =
+ application_manager_.application(connection_key());
+ if (!application) {
+ LOG4CXX_ERROR(logger_,
+ "Application with connection key "
+ << connection_key()
+ << " not found. Not able to update hash.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Updating hash for application with connection key "
+ << connection_key() << " while processing function id "
+ << MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_api::FunctionID::eType>(function_id())));
+
+ application->UpdateHash();
+}
+
uint32_t CommandRequestImpl::SendHMIRequest(
const hmi_apis::FunctionID::eType& function_id,
const smart_objects::SmartObject* msg_params,
@@ -493,96 +588,133 @@ bool CommandRequestImpl::CheckAllowedParameters() {
return true;
}
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
- ApplicationSetConstIt it_app_list = accessor.begin();
- ApplicationSetConstIt 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()) {
- RPCParams params;
-
- const smart_objects::SmartObject& s_map =
- (*message_)[strings::msg_params];
- if (smart_objects::SmartType_Map == s_map.getType()) {
- smart_objects::SmartMap::iterator iter = s_map.map_begin();
- smart_objects::SmartMap::iterator iter_end = s_map.map_end();
-
- for (; iter != iter_end; ++iter) {
- if (true == iter->second.asBool()) {
- LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first);
- params.push_back(iter->first);
- }
- }
- }
-
- mobile_apis::Result::eType check_result =
- application_manager_.CheckPolicyPermissions(
- (*it_app_list).get()->policy_app_id(),
- (*it_app_list).get()->hmi_level(),
- static_cast<mobile_api::FunctionID::eType>(function_id()),
- params,
- &parameters_permissions_);
-
- // Check, if RPC is allowed by policy
- if (mobile_apis::Result::SUCCESS != check_result) {
- smart_objects::SmartObjectSPtr response =
- MessageHelper::CreateBlockedByPoliciesResponse(
- static_cast<mobile_api::FunctionID::eType>(function_id()),
- check_result,
- correlation_id(),
- (*it_app_list)->app_id());
-
- application_manager_.SendMessageToMobile(response);
- return false;
- }
-
- // If no parameters specified in policy table, no restriction will be
- // applied for parameters
- if (parameters_permissions_.allowed_params.empty() &&
- parameters_permissions_.disallowed_params.empty() &&
- parameters_permissions_.undefined_params.empty()) {
- return true;
- }
-
- RemoveDisallowedParameters();
+ const ApplicationSharedPtr app =
+ application_manager_.application(connection_key());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "There is no registered application with "
+ "connection key '"
+ << connection_key() << "'");
+ return false;
+ }
+
+ RPCParams params;
+
+ const smart_objects::SmartObject& s_map = (*message_)[strings::msg_params];
+ smart_objects::SmartMap::const_iterator iter = s_map.map_begin();
+ smart_objects::SmartMap::const_iterator iter_end = s_map.map_end();
+
+ for (; iter != iter_end; ++iter) {
+ if (iter->second.asBool()) {
+ LOG4CXX_DEBUG(logger_, "Request's param: " << iter->first);
+ params.insert(iter->first);
}
}
+
+ mobile_apis::Result::eType check_result =
+ application_manager_.CheckPolicyPermissions(
+ app,
+ MessageHelper::StringifiedFunctionID(
+ static_cast<mobile_api::FunctionID::eType>(function_id())),
+ params,
+ &parameters_permissions_);
+
+ // Check, if RPC is allowed by policy
+ if (mobile_apis::Result::SUCCESS != check_result) {
+ smart_objects::SmartObjectSPtr response =
+ MessageHelper::CreateBlockedByPoliciesResponse(
+ static_cast<mobile_api::FunctionID::eType>(function_id()),
+ check_result,
+ correlation_id(),
+ app->app_id());
+
+ application_manager_.SendMessageToMobile(response);
+ return false;
+ }
+
+ // If no parameters specified in policy table, no restriction will be
+ // applied for parameters
+ if (parameters_permissions_.allowed_params.empty() &&
+ parameters_permissions_.disallowed_params.empty() &&
+ parameters_permissions_.undefined_params.empty()) {
+ return true;
+ }
+
+ RemoveDisallowedParameters();
+
return true;
}
+bool CommandRequestImpl::CheckHMICapabilities(
+ const mobile_apis::ButtonName::eType button) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ using namespace smart_objects;
+ using namespace mobile_apis;
+
+ const HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ if (!hmi_capabilities.is_ui_cooperating()) {
+ LOG4CXX_ERROR(logger_, "UI is not supported by HMI");
+ return false;
+ }
+
+ const SmartObject* button_capabilities_so =
+ hmi_capabilities.button_capabilities();
+ if (!button_capabilities_so) {
+ LOG4CXX_ERROR(logger_, "Invalid button capabilities object");
+ return false;
+ }
+
+ const SmartObject& button_capabilities = *button_capabilities_so;
+ for (size_t i = 0; i < button_capabilities.length(); ++i) {
+ const SmartObject& capabilities = button_capabilities[i];
+ const ButtonName::eType current_button = static_cast<ButtonName::eType>(
+ capabilities.getElement(hmi_response::button_name).asInt());
+ if (current_button == button) {
+ LOG4CXX_DEBUG(logger_,
+ "Button capabilities for " << button << " was found");
+ return true;
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Button capabilities for " << button << " was not found");
+ return false;
+}
+
void CommandRequestImpl::RemoveDisallowedParameters() {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject& params = (*message_)[strings::msg_params];
// Remove from request all disallowed parameters
- std::vector<std::string>::const_iterator it_disallowed =
+ RPCParams::const_iterator it_disallowed =
parameters_permissions_.disallowed_params.begin();
- std::vector<std::string>::const_iterator it_disallowed_end =
+ RPCParams::const_iterator it_disallowed_end =
parameters_permissions_.disallowed_params.end();
for (; it_disallowed != it_disallowed_end; ++it_disallowed) {
if (params.keyExists(*it_disallowed)) {
- params.erase(*it_disallowed);
- removed_parameters_permissions_.disallowed_params.push_back(
- *it_disallowed);
- LOG4CXX_INFO(
- logger_,
- "Following parameter is disallowed by user: " << *it_disallowed);
+ const std::string key = *it_disallowed;
+ params.erase(key);
+ removed_parameters_permissions_.disallowed_params.insert(key);
+ LOG4CXX_INFO(logger_,
+ "Following parameter is disallowed by user: " << key);
}
}
// Remove from request all undefined yet parameters
- std::vector<std::string>::const_iterator it_undefined =
+ RPCParams::const_iterator it_undefined =
parameters_permissions_.undefined_params.begin();
- std::vector<std::string>::const_iterator it_undefined_end =
+ RPCParams::const_iterator it_undefined_end =
parameters_permissions_.undefined_params.end();
for (; it_undefined != it_undefined_end; ++it_undefined) {
if (params.keyExists(*it_undefined)) {
- params.erase(*it_undefined);
- removed_parameters_permissions_.undefined_params.push_back(*it_undefined);
- LOG4CXX_INFO(
- logger_,
- "Following parameter is disallowed by policy: " << *it_undefined);
+ const std::string key = *it_undefined;
+ params.erase(key);
+ removed_parameters_permissions_.undefined_params.insert(key);
+ LOG4CXX_INFO(logger_,
+ "Following parameter is disallowed by policy: " << key);
}
}
@@ -600,7 +732,7 @@ void CommandRequestImpl::RemoveDisallowedParameters() {
parameters_permissions_.allowed_params.end(),
key)) {
params.erase(key);
- removed_parameters_permissions_.undefined_params.push_back(key);
+ removed_parameters_permissions_.undefined_params.insert(key);
LOG4CXX_INFO(logger_,
"Following parameter is not found among allowed parameters '"
<< key << "' and will be treated as disallowed.");
@@ -622,7 +754,7 @@ void CommandRequestImpl::AddDisallowedParametersToInfo(
smart_objects::SmartObject& response) const {
std::string info;
- std::vector<std::string>::const_iterator it =
+ RPCParams::const_iterator it =
removed_parameters_permissions_.disallowed_params.begin();
for (; it != removed_parameters_permissions_.disallowed_params.end(); ++it) {
AddDissalowedParameterToInfoString(info, (*it));
@@ -669,6 +801,7 @@ bool CommandRequestImpl::HasDisallowedParams() const {
bool CommandRequestImpl::PrepareResultForMobileResponse(
hmi_apis::Common_Result::eType result_code,
HmiInterfaces::InterfaceID interface) const {
+ LOG4CXX_AUTO_TRACE(logger_);
using namespace helpers;
if (Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
result_code,
@@ -691,48 +824,9 @@ bool CommandRequestImpl::PrepareResultForMobileResponse(
bool CommandRequestImpl::PrepareResultForMobileResponse(
ResponseInfo& out_first, ResponseInfo& out_second) const {
- using namespace helpers;
-
- out_first.is_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- out_first.result_code,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED);
-
- out_second.is_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
- out_second.result_code,
- hmi_apis::Common_Result::SUCCESS,
- hmi_apis::Common_Result::WARNINGS,
- hmi_apis::Common_Result::WRONG_LANGUAGE,
- hmi_apis::Common_Result::RETRY,
- hmi_apis::Common_Result::SAVED);
-
- out_first.is_invalid_enum =
- hmi_apis::Common_Result::INVALID_ENUM == out_first.result_code;
-
- out_second.is_invalid_enum =
- hmi_apis::Common_Result::INVALID_ENUM == out_second.result_code;
-
- out_first.is_unsupported_resource =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == out_first.result_code;
-
- out_second.is_unsupported_resource =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == out_second.result_code;
-
- out_first.interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- out_first.interface);
- out_second.interface_state =
- application_manager_.hmi_interfaces().GetInterfaceState(
- out_second.interface);
-
- bool result = (out_first.is_ok && out_second.is_ok) ||
- (out_second.is_invalid_enum && out_first.is_ok) ||
- (out_first.is_invalid_enum && out_second.is_ok);
- result = result || CheckResultCode(out_first, out_second);
- result = result || CheckResultCode(out_second, out_first);
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool result = CheckResultCode(out_first, out_second) ||
+ CheckResultCode(out_second, out_first);
return result;
}
@@ -749,25 +843,30 @@ void CommandRequestImpl::GetInfo(
mobile_apis::Result::eType CommandRequestImpl::PrepareResultCodeForResponse(
const ResponseInfo& first, const ResponseInfo& second) {
+ LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- if (IsResultCodeUnsupported(first, second)) {
- result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- } else {
- // If response contains erroneous result code SDL need return erroneus
- // result code.
- hmi_apis::Common_Result::eType first_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- hmi_apis::Common_Result::eType second_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- if (!first.is_unsupported_resource) {
- first_result = first.result_code;
- }
- if (!second.is_unsupported_resource) {
- second_result = second.result_code;
- }
- result_code =
- MessageHelper::HMIToMobileResult(std::max(first_result, second_result));
- }
+ if (IsResultCodeUnsupported(first, second) ||
+ IsResultCodeUnsupported(second, first)) {
+ return mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ }
+ if (IsResultCodeWarning(first, second) ||
+ IsResultCodeWarning(second, first)) {
+ return mobile_apis::Result::WARNINGS;
+ }
+ // If response contains erroneous result code SDL need return erroneus
+ // result code.
+ hmi_apis::Common_Result::eType first_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ hmi_apis::Common_Result::eType second_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ if (!first.is_unsupported_resource) {
+ first_result = first.result_code;
+ }
+ if (!second.is_unsupported_resource) {
+ second_result = second.result_code;
+ }
+ result_code =
+ MessageHelper::HMIToMobileResult(std::max(first_result, second_result));
return result_code;
}
@@ -776,6 +875,100 @@ const CommandParametersPermissions& CommandRequestImpl::parameters_permissions()
return parameters_permissions_;
}
+void CommandRequestImpl::StartAwaitForInterface(
+ const HmiInterfaces::InterfaceID interface_id) {
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ awaiting_response_interfaces_.insert(interface_id);
+}
+
+bool CommandRequestImpl::IsInterfaceAwaited(
+ const HmiInterfaces::InterfaceID& interface_id) const {
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ std::set<HmiInterfaces::InterfaceID>::const_iterator it =
+ awaiting_response_interfaces_.find(interface_id);
+ return (it != awaiting_response_interfaces_.end());
+}
+
+void CommandRequestImpl::EndAwaitForInterface(
+ const HmiInterfaces::InterfaceID& interface_id) {
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ std::set<HmiInterfaces::InterfaceID>::const_iterator it =
+ awaiting_response_interfaces_.find(interface_id);
+ if (it != awaiting_response_interfaces_.end()) {
+ awaiting_response_interfaces_.erase(it);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "EndAwaitForInterface called on interface \
+ which was not put into await state: "
+ << interface_id);
+ }
+}
+
+bool CommandRequestImpl::IsResultCodeUnsupported(
+ const ResponseInfo& first, const ResponseInfo& second) const {
+ const bool first_ok_second_unsupported =
+ (first.is_ok || first.is_not_used) && second.is_unsupported_resource;
+ const bool both_unsupported =
+ first.is_unsupported_resource && second.is_unsupported_resource;
+ return first_ok_second_unsupported || both_unsupported;
+}
+
+std::string GetComponentNameFromInterface(
+ const HmiInterfaces::InterfaceID& interface) {
+ switch (interface) {
+ case HmiInterfaces::HMI_INTERFACE_Buttons:
+ return "Buttons";
+ case HmiInterfaces::HMI_INTERFACE_BasicCommunication:
+ return "BasicCommunication";
+ case HmiInterfaces::HMI_INTERFACE_VR:
+ return "VR";
+ case HmiInterfaces::HMI_INTERFACE_TTS:
+ return "TTS";
+ case HmiInterfaces::HMI_INTERFACE_UI:
+ return "UI";
+ case HmiInterfaces::HMI_INTERFACE_Navigation:
+ return "Navigation";
+ case HmiInterfaces::HMI_INTERFACE_VehicleInfo:
+ return "VehicleInfo";
+ case HmiInterfaces::HMI_INTERFACE_SDL:
+ return "SDL";
+ default:
+ return "Unknown type";
+ }
+}
+
+const std::string InfoInterfaceSeparator(
+ const std::string& sum, const HmiInterfaces::InterfaceID container_value) {
+ return sum.empty()
+ ? GetComponentNameFromInterface(container_value)
+ : sum + ", " + GetComponentNameFromInterface(container_value);
+}
+
+void CommandRequestImpl::AddTimeOutComponentInfoToMessage(
+ smart_objects::SmartObject& response) const {
+ using NsSmartDeviceLink::NsSmartObjects::SmartObject;
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(awaiting_response_interfaces_lock_);
+ if (awaiting_response_interfaces_.empty()) {
+ LOG4CXX_ERROR(logger_, "No interfaces awaiting, info param is empty");
+ return;
+ }
+
+ const std::string not_responding_interfaces_string =
+ std::accumulate(awaiting_response_interfaces_.begin(),
+ awaiting_response_interfaces_.end(),
+ std::string(""),
+ InfoInterfaceSeparator);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Not responding interfaces string: " << not_responding_interfaces_string);
+ if (!not_responding_interfaces_string.empty()) {
+ const std::string component_info =
+ not_responding_interfaces_string + " component does not respond";
+ response[strings::msg_params][strings::info] = component_info;
+ }
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc b/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
index 80b1edb5bb..c6c550a474 100644
--- a/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
+++ b/src/components/application_manager/src/commands/hmi/basic_communication_on_awake_sdl.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,3 +29,45 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
+#include "application_manager/commands/hmi/basic_communication_on_awake_sdl.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/resumption/resume_ctrl.h"
+
+namespace application_manager {
+
+namespace commands {
+
+OnAwakeSDLNotification::OnAwakeSDLNotification(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : NotificationFromHMI(message, application_manager) {}
+
+OnAwakeSDLNotification::~OnAwakeSDLNotification() {}
+
+void OnAwakeSDLNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!application_manager_.resume_controller().is_suspended()) {
+ return;
+ }
+
+ {
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetIt itBegin = accessor.GetData().begin();
+ ApplicationSetIt itEnd = accessor.GetData().end();
+ for (; itBegin != itEnd; ++itBegin) {
+ const ApplicationSharedPtr app = *itBegin;
+ if (app && app->IsHashChangedDuringSuspend()) {
+ MessageHelper::SendHashUpdateNotification(app->app_id(),
+ application_manager_);
+ app->SetHashChangedDuringSuspend(false);
+ }
+ }
+ }
+
+ application_manager_.resume_controller().OnAwake();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc b/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc
new file mode 100644
index 0000000000..a09fe71bf2
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/decrypt_certificate_request.cc
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/decrypt_certificate_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+DecryptCertificateRequest::DecryptCertificateRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager) {}
+
+void DecryptCertificateRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t correlation_id = RequestToHMI::correlation_id();
+ const uint32_t app_id = RequestToHMI::application_id();
+ application_manager_.set_application_id(correlation_id, app_id);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc b/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc
new file mode 100644
index 0000000000..cea9290f7d
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/decrypt_certificate_response.cc
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/decrypt_certificate_response.h"
+
+#include "application_manager/policies/policy_handler.h"
+#ifdef EXTERNAL_PROPRIETARY_MODE
+namespace application_manager {
+
+namespace commands {
+
+DecryptCertificateResponse::DecryptCertificateResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : ResponseFromHMI(message, application_manager) {}
+
+DecryptCertificateResponse::~DecryptCertificateResponse() {}
+
+void DecryptCertificateResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ (*message_)[strings::params][hmi_response::code].asInt());
+
+ const bool is_succeeded = hmi_apis::Common_Result::SUCCESS == code;
+
+ application_manager_.GetPolicyHandler().OnCertificateDecrypted(is_succeeded);
+}
+
+} // namespace commands
+} // namespace application_manager
+#endif // EXTERNAL_PROPRIETARY_MODE
diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc
index af220051d4..bfcdf4985e 100644
--- a/src/components/application_manager/src/commands/hmi/get_urls.cc
+++ b/src/components/application_manager/src/commands/hmi/get_urls.cc
@@ -34,18 +34,7 @@
#include "application_manager/message.h"
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler.h"
-
-namespace {
-struct PolicyAppIdComparator {
- PolicyAppIdComparator(const std::string& policy_app_id)
- : policy_app_id_(policy_app_id) {}
-
- bool operator()(const policy::EndpointData& data) {
- return data.app_id == policy_app_id_;
- }
- std::string policy_app_id_;
-};
-}
+#include "utils/helpers.h"
namespace application_manager {
namespace commands {
@@ -58,41 +47,114 @@ GetUrls::~GetUrls() {}
void GetUrls::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- using namespace smart_objects;
- using namespace application_manager;
- using namespace strings;
- using namespace hmi_apis;
+ namespace Common_Result = hmi_apis::Common_Result;
+ using policy::EndpointUrls;
if (!application_manager_.GetPolicyHandler().PolicyEnabled()) {
SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
return;
}
- SmartObject& object = *message_;
- const std::string service_to_check =
- object[msg_params][hmi_request::service].asString();
+ const uint32_t service_to_check =
+ (*message_)[strings::msg_params][hmi_request::service].asUInt();
+
+ EndpointUrls endpoints;
+ application_manager_.GetPolicyHandler().GetUpdateUrls(service_to_check,
+ endpoints);
- policy::EndpointUrls endpoints;
- application_manager_.GetPolicyHandler().GetServiceUrls(
- object[strings::msg_params][hmi_request::service].asString(), endpoints);
if (endpoints.empty()) {
LOG4CXX_ERROR(logger_, "No URLs for service " << service_to_check);
SendResponseToHMI(Common_Result::DATA_NOT_AVAILABLE);
return;
}
-#ifdef EXTENDED_POLICY
- const std::string policy_service = "7";
+#ifdef PROPRIETARY_MODE
+ const uint32_t policy_service = 7u;
if (policy_service == service_to_check) {
ProcessPolicyServiceURLs(endpoints);
return;
}
-#endif
+#endif // PROPRIETARY_MODE
+
ProcessServiceURLs(endpoints);
}
-#ifdef EXTENDED_POLICY
+void GetUrls::ProcessServiceURLs(const policy::EndpointUrls& endpoints) {
+ namespace Common_Result = hmi_apis::Common_Result;
+ using smart_objects::SmartObject;
+
+ (*message_)[strings::msg_params].erase(hmi_request::service);
+ SmartObject& urls = (*message_)[strings::msg_params][hmi_response::urls];
+
+ size_t index = 0;
+ for (size_t e = 0; e < endpoints.size(); ++e) {
+ ApplicationSharedPtr app =
+ application_manager_.application_by_policy_id(endpoints[e].app_id);
+
+#ifndef PROPRIETARY_MODE
+ bool registered_not_default = false;
+ if (policy::kDefaultId != endpoints[e].app_id) {
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Can't find application with policy id "
+ << endpoints[e].app_id
+ << " URLs adding for this application is skipped.");
+ continue;
+ }
+ registered_not_default = true;
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE || HTTP
+ for (size_t u = 0; u < endpoints[e].url.size(); ++u, ++index) {
+ const std::string& app_url = endpoints[e].url[u];
+ SmartObject& service_info = urls[index];
+
+ service_info[strings::url] = app_url;
+#ifndef PROPRIETARY_MODE
+ if (registered_not_default) {
+ service_info[strings::app_id] = app->hmi_app_id();
+ }
+#else // EXTERNAL_PROPRIETARY_MODE || HTTP
+ service_info[hmi_response::policy_app_id] = endpoints[e].app_id;
+#endif
+ }
+ }
+ SendResponseToHMI(Common_Result::SUCCESS);
+}
+
+void GetUrls::SendResponseToHMI(hmi_apis::Common_Result::eType result) {
+ (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
+ (*message_)[strings::params][hmi_response::code] = result;
+ application_manager_.ManageHMICommand(message_);
+}
+
+#ifdef PROPRIETARY_MODE
+struct PolicyAppIdComparator {
+ PolicyAppIdComparator(const std::string& policy_app_id)
+ : policy_app_id_(policy_app_id) {}
+
+ bool operator()(const policy::EndpointData& data) {
+ return data.app_id == policy_app_id_;
+ }
+ std::string policy_app_id_;
+};
+
+void FillSODefaultUrls(smart_objects::SmartObject& urls,
+ const policy::EndpointUrls& endpoints) {
+ using smart_objects::SmartObject;
+ PolicyAppIdComparator comparator(policy::kDefaultId);
+ policy::EndpointUrls::const_iterator it =
+ std::find_if(endpoints.begin(), endpoints.end(), comparator);
+ if (it == endpoints.end()) {
+ return;
+ }
+ SmartObject service_info = SmartObject(smart_objects::SmartType_Map);
+ for (size_t i = 0; i < (*it).url.size(); ++i) {
+ service_info[strings::url] = (*it).url[i];
+ urls[i] = service_info;
+ }
+}
+
void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
LOG4CXX_AUTO_TRACE(logger_);
using namespace smart_objects;
@@ -133,87 +195,29 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) {
object[msg_params][hmi_response::urls] = SmartObject(SmartType_Array);
SmartObject& urls = object[msg_params][hmi_response::urls];
const std::string mobile_app_id = app->policy_app_id();
- std::string default_url = "URL is not found";
-
- // Will use only one URL for particular application if it will be found
- // Otherwise URL from default section will used
- SmartObject service_info = SmartObject(SmartType_Map);
-
- for (size_t e = 0; e < endpoints.size(); ++e) {
- if (mobile_app_id == endpoints[e].app_id) {
- if (endpoints[e].url.size()) {
- service_info[url] = endpoints[e].url[0];
- SendResponseToHMI(Common_Result::SUCCESS);
- return;
- }
- }
- if (policy::kDefaultId == endpoints[e].app_id) {
- if (endpoints[e].url.size()) {
- default_url = endpoints[e].url[0];
- }
- }
- }
-
- service_info[strings::app_id] = app->app_id();
- service_info[strings::url] = default_url;
- urls[0] = service_info;
- // TODO(AOleynik): Issue with absent policy_app_id. Need to fix later on.
- // Possibly related to smart schema
- SendResponseToHMI(Common_Result::SUCCESS);
- return;
-}
-#endif
-
-void GetUrls::ProcessServiceURLs(const policy::EndpointUrls& endpoints) {
- using namespace smart_objects;
- using namespace strings;
- using namespace hmi_apis;
-
- SmartObject& object = *message_;
- object[msg_params].erase(hmi_request::service);
- object[msg_params][hmi_response::urls] = SmartObject(SmartType_Array);
-
- SmartObject& urls = object[msg_params][hmi_response::urls];
size_t index = 0;
- for (size_t e = 0; e < endpoints.size(); ++e) {
- for (size_t u = 0; u < endpoints[e].url.size(); ++u, ++index) {
- const std::string app_url = endpoints[e].url[u];
-
- urls[index] = SmartObject(SmartType_Map);
- SmartObject& service_info = urls[index];
-
- service_info[url] = app_url;
- if (policy::kDefaultId != endpoints[e].app_id) {
- service_info[hmi_response::policy_app_id] = endpoints[e].app_id;
+ for (size_t i = 0; i < endpoints.size(); ++i) {
+ using namespace helpers;
+
+ const bool to_add = Compare<std::string, EQ, ONE>(
+ endpoints[i].app_id, mobile_app_id, policy::kDefaultId);
+ const bool is_default = policy::kDefaultId == endpoints[i].app_id;
+
+ if (to_add) {
+ for (size_t k = 0; k < endpoints[i].url.size(); ++k) {
+ if (!is_default) {
+ urls[index][strings::app_id] = app_id_to_send_to;
+ }
+ urls[index][strings::url] = endpoints[i].url[k];
+ ++index;
}
}
}
SendResponseToHMI(Common_Result::SUCCESS);
+ return;
}
-
-void GetUrls::FillSODefaultUrls(smart_objects::SmartObject& urls,
- const policy::EndpointUrls& endpoints) {
- using namespace smart_objects;
- LOG4CXX_AUTO_TRACE(logger_);
- PolicyAppIdComparator comparator(policy::kDefaultId);
- policy::EndpointUrls::const_iterator it =
- std::find_if(endpoints.begin(), endpoints.end(), comparator);
- if (it == endpoints.end()) {
- return;
- }
- SmartObject service_info = SmartObject(SmartType_Map);
- for (size_t i = 0; i < (*it).url.size(); ++i) {
- service_info[strings::url] = (*it).url[i];
- urls[i] = service_info;
- }
-}
-
-void GetUrls::SendResponseToHMI(hmi_apis::Common_Result::eType result) {
- (*message_)[strings::params][strings::message_type] = MessageType::kResponse;
- (*message_)[strings::params][hmi_response::code] = result;
- application_manager_.ManageHMICommand(message_);
-}
+#endif // PROPRIETARY_MODE
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc
index 1e46eab52e..42b8c64fc0 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
@@ -109,6 +109,8 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
logger_,
"StartAudioStreamRequest aborted. Application can not stream");
}
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
break;
}
if (hmi_apis::Common_Result::REJECTED == code) {
@@ -125,15 +127,16 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) {
}
void AudioStartStreamRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
RetryStartSession();
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
}
void AudioStartStreamRequest::RetryStartSession() {
LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
if (!app) {
@@ -156,10 +159,11 @@ void AudioStartStreamRequest::RetryStartSession() {
}
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);
+ LOG4CXX_DEBUG(
+ logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
+
+ if (curr_retry_number < retry_number_) {
+ LOG4CXX_DEBUG(logger_, "Send AudioStartStream retry");
MessageHelper::SendAudioStartStream(app->app_id(), application_manager_);
app->set_audio_stream_retry_number(++curr_retry_number);
} else {
diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc
new file mode 100644
index 0000000000..d19db515ab
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/navi_set_video_config_request.h"
+#include <string>
+#include <vector>
+
+namespace application_manager {
+
+namespace commands {
+
+NaviSetVideoConfigRequest::NaviSetVideoConfigRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+NaviSetVideoConfigRequest::~NaviSetVideoConfigRequest() {}
+
+void NaviSetVideoConfigRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!CheckAvailabilityHMIInterfaces(
+ application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) {
+ LOG4CXX_WARN(logger_, "HMI interface Navigation is not supported");
+ return;
+ }
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application with hmi_app_id " << application_id()
+ << "does not exist");
+ return;
+ }
+
+ subscribe_on_event(hmi_apis::FunctionID::Navigation_SetVideoConfig,
+ correlation_id());
+ SendRequest();
+}
+
+void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_,
+ "Application is not found, abort NaviSetVideoConfigRequest");
+ return;
+ }
+
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
+ const hmi_apis::Common_Result::eType code =
+ static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asInt());
+ bool result = false;
+ std::vector<std::string> rejected_params;
+
+ if (code == hmi_apis::Common_Result::SUCCESS) {
+ LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response");
+ result = true;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Received SetVideoConfig failure response (" << event.id()
+ << ")");
+ result = false;
+ if (message[strings::msg_params].keyExists(strings::rejected_params)) {
+ const smart_objects::SmartArray* list =
+ message[strings::msg_params][strings::rejected_params].asArray();
+ if (list != NULL) {
+ for (unsigned int i = 0; i < list->size(); i++) {
+ const std::string& param = (*list)[i].asString();
+ // Make sure that we actually sent the parameter in the request
+ if ((*message_)[strings::msg_params].keyExists(strings::config) &&
+ (*message_)[strings::msg_params][strings::config].keyExists(
+ param)) {
+ rejected_params.push_back(param);
+ }
+ }
+ }
+ }
+ }
+ application_manager_.OnStreamingConfigured(
+ app->app_id(),
+ protocol_handler::ServiceType::kMobileNav,
+ result,
+ rejected_params);
+ break;
+ }
+ default:
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ break;
+ }
+}
+
+void NaviSetVideoConfigRequest::onTimeOut() {
+ LOG4CXX_WARN(logger_, "Timed out while waiting for SetVideoConfig response");
+
+ ApplicationSharedPtr app =
+ application_manager_.application_by_hmi_app(application_id());
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not found");
+ return;
+ }
+
+ std::vector<std::string> empty;
+ application_manager_.OnStreamingConfigured(
+ app->app_id(), protocol_handler::ServiceType::kMobileNav, false, empty);
+
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc
new file mode 100644
index 0000000000..03679eb3b1
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/navi_set_video_config_response.h"
+#include "application_manager/event_engine/event.h"
+
+namespace application_manager {
+
+namespace commands {
+
+NaviSetVideoConfigResponse::NaviSetVideoConfigResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : ResponseFromHMI(message, application_manager) {}
+
+NaviSetVideoConfigResponse::~NaviSetVideoConfigResponse() {}
+
+void NaviSetVideoConfigResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ event_engine::Event event(hmi_apis::FunctionID::Navigation_SetVideoConfig);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc
index 9f1c4b7902..ffc325b5e4 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
@@ -109,11 +109,13 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
logger_,
"NaviStartStreamRequest aborted. Application can not stream");
}
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
break;
}
if (hmi_apis::Common_Result::REJECTED == code) {
LOG4CXX_INFO(logger_, "StartStream response REJECTED ");
- SendRequest();
+ RetryStartSession();
break;
}
}
@@ -125,15 +127,16 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) {
}
void NaviStartStreamRequest::onTimeOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
RetryStartSession();
-
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
}
void NaviStartStreamRequest::RetryStartSession() {
LOG4CXX_AUTO_TRACE(logger_);
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
+
ApplicationSharedPtr app =
application_manager_.application_by_hmi_app(application_id());
if (!app) {
@@ -156,10 +159,11 @@ void NaviStartStreamRequest::RetryStartSession() {
}
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);
+ LOG4CXX_DEBUG(
+ logger_, "Retry number " << curr_retry_number << " of " << retry_number_);
+
+ if (curr_retry_number < retry_number_) {
+ LOG4CXX_DEBUG(logger_, "Send NaviStartStream retry");
MessageHelper::SendNaviStartStream(app->app_id(), application_manager_);
app->set_video_stream_retry_number(++curr_retry_number);
} else {
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 64eb63fde8..3c2d73b10c 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, ApplicationManager& application_manager)
: CommandImpl(message, application_manager) {
// Replace HMI app id with Mobile connection id
- ReplaceHMIByMobileAppId(*message);
+ ReplaceHMIWithMobileAppId(*message);
}
NotificationFromHMI::~NotificationFromHMI() {}
diff --git a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
index f1e933b7ef..d52df950c3 100644
--- a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
+++ b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc
@@ -39,15 +39,13 @@ namespace commands {
NotificationToHMI::NotificationToHMI(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace Mobile connection id with HMI app id
- ReplaceMobileByHMIAppId(*(message.get()));
-}
+ : CommandImpl(message, application_manager) {}
NotificationToHMI::~NotificationToHMI() {}
bool NotificationToHMI::Init() {
- return true;
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
}
bool NotificationToHMI::CleanUp() {
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 0efc1aee8a..19577f0127 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
@@ -35,6 +35,78 @@
#include "application_manager/application_manager.h"
#include "application_manager/policies/policy_handler.h"
#include "application_manager/message_helper.h"
+#include <algorithm>
+#include <functional>
+#include <string>
+#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
+#include "utils/make_shared.h"
+
+namespace {
+
+/**
+ * @brief Converts SmartObject data to group permission status and appends to
+ * collection
+ */
+struct PermissionsAppender
+ : public std::unary_function<void,
+ const smart_objects::SmartArray::value_type&> {
+ PermissionsAppender(policy::PermissionConsent& consents)
+ : allowed_key_(application_manager::hmi_response::allowed)
+ , consents_(consents) {}
+ void operator()(const smart_objects::SmartArray::value_type& item) const {
+ using namespace policy;
+ using namespace application_manager;
+
+ FunctionalGroupPermission permissions;
+
+ permissions.group_id = static_cast<int32_t>(item[strings::id].asInt());
+ permissions.group_alias = item[strings::name].asString();
+
+ if (item.keyExists(allowed_key_)) {
+ permissions.state =
+ item[allowed_key_].asBool() ? kGroupAllowed : kGroupDisallowed;
+ }
+
+ consents_.group_permissions.push_back(permissions);
+ }
+
+ private:
+ const std::string allowed_key_;
+ policy::PermissionConsent& consents_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+/**
+ * @brief Converts SmartObject data to customer connectivity status item and
+ * appends to collection
+ */
+struct ExternalConsentStatusAppender
+ : std::unary_function<void, const smart_objects::SmartArray::value_type&> {
+ ExternalConsentStatusAppender(
+ policy::ExternalConsentStatus& external_consent_status)
+ : external_consent_status_(external_consent_status) {}
+ void operator()(const smart_objects::SmartArray::value_type& item) const {
+ using namespace policy;
+ using namespace hmi_apis;
+ using namespace application_manager;
+
+ ExternalConsentStatusItem status_item(
+ static_cast<uint32_t>(item[strings::entity_type].asUInt()),
+ static_cast<uint32_t>(item[strings::entity_id].asUInt()),
+ static_cast<Common_EntityStatus::eType>(
+ item[strings::status].asUInt()) == Common_EntityStatus::ON
+ ? policy::kStatusOn
+ : policy::kStatusOff);
+
+ external_consent_status_.insert(status_item);
+ }
+
+ private:
+ policy::ExternalConsentStatus& external_consent_status_;
+};
+#endif
+} // namespace
namespace application_manager {
@@ -59,9 +131,9 @@ void OnAppPermissionConsentNotification::Run() {
connection_key = msg_params[strings::app_id].asUInt();
}
- if (msg_params.keyExists("consentedFunctions")) {
- smart_objects::SmartArray* user_consent =
- msg_params["consentedFunctions"].asArray();
+ if (msg_params.keyExists(strings::consented_functions)) {
+ const smart_objects::SmartArray* user_consent =
+ msg_params[strings::consented_functions].asArray();
smart_objects::SmartArray::const_iterator it = user_consent->begin();
smart_objects::SmartArray::const_iterator it_end = user_consent->end();
@@ -80,13 +152,24 @@ void OnAppPermissionConsentNotification::Run() {
permission_consent.group_permissions.push_back(permissions);
}
- permission_consent.consent_source = msg_params["source"].asString();
-
- application_manager_.GetPolicyHandler().OnAppPermissionConsent(
- connection_key, permission_consent);
+ permission_consent.consent_source = msg_params[strings::source].asString();
+ }
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status;
+ if (msg_params.keyExists(strings::external_consent_status)) {
+ const smart_objects::SmartArray* system_external_consent_status =
+ msg_params[strings::external_consent_status].asArray();
+ ExternalConsentStatusAppender status_appender(external_consent_status);
+ std::for_each(system_external_consent_status->begin(),
+ system_external_consent_status->end(),
+ status_appender);
}
+ application_manager_.GetPolicyHandler().OnAppPermissionConsent(
+ connection_key, permission_consent, external_consent_status);
+#else
+ application_manager_.GetPolicyHandler().OnAppPermissionConsent(
+ connection_key, permission_consent);
+#endif
}
-
-} // namespace commands
-
+} // commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc
index 10ea1ea303..f64e3e111b 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
@@ -44,6 +44,12 @@ OnAppUnregisteredNotification::OnAppUnregisteredNotification(
OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {}
+bool OnAppUnregisteredNotification::Init() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Replacement of hmi id is skipped.");
+ return true;
+}
+
void OnAppUnregisteredNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
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 4c322c456f..a895d353ce 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
@@ -34,8 +34,10 @@
#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
#include "application_manager/application_impl.h"
+#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#include "utils/make_shared.h"
namespace application_manager {
@@ -43,6 +45,53 @@ namespace commands {
namespace hmi {
+namespace {
+struct OnDriverDistractionProcessor {
+ OnDriverDistractionProcessor(
+ OnDriverDistractionNotification& command,
+ smart_objects::SmartObjectSPtr on_driver_distraction_so,
+ ApplicationManager& application_manager)
+ : command_(command)
+ , on_driver_distraction_so_(on_driver_distraction_so)
+ , application_manager_(application_manager)
+ , stringified_function_id_(MessageHelper::StringifiedFunctionID(
+ mobile_api::FunctionID::OnDriverDistractionID)) {}
+
+ void operator()(ApplicationSharedPtr application) {
+ if (application) {
+ (*on_driver_distraction_so_)[strings::params][strings::connection_key] =
+ application->app_id();
+ const RPCParams params;
+ policy::CheckPermissionResult result;
+ application_manager_.GetPolicyHandler().CheckPermissions(
+ application, stringified_function_id_, params, result);
+ if (result.hmi_level_permitted != policy::kRpcAllowed) {
+ MobileMessageQueue messages;
+ application->SwapMobileMessageQueue(messages);
+ messages.erase(
+ std::remove_if(
+ messages.begin(),
+ messages.end(),
+ [this](smart_objects::SmartObjectSPtr message) {
+ return (*message)[strings::params][strings::function_id]
+ .asString() == stringified_function_id_;
+ }),
+ messages.end());
+ application->PushMobileMessage(on_driver_distraction_so_);
+ return;
+ }
+ command_.SendNotificationToMobile(on_driver_distraction_so_);
+ }
+ }
+
+ private:
+ OnDriverDistractionNotification& command_;
+ smart_objects::SmartObjectSPtr on_driver_distraction_so_;
+ ApplicationManager& application_manager_;
+ std::string stringified_function_id_;
+};
+}
+
OnDriverDistractionNotification::OnDriverDistractionNotification(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: NotificationFromHMI(message, application_manager) {}
@@ -51,38 +100,31 @@ OnDriverDistractionNotification::~OnDriverDistractionNotification() {}
void OnDriverDistractionNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-
const hmi_apis::Common_DriverDistractionState::eType state =
static_cast<hmi_apis::Common_DriverDistractionState::eType>(
(*message_)[strings::msg_params][hmi_notification::state].asInt());
- application_manager_.set_driver_distraction(state);
+ application_manager_.set_driver_distraction_state(state);
smart_objects::SmartObjectSPtr on_driver_distraction =
- new smart_objects::SmartObject();
+ utils::MakeShared<smart_objects::SmartObject>();
if (!on_driver_distraction) {
LOG4CXX_ERROR(logger_, "NULL pointer");
return;
}
-
(*on_driver_distraction)[strings::params][strings::function_id] =
mobile_api::FunctionID::OnDriverDistractionID;
-
+ (*on_driver_distraction)[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
(*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
state;
const ApplicationSet applications =
application_manager_.applications().GetData();
- ApplicationSetConstIt it = applications.begin();
- for (; applications.end() != it; ++it) {
- const ApplicationSharedPtr app = *it;
- if (app) {
- (*on_driver_distraction)[strings::params][strings::connection_key] =
- app->app_id();
- SendNotificationToMobile(on_driver_distraction);
- }
- }
+ OnDriverDistractionProcessor processor(
+ *this, on_driver_distraction, application_manager_);
+ std::for_each(applications.begin(), applications.end(), processor);
}
} // namespace hmi
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 682093cef9..cb68b21263 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
@@ -75,6 +75,7 @@ void OnExitAllApplicationsNotification::Run() {
break;
}
case hmi_apis::Common_ApplicationsCloseReason::SUSPEND: {
+ application_manager_.resume_controller().OnSuspend();
SendOnSDLPersistenceComplete();
return;
}
@@ -110,5 +111,4 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() {
}
} // namespace commands
-
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
index a7b6b9a2cd..efdfaf8f3e 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,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,9 @@
#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "functional_module/plugin_manager.h"
+#endif // SDL_REMOTE_CONTROL
namespace application_manager {
@@ -62,17 +65,17 @@ void OnExitApplicationNotification::Run() {
return;
}
+#ifdef SDL_REMOTE_CONTROL
+ application_manager_.GetPluginManager().OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationExit, app_impl);
+#endif // SDL_REMOTE_CONTROL
+
Common_ApplicationExitReason::eType reason;
reason = static_cast<Common_ApplicationExitReason::eType>(
(*message_)[strings::msg_params][strings::reason].asInt());
switch (reason) {
case Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION: {
- application_manager_.ManageMobileCommand(
- MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
- app_id,
- AppInterfaceUnregisteredReason::DRIVER_DISTRACTION_VIOLATION),
- commands::Command::ORIGIN_SDL);
break;
}
case Common_ApplicationExitReason::USER_EXIT: {
@@ -100,13 +103,9 @@ void OnExitApplicationNotification::Run() {
return;
}
}
- ApplicationSharedPtr app = application_manager_.application(app_id);
- if (app) {
- application_manager_.state_controller().SetRegularState(
- app, HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE, false);
- } else {
- LOG4CXX_ERROR(logger_, "Unable to find appication " << app_id);
- }
+
+ application_manager_.state_controller().SetRegularState(
+ app_impl, HMILevel::HMI_NONE, AudioStreamingState::NOT_AUDIBLE, false);
}
} // namespace commands
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 03c0bc7378..8724a072ed 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
@@ -47,7 +47,7 @@ OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {}
void OnReceivedPolicyUpdate::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-#ifdef EXTENDED_POLICY
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
const std::string& file_path =
(*message_)[strings::msg_params][hmi_notification::policyfile].asString();
policy::BinaryMessage file_content;
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 b74f1b6799..ea91dca5f1 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
@@ -89,6 +89,22 @@ void OnSystemRequestNotification::Run() {
return;
}
+ std::string device_mac;
+ application_manager_.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(app->device(), NULL, NULL, &device_mac, NULL);
+
+ if (policy::kDeviceAllowed !=
+ application_manager_.GetPolicyHandler().GetUserConsentForDevice(
+ device_mac)) {
+ LOG4CXX_WARN(logger_,
+ "Application "
+ << app->policy_app_id()
+ << " is registered from non-consented device."
+ "Can't forward notification to application.");
+ return;
+ }
+
LOG4CXX_DEBUG(logger_,
"Sending request with application id " << app->policy_app_id());
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 5f8109ccab..bba7e2f3ff 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
@@ -50,6 +50,14 @@ void OnVIVehicleDataNotification::Run() {
(*message_)[strings::params][strings::function_id] =
static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID);
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+ if (msg_params.keyExists(strings::odometer)) {
+ application_manager_.IviInfoUpdated(
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER,
+ msg_params[strings::odometer].asInt());
+ }
+
SendNotificationToMobile(message_);
}
diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc
new file mode 100644
index 0000000000..32b296a3b9
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/rc_get_capabilities_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCGetCapabilitiesRequest::RCGetCapabilitiesRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager) {}
+
+RCGetCapabilitiesRequest::~RCGetCapabilitiesRequest() {}
+
+void RCGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc
new file mode 100644
index 0000000000..82cbd7f128
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCGetCapabilitiesResponse::RCGetCapabilitiesResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : ResponseFromHMI(message, application_manager) {}
+
+RCGetCapabilitiesResponse::~RCGetCapabilitiesResponse() {}
+
+void RCGetCapabilitiesResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities();
+ bool capability_exists =
+ (*message_)[strings::msg_params].keyExists(strings::rc_capability);
+
+ if (capability_exists) {
+ hmi_capabilities.set_rc_capability(
+ (*message_)[strings::msg_params][strings::rc_capability]);
+ }
+ hmi_capabilities.set_rc_supported(capability_exists);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc
new file mode 100644
index 0000000000..a976ce1044
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/rc_is_ready_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCIsReadyRequest::RCIsReadyRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+RCIsReadyRequest::~RCIsReadyRequest() {}
+
+void RCIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::RC_IsReady, correlation_id());
+ SendRequest();
+}
+
+void RCIsReadyRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const smart_objects::SmartObject& message = event.smart_object();
+ switch (event.id()) {
+ case hmi_apis::FunctionID::RC_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received RC_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::RC_IsReady);
+ const bool is_available = ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_RC);
+
+ HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ hmi_capabilities.set_is_rc_cooperating(is_available);
+ if (!is_available) {
+ hmi_capabilities.set_rc_supported(false);
+ }
+
+ if (!CheckAvailabilityHMIInterfaces(application_manager_,
+ HmiInterfaces::HMI_INTERFACE_RC)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_RC isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void RCIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void RCIsReadyRequest::SendMessageToHMI() {
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::RC_GetCapabilities, application_manager_));
+ application_manager_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc
new file mode 100644
index 0000000000..6756b294f3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/rc_is_ready_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCIsReadyResponse::RCIsReadyResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : ResponseFromHMI(message, application_manager) {}
+
+RCIsReadyResponse::~RCIsReadyResponse() {}
+
+void RCIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::RC_IsReady);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc
index be3cd6314c..5a4e7b149e 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
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2016, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@ RequestFromHMI::RequestFromHMI(const MessageSharedPtr& message,
: CommandImpl(message, application_manager)
, EventObserver(application_manager.event_dispatcher()) {
// Replace HMI app id with Mobile connection id
- ReplaceHMIByMobileAppId(*(message.get()));
+ ReplaceHMIWithMobileAppId(*message);
}
RequestFromHMI::~RequestFromHMI() {}
@@ -65,9 +65,10 @@ void RequestFromHMI::SendResponse(
const uint32_t correlation_id,
const hmi_apis::FunctionID::eType function_id,
const hmi_apis::Common_Result::eType result_code) {
- smart_objects::SmartObject* message =
- new smart_objects::SmartObject(smart_objects::SmartType_Map);
- FillCommonParametersOfSO(message, correlation_id, function_id);
+ smart_objects::SmartObjectSPtr message =
+ ::utils::MakeShared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ FillCommonParametersOfSO(*message, correlation_id, function_id);
(*message)[strings::params][strings::message_type] = MessageType::kResponse;
(*message)[strings::params][hmi_response::code] = 0;
(*message)[strings::msg_params][strings::success] = success;
@@ -76,30 +77,31 @@ void RequestFromHMI::SendResponse(
application_manager_.ManageHMICommand(message);
}
-// void RequestFromHMI::SendErrorResponse(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);
-// FillCommonParametersOfSO(message, correlation_id, function_id);
-// (*message)[strings::params][strings::message_type] =
-// MessageType::kErrorResponse;
-// (*message)[strings::params][hmi_response::code] = result_code;
-// (*message)[strings::params][strings::error_msg] = "HMIDeactivate is active";
-
-// application_manager_.ManageHMICommand(message);
-//}
+void RequestFromHMI::SendErrorResponse(
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id,
+ const hmi_apis::Common_Result::eType result_code,
+ const std::string error_message) {
+ smart_objects::SmartObjectSPtr message =
+ ::utils::MakeShared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ FillCommonParametersOfSO(*message, correlation_id, function_id);
+ (*message)[strings::params][strings::message_type] =
+ MessageType::kErrorResponse;
+ (*message)[strings::params][hmi_response::code] = result_code;
+ (*message)[strings::params][strings::error_msg] = error_message;
+
+ application_manager_.ManageHMICommand(message);
+}
void RequestFromHMI::FillCommonParametersOfSO(
- smart_objects::SmartObject* message,
- uint32_t correlation_id,
- hmi_apis::FunctionID::eType function_id) {
- (*message)[strings::params][strings::function_id] = function_id;
- (*message)[strings::params][strings::protocol_type] = hmi_protocol_type_;
- (*message)[strings::params][strings::protocol_version] = protocol_version_;
- (*message)[strings::params][strings::correlation_id] = correlation_id;
+ smart_objects::SmartObject& message,
+ const uint32_t correlation_id,
+ const hmi_apis::FunctionID::eType function_id) {
+ (message)[strings::params][strings::function_id] = function_id;
+ (message)[strings::params][strings::protocol_type] = hmi_protocol_type_;
+ (message)[strings::params][strings::protocol_version] = protocol_version_;
+ (message)[strings::params][strings::correlation_id] = correlation_id;
}
} // namespace commands
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 39d549ac72..6905e7cdef 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
@@ -61,15 +61,13 @@ bool ChangeInterfaceState(ApplicationManager& application_manager,
RequestToHMI::RequestToHMI(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace Mobile connection id with HMI app id
- ReplaceMobileByHMIAppId(*(message.get()));
-}
+ : CommandImpl(message, application_manager) {}
RequestToHMI::~RequestToHMI() {}
bool RequestToHMI::Init() {
- return true;
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
}
bool RequestToHMI::CleanUp() {
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 23d8e6e229..d6d5d95d07 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
@@ -48,7 +48,7 @@ ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message,
}
// Replace HMI app id with Mobile connection id
- ReplaceHMIByMobileAppId(*(message.get()));
+ ReplaceHMIWithMobileAppId(*message);
}
ResponseFromHMI::~ResponseFromHMI() {}
diff --git a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
index e6f64047ba..de1e1e0fde 100644
--- a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
+++ b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc
@@ -39,15 +39,13 @@ namespace commands {
ResponseToHMI::ResponseToHMI(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : CommandImpl(message, application_manager) {
- // Replace Mobile connection id with HMI app id
- ReplaceMobileByHMIAppId(*(message.get()));
-}
+ : CommandImpl(message, application_manager) {}
ResponseToHMI::~ResponseToHMI() {}
bool ResponseToHMI::Init() {
- return true;
+ // Replace Mobile connection id with HMI app id
+ return ReplaceMobileWithHMIAppId(*message_);
}
bool ResponseToHMI::CleanUp() {
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 30ea41e0b0..6961c15f76 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
@@ -46,7 +46,10 @@ struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> {
bool operator()(const ApplicationSharedPtr app) const {
return app
? handle_ == app->device() &&
- ProtocolVersion::kV4 == app->protocol_version()
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::
+ PROTOCOL_VERSION_4,
+ app->protocol_version())
: false;
}
};
@@ -84,6 +87,42 @@ SDLActivateAppRequest::SDLActivateAppRequest(
SDLActivateAppRequest::~SDLActivateAppRequest() {}
+uint32_t SDLActivateAppRequest::app_id() const {
+ using namespace strings;
+ if (!(*message_).keyExists(msg_params)) {
+ LOG4CXX_DEBUG(logger_, msg_params << " section is absent in the message.");
+ return 0;
+ }
+ if (!(*message_)[msg_params].keyExists(strings::app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ strings::app_id << " section is absent in the message.");
+ return 0;
+ }
+ return (*message_)[msg_params][strings::app_id].asUInt();
+}
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+void SDLActivateAppRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace hmi_apis::FunctionID;
+
+ if (application_manager_.state_controller().IsStateActive(
+ HmiState::STATE_ID_DEACTIVATE_HMI)) {
+ LOG4CXX_DEBUG(logger_,
+ "DeactivateHmi state is active. "
+ "Sends response with result code REJECTED");
+ SendErrorResponse(correlation_id(),
+ static_cast<eType>(function_id()),
+ hmi_apis::Common_Result::REJECTED,
+ "HMIDeactivate is active");
+ } else {
+ const uint32_t application_id = app_id();
+ application_manager_.GetPolicyHandler().OnActivateApp(application_id,
+ correlation_id());
+ }
+}
+
+#else // EXTERNAL_PROPRIETARY_MODE
void SDLActivateAppRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace hmi_apis::FunctionID;
@@ -118,6 +157,18 @@ void SDLActivateAppRequest::Run() {
"Found application to activate. Application id is "
<< app_to_activate->app_id());
+ if (application_manager_.state_controller().IsStateActive(
+ HmiState::StateID::STATE_ID_DEACTIVATE_HMI)) {
+ LOG4CXX_WARN(logger_,
+ "DeactivateHmi state is active. "
+ "Sends response with result code REJECTED");
+ SendErrorResponse(correlation_id(),
+ static_cast<hmi_apis::FunctionID::eType>(function_id()),
+ hmi_apis::Common_Result::REJECTED,
+ "HMIDeactivate is active");
+ return;
+ }
+
if (app_to_activate->IsRegistered()) {
LOG4CXX_DEBUG(logger_, "Application is registered. Activating.");
application_manager_.GetPolicyHandler().OnActivateApp(application_id,
@@ -134,7 +185,8 @@ void SDLActivateAppRequest::Run() {
"Can't find regular foreground app with the same "
"connection id:"
<< device_handle);
- SendResponse(false, correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED);
+ SendErrorResponse(
+ correlation_id(), SDL_ActivateApp, NO_APPS_REGISTERED, "");
return;
}
@@ -160,13 +212,14 @@ void SDLActivateAppRequest::Run() {
subscribe_on_event(BasicCommunication_OnAppRegistered);
}
+#endif // EXTERNAL_PROPRIETARY_MODE
void SDLActivateAppRequest::onTimeOut() {
using namespace hmi_apis::FunctionID;
using namespace hmi_apis::Common_Result;
using namespace application_manager;
unsubscribe_from_event(BasicCommunication_OnAppRegistered);
- SendResponse(
- false, correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED);
+ SendErrorResponse(
+ correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED, "");
}
void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
@@ -192,20 +245,6 @@ void SDLActivateAppRequest::on_event(const event_engine::Event& event) {
correlation_id());
}
-uint32_t SDLActivateAppRequest::app_id() const {
- using namespace strings;
- if (!(*message_).keyExists(msg_params)) {
- LOG4CXX_DEBUG(logger_, msg_params << " section is absent in the message.");
- return 0;
- }
- if (!(*message_)[msg_params].keyExists(strings::app_id)) {
- LOG4CXX_DEBUG(logger_,
- strings::app_id << " section is absent in the message.");
- return 0;
- }
- return (*message_)[msg_params][strings::app_id].asUInt();
-}
-
uint32_t SDLActivateAppRequest::hmi_app_id(
const smart_objects::SmartObject& so) const {
using namespace strings;
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 e79bca14de..f1fb9ccead 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
@@ -44,7 +44,7 @@ SDLPolicyUpdate::~SDLPolicyUpdate() {}
void SDLPolicyUpdate::Run() {
LOG4CXX_AUTO_TRACE(logger_);
-#ifdef EXTENDED_POLICY
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
SendRequest();
#else
LOG4CXX_WARN(logger_,
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 de0a2f2157..3b5aeac639 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
@@ -78,6 +78,32 @@ void UIGetCapabilitiesResponse::Run() {
hmi_capabilities.set_phone_call_supported(
msg_params[strings::hmi_capabilities][strings::phone_call].asBool());
}
+ if (msg_params[strings::hmi_capabilities].keyExists(
+ strings::video_streaming)) {
+ hmi_capabilities.set_video_streaming_supported(
+ msg_params[strings::hmi_capabilities][strings::video_streaming]
+ .asBool());
+ }
+ }
+
+ if (msg_params.keyExists(strings::system_capabilities)) {
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::navigation_capability)) {
+ hmi_capabilities.set_navigation_capability(
+ msg_params[strings::system_capabilities]
+ [strings::navigation_capability]);
+ }
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::phone_capability)) {
+ hmi_capabilities.set_phone_capability(
+ msg_params[strings::system_capabilities][strings::phone_capability]);
+ }
+ if (msg_params[strings::system_capabilities].keyExists(
+ strings::video_streaming_capability)) {
+ hmi_capabilities.set_video_streaming_capability(
+ msg_params[strings::system_capabilities]
+ [strings::video_streaming_capability]);
+ }
}
}
diff --git a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc
new file mode 100644
index 0000000000..9484906a17
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/ui_send_haptic_data_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISendHapticDataRequest::UISendHapticDataRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager) {}
+
+UISendHapticDataRequest::~UISendHapticDataRequest() {}
+
+void UISendHapticDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc
new file mode 100644
index 0000000000..a8239a40e8
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "application_manager/commands/hmi/ui_send_haptic_data_response.h"
+#include "application_manager/event_engine/event.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+UISendHapticDataResponse::UISendHapticDataResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : ResponseFromHMI(message, application_manager) {}
+
+UISendHapticDataResponse::~UISendHapticDataResponse() {}
+
+void UISendHapticDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::UI_SendHapticData);
+ event.set_smart_object(*message_);
+ event.raise(application_manager_.event_dispatcher());
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
index c98b7ec028..1653ec0744 100644
--- a/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
+++ b/src/components/application_manager/src/commands/hmi/ui_set_icon_request.cc
@@ -36,8 +36,9 @@ namespace application_manager {
namespace commands {
-UISetIconRequest::UISetIconRequest(const MessageSharedPtr& message)
- : RequestToHMI(message) {}
+UISetIconRequest::UISetIconRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager) {}
UISetIconRequest::~UISetIconRequest() {}
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 a76f537a24..69948b8122 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
@@ -64,6 +64,11 @@ void AddCommandRequest::onTimeOut() {
CommandRequestImpl::onTimeOut();
}
+bool AddCommandRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
void AddCommandRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -187,10 +192,12 @@ void AddCommandRequest::Run() {
}
if (send_ui_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_AddCommand, &ui_msg_params, true);
}
if (send_vr_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &vr_msg_params, true);
}
}
@@ -312,6 +319,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_AddCommand: {
LOG4CXX_INFO(logger_, "Received UI_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -323,6 +331,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::VR_AddCommand: {
LOG4CXX_INFO(logger_, "Received VR_AddCommand event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
is_vr_received_ = true;
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -492,10 +501,6 @@ void AddCommandRequest::on_event(const event_engine::Event& event) {
result_code,
info.empty() ? NULL : info.c_str(),
&(message[strings::msg_params]));
-
- if (result) {
- application->UpdateHash();
- }
}
bool AddCommandRequest::IsPendingResponseExist() {
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 6838d1af7d..fe44e5a41f 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
@@ -94,6 +94,7 @@ void AddSubMenuRequest::Run() {
(*message_)[strings::msg_params][strings::menu_name];
msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_AddSubMenu, &msg_params, true);
}
@@ -103,6 +104,7 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_AddSubMenu: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -128,9 +130,6 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) {
MessageHelper::HMIToMobileResult(result_code),
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
- if (result) {
- application->UpdateHash();
- }
break;
}
default: {
@@ -140,6 +139,11 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) {
}
}
+bool AddSubMenuRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
bool AddSubMenuRequest::CheckSubMenuName() {
LOG4CXX_AUTO_TRACE(logger_);
const char* str = NULL;
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 b151990289..d5767690d7 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
@@ -111,6 +111,7 @@ void AlertManeuverRequest::Run() {
}
pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
SendHMIRequest(
hmi_apis::FunctionID::Navigation_AlertManeuver, &msg_params, true);
@@ -123,6 +124,7 @@ void AlertManeuverRequest::Run() {
msg_params[hmi_request::speak_type] =
hmi_apis::Common_MethodName::ALERT_MANEUVER;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, &msg_params, true);
}
}
@@ -134,6 +136,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) {
switch (event_id) {
case hmi_apis::FunctionID::Navigation_AlertManeuver: {
LOG4CXX_INFO(logger_, "Received Navigation_AlertManeuver event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
pending_requests_.Remove(event_id);
navi_alert_maneuver_result_code_ =
static_cast<hmi_apis::Common_Result::eType>(
@@ -143,6 +146,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::TTS_Speak: {
LOG4CXX_INFO(logger_, "Received TTS_Speak event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
pending_requests_.Remove(event_id);
tts_speak_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -191,10 +195,13 @@ bool AlertManeuverRequest::PrepareResponseParameters(
application_manager::commands::ResponseInfo navigation_alert_info(
navi_alert_maneuver_result_code_,
- HmiInterfaces::HMI_INTERFACE_Navigation);
+ HmiInterfaces::HMI_INTERFACE_Navigation,
+ application_manager_);
application_manager::commands::ResponseInfo tts_alert_info(
- tts_speak_result_code_, HmiInterfaces::HMI_INTERFACE_TTS);
+ tts_speak_result_code_,
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
const bool result =
PrepareResultForMobileResponse(navigation_alert_info, tts_alert_info);
@@ -216,23 +223,42 @@ bool AlertManeuverRequest::PrepareResponseParameters(
bool AlertManeuverRequest::IsWhiteSpaceExist() {
LOG4CXX_AUTO_TRACE(logger_);
- const char* str = NULL;
+ using smart_objects::SmartArray;
if ((*message_)[strings::msg_params].keyExists(strings::tts_chunks)) {
- const smart_objects::SmartArray* tc_array =
+ const SmartArray* tts_chunks_arr =
(*message_)[strings::msg_params][strings::tts_chunks].asArray();
- smart_objects::SmartArray::const_iterator it_tc = tc_array->begin();
- smart_objects::SmartArray::const_iterator it_tc_end = tc_array->end();
+ SmartArray::const_iterator it_tts_chunk = tts_chunks_arr->begin();
- for (; it_tc != it_tc_end; ++it_tc) {
- str = (*it_tc)[strings::text].asCharArray();
- if (strlen(str) && !CheckSyntax(str)) {
+ for (; it_tts_chunk != tts_chunks_arr->end(); ++it_tts_chunk) {
+ const char* tts_chunk_text = (*it_tts_chunk)[strings::text].asCharArray();
+ if (strlen(tts_chunk_text) && !CheckSyntax(tts_chunk_text)) {
LOG4CXX_ERROR(logger_, "Invalid tts_chunks syntax check failed");
return true;
}
}
}
+ if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ DCHECK_OR_RETURN(
+ (*message_)[strings::msg_params][strings::soft_buttons].getType() ==
+ smart_objects::SmartType_Array,
+ true);
+ const smart_objects::SmartArray* soft_button_array =
+ (*message_)[strings::msg_params][strings::soft_buttons].asArray();
+
+ SmartArray::const_iterator it_soft_button = soft_button_array->begin();
+
+ for (; it_soft_button != soft_button_array->end(); ++it_soft_button) {
+ const char* soft_button_text =
+ (*it_soft_button)[strings::text].asCharArray();
+ if (!CheckSyntax(soft_button_text)) {
+ LOG4CXX_ERROR(logger_, "Invalid soft_buttons syntax check failed");
+ return true;
+ }
+ }
+ }
+
return false;
}
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 48eb45f9ce..3c42e43767 100644
--- a/src/components/application_manager/src/commands/mobile/alert_request.cc
+++ b/src/components/application_manager/src/commands/mobile/alert_request.cc
@@ -40,13 +40,12 @@
#include "application_manager/policies/policy_handler.h"
#include "utils/helpers.h"
+#include "smart_objects/smart_object.h"
namespace application_manager {
namespace commands {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
AlertRequest::AlertRequest(const MessageSharedPtr& message,
ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
@@ -117,18 +116,6 @@ void AlertRequest::Run() {
}
}
-void AlertRequest::onTimeOut() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (false ==
- (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
- CommandRequestImpl::onTimeOut();
- return;
- }
- LOG4CXX_INFO(logger_,
- "Default timeout ignored. "
- "AlertRequest with soft buttons wait timeout on HMI side");
-}
-
void AlertRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
@@ -149,6 +136,7 @@ void AlertRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::UI_Alert: {
LOG4CXX_INFO(logger_, "Received UI_Alert event");
// Unsubscribe from event to avoid unwanted messages
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
unsubscribe_from_event(hmi_apis::FunctionID::UI_Alert);
awaiting_ui_alert_response_ = false;
HmiInterfaces::InterfaceState ui_interface_state =
@@ -158,6 +146,7 @@ void AlertRequest::on_event(const event_engine::Event& event) {
if (awaiting_tts_speak_response_ &&
HmiInterfaces::STATE_NOT_AVAILABLE != ui_interface_state) {
awaiting_tts_stop_speaking_response_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL, true);
}
alert_result_ = static_cast<hmi_apis::Common_Result::eType>(
@@ -171,6 +160,7 @@ void AlertRequest::on_event(const event_engine::Event& event) {
case hmi_apis::FunctionID::TTS_Speak: {
LOG4CXX_INFO(logger_, "Received TTS_Speak event");
// Unsubscribe from event to avoid unwanted messages
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
unsubscribe_from_event(hmi_apis::FunctionID::TTS_Speak);
awaiting_tts_speak_response_ = false;
tts_speak_result_ = static_cast<hmi_apis::Common_Result::eType>(
@@ -180,6 +170,7 @@ void AlertRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::TTS_StopSpeaking: {
LOG4CXX_INFO(logger_, "Received TTS_StopSpeaking event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
// Unsubscribe from event to avoid unwanted messages
unsubscribe_from_event(hmi_apis::FunctionID::TTS_StopSpeaking);
awaiting_tts_stop_speaking_response_ = false;
@@ -205,9 +196,11 @@ void AlertRequest::on_event(const event_engine::Event& event) {
bool AlertRequest::PrepareResponseParameters(
mobile_apis::Result::eType& result_code, std::string& info) {
- ResponseInfo ui_alert_info(alert_result_, HmiInterfaces::HMI_INTERFACE_UI);
+ ResponseInfo ui_alert_info(
+ alert_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
ResponseInfo tts_alert_info(tts_speak_result_,
- HmiInterfaces::HMI_INTERFACE_TTS);
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
bool result = PrepareResultForMobileResponse(ui_alert_info, tts_alert_info);
@@ -220,7 +213,7 @@ bool AlertRequest::PrepareResponseParameters(
result = false;
}
result_code = mobile_apis::Result::WARNINGS;
- if ((ui_alert_info.is_ok || ui_alert_info.is_invalid_enum) &&
+ if ((ui_alert_info.is_ok || ui_alert_info.is_not_used) &&
tts_alert_info.is_unsupported_resource &&
HmiInterfaces::STATE_AVAILABLE == tts_alert_info.interface_state) {
tts_response_info_ = "Unsupported phoneme type sent in a prompt";
@@ -231,6 +224,10 @@ bool AlertRequest::PrepareResponseParameters(
result_code = PrepareResultCodeForResponse(ui_alert_info, tts_alert_info);
info = MergeInfos(
ui_alert_info, ui_response_info_, tts_alert_info, tts_response_info_);
+ // Mobile Alert request is successful when UI_Alert is successful
+ if (is_ui_alert_sent_ && !ui_alert_info.is_ok) {
+ return false;
+ }
return result;
}
@@ -347,6 +344,7 @@ void AlertRequest::SendAlertRequest(int32_t app_id) {
msg_params.keyExists(hmi_request::soft_buttons)) {
awaiting_ui_alert_response_ = true;
is_ui_alert_sent_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true);
}
}
@@ -371,6 +369,7 @@ void AlertRequest::SendSpeakRequest(int32_t app_id,
}
msg_params[strings::app_id] = app_id;
msg_params[hmi_request::speak_type] = Common_MethodName::ALERT;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
}
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 f1f3b93e24..f55767c723 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
@@ -66,6 +66,73 @@ ChangeRegistrationRequest::ChangeRegistrationRequest(
ChangeRegistrationRequest::~ChangeRegistrationRequest() {}
+void ChangeRegistrationRequest::SendVRRequest(
+ ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::VR_ChangeRegistration;
+ pending_requests_.Add(function);
+ smart_objects::SmartObject vr_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ vr_params[strings::language] = msg_params[strings::language];
+
+ vr_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::vr_synonyms)) {
+ vr_params[strings::vr_synonyms] = msg_params[strings::vr_synonyms];
+ app->set_vr_synonyms(msg_params[strings::vr_synonyms]);
+ }
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &vr_params, true);
+}
+
+void ChangeRegistrationRequest::SendTTSRequest(
+ ApplicationSharedPtr app, smart_objects::SmartObject& msg_params) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::TTS_ChangeRegistration;
+ pending_requests_.Add(function);
+
+ smart_objects::SmartObject tts_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ tts_params[strings::language] = msg_params[strings::language];
+
+ tts_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::tts_name)) {
+ tts_params[strings::tts_name] = msg_params[strings::tts_name];
+ app->set_tts_name(msg_params[strings::tts_name]);
+ }
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &tts_params, true);
+}
+
+void ChangeRegistrationRequest::SendUIRequest(
+ ApplicationSharedPtr app,
+ smart_objects::SmartObject& msg_params,
+ const int32_t hmi_language) {
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ auto function = hmi_apis::FunctionID::UI_ChangeRegistration;
+ pending_requests_.Add(function);
+ // UI processing
+ smart_objects::SmartObject ui_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ ui_params[strings::language] = hmi_language;
+ ui_params[strings::app_id] = app->app_id();
+ if (msg_params.keyExists(strings::app_name)) {
+ ui_params[strings::app_name] = msg_params[strings::app_name];
+ app->set_name(msg_params[strings::app_name].asCustomString());
+ }
+ if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
+ ui_params[strings::ngn_media_screen_app_name] =
+ msg_params[strings::ngn_media_screen_app_name];
+ app->set_ngn_media_screen_name(
+ msg_params[strings::ngn_media_screen_app_name]);
+ }
+
+ StartAwaitForInterface(hmi_interfaces.GetInterfaceFromFunction(function));
+ SendHMIRequest(function, &ui_params, true);
+}
+
void ChangeRegistrationRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
using namespace smart_objects;
@@ -111,53 +178,42 @@ void ChangeRegistrationRequest::Run() {
return;
}
- pending_requests_.Add(hmi_apis::FunctionID::UI_ChangeRegistration);
- pending_requests_.Add(hmi_apis::FunctionID::VR_ChangeRegistration);
- pending_requests_.Add(hmi_apis::FunctionID::TTS_ChangeRegistration);
+ const HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
- // UI processing
- SmartObject ui_params = SmartObject(SmartType_Map);
+ const HmiInterfaces::InterfaceState vr_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_VR);
+ const HmiInterfaces::InterfaceState ui_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
+ const HmiInterfaces::InterfaceState tts_state =
+ hmi_interfaces.GetInterfaceState(
+ HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS);
- ui_params[strings::language] = hmi_language;
- ui_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::app_name)) {
- ui_params[strings::app_name] = msg_params[strings::app_name];
- app->set_name(msg_params[strings::app_name].asCustomString());
+ using helpers::Compare;
+ using helpers::EQ;
+ using helpers::ALL;
+
+ if (Compare<HmiInterfaces::InterfaceState, EQ, ALL>(
+ HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE,
+ vr_state,
+ tts_state,
+ ui_state)) {
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
}
- if (msg_params.keyExists(strings::ngn_media_screen_app_name)) {
- ui_params[strings::ngn_media_screen_app_name] =
- msg_params[strings::ngn_media_screen_app_name];
- app->set_ngn_media_screen_name(
- msg_params[strings::ngn_media_screen_app_name]);
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != vr_state) {
+ // VR processing
+ SendVRRequest(app, msg_params);
}
-
- SendHMIRequest(hmi_apis::FunctionID::UI_ChangeRegistration, &ui_params, true);
-
- // VR processing
- SmartObject vr_params = SmartObject(SmartType_Map);
-
- vr_params[strings::language] = msg_params[strings::language];
-
- vr_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::vr_synonyms)) {
- vr_params[strings::vr_synonyms] = msg_params[strings::vr_synonyms];
- app->set_vr_synonyms(msg_params[strings::vr_synonyms]);
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != tts_state) {
+ // TTS processing
+ SendTTSRequest(app, msg_params);
}
- SendHMIRequest(hmi_apis::FunctionID::VR_ChangeRegistration, &vr_params, true);
-
- // TTS processing
- SmartObject tts_params = SmartObject(SmartType_Map);
- tts_params[strings::language] = msg_params[strings::language];
-
- tts_params[strings::app_id] = app->app_id();
- if (msg_params.keyExists(strings::tts_name)) {
- tts_params[strings::tts_name] = msg_params[strings::tts_name];
- app->set_tts_name(msg_params[strings::tts_name]);
+ if (HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE != ui_state) {
+ SendUIRequest(app, msg_params, hmi_language);
}
-
- SendHMIRequest(
- hmi_apis::FunctionID::TTS_ChangeRegistration, &tts_params, true);
}
void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
@@ -169,6 +225,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
switch (event_id) {
case hmi_apis::FunctionID::UI_ChangeRegistration: {
LOG4CXX_INFO(logger_, "Received UI_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
pending_requests_.Remove(event_id);
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -177,6 +234,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::VR_ChangeRegistration: {
LOG4CXX_INFO(logger_, "Received VR_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
pending_requests_.Remove(event_id);
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -185,6 +243,7 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::TTS_ChangeRegistration: {
LOG4CXX_INFO(logger_, "Received TTS_ChangeRegistration event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
pending_requests_.Remove(event_id);
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -295,12 +354,14 @@ bool ChangeRegistrationRequest::PrepareResponseParameters(
hmi_interfaces.GetInterfaceState(
HmiInterfaces::InterfaceID::HMI_INTERFACE_UI);
- ResponseInfo ui_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI);
+ ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
- ResponseInfo tts_properties_info(tts_result_,
- HmiInterfaces::HMI_INTERFACE_TTS);
+ ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
- ResponseInfo vr_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_VR);
+ ResponseInfo vr_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
bool result = ((!is_tts_ui_vr_unsupported) && is_tts_succeeded_unsupported &&
is_ui_succeeded_unsupported && is_vr_succeeded_unsupported);
@@ -338,6 +399,9 @@ bool ChangeRegistrationRequest::PrepareResponseParameters(
}
result_code = MessageHelper::HMIToMobileResult(
std::max(std::max(ui_result, vr_result), tts_result));
+ if (mobile_api::Result::INVALID_ENUM == result_code) {
+ result_code = mobile_api::Result::UNSUPPORTED_RESOURCE;
+ }
}
const bool is_tts_state_available =
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 fa0d15252e..20387ef230 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
@@ -49,9 +49,11 @@ namespace commands {
CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
+ , choice_set_id_(0)
, expected_chs_count_(0)
, received_chs_count_(0)
, error_from_hmi_(false)
+ , is_timed_out_(false)
, vr_commands_lock_(true) {}
CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() {
@@ -129,23 +131,32 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet(
const SmartArray* choice_set =
(*message_)[strings::msg_params][strings::choice_set].asArray();
- SmartArray::const_iterator choice_set_it = choice_set->begin();
+ SmartArray::const_iterator current_choice_set_it = choice_set->begin();
+ SmartArray::const_iterator next_choice_set_it;
- for (; choice_set->end() != choice_set_it; ++choice_set_it) {
+ for (; choice_set->end() != current_choice_set_it; ++current_choice_set_it) {
std::pair<std::set<uint32_t>::iterator, bool> ins_res =
- choice_id_set.insert((*choice_set_it)[strings::choice_id].asInt());
+ choice_id_set.insert(
+ (*current_choice_set_it)[strings::choice_id].asInt());
if (!ins_res.second) {
LOG4CXX_ERROR(logger_,
"Choise with ID "
- << (*choice_set_it)[strings::choice_id].asInt()
+ << (*current_choice_set_it)[strings::choice_id].asInt()
<< " already exists");
return mobile_apis::Result::INVALID_ID;
}
- if (IsWhiteSpaceExist(*choice_set_it)) {
+ if (IsWhiteSpaceExist(*current_choice_set_it)) {
LOG4CXX_ERROR(logger_, "Incoming choice set has contains \t\n \\t \\n");
return mobile_apis::Result::INVALID_DATA;
}
+ for (next_choice_set_it = current_choice_set_it + 1;
+ choice_set->end() != next_choice_set_it;
+ ++next_choice_set_it) {
+ if (compareSynonyms(*current_choice_set_it, *next_choice_set_it)) {
+ return mobile_apis::Result::DUPLICATE_NAME;
+ }
+ }
}
return mobile_apis::Result::SUCCESS;
}
@@ -276,6 +287,7 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests(
sync_primitives::AutoLock commands_lock(vr_commands_lock_);
const uint32_t vr_cmd_id = msg_params[strings::cmd_id].asUInt();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
const uint32_t vr_corr_id =
SendHMIRequest(hmi_apis::FunctionID::VR_AddCommand, &msg_params, true);
@@ -345,6 +357,7 @@ void CreateInteractionChoiceSetRequest::on_event(
uint32_t corr_id = static_cast<uint32_t>(
message[strings::params][strings::correlation_id].asUInt());
if (event.id() == hmi_apis::FunctionID::VR_AddCommand) {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
{
sync_primitives::AutoLock commands_lock(vr_commands_lock_);
if (is_no_error) {
@@ -365,6 +378,7 @@ void CreateInteractionChoiceSetRequest::onTimeOut() {
if (!error_from_hmi_) {
SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
}
+ CommandRequestImpl::onTimeOut();
DeleteChoices();
// We have to keep request alive until receive all responses from HMI
@@ -375,6 +389,11 @@ void CreateInteractionChoiceSetRequest::onTimeOut() {
connection_key(), correlation_id(), function_id());
}
+bool CreateInteractionChoiceSetRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
void CreateInteractionChoiceSetRequest::DeleteChoices() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -410,14 +429,6 @@ void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() {
if (!error_from_hmi_) {
SendResponse(true, mobile_apis::Result::SUCCESS);
-
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
- application->UpdateHash();
} else {
DeleteChoices();
}
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 103e87fa00..f894ed452c 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
@@ -104,12 +104,14 @@ void DeleteCommandRequest::Run() {
is_vr_send_ = true;
}
if (is_ui_send_) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params, true);
}
if (is_vr_send_) {
// VR params
msg_params[strings::grammar_id] = application->get_grammar_id();
msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params, true);
}
}
@@ -117,8 +119,10 @@ void DeleteCommandRequest::Run() {
bool DeleteCommandRequest::PrepareResponseParameters(
mobile_apis::Result::eType& result_code, std::string& info) {
using namespace helpers;
- ResponseInfo ui_delete_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI);
- ResponseInfo vr_delete_info(vr_result_, HmiInterfaces::HMI_INTERFACE_VR);
+ ResponseInfo ui_delete_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ ResponseInfo vr_delete_info(
+ vr_result_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
const bool result =
PrepareResultForMobileResponse(ui_delete_info, vr_delete_info);
@@ -143,6 +147,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
case hmi_apis::FunctionID::UI_DeleteCommand: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -153,6 +158,7 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
break;
}
case hmi_apis::FunctionID::VR_DeleteCommand: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
is_vr_received_ = true;
vr_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -201,9 +207,11 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) {
}
SendResponse(
result, result_code, info.empty() ? NULL : info.c_str(), &msg_params);
- if (result) {
- application->UpdateHash();
- }
+}
+
+bool DeleteCommandRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
}
bool DeleteCommandRequest::IsPendingResponseExist() {
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 00d23bb094..984c7a1725 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
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2016, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -73,6 +73,13 @@ void DeleteFileRequest::Run() {
const std::string& sync_file_name =
(*message_)[strings::msg_params][strings::sync_file_name].asString();
+ if (!file_system::IsFileNameValid(sync_file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
std::string full_file_path =
application_manager_.get_settings().app_storage_folder() + "/";
full_file_path += application->folder_name();
@@ -93,7 +100,7 @@ void DeleteFileRequest::Run() {
SendResponse(false, mobile_apis::Result::GENERIC_ERROR);
}
} else {
- SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ SendResponse(false, mobile_apis::Result::REJECTED);
}
}
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 6ef8e5d9da..bfbb2429ac 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
@@ -90,9 +90,11 @@ void DeleteInteractionChoiceSetRequest::Run() {
// 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::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
}
bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse(
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 57748e6feb..09f3139245 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
@@ -74,6 +74,7 @@ void DeleteSubMenuRequest::Run() {
msg_params[strings::menu_id] =
(*message_)[strings::msg_params][strings::menu_id];
msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_DeleteSubMenu, &msg_params, true);
}
@@ -143,6 +144,7 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_DeleteSubMenu: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -171,9 +173,6 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
MessageHelper::HMIToMobileResult(result_code),
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
- if (result) {
- application->UpdateHash();
- }
break;
}
default: {
@@ -183,6 +182,11 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) {
}
}
+bool DeleteSubMenuRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc
index 5c5d250026..7704d700f9 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
@@ -83,6 +83,7 @@ void DiagnosticMessageRequest::Run() {
// Add app_id for HMI request
(*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
&(*message_)[strings::msg_params],
true);
@@ -94,6 +95,7 @@ void DiagnosticMessageRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 64685afe2e..d0ab42e266 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
@@ -87,6 +87,7 @@ void DialNumberRequest::Run() {
(*message_)[strings::msg_params][strings::number].asString();
msg_params[strings::app_id] = application->hmi_app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
SendHMIRequest(
hmi_apis::FunctionID::BasicCommunication_DialNumber, &msg_params, true);
}
@@ -106,6 +107,7 @@ void DialNumberRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::BasicCommunication_DialNumber: {
LOG4CXX_INFO(logger_, "Received DialNumber event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
result_code = CommandRequestImpl::GetMobileResultCode(
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt()));
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 f67d1f2434..0bd83078e5 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,6 +47,7 @@ EndAudioPassThruRequest::~EndAudioPassThruRequest() {}
void EndAudioPassThruRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_EndAudioPassThru, NULL, true);
}
@@ -56,6 +57,7 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_EndAudioPassThru: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt());
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 d98207c772..88fd07234a 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
@@ -72,6 +72,7 @@ void GetDTCsRequest::Run() {
msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_GetDTCs, &msg_params, true);
}
@@ -81,6 +82,7 @@ void GetDTCsRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_GetDTCs: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc
new file mode 100644
index 0000000000..71cde5158d
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc
@@ -0,0 +1,95 @@
+#include "application_manager/commands/mobile/get_system_capability_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+GetSystemCapabilityRequest::GetSystemCapabilityRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : CommandRequestImpl(message, application_manager) {}
+
+GetSystemCapabilityRequest::~GetSystemCapabilityRequest() {}
+
+void GetSystemCapabilityRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if ((*message_)[strings::msg_params].empty()) {
+ LOG4CXX_ERROR(logger_, strings::msg_params << " is empty.");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+ smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
+ mobile_apis::SystemCapabilityType::eType response_type =
+ static_cast<mobile_apis::SystemCapabilityType::eType>(
+ (*message_)[strings::msg_params][strings::system_capability_type]
+ .asInt());
+ response_params[strings::system_capability][strings::system_capability_type] =
+ response_type;
+
+ const HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+
+ switch (response_type) {
+ case mobile_apis::SystemCapabilityType::NAVIGATION: {
+ if (hmi_capabilities.navigation_capability()) {
+ response_params[strings::system_capability]
+ [strings::navigation_capability] =
+ *hmi_capabilities.navigation_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::PHONE_CALL: {
+ if (hmi_capabilities.phone_capability()) {
+ response_params[strings::system_capability][strings::phone_capability] =
+ *hmi_capabilities.phone_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: {
+ if (hmi_capabilities.rc_capability()) {
+ response_params[strings::system_capability][strings::rc_capability] =
+ *hmi_capabilities.rc_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
+ case mobile_apis::SystemCapabilityType::VIDEO_STREAMING:
+ if (hmi_capabilities.video_streaming_capability()) {
+ response_params[strings::system_capability]
+ [strings::video_streaming_capability] =
+ *hmi_capabilities.video_streaming_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ default: // Return unsupported resource
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+}
+
+void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest on_event");
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc
new file mode 100644
index 0000000000..91c2562cd3
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc
@@ -0,0 +1,22 @@
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/mobile/get_system_capability_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+GetSystemCapabilityResponse::GetSystemCapabilityResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : CommandResponseImpl(message, application_manager) {}
+
+GetSystemCapabilityResponse::~GetSystemCapabilityResponse() {}
+
+void GetSystemCapabilityResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc
index 25e2da3eb6..f81d0a8c2a 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
@@ -57,7 +57,7 @@ void GetVehicleDataRequest::Run() {
int32_t app_id =
(*message_)[strings::params][strings::connection_key].asUInt();
- ApplicationSharedPtr app = appplication_manager.application(app_id);
+ ApplicationSharedPtr app = application_manager_.application(app_id);
if (!app) {
LOG4CXX_ERROR(logger_, "NULL pointer");
@@ -250,6 +250,7 @@ void GetVehicleDataRequest::Run() {
}
}
if (msg_params.length() > min_length_msg_params) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(
hmi_apis::FunctionID::VehicleInfo_GetVehicleData, &msg_params, true);
return;
@@ -266,6 +267,7 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc
index 198964a333..da4ce38646 100644
--- a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc
+++ b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc
@@ -8,7 +8,9 @@ namespace commands {
GetWayPointsRequest::GetWayPointsRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
+ : CommandRequestImpl(message, application_manager) {
+ subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout);
+}
GetWayPointsRequest::~GetWayPointsRequest() {}
@@ -29,6 +31,7 @@ void GetWayPointsRequest::Run() {
msg_params = (*message_)[strings::msg_params];
msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
SendHMIRequest(hmi_apis::FunctionID::Navigation_GetWayPoints,
msg_params.empty() ? NULL : &msg_params,
true);
@@ -38,8 +41,15 @@ void GetWayPointsRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
switch (event.id()) {
+ case hmi_apis::FunctionID::UI_OnResetTimeout: {
+ LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
+ application_manager_.updateRequestTimeout(
+ connection_key(), correlation_id(), default_timeout());
+ break;
+ }
case hmi_apis::FunctionID::Navigation_GetWayPoints: {
LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
const hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 425f1ddb46..794fba631d 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
@@ -76,22 +76,21 @@ void ListFilesRequest::Run() {
(*message_)[strings::msg_params][strings::space_available] =
static_cast<int32_t>(application->GetAvailableDiskSpace());
+ // Enumarating through File system
uint32_t i = 0;
- const AppFilesMap& app_files = application->getAppFiles();
- for (AppFilesMap::const_iterator it = app_files.begin();
- it != app_files.end();
- ++it) {
- std::string filename = it->first.substr(it->first.find_last_of('/') + 1);
- // In AppFile to application stored full path to file. In message required
- // to write only name file.
- // Plus one required for move to next letter after '/'.
+ std::string directory_name =
+ application_manager_.get_settings().app_storage_folder();
+ directory_name += "/" + application->folder_name();
+ std::vector<std::string> persistent_files =
+ file_system::ListFiles(directory_name);
+ std::vector<std::string>::const_iterator it = persistent_files.begin();
+ for (; it != persistent_files.end(); ++it) {
if (i < application_manager_.get_settings().list_files_response_size()) {
- LOG4CXX_DEBUG(logger_,
- "File " + filename + " added to ListFiles response");
- (*message_)[strings::msg_params][strings::filenames][i++] = filename;
+ LOG4CXX_DEBUG(logger_, "File " + *it + " added to ListFiles response");
+ (*message_)[strings::msg_params][strings::filenames][i++] = *it;
} else {
LOG4CXX_DEBUG(logger_,
- "File " + filename + " not added to ListFiles response");
+ "File " + *it + " not added to ListFiles response");
}
}
(*message_)[strings::params][strings::message_type] =
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 64043d2a88..7c631d6d4b 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
@@ -56,8 +56,7 @@ void OnButtonEventNotification::Run() {
const bool is_app_id_exists =
(*message_)[strings::msg_params].keyExists(strings::app_id);
- const ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
+ ApplicationSharedPtr app;
// CUSTOM_BUTTON notification
if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
@@ -67,6 +66,9 @@ void OnButtonEventNotification::Run() {
return;
}
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
// custom_button_id is mandatory for CUSTOM_BUTTON notification
if (false ==
(*message_)[strings::msg_params].keyExists(
@@ -92,6 +94,14 @@ void OnButtonEventNotification::Run() {
return;
}
+ if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "CUSTOM_BUTTON OnButtonEvent notification is allowed only "
+ << "in FULL or LIMITED hmi level");
+ return;
+ }
+
SendButtonEvent(app);
return;
}
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 b789b7c7e9..ae6658b93a 100755..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
@@ -56,8 +56,7 @@ void OnButtonPressNotification::Run() {
const bool is_app_id_exists =
(*message_)[strings::msg_params].keyExists(strings::app_id);
- const ApplicationSharedPtr app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
+ ApplicationSharedPtr app;
// CUSTOM_BUTTON notification
if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
@@ -67,6 +66,9 @@ void OnButtonPressNotification::Run() {
return;
}
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+
// custom_button_id is mandatory for CUSTOM_BUTTON notification
if (false ==
(*message_)[strings::msg_params].keyExists(
@@ -92,6 +94,15 @@ void OnButtonPressNotification::Run() {
return;
}
+ // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode
+ if ((mobile_api::HMILevel::HMI_FULL != app->hmi_level()) &&
+ (mobile_api::HMILevel::HMI_LIMITED != app->hmi_level())) {
+ LOG4CXX_WARN(logger_,
+ "CUSTOM_BUTTON OnButtonPress notification is allowed only "
+ << "in FULL or LIMITED hmi level");
+ return;
+ }
+
SendButtonPress(app);
return;
}
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
index 9b16bd3572..4bb6cfe9d5 100644
--- 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
@@ -75,10 +75,13 @@ void OnHMIStatusNotificationFromMobile::Run() {
<< connection_key() << " and handle: " << handle);
if (!is_apps_requested_before &&
- ProtocolVersion::kV4 == app->protocol_version() && app->is_foreground()) {
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ app->protocol_version()) &&
+ app->is_foreground()) {
// In case this notification will be received from mobile side with
// foreground level for app on mobile, this should trigger remote
- // apps list query for SDL 4.0 app
+ // apps list query for SDL 4.0+ app
MessageHelper::SendQueryApps(connection_key(), application_manager_);
return;
}
@@ -89,7 +92,9 @@ void OnHMIStatusNotificationFromMobile::Run() {
" for handle: "
<< handle);
- if (ProtocolVersion::kV4 == app->protocol_version()) {
+ if (Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ app->protocol_version())) {
const ApplicationSet& accessor =
application_manager_.applications().GetData();
@@ -97,7 +102,9 @@ void OnHMIStatusNotificationFromMobile::Run() {
ApplicationSetConstIt it = accessor.begin();
for (; accessor.end() != it; ++it) {
if (connection_key() != (*it)->app_id() &&
- ProtocolVersion::kV4 == (*it)->protocol_version() &&
+ Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4,
+ (*it)->protocol_version()) &&
(*it)->is_foreground()) {
is_another_foreground_sdl4_app = true;
break;
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 851e9f3059..427f52c12b 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
@@ -58,7 +58,9 @@ void OnKeyBoardInputNotification::Run() {
for (; accessor.GetData().end() != it; ++it) {
// if there is app with active perform interaction use it for notification
ApplicationSharedPtr app = *it;
- if (app->is_perform_interaction_active()) {
+ if (app->is_perform_interaction_active() &&
+ (*it)->perform_interaction_layout() ==
+ mobile_apis::LayoutMode::KEYBOARD) {
LOG4CXX_INFO(logger_,
"There is application with active PerformInteraction");
app_to_notify = app;
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 03d9b47406..c29ff3e2d3 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
@@ -78,33 +78,41 @@ void OnSystemRequestNotification::Run() {
}
if (RequestType::PROPRIETARY == request_type) {
-/* According to requirements:
- "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
- If the requestType = HTTP, add to mobile API fileType = BINARY"
- Also in Genivi SDL we don't save the PT to file - we put it directly in
- binary_data */
+ /* According to requirements:
+ "If the requestType = PROPRIETARY, add to mobile API fileType = JSON
+ If the requestType = HTTP, add to mobile API fileType = BINARY"
+ Also in Genivi SDL we don't save the PT to file - we put it directly in
+ binary_data */
-#ifdef EXTENDED_POLICY
const std::string filename =
(*message_)[strings::msg_params][strings::file_name].asString();
-
BinaryMessage binary_data;
file_system::ReadBinaryFile(filename, binary_data);
+#if defined(PROPRIETARY_MODE)
AddHeader(binary_data);
+#endif // PROPRIETARY_MODE
+
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
(*message_)[strings::params][strings::binary_data] = binary_data;
-#endif
+#endif // PROPRIETARY_MODE
+
(*message_)[strings::msg_params][strings::file_type] = FileType::JSON;
} else if (RequestType::HTTP == request_type) {
(*message_)[strings::msg_params][strings::file_type] = FileType::BINARY;
+ if ((*message_)[strings::msg_params].keyExists(strings::url)) {
+ (*message_)[strings::msg_params][strings::timeout] =
+ policy_handler.TimeoutExchangeSec();
+ }
}
SendNotification();
}
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
LOG4CXX_AUTO_TRACE(logger_);
- const int timeout = application_manager_.GetPolicyHandler().TimeoutExchange();
+ const uint32_t timeout =
+ application_manager_.GetPolicyHandler().TimeoutExchangeSec();
size_t content_length;
char size_str[24];
@@ -184,7 +192,7 @@ size_t OnSystemRequestNotification::ParsePTString(
pt_string = result;
return result_length;
}
-#endif
+#endif // PROPRIETARY_MODE
} // namespace mobile
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 c769194c95..2a9969eac4 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,17 +50,34 @@ OnTouchEventNotification::~OnTouchEventNotification() {}
void OnTouchEventNotification::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- const std::vector<ApplicationSharedPtr>& applications =
+ const std::vector<ApplicationSharedPtr>& applications_with_navi =
application_manager_.applications_with_navi();
- std::vector<ApplicationSharedPtr>::const_iterator it = applications.begin();
- for (; applications.end() != it; ++it) {
- ApplicationSharedPtr app = *it;
+ const std::vector<ApplicationSharedPtr>& projection_applications =
+ application_manager_.applications_with_mobile_projection();
+
+ std::vector<ApplicationSharedPtr>::const_iterator nav_it =
+ applications_with_navi.begin();
+
+ for (; applications_with_navi.end() != nav_it; ++nav_it) {
+ ApplicationSharedPtr app = *nav_it;
if (app->IsFullscreen()) {
(*message_)[strings::params][strings::connection_key] = app->app_id();
SendNotification();
}
}
+
+ std::vector<ApplicationSharedPtr>::const_iterator projection_it =
+ projection_applications.begin();
+
+ for (; projection_applications.end() != projection_it; ++projection_it) {
+ ApplicationSharedPtr projection_app = *projection_it;
+ if (projection_app->IsFullscreen()) {
+ (*message_)[strings::params][strings::connection_key] =
+ projection_app->app_id();
+ SendNotification();
+ }
+ }
}
} // namespace mobile
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 9f5fd937f9..a05d41c098 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
@@ -47,8 +47,6 @@ namespace str = strings;
PerformAudioPassThruRequest::PerformAudioPassThruRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
- , awaiting_tts_speak_response_(false)
- , awaiting_ui_response_(false)
, result_tts_speak_(hmi_apis::Common_Result::INVALID_ENUM)
, result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {
subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout);
@@ -97,7 +95,7 @@ void PerformAudioPassThruRequest::Run() {
// According with new implementation processing of UNSUPPORTE_RESOURCE
// need set flag before sending to hmi
- awaiting_ui_response_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
(0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
// In case TTS Speak, subscribe on notification
@@ -119,7 +117,7 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_PerformAudioPassThru: {
LOG4CXX_TRACE(logger_, "Received UI_PerformAudioPassThru");
- awaiting_ui_response_ = false;
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
result_ui_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt());
@@ -142,7 +140,7 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
result_tts_speak_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt());
GetInfo(message, tts_info_);
- awaiting_tts_speak_response_ = false;
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
const bool is_tts_speak_success_unsuported =
Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
result_tts_speak_,
@@ -179,36 +177,58 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) {
return;
}
- std::string return_info;
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
- const bool result = PrepareResponseParameters(result_code, return_info);
+ const ResponseParams response_params = PrepareResponseParameters();
- SendResponse(result,
- result_code,
- return_info.empty() ? NULL : return_info.c_str(),
- &(message[strings::msg_params]));
+ SendResponse(
+ response_params.success,
+ response_params.result_code,
+ response_params.info.empty() ? NULL : response_params.info.c_str(),
+ &(message[strings::msg_params]));
}
-bool PerformAudioPassThruRequest::PrepareResponseParameters(
- mobile_apis::Result::eType& result_code, std::string& info) {
+const PerformAudioPassThruRequest::ResponseParams&
+PerformAudioPassThruRequest::PrepareResponseParameters() {
LOG4CXX_AUTO_TRACE(logger_);
- ResponseInfo ui_perform_info(result_ui_, HmiInterfaces::HMI_INTERFACE_UI);
+ ResponseInfo ui_perform_info(
+ result_ui_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
ResponseInfo tts_perform_info(result_tts_speak_,
- HmiInterfaces::HMI_INTERFACE_TTS);
- const bool result =
- PrepareResultForMobileResponse(ui_perform_info, tts_perform_info);
+ HmiInterfaces::HMI_INTERFACE_TTS,
+ application_manager_);
+ // Note(dtrunov): According to requirment "WARNINGS, success:true on getting
+ // UNSUPPORTED_RESOURCE for "ttsChunks"
if (ui_perform_info.is_ok && tts_perform_info.is_unsupported_resource &&
HmiInterfaces::STATE_AVAILABLE == tts_perform_info.interface_state) {
- result_code = mobile_apis::Result::WARNINGS;
+ response_params_.result_code = mobile_apis::Result::WARNINGS;
tts_info_ = "Unsupported phoneme type sent in a prompt";
- info = MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
- return result;
+ response_params_.info =
+ MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+ response_params_.success = true;
+ return response_params_;
}
- result_code = PrepareResultCodeForResponse(ui_perform_info, tts_perform_info);
- info = MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
- return result;
+
+ response_params_.success =
+ PrepareResultForMobileResponse(ui_perform_info, tts_perform_info);
+ if (IsResultCodeUnsupported(ui_perform_info, tts_perform_info)) {
+ response_params_.result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
+ } else {
+ AudioPassThruResults results = PrepareAudioPassThruResultCodeForResponse(
+ ui_perform_info, tts_perform_info);
+ response_params_.success = results.second;
+ response_params_.result_code = results.first;
+ }
+ response_params_.info =
+ MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+
+ return response_params_;
+}
+
+bool PerformAudioPassThruRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& result_code, std::string& info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ NOTREACHED();
+ return false;
}
void PerformAudioPassThruRequest::SendSpeakRequest() {
@@ -229,7 +249,7 @@ void PerformAudioPassThruRequest::SendSpeakRequest() {
// app_id
msg_params[strings::app_id] = connection_key();
msg_params[hmi_request::speak_type] = Common_MethodName::AUDIO_PASS_THRU;
- awaiting_tts_speak_response_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
SendHMIRequest(FunctionID::TTS_Speak, &msg_params, true);
}
@@ -273,6 +293,7 @@ void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
msg_params[str::mute_audio] = true;
}
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(
hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true);
}
@@ -353,16 +374,56 @@ void PerformAudioPassThruRequest::FinishTTSSpeak() {
LOG4CXX_DEBUG(logger_, "Stop AudioPassThru.");
application_manager_.StopAudioPassThru(connection_key());
}
- if (!awaiting_tts_speak_response_) {
+ if (!IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS)) {
LOG4CXX_WARN(logger_, "TTS Speak is inactive.");
return;
}
SendHMIRequest(hmi_apis::FunctionID::TTS_StopSpeaking, NULL);
}
+PerformAudioPassThruRequest::AudioPassThruResults
+PerformAudioPassThruRequest::PrepareAudioPassThruResultCodeForResponse(
+ const ResponseInfo& ui_response, const ResponseInfo& tts_response) {
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+
+ hmi_apis::Common_Result::eType common_result =
+ hmi_apis::Common_Result::INVALID_ENUM;
+ const hmi_apis::Common_Result::eType ui_result = ui_response.result_code;
+ const hmi_apis::Common_Result::eType tts_result = tts_response.result_code;
+ bool result = false;
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result == hmi_apis::Common_Result::SUCCESS)) {
+ result = true;
+ }
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result == hmi_apis::Common_Result::INVALID_ENUM)) {
+ result = true;
+ }
+
+ if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result != hmi_apis::Common_Result::SUCCESS) &&
+ (tts_result != hmi_apis::Common_Result::INVALID_ENUM)) {
+ common_result = hmi_apis::Common_Result::WARNINGS;
+ result = true;
+ } else if (ui_response.is_ok &&
+ tts_result == hmi_apis::Common_Result::WARNINGS) {
+ common_result = hmi_apis::Common_Result::WARNINGS;
+ result = true;
+ } else if (ui_result == hmi_apis::Common_Result::INVALID_ENUM) {
+ common_result = tts_result;
+ } else {
+ common_result = ui_result;
+ }
+ result_code = MessageHelper::HMIToMobileResult(common_result);
+ return std::make_pair(result_code, result);
+}
+
bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
LOG4CXX_AUTO_TRACE(logger_);
- return awaiting_tts_speak_response_ || awaiting_ui_response_;
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
}
} // namespace commands
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 d094c3d80e..68940158b9 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
@@ -143,11 +143,10 @@ void PerformInteractionRequest::Run() {
}
}
- if (choice_set_id_list_length &&
- (!CheckChoiceIDFromRequest(
- app,
- choice_set_id_list_length,
- msg_params[strings::interaction_choice_set_id_list]))) {
+ if (!CheckChoiceIDFromRequest(
+ app,
+ choice_set_id_list_length,
+ msg_params[strings::interaction_choice_set_id_list])) {
LOG4CXX_ERROR(logger_,
"PerformInteraction has choice sets with "
"duplicated IDs or application does not have choice sets");
@@ -205,6 +204,7 @@ void PerformInteractionRequest::Run() {
app->set_perform_interaction_mode(static_cast<int32_t>(interaction_mode_));
app->set_perform_interaction_active(true);
+ app->set_perform_interaction_layout(interaction_layout);
// increment amount of active requests
++pi_requests_count_;
SendVRPerformInteractionRequest(app);
@@ -226,6 +226,7 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::UI_PerformInteraction: {
LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
ui_response_received_ = true;
unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction);
ui_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
@@ -236,6 +237,7 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::VR_PerformInteraction: {
LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
vr_response_received_ = true;
unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction);
vr_result_code_ = static_cast<hmi_apis::Common_Result::eType>(
@@ -391,14 +393,14 @@ void PerformInteractionRequest::ProcessUIResponse(
if (result) {
if (is_pi_warning) {
ui_result_code_ = hmi_apis::Common_Result::WARNINGS;
- ui_info_ = "Unsupported phoneme type was sent in an item";
+ ui_info_ = message[strings::msg_params][strings::info].asString();
if (message.keyExists(strings::params) &&
message[strings::params].keyExists(strings::data)) {
msg_params = message[strings::params][strings::data];
}
} else if (is_pi_unsupported) {
ui_result_code_ = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- ui_info_ = "Unsupported phoneme type was sent in an item";
+ ui_info_ = message[strings::msg_params][strings::info].asString();
} else if (message.keyExists(strings::msg_params)) {
msg_params = message[strings::msg_params];
}
@@ -502,6 +504,7 @@ void PerformInteractionRequest::SendUIPerformInteractionRequest(
(*message_)[strings::msg_params][hmi_request::interaction_layout]
.asInt();
}
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(
hmi_apis::FunctionID::UI_PerformInteraction, &msg_params, true);
}
@@ -594,6 +597,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest(
msg_params[strings::timeout] = default_timeout_;
}
msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VR);
SendHMIRequest(
hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, true);
}
@@ -925,10 +929,10 @@ void PerformInteractionRequest::SendBothModeResponse(
LOG4CXX_AUTO_TRACE(logger_);
mobile_apis::Result::eType perform_interaction_result_code =
mobile_apis::Result::INVALID_ENUM;
- ResponseInfo ui_perform_info(ui_result_code_,
- HmiInterfaces::HMI_INTERFACE_UI);
- ResponseInfo vr_perform_info(vr_result_code_,
- HmiInterfaces::HMI_INTERFACE_VR);
+ ResponseInfo ui_perform_info(
+ ui_result_code_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ ResponseInfo vr_perform_info(
+ vr_result_code_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_);
const bool result =
PrepareResultForMobileResponse(ui_perform_info, vr_perform_info);
perform_interaction_result_code =
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 68e7ad60d1..602b420ba0 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
@@ -110,6 +110,17 @@ void PutFileRequest::Run() {
}
sync_file_name_ =
(*message_)[strings::msg_params][strings::sync_file_name].asString();
+
+ if (!file_system::IsFileNameValid(sync_file_name_)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false,
+ mobile_apis::Result::INVALID_DATA,
+ err_msg.c_str(),
+ &response_params);
+ return;
+ }
+
file_type_ = static_cast<mobile_apis::FileType::eType>(
(*message_)[strings::msg_params][strings::file_type].asInt());
const std::vector<uint8_t> binary_data =
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 0bf747bde3..c51f545e7e 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
@@ -87,6 +87,7 @@ void ReadDIDRequest::Run() {
(*message_)[strings::msg_params][strings::ecu_name];
msg_params[strings::did_location] =
(*message_)[strings::msg_params][strings::did_location];
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_ReadDID, &msg_params, true);
}
@@ -97,6 +98,7 @@ void ReadDIDRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::VehicleInfo_ReadDID: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 9ae2bac73c..a3a30ddb20 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
@@ -45,6 +45,9 @@
#include "application_manager/app_launch/app_launch_ctrl.h"
#include "application_manager/message_helper.h"
#include "application_manager/resumption/resume_ctrl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/helpers/application_helper.h"
+#include "config_profile/profile.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/generated_msg_version.h"
@@ -72,6 +75,12 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
return mobile_apis::AppHMIType::TESTING;
} else if ("SYSTEM" == str) {
return mobile_apis::AppHMIType::SYSTEM;
+ } else if ("PROJECTION" == str) {
+ return mobile_apis::AppHMIType::PROJECTION;
+#ifdef SDL_REMOTE_CONTROL
+ } else if ("REMOTE_CONTROL" == str) {
+ return mobile_apis::AppHMIType::REMOTE_CONTROL;
+#endif
} else {
return mobile_apis::AppHMIType::INVALID_ENUM;
}
@@ -80,6 +89,9 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) {
std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) {
const std::map<mobile_apis::AppHMIType::eType, std::string> app_hmi_type_map =
{{mobile_apis::AppHMIType::DEFAULT, "DEFAULT"},
+#ifdef SDL_REMOTE_CONTROL
+ {mobile_apis::AppHMIType::REMOTE_CONTROL, "REMOTE_CONTROL"},
+#endif // SDL_REMOTE_CONTROL
{mobile_apis::AppHMIType::COMMUNICATION, "COMMUNICATION"},
{mobile_apis::AppHMIType::MEDIA, "MEDIA"},
{mobile_apis::AppHMIType::MESSAGING, "MESSAGING"},
@@ -88,7 +100,8 @@ std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) {
{mobile_apis::AppHMIType::SOCIAL, "SOCIAL"},
{mobile_apis::AppHMIType::BACKGROUND_PROCESS, "BACKGROUND_PROCESS"},
{mobile_apis::AppHMIType::TESTING, "TESTING"},
- {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"}};
+ {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"},
+ {mobile_apis::AppHMIType::PROJECTION, "PROJECTION"}};
std::map<mobile_apis::AppHMIType::eType, std::string>::const_iterator iter =
app_hmi_type_map.find(type);
@@ -140,6 +153,13 @@ struct CheckMissedTypes {
std::string& log_;
};
+class SmartArrayValueExtractor {
+ public:
+ AppHmiType operator()(const smart_objects::SmartObject& so) const {
+ return static_cast<AppHmiType>(so.asInt());
+ }
+};
+
struct IsSameNickname {
IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {}
bool operator()(const policy::StringArray::value_type& nickname) const {
@@ -198,6 +218,10 @@ void RegisterAppInterfaceRequest::Run() {
return;
}
+ if (IsApplicationSwitched()) {
+ return;
+ }
+
const std::string mobile_app_id =
(*message_)[strings::msg_params][strings::app_id].asString();
@@ -212,7 +236,13 @@ void RegisterAppInterfaceRequest::Run() {
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
- const std::string& policy_app_id = msg_params[strings::app_id].asString();
+ const std::string policy_app_id = msg_params[strings::app_id].asString();
+ std::string new_policy_app_id = policy_app_id;
+ std::transform(policy_app_id.begin(),
+ policy_app_id.end(),
+ new_policy_app_id.begin(),
+ ::tolower);
+ (*message_)[strings::msg_params][strings::app_id] = new_policy_app_id;
if (application_manager_.IsApplicationForbidden(connection_key(),
policy_app_id)) {
@@ -310,6 +340,11 @@ void RegisterAppInterfaceRequest::Run() {
app_type.getElement(i).asUInt())) {
application->set_voice_communication_supported(true);
}
+ if (mobile_apis::AppHMIType::PROJECTION ==
+ static_cast<mobile_apis::AppHMIType::eType>(
+ app_type.getElement(i).asUInt())) {
+ application->set_mobile_projection_enabled(true);
+ }
}
}
@@ -335,7 +370,7 @@ void RegisterAppInterfaceRequest::Run() {
GetPolicyHandler().SetDeviceInfo(device_mac, device_info);
- SendRegisterAppInterfaceResponseToMobile();
+ SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
smart_objects::SmartObjectSPtr so =
GetLockScreenIconUrlNotification(connection_key(), application);
application_manager_.ManageMobileCommand(so, commands::Command::ORIGIN_SDL);
@@ -468,9 +503,14 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params,
hmi_capabilities.navigation_supported();
response_params[strings::hmi_capabilities][strings::phone_call] =
hmi_capabilities.phone_call_supported();
+ response_params[strings::hmi_capabilities][strings::video_streaming] =
+ hmi_capabilities.video_streaming_supported();
+ response_params[strings::hmi_capabilities][strings::remote_control] =
+ hmi_capabilities.rc_supported();
}
-void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
+void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile(
+ ApplicationType app_type) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObject response_params(smart_objects::SmartType_Map);
@@ -496,6 +536,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
major_version; // From generated file interfaces/generated_msg_version.h
response_params[strings::sync_msg_version][strings::minor_version] =
minor_version; // From generated file interfaces/generated_msg_version.h
+ response_params[strings::sync_msg_version][strings::patch_version] =
+ patch_version; // From generated file interfaces/generated_msg_version.h
const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
@@ -539,18 +581,27 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
FillUIRelatedFields(response_params, hmi_capabilities);
}
+ if (HmiInterfaces::STATE_NOT_AVAILABLE !=
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
+ FillVIRelatedFields(response_params, hmi_capabilities);
+ }
+
if (hmi_capabilities.button_capabilities()) {
response_params[hmi_response::button_capabilities] =
*hmi_capabilities.button_capabilities();
}
+
if (hmi_capabilities.soft_button_capabilities()) {
response_params[hmi_response::soft_button_capabilities] =
*hmi_capabilities.soft_button_capabilities();
}
+
if (hmi_capabilities.preset_bank_capabilities()) {
response_params[hmi_response::preset_bank_capabilities] =
*hmi_capabilities.preset_bank_capabilities();
}
+
if (hmi_capabilities.hmi_zone_capabilities()) {
if (smart_objects::SmartType_Array ==
hmi_capabilities.hmi_zone_capabilities()->getType()) {
@@ -563,23 +614,11 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
}
}
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_TTS)) {
- FillTTSRelatedFields(response_params, hmi_capabilities);
- }
-
if (hmi_capabilities.pcm_stream_capabilities()) {
response_params[strings::pcm_stream_capabilities] =
*hmi_capabilities.pcm_stream_capabilities();
}
- if (HmiInterfaces::STATE_NOT_AVAILABLE !=
- application_manager_.hmi_interfaces().GetInterfaceState(
- HmiInterfaces::HMI_INTERFACE_VehicleInfo)) {
- FillVIRelatedFields(response_params, hmi_capabilities);
- }
-
const std::vector<uint32_t>& diag_modes =
application_manager_.get_settings().supported_diag_modes();
if (!diag_modes.empty()) {
@@ -590,6 +629,7 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
++index;
}
}
+
response_params[strings::sdl_version] =
application_manager_.get_settings().sdl_version();
const std::string ccpu_version =
@@ -598,6 +638,27 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
response_params[strings::system_software_version] = ccpu_version;
}
+ if (ApplicationType::kSwitchedApplicationWrongHashId == app_type) {
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport, "
+ "but doesn't have correct hashID.");
+
+ application_manager::DeleteApplicationData(application,
+ application_manager_);
+
+ SendResponse(
+ true, mobile_apis::Result::RESUME_FAILED, NULL, &response_params);
+ return;
+ }
+
+ if (ApplicationType::kSwitchedApplicationHashOk == app_type) {
+ LOG4CXX_DEBUG(logger_,
+ "Application has been switched from another transport "
+ "and has correct hashID.");
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ return;
+ }
+
bool resumption =
(*message_)[strings::msg_params].keyExists(strings::hash_id);
@@ -634,9 +695,40 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
application->mac_address());
}
+ AppHmiTypes hmi_types;
+ if ((*message_)[strings::msg_params].keyExists(strings::app_hmi_type)) {
+ smart_objects::SmartArray* hmi_types_ptr =
+ (*message_)[strings::msg_params][strings::app_hmi_type].asArray();
+ DCHECK_OR_RETURN_VOID(hmi_types_ptr);
+ SmartArrayValueExtractor extractor;
+ if (hmi_types_ptr && 0 < hmi_types_ptr->size()) {
+ std::transform(hmi_types_ptr->begin(),
+ hmi_types_ptr->end(),
+ std::back_inserter(hmi_types),
+ extractor);
+ }
+ }
+ policy::StatusNotifier notify_upd_manager = GetPolicyHandler().AddApplication(
+ application->policy_app_id(), hmi_types);
SendResponse(true, result_code, add_info.c_str(), &response_params);
SendOnAppRegisteredNotificationToHMI(
*(application.get()), resumption, need_restore_vr);
+#ifdef SDL_REMOTE_CONTROL
+ if (msg_params.keyExists(strings::app_hmi_type)) {
+ GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(),
+ &(msg_params[strings::app_hmi_type]));
+ }
+#endif // SDL_REMOTE_CONTROL
+
+ // Default HMI level should be set before any permissions validation, since it
+ // relies on HMI level.
+ application_manager_.OnApplicationRegistered(application);
+ (*notify_upd_manager)();
+
+ // Start PTU after successfull registration
+ // Sends OnPermissionChange notification to mobile right after RAI response
+ // and HMI level set-up
+ GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id());
if (result_code != mobile_apis::Result::RESUME_FAILED) {
resumer.StartResumption(application, hash_id);
@@ -649,6 +741,11 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
SendChangeRegistrationOnHMI(application);
}
+DEPRECATED void
+RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() {
+ SendRegisterAppInterfaceResponseToMobile(ApplicationType::kNewApplication);
+}
+
void RegisterAppInterfaceRequest::SendChangeRegistration(
const hmi_apis::FunctionID::eType function_id,
const int32_t language,
@@ -885,7 +982,7 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
// If AppHMIType is not included in policy - allow any type
if (!app_hmi_types.empty()) {
if (message[strings::msg_params].keyExists(strings::app_hmi_type)) {
- // If AppHMITypes are partially same, the system should allow those listed
+ // If AppHmiTypes are partially same, the system should allow those listed
// in the policy table and send warning info on missed values
smart_objects::SmartArray app_types =
*(message[strings::msg_params][strings::app_hmi_type].asArray());
@@ -895,13 +992,13 @@ mobile_apis::Result::eType RegisterAppInterfaceRequest::CheckWithPolicyData() {
std::for_each(app_types.begin(), app_types.end(), checker);
if (!log.empty()) {
response_info_ =
- "Following AppHMITypes are not present in policy "
+ "Following AppHmiTypes are not present in policy "
"table:" +
log;
result_checking_app_hmi_type_ = mobile_apis::Result::WARNINGS;
}
}
- // Replace AppHMITypes in request with values allowed by policy table
+ // Replace AppHmiTypes in request with values allowed by policy table
message[strings::msg_params][strings::app_hmi_type] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
@@ -1130,6 +1227,56 @@ void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() {
CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
}
+bool RegisterAppInterfaceRequest::IsApplicationSwitched() {
+ const smart_objects::SmartObject& msg_params =
+ (*message_)[strings::msg_params];
+
+ const std::string& policy_app_id = msg_params[strings::app_id].asString();
+
+ LOG4CXX_DEBUG(logger_, "Looking for application id " << policy_app_id);
+
+ auto app = application_manager_.application_by_policy_id(policy_app_id);
+
+ if (!app) {
+ LOG4CXX_DEBUG(logger_,
+ "Application with policy id " << policy_app_id
+ << " is not found.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application with policy id " << policy_app_id << " is found.");
+ if (!application_manager_.IsAppInReconnectMode(policy_app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "Policy id " << policy_app_id
+ << " is not found in reconnection list.");
+ SendResponse(false, mobile_apis::Result::APPLICATION_REGISTERED_ALREADY);
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Application is found in reconnection list.");
+
+ auto app_type = ApplicationType::kSwitchedApplicationWrongHashId;
+ if ((*message_)[strings::msg_params].keyExists(strings::hash_id)) {
+ const auto hash_id =
+ (*message_)[strings::msg_params][strings::hash_id].asString();
+
+ auto& resume_ctrl = application_manager_.resume_controller();
+ if (resume_ctrl.CheckApplicationHash(app, hash_id)) {
+ app_type = ApplicationType::kSwitchedApplicationHashOk;
+ }
+ }
+
+ application_manager_.ProcessReconnection(app, connection_key());
+ SendRegisterAppInterfaceResponseToMobile(app_type);
+
+ application_manager_.SendHMIStatusNotification(app);
+
+ application_manager_.OnApplicationSwitched(app);
+
+ return true;
+}
+
policy::PolicyHandlerInterface&
RegisterAppInterfaceRequest::GetPolicyHandler() {
return application_manager_.GetPolicyHandler();
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 1d7f829a68..3e94e652d4 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
@@ -77,15 +77,6 @@ void RegisterAppInterfaceResponse::Run() {
}
SetHeartBeatTimeout(connection_key(), application->policy_app_id());
-
- // Default HMI level should be set before any permissions validation, since it
- // relies on HMI level.
- application_manager_.OnApplicationRegistered(application);
-
- // Sends OnPermissionChange notification to mobile right after RAI response
- // and HMI level set-up
- application_manager_.GetPolicyHandler().OnAppRegisteredOnMobile(
- application->policy_app_id());
}
void RegisterAppInterfaceResponse::SetHeartBeatTimeout(
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 e47ed01f51..a7c2db0e65 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
@@ -46,10 +46,6 @@ namespace commands {
ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest(
const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager)
- , is_ui_send_(false)
- , is_tts_send_(false)
- , is_ui_received_(false)
- , is_tts_received_(false)
, ui_result_(hmi_apis::Common_Result::INVALID_ENUM)
, tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {}
@@ -111,11 +107,11 @@ void ResetGlobalPropertiesRequest::Run() {
if (vr_help_title_items || menu_name || menu_icon ||
is_key_board_properties) {
- is_ui_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
}
if (timeout_prompt || helpt_promt) {
- is_tts_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
}
app->set_reset_global_properties_active(true);
@@ -242,22 +238,21 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
LOG4CXX_AUTO_TRACE(logger_);
const smart_objects::SmartObject& message = event.smart_object();
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
-
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetGlobalProperties: {
LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
- is_ui_received_ = true;
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, ui_response_info_);
break;
}
case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
- is_tts_received_ = true;
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
+ GetInfo(message, tts_response_info_);
break;
}
default: {
@@ -266,53 +261,65 @@ void ResetGlobalPropertiesRequest::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::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;
-
- if (result) {
- if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_) {
- result_code = mobile_apis::Result::WARNINGS;
- 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_));
- }
- } else {
- result_code = static_cast<mobile_apis::Result::eType>(
- std::max(ui_result_, tts_result_));
- }
+ if (IsPendingResponseExist()) {
+ LOG4CXX_DEBUG(logger_, "Waiting for remaining responses");
+ return;
+ }
- SendResponse(result,
- static_cast<mobile_apis::Result::eType>(result_code),
- return_info,
- &(message[strings::msg_params]));
+ mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
+ std::string response_info;
+ const bool result = PrepareResponseParameters(result_code, response_info);
- if (!application) {
- LOG4CXX_ERROR(logger_, "NULL pointer");
- return;
- }
+ SendResponse(result,
+ static_cast<mobile_apis::Result::eType>(result_code),
+ response_info.empty() ? NULL : response_info.c_str(),
+ &(message[strings::msg_params]));
+}
- if (result) {
- application->UpdateHash();
- }
+bool ResetGlobalPropertiesRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
+bool ResetGlobalPropertiesRequest::PrepareResponseParameters(
+ mobile_apis::Result::eType& out_result_code,
+ std::string& out_response_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ bool result = false;
+ ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
+ ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
+
+ HmiInterfaces::InterfaceState tts_interface_state =
+ application_manager_.hmi_interfaces().GetInterfaceState(
+ HmiInterfaces::HMI_INTERFACE_TTS);
+
+ if (hmi_apis::Common_Result::SUCCESS == ui_result_ &&
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_ &&
+ HmiInterfaces::STATE_AVAILABLE == tts_interface_state) {
+ result = true;
+ out_result_code = mobile_apis::Result::WARNINGS;
+ out_response_info = "Unsupported phoneme type sent in a prompt";
} else {
- LOG4CXX_WARN(logger_, "unable to find application: " << connection_key());
+ result =
+ PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
+ out_result_code =
+ PrepareResultCodeForResponse(ui_properties_info, tts_properties_info);
+ out_response_info = MergeInfos(tts_properties_info,
+ tts_response_info_,
+ ui_properties_info,
+ ui_response_info_);
}
+
+ return result;
}
bool ResetGlobalPropertiesRequest::IsPendingResponseExist() {
- return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_;
+ return IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_TTS) ||
+ IsInterfaceAwaited(HmiInterfaces::HMI_INTERFACE_UI);
}
} // namespace commands
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 0c770953fe..b0b2d5f464 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
@@ -109,7 +109,7 @@ void ScrollableMessageRequest::Run() {
MessageHelper::SubscribeApplicationToSoftButton(
(*message_)[strings::msg_params], app, function_id());
}
-
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_ScrollableMessage, &msg_params, true);
}
@@ -126,6 +126,7 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::UI_ScrollableMessage: {
LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
new file mode 100644
index 0000000000..569eba6c02
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/send_haptic_data_request.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace application_manager {
+
+namespace commands {
+
+namespace custom_str = utils::custom_string;
+
+SendHapticDataRequest::SendHapticDataRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : CommandRequestImpl(message, application_manager) {}
+
+SendHapticDataRequest::~SendHapticDataRequest() {}
+
+void SendHapticDataRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
+
+ ApplicationSharedPtr app = application_manager_.application(connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "Application is not registered");
+ SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ return;
+ }
+
+ if (app->is_navi() || app->mobile_projection_enabled()) {
+ SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true);
+ } else {
+ SendResponse(false,
+ mobile_apis::Result::DISALLOWED,
+ "Application is not of type Navigation or Mobile Projection");
+ }
+}
+
+void SendHapticDataRequest::on_event(const event_engine::Event& event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace helpers;
+
+ const smart_objects::SmartObject& message = event.smart_object();
+
+ switch (event.id()) {
+ case hmi_apis::FunctionID::UI_SendHapticData: {
+ mobile_apis::Result::eType result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ message[strings::params][hmi_response::code].asUInt()));
+
+ const bool result = Compare<mobile_api::Result::eType, EQ, ONE>(
+ result_code,
+ mobile_api::Result::SUCCESS,
+ mobile_api::Result::WARNINGS);
+
+ SendResponse(result, result_code, NULL, &(message[strings::msg_params]));
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc
new file mode 100644
index 0000000000..c8649d34af
--- /dev/null
+++ b/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/mobile/send_haptic_data_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+SendHapticDataResponse::SendHapticDataResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : CommandResponseImpl(message, application_manager) {}
+
+SendHapticDataResponse::~SendHapticDataResponse() {}
+
+void SendHapticDataResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ application_manager_.SendMessageToMobile(message_);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/send_location_request.cc b/src/components/application_manager/src/commands/mobile/send_location_request.cc
index 7b9ec53c3a..54664a8771 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
@@ -62,11 +62,9 @@ void SendLocationRequest::Run() {
smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params];
if (msg_params.keyExists(strings::delivery_mode)) {
- const std::vector<std::string>& allowed_params =
- parameters_permissions().allowed_params;
- if (allowed_params.end() == std::find(allowed_params.begin(),
- allowed_params.end(),
- strings::delivery_mode)) {
+ const RPCParams& allowed_params = parameters_permissions().allowed_params;
+
+ if (helpers::in_range(allowed_params, strings::delivery_mode)) {
msg_params.erase(strings::delivery_mode);
}
}
@@ -127,6 +125,7 @@ void SendLocationRequest::Run() {
SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map);
request_msg_params = msg_params;
request_msg_params[strings::app_id] = app->hmi_app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
SendHMIRequest(
hmi_apis::FunctionID::Navigation_SendLocation, &request_msg_params, true);
}
@@ -137,6 +136,7 @@ void SendLocationRequest::on_event(const event_engine::Event& event) {
const smart_objects::SmartObject& message = event.smart_object();
if (hmi_apis::FunctionID::Navigation_SendLocation == event.id()) {
LOG4CXX_INFO(logger_, "Received Navigation_SendLocation event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
const Common_Result::eType result_code = static_cast<Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
std::string response_info;
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
index 5d70a2fb5b..ee544e956a 100644
--- 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
@@ -71,6 +71,13 @@ void SetAppIconRequest::Run() {
const std::string& sync_file_name =
(*message_)[strings::msg_params][strings::sync_file_name].asString();
+ if (!file_system::IsFileNameValid(sync_file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
std::string full_file_path =
application_manager_.get_settings().app_storage_folder() + "/";
full_file_path += app->folder_name();
@@ -107,15 +114,16 @@ void SetAppIconRequest::Run() {
// for further use in on_event function
(*message_)[strings::msg_params][strings::sync_file_name] =
msg_params[strings::sync_file_name];
-
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
}
void SetAppIconRequest::CopyToIconStorage(
const std::string& path_to_file) const {
- if (!application_manager_.protocol_handler()
- .get_settings()
- .enable_protocol_4()) {
+ if (!(application_manager_.protocol_handler()
+ .get_settings()
+ .max_supported_protocol_version() >=
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)) {
LOG4CXX_WARN(logger_,
"Icon copying skipped, since protocol ver. 4 is not enabled.");
return;
@@ -234,6 +242,7 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetAppIcon: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 984690384a..38b62ce731 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
@@ -58,6 +58,7 @@ void SetDisplayLayoutRequest::Run() {
}
(*message_)[strings::msg_params][strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout,
&((*message_)[strings::msg_params]),
true);
@@ -70,6 +71,7 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetDisplayLayout: {
LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 fcfea5e744..e811f5d154 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
@@ -229,6 +229,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetGlobalProperties: {
LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
is_ui_received_ = true;
ui_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -237,6 +238,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
}
case hmi_apis::FunctionID::TTS_SetGlobalProperties: {
LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
is_tts_received_ = true;
tts_result_ = static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -265,15 +267,11 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) {
result_code,
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
+}
- if (!application) {
- LOG4CXX_DEBUG(logger_, "NULL pointer.");
- return;
- }
-
- if (result) {
- application->UpdateHash();
- }
+bool SetGlobalPropertiesRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
}
bool SetGlobalPropertiesRequest::PrepareResponseParameters(
@@ -281,10 +279,11 @@ bool SetGlobalPropertiesRequest::PrepareResponseParameters(
LOG4CXX_AUTO_TRACE(logger_);
using namespace helpers;
- ResponseInfo ui_properties_info(ui_result_, HmiInterfaces::HMI_INTERFACE_UI);
+ ResponseInfo ui_properties_info(
+ ui_result_, HmiInterfaces::HMI_INTERFACE_UI, application_manager_);
- ResponseInfo tts_properties_info(tts_result_,
- HmiInterfaces::HMI_INTERFACE_TTS);
+ ResponseInfo tts_properties_info(
+ tts_result_, HmiInterfaces::HMI_INTERFACE_TTS, application_manager_);
const bool result =
PrepareResultForMobileResponse(ui_properties_info, tts_properties_info);
if (result &&
@@ -401,6 +400,7 @@ void SetGlobalPropertiesRequest::SendTTSRequest(
const smart_objects::SmartObject& params, bool use_events) {
LOG4CXX_AUTO_TRACE(logger_);
is_tts_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
SendHMIRequest(
hmi_apis::FunctionID::TTS_SetGlobalProperties, &params, use_events);
}
@@ -409,6 +409,7 @@ void SetGlobalPropertiesRequest::SendUIRequest(
const smart_objects::SmartObject& params, bool use_events) {
LOG4CXX_AUTO_TRACE(logger_);
is_ui_send_ = true;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(
hmi_apis::FunctionID::UI_SetGlobalProperties, &params, use_events);
}
diff --git a/src/components/application_manager/src/commands/mobile/set_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_icon_request.cc
index 85f34aead9..037de54456 100644
--- a/src/components/application_manager/src/commands/mobile/set_icon_request.cc
+++ b/src/components/application_manager/src/commands/mobile/set_icon_request.cc
@@ -95,7 +95,7 @@ void SetIconRequest::Run() {
// for further use in on_event function
(*message_)[strings::msg_params][strings::sync_file_name] =
msg_params[strings::sync_file_name];
-
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_SetAppIcon, &msg_params, true);
}
@@ -105,6 +105,7 @@ void SetIconRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetAppIcon: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
mobile_apis::Result::eType result_code =
static_cast<mobile_apis::Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 1e0a00318d..54727abe01 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
@@ -71,6 +71,7 @@ void SetMediaClockRequest::Run() {
// copy entirely msg
msg_params = (*message_)[strings::msg_params];
msg_params[strings::app_id] = app->app_id();
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(
hmi_apis::FunctionID::UI_SetMediaClockTimer, &msg_params, true);
@@ -85,6 +86,7 @@ void SetMediaClockRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_SetMediaClockTimer: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 b1cc40009d..42bfea4864 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
@@ -172,6 +172,7 @@ void ShowConstantTBTRequest::Run() {
}
app->set_tbt_show_command(msg_params);
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
SendHMIRequest(
hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, true);
}
@@ -184,6 +185,7 @@ void ShowConstantTBTRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::Navigation_ShowConstantTBT: {
LOG4CXX_INFO(logger_, "Received Navigation_ShowConstantTBT event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
const Common_Result::eType result_code =
static_cast<Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 cf2509cdb9..ad598efc1d 100644
--- a/src/components/application_manager/src/commands/mobile/show_request.cc
+++ b/src/components/application_manager/src/commands/mobile/show_request.cc
@@ -45,10 +45,46 @@ namespace commands {
ShowRequest::ShowRequest(const MessageSharedPtr& message,
ApplicationManager& application_manager)
- : CommandRequestImpl(message, application_manager) {}
+ : CommandRequestImpl(message, application_manager)
+ , core_result_code_(mobile_apis::Result::INVALID_ENUM) {}
ShowRequest::~ShowRequest() {}
+void ShowRequest::HandleMetadata(const char* field_id,
+ int32_t field_index,
+ smart_objects::SmartObject& msg_params) {
+ smart_objects::SmartObject& metadata_tags =
+ (*message_)[strings::msg_params][strings::metadata_tags];
+
+ if (metadata_tags.keyExists(field_id)) {
+ if (field_index != -1) {
+ msg_params[hmi_request::show_strings][field_index]
+ [hmi_request::field_types] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ const size_t num_tags = metadata_tags[field_id].length();
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = metadata_tags[field_id][i].asInt();
+ msg_params[hmi_request::show_strings][field_index]
+ [hmi_request::field_types][i] = current_tag;
+ }
+ } else {
+ LOG4CXX_INFO(logger_,
+ "metadata tag provided with no item for "
+ << field_id << ", ignoring with warning");
+ // tag provided with no item, ignore with warning
+ if (mobile_apis::Result::INVALID_ENUM == core_result_code_) {
+ core_result_code_ = mobile_apis::Result::WARNINGS;
+ core_response_info_ =
+ "Metadata tag was provided for a field with no data.";
+ }
+ }
+ } else {
+ LOG4CXX_INFO(logger_,
+ "No metadata tagging provided for field: " << field_id);
+ }
+}
+
void ShowRequest::Run() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -125,38 +161,53 @@ void ShowRequest::Run() {
smart_objects::SmartObject(smart_objects::SmartType_Array);
int32_t index = 0;
+ int32_t main_field_1_index = -1;
if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) {
msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField1);
msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::main_field_1];
+ main_field_1_index = index;
++index;
}
+ int32_t main_field_2_index = -1;
if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) {
msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField2);
msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::main_field_2];
+ main_field_2_index = index;
++index;
}
+ int32_t main_field_3_index = -1;
if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) {
msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField3);
msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::main_field_3];
+ main_field_3_index = index;
++index;
}
+ int32_t main_field_4_index = -1;
if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) {
msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::mainField4);
msg_params[hmi_request::show_strings][index][hmi_request::field_text] =
(*message_)[strings::msg_params][strings::main_field_4];
+ main_field_4_index = index;
++index;
}
+ if ((*message_)[strings::msg_params].keyExists(strings::metadata_tags)) {
+ HandleMetadata(strings::main_field_1, main_field_1_index, msg_params);
+ HandleMetadata(strings::main_field_2, main_field_2_index, msg_params);
+ HandleMetadata(strings::main_field_3, main_field_3_index, msg_params);
+ HandleMetadata(strings::main_field_4, main_field_4_index, msg_params);
+ }
+
if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) {
msg_params[hmi_request::show_strings][index][hmi_request::field_name] =
static_cast<int32_t>(hmi_apis::Common_TextFieldName::mediaClock);
@@ -212,6 +263,7 @@ void ShowRequest::Run() {
(*message_)[strings::msg_params][strings::custom_presets];
}
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true);
MessageSharedPtr persistentData = new smart_objects::SmartObject(msg_params);
@@ -227,6 +279,7 @@ void ShowRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::UI_Show: {
LOG4CXX_DEBUG(logger_, "Received UI_Show event.");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
std::string response_info;
hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
@@ -239,8 +292,15 @@ void ShowRequest::on_event(const event_engine::Event& event) {
response_info =
message[strings::params][hmi_response::message].asString();
}
+ mobile_apis::Result::eType converted_result_code =
+ MessageHelper::HMIToMobileResult(result_code);
+ if (mobile_apis::Result::SUCCESS == converted_result_code &&
+ mobile_apis::Result::INVALID_ENUM != core_result_code_) {
+ converted_result_code = core_result_code_;
+ response_info = core_response_info_;
+ }
SendResponse(result,
- MessageHelper::HMIToMobileResult(result_code),
+ converted_result_code,
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
break;
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 054d0ec16d..f98869b08f 100644
--- a/src/components/application_manager/src/commands/mobile/slider_request.cc
+++ b/src/components/application_manager/src/commands/mobile/slider_request.cc
@@ -107,6 +107,7 @@ void SliderRequest::Run() {
msg_params[strings::timeout] = default_timeout_;
}
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
SendHMIRequest(hmi_apis::FunctionID::UI_Slider, &msg_params, true);
}
@@ -132,7 +133,7 @@ void SliderRequest::on_event(const event_engine::Event& event) {
}
LOG4CXX_DEBUG(logger_, "Received UI_Slider event");
-
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI);
const Common_Result::eType response_code = static_cast<Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
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 6cbb762102..1954cde181 100644
--- a/src/components/application_manager/src/commands/mobile/speak_request.cc
+++ b/src/components/application_manager/src/commands/mobile/speak_request.cc
@@ -72,6 +72,7 @@ void SpeakRequest::Run() {
(*message_)[strings::msg_params][strings::app_id] = app->app_id();
(*message_)[strings::msg_params][hmi_request::speak_type] =
hmi_apis::Common_MethodName::SPEAK;
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
SendHMIRequest(hmi_apis::FunctionID::TTS_Speak,
&message_->getElement(strings::msg_params),
true);
@@ -82,7 +83,7 @@ void SpeakRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::TTS_Speak: {
LOG4CXX_INFO(logger_, "Received TTS_Speak event");
-
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_TTS);
ProcessTTSSpeakResponse(event.smart_object());
break;
}
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 eb6bbf545e..4d11467d2d 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
@@ -86,10 +86,11 @@ void SubscribeButtonRequest::Run() {
const bool is_succedeed = true;
SendResponse(is_succedeed, mobile_apis::Result::SUCCESS);
+}
- if (is_succedeed) {
- app->UpdateHash();
- }
+bool SubscribeButtonRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
}
bool SubscribeButtonRequest::IsSubscriptionAllowed(
@@ -104,34 +105,6 @@ bool SubscribeButtonRequest::IsSubscriptionAllowed(
return true;
}
-bool SubscribeButtonRequest::CheckHMICapabilities(
- mobile_apis::ButtonName::eType button) {
- using namespace smart_objects;
- using namespace mobile_apis;
- LOG4CXX_AUTO_TRACE(logger_);
-
- const HMICapabilities& hmi_caps = application_manager_.hmi_capabilities();
- if (!hmi_caps.is_ui_cooperating()) {
- LOG4CXX_ERROR(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;
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 56027bacaf..15ba7999bd 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
@@ -3,6 +3,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -116,7 +119,7 @@ void SubscribeVehicleDataRequest::Run() {
smart_objects::SmartObject response_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
bool result = false;
- CheckVISubscribtions(
+ CheckVISubscriptions(
app, info, result_code, response_params, msg_params, result);
if (mobile_apis::Result::INVALID_ENUM != result_code) {
@@ -149,6 +152,7 @@ void SubscribeVehicleDataRequest::Run() {
++it)
SendHMIRequest(it->func_id, &msg_params, true);
#else
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
&msg_params,
true);
@@ -165,7 +169,7 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
LOG4CXX_ERROR(logger_, "Received unknown event.");
return;
}
-
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
ApplicationSharedPtr app =
application_manager_.application(CommandRequestImpl::connection_key());
@@ -250,6 +254,15 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
result_code = mobile_apis::Result::IGNORED;
response_info = "Already subscribed on some provided VehicleData.";
}
+
+ if (!vi_waiting_for_subscribe_.empty()) {
+ LOG4CXX_DEBUG(logger_, "Subscribing to all pending VehicleData");
+ VehicleInfoSubscriptions::const_iterator key =
+ vi_waiting_for_subscribe_.begin();
+ for (; key != vi_waiting_for_subscribe_.end(); ++key) {
+ app->SubscribeToIVI(*key);
+ }
+ }
}
UnsubscribeFailedSubscriptions(app, message[strings::msg_params]);
@@ -264,31 +277,45 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
result_code,
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
-
- if (is_succeeded) {
- app->UpdateHash();
- }
#endif // #ifdef HMI_DBUS_API
}
+bool SubscribeVehicleDataRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
void SubscribeVehicleDataRequest::AddAlreadySubscribedVI(
smart_objects::SmartObject& msg_params) const {
LOG4CXX_AUTO_TRACE(logger_);
using namespace mobile_apis;
+ auto vi_to_string =
+ [](const mobile_apis::VehicleDataType::eType vehicle_data) {
+ for (auto& vi_str_to_int_pair : MessageHelper::vehicle_data()) {
+ if (vehicle_data == vi_str_to_int_pair.second) {
+ return vi_str_to_int_pair.first;
+ }
+ }
+ return std::string();
+ };
+
VehicleInfoSubscriptions::const_iterator it_same_app =
vi_already_subscribed_by_this_app_.begin();
for (; vi_already_subscribed_by_this_app_.end() != it_same_app;
++it_same_app) {
- msg_params[*it_same_app][strings::result_code] =
+ msg_params[vi_to_string(*it_same_app)][strings::result_code] =
VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED;
+ msg_params[vi_to_string(*it_same_app)][strings::data_type] = *it_same_app;
}
VehicleInfoSubscriptions::const_iterator it_another_app =
vi_already_subscribed_by_another_apps_.begin();
for (; vi_already_subscribed_by_another_apps_.end() != it_another_app;
++it_another_app) {
- msg_params[*it_another_app][strings::result_code] =
+ msg_params[vi_to_string(*it_another_app)][strings::result_code] =
VehicleDataResultCode::VDRC_SUCCESS;
+ msg_params[vi_to_string(*it_another_app)][strings::data_type] =
+ *it_another_app;
}
}
@@ -341,6 +368,21 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
smart_objects::SmartObject& out_response_params,
smart_objects::SmartObject& out_request_params,
bool& out_result) {
+ CheckVISubscriptions(app,
+ out_info,
+ out_result_code,
+ out_response_params,
+ out_request_params,
+ out_result);
+}
+
+void SubscribeVehicleDataRequest::CheckVISubscriptions(
+ ApplicationSharedPtr app,
+ std::string& out_info,
+ mobile_apis::Result::eType& out_result_code,
+ smart_objects::SmartObject& out_response_params,
+ smart_objects::SmartObject& out_request_params,
+ bool& out_result) {
// counter for items to subscribe
VehicleInfoSubscriptions::size_type items_to_subscribe = 0;
// counter for subscribed items by application
@@ -365,7 +407,7 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
++items_to_subscribe;
}
if (!is_interface_not_available && is_key_enabled) {
- VehicleDataType key_type = it->second;
+ mobile_apis::VehicleDataType::eType key_type = it->second;
if (app->IsSubscribedToIVI(key_type)) {
LOG4CXX_DEBUG(logger_,
"App with connection key "
@@ -406,12 +448,13 @@ void SubscribeVehicleDataRequest::CheckVISubscribtions(
out_request_params[key_name] = is_key_enabled;
- if (app->SubscribeToIVI(static_cast<uint32_t>(key_type))) {
+ if (is_key_enabled) {
+ vi_waiting_for_subscribe_.insert(key_type);
LOG4CXX_DEBUG(
logger_,
"App with connection key "
<< connection_key()
- << " have been subscribed for VehicleDataType: " << key_type);
+ << " will be subscribed for VehicleDataType: " << key_type);
++subscribed_items;
}
}
diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
index 29cc8e6541..8195697dfc 100644
--- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
+++ b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc
@@ -25,18 +25,18 @@ void SubscribeWayPointsRequest::Run() {
return;
}
- if (application_manager_.IsAppSubscribedForWayPoints(app->app_id())) {
+ if (application_manager_.IsAppSubscribedForWayPoints(app)) {
SendResponse(false, mobile_apis::Result::IGNORED);
return;
}
if (application_manager_.IsAnyAppSubscribedForWayPoints()) {
- application_manager_.SubscribeAppForWayPoints(app->app_id());
+ application_manager_.SubscribeAppForWayPoints(app);
SendResponse(true, mobile_apis::Result::SUCCESS);
- app->UpdateHash();
return;
}
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
SendHMIRequest(
hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, true);
}
@@ -48,6 +48,7 @@ void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: {
LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
const hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -56,15 +57,12 @@ void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
const bool result = PrepareResultForMobileResponse(
result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
if (result) {
- application_manager_.SubscribeAppForWayPoints(app->app_id());
+ application_manager_.SubscribeAppForWayPoints(app);
}
SendResponse(result,
MessageHelper::HMIToMobileResult(result_code),
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
- if (result) {
- app->UpdateHash();
- }
break;
}
default: {
@@ -74,6 +72,11 @@ void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
}
}
+bool SubscribeWayPointsRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc
index b9acf5e930..fe38b93732 100644
--- a/src/components/application_manager/src/commands/mobile/system_request.cc
+++ b/src/components/application_manager/src/commands/mobile/system_request.cc
@@ -118,8 +118,7 @@ class QueryAppsDataValidator {
smart_objects::SmartArray::iterator applications_iterator =
objects_array->begin();
- for (; applications_iterator != objects_array->end();
- ++applications_iterator) {
+ for (; applications_iterator != objects_array->end();) {
const smart_objects::SmartObject& app_data = *applications_iterator;
if (!app_data.isValid()) {
@@ -133,7 +132,8 @@ class QueryAppsDataValidator {
LOG4CXX_WARN(logger_,
"Application hasn`t some of mandatory parameters. "
"Application will be skipped.");
- objects_array->erase(applications_iterator);
+
+ applications_iterator = objects_array->erase(applications_iterator);
continue;
}
@@ -186,6 +186,7 @@ class QueryAppsDataValidator {
return false;
}
has_response_valid_application = true;
+ ++applications_iterator;
}
return has_response_valid_application;
}
@@ -466,6 +467,20 @@ void SystemRequest::Run() {
file_name = kSYNC;
}
+ if (!CheckSyntax(file_name)) {
+ LOG4CXX_ERROR(logger_,
+ "Incoming request contains \t\n \\t \\n or whitespace");
+ SendResponse(false, mobile_apis::Result::INVALID_DATA);
+ return;
+ }
+
+ if (!file_system::IsFileNameValid(file_name)) {
+ const std::string err_msg = "Sync file name contains forbidden symbols.";
+ LOG4CXX_ERROR(logger_, err_msg);
+ SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str());
+ return;
+ }
+
bool is_system_file = std::string::npos != file_name.find(kSYNC) ||
std::string::npos != file_name.find(kIVSU);
@@ -520,19 +535,8 @@ void SystemRequest::Run() {
if (!file || !file->is_download_complete ||
!file_system::MoveFile(app_full_file_path, file_dst_path)) {
LOG4CXX_DEBUG(logger_, "Binary data not found.");
-
- std::string origin_file_name;
- if ((*message_)[strings::msg_params].keyExists(strings::file_name)) {
- origin_file_name =
- (*message_)[strings::msg_params][strings::file_name].asString();
- }
- if (!(mobile_apis::RequestType::HTTP == request_type &&
- 0 == origin_file_name.compare(kIVSU))) {
- LOG4CXX_DEBUG(logger_, "Binary data required. Reject");
- SendResponse(false, mobile_apis::Result::REJECTED);
- return;
- }
- LOG4CXX_DEBUG(logger_, "IVSU does not require binary data. Continue");
+ SendResponse(false, mobile_apis::Result::REJECTED);
+ return;
}
processing_file_ = file_dst_path;
}
@@ -578,11 +582,12 @@ void SystemRequest::Run() {
msg_params[strings::file_name] = file_dst_path;
}
- if (mobile_apis::RequestType::PROPRIETARY != request_type) {
- msg_params[strings::app_id] = (application->policy_app_id());
- }
+ // expected int, mandatory=true, all Policies flow (HTTP,Proprietary,External)
+ msg_params[strings::app_id] = application->hmi_app_id();
+
msg_params[strings::request_type] =
(*message_)[strings::msg_params][strings::request_type];
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_SystemRequest,
&msg_params,
true);
@@ -596,6 +601,7 @@ void SystemRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::BasicCommunication_SystemRequest: {
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_BasicCommunication);
mobile_apis::Result::eType result_code =
GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asUInt()));
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 d7056a624e..d40ad9c870 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
@@ -53,6 +53,7 @@ void UnregisterAppInterfaceRequest::Run() {
connection_key(),
mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM),
commands::Command::ORIGIN_SDL);
+ application_manager_.EndNaviServices(connection_key());
application_manager_.UnregisterApplication(connection_key(),
mobile_apis::Result::SUCCESS);
SendResponse(true, mobile_apis::Result::SUCCESS);
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 e1bdba61a0..7e798bcb4e 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
@@ -58,8 +58,16 @@ void UnsubscribeButtonRequest::Run() {
return;
}
- const uint32_t btn_id =
- (*message_)[str::msg_params][str::button_name].asUInt();
+ const mobile_apis::ButtonName::eType btn_id =
+ static_cast<mobile_apis::ButtonName::eType>(
+ (*message_)[str::msg_params][str::button_name].asInt());
+
+ if (!CheckHMICapabilities(btn_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Button " << btn_id << " isn't allowed by HMI capabilities");
+ SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ return;
+ }
if (!app->UnsubscribeFromButton(
static_cast<mobile_apis::ButtonName::eType>(btn_id))) {
@@ -70,7 +78,11 @@ void UnsubscribeButtonRequest::Run() {
SendUnsubscribeButtonNotification();
SendResponse(true, mobile_apis::Result::SUCCESS);
- app->UpdateHash();
+}
+
+bool UnsubscribeButtonRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
}
void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
@@ -81,7 +93,7 @@ void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() {
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());
+ (*message_)[strings::msg_params][strings::button_name].asInt());
msg_params[strings::is_suscribed] = false;
CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params);
}
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 409579b294..9ac98a27f7 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
@@ -32,6 +32,7 @@
*/
#include "application_manager/commands/mobile/unsubscribe_button_response.h"
+#include "smart_objects/smart_object.h"
namespace application_manager {
@@ -46,8 +47,6 @@ UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {}
void UnsubscribeButtonResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
// check if response false
if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
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 6902a9d659..d6ad928bf7 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
@@ -1,6 +1,6 @@
/*
- Copyright (c) 2013, Ford Motor Company
+ Copyright (c) 2017, Ford Motor Company
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -134,7 +134,7 @@ void UnsubscribeVehicleDataRequest::Run() {
if (is_key_enabled) {
++items_to_unsubscribe;
- VehicleDataType key_type = it->second;
+ mobile_apis::VehicleDataType::eType key_type = it->second;
if (!app->IsSubscribedToIVI(key_type)) {
++unsubscribed_items;
vi_already_unsubscribed_by_this_app_.insert(key_type);
@@ -201,16 +201,14 @@ void UnsubscribeVehicleDataRequest::Run() {
}
if (is_everything_already_unsubscribed) {
- mobile_apis::Result::eType result_code =
- vi_already_unsubscribed_by_this_app_.size()
- ? mobile_apis::Result::IGNORED
- : mobile_apis::Result::SUCCESS;
-
- const char* info = vi_already_unsubscribed_by_this_app_.size()
- ? "Already subscribed on some provided VehicleData."
- : NULL;
-
- SendResponse(true, result_code, info, &response_params);
+ if (!vi_already_unsubscribed_by_this_app_.empty()) {
+ SendResponse(false,
+ mobile_apis::Result::IGNORED,
+ "Some provided VehicleData was not subscribed.",
+ &response_params);
+ } else {
+ SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params);
+ }
return;
}
@@ -236,6 +234,7 @@ void UnsubscribeVehicleDataRequest::Run() {
++it)
SendHMIRequest(it->func_id, &msg_params, true);
#else
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
&msg_params,
true);
@@ -252,6 +251,15 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
LOG4CXX_ERROR(logger_, "Received unknown event.");
return;
}
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_VehicleInfo);
+
+ ApplicationSharedPtr app =
+ application_manager_.application(CommandRequestImpl::connection_key());
+
+ if (!app) {
+ LOG4CXX_ERROR(logger_, "NULL pointer.");
+ return;
+ }
#ifdef HMI_DBUS_API
for (HmiRequests::iterator it = hmi_requests_.begin();
@@ -308,7 +316,7 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
}
SendResponse(any_arg_success, status, NULL, &response_params);
if (true == any_arg_success) {
- UpdateHash();
+ app->UpdateHash();
}
}
#else
@@ -344,11 +352,17 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) {
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
if (result) {
- UpdateHash();
+ application_manager_.TerminateRequest(
+ connection_key(), correlation_id(), function_id());
}
#endif // #ifdef HMI_DBUS_API
}
+bool UnsubscribeVehicleDataRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
struct SubscribedToIVIPredicate {
int32_t vehicle_info_;
SubscribedToIVIPredicate(int32_t vehicle_info)
@@ -389,20 +403,5 @@ void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI(
}
}
-void UnsubscribeVehicleDataRequest::UpdateHash() const {
- LOG4CXX_AUTO_TRACE(logger_);
- ApplicationSharedPtr application =
- application_manager_.application(connection_key());
- if (application) {
- application->UpdateHash();
- } else {
- LOG4CXX_ERROR(logger_,
- "Application with connection_key = " << connection_key()
- << " doesn't exist.");
- }
- application_manager_.TerminateRequest(
- connection_key(), correlation_id(), function_id());
-}
-
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc
index e06158e4eb..986256d377 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
@@ -32,6 +32,7 @@
*/
#include "application_manager/commands/mobile/unsubscribe_vehicle_data_response.h"
+#include "smart_objects/smart_object.h"
namespace application_manager {
namespace commands {
@@ -45,8 +46,6 @@ UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {}
void UnsubscribeVehicleDataResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
// check if response false
if (true == (*message_)[strings::msg_params].keyExists(strings::success)) {
if ((*message_)[strings::msg_params][strings::success].asBool() == false) {
diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc
index 728209fcf2..dc3404c022 100644
--- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc
+++ b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc
@@ -25,11 +25,12 @@ void UnSubscribeWayPointsRequest::Run() {
return;
}
- if (!application_manager_.IsAppSubscribedForWayPoints(app->app_id())) {
+ if (!application_manager_.IsAppSubscribedForWayPoints(app)) {
SendResponse(false, mobile_apis::Result::IGNORED);
return;
}
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
SendHMIRequest(
hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true);
}
@@ -41,6 +42,7 @@ void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: {
LOG4CXX_INFO(logger_, "Received Navigation_UnSubscribeWayPoints event");
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
const hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
@@ -49,15 +51,12 @@ void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
const bool result = PrepareResultForMobileResponse(
result_code, HmiInterfaces::HMI_INTERFACE_Navigation);
if (result) {
- application_manager_.UnsubscribeAppFromWayPoints(app->app_id());
+ application_manager_.UnsubscribeAppFromWayPoints(app);
}
SendResponse(result,
MessageHelper::HMIToMobileResult(result_code),
response_info.empty() ? NULL : response_info.c_str(),
&(message[strings::msg_params]));
- if (result) {
- app->UpdateHash();
- }
break;
}
default: {
@@ -67,6 +66,11 @@ void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) {
}
}
+bool UnSubscribeWayPointsRequest::Init() {
+ hash_update_mode_ = HashUpdateMode::kDoHashUpdate;
+ return true;
+}
+
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc
index becab175e9..44fe9d0d07 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
@@ -138,6 +138,7 @@ void UpdateTurnListRequest::Run() {
if ((*message_)[strings::msg_params].keyExists(strings::turn_list) ||
(*message_)[strings::msg_params].keyExists(strings::soft_buttons)) {
+ StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
SendHMIRequest(
hmi_apis::FunctionID::Navigation_UpdateTurnList, &msg_params, true);
} else {
@@ -154,7 +155,7 @@ void UpdateTurnListRequest::on_event(const event_engine::Event& event) {
switch (event.id()) {
case hmi_apis::FunctionID::Navigation_UpdateTurnList: {
LOG4CXX_INFO(logger_, "Received Navigation_UpdateTurnList event");
-
+ EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation);
const hmi_apis::Common_Result::eType result_code =
static_cast<hmi_apis::Common_Result::eType>(
message[strings::params][hmi_response::code].asInt());
diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc
new file mode 100644
index 0000000000..2a96502cde
--- /dev/null
+++ b/src/components/application_manager/src/core_service.cc
@@ -0,0 +1,231 @@
+/**
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <vector>
+#include <algorithm>
+#include "application_manager/core_service.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/message_helper.h"
+#include "json/json.h"
+#include "interfaces/HMI_API.h"
+
+namespace application_manager {
+
+namespace {
+struct AppExtensionPredicate {
+ AppExtensionUID uid;
+ bool operator()(const ApplicationSharedPtr app) {
+ return app ? app->QueryInterface(uid).valid() : false;
+ }
+};
+}
+
+CoreService::CoreService(ApplicationManager& application_manager)
+ : application_manager_(application_manager) {}
+
+CoreService::~CoreService() {}
+
+mobile_apis::Result::eType CoreService::CheckPolicyPermissions(MessagePtr msg) {
+ ApplicationSharedPtr app = GetApplication(msg->connection_key());
+ if (!app) {
+ return mobile_apis::Result::eType::APPLICATION_NOT_REGISTERED;
+ }
+
+#ifdef SDL_REMOTE_CONTROL
+ const RPCParams rpc_params;
+ CommandParametersPermissions params;
+ const mobile_apis::Result::eType ret =
+ application_manager_.CheckPolicyPermissions(
+ app, msg->function_name(), rpc_params, &params);
+
+ if (ret != mobile_apis::Result::eType::SUCCESS) {
+ return ret;
+ }
+
+ if (!AreParametersAllowed(msg, params)) {
+ return mobile_apis::Result::eType::DISALLOWED;
+ }
+
+ return ret;
+#else
+ return mobile_apis::Result::eType::SUCCESS;
+#endif // SDL_REMOTE_CONTROL
+}
+
+bool CoreService::CheckModule(const ApplicationId& app_id,
+ const std::string& module) {
+#ifdef SDL_REMOTE_CONTROL
+ ApplicationSharedPtr app = GetApplication(app_id);
+ if (app) {
+ return application_manager_.GetPolicyHandler().CheckModule(
+ app->policy_app_id(), module);
+ }
+#endif // SDL_REMOTE_CONTROL
+ return false;
+}
+
+bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const {
+#ifdef SDL_REMOTE_CONTROL
+ DCHECK_OR_RETURN(app, false);
+ return application_manager_.GetPolicyHandler().CheckHMIType(
+ app->policy_app_id(),
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ app->app_types());
+#endif // SDL_REMOTE_CONTROL
+ return false;
+}
+
+bool CoreService::IsInterfaceAvailable(
+ const HmiInterfaces::InterfaceID interface) const {
+#ifdef SDL_REMOTE_CONTROL
+ HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces();
+ const HmiInterfaces::InterfaceState state =
+ hmi_interfaces.GetInterfaceState(interface);
+ return HmiInterfaces::STATE_NOT_AVAILABLE != state;
+#endif // SDL_REMOTE_CONTROL
+ return false;
+}
+
+void CoreService::RemoveHMIFakeParameters(
+ application_manager::MessagePtr& message) {
+ application_manager_.RemoveHMIFakeParameters(message);
+}
+
+ApplicationSharedPtr CoreService::GetApplication(ApplicationId app_id) {
+ return application_manager_.application(app_id);
+}
+
+void CoreService::SendMessageToHMI(const MessagePtr& message) {
+ application_manager_.SendPostMessageToHMI(message);
+}
+
+void CoreService::SendMessageToMobile(const MessagePtr& message) {
+ application_manager_.SendPostMessageToMobile(message);
+}
+
+uint32_t CoreService::GetNextCorrelationID() {
+ return application_manager_.GetNextHMICorrelationID();
+}
+
+std::vector<ApplicationSharedPtr> CoreService::GetApplications(
+ AppExtensionUID uid) {
+ ApplicationSet accessor = application_manager_.applications().GetData();
+ AppExtensionPredicate predicate;
+ predicate.uid = uid;
+
+ std::vector<ApplicationSharedPtr> result;
+ ApplicationSetConstIt it =
+ std::find_if(accessor.begin(), accessor.end(), predicate);
+ while (it != accessor.end()) {
+ result.push_back(*it);
+ it = std::find_if(++it, accessor.end(), predicate);
+ }
+ return result;
+}
+
+void CoreService::ChangeNotifyHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) {
+ DCHECK_OR_RETURN_VOID(app);
+ application_manager_.ChangeAppsHMILevel(app->app_id(), level);
+}
+
+const smart_objects::SmartObject* CoreService::GetRCCapabilities() const {
+ return application_manager_.hmi_capabilities().rc_capability();
+}
+
+void CoreService::NotifyHMIAboutHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) {
+ DCHECK_OR_RETURN_VOID(app);
+ if (app->hmi_level() != mobile_apis::HMILevel::eType::HMI_FULL) {
+ MessageHelper::SendActivateAppToHMI(
+ app->app_id(),
+ application_manager_,
+ static_cast<hmi_apis::Common_HMILevel::eType>(level),
+ true);
+ }
+}
+
+bool CoreService::AreParametersAllowed(
+ MessagePtr msg, const CommandParametersPermissions& params) {
+ Json::Reader reader;
+ Json::Value json;
+ bool ret = reader.parse(msg->json_message(), json);
+ if (ret) {
+ return CheckParams(json.get(strings::params, Json::Value(Json::nullValue)),
+ params.allowed_params);
+ }
+ return false;
+}
+
+bool CoreService::CheckParams(const Json::Value& object,
+ const RPCParams& allowed_params) {
+ if (!object.isObject()) {
+ return true;
+ }
+ for (Json::Value::iterator i = object.begin(); i != object.end(); ++i) {
+ std::string name = i.memberName();
+ if (!IsAllowed(name, allowed_params)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool CoreService::IsAllowed(const std::string& name,
+ const RPCParams& allowed_params) {
+ return std::find(allowed_params.begin(), allowed_params.end(), name) !=
+ allowed_params.end();
+}
+
+bool CoreService::GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const {
+#ifdef SDL_REMOTE_CONTROL
+ return application_manager_.GetPolicyHandler().GetModuleTypes(policy_app_id,
+ modules);
+#endif // SDL_REMOTE_CONTROL
+ return false;
+}
+
+MessageValidationResult CoreService::ValidateMessageBySchema(
+ const Message& message) {
+ const MessageValidationResult result =
+ application_manager_.ValidateMessageBySchema(message);
+ LOG4CXX_DEBUG(logger_, "Validation result : " << result);
+ return result;
+}
+
+const ApplicationManagerSettings& CoreService::GetSettings() const {
+ return application_manager_.get_settings();
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
index f8b8bc791d..b19a6f9194 100644
--- a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
+++ b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc
@@ -45,8 +45,10 @@ EventDispatcherImpl::EventDispatcherImpl()
EventDispatcherImpl::~EventDispatcherImpl() {}
void EventDispatcherImpl::raise_event(const Event& event) {
+ AutoLock observer_lock(observer_lock_);
{
- AutoLock auto_lock(state_lock_);
+ AutoLock state_lock(state_lock_);
+
// check if event is notification
if (hmi_apis::messageType::notification == event.smart_object_type()) {
const uint32_t notification_correlation_id = 0;
@@ -61,11 +63,10 @@ void EventDispatcherImpl::raise_event(const Event& event) {
}
// Call observers
- EventObserver* temp;
while (!observers_.empty()) {
- AutoLock auto_lock(observer_lock_);
- temp = *observers_.begin();
+ EventObserver* temp = *observers_.begin();
observers_.erase(observers_.begin());
+ AutoUnlock unlock_observer(observer_lock);
temp->on_event(event);
}
}
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc
new file mode 100644
index 0000000000..16b49faa2a
--- /dev/null
+++ b/src/components/application_manager/src/helpers/application_helper.cc
@@ -0,0 +1,146 @@
+#include <vector>
+#include <string>
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/message_helper.h"
+#include "utils/logger.h"
+#include "utils/file_system.h"
+
+namespace {
+using namespace application_manager;
+void DeleteWayPoints(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ app_manager.UnsubscribeAppFromWayPoints(app);
+ if (!app_manager.IsAnyAppSubscribedForWayPoints()) {
+ MessageHelper::SendUnsubscribedWayPoints(app_manager);
+ }
+}
+
+void DeleteCommands(ApplicationSharedPtr app, ApplicationManager& app_manager) {
+ CommandsMap cmap = app->commands_map().GetData();
+
+ for (auto cmd : cmap) {
+ MessageHelper::SendDeleteCommandRequest(cmd.second, app, app_manager);
+ app->RemoveCommand(cmd.first);
+ }
+}
+
+void DeleteSubmenus(ApplicationSharedPtr app, ApplicationManager& app_manager) {
+ SubMenuMap smap = app->sub_menu_map().GetData();
+
+ for (auto smenu : smap) {
+ MessageHelper::SendDeleteSubmenuRequest(smenu.second, app, app_manager);
+ app->RemoveSubMenu(smenu.first);
+ }
+}
+
+void DeleteChoiceSets(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ ChoiceSetMap csmap = app->choice_set_map().GetData();
+
+ for (auto choice : csmap) {
+ MessageHelper::SendDeleteChoiceSetRequest(choice.second, app, app_manager);
+ app->RemoveChoiceSet(choice.first);
+ }
+}
+
+void DeleteGlobalProperties(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ using namespace smart_objects;
+
+ const std::vector<std::string>& timeout_prompt =
+ app_manager.get_settings().time_out_promt();
+
+ SmartObject so_default_timeout_prompt = SmartObject(SmartType_Array);
+
+ int32_t index = 0;
+ for (auto prompt : timeout_prompt) {
+ SmartObject timeoutPrompt = SmartObject(SmartType_Map);
+ timeoutPrompt[strings::text] = timeout_prompt[static_cast<size_t>(index)];
+ timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+ so_default_timeout_prompt[index] = timeoutPrompt;
+ ++index;
+ }
+
+ app->set_timeout_prompt(so_default_timeout_prompt);
+
+ SmartObject empty_so = SmartObject(SmartType_Array);
+ app->set_help_prompt(empty_so);
+ app->reset_vr_help_title();
+ app->reset_vr_help();
+ app->set_keyboard_props(empty_so);
+ app->set_menu_icon(empty_so);
+ app->set_menu_title(empty_so);
+
+ MessageHelper::SendResetPropertiesRequest(app, app_manager);
+}
+
+void DeleteButtonSubscriptions(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ ButtonSubscriptions buttons = app->SubscribedButtons().GetData();
+
+ for (auto button : buttons) {
+ if (mobile_apis::ButtonName::CUSTOM_BUTTON == button) {
+ continue;
+ }
+ MessageHelper::SendUnsubscribeButtonNotification(button, app, app_manager);
+ app->UnsubscribeFromButton(button);
+ }
+}
+
+void DeleteVISubscriptions(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ VehicleInfoSubscriptions ivi = app->SubscribedIVI().GetData();
+
+ for (auto i : ivi) {
+ app->UnsubscribeFromIVI(i);
+ SubscribedToIVIPredicate p(i);
+ auto app = FindApp(app_manager.applications(), p);
+ if (!app) {
+ MessageHelper::SendUnsubscribeIVIRequest(i, app, app_manager);
+ }
+ }
+}
+
+void CleanupAppFiles(ApplicationSharedPtr app) {
+ const auto icon_file = app->app_icon_path();
+
+ auto files = app->getAppFiles();
+ for (auto file : files) {
+ auto file_name = file.first;
+ if (icon_file == file_name) {
+ continue;
+ }
+ app->DeleteFile(file_name);
+ file_system::DeleteFile(file_name);
+ }
+}
+} // namespace
+
+namespace application_manager {
+
+CREATE_LOGGERPTR_GLOBAL(logger, "ApplicationManager")
+
+SubscribedToIVIPredicate::SubscribedToIVIPredicate(uint32_t vehicle_info)
+ : vehicle_info_(vehicle_info) {}
+
+bool SubscribedToIVIPredicate::operator()(
+ const ApplicationSharedPtr app) const {
+ return app ? app->IsSubscribedToIVI(vehicle_info_) : false;
+}
+
+void DeleteApplicationData(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ LOG4CXX_AUTO_TRACE(logger);
+ DCHECK_OR_RETURN_VOID(app);
+
+ DeleteWayPoints(app, app_manager);
+ DeleteCommands(app, app_manager);
+ DeleteSubmenus(app, app_manager);
+ DeleteChoiceSets(app, app_manager);
+ DeleteGlobalProperties(app, app_manager);
+ DeleteButtonSubscriptions(app, app_manager);
+ DeleteVISubscriptions(app, app_manager);
+ CleanupAppFiles(app);
+}
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc
index c6fa321401..e39b728155 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -49,6 +49,8 @@ namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters;
namespace {
std::map<std::string, hmi_apis::Common_VrCapabilities::eType>
vr_enum_capabilities;
+std::map<std::string, hmi_apis::Common_SpeechCapabilities::eType>
+ tts_enum_capabilities;
std::map<std::string, hmi_apis::Common_ButtonName::eType> button_enum_name;
std::map<std::string, hmi_apis::Common_TextFieldName::eType>
text_fields_enum_name;
@@ -66,11 +68,32 @@ std::map<std::string, hmi_apis::Common_ImageFieldName::eType>
std::map<std::string, hmi_apis::Common_FileType::eType> file_type_enum;
std::map<std::string, hmi_apis::Common_DisplayType::eType> display_type_enum;
std::map<std::string, hmi_apis::Common_CharacterSet::eType> character_set_enum;
+std::map<std::string, hmi_apis::Common_VideoStreamingProtocol::eType>
+ video_streaming_protocol_enum;
+std::map<std::string, hmi_apis::Common_VideoStreamingCodec::eType>
+ video_streaming_codec_enum;
void InitCapabilities() {
vr_enum_capabilities.insert(std::make_pair(
std::string("TEXT"), hmi_apis::Common_VrCapabilities::VR_TEXT));
+ tts_enum_capabilities.insert(std::make_pair(
+ std::string("TEXT"), hmi_apis::Common_SpeechCapabilities::SC_TEXT));
+ tts_enum_capabilities.insert(
+ std::make_pair(std::string("SAPI_PHONEMES"),
+ hmi_apis::Common_SpeechCapabilities::SAPI_PHONEMES));
+ tts_enum_capabilities.insert(
+ std::make_pair(std::string("LHPLUS_PHONEMES"),
+ hmi_apis::Common_SpeechCapabilities::LHPLUS_PHONEMES));
+ tts_enum_capabilities.insert(
+ std::make_pair(std::string("SAPI_PHONEMES"),
+ hmi_apis::Common_SpeechCapabilities::SAPI_PHONEMES));
+ tts_enum_capabilities.insert(
+ std::make_pair(std::string("PRE_RECORDED"),
+ hmi_apis::Common_SpeechCapabilities::PRE_RECORDED));
+ tts_enum_capabilities.insert(std::make_pair(
+ std::string("SILENCE"), hmi_apis::Common_SpeechCapabilities::SILENCE));
+
button_enum_name.insert(
std::make_pair(std::string("OK"), hmi_apis::Common_ButtonName::OK));
button_enum_name.insert(std::make_pair(
@@ -314,6 +337,28 @@ void InitCapabilities() {
std::string("CID1SET"), hmi_apis::Common_CharacterSet::CID1SET));
character_set_enum.insert(std::make_pair(
std::string("CID2SET"), hmi_apis::Common_CharacterSet::CID2SET));
+
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RAW"), hmi_apis::Common_VideoStreamingProtocol::RAW));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RTP"), hmi_apis::Common_VideoStreamingProtocol::RTP));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RTSP"), hmi_apis::Common_VideoStreamingProtocol::RTSP));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("RTMP"), hmi_apis::Common_VideoStreamingProtocol::RTMP));
+ video_streaming_protocol_enum.insert(std::make_pair(
+ std::string("WEBM"), hmi_apis::Common_VideoStreamingProtocol::WEBM));
+
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("H264"), hmi_apis::Common_VideoStreamingCodec::H264));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("H265"), hmi_apis::Common_VideoStreamingCodec::H265));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("Theora"), hmi_apis::Common_VideoStreamingCodec::Theora));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("VP8"), hmi_apis::Common_VideoStreamingCodec::VP8));
+ video_streaming_codec_enum.insert(std::make_pair(
+ std::string("VP9"), hmi_apis::Common_VideoStreamingCodec::VP9));
}
} // namespace
@@ -324,6 +369,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
, is_ui_cooperating_(false)
, is_navi_cooperating_(false)
, is_ivi_cooperating_(false)
+ , is_rc_cooperating_(false)
, attenuated_supported_(false)
, ui_language_(hmi_apis::Common_Language::INVALID_ENUM)
, vr_language_(hmi_apis::Common_Language::INVALID_ENUM)
@@ -344,6 +390,12 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
, prerecorded_speech_(NULL)
, is_navigation_supported_(false)
, is_phone_call_supported_(false)
+ , is_video_streaming_supported_(false)
+ , is_rc_supported_(false)
+ , navigation_capability_(NULL)
+ , phone_capability_(NULL)
+ , video_streaming_capability_(NULL)
+ , rc_capability_(NULL)
, app_mngr_(app_mngr)
, hmi_language_handler_(app_mngr) {
InitCapabilities();
@@ -353,6 +405,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
is_ui_cooperating_ = true;
is_navi_cooperating_ = true;
is_ivi_cooperating_ = true;
+ is_rc_cooperating_ = true;
}
}
@@ -371,6 +424,10 @@ HMICapabilitiesImpl::~HMICapabilitiesImpl() {
delete audio_pass_thru_capabilities_;
delete pcm_stream_capabilities_;
delete prerecorded_speech_;
+ delete navigation_capability_;
+ delete phone_capability_;
+ delete video_streaming_capability_;
+ delete rc_capability_;
}
bool HMICapabilitiesImpl::VerifyImageType(const int32_t image_type) const {
@@ -411,6 +468,10 @@ void HMICapabilitiesImpl::set_is_ivi_cooperating(const bool value) {
is_ivi_cooperating_ = value;
}
+void HMICapabilitiesImpl::set_is_rc_cooperating(const bool value) {
+ is_rc_cooperating_ = value;
+}
+
void HMICapabilitiesImpl::set_attenuated_supported(const bool state) {
attenuated_supported_ = state;
}
@@ -586,6 +647,48 @@ void HMICapabilitiesImpl::set_phone_call_supported(const bool supported) {
is_phone_call_supported_ = supported;
}
+void HMICapabilitiesImpl::set_video_streaming_supported(const bool supported) {
+ is_video_streaming_supported_ = supported;
+}
+
+void HMICapabilitiesImpl::set_rc_supported(const bool supported) {
+ is_rc_supported_ = supported;
+}
+
+void HMICapabilitiesImpl::set_navigation_capability(
+ const smart_objects::SmartObject& navigation_capability) {
+ if (navigation_capability_) {
+ delete navigation_capability_;
+ }
+ navigation_capability_ =
+ new smart_objects::SmartObject(navigation_capability);
+}
+
+void HMICapabilitiesImpl::set_phone_capability(
+ const smart_objects::SmartObject& phone_capability) {
+ if (phone_capability_) {
+ delete phone_capability_;
+ }
+ phone_capability_ = new smart_objects::SmartObject(phone_capability);
+}
+
+void HMICapabilitiesImpl::set_video_streaming_capability(
+ const smart_objects::SmartObject& video_streaming_capability) {
+ if (video_streaming_capability_) {
+ delete video_streaming_capability_;
+ }
+ video_streaming_capability_ =
+ new smart_objects::SmartObject(video_streaming_capability);
+}
+
+void HMICapabilitiesImpl::set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) {
+ if (rc_capability_) {
+ delete rc_capability_;
+ }
+ rc_capability_ = new smart_objects::SmartObject(rc_capability);
+}
+
void HMICapabilitiesImpl::Init(resumption::LastState* last_state) {
hmi_language_handler_.Init(last_state);
if (false == load_capabilities_from_file()) {
@@ -617,6 +720,10 @@ bool HMICapabilitiesImpl::is_ivi_cooperating() const {
return is_ivi_cooperating_;
}
+bool HMICapabilitiesImpl::is_rc_cooperating() const {
+ return is_rc_cooperating_;
+}
+
const smart_objects::SmartObject* HMICapabilitiesImpl::ui_supported_languages()
const {
return ui_supported_languages_;
@@ -697,6 +804,33 @@ bool HMICapabilitiesImpl::phone_call_supported() const {
return is_phone_call_supported_;
}
+bool HMICapabilitiesImpl::video_streaming_supported() const {
+ return is_video_streaming_supported_;
+}
+
+bool HMICapabilitiesImpl::rc_supported() const {
+ return is_rc_supported_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability()
+ const {
+ return navigation_capability_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability()
+ const {
+ return phone_capability_;
+}
+
+const smart_objects::SmartObject*
+HMICapabilitiesImpl::video_streaming_capability() const {
+ return video_streaming_capability_;
+}
+
+const smart_objects::SmartObject* HMICapabilitiesImpl::rc_capability() const {
+ return rc_capability_;
+}
+
bool HMICapabilitiesImpl::load_capabilities_from_file() {
std::string json_string;
std::string file_name = app_mngr_.get_settings().hmi_capabilities_file_name();
@@ -941,6 +1075,95 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
soft_button_capabilities, soft_button_capabilities_so);
set_soft_button_capabilities(soft_button_capabilities_so);
}
+ if (check_existing_json_member(ui, "systemCapabilities")) {
+ Json::Value system_capabilities = ui.get("systemCapabilities", "");
+ if (check_existing_json_member(system_capabilities,
+ "navigationCapability")) {
+ Json::Value navigation_capability =
+ system_capabilities.get("navigationCapability", "");
+ smart_objects::SmartObject navigation_capability_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(
+ navigation_capability, navigation_capability_so);
+ set_navigation_capability(navigation_capability_so);
+ if (!navigation_capability_so.empty()) {
+ set_navigation_supported(true);
+ }
+ }
+ if (check_existing_json_member(system_capabilities,
+ "phoneCapability")) {
+ Json::Value phone_capability =
+ system_capabilities.get("phoneCapability", "");
+ smart_objects::SmartObject phone_capability_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability,
+ phone_capability_so);
+ set_phone_capability(phone_capability_so);
+ if (!phone_capability_so.empty()) {
+ set_phone_call_supported(true);
+ }
+ }
+ if (check_existing_json_member(system_capabilities,
+ "videoStreamingCapability")) {
+ Json::Value vs_capability =
+ system_capabilities.get("videoStreamingCapability", "");
+ smart_objects::SmartObject vs_capability_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(vs_capability,
+ vs_capability_so);
+
+ if (vs_capability_so.keyExists("supportedFormats")) {
+ smart_objects::SmartObject& supported_format_array =
+ vs_capability_so["supportedFormats"];
+ smart_objects::SmartObject converted_array(
+ smart_objects::SmartType_Array);
+ for (uint32_t i = 0, j = 0; i < supported_format_array.length();
+ i++) {
+ if (!supported_format_array[i].keyExists("protocol") ||
+ !supported_format_array[i].keyExists("codec")) {
+ continue;
+ }
+
+ std::map<std::string,
+ hmi_apis::Common_VideoStreamingProtocol::eType>::
+ const_iterator it_protocol =
+ video_streaming_protocol_enum.find(
+ supported_format_array[i]["protocol"].asString());
+
+ std::map<std::string,
+ hmi_apis::Common_VideoStreamingCodec::eType>::
+ const_iterator it_codec = video_streaming_codec_enum.find(
+ supported_format_array[i]["codec"].asString());
+
+ // format is valid only if both protocol and codec are converted
+ // to enum values successfully
+ if (it_protocol != video_streaming_protocol_enum.end() &&
+ it_codec != video_streaming_codec_enum.end()) {
+ smart_objects::SmartObject format_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ format_so["protocol"] = it_protocol->second;
+ format_so["codec"] = it_codec->second;
+ converted_array[j++] = format_so;
+ }
+ }
+ vs_capability_so.erase("supportedFormats");
+ vs_capability_so["supportedFormats"] = converted_array;
+ }
+ set_video_streaming_capability(vs_capability_so);
+ if (!vs_capability_so.empty()) {
+ set_video_streaming_supported(true);
+ }
+ }
+ if (check_existing_json_member(system_capabilities,
+ "remoteControlCapability")) {
+ Json::Value rc_capability =
+ system_capabilities.get("remoteControlCapability", "");
+ smart_objects::SmartObject rc_capability_so;
+ Formatters::CFormatterJsonBase::jsonValueToObj(rc_capability,
+ rc_capability_so);
+ set_rc_capability(rc_capability_so);
+ if (!rc_capability_so.empty()) {
+ set_rc_supported(true);
+ }
+ }
+ }
} // UI end
// VR
@@ -995,8 +1218,14 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
}
if (check_existing_json_member(tts, "capabilities")) {
- set_speech_capabilities(
- smart_objects::SmartObject(tts.get("capabilities", "").asString()));
+ Json::Value capabilities = tts.get("capabilities", "");
+ smart_objects::SmartObject tts_capabilities_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (uint32_t i = 0; i < capabilities.size(); ++i) {
+ tts_capabilities_so[i] =
+ tts_enum_capabilities.find(capabilities[i].asString())->second;
+ }
+ set_speech_capabilities(tts_capabilities_so);
}
} // TTS end
@@ -1040,7 +1269,6 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() {
vehicle_type_so);
set_vehicle_type(vehicle_type_so);
} // VehicleType end
-
} catch (...) {
return false;
}
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
index 67625fde88..a7f3ce7e6b 100644
--- a/src/components/application_manager/src/hmi_command_factory.cc
+++ b/src/components/application_manager/src/hmi_command_factory.cc
@@ -2,6 +2,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017 Xevo Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -13,7 +16,7 @@
disclaimer in the documentation and/or other materials provided with the
distribution.
- Neither the name of the Ford Motor Company nor the names of its contributors
+ Neither the name of the copyright holders nor the names of their contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
@@ -157,6 +160,11 @@
#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
#include "application_manager/commands/hmi/on_event_changed_notification.h"
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "application_manager/commands/hmi/decrypt_certificate_request.h"
+#include "application_manager/commands/hmi/decrypt_certificate_response.h"
+#endif // EXTERNAL_PROPRIETARY_MODE
+
#ifdef HMI_DBUS_API
#include "application_manager/commands/hmi/vi_get_vehicle_data_request_template.h"
#include "application_manager/commands/hmi/vi_get_vehicle_data_response_template.h"
@@ -241,6 +249,8 @@
#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "application_manager/commands/hmi/navi_set_video_config_request.h"
+#include "application_manager/commands/hmi/navi_set_video_config_response.h"
#include "application_manager/commands/hmi/navi_start_stream_request.h"
#include "application_manager/commands/hmi/navi_start_stream_response.h"
#include "application_manager/commands/hmi/navi_stop_stream_request.h"
@@ -259,6 +269,7 @@
#include "application_manager/commands/hmi/on_system_error_notification.h"
#include "application_manager/commands/hmi/basic_communication_system_request.h"
#include "application_manager/commands/hmi/basic_communication_system_response.h"
+#include "application_manager/commands/hmi/basic_communication_on_awake_sdl.h"
#include "application_manager/commands/hmi/sdl_policy_update.h"
#include "application_manager/commands/hmi/sdl_policy_update_response.h"
#include "application_manager/commands/hmi/on_received_policy_update.h"
@@ -271,6 +282,13 @@
#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
#include "application_manager/commands/hmi/dial_number_request.h"
#include "application_manager/commands/hmi/dial_number_response.h"
+#include "application_manager/commands/hmi/ui_send_haptic_data_request.h"
+#include "application_manager/commands/hmi/ui_send_haptic_data_response.h"
+
+#include "application_manager/commands/hmi/rc_is_ready_request.h"
+#include "application_manager/commands/hmi/rc_is_ready_response.h"
+#include "application_manager/commands/hmi/rc_get_capabilities_request.h"
+#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
namespace application_manager {
@@ -328,6 +346,18 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
}
break;
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ case hmi_apis::FunctionID::BasicCommunication_DecryptCertificate: {
+ if (is_response) {
+ command.reset(new commands::DecryptCertificateResponse(
+ message, application_manager));
+ } else {
+ command.reset(new commands::DecryptCertificateRequest(
+ message, application_manager));
+ }
+ break;
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: {
if (is_response) {
command.reset(
@@ -752,6 +782,11 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
message, application_manager));
break;
}
+ case hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL: {
+ command.reset(
+ new commands::OnAwakeSDLNotification(message, application_manager));
+ break;
+ }
case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: {
command.reset(new commands::OnExitApplicationNotification(
message, application_manager));
@@ -2061,6 +2096,16 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
message, application_manager));
break;
}
+ case hmi_apis::FunctionID::Navigation_SetVideoConfig: {
+ if (is_response) {
+ command.reset(new commands::NaviSetVideoConfigResponse(
+ message, application_manager));
+ } else {
+ command.reset(new commands::NaviSetVideoConfigRequest(
+ message, application_manager));
+ }
+ break;
+ }
case hmi_apis::FunctionID::Navigation_StartStream: {
if (is_response) {
command.reset(new commands::NaviStartStreamResponse(
@@ -2235,6 +2280,36 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
message, application_manager));
break;
}
+ case hmi_apis::FunctionID::RC_IsReady: {
+ if (is_response) {
+ command.reset(
+ new commands::RCIsReadyResponse(message, application_manager));
+ } else {
+ command.reset(
+ new commands::RCIsReadyRequest(message, application_manager));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::RC_GetCapabilities: {
+ if (is_response) {
+ command.reset(new commands::RCGetCapabilitiesResponse(
+ message, application_manager));
+ } else {
+ command.reset(new commands::RCGetCapabilitiesRequest(
+ message, application_manager));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::UI_SendHapticData: {
+ if (is_response) {
+ command.reset(new commands::UISendHapticDataResponse(
+ message, application_manager));
+ } else {
+ command.reset(new commands::UISendHapticDataRequest(
+ message, application_manager));
+ }
+ break;
+ }
}
return command;
}
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index 5665d0654a..4479665f64 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -2,6 +2,9 @@
* Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
@@ -13,7 +16,7 @@
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
- * Neither the name of the Ford Motor Company nor the names of its contributors
+ * Neither the name of the copyright holders nor the names of their contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -48,10 +51,6 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnUpdateDeviceList] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
- convert_map[BasicCommunication_OnPhoneCall] =
- HmiInterfaces::HMI_INTERFACE_BasicCommunication;
- convert_map[BasicCommunication_OnEmergencyEvent] =
- HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnResumeAudioSource] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnSDLPersistenceComplete] =
@@ -104,8 +103,6 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnIgnitionCycleOver] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
- convert_map[BasicCommunication_OnDeactivateHMI] =
- HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[BasicCommunication_OnEventChanged] =
HmiInterfaces::HMI_INTERFACE_BasicCommunication;
convert_map[VR_IsReady] = HmiInterfaces::HMI_INTERFACE_VR;
@@ -161,6 +158,7 @@ generate_function_to_interface_convert_map() {
convert_map[UI_IsReady] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_ClosePopUp] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[UI_OnResetTimeout] = HmiInterfaces::HMI_INTERFACE_UI;
+ convert_map[UI_SendHapticData] = HmiInterfaces::HMI_INTERFACE_UI;
convert_map[Navigation_IsReady] = HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_SendLocation] =
HmiInterfaces::HMI_INTERFACE_Navigation;
@@ -172,6 +170,8 @@ generate_function_to_interface_convert_map() {
HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_OnTBTClientState] =
HmiInterfaces::HMI_INTERFACE_Navigation;
+ convert_map[Navigation_SetVideoConfig] =
+ HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_StartStream] = HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_StopStream] = HmiInterfaces::HMI_INTERFACE_Navigation;
convert_map[Navigation_StartAudioStream] =
@@ -220,6 +220,8 @@ generate_function_to_interface_convert_map() {
convert_map[SDL_OnSystemError] = HmiInterfaces::HMI_INTERFACE_SDL;
convert_map[SDL_AddStatisticsInfo] = HmiInterfaces::HMI_INTERFACE_SDL;
convert_map[SDL_GetURLS] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[RC_IsReady] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_RC;
return convert_map;
}
@@ -241,6 +243,8 @@ HmiInterfacesImpl::HmiInterfacesImpl() {
HmiInterfaces::STATE_NOT_RESPONSE;
interfaces_states_[HmiInterfaces::HMI_INTERFACE_VR] =
HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_RC] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
}
HmiInterfaces::InterfaceState HmiInterfacesImpl::GetInterfaceState(
diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc
index d37467ee76..4e5390a1b4 100644
--- a/src/components/application_manager/src/hmi_language_handler.cc
+++ b/src/components/application_manager/src/hmi_language_handler.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
#include "application_manager/hmi_capabilities.h"
#include "utils/helpers.h"
#include "resumption/last_state.h"
+#include "smart_objects/smart_object.h"
static const std::string LanguagesKey = "Languages";
static const std::string UIKey = "UI";
@@ -79,7 +80,8 @@ void HMILanguageHandler::set_language_for(
LOG4CXX_DEBUG(logger_,
"Setting language " << language << " for interface "
<< interface);
- last_state_->dictionary[LanguagesKey][key] = language;
+ Json::Value& dictionary = last_state_->get_dictionary();
+ dictionary[LanguagesKey][key] = language;
return;
}
@@ -104,10 +106,11 @@ hmi_apis::Common_Language::eType HMILanguageHandler::get_language_for(
return Common_Language::INVALID_ENUM;
}
- if (last_state_->dictionary.isMember(LanguagesKey)) {
- if (last_state_->dictionary[LanguagesKey].isMember(key)) {
+ const Json::Value& dictionary = last_state_->get_dictionary();
+ if (dictionary.isMember(LanguagesKey)) {
+ if (dictionary[LanguagesKey].isMember(key)) {
Common_Language::eType language = static_cast<Common_Language::eType>(
- last_state_->dictionary[LanguagesKey][key].asInt());
+ dictionary[LanguagesKey][key].asInt());
return language;
}
}
@@ -150,7 +153,7 @@ void HMILanguageHandler::on_event(const event_engine::Event& event) {
}
void HMILanguageHandler::set_handle_response_for(
- const event_engine::smart_objects::SmartObject& request) {
+ const smart_objects::SmartObject& request) {
LOG4CXX_AUTO_TRACE(logger_);
using namespace helpers;
if (!request.keyExists(strings::params)) {
diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc
index 80628f9f33..bc1ccd8f42 100644
--- a/src/components/application_manager/src/hmi_state.cc
+++ b/src/components/application_manager/src/hmi_state.cc
@@ -1,3 +1,4 @@
+
/*
* Copyright (c) 2015, Ford Motor Company
* All rights reserved.
@@ -36,42 +37,65 @@
namespace application_manager {
-HmiState::HmiState(uint32_t app_id,
+HmiState::HmiState(utils::SharedPtr<Application> app,
const ApplicationManager& app_mngr,
StateID state_id)
- : app_id_(app_id)
+ : app_(app)
, state_id_(state_id)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
, system_context_(mobile_apis::SystemContext::INVALID_ENUM) {}
-HmiState::HmiState(uint32_t app_id, const ApplicationManager& app_mngr)
- : app_id_(app_id)
+HmiState::HmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr)
+ : app_(app)
, state_id_(STATE_ID_REGULAR)
, app_mngr_(app_mngr)
, hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
, audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
, system_context_(mobile_apis::SystemContext::INVALID_ENUM) {}
+DEPRECATED HmiState::HmiState(uint32_t app_id,
+ const ApplicationManager& app_mngr,
+ StateID state_id)
+ : state_id_(state_id)
+ , app_mngr_(app_mngr)
+ , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
+ , audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
+ , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
+ app_ = app_mngr_.application(app_id);
+}
+
+DEPRECATED HmiState::HmiState(uint32_t app_id,
+ const ApplicationManager& app_mngr)
+ : state_id_(STATE_ID_REGULAR)
+ , app_mngr_(app_mngr)
+ , hmi_level_(mobile_apis::HMILevel::INVALID_ENUM)
+ , audio_streaming_state_(mobile_apis::AudioStreamingState::INVALID_ENUM)
+ , system_context_(mobile_apis::SystemContext::INVALID_ENUM) {
+ app_ = app_mngr_.application(app_id);
+}
+
void HmiState::set_parent(HmiStatePtr parent) {
DCHECK_OR_RETURN_VOID(parent);
parent_ = parent;
}
-bool HmiState::is_navi_app(const uint32_t app_id) const {
- const ApplicationSharedPtr app = app_mngr_.application(app_id);
- return app ? app->is_navi() : false;
+bool HmiState::is_navi_app() const {
+ return app_->is_navi();
}
-bool HmiState::is_media_app(const uint32_t app_id) const {
- const ApplicationSharedPtr app = app_mngr_.application(app_id);
- return app ? app->is_media_application() : false;
+bool HmiState::is_media_app() const {
+ return app_->is_media_application();
}
-bool HmiState::is_voice_communication_app(const uint32_t app_id) const {
- const ApplicationSharedPtr app = app_mngr_.application(app_id);
- return app ? app->is_voice_communication_supported() : false;
+bool HmiState::is_voice_communication_app() const {
+ return app_->is_voice_communication_supported();
+}
+
+bool HmiState::is_mobile_projection_app() const {
+ return app_->mobile_projection_enabled();
}
mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
@@ -80,10 +104,20 @@ mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state()
return AudioStreamingState::NOT_AUDIBLE;
}
-VRHmiState::VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr)
+VRHmiState::VRHmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_VR_SESSION) {}
+
+DEPRECATED VRHmiState::VRHmiState(uint32_t app_id,
+ const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_VR_SESSION) {}
-TTSHmiState::TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr)
+TTSHmiState::TTSHmiState(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_TTS_SESSION) {}
+
+DEPRECATED TTSHmiState::TTSHmiState(uint32_t app_id,
+ const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_TTS_SESSION) {}
mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
@@ -101,8 +135,12 @@ mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state()
return expected_state;
}
-NaviStreamingHmiState::NaviStreamingHmiState(uint32_t app_id,
+NaviStreamingHmiState::NaviStreamingHmiState(utils::SharedPtr<Application> app,
const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_NAVI_STREAMING) {}
+
+DEPRECATED NaviStreamingHmiState::NaviStreamingHmiState(
+ uint32_t app_id, const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_NAVI_STREAMING) {}
mobile_apis::AudioStreamingState::eType
@@ -111,7 +149,7 @@ NaviStreamingHmiState::audio_streaming_state() const {
using namespace mobile_apis;
AudioStreamingState::eType expected_state = parent()->audio_streaming_state();
- if (!is_navi_app(app_id_) && AudioStreamingState::AUDIBLE == expected_state) {
+ if (!is_navi_app() && AudioStreamingState::AUDIBLE == expected_state) {
if (app_mngr_.is_attenuated_supported()) {
expected_state = AudioStreamingState::ATTENUATED;
} else {
@@ -121,8 +159,12 @@ NaviStreamingHmiState::audio_streaming_state() const {
return expected_state;
}
-PhoneCallHmiState::PhoneCallHmiState(uint32_t app_id,
+PhoneCallHmiState::PhoneCallHmiState(utils::SharedPtr<Application> app,
const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_PHONE_CALL) {}
+
+DEPRECATED PhoneCallHmiState::PhoneCallHmiState(
+ uint32_t app_id, const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_PHONE_CALL) {}
mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
@@ -133,21 +175,29 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
- if (is_navi_app(app_id_)) {
+ if (is_navi_app() || is_mobile_projection_app()) {
return HMILevel::HMI_LIMITED;
}
- if (!is_media_app(app_id_)) {
+ if (!is_media_app()) {
return parent()->hmi_level();
}
return HMILevel::HMI_BACKGROUND;
}
-SafetyModeHmiState::SafetyModeHmiState(uint32_t app_id,
+SafetyModeHmiState::SafetyModeHmiState(utils::SharedPtr<Application> app,
const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_SAFETY_MODE) {}
+
+DEPRECATED SafetyModeHmiState::SafetyModeHmiState(
+ uint32_t app_id, const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_SAFETY_MODE) {}
-DeactivateHMI::DeactivateHMI(uint32_t app_id,
+DeactivateHMI::DeactivateHMI(utils::SharedPtr<Application> app,
const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
+
+DEPRECATED DeactivateHMI::DeactivateHMI(uint32_t app_id,
+ const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_DEACTIVATE_HMI) {}
mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
@@ -161,7 +211,12 @@ mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const {
return HMILevel::HMI_BACKGROUND;
}
-AudioSource::AudioSource(uint32_t app_id, const ApplicationManager& app_mngr)
+AudioSource::AudioSource(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE) {}
+
+DEPRECATED AudioSource::AudioSource(uint32_t app_id,
+ const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_AUDIO_SOURCE) {}
mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
@@ -175,13 +230,18 @@ mobile_apis::HMILevel::eType AudioSource::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
- if (is_navi_app(app_id_)) {
+ if (is_navi_app() || is_voice_communication_app()) {
return HMILevel::HMI_LIMITED;
}
return HMILevel::HMI_BACKGROUND;
}
-EmbeddedNavi::EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr)
+EmbeddedNavi::EmbeddedNavi(utils::SharedPtr<Application> app,
+ const ApplicationManager& app_mngr)
+ : HmiState(app, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
+
+DEPRECATED EmbeddedNavi::EmbeddedNavi(uint32_t app_id,
+ const ApplicationManager& app_mngr)
: HmiState(app_id, app_mngr, STATE_ID_EMBEDDED_NAVI) {}
mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
@@ -192,7 +252,7 @@ mobile_apis::HMILevel::eType EmbeddedNavi::hmi_level() const {
HMILevel::HMI_NONE)) {
return parent()->hmi_level();
}
- if (is_media_app(app_id_)) {
+ if (is_media_app()) {
return HMILevel::HMI_LIMITED;
}
return HMILevel::HMI_BACKGROUND;
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
index a7c887d348..7bc686aef1 100644
--- a/src/components/application_manager/src/message.cc
+++ b/src/components/application_manager/src/message.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,9 +64,20 @@ Message::Message(protocol_handler::MessagePriority priority)
, binary_data_(NULL)
, data_size_(0)
, payload_size_(0)
- , version_(kUnknownProtocol) {}
+ , version_(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN) {}
-Message::Message(const Message& message) : priority_(message.priority_) {
+Message::Message(const Message& message)
+ : function_id_(0)
+ , correlation_id_(0)
+ , type_(kUnknownType)
+ , priority_(message.priority_)
+ , connection_key_(0)
+ , binary_data_(NULL)
+ , data_size_(0)
+ , payload_size_(0)
+ , version_(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN) {
*this = message;
}
@@ -78,7 +89,7 @@ Message& Message::operator=(const Message& message) {
set_data_size(message.data_size_);
set_payload_size(message.payload_size_);
if (message.binary_data_) {
- set_binary_data(message.binary_data_);
+ set_binary_data(static_cast<const BinaryData*>(message.binary_data_));
}
set_json_message(message.json_message_);
set_protocol_version(message.protocol_version());
@@ -87,7 +98,7 @@ Message& Message::operator=(const Message& message) {
return *this;
}
-bool Message::operator==(const Message& message) {
+bool Message::operator==(const Message& message) const {
bool function_id = function_id_ == message.function_id_;
bool correlation_id = correlation_id_ == message.correlation_id_;
bool connection_key = connection_key_ == message.connection_key_;
@@ -96,14 +107,17 @@ bool Message::operator==(const Message& message) {
bool version = version_ == message.version_;
bool data_size = data_size_ == message.data_size_;
bool payload_size = payload_size_ == message.payload_size_;
-
- bool binary_data = std::equal(binary_data_->begin(),
- binary_data_->end(),
- message.binary_data_->begin(),
- BinaryDataPredicate);
+ bool binary_data_available = true;
+ if (binary_data_) {
+ binary_data_available = std::equal(binary_data_->begin(),
+ binary_data_->end(),
+ message.binary_data_->begin(),
+ BinaryDataPredicate);
+ }
return function_id && correlation_id && connection_key && type &&
- binary_data && json_message && version && data_size && payload_size;
+ binary_data_available && json_message && version && data_size &&
+ payload_size;
}
Message::~Message() {
@@ -116,6 +130,12 @@ int32_t Message::function_id() const {
return function_id_;
}
+#ifdef SDL_REMOTE_CONTROL
+std::string Message::function_name() const {
+ return function_name_;
+}
+#endif // SDL_REMOTE_CONTROL
+
int32_t Message::correlation_id() const {
return correlation_id_;
}
@@ -128,7 +148,7 @@ MessageType Message::type() const {
return type_;
}
-ProtocolVersion Message::protocol_version() const {
+protocol_handler::MajorProtocolVersion Message::protocol_version() const {
return version_;
}
@@ -156,6 +176,12 @@ void Message::set_function_id(int32_t id) {
function_id_ = id;
}
+#ifdef SDL_REMOTE_CONTROL
+void Message::set_function_name(const std::string& name) {
+ function_name_ = name;
+}
+#endif // SDL_REMOTE_CONTROL
+
void Message::set_correlation_id(int32_t id) {
correlation_id_ = id;
}
@@ -178,14 +204,28 @@ void Message::set_binary_data(BinaryData* data) {
delete binary_data_;
}
- binary_data_ = data;
+ binary_data_ = new BinaryData(*data);
+}
+
+void Message::set_binary_data(const BinaryData* data) {
+ if (NULL == data) {
+ NOTREACHED();
+ return;
+ }
+
+ if (binary_data_) {
+ delete binary_data_;
+ }
+
+ binary_data_ = new BinaryData(*data);
}
void Message::set_json_message(const std::string& json_message) {
json_message_ = json_message;
}
-void Message::set_protocol_version(ProtocolVersion version) {
+void Message::set_protocol_version(
+ protocol_handler::MajorProtocolVersion version) {
version_ = version;
}
@@ -204,4 +244,11 @@ void Message::set_data_size(size_t data_size) {
void Message::set_payload_size(size_t payload_size) {
payload_size_ = payload_size;
}
+
+bool Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion minVersion,
+ protocol_handler::MajorProtocolVersion version) {
+ return version >= minVersion &&
+ version <= protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5;
+}
} // namespace application_manager
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index a764c574d0..61012224b6 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -2,6 +2,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017, Livio, Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -38,9 +41,11 @@
#include <set>
#include <string>
+#include <strings.h>
#include <algorithm>
#include <utility>
#include <map>
+#include <functional>
#include "application_manager/application.h"
#include "application_manager/application_manager.h"
@@ -69,6 +74,8 @@ namespace {
typedef std::map<std::string, hmi_apis::Common_AppPriority::eType>
CommonAppPriorityMap;
+typedef std::vector<policy::FunctionalGroupPermission> PermissionsList;
+
CommonAppPriorityMap app_priority_values = {
{"NORMAL", hmi_apis::Common_AppPriority::NORMAL},
{"COMMUNICATION", hmi_apis::Common_AppPriority::COMMUNICATION},
@@ -96,41 +103,119 @@ bool ValidateSoftButtons(smart_objects::SmartObject& soft_buttons) {
}
}
return true;
-} // namespace
}
-std::pair<std::string, VehicleDataType> kVehicleDataInitializer[] = {
- std::make_pair(strings::gps, VehicleDataType::GPS),
- std::make_pair(strings::speed, VehicleDataType::SPEED),
- std::make_pair(strings::rpm, VehicleDataType::RPM),
- std::make_pair(strings::fuel_level, VehicleDataType::FUELLEVEL),
- std::make_pair(strings::fuel_level_state, VehicleDataType::FUELLEVEL_STATE),
+
+struct GroupsAppender
+ : std::unary_function<void, const PermissionsList::value_type&> {
+ GroupsAppender(smart_objects::SmartObject& groups)
+ : groups_(groups), index_(0) {}
+
+ void operator()(const PermissionsList::value_type& item) {
+ using namespace smart_objects;
+ using namespace policy;
+ groups_[index_] = SmartObject(SmartType_Map);
+
+ SmartObject& group = groups_[index_];
+ group[strings::name] = item.group_alias;
+ group[strings::id] = item.group_id;
+ GroupConsent permission_state = item.state;
+ // If state undefined, 'allowed' parameter should be absent
+ if (kGroupUndefined != permission_state) {
+ group["allowed"] = kGroupAllowed == permission_state;
+ }
+ ++index_;
+ }
+
+ private:
+ smart_objects::SmartObject& groups_;
+ int32_t index_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+struct ExternalConsentStatusAppender
+ : std::unary_function<void,
+ const policy::ExternalConsentStatus::value_type&> {
+ ExternalConsentStatusAppender(smart_objects::SmartObject& status)
+ : status_(status), index_(0) {}
+
+ void operator()(const policy::ExternalConsentStatus::value_type& item) {
+ using namespace smart_objects;
+ using namespace policy;
+ using namespace hmi_apis;
+ status_[index_] = SmartObject(SmartType_Map);
+
+ SmartObject& external_consent_status = status_[index_];
+ external_consent_status[strings::entity_type] = item.entity_type_;
+ external_consent_status[strings::entity_id] = item.entity_id_;
+ external_consent_status[strings::status] =
+ policy::kStatusOn == item.status_
+ ? static_cast<int32_t>(Common_EntityStatus::ON)
+ : static_cast<int32_t>(Common_EntityStatus::OFF);
+ ++index_;
+ }
+
+ private:
+ smart_objects::SmartObject& status_;
+ int32_t index_;
+};
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+} // namespace
+
+std::pair<std::string,
+ mobile_apis::VehicleDataType::eType> kVehicleDataInitializer[] = {
+ std::make_pair(strings::gps, mobile_apis::VehicleDataType::VEHICLEDATA_GPS),
+ std::make_pair(strings::speed,
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED),
+ std::make_pair(strings::rpm, mobile_apis::VehicleDataType::VEHICLEDATA_RPM),
+ std::make_pair(strings::fuel_level,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL),
+ std::make_pair(strings::fuel_level_state,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL_STATE),
std::make_pair(strings::instant_fuel_consumption,
- VehicleDataType::FUELCONSUMPTION),
- std::make_pair(strings::external_temp, VehicleDataType::EXTERNTEMP),
- std::make_pair(strings::vin, VehicleDataType::VIN),
- std::make_pair(strings::prndl, VehicleDataType::PRNDL),
- std::make_pair(strings::tire_pressure, VehicleDataType::TIREPRESSURE),
- std::make_pair(strings::odometer, VehicleDataType::ODOMETER),
- std::make_pair(strings::belt_status, VehicleDataType::BELTSTATUS),
- std::make_pair(strings::body_information, VehicleDataType::BODYINFO),
- std::make_pair(strings::device_status, VehicleDataType::DEVICESTATUS),
- std::make_pair(strings::driver_braking, VehicleDataType::BRAKING),
- std::make_pair(strings::wiper_status, VehicleDataType::WIPERSTATUS),
- std::make_pair(strings::head_lamp_status, VehicleDataType::HEADLAMPSTATUS),
- std::make_pair(strings::e_call_info, VehicleDataType::ECALLINFO),
- std::make_pair(strings::airbag_status, VehicleDataType::AIRBAGSTATUS),
- std::make_pair(strings::emergency_event, VehicleDataType::EMERGENCYEVENT),
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELCONSUMPTION),
+ std::make_pair(strings::external_temp,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EXTERNTEMP),
+ std::make_pair(strings::vin, mobile_apis::VehicleDataType::VEHICLEDATA_VIN),
+ std::make_pair(strings::prndl,
+ mobile_apis::VehicleDataType::VEHICLEDATA_PRNDL),
+ std::make_pair(strings::tire_pressure,
+ mobile_apis::VehicleDataType::VEHICLEDATA_TIREPRESSURE),
+ std::make_pair(strings::odometer,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ODOMETER),
+ std::make_pair(strings::belt_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BELTSTATUS),
+ std::make_pair(strings::body_information,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BODYINFO),
+ std::make_pair(strings::device_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_DEVICESTATUS),
+ std::make_pair(strings::driver_braking,
+ mobile_apis::VehicleDataType::VEHICLEDATA_BRAKING),
+ std::make_pair(strings::wiper_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_WIPERSTATUS),
+ std::make_pair(strings::head_lamp_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_HEADLAMPSTATUS),
+ std::make_pair(strings::e_call_info,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ECALLINFO),
+ std::make_pair(strings::airbag_status,
+ mobile_apis::VehicleDataType::VEHICLEDATA_AIRBAGSTATUS),
+ std::make_pair(strings::emergency_event,
+ mobile_apis::VehicleDataType::VEHICLEDATA_EMERGENCYEVENT),
std::make_pair(strings::cluster_mode_status,
- VehicleDataType::CLUSTERMODESTATUS),
- std::make_pair(strings::my_key, VehicleDataType::MYKEY),
+ mobile_apis::VehicleDataType::VEHICLEDATA_CLUSTERMODESTATUS),
+ std::make_pair(strings::my_key,
+ mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY),
/*
NOT DEFINED in mobile API
- std::make_pair(strings::gps, VehicleDataType::BATTVOLTAGE),
+ std::make_pair(strings::gps,
+ BATTVOLTAGE),
*/
- std::make_pair(strings::engine_torque, VehicleDataType::ENGINETORQUE),
- std::make_pair(strings::acc_pedal_pos, VehicleDataType::ACCPEDAL),
+ std::make_pair(strings::engine_torque,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ENGINETORQUE),
+ std::make_pair(strings::acc_pedal_pos,
+ mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL),
std::make_pair(strings::steering_wheel_angle,
- VehicleDataType::STEERINGWHEEL),
+ mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL),
};
const VehicleData MessageHelper::vehicle_data_(
@@ -198,17 +283,6 @@ const uint32_t MessageHelper::GetPriorityCode(const std::string& priority) {
return static_cast<uint32_t>(hmi_apis::Common_AppPriority::INVALID_ENUM);
}
-std::string MessageHelper::CommonLanguageToString(
- hmi_apis::Common_Language::eType language) {
- 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;
@@ -220,21 +294,40 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(
return hmi_apis::Common_Language::INVALID_ENUM;
}
-smart_objects::SmartObjectSPtr MessageHelper::CreateRequestObject(
- const uint32_t correlation_id) {
+std::string MessageHelper::GetDeviceMacAddressForHandle(
+ const uint32_t device_handle, const ApplicationManager& app_mngr) {
+ std::string device_mac_address = "";
+ app_mngr.connection_handler().get_session_observer().GetDataOnDeviceID(
+ device_handle, NULL, NULL, &device_mac_address);
+ LOG4CXX_DEBUG(logger_, "result : " << device_handle);
+ return device_mac_address;
+}
+
+std::string MessageHelper::CommonLanguageToString(
+ hmi_apis::Common_Language::eType language) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ const char* str = 0;
+ if (EnumConversionHelper<hmi_apis::Common_Language::eType>::EnumToCString(
+ language, &str)) {
+ return str ? str : "";
+ }
+ return std::string();
+}
+
+smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI(
+ hmi_apis::messageType::eType message_type, const uint32_t correlation_id) {
using namespace smart_objects;
- SmartObjectSPtr request = utils::MakeShared<SmartObject>(SmartType_Map);
- SmartObject& ref = *request;
+ SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ SmartObject& ref = *message;
- ref[strings::params][strings::message_type] =
- static_cast<int>(hmi_apis::messageType::request);
+ ref[strings::params][strings::message_type] = static_cast<int>(message_type);
ref[strings::params][strings::protocol_version] =
commands::CommandImpl::protocol_version_;
ref[strings::params][strings::protocol_type] =
commands::CommandImpl::hmi_protocol_type_;
ref[strings::params][strings::correlation_id] = correlation_id;
- return request;
+ return message;
}
smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification(
@@ -251,6 +344,25 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification(
return message;
}
+void MessageHelper::SendDecryptCertificateToHMI(const std::string& file_name,
+ ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_DecryptCertificate;
+
+ SmartObject msg_params = SmartObject(SmartType_Map);
+
+ msg_params[hmi_request::file_name] = file_name;
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+}
+
void MessageHelper::SendHashUpdateNotification(const uint32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -291,6 +403,253 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(
return notification;
}
+void MessageHelper::SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(cmd);
+ using namespace smart_objects;
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::cmd_id] = (*cmd)[strings::cmd_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ if ((*cmd).keyExists(strings::menu_params)) {
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+ }
+
+ if ((*cmd).keyExists(strings::vr_commands)) {
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VR_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+ }
+}
+
+void MessageHelper::SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(cmd);
+ using namespace smart_objects;
+
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::menu_id] = (*cmd)[strings::menu_id];
+ msg_params[strings::app_id] = application->app_id();
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_DeleteSubMenu;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+
+ const DataAccessor<CommandsMap> accessor = application->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+ CommandsMap::const_iterator it = commands.begin();
+
+ for (; commands.end() != it; ++it) {
+ if (!(*it->second).keyExists(strings::vr_commands)) {
+ continue;
+ }
+
+ if ((*cmd)[strings::menu_id].asInt() ==
+ (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) {
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt();
+ msg_params[strings::app_id] = application->app_id();
+ msg_params[strings::grammar_id] = application->get_grammar_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command;
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VR_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+ }
+ }
+}
+
+void MessageHelper::SendDeleteChoiceSetRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(cmd);
+ using namespace smart_objects;
+
+ // Same is deleted with SendDeleteCommandRequest?
+
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::app_id] = application->app_id();
+ msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice;
+ msg_params[strings::grammar_id] = (*cmd)[strings::grammar_id];
+ cmd = &((*cmd)[strings::choice_set]);
+ for (uint32_t i = 0; i < (*cmd).length(); ++i) {
+ msg_params[strings::cmd_id] = (*cmd)[i][strings::choice_id];
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VR_DeleteCommand;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+ }
+}
+
+void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using namespace smart_objects;
+
+ {
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params = *MessageHelper::CreateAppVrHelp(application);
+ msg_params[hmi_request::menu_title] = "";
+
+ smart_objects::SmartObject key_board_properties =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ key_board_properties[strings::language] =
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_US);
+ key_board_properties[hmi_request::keyboard_layout] =
+ static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY);
+
+ key_board_properties[hmi_request::auto_complete_text] = "";
+ msg_params[hmi_request::keyboard_properties] = key_board_properties;
+
+ msg_params[strings::app_id] = application->app_id();
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::UI_SetGlobalProperties;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+ }
+
+ {
+ SmartObject msg_params = SmartObject(smart_objects::SmartType_Map);
+
+ msg_params[strings::help_prompt] = application->help_prompt();
+ msg_params[strings::timeout_prompt] = application->timeout_prompt();
+ msg_params[strings::app_id] = application->app_id();
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::TTS_SetGlobalProperties;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+ }
+}
+
+void MessageHelper::SendUnsubscribeButtonNotification(
+ mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ SmartObject msg_params = SmartObject(SmartType_Map);
+ msg_params[strings::app_id] = application->app_id();
+ msg_params[strings::name] = button;
+ msg_params[strings::is_suscribed] = false;
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::notification, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+}
+
+void MessageHelper::SendUnsubscribeIVIRequest(int32_t ivi_id,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+
+ std::string key_name;
+ for (auto item : vehicle_data_) {
+ if (ivi_id == item.second) {
+ key_name = item.first;
+ break;
+ }
+ }
+
+ if (key_name.empty()) {
+ return;
+ }
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[key_name] = true;
+
+ SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ DCHECK(message);
+
+ SmartObject& object = *message;
+ object[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData;
+
+ object[strings::msg_params] = msg_params;
+
+ app_mngr.ManageHMICommand(message);
+}
+
const VehicleData& MessageHelper::vehicle_data() {
return vehicle_data_;
}
@@ -357,6 +716,95 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult(
return HMIResultFromString(result);
}
+#ifdef SDL_REMOTE_CONTROL
+void MessageHelper::SendHMIStatusNotification(
+ const Application& application_impl,
+ ApplicationManager& application_manager) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject;
+ if (!notification) {
+ LOG4CXX_ERROR(logger_, "Failed to create smart object");
+ return;
+ }
+ smart_objects::SmartObject& message = *notification;
+
+ message[strings::params][strings::function_id] =
+ static_cast<int32_t>(mobile_api::FunctionID::OnHMIStatusID);
+
+ message[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ message[strings::params][strings::connection_key] =
+ static_cast<int32_t>(application_impl.app_id());
+
+ message[strings::msg_params][strings::hmi_level] =
+ static_cast<int32_t>(application_impl.hmi_level());
+
+ message[strings::msg_params][strings::audio_streaming_state] =
+ static_cast<int32_t>(application_impl.audio_streaming_state());
+
+ message[strings::msg_params][strings::system_context] =
+ static_cast<int32_t>(application_impl.system_context());
+
+ application_manager.ManageMobileCommand(notification,
+ commands::Command::ORIGIN_SDL);
+}
+
+void MessageHelper::SendActivateAppToHMI(
+ uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority) {
+ application_manager::ApplicationConstSharedPtr app =
+ application_manager.application(app_id);
+ 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_ActivateApp;
+ (*message)[strings::params][strings::message_type] = MessageType::kRequest;
+ (*message)[strings::params][strings::correlation_id] =
+ application_manager.GetNextHMICorrelationID();
+ (*message)[strings::msg_params][strings::app_id] = app_id;
+
+ if (send_policy_priority) {
+ std::string priority;
+ application_manager.GetPolicyHandler().GetPriority(app->policy_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();
+ application_manager.connection_handler()
+ .get_session_observer()
+ .GetDataOnDeviceID(device_handle, NULL, NULL, &mac_adress, NULL);
+
+ policy::DeviceConsent consent =
+ application_manager.GetPolicyHandler().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.
+ if (hmi_apis::Common_HMILevel::INVALID_ENUM != level &&
+ hmi_apis::Common_HMILevel::FULL != level) {
+ (*message)[strings::msg_params][strings::activate_app_hmi_level] = level;
+ }
+
+ application_manager.ManageHMICommand(message);
+}
+#endif // SDL_REMOTE_CONTROL
+
mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
const std::string& hmi_level) {
using namespace NsSmartDeviceLink::NsSmartObjects;
@@ -369,7 +817,7 @@ mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel(
}
std::string MessageHelper::StringifiedHMILevel(
- mobile_apis::HMILevel::eType hmi_level) {
+ const mobile_apis::HMILevel::eType hmi_level) {
using namespace NsSmartDeviceLink::NsSmartObjects;
const char* str = 0;
if (EnumConversionHelper<mobile_apis::HMILevel::eType>::EnumToCString(
@@ -533,8 +981,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse(
(*response)[strings::params][strings::connection_key] = connection_key;
(*response)[strings::params][strings::protocol_type] =
commands::CommandImpl::mobile_protocol_type_;
- (*response)[strings::params][strings::protocol_version] =
- static_cast<int>(kV2);
+ (*response)[strings::params][strings::protocol_version] = static_cast<int>(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2);
return response;
}
@@ -551,9 +999,12 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO(
smart_objects::SmartObject(smart_objects::SmartType_Array);
smart_objects::SmartObject& list_so = (*device_list_so)[strings::device_list];
- int32_t index = 0;
+ uint32_t index = 0;
+ // According to requirements, SDL should send info about 100 devices at
+ // maximum, even if SDL has more devices connected.
+ const uint32_t max_device_count = 100;
for (connection_handler::DeviceMap::const_iterator it = devices.begin();
- devices.end() != it;
+ devices.end() != it && index < max_device_count;
++it) {
const connection_handler::Device& d =
static_cast<connection_handler::Device>(it->second);
@@ -610,6 +1061,11 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon(
bool MessageHelper::SendIVISubscribtions(const uint32_t app_id,
ApplicationManager& app_mngr) {
+ return SendIVISubscriptions(app_id, app_mngr);
+}
+
+bool MessageHelper::SendIVISubscriptions(const uint32_t app_id,
+ ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
bool result = true;
@@ -651,7 +1107,7 @@ smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
const VehicleInfoSubscriptions& subscriptions = vi_accessor.GetData();
for (; vehicle_data.end() != ivi_it; ++ivi_it) {
- uint32_t type_id = static_cast<int>(ivi_it->second);
+ mobile_apis::VehicleDataType::eType type_id = ivi_it->second;
if (subscriptions.end() != subscriptions.find(type_id)) {
std::string key_name = ivi_it->first;
msg_params[key_name] = true;
@@ -672,7 +1128,7 @@ smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests(
if (true == msg_params.keyExists(sr.str) &&
true == msg_params[sr.str].asBool()) {
smart_objects::SmartObjectSPtr request =
- MessageHelper::CreateModuleInfoSO(sr.func_id);
+ MessageHelper::CreateModuleInfoSO(sr.func_id, app_mngr);
(*request)[strings::msg_params] = msg_params;
hmi_requests.push_back(request);
}
@@ -749,7 +1205,9 @@ void MessageHelper::SendSetAppIcon(
using namespace smart_objects;
SmartObjectSPtr set_app_icon =
- CreateRequestObject(application_manager.GetNextHMICorrelationID());
+ CreateMessageForHMI(hmi_apis::messageType::request,
+ application_manager.GetNextHMICorrelationID());
+
if (set_app_icon) {
SmartObject& so_to_send = *set_app_icon;
so_to_send[strings::params][strings::function_id] =
@@ -771,7 +1229,7 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app,
ApplicationManager& app_man) {
LOG4CXX_AUTO_TRACE(logger_);
if (app) {
- SendSetAppIcon(app, app->app_icon_path(), app_man);
+ SendSetAppIcon(app->app_id(), app->app_icon_path(), app_man);
SendGlobalPropertiesToHMI(app, app_man);
SendShowRequestToHMI(app, app_man);
}
@@ -808,7 +1266,7 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
if (app->vr_help_title() || app->vr_help()) {
smart_objects::SmartObjectSPtr ui_global_properties =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!ui_global_properties) {
return requests;
}
@@ -843,7 +1301,7 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI(
// TTS global properties
if (app->help_prompt() || app->timeout_prompt()) {
smart_objects::SmartObjectSPtr tts_global_properties =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!tts_global_properties) {
return requests;
}
@@ -875,8 +1333,9 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app,
if (!app) {
return;
}
- smart_objects::SmartObjectSPtr tts_global_properties =
- CreateRequestObject(app_man.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr tts_global_properties = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_man.GetNextHMICorrelationID());
+
if (tts_global_properties) {
smart_objects::SmartObject& so_to_send = *tts_global_properties;
so_to_send[strings::params][strings::function_id] =
@@ -954,7 +1413,7 @@ smart_objects::SmartObjectList MessageHelper::CreateShowRequestToHMI(
if (app->show_command()) {
smart_objects::SmartObjectSPtr ui_show =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
(*ui_show)[strings::params][strings::function_id] =
static_cast<int>(hmi_apis::FunctionID::UI_Show);
@@ -986,8 +1445,8 @@ void MessageHelper::SendShowConstantTBTRequestToHMI(
}
if (app->tbt_show_command()) {
- smart_objects::SmartObjectSPtr navi_show_tbt =
- CreateRequestObject(app_man.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr navi_show_tbt = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_man.GetNextHMICorrelationID());
if (!navi_show_tbt) {
return;
}
@@ -1027,8 +1486,8 @@ smart_objects::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI(
for (; commands.end() != i; ++i) {
// UI Interface
if ((*i->second).keyExists(strings::menu_params)) {
- smart_objects::SmartObjectSPtr ui_command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr ui_command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!ui_command) {
return requests;
}
@@ -1080,8 +1539,8 @@ MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(
(*(it->second))[strings::grammar_id].asUInt();
const size_t size = (*(it->second))[strings::choice_set].length();
for (size_t j = 0; j < size; ++j) {
- smart_objects::SmartObjectSPtr vr_command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr vr_command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!vr_command) {
return requests;
}
@@ -1114,8 +1573,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration(
const uint32_t app_id,
const smart_objects::SmartObject* app_types,
ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!command) {
return NULL;
}
@@ -1171,8 +1630,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI(
const smart_objects::SmartObject& vr_commands,
uint32_t app_id,
ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr vr_command =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr vr_command = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!vr_command) {
return NULL;
}
@@ -1291,7 +1750,7 @@ smart_objects::SmartObjectList MessageHelper::CreateAddSubMenuRequestToHMI(
SubMenuMap::const_iterator i = sub_menu.begin();
for (; sub_menu.end() != i; ++i) {
smart_objects::SmartObjectSPtr ui_sub_menu =
- CreateRequestObject(correlation_id);
+ CreateMessageForHMI(hmi_apis::messageType::request, correlation_id);
if (!ui_sub_menu) {
return requsets;
}
@@ -1330,7 +1789,7 @@ void MessageHelper::SendOnAppUnregNotificationToHMI(
message[strings::params][strings::message_type] = MessageType::kNotification;
// we put hmi_app_id because applicaton list does not contain application on
// this momment
- // and ReplaceHMIByMobileAppId function will be unable to replace app_id to
+ // and ReplaceHMIWithMobileAppId function will be unable to replace app_id to
// hmi_app_id
message[strings::msg_params][strings::app_id] = app->hmi_app_id();
message[strings::msg_params][strings::unexpected_disconnect] =
@@ -1359,8 +1818,6 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI(
if (send_policy_priority) {
std::string priority;
- // TODO(KKolodiy): need remove method policy_manager
-
policy_handler.GetPriority(app->policy_app_id(), &priority);
// According SDLAQ-CRS-2794
// SDL have to send ActivateApp without "proirity" parameter to HMI.
@@ -1452,8 +1909,9 @@ void MessageHelper::SendSDLActivateAppResponse(
}
// If application is revoked it should not be activated
- if (permissions.appRevoked || !permissions.isSDLAllowed) {
- return;
+ if (permissions.appRevoked) {
+ (*message)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
}
app_mngr.ManageHMICommand(message);
@@ -1478,11 +1936,11 @@ void MessageHelper::SendOnSDLConsentNeeded(
}
void MessageHelper::SendPolicyUpdate(const std::string& file_path,
- const int timeout,
+ const uint32_t timeout,
const std::vector<int>& retries,
ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr message =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
smart_objects::SmartObject& object = *message;
object[strings::params][strings::function_id] =
hmi_apis::FunctionID::BasicCommunication_PolicyUpdate;
@@ -1496,15 +1954,16 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path,
}
app_mngr.ManageHMICommand(message);
}
-
void MessageHelper::SendGetUserFriendlyMessageResponse(
const std::vector<policy::UserFriendlyMessage>& msg,
- uint32_t correlation_id,
+ const uint32_t correlation_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
smart_objects::SmartObjectSPtr message =
- utils::MakeShared<smart_objects::SmartObject>(
- smart_objects::SmartType_Map);
+ new smart_objects::SmartObject(smart_objects::SmartType_Map);
+ if (!message) {
+ return;
+ }
(*message)[strings::params][strings::function_id] =
hmi_apis::FunctionID::SDL_GetUserFriendlyMessage;
@@ -1524,9 +1983,14 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
smart_objects::SmartObject& user_friendly_messages =
(*message)[strings::msg_params][messages];
-
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ 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";
+#endif // EXTERNAL_PROPRIETARY_MODE
const std::string message_code = "messageCode";
-
std::vector<policy::UserFriendlyMessage>::const_iterator it = msg.begin();
std::vector<policy::UserFriendlyMessage>::const_iterator it_end = msg.end();
for (uint32_t index = 0; it != it_end; ++it, ++index) {
@@ -1535,51 +1999,101 @@ void MessageHelper::SendGetUserFriendlyMessageResponse(
smart_objects::SmartObject& obj = user_friendly_messages[index];
obj[message_code] = it->message_code;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ 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;
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
}
app_mngr.ManageHMICommand(message);
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
void MessageHelper::SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
- const uint32_t correlation_id,
+ const policy::ExternalConsentStatus& external_consent_status,
+ uint32_t correlation_id,
ApplicationManager& app_mngr) {
- smart_objects::SmartObject message(smart_objects::SmartType_Map);
+ using namespace smart_objects;
+ using namespace hmi_apis;
- message[strings::params][strings::function_id] =
- hmi_apis::FunctionID::SDL_GetListOfPermissions;
- message[strings::params][strings::message_type] = MessageType::kResponse;
- message[strings::params][strings::correlation_id] = correlation_id;
- message[strings::params][hmi_response::code] = 0;
+ SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ DCHECK_OR_RETURN_VOID(message);
+
+ SmartObject& params = (*message)[strings::params];
+
+ params[strings::function_id] = FunctionID::SDL_GetListOfPermissions;
+ params[strings::message_type] = MessageType::kResponse;
+ params[strings::correlation_id] = correlation_id;
+ params[hmi_response::code] = static_cast<int32_t>(Common_Result::SUCCESS);
+
+ SmartObject& msg_params = (*message)[strings::msg_params];
const std::string allowed_functions = "allowedFunctions";
- message[strings::msg_params][allowed_functions] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params[allowed_functions] = SmartObject(SmartType_Array);
- smart_objects::SmartObject& allowed_functions_array =
- message[strings::msg_params][allowed_functions];
+ SmartObject& allowed_functions_array = msg_params[allowed_functions];
- std::vector<policy::FunctionalGroupPermission>::const_iterator it =
- permissions.begin();
- std::vector<policy::FunctionalGroupPermission>::const_iterator it_end =
- permissions.end();
- for (uint32_t index = 0; it != it_end; ++it, ++index) {
- allowed_functions_array[index] =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
+ GroupsAppender groups_appender(allowed_functions_array);
+ std::for_each(permissions.begin(), permissions.end(), groups_appender);
- smart_objects::SmartObject& item = allowed_functions_array[index];
- item[strings::name] = (*it).group_alias;
- item[strings::id] = (*it).group_id;
- policy::GroupConsent permission_state = (*it).state;
- // If state undefined, 'allowed' parameter should be absent
- if (policy::kGroupUndefined != permission_state) {
- item["allowed"] = policy::kGroupAllowed == permission_state;
- }
- }
+ const std::string external_consent_status_key = "externalConsentStatus";
+ msg_params[external_consent_status_key] = SmartObject(SmartType_Array);
- app_mngr.ManageHMICommand(
- utils::MakeShared<smart_objects::SmartObject>(message));
+ SmartObject& external_consent_status_array =
+ msg_params[external_consent_status_key];
+
+ ExternalConsentStatusAppender external_consent_status_appender(
+ external_consent_status_array);
+ std::for_each(external_consent_status.begin(),
+ external_consent_status.end(),
+ external_consent_status_appender);
+
+ app_mngr.ManageHMICommand(message);
}
+#else
+void MessageHelper::SendGetListOfPermissionsResponse(
+ const std::vector<policy::FunctionalGroupPermission>& permissions,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr) {
+ using namespace smart_objects;
+ using namespace hmi_apis;
+
+ SmartObjectSPtr message = utils::MakeShared<SmartObject>(SmartType_Map);
+ DCHECK_OR_RETURN_VOID(message);
+
+ SmartObject& params = (*message)[strings::params];
+
+ params[strings::function_id] = FunctionID::SDL_GetListOfPermissions;
+ params[strings::message_type] = MessageType::kResponse;
+ params[strings::correlation_id] = correlation_id;
+ params[hmi_response::code] = static_cast<int32_t>(Common_Result::SUCCESS);
+
+ SmartObject& msg_params = (*message)[strings::msg_params];
+
+ const std::string allowed_functions = "allowedFunctions";
+ msg_params[allowed_functions] = SmartObject(SmartType_Array);
+
+ SmartObject& allowed_functions_array = msg_params[allowed_functions];
+
+ GroupsAppender groups_appender(allowed_functions_array);
+ std::for_each(permissions.begin(), permissions.end(), groups_appender);
+ app_mngr.ManageHMICommand(message);
+}
+#endif // EXTERNAL_PROPRIETARY_MODE
smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
uint32_t connection_key,
@@ -1602,11 +2116,31 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse(
return utils::MakeShared<smart_objects::SmartObject>(response_data);
}
+void MessageHelper::SendNaviSetVideoConfig(
+ int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObjectSPtr request = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
+ if (!request) {
+ return;
+ }
+
+ (*request)[strings::params][strings::function_id] =
+ hmi_apis::FunctionID::Navigation_SetVideoConfig;
+
+ (*request)[strings::msg_params][strings::app_id] = app_id;
+ (*request)[strings::msg_params][strings::config] = video_params;
+
+ app_mngr.ManageHMICommand(request);
+}
+
void MessageHelper::SendNaviStartStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr start_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr start_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!start_stream) {
return;
}
@@ -1644,8 +2178,8 @@ void MessageHelper::SendNaviStartStream(const int32_t app_id,
void MessageHelper::SendNaviStopStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr stop_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr stop_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!stop_stream) {
return;
}
@@ -1661,8 +2195,8 @@ void MessageHelper::SendNaviStopStream(const int32_t app_id,
void MessageHelper::SendAudioStartStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr start_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr start_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!start_stream) {
return;
@@ -1701,8 +2235,8 @@ void MessageHelper::SendAudioStartStream(const int32_t app_id,
void MessageHelper::SendAudioStopStream(const int32_t app_id,
ApplicationManager& app_mngr) {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObjectSPtr stop_stream =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr stop_stream = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!stop_stream) {
return;
@@ -1751,8 +2285,8 @@ void MessageHelper::SendOnDataStreaming(
bool MessageHelper::SendStopAudioPathThru(ApplicationManager& app_mngr) {
LOG4CXX_INFO(logger_, "MessageHelper::SendAudioStopAudioPathThru");
- smart_objects::SmartObjectSPtr result =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr result = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
(*result)[strings::params][strings::function_id] =
hmi_apis::FunctionID::UI_EndAudioPassThru;
@@ -1763,8 +2297,8 @@ bool MessageHelper::SendStopAudioPathThru(ApplicationManager& app_mngr) {
bool MessageHelper::SendUnsubscribedWayPoints(ApplicationManager& app_mngr) {
LOG4CXX_INFO(logger_, "MessageHelper::SendUnsubscribedWayPoints");
- smart_objects::SmartObjectSPtr result =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr result = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
(*result)[strings::params][strings::function_id] =
hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints;
@@ -1786,12 +2320,15 @@ void MessageHelper::SendPolicySnapshotNotification(
LOG4CXX_WARN(logger_, "No service URLs");
}
- content[strings::msg_params][strings::request_type] =
- mobile_apis::RequestType::PROPRIETARY;
content[strings::params][strings::binary_data] =
smart_objects::SmartObject(policy_data);
- content[strings::msg_params][strings::file_type] =
- mobile_apis::FileType::BINARY;
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ content[strings::msg_params][strings::request_type] =
+ mobile_apis::RequestType::PROPRIETARY;
+#else
+ content[strings::msg_params][strings::request_type] =
+ mobile_apis::RequestType::HTTP;
+#endif // PROPRIETARY || EXTERNAL_PROPRIETARY_MODE
SendSystemRequestNotification(connection_key, content, app_mngr);
}
@@ -1845,16 +2382,14 @@ void MessageHelper::SendQueryApps(const uint32_t connection_key,
policy::PolicyHandlerInterface& policy_handler = app_mngr.GetPolicyHandler();
+ const uint32_t timeout = policy_handler.TimeoutExchangeSec();
smart_objects::SmartObject content(smart_objects::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();
+ content[strings::msg_params][strings::timeout] = timeout;
Json::Value http_header;
- 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;
@@ -2122,8 +2657,8 @@ void MessageHelper::SendOnStatusUpdate(const std::string& status,
}
void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) {
- smart_objects::SmartObjectSPtr message =
- CreateRequestObject(app_mngr.GetNextHMICorrelationID());
+ smart_objects::SmartObjectSPtr message = CreateMessageForHMI(
+ hmi_apis::messageType::request, app_mngr.GetNextHMICorrelationID());
if (!message) {
return;
}
@@ -2179,7 +2714,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles(
return mobile_apis::Result::SUCCESS;
}
-mobile_apis::Result::eType MessageHelper::VerifyImage(
+mobile_apis::Result::eType MessageHelper::VerifyImageApplyPath(
smart_objects::SmartObject& image,
ApplicationConstSharedPtr app,
ApplicationManager& app_mngr) {
@@ -2223,15 +2758,33 @@ mobile_apis::Result::eType MessageHelper::VerifyImage(
full_file_path += file_name;
}
+ image[strings::value] = full_file_path;
if (!file_system::FileExists(full_file_path)) {
return mobile_apis::Result::INVALID_DATA;
}
- image[strings::value] = full_file_path;
-
return mobile_apis::Result::SUCCESS;
}
+mobile_apis::Result::eType MessageHelper::VerifyImage(
+ smart_objects::SmartObject& image,
+ ApplicationConstSharedPtr app,
+ ApplicationManager& app_mngr) {
+ smart_objects::SmartObject temp_image = image;
+ const uint32_t image_type = image[strings::image_type].asUInt();
+ const mobile_apis::ImageType::eType type =
+ static_cast<mobile_apis::ImageType::eType>(image_type);
+
+ const mobile_apis::Result::eType result =
+ VerifyImageApplyPath(temp_image, app, app_mngr);
+ if ((mobile_apis::Result::SUCCESS == result) &&
+ (mobile_apis::ImageType::DYNAMIC == type)) {
+ image[strings::value] = temp_image[strings::value];
+ }
+
+ return result;
+}
+
mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems(
smart_objects::SmartObject& message,
ApplicationConstSharedPtr app,
@@ -2432,6 +2985,7 @@ bool MessageHelper::PrintSmartObject(const smart_objects::SmartObject& object) {
break;
}
case NsSmartDeviceLink::NsSmartObjects::SmartType_Integer:
+ printf("%lld", static_cast<long long int>(object.asInt()));
break;
case NsSmartDeviceLink::NsSmartObjects::SmartType_String:
printf("%s", object.asString().c_str());
diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc
index 688bacf1ac..f6f9cab7f5 100644
--- a/src/components/application_manager/src/mobile_command_factory.cc
+++ b/src/components/application_manager/src/mobile_command_factory.cc
@@ -2,6 +2,9 @@
Copyright (c) 2013, Ford Motor Company
All rights reserved.
+ Copyright (c) 2017 Xevo Inc.
+ All rights reserved.
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -13,7 +16,7 @@
disclaimer in the documentation and/or other materials provided with the
distribution.
- Neither the name of the Ford Motor Company nor the names of its contributors
+ Neither the name of the copyright holders nor the names of their contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
@@ -56,6 +59,8 @@
#include "application_manager/commands/mobile/generic_response.h"
#include "application_manager/commands/mobile/get_dtcs_request.h"
#include "application_manager/commands/mobile/get_dtcs_response.h"
+#include "application_manager/commands/mobile/get_system_capability_request.h"
+#include "application_manager/commands/mobile/get_system_capability_response.h"
#include "application_manager/commands/mobile/get_vehicle_data_request.h"
#include "application_manager/commands/mobile/get_vehicle_data_response.h"
#include "application_manager/commands/mobile/get_way_points_request.h"
@@ -133,6 +138,8 @@
#include "application_manager/commands/mobile/send_location_response.h"
#include "application_manager/commands/mobile/dial_number_request.h"
#include "application_manager/commands/mobile/dial_number_response.h"
+#include "application_manager/commands/mobile/send_haptic_data_request.h"
+#include "application_manager/commands/mobile/send_haptic_data_response.h"
#include "interfaces/MOBILE_API.h"
#include "utils/make_shared.h"
@@ -450,6 +457,17 @@ CommandSharedPtr MobileCommandFactory::CreateCommand(
}
break;
}
+ case mobile_apis::FunctionID::GetSystemCapabilityID: {
+ if ((*message)[strings::params][strings::message_type] ==
+ static_cast<int>(application_manager::MessageType::kResponse)) {
+ command.reset(new commands::GetSystemCapabilityResponse(
+ message, application_manager));
+ } else {
+ command.reset(new commands::GetSystemCapabilityRequest(
+ message, application_manager));
+ }
+ break;
+ }
case mobile_apis::FunctionID::ReadDIDID: {
if ((*message)[strings::params][strings::message_type] ==
static_cast<int>(application_manager::MessageType::kResponse)) {
@@ -604,6 +622,17 @@ CommandSharedPtr MobileCommandFactory::CreateCommand(
}
break;
}
+ case mobile_apis::FunctionID::SendHapticDataID: {
+ if ((*message)[strings::params][strings::message_type] ==
+ static_cast<int>(application_manager::MessageType::kResponse)) {
+ command.reset(
+ new commands::SendHapticDataResponse(message, application_manager));
+ } else {
+ command.reset(
+ new commands::SendHapticDataRequest(message, application_manager));
+ }
+ break;
+ }
case mobile_apis::FunctionID::OnButtonEventID: {
command.reset(new commands::mobile::OnButtonEventNotification(
message, application_manager));
diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc
index 09d9512b19..2f06c5f3b5 100644
--- a/src/components/application_manager/src/mobile_message_handler.cc
+++ b/src/components/application_manager/src/mobile_message_handler.cc
@@ -55,9 +55,9 @@ using protocol_handler::Extract;
namespace {
typedef std::map<MessageType, std::string> MessageTypeMap;
-MessageTypeMap messageTypes = {std::make_pair(kRequest, "Request"),
- std::make_pair(kResponse, "Response"),
- std::make_pair(kNotification, "Notification")};
+MessageTypeMap message_types = {std::make_pair(kRequest, "Request"),
+ std::make_pair(kResponse, "Response"),
+ std::make_pair(kNotification, "Notification")};
}
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
@@ -67,26 +67,31 @@ MobileMessageHandler::HandleIncomingMessageProtocol(
DCHECK_OR_RETURN(message, NULL);
application_manager::Message* out_message = NULL;
switch (message->protocol_version()) {
- case ProtocolVersion::kV1:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1:
LOG4CXX_DEBUG(logger_, "Protocol version - V1");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV1(message);
break;
- case ProtocolVersion::kV2:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2:
LOG4CXX_DEBUG(logger_, "Protocol version - V2");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
break;
- case ProtocolVersion::kV3:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3:
LOG4CXX_DEBUG(logger_, "Protocol version - V3");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
break;
- case ProtocolVersion::kV4:
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4:
LOG4CXX_DEBUG(logger_, "Protocol version - V4");
out_message =
MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
break;
+ case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5:
+ LOG4CXX_DEBUG(logger_, "Protocol version - V5");
+ out_message =
+ MobileMessageHandler::HandleIncomingMessageProtocolV2(message);
+ break;
default:
LOG4CXX_WARN(logger_, "Can't recognise protocol version");
out_message = NULL;
@@ -99,7 +104,7 @@ MobileMessageHandler::HandleIncomingMessageProtocol(
LOG4CXX_DEBUG(logger_,
"Incoming RPC_INFO: " << (out_message->connection_key() >> 16)
<< ", "
- << messageTypes[out_message->type()]
+ << message_types[out_message->type()]
<< ", " << out_message->function_id()
<< ", " << out_message->correlation_id()
<< ", " << out_message->json_message());
@@ -111,17 +116,18 @@ MobileMessageHandler::HandleOutgoingMessageProtocol(
const MobileMessage& message) {
LOG4CXX_DEBUG(logger_,
"Outgoing RPC_INFO: " << (message->connection_key() >> 16)
- << ", " << messageTypes[message->type()]
+ << ", " << message_types[message->type()]
<< ", " << message->function_id() << ", "
<< message->correlation_id() << ", "
<< message->json_message());
- if (message->protocol_version() == application_manager::kV1) {
+ if (message->protocol_version() ==
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1) {
return MobileMessageHandler::HandleOutgoingMessageProtocolV1(message);
}
- if ((message->protocol_version() == application_manager::kV2) ||
- (message->protocol_version() == application_manager::kV3) ||
- (message->protocol_version() == application_manager::kV4)) {
+ if (Message::is_sufficient_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2,
+ message->protocol_version())) {
return MobileMessageHandler::HandleOutgoingMessageProtocolV2(message);
}
return NULL;
@@ -142,7 +148,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV1(
outgoing_message->set_connection_key(message->connection_key());
outgoing_message->set_protocol_version(
- static_cast<application_manager::ProtocolVersion>(
+ static_cast<protocol_handler::MajorProtocolVersion>(
message->protocol_version()));
outgoing_message->set_json_message(std::string(
reinterpret_cast<const char*>(message->data()), message->data_size()));
@@ -184,14 +190,14 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2(
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>(
+ static_cast<protocol_handler::MajorProtocolVersion>(
message->protocol_version()));
outgoing_message->set_data_size(message->data_size());
outgoing_message->set_payload_size(message->payload_size());
if (!payload.data.empty()) {
- outgoing_message->set_binary_data(
- new application_manager::BinaryData(payload.data));
+ const BinaryData binary_payload_data(payload.data);
+ outgoing_message->set_binary_data(&binary_payload_data);
}
return outgoing_message.release();
}
@@ -200,19 +206,20 @@ protocol_handler::RawMessage*
MobileMessageHandler::HandleOutgoingMessageProtocolV1(
const MobileMessage& message) {
LOG4CXX_AUTO_TRACE(logger_);
- std::string messageString = message->json_message();
- if (messageString.length() == 0) {
+ std::string message_string = message->json_message();
+ if (message_string.length() == 0) {
LOG4CXX_WARN(logger_, "Drop ill-formed message from mobile");
return NULL;
}
- uint8_t* rawMessage = new uint8_t[messageString.length() + 1];
- memcpy(rawMessage, messageString.c_str(), messageString.length() + 1);
+ BinaryData raw_message(message_string.length() + 1);
+ memcpy(&raw_message[0], message_string.c_str(), message_string.length() + 1);
- protocol_handler::RawMessage* result = new protocol_handler::RawMessage(
- message->connection_key(), 1, rawMessage, messageString.length() + 1);
-
- delete[] rawMessage;
+ protocol_handler::RawMessage* result =
+ new protocol_handler::RawMessage(message->connection_key(),
+ 1,
+ &raw_message[0],
+ message_string.length() + 1);
return result;
}
@@ -224,51 +231,52 @@ MobileMessageHandler::HandleOutgoingMessageProtocolV2(
if (message->json_message().length() == 0) {
LOG4CXX_ERROR(logger_, "json string is empty.");
}
- uint32_t jsonSize = message->json_message().length();
- uint32_t binarySize = 0;
+ uint32_t json_size = message->json_message().length();
+ uint32_t binary_size = 0;
if (message->has_binary_data()) {
- binarySize = message->binary_data()->size();
+ binary_size = message->binary_data()->size();
}
- const size_t dataForSendingSize =
- protocol_handler::PROTOCOL_HEADER_V2_SIZE + jsonSize + binarySize;
- uint8_t* dataForSending = new uint8_t[dataForSendingSize];
+ const size_t data_for_sending_size =
+ protocol_handler::PROTOCOL_HEADER_V2_SIZE + json_size + binary_size;
+ BinaryData data_for_sending(data_for_sending_size);
uint8_t offset = 0;
- uint8_t rpcTypeFlag = 0;
+ uint8_t rpc_type_flag = 0;
switch (message->type()) {
case application_manager::kRequest:
- rpcTypeFlag = kRequest;
+ rpc_type_flag = kRequest;
break;
case application_manager::kResponse:
- rpcTypeFlag = kResponse;
+ rpc_type_flag = kResponse;
break;
case application_manager::kNotification:
- rpcTypeFlag = kNotification;
+ rpc_type_flag = kNotification;
break;
default:
NOTREACHED();
break;
}
- uint32_t functionId = message->function_id();
- dataForSending[offset++] = ((rpcTypeFlag << 4) & 0xF0) | (functionId >> 24);
- dataForSending[offset++] = functionId >> 16;
- dataForSending[offset++] = functionId >> 8;
- dataForSending[offset++] = functionId;
+ uint32_t function_id = message->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->correlation_id();
- dataForSending[offset++] = correlationId >> 24;
- dataForSending[offset++] = correlationId >> 16;
- dataForSending[offset++] = correlationId >> 8;
- dataForSending[offset++] = correlationId;
+ uint32_t correlation_id = message->correlation_id();
+ data_for_sending[offset++] = correlation_id >> 24;
+ data_for_sending[offset++] = correlation_id >> 16;
+ data_for_sending[offset++] = correlation_id >> 8;
+ data_for_sending[offset++] = correlation_id;
- dataForSending[offset++] = jsonSize >> 24;
- dataForSending[offset++] = jsonSize >> 16;
- dataForSending[offset++] = jsonSize >> 8;
- dataForSending[offset++] = jsonSize;
+ data_for_sending[offset++] = json_size >> 24;
+ data_for_sending[offset++] = json_size >> 16;
+ data_for_sending[offset++] = json_size >> 8;
+ data_for_sending[offset++] = json_size;
- memcpy(dataForSending + offset, message->json_message().c_str(), jsonSize);
+ memcpy(&data_for_sending[offset], message->json_message().c_str(), json_size);
// Default the service type to RPC Service
uint8_t type = 0x07;
@@ -276,22 +284,21 @@ MobileMessageHandler::HandleOutgoingMessageProtocolV2(
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) {
- currentPointer[i] = binaryData[i];
+ const BinaryData& binary_data = *(message->binary_data());
+ BinaryData::value_type* current_pointer =
+ &data_for_sending[offset + json_size];
+ for (uint32_t i = 0; i < binary_size; ++i) {
+ current_pointer[i] = binary_data[i];
}
}
- protocol_handler::RawMessage* msgToProtocolHandler =
+ protocol_handler::RawMessage* msg_to_protocol_handler =
new protocol_handler::RawMessage(message->connection_key(),
message->protocol_version(),
- dataForSending,
- dataForSendingSize,
+ &data_for_sending[0],
+ data_for_sending_size,
type);
- delete[] dataForSending;
-
- return msgToProtocolHandler;
+ return msg_to_protocol_handler;
}
} // namespace application_manager
diff --git a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
index 7b5954a3c3..871e96442a 100644
--- a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
+++ b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc
@@ -36,17 +36,35 @@
namespace policy {
CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
+#ifdef EXTERNAL_PROPRIETARY_MODE
AppPermissionDelegate::AppPermissionDelegate(
const uint32_t connection_key,
const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status,
policy::PolicyHandlerInterface& policy_handler)
: connection_key_(connection_key)
, permissions_(permissions)
+ , external_consent_status_(external_consent_status)
, policy_handler_(policy_handler) {}
+#else
+AppPermissionDelegate::AppPermissionDelegate(
+ const uint32_t connection_key,
+ const PermissionConsent& permissions,
+ policy::PolicyHandlerInterface& policy_handler)
+ : connection_key_(connection_key)
+ , permissions_(permissions)
+ , policy_handler_(policy_handler) {}
+#endif
void AppPermissionDelegate::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy_handler_.OnAppPermissionConsentInternal(
+ connection_key_, external_consent_status_, permissions_);
+#else
policy_handler_.OnAppPermissionConsentInternal(connection_key_, permissions_);
+#endif
}
void AppPermissionDelegate::exitThreadMain() {
diff --git a/src/components/application_manager/src/policies/delegates/statistics_delegate.cc b/src/components/application_manager/src/policies/delegates/statistics_delegate.cc
index 11c1dc9a91..e668be4ed1 100644
--- a/src/components/application_manager/src/policies/delegates/statistics_delegate.cc
+++ b/src/components/application_manager/src/policies/delegates/statistics_delegate.cc
@@ -39,6 +39,9 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
usage_statistics::GlobalCounterId type)
: type_(INCREMENT_GLOBAL)
, global_counter_(type)
+ , app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE)
+ , app_info_(usage_statistics::AppInfoId::APP_INFO_NONE)
+ , stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE)
, app_id_("")
, value_("")
, timespan_seconds_(0)
@@ -48,7 +51,10 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
const std::string& app_id,
usage_statistics::AppCounterId type)
: type_(INCREMENT_APP)
+ , global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE)
, app_counter_(type)
+ , app_info_(usage_statistics::AppInfoId::APP_INFO_NONE)
+ , stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE)
, app_id_(app_id)
, value_("")
, timespan_seconds_(0)
@@ -59,7 +65,10 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
usage_statistics::AppInfoId type,
const std::string& value)
: type_(SET)
+ , global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE)
+ , app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE)
, app_info_(type)
+ , stop_watch_(usage_statistics::AppStopwatchId::STOPWATCH_NONE)
, app_id_(app_id)
, value_(value)
, timespan_seconds_(0)
@@ -70,6 +79,9 @@ StatisticsDelegate::StatisticsDelegate(PolicyHandler& policy_handler,
usage_statistics::AppStopwatchId type,
int32_t timespan_seconds)
: type_(ADD)
+ , global_counter_(usage_statistics::GlobalCounterId::GLOBAL_COUNTER_NONE)
+ , app_counter_(usage_statistics::AppCounterId::APP_COUNTER_NONE)
+ , app_info_(usage_statistics::AppInfoId::APP_INFO_NONE)
, stop_watch_(type)
, app_id_(app_id)
, value_("")
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 492abe499a..828f2d923a 100644
--- a/src/components/application_manager/src/policies/policy_event_observer.cc
+++ b/src/components/application_manager/src/policies/policy_event_observer.cc
@@ -37,7 +37,6 @@
#include "smart_objects/smart_object.h"
namespace policy {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
using namespace application_manager;
class PolicyHandler;
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index 23f5227667..b6b208b39b 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -34,10 +34,11 @@
#include <dlfcn.h>
#include <algorithm>
#include <vector>
+#include <functional>
+#include <utility>
#include "application_manager/smart_object_keys.h"
-
#include "application_manager/policies/delegates/app_permission_delegate.h"
-
+#include "policy/status.h"
#include "application_manager/application_manager.h"
#include "application_manager/state_controller.h"
#include "application_manager/message_helper.h"
@@ -53,6 +54,10 @@
#include "utils/file_system.h"
#include "utils/scope_guard.h"
#include "utils/make_shared.h"
+#include "policy/policy_manager.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "functional_module/plugin_manager.h"
+#endif // SDL_REMOTE_CONTROL
namespace policy {
@@ -62,31 +67,32 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
namespace {
using namespace mobile_apis;
-typedef std::map<RequestType::eType, std::string> RequestTypeMap;
+typedef std::map<mobile_apis::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) {
+ {mobile_apis::RequestType::INVALID_ENUM, "INVALID_ENUM"},
+ {mobile_apis::RequestType::HTTP, "HTTP"},
+ {mobile_apis::RequestType::FILE_RESUME, "FILE_RESUME"},
+ {mobile_apis::RequestType::AUTH_REQUEST, "AUTH_REQUEST"},
+ {mobile_apis::RequestType::AUTH_CHALLENGE, "AUTH_CHALLENGE"},
+ {mobile_apis::RequestType::AUTH_ACK, "AUTH_ACK"},
+ {mobile_apis::RequestType::PROPRIETARY, "PROPRIETARY"},
+ {mobile_apis::RequestType::QUERY_APPS, "QUERY_APPS"},
+ {mobile_apis::RequestType::LAUNCH_APP, "LAUNCH_APP"},
+ {mobile_apis::RequestType::LOCK_SCREEN_ICON_URL, "LOCK_SCREEN_ICON_URL"},
+ {mobile_apis::RequestType::TRAFFIC_MESSAGE_CHANNEL,
+ "TRAFFIC_MESSAGE_CHANNEL"},
+ {mobile_apis::RequestType::DRIVER_PROFILE, "DRIVER_PROFILE"},
+ {mobile_apis::RequestType::VOICE_SEARCH, "VOICE_SEARCH"},
+ {mobile_apis::RequestType::NAVIGATION, "NAVIGATION"},
+ {mobile_apis::RequestType::PHONE, "PHONE"},
+ {mobile_apis::RequestType::CLIMATE, "CLIMATE"},
+ {mobile_apis::RequestType::SETTINGS, "SETTINGS"},
+ {mobile_apis::RequestType::VEHICLE_DIAGNOSTICS, "VEHICLE_DIAGNOSTICS"},
+ {mobile_apis::RequestType::EMERGENCY, "EMERGENCY"},
+ {mobile_apis::RequestType::MEDIA, "MEDIA"},
+ {mobile_apis::RequestType::FOTA, "FOTA"}};
+
+const std::string RequestTypeToString(mobile_apis::RequestType::eType type) {
RequestTypeMap::const_iterator it = TypeToString.find(type);
if (TypeToString.end() != it) {
return (*it).second;
@@ -112,7 +118,21 @@ const policy::DeviceParams GetDeviceParams(
device_params.device_handle = device_handle;
return device_params;
}
-}
+
+struct HMILevelPredicate
+ : public std::unary_function<ApplicationSharedPtr, bool> {
+ explicit HMILevelPredicate(const mobile_api::HMILevel::eType level)
+ : level_(level) {}
+
+ bool operator()(const ApplicationSharedPtr app) const {
+ return level_ == app->hmi_level() ? true : false;
+ }
+
+ private:
+ mobile_api::HMILevel::eType level_;
+};
+
+} // namespace
#define POLICY_LIB_CHECK(return_value) \
{ \
@@ -134,25 +154,6 @@ const policy::DeviceParams GetDeviceParams(
static const std::string kCerficateFileName = "certificate";
-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,
@@ -182,11 +183,9 @@ struct SDLAllowedNotification {
, state_controller_(state_controller) {}
void operator()(const ApplicationSharedPtr& app) {
- if (!policy_manager_) {
- return;
- }
+ DCHECK_OR_RETURN_VOID(policy_manager_);
if (device_id_ == app->device()) {
- std::string hmi_level;
+ std::string hmi_level = "NONE";
mobile_apis::HMILevel::eType default_mobile_hmi;
policy_manager_->GetDefaultHmi(app->policy_app_id(), &hmi_level);
if ("BACKGROUND" == hmi_level) {
@@ -210,6 +209,43 @@ struct SDLAllowedNotification {
StateController& state_controller_;
};
+/**
+ * @brief Gets from system list of currently registered applications and
+ * create collection of links device-to-application
+ */
+struct LinksCollector {
+ LinksCollector(const ApplicationManager& application_manager,
+ std::map<std::string, std::string>& out_app_to_device_link)
+ : application_manager_(application_manager)
+ , out_app_to_device_link_(out_app_to_device_link) {
+ out_app_to_device_link_.clear();
+ }
+
+ void operator()(const ApplicationSharedPtr& app) {
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_,
+ "Invalid pointer to application was passed."
+ "Skip current application.");
+ return;
+ }
+ DeviceParams device_params = GetDeviceParams(
+ app->device(),
+ application_manager_.connection_handler().get_session_observer());
+ const std::string app_id = app->policy_app_id();
+ if (device_params.device_mac_address.empty()) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't find device, which hosts application " << app_id);
+ return;
+ }
+ out_app_to_device_link_.insert(
+ std::make_pair(device_params.device_mac_address, app_id));
+ }
+
+ private:
+ const ApplicationManager& application_manager_;
+ std::map<std::string, std::string>& out_app_to_device_link_;
+};
+
struct LinkAppToDevice {
explicit LinkAppToDevice(
std::map<std::string, std::string>& app_to_device_link,
@@ -296,6 +332,10 @@ PolicyHandler::PolicyHandler(const PolicySettings& settings,
PolicyHandler::~PolicyHandler() {}
+bool PolicyHandler::PolicyEnabled() const {
+ return get_settings().enable_policy();
+}
+
bool PolicyHandler::LoadPolicyLibrary() {
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoWriteLock lock(policy_manager_lock_);
@@ -304,11 +344,11 @@ bool PolicyHandler::LoadPolicyLibrary() {
"System is configured to work without policy "
"functionality.");
policy_manager_.reset();
- return NULL;
+ return false;
}
dl_handle_ = dlopen(kLibrary.c_str(), RTLD_LAZY);
- char* error = dlerror();
+ const char* error = dlerror();
if (!error) {
if (CreateManager()) {
policy_manager_->set_listener(this);
@@ -323,10 +363,6 @@ bool PolicyHandler::LoadPolicyLibrary() {
return policy_manager_.valid();
}
-bool PolicyHandler::PolicyEnabled() const {
- return get_settings().enable_policy();
-}
-
bool PolicyHandler::CreateManager() {
typedef PolicyManager* (*CreateManager)();
typedef void (*DeleteManager)(PolicyManager*);
@@ -355,7 +391,7 @@ bool PolicyHandler::InitPolicyTable() {
// info necessary for policy table
event_observer_->subscribe_on_event(
hmi_apis::FunctionID::BasicCommunication_OnReady);
- const std::string& preloaded_file = get_settings().preloaded_pt_file();
+ std::string preloaded_file = get_settings().preloaded_pt_file();
if (file_system::FileExists(preloaded_file)) {
return policy_manager_->InitPT(preloaded_file, &get_settings());
}
@@ -366,7 +402,7 @@ bool PolicyHandler::InitPolicyTable() {
bool PolicyHandler::ResetPolicyTable() {
LOG4CXX_TRACE(logger_, "Reset policy table.");
POLICY_LIB_CHECK(false);
- const std::string& preloaded_file = get_settings().preloaded_pt_file();
+ std::string preloaded_file = get_settings().preloaded_pt_file();
if (file_system::FileExists(preloaded_file)) {
return policy_manager_->ResetPT(preloaded_file);
}
@@ -381,44 +417,70 @@ bool PolicyHandler::ClearUserConsent() {
}
uint32_t PolicyHandler::GetAppIdForSending() const {
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK(0);
const ApplicationSet& accessor =
application_manager_.applications().GetData();
- HmiLevelOrderedApplicationList app_list(accessor.begin(), accessor.end());
- LOG4CXX_INFO(logger_, "Apps size: " << app_list.size());
+ HMILevelPredicate has_none_level(mobile_api::HMILevel::HMI_NONE);
+ Applications apps_without_none_level;
+ std::copy_if(accessor.begin(),
+ accessor.end(),
+ std::back_inserter(apps_without_none_level),
+ std::not1(has_none_level));
- for (HmiLevelOrderedApplicationList::const_iterator first = app_list.begin();
- first != app_list.end();
- ++first) {
- if ((*first)->IsRegistered()) {
- const uint32_t app_id = (*first)->app_id();
- DeviceParams device_params = GetDeviceParams(
- (*first)->device(),
- application_manager_.connection_handler().get_session_observer());
+ LOG4CXX_DEBUG(logger_,
+ "Number of apps with different from NONE level: "
+ << apps_without_none_level.size());
- if (kDeviceAllowed ==
- policy_manager_->GetUserConsentForDevice(
- device_params.device_mac_address)) {
- return app_id;
- }
- }
+ uint32_t choosen_app_id =
+ ChooseRandomAppForPolicyUpdate(apps_without_none_level);
+
+ if (choosen_app_id) {
+ return choosen_app_id;
}
- return 0;
+
+ Applications apps_with_none_level;
+ std::copy_if(accessor.begin(),
+ accessor.end(),
+ std::back_inserter(apps_with_none_level),
+ has_none_level);
+
+ LOG4CXX_DEBUG(
+ logger_,
+ "Number of apps with NONE level: " << apps_with_none_level.size());
+
+ return ChooseRandomAppForPolicyUpdate(apps_with_none_level);
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+void PolicyHandler::OnAppPermissionConsent(
+ const uint32_t connection_key,
+ const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ AsyncRun(new AppPermissionDelegate(
+ connection_key, permissions, external_consent_status, *this));
+}
+#else
void PolicyHandler::OnAppPermissionConsent(
const uint32_t connection_key, const PermissionConsent& permissions) {
LOG4CXX_AUTO_TRACE(logger_);
AsyncRun(new AppPermissionDelegate(connection_key, permissions, *this));
}
+#endif
+
void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
const bool is_allowed) {
POLICY_LIB_CHECK_VOID();
connection_handler::DeviceHandle device_handle;
- application_manager_.connection_handler().GetDeviceID(device_id,
- &device_handle);
+ if (!application_manager_.connection_handler().GetDeviceID(device_id,
+ &device_handle)) {
+ LOG4CXX_ERROR(logger_,
+ "Unable to get device handle for device_id: " << device_id);
+ return;
+ }
// 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
@@ -432,8 +494,10 @@ void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id,
if (device_handle == (*it_app_list).get()->device()) {
const std::string policy_app_id = (*it_app_list)->policy_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
+ // If app has predata policy, which is assigned without device consent
+ // or
+ // with negative data consent, there no necessity to change smth and
+ // send
// notification for such app in case of device consent is not allowed
if (policy_manager_->IsPredataPolicy(policy_app_id) && !is_allowed) {
continue;
@@ -463,9 +527,9 @@ void PolicyHandler::SendOnAppPermissionsChanged(
}
void PolicyHandler::OnPTExchangeNeeded() {
+ LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
- MessageHelper::SendOnStatusUpdate(policy_manager_->ForcePTExchange(),
- application_manager_);
+ policy_manager_->ForcePTExchange();
}
void PolicyHandler::GetAvailableApps(std::queue<std::string>& apps) {
@@ -480,9 +544,17 @@ void PolicyHandler::GetAvailableApps(std::queue<std::string>& apps) {
}
}
-void PolicyHandler::AddApplication(const std::string& application_id) {
- POLICY_LIB_CHECK_VOID();
- policy_manager_->AddApplication(application_id);
+struct SmartObjectToInt {
+ int operator()(const smart_objects::SmartObject& item) const {
+ return item.asInt();
+ }
+};
+
+StatusNotifier PolicyHandler::AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
+ POLICY_LIB_CHECK(utils::MakeShared<utils::CallNothing>());
+ return policy_manager_->AddApplication(application_id, hmi_types);
}
void PolicyHandler::AddDevice(const std::string& device_id,
@@ -499,69 +571,88 @@ void PolicyHandler::SetDeviceInfo(const std::string& device_id,
policy_manager_->SetDeviceInfo(device_id, device_info);
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
void PolicyHandler::OnAppPermissionConsentInternal(
- const uint32_t connection_key, PermissionConsent& permissions) {
+ const uint32_t connection_key,
+ const ExternalConsentStatus& external_consent_status,
+ PermissionConsent& out_permissions) {
LOG4CXX_AUTO_TRACE(logger_);
+ const PolicyManager::NotificationMode mode =
+ external_consent_status.empty() ? PolicyManager::kNotifyApplicationMode
+ : PolicyManager::kSilentMode;
+#else
+void PolicyHandler::OnAppPermissionConsentInternal(
+ const uint32_t connection_key, PermissionConsent& out_permissions) {
+#endif
POLICY_LIB_CHECK_VOID();
+
if (connection_key) {
ApplicationSharedPtr app = application_manager_.application(connection_key);
if (app.valid()) {
- permissions.policy_app_id = app->policy_app_id();
+ out_permissions.policy_app_id = app->policy_app_id();
DeviceParams device_params = GetDeviceParams(
app->device(),
application_manager_.connection_handler().get_session_observer());
- permissions.device_id = device_params.device_mac_address;
+ out_permissions.device_id = device_params.device_mac_address;
}
- if (!permissions.policy_app_id.empty()) {
- policy_manager_->SetUserConsentForApp(permissions);
+ if (!out_permissions.policy_app_id.empty()) {
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy_manager_->SetUserConsentForApp(out_permissions, mode);
+#else
+ policy_manager_->SetUserConsentForApp(out_permissions);
+#endif
}
+ } else if (!app_to_device_link_.empty()) {
+ sync_primitives::AutoLock lock(app_to_device_link_lock_);
+ std::map<std::string, std::string>::const_iterator it =
+ app_to_device_link_.begin();
+ for (; app_to_device_link_.end() != it; ++it) {
+ ApplicationSharedPtr app =
+ application_manager_.application_by_policy_id(it->second);
+
+ // If list of apps sent to HMI for user consents is not the same as
+ // current,
+ // permissions should be set only for coincident to registered apps
+ if (!app.valid()) {
+ LOG4CXX_WARN(logger_,
+ "Invalid pointer to application was passed."
+ "Permissions setting skipped.");
+ continue;
+ }
- return;
- }
+ DeviceParams device_params = GetDeviceParams(
+ app->device(),
+ application_manager_.connection_handler().get_session_observer());
- sync_primitives::AutoLock lock(app_to_device_link_lock_);
- if (!app_to_device_link_.size()) {
+ if (device_params.device_mac_address != it->first) {
+ LOG4CXX_WARN(logger_,
+ "Device_id of application is changed."
+ "Permissions setting skipped.");
+ continue;
+ }
+
+ out_permissions.policy_app_id = it->second;
+ out_permissions.device_id = it->first;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy_manager_->SetUserConsentForApp(out_permissions, mode);
+#else
+ policy_manager_->SetUserConsentForApp(out_permissions);
+#endif
+ }
+ } else {
LOG4CXX_WARN(logger_,
"There are no applications previously stored for "
"setting common permissions.");
- return;
}
-
- std::map<std::string, std::string>::const_iterator it =
- app_to_device_link_.begin();
- std::map<std::string, std::string>::const_iterator it_end =
- app_to_device_link_.end();
- for (; it != it_end; ++it) {
- ApplicationSharedPtr app =
- application_manager_.application_by_policy_id(it->first);
-
- // If list of apps sent to HMI for user consents is not the same as current,
- // permissions should be set only for coincident to registered apps
- if (!app.valid()) {
- LOG4CXX_WARN(logger_,
- "Invalid pointer to application was passed."
- "Permissions setting skipped.");
- continue;
- }
-
- DeviceParams device_params = GetDeviceParams(
- app->device(),
- application_manager_.connection_handler().get_session_observer());
-
- if (device_params.device_mac_address != it->second) {
- LOG4CXX_WARN(logger_,
- "Device_id of application is changed."
- "Permissions setting skipped.");
- continue;
- }
-
- permissions.policy_app_id = it->first;
- permissions.device_id = it->second;
- policy_manager_->SetUserConsentForApp(permissions);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ if (!policy_manager_->SetExternalConsentStatus(external_consent_status)) {
+ LOG4CXX_WARN(logger_,
+ "External User Consent Settings status has not been set!");
}
+#endif
}
void policy::PolicyHandler::SetDaysAfterEpoch() {
@@ -585,77 +676,187 @@ void PolicyHandler::OnGetUserFriendlyMessage(
uint32_t correlation_id) {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
- std::vector<UserFriendlyMessage> result =
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ const std::string active_hmi_language =
+ application_manager::MessageHelper::CommonLanguageToString(
+ application_manager_.hmi_capabilities().active_ui_language());
+ const std::vector<UserFriendlyMessage> result =
+ policy_manager_->GetUserFriendlyMessages(
+ message_codes, language, active_hmi_language);
+#else
+ const std::vector<UserFriendlyMessage> result =
policy_manager_->GetUserFriendlyMessages(message_codes, language);
+#endif // EXTERNAL_PROPRIETARY_MODE
// Send response to HMI with gathered data
MessageHelper::SendGetUserFriendlyMessageResponse(
result, correlation_id, application_manager_);
}
-void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
- const uint32_t correlation_id) {
+void PolicyHandler::GetRegisteredLinks(
+ std::map<std::string, std::string>& out_links) const {
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ ApplicationSetConstIt it_app = accessor.GetData().begin();
+ ApplicationSetConstIt it_app_end = accessor.GetData().end();
+
+ LinksCollector linker(application_manager_, out_links);
+ std::for_each(it_app, it_app_end, linker);
+}
+
+std::vector<policy::FunctionalGroupPermission>
+PolicyHandler::CollectRegisteredAppsPermissions() {
LOG4CXX_AUTO_TRACE(logger_);
- POLICY_LIB_CHECK_VOID();
+ POLICY_LIB_CHECK(std::vector<policy::FunctionalGroupPermission>());
// 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_);
- const ApplicationSet& accessor =
- application_manager_.applications().GetData();
- ApplicationSetConstIt it_app = accessor.begin();
- ApplicationSetConstIt it_app_end = accessor.end();
-
- // Add all currently registered applications
- std::for_each(it_app, it_app_end, linker);
-
- PermissionsConsolidator consolidator;
- std::vector<policy::FunctionalGroupPermission> group_permissions;
- std::map<std::string, std::string>::const_iterator it =
- app_to_device_link_.begin();
- for (; it != app_to_device_link_.end(); ++it) {
- policy_manager_->GetUserConsentForApp(
- it->second, it->first, group_permissions);
- consolidator.Consolidate(group_permissions);
- }
+ sync_primitives::AutoLock lock(app_to_device_link_lock_);
- MessageHelper::SendGetListOfPermissionsResponse(
- consolidator.GetConsolidatedPermissions(),
- correlation_id,
- application_manager_);
+ GetRegisteredLinks(app_to_device_link_);
- return;
+ PermissionsConsolidator consolidator;
+ std::vector<policy::FunctionalGroupPermission> group_permissions;
+ std::map<std::string, std::string>::const_iterator it =
+ app_to_device_link_.begin();
+ for (; it != app_to_device_link_.end(); ++it) {
+ policy_manager_->GetUserConsentForApp(
+ it->first, it->second, group_permissions);
+ consolidator.Consolidate(group_permissions);
}
+ return consolidator.GetConsolidatedPermissions();
+}
+std::vector<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions(
+ const uint32_t connection_key) {
// Single app only
ApplicationSharedPtr app = application_manager_.application(connection_key);
+ std::vector<FunctionalGroupPermission> group_permissions;
- if (!app.valid()) {
+ if (NULL == app.get() || !app.valid()) {
LOG4CXX_WARN(logger_,
"Connection key '"
<< connection_key
<< "' "
"not found within registered applications.");
- return;
+
+ return group_permissions;
}
DeviceParams device_params = GetDeviceParams(
app->device(),
application_manager_.connection_handler().get_session_observer());
- std::vector<FunctionalGroupPermission> group_permissions;
if (device_params.device_mac_address.empty()) {
LOG4CXX_WARN(logger_, "Couldn't find device, which hosts application.");
- } else if (!app) {
- LOG4CXX_WARN(logger_, "Couldn't find application to get permissions.");
- } else {
- policy_manager_->GetUserConsentForApp(device_params.device_mac_address,
- app->policy_app_id(),
- group_permissions);
+ return group_permissions;
+ }
+
+ policy_manager_->GetUserConsentForApp(device_params.device_mac_address,
+ app->policy_app_id(),
+ group_permissions);
- MessageHelper::SendGetListOfPermissionsResponse(
- group_permissions, correlation_id, application_manager_);
+ return group_permissions;
+}
+
+void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key,
+ const uint32_t correlation_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK_VOID();
+
+ application_manager::ApplicationSharedPtr app =
+ application_manager_.application(connection_key);
+ const bool is_app_registered = NULL != app.get();
+ const bool is_connection_key_valid = is_app_registered && connection_key;
+
+ const std::vector<policy::FunctionalGroupPermission> permissions =
+ is_connection_key_valid ? CollectAppPermissions(connection_key)
+ : CollectRegisteredAppsPermissions();
+
+ if (permissions.empty() && is_connection_key_valid) {
+ LOG4CXX_ERROR(logger_,
+ "No permissions found for application with connection key:"
+ << connection_key);
+ return;
}
+
+ MessageHelper::SendGetListOfPermissionsResponse(
+ permissions,
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy_manager_->GetExternalConsentStatus(),
+#endif // EXTERNAL_PROPRIETARY_MODE
+ correlation_id,
+ application_manager_);
+}
+
+void PolicyHandler::LinkAppsToDevice() {
+ sync_primitives::AutoLock lock(app_to_device_link_lock_);
+ LinkAppToDevice linker(app_to_device_link_, application_manager_);
+ LOG4CXX_DEBUG(logger_, "add links to app. no specific app was passed");
+ {
+ const ApplicationSet& accessor =
+ application_manager_.applications().GetData();
+ if (accessor.empty()) {
+ LOG4CXX_WARN(logger_,
+ "application_manager doesn't have any applications");
+ } else {
+ // Add all currently registered applications
+ std::for_each(accessor.begin(), accessor.end(), linker);
+ }
+ }
+}
+
+bool PolicyHandler::IsAppSuitableForPolicyUpdate(
+ const Applications::value_type value) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!value->IsRegistered()) {
+ LOG4CXX_DEBUG(logger_,
+ "Application " << value->app_id()
+ << " is not marked as registered.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application " << value->app_id()
+ << " marked as registered."
+ "Checking its parameters.");
+
+ DeviceParams device_params = GetDeviceParams(
+ value->device(),
+ application_manager_.connection_handler().get_session_observer());
+
+ const bool is_device_allowed = (kDeviceAllowed ==
+ policy_manager_->GetUserConsentForDevice(
+ device_params.device_mac_address));
+
+ LOG4CXX_DEBUG(logger_,
+ "Is device " << device_params.device_mac_address << " allowed "
+ << std::boolalpha << is_device_allowed);
+ return is_device_allowed;
+}
+
+uint32_t PolicyHandler::ChooseRandomAppForPolicyUpdate(
+ Applications& app_list) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::random_shuffle(app_list.begin(), app_list.end());
+
+ Applications::const_iterator choosen_app = std::find_if(
+ app_list.begin(),
+ app_list.end(),
+ std::bind1st(std::mem_fun(&PolicyHandler::IsAppSuitableForPolicyUpdate),
+ this));
+
+ if (app_list.end() != choosen_app) {
+ return (*choosen_app)->app_id();
+ }
+
+ return 0;
+}
+
+void PolicyHandler::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->OnDeviceSwitching(device_id_from, device_id_to);
}
void PolicyHandler::OnGetStatusUpdate(const uint32_t correlation_id) {
@@ -669,6 +870,8 @@ void PolicyHandler::OnGetStatusUpdate(const uint32_t correlation_id) {
void PolicyHandler::OnUpdateStatusChanged(const std::string& status) {
LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->SaveUpdateStatusRequired(policy::kUpToDate != status);
MessageHelper::SendOnStatusUpdate(status, application_manager_);
}
@@ -728,6 +931,21 @@ void PolicyHandler::OnVIIsReady() {
void PolicyHandler::OnVehicleDataUpdated(
const smart_objects::SmartObject& message) {
POLICY_LIB_CHECK_VOID();
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ if (!message.keyExists(strings::msg_params)) {
+ LOG4CXX_ERROR(logger_,
+ "Message does not contains mandatory section "
+ << strings::msg_params);
+ return;
+ }
+ if (message[strings::msg_params].keyExists(strings::vin)) {
+ policy_manager_->SetVINValue(
+ message[strings::msg_params][strings::vin].asString());
+ }
+#else
+ LOG4CXX_DEBUG(logger_,
+ "This functionality is not available for not external policy");
+#endif
}
void PolicyHandler::OnPendingPermissionChange(
@@ -818,11 +1036,10 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string,
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK(false);
- uint32_t app_id = GetAppIdForSending();
-
+ const uint32_t app_id = GetAppIdForSending();
ApplicationSharedPtr app = application_manager_.application(app_id);
- if (!app.valid()) {
+ if (!app) {
LOG4CXX_WARN(logger_,
"There is no registered application with "
"connection key '"
@@ -875,8 +1092,9 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file,
correlation_id, vehicle_data_args, application_manager_);
} else {
LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one.");
- OnPTExchangeNeeded();
+ policy_manager_->ForcePTExchange();
}
+ OnPTUFinished(ret);
return ret;
}
@@ -897,43 +1115,105 @@ bool PolicyHandler::UnloadPolicyLibrary() {
return ret;
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+struct SDLAlowedNotification {
+ SDLAlowedNotification(const connection_handler::DeviceHandle& device_id,
+ PolicyManager* policy_manager,
+ StateController& state_controller)
+ : device_id_(device_id)
+ , policy_manager_(policy_manager)
+ , state_controller_(state_controller) {}
+
+ void operator()(const ApplicationSharedPtr& app) {
+ DCHECK_OR_RETURN_VOID(policy_manager_);
+ if (app->device() == device_id_) {
+ std::string hmi_level;
+ mobile_apis::HMILevel::eType default_mobile_hmi;
+ policy_manager_->GetDefaultHmi(app->policy_app_id(), &hmi_level);
+ if ("BACKGROUND" == hmi_level) {
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_BACKGROUND;
+ } else if ("FULL" == hmi_level) {
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_FULL;
+ } else if ("LIMITED" == hmi_level) {
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_LIMITED;
+ } else if ("NONE" == hmi_level) {
+ default_mobile_hmi = mobile_apis::HMILevel::HMI_NONE;
+ } else {
+ return;
+ }
+ state_controller_.SetRegularState(app, default_mobile_hmi, true);
+ }
+ }
+
+ private:
+ connection_handler::DeviceHandle device_id_;
+ PolicyManager* policy_manager_;
+ StateController& state_controller_;
+};
+#endif // EXTERNAL_PROPRIETARY_MODE
+
void PolicyHandler::OnAllowSDLFunctionalityNotification(
bool is_allowed, const std::string& device_mac) {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
using namespace mobile_apis;
- // Device ids, need to be changed
- std::vector<std::string> device_macs;
const bool device_specific = !device_mac.empty();
// Common devices consents change
connection_handler::ConnectionHandler& connection_handler =
application_manager_.connection_handler();
+
if (!device_specific) {
+ // Device ids, need to be changed
+ std::vector<std::string> device_macs;
connection_handler.GetConnectedDevicesMAC(device_macs);
- } else {
- device_macs.push_back(device_mac);
- }
-
- std::vector<std::string>::const_iterator it_ids = device_macs.begin();
- std::vector<std::string>::const_iterator it_ids_end = device_macs.end();
- for (; it_ids != it_ids_end; ++it_ids) {
- const std::string device_id = *it_ids;
+ std::vector<std::string>::const_iterator it_ids = device_macs.begin();
+ std::vector<std::string>::const_iterator it_ids_end = device_macs.end();
+ for (; it_ids != it_ids_end; ++it_ids) {
+ const std::string device_id = *it_ids;
+
+ if (kDefaultDeviceMacAddress == device_id) {
+ LOG4CXX_WARN(logger_,
+ "Device with id " << device_id << " wasn't found.");
+ continue;
+ }
+ policy_manager_->SetUserConsentForDevice(device_id, is_allowed);
+ connection_handler::DeviceHandle device_handle = 0;
+ if (!connection_handler.GetDeviceID(device_id, &device_handle)) {
+ LOG4CXX_WARN(logger_,
+ "Device handle with mac " << device_id
+ << " wasn't found.");
+ }
- if (kDefaultDeviceMacAddress == device_id) {
- LOG4CXX_WARN(logger_, "Device with id " << device_id << " wasn't found.");
- return;
- }
- policy_manager_->SetUserConsentForDevice(device_id, is_allowed);
- uint32_t device_handle = 0;
- if (!connection_handler.GetDeviceID(device_mac, &device_handle)) {
- LOG4CXX_WARN(logger_,
- "Device hadle with mac " << device_mac << " wasn't found.");
+#ifdef EXTERNAL_PROPRIETARY_MODE
+
+ DataAccessor<ApplicationSet> accessor =
+ application_manager_.applications();
+ if (!is_allowed) {
+ std::for_each(
+ accessor.GetData().begin(),
+ accessor.GetData().end(),
+ DeactivateApplication(device_handle,
+ application_manager_.state_controller()));
+#ifdef SDL_REMOTE_CONTROL
+ application_manager_.GetPluginManager().OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationsDisabled);
+#endif // SDL_REMOTE_CONTROL
+ } else {
+ std::for_each(
+ accessor.GetData().begin(),
+ accessor.GetData().end(),
+ SDLAlowedNotification(device_handle,
+ policy_manager_.get(),
+ application_manager_.state_controller()));
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
}
}
// Case, when specific device was changed
+ connection_handler::DeviceHandle device_handle = 0u;
if (device_specific) {
- uint32_t device_handle = 0;
+ policy_manager_->SetUserConsentForDevice(device_mac, is_allowed);
if (!connection_handler.GetDeviceID(device_mac, &device_handle)) {
LOG4CXX_WARN(logger_,
"Device hadle with mac " << device_mac << " wasn't found.");
@@ -948,6 +1228,37 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
pending_device_handles_.erase(it);
}
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+
+ if (last_activated_app_id_) {
+ ApplicationSharedPtr app =
+ application_manager_.application(last_activated_app_id_);
+
+ if (!app) {
+ LOG4CXX_WARN(logger_,
+ "Application with id '"
+ << last_activated_app_id_
+ << "' not found among registered applications.");
+ return;
+ }
+ if (is_allowed) {
+ // Send HMI status notification to mobile
+ // Put application in full
+ AudioStreamingState::eType state = app->is_audio()
+ ? AudioStreamingState::AUDIBLE
+ : AudioStreamingState::NOT_AUDIBLE;
+
+ application_manager_.state_controller().SetRegularState(
+ app, mobile_apis::HMILevel::HMI_FULL, state, true);
+ last_activated_app_id_ = 0;
+ } else {
+ DeactivateApplication deactivate_notification(
+ device_handle, application_manager_.state_controller());
+ deactivate_notification(app);
+ }
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
}
void PolicyHandler::OnIgnitionCycleOver() {
@@ -977,8 +1288,44 @@ void PolicyHandler::OnActivateApp(uint32_t connection_key,
}
} else {
permissions = policy_manager_->GetAppPermissionsChanges(policy_app_id);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ UsageStatistics& usage = app->usage_report();
+
+ usage.RecordAppUserSelection();
+ DeviceParams device_params = GetDeviceParams(
+ app->device(),
+ application_manager_.connection_handler().get_session_observer());
+ permissions.deviceInfo = device_params;
+
+ DeviceConsent consent = policy_manager_->GetUserConsentForDevice(
+ permissions.deviceInfo.device_mac_address);
+ permissions.isSDLAllowed = kDeviceAllowed == consent;
+
+ // According to the SDLAQ-CRS-2794, p.9
+ // 'priority' should be omitted in case when device
+ // is not allowed.
+ if (!permissions.isSDLAllowed) {
+ permissions.priority.clear();
+ last_activated_app_id_ = connection_key;
+ }
+ if (permissions.appRevoked) {
+ usage.RecordRunAttemptsWhileRevoked();
+ }
+
+ // If isSDLAllowed is false, we should provide device params for user
+ // consent
+ if (!permissions.isSDLAllowed) {
+ pending_device_handles_.push_back(permissions.deviceInfo.device_handle);
+ }
+
+ if (permissions.appPermissionsConsentNeeded) {
+ MessageHelper::SendOnAppPermissionsChangedNotification(
+ app->app_id(), permissions, application_manager_);
+ }
+#else // EXTERNAL_PROPRIETARY_MODE
permissions.isSDLAllowed = true;
+#endif // EXTERNAL_PROPRIETARY_MODE
policy_manager_->RemovePendingPermissionChanges(policy_app_id);
}
// If application is revoked it should not be activated
@@ -1006,7 +1353,7 @@ void PolicyHandler::KmsChanged(int kilometers) {
void PolicyHandler::PTExchangeAtUserRequest(uint32_t correlation_id) {
LOG4CXX_TRACE(logger_, "PT exchange at user request");
POLICY_LIB_CHECK_VOID();
- std::string update_status = policy_manager_->ForcePTExchange();
+ std::string update_status = policy_manager_->ForcePTExchangeAtUserRequest();
MessageHelper::SendUpdateSDLResponse(
update_status, correlation_id, application_manager_);
}
@@ -1091,8 +1438,8 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id,
bool PolicyHandler::SaveSnapshot(const BinaryMessage& pt_string,
std::string& snap_path) {
const std::string& policy_snapshot_file_name =
- settings_.policies_snapshot_file_name();
- const std::string& system_files_path = settings_.system_files_path();
+ get_settings().policies_snapshot_file_name();
+ const std::string& system_files_path = get_settings().system_files_path();
snap_path = system_files_path + '/' + policy_snapshot_file_name;
bool result = false;
@@ -1107,32 +1454,56 @@ bool PolicyHandler::SaveSnapshot(const BinaryMessage& pt_string,
return result;
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+void PolicyHandler::OnSnapshotCreated(
+ const BinaryMessage& pt_string,
+ const std::vector<int>& retry_delay_seconds,
+ const uint32_t timeout_exchange_ms) {
+ std::string policy_snapshot_full_path;
+ if (SaveSnapshot(pt_string, policy_snapshot_full_path)) {
+ const uint32_t timeout_exchange_s =
+ timeout_exchange_ms / date_time::DateTime::MILLISECONDS_IN_SECOND;
+ MessageHelper::SendPolicyUpdate(policy_snapshot_full_path,
+ timeout_exchange_s,
+ retry_delay_seconds,
+ application_manager_);
+ }
+}
+#else // EXTERNAL_PROPRIETARY_MODE
void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string) {
LOG4CXX_AUTO_TRACE(logger_);
POLICY_LIB_CHECK_VOID();
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
std::string policy_snapshot_full_path;
if (!SaveSnapshot(pt_string, policy_snapshot_full_path)) {
LOG4CXX_ERROR(logger_, "Snapshot processing skipped.");
return;
}
MessageHelper::SendPolicyUpdate(policy_snapshot_full_path,
- policy_manager_->TimeoutExchange(),
+ TimeoutExchangeSec(),
policy_manager_->RetrySequenceDelaysSeconds(),
application_manager_);
-#else
+#else // PROPRIETARY_MODE
+ LOG4CXX_ERROR(logger_, "HTTP policy");
EndpointUrls urls;
- policy_manager_->GetServiceUrls("0x07", urls);
+ policy_manager_->GetUpdateUrls("0x07", urls);
if (urls.empty()) {
LOG4CXX_ERROR(logger_, "Service URLs are empty! NOT sending PT to mobile!");
return;
}
- SendMessageToSDK(pt_string, urls.front().url.front());
-#endif
+
+ AppIdURL app_url = policy_manager_->GetNextUpdateUrl(urls);
+ while (!IsUrlAppIdValid(app_url.first, urls)) {
+ app_url = policy_manager_->GetNextUpdateUrl(urls);
+ }
+ const std::string& url = urls[app_url.first].url[app_url.second];
+ SendMessageToSDK(pt_string, url);
+#endif // PROPRIETARY_MODE
// reset update required false
OnUpdateRequestSentToMobile();
}
+#endif // EXTERNAL_PROPRIETARY_MODE
bool PolicyHandler::GetPriority(const std::string& policy_app_id,
std::string* priority) const {
@@ -1140,13 +1511,27 @@ bool PolicyHandler::GetPriority(const std::string& policy_app_id,
return policy_manager_->GetPriority(policy_app_id, priority);
}
-void PolicyHandler::CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result) {
+void PolicyHandler::CheckPermissions(
+ const application_manager::ApplicationSharedPtr app,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) {
POLICY_LIB_CHECK_VOID();
- policy_manager_->CheckPermissions(app_id, hmi_level, rpc, rpc_params, result);
+ const std::string hmi_level =
+ MessageHelper::StringifiedHMILevel(app->hmi_level());
+ const std::string device_id = MessageHelper::GetDeviceMacAddressForHandle(
+ app->device(), application_manager_);
+ LOG4CXX_INFO(logger_,
+ "Checking permissions for " << app->policy_app_id() << " in "
+ << hmi_level << " on device "
+ << device_id << " rpc " << rpc);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy_manager_->CheckPermissions(
+ app->policy_app_id(), hmi_level, rpc, rpc_params, result);
+#else // EXTERNAL_PROPRIETARY_MODE
+ policy_manager_->CheckPermissions(
+ device_id, app->policy_app_id(), hmi_level, rpc, rpc_params, result);
+#endif // EXTERNAL_PROPRIETARY_MODE
}
uint32_t PolicyHandler::GetNotificationsNumber(
@@ -1175,10 +1560,16 @@ bool PolicyHandler::GetInitialAppData(const std::string& application_id,
application_id, nicknames, app_hmi_types);
}
-void PolicyHandler::GetServiceUrls(const std::string& service_type,
- EndpointUrls& end_points) {
+void PolicyHandler::GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->GetUpdateUrls(service_type, out_end_points);
+}
+
+void PolicyHandler::GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) {
POLICY_LIB_CHECK_VOID();
- policy_manager_->GetServiceUrls(service_type, end_points);
+ policy_manager_->GetUpdateUrls(service_type, out_end_points);
}
std::string PolicyHandler::GetLockScreenIconUrl() const {
@@ -1186,19 +1577,19 @@ std::string PolicyHandler::GetLockScreenIconUrl() const {
return policy_manager_->GetLockScreenIconUrl();
}
-void PolicyHandler::ResetRetrySequence() {
- POLICY_LIB_CHECK_VOID();
- policy_manager_->ResetRetrySequence();
-}
-
uint32_t PolicyHandler::NextRetryTimeout() {
POLICY_LIB_CHECK(0);
+ LOG4CXX_AUTO_TRACE(logger_);
return policy_manager_->NextRetryTimeout();
}
-int PolicyHandler::TimeoutExchange() {
+uint32_t PolicyHandler::TimeoutExchangeSec() const {
+ return TimeoutExchangeMSec() / date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+uint32_t PolicyHandler::TimeoutExchangeMSec() const {
POLICY_LIB_CHECK(0);
- return policy_manager_->TimeoutExchange();
+ return policy_manager_->TimeoutExchangeMSec();
}
void PolicyHandler::OnExceededTimeout() {
@@ -1292,9 +1683,86 @@ void PolicyHandler::OnUpdateHMIAppType(
(*it)->OnUpdateHMIAppType(app_hmi_types);
}
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) {
LOG4CXX_AUTO_TRACE(logger_);
+ if (certificate_data.empty()) {
+ OnEmptyCertificateArrived();
+ return;
+ }
+
+ const std::string file_name =
+ file_system::GetAbsolutePath(get_settings().app_storage_folder()) + "/" +
+ kCerficateFileName;
+ const bool is_written = file_system::Write(
+ file_name,
+ std::vector<uint8_t>(certificate_data.begin(), certificate_data.end()));
+ LOG4CXX_DEBUG(logger_,
+ "Saving encrypted certificate data: \"" << certificate_data
+ << '"');
+ if (!is_written) {
+ LOG4CXX_ERROR(logger_,
+ "Unable to save encrypted certificate to file " << file_name);
+ return;
+ }
+ LOG4CXX_DEBUG(logger_, "Saved encrypted certificate data" << file_name);
+
+ MessageHelper::SendDecryptCertificateToHMI(file_name, application_manager_);
+}
+
+void PolicyHandler::OnEmptyCertificateArrived() const {
+ LOG4CXX_DEBUG(logger_, "Empty certificate arrived");
+ const std::string empty_certificate;
+ sync_primitives::AutoLock lock(listeners_lock_);
+ std::for_each(
+ listeners_.begin(),
+ listeners_.end(),
+ std::bind2nd(std::mem_fun(&PolicyHandlerObserver::OnCertificateUpdated),
+ empty_certificate));
+}
+
+void PolicyHandler::OnCertificateDecrypted(bool is_succeeded) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK_VOID();
+
+ const std::string file_name =
+ file_system::GetAbsolutePath(get_settings().app_storage_folder()) + +"/" +
+ kCerficateFileName;
+
+ LOG4CXX_DEBUG(logger_, "Loading certificate data from file " << file_name);
+
+ utils::ScopeGuard file_deleter =
+ utils::MakeGuard(file_system::DeleteFile, file_name);
+ UNUSED(file_deleter);
+
+ if (!is_succeeded) {
+ LOG4CXX_ERROR(logger_, "Couldn't delete file " << file_name);
+ return;
+ }
+
+ std::string certificate_data;
+ if (!file_system::ReadFile(file_name, certificate_data)) {
+ LOG4CXX_ERROR(logger_,
+ "Unable to read certificate from file " << file_name);
+ return;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Loaded decrypted certificate data: \"" << certificate_data
+ << '"');
+
+ policy_manager_->SetDecryptedCertificate(certificate_data);
+
+ sync_primitives::AutoLock lock(listeners_lock_);
+ std::for_each(
+ listeners_.begin(),
+ listeners_.end(),
+ std::bind2nd(std::mem_fun(&PolicyHandlerObserver::OnCertificateUpdated),
+ certificate_data));
+}
+#else // EXTERNAL_PROPRIETARY_MODE
+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) {
@@ -1302,6 +1770,18 @@ void PolicyHandler::OnCertificateUpdated(const std::string& certificate_data) {
observer->OnCertificateUpdated(certificate_data);
}
}
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+void PolicyHandler::OnPTUFinished(const bool ptu_result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(listeners_lock_);
+
+ std::for_each(
+ listeners_.begin(),
+ listeners_.end(),
+ std::bind2nd(std::mem_fun(&PolicyHandlerObserver::OnPTUFinished),
+ ptu_result));
+}
bool PolicyHandler::CanUpdate() {
return 0 != GetAppIdForSending();
@@ -1312,6 +1792,17 @@ void PolicyHandler::RemoveDevice(const std::string& device_id) {
POLICY_LIB_CHECK_VOID();
policy_manager_->MarkUnpairedDevice(device_id);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ connection_handler::DeviceHandle device_uid;
+ if (application_manager_.connection_handler().GetDeviceID(device_id,
+ &device_uid)) {
+ DataAccessor<ApplicationSet> accessor = application_manager_.applications();
+ std::for_each(accessor.GetData().begin(),
+ accessor.GetData().end(),
+ DeactivateApplication(
+ device_uid, application_manager_.state_controller()));
+ }
+#endif // EXTERNAL_PROPRIETARY_MODE
}
bool PolicyHandler::IsApplicationRevoked(const std::string& app_id) {
@@ -1365,7 +1856,7 @@ const std::string PolicyHandler::RemoteAppsUrl() const {
const std::string default_url;
POLICY_LIB_CHECK(default_url);
EndpointUrls endpoints;
- policy_manager_->GetServiceUrls("queryAppsUrl", endpoints);
+ policy_manager_->GetUpdateUrls("queryAppsUrl", endpoints);
if (endpoints.empty() || endpoints[0].url.empty()) {
return default_url;
}
@@ -1373,14 +1864,14 @@ const std::string PolicyHandler::RemoteAppsUrl() const {
return endpoints[0].url[0];
}
-void policy::PolicyHandler::OnAppsSearchStarted() {
+void PolicyHandler::OnAppsSearchStarted() {
POLICY_LIB_CHECK();
policy_manager_->OnAppsSearchStarted();
}
-void PolicyHandler::OnAppsSearchCompleted() {
+void PolicyHandler::OnAppsSearchCompleted(const bool trigger_ptu) {
POLICY_LIB_CHECK();
- policy_manager_->OnAppsSearchCompleted();
+ policy_manager_->OnAppsSearchCompleted(trigger_ptu);
}
void PolicyHandler::OnAppRegisteredOnMobile(const std::string& application_id) {
@@ -1424,6 +1915,13 @@ const VehicleInfo policy::PolicyHandler::GetVehicleInfo() const {
return policy_manager_->GetVehicleInfo();
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+const MetaInfo PolicyHandler::GetMetaInfo() const {
+ POLICY_LIB_CHECK(MetaInfo());
+ return policy_manager_->GetMetaInfo();
+}
+#endif // EXTERNAL_PROPRIETARY_MODE
+
void PolicyHandler::Increment(usage_statistics::GlobalCounterId type) {
POLICY_LIB_CHECK();
policy_manager_->Increment(type);
@@ -1449,4 +1947,154 @@ void PolicyHandler::Add(const std::string& app_id,
policy_manager_->Add(app_id, type, timespan_seconds);
}
+bool PolicyHandler::IsUrlAppIdValid(const uint32_t app_idx,
+ const EndpointUrls& urls) const {
+ const EndpointData& app_data = urls[app_idx];
+ const std::vector<std::string> app_urls = app_data.url;
+ const ApplicationSharedPtr app =
+ application_manager_.application_by_policy_id(app_data.app_id);
+
+ const bool is_registered = (app && (app->IsRegistered()));
+ const bool is_default = (app_data.app_id == policy::kDefaultId);
+ const bool is_empty_urls = app_urls.empty();
+
+ return ((is_registered && !is_empty_urls) || is_default);
+}
+
+#ifdef SDL_REMOTE_CONTROL
+
+std::vector<std::string> PolicyHandler::GetDevicesIds(
+ const std::string& policy_app_id) {
+ return application_manager_.devices(policy_app_id);
+}
+
+void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+ if (app->hmi_level() == mobile_apis::HMILevel::HMI_NONE) {
+ // If default is FULL, send request to HMI. Notification to mobile will be
+ // sent on response receiving.
+ if (mobile_apis::HMILevel::HMI_FULL == level) {
+ MessageHelper::SendActivateAppToHMI(app->app_id(), application_manager_);
+ } else {
+ LOG4CXX_INFO(logger_,
+ "Changing hmi level of application "
+ << app->app_id() << " to default hmi level " << level);
+ // Set application hmi level
+ application_manager_.ChangeAppsHMILevel(app->app_id(), level);
+ // If hmi Level is full, it will be seted after ActivateApp response
+ MessageHelper::SendHMIStatusNotification(*app, application_manager_);
+ }
+ }
+}
+
+bool PolicyHandler::CheckModule(const PTString& app_id,
+ const PTString& module) {
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->CheckModule(app_id, module);
+}
+
+void PolicyHandler::OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) {
+ POLICY_LIB_CHECK_VOID();
+ policy_manager_->SendAppPermissionsChanged(device_id, application_id);
+}
+
+void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app =
+ application_manager_.application(device_id, policy_app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_,
+ "Could not find application: " << device_id << " - "
+ << policy_app_id);
+ return;
+ }
+ mobile_apis::HMILevel::eType level =
+ MessageHelper::StringToHMILevel(hmi_level);
+ if (mobile_apis::HMILevel::INVALID_ENUM == level) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't convert default hmi level " << hmi_level
+ << " to enum.");
+ return;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "Changing hmi level of application "
+ << app->app_id() << " to default hmi level " << level);
+ // Set application hmi level
+ application_manager_.ChangeAppsHMILevel(app->app_id(), level);
+ MessageHelper::SendHMIStatusNotification(*app, application_manager_);
+}
+
+bool PolicyHandler::GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->GetModuleTypes(policy_app_id, modules);
+}
+
+void PolicyHandler::SetDefaultHmiTypes(
+ const std::string& application_id,
+ const smart_objects::SmartObject* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK_VOID();
+ std::vector<int> hmi_types;
+ if (app_types && app_types->asArray()) {
+ smart_objects::SmartArray* hmi_list = app_types->asArray();
+ std::transform(hmi_list->begin(),
+ hmi_list->end(),
+ std::back_inserter(hmi_types),
+ SmartObjectToInt());
+ }
+ policy_manager_->SetDefaultHmiTypes(application_id, hmi_types);
+}
+
+bool PolicyHandler::CheckHMIType(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ POLICY_LIB_CHECK(false);
+ std::vector<int> policy_hmi_types;
+ bool ret = policy_manager_->GetHMITypes(application_id, &policy_hmi_types);
+
+ std::vector<int> additional_hmi_types;
+ if (app_types && app_types->asArray()) {
+ smart_objects::SmartArray* hmi_list = app_types->asArray();
+ std::transform(hmi_list->begin(),
+ hmi_list->end(),
+ std::back_inserter(additional_hmi_types),
+ SmartObjectToInt());
+ }
+ const std::vector<int>& hmi_types =
+ ret ? policy_hmi_types : additional_hmi_types;
+ return std::find(hmi_types.begin(), hmi_types.end(), hmi) != hmi_types.end();
+}
+
+void PolicyHandler::OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ApplicationSharedPtr app =
+ application_manager_.application(device_id, policy_app_id);
+ if (!app) {
+ LOG4CXX_WARN(logger_,
+ "Could not find application: " << device_id << " - "
+ << policy_app_id);
+ return;
+ }
+ mobile_apis::HMILevel::eType level =
+ MessageHelper::StringToHMILevel(hmi_level);
+ if (mobile_apis::HMILevel::INVALID_ENUM == level) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't convert default hmi level " << hmi_level
+ << " to enum.");
+ return;
+ }
+ UpdateHMILevel(app, level);
+}
+#endif // SDL_REMOTE_CONTROL
} // namespace policy
diff --git a/src/components/application_manager/src/policies/policy_retry_sequence.cc b/src/components/application_manager/src/policies/policy_retry_sequence.cc
index a88aef0cc1..7d24d0b35c 100644
--- a/src/components/application_manager/src/policies/policy_retry_sequence.cc
+++ b/src/components/application_manager/src/policies/policy_retry_sequence.cc
@@ -57,7 +57,7 @@ void RetrySequence::StartNextRetry() {
if (pt_snapshot) {
policy_handler_->SendMessageToSDK(*pt_snapshot);
- const int timeout = policy_handler_->TimeoutExchange();
+ const uint32_t timeout = policy_handler_->TimeoutExchangeSec();
const int seconds = policy_handler_->NextRetryTimeout();
LOG4CXX_DEBUG(logger_,
"Timeout response: " << timeout << " Next try: " << seconds);
@@ -70,6 +70,7 @@ void RetrySequence::StartNextRetry() {
StartNextRetry();
} else {
LOG4CXX_INFO(logger_, "End retry sequence. Update PT was not received");
+ policy_handler_->OnPTUFinished(false);
}
}
}
diff --git a/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc b/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc
deleted file mode 100644
index e1d5199063..0000000000
--- a/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/policies/pt_exchange_handler_ext.h"
-
-#include <fstream>
-#include <string>
-
-#include "application_manager/message_helper.h"
-#include "config_profile/profile.h"
-#include "utils/file_system.h"
-
-using application_manager::MessageHelper;
-using profile::Profile;
-using std::string;
-
-namespace policy {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
-
-PTExchangeHandlerExt::PTExchangeHandlerExt(PolicyHandler* policy_handler)
- : PTExchangeHandler(), policy_handler_(policy_handler) {
- DCHECK(policy_handler_);
-}
-
-PTExchangeHandlerExt::~PTExchangeHandlerExt() {}
-
-void PTExchangeHandlerExt::Start() {
- LOG4CXX_TRACE(logger_, "Start exchange PT");
-
- const string policy_snapshot_file_name =
- policy_handler_->get_settings().policies_snapshot_file_name();
- const std::string system_files_path =
- policy_handler_->get_settings().system_files_path();
- const std::string policy_snapshot_full_path =
- system_files_path + '/' + policy_snapshot_file_name;
- BinaryMessageSptr pt_snapshot = policy_handler_->RequestPTUpdate();
- if (pt_snapshot.valid()) {
- if (file_system::CreateDirectoryRecursively(system_files_path) &&
- file_system::WriteBinaryFile(policy_snapshot_full_path, *pt_snapshot)) {
- MessageHelper::SendPolicyUpdate(
- policy_snapshot_full_path,
- policy_handler_->TimeoutExchange(),
- policy_handler_->RetrySequenceDelaysSeconds());
- } else {
- LOG4CXX_ERROR(logger_,
- "Failed to write snapshot file to "
- << policy_snapshot_file_name);
- }
- } else {
- LOG4CXX_ERROR(logger_, "Failed to obtain policy table snapshot");
- }
-}
-
-void PTExchangeHandlerExt::Stop() {
- // Nothing doing
-}
-
-} // namespace policy
diff --git a/src/components/application_manager/src/policies/pt_exchange_handler_impl.cc b/src/components/application_manager/src/policies/pt_exchange_handler_impl.cc
deleted file mode 100644
index d1c6fafb07..0000000000
--- a/src/components/application_manager/src/policies/pt_exchange_handler_impl.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "application_manager/policies/pt_exchange_handler_impl.h"
-
-#include "utils/logger.h"
-#include "application_manager/policies/policy_handler.h"
-#include "application_manager/policies/policy_retry_sequence.h"
-#include "utils/threads/thread_manager.h"
-
-namespace policy {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler")
-
-PTExchangeHandlerImpl::PTExchangeHandlerImpl(PolicyHandler* handler)
- : policy_handler_(handler)
- , retry_sequence_(
- threads::CreateThread("RetrySequence", new RetrySequence(handler))) {
- DCHECK(policy_handler_);
- LOG4CXX_INFO(logger_, "Exchan created");
-}
-
-PTExchangeHandlerImpl::~PTExchangeHandlerImpl() {
- Stop();
- policy_handler_ = NULL;
-}
-
-void PTExchangeHandlerImpl::Start() {
- sync_primitives::AutoLock locker(retry_sequence_lock_);
- LOG4CXX_INFO(logger_, "Exchan started");
-
- retry_sequence_->stop();
- threads::DeleteThread(retry_sequence_);
- retry_sequence_ = threads::CreateThread("RetrySequence",
- new RetrySequence(policy_handler_));
-
- if (policy_handler_) {
- policy_handler_->ResetRetrySequence();
- }
- retry_sequence_->start();
-}
-
-void PTExchangeHandlerImpl::Stop() {
- sync_primitives::AutoLock locker(retry_sequence_lock_);
- if (retry_sequence_->is_running()) {
- retry_sequence_->stop();
- }
-}
-
-} // namespace policy
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index aa2a3d7c5d..1b9bd7ffb9 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -49,6 +49,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RequestController")
RequestController::RequestController(const RequestControlerSettings& settings)
: pool_state_(UNDEFINED)
, pool_size_(settings.thread_pool_size())
+ , request_tracker_(settings)
, timer_("AM RequestCtrlTimer",
new timer::TimerTaskImpl<RequestController>(
this, &RequestController::TimeoutThread))
@@ -62,8 +63,11 @@ RequestController::RequestController(const RequestControlerSettings& settings)
RequestController::~RequestController() {
LOG4CXX_AUTO_TRACE(logger_);
- timer_stop_flag_ = true;
- timer_condition_.Broadcast();
+ {
+ sync_primitives::AutoLock auto_lock(timer_lock);
+ timer_stop_flag_ = true;
+ timer_condition_.Broadcast();
+ }
timer_.Stop();
if (pool_state_ != TPoolState::STOPPED) {
DestroyThreadpool();
@@ -101,42 +105,26 @@ void RequestController::DestroyThreadpool() {
}
RequestController::TResult RequestController::CheckPosibilitytoAdd(
- const RequestPtr request) {
+ const RequestPtr request, const mobile_apis::HMILevel::eType level) {
LOG4CXX_AUTO_TRACE(logger_);
- const uint32_t& app_hmi_level_none_time_scale =
- settings_.app_hmi_level_none_time_scale();
-
- // app_hmi_level_none_max_request_per_time_scale
- const uint32_t& hmi_level_none_count =
- settings_.app_hmi_level_none_time_scale_max_requests();
-
- const uint32_t& app_time_scale = settings_.app_time_scale();
-
- const uint32_t& max_request_per_time_scale =
- settings_.app_time_scale_max_requests();
-
- const uint32_t& pending_requests_amount = settings_.pending_requests_amount();
-
- if (!CheckPendingRequestsAmount(pending_requests_amount)) {
+ if (!CheckPendingRequestsAmount(settings_.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,
- hmi_level_none_count)) {
+ const TrackResult track_result =
+ request_tracker_.Track(request->connection_key(), level);
+
+ if (TrackResult::kNoneLevelMaxRequestsExceeded == track_result) {
LOG4CXX_ERROR(logger_, "Too many application requests in hmi level NONE");
return RequestController::NONE_HMI_LEVEL_MANY_REQUESTS;
}
- if (!waiting_for_response_.CheckTimeScaleMaxRequest(
- request->connection_key(),
- app_time_scale,
- max_request_per_time_scale)) {
+
+ if (TrackResult::kMaxRequestsExceeded == track_result) {
LOG4CXX_ERROR(logger_, "Too many application requests");
return RequestController::TOO_MANY_REQUESTS;
}
+
return SUCCESS;
}
@@ -171,7 +159,7 @@ RequestController::TResult RequestController::addMobileRequest(
logger_,
"correlation_id : " << request->correlation_id()
<< "connection_key : " << request->connection_key());
- RequestController::TResult result = CheckPosibilitytoAdd(request);
+ RequestController::TResult result = CheckPosibilitytoAdd(request, hmi_level);
if (SUCCESS == result) {
AutoLock auto_lock_list(mobile_request_list_lock_);
mobile_request_list_.push_back(request);
@@ -224,12 +212,12 @@ void RequestController::removeNotification(
if (it->get() == notification) {
notification_list_.erase(it++);
LOG4CXX_DEBUG(logger_, "Notification removed");
- break;
+ return;
} else {
++it;
}
}
- LOG4CXX_DEBUG(logger_, "Cant find notification");
+ LOG4CXX_DEBUG(logger_, "Cannot find notification");
}
void RequestController::TerminateRequest(const uint32_t correlation_id,
@@ -385,11 +373,11 @@ void RequestController::TimeoutThread() {
LOG4CXX_DEBUG(
logger_,
"ENTER Waiting fore response count: " << waiting_for_response_.Size());
+ sync_primitives::AutoLock auto_lock(timer_lock);
while (!timer_stop_flag_) {
RequestInfoPtr probably_expired =
waiting_for_response_.FrontWithNotNullTimeout();
if (!probably_expired) {
- sync_primitives::AutoLock auto_lock(timer_lock);
timer_condition_.Wait(auto_lock);
continue;
}
@@ -403,7 +391,6 @@ void RequestController::TimeoutThread() {
<< " request id: " << probably_expired->requestId()
<< " connection_key: " << probably_expired->app_id()
<< " NOT expired");
- sync_primitives::AutoLock auto_lock(timer_lock);
const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
const TimevalStruct end_time = probably_expired->end_time();
if (current_time < end_time) {
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc
index 80b18a53c6..9a5828d939 100644
--- a/src/components/application_manager/src/request_info.cc
+++ b/src/components/application_manager/src/request_info.cc
@@ -268,66 +268,6 @@ void RequestInfoSet::CheckSetSizes() {
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_) {
diff --git a/src/components/application_manager/src/request_tracker.cc b/src/components/application_manager/src/request_tracker.cc
new file mode 100644
index 0000000000..13b3d4d873
--- /dev/null
+++ b/src/components/application_manager/src/request_tracker.cc
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2017, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "utils/logger.h"
+#include "utils/macro.h"
+#include "application_manager/request_tracker.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace request_controller {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RequestController")
+
+RequestTracker::RequestTracker(const RequestControlerSettings& settings)
+ : settings_(settings) {}
+
+TrackResult RequestTracker::Track(const ApplicationID& app_id,
+ const mobile_apis::HMILevel::eType level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool track_result = false;
+
+ LOG4CXX_DEBUG(logger_,
+ "Tracking request for level: "
+ << MessageHelper::StringifiedHMILevel(level));
+
+ if (mobile_apis::HMILevel::HMI_NONE == level) {
+ track_result = Track(app_id,
+ settings_.app_hmi_level_none_time_scale(),
+ settings_.app_hmi_level_none_time_scale_max_requests(),
+ none_level_tracker_);
+
+ return track_result ? TrackResult::kSuccess
+ : TrackResult::kNoneLevelMaxRequestsExceeded;
+ }
+
+ track_result = Track(app_id,
+ settings_.app_time_scale(),
+ settings_.app_time_scale_max_requests(),
+ tracker_);
+
+ return track_result ? TrackResult::kSuccess
+ : TrackResult::kMaxRequestsExceeded;
+}
+
+bool RequestTracker::Track(const ApplicationID& app_id,
+ const uint32_t time_scale,
+ const uint32_t max_requests,
+ ApplicationsRequestsTracker& tracker) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using date_time::DateTime;
+
+ if (!time_scale || !max_requests) {
+ LOG4CXX_INFO(logger_, "Time scale request tracking is disabled.");
+ return true;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Time scale is: " << time_scale << ". Max requests number is: "
+ << max_requests);
+
+ LOG4CXX_DEBUG(logger_, "Tracking app id: " << app_id);
+ ApplicationsRequestsTracker::iterator it_app = tracker.find(app_id);
+
+ if (tracker.end() == it_app) {
+ LOG4CXX_DEBUG(logger_, "Adding new application into tracking.");
+ tracker[app_id].push_back(DateTime::getCurrentTime());
+ return true;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Amount of known requests is: " << it_app->second.size());
+
+ if (it_app->second.size() < max_requests) {
+ LOG4CXX_DEBUG(logger_, "Adding new request into tracking.");
+ tracker[app_id].push_back(DateTime::getCurrentTime());
+ return true;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Oldest request is added at: "
+ << DateTime::getmSecs(it_app->second.front())
+ << ". Current time is: "
+ << DateTime::getmSecs(DateTime::getCurrentTime())
+ << ". Time scale is: " << time_scale);
+
+ if (DateTime::calculateTimeSpan(it_app->second.front()) > time_scale) {
+ LOG4CXX_DEBUG(logger_, "Dropping oldest request, adding new one.");
+ ApplicationsRequestsTracker::mapped_type& times = tracker[app_id];
+
+ DCHECK_OR_RETURN(!times.empty(), false);
+
+ times.erase(times.begin());
+ times.push_back(DateTime::getCurrentTime());
+ return true;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Requests amount per time scale is exceeded.");
+
+ return false;
+}
+
+} // namespace request_controller
+} // namespace application_manager
diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
index ad50bbf104..e3fd423970 100644
--- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
+++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc
@@ -67,6 +67,7 @@ ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager)
this, &ResumeCtrlImpl::SaveDataOnTimer))
, is_resumption_active_(false)
, is_data_saved_(false)
+ , is_suspended_(false)
, launch_time_(time(NULL))
, application_manager_(application_manager) {}
#ifdef BUILD_TESTS
@@ -263,16 +264,25 @@ bool ResumeCtrlImpl::RemoveApplicationFromSaved(
void ResumeCtrlImpl::OnSuspend() {
LOG4CXX_AUTO_TRACE(logger_);
- StopSavePersistentDataTimer();
- SaveAllApplications();
- resumption_storage_->OnSuspend();
- resumption_storage_->Persist();
+ is_suspended_ = true;
+ FinalPersistData();
+}
+
+void ResumeCtrlImpl::OnIgnitionOff() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ resumption_storage_->IncrementIgnOffCount();
+ FinalPersistData();
}
void ResumeCtrlImpl::OnAwake() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_suspended_ = false;
ResetLaunchTime();
StartSavePersistentDataTimer();
- return resumption_storage_->OnAwake();
+}
+
+bool ResumeCtrlImpl::is_suspended() const {
+ return is_suspended_;
}
void ResumeCtrlImpl::StartSavePersistentDataTimer() {
@@ -433,6 +443,13 @@ void ResumeCtrlImpl::SaveDataOnTimer() {
}
}
+void ResumeCtrlImpl::FinalPersistData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ StopSavePersistentDataTimer();
+ SaveAllApplications();
+ resumption_storage_->Persist();
+}
+
bool ResumeCtrlImpl::IsDeviceMacAddressEqual(
ApplicationSharedPtr application, const std::string& saved_device_mac) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -580,7 +597,7 @@ void ResumeCtrlImpl::AddWayPointsSubscription(
const smart_objects::SmartObject& subscribed_for_way_points_so =
saved_app[strings::subscribed_for_way_points];
if (true == subscribed_for_way_points_so.asBool()) {
- application_manager_.SubscribeAppForWayPoints(application->app_id());
+ application_manager_.SubscribeAppForWayPoints(application);
}
}
}
@@ -589,29 +606,30 @@ void ResumeCtrlImpl::AddSubscriptions(
ApplicationSharedPtr application,
const smart_objects::SmartObject& saved_app) {
LOG4CXX_AUTO_TRACE(logger_);
- if (saved_app.keyExists(strings::application_subscribtions)) {
- const smart_objects::SmartObject& subscribtions =
- saved_app[strings::application_subscribtions];
+ if (saved_app.keyExists(strings::application_subscriptions)) {
+ const smart_objects::SmartObject& subscriptions =
+ saved_app[strings::application_subscriptions];
- if (subscribtions.keyExists(strings::application_buttons)) {
- const smart_objects::SmartObject& subscribtions_buttons =
- subscribtions[strings::application_buttons];
+ if (subscriptions.keyExists(strings::application_buttons)) {
+ const smart_objects::SmartObject& subscriptions_buttons =
+ subscriptions[strings::application_buttons];
mobile_apis::ButtonName::eType btn;
- for (size_t i = 0; i < subscribtions_buttons.length(); ++i) {
+ for (size_t i = 0; i < subscriptions_buttons.length(); ++i) {
btn = static_cast<mobile_apis::ButtonName::eType>(
- (subscribtions_buttons[i]).asInt());
+ (subscriptions_buttons[i]).asInt());
application->SubscribeToButton(btn);
}
}
MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
application, application_manager_);
- if (subscribtions.keyExists(strings::application_vehicle_info)) {
- const smart_objects::SmartObject& subscribtions_ivi =
- subscribtions[strings::application_vehicle_info];
- VehicleDataType ivi;
- for (size_t i = 0; i < subscribtions_ivi.length(); ++i) {
- ivi = static_cast<VehicleDataType>((subscribtions_ivi[i]).asInt());
+ if (subscriptions.keyExists(strings::application_vehicle_info)) {
+ const smart_objects::SmartObject& subscriptions_ivi =
+ subscriptions[strings::application_vehicle_info];
+ mobile_apis::VehicleDataType::eType ivi;
+ for (size_t i = 0; i < subscriptions_ivi.length(); ++i) {
+ ivi = static_cast<mobile_apis::VehicleDataType::eType>(
+ (subscriptions_ivi[i]).asInt());
application->SubscribeToIVI(ivi);
}
ProcessHMIRequests(MessageHelper::GetIVISubscriptionRequests(
@@ -644,7 +662,7 @@ bool ResumeCtrlImpl::DisconnectedJustBeforeIgnOff(
DCHECK_OR_RETURN(saved_app.keyExists(strings::time_stamp), false);
const time_t time_stamp =
- static_cast<time_t>(saved_app[strings::time_stamp].asUInt());
+ static_cast<time_t>(saved_app[strings::time_stamp].asInt());
time_t ign_off_time =
static_cast<time_t>(resumption_storage_->GetIgnOffTime());
const uint32_t sec_spent_before_ign = labs(ign_off_time - time_stamp);
@@ -773,7 +791,7 @@ void ResumeCtrlImpl::LoadResumeData() {
"Resumption data for application "
<< app_id << " and device id " << device_id
<< " will be dropped.");
- resumption_storage_->DropAppDataResumption(device_id, app_id);
+ resumption_storage_->RemoveApplicationFromSaved(app_id, device_id);
continue;
}
}
@@ -798,9 +816,13 @@ void ResumeCtrlImpl::OnAppRegistrationEnd() {
int32_t ResumeCtrlImpl::GetSavedAppHmiLevel(
const std::string& app_id, const std::string& device_id) const {
+ using namespace mobile_apis;
smart_objects::SmartObject saved_app;
if (resumption_storage_->GetSavedApplication(app_id, device_id, saved_app)) {
- const int32_t saved_hmi_level = saved_app[strings::hmi_level].asInt();
+ const HMILevel::eType saved_hmi_level =
+ static_cast<mobile_apis::HMILevel::eType>(
+ saved_app[strings::hmi_level].asInt());
+
return saved_hmi_level;
}
return static_cast<int32_t>(mobile_apis::HMILevel::INVALID_ENUM);
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 273cd5413e..bd5bdbddab 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -33,7 +33,6 @@
#include "application_manager/resumption/resumption_data.h"
#include "utils/logger.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/vehicle_info_data.h"
#include "application_manager/application_manager_settings.h"
namespace resumption {
diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc
index 08de6d8190..2fe7330a9c 100644
--- a/src/components/application_manager/src/resumption/resumption_data_db.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_db.cc
@@ -212,7 +212,9 @@ uint32_t ResumptionDataDB::GetHMIApplicationID(
return hmi_app_id;
}
-void ResumptionDataDB::OnSuspend() {
+DEPRECATED void ResumptionDataDB::OnSuspend() {}
+
+void ResumptionDataDB::IncrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
utils::dbms::SQLQuery query_update_suspend_data(db());
@@ -291,7 +293,9 @@ bool ResumptionDataDB::GetHashId(const std::string& policy_app_id,
return SelectHashId(policy_app_id, device_id, hash_id);
}
-void ResumptionDataDB::OnAwake() {
+DEPRECATED void ResumptionDataDB::OnAwake() {}
+
+void ResumptionDataDB::DecrementIgnOffCount() {
LOG4CXX_AUTO_TRACE(logger_);
UpdateDataOnAwake();
@@ -949,7 +953,7 @@ bool ResumptionDataDB::SelectSubscriptionsData(
return false;
}
- saved_app[strings::application_subscribtions] = SmartObject(SmartType_Map);
+ saved_app[strings::application_subscriptions] = SmartObject(SmartType_Map);
if (0 == count_item) {
LOG4CXX_INFO(logger_, "Application does not contain subscriptions data");
@@ -968,8 +972,8 @@ bool ResumptionDataDB::SelectSubscriptionsData(
size_t buttons_idx = 0;
size_t vi_idx = 0;
/* Position of data in "select_subscriptions" :
- field "vehicleValue" from table "applicationSubscribtionsArray" = 0
- field "ButtonNameValue" from table "applicationSubscribtionsArray" = 1*/
+ field "vehicleValue" from table "applicationSubscriptionsArray" = 0
+ field "ButtonNameValue" from table "applicationSubscriptionsArray" = 1*/
while (select_subscriptions.Next()) {
if (!select_subscriptions.IsNull(0)) {
application_vehicle_info[vi_idx++] = select_subscriptions.GetInteger(0);
@@ -979,12 +983,12 @@ bool ResumptionDataDB::SelectSubscriptionsData(
}
}
if (!application_buttons.empty()) {
- saved_app[strings::application_subscribtions]
+ saved_app[strings::application_subscriptions]
[strings::application_buttons] = application_buttons;
}
if (!application_vehicle_info.empty()) {
- saved_app[strings::application_subscribtions]
+ saved_app[strings::application_subscriptions]
[strings::application_vehicle_info] = application_vehicle_info;
}
LOG4CXX_INFO(logger_, "Subscriptions were restored from DB successfully");
@@ -1500,9 +1504,9 @@ bool ResumptionDataDB::DeleteSavedSubscriptions(
LOG4CXX_AUTO_TRACE(logger_);
if (!ExecQueryToDeleteData(
- policy_app_id, device_id, kDeleteApplicationSubscribtionsArray)) {
+ policy_app_id, device_id, kDeleteApplicationSubscriptionsArray)) {
LOG4CXX_WARN(logger_,
- "Incorrect delete from applicationSubscribtionsArray.");
+ "Incorrect delete from applicationSubscriptionsArray.");
return false;
}
return true;
@@ -1895,7 +1899,7 @@ bool ResumptionDataDB::SaveApplicationToDB(
}
if (!InsertSubscriptionsData(GetApplicationSubscriptions(application),
application_primary_key)) {
- LOG4CXX_WARN(logger_, "Incorrect insert subscribtions data to DB.");
+ LOG4CXX_WARN(logger_, "Incorrect insert subscriptions data to DB.");
db_->RollbackTransaction();
return false;
}
@@ -1952,9 +1956,9 @@ bool ResumptionDataDB::SaveApplicationToDB(
db_->RollbackTransaction();
return false;
}
- if (!InsertSubscriptionsData(application["subscribtions"],
+ if (!InsertSubscriptionsData(application["subscriptions"],
application_primary_key)) {
- LOG4CXX_WARN(logger_, "Incorrect insert subscribtions data to DB.");
+ LOG4CXX_WARN(logger_, "Incorrect insert subscriptions data to DB.");
db_->RollbackTransaction();
return false;
}
@@ -2160,9 +2164,9 @@ bool ResumptionDataDB::InsertSubscriptionsData(
return false;
}
/* Positions of binding data for "insert_subscriptions":
- field "idApplication" from table "applicationSubscribtionsArray" = 0
- field "vehicleValue" from table "applicationSubscribtionsArray" = 1
- field "ButtonNameValue" from table "applicationSubscribtionsArray" = 2*/
+ field "idApplication" from table "applicationSubscriptionsArray" = 0
+ field "vehicleValue" from table "applicationSubscriptionsArray" = 1
+ field "ButtonNameValue" from table "applicationSubscriptionsArray" = 2*/
for (size_t i = 0; i < max_length; ++i) {
insert_subscriptions.Bind(0, application_primary_key);
if (i < vi_sub_length) {
@@ -2578,7 +2582,7 @@ bool ResumptionDataDB::InsertApplicationData(
const mobile_apis::HMILevel::eType hmi_level = application.m_hmi_level;
bool is_media_application = application.m_is_media_application;
bool is_subscribed_for_way_points =
- application_manager_.IsAppSubscribedForWayPoints(connection_key);
+ application_manager_.IsAppSubscribedForWayPoints(application.app_ptr);
if (!query.Prepare(kInsertApplication)) {
LOG4CXX_WARN(logger_,
@@ -2804,6 +2808,7 @@ ApplicationParams::ApplicationParams(app_mngr::ApplicationSharedPtr application)
m_hmi_app_id = application->hmi_app_id();
m_hmi_level = application->hmi_level();
m_is_media_application = application->IsAudioApplication();
+ app_ptr = application;
}
}
diff --git a/src/components/application_manager/src/resumption/resumption_data_json.cc b/src/components/application_manager/src/resumption/resumption_data_json.cc
index f60f934fef..b6a50fd5de 100644
--- a/src/components/application_manager/src/resumption/resumption_data_json.cc
+++ b/src/components/application_manager/src/resumption/resumption_data_json.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -66,7 +66,7 @@ void ResumptionDataJson::SaveApplication(
const std::string device_mac = application->mac_address();
const mobile_apis::HMILevel::eType hmi_level = application->hmi_level();
const bool is_subscribed_for_way_points =
- application_manager_.IsAppSubscribedForWayPoints(application->app_id());
+ application_manager_.IsAppSubscribedForWayPoints(application);
sync_primitives::AutoLock autolock(resumption_lock_);
Json::Value tmp;
@@ -95,7 +95,7 @@ void ResumptionDataJson::SaveApplication(
json_app[strings::application_global_properties] = tmp;
Formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationSubscriptions(application), tmp);
- json_app[strings::application_subscribtions] = tmp;
+ json_app[strings::application_subscriptions] = tmp;
Formatters::CFormatterJsonBase::objToJsonValue(
GetApplicationFiles(application), tmp);
json_app[strings::application_files] = tmp;
@@ -143,11 +143,13 @@ uint32_t ResumptionDataJson::GetHMIApplicationID(
return hmi_app_id;
}
-void ResumptionDataJson::OnSuspend() {
+DEPRECATED void ResumptionDataJson::OnSuspend() {}
+
+void ResumptionDataJson::IncrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock autolock(resumption_lock_);
- Json::Value to_save;
+ Json::Value to_save = Json::arrayValue;
for (Json::Value::iterator it = GetSavedApplications().begin();
it != GetSavedApplications().end();
++it) {
@@ -167,7 +169,9 @@ void ResumptionDataJson::OnSuspend() {
LOG4CXX_DEBUG(logger_, GetResumptionData().toStyledString());
}
-void ResumptionDataJson::OnAwake() {
+DEPRECATED void ResumptionDataJson::OnAwake() {}
+
+void ResumptionDataJson::DecrementIgnOffCount() {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock autolock(resumption_lock_);
@@ -372,10 +376,9 @@ Json::Value& ResumptionDataJson::GetResumptionData() const {
using namespace app_mngr;
LOG4CXX_AUTO_TRACE(logger_);
sync_primitives::AutoLock autolock(resumption_lock_);
- Json::Value& dictionary = last_state().dictionary;
+ Json::Value& dictionary = last_state().get_dictionary();
if (!dictionary.isMember(strings::resumption)) {
- last_state().dictionary[strings::resumption] =
- Json::Value(Json::objectValue);
+ dictionary[strings::resumption] = Json::Value(Json::objectValue);
LOG4CXX_WARN(logger_, "resumption section is missed");
}
Json::Value& resumption = dictionary[strings::resumption];
@@ -470,7 +473,7 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id,
application[strings::application_submenus].clear();
application[strings::application_choice_sets].clear();
application[strings::application_global_properties].clear();
- application[strings::application_subscribtions].clear();
+ application[strings::application_subscriptions].clear();
application[strings::application_files].clear();
application.removeMember(strings::grammar_id);
LOG4CXX_DEBUG(logger_,
@@ -481,7 +484,10 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id,
}
void ResumptionDataJson::Persist() {
- last_state().SaveToFileSystem();
+ // We lock the resumption data because SaveStateToFileSystem accesses
+ // the same dictionary that we use here in ResumptionDataJson
+ sync_primitives::AutoLock autolock(resumption_lock_);
+ last_state().SaveStateToFileSystem();
}
} // resumption
diff --git a/src/components/application_manager/src/resumption/resumption_sql_queries.cc b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
index 5f318e6955..9ca91e859a 100644
--- a/src/components/application_manager/src/resumption/resumption_sql_queries.cc
+++ b/src/components/application_manager/src/resumption/resumption_sql_queries.cc
@@ -212,7 +212,7 @@ const std::string kCreateSchema =
"`vrHelpItemArray`(`idglobalProperties`); "
"CREATE TABLE IF NOT EXISTS `application`( "
" `idApplication` INTEGER PRIMARY KEY NOT NULL, "
- " `appID` TEXT, "
+ " `appID` TEXT COLLATE NOCASE, "
" `connection_key` INTEGER, "
" `grammarID` INTEGER, "
" `hashID` TEXT, "
@@ -298,8 +298,8 @@ const std::string kCreateSchema =
"CREATE INDEX IF NOT EXISTS "
"`applicationSubMenuArray.fk_Application_idx` "
" ON `applicationSubMenuArray`(`idApplication`); "
- "CREATE TABLE IF NOT EXISTS `applicationSubscribtionsArray`( "
- " `idapplicationSubscribtionsArray` INTEGER PRIMARY KEY NOT NULL, "
+ "CREATE TABLE IF NOT EXISTS `applicationSubscriptionsArray`( "
+ " `idapplicationSubscriptionsArray` INTEGER PRIMARY KEY NOT NULL, "
" `vehicleValue` INTEGER, "
" `ButtonNameValue` INTEGER, "
" `idApplication` INTEGER, "
@@ -308,8 +308,8 @@ const std::string kCreateSchema =
" REFERENCES `application`(`idApplication`) "
" ); "
"CREATE INDEX IF NOT EXISTS "
- "`applicationSubscribtionsArray.fk_Application_idx` "
- " ON `applicationSubscribtionsArray`(`idApplication`); "
+ "`applicationSubscriptionsArray.fk_Application_idx` "
+ " ON `applicationSubscriptionsArray`(`idApplication`); "
"CREATE TABLE IF NOT EXISTS `_internal_data`( "
" `db_version_hash` INTEGER "
" ); "
@@ -365,8 +365,8 @@ const std::string kDropSchema =
"DROP TABLE IF EXISTS `applicationSubMenuArray`; "
"DROP INDEX IF EXISTS `applicationSubMenuArray.fk_subMenu_idx`; "
"DROP INDEX IF EXISTS `applicationSubMenuArray.fk_Application_idx`; "
- "DROP TABLE IF EXISTS `applicationSubscribtionsArray`; "
- "DROP INDEX IF EXISTS `applicationSubscribtionsArray.fk_Application_idx`; "
+ "DROP TABLE IF EXISTS `applicationSubscriptionsArray`; "
+ "DROP INDEX IF EXISTS `applicationSubscriptionsArray.fk_Application_idx`; "
"DROP TABLE IF EXISTS `_internal_data`; "
"COMMIT; "
"VACUUM;";
@@ -477,8 +477,8 @@ const std::string kDeleteApplicationSubMenuArray =
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?)";
-const std::string kDeleteApplicationSubscribtionsArray =
- "DELETE FROM `applicationSubscribtionsArray` "
+const std::string kDeleteApplicationSubscriptionsArray =
+ "DELETE FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?)";
@@ -713,7 +713,7 @@ const std::string kInsertVrCommand =
"(?, ?, ?);";
const std::string kInsertSubscriptions =
- "INSERT INTO `applicationSubscribtionsArray` "
+ "INSERT INTO `applicationSubscriptionsArray` "
"(`idApplication`, `vehicleValue`, `ButtonNameValue`) "
"VALUES "
"(?, ?, ?);";
@@ -851,14 +851,14 @@ const std::string kSelectCommands =
const std::string kSelectCountSubscriptions =
"SELECT COUNT (`idApplication`) "
- "FROM `applicationSubscribtionsArray` "
+ "FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?);";
const std::string kSelectSubscriptions =
"SELECT `vehicleValue`, `ButtonNameValue` "
- "FROM `applicationSubscribtionsArray` "
+ "FROM `applicationSubscriptionsArray` "
"WHERE `idApplication` = (SELECT `idApplication` "
"FROM `application` "
"WHERE `appID` = ? AND `deviceID` = ?);";
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index 68a3a7d424..c3aba90dd5 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -36,6 +36,7 @@ const char* success = "success";
const char* sync_msg_version = "syncMsgVersion";
const char* major_version = "majorVersion";
const char* minor_version = "minorVersion";
+const char* patch_version = "patchVersion";
const char* app_name = "appName";
const char* ngn_media_screen_app_name = "ngnMediaScreenAppName";
const char* vr_synonyms = "vrSynonyms";
@@ -56,6 +57,7 @@ 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* metadata_tags = "metadataTags";
const char* eta = "eta";
const char* time_to_destination = "timeToDestination";
const char* total_distance = "totalDistance";
@@ -131,6 +133,16 @@ const char* speech_capabilities = "speechCapabilities";
const char* vr_capabilities = "vrCapabilities";
const char* audio_pass_thru_capabilities = "audioPassThruCapabilities";
const char* pcm_stream_capabilities = "pcmStreamCapabilities";
+const char* audio_pass_thru_icon = "audioPassThruIcon";
+const char* way_points = "wayPoints";
+const char* system_capability = "systemCapability";
+const char* system_capability_type = "systemCapabilityType";
+const char* system_capabilities = "systemCapabilities";
+const char* navigation_capability = "navigationCapability";
+const char* phone_capability = "phoneCapability";
+const char* video_streaming_capability = "videoStreamingCapability";
+const char* rc_capability = "remoteControlCapability";
+
// PutFile
const char* sync_file_name = "syncFileName";
const char* file_name = "fileName";
@@ -221,6 +233,8 @@ const char* supported_diag_modes = "supportedDiagModes";
const char* hmi_capabilities = "hmiCapabilities";
const char* navigation = "navigation";
const char* phone_call = "phoneCall";
+const char* video_streaming = "videoStreaming";
+const char* remote_control = "remoteControl";
const char* sdl_version = "sdlVersion";
const char* system_software_version = "systemSoftwareVersion";
const char* priority = "priority";
@@ -232,7 +246,7 @@ const char* application_choice_sets = "applicationChoiceSets";
const char* application_global_properties = "globalProperties";
const char* application_vehicle_info = "vehicleInfo";
const char* application_buttons = "buttons";
-const char* application_subscribtions = "subscribtions";
+const char* application_subscriptions = "subscriptions";
const char* application_files = "applicationFiles";
const char* application_show = "applicationShow";
const char* resumption = "resumption";
@@ -273,6 +287,38 @@ const char* is_suscribed = "isSubscribed";
const char* message_data = "messageData";
const char* delivery_mode = "deliveryMode";
+
+const char* audio_streaming_indicator = "audioStreamingIndicator";
+
+const char* const keyboard_properties_supported = "keyboardPropertiesSupported";
+const char* const language_supported = "languageSupported";
+const char* const keyboard_layout_supported = "keyboardLayoutSupported";
+const char* const keypress_mode_supported = "keypressModeSupported";
+const char* const limited_characters_list_supported =
+ "limitedCharactersListSupported";
+const char* const auto_complete_text_supported = "autoCompleteTextSupported";
+const char* const entity_type = "entityType";
+const char* const entity_id = "entityID";
+const char* const status = "status";
+const char* const external_consent_status = "externalConsentStatus";
+const char* const consented_functions = "consentedFunctions";
+const char* const source = "source";
+const char* const config = "config";
+const char* const protocol = "protocol";
+const char* const codec = "codec";
+const char* const width = "width";
+const char* const height = "height";
+const char* const rejected_params = "rejectedParams";
+const char* const preferred_resolution = "preferredResolution";
+const char* const resolution_width = "resolutionWidth";
+const char* const resolution_height = "resolutionHeight";
+const char* const max_bitrate = "maxBitrate";
+const char* const supported_formats = "supportedFormats";
+const char* const haptic_spatial_data_supported = "hapticSpatialDataSupported";
+const char* const haptic_rect_data = "hapticRectData";
+const char* const rect = "rect";
+const char* const x = "x";
+const char* const y = "y";
} // namespace strings
namespace json {
@@ -324,6 +370,7 @@ namespace hmi_request {
const char* parent_id = "parentID";
const char* field_name = "fieldName";
const char* field_text = "fieldText";
+const char* field_types = "fieldTypes";
const char* alert_strings = "alertStrings";
const char* duration = "duration";
const char* soft_buttons = "softButtons";
@@ -346,6 +393,7 @@ const char* keyboard_layout = "keyboardLayout";
const char* limited_character_list = "limitedCharacterList";
const char* auto_complete_text = "autoCompleteText";
const char* file = "file";
+const char* file_name = "fileName";
const char* retry = "retry";
const char* service = "service";
} // namespace hmi_request
@@ -406,4 +454,4 @@ const char* event_name = "eventName";
} // namespace hmi_notification
-} // namespace application_manager \ No newline at end of file
+} // namespace application_manager
diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc
index 839cc13026..84081a3830 100644
--- a/src/components/application_manager/src/state_controller_impl.cc
+++ b/src/components/application_manager/src/state_controller_impl.cc
@@ -95,9 +95,7 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app,
static_cast<hmi_apis::Common_HMILevel::eType>(
resolved_state->hmi_level());
- const bool is_full_allowed = (hmi_apis::Common_HMILevel::FULL == hmi_level);
-
- if (send_activate_app && is_full_allowed) {
+ if (send_activate_app) {
const int64_t corr_id = SendBCActivateApp(app, hmi_level, true);
if (-1 != corr_id) {
subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_ActivateApp,
@@ -125,7 +123,7 @@ void StateControllerImpl::SetRegularState(
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
@@ -146,7 +144,7 @@ void StateControllerImpl::SetRegularState(
return;
}
const HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
@@ -168,7 +166,7 @@ void StateControllerImpl::SetRegularState(
return;
}
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(audio_state);
@@ -186,7 +184,7 @@ void StateControllerImpl::SetRegularState(
}
HmiStatePtr prev_state = app->RegularHmiState();
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(hmi_state);
hmi_state->set_hmi_level(hmi_level);
hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level));
@@ -208,7 +206,7 @@ void StateControllerImpl::SetRegularState(
HmiStatePtr prev_regular = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_regular);
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, 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(
@@ -229,7 +227,7 @@ void StateControllerImpl::SetRegularState(
HmiStatePtr prev_state = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr hmi_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, 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);
@@ -327,7 +325,7 @@ HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app,
<< state->system_context());
HmiStatePtr available_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN(available_state, HmiStatePtr());
available_state->set_hmi_level(state->hmi_level());
available_state->set_audio_streaming_state(state->audio_streaming_state());
@@ -365,9 +363,9 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app,
}
if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) &&
- app->is_navi()) {
+ (app->is_navi() || app->mobile_projection_enabled())) {
LOG4CXX_DEBUG(logger_,
- "Resumption for navi app is not allowed. "
+ "Resumption for navi or projection app is not allowed. "
<< "EMBEDDED_NAVI event is active");
return false;
}
@@ -504,7 +502,7 @@ void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app,
<< ", system_context " << state->system_context());
HmiStatePtr curr_state = app->CurrentHmiState();
HmiStatePtr old_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(old_state);
old_state->set_hmi_level(curr_state->hmi_level());
old_state->set_audio_streaming_state(curr_state->audio_streaming_state());
@@ -535,7 +533,7 @@ void StateControllerImpl::SetupRegularHmiState(
HmiStatePtr prev_state = app->RegularHmiState();
DCHECK_OR_RETURN_VOID(prev_state);
HmiStatePtr new_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, 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);
@@ -558,12 +556,19 @@ bool StateControllerImpl::IsSameAppType(ApplicationConstSharedPtr app1,
ApplicationConstSharedPtr app2) {
const bool both_media =
app1->is_media_application() && app2->is_media_application();
+
const bool both_navi = app1->is_navi() && app2->is_navi();
+
const bool both_vc = app1->is_voice_communication_supported() &&
app2->is_voice_communication_supported();
+
const bool both_simple =
!app1->IsAudioApplication() && !app2->IsAudioApplication();
- return both_simple || both_media || both_navi || both_vc;
+
+ const bool both_projection =
+ app1->mobile_projection_enabled() && app2->mobile_projection_enabled();
+
+ return both_simple || both_media || both_navi || both_vc || both_projection;
}
void StateControllerImpl::on_event(const event_engine::Event& event) {
@@ -711,7 +716,7 @@ void StateControllerImpl::OnApplicationRegistered(
active_states_lock_.Acquire();
StateIDList::iterator it = active_states_.begin();
for (; it != active_states_.end(); ++it) {
- HmiStatePtr new_state = CreateHmiState(app->app_id(), *it);
+ HmiStatePtr new_state = CreateHmiState(app, *it);
DCHECK_OR_RETURN_VOID(new_state);
DCHECK_OR_RETURN_VOID(new_state->state_id() != HmiState::STATE_ID_REGULAR);
HmiStatePtr old_hmi_state = app->CurrentHmiState();
@@ -721,7 +726,7 @@ void StateControllerImpl::OnApplicationRegistered(
active_states_lock_.Release();
HmiStatePtr default_state =
- CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR);
+ CreateHmiState(app, HmiState::StateID::STATE_ID_REGULAR);
DCHECK_OR_RETURN_VOID(default_state);
default_state->set_hmi_level(default_level);
default_state->set_audio_streaming_state(CalcAudioState(app, default_level));
@@ -891,49 +896,49 @@ bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const {
}
HmiStatePtr StateControllerImpl::CreateHmiState(
- uint32_t app_id, HmiState::StateID state_id) const {
+ utils::SharedPtr<Application> app, HmiState::StateID state_id) const {
using namespace utils;
LOG4CXX_AUTO_TRACE(logger_);
HmiStatePtr new_state;
switch (state_id) {
case HmiState::STATE_ID_PHONE_CALL: {
- new_state = MakeShared<PhoneCallHmiState>(app_id, app_mngr_);
+ new_state = MakeShared<PhoneCallHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_SAFETY_MODE: {
- new_state = MakeShared<SafetyModeHmiState>(app_id, app_mngr_);
+ new_state = MakeShared<SafetyModeHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_VR_SESSION: {
- new_state = MakeShared<VRHmiState>(app_id, app_mngr_);
+ new_state = MakeShared<VRHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_TTS_SESSION: {
- new_state = MakeShared<TTSHmiState>(app_id, app_mngr_);
+ new_state = MakeShared<TTSHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_NAVI_STREAMING: {
- new_state = MakeShared<NaviStreamingHmiState>(app_id, app_mngr_);
+ new_state = MakeShared<NaviStreamingHmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_REGULAR: {
- new_state = MakeShared<HmiState>(app_id, app_mngr_);
+ new_state = MakeShared<HmiState>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_POSTPONED: {
- new_state = MakeShared<HmiState>(app_id, app_mngr_, state_id);
+ new_state = MakeShared<HmiState>(app, app_mngr_, state_id);
break;
}
case HmiState::STATE_ID_DEACTIVATE_HMI: {
- new_state = MakeShared<DeactivateHMI>(app_id, app_mngr_);
+ new_state = MakeShared<DeactivateHMI>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_AUDIO_SOURCE: {
- new_state = MakeShared<AudioSource>(app_id, app_mngr_);
+ new_state = MakeShared<AudioSource>(app, app_mngr_);
break;
}
case HmiState::STATE_ID_EMBEDDED_NAVI: {
- new_state = MakeShared<EmbeddedNavi>(app_id, app_mngr_);
+ new_state = MakeShared<EmbeddedNavi>(app, app_mngr_);
break;
}
default:
diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc
index 42c48520e9..80755b6509 100644
--- a/src/components/application_manager/src/usage_statistics.cc
+++ b/src/components/application_manager/src/usage_statistics.cc
@@ -70,7 +70,9 @@ UsageStatistics::UsageStatistics(
statistics_manager, app_id, RUN_ATTEMPTS_WHILE_REVOKED)
, count_of_removals_for_bad_behavior_(
statistics_manager, app_id, REMOVALS_MISBEHAVED)
- , count_of_tls_error_(statistics_manager, app_id, COUNT_OF_TLS_ERRORS) {
+ , count_of_tls_error_(statistics_manager, app_id, COUNT_OF_TLS_ERRORS)
+ , count_of_rejections_sync_out_of_memory_(
+ statistics_manager, app_id, REJECTIONS_SYNC_OUT_OF_MEMORY) {
time_in_hmi_state_sptr_->Start(SECONDS_HMI_NONE);
}
@@ -90,7 +92,9 @@ UsageStatistics::UsageStatistics(
statistics_manager, app_id, RUN_ATTEMPTS_WHILE_REVOKED)
, count_of_removals_for_bad_behavior_(
statistics_manager, app_id, REMOVALS_MISBEHAVED)
- , count_of_tls_error_(statistics_manager, app_id, COUNT_OF_TLS_ERRORS) {
+ , count_of_tls_error_(statistics_manager, app_id, COUNT_OF_TLS_ERRORS)
+ , count_of_rejections_sync_out_of_memory_(
+ statistics_manager, app_id, REJECTIONS_SYNC_OUT_OF_MEMORY) {
DCHECK(time_in_hmi_state_sptr_.get());
time_in_hmi_state_sptr_->Start(SECONDS_HMI_NONE);
}
@@ -124,7 +128,7 @@ void UsageStatistics::RecordAppRegistrationGuiLanguage(
void UsageStatistics::RecordAppRegistrationVuiLanguage(
Language::eType vui_language) {
- app_registration_language_gui_.Update(LanguageIdToString(vui_language));
+ app_registration_language_vui_.Update(LanguageIdToString(vui_language));
}
void UsageStatistics::RecordRpcSentInHMINone() {
@@ -151,4 +155,8 @@ void UsageStatistics::RecordTLSError() {
++count_of_tls_error_;
}
+void UsageStatistics::RecordRejectionsSyncOutOfMemory() {
+ ++count_of_rejections_sync_out_of_memory_;
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt
index ba5d684df8..3e9010e22c 100644
--- a/src/components/application_manager/test/CMakeLists.txt
+++ b/src/components/application_manager/test/CMakeLists.txt
@@ -28,47 +28,63 @@
# 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.
-
-if (BUILD_TESTS)
-
- include_directories(
- ${GMOCK_INCLUDE_DIRECTORY}
- ${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/application_manager/include/
- ${COMPONENTS_DIR}/utils/include/
- ${COMPONENTS_DIR}/resumption/include/
- ${COMPONENTS_DIR}/utils/include/
- ${COMPONENTS_DIR}/policy/include/
- ${COMPONENTS_DIR}/media_manager/include/
- ${COMPONENTS_DIR}/security_manager/include/
- ${COMPONENTS_DIR}/policy/test/include/
- ${COMPONENTS_DIR}/application_manager/test/include/
- )
-
- set(testSources
- ${AM_TEST_DIR}/mobile_message_handler_test.cc
- ${AM_TEST_DIR}/mobile_message_handler_v1_test.cc
- ${AM_TEST_DIR}/request_info_test.cc
- ${AM_TEST_DIR}/resumption_sql_queries_test.cc
- ${AM_TEST_DIR}/event_engine_test.cc
- ${AM_TEST_DIR}/policy_event_observer_test.cc
- ${AM_TEST_DIR}/application_impl_test.cc
- ${AM_TEST_DIR}/hmi_capabilities_test.cc
- ${AM_TEST_DIR}/application_state_test.cc
- ${AM_TEST_DIR}/usage_statistics_test.cc
- ${AM_TEST_DIR}/policy_handler_test.cc
- ${AM_TEST_DIR}/mock_message_helper.cc
- )
- set (request_controller_SOURCES
- ${AM_TEST_DIR}/request_controller/request_controller_test.cc
- )
-
-set(testLibraries
- ApplicationManager
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+ ${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/resumption/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${POLICY_PATH}/include/
+ ${COMPONENTS_DIR}/policy/policy_regular/test/include
+ ${POLICY_PATH}/policy/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+ ${COMPONENTS_DIR}/media_manager/include/
+ ${COMPONENTS_DIR}/security_manager/include/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+ ${BSON_INCLUDE_DIRECTORY}
+)
+
+set(testSources
+ ${AM_TEST_DIR}/mock_message_helper.cc
+ ${AM_TEST_DIR}/mobile_message_handler_test.cc
+ ${AM_TEST_DIR}/mobile_message_handler_v1_test.cc
+ ${AM_TEST_DIR}/request_info_test.cc
+ ${AM_TEST_DIR}/resumption_sql_queries_test.cc
+ ${AM_TEST_DIR}/event_engine_test.cc
+ ${AM_TEST_DIR}/policy_event_observer_test.cc
+ ${AM_TEST_DIR}/application_impl_test.cc
+ ${AM_TEST_DIR}/hmi_capabilities_test.cc
+ ${AM_TEST_DIR}/hmi_language_handler_test.cc
+ ${AM_TEST_DIR}/application_state_test.cc
+ ${AM_TEST_DIR}/usage_statistics_test.cc
+ ${AM_TEST_DIR}/policy_handler_test.cc
+ ${AM_TEST_DIR}/application_manager_impl_test.cc
+ ${AM_TEST_DIR}/application_helper_test.cc
+ ${AM_TEST_DIR}/command_holder_test.cc
+)
+
+set(testSourcesMockHmi
+ ${AM_SOURCE_DIR}/src/message_helper/message_helper.cc
+ ${AM_TEST_DIR}/application_manager_impl_mock_hmi_test.cc
+ ${AM_TEST_DIR}/mock_hmi_command_factory.cc
+)
+
+if(REMOTE_CONTROL)
+ list(APPEND testSources ${AM_TEST_DIR}/rc_policy_handler_test.cc)
+endif(REMOTE_CONTROL)
+
+set (RequestController_SOURCES
+ ${AM_TEST_DIR}/request_controller/request_controller_test.cc
+ ${AM_TEST_DIR}/mock_message_helper.cc
+)
+
+set(LIBRARIES
Utils
- dbms
+ ApplicationManager
jsoncpp
Policy
connectionHandler
@@ -86,90 +102,57 @@ set(testLibraries
Resumption
ProtocolHandler
SecurityManager
+ bson -L${BSON_LIBS_DIRECTORY}
+ emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
-set(test_exec_libraries
- HMI_API
- MOBILE_API
- v4_protocol_v1_2_no_extra
- SmartObjects
- formatters
- ProtocolHandler
- connectionHandler
- HMIMessageHandler
- Utils
- jsoncpp
- ConfigProfile
- MediaManager
- Resumption
-)
+if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
+ list(REMOVE_ITEM LIBRARIES dl)
+endif()
-IF(${CMAKE_SYSTEM_NAME} MATCHES "QNX")
- list(REMOVE_ITEM test_exec_libraries dl)
+if (ENABLE_LOG)
+ list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
+ list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
endif()
- set(testLibraries
- Utils
- ApplicationManager
- jsoncpp
- Policy
- connectionHandler
- HMI_API
- MOBILE_API
- v4_protocol_v1_2_no_extra
- SmartObjects
- formatters
- gmock_main
- UsageStatistics
- dl
- ProtocolLibrary
- ConfigProfile
- MediaManager
- Resumption
- ProtocolHandler
- SecurityManager
- )
-
- if (${CMAKE_SYSTEM_NAME} MATCHES "QNX")
- list(REMOVE_ITEM test_exec_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})
- list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY})
- endif()
-
- file(COPY smartDeviceLink_test2.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY sdl_preloaded_pt.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY sdl_pt_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink_test2.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY sdl_preloaded_pt.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY sdl_pt_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(
-OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libPolicy.so
- COMMAND ${CMAKE_COMMAND} -E
- copy ${COMPONENTS_DIR}/policy/libPolicy.so ${CMAKE_CURRENT_BINARY_DIR})
- set(CMAKE_EXE_LINKER_FLAGS
- "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}")
- create_test("application_manager_test" "${testSources}" "${testLibraries}" )
-# TODO [AKozoriz] : Fix not buildable tests
- set(ResumptionData_SOURCES
- ${AM_TEST_DIR}/resumption/resumption_data_test.cc
- ${AM_TEST_DIR}/resumption/resumption_data_db_test.cc
- ${AM_TEST_DIR}/resumption/resumption_data_json_test.cc
- ${AM_TEST_DIR}/resumption/resume_ctrl_test.cc
- ${AM_TEST_DIR}/mock_message_helper.cc
- )
-
- file(COPY hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-
- file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resumption)
- file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/resumption)
- create_test("resumption/data_resumption_test" "${ResumptionData_SOURCES}" "${testLibraries}")
-
- add_subdirectory(state_controller)
-endif()
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libPolicy.so
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${POLICY_PATH}/libPolicy.so ${CMAKE_CURRENT_BINARY_DIR}
+)
+set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}"
+)
+create_test("application_manager_test" "${testSources}" "${LIBRARIES}")
+create_test("application_manager_mock_hmi_test" "${testSourcesMockHmi}" "${LIBRARIES}")
+add_dependencies("application_manager_test" libbson)
+
+create_test("request_controller_test" "${RequestController_SOURCES}" "${LIBRARIES}")
+
+set(ResumptionData_SOURCES
+ ${AM_TEST_DIR}/resumption/resumption_data_test.cc
+ ${AM_TEST_DIR}/resumption/resumption_data_db_test.cc
+ ${AM_TEST_DIR}/resumption/resumption_data_json_test.cc
+ ${AM_TEST_DIR}/resumption/resume_ctrl_test.cc
+ ${AM_TEST_DIR}/mock_message_helper.cc
+)
+
+file(COPY hmi_capabilities.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY hmi_capabilities_sc1.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY hmi_capabilities_sc2.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/resumption)
+file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/resumption)
+create_test("data_resumption_test" "${ResumptionData_SOURCES}" "${LIBRARIES}")
+add_subdirectory(state_controller)
add_subdirectory(app_launch)
add_subdirectory(commands)
+add_subdirectory(message_helper)
diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
index 0f5196a97e..1b90f29647 100644
--- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc
@@ -41,10 +41,12 @@
#include "application_manager/mock_application_manager.h"
#include "connection_handler/mock_connection_handler.h"
#include "utils/make_shared.h"
+#include "utils/test_async_waiter.h"
namespace test {
namespace components {
namespace app_launch_test {
+
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::Truly;
@@ -52,6 +54,7 @@ using ::testing::NiceMock;
using ::testing::Invoke;
using ::testing::AtLeast;
using ::testing::InSequence;
+using ::testing::DoAll;
namespace ch_test = test::components::connection_handler_test;
namespace am_test = test::components::application_manager_test;
@@ -61,8 +64,8 @@ typedef utils::SharedPtr<am_test::MockApplication> MockAppPtr;
class AppLaunchCtrlTest : public ::testing::Test {
public:
MockAppPtr AppFromAppData(const app_launch::ApplicationData& app_data) {
- utils::SharedPtr<NiceMock<am_test::MockApplication>> app =
- utils::MakeShared<NiceMock<am_test::MockApplication>>();
+ utils::SharedPtr<NiceMock<am_test::MockApplication> > app =
+ utils::MakeShared<NiceMock<am_test::MockApplication> >();
ON_CALL(*app, mac_address()).WillByDefault(ReturnRef(app_data.device_mac_));
ON_CALL(*app, bundle_id()).WillByDefault(ReturnRef(app_data.bundle_id_));
@@ -74,7 +77,7 @@ class AppLaunchCtrlTest : public ::testing::Test {
app_launch::ApplicationDataPtr AppDataFromApp(
const am_test::MockApplication& app) {
app_launch::ApplicationDataPtr app_data =
- utils::MakeShared<NiceMock<app_launch::ApplicationData>>(
+ utils::MakeShared<NiceMock<app_launch::ApplicationData> >(
app.policy_app_id(), app.bundle_id(), app.mac_address());
return app_data;
}
@@ -198,6 +201,7 @@ TEST_F(AppLaunchCtrlTest, StoredAppIsLaunchedAfterDeviceConnected) {
app_launch::ApplicationDataPtr app_to_launch = GetTestAppData(0);
MockAppPtr app = GetTestApp(0);
+ TestAsyncWaiter waiter;
applications_on_device.push_back(app_to_launch);
EXPECT_CALL(app_launch_data_mock_,
GetApplicationDataByDevice(app_to_launch->device_mac_))
@@ -206,17 +210,21 @@ TEST_F(AppLaunchCtrlTest, StoredAppIsLaunchedAfterDeviceConnected) {
connection_handler_mock_,
RunAppOnDevice(app_to_launch->device_mac_, app_to_launch->bundle_id_))
.Times(AtLeast(1))
- .WillOnce(InvokeOnAppRegistered(app_launch_ctrl_.get(), app.get()));
+ .WillOnce(DoAll(InvokeOnAppRegistered(app_launch_ctrl_.get(), app.get()),
+ NotifyTestAsyncWaiter(&waiter)));
app_launch_ctrl_->OnDeviceConnected(app_to_launch->device_mac_);
const uint32_t wait_time =
MAX_TEST_DURATION + settings_.app_launch_wait_time();
- testing::Mock::AsyncVerifyAndClearExpectations(wait_time);
+ EXPECT_TRUE(waiter.WaitFor(1, wait_time));
}
TEST_F(AppLaunchCtrlTest, RelaunchAppIfNotRegisteredMultipleTimes) {
std::vector<app_launch::ApplicationDataPtr> applications_on_device;
app_launch::ApplicationDataPtr app_to_launch = GetTestAppData(0);
applications_on_device.push_back(app_to_launch);
+
+ TestAsyncWaiter waiter;
+ const uint32_t times = settings_.app_launch_max_retry_attempt();
EXPECT_CALL(app_launch_data_mock_,
GetApplicationDataByDevice(app_to_launch->device_mac_))
.WillOnce(Return(applications_on_device));
@@ -224,14 +232,15 @@ TEST_F(AppLaunchCtrlTest, RelaunchAppIfNotRegisteredMultipleTimes) {
EXPECT_CALL(
connection_handler_mock_,
RunAppOnDevice(app_to_launch->device_mac_, app_to_launch->bundle_id_))
- .Times(settings_.app_launch_max_retry_attempt());
+ .Times(times)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
app_launch_ctrl_->OnDeviceConnected(app_to_launch->device_mac_);
const uint32_t wait_time = MAX_TEST_DURATION +
settings_.app_launch_wait_time() +
settings_.app_launch_max_retry_attempt() *
settings_.app_launch_retry_wait_time();
- testing::Mock::AsyncVerifyAndClearExpectations(wait_time);
+ EXPECT_TRUE(waiter.WaitFor(times, wait_time));
}
TEST_F(AppLaunchCtrlTest, LaunchMultipleApps) {
@@ -243,6 +252,8 @@ TEST_F(AppLaunchCtrlTest, LaunchMultipleApps) {
apps.push_back(it->second);
}
+ TestAsyncWaiter waiter;
+ const uint32_t times = apps_and_data.size();
EXPECT_CALL(app_launch_data_mock_, GetApplicationDataByDevice(DeviceMac(1)))
.WillOnce(Return(apps));
@@ -250,13 +261,18 @@ TEST_F(AppLaunchCtrlTest, LaunchMultipleApps) {
for (std::vector<AppAndAppData>::iterator it = apps_and_data.begin();
it != apps_and_data.end();
++it) {
- ExpectRegisteration(*it);
+ EXPECT_CALL(connection_handler_mock_,
+ RunAppOnDevice(it->second->device_mac_, it->second->bundle_id_))
+ .Times(AtLeast(1))
+ .WillOnce(DoAll(
+ InvokeOnAppRegistered(app_launch_ctrl_.get(), it->first.get()),
+ NotifyTestAsyncWaiter(&waiter)));
}
app_launch_ctrl_->OnDeviceConnected(DeviceMac(1));
const uint32_t wait_time = MAX_TEST_DURATION +
settings_.app_launch_wait_time() +
apps.size() * settings_.wait_time_between_apps();
- testing::Mock::AsyncVerifyAndClearExpectations(wait_time);
+ waiter.WaitFor(times, wait_time);
}
TEST_F(AppLaunchCtrlTest, LaunchMultipleAppsNoRegister) {
@@ -268,6 +284,9 @@ TEST_F(AppLaunchCtrlTest, LaunchMultipleAppsNoRegister) {
apps.push_back(it->second);
}
+ TestAsyncWaiter waiter;
+ const uint32_t times =
+ settings_.app_launch_max_retry_attempt() * apps_and_data.size();
EXPECT_CALL(app_launch_data_mock_, GetApplicationDataByDevice(DeviceMac(1)))
.WillOnce(Return(apps));
@@ -279,13 +298,14 @@ TEST_F(AppLaunchCtrlTest, LaunchMultipleAppsNoRegister) {
EXPECT_CALL(connection_handler_mock_,
RunAppOnDevice(app_data.second->device_mac_,
app_data.second->bundle_id_))
- .Times(settings_.app_launch_max_retry_attempt());
+ .Times(settings_.app_launch_max_retry_attempt())
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
}
app_launch_ctrl_->OnDeviceConnected(DeviceMac(1));
const uint32_t wait_time = MAX_TEST_DURATION +
settings_.app_launch_wait_time() +
apps.size() * settings_.wait_time_between_apps();
- testing::Mock::AsyncVerifyAndClearExpectations(wait_time);
+ waiter.WaitFor(times, wait_time);
}
TEST_F(AppLaunchCtrlTest, LaunchMultipleAppsInHMILevelOrder) {
@@ -322,31 +342,28 @@ TEST_F(AppLaunchCtrlTest, LaunchMultipleAppsInHMILevelOrder) {
apps.push_back(app_data);
}
+ TestAsyncWaiter waiter;
+ const uint32_t times = apps_and_data.size();
EXPECT_CALL(app_launch_data_mock_, GetApplicationDataByDevice(DeviceMac(1)))
.WillOnce(Return(apps));
- {
- InSequence s;
-
- ExpectRegisteration(apps_and_data[0]);
- ExpectRegisteration(apps_and_data[1]);
- ExpectRegisteration(apps_and_data[2]);
+ // Expect multiple call
+ for (std::vector<AppAndAppData>::iterator it = apps_and_data.begin();
+ it != apps_and_data.end();
+ ++it) {
+ EXPECT_CALL(connection_handler_mock_,
+ RunAppOnDevice(it->second->device_mac_, it->second->bundle_id_))
+ .Times(AtLeast(1))
+ .WillRepeatedly(DoAll(
+ InvokeOnAppRegistered(app_launch_ctrl_.get(), it->first.get()),
+ NotifyTestAsyncWaiter(&waiter)));
}
app_launch_ctrl_->OnDeviceConnected(DeviceMac(1));
+
const uint32_t wait_time = MAX_TEST_DURATION +
settings_.app_launch_wait_time() +
apps.size() * settings_.wait_time_between_apps();
- testing::Mock::AsyncVerifyAndClearExpectations(wait_time);
-}
-
-void AppLaunchCtrlTest::ExpectRegisteration(
- const AppLaunchCtrlTest::AppAndAppData& app_data) {
- EXPECT_CALL(
- connection_handler_mock_,
- RunAppOnDevice(app_data.second->device_mac_, app_data.second->bundle_id_))
- .Times(AtLeast(1))
- .WillOnce(
- InvokeOnAppRegistered(app_launch_ctrl_.get(), app_data.first.get()));
+ waiter.WaitFor(times, wait_time);
}
} // namespace app_launch_test
diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
index 6b00365dd3..cc7d3f5814 100644
--- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
+++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include "utils/make_shared.h"
#include "utils/file_system.h"
#include "utils/date_time.h"
-#include "resumption/last_state.h"
+#include "resumption/last_state_impl.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/mock_app_launch_settings.h"
@@ -68,7 +68,7 @@ class AppLaunchDataJsonTest : public ::testing::Test {
virtual void SetUp() {
::file_system::DeleteFile(kAppStorageFile);
test_last_state_ = std::auto_ptr<resumption::LastState>(
- new resumption::LastState(kAppStorageFolder, kAppInfoStorage));
+ new resumption::LastStateImpl(kAppStorageFolder, kAppInfoStorage));
ASSERT_TRUE(::file_system::CreateFile(kAppStorageFile));
NiceMock<app_launch_test::MockAppLaunchSettings> mock_app_launch_settings_;
diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc
new file mode 100644
index 0000000000..a0b6fd6aa2
--- /dev/null
+++ b/src/components/application_manager/test/application_helper_test.cc
@@ -0,0 +1,258 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gmock/gmock.h>
+#include <string>
+#include <vector>
+
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_message_helper.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "policy/mock_policy_settings.h"
+
+#include "application_manager/application.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/usage_statistics.h"
+#include "application_manager/helpers/application_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "interfaces/MOBILE_API.h"
+#include "connection_handler/device.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+namespace {
+const uint8_t expected_tread_pool_size = 2u;
+const uint8_t stop_streaming_timeout = 1u;
+const std::string kDirectoryName = "./test_storage";
+const std::vector<std::string> kTimeoutPrompt{"timeoutPrompt"};
+}
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+using namespace application_manager;
+using namespace policy_handler_test;
+
+class ApplicationHelperTest : public testing::Test {
+ public:
+ ApplicationHelperTest()
+ : mock_message_helper_(
+ application_manager::MockMessageHelper::message_helper_mock())
+ , app_manager_impl_(mock_application_manager_settings_,
+ mock_policy_settings_) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(mock_application_manager_settings_, thread_pool_size())
+ .WillByDefault(Return(expected_tread_pool_size));
+ ON_CALL(mock_application_manager_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, launch_hmi())
+ .WillByDefault(Return(true));
+ ON_CALL(mock_application_manager_settings_, stop_streaming_timeout())
+ .WillByDefault(Return(stop_streaming_timeout));
+ ON_CALL(mock_application_manager_settings_, time_out_promt())
+ .WillByDefault(ReturnRef(kTimeoutPrompt));
+
+ CreateApplication();
+ app_manager_impl_.AddMockApplication(app_impl_);
+
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void CreateApplication() {
+ const uint32_t application_id = 1;
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1;
+ const custom_str::CustomString app_name("");
+
+ app_impl_ = new ApplicationImpl(
+ application_id,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ utils::MakeShared<usage_statistics_test::MockStatisticsManager>(),
+ app_manager_impl_);
+ }
+
+ MockMessageHelper* mock_message_helper_;
+ NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
+ NiceMock<MockPolicySettings> mock_policy_settings_;
+
+ ApplicationManagerImpl app_manager_impl_;
+ ApplicationSharedPtr app_impl_;
+};
+
+TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) {
+ const uint32_t cmd_id = 1;
+ const uint32_t menu_id = 2;
+ const uint32_t choice_set_id = 3;
+ const mobile_apis::VehicleDataType::eType vi =
+ mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL;
+ const mobile_apis::ButtonName::eType button = mobile_apis::ButtonName::AC;
+
+ smart_objects::SmartObject cmd;
+ cmd[strings::msg_params][strings::cmd_id] = cmd_id;
+ cmd[strings::msg_params][strings::vr_commands][0] = "vrCmd";
+ cmd[strings::msg_params][strings::menu_id] = menu_id;
+ cmd[strings::msg_params][strings::interaction_choice_set_id] = choice_set_id;
+
+ app_impl_->AddCommand(cmd_id, cmd[strings::msg_params]);
+ app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
+ app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
+ EXPECT_TRUE(app_impl_->SubscribeToIVI(static_cast<uint32_t>(vi)));
+ EXPECT_TRUE(app_impl_->SubscribeToButton(button));
+
+ const std::string some_string = "some_string";
+ smart_objects::SmartObject dummy_data =
+ smart_objects::SmartObject(smart_objects::SmartType_String);
+ dummy_data = some_string;
+ app_impl_->set_help_prompt(dummy_data);
+ app_impl_->set_timeout_prompt(dummy_data);
+ app_impl_->set_vr_help(dummy_data);
+ app_impl_->set_vr_help_title(dummy_data);
+ app_impl_->set_keyboard_props(dummy_data);
+ app_impl_->set_menu_title(dummy_data);
+ app_impl_->set_menu_icon(dummy_data);
+
+ const bool persistent = false;
+ const bool downloaded = true;
+ const std::string filename = "filename";
+ AppFile file(filename, persistent, downloaded, mobile_apis::FileType::BINARY);
+
+ app_impl_->AddFile(file);
+
+ EXPECT_TRUE(NULL != app_impl_->FindCommand(cmd_id));
+ EXPECT_TRUE(NULL != app_impl_->FindSubMenu(menu_id));
+ EXPECT_TRUE(NULL != app_impl_->FindChoiceSet(choice_set_id));
+ EXPECT_TRUE(app_impl_->IsSubscribedToButton(button));
+ EXPECT_TRUE(app_impl_->IsSubscribedToIVI(static_cast<uint32_t>(vi)));
+ auto help_prompt = app_impl_->help_prompt();
+ EXPECT_TRUE(help_prompt->asString() == some_string);
+ auto timeout_prompt = app_impl_->timeout_prompt();
+ EXPECT_TRUE(timeout_prompt->asString() == some_string);
+ auto vr_help = app_impl_->vr_help();
+ EXPECT_TRUE(vr_help->asString() == some_string);
+ auto vr_help_title = app_impl_->vr_help_title();
+ EXPECT_TRUE(vr_help_title->asString() == some_string);
+ auto kb_properties = app_impl_->keyboard_props();
+ EXPECT_TRUE(kb_properties->asString() == some_string);
+ auto menu_title = app_impl_->menu_title();
+ EXPECT_TRUE(menu_title->asString() == some_string);
+ auto menu_icon = app_impl_->menu_icon();
+ EXPECT_TRUE(menu_icon->asString() == some_string);
+ auto file_ptr = app_impl_->GetFile(filename);
+ EXPECT_TRUE(NULL != file_ptr);
+ EXPECT_TRUE(file_ptr->file_name == filename);
+
+ // Act
+ application_manager::DeleteApplicationData(app_impl_, app_manager_impl_);
+ EXPECT_FALSE(NULL != app_impl_->FindCommand(cmd_id));
+ EXPECT_FALSE(NULL != app_impl_->FindSubMenu(menu_id));
+ EXPECT_FALSE(NULL != app_impl_->FindChoiceSet(choice_set_id));
+ EXPECT_FALSE(app_impl_->IsSubscribedToButton(button));
+ EXPECT_FALSE(app_impl_->IsSubscribedToIVI(static_cast<uint32_t>(vi)));
+ help_prompt = app_impl_->help_prompt();
+ EXPECT_FALSE(help_prompt->asString() == some_string);
+ timeout_prompt = app_impl_->timeout_prompt();
+ EXPECT_FALSE(timeout_prompt->asString() == some_string);
+ vr_help = app_impl_->vr_help();
+ EXPECT_TRUE(vr_help == NULL);
+ vr_help_title = app_impl_->vr_help_title();
+ EXPECT_TRUE(vr_help_title == NULL);
+ kb_properties = app_impl_->keyboard_props();
+ EXPECT_FALSE(kb_properties->asString() == some_string);
+ menu_title = app_impl_->menu_title();
+ EXPECT_FALSE(menu_title->asString() == some_string);
+ menu_icon = app_impl_->menu_icon();
+ EXPECT_FALSE(menu_icon->asString() == some_string);
+ file_ptr = app_impl_->GetFile(filename);
+ EXPECT_TRUE(NULL == file_ptr);
+}
+
+TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectHMICleanupRequests) {
+ const uint32_t cmd_id = 1;
+ const uint32_t menu_id = 2;
+ const uint32_t choice_set_id = 3;
+ smart_objects::SmartObject cmd;
+ cmd[strings::msg_params][strings::cmd_id] = cmd_id;
+ cmd[strings::msg_params][strings::vr_commands][0] = "vrCmd";
+ cmd[strings::msg_params][strings::menu_id] = menu_id;
+ cmd[strings::msg_params][strings::interaction_choice_set_id] = choice_set_id;
+
+ app_impl_->AddCommand(cmd_id, cmd[strings::msg_params]);
+ app_impl_->AddSubMenu(menu_id, cmd[strings::menu_params]);
+ app_impl_->AddChoiceSet(choice_set_id, cmd[strings::msg_params]);
+ app_impl_->SubscribeToIVI(static_cast<uint32_t>(
+ mobile_apis::VehicleDataType::VEHICLEDATA_ACCPEDAL));
+ app_impl_->SubscribeToButton(mobile_apis::ButtonName::AC);
+
+ EXPECT_CALL(*mock_message_helper_, SendUnsubscribedWayPoints(_));
+
+ EXPECT_CALL(*mock_message_helper_, SendDeleteCommandRequest(_, _, _));
+
+ EXPECT_CALL(*mock_message_helper_, SendDeleteSubmenuRequest(_, _, _));
+
+ EXPECT_CALL(*mock_message_helper_, SendDeleteChoiceSetRequest(_, _, _));
+
+ EXPECT_CALL(*mock_message_helper_, SendResetPropertiesRequest(_, _));
+
+ EXPECT_CALL(*mock_message_helper_,
+ SendUnsubscribeButtonNotification(_, _, _));
+
+ EXPECT_CALL(*mock_message_helper_, SendUnsubscribeIVIRequest(_, _, _));
+
+ // Act
+ application_manager::DeleteApplicationData(app_impl_, app_manager_impl_);
+}
+
+} // application_manager_test
+} // components
+} // test
diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc
index fbd3a2a469..6b7f78b8f7 100644
--- a/src/components/application_manager/test/application_impl_test.cc
+++ b/src/components/application_manager/test/application_impl_test.cc
@@ -50,7 +50,9 @@
#include "resumption/last_state.h"
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "policy/mock_statistics_manager.h"
+#include "application_manager/mock_resume_ctrl.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
@@ -59,7 +61,6 @@ namespace application_manager_test {
using namespace application_manager;
using namespace mobile_apis;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
namespace custom_str = utils::custom_string;
using ::testing::_;
@@ -77,14 +78,12 @@ class ApplicationImplTest : public ::testing::Test {
policy_app_id = "policy_app_id";
app_name = "app_name";
mac_address = "mac_address";
+ device_handle = 0;
test_lvl = HMILevel::INVALID_ENUM;
state_id = HmiState::STATE_ID_REGULAR;
audiostate = AudioStreamingState::NOT_AUDIBLE;
syst_context = SystemContext::SYSCTXT_MAIN;
- testHmiState = CreateTestHmiState();
- EXPECT_CALL(mock_application_manager_, CreateRegularState(app_id, _, _, _))
- .WillOnce(Return(testHmiState));
EXPECT_CALL(mock_application_manager_, get_settings())
.WillRepeatedly(ReturnRef(mock_application_manager_settings_));
EXPECT_CALL(mock_application_manager_settings_, app_icons_folder())
@@ -95,15 +94,17 @@ class ApplicationImplTest : public ::testing::Test {
audio_data_stopped_timeout()).WillOnce(Return(0));
EXPECT_CALL(mock_application_manager_settings_,
video_data_stopped_timeout()).WillOnce(Return(0));
- app_impl = new ApplicationImpl(app_id,
- policy_app_id,
- mac_address,
- app_name,
- utils::MakeShared<MockStatisticsManager>(),
- mock_application_manager_);
- }
- void TearDown() OVERRIDE {
- delete app_impl;
+ app_impl.reset(
+ new ApplicationImpl(app_id,
+ policy_app_id,
+ mac_address,
+ device_handle,
+ app_name,
+ utils::MakeShared<MockStatisticsManager>(),
+ mock_application_manager_));
+
+ HmiStatePtr initial_state = CreateTestHmiState();
+ app_impl->SetInitialState(initial_state);
}
HmiStatePtr CreateTestHmiState();
@@ -114,10 +115,11 @@ class ApplicationImplTest : public ::testing::Test {
void CheckCurrentHMIState();
MockApplicationManagerSettings mock_application_manager_settings_;
MockApplicationManager mock_application_manager_;
- ApplicationImpl* app_impl;
+ utils::SharedPtr<ApplicationImpl> app_impl;
uint32_t app_id;
std::string policy_app_id;
std::string mac_address;
+ connection_handler::DeviceHandle device_handle;
custom_str::CustomString app_name;
const std::string directory_name = "./test_storage";
HmiState::StateID state_id;
@@ -128,8 +130,10 @@ class ApplicationImplTest : public ::testing::Test {
};
HmiStatePtr ApplicationImplTest::CreateTestHmiState() {
- HmiStatePtr testState =
- utils::MakeShared<HmiState>(app_id, mock_application_manager_, state_id);
+ HmiStatePtr testState = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(app_impl),
+ mock_application_manager_,
+ state_id);
testState->set_hmi_level(test_lvl);
testState->set_audio_streaming_state(audiostate);
testState->set_system_context(syst_context);
@@ -142,7 +146,7 @@ HmiStatePtr ApplicationImplTest::TestAddHmiState(HMILevel::eType hmi_lvl,
test_lvl = hmi_lvl;
state_id = id_state;
HmiStatePtr state = CreateTestHmiState();
- (app_impl->*hmi_action)(state);
+ ((app_impl.get())->*hmi_action)(state);
return state;
}
@@ -565,70 +569,139 @@ TEST_F(ApplicationImplTest, SubscribeToSoftButton_UnsubscribeFromSoftButton) {
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeNotNaviNotVoice) {
smart_objects::SmartObject type_media;
- type_media[0] = AppHMIType::MEDIA;
+ type_media[0] = mobile_apis::AppHMIType::MEDIA;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(type_media);
app_impl->ChangeSupportingAppHMIType();
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) {
smart_objects::SmartObject type_comm;
- type_comm[0] = AppHMIType::COMMUNICATION;
+ type_comm[0] = mobile_apis::AppHMIType::COMMUNICATION;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(type_comm);
app_impl->ChangeSupportingAppHMIType();
EXPECT_FALSE(app_impl->is_navi());
EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) {
smart_objects::SmartObject type_navi;
- type_navi[0] = AppHMIType::NAVIGATION;
+ type_navi[0] = mobile_apis::AppHMIType::NAVIGATION;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(type_navi);
app_impl->ChangeSupportingAppHMIType();
EXPECT_TRUE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) {
smart_objects::SmartObject app_types;
- app_types[0] = AppHMIType::NAVIGATION;
- app_types[1] = AppHMIType::COMMUNICATION;
- app_types[2] = AppHMIType::MEDIA;
+ app_types[0] = mobile_apis::AppHMIType::NAVIGATION;
+ app_types[1] = mobile_apis::AppHMIType::COMMUNICATION;
+ app_types[2] = mobile_apis::AppHMIType::MEDIA;
+
+ EXPECT_FALSE(app_impl->is_navi());
+ EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
+
+ app_impl->set_app_types(app_types);
+ app_impl->ChangeSupportingAppHMIType();
+
+ EXPECT_TRUE(app_impl->is_navi());
+ EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
+}
+
+TEST_F(ApplicationImplTest,
+ ChangeSupportingAppHMIType_TypeIsNaviAndVoiceAndProjection) {
+ smart_objects::SmartObject app_types;
+ app_types[0] = mobile_apis::AppHMIType::NAVIGATION;
+ app_types[1] = mobile_apis::AppHMIType::COMMUNICATION;
+ app_types[2] = mobile_apis::AppHMIType::MEDIA;
+ app_types[3] = mobile_apis::AppHMIType::PROJECTION;
EXPECT_FALSE(app_impl->is_navi());
EXPECT_FALSE(app_impl->is_voice_communication_supported());
+ EXPECT_FALSE(app_impl->mobile_projection_enabled());
app_impl->set_app_types(app_types);
app_impl->ChangeSupportingAppHMIType();
EXPECT_TRUE(app_impl->is_navi());
EXPECT_TRUE(app_impl->is_voice_communication_supported());
+ EXPECT_TRUE(app_impl->mobile_projection_enabled());
}
TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) {
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
SendHashUpdateNotification(app_id, _)).Times(1);
+ resumprion_test::MockResumeCtrl mock_resume_ctrl;
+ EXPECT_CALL(mock_application_manager_, resume_controller())
+ .WillOnce(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, is_suspended()).WillOnce(Return(false));
+ app_impl->UpdateHash();
+
+ EXPECT_TRUE(app_impl->is_application_data_changed());
+}
+
+TEST_F(ApplicationImplTest, UpdateHash_AppMngrSuspended) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendHashUpdateNotification(app_id, _)).Times(0);
+ resumprion_test::MockResumeCtrl mock_resume_ctrl;
+ EXPECT_CALL(mock_application_manager_, resume_controller())
+ .WillOnce(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, is_suspended()).WillOnce(Return(true));
app_impl->UpdateHash();
EXPECT_TRUE(app_impl->is_application_data_changed());
}
+TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingNotApproved) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviSetVideoConfig(app_id, _, _));
+
+ smart_objects::SmartObject params;
+ app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params);
+}
+
+TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingApproved) {
+ app_impl->set_video_streaming_approved(true);
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviSetVideoConfig(app_id, _, _)).Times(0);
+
+ smart_objects::SmartObject params;
+ app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params);
+}
+
+TEST_F(ApplicationImplTest, SetVideoConfig_NotMobileNavi) {
+ EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ SendNaviSetVideoConfig(app_id, _, _)).Times(0);
+
+ smart_objects::SmartObject params;
+ app_impl->SetVideoConfig(protocol_handler::ServiceType::kAudio, params);
+}
+
TEST_F(ApplicationImplTest, StartStreaming_MobileNavi_StreamingNotApproved) {
EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
SendNaviStartStream(app_id, _));
@@ -731,6 +804,29 @@ TEST_F(ApplicationImplTest, StopStreaming_StreamingApproved) {
EXPECT_FALSE(app_impl->audio_streaming_approved());
}
+TEST_F(ApplicationImplTest, PushPopMobileMessage) {
+ smart_objects::SmartObjectSPtr on_driver_distraction =
+ utils::MakeShared<smart_objects::SmartObject>();
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ (*on_driver_distraction)[strings::params][strings::function_id] =
+ mobile_api::FunctionID::OnDriverDistractionID;
+
+ (*on_driver_distraction)[strings::msg_params][mobile_notification::state] =
+ state;
+
+ app_impl->PushMobileMessage(on_driver_distraction);
+ app_impl->PushMobileMessage(on_driver_distraction);
+
+ MobileMessageQueue messages;
+ app_impl->SwapMobileMessageQueue(messages);
+
+ EXPECT_EQ(2u, messages.size());
+
+ app_impl->SwapMobileMessageQueue(messages);
+ EXPECT_TRUE(messages.empty());
+}
+
} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
new file mode 100644
index 0000000000..b9437d55e0
--- /dev/null
+++ b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include <memory>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/application.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "utils/custom_string.h"
+#include "utils/make_shared.h"
+#include "encryption/hashing.h"
+
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_resumption_data.h"
+#include "application_manager/mock_hmi_command_factory.h"
+#include "application_manager/mock_request.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "policy/mock_policy_settings.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace am = application_manager;
+
+using testing::_;
+using ::testing::DoAll;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::SetArgPointee;
+
+using namespace application_manager;
+
+namespace {
+const uint32_t kApplicationId = 0u;
+const std::string kDirectoryName = "./test_storage";
+const uint32_t kTimeout = 10000u;
+} // namespace
+
+/**
+ * @brief The ApplicationManagerImplMockHmiTest class uses mocked HMI factory
+ * which calls its static method and real (non-mocked) MessageHelper.
+ * Class is separated from ApplicationManagerImplTest since it requires real
+ * HMI factory and mocked MessageHelper. So it is not possible to combine
+ * this code together.
+ */
+class ApplicationManagerImplMockHmiTest : public ::testing::Test {
+ public:
+ ApplicationManagerImplMockHmiTest()
+ : mock_storage_(
+ ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ mock_app_mngr_)) {}
+
+ protected:
+ void SetUp() OVERRIDE {
+ const uint8_t expected_tread_pool_size = 2u;
+ const uint8_t stop_streaming_timeout = 1u;
+
+ ON_CALL(mock_application_manager_settings_, thread_pool_size())
+ .WillByDefault(Return(expected_tread_pool_size));
+ ON_CALL(mock_application_manager_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, launch_hmi())
+ .WillByDefault(Return(true));
+ ON_CALL(mock_application_manager_settings_, stop_streaming_timeout())
+ .WillByDefault(Return(stop_streaming_timeout));
+ ON_CALL(mock_application_manager_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kTimeout));
+
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+
+ app_manager_impl_.reset(new am::ApplicationManagerImpl(
+ mock_application_manager_settings_, mock_policy_settings_));
+
+ app_manager_impl_->set_connection_handler(&mock_connection_handler_);
+ app_manager_impl_->resume_controller().set_resumption_storage(
+ mock_storage_);
+ }
+
+ void SetCommonExpectationOnAppReconnection(
+ const connection_handler::DeviceHandle new_device_id,
+ const uint32_t new_application_id,
+ const std::string& mac_address) {
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnSessionKey(new_application_id,
+ _,
+ _,
+ testing::An<connection_handler::DeviceHandle*>()))
+ .WillOnce(DoAll(SetArgPointee<3u>(new_device_id), Return(0)));
+
+ const std::string connection_type = "MyConnectionType";
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ ::testing::Matcher<connection_handler::DeviceHandle>(new_device_id),
+ _,
+ _,
+ _,
+ _))
+ .WillOnce(DoAll(SetArgPointee<3u>(mac_address),
+ SetArgPointee<4u>(connection_type),
+ Return(0)));
+ }
+
+ utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
+ mock_storage_;
+ application_manager_test::MockApplicationManager mock_app_mngr_;
+ NiceMock<policy_handler_test::MockPolicySettings> mock_policy_settings_;
+ NiceMock<connection_handler_test::MockConnectionHandler>
+ mock_connection_handler_;
+ NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
+ NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
+ std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+};
+
+TEST_F(ApplicationManagerImplMockHmiTest,
+ PostponeCommandsDuringSwitching_ExpectSendingOnSwitchingEnd) {
+ const uint32_t application_id = 1u;
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1u;
+ const custom_str::CustomString app_name("");
+
+ utils::SharedPtr<ApplicationImpl> app_impl = new ApplicationImpl(
+ application_id,
+ policy_app_id,
+ encryption::MakeHash(mac_address),
+ device_id,
+ app_name,
+ utils::SharedPtr<usage_statistics::StatisticsManager>(
+ new usage_statistics_test::MockStatisticsManager()),
+ *app_manager_impl_);
+
+ app_manager_impl_->AddMockApplication(app_impl);
+
+ const connection_handler::Device bt(
+ device_id, "BT_device", mac_address, "BLUETOOTH");
+
+ const connection_handler::Device usb(
+ device_id + 1, "USB_device", "USB_serial", "USB_IOS");
+
+ MockHMICommandFactory* mock_hmi_factory =
+ MockHMICommandFactory::mock_hmi_command_factory();
+
+ // Skip sending notification on device switching as it is not the goal here
+ EXPECT_CALL(*mock_hmi_factory, CreateCommand(_, _))
+ .WillOnce(Return(utils::SharedPtr<commands::Command>()));
+
+ app_manager_impl_->OnDeviceSwitchingStart(bt, usb);
+
+ const uint32_t connection_key = 1u;
+ const uint32_t correlation_id_1 = 1u;
+ const uint32_t correlation_id_2 = 2u;
+ const uint32_t correlation_id_3 = 3u;
+ utils::SharedPtr<NiceMock<MockRequest> > cmd_1 =
+ utils::MakeShared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_1);
+ utils::SharedPtr<NiceMock<MockRequest> > cmd_2 =
+ utils::MakeShared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_2);
+ utils::SharedPtr<NiceMock<MockRequest> > cmd_3 =
+ utils::MakeShared<NiceMock<MockRequest> >(connection_key,
+ correlation_id_3);
+
+ EXPECT_CALL(*mock_hmi_factory, CreateCommand(_, _))
+ .WillOnce(Return(cmd_1))
+ .WillOnce(Return(cmd_2))
+ .WillOnce(Return(cmd_3));
+
+ commands::MessageSharedPtr hmi_msg_1 =
+ utils::MakeShared<smart_objects::SmartObject>();
+ commands::MessageSharedPtr hmi_msg_2 =
+ utils::MakeShared<smart_objects::SmartObject>();
+ commands::MessageSharedPtr hmi_msg_3 =
+ utils::MakeShared<smart_objects::SmartObject>();
+
+ (*hmi_msg_1)[strings::msg_params][strings::app_id] =
+ (*hmi_msg_2)[strings::msg_params][strings::app_id] =
+ (*hmi_msg_3)[strings::msg_params][strings::app_id] = application_id;
+
+ EXPECT_CALL(*cmd_1, Init()).Times(0);
+ EXPECT_CALL(*cmd_2, Init()).Times(0);
+ EXPECT_CALL(*cmd_3, Init()).Times(0);
+
+ // Act
+ app_manager_impl_->ManageHMICommand(hmi_msg_1);
+ app_manager_impl_->ManageHMICommand(hmi_msg_2);
+ app_manager_impl_->ManageHMICommand(hmi_msg_3);
+
+ EXPECT_CALL(*mock_hmi_factory, CreateCommand(_, _))
+ .WillOnce(Return(cmd_1))
+ .WillOnce(Return(cmd_2))
+ .WillOnce(Return(cmd_3));
+
+ EXPECT_CALL(*cmd_1, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*cmd_1, Run());
+ EXPECT_CALL(*cmd_2, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*cmd_2, Run());
+ EXPECT_CALL(*cmd_3, Init()).WillOnce(Return(true));
+ EXPECT_CALL(*cmd_3, Run());
+
+ const connection_handler::DeviceHandle new_device_id = 2;
+ const uint32_t new_application_id = 2;
+ SetCommonExpectationOnAppReconnection(
+ new_device_id, new_application_id, mac_address);
+
+ app_manager_impl_->ProcessReconnection(app_impl, new_application_id);
+ app_manager_impl_->OnApplicationSwitched(app_impl);
+
+ Mock::VerifyAndClearExpectations(&mock_hmi_factory);
+}
+
+} // application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc
new file mode 100644
index 0000000000..e54bc612ca
--- /dev/null
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -0,0 +1,829 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+#include <bson_object.h>
+
+#include "gtest/gtest.h"
+#include "application_manager/application.h"
+#include "application_manager/application_impl.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_resumption_data.h"
+#include "application_manager/resumption/resume_ctrl_impl.h"
+#include "application_manager/test/include/application_manager/mock_message_helper.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "hmi_message_handler/mock_hmi_message_handler.h"
+#include "policy/mock_policy_settings.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol/bson_object_keys.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "utils/custom_string.h"
+#include "utils/file_system.h"
+#include "utils/lock.h"
+#include "utils/make_shared.h"
+#include "utils/push_log.h"
+#include "encryption/hashing.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+namespace am = application_manager;
+namespace policy_test = test::components::policy_handler_test;
+namespace con_test = connection_handler_test;
+
+using testing::_;
+using ::testing::Matcher;
+using ::testing::ByRef;
+using ::testing::DoAll;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::SaveArg;
+using ::testing::SetArgPointee;
+
+using namespace application_manager;
+
+// custom action to call a member function with 4 arguments
+ACTION_P6(InvokeMemberFuncWithArg4, ptr, memberFunc, a, b, c, d) {
+ (ptr->*memberFunc)(a, b, c, d);
+}
+
+namespace {
+const std::string kDirectoryName = "./test_storage";
+const uint32_t kTimeout = 10000u;
+connection_handler::DeviceHandle kDeviceId = 12345u;
+} // namespace
+
+class ApplicationManagerImplTest : public ::testing::Test {
+ public:
+ ApplicationManagerImplTest()
+ : mock_storage_(
+ ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
+ mock_app_mngr_))
+ , mock_message_helper_(
+ application_manager::MockMessageHelper::message_helper_mock())
+ , app_id_(0u) {
+ logger::create_log_message_loop_thread();
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+ ~ApplicationManagerImplTest() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ protected:
+ void SetUp() OVERRIDE {
+ CreateAppManager();
+ ON_CALL(mock_connection_handler_, GetDataOnSessionKey(_, _, _, &kDeviceId))
+ .WillByDefault(DoAll(SetArgPointee<3u>(app_id_), Return(0)));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+
+ app_manager_impl_->resume_controller().set_resumption_storage(
+ mock_storage_);
+ app_manager_impl_->set_connection_handler(&mock_connection_handler_);
+ }
+
+ void CreateAppManager() {
+ const uint8_t expected_tread_pool_size = 2u;
+ const uint8_t stop_streaming_timeout = 1u;
+
+ ON_CALL(mock_application_manager_settings_, thread_pool_size())
+ .WillByDefault(Return(expected_tread_pool_size));
+ ON_CALL(mock_application_manager_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kDirectoryName));
+ ON_CALL(mock_application_manager_settings_, launch_hmi())
+ .WillByDefault(Return(false));
+ ON_CALL(mock_application_manager_settings_, stop_streaming_timeout())
+ .WillByDefault(Return(stop_streaming_timeout));
+ ON_CALL(mock_application_manager_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kTimeout));
+
+ app_manager_impl_.reset(new am::ApplicationManagerImpl(
+ mock_application_manager_settings_, mock_policy_settings_));
+ mock_app_ptr_ = utils::SharedPtr<MockApplication>(new MockApplication());
+
+ ASSERT_TRUE(app_manager_impl_.get());
+ ASSERT_TRUE(mock_app_ptr_.get());
+ }
+
+ void AddMockApplication() {
+ app_manager_impl_->AddMockApplication(mock_app_ptr_);
+ }
+
+ void SetCommonExpectationOnAppReconnection(
+ const connection_handler::DeviceHandle new_device_id,
+ const uint32_t new_application_id,
+ const std::string& mac_address) {
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnSessionKey(new_application_id,
+ _,
+ _,
+ testing::An<connection_handler::DeviceHandle*>()))
+ .WillOnce(DoAll(SetArgPointee<3u>(new_device_id), Return(0)));
+
+ const std::string connection_type = "MyConnectionType";
+ EXPECT_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ ::testing::Matcher<connection_handler::DeviceHandle>(new_device_id),
+ _,
+ _,
+ _,
+ _))
+ .WillOnce(DoAll(SetArgPointee<3u>(mac_address),
+ SetArgPointee<4u>(connection_type),
+ Return(0)));
+ }
+
+ NiceMock<policy_test::MockPolicySettings> mock_policy_settings_;
+ utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
+ mock_storage_;
+ NiceMock<con_test::MockConnectionHandler> mock_connection_handler_;
+ NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_;
+ NiceMock<MockApplicationManagerSettings> mock_application_manager_settings_;
+ application_manager_test::MockApplicationManager mock_app_mngr_;
+ std::auto_ptr<am::ApplicationManagerImpl> app_manager_impl_;
+ application_manager::MockMessageHelper* mock_message_helper_;
+ uint32_t app_id_;
+ utils::SharedPtr<MockApplication> mock_app_ptr_;
+};
+
+TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) {
+ using namespace NsSmartDeviceLink::NsSmartObjects;
+ SmartObject app_data;
+ const uint32_t connection_key = 65537u;
+
+ app_data[am::json::name] = "application_manager_test";
+ app_data[am::json::appId] = app_id_;
+ app_data[am::json::android] = "bucket";
+ app_data[am::json::android][am::json::packageName] = "com.android.test";
+ smart_objects::SmartObject sm_object(SmartType_Map);
+ sm_object[am::json::response][0] = app_data;
+ SmartObjectSPtr sptr = MakeShared<SmartObject>(sm_object);
+
+ ON_CALL(*mock_message_helper_, CreateModuleInfoSO(_, _))
+ .WillByDefault(Return(sptr));
+ ON_CALL(*mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillByDefault(Return(sptr));
+ app_manager_impl_->ProcessQueryApp(sm_object, connection_key);
+}
+
+TEST_F(ApplicationManagerImplTest,
+ SubscribeAppForWayPoints_ExpectSubscriptionApp) {
+ auto app_ptr =
+ ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
+ EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ UnsubscribeAppForWayPoints_ExpectUnsubscriptionApp) {
+ auto app_ptr =
+ ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
+ EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
+ app_manager_impl_->UnsubscribeAppFromWayPoints(app_ptr);
+ EXPECT_FALSE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr));
+ const std::set<int32_t> result =
+ app_manager_impl_->GetAppsSubscribedForWayPoints();
+ EXPECT_TRUE(result.empty());
+}
+
+TEST_F(
+ ApplicationManagerImplTest,
+ IsAnyAppSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
+ EXPECT_FALSE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
+ app_manager_impl_->SubscribeAppForWayPoints(app_id_);
+ EXPECT_TRUE(app_manager_impl_->IsAnyAppSubscribedForWayPoints());
+}
+
+TEST_F(
+ ApplicationManagerImplTest,
+ GetAppsSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) {
+ auto app_ptr =
+ ApplicationSharedPtr::static_pointer_cast<am::Application>(mock_app_ptr_);
+ app_manager_impl_->SubscribeAppForWayPoints(app_ptr);
+ std::set<int32_t> result = app_manager_impl_->GetAppsSubscribedForWayPoints();
+ EXPECT_EQ(1u, result.size());
+ EXPECT_TRUE(result.find(app_ptr) != result.end());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_RpcService) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kRpc;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownApp) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kInvalidServiceType;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(456));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownService) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kInvalidServiceType;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_VideoServiceStart) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoServiceNotStart1) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ // is_navi() is false
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(false));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() and StartStreaming() should not be called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0);
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoServiceNotStart2) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ // HMI level is not FULL nor LIMITED
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() and StartStreaming() should not be called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0);
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is false and list is empty
+ EXPECT_FALSE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoSetConfig_SUCCESS) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params,
+ protocol_handler::strings::protocol_version,
+ protocol_version);
+ bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100);
+ char protocol_name[] = "RTP";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_protocol, protocol_name);
+ char codec_name[] = "VP9";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_codec, codec_name);
+ bson_object_put_int32(&input_params, protocol_handler::strings::height, 640);
+ bson_object_put_int32(&input_params, protocol_handler::strings::width, 480);
+
+ smart_objects::SmartObject converted_params(smart_objects::SmartType_Map);
+ converted_params[strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ converted_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::VP9;
+ converted_params[strings::height] = 640;
+ converted_params[strings::width] = 480;
+
+ std::vector<std::string> empty;
+
+ // check: SetVideoConfig() and StartStreaming() are called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(service_type, converted_params))
+ .WillOnce(DoAll(InvokeMemberFuncWithArg4(
+ app_manager_impl_.get(),
+ &ApplicationManagerImpl::OnStreamingConfigured,
+ session_key,
+ service_type,
+ true,
+ ByRef(empty)),
+ Return(true)));
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+static bool ValidateList(std::vector<std::string>& expected,
+ std::vector<std::string>& actual) {
+ if (expected.size() != actual.size()) {
+ return false;
+ }
+ for (unsigned int i = 0; i < expected.size(); i++) {
+ std::string& param = expected[i];
+ unsigned int j;
+ for (j = 0; j < actual.size(); j++) {
+ if (param == actual[j]) {
+ break;
+ }
+ }
+ if (j == actual.size()) {
+ // not found
+ return false;
+ }
+ }
+ return true;
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoSetConfig_FAILURE) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params,
+ protocol_handler::strings::protocol_version,
+ protocol_version);
+ bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100);
+ char protocol_name[] = "RTP";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_protocol, protocol_name);
+ char codec_name[] = "VP9";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_codec, codec_name);
+ bson_object_put_int32(&input_params, protocol_handler::strings::height, 640);
+ bson_object_put_int32(&input_params, protocol_handler::strings::width, 480);
+
+ smart_objects::SmartObject converted_params(smart_objects::SmartType_Map);
+ converted_params[strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ converted_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::VP9;
+ converted_params[strings::height] = 640;
+ converted_params[strings::width] = 480;
+
+ std::vector<std::string> rejected_list;
+ rejected_list.push_back(std::string("protocol"));
+ rejected_list.push_back(std::string("codec"));
+
+ // simulate HMI returning negative response
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(service_type, converted_params))
+ .WillOnce(DoAll(InvokeMemberFuncWithArg4(
+ app_manager_impl_.get(),
+ &ApplicationManagerImpl::OnStreamingConfigured,
+ session_key,
+ service_type,
+ false,
+ ByRef(rejected_list)),
+ Return(true)));
+
+ // check: StartStreaming() should not be called
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0);
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is false
+ EXPECT_FALSE(result);
+
+ // check: rejected param list contains "videoProtocol" and "videoCodec"
+ ASSERT_EQ(2u, rejected_params.size());
+ std::vector<std::string> expected_list;
+ expected_list.push_back(
+ std::string(protocol_handler::strings::video_protocol));
+ expected_list.push_back(std::string(protocol_handler::strings::video_codec));
+ ASSERT_TRUE(ValidateList(expected_list, rejected_params));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_VideoServiceWithoutVideoParams) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kMobileNav;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params, "protocolVersion", protocol_version);
+ bson_object_put_int64(&input_params, "mtu", 100);
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_AudioServiceStart) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kAudio;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, NULL);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnServiceStartedCallback_AudioServiceWithParams) {
+ AddMockApplication();
+
+ const connection_handler::DeviceHandle device_handle = 0;
+ const protocol_handler::ServiceType service_type =
+ protocol_handler::ServiceType::kAudio;
+ const int32_t session_key = 123;
+ EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key));
+ EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ bool result = false;
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _))
+ .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params)));
+
+ BsonObject input_params;
+ bson_object_initialize_default(&input_params);
+ char protocol_version[] = "1.0.0";
+ bson_object_put_string(&input_params,
+ protocol_handler::strings::protocol_version,
+ protocol_version);
+ bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100);
+ char protocol_name[] = "RTP";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_protocol, protocol_name);
+ char codec_name[] = "VP9";
+ bson_object_put_string(
+ &input_params, protocol_handler::strings::video_codec, codec_name);
+ bson_object_put_int32(&input_params, protocol_handler::strings::height, 640);
+ bson_object_put_int32(&input_params, protocol_handler::strings::width, 480);
+
+ // check: SetVideoConfig() should not be called, StartStreaming() is called
+ EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0);
+ EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return());
+
+ app_manager_impl_->OnServiceStartedCallback(
+ device_handle, session_key, service_type, &input_params);
+
+ // check: return value is true and list is empty
+ EXPECT_TRUE(result);
+ EXPECT_TRUE(rejected_params.empty());
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnDeviceSwitchingStart_ExpectPutAppsInWaitList) {
+ utils::SharedPtr<MockApplication> switching_app_ptr =
+ utils::MakeShared<MockApplication>();
+
+ const std::string switching_device_id = "switching";
+ const std::string switching_device_id_hash =
+ encryption::MakeHash(switching_device_id);
+ app_manager_impl_->AddMockApplication(switching_app_ptr);
+ EXPECT_CALL(*switching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(switching_device_id_hash));
+
+ const std::string policy_app_id_switch = "abc";
+ EXPECT_CALL(*switching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_switch));
+
+ const auto hmi_level_switching_app = mobile_apis::HMILevel::HMI_FULL;
+ EXPECT_CALL(*switching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_switching_app));
+
+ utils::SharedPtr<MockApplication> nonswitching_app_ptr =
+ utils::MakeShared<MockApplication>();
+
+ const std::string nonswitching_device_id = "nonswitching";
+ const std::string nonswitching_device_id_hash =
+ encryption::MakeHash(nonswitching_device_id);
+ app_manager_impl_->AddMockApplication(nonswitching_app_ptr);
+ EXPECT_CALL(*nonswitching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(nonswitching_device_id_hash));
+
+ const std::string policy_app_id_nonswitch = "efg";
+ EXPECT_CALL(*nonswitching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_nonswitch));
+
+ const auto hmi_level_nonswitching_app = mobile_apis::HMILevel::HMI_LIMITED;
+ EXPECT_CALL(*nonswitching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_nonswitching_app));
+
+ // Act
+ const connection_handler::DeviceHandle switching_handle = 1;
+ const connection_handler::Device switching_device(
+ switching_handle, "switching_device", switching_device_id, "BLUETOOTH");
+
+ const connection_handler::DeviceHandle non_switching_handle = 2;
+ const connection_handler::Device non_switching_device(non_switching_handle,
+ "non_switching_device",
+ nonswitching_device_id,
+ "USB");
+
+ EXPECT_CALL(*mock_message_helper_, CreateDeviceListSO(_, _, _))
+ .WillOnce(Return(smart_objects::SmartObjectSPtr()));
+ app_manager_impl_->OnDeviceSwitchingStart(switching_device,
+ non_switching_device);
+ EXPECT_TRUE(app_manager_impl_->IsAppInReconnectMode(policy_app_id_switch));
+ EXPECT_FALSE(
+ app_manager_impl_->IsAppInReconnectMode(policy_app_id_nonswitch));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ OnDeviceSwitchingFinish_ExpectUnregisterAppsInWaitList) {
+ utils::SharedPtr<MockApplication> switching_app_ptr =
+ utils::MakeShared<MockApplication>();
+
+ const std::string switching_device_id = "switching";
+ const std::string switching_device_id_hash =
+ encryption::MakeHash(switching_device_id);
+ app_manager_impl_->AddMockApplication(switching_app_ptr);
+ EXPECT_CALL(*switching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(switching_device_id_hash));
+
+ const std::string policy_app_id_switch = "abc";
+ EXPECT_CALL(*switching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_switch));
+
+ const auto hmi_level_switching_app = mobile_apis::HMILevel::HMI_FULL;
+ EXPECT_CALL(*switching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_switching_app));
+
+ utils::SharedPtr<MockApplication> nonswitching_app_ptr =
+ utils::MakeShared<MockApplication>();
+
+ const std::string nonswitching_device_id = "nonswitching";
+ const std::string nonswitching_device_id_hash =
+ encryption::MakeHash(nonswitching_device_id);
+ app_manager_impl_->AddMockApplication(nonswitching_app_ptr);
+ EXPECT_CALL(*nonswitching_app_ptr, mac_address())
+ .WillRepeatedly(ReturnRef(nonswitching_device_id_hash));
+
+ const std::string policy_app_id_nonswitch = "efg";
+ EXPECT_CALL(*nonswitching_app_ptr, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_nonswitch));
+
+ const auto hmi_level_nonswitching_app = mobile_apis::HMILevel::HMI_LIMITED;
+ EXPECT_CALL(*nonswitching_app_ptr, hmi_level())
+ .WillRepeatedly(Return(hmi_level_nonswitching_app));
+
+ // Act
+ const connection_handler::DeviceHandle switching_handle = 1;
+ const connection_handler::Device switching_device(
+ switching_handle, "switching_device", switching_device_id, "BLUETOOTH");
+
+ const connection_handler::DeviceHandle non_switching_handle = 2;
+ const connection_handler::Device non_switching_device(non_switching_handle,
+ "non_switching_device",
+ nonswitching_device_id,
+ "USB");
+
+ EXPECT_CALL(*mock_message_helper_, CreateDeviceListSO(_, _, _))
+ .WillOnce(Return(smart_objects::SmartObjectSPtr()));
+
+ app_manager_impl_->OnDeviceSwitchingStart(switching_device,
+ non_switching_device);
+
+ EXPECT_TRUE(app_manager_impl_->IsAppInReconnectMode(policy_app_id_switch));
+
+ app_manager_impl_->OnDeviceSwitchingFinish(switching_device_id);
+ EXPECT_FALSE(
+ app_manager_impl_->application_by_policy_id(policy_app_id_switch));
+}
+
+TEST_F(ApplicationManagerImplTest,
+ ProcessReconnection_ExpectChangeAppIdDeviceId) {
+ const uint32_t application_id = 1;
+ const std::string policy_app_id = "p_app_id";
+ const std::string mac_address = "MA:CA:DD:RE:SS";
+ const connection_handler::DeviceHandle device_id = 1;
+ const custom_str::CustomString app_name("");
+
+ utils::SharedPtr<ApplicationImpl> app_impl = new ApplicationImpl(
+ application_id,
+ policy_app_id,
+ mac_address,
+ device_id,
+ app_name,
+ utils::SharedPtr<usage_statistics::StatisticsManager>(
+ new usage_statistics_test::MockStatisticsManager()),
+ *app_manager_impl_);
+
+ app_manager_impl_->AddMockApplication(app_impl);
+
+ const connection_handler::DeviceHandle new_device_id = 2;
+ const uint32_t new_application_id = 2;
+ SetCommonExpectationOnAppReconnection(
+ new_device_id, new_application_id, mac_address);
+
+ // Act
+ app_manager_impl_->ProcessReconnection(app_impl, new_application_id);
+ EXPECT_EQ(new_device_id, app_impl->device());
+ EXPECT_EQ(new_application_id, app_impl->app_id());
+}
+
+} // application_manager_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc
index 7bc34966b4..33f23022f0 100644
--- a/src/components/application_manager/test/application_state_test.cc
+++ b/src/components/application_manager/test/application_state_test.cc
@@ -34,6 +34,7 @@
#include "gtest/gtest.h"
#include "application_manager/hmi_state.h"
#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
#include "application_manager/event_engine/event_dispatcher.h"
#include "resumption/last_state.h"
#include "application_manager/policies/policy_handler.h"
@@ -64,12 +65,17 @@ std::vector<StateID> GenerateCurrentStates() {
}
class ApplicationStateTest : public ::testing::Test {
+ public:
+ void SetUp() OVERRIDE {
+ mock_app_.reset(new MockApplication);
+ }
+
protected:
static std::vector<StateID> added_states_;
ApplicationState app_state;
const StateID current_id = StateID::STATE_ID_CURRENT;
const StateID postponed_id = StateID::STATE_ID_POSTPONED;
- const uint32_t app_id = 10;
+ utils::SharedPtr<MockApplication> mock_app_;
MockApplicationManager app_mngr_;
};
@@ -79,8 +85,10 @@ std::vector<StateID> ApplicationStateTest::added_states_ =
TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
EXPECT_EQ(state, app_state.GetState(current_id));
}
@@ -89,8 +97,10 @@ TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) {
TEST_F(ApplicationStateTest, AddStates_RemoveStates_GetCurrentState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
HmiStatePtr curr_state = app_state.GetState(current_id);
@@ -110,16 +120,20 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
// Added some states
std::vector<StateID>::iterator new_state = added_states_.begin();
for (; new_state != added_states_.end(); ++new_state) {
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
}
// Postponed state wasn't added
HmiStatePtr get_postponed_id = app_state.GetState(postponed_id);
EXPECT_EQ(NULL, get_postponed_id);
// Add posponed state
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Postponed state exists
get_postponed_id = app_state.GetState(postponed_id);
@@ -129,14 +143,19 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) {
TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
// Add state
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
state->set_hmi_level(HMILevel::HMI_FULL);
app_state.AddState(state);
++new_state;
// Add some other
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
state->set_hmi_level(HMILevel::HMI_LIMITED);
}
@@ -150,13 +169,18 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
std::vector<StateID>::iterator new_state = added_states_.begin();
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
++new_state;
// Add postponed state
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Make sure that the state was added
@@ -164,7 +188,10 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
ASSERT_EQ(state, post_state);
for (; new_state != added_states_.end(); ++new_state) {
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, *new_state);
+ state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ *new_state);
app_state.AddState(state);
}
@@ -184,22 +211,32 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) {
TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
// Add some state
StateID first_state = StateID::STATE_ID_PHONE_CALL;
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, first_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ first_state);
app_state.AddState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Add new postponed state
- const uint32_t app_id2 = 10;
- state = utils::MakeShared<HmiState>(app_id2, app_mngr_, postponed_id);
+ utils::SharedPtr<MockApplication> mock_app_2(new MockApplication);
+ state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Add regular state
- state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, StateID::STATE_ID_REGULAR);
+ state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ StateID::STATE_ID_REGULAR);
app_state.AddState(state);
// Postponed state is the first
@@ -213,8 +250,10 @@ TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) {
TEST_F(ApplicationStateTest, InitState_GetRegularState) {
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, init_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ init_state);
app_state.InitState(state);
@@ -228,14 +267,19 @@ TEST_F(ApplicationStateTest, InitState_GetRegularState) {
TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
// Precondition
StateID init_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state =
- utils::MakeShared<HmiState>(app_id, app_mngr_, init_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ init_state);
state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
app_state.InitState(state);
// Add postponed state
- state = utils::MakeShared<HmiState>(app_id, app_mngr_, postponed_id);
+ state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ postponed_id);
app_state.AddState(state);
// Make sure that state was added
@@ -252,7 +296,10 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) {
TEST_F(ApplicationStateTest,
AddRegularState_RemoveRegularState_RegularStateNotDeleted) {
StateID reg_state = StateID::STATE_ID_REGULAR;
- HmiStatePtr state = utils::MakeShared<HmiState>(app_id, app_mngr_, reg_state);
+ HmiStatePtr state = utils::MakeShared<HmiState>(
+ static_cast<utils::SharedPtr<Application> >(mock_app_),
+ app_mngr_,
+ reg_state);
app_state.InitState(state);
// Try deleting regular state
diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc
new file mode 100644
index 0000000000..e10cd5d008
--- /dev/null
+++ b/src/components/application_manager/test/command_holder_test.cc
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gmock/gmock.h>
+
+#include "application_manager/command_holder_impl.h"
+#include "application_manager/commands/command.h"
+#include "smart_objects/smart_object.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using testing::_;
+using testing::Return;
+
+namespace am = application_manager;
+
+class CommandHolderImplTest : public testing::Test {
+ public:
+ CommandHolderImplTest()
+ : kPolicyAppId_("p_app_id")
+ , kHmiApplicationId_(123)
+ , kConnectionKey_(56789)
+ , cmd_ptr_(new smart_objects::SmartObject)
+ , mock_app_ptr_(new MockApplication) {}
+
+ void SetUp() OVERRIDE {
+ ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kConnectionKey_));
+ ON_CALL(*mock_app_ptr_, hmi_app_id())
+ .WillByDefault(Return(kHmiApplicationId_));
+ ON_CALL(*mock_app_ptr_, policy_app_id())
+ .WillByDefault(Return(kPolicyAppId_));
+ }
+
+ MockApplicationManager mock_app_manager_;
+ const std::string kPolicyAppId_;
+ const uint32_t kHmiApplicationId_;
+ const uint32_t kConnectionKey_;
+ utils::SharedPtr<smart_objects::SmartObject> cmd_ptr_;
+ utils::SharedPtr<MockApplication> mock_app_ptr_;
+};
+
+TEST_F(CommandHolderImplTest, HoldOne_ExpectReleaseOne) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ // Act
+ EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_));
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, HoldMany_ExpectReleaseSame) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+
+ int32_t iterations = 0;
+ do {
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ ++iterations;
+ } while (iterations < 5);
+
+ // Act
+ EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_)).Times(iterations);
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_Drop_ExpectNoReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ // Act
+ cmd_holder.Clear(mock_app_ptr_);
+ EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_)).Times(0);
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_ReleaseAnotherId_ExpectNoReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ // Act
+ utils::SharedPtr<MockApplication> another_app =
+ utils::MakeShared<MockApplication>();
+
+ EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_)).Times(0);
+ cmd_holder.Resume(another_app, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_DropAnotherId_ExpectReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+
+ int32_t iterations = 0;
+ do {
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+ ++iterations;
+ } while (iterations < 3);
+
+ // Act
+ utils::SharedPtr<MockApplication> another_app =
+ utils::MakeShared<MockApplication>();
+ cmd_holder.Clear(another_app);
+
+ EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_)).Times(iterations);
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+}
+
+TEST_F(CommandHolderImplTest, Hold_Mobile_and_HMI_commands_ExpectReleased) {
+ am::CommandHolderImpl cmd_holder(mock_app_manager_);
+
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_);
+
+ cmd_holder.Suspend(
+ mock_app_ptr_, am::CommandHolder::CommandType::kMobileCommand, cmd_ptr_);
+
+ // Act
+ EXPECT_CALL(mock_app_manager_, ManageHMICommand(cmd_ptr_));
+ cmd_holder.Resume(mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand);
+
+ EXPECT_CALL(
+ mock_app_manager_,
+ ManageMobileCommand(cmd_ptr_,
+ am::commands::Command::CommandOrigin::ORIGIN_MOBILE));
+ cmd_holder.Resume(mock_app_ptr_,
+ am::CommandHolder::CommandType::kMobileCommand);
+}
+
+} // application_manager_test
+} // components
+} // test
diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt
index ebcb1b5086..8dafc16471 100644
--- a/src/components/application_manager/test/commands/CMakeLists.txt
+++ b/src/components/application_manager/test/commands/CMakeLists.txt
@@ -28,36 +28,43 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/application_manager/include/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/hmi/
+ ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/mobile/
${COMPONENTS_DIR}/application_manager/test/include/
- ${COMPONENTS_DIR}/application_manager/test/include/commands/
+ ${COMPONENTS_DIR}/application_manager/test/include/application_manager/
)
-set(COMMANDS_TEST_SOURCE_DIR
- ${COMPONENTS_DIR}/application_manager/test/commands
-)
+set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands)
-set (SOURCES
+file(GLOB SOURCES
+ ${COMMANDS_TEST_DIR}/*
${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
- ${COMMANDS_TEST_SOURCE_DIR}/command_impl_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/command_response_impl_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/command_request_impl_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/mock_application_helper.cc
+ ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc
+ ${COMPONENTS_DIR}/application_manager/src/message.cc
+ ${COMMANDS_TEST_DIR}/hmi/*
+ ${COMMANDS_TEST_DIR}/hmi/hmi_notifications/*
+ ${COMMANDS_TEST_DIR}/mobile/*
)
set(LIBRARIES
gmock
Utils
- ApplicationManager
- connectionHandler
+ SmartObjects
HMI_API
MOBILE_API
- SmartObjects
+ ApplicationManager
+ AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+ connectionHandler
jsoncpp
)
-create_test("commands_test" "${SOURCES}" "${LIBRARIES}" )
-
-add_subdirectory(mobile)
-add_subdirectory(hmi)
+create_cotired_test("commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/test/commands/command_impl_test.cc b/src/components/application_manager/test/commands/command_impl_test.cc
index bb56e984e5..ff9634cbb1 100644
--- a/src/components/application_manager/test/commands/command_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_impl_test.cc
@@ -49,6 +49,7 @@
namespace test {
namespace components {
namespace commands_test {
+namespace command_impl {
using ::testing::Return;
using ::testing::AtLeast;
@@ -82,8 +83,8 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {
public:
class UnwrappedCommandImpl : CommandImpl {
public:
- using CommandImpl::ReplaceMobileByHMIAppId;
- using CommandImpl::ReplaceHMIByMobileAppId;
+ using CommandImpl::ReplaceMobileWithHMIAppId;
+ using CommandImpl::ReplaceHMIWithMobileAppId;
UnwrappedCommandImpl(const MessageSharedPtr& message,
ApplicationManager& application_manager)
@@ -150,16 +151,16 @@ TEST_F(CommandImplTest, GetMethods_SUCCESS) {
EXPECT_NO_THROW(command->onTimeOut());
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_NoAppIdInMessage_UNSUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_NoAppIdInMessage_UNSUCCESS) {
MessageSharedPtr msg;
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
EXPECT_CALL(app_mngr_, application(_)).Times(0);
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::app_id] = kAppId1;
@@ -170,12 +171,12 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kAppId1)).WillOnce(Return(app));
ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
EXPECT_EQ(kAppId2, (*msg)[strings::app_id].asUInt());
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Array_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_Array_SUCCESS) {
MessageSharedPtr msg = CreateArrayMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -186,14 +187,14 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Array_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
EXPECT_TRUE(msg->asArray());
std::for_each(
msg->asArray()->begin(), msg->asArray()->end(), ExpectEqualAppId);
}
-TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Map_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceMobileWithHMIAppId_Map_SUCCESS) {
MessageSharedPtr msg = CreateMapMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -204,7 +205,7 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Map_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceMobileByHMIAppId(*msg);
+ command->ReplaceMobileWithHMIAppId(*msg);
std::set<std::string> keys(msg->enumerate());
std::for_each(keys.begin(),
@@ -212,16 +213,17 @@ TEST_F(CommandImplTest, ReplaceMobileByHMIAppId_Map_SUCCESS) {
std::bind2nd(std::ptr_fun(&ExpectEqualKeyAppId), msg));
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_NoHMIAppIdInMessage_UNSUCCESS) {
+TEST_F(CommandImplTest,
+ ReplaceHMIWithMobileAppId_NoHMIAppIdInMessage_UNSUCCESS) {
MessageSharedPtr msg;
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).Times(0);
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceHMIWithMobileAppId_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[strings::app_id] = kAppId1;
@@ -232,12 +234,12 @@ TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_SUCCESS) {
EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppId1)).WillOnce(Return(app));
ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
EXPECT_EQ(kAppId2, (*msg)[strings::app_id].asUInt());
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Array_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceHMIWithMobileAppId_Array_SUCCESS) {
MessageSharedPtr msg = CreateArrayMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -248,14 +250,14 @@ TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Array_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
EXPECT_TRUE(msg->asArray());
std::for_each(
msg->asArray()->begin(), msg->asArray()->end(), ExpectEqualAppId);
}
-TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Map_SUCCESS) {
+TEST_F(CommandImplTest, ReplaceHMIWithMobileAppId_Map_SUCCESS) {
MessageSharedPtr msg = CreateMapMessage(kDefaultMsgCount);
UCommandImplPtr command = CreateCommand<UCommandImpl>(msg);
@@ -266,7 +268,7 @@ TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Map_SUCCESS) {
.WillRepeatedly(Return(app));
ON_CALL(*app, app_id()).WillByDefault(Return(kAppId2));
- command->ReplaceHMIByMobileAppId(*msg);
+ command->ReplaceHMIWithMobileAppId(*msg);
std::set<std::string> keys = msg->enumerate();
std::for_each(keys.begin(),
@@ -274,6 +276,7 @@ TEST_F(CommandImplTest, ReplaceHMIByMobileAppId_Map_SUCCESS) {
std::bind2nd(std::ptr_fun(&ExpectEqualKeyAppId), msg));
}
+} // namespace command_impl
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc
index 973438cb55..4493c54d3c 100644
--- a/src/components/application_manager/test/commands/command_request_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_request_impl_test.cc
@@ -54,6 +54,7 @@
namespace test {
namespace components {
namespace commands_test {
+namespace command_request_impl {
namespace am = application_manager;
namespace strings = am::strings;
@@ -120,14 +121,11 @@ class CommandRequestImplTest
CommandParametersPermissions& removed_parameters_permissions() {
return removed_parameters_permissions_;
}
- };
- CommandRequestImplTest() {
- mock_message_helper_ = am::MockMessageHelper::message_helper_mock();
- }
- ~CommandRequestImplTest() {
- mock_message_helper_ = NULL;
- }
+ void SetHashUpdateMode(HashUpdateMode mode) {
+ hash_update_mode_ = mode;
+ }
+ };
MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
@@ -140,7 +138,6 @@ class CommandRequestImplTest
}
sync_primitives::Lock app_set_lock_;
- am::MockMessageHelper* mock_message_helper_;
};
typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl;
@@ -172,7 +169,7 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
MessageSharedPtr dummy_msg(CreateMessage());
- EXPECT_CALL(*mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
.WillOnce(Return(dummy_msg));
EXPECT_CALL(
app_mngr_,
@@ -268,12 +265,11 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) {
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId));
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
@@ -286,12 +282,11 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
.WillOnce(Return(kCorrelationId));
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
// Return `true` prevents call of `SendResponse` method;
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
@@ -303,10 +298,10 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) {
TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(
- am::VehicleData::value_type(kMissedParam, am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMissedParam, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
- EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
MessageSharedPtr msg = CreateMessage();
@@ -319,10 +314,10 @@ TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
CommandParametersPermissions& permission = command->parameters_permissions();
- permission.disallowed_params.push_back(kDisallowedParam1);
- permission.disallowed_params.push_back(kDisallowedParam2);
- permission.allowed_params.push_back(kAllowedParam);
- permission.undefined_params.push_back(kUndefinedParam);
+ permission.disallowed_params.insert(kDisallowedParam1);
+ permission.disallowed_params.insert(kDisallowedParam2);
+ permission.allowed_params.insert(kAllowedParam);
+ permission.undefined_params.insert(kUndefinedParam);
command->RemoveDisallowedParameters();
@@ -347,33 +342,24 @@ TEST_F(CommandRequestImplTest,
}
TEST_F(CommandRequestImplTest,
- CheckAllowedParameters_NoAppWithSameConnectionKey_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
-
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
-
- SharedPtr<ApplicationSet> app_set;
- MockAppPtr app(InitAppSetDataAccessor(app_set));
- EXPECT_CALL(*app, app_id()).WillOnce(Return(6u));
- EXPECT_TRUE(command->CheckPermissions());
+ CheckAllowedParameters_NoAppWithSameConnectionKey_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr()));
+ EXPECT_FALSE(command->CheckPermissions());
}
TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params] = 0u;
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ MessageSharedPtr message = CreateMessage();
+ (*message)[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
- SharedPtr<ApplicationSet> app_set;
- MockAppPtr app(InitAppSetDataAccessor(app_set));
- EXPECT_CALL(*app, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(*app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
.WillOnce(Return(kMobResultSuccess));
EXPECT_TRUE(command->CheckPermissions());
@@ -381,32 +367,31 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) {
TEST_F(CommandRequestImplTest,
CheckAllowedParameters_WrongPolicyPermissions_UNSUCCESS) {
- MessageSharedPtr msg = CreateMessage();
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- (*msg)[strings::msg_params] = 0u;
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ MessageSharedPtr message = CreateMessage();
+ (*message)[strings::msg_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(message);
- SharedPtr<ApplicationSet> app_set;
- MockAppPtr app(InitAppSetDataAccessor(app_set));
- EXPECT_CALL(*app, app_id()).Times(2).WillRepeatedly(Return(kConnectionKey));
- EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(*app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app, app_id())
+ .Times(1)
+ .WillRepeatedly(Return(kConnectionKey));
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
.WillOnce(Return(mobile_apis::Result::INVALID_ENUM));
- MessageSharedPtr dummy_msg;
- EXPECT_CALL(*mock_message_helper_,
- CreateBlockedByPoliciesResponse(_, _, _, _))
- .WillOnce(Return(dummy_msg));
+ EXPECT_CALL(mock_message_helper_, CreateBlockedByPoliciesResponse(_, _, _, _))
+ .WillOnce(Return(smart_objects::SmartObjectSPtr()));
+
EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _));
EXPECT_FALSE(command->CheckPermissions());
}
ACTION_P(GetArg3, output) {
- *output = arg3;
+ *output = arg2;
}
TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
@@ -416,15 +401,11 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
- SharedPtr<ApplicationSet> app_set;
- MockAppPtr app(InitAppSetDataAccessor(app_set));
- EXPECT_CALL(*app, app_id()).WillOnce(Return(kConnectionKey));
- EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId));
- EXPECT_CALL(*app, hmi_level())
- .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ MockAppPtr app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
RPCParams params;
- EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _))
+ EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _))
.WillOnce(DoAll(GetArg3(&params), Return(kMobResultSuccess)));
EXPECT_TRUE(command->CheckPermissions());
@@ -434,17 +415,17 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) {
TEST_F(CommandRequestImplTest, AddDisallowedParameters_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
- am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kDisallowedParam1, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
- EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
MessageSharedPtr msg;
CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
- command->removed_parameters_permissions().disallowed_params.push_back(
+ command->removed_parameters_permissions().disallowed_params.insert(
kDisallowedParam1);
command->AddDisallowedParameters(*msg);
@@ -486,10 +467,10 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) {
TEST_F(CommandRequestImplTest,
SendResponse_AddDisallowedParametersToInfo_SUCCESS) {
am::VehicleData vehicle_data;
- vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1,
- am::VehicleDataType::MYKEY));
+ vehicle_data.insert(am::VehicleData::value_type(
+ kDisallowedParam1, mobile_apis::VehicleDataType::VEHICLEDATA_MYKEY));
- EXPECT_CALL(*mock_message_helper_, vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
MessageSharedPtr msg = CreateMessage();
@@ -498,7 +479,7 @@ TEST_F(CommandRequestImplTest,
CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
- command->removed_parameters_permissions().disallowed_params.push_back(
+ command->removed_parameters_permissions().disallowed_params.insert(
kDisallowedParam1);
MessageSharedPtr result;
@@ -514,6 +495,82 @@ TEST_F(CommandRequestImplTest,
(*result)[strings::msg_params][strings::info].asString().empty());
}
+TEST_F(CommandRequestImplTest, HashUpdateAllowed_UpdateExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+
+ MessageSharedPtr result;
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = true;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, UpdateHash());
+
+ command.reset();
+}
+
+TEST_F(CommandRequestImplTest, HashUpdateDisallowed_HashUpdateNotExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(
+ CommandRequestImpl::HashUpdateMode::kSkipHashUpdate);
+
+ MessageSharedPtr result;
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = true;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(*mock_app, UpdateHash()).Times(0);
+
+ command.reset();
+}
+
+TEST_F(CommandRequestImplTest, RequestFailed_HashUpdateNotExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+
+ MessageSharedPtr result;
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = false;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(*mock_app, UpdateHash()).Times(0);
+
+ command.reset();
+}
+
+TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) {
+ MessageSharedPtr msg;
+ CommandPtr command = CreateCommand<UCommandRequestImpl>(msg);
+ command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate);
+
+ MessageSharedPtr result;
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const bool is_succedeed = true;
+ command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL);
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app, UpdateHash()).Times(0);
+
+ command.reset();
+}
+
+} // namespace command_request_impl
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/commands/command_response_impl_test.cc b/src/components/application_manager/test/commands/command_response_impl_test.cc
index c7a5edae63..f95b9a49b2 100644
--- a/src/components/application_manager/test/commands/command_response_impl_test.cc
+++ b/src/components/application_manager/test/commands/command_response_impl_test.cc
@@ -45,6 +45,7 @@
namespace test {
namespace components {
namespace commands_test {
+namespace command_response_impl {
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
@@ -179,6 +180,7 @@ TEST_F(CommandResponseImplTest,
(*msg)[strings::msg_params][strings::result_code].asInt());
}
+} // namespace command_response_impl
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/CMakeLists.txt b/src/components/application_manager/test/commands/hmi/CMakeLists.txt
deleted file mode 100644
index d99e211bdc..0000000000
--- a/src/components/application_manager/test/commands/hmi/CMakeLists.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 2016, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include_directories(
- ${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/application_manager/include/application_manager/
- ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/
- ${COMPONENTS_DIR}/application_manager/test/include/
- ${COMPONENTS_DIR}/application_manager/test/include/application_manager/commands/
-)
-
-file(GLOB SOURCES
- ${AM_SOURCE_DIR}/src/smart_object_keys.cc
- ${AM_SOURCE_DIR}/test/mock_message_helper.cc
- ${COMMANDS_TEST_SOURCE_DIR}/hmi/*
- ${COMMANDS_TEST_SOURCE_DIR}/hmi/vi_is_ready_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/hmi/vr_is_ready_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/hmi/ui_is_ready_request_test.cc
- )
-
-set(LIBRARIES
- gmock
- jsoncpp
- Utils
- ApplicationManager
- connectionHandler
- HMI_API
- MOBILE_API
- SmartObjects
-)
-
-create_test("hmi_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
new file mode 100644
index 0000000000..7f7911a01d
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/activate_app_request_test.cc
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/activate_app_request.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/commands/command_impl.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace activate_app_request {
+
+using ::testing::_;
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::MessageSharedPtr;
+using am::commands::ActivateAppRequest;
+using am::commands::CommandImpl;
+
+using ::test::components::application_manager_test::MockApplication;
+
+typedef SharedPtr<MockApplication> MockAppPtr;
+typedef ::utils::SharedPtr<ActivateAppRequest> ActivateAppRequestPtr;
+
+MATCHER_P(CheckMessage, level, "") {
+ return level ==
+ static_cast<mobile_apis::HMILevel::eType>(
+ (*arg)[strings::msg_params][strings::activate_app_hmi_level]
+ .asInt());
+}
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kCorrelationId = 2u;
+} // namespace
+
+class ActivateAppRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[strings::app_id] = kAppId;
+ msg_params[strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::msg_params] = msg_params;
+ (*msg)[strings::params][strings::app_id] = kAppId;
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*msg)[strings::app_id] = kAppId;
+ return msg;
+ }
+};
+
+TEST_F(ActivateAppRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ MockAppPtr app = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ ON_CALL(*app, hmi_app_id()).WillByDefault(Return(kAppId));
+
+// TODO(OKozlov) Investigate and fix issue with using log
+#ifdef ENABLE_LOG
+ (*msg)[strings::msg_params][strings::activate_app_hmi_level] =
+ mobile_apis::HMILevel::HMI_FULL;
+#endif
+ ActivateAppRequestPtr command(CreateCommand<ActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
+#ifdef ENABLE_LOG
+ EXPECT_CALL(app_mngr_,
+ SendMessageToHMI(CheckMessage(mobile_apis::HMILevel::HMI_FULL)));
+#else
+ EXPECT_CALL(app_mngr_,
+ SendMessageToHMI(msg)));
+#endif
+ command->Run();
+
+#ifndef ENABLE_LOG
+ EXPECT_EQ(CommandImpl::hmi_protocol_type_,
+ (*msg)[strings::params][strings::protocol_type].asInt());
+ EXPECT_EQ(CommandImpl::protocol_version_,
+ (*msg)[strings::params][strings::protocol_version].asInt());
+#endif
+}
+
+} // namespace activate_app_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc
new file mode 100644
index 0000000000..88efc61816
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/add_statistics_info_notification_test.cc
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/add_statistics_info_notification.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace add_statistics_info_notification {
+
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_notification = ::application_manager::hmi_notification;
+using am::commands::MessageSharedPtr;
+using am::commands::AddStatisticsInfoNotification;
+using am::commands::CommandImpl;
+using policy::PolicyHandler;
+using policy_test::MockPolicyHandlerInterface;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+typedef ::utils::SharedPtr<AddStatisticsInfoNotification> NotificationPtr;
+
+namespace {
+const uint32_t kStatisticType = 1u;
+} // namespace
+
+class AddStatisticsInfoNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ MockPolicyHandlerInterface policy_handler_;
+};
+
+TEST_F(AddStatisticsInfoNotificationTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::msg_params][am::hmi_notification::statistic_type] =
+ kStatisticType;
+ NotificationPtr command(CreateCommand<AddStatisticsInfoNotification>(msg));
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler_));
+ EXPECT_CALL(policy_handler_, AddStatisticsInfo(kStatisticType));
+
+ command->Run();
+}
+
+} // namespace add_statistics_info_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc
new file mode 100644
index 0000000000..60eced4830
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/allow_all_apps_response_test.cc
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/allow_all_apps_response.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/commands/command_impl.h"
+#include "commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace allow_all_apps_response {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::AllowAllAppsResponse;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef ::utils::SharedPtr<AllowAllAppsResponse> ResponsePtr;
+
+namespace {
+const bool kResponseIsAllowed = true;
+} //
+
+class AllowAllAppsResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AllowAllAppsResponseTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::allowed] = kResponseIsAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAllAppsResponse>(msg));
+
+ EXPECT_CALL(app_mngr_, SetAllAppsAllowed(kResponseIsAllowed));
+
+ command->Run();
+}
+
+} // namespace allow_all_apps_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc
new file mode 100644
index 0000000000..69b4abe39d
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/allow_app_response_test.cc
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/allow_app_response.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/mock_application.h"
+#include "commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace allow_app_response {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::AllowAppResponse;
+using ::testing::_;
+using ::testing::Return;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const bool kIsResponseAllowed = true;
+}
+
+typedef ::utils::SharedPtr<AllowAppResponse> ResponsePtr;
+
+class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(AllowAppResponseTest, Run_AppCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
+
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, set_app_allowed(kIsResponseAllowed));
+
+ command->Run();
+}
+
+TEST_F(AllowAppResponseTest, Run_AppNotCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*msg)[strings::msg_params][hmi_response::allowed] = kIsResponseAllowed;
+
+ ResponsePtr command(CreateCommand<AllowAppResponse>(msg));
+
+ MockAppPtr mock_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+
+ command->Run();
+}
+
+} // namespace allow_app_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..b2a8f0858a
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/button_get_capabilities_response_test.cc
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/button_get_capabilities_response.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace button_get_capabilities_response {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::ButtonGetCapabilitiesResponse;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef ::utils::SharedPtr<ButtonGetCapabilitiesResponse> ResponsePtr;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+class ButtonGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateMsgParams() {
+ capabilities_[strings::name] = hmi_apis::Common_ButtonName::OK;
+ preset_bank_capabilities_ = true;
+
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::capabilities] = (capabilities_);
+ (*msg)[strings::msg_params][hmi_response::preset_bank_capabilities] =
+ (preset_bank_capabilities_);
+
+ return msg;
+ }
+
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+ SmartObject preset_bank_capabilities_;
+};
+
+TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeSuccess_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_preset_bank_capabilities(preset_bank_capabilities_));
+
+ command->Run();
+}
+
+TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeAborted_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ResponsePtr command(CreateCommand<ButtonGetCapabilitiesResponse>(msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities()).Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_, set_button_capabilities(capabilities_))
+ .Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_preset_bank_capabilities(preset_bank_capabilities_)).Times(0);
+
+ command->Run();
+}
+
+} // namespace button_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc
new file mode 100644
index 0000000000..b4a6ea272a
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/close_popup_response_test.cc
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "commands/commands_test.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+#include "application_manager/commands/hmi/close_popup_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace close_popup_response {
+
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+using am::commands::ResponseFromHMI;
+using am::commands::ClosePopupResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(ClosePopupResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ ResponseFromHMIPtr command(CreateCommand<ClosePopupResponse>(command_msg));
+
+ command->Run();
+}
+
+} // namespace close_popup_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc
new file mode 100644
index 0000000000..7c95a4ca2f
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/dummy_hmi_commands_test.cc
@@ -0,0 +1,617 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/hmi/allow_all_apps_request.h"
+#include "application_manager/commands/hmi/allow_all_apps_response.h"
+#include "application_manager/commands/hmi/allow_app_request.h"
+#include "application_manager/commands/hmi/allow_app_response.h"
+#include "application_manager/commands/hmi/navi_audio_start_stream_request.h"
+#include "application_manager/commands/hmi/navi_audio_start_stream_response.h"
+#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_audio_stop_stream_response.h"
+#include "application_manager/commands/hmi/update_device_list_request.h"
+#include "application_manager/commands/hmi/update_device_list_response.h"
+#include "application_manager/commands/hmi/on_update_device_list.h"
+#include "application_manager/commands/hmi/on_start_device_discovery.h"
+#include "application_manager/commands/hmi/update_app_list_request.h"
+#include "application_manager/commands/hmi/update_app_list_response.h"
+#include "application_manager/commands/hmi/on_find_applications.h"
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
+#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
+#include "application_manager/commands/hmi/on_status_update_notification.h"
+#include "application_manager/commands/hmi/update_sdl_request.h"
+#include "application_manager/commands/hmi/update_sdl_response.h"
+#include "application_manager/commands/hmi/activate_app_request.h"
+#include "application_manager/commands/hmi/activate_app_response.h"
+#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
+#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
+#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
+#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
+#include "application_manager/commands/hmi/on_app_activated_notification.h"
+#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
+#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
+#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
+#include "application_manager/commands/hmi/on_exit_application_notification.h"
+#include "application_manager/commands/hmi/on_put_file_notification.h"
+#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
+#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
+#include "application_manager/commands/hmi/get_system_info_request.h"
+#include "application_manager/commands/hmi/get_system_info_response.h"
+#include "application_manager/commands/hmi/close_popup_request.h"
+#include "application_manager/commands/hmi/close_popup_response.h"
+#include "application_manager/commands/hmi/button_get_capabilities_request.h"
+#include "application_manager/commands/hmi/button_get_capabilities_response.h"
+#include "application_manager/commands/hmi/ui_add_command_request.h"
+#include "application_manager/commands/hmi/ui_add_command_response.h"
+#include "application_manager/commands/hmi/ui_delete_command_request.h"
+#include "application_manager/commands/hmi/ui_delete_command_response.h"
+#include "application_manager/commands/hmi/ui_add_submenu_request.h"
+#include "application_manager/commands/hmi/ui_add_submenu_response.h"
+#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
+#include "application_manager/commands/hmi/ui_delete_submenu_response.h"
+#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
+#include "application_manager/commands/hmi/ui_get_language_request.h"
+#include "application_manager/commands/hmi/ui_get_language_response.h"
+#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
+#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
+#include "application_manager/commands/hmi/ui_change_registration_request.h"
+#include "application_manager/commands/hmi/ui_change_registration_response.h"
+#include "application_manager/commands/hmi/ui_show_request.h"
+#include "application_manager/commands/hmi/ui_show_response.h"
+#include "application_manager/commands/hmi/ui_alert_request.h"
+#include "application_manager/commands/hmi/ui_alert_response.h"
+#include "application_manager/commands/hmi/ui_is_ready_request.h"
+#include "application_manager/commands/hmi/ui_is_ready_response.h"
+#include "application_manager/commands/hmi/ui_slider_request.h"
+#include "application_manager/commands/hmi/ui_slider_response.h"
+#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "application_manager/commands/hmi/ui_set_media_clock_timer_response.h"
+#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
+#include "application_manager/commands/hmi/ui_set_global_properties_response.h"
+#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
+#include "application_manager/commands/hmi/ui_scrollable_message_response.h"
+#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
+#include "application_manager/commands/hmi/ui_set_app_icon_response.h"
+#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h"
+#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "application_manager/commands/hmi/ui_end_audio_pass_thru_response.h"
+#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
+#include "application_manager/commands/hmi/ui_perform_interaction_response.h"
+#include "application_manager/commands/hmi/vr_is_ready_request.h"
+#include "application_manager/commands/hmi/vr_is_ready_response.h"
+#include "application_manager/commands/hmi/vr_add_command_request.h"
+#include "application_manager/commands/hmi/vr_add_command_response.h"
+#include "application_manager/commands/hmi/vr_delete_command_request.h"
+#include "application_manager/commands/hmi/vr_delete_command_response.h"
+#include "application_manager/commands/hmi/vr_change_registration_request.h"
+#include "application_manager/commands/hmi/vr_change_registration_response.h"
+#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
+#include "application_manager/commands/hmi/vr_get_language_request.h"
+#include "application_manager/commands/hmi/vr_get_language_response.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
+#include "application_manager/commands/hmi/tts_is_ready_request.h"
+#include "application_manager/commands/hmi/tts_is_ready_response.h"
+#include "application_manager/commands/hmi/tts_change_registration_request.h"
+#include "application_manager/commands/hmi/tts_change_registration_response.h"
+#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
+#include "application_manager/commands/hmi/tts_get_language_request.h"
+#include "application_manager/commands/hmi/tts_get_language_response.h"
+#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
+#include "application_manager/commands/hmi/tts_stop_speaking_response.h"
+#include "application_manager/commands/hmi/tts_speak_request.h"
+#include "application_manager/commands/hmi/tts_speak_response.h"
+#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
+#include "application_manager/commands/hmi/tts_set_global_properties_response.h"
+#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
+#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
+#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
+#include "application_manager/commands/hmi/vr_perform_interaction_response.h"
+#include "application_manager/commands/hmi/vi_is_ready_request.h"
+#include "application_manager/commands/hmi/vi_is_ready_response.h"
+#include "application_manager/commands/hmi/vi_read_did_request.h"
+#include "application_manager/commands/hmi/vi_read_did_response.h"
+#include "application_manager/commands/hmi/sdl_activate_app_request.h"
+#include "application_manager/commands/hmi/sdl_activate_app_response.h"
+#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
+#include "application_manager/commands/hmi/on_event_changed_notification.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_data_response.h"
+#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h"
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
+#include "application_manager/commands/hmi/vi_get_dtcs_response.h"
+#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
+#include "application_manager/commands/hmi/vi_diagnostic_message_response.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_type_response.h"
+#include "application_manager/commands/hmi/navi_is_ready_request.h"
+#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
+#include "application_manager/commands/hmi/navi_show_constant_tbt_response.h"
+#include "application_manager/commands/hmi/navi_is_ready_response.h"
+#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
+#include "application_manager/commands/hmi/navi_alert_maneuver_response.h"
+#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
+#include "application_manager/commands/hmi/navi_update_turn_list_response.h"
+#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
+#include "application_manager/commands/hmi/navi_subscribe_way_points_response.h"
+#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "application_manager/commands/hmi/navi_unsubscribe_way_points_response.h"
+#include "application_manager/commands/hmi/navi_get_way_points_request.h"
+#include "application_manager/commands/hmi/navi_get_way_points_response.h"
+#include "application_manager/commands/hmi/on_ready_notification.h"
+#include "application_manager/commands/hmi/on_device_chosen_notification.h"
+#include "application_manager/commands/hmi/on_file_removed_notification.h"
+#include "application_manager/commands/hmi/on_system_context_notification.h"
+#include "application_manager/commands/hmi/on_app_registered_notification.h"
+#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
+#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
+#include "application_manager/commands/hmi/on_tts_started_notification.h"
+#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
+#include "application_manager/commands/hmi/on_vr_started_notification.h"
+#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
+#include "application_manager/commands/hmi/on_vr_command_notification.h"
+#include "application_manager/commands/hmi/on_ui_command_notification.h"
+#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
+#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
+#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
+#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
+#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
+#include "application_manager/commands/hmi/on_button_event_notification.h"
+#include "application_manager/commands/hmi/on_button_press_notification.h"
+#include "application_manager/commands/hmi/on_button_subscription_notification.h"
+#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
+#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "application_manager/commands/hmi/navi_start_stream_request.h"
+#include "application_manager/commands/hmi/navi_start_stream_response.h"
+#include "application_manager/commands/hmi/navi_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_stop_stream_response.h"
+#include "application_manager/commands/hmi/on_system_request_notification.h"
+#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
+#include "application_manager/commands/hmi/ui_set_display_layout_response.h"
+#include "application_manager/commands/hmi/on_sdl_close_notification.h"
+#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "application_manager/commands/hmi/on_record_start_notification.h"
+#include "application_manager/commands/hmi/add_statistics_info_notification.h"
+#include "application_manager/commands/hmi/on_system_error_notification.h"
+#include "application_manager/commands/hmi/basic_communication_system_request.h"
+#include "application_manager/commands/hmi/basic_communication_system_response.h"
+#include "application_manager/commands/hmi/sdl_policy_update.h"
+#include "application_manager/commands/hmi/sdl_policy_update_response.h"
+#include "application_manager/commands/hmi/on_received_policy_update.h"
+#include "application_manager/commands/hmi/on_policy_update.h"
+#include "application_manager/commands/hmi/get_urls.h"
+#include "application_manager/commands/hmi/get_urls_response.h"
+#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
+#include "application_manager/commands/hmi/navi_send_location_request.h"
+#include "application_manager/commands/hmi/navi_send_location_response.h"
+#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "application_manager/commands/hmi/dial_number_request.h"
+#include "application_manager/commands/hmi/dial_number_response.h"
+#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
+#include "application_manager/commands/hmi/on_vi_speed_notification.h"
+#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
+#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
+#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
+#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
+#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
+#include "application_manager/commands/hmi/on_vi_vin_notification.h"
+#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
+#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
+#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
+#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
+#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
+#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
+#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
+#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
+#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
+#include "application_manager/commands/hmi/ui_set_icon_request.h"
+
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace dummy_hmi_commands_test {
+
+namespace commands = ::application_manager::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+template <class Command>
+class HMICommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ stream_retry_.first = 0;
+ stream_retry_.second = 0;
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, start_stream_retry_amount())
+ .WillByDefault(ReturnRef(stream_retry_));
+ }
+
+ protected:
+ std::pair<uint32_t, int32_t> stream_retry_;
+};
+
+template <class Command>
+class HMICommandsTestFirst : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestSecond : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestThird : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestFourth : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class HMICommandsTestFifth : public HMICommandsTest<Command> {
+ public:
+ using typename HMICommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::OnStartDeviceDiscovery,
+ commands::UpdateDeviceListResponse,
+ commands::UpdateDeviceListRequest,
+ commands::ActivateAppResponse,
+ commands::ActivateAppRequest,
+ commands::GetSystemInfoResponse,
+ commands::GetSystemInfoRequest,
+ commands::SDLActivateAppResponse,
+ commands::SDLActivateAppRequest,
+ commands::SDLPolicyUpdateResponse,
+ commands::SDLPolicyUpdate,
+ commands::GetUrlsResponse,
+ commands::GetUrls,
+ commands::OnAppPermissionChangedNotification,
+ commands::SDLGetListOfPermissionsResponse,
+ commands::SDLGetListOfPermissionsRequest,
+ commands::SDLGetUserFriendlyMessageResponse,
+ commands::SDLGetUserFriendlyMessageRequest,
+ commands::SDLGetStatusUpdateResponse,
+ commands::SDLGetStatusUpdateRequest,
+ commands::OnStatusUpdateNotification,
+ commands::OnAppPermissionConsentNotification,
+ commands::MixingAudioSupportedResponse,
+ commands::MixingAudioSupportedRequest,
+ commands::OnExitAllApplicationsNotification,
+ commands::UIAddCommandResponse,
+ commands::UIAddCommandRequest,
+ commands::UIDeleteCommandResponse,
+ commands::UIDeleteCommandRequest,
+ commands::UIAddSubmenuResponse,
+ commands::UIAddSubmenuRequest,
+ commands::UIDeleteSubmenuResponse,
+ commands::UIDeleteSubmenuRequest,
+ commands::UISetMediaClockTimerResponse,
+ commands::UISetMediaClockTimerRequest,
+ commands::UIPerformInteractionResponse,
+ commands::UIPerformInteractionRequest,
+ commands::UISetGlobalPropertiesResponse,
+ commands::UISetGlobalPropertiesRequest,
+ commands::UIScrollableMessageResponse,
+ commands::UIScrollableMessageRequest,
+ commands::UISetAppIconResponse,
+ commands::UISetAppIconRequest,
+ commands::UIGetSupportedLanguagesResponse,
+ commands::UIGetSupportedLanguagesRequest,
+ commands::UIGetLanguageResponse,
+ commands::UIGetLanguageRequest,
+ commands::UIGetCapabilitiesResponse,
+ commands::UIGetCapabilitiesRequest,
+ commands::UIChangeRegistratioResponse> HMICommandsListFirst;
+
+typedef Types<commands::UIChangeRegistrationRequest,
+ commands::UIPerformAudioPassThruResponse,
+ commands::UIPerformAudioPassThruRequest,
+ commands::UIEndAudioPassThruResponse,
+ commands::UIEndAudioPassThruRequest,
+ commands::UIAlertResponse,
+ commands::UIAlertRequest,
+ commands::VRIsReadyResponse,
+ commands::VRIsReadyRequest,
+ commands::VRAddCommandResponse,
+ commands::VRAddCommandRequest,
+ commands::VRDeleteCommandResponse,
+ commands::VRDeleteCommandRequest,
+ commands::VRChangeRegistrationResponse,
+ commands::VRChangeRegistrationRequest,
+ commands::VRGetSupportedLanguagesResponse,
+ commands::VRGetSupportedLanguagesRequest,
+ commands::VRGetLanguageResponse,
+ commands::VRGetLanguageRequest,
+ commands::VRGetCapabilitiesResponse,
+ commands::VRGetCapabilitiesRequest,
+ commands::TTSIsReadyResponse,
+ commands::TTSIsReadyRequest,
+ commands::TTSChangeRegistratioResponse,
+ commands::TTSChangeRegistrationRequest,
+ commands::TTSGetSupportedLanguagesResponse,
+ commands::TTSGetSupportedLanguagesRequest,
+ commands::TTSStopSpeakingResponse,
+ commands::TTSStopSpeakingRequest,
+ commands::TTSGetLanguageResponse,
+ commands::TTSGetLanguageRequest,
+ commands::TTSSpeakResponse,
+ commands::TTSSpeakRequest,
+ commands::TTSSetGlobalPropertiesResponse,
+ commands::TTSSetGlobalPropertiesRequest,
+ commands::TTSGetCapabilitiesResponse,
+ commands::TTSGetCapabilitiesRequest,
+ commands::OnTTSStartedNotification,
+ commands::OnTTSStoppedNotification,
+ commands::OnAppActivatedNotification,
+ commands::OnExitApplicationNotification,
+ commands::UIShowResponse,
+ commands::UIShowRequest,
+ commands::UISliderResponse,
+ commands::UISliderRequest,
+ commands::ClosePopupResponse,
+ commands::ClosePopupRequest,
+ commands::UIIsReadyResponse,
+ commands::UIIsReadyRequest,
+ commands::VIIsReadyResponse> HMICommandsListSecond;
+
+typedef Types<commands::VIIsReadyRequest,
+ commands::VIReadDIDResponse,
+ commands::VIReadDIDRequest,
+ commands::VIGetVehicleDataResponse,
+ commands::VIGetVehicleDataRequest,
+ commands::VIGetDTCsResponse,
+ commands::VIGetDTCsRequest,
+ commands::VIDiagnosticMessageResponse,
+ commands::VIDiagnosticMessageRequest,
+ commands::VIGetVehicleTypeResponse,
+ commands::VIGetVehicleTypeRequest,
+ commands::NaviIsReadyResponse,
+ commands::NaviIsReadyRequest,
+ commands::NaviAlertManeuverResponse,
+ commands::NaviAlertManeuverRequest,
+ commands::NaviGetWayPointsResponse,
+ commands::NaviGetWayPointsRequest,
+ commands::NaviUpdateTurnListResponse,
+ commands::NaviUpdateTurnListRequest,
+ commands::NaviShowConstantTBTResponse,
+ commands::NaviShowConstantTBTRequest,
+ commands::NaviSubscribeWayPointsResponse,
+ commands::NaviSubscribeWayPointsRequest,
+ commands::NaviUnsubscribeWayPointsResponse,
+ commands::NaviUnSubscribeWayPointsRequest,
+ commands::ButtonGetCapabilitiesResponse,
+ commands::ButtonGetCapabilitiesRequest,
+ commands::OnAllowSDLFunctionalityNotification,
+ commands::OnSDLConsentNeededNotification,
+ commands::UpdateSDLResponse,
+ commands::UpdateSDLRequest,
+ commands::OnIgnitionCycleOverNotification,
+ commands::OnSystemInfoChangedNotification,
+ commands::OnReadyNotification,
+ commands::OnDeviceChosenNotification,
+ commands::OnSystemContextNotification,
+ commands::hmi::OnDriverDistractionNotification,
+ commands::OnUpdateDeviceList,
+ commands::OnAppRegisteredNotification,
+ commands::OnAppUnregisteredNotification,
+ commands::OnFindApplications,
+ commands::UpdateAppListResponse,
+ commands::UpdateAppListRequest,
+ commands::OnVRStartedNotification,
+ commands::OnVRStoppedNotification,
+ commands::OnVRCommandNotification,
+ commands::OnUICommandNotification,
+ commands::OnAppDeactivatedNotification> HMICommandsListThird;
+
+typedef Types<commands::hmi::OnButtonEventNotification,
+ commands::hmi::OnButtonPressNotification,
+ commands::hmi::OnButtonSubscriptionNotification,
+ commands::VISubscribeVehicleDataResponse,
+ commands::VISubscribeVehicleDataRequest,
+ commands::VIUnsubscribeVehicleDataResponse,
+ commands::VIUnsubscribeVehicleDataRequest,
+ commands::OnVIVehicleDataNotification,
+ commands::OnNaviTBTClientStateNotification,
+ commands::hmi::OnUIKeyBoardInputNotification,
+ commands::hmi::OnUITouchEventNotification,
+ commands::hmi::OnUIResetTimeoutNotification,
+ commands::NaviStartStreamResponse,
+ commands::NaviStartStreamRequest,
+ commands::NaviStopStreamResponse,
+ commands::NaviStopStreamRequest,
+ commands::AudioStartStreamResponse,
+ commands::AudioStartStreamRequest,
+ commands::AudioStopStreamResponse,
+ commands::AudioStopStreamRequest,
+ commands::OnAudioDataStreamingNotification,
+ commands::OnVideoDataStreamingNotification,
+ commands::VRPerformInteractionResponse,
+ commands::VRPerformInteractionRequest,
+ commands::OnSystemRequestNotification,
+ commands::OnPutFileNotification,
+ commands::OnResumeAudioSourceNotification,
+ commands::UiSetDisplayLayoutResponse,
+ commands::UiSetDisplayLayoutRequest,
+ commands::OnSDLCloseNotification,
+ commands::OnSDLPersistenceCompleteNotification,
+ commands::OnFileRemovedNotification,
+ commands::OnRecordStartdNotification,
+ commands::BasicCommunicationSystemResponse,
+ commands::BasicCommunicationSystemRequest,
+ commands::NaviSendLocationResponse,
+ commands::NaviSendLocationRequest,
+ commands::AddStatisticsInfoNotification,
+ commands::OnSystemErrorNotification,
+ commands::OnReceivedPolicyUpdate,
+ commands::OnPolicyUpdate,
+ commands::OnDeviceStateChangedNotification,
+ commands::hmi::OnTTSResetTimeoutNotification,
+ commands::hmi::DialNumberResponse,
+ commands::hmi::DialNumberRequest,
+ commands::OnEventChangedNotification,
+ commands::OnNaviWayPointChangeNotification,
+ commands::OnUILanguageChangeNotification,
+ commands::OnVRLanguageChangeNotification,
+ commands::OnTTSLanguageChangeNotification> HMICommandsListFourth;
+
+typedef Types<commands::OnVIGpsDataNotification,
+ commands::OnVISpeedNotification,
+ commands::OnVIRpmNotification,
+ commands::OnVIFuelLevelNotification,
+ commands::OnVIFuelLevelStateNotification,
+ commands::OnVIInstantFuelConsumptionNotification,
+ commands::OnVIExternalTemperatureNotification,
+ commands::OnVIVinNotification,
+ commands::OnVIPrndlNotification,
+ commands::OnVITirePressureNotification,
+ commands::OnVIOdometerNotification,
+ commands::OnVIBeltStatusNotification,
+ commands::OnVIBodyInformationNotification,
+ commands::OnVIDeviceStatusNotification,
+ commands::OnVIDriverBrakingNotification,
+ commands::OnVIWiperStatusNotification,
+ commands::OnVIHeadLampStatusNotification,
+ commands::OnVIEngineTorqueNotification,
+ commands::OnVIAccPedalPositionNotification,
+ commands::OnVISteeringWheelAngleNotification,
+ commands::OnVIMyKeyNotification,
+ commands::AllowAllAppsRequest,
+ commands::AllowAllAppsResponse,
+ commands::AllowAppRequest,
+ commands::AllowAppResponse> HMICommandsListFifth;
+
+TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst);
+TYPED_TEST_CASE(HMICommandsTestSecond, HMICommandsListSecond);
+TYPED_TEST_CASE(HMICommandsTestThird, HMICommandsListThird);
+TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth);
+TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth);
+
+TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+} // namespace dummy_hmi_commands_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc
new file mode 100644
index 0000000000..e8c88256c3
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/get_system_info_request_test.cc
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/commands/hmi/get_system_info_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_system_info_request {
+
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestToHMI;
+using am::commands::GetSystemInfoRequest;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+} // namespace
+
+class GetSystemInfoRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetSystemInfoRequestTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+
+ RequestToHMIPtr command(CreateCommand<GetSystemInfoRequest>(command_msg));
+
+ const uint32_t kAppId = command->application_id();
+
+ EXPECT_CALL(app_mngr_, set_application_id(kCorrelationId, kAppId));
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::msg_params][strings::app_id].asUInt(),
+ kAppId);
+ EXPECT_EQ((*command_msg)[strings::params][strings::correlation_id].asUInt(),
+ kCorrelationId);
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace get_system_info_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc
new file mode 100644
index 0000000000..980b6e0e9d
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/get_system_info_response_test.cc
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+#include "application_manager/commands/hmi/get_system_info_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_system_info_response {
+
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::ResponseFromHMI;
+using am::commands::GetSystemInfoResponse;
+using am::commands::CommandImpl;
+using am::commands::SystemInfo;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string ccpu_version("4.1.3.B_EB355B");
+const std::string wers_country_code("WAEGB");
+const uint32_t lang_code = 0u;
+const std::string kLanguage = "";
+} // namespace
+
+class GetSystemInfoResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::msg_params]["ccpu_version"] = ccpu_version;
+ (*command_msg)[strings::msg_params]["wersCountryCode"] = wers_country_code;
+ (*command_msg)[strings::msg_params]["language"] = lang_code;
+
+ return command_msg;
+ }
+
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(GetSystemInfoResponseTest, GetSystemInfo_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
+ policy_test::MockPolicyHandlerInterface policy_handler;
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ std::string language;
+ EXPECT_CALL(mock_message_helper_,
+ CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code)))
+ .WillOnce(Return(language));
+ EXPECT_EQ(kLanguage, language);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler));
+ EXPECT_CALL(policy_handler,
+ OnGetSystemInfo(ccpu_version, wers_country_code, kLanguage));
+
+ command->Run();
+}
+
+TEST_F(GetSystemInfoResponseTest, GetSystemInfo_UNSUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(CreateCommand<GetSystemInfoResponse>(command_msg));
+ policy_test::MockPolicyHandlerInterface policy_handler;
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities()).Times(0);
+
+ EXPECT_CALL(mock_message_helper_,
+ CommonLanguageToString(
+ static_cast<hmi_apis::Common_Language::eType>(lang_code)))
+ .Times(0);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler));
+ EXPECT_CALL(policy_handler, OnGetSystemInfo("", "", ""));
+
+ command->Run();
+}
+
+} // namespace get_system_info_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/test/commands/hmi/get_urls_response_test.cc
new file mode 100644
index 0000000000..5a41cae7ce
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/get_urls_response_test.cc
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/hmi/response_to_hmi.h"
+#include "application_manager/commands/hmi/get_urls_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_urls_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::ResponseToHMI;
+using am::commands::GetUrlsResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<ResponseToHMI> ResponseToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class GetUrlResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(GetUrlResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ ResponseToHMIPtr command(CreateCommand<GetUrlsResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace get_urls_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/test/commands/hmi/get_urls_test.cc
new file mode 100644
index 0000000000..9430dc045c
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/get_urls_test.cc
@@ -0,0 +1,331 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/message.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/hmi/get_urls.h"
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "hmi/request_from_hmi.h"
+#include "policy/mock_policy_manager.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace get_urls {
+
+using namespace hmi_apis;
+using namespace policy;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+using ::testing::SetArgReferee;
+using ::test::components::application_manager_test::MockApplication;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestFromHMI;
+using am::commands::GetUrls;
+using am::commands::CommandImpl;
+using policy::PolicyHandler;
+using policy_test::MockPolicyHandlerInterface;
+
+typedef SharedPtr<RequestFromHMI> RequestFromHMIPtr;
+
+namespace {
+const uint32_t kInvalidAppId_ = 0u;
+const uint32_t kAppIdForSending = 1u;
+const uint32_t kConnectionKey = 2u;
+const uint32_t kServiceType = 0u;
+const std::string kInitialService = "0x0";
+const std::string kPolicyService = "7";
+const std::string kDefaultUrl = "URL is not found";
+const std::string kDefaultId = "default";
+const std::string kPolicyAppId = "policy_app_id";
+} // namespace
+
+class GetUrlsTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_;
+ MessageSharedPtr command_msg_;
+ RequestFromHMIPtr request_command_;
+
+ GetUrlsTest() {
+ command_msg_ =
+ CreateMessage(NsSmartDeviceLink::NsSmartObjects::SmartType_Map);
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kInitialService;
+
+ request_command_ = CreateCommand<GetUrls>(command_msg_);
+
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ }
+};
+
+TEST_F(GetUrlsTest, RUN_SUCCESS) {
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ request_command_->Run();
+}
+
+TEST_F(GetUrlsTest, RUN_PolicyNotEnabled_UNSUCCESS) {
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+TEST_F(GetUrlsTest, RUN_EmptyEndpoints_UNSUCCESS) {
+ EndpointUrls endpoints_;
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+#ifdef EXTENDED_POLICY
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppIdForSending));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::SUCCESS,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+
+ EXPECT_EQ(kAppIdForSending,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [strings::app_id].asInt());
+ EXPECT_EQ(kDefaultUrl,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [strings::url].asString());
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_IncorrectIdForSending_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kInvalidAppId_));
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, application(kInvalidAppId_)).Times(0);
+
+ request_command_->Run();
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_ApplicationIsNotValid_UNSUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr invalid_mock_app;
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(invalid_mock_app));
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::DATA_NOT_AVAILABLE,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+
+TEST_F(GetUrlsTest, ProcessPolicyServiceURLs_FoundURLForApplication_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_request::service] =
+ kPolicyService;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ data.app_id = kPolicyAppId;
+ endpoints_.push_back(data);
+
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kPolicyService, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ MockAppPtr mock_app = CreateMockApp();
+
+ EXPECT_CALL(mock_policy_handler_, GetAppIdForSending())
+ .WillOnce(Return(kAppIdForSending));
+
+ EXPECT_CALL(app_mngr_, application(kAppIdForSending))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, policy_app_id()).WillOnce(Return(kPolicyAppId));
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(command_msg_)).WillOnce(Return(true));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+
+ EXPECT_EQ(am::MessageType::kResponse,
+ (*command_msg_)[strings::params][strings::message_type].asInt());
+ EXPECT_EQ(Common_Result::SUCCESS,
+ (*command_msg_)[strings::params][am::hmi_response::code].asInt());
+}
+#endif
+
+TEST_F(GetUrlsTest, DISABLED_ProcessServiceURLs_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
+ kDefaultUrl;
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id] = "1";
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ data.app_id = "1";
+ endpoints_.push_back(data);
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+ EXPECT_EQ(kDefaultUrl,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::strings::url].asString());
+ EXPECT_EQ(endpoints_[0].app_id,
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id].asString());
+}
+
+TEST_F(GetUrlsTest, ProcessServiceURLs_PolicyDefaultId_SUCCESS) {
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0] =
+ kDefaultUrl;
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ [am::hmi_response::policy_app_id] = kDefaultId;
+
+ EXPECT_CALL(mock_policy_handler_, PolicyEnabled()).WillOnce(Return(true));
+ EndpointUrls endpoints_;
+ EndpointData data(kDefaultUrl);
+ endpoints_.push_back(data);
+ EXPECT_CALL(mock_policy_handler_, GetUpdateUrls(kServiceType, _))
+ .WillOnce(SetArgReferee<1>(endpoints_));
+ MockAppPtr mock_app = CreateMockApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(_))
+ .WillOnce(Return(mock_app));
+ request_command_->Run();
+
+ EXPECT_FALSE((*command_msg_)[am::strings::msg_params].keyExists(
+ am::hmi_request::service));
+ EXPECT_TRUE(
+ (*command_msg_)[am::strings::msg_params][am::hmi_response::urls][0]
+ .keyExists(am::hmi_response::policy_app_id));
+}
+
+} // namespace get_urls
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
new file mode 100644
index 0000000000..ffedf1b4f6
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
@@ -0,0 +1,1980 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+
+#include "application_manager/commands/hmi/on_button_event_notification.h"
+#include "application_manager/commands/hmi/on_navi_tbt_client_state_notification.h"
+#include "application_manager/commands/hmi/on_navi_way_point_change_notification.h"
+#include "application_manager/commands/hmi/on_ui_command_notification.h"
+#include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h"
+#include "application_manager/commands/hmi/on_ui_touch_event_notification.h"
+#include "application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h"
+#include "application_manager/commands/hmi/on_vi_belt_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_body_information_notification.h"
+#include "application_manager/commands/hmi/on_vi_device_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_driver_braking_notification.h"
+#include "application_manager/commands/hmi/on_vi_engine_torque_notification.h"
+#include "application_manager/commands/hmi/on_vi_external_temperature_notification.h"
+#include "application_manager/commands/hmi/on_vi_fuel_level_notification.h"
+#include "application_manager/commands/hmi/on_vi_fuel_level_state_notification.h"
+#include "application_manager/commands/hmi/on_vi_gps_data_notification.h"
+#include "application_manager/commands/hmi/on_vi_head_lamp_status_notification.h"
+#include "application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h"
+#include "application_manager/commands/hmi/on_vi_my_key_notification.h"
+#include "application_manager/commands/hmi/on_vi_odometer_notification.h"
+#include "application_manager/commands/hmi/on_vi_prndl_notification.h"
+#include "application_manager/commands/hmi/on_vi_rpm_notification.h"
+#include "application_manager/commands/hmi/on_vi_speed_notification.h"
+#include "application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h"
+#include "application_manager/commands/hmi/on_vi_tire_pressure_notification.h"
+#include "application_manager/commands/hmi/on_vi_vehicle_data_notification.h"
+#include "application_manager/commands/hmi/on_vi_vin_notification.h"
+#include "application_manager/commands/hmi/on_vi_wiper_status_notification.h"
+#include "application_manager/commands/hmi/on_app_permission_changed_notification.h"
+#include "application_manager/commands/hmi/on_app_registered_notification.h"
+#include "application_manager/commands/hmi/on_audio_data_streaming_notification.h"
+#include "application_manager/commands/hmi/on_button_subscription_notification.h"
+#include "application_manager/commands/hmi/on_file_removed_notification.h"
+#include "application_manager/commands/hmi/on_put_file_notification.h"
+#include "application_manager/commands/hmi/on_resume_audio_source_notification.h"
+#include "application_manager/commands/hmi/on_sdl_close_notification.h"
+#include "application_manager/commands/hmi/on_sdl_consent_needed_notification.h"
+#include "application_manager/commands/hmi/on_sdl_persistence_complete_notification.h"
+#include "application_manager/commands/hmi/on_status_update_notification.h"
+#include "application_manager/commands/hmi/on_video_data_streaming_notification.h"
+#include "application_manager/commands/hmi/on_record_start_notification.h"
+#include "application_manager/commands/hmi/on_app_activated_notification.h"
+#include "application_manager/commands/hmi/on_app_deactivated_notification.h"
+#include "application_manager/commands/hmi/on_app_unregistered_notification.h"
+#include "application_manager/commands/hmi/on_button_press_notification.h"
+#include "application_manager/commands/hmi/on_event_changed_notification.h"
+#include "application_manager/commands/hmi/on_ready_notification.h"
+#include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h"
+#include "application_manager/commands/hmi/on_tts_started_notification.h"
+#include "application_manager/commands/hmi/on_tts_stopped_notification.h"
+#include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h"
+#include "application_manager/commands/hmi/on_vr_started_notification.h"
+#include "application_manager/commands/hmi/on_vr_stopped_notification.h"
+#include "application_manager/commands/hmi/on_app_permission_consent_notification.h"
+#include "application_manager/commands/hmi/on_ignition_cycle_over_notification.h"
+#include "application_manager/commands/hmi/on_policy_update.h"
+#include "application_manager/commands/hmi/on_received_policy_update.h"
+#include "application_manager/commands/hmi/on_system_error_notification.h"
+#include "application_manager/commands/hmi/on_system_info_changed_notification.h"
+#include "application_manager/commands/hmi/on_allow_sdl_functionality_notification.h"
+#include "application_manager/commands/hmi/on_device_state_changed_notification.h"
+#include "application_manager/commands/hmi/on_exit_all_applications_notification.h"
+#include "application_manager/commands/hmi/on_exit_application_notification.h"
+#include "application_manager/commands/hmi/on_vr_command_notification.h"
+#include "application_manager/commands/hmi/on_vr_language_change_notification.h"
+#include "application_manager/commands/hmi/on_start_device_discovery.h"
+#include "application_manager/commands/hmi/on_device_chosen_notification.h"
+#include "application_manager/commands/hmi/on_system_context_notification.h"
+#include "application_manager/commands/hmi/on_system_request_notification.h"
+#include "application_manager/commands/hmi/on_tts_language_change_notification.h"
+#include "application_manager/commands/hmi/on_ui_language_change_notification.h"
+#include "application_manager/commands/hmi/on_driver_distraction_notification.h"
+
+#include "utils/lock.h"
+#include "utils/data_accessor.h"
+#include "utils/signals.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/hmi_capabilities_impl.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "transport_manager/mock_transport_manager.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "application_manager/mock_resume_ctrl.h"
+
+#ifdef SDL_REMOTE_CONTROL
+#include "functional_module/plugin_manager.h"
+#endif // SDL_REMOTE_CONTROL
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace hmi_notifications_test {
+
+using ::testing::_;
+using ::testing::Test;
+using ::testing::Types;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::InSequence;
+using ::utils::SharedPtr;
+using ::smart_objects::SmartObject;
+using ::application_manager::commands::MessageSharedPtr;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::application_manager::MockMessageHelper;
+
+using namespace am::commands;
+
+typedef SharedPtr<MockApplication> MockAppPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+#define MEDIA true
+#define NOT_MEDIA false
+#define VC true
+#define NOT_VC false
+#define NAVI true
+#define NOT_NAVI false
+
+ACTION_P(GetEventId, event_id) {
+ *event_id = arg0.id();
+}
+ACTION_P(GetArg, arg) {
+ *arg = arg0;
+}
+
+ACTION_P(GetArg3, result) {
+ arg3 = *result;
+}
+
+ACTION_P2(GetConnectIdPermissionConsent, connect_id, consent) {
+ *connect_id = arg0;
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ arg1.group_permissions.begin();
+ for (; it != arg1.group_permissions.end(); ++it) {
+ consent->group_permissions.push_back(*it);
+ }
+ consent->consent_source = arg1.consent_source;
+}
+ACTION_P2(GetBoolValueAndString, value, str) {
+ *value = arg0;
+ *str = arg1;
+}
+ACTION_P(GetMessage, message) {
+ (*message)[am::strings::params][am::strings::function_id] =
+ (*arg0)[am::strings::params][am::strings::function_id].asInt();
+ (*message)[am::strings::params][am::strings::message_type] =
+ (*arg0)[am::strings::params][am::strings::message_type].asInt();
+ (*message)[am::strings::params][am::strings::correlation_id] =
+ (*arg0)[am::strings::params][am::strings::correlation_id].asInt();
+ (*message)[am::strings::params][am::strings::connection_key] =
+ (*arg0)[am::strings::params][am::strings::connection_key].asInt();
+ return (*message)[am::strings::params][am::strings::correlation_id].asInt();
+}
+
+namespace {
+const uint32_t kCountCommandsManageMobile_ = 22u;
+const uint32_t kCountCommandsToHmi_ = 12u;
+const int32_t kHmiProtocolType_ = 1;
+const int32_t kMobileProtocolType_ = 0;
+const int32_t kProtocolVersion_ = 3;
+const uint32_t kCorrelationId_ = 1939u;
+const uint32_t kAppId_ = 2014u;
+} // namespace
+
+class HMICommandsNotificationsTest
+ : public components::commands_test::CommandsTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ HMICommandsNotificationsTest()
+ : applications_(application_set_, applications_lock_), app_ptr_(NULL) {}
+
+ ~HMICommandsNotificationsTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+ typedef Command CommandType;
+
+ protected:
+ am::ApplicationSet application_set_;
+ sync_primitives::Lock applications_lock_;
+ DataAccessor<am::ApplicationSet> applications_;
+ MockHMICapabilities mock_hmi_capabilities_;
+
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+ NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
+
+ application_manager_test::MockStateController mock_state_controller_;
+
+ am::ApplicationSharedPtr app_;
+ NiceMock<MockApplication>* app_ptr_;
+
+ typedef IsNiceMock<connection_handler_test::MockConnectionHandler,
+ kMocksAreNice>::Result MockConnectionHandler;
+
+ typedef IsNiceMock<protocol_handler_test::MockSessionObserver,
+ kMocksAreNice>::Result MockSessionObserver;
+
+ MockConnectionHandler mock_connection_handler_;
+ MockSessionObserver mock_session_observer_;
+
+ void InitCommand(const uint32_t& default_timeout) OVERRIDE {
+ app_ = ConfigureApp(&app_ptr_, kAppId_, NOT_MEDIA, NOT_NAVI, NOT_VC);
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(default_timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(policy_interface_));
+ ON_CALL(app_mngr_, application_by_hmi_app(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_));
+ }
+
+ am::ApplicationSharedPtr ConfigureApp(NiceMock<MockApplication>** app_mock,
+ uint32_t app_id,
+ bool media,
+ bool navi,
+ bool vc) {
+ *app_mock = new NiceMock<MockApplication>;
+
+ Mock::AllowLeak(*app_mock); // WorkAround for gogletest bug
+ am::ApplicationSharedPtr app(*app_mock);
+
+ ON_CALL(**app_mock, app_id()).WillByDefault(Return(app_id));
+ ON_CALL(**app_mock, is_media_application()).WillByDefault(Return(media));
+ ON_CALL(**app_mock, is_navi()).WillByDefault(Return(navi));
+ ON_CALL(**app_mock, is_voice_communication_supported())
+ .WillByDefault(Return(vc));
+ ON_CALL(**app_mock, IsAudioApplication())
+ .WillByDefault(Return(media || navi || vc));
+ return app;
+ }
+#if defined(OS_POSIX)
+ void SubscribeForSignal() {
+ sigset_t signal_set;
+ sigemptyset(&signal_set);
+ sigaddset(&signal_set, SIGINT);
+ sigaddset(&signal_set, SIGTERM);
+ pthread_sigmask(SIG_BLOCK, &signal_set, NULL);
+ }
+#endif
+};
+
+namespace {
+void sig_handler(int sig) {
+ switch (sig) {
+ case SIGINT:
+ break;
+ case SIGTERM:
+ break;
+ case SIGSEGV:
+ abort();
+ default:
+ exit(EXIT_FAILURE);
+ }
+}
+} // namespace
+
+template <class Command>
+class HMIOnViNotifications : public commands_test::CommandsTest<kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <class Command>
+class HMIOnNotificationsListToHMI
+ : public commands_test::CommandsTest<kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <class CommandT, hmi_apis::FunctionID::eType kCommandId>
+struct CommandPair {
+ typedef CommandT CommandType;
+ enum { kHMICommandId = kCommandId };
+};
+
+template <class Command>
+class HMIOnNotificationsEventDispatcher
+ : public commands_test::CommandsTest<kIsNice> {
+ public:
+ typedef Command CommandType;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+typedef Types<OnVIAccPedalPositionNotification,
+ OnVIBeltStatusNotification,
+ OnVIBodyInformationNotification,
+ OnVIDeviceStatusNotification,
+ OnVIDriverBrakingNotification,
+ OnVIEngineTorqueNotification,
+ OnVIExternalTemperatureNotification,
+ OnVIFuelLevelNotification,
+ OnVIFuelLevelStateNotification,
+ OnVIGpsDataNotification,
+ OnVIHeadLampStatusNotification,
+ OnVIInstantFuelConsumptionNotification,
+ OnVIMyKeyNotification,
+ OnVIOdometerNotification,
+ OnVIPrndlNotification,
+ OnVIRpmNotification,
+ OnVISpeedNotification,
+ OnVISteeringWheelAngleNotification,
+ OnVITirePressureNotification,
+ OnVIVehicleDataNotification,
+ OnVIVinNotification,
+ OnVIWiperStatusNotification> HMIOnViNotificationsTypes;
+
+typedef Types<OnAppPermissionChangedNotification,
+ OnAudioDataStreamingNotification,
+ hmi::OnButtonSubscriptionNotification,
+ OnFileRemovedNotification,
+ OnPutFileNotification,
+ OnResumeAudioSourceNotification,
+ OnSDLCloseNotification,
+ OnSDLConsentNeededNotification,
+ OnSDLPersistenceCompleteNotification,
+ OnStatusUpdateNotification,
+ OnVideoDataStreamingNotification,
+ OnRecordStartdNotification> HMIOnNotificationsListToHMITypes;
+
+typedef Types<
+ CommandPair<OnAppActivatedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated>,
+ CommandPair<OnAppDeactivatedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated>,
+ CommandPair<OnEventChangedNotification,
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged>,
+ CommandPair<hmi::OnTTSResetTimeoutNotification,
+ hmi_apis::FunctionID::TTS_OnResetTimeout>,
+ CommandPair<OnTTSStartedNotification, hmi_apis::FunctionID::TTS_Started>,
+ CommandPair<OnTTSStoppedNotification, hmi_apis::FunctionID::TTS_Stopped>,
+ CommandPair<hmi::OnUIResetTimeoutNotification,
+ hmi_apis::FunctionID::UI_OnResetTimeout>,
+ CommandPair<OnVRStartedNotification, hmi_apis::FunctionID::VR_Started>,
+ CommandPair<OnVRStoppedNotification, hmi_apis::FunctionID::VR_Stopped> >
+ HMIOnNotificationsEventDispatcherTypes;
+
+TYPED_TEST_CASE(HMIOnViNotifications, HMIOnViNotificationsTypes);
+TYPED_TEST_CASE(HMIOnNotificationsListToHMI, HMIOnNotificationsListToHMITypes);
+TYPED_TEST_CASE(HMIOnNotificationsEventDispatcher,
+ HMIOnNotificationsEventDispatcherTypes);
+
+TYPED_TEST(HMIOnViNotifications, CommandsSendNotificationToMobile) {
+ MessageSharedPtr message =
+ commands_test::CommandsTest<kIsNice>::CreateMessage();
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>(message);
+ EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnVehicleDataID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TYPED_TEST(HMIOnNotificationsListToHMI, CommandsSendNotificationToHmi) {
+ MessageSharedPtr message =
+ commands_test::CommandsTest<kIsNice>::CreateMessage();
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>(message);
+ EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
+ SendMessageToHMI(_));
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(kHmiProtocolType_),
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kProtocolVersion_),
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TYPED_TEST(HMIOnNotificationsEventDispatcher,
+ CommandsNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message =
+ commands_test::CommandsTest<kIsNice>::CreateMessage();
+ utils::SharedPtr<typename TestFixture::CommandType::CommandType> command =
+ this->template CreateCommand<
+ typename TestFixture::CommandType::CommandType>(message);
+ EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_,
+ event_dispatcher())
+ .WillOnce(ReturnRef(this->mock_event_dispatcher_));
+ EXPECT_CALL(this->mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(TestFixture::CommandType::kHMICommandId, event_id);
+}
+
+// notifications(SendNotificationToMobile)
+TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<hmi::OnButtonEventNotification>(message);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnButtonEventID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnNaviTBTClientStateNotification>(message);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTBTClientStateID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnNaviWayPointChangeSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnNaviWayPointChangeNotification>(message);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnWayPointChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnUICommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_MENU),
+ (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUIKeyBoardInputSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<hmi::OnUIKeyBoardInputNotification>(message);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnKeyboardInputID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUITouchEventSendNotificationToMobile) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<hmi::OnUITouchEventNotification>(message);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnTouchEventID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppRegisteredNotificationSendNotificationToHmi) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAppRegisteredNotification>(message);
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(_));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered),
+ event_id);
+ EXPECT_EQ(
+ kHmiProtocolType_,
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ kProtocolVersion_,
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppUnregisteredNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAppUnregisteredNotification>(message);
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(_));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered),
+ event_id);
+ EXPECT_EQ(
+ kHmiProtocolType_,
+ (*message)[am::strings::params][am::strings::protocol_type].asInt());
+ EXPECT_EQ(
+ kProtocolVersion_,
+ (*message)[am::strings::params][am::strings::protocol_version].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<hmi::OnButtonPressNotification>(message);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(hmi_apis::FunctionID::Buttons_OnButtonPress),
+ event_id);
+ EXPECT_EQ(static_cast<int>(mobile_apis::FunctionID::eType::OnButtonPressID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) {
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnReadyNotification>(message);
+
+ EXPECT_CALL(app_mngr_, OnHMIStartedCooperation());
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ command->Run();
+ EXPECT_EQ(hmi_apis::FunctionID::BasicCommunication_OnReady, event_id);
+}
+
+// policy handler
+TEST_F(HMICommandsNotificationsTest,
+ OnIgnitionCycleOverNotificationPolicyHandler) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnIgnitionCycleOverNotification>(message);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, OnIgnitionCycleOver());
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnPolicyUpdateNotificationPolicyHandler) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command = CreateCommand<OnPolicyUpdate>(message);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, OnPTExchangeNeeded());
+ command->Run();
+}
+
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+TEST_F(HMICommandsNotificationsTest,
+ OnReceivePolicyUpdateNotification_SUCCESS) {
+ const std::string kFile = "./test_file.txt";
+ EXPECT_TRUE(file_system::CreateFile(kFile));
+ uint8_t tmp[] = {1u, 2u, 3u, 4u};
+ std::vector<uint8_t> data(tmp, tmp + 4);
+ EXPECT_TRUE(file_system::WriteBinaryFile(kFile, data));
+
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
+ (*message)[am::strings::msg_params][am::hmi_notification::policyfile] = kFile;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnReceivedPolicyUpdate>(message);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, ReceiveMessageFromSDK(kFile, data));
+ command->Run();
+ EXPECT_TRUE(file_system::DeleteFile(kFile));
+}
+#endif
+
+TEST_F(HMICommandsNotificationsTest,
+ OnReceivePolicyUpdateNotification_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String);
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnReceivedPolicyUpdate>(message);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
+ EXPECT_CALL(policy_interface_, ReceiveMessageFromSDK(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerNoAppId) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ SmartObject& applications =
+ (*message)[am::strings::msg_params]["consentedFunctions"];
+
+ smart_objects::SmartObject hmi_application_temp(smart_objects::SmartType_Map);
+ applications[0] = hmi_application_temp;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(GetArg(&connection_id));
+ command->Run();
+ EXPECT_EQ(0, connection_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerWithAppId) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ smart_objects::SmartObjectSPtr consented_function =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(policy::kGroupUndefined, (*it).state);
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowTrue) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["source"] = "test_content_source";
+
+ smart_objects::SmartObjectSPtr consented_function =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*consented_function)["allowed"] = true;
+ (*consented_function)[am::strings::id] = 999;
+ (*consented_function)[am::strings::name] = "test_group_alias";
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(999, (*it).group_id);
+ EXPECT_EQ("test_group_alias", (*it).group_alias);
+ EXPECT_EQ(policy::kGroupAllowed, (*it).state);
+ }
+ EXPECT_EQ("test_content_source", permission_consent.consent_source);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAppPermissionConsentNotificationPolicyHandlerAppIdAllowFalse) {
+ MessageSharedPtr message = CreateMessage(smart_objects::SmartType_Map);
+ (*message)[am::strings::msg_params]["consentedFunctions"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params]["source"] = "test_content_source";
+
+ smart_objects::SmartObjectSPtr consented_function =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*consented_function)["allowed"] = false;
+ (*consented_function)[am::strings::id] = 999;
+ (*consented_function)[am::strings::name] = "test_group_alias";
+ (*message)[am::strings::msg_params]["consentedFunctions"][0] =
+ *consented_function;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAppPermissionConsentNotification>(message);
+
+ int32_t connection_id = -1;
+ policy::PermissionConsent permission_consent;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _, _))
+#else
+ EXPECT_CALL(policy_interface_, OnAppPermissionConsent(_, _))
+#endif
+ .WillOnce(
+ GetConnectIdPermissionConsent(&connection_id, &permission_consent));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(kAppId_), connection_id);
+
+ std::vector<policy::FunctionalGroupPermission>::const_iterator it =
+ permission_consent.group_permissions.begin();
+ for (; it != permission_consent.group_permissions.end(); ++it) {
+ EXPECT_EQ(999, (*it).group_id);
+ EXPECT_EQ("test_group_alias", (*it).group_alias);
+ EXPECT_EQ(policy::kGroupDisallowed, (*it).state);
+ }
+ EXPECT_EQ("test_content_source", permission_consent.consent_source);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemErrorNotificationOnSystemErrorCode) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::error] =
+ hmi_apis::Common_SystemError::SYNC_REBOOTED;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemErrorNotification>(message);
+
+ int32_t code = hmi_apis::Common_SystemError::INVALID_ENUM;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, OnSystemError(_)).WillOnce(GetArg(&code));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(hmi_apis::Common_SystemError::SYNC_REBOOTED),
+ code);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemInfoChangedNotificationCheckLanguage) {
+ const uint32_t kLangCode = 5u;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLangCode;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemInfoChangedNotification>(message);
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, OnSystemInfoChanged(_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAllowSDLFunctionalityNotificationDeviceKeyNotExist) {
+ const std::string kDeviceId = "";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAllowSDLFunctionalityNotification>(message);
+
+ bool value = false;
+ std::string str;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, OnAllowSDLFunctionalityNotification(_, _))
+ .WillOnce(GetBoolValueAndString(&value, &str));
+ command->Run();
+ EXPECT_EQ(true, value);
+ EXPECT_EQ(kDeviceId, str);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnAllowSDLFunctionalityNotificationDeviceKeyExist) {
+ const std::string kDeviceId = "device_id";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_response::allowed] = true;
+ (*message)[am::strings::msg_params]["device"]["id"] = kDeviceId;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnAllowSDLFunctionalityNotification>(message);
+
+ bool value;
+ std::string str;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, OnAllowSDLFunctionalityNotification(_, _))
+ .WillOnce(GetBoolValueAndString(&value, &str));
+ command->Run();
+ EXPECT_EQ(true, value);
+ EXPECT_EQ(kDeviceId, str);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateNotUnpaired) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::INVALID_ENUM;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
+ EXPECT_CALL(policy_interface_, RemoveDevice(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateUnpaired) {
+ // Random MAC adress for test. It must contain 12 symbols.
+ const std::string device_id = "AA15F2204D6B";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = device_id;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, RemoveDevice(_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateEmptyDeviceId) {
+ const std::string empty_device_id = "";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ std::string device_id = "default_id";
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, RemoveDevice(_)).WillOnce(GetArg(&device_id));
+ command->Run();
+ EXPECT_EQ(empty_device_id, device_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceStateChangedNotificationDeviceStateDeviceIdFromId) {
+ const std::string empty_device_id = "";
+ const std::string id = "id_string";
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params]["deviceState"] =
+ hmi_apis::Common_DeviceState::UNPAIRED;
+ (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id;
+ (*message)[am::strings::msg_params]["deviceId"]["id"] = id;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnDeviceStateChangedNotification>(message);
+
+ std::string device_id = "default_id";
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, RemoveDevice(_)).WillOnce(GetArg(&device_id));
+ command->Run();
+ EXPECT_EQ(id, device_id);
+}
+
+//~policy_handler
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonIgnitionOff) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+#if defined(OS_POSIX)
+ am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason;
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_))
+ .WillOnce(GetArg(&mob_reason));
+ EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
+
+ SubscribeForSignal();
+ command->Run();
+ utils::WaitTerminationSignals(sig_handler);
+
+ EXPECT_EQ(am::mobile_api::AppInterfaceUnregisteredReason::IGNITION_OFF,
+ mob_reason);
+#endif
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonMasterResetAndFactoryDefaults) {
+ MessageSharedPtr message = CreateMessage();
+
+ std::vector<hmi_apis::Common_ApplicationsCloseReason::eType> reason_list;
+ reason_list.push_back(hmi_apis::Common_ApplicationsCloseReason::MASTER_RESET);
+ reason_list.push_back(
+ hmi_apis::Common_ApplicationsCloseReason::FACTORY_DEFAULTS);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
+ mob_reason_list;
+ mob_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::MASTER_RESET);
+ mob_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS);
+
+ std::vector<hmi_apis::Common_ApplicationsCloseReason::eType>::iterator
+ it_reason = reason_list.begin();
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
+ it_mob_reason = mob_reason_list.begin();
+
+ for (; it_reason != reason_list.end(); ++it_reason, ++it_mob_reason) {
+ (*message)[am::strings::msg_params][am::hmi_request::reason] = *it_reason;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+#if defined(OS_POSIX)
+ am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason =
+ *it_mob_reason;
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(mob_reason));
+ EXPECT_CALL(app_mngr_, HeadUnitReset(mob_reason));
+
+ SubscribeForSignal();
+ command->Run();
+ utils::WaitTerminationSignals(sig_handler);
+#endif
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonSuspend) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::SUSPEND;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+
+ MessageSharedPtr ethalon_message =
+ CreateMessage(smart_objects::SmartType_Map);
+ (*ethalon_message)[am::strings::params][am::strings::function_id] =
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete;
+ (*ethalon_message)[am::strings::params][am::strings::message_type] =
+ am::MessageType::kNotification;
+ (*ethalon_message)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId_;
+ MessageSharedPtr temp_message = CreateMessage();
+
+ resumprion_test::MockResumeCtrl mock_resume_ctrl;
+ EXPECT_CALL(app_mngr_, resume_controller())
+ .WillOnce(ReturnRef(mock_resume_ctrl));
+ EXPECT_CALL(mock_resume_ctrl, OnSuspend());
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId_));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(GetMessage(temp_message));
+
+ command->Run();
+ EXPECT_EQ(
+ static_cast<uint32_t>(
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete),
+ (*temp_message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<uint32_t>(am::MessageType::kNotification),
+ (*temp_message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(static_cast<uint32_t>(kCorrelationId_),
+ (*temp_message)[am::strings::params][am::strings::correlation_id]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitAllApplicationsNotificationReasonInvalidEnum) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_request::reason] =
+ hmi_apis::Common_ApplicationsCloseReason::INVALID_ENUM;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitAllApplicationsNotification>(message);
+
+ EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_)).Times(0);
+ EXPECT_CALL(app_mngr_, HeadUnitReset(_)).Times(0);
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationManageMobileCommand) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ smart_objects::SmartObjectSPtr notification =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(
+ mobile_apis::FunctionID::OnAppInterfaceUnregisteredID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+
+ std::vector<hmi_apis::Common_ApplicationExitReason::eType> reason_list;
+ reason_list.push_back(hmi_apis::Common_ApplicationExitReason::
+ UNAUTHORIZED_TRANSPORT_REGISTRATION);
+ reason_list.push_back(
+ hmi_apis::Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>
+ mobile_reason_list;
+ mobile_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED);
+ mobile_reason_list.push_back(
+ mobile_apis::AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE);
+
+ std::vector<mobile_apis::AppInterfaceUnregisteredReason::eType>::iterator
+ it_mobile_reason = mobile_reason_list.begin();
+ std::vector<hmi_apis::Common_ApplicationExitReason::eType>::iterator
+ it_reason = reason_list.begin();
+
+ for (; it_reason != reason_list.end(); ++it_reason, ++it_mobile_reason) {
+ (*message)[am::strings::msg_params][am::strings::reason] = *it_reason;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(*it_mobile_reason);
+
+#ifdef SDL_REMOTE_CONTROL
+ functional_modules::PluginManager plugin_mng;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(plugin_mng));
+#endif // SDL_REMOTE_CONTROL
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_, *it_mobile_reason)).WillOnce(Return(notification));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(notification, Command::ORIGIN_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationUnhandledReason) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::INVALID_ENUM;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+#ifdef SDL_REMOTE_CONTROL
+ functional_modules::PluginManager plugin_mng;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(plugin_mng));
+#endif // SDL_REMOTE_CONTROL
+
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnExitApplicationNotificationInvalidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ DISABLED_OnExitApplicationNotificationDriverDistractionValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ false));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnExitApplicationNotificationrUserExitValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ (*message)[am::strings::msg_params][am::strings::reason] =
+ hmi_apis::Common_ApplicationExitReason::USER_EXIT;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnExitApplicationNotification>(message);
+
+#ifdef SDL_REMOTE_CONTROL
+ functional_modules::PluginManager plugin_mng;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(plugin_mng));
+#endif // SDL_REMOTE_CONTROL
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_,
+ mobile_apis::HMILevel::HMI_NONE,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ false));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationSwitchedAndValidApp) {
+ const uint32_t cmd_id = 12u;
+ const uint32_t max_cmd_id = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = cmd_id;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(_, mobile_apis::HMILevel::HMI_FULL, true));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(max_cmd_id));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationSwitchedAndInvalidApp) {
+ const uint32_t kCmdId = 12u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationCmdIdEqualToMaxCmdId) {
+ const uint32_t kCmdId = 11u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationCmdIdLessMaxCmdIsInvalidApp) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ am::ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationActivePerformIteraction) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+ const uint32_t kIsPerformInteractionActive = 1u;
+ int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
+ .WillOnce(Return(kIsPerformInteractionActive));
+ EXPECT_CALL(app_mngr_, event_dispatcher());
+ EXPECT_CALL(mock_event_dispatcher_, raise_event(_))
+ .WillOnce(GetEventId(&event_id));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+ EXPECT_EQ(hmi_apis::FunctionID::VR_OnCommand, event_id);
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRCommandNotificationNotActivePerformIteraction) {
+ const uint32_t kCmdId = 8u;
+ const uint32_t kMaxCmdId = 10u;
+ const uint32_t kIsPerformInteractionActive = 0u;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ (*message)[am::strings::msg_params][am::strings::function_id] =
+ mobile_apis::FunctionID::eType::OnCommandID;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRCommandNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId));
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ EXPECT_CALL(*app_ptr_, is_perform_interaction_active())
+ .WillOnce(Return(kIsPerformInteractionActive));
+
+ EXPECT_CALL(app_mngr_, event_dispatcher()).Times(0);
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::eType::OnCommandID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::TriggerSource::TS_VR),
+ (*message)[am::strings::msg_params][am::strings::trigger_source].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnVRLanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRLanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnVRLanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnVRLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ SetRegularState(app_, mobile_apis::HMILevel::HMI_NONE, false));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(notification, Command::ORIGIN_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnStartDeviceDiscoveryRun) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnStartDeviceDiscovery>(message);
+ EXPECT_CALL(app_mngr_, StartDevicesDiscovery());
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceChosenNotificationDeviceInfoExists) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::device_info]
+ [am::strings::id] = "2014";
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnDeviceChosenNotification>(message);
+ EXPECT_CALL(app_mngr_,
+ ConnectToDevice(
+ (*message)[am::strings::msg_params][am::strings::device_info]
+ [am::strings::id].asString()));
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDeviceChosenNotificationDeviceInfoNotExists) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnDeviceChosenNotification>(message);
+ EXPECT_CALL(app_mngr_, ConnectToDevice(_)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationValidActiveApplication) {
+ MessageSharedPtr message = CreateMessage();
+ std::vector<am::mobile_api::SystemContext::eType> system_context_list;
+ system_context_list.push_back(
+ am::mobile_api::SystemContext::SYSCTXT_VRSESSION);
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MENU);
+ system_context_list.push_back(
+ am::mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED);
+
+ std::vector<am::mobile_api::SystemContext::eType>::iterator it =
+ system_context_list.begin();
+ for (; it != system_context_list.end(); ++it) {
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ *it;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationInvalidActiveApplication) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::SYSCTXT_VRSESSION;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationInvalidSystemContext) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::INVALID_ENUM;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, active_application()).Times(0);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationValidApplication) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ std::vector<am::mobile_api::SystemContext::eType> system_context_list;
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_ALERT);
+ system_context_list.push_back(am::mobile_api::SystemContext::SYSCTXT_MAIN);
+
+ std::vector<am::mobile_api::SystemContext::eType>::iterator it =
+ system_context_list.begin();
+ for (; it != system_context_list.end(); ++it) {
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ *it;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_, SetRegularState(app_, *it));
+ command->Run();
+ }
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemContextNotificationAppIdDoesntExists) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::system_context] =
+ am::mobile_api::SystemContext::SYSCTXT_ALERT;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemContextNotification>(message);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, state_controller()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdExistsAndValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ const int32_t device_id = 1;
+ ON_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
+ .WillByDefault(Return(device_id));
+
+ EXPECT_CALL(policy_interface_, GetUserConsentForDevice(_))
+ .WillOnce(Return(policy::kDeviceAllowed));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdExistsAndInvalidApp) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+ ApplicationSharedPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdDoesntExistsAndValidApp) {
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(policy_interface_));
+ EXPECT_CALL(policy_interface_, GetAppIdForSending())
+ .WillOnce(Return(kAppId_));
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_));
+ ON_CALL(app_mngr_, connection_handler())
+ .WillByDefault(ReturnRef(mock_connection_handler_));
+ ON_CALL(mock_connection_handler_, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer_));
+ const int32_t device_id = 1;
+ ON_CALL(
+ mock_session_observer_,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), NULL, NULL, _, NULL))
+ .WillByDefault(Return(device_id));
+
+ EXPECT_CALL(policy_interface_, GetUserConsentForDevice(_))
+ .WillOnce(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnSystemRequestNotificationAppIdDoesntExistsAndNullAppId) {
+ const uint32_t kNullApppId = 0u;
+ MessageSharedPtr message = CreateMessage();
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnSystemRequestNotification>(message);
+ EXPECT_CALL(app_mngr_, GetPolicyHandler());
+ EXPECT_CALL(policy_interface_, GetAppIdForSending())
+ .WillOnce(Return(kNullApppId));
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnTTSLanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnTTSLanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnTTSLanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnTTSLanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_ui_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(notification, Command::ORIGIN_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(hmi_apis::Common_Language::EN_AU),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnUILanguageChangeNotificationEmptyData) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ EXPECT_CALL(*app_ptr_, ui_language()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUILanguageChangeNotificationAppLangEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] = kLang;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
+
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kLang),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnUILanguageChangeNotificationAppLangNotEqualMessageLang) {
+ const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::language] =
+ mobile_apis::Language::EN_US;
+ utils::SharedPtr<Command> command =
+ CreateCommand<OnUILanguageChangeNotification>(message);
+
+ application_set_.insert(app_);
+ smart_objects::SmartObjectSPtr notification =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*notification)[am::strings::params][am::strings::function_id] =
+ static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID);
+ (*notification)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+ (*notification)[am::strings::params][am::strings::connection_key] = kAppId_;
+ (*notification)[am::strings::msg_params][am::strings::reason] =
+ static_cast<int32_t>(
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE);
+
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ EXPECT_CALL(mock_hmi_capabilities_, active_vr_language())
+ .WillOnce(Return(hmi_apis::Common_Language::EN_AU));
+ EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_));
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*app_ptr_, ui_language()).WillRepeatedly(ReturnRef(kLang));
+ EXPECT_CALL(mock_message_helper_,
+ GetOnAppInterfaceUnregisteredNotificationToMobile(
+ kAppId_,
+ mobile_apis::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE))
+ .WillOnce(Return(notification));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(notification, Command::ORIGIN_SDL));
+ EXPECT_CALL(app_mngr_,
+ UnregisterApplication(
+ kAppId_, mobile_apis::Result::SUCCESS, false, false));
+ command->Run();
+ EXPECT_EQ(static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(mobile_apis::Language::EN_US),
+ (*message)[am::strings::msg_params][am::strings::hmi_display_language]
+ .asInt());
+}
+
+TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ utils::SharedPtr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(state));
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest,
+ OnDriverDistractionNotificationInvalidApp) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::hmi_notification::state] = state;
+ utils::SharedPtr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ ApplicationSharedPtr invalid_app;
+ application_set_.insert(invalid_app);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(*app_ptr_, app_id()).Times(0);
+ command->Run();
+}
+
+TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::mobile_notification::state] = state;
+ utils::SharedPtr<Command> command =
+ CreateCommand<hmi::OnDriverDistractionNotification>(message);
+
+ application_set_.insert(app_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(applications_));
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_interface_));
+ EXPECT_CALL(policy_interface_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(GetMessage(message));
+ EXPECT_CALL(*app_ptr_, app_id()).WillRepeatedly(Return(kAppId_));
+
+ command->Run();
+ EXPECT_EQ(
+ static_cast<int32_t>(am::mobile_api::FunctionID::OnDriverDistractionID),
+ (*message)[am::strings::params][am::strings::function_id].asInt());
+ EXPECT_EQ(
+ static_cast<int32_t>(kAppId_),
+ (*message)[am::strings::params][am::strings::connection_key].asInt());
+ EXPECT_EQ(static_cast<int32_t>(am::MessageType::kNotification),
+ (*message)[am::strings::params][am::strings::message_type].asInt());
+}
+
+} // namespace hmi_notifications_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc
new file mode 100644
index 0000000000..322f7dd398
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/mixing_audio_supported_request_test.cc
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "hmi/request_to_hmi.h"
+#include "application_manager/commands/hmi/mixing_audio_supported_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace mixing_audio_supported_request {
+
+using ::testing::_;
+using ::testing::Return;
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::RequestToHMI;
+using am::commands::MixingAudioSupportedRequest;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<RequestToHMI> RequestToHMIPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class MixingAudioSupportedRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(MixingAudioSupportedRequestTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ RequestToHMIPtr command(
+ CreateCommand<MixingAudioSupportedRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace mixing_audio_supported_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc
new file mode 100644
index 0000000000..89ba6c8bdb
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/mixing_audio_supported_response_test.cc
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/hmi/mixing_audio_supported_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace mixing_audio_supported_response {
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::ResponseFromHMI;
+using am::commands::MixingAudioSupportedResponse;
+using am::commands::CommandImpl;
+using am::HMICapabilities;
+namespace hmi_response = ::application_manager::hmi_response;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class MixingAudioSupportedResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(MixingAudioSupportedResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::strings::number] = "123";
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<MixingAudioSupportedResponse>(command_msg));
+ MockHMICapabilities mock_hmi_capabilities;
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+
+ const bool hmiResponse =
+ (*command_msg)[strings::msg_params][hmi_response::attenuated_supported]
+ .asBool();
+
+ EXPECT_CALL(mock_hmi_capabilities, set_attenuated_supported(hmiResponse));
+
+ command->Run();
+}
+
+} // namespace mixing_audio_supported_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
index 1256914225..c187cc75d9 100644
--- a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
+++ b/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc
@@ -47,6 +47,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
+namespace navi_audio_start_stream_request {
using ::testing::_;
using ::testing::ReturnRef;
@@ -66,8 +67,6 @@ class AudioStartStreamRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
AudioStartStreamRequestTest() {
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(mock_hmi_interfaces_));
ON_CALL(app_mngr_settings_, start_stream_retry_amount())
.WillByDefault(ReturnRef(start_stream_retry_amount_));
msg_ = CreateMessage();
@@ -77,7 +76,6 @@ class AudioStartStreamRequestTest
std::pair<uint32_t, int32_t> start_stream_retry_amount_;
MessageSharedPtr msg_;
SharedPtr<AudioStartStreamRequest> command_;
- MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
};
TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
@@ -115,6 +113,7 @@ TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
command_->Run();
}
+} // namespace navi_audio_start_stream_request
} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc
index 4ebb04041e..825cca9185 100644
--- a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc
+++ b/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc
@@ -47,6 +47,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
+namespace navi_is_ready_request {
using ::testing::_;
using ::testing::ReturnRef;
@@ -68,12 +69,9 @@ class NaviIsReadyRequestTest
NaviIsReadyRequestTest() : command_(CreateCommand<NaviIsReadyRequest>()) {
ON_CALL(app_mngr_, hmi_capabilities())
.WillByDefault(ReturnRef(mock_hmi_capabilities_));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(mock_hmi_interfaces_));
}
NaviIsReadyRequestPtr command_;
- MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
MOCK(application_manager_test::MockHMICapabilities) mock_hmi_capabilities_;
};
@@ -133,6 +131,7 @@ TEST_F(NaviIsReadyRequestTest,
command_->on_event(event);
}
+} // namespace navi_is_ready_request
} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc
new file mode 100644
index 0000000000..7185a5f7ed
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/navi_is_ready_response_test.cc
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/commands/hmi/navi_is_ready_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_is_ready_responce {
+
+namespace am = ::application_manager;
+namespace commands = am::commands;
+
+using ::testing::ReturnRef;
+using ::utils::SharedPtr;
+using commands::ResponseFromHMI;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class NaviIsReadyResponseTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NaviIsReadyResponseTest, NaviIsReadyResponse_Run_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<commands::NaviIsReadyResponse>());
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+ command->Run();
+}
+
+} // namespace navi_is_ready_responce
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc
new file mode 100644
index 0000000000..7c04aa724c
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <algorithm>
+
+#include "application_manager/commands/hmi/navi_set_video_config_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_set_video_config_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::NaviSetVideoConfigRequest;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kAppId = 1u;
+const uint32_t kHmiAppId = 13u;
+const hmi_apis::FunctionID::eType kEventID =
+ hmi_apis::FunctionID::Navigation_SetVideoConfig;
+} // namespace
+
+typedef SharedPtr<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr;
+
+class NaviSetVideoConfigRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ NaviSetVideoConfigRequestTest() {
+ mock_app_ptr_ = CreateMockApp();
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_ptr_));
+ ON_CALL(app_mngr_, application_by_hmi_app(_))
+ .WillByDefault(Return(mock_app_ptr_));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(mock_event_dispatcher_));
+ ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_ptr_, hmi_app_id()).WillByDefault(Return(kHmiAppId));
+ }
+
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+ MockAppPtr mock_app_ptr_;
+ MockEventDispatcher mock_event_dispatcher_;
+};
+
+TEST_F(NaviSetVideoConfigRequestTest, OnEventWithSuccessResponse) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, true, empty))
+ .Times(1);
+
+ command->on_event(event);
+}
+
+static bool ValidateList(std::vector<std::string>& expected,
+ std::vector<std::string>& actual) {
+ std::sort(expected.begin(), expected.end());
+ std::sort(actual.begin(), actual.end());
+ return std::equal(expected.begin(), expected.end(), actual.begin());
+}
+
+TEST_F(NaviSetVideoConfigRequestTest, OnEventWithRejectedResponse) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ (*request_msg)[am::strings::msg_params][am::strings::config] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::codec] =
+ hmi_apis::Common_VideoStreamingCodec::H265;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::height] = 640;
+ (*request_msg)[am::strings::msg_params][am::strings::config]
+ [am::strings::width] = 480;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params][0] =
+ "codec";
+ (*event_msg)[am::strings::msg_params][am::strings::rejected_params][1] =
+ "protocol";
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> rejected_params;
+ EXPECT_CALL(app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, _))
+ .WillOnce(SaveArg<3>(&rejected_params));
+
+ command->on_event(event);
+
+ ASSERT_EQ(2u, rejected_params.size());
+ std::vector<std::string> expected_list;
+ expected_list.push_back(std::string("protocol"));
+ expected_list.push_back(std::string("codec"));
+ ASSERT_TRUE(ValidateList(expected_list, rejected_params));
+}
+
+TEST_F(NaviSetVideoConfigRequestTest,
+ OnEventWithRejectedResponseWithoutParams) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+
+ Event event(kEventID);
+ event.set_smart_object(*event_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
+ .WillOnce(Return());
+
+ command->on_event(event);
+}
+
+TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) {
+ MessageSharedPtr request_msg = CreateMessage();
+ (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+
+ NaviSetVideoConfigRequestPtr command =
+ CreateCommand<NaviSetVideoConfigRequest>(request_msg);
+
+ std::vector<std::string> empty;
+ EXPECT_CALL(
+ app_mngr_,
+ OnStreamingConfigured(
+ kAppId, protocol_handler::ServiceType::kMobileNav, false, empty))
+ .WillOnce(Return());
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1);
+
+ command->onTimeOut();
+}
+
+} // namespace navi_set_video_config_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc
new file mode 100644
index 0000000000..753c2a9179
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the names of the copyright holders nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/hmi/navi_set_video_config_response.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace navi_set_video_config_response {
+
+using utils::SharedPtr;
+using application_manager::commands::NaviSetVideoConfigResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+class NaviSetVideoConfigResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<NaviSetVideoConfigResponse> command(
+ CreateCommand<NaviSetVideoConfigResponse>(msg));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace navi_set_video_config_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
index e5fce1a099..1327ff6dd6 100644
--- a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
+++ b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc
@@ -47,6 +47,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
+namespace navi_start_stream_request {
using ::testing::_;
using ::testing::ReturnRef;
@@ -66,8 +67,6 @@ class NaviStartStreamRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
NaviStartStreamRequestTest() {
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(mock_hmi_interfaces_));
ON_CALL(app_mngr_settings_, start_stream_retry_amount())
.WillByDefault(ReturnRef(start_stream_retry_amount_));
msg_ = CreateMessage();
@@ -77,7 +76,6 @@ class NaviStartStreamRequestTest
std::pair<uint32_t, int32_t> start_stream_retry_amount_;
MessageSharedPtr msg_;
SharedPtr<NaviStartStreamRequest> command_;
- MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
};
TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) {
@@ -115,6 +113,7 @@ TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceAvailable_SentRequest) {
command_->Run();
}
+} // namespace navi_start_stream_request
} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
index f812ead115..18f82cd645 100644
--- a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
+++ b/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc
@@ -46,6 +46,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
+namespace navi_stop_stream_requests {
using ::testing::_;
using ::testing::ReturnRef;
@@ -72,7 +73,6 @@ class NaviStopStreamRequestsTest
MessageSharedPtr msg_;
SharedPtr<Command> command_;
- MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
};
typedef testing::Types<commands::AudioStopStreamRequest,
@@ -97,6 +97,7 @@ TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceAvailable_SentRequest) {
TestFixture::command_->Run();
}
+} // namespace navi_stop_stream_requests
} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc
new file mode 100644
index 0000000000..b8a8c68ece
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/on_driver_distraction_notification_test.cc
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "utils/shared_ptr.h"
+#include "utils/lock.h"
+#include "utils/make_shared.h"
+#include "utils/data_accessor.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/on_driver_distraction_notification.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace on_driver_distraction_notification {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::Eq;
+using ::utils::SharedPtr;
+
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::hmi::OnDriverDistractionNotification;
+using namespace am::commands;
+
+typedef ::utils::SharedPtr<OnDriverDistractionNotification> NotificationPtr;
+
+class HMIOnDriverDistractionNotificationTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ ::sync_primitives::Lock app_set_lock_;
+ policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
+};
+
+MATCHER_P2(CheckNotificationParams, function_id, state, "") {
+ bool is_function_id_matched =
+ function_id ==
+ static_cast<am::mobile_api::FunctionID::eType>(
+ (*arg)[am::strings::params][am::strings::function_id].asInt());
+ bool is_state_matched =
+ state ==
+ static_cast<hmi_apis::Common_DriverDistractionState::eType>(
+ (*arg)[am::strings::msg_params][am::mobile_notification::state]
+ .asInt());
+ return is_function_id_matched && is_state_matched;
+}
+
+ACTION_P(GetArg3, result) {
+ arg3 = *result;
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest, Run_PushMobileMessage_SUCCESS) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
+
+ MockAppPtr mock_app = CreateMockApp();
+ am::ApplicationSet app_set;
+ app_set.insert(mock_app);
+
+ DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcDisallowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_interface_));
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+
+ EXPECT_CALL(*mock_app,
+ PushMobileMessage(CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state)));
+
+ command->Run();
+}
+
+TEST_F(HMIOnDriverDistractionNotificationTest,
+ Run_SendNotificationToMobile_SUCCESS) {
+ const hmi_apis::Common_DriverDistractionState::eType state =
+ hmi_apis::Common_DriverDistractionState::DD_ON;
+ MessageSharedPtr commands_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*commands_msg)[am::strings::msg_params][am::hmi_notification::state] = state;
+
+ NotificationPtr command(
+ CreateCommand<OnDriverDistractionNotification>(commands_msg));
+
+ EXPECT_CALL(app_mngr_, set_driver_distraction_state(Eq(state)));
+
+ MockAppPtr mock_app = CreateMockApp();
+ am::ApplicationSet app_set;
+ app_set.insert(mock_app);
+
+ DataAccessor<am::ApplicationSet> accessor(app_set, app_set_lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+
+ policy::CheckPermissionResult result;
+ result.hmi_level_permitted = policy::kRpcAllowed;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_interface_));
+ EXPECT_CALL(mock_policy_handler_interface_, CheckPermissions(_, _, _, _))
+ .WillOnce(GetArg3(&result));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ CheckNotificationParams(
+ am::mobile_api::FunctionID::OnDriverDistractionID, state),
+ Command::CommandOrigin::ORIGIN_SDL));
+
+ command->Run();
+}
+
+} // on_driver_distraction_notification
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..90be018e74
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc
@@ -0,0 +1,181 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_get_capabilities_response {
+
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::RCGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class RCGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][strings::rc_capability] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::rc_capability] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& remote_control_capability =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::rc_capability];
+
+ remote_control_capability["climateControlCapabilities"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability["climateControlCapabilities"][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& climate_control_capability =
+ remote_control_capability["climateControlCapabilities"][0];
+
+ climate_control_capability["moduleName"] = "Climate";
+ climate_control_capability["fanSpeedAvailable"] = true;
+ climate_control_capability["desiredTemperatureAvailable"] = true;
+ climate_control_capability["acEnableAvailable"] = true;
+ climate_control_capability["acMaxEnableAvailable"] = true;
+ climate_control_capability["circulateAirEnableAvailable"] = true;
+ climate_control_capability["autoModeEnableAvailable"] = true;
+ climate_control_capability["dualModeEnableAvailable"] = true;
+
+ climate_control_capability["defrostZoneAvailable"] = true;
+ climate_control_capability["defrostZone"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ climate_control_capability["defrostZone"][0] = "ALL";
+
+ climate_control_capability["ventilationModeAvailable"] = true;
+ climate_control_capability["ventilationMode"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ climate_control_capability["ventilationMode"][0] = "BOTH";
+
+ remote_control_capability["radioControlCapabilities"] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability["radioControlCapabilities"][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& radio_control_capability =
+ remote_control_capability["radioControlCapabilities"][0];
+
+ radio_control_capability["moduleName"] = "Radio";
+ radio_control_capability["radioEnableAvailable"] = true;
+ radio_control_capability["radioBandAvailable"] = true;
+ radio_control_capability["radioFrequencyAvailable"] = true;
+ radio_control_capability["hdChannelAvailable"] = true;
+ radio_control_capability["rdsDataAvailable"] = true;
+ radio_control_capability["availableHDsAvailable"] = true;
+ radio_control_capability["stateAvailable"] = true;
+ radio_control_capability["signalStrengthAvailable"] = true;
+ radio_control_capability["signalChangeThresholdAvailable"] = true;
+
+ remote_control_capability[hmi_response::button_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ remote_control_capability[hmi_response::button_capabilities][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ smart_objects::SmartObject& button_capability =
+ remote_control_capability[hmi_response::button_capabilities][0];
+
+ button_capability[strings::button_name] = "OK";
+ button_capability["shortPressAvailable"] = true;
+ button_capability["longPressAvailable"] = true;
+ button_capability["upDownAvailable"] = true;
+
+ RCGetCapabilitiesResponsePtr command(
+ CreateCommand<RCGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject rc_capability_so =
+ (*command_msg)[strings::msg_params][strings::rc_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_capability(rc_capability_so));
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(true));
+
+ command->Run();
+}
+
+} // namespace rc_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc
new file mode 100644
index 0000000000..73a43342f1
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/commands/hmi/rc_is_ready_request.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/hmi_interfaces.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::RCIsReadyRequest;
+using am::event_engine::Event;
+
+typedef SharedPtr<RCIsReadyRequest> RCIsReadyRequestPtr;
+
+class RCIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCIsReadyRequestTest() : command_(CreateCommand<RCIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_rc_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ if (is_send_message_to_hmi) {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillRepeatedly(ReturnRef(mock_hmi_capabilities_));
+ ExpectSendMessagesToHMI();
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ }
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_rc_cooperating(is_rc_cooperating_available));
+ if (!is_rc_cooperating_available) {
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(false));
+ }
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillOnce(Return(state));
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr capabilities(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(mock_message_helper_,
+ CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_rc_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_rc_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ RCIsReadyRequestPtr command_;
+ am::MockHmiInterfaces mock_hmi_interfaces_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+};
+
+TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_rc_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_rc_cooperating_available);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace rc_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc
new file mode 100644
index 0000000000..157dff6216
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/hmi/rc_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_response {
+
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::RCIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef SharedPtr<RCIsReadyResponse> RCIsReadyResponsePtr;
+
+class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(RCIsReadyResponseTest, RUN_SUCCESS) {
+ RCIsReadyResponsePtr command(CreateCommand<RCIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace rc_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc
new file mode 100644
index 0000000000..8ee86f098d
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/response_from_hmi_test.cc
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "hmi/response_from_hmi.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace response_from_hmi {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::SaveArg;
+using ::testing::DoAll;
+
+using ::utils::SharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+namespace am = ::application_manager;
+
+using am::commands::ResponseFromHMI;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+
+class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResponseFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(ResponseFromHMITest, SendResponseToMobile_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(msg, _));
+
+ command->SendResponseToMobile(msg, app_mngr_);
+
+ const application_manager::MessageType received_message_tipe =
+ static_cast<application_manager::MessageType>(
+ (*msg)[am::strings::params][am::strings::message_type].asInt());
+
+ EXPECT_EQ(application_manager::MessageType::kResponse, received_message_tipe);
+}
+
+TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr result_msg;
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(true)));
+
+ const hmi_apis::FunctionID::eType posted_function_id =
+ hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr dummy_msg_params = CreateMessage();
+ command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
+
+ ASSERT_TRUE(result_msg);
+
+ const application_manager::MessageType received_message_tipe =
+ static_cast<application_manager::MessageType>(
+ (*result_msg)[am::strings::params][am::strings::message_type]
+ .asInt());
+
+ EXPECT_EQ(am::MessageType::kRequest, received_message_tipe);
+
+ const hmi_apis::FunctionID::eType received_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[am::strings::params][am::strings::function_id].asInt());
+
+ EXPECT_EQ(posted_function_id, received_function_id);
+}
+
+TEST_F(ResponseFromHMITest, CreateHMIRequest_CantManageCommand_Covering) {
+ ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>());
+
+ MessageSharedPtr result_msg;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID()).WillByDefault(Return(1u));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result_msg), Return(false)));
+
+ const hmi_apis::FunctionID::eType posted_function_id =
+ hmi_apis::FunctionID::INVALID_ENUM;
+ MessageSharedPtr dummy_msg_params = CreateMessage();
+ command->CreateHMIRequest(posted_function_id, *dummy_msg_params);
+}
+
+} // namespace response_from_hmi
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc
new file mode 100644
index 0000000000..d36b55ee25
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc
@@ -0,0 +1,503 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/lock.h"
+#include "utils/helpers.h"
+#include "application_manager/commands/hmi/sdl_activate_app_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "commands/command_request_test.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_state_controller.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_activate_app_request {
+
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::MessageSharedPtr;
+using am::commands::SDLActivateAppRequest;
+using am::ApplicationSet;
+using testing::Mock;
+using testing::Return;
+using testing::ReturnRef;
+using testing::Mock;
+using ::testing::NiceMock;
+using policy_test::MockPolicyHandlerInterface;
+using am::event_engine::Event;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const uint32_t kAppIDFirst = 1u;
+const connection_handler::DeviceHandle kHandle = 2u;
+} // namespace
+
+MATCHER_P2(CheckMsgParams, result, corr_id, "") {
+ const bool is_func_id_valid =
+ hmi_apis::FunctionID::SDL_ActivateApp ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::function_id].asInt());
+
+ const bool is_result_code_valid =
+ hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ const bool is_result_valid =
+ result == (*arg)[am::strings::msg_params][am::strings::success].asBool();
+
+ const bool is_corr_id_valid =
+ corr_id ==
+ ((*arg)[am::strings::params][am::strings::correlation_id].asUInt());
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(true,
+ is_func_id_valid,
+ is_result_code_valid,
+ is_result_valid,
+ is_corr_id_valid);
+}
+
+class SDLActivateAppRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ ~SDLActivateAppRequestTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ MockAppPtr mock_app = CreateMockApp();
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app), app_id()).WillByDefault(Return(kAppID));
+ ON_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillByDefault(Return(mock_app));
+ }
+ void SetCorrelationAndAppID(MessageSharedPtr msg) {
+ (*msg)[am::strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[am::strings::msg_params][strings::app_id] = kAppID;
+ }
+
+ ApplicationSet app_list_;
+ ::sync_primitives::Lock lock_;
+ policy_test::MockPolicyHandlerInterface policy_handler_;
+ application_manager_test::MockStateController mock_state_controller_;
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+
+TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler_));
+ EXPECT_CALL(policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+ (*msg)[am::strings::msg_params][strings::function_id] =
+ hmi_apis::FunctionID::SDL_ActivateApp;
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::SDL_ActivateApp)))
+ .WillOnce(Return(true));
+
+ command->Run();
+}
+#else
+
+TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kAppID)).WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ ON_CALL(*mock_app, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ const std::string url = "url";
+ ON_CALL(*mock_app_first, SchemaUrl()).WillByDefault(Return(url));
+ const std::string package = "package";
+ ON_CALL(*mock_app_first, PackageName()).WillByDefault(Return(package));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, AppIdNotFound_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(app_mngr_, WaitingApplicationByID(kAppID))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ ON_CALL(*mock_app, device()).WillByDefault(Return(kHandle));
+
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ app_list_ = accessor.GetData();
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ app_list_ = accessor.GetData();
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppIDFirst))
+ .WillByDefault(Return(mock_app_first));
+
+ app_list_.insert(mock_app_first);
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotActive_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler_));
+ EXPECT_CALL(policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+
+ const std::string schema("schema");
+ mock_app->SetShemaUrl(schema);
+ const std::string package_name("package_name");
+ mock_app->SetPackageName(package_name);
+
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(*mock_app, IsRegistered()).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, schema, package_name, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+
+TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MockAppPtr mock_app(CreateMockApp());
+ ON_CALL(app_mngr_, application(kAppID)).WillByDefault(Return(mock_app));
+ EXPECT_CALL(*mock_app, device()).WillOnce(Return(kHandle));
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(mock_state_controller_));
+ EXPECT_CALL(mock_state_controller_,
+ IsStateActive(am::HmiState::StateID::STATE_ID_DEACTIVATE_HMI))
+ .WillOnce(Return(false));
+ DataAccessor<ApplicationSet> accessor(app_list_, lock_);
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
+
+ app_list_ = accessor.GetData();
+
+ MockAppPtr mock_app_first(CreateMockApp());
+ ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle));
+ ON_CALL(*mock_app_first, is_foreground()).WillByDefault(Return(false));
+
+ app_list_.insert(mock_app_first);
+ ON_CALL(*mock_app_first, protocol_version())
+ .WillByDefault(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
+ EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(mock_message_helper_, SendLaunchApp(_, _, _, _));
+
+ command->Run();
+}
+#endif
+
+TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ SetCorrelationAndAppID(msg);
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+ ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->onTimeOut();
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[am::strings::params][strings::correlation_id] = kCorrelationID;
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>());
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*event_msg);
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) {
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
+ kAppID;
+
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>());
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr invalid_mock_app;
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_))
+ .WillOnce(Return(invalid_mock_app));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
+
+ command->on_event(event);
+}
+
+TEST_F(SDLActivateAppRequestTest, OnEvent_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ SharedPtr<SDLActivateAppRequest> command(
+ CreateCommand<SDLActivateAppRequest>(msg));
+
+ MessageSharedPtr event_msg = CreateMessage();
+ (*event_msg)[strings::msg_params][strings::application][strings::app_id] =
+ kAppID;
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(*event_msg);
+
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(_)).WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler_));
+ EXPECT_CALL(policy_handler_, OnActivateApp(kAppID, kCorrelationID));
+
+ command->on_event(event);
+}
+
+} // namespace sdl_activate_app_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc
new file mode 100644
index 0000000000..5dff55f7c3
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/sdl_activate_app_response_test.cc
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/commands/hmi/sdl_activate_app_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_activate_app_response {
+
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::SDLActivateAppResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<SDLActivateAppResponse> SDLActivateAppResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class SDLActivateAppResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SDLActivateAppResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ SDLActivateAppResponsePtr command(
+ CreateCommand<SDLActivateAppResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace sdl_activate_app_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
new file mode 100644
index 0000000000..1bcdaebb35
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_list_of_permissions_request {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::SDLGetListOfPermissionsRequest;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using smart_objects::SmartObject;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const uint32_t kConnectionKey = 0u;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+class SDLGetListOfPermissionsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
+ }
+ MockAppPtr mock_app_;
+};
+
+TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillOnce(Return(mock_app_));
+
+ SharedPtr<SDLGetListOfPermissionsRequest> command(
+ CreateCommand<SDLGetListOfPermissionsRequest>(msg));
+
+ MockPolicyHandlerInterface policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler));
+ EXPECT_CALL(policy_handler, OnGetListOfPermissions(kAppID, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetListOfPermissionsRequestTest, Run_KeyDoesntExist_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Binary);
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ SharedPtr<SDLGetListOfPermissionsRequest> command(
+ CreateCommand<SDLGetListOfPermissionsRequest>(msg));
+
+ MockPolicyHandlerInterface policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler));
+ EXPECT_CALL(policy_handler,
+ OnGetListOfPermissions(kConnectionKey, kCorrelationID));
+
+ command->Run();
+}
+
+} // namespace sdl_get_list_of_permissions_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc
new file mode 100644
index 0000000000..988cdd18c7
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/sdl_get_status_update_request_test.cc
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/sdl_get_status_update_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_status_update_request {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::SDLGetStatusUpdateRequest;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+class SDLGetStatusUpdateRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+
+ SharedPtr<SDLGetStatusUpdateRequest> command(
+ CreateCommand<SDLGetStatusUpdateRequest>(msg));
+
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler));
+ EXPECT_CALL(mock_policy_handler, OnGetStatusUpdate(kCorrelationID));
+
+ command->Run();
+}
+
+} // namespace sdl_get_status_update_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
new file mode 100644
index 0000000000..66fedda3ca
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_request.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_state_controller.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "smart_objects/smart_object.h"
+#include "commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace sdl_get_user_friendly_message_request {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::SDLGetUserFriendlyMessageRequest;
+using application_manager::MockMessageHelper;
+using test::components::policy_test::MockPolicyHandlerInterface;
+using test::components::application_manager_test::MockHMICapabilities;
+using testing::_;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace {
+const uint32_t kCorrelationID = 1u;
+const uint32_t kAppID = 2u;
+const std::string kLanguageDe = "de-de";
+const std::string kLanguageEn = "en-gb";
+const std::string kMessageCodes = "messageCodes";
+const hmi_apis::Common_Language::eType kLanguage =
+ hmi_apis::Common_Language::EN_GB;
+} // namespace
+
+namespace strings = ::application_manager::strings;
+
+class SDLGetUserFriendlyMessageRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ }
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout);
+ ON_CALL((*mock_app_), app_id()).WillByDefault(Return(kAppID));
+ EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID))
+ .WillOnce(Return(mock_app_));
+ }
+ MockAppPtr mock_app_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ (*msg)[strings::msg_params][kMessageCodes] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
+ (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
+
+ (*msg)[strings::msg_params][strings::language] = kLanguage;
+
+ SharedPtr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
+ .WillOnce(Return(kLanguageEn));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_));
+ std::vector<std::string> msg_codes;
+ msg_codes.push_back(kLanguageDe);
+ msg_codes.push_back(kLanguageEn);
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ (*msg)[strings::msg_params][kMessageCodes] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe);
+ (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn);
+
+ SharedPtr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_hmi_capabilities, active_ui_language())
+ .WillOnce(Return(kLanguage));
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage))
+ .WillOnce(Return(kLanguageEn));
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler_));
+ std::vector<std::string> msg_codes;
+ msg_codes.push_back(kLanguageDe);
+ msg_codes.push_back(kLanguageEn);
+ EXPECT_CALL(mock_policy_handler_,
+ OnGetUserFriendlyMessage(msg_codes, kLanguageEn, kCorrelationID));
+
+ command->Run();
+}
+
+TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_NoMsgCodes_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::params][strings::correlation_id] = kCorrelationID;
+ (*msg)[strings::msg_params][strings::app_id] = kAppID;
+
+ SharedPtr<SDLGetUserFriendlyMessageRequest> command(
+ CreateCommand<SDLGetUserFriendlyMessageRequest>(msg));
+
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_)).Times(0);
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
+ EXPECT_CALL(mock_policy_handler_, OnGetUserFriendlyMessage(_, _, _)).Times(0);
+
+ command->Run();
+}
+
+} // namespace sdl_get_user_friendly_message_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/test/commands/hmi/simple_notifications_test.cc
new file mode 100644
index 0000000000..9d7441fef7
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/simple_notifications_test.cc
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "commands/commands_test.h"
+
+#include "hmi/notification_to_hmi.h"
+#include "application_manager/commands/command_notification_impl.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_notifications_test {
+
+using namespace application_manager;
+
+using ::testing::Types;
+
+template <typename Command>
+class SimpleNotificationsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::CommandNotificationImpl, commands::NotificationToHMI>
+ CommandsList;
+
+TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList);
+
+TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+} // namespace simple_notifications_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc
new file mode 100644
index 0000000000..4f7a7a9f72
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/simple_request_from_hmi_test.cc
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "hmi/request_from_hmi.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_requests_from_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+using ::testing::NiceMock;
+
+using ::utils::SharedPtr;
+namespace commands = ::application_manager::commands;
+using commands::MessageSharedPtr;
+using ::application_manager::event_engine::EventObserver;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ }
+ NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
+};
+
+TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ SharedPtr<commands::RequestFromHMI> command(
+ CreateCommand<commands::RequestFromHMI>());
+ application_manager::event_engine::Event event(
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp);
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_NO_THROW(command->on_event(event));
+}
+
+TEST_F(RequestFromHMITest, SendResponse_SUCCESS) {
+ SharedPtr<commands::RequestFromHMI> command(
+ CreateCommand<commands::RequestFromHMI>());
+
+ const bool success = false;
+ const uint32_t correlation_id = 1u;
+ EXPECT_CALL(app_mngr_, ManageHMICommand(NotNull()));
+
+ command->SendResponse(success,
+ correlation_id,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ hmi_apis::Common_Result::SUCCESS);
+}
+
+} // namespace simple_requests_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc
new file mode 100644
index 0000000000..3fa3aaef3a
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the copyright holders nor the names of their contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/hmi/allow_app_request.h"
+#include "application_manager/commands/hmi/allow_all_apps_request.h"
+#include "application_manager/commands/hmi/basic_communication_system_request.h"
+#include "application_manager/commands/hmi/button_get_capabilities_request.h"
+#include "application_manager/commands/hmi/navi_alert_maneuver_request.h"
+#include "application_manager/commands/hmi/navi_audio_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_get_way_points_request.h"
+#include "application_manager/commands/hmi/navi_is_ready_request.h"
+#include "application_manager/commands/hmi/navi_send_location_request.h"
+#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
+#include "application_manager/commands/hmi/navi_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
+#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
+#include "application_manager/commands/hmi/sdl_activate_app_response.h"
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
+#include "application_manager/commands/hmi/ui_scrollable_message_request.h"
+#include "application_manager/commands/hmi/ui_set_app_icon_request.h"
+#include "application_manager/commands/hmi/ui_set_display_layout_request.h"
+#include "application_manager/commands/hmi/ui_set_global_properties_request.h"
+#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_type_request.h"
+#include "application_manager/commands/hmi/vi_is_ready_request.h"
+#include "application_manager/commands/hmi/vi_read_did_request.h"
+#include "application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h"
+#include "application_manager/commands/hmi/dial_number_request.h"
+#include "application_manager/commands/hmi/tts_is_ready_request.h"
+#include "application_manager/commands/hmi/tts_set_global_properties_request.h"
+#include "application_manager/commands/hmi/tts_speak_request.h"
+#include "application_manager/commands/hmi/tts_stop_speaking_request.h"
+#include "application_manager/commands/hmi/tts_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/tts_change_registration_request.h"
+#include "application_manager/commands/hmi/tts_get_capabilities_request.h"
+#include "application_manager/commands/hmi/tts_get_language_request.h"
+#include "application_manager/commands/hmi/close_popup_request.h"
+#include "application_manager/commands/hmi/ui_add_command_request.h"
+#include "application_manager/commands/hmi/ui_add_submenu_request.h"
+#include "application_manager/commands/hmi/ui_alert_request.h"
+#include "application_manager/commands/hmi/ui_change_registration_request.h"
+#include "application_manager/commands/hmi/ui_delete_command_request.h"
+#include "application_manager/commands/hmi/ui_delete_submenu_request.h"
+#include "application_manager/commands/hmi/ui_end_audio_pass_thru_request.h"
+#include "application_manager/commands/hmi/ui_get_capabilities_request.h"
+#include "application_manager/commands/hmi/ui_get_language_request.h"
+#include "application_manager/commands/hmi/ui_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/ui_is_ready_request.h"
+#include "application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h"
+#include "application_manager/commands/hmi/ui_perform_interaction_request.h"
+#include "application_manager/commands/hmi/vi_diagnostic_message_request.h"
+#include "application_manager/commands/hmi/vi_get_dtcs_request.h"
+#include "application_manager/commands/hmi/vi_get_vehicle_data_request.h"
+#include "application_manager/commands/hmi/ui_set_media_clock_timer_request.h"
+#include "application_manager/commands/hmi/ui_show_request.h"
+#include "application_manager/commands/hmi/ui_slider_request.h"
+#include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h"
+#include "application_manager/commands/hmi/vr_add_command_request.h"
+#include "application_manager/commands/hmi/vr_change_registration_request.h"
+#include "application_manager/commands/hmi/vr_delete_command_request.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_request.h"
+#include "application_manager/commands/hmi/vr_get_supported_languages_request.h"
+#include "application_manager/commands/hmi/vr_get_language_request.h"
+#include "application_manager/commands/hmi/vr_is_ready_request.h"
+#include "application_manager/commands/hmi/vr_perform_interaction_request.h"
+#include "application_manager/commands/hmi/allow_all_apps_request.h"
+#include "application_manager/commands/hmi/basic_communication_system_request.h"
+#include "application_manager/commands/hmi/button_get_capabilities_request.h"
+#include "application_manager/commands/hmi/allow_app_request.h"
+#include "application_manager/commands/hmi/navi_send_location_request.h"
+#include "application_manager/commands/hmi/navi_unsubscribe_way_points_request.h"
+#include "application_manager/commands/hmi/navi_update_turn_list_request.h"
+#include "application_manager/commands/hmi/navi_show_constant_tbt_request.h"
+#include "application_manager/commands/hmi/navi_stop_stream_request.h"
+#include "application_manager/commands/hmi/navi_subscribe_way_points_request.h"
+#include "application_manager/commands/hmi/sdl_policy_update.h"
+#include "application_manager/commands/hmi/ui_set_icon_request.h"
+#include "application_manager/commands/hmi/dial_number_request.h"
+#include "application_manager/commands/hmi/ui_send_haptic_data_request.h"
+
+#include "application_manager/test/include/application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_requests_to_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+
+using ::utils::SharedPtr;
+
+namespace am_commands = application_manager::commands;
+using am_commands::MessageSharedPtr;
+using event_engine_test::MockEventDispatcher;
+
+class RequestToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) {
+ SharedPtr<am_commands::RequestToHMI> command(
+ CreateCommand<am_commands::RequestToHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_NO_THROW(command->Run());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(RequestToHMITest, SendRequest_SUCCESS) {
+ SharedPtr<am_commands::RequestToHMI> command(
+ CreateCommand<am_commands::RequestToHMI>());
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(NotNull()));
+
+ command->SendRequest();
+}
+
+template <typename Command>
+class RequestToHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <typename Command>
+class RequestToHMICommandsTest2 : public RequestToHMICommandsTest<Command> {};
+
+template <typename Command>
+class RequestToHMICommandsTest3
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<am_commands::VIGetVehicleTypeRequest,
+ am_commands::VIReadDIDRequest,
+ am_commands::VISubscribeVehicleDataRequest,
+ am_commands::hmi::DialNumberRequest,
+ am_commands::ClosePopupRequest,
+ am_commands::TTSSetGlobalPropertiesRequest,
+ am_commands::TTSSpeakRequest,
+ am_commands::TTSStopSpeakingRequest,
+ am_commands::TTSGetSupportedLanguagesRequest,
+ am_commands::UIAddCommandRequest,
+ am_commands::UIAddSubmenuRequest,
+ am_commands::UIAlertRequest,
+ am_commands::UIChangeRegistrationRequest,
+ am_commands::UIDeleteCommandRequest,
+ am_commands::UIDeleteSubmenuRequest,
+ am_commands::UIEndAudioPassThruRequest,
+ am_commands::UIGetCapabilitiesRequest,
+ am_commands::UIGetLanguageRequest,
+ am_commands::UIGetSupportedLanguagesRequest,
+ am_commands::UIPerformAudioPassThruRequest,
+ am_commands::UIPerformInteractionRequest,
+ am_commands::VIDiagnosticMessageRequest,
+ am_commands::VIGetDTCsRequest,
+ am_commands::VIGetVehicleDataRequest,
+ am_commands::UISetMediaClockTimerRequest,
+ am_commands::UIShowRequest,
+ am_commands::VIUnsubscribeVehicleDataRequest,
+ am_commands::VRAddCommandRequest,
+ am_commands::VRChangeRegistrationRequest,
+ am_commands::VRDeleteCommandRequest,
+ am_commands::UISliderRequest,
+ am_commands::TTSChangeRegistrationRequest,
+ am_commands::TTSGetCapabilitiesRequest,
+ am_commands::TTSGetLanguageRequest,
+ am_commands::AllowAllAppsRequest,
+ am_commands::BasicCommunicationSystemRequest,
+ am_commands::ButtonGetCapabilitiesRequest,
+ am_commands::NaviSendLocationRequest,
+ am_commands::NaviUnSubscribeWayPointsRequest,
+ am_commands::NaviUpdateTurnListRequest,
+ am_commands::NaviShowConstantTBTRequest,
+ am_commands::NaviStopStreamRequest,
+ am_commands::NaviSubscribeWayPointsRequest,
+ am_commands::NaviAlertManeuverRequest,
+ am_commands::AudioStopStreamRequest,
+ am_commands::NaviGetWayPointsRequest,
+ am_commands::UISetGlobalPropertiesRequest,
+ am_commands::UISendHapticDataRequest> RequestCommandsList;
+
+typedef Types<am_commands::UIScrollableMessageRequest,
+ am_commands::VRGetCapabilitiesRequest,
+ am_commands::UISetAppIconRequest,
+ am_commands::UiSetDisplayLayoutRequest,
+ am_commands::VRGetSupportedLanguagesRequest,
+ am_commands::VRGetLanguageRequest,
+ am_commands::VRPerformInteractionRequest,
+ am_commands::AllowAppRequest,
+// TODO (OKozlov). Need to clarify why UT fails
+// for UISetIconRequest
+// am_commands::UISetIconRequest,
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
+ am_commands::SDLPolicyUpdate,
+#endif
+ am_commands::hmi::DialNumberRequest> RequestCommandsList2;
+
+typedef Types<am_commands::VIIsReadyRequest,
+ am_commands::TTSIsReadyRequest,
+ am_commands::UIIsReadyRequest,
+ am_commands::NaviIsReadyRequest,
+ am_commands::VRIsReadyRequest> RequestCommandsList3;
+
+TYPED_TEST_CASE(RequestToHMICommandsTest, RequestCommandsList);
+TYPED_TEST_CASE(RequestToHMICommandsTest2, RequestCommandsList2);
+TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3);
+
+TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+ EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+} // namespace simple_requests_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc
new file mode 100644
index 0000000000..f55b2e5835
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc
@@ -0,0 +1,373 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the copyright holders nor the names of their contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/navi_alert_maneuver_response.h"
+#include "hmi/navi_audio_start_stream_response.h"
+#include "hmi/navi_audio_stop_stream_response.h"
+#include "hmi/navi_get_way_points_response.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_stop_stream_response.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/ui_set_app_icon_response.h"
+#include "hmi/ui_set_display_layout_response.h"
+#include "hmi/ui_set_global_properties_response.h"
+#include "hmi/ui_scrollable_message_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/vi_read_did_response.h"
+#include "hmi/vi_subscribe_vehicle_data_response.h"
+#include "hmi/vi_get_vehicle_type_response.h"
+#include "hmi/vi_is_ready_response.h"
+#include "hmi/dial_number_response.h"
+#include "hmi/close_popup_response.h"
+#include "hmi/tts_set_global_properties_response.h"
+#include "hmi/tts_speak_response.h"
+#include "hmi/tts_stop_speaking_response.h"
+#include "hmi/tts_change_registration_response.h"
+#include "hmi/ui_add_command_response.h"
+#include "hmi/ui_add_submenu_response.h"
+#include "hmi/ui_alert_response.h"
+#include "hmi/ui_change_registration_response.h"
+#include "hmi/ui_delete_command_response.h"
+#include "hmi/ui_delete_submenu_response.h"
+#include "hmi/ui_end_audio_pass_thru_response.h"
+#include "hmi/ui_perform_audio_pass_thru_response.h"
+#include "hmi/ui_perform_interaction_response.h"
+#include "hmi/vi_diagnostic_message_response.h"
+#include "hmi/vi_get_dtcs_response.h"
+#include "hmi/ui_set_media_clock_timer_response.h"
+#include "hmi/ui_show_response.h"
+#include "hmi/ui_slider_response.h"
+#include "hmi/vi_unsubscribe_vehicle_data_response.h"
+#include "hmi/vr_add_command_response.h"
+#include "hmi/vr_change_registration_response.h"
+#include "hmi/vr_delete_command_response.h"
+#include "hmi/vr_perform_interaction_response.h"
+#include "hmi/activate_app_response.h"
+#include "hmi/basic_communication_system_response.h"
+#include "hmi/navi_unsubscribe_way_points_response.h"
+#include "hmi/navi_update_turn_list_response.h"
+#include "hmi/navi_send_location_response.h"
+#include "hmi/navi_show_constant_tbt_response.h"
+#include "hmi/navi_start_stream_response.h"
+#include "hmi/navi_subscribe_way_points_response.h"
+#include "hmi/on_find_applications.h"
+#include "hmi/on_update_device_list.h"
+#include "hmi/sdl_policy_update_response.h"
+#include "hmi/update_app_list_response.h"
+#include "hmi/update_device_list_response.h"
+#include "hmi/notification_from_hmi.h"
+#include "hmi/ui_send_haptic_data_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_response_from_hmi_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Types;
+using ::testing::Eq;
+
+using ::utils::SharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+
+namespace am = ::application_manager;
+namespace commands = am::commands;
+using commands::MessageSharedPtr;
+
+template <class CommandD>
+class ResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef CommandD CommandData;
+ MockEventDispatcher event_dispatcher_;
+
+ ResponseFromHMICommandsTest() {
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ }
+};
+
+template <class Command>
+class EmptyResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+template <class Command, hmi_apis::FunctionID::eType kExpectedEventId>
+struct CommandData {
+ typedef Command CommandType;
+ enum { kEventId = kExpectedEventId };
+};
+
+typedef Types<
+ CommandData<commands::VIReadDIDResponse,
+ hmi_apis::FunctionID::VehicleInfo_ReadDID>,
+ CommandData<commands::TTSSpeakResponse, hmi_apis::FunctionID::TTS_Speak>,
+ CommandData<commands::VISubscribeVehicleDataResponse,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData>,
+ CommandData<commands::hmi::DialNumberResponse,
+ hmi_apis::FunctionID::BasicCommunication_DialNumber>,
+ CommandData<commands::UIDeleteSubmenuResponse,
+ hmi_apis::FunctionID::UI_DeleteSubMenu>,
+ CommandData<commands::UIEndAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_EndAudioPassThru>,
+ CommandData<commands::TTSSetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::TTS_SetGlobalProperties>,
+ CommandData<commands::TTSStopSpeakingResponse,
+ hmi_apis::FunctionID::TTS_StopSpeaking>,
+ CommandData<commands::UIAddCommandResponse,
+ hmi_apis::FunctionID::UI_AddCommand>,
+ CommandData<commands::UIAddSubmenuResponse,
+ hmi_apis::FunctionID::UI_AddSubMenu>,
+ CommandData<commands::UIAlertResponse, hmi_apis::FunctionID::UI_Alert>,
+ CommandData<commands::UIChangeRegistratioResponse,
+ hmi_apis::FunctionID::UI_ChangeRegistration>,
+ CommandData<commands::UIDeleteCommandResponse,
+ hmi_apis::FunctionID::UI_DeleteCommand>,
+ CommandData<commands::UIPerformAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_PerformAudioPassThru>,
+ CommandData<commands::UIPerformInteractionResponse,
+ hmi_apis::FunctionID::UI_PerformInteraction>,
+ CommandData<commands::UIDeleteSubmenuResponse,
+ hmi_apis::FunctionID::UI_DeleteSubMenu>,
+ CommandData<commands::UIEndAudioPassThruResponse,
+ hmi_apis::FunctionID::UI_EndAudioPassThru>,
+ CommandData<commands::VIDiagnosticMessageResponse,
+ hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage>,
+ CommandData<commands::VIGetDTCsResponse,
+ hmi_apis::FunctionID::VehicleInfo_GetDTCs>,
+ CommandData<commands::UISetMediaClockTimerResponse,
+ hmi_apis::FunctionID::UI_SetMediaClockTimer>,
+ CommandData<commands::UIShowResponse, hmi_apis::FunctionID::UI_Show>,
+ CommandData<commands::VIUnsubscribeVehicleDataResponse,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData>,
+ CommandData<commands::VRAddCommandResponse,
+ hmi_apis::FunctionID::VR_AddCommand>,
+ CommandData<commands::VRChangeRegistrationResponse,
+ hmi_apis::FunctionID::VR_ChangeRegistration>,
+ CommandData<commands::VRDeleteCommandResponse,
+ hmi_apis::FunctionID::VR_DeleteCommand>,
+ CommandData<commands::UISliderResponse, hmi_apis::FunctionID::UI_Slider>,
+ CommandData<commands::TTSChangeRegistratioResponse,
+ hmi_apis::FunctionID::TTS_ChangeRegistration>,
+ CommandData<commands::ActivateAppResponse,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp>,
+ CommandData<commands::BasicCommunicationSystemResponse,
+ hmi_apis::FunctionID::BasicCommunication_SystemRequest>,
+ CommandData<commands::NaviAlertManeuverResponse,
+ hmi_apis::FunctionID::Navigation_AlertManeuver>,
+ CommandData<commands::AudioStartStreamResponse,
+ hmi_apis::FunctionID::Navigation_StartAudioStream>,
+ CommandData<commands::NaviGetWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_GetWayPoints>,
+ CommandData<commands::NaviSendLocationResponse,
+ hmi_apis::FunctionID::Navigation_SendLocation>,
+ CommandData<commands::NaviShowConstantTBTResponse,
+ hmi_apis::FunctionID::Navigation_ShowConstantTBT>,
+ CommandData<commands::NaviStartStreamResponse,
+ hmi_apis::FunctionID::Navigation_StartStream>,
+ CommandData<commands::NaviSubscribeWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints>,
+ CommandData<commands::NaviUnsubscribeWayPointsResponse,
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints>,
+ CommandData<commands::NaviUpdateTurnListResponse,
+ hmi_apis::FunctionID::Navigation_UpdateTurnList>,
+ CommandData<commands::UISetAppIconResponse,
+ hmi_apis::FunctionID::UI_SetAppIcon>,
+ CommandData<commands::UiSetDisplayLayoutResponse,
+ hmi_apis::FunctionID::UI_SetDisplayLayout>,
+ CommandData<commands::UISetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::UI_SetGlobalProperties>,
+ CommandData<commands::UISetGlobalPropertiesResponse,
+ hmi_apis::FunctionID::UI_SetGlobalProperties>,
+ CommandData<commands::VRPerformInteractionResponse,
+ hmi_apis::FunctionID::VR_PerformInteraction>,
+ CommandData<commands::UIScrollableMessageResponse,
+ hmi_apis::FunctionID::UI_ScrollableMessage>,
+ CommandData<commands::UISendHapticDataResponse,
+ hmi_apis::FunctionID::UI_SendHapticData> > ResponseCommandsList;
+
+typedef Types<commands::AudioStopStreamResponse,
+ commands::NaviStopStreamResponse,
+ commands::OnFindApplications,
+ commands::OnUpdateDeviceList,
+ commands::SDLPolicyUpdateResponse,
+ commands::UpdateAppListResponse,
+ commands::UpdateDeviceListResponse> EmptyResponseCommandsList;
+
+TYPED_TEST_CASE(ResponseFromHMICommandsTest, ResponseCommandsList);
+
+TYPED_TEST_CASE(EmptyResponseFromHMICommandsTest, EmptyResponseCommandsList);
+
+MATCHER_P(EventIdIsEqualTo, function_id, "") {
+ return static_cast<hmi_apis::FunctionID::eType>(function_id) == arg.id();
+}
+
+TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandData CommandData;
+ typedef typename CommandData::CommandType CommandType;
+
+ SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+
+ EXPECT_CALL(this->event_dispatcher_,
+ raise_event(EventIdIsEqualTo(CommandData::kEventId)));
+
+ command->Run();
+}
+
+TYPED_TEST(EmptyResponseFromHMICommandsTest, Run_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+
+ command->Run();
+}
+
+class OtherResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P(VehicleTypeIsEqualTo, vehicle_type, "") {
+ return (*vehicle_type) == arg.asString();
+}
+
+TEST_F(OtherResponseFromHMICommandsTest, VIGetVehicleTypeResponse_Run_SUCCESS) {
+ const std::string kVehicleType = "Test";
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params][am::hmi_response::vehicle_type] =
+ kVehicleType;
+
+ SharedPtr<commands::VIGetVehicleTypeResponse> command(
+ CreateCommand<commands::VIGetVehicleTypeResponse>(command_msg));
+
+ application_manager_test::MockHMICapabilities hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(hmi_capabilities));
+
+ EXPECT_CALL(hmi_capabilities,
+ set_vehicle_type(VehicleTypeIsEqualTo(&kVehicleType)));
+
+ command->Run();
+}
+
+TEST_F(OtherResponseFromHMICommandsTest, VIIsReadyResponse_Run_SUCCESS) {
+ SharedPtr<commands::VIIsReadyResponse> command(
+ CreateCommand<commands::VIIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+MATCHER_P(CheckMsgType, msg_type, "") {
+ return msg_type ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::message_type].asInt());
+}
+
+class NotificationFromHMITest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(NotificationFromHMITest, BasicMethodsOverloads_SUCCESS) {
+ SharedPtr<commands::NotificationFromHMI> command(
+ CreateCommand<commands::NotificationFromHMI>());
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+ EXPECT_NO_THROW(command->Run());
+}
+
+TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::message_type] =
+ static_cast<int32_t>(am::MessageType::kNotification);
+
+ SharedPtr<commands::NotificationFromHMI> command(
+ CreateCommand<commands::NotificationFromHMI>());
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(CheckMsgType(am::MessageType::kNotification),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ command->SendNotificationToMobile(command_msg);
+}
+
+TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::msg_params] = 0;
+ SharedPtr<commands::NotificationFromHMI> command(
+ CreateCommand<commands::NotificationFromHMI>(command_msg));
+
+ const uint32_t correlation_id = 1u;
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(correlation_id));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(CheckMsgType(am::MessageType::kRequest)))
+ .WillOnce(Return(false));
+
+ command->CreateHMIRequest(hmi_apis::FunctionID::INVALID_ENUM,
+ (*command_msg)[am::strings::msg_params]);
+}
+
+} // namespace simple_response_from_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc
new file mode 100644
index 0000000000..3948d2bfe3
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/simple_response_to_hmi_test.cc
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/commands/hmi/sdl_activate_app_response.h"
+#include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h"
+#include "application_manager/commands/hmi/sdl_get_status_update_response.h"
+#include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h"
+#include "application_manager/commands/hmi/response_to_hmi.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace simple_response_to_hmi_test {
+
+using ::testing::_;
+using ::testing::Types;
+using ::testing::NotNull;
+using ::utils::SharedPtr;
+
+namespace commands = ::application_manager::commands;
+using commands::MessageSharedPtr;
+
+template <class Command>
+class ResponseToHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+};
+
+typedef Types<commands::SDLActivateAppResponse,
+ commands::SDLGetListOfPermissionsResponse,
+ commands::SDLGetStatusUpdateResponse,
+ commands::SDLGetUserFriendlyMessageResponse> ResponseCommandsList;
+
+TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList);
+
+TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) {
+ typedef typename TestFixture::CommandType CommandType;
+
+ SharedPtr<CommandType> command = this->template CreateCommand<CommandType>();
+
+ EXPECT_CALL(this->app_mngr_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+class ResponseToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) {
+ SharedPtr<commands::ResponseToHMI> command(
+ CreateCommand<commands::ResponseToHMI>());
+
+ // Current implementation always return `true`
+ EXPECT_TRUE(command->Init());
+ EXPECT_TRUE(command->CleanUp());
+}
+
+TEST_F(ResponseToHMITest, Run_SUCCESS) {
+ SharedPtr<commands::ResponseToHMI> command(
+ CreateCommand<commands::ResponseToHMI>());
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(NotNull()));
+
+ command->Run();
+}
+
+} // namespace simple_response_to_hmi_test
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..c7b5c76b40
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/tts_get_capabilities_response_test.cc
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/tts_get_capabilities_response.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_capabilities_response {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::TTSGetCapabilitiesResponse;
+using test::components::application_manager_test::MockHMICapabilities;
+using utils::SharedPtr;
+using testing::_;
+
+namespace strings = ::application_manager::strings;
+namespace hmi_response = ::application_manager::hmi_response;
+
+namespace {
+const std::string kText = "TEXT";
+}
+
+class TTSGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+};
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
+ (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
+ kText;
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_speech_capabilities(SmartObject(kText)));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_prerecorded_speech(SmartObject(kText)));
+
+ SharedPtr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlySpeech_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText;
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_speech_capabilities(SmartObject(kText)));
+ EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
+
+ SharedPtr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::prerecorded_speech_capabilities] =
+ kText;
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_prerecorded_speech(SmartObject(kText)));
+
+ SharedPtr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+TEST_F(TTSGetCapabilitiesResponseTest, Run_Nothing_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0);
+ EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0);
+
+ SharedPtr<TTSGetCapabilitiesResponse> command(
+ CreateCommand<TTSGetCapabilitiesResponse>(msg));
+
+ command->Run();
+}
+
+} // namespace tts_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc
new file mode 100644
index 0000000000..e0b2fad5b9
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/tts_get_language_response_test.cc
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/tts_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "commands/commands_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_language_response {
+
+using utils::SharedPtr;
+using application_manager::commands::TTSGetLanguageResponse;
+using test::components::application_manager_test::MockHMICapabilities;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+namespace {
+const Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class TTSGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ SharedPtr<TTSGetLanguageResponse> command(
+ CreateCommand<TTSGetLanguageResponse>(msg));
+
+ MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_hmi_capabilities, set_active_tts_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(TTSGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<TTSGetLanguageResponse> command(
+ CreateCommand<TTSGetLanguageResponse>(msg));
+
+ MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_hmi_capabilities,
+ set_active_tts_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace tts_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..547fc02481
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/tts_get_supported_languages_response_test.cc
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+#include "application_manager/commands/hmi/tts_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_get_supported_languages_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::ResponseFromHMI;
+using am::commands::TTSGetSupportedLanguagesResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class TTSGetSupportedLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(TTSGetSupportedLanguageResponseTest, RUN_SUCCESS) {
+ smart_objects::SmartObject supported_languages("EN_US");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_tts_supported_languages((
+ *command_msg)[strings::msg_params][hmi_response::languages]));
+
+ command->Run();
+}
+TEST_F(TTSGetSupportedLanguageResponseTest, RUN_UNSUCCESS) {
+ smart_objects::SmartObject supported_languages("EN_US");
+
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ ResponseFromHMIPtr command(
+ CreateCommand<TTSGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_tts_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace tts_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc
new file mode 100644
index 0000000000..52c66ff877
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/tts_is_ready_response_test.cc
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/hmi/response_from_hmi.h"
+#include "application_manager/commands/hmi/tts_is_ready_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace tts_is_ready_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::ResponseFromHMI;
+using am::commands::TTSIsReadyResponse;
+using am::commands::CommandImpl;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const bool kIsAvailable = true;
+const bool kIsNotAvailable = false;
+} // namespace
+
+class TTSIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(TTSIsReadyResponseTest, RUN_SUCCESS) {
+ ResponseFromHMIPtr command(CreateCommand<TTSIsReadyResponse>());
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace tts_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..b02c9851ee
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc
@@ -0,0 +1,346 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the copyright holders nor the names of their contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/hmi/ui_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_capabilities_response {
+
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::ResponseFromHMI;
+using am::commands::UIGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<ResponseFromHMI> ResponseFromHMIPtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class UIGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(UIGetCapabilitiesResponseTest, RUN_SetDisplay_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities]
+ [hmi_response::display_type] = "GEN2_8_DMA";
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject display_capabilities_so =
+ (*command_msg)[strings::msg_params][hmi_response::display_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_display_capabilities(display_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetSoftButton_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][hmi_response::soft_button_capabilities]
+ [hmi_response::image_supported] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject soft_button_capabilities_so = (*command_msg)
+ [strings::msg_params][hmi_response::soft_button_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_soft_button_capabilities(soft_button_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetHmiZone_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities][0] =
+ "FRONT";
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject hmi_zone_capabilities_so =
+ (*command_msg)[strings::msg_params][hmi_response::hmi_zone_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_hmi_zone_capabilities(hmi_zone_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetAudioPassThru_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::audio_pass_thru_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject audio_pass_thru_capabilities_so = (*command_msg)
+ [strings::msg_params][strings::audio_pass_thru_capabilities];
+ EXPECT_CALL(
+ mock_hmi_capabilities_,
+ set_audio_pass_thru_capabilities(audio_pass_thru_capabilities_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetNavigation_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::navigation] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_navigation_supported(
+ hmi_capabilities_so[strings::navigation].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetPhoneCall_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::phone_call] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_phone_call_supported(
+ hmi_capabilities_so[strings::phone_call].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreaming_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities]
+ [strings::video_streaming] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject hmi_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::hmi_capabilities];
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_video_streaming_supported(
+ hmi_capabilities_so[strings::video_streaming].asBool()));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability]["sendLocationEnabled"] = true;
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability]["getWayPointsEnabled"] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject navigation_capability_so =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::navigation_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_navigation_capability(navigation_capability_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::phone_capability]["dialNumberEnabled"] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject phone_capability_so =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::phone_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_phone_capability(phone_capability_so));
+
+ command->Run();
+}
+
+TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::system_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::video_streaming_capability] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ smart_objects::SmartObject& video_streaming_capability =
+ (*command_msg)[strings::msg_params][strings::system_capabilities]
+ [strings::video_streaming_capability];
+
+ video_streaming_capability[strings::preferred_resolution] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ video_streaming_capability[strings::preferred_resolution]
+ [strings::resolution_width] = 800;
+ video_streaming_capability[strings::preferred_resolution]
+ [strings::resolution_height] = 350;
+
+ video_streaming_capability[strings::max_bitrate] = 10000;
+
+ video_streaming_capability[strings::supported_formats] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ video_streaming_capability[strings::supported_formats][0] =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+
+ video_streaming_capability[strings::supported_formats][0][strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RAW;
+
+ video_streaming_capability[strings::supported_formats][0][strings::codec] =
+ hmi_apis::Common_VideoStreamingCodec::H264;
+
+ video_streaming_capability[strings::haptic_spatial_data_supported] = true;
+
+ ResponseFromHMIPtr command(
+ CreateCommand<UIGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_video_streaming_capability(video_streaming_capability));
+
+ command->Run();
+}
+
+} // namespace ui_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc
new file mode 100644
index 0000000000..e45e4583e5
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/ui_get_language_response_test.cc
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/ui_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_language_response {
+
+using utils::SharedPtr;
+using application_manager::commands::UIGetLanguageResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class UIGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ SharedPtr<UIGetLanguageResponse> command(
+ CreateCommand<UIGetLanguageResponse>(msg));
+
+ MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_hmi_capabilities, set_active_ui_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(UIGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<UIGetLanguageResponse> command(
+ CreateCommand<UIGetLanguageResponse>(msg));
+
+ MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_hmi_capabilities,
+ set_active_ui_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace ui_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..690c863ccb
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/ui_get_supported_languages_response_test.cc
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/hmi/ui_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_get_supported_languages_response {
+
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::UIGetSupportedLanguagesResponse;
+
+typedef SharedPtr<UIGetSupportedLanguagesResponse>
+ UIGetSupportedLanguagesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const std::string kLanguage = "EN_US";
+const smart_objects::SmartObject supported_languages(kLanguage);
+} // namespace
+
+class UIGetSupportedLanguagesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(UIGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ UIGetSupportedLanguagesResponsePtr command(
+ CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_ui_supported_languages((supported_languages)));
+
+ command->Run();
+}
+TEST_F(UIGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ UIGetSupportedLanguagesResponsePtr command(
+ CreateCommand<UIGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_ui_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace ui_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
index 0a1ad28c79..66b1317870 100644
--- a/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
+++ b/src/components/application_manager/test/commands/hmi/ui_is_ready_request_test.cc
@@ -49,16 +49,15 @@ namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
+namespace ui_is_ready_request {
namespace am = ::application_manager;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
using am::commands::MessageSharedPtr;
using am::commands::UIIsReadyRequest;
-using am::MockMessageHelper;
using am::event_engine::Event;
typedef SharedPtr<UIIsReadyRequest> UIIsReadyRequestPtr;
@@ -66,14 +65,11 @@ typedef SharedPtr<UIIsReadyRequest> UIIsReadyRequestPtr;
class UIIsReadyRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- UIIsReadyRequestTest()
- : command_(CreateCommand<UIIsReadyRequest>())
- , mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+ UIIsReadyRequestTest() : command_(CreateCommand<UIIsReadyRequest>()) {}
void SetUp() OVERRIDE {
ON_CALL(app_mngr_, hmi_capabilities())
.WillByDefault(ReturnRef(mock_hmi_capabilities_));
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
void SetUpExpectations(bool is_ui_cooperating_available,
bool is_send_message_to_hmi,
@@ -150,8 +146,6 @@ class UIIsReadyRequestTest
}
UIIsReadyRequestPtr command_;
- am::MockHmiInterfaces mock_hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
};
@@ -203,7 +197,8 @@ TEST_F(UIIsReadyRequestTest, OnTimeout_SUCCESS) {
command_->onTimeOut();
}
-} // namespace mobile_commands_test
+} // namespace ui_is_ready_request
+} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc
new file mode 100644
index 0000000000..d69ec0528e
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/ui_is_ready_response_test.cc
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/hmi/ui_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace ui_is_ready_response {
+
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::UIIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef SharedPtr<UIIsReadyResponse> UIIsReadyResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const bool kIsAvailable = true;
+const bool kIsNotAvailable = false;
+} // namespace
+
+class UIIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(UIIsReadyResponseTest, RUN_SUCCESS) {
+ UIIsReadyResponsePtr command(CreateCommand<UIIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace ui_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc
new file mode 100644
index 0000000000..99eed48f71
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/update_device_list_request_test.cc
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/HMI_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/request_controller_settings.h"
+#include "application_manager/mock_application_manager_settings.h"
+#include "application_manager/commands/hmi/update_device_list_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_device_list_request {
+
+using ::utils::SharedPtr;
+using testing::_;
+using testing::ReturnRef;
+using testing::Return;
+using test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::event_engine::Event;
+using am::commands::UpdateDeviceListRequest;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<UpdateDeviceListRequest> UpdateDeviceListRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class UpdateDeviceListRequestTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ return command_msg;
+ }
+
+ MockApplicationManagerSettings settings_;
+ MockEventDispatcher mock_event_dispatcher_;
+};
+
+TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(
+ CreateCommand<UpdateDeviceListRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
+
+ EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, IsHMICooperating()).Times(0);
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+TEST_F(UpdateDeviceListRequestTest, RUN_HMICooperatingReturnsTrue_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(
+ CreateCommand<UpdateDeviceListRequest>(command_msg));
+
+ EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings_));
+
+ EXPECT_CALL(settings_, launch_hmi()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, IsHMICooperating()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+TEST_F(UpdateDeviceListRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
+
+ command->on_event(event);
+}
+
+TEST_F(UpdateDeviceListRequestTest, OnEvent_SUCCESS) {
+ Event event(Event::EventID::BasicCommunication_OnReady);
+
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher_));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_, _));
+ EXPECT_CALL(mock_event_dispatcher_, remove_observer(_));
+
+ UpdateDeviceListRequestPtr command(CreateCommand<UpdateDeviceListRequest>());
+
+ command->on_event(event);
+}
+
+} // namespace update_device_list_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc
new file mode 100644
index 0000000000..e9bf402aa7
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/update_sdl_request_test.cc
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/commands/hmi/update_sdl_request.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_sdl_request {
+
+using ::utils::SharedPtr;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::UpdateSDLRequest;
+
+typedef SharedPtr<UpdateSDLRequest> UpdateSDLRequestPtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class UpdateSDLRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(UpdateSDLRequestTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+
+ UpdateSDLRequestPtr command(CreateCommand<UpdateSDLRequest>(command_msg));
+ policy_test::MockPolicyHandlerInterface policy_handler;
+
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler));
+ EXPECT_CALL(policy_handler, PTExchangeAtUserRequest(kCorrelationId));
+
+ command->Run();
+
+ EXPECT_EQ(kCorrelationId,
+ (*command_msg)[strings::params][strings::correlation_id].asUInt());
+}
+
+} // namespace update_sdl_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc
new file mode 100644
index 0000000000..e612f438cc
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/update_sdl_response_test.cc
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "hmi/update_sdl_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace update_sdl_response {
+
+using ::utils::SharedPtr;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+using am::commands::UpdateSDLResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<UpdateSDLResponse> UpdateSDLResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class UpdateSDLResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(UpdateSDLResponseTest, RUN_SendRequest_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+
+ UpdateSDLResponsePtr command(CreateCommand<UpdateSDLResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, SendMessageToHMI(command_msg));
+
+ command->Run();
+
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_type].asInt(),
+ CommandImpl::hmi_protocol_type_);
+ EXPECT_EQ((*command_msg)[strings::params][strings::protocol_version].asInt(),
+ CommandImpl::protocol_version_);
+}
+
+} // namespace update_sdl_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc
new file mode 100644
index 0000000000..e61f90a2fa
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/vi_get_vehicle_data_response_test.cc
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "commands/commands_test.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "hmi/vi_get_vehicle_data_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vi_get_vehicle_data_response {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::MessageSharedPtr;
+using am::commands::VIGetVehicleDataResponse;
+using am::event_engine::Event;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef SharedPtr<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 1u;
+const std::string kStrNumber = "123";
+} // namespace
+
+class VIGetVehicleDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(VIGetVehicleDataResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::message_type] =
+ hmi_apis::messageType::response;
+
+ VIGetVehicleDataResponsePtr command(
+ CreateCommand<VIGetVehicleDataResponse>(command_msg));
+
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(*command_msg);
+
+ policy_test::MockPolicyHandlerInterface policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(policy_handler));
+ EXPECT_CALL(policy_handler, OnVehicleDataUpdated(*command_msg));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(VIGetVehicleDataResponseTest, ErrorResponse_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStrNumber;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][strings::message_type] =
+ hmi_apis::messageType::error_response;
+ (*command_msg)[strings::params][strings::data][strings::slider_position] = 1;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::params][strings::correlation_id] = kCorrelationId;
+ (*command_msg)[am::strings::params][am::strings::error_msg] = "test_error";
+ (*command_msg)[am::strings::params][am::strings::protocol_type] =
+ am::commands::CommandImpl::hmi_protocol_type_;
+ (*command_msg)[strings::params][strings::protocol_version] =
+ am::commands::CommandImpl::protocol_version_;
+
+ smart_objects::SmartObject result(smart_objects::SmartType_Map);
+ result[strings::msg_params] = (*command_msg)[strings::params][strings::data];
+ result[strings::params][hmi_response::code] =
+ (*command_msg)[strings::params][hmi_response::code];
+ result[strings::params][strings::correlation_id] =
+ (*command_msg)[strings::params][strings::correlation_id];
+ result[strings::params][strings::error_msg] =
+ (*command_msg)[strings::params][strings::error_msg];
+ result[strings::params][strings::message_type] =
+ (*command_msg)[strings::params][strings::message_type];
+ result[strings::params][strings::protocol_type] =
+ (*command_msg)[strings::params][strings::protocol_type];
+ result[strings::params][strings::protocol_version] =
+ (*command_msg)[strings::params][strings::protocol_version];
+
+ VIGetVehicleDataResponsePtr command(
+ CreateCommand<VIGetVehicleDataResponse>(command_msg));
+
+ am::event_engine::Event event(
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
+ event.set_smart_object(result);
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vi_get_vehicle_data_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
index aa4b450a98..557afa98d0 100644
--- a/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
+++ b/src/components/application_manager/test/commands/hmi/vi_is_ready_request_test.cc
@@ -49,6 +49,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
+namespace vi_is_ready_request {
using ::testing::_;
using ::testing::ReturnRef;
@@ -56,7 +57,6 @@ using ::testing::Return;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
using am::commands::VIIsReadyRequest;
-using am::MockMessageHelper;
using am::event_engine::Event;
typedef SharedPtr<VIIsReadyRequest> VIIsReadyRequestPtr;
@@ -102,7 +102,7 @@ class VIIsReadyRequestTest
void ExpectSendMessagesToHMI() {
smart_objects::SmartObjectSPtr ivi_type;
EXPECT_CALL(
- *(MockMessageHelper::message_helper_mock()),
+ mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::VehicleInfo_GetVehicleType, _))
.WillOnce(Return(ivi_type));
EXPECT_CALL(app_mngr_, ManageHMICommand(ivi_type));
@@ -120,7 +120,6 @@ class VIIsReadyRequestTest
}
VIIsReadyRequestPtr command_;
- am::MockHmiInterfaces mock_hmi_interfaces_;
application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_;
};
@@ -169,7 +168,8 @@ TEST_F(VIIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
command_->onTimeOut();
}
-} // namespace mobile_commands_test
+} // namespace vi_is_ready_request
+} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc
new file mode 100644
index 0000000000..907a013972
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/vr_get_capabilities_response_test.cc
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/hmi/vr_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_capabilities_response {
+
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::VRGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class VRGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(VRGetCapabilitiesResponseTest, RUN_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+ (*command_msg)[strings::msg_params][strings::vr_capabilities] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ (*command_msg)[strings::msg_params][strings::vr_capabilities][0] =
+ "vrCapabilities";
+
+ VRGetCapabilitiesResponsePtr command(
+ CreateCommand<VRGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject vr_capabilities_so =
+ (*command_msg)[strings::msg_params][strings::vr_capabilities];
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_vr_capabilities(vr_capabilities_so));
+
+ command->Run();
+}
+
+} // namespace vr_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc
new file mode 100644
index 0000000000..7d42e39548
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/vr_get_language_response_test.cc
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/hmi/vr_get_language_response.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_application_manager.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_language_response {
+
+using utils::SharedPtr;
+using application_manager::commands::VRGetLanguageResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+using testing::_;
+using testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+using namespace hmi_apis;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB;
+} // namespace
+
+class VRGetLanguageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[strings::msg_params][hmi_response::language] = kLanguage;
+
+ SharedPtr<VRGetLanguageResponse> command(
+ CreateCommand<VRGetLanguageResponse>(msg));
+
+ MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_hmi_capabilities, set_active_vr_language(kLanguage));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+TEST_F(VRGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<VRGetLanguageResponse> command(
+ CreateCommand<VRGetLanguageResponse>(msg));
+
+ MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_hmi_capabilities,
+ set_active_vr_language(Common_Language::INVALID_ENUM));
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vr_get_language_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc
new file mode 100644
index 0000000000..27be9e0f0f
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/vr_get_supported_languages_response_test.cc
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/application.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/commands/hmi/vr_get_supported_languages_response.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_get_supported_languages_response {
+
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::VRGetSupportedLanguagesResponse;
+
+typedef SharedPtr<VRGetSupportedLanguagesResponse>
+ VRGetSupportedLanguagesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kStringNum = "123";
+const std::string kLanguage = "EN_US";
+const smart_objects::SmartObject supported_languages(kLanguage);
+} // namespace
+
+class VRGetSupportedLanguagesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(VRGetSupportedLanguagesResponseTest, RUN_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+ (*command_msg)[strings::msg_params][hmi_response::languages] =
+ supported_languages;
+
+ VRGetSupportedLanguagesResponsePtr command(
+ CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_vr_supported_languages((supported_languages)));
+
+ command->Run();
+}
+TEST_F(VRGetSupportedLanguagesResponseTest, RUN_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = kStringNum;
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::WRONG_LANGUAGE;
+ (*command_msg)[strings::msg_params][hmi_response::capabilities] =
+ (capabilities_);
+
+ VRGetSupportedLanguagesResponsePtr command(
+ CreateCommand<VRGetSupportedLanguagesResponse>(command_msg));
+
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_vr_supported_languages(supported_languages)).Times(0);
+
+ command->Run();
+
+ EXPECT_FALSE((*command_msg)[am::strings::msg_params].keyExists(
+ am::hmi_response::languages));
+}
+
+} // namespace vr_get_supported_languages_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
index e5989d0b64..c9403b2f0e 100644
--- a/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
+++ b/src/components/application_manager/test/commands/hmi/vr_is_ready_request_test.cc
@@ -48,13 +48,13 @@ namespace test {
namespace components {
namespace commands_test {
namespace hmi_commands_test {
+namespace vr_is_ready_request {
using ::testing::_;
using ::testing::ReturnRef;
namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
using am::commands::VRIsReadyRequest;
-using am::MockMessageHelper;
using am::event_engine::Event;
typedef SharedPtr<VRIsReadyRequest> VRIsReadyRequestPtr;
@@ -104,7 +104,7 @@ class VRIsReadyRequestTest
smart_objects::SmartObjectSPtr language(
new smart_objects::SmartObject(smart_objects::SmartType_Map));
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ EXPECT_CALL(mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _))
.WillOnce(Return(language));
EXPECT_CALL(mock_hmi_capabilities_, set_handle_response_for(*language));
@@ -113,14 +113,14 @@ class VRIsReadyRequestTest
smart_objects::SmartObjectSPtr support_language(
new smart_objects::SmartObject(smart_objects::SmartType_Map));
EXPECT_CALL(
- *(MockMessageHelper::message_helper_mock()),
+ mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _))
.WillOnce(Return(support_language));
EXPECT_CALL(app_mngr_, ManageHMICommand(support_language));
smart_objects::SmartObjectSPtr capabilities(
new smart_objects::SmartObject(smart_objects::SmartType_Map));
- EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ EXPECT_CALL(mock_message_helper_,
CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, _))
.WillOnce(Return(capabilities));
EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
@@ -138,7 +138,6 @@ class VRIsReadyRequestTest
}
VRIsReadyRequestPtr command_;
- am::MockHmiInterfaces mock_hmi_interfaces_;
application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
};
@@ -187,7 +186,8 @@ TEST_F(VRIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
command_->onTimeOut();
}
-} // namespace mobile_commands_test
+} // namespace vr_is_ready_request
+} // namespace hmi_commands_test
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc
new file mode 100644
index 0000000000..37e945bc11
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/vr_is_ready_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/hmi/vr_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace vr_is_ready_response {
+
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::VRIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef SharedPtr<VRIsReadyResponse> VRIsReadyResponsePtr;
+
+class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(VRIsReadyResponseTest, RUN_SUCCESS) {
+ VRIsReadyResponsePtr command(CreateCommand<VRIsReadyResponse>());
+
+ MockEventDispatcher mock_event_dispatcher;
+ EXPECT_CALL(app_mngr_, event_dispatcher())
+ .WillOnce(ReturnRef(mock_event_dispatcher));
+ EXPECT_CALL(mock_event_dispatcher, raise_event(_));
+
+ command->Run();
+}
+
+} // namespace vr_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/CMakeLists.txt b/src/components/application_manager/test/commands/mobile/CMakeLists.txt
deleted file mode 100644
index 31c8503573..0000000000
--- a/src/components/application_manager/test/commands/mobile/CMakeLists.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright (c) 2016, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include_directories(
- ${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/application_manager/include/application_manager/
- ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/
- ${COMPONENTS_DIR}/application_manager/test/include/
- ${COMPONENTS_DIR}/application_manager/test/include/application_manager/commands/
-)
-
-set (SOURCES
- ${AM_SOURCE_DIR}/src/smart_object_keys.cc
- ${AM_SOURCE_DIR}/test/mock_message_helper.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/delete_command_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/add_command_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/perform_interaction_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/change_registration_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/create_interaction_choice_set_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/register_app_interface_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/speak_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/alert_maneuver_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/show_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/alert_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/add_sub_menu_request_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/delete_sub_menu_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/set_media_clock_timer_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/set_global_properties_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/set_app_icon_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/set_display_layout_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/slider_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/scrollable_message_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/perform_audio_pass_thru_test.cc
- ${COMMANDS_TEST_SOURCE_DIR}/mobile/end_audio_pass_thru_request_test.cc
-)
-
-set(LIBRARIES
- gmock
- jsoncpp
- Utils
- ApplicationManager
- connectionHandler
- HMI_API
- MOBILE_API
- SmartObjects
-)
-
-create_test("mobile_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
index b337acd52f..471f0763de 100644
--- a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc
@@ -53,291 +53,1032 @@
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace add_command_request {
namespace am = application_manager;
-
-using am::commands::AddCommandRequest;
using am::commands::CommandImpl;
using am::ApplicationManager;
using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
-using am::MockMessageHelper;
-using am::MockHmiInterfaces;
-
using ::testing::_;
-using ::testing::Mock;
-using ::testing::Return;
-using ::testing::ReturnRef;
using ::utils::SharedPtr;
+using ::testing::Return;
+using ::testing::InSequence;
+using am::commands::AddCommandRequest;
+using NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr;
using ::test::components::application_manager_test::MockApplication;
+using am::event_engine::EventObserver;
+using namespace smart_objects;
namespace custom_str = utils::custom_string;
namespace strings = ::application_manager::strings;
+namespace mobile_result = mobile_apis::Result;
namespace hmi_response = ::application_manager::hmi_response;
+namespace hmi_request = ::application_manager::hmi_request;
+using namespace strings;
namespace {
-const int32_t kCommandId = 1;
+const hmi_apis::FunctionID::eType kInvalidFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const std::string kMenuName = "LG";
+const uint32_t kFirstParentId = 10u;
+const uint32_t kSecondParentId = 1u;
+const std::string kErroredVRCommand = "l\namer";
+const std::string kFirstVrCommand = "lamer";
+const std::string kSecondVrCommand = "hacker";
+const uint32_t kFirstCommandId = 10u;
+const uint32_t kSecondCommandId = 11u;
+const int32_t kType = 34;
+const int32_t kGrammarId = 12;
+const int32_t kPosition = 10;
} // namespace
class AddCommandRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
AddCommandRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ : msg_(CreateMessage())
+ , default_app_name_("test_default_app_name_")
+ , mock_app_(CreateMockApp()) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ InitGetters();
+ InitBasicMessage();
+ }
protected:
- MessageSharedPtr CreateFullParamsVRSO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[strings::cmd_id] = kCmdId;
- msg_params[strings::vr_commands] =
- smart_objects::SmartObject(smart_objects::SmartType_Array);
- msg_params[strings::vr_commands][0] = "lamer";
- msg_params[strings::type] = 34;
- msg_params[strings::grammar_id] = 12;
- msg_params[strings::app_id] = kAppId;
- (*msg)[strings::msg_params] = msg_params;
-
- return msg;
+ void InitBasicMessage() {
+ (*msg_)[params][connection_key] = kConnectionKey;
+ (*msg_)[msg_params][app_id] = kAppId;
+ (*msg_)[msg_params][app_name] = default_app_name_;
}
- MessageSharedPtr CreateFullParamsUISO() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- msg_params[am::strings::cmd_icon] = 1;
- msg_params[am::strings::cmd_icon][am::strings::value] = "10";
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
+ void InitGetters() {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillByDefault(Return(so_ptr_.get()));
}
- MessageSharedPtr CreateParamsUISOWithOutCmdIcon() {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
- smart_objects::SmartObject menu_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- menu_params[am::strings::position] = 10;
- menu_params[am::strings::menu_name] = "LG";
-
- smart_objects::SmartObject msg_params =
- smart_objects::SmartObject(smart_objects::SmartType_Map);
- msg_params[am::strings::cmd_id] = kCmdId;
- msg_params[am::strings::menu_params] = menu_params;
- msg_params[am::strings::app_id] = kAppId;
- (*msg)[am::strings::msg_params] = msg_params;
-
- return msg;
+ void CreateBasicParamsUIRequest() {
+ SmartObject menu_params = SmartObject(SmartType_Map);
+ menu_params[position] = kPosition;
+ menu_params[menu_name] = kMenuName;
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[strings::menu_params] = menu_params;
+ msg_params[cmd_icon] = 1;
+ msg_params[cmd_icon][value] = "10";
+ msg_params[info] = "UI info";
}
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
+ void CreateBasicParamsVRRequest() {
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[cmd_id] = kCmdId;
+ msg_params[vr_commands] = SmartObject(SmartType_Array);
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ msg_params[type] = kPosition;
+ msg_params[grammar_id] = kGrammarId;
+ msg_params[info] = "VR info";
}
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ const am::CommandsMap CreateCommandsMap(SmartObject& first_command,
+ SmartObject& second_command) {
+ second_command[menu_params] = SmartObject(SmartType_Map);
+ second_command[menu_params][hmi_request::parent_id] = kFirstParentId;
+ second_command[menu_params][menu_name] = kMenuName;
+ second_command[vr_commands] = SmartObject(SmartType_Array);
+ second_command[vr_commands][0] = kSecondVrCommand;
+ am::CommandsMap commands_map;
+ commands_map.insert(std::make_pair(kFirstCommandId, &first_command));
+ commands_map.insert(std::make_pair(kSecondCommandId, &second_command));
+ return commands_map;
}
- void ResultCommandExpectations(MessageSharedPtr msg,
- const std::string& info) {
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::success].asBool(),
- true);
- EXPECT_EQ(
- (*msg)[am::strings::msg_params][am::strings::result_code].asInt(),
- static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
- EXPECT_EQ((*msg)[am::strings::msg_params][am::strings::info].asString(),
- info);
+ void CheckOnTimeOutCommandDeletion(
+ const hmi_apis::FunctionID::eType incoming_cmd,
+ const hmi_apis::FunctionID::eType cmd_to_delete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId))
+ .WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>(
+ commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event(incoming_cmd);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(HMIResultCodeIs(cmd_to_delete)))
+ .WillOnce(Return(true));
+ SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(response,
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ utils::SharedPtr<CommandRequestImpl> base_class_request =
+ static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr);
+ base_class_request->onTimeOut();
}
+ MessageSharedPtr msg_;
+ SmartObjectSPtr so_ptr_;
+ const utils::custom_string::CustomString default_app_name_;
sync_primitives::Lock lock_;
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
MockAppPtr mock_app_;
};
-TEST_F(AddCommandRequestTest, OnTimeout_GENERIC_ERROR) {
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[strings::msg_params][strings::result_code] =
- am::mobile_api::Result::GENERIC_ERROR;
- (*msg)[strings::msg_params][strings::success] = false;
- (*msg)[strings::params][strings::connection_key] = kConnectionKey;
+TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MenuNameHasSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ const std::string errored_menu_name = "L\nG";
+ msg_params[menu_params][menu_name] = errored_menu_name;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ SmartObject parent = SmartObject(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kFirstParentId))
+ .WillOnce(Return(&parent));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_VRCommandsHaveSyntaxError_EXPECT_INVALID_DATA) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[vr_commands][0] = kErroredVRCommand;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
- utils::SharedPtr<AddCommandRequest> command =
+TEST_F(AddCommandRequestTest, Run_CMDIconHasError_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ (*msg)[params][connection_key] = kConnectionKey;
+ msg_params[cmd_id] = kCmdId;
+ msg_params[cmd_icon] = 1;
+ const std::string errored_cmd_icon_value = "1\n0";
+ msg_params[cmd_icon][value] = errored_cmd_icon_value;
+ msg_params[vr_commands][0] = kFirstVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
- ON_CALL(*mock_app_, get_grammar_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(*mock_app_, RemoveCommand(_)).WillByDefault(Return());
+TEST_F(AddCommandRequestTest, Run_CommandIDAlreadyExists_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
- EXPECT_CALL(
- mock_message_helper_,
- CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
- .WillOnce(Return(msg));
+TEST_F(AddCommandRequestTest,
+ Run_CommandNameAlreadyExists_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kFirstParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgParentIDsAreDifferentSubmenuNotExisted_EXPECT_INVALID_ID) {
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsgVrSynonymsAreTheSame_EXPECT_DUPLICATE_NAME) {
+ CreateBasicParamsVRRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ msg_params[vr_commands][0] = kSecondVrCommand;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest, Run_MsgDataEmpty_EXPECT_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[params][connection_key] = kConnectionKey;
+ SmartObject& msg_params = (*msg)[strings::msg_params];
+ msg_params[app_id] = kAppId;
+ msg_params[cmd_id] = kCmdId;
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg);
+ request_ptr->Run();
+}
+
+TEST_F(AddCommandRequestTest,
+ Run_CmdAndMsg_UI_and_Vr_AreCorrect_EXPECT_VR_AND_UI_SENT) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ SmartObject& image = msg_params[cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+}
- MessageSharedPtr command_result;
+TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
+
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
EXPECT_CALL(
app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
-
- command->onTimeOut();
- EXPECT_EQ((*command_result)[strings::msg_params][strings::success].asBool(),
- false);
- EXPECT_EQ(
- (*command_result)[strings::msg_params][strings::result_code].asInt(),
- static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
}
-TEST_F(AddCommandRequestTest, OnEvent_VR_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_vr = CreateFullParamsVRSO();
- (*msg_vr)[strings::msg_params][strings::menu_params]
- [am::hmi_request::parent_id] = 10u;
- (*msg_vr)[strings::msg_params][strings::menu_params][strings::menu_name] =
- "menu_name";
+TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) {
+ CreateBasicParamsUIRequest();
+ (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
- utils::SharedPtr<AddCommandRequest> command =
- CreateCommand<AddCommandRequest>(msg_vr);
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
+ Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
- ON_CALL(*mock_app_, FindSubMenu(_)).WillByDefault(Return(&(*msg_vr)));
- ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- ON_CALL(hmi_interfaces_, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ request_ptr->on_event(event);
+}
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[strings::params][hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::info] =
- "VR is not supported by system";
- (*msg)[strings::msg_params][strings::cmd_id] = kCommandId;
+TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) {
+ CreateBasicParamsVRRequest();
+ MessageSharedPtr msg = CreateMessage(SmartType_Map);
+ (*msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*msg)[msg_params][cmd_id] = kCmdId;
Event event(hmi_apis::FunctionID::VR_AddCommand);
event.set_smart_object(*msg);
-
- smart_objects::SmartObject* ptr = NULL;
- ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr));
-
- ON_CALL(mock_message_helper_, HMIToMobileResult(_))
- .WillByDefault(Return(mobile_apis::Result::SUCCESS));
-
- EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_vr)[strings::msg_params]));
+ EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params]));
am::CommandsMap commands_map;
- ON_CALL(*mock_app_, commands_map())
- .WillByDefault(
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(
Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_VR_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::VR_AddCommand,
+ hmi_apis::FunctionID::VR_DeleteCommand);
+}
- EXPECT_CALL(*mock_app_, UpdateHash());
+TEST_F(AddCommandRequestTest, OnTimeOut_EXPECT_UI_DeleteCommand) {
+ CheckOnTimeOutCommandDeletion(hmi_apis::FunctionID::UI_AddCommand,
+ hmi_apis::FunctionID::UI_DeleteCommand);
+}
- MessageSharedPtr msg_ui(CreateMessage(smart_objects::SmartType_Map));
- (*msg_ui)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
+TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) {
+ MessageSharedPtr command_msg = CreateMessage(SmartType_Map);
+ (*command_msg)[params][connection_key] = kConnectionKey;
+ MessageSharedPtr event_msg = CreateMessage(SmartType_Map);
+ (*event_msg)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[msg_params][cmd_id] = kCmdId;
Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
- event_ui.set_smart_object(*msg_ui);
+ event_ui.set_smart_object(*event_msg);
- command->Run();
- command->on_event(event_ui);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*event_msg);
- MessageSharedPtr vr_command_result;
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(command_msg);
+ request_ptr->Run();
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest, OnEvent_AppNotExisted_UNSUCCESS) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->on_event(event);
+}
+
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsRejected_ExpectUICommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::REJECTED;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
EXPECT_CALL(
app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&vr_command_result), Return(true)));
-
- command->on_event(event);
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::REJECTED), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
- ResultCommandExpectations(vr_command_result, "VR is not supported by system");
+TEST_F(AddCommandRequestTest,
+ OnEvent_HmiResponseCodeIsWarnings_ExpectCommandUpdated) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::WARNINGS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::WARNINGS), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
}
-TEST_F(AddCommandRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_vr = CreateFullParamsUISO();
- (*msg_vr)[am::strings::msg_params][am::strings::vr_commands][0] =
- "vr_command";
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsGenericError_VR_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
- utils::SharedPtr<AddCommandRequest> command =
- CreateCommand<AddCommandRequest>(msg_vr);
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsGenericError_UI_HmiResponseCodeIsUnsupportedResourse_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::GENERIC_ERROR;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
- ON_CALL(*mock_app_, FindSubMenu(_)).WillByDefault(Return(&(*msg_vr)));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
- ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_))
- .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- ON_CALL(hmi_interfaces_,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_vr);
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
- (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ event_ui.set_smart_object(*msg_ui);
+ request_ptr->on_event(event_ui);
+}
- Event event(hmi_apis::FunctionID::UI_AddCommand);
- event.set_smart_object(*msg);
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_UI_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
- smart_objects::SmartObject* ptr = NULL;
- ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr));
- EXPECT_EQ(NULL, ptr);
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
- ON_CALL(mock_message_helper_, HMIToMobileResult(_))
- .WillByDefault(Return(mobile_apis::Result::SUCCESS));
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_VR_HmiResponseCodeIsUnsupportedResourse_VR_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
- ON_CALL(mock_message_helper_, VerifyImage(_, _, _))
- .WillByDefault(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_,
- AddCommand(kCmdId, (*msg_vr)[am::strings::msg_params]));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ event_vr.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_UI_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
am::CommandsMap commands_map;
- ON_CALL(*mock_app_, commands_map())
- .WillByDefault(
- Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::UI_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
- EXPECT_CALL(*mock_app_, UpdateHash());
+TEST_F(
+ AddCommandRequestTest,
+ OnEvent_VR_HmiResponseCodeIsUnsupportedResource_NotAvailableInterfaceState_ExpectCommandRemoved) {
+ CreateBasicParamsVRRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
+ .WillRepeatedly(
+ Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*msg_);
+ request_ptr->on_event(event);
+}
- MessageSharedPtr msg_ui(CreateMessage(smart_objects::SmartType_Map));
- (*msg_ui)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::SUCCESS;
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_EventWithNotSuccesResponseCode_ExpectVRCommandDelete) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ MessageSharedPtr msg_ui = CreateMessage(SmartType_Map);
+ (*msg_ui)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_ui)[msg_params][cmd_id] = kCmdId;
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_ui);
Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
- event_vr.set_smart_object(*msg_vr);
+ event_vr.set_smart_object(*msg_);
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ request_ptr->on_event(event_ui);
+ request_ptr->on_event(event_vr);
+}
- command->Run();
- command->on_event(event_vr);
- MessageSharedPtr ui_command_result;
+TEST_F(AddCommandRequestTest,
+ OnEvent_UI_VR_Events_VRErrorPresent_ExpectRemoveCommand) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& params = (*msg_)[strings::params];
+ params[hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+ SmartObject& image = (*msg_)[msg_params][cmd_icon];
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ am::CommandsMap commands_map;
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _));
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+
+ Event event_ui(hmi_apis::FunctionID::UI_AddCommand);
+ event_ui.set_smart_object(*msg_);
+ request_ptr->on_event(event_ui);
EXPECT_CALL(
app_mngr_,
- ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_DeleteCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(2);
+ Event event_vr(hmi_apis::FunctionID::VR_AddCommand);
+ MessageSharedPtr msg_vr = CreateMessage(SmartType_Map);
+ (*msg_vr)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+ (*msg_vr)[msg_params][cmd_id] = kCmdId;
+ event_vr.set_smart_object(*msg_vr);
+ request_ptr->on_event(event_vr);
+}
- command->on_event(event);
+TEST_F(AddCommandRequestTest,
+ OnTimeOut_AppNotExisted_NoAppRemoveCommandCalled) {
+ CreateBasicParamsUIRequest();
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0);
+ SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ response, am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ utils::SharedPtr<CommandRequestImpl> base_class_request =
+ static_cast<utils::SharedPtr<CommandRequestImpl> >(
+ CreateCommand<AddCommandRequest>(msg_));
+ base_class_request->onTimeOut();
+}
- ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) {
+ CreateBasicParamsVRRequest();
+ CreateBasicParamsUIRequest();
+ SmartObject& msg_params = (*msg_)[strings::msg_params];
+ SmartObject& image = msg_params[cmd_icon];
+ msg_params[menu_params][hmi_request::parent_id] = kSecondParentId;
+ EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get()));
+ SmartObject first_command = SmartObject(SmartType_Map);
+ SmartObject second_command = SmartObject(SmartType_Map);
+ const am::CommandsMap commands_map =
+ CreateCommandsMap(first_command, second_command);
+ EXPECT_CALL(*mock_app_, commands_map())
+ .WillRepeatedly(Return(
+ DataAccessor<application_manager::CommandsMap>(commands_map, lock_)));
+ so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map);
+ EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId))
+ .WillOnce(Return(so_ptr_.get()));
+ {
+ InSequence dummy;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand)))
+ .WillOnce(Return(true));
+ }
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ utils::SharedPtr<AddCommandRequest> request_ptr =
+ CreateCommand<AddCommandRequest>(msg_);
+ request_ptr->Run();
+ EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId));
+ SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map);
+ (*response)[strings::msg_params][strings::info] = "info";
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(response));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ response, am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ utils::SharedPtr<CommandRequestImpl> base_class_request =
+ static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr);
+ base_class_request->onTimeOut();
}
} // namespace add_command_test
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc
index 7eae10d10b..f5bb7888d8 100644
--- a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc
@@ -48,15 +48,13 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace add_sub_menu_request {
namespace am = ::application_manager;
using am::commands::AddSubMenuRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using am::MockHmiInterfaces;
-using am::MockMessageHelper;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
typedef SharedPtr<AddSubMenuRequest> AddSubMenuPtr;
@@ -66,12 +64,7 @@ const uint32_t kConnectionKey = 2u;
} // namespace
class AddSubMenuRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- AddSubMenuRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
- MockMessageHelper& mock_message_helper_;
-};
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
const uint32_t menu_id = 10u;
@@ -97,22 +90,12 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
Event event(hmi_apis::FunctionID::UI_AddSubMenu);
event.set_smart_object(*ev_msg);
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
MessageSharedPtr ui_command_result;
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
.WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
-
+ command->Init();
command->on_event(event);
EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
@@ -129,9 +112,9 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.asString()
.empty());
}
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
+} // namespace add_sub_menu_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
index 157f3db750..90c6409fa8 100644
--- a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc
@@ -54,6 +54,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace alert_maneuver_request {
using ::testing::_;
using ::testing::Return;
@@ -62,8 +63,6 @@ namespace am = ::application_manager;
using am::commands::AlertManeuverRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using am::MockHmiInterfaces;
-using am::MockMessageHelper;
typedef SharedPtr<AlertManeuverRequest> CommandPtr;
@@ -87,15 +86,7 @@ class AlertManeuverRequestTest
MockAppPtr mock_app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- MockMessageHelper* mock_message_helper =
- MockMessageHelper::message_helper_mock();
- EXPECT_CALL(*mock_message_helper, HMIToMobileResult(_))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(state));
MessageSharedPtr response_to_mobile;
@@ -148,7 +139,8 @@ TEST_F(AlertManeuverRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::text] = "text";
CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
@@ -161,8 +153,7 @@ TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_UNSUCCESS) {
const mobile_apis::Result::eType kProcessingResult =
mobile_apis::Result::ABORTED;
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
- ProcessSoftButtons(_, _, _, _))
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
.WillOnce(Return(kProcessingResult));
MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
@@ -198,7 +189,8 @@ TEST_F(AlertManeuverRequestTest, Run_IsWhiteSpaceExist_UNSUCCESS) {
TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::msg_params][am::strings::soft_buttons] = 0;
+ (*msg)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::text] = "text";
CommandPtr command(CreateCommand<AlertManeuverRequest>(msg));
@@ -208,21 +200,16 @@ TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) {
ON_CALL(app_mngr_, GetPolicyHandler())
.WillByDefault(ReturnRef(policy_interface_));
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
- ProcessSoftButtons(_, _, _, _))
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _))
.WillOnce(Return(mobile_apis::Result::SUCCESS));
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_))
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
.WillRepeatedly(
Return(am::HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
- SubscribeApplicationToSoftButton(_, _, _));
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command)));
EXPECT_EQ(hmi_apis::FunctionID::Navigation_AlertManeuver,
@@ -243,34 +230,35 @@ TEST_F(AlertManeuverRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
.asInt()));
}
-TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case1) {
+TEST_F(AlertManeuverRequestTest, OnEvent_SUCCESS) {
CheckExpectations(hmi_apis::Common_Result::SUCCESS,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::SUCCESS,
am::HmiInterfaces::STATE_AVAILABLE,
true);
}
-TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case2) {
- CheckExpectations(hmi_apis::Common_Result::SUCCESS,
+TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE) {
+ CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_NOT_AVAILABLE,
- true);
+ am::HmiInterfaces::STATE_AVAILABLE,
+ false);
}
-TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case3) {
- CheckExpectations(hmi_apis::Common_Result::SUCCESS,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
+TEST_F(AlertManeuverRequestTest, OnEvent_WARNINGS) {
+ CheckExpectations(hmi_apis::Common_Result::WARNINGS,
+ mobile_apis::Result::WARNINGS,
am::HmiInterfaces::STATE_NOT_RESPONSE,
true);
}
-TEST_F(AlertManeuverRequestTest, OnEvent_UNSUPPORTED_RESOURCE_Case4) {
+TEST_F(AlertManeuverRequestTest, OnEvent_GENERIC_ERROR) {
CheckExpectations(hmi_apis::Common_Result::GENERIC_ERROR,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
+ mobile_apis::Result::GENERIC_ERROR,
am::HmiInterfaces::STATE_NOT_RESPONSE,
false);
}
+} // namespace alert_maneuver_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_request_test.cc
index 2c80f6e5e2..5d9e507511 100644
--- a/src/components/application_manager/test/commands/mobile/alert_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/alert_request_test.cc
@@ -43,10 +43,12 @@
#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace alert_request {
namespace am = application_manager;
@@ -54,25 +56,29 @@ using am::commands::AlertRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::utils::SharedPtr;
+using am::event_engine::Event;
+using policy_test::MockPolicyHandlerInterface;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
+typedef SharedPtr<AlertRequest> CommandPtr;
+
namespace {
const int32_t kCommandId = 1;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const uint32_t kDefaultTimeout = 1000u;
+const uint32_t kCorrelationId = 2u;
+const mobile_apis::FunctionID::eType kFunctionId =
+ mobile_apis::FunctionID::AlertID;
} // namespace
class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- AlertRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ AlertRequestTest() : mock_app_(CreateMockApp()), msg_(CreateMessage()) {}
protected:
MessageSharedPtr CreateFullParamsUISO() {
@@ -106,33 +112,82 @@ class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
info);
}
- void SetUp() OVERRIDE {
+ void PreConditions() {
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
.WillByDefault(
- Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE));
+ Return(am::HmiInterfaces::InterfaceState::STATE_AVAILABLE));
}
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+
+ void Expectations() {
+ (*msg_)[am::strings::params][am::strings::function_id] = kFunctionId;
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(
+ *mock_app_,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
+ .WillByDefault(Return(false));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+ }
+
+ void AddAlertTextsToMsg() {
+ (*msg_)[am::strings::msg_params][am::strings::alert_text1] = "alert_text1";
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] = "alert_text2";
+ (*msg_)[am::strings::msg_params][am::strings::alert_text3] = "alert_text3";
+ }
+ void AddTTSChunkToMsg() {
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "tts_chunk_text";
+ }
+
+ void ExpectCallHmiLevel(const mobile_apis::HMILevel::eType level) {
+ EXPECT_CALL(*mock_app_, hmi_level()).WillRepeatedly(Return(level));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ }
+
+ void ExpectManageHmiCommandTTSAndUI() {
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Alert)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
}
sync_primitives::Lock lock_;
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
+
MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ MockPolicyHandlerInterface mock_policy_handler_;
};
TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
+ PreConditions();
MessageSharedPtr command_msg = CreateMessage(smart_objects::SmartType_Map);
(*command_msg)[am::strings::msg_params][am::strings::result_code] =
am::mobile_api::Result::GENERIC_ERROR;
@@ -164,6 +219,7 @@ TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) {
}
TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
+ PreConditions();
MessageSharedPtr command_msg = CreateFullParamsUISO();
(*command_msg)[am::strings::msg_params][am::strings::menu_params]
[am::hmi_request::parent_id] = 10u;
@@ -180,9 +236,6 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
(*msg)[am::strings::msg_params][am::strings::info] =
"UI is not supported by system";
- ON_CALL(mock_message_helper_, HMIToMobileResult(_))
- .WillByDefault(Return(mobile_apis::Result::SUCCESS));
-
MessageSharedPtr msg_tts = CreateMessage();
(*msg_tts)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::SUCCESS;
@@ -205,7 +258,514 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
ResultCommandExpectations(ui_command_result, "UI is not supported by system");
}
+class CallOnTimeOut {
+ public:
+ CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.onTimeOut();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+TEST_F(AlertRequestTest, Init_DurationExists_SUCCESS) {
+ Expectations();
+ (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, Init_DurationNotExists_SUCCESS) {
+ Expectations();
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(AlertRequestTest, OnTimeOut_SUCCESS) {
+ Expectations();
+ MessageSharedPtr result_msg(CreateMessage(smart_objects::SmartType_Null));
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, mobile_apis::Result::GENERIC_ERROR))
+ .WillOnce(Return(result_msg));
+
+ CommandPtr command(CreateCommand<AlertRequest>());
+ MessageSharedPtr received_result_msg(
+ CatchMobileCommandResult(CallOnTimeOut(*command)));
+ EXPECT_EQ(result_msg, received_result_msg);
+}
+
+TEST_F(AlertRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ Expectations();
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_AlertFrequencyIsTooHigh_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(
+ *mock_app_,
+ AreCommandLimitsExceeded(kFunctionId, am::TLimitSource::POLICY_TABLE))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(mobile_apis::Result::REJECTED,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertRequestTest, Run_FailToProcessSoftButtons_UNSUCCESS) {
+ Expectations();
+ const mobile_apis::Result::eType result_code =
+ mobile_apis::Result::INVALID_ENUM;
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(result_code));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command)));
+ EXPECT_EQ(result_code,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+}
+
+TEST_F(AlertRequestTest, Run_MandatoryParametersAreMissed_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_MandatoryParametersAreInvalid_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
+ "invalid\t\nParam";
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+ (*msg_)[am::strings::msg_params][am::strings::progress_indicator] =
+ "progress_indicator";
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+
+ ExpectManageHmiCommandTTSAndUI();
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ Expectations();
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_UI_OnResetTimeout_SUCCESS) {
+ PreConditions();
+ Expectations();
+ AddAlertTextsToMsg();
+
+ (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout;
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+
+ EXPECT_CALL(
+ app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_ENUM);
+
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ ExpectManageHmiCommandTTSAndUI();
+
+ command->Run();
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)));
+
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) {
+ PreConditions();
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSUnsupportedResource_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ PreConditions();
+
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest,
+ DISABLED_OnEvent_TTSUnsupportedResourceUiAlertSent_SUCCESS) {
+ PreConditions();
+
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_TTSUnsupportedResourceUiAlertSuccess_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons] = "soft_buttons";
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(mock_message_helper_,
+ SubscribeApplicationToSoftButton(
+ (*msg_)[am::strings::msg_params], _, kFunctionId));
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, OnEvent_TTSSuccesUiAlertInvalidEnum_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_ENUM;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) {
+ Expectations();
+ AddTTSChunkToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)))
+ .WillOnce(Return(true));
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::INVALID_ENUM;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg_)[am::strings::msg_params][am::strings::play_tone] = true;
+
+ ExpectCallHmiLevel(mobile_apis::HMILevel::HMI_FULL);
+ EXPECT_CALL(mock_message_helper_,
+ ProcessSoftButtons((*msg_)[am::strings::msg_params], _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ ExpectManageHmiCommandTTSAndUI();
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(true));
+
+ Event ui_event(hmi_apis::FunctionID::UI_Alert);
+ ui_event.set_smart_object(*msg_);
+ command->on_event(ui_event);
+
+ Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking);
+ tts_stop_event.set_smart_object(*msg_);
+ command->on_event(tts_stop_event);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS);
+
+ Event event(hmi_apis::FunctionID::TTS_Speak);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert2_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text2] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidAlert3_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::alert_text3] =
+ "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(AlertRequestTest, Run_InvalidTTSChunk_UNSUCCESS) {
+ Expectations();
+ AddAlertTextsToMsg();
+ (*msg_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "invalid_text_with_empty_str\\n";
+
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<AlertRequest>(msg_));
+ command->Run();
+}
+
} // namespace alert_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
-} // namespace tests
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/test/commands/mobile/change_registration_test.cc
index a2a137d0f4..3d7671015c 100644
--- a/src/components/application_manager/test/commands/mobile/change_registration_test.cc
+++ b/src/components/application_manager/test/commands/mobile/change_registration_test.cc
@@ -51,10 +51,12 @@
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace change_registration_request {
namespace am = application_manager;
@@ -63,13 +65,13 @@ using am::ApplicationManager;
using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::testing::_;
-using ::testing::Mock;
using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::SetArgPointee;
using am::commands::ChangeRegistrationRequest;
+using policy_test::MockPolicyHandlerInterface;
using ::test::components::application_manager_test::MockApplication;
namespace custom_str = utils::custom_string;
@@ -77,7 +79,6 @@ namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
namespace {
-const int32_t kCommandId = 1;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
@@ -87,8 +88,8 @@ class ChangeRegistrationRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
ChangeRegistrationRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ : mock_app_(CreateMockApp())
+ , supported_languages_(CreateMessage(smart_objects::SmartType_Array)) {}
MessageSharedPtr CreateMsgFromMobile() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -103,41 +104,40 @@ class ChangeRegistrationRequestTest
void PrepareExpectationBeforeRun() {
ON_CALL(app_mngr_, hmi_capabilities())
.WillByDefault(ReturnRef(hmi_capabilities_));
- smart_objects::SmartObject supported_languages(
- smart_objects::SmartType_Array);
- supported_languages[0] = static_cast<int32_t>(mobile_apis::Language::EN_US);
+ (*supported_languages_)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
EXPECT_CALL(hmi_capabilities_, ui_supported_languages())
- .WillOnce(Return(&supported_languages));
+ .WillOnce(Return(supported_languages_.get()));
EXPECT_CALL(hmi_capabilities_, vr_supported_languages())
- .WillOnce(Return(&supported_languages));
+ .WillOnce(Return(supported_languages_.get()));
EXPECT_CALL(hmi_capabilities_, tts_supported_languages())
- .WillOnce(Return(&supported_languages));
+ .WillOnce(Return(supported_languages_.get()));
EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(hmi_interfaces_));
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
EXPECT_CALL(
- hmi_interfaces_,
+ mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- EXPECT_CALL(hmi_interfaces_,
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
EXPECT_CALL(
- hmi_interfaces_,
+ mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- EXPECT_CALL(hmi_interfaces_,
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
+ EXPECT_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
EXPECT_CALL(
- hmi_interfaces_,
+ mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
- .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- EXPECT_CALL(hmi_interfaces_,
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ EXPECT_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
}
void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
@@ -145,14 +145,11 @@ class ChangeRegistrationRequestTest
const am::HmiInterfaces::InterfaceState state,
const bool success,
const hmi_apis::Common_Result::eType ui_hmi_response =
- hmi_apis::Common_Result::WARNINGS,
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
const hmi_apis::Common_Result::eType vr_hmi_response =
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
- ON_CALL(mock_message_helper_, HMIToMobileResult(_))
- .WillByDefault(Return(mobile_response));
-
utils::SharedPtr<ChangeRegistrationRequest> command =
CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
MockAppPtr mock_app = CreateMockApp();
@@ -170,6 +167,8 @@ class ChangeRegistrationRequestTest
EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
PrepareExpectationBeforeRun();
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
command->Run();
MessageSharedPtr ui_response = CreateMessage(smart_objects::SmartType_Map);
@@ -181,12 +180,6 @@ class ChangeRegistrationRequestTest
(*tts_response)[strings::params][hmi_response::code] = hmi_response;
(*tts_response)[strings::msg_params] = 0;
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
- .WillRepeatedly(Return(state));
-
am::event_engine::Event event_ui(
hmi_apis::FunctionID::UI_ChangeRegistration);
event_ui.set_smart_object(*ui_response);
@@ -247,16 +240,10 @@ class ChangeRegistrationRequestTest
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
ON_CALL(app_mngr_, hmi_capabilities())
.WillByDefault(ReturnRef(hmi_capabilities_));
}
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
- }
-
void ExpectationsHmiCapabilities(
smart_objects::SmartObjectSPtr supported_languages) {
EXPECT_CALL(hmi_capabilities_, ui_supported_languages())
@@ -284,9 +271,9 @@ class ChangeRegistrationRequestTest
MockHMICapabilities;
sync_primitives::Lock app_set_lock_;
MockHMICapabilities hmi_capabilities_;
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
MockAppPtr mock_app_;
+ MessageSharedPtr supported_languages_;
+ MockPolicyHandlerInterface mock_policy_handler_;
};
typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities;
@@ -294,9 +281,9 @@ typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities;
TEST_F(ChangeRegistrationRequestTest,
OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
-
utils::SharedPtr<ChangeRegistrationRequest> command =
CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+
am::ApplicationSet application_set;
const utils::custom_string::CustomString name("name");
MockAppPtr app = CreateMockApp();
@@ -316,25 +303,25 @@ TEST_F(ChangeRegistrationRequestTest,
ExpectationsHmiCapabilities(supported_languages);
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
ON_CALL(
- hmi_interfaces_,
+ mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
.WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
command->Run();
@@ -361,10 +348,7 @@ TEST_F(ChangeRegistrationRequestTest,
hmi_apis::FunctionID::TTS_ChangeRegistration);
event_tts.set_smart_object(*tts_response);
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
MessageSharedPtr response_to_mobile;
@@ -383,11 +367,52 @@ TEST_F(ChangeRegistrationRequestTest,
}
TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_true) {
- CheckExpectations(hmi_apis::Common_Result::SUCCESS,
- mobile_apis::Result::UNSUPPORTED_RESOURCE,
- am::HmiInterfaces::STATE_NOT_AVAILABLE,
- true);
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) {
+ MessageSharedPtr msg_from_mobile = CreateMsgFromMobile();
+ utils::SharedPtr<ChangeRegistrationRequest> command =
+ CreateCommand<ChangeRegistrationRequest>(msg_from_mobile);
+ MockAppPtr mock_app = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
+ ON_CALL(*mock_app, app_id()).WillByDefault(Return(1));
+ am::ApplicationSet application_set;
+ const utils::custom_string::CustomString name("name");
+ MockAppPtr app = CreateMockApp();
+ app->set_name(name);
+ DataAccessor<am::ApplicationSet> accessor(application_set, app_set_lock_);
+ application_set.insert(app);
+ EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ EXPECT_CALL(*app, name()).WillOnce(ReturnRef(name));
+
+ ON_CALL(app_mngr_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities_));
+ (*supported_languages_)[0] =
+ static_cast<int32_t>(mobile_apis::Language::EN_US);
+ EXPECT_CALL(hmi_capabilities_, ui_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(hmi_capabilities_, vr_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+ EXPECT_CALL(hmi_capabilities_, tts_supported_languages())
+ .WillOnce(Return(supported_languages_.get()));
+
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr response_to_mobile;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+ command->Run();
+
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[strings::msg_params][strings::result_code].asInt(),
+ static_cast<int32_t>(mobile_apis::Result::UNSUPPORTED_RESOURCE));
}
TEST_F(ChangeRegistrationRequestTest,
@@ -407,17 +432,17 @@ TEST_F(ChangeRegistrationRequestTest,
}
TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_UNSUPPORTED_RESOURCE_SUCCESS_STATE_AVAILABLE_Expect_false) {
+ OnEvent_TTS_UNSUPPORTED_RESOURCE_SUCCESS_STATE_AVAILABLE_Expect_true) {
CheckExpectations(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE,
mobile_apis::Result::UNSUPPORTED_RESOURCE,
am::HmiInterfaces::STATE_AVAILABLE,
- false,
+ true,
hmi_apis::Common_Result::SUCCESS,
hmi_apis::Common_Result::SUCCESS);
}
TEST_F(ChangeRegistrationRequestTest,
- OnEvent_TTS_SUCCESS_STATE_AVAILABLE_Expect_false) {
+ OnEvent_TTS_SUCCESS_STATE_AVAILABLE_Expect_true) {
CheckExpectations(hmi_apis::Common_Result::SUCCESS,
mobile_apis::Result::SUCCESS,
am::HmiInterfaces::STATE_AVAILABLE,
@@ -429,7 +454,7 @@ TEST_F(ChangeRegistrationRequestTest,
TEST_F(ChangeRegistrationRequestTest,
OnEvent_TTS_WRONG_LANGUAGE_STATE_AVAILABLE_Expect_true) {
CheckExpectations(hmi_apis::Common_Result::WRONG_LANGUAGE,
- mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::WRONG_LANGUAGE,
am::HmiInterfaces::STATE_AVAILABLE,
true,
hmi_apis::Common_Result::SUCCESS,
@@ -439,7 +464,7 @@ TEST_F(ChangeRegistrationRequestTest,
TEST_F(ChangeRegistrationRequestTest,
OnEvent_TTS_INVALID_DATA_STATE_AVAILABLE_Expect_false) {
CheckExpectations(hmi_apis::Common_Result::INVALID_DATA,
- mobile_apis::Result::SUCCESS,
+ mobile_apis::Result::INVALID_DATA,
am::HmiInterfaces::STATE_AVAILABLE,
false,
hmi_apis::Common_Result::SUCCESS,
@@ -472,27 +497,27 @@ TEST_F(ChangeRegistrationRequestTest,
ExpectationsHmiCapabilities(supported_languages);
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration))
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration))
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
ON_CALL(
- hmi_interfaces_,
+ mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration))
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
command->Run();
@@ -534,6 +559,7 @@ TEST_F(ChangeRegistrationRequestTest,
}
} // namespace change_registration_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
index 138723b0c3..c3513d2acb 100644
--- a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
+++ b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc
@@ -35,6 +35,7 @@
#include <set>
#include "application_manager/commands/mobile/create_interaction_choice_set_request.h"
+#include "application_manager/commands/mobile/create_interaction_choice_set_response.h"
#include "gtest/gtest.h"
#include "utils/shared_ptr.h"
@@ -49,10 +50,12 @@
#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_hmi_capabilities.h"
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace create_interaction_choice_set_request {
namespace am = application_manager;
@@ -61,19 +64,28 @@ using am::ApplicationManager;
using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::testing::_;
-using ::testing::Mock;
using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::AtLeast;
using am::commands::CreateInteractionChoiceSetRequest;
+using am::commands::CreateInteractionChoiceSetResponse;
using ::test::components::application_manager_test::MockApplication;
namespace custom_str = utils::custom_string;
namespace strings = ::application_manager::strings;
namespace hmi_response = ::application_manager::hmi_response;
+typedef SharedPtr<CreateInteractionChoiceSetRequest>
+ CreateInteractionChoiceSetRequestPtr;
+typedef SharedPtr<CreateInteractionChoiceSetResponse>
+ CreateInteractionChoiceSetResponsePtr;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
namespace {
const hmi_apis::FunctionID::eType kInvalidFunctionId =
hmi_apis::FunctionID::INVALID_ENUM;
@@ -81,12 +93,27 @@ const int32_t kCommandId = 1;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kGrammarId = 10u;
+const int32_t kMenuId = 5;
+const uint32_t kChoiceSetId = 1u;
+const uint32_t kChoiceId1 = 2u;
+const uint32_t kChoiceId2 = 3u;
+const std::string kImage = "image";
+const std::string kSecondImage = "second_image";
+const std::string kVrCommands1 = "vr_commands_1";
+const std::string kVrCommands2 = "vr_commands_2";
+const std::string kMenuName = "menu_name";
+
} // namespace
class CreateInteractionChoiceSetRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- sync_primitives::Lock lock_;
+ CreateInteractionChoiceSetRequestTest()
+ : message_(CreateMessage())
+ , command_(CreateCommand<CreateInteractionChoiceSetRequest>(message_))
+ , mock_app_(CreateMockApp()) {}
MessageSharedPtr CreateFullParamsVRSO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -104,7 +131,39 @@ class CreateInteractionChoiceSetRequestTest
return msg;
}
+
+ void FillMessageFieldsItem1(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ }
+ void FillMessageFieldsItem2(MessageSharedPtr message) {
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands2;
+ (*message)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id] = kChoiceSetId;
+ }
+
+ MessageSharedPtr message_;
+ CreateInteractionChoiceSetRequestPtr command_;
+ MockAppPtr mock_app_;
+ sync_primitives::Lock lock_;
};
+
+class CreateInteractionChoiceSetResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) {
MessageSharedPtr msg_vr = CreateMessage(smart_objects::SmartType_Map);
(*msg_vr)[strings::msg_params][strings::result_code] =
@@ -145,11 +204,10 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
utils::SharedPtr<CreateInteractionChoiceSetRequest> req_vr =
CreateCommand<CreateInteractionChoiceSetRequest>(msg_vr);
- MockAppPtr mock_app = CreateMockApp();
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
- ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
smart_objects::SmartObject* null_obj = NULL;
- ON_CALL(*mock_app, FindChoiceSet(_)).WillByDefault(Return(null_obj));
+ ON_CALL(*mock_app_, FindChoiceSet(_)).WillByDefault(Return(null_obj));
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[strings::params][hmi_response::code] =
@@ -161,25 +219,18 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
event.set_smart_object(*msg);
smart_objects::SmartObject* ptr = NULL;
- ON_CALL(*mock_app, FindCommand(kCmdId)).WillByDefault(Return(ptr));
+ ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr));
EXPECT_EQ(NULL, ptr);
- MockMessageHelper* mock_message_helper =
- MockMessageHelper::message_helper_mock();
- ON_CALL(*mock_message_helper, HMIToMobileResult(_))
- .WillByDefault(Return(mobile_apis::Result::SUCCESS));
-
am::CommandsMap commands_map;
- ON_CALL(*mock_app, commands_map())
+ ON_CALL(*mock_app_, commands_map())
.WillByDefault(
Return(DataAccessor<am::CommandsMap>(commands_map, lock_)));
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- ON_CALL(hmi_interfaces, GetInterfaceFromFunction(_))
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
.WillByDefault(
Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
- ON_CALL(hmi_interfaces, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
req_vr->Run();
@@ -205,7 +256,559 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) {
}
}
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_VerifyImageFail_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image] = kSecondImage;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::INVALID_DATA));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* invalid_choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(invalid_choice_set_id));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_CheckChoiceSet_InvalidChoiceId_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+
+ FillMessageFieldsItem2(message_);
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][1] = " kVrCommands2\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands1;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_IsWhiteSpaceVRCommandsExist_InvalidMenuName_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = "menu_name\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_text] = "secondary_text\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::tertiary_text] = "tertiary_text\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = "image\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] =
+ "second_image\t";
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = "vr_commands_1\t";
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::menu_name)) {
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::secondary_text)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::tertiary_text)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_text] = "secondary_text";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::vr_commands)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::tertiary_text] = "tertiary_text";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::image)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = "vr_commands";
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+ if ((*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ .keyExists(am::strings::secondary_image)) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ CreateInteractionChoiceSetRequestPtr command(
+ CreateCommand<CreateInteractionChoiceSetRequest>(message_));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0);
+ command->Run();
+ }
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_ValidAmountVrCommands_SUCCESS) {
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .Times(AtLeast(2))
+ .WillOnce(Return(kConnectionKey))
+ .WillOnce(Return(kConnectionKey));
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ Run_EmptyAmountVrCommands_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::image][am::strings::value] = kImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::secondary_image][am::strings::value] = kSecondImage;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::vr_commands][0] = kVrCommands1;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::choice_id] = kChoiceId2;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::menu_name] = kMenuName;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][1]
+ [am::strings::vr_commands][0] = kVrCommands2;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ command_->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InvalidEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InvalidVrCommand_UNSUCCESS) {
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ command_->Run();
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_InValidVrNoError_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_DATA;
+
+ FillMessageFieldsItem1(message_);
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ command_->Run();
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnEvent_ValidVrNoErrorAndExpectedChoiceLessThanReceiveChoice_SUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::WARNINGS;
+
+ FillMessageFieldsItem1(message_);
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_InvalidErrorFromHMI_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
+ am::commands::Command::ORIGIN_SDL));
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_ValidErrorFromHMI_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_ENUM;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(kChoiceSetId));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::INVALID_ENUM;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(2);
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(_)).Times(0);
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest,
+ OnTimeOut_SuccessfulResponseReceived_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ FillMessageFieldsItem1(message_);
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::SUCCESS));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _));
+
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+ event.set_smart_object(*message_);
+
+ command_->on_event(event);
+
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, RemoveChoiceSet(_));
+
+ command_->onTimeOut();
+}
+
+TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::success] = false;
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::INVALID_ENUM;
+ CreateInteractionChoiceSetResponsePtr command(
+ CreateCommand<CreateInteractionChoiceSetResponse>(message));
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(message, false));
+ command->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetResponseTest, Run_SuccessTrue_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::success] = true;
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+ CreateInteractionChoiceSetResponsePtr command(
+ CreateCommand<CreateInteractionChoiceSetResponse>(message));
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(message, false));
+ command->Run();
+}
+
+TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::VR_AddCommand);
+
+ (*message_)[am::strings::params][am::strings::correlation_id] =
+ kCorrelationId;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+
+ FillMessageFieldsItem1(message_);
+
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _))
+ .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId))
+ .WillRepeatedly(Return(choice_set_id));
+
+ EXPECT_CALL(app_mngr_, GenerateGrammarID())
+ .WillRepeatedly(Return(kGrammarId));
+ EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(2);
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ command_->Run();
+
+ FillMessageFieldsItem2(message_);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR),
+ am::commands::Command::ORIGIN_SDL));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _));
+ event.set_smart_object(*message_);
+ command_->on_event(event);
+ command_->Run();
+}
+
} // namespace create_interaction_choice_set_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc
index 1e03dcaaf1..c92ec81a1f 100644
--- a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc
@@ -53,7 +53,6 @@ namespace mobile_commands_test {
namespace delete_command_request {
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
namespace am = ::application_manager;
@@ -75,9 +74,7 @@ const uint32_t kConnectionKey = 2u;
class DeleteCommandRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- DeleteCommandRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ DeleteCommandRequestTest() : mock_app_(CreateMockApp()) {}
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
@@ -134,12 +131,7 @@ class DeleteCommandRequestTest
.WillByDefault(ReturnRef(hmi_interfaces_));
}
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
- }
-
NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
MockAppPtr mock_app_;
};
@@ -162,10 +154,10 @@ TEST_F(DeleteCommandRequestTest,
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR));
ON_CALL(hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
ON_CALL(hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
ON_CALL(*mock_app_, FindCommand(kCommandId))
.WillByDefault(Return(test_msg.get()));
ON_CALL(*mock_app_, get_grammar_id()).WillByDefault(Return(kConnectionKey));
@@ -175,7 +167,7 @@ TEST_F(DeleteCommandRequestTest,
hmi_apis::Common_Result::SUCCESS;
Event event_ui(hmi_apis::FunctionID::UI_DeleteCommand);
event_ui.set_smart_object(*msg);
-
+ command->Init();
command->Run();
command->on_event(event_ui);
@@ -222,10 +214,10 @@ TEST_F(DeleteCommandRequestTest,
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
ON_CALL(hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
ON_CALL(hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
ON_CALL(*app, FindCommand(kCommandId)).WillByDefault(Return(test_msg.get()));
ON_CALL(*app, get_grammar_id()).WillByDefault(Return(kConnectionKey));
@@ -235,6 +227,7 @@ TEST_F(DeleteCommandRequestTest,
Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand);
event_vr.set_smart_object(*msg);
+ command->Init();
command->Run();
command->on_event(event_vr);
diff --git a/src/components/application_manager/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/test/commands/mobile/delete_file_test.cc
new file mode 100644
index 0000000000..3692f7298e
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/delete_file_test.cc
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <vector>
+#include <string>
+#include <map>
+
+#include "mobile/delete_file_request.h"
+#include "mobile/delete_file_response.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+#include "application_manager/mock_application_manager_settings.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/policies/policy_handler.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_file {
+
+using ::testing::_;
+using ::testing::Test;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SetArgReferee;
+using ::testing::AtLeast;
+namespace am = ::application_manager;
+using am::commands::DeleteFileRequest;
+using am::commands::DeleteFileResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef SharedPtr<DeleteFileRequest> DeleteFileRequestPtr;
+typedef SharedPtr<DeleteFileResponse> DeleteFileResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+ACTION_TEMPLATE(SetArgPointer,
+ HAS_1_TEMPLATE_PARAMS(int, k),
+ AND_1_VALUE_PARAMS(vec)) {
+ *std::tr1::get<k>(args) = *vec;
+}
+
+MATCHER_P(CheckMessageResultCode, result_code, "") {
+ return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ result_code;
+}
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kCorrelationId = 10u;
+const int32_t kMenuId = 5;
+} // namespace
+
+class DeleteFileRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteFileRequest>(message_);
+ mock_app_ = CreateMockApp();
+ }
+ DeleteFileRequestPtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr mock_app_;
+};
+
+class DeleteFileResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(DeleteFileRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(app_mngr_, get_settings()).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_HMILevelNone_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const uint32_t num = 0;
+ EXPECT_CALL(app_mngr_settings_, delete_file_in_none())
+ .WillOnce(ReturnRef(num));
+ EXPECT_CALL(*mock_app_, delete_file_in_none_count()).WillOnce(Return(1));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::REJECTED),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) {
+ const std::string file_name = "test_file.txt";
+ EXPECT_TRUE(file_system::CreateFile(file_name));
+ (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kFullFilePath));
+
+ am::AppFile file;
+ file.file_name = file_name;
+ file.file_type = mobile_apis::FileType::BINARY;
+
+ EXPECT_CALL(*mock_app_, GetFile(_)).WillOnce(Return(&file));
+ EXPECT_CALL(*mock_app_, DeleteFile(_));
+ EXPECT_CALL(*mock_app_, increment_delete_file_in_none_count());
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(CheckMessageResultCode(mobile_apis::Result::SUCCESS),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteFileRequestTest, Run_InvalidFile_UNSUCCESS) {
+ const std::string file_name = "test_file.txt";
+ (*message_)[am::strings::msg_params][am::strings::sync_file_name] = file_name;
+
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillOnce(ReturnRef(app_mngr_settings_));
+ const std::string kFullFilePath = file_system::CurrentWorkingDirectory();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kFullFilePath));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::REJECTED),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ command_->Run();
+}
+
+TEST_F(DeleteFileResponseTest, Run_InvalidApp_UNSUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(CheckMessageResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ false));
+
+ command->Run();
+}
+
+TEST_F(DeleteFileResponseTest, Run_ValidApp_SUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*message)[am::strings::msg_params][am::strings::success] = true;
+
+ DeleteFileResponsePtr command = CreateCommand<DeleteFileResponse>(message);
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
+ const uint32_t kAvailableDiskSpace = 10u;
+ EXPECT_CALL(*app, GetAvailableDiskSpace())
+ .WillOnce(Return(kAvailableDiskSpace));
+
+ EXPECT_CALL(app_mngr_,
+ SendMessageToMobile(
+ CheckMessageResultCode(mobile_apis::Result::SUCCESS), _));
+
+ command->Run();
+}
+
+} // namespace delete_file
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc
new file mode 100644
index 0000000000..192cad12b0
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <map>
+
+#include "mobile/delete_interaction_choice_set_request.h"
+#include "mobile/delete_interaction_choice_set_response.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace delete_interaction_choice_set {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::InSequence;
+
+namespace am = ::application_manager;
+
+using am::commands::DeleteInteractionChoiceSetRequest;
+using am::commands::DeleteInteractionChoiceSetResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+
+typedef SharedPtr<DeleteInteractionChoiceSetRequest>
+ DeleteInteractionChoiceSetRequestPtr;
+typedef SharedPtr<DeleteInteractionChoiceSetResponse>
+ DeleteInteractionChoiceSetResponsePtr;
+
+MATCHER_P(CheckMessageSuccess, success, "") {
+ return success ==
+ (*arg)[am::strings::msg_params][am::strings::success].asBool();
+}
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kChoiceSetId = 11u;
+const uint32_t kChoiceId = 110u;
+const uint32_t kGrammarId = 101u;
+} // namespace
+
+class DeleteInteractionChoiceSetRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ DeleteInteractionChoiceSetRequestTest()
+ : accessor_(choice_set_map_, performinteraction_choice_set_lock_) {}
+
+ ~DeleteInteractionChoiceSetRequestTest() {
+ // Fix DataAccessor release and WinQt crash
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
+
+ am::PerformChoiceSetMap choice_set_map_;
+ mutable sync_primitives::Lock performinteraction_choice_set_lock_;
+ DataAccessor<am::PerformChoiceSetMap> accessor_;
+
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+ app_ = CreateMockApp();
+ }
+
+ DeleteInteractionChoiceSetRequestPtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr app_;
+};
+
+class DeleteInteractionChoiceSetResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ protected:
+ void SetUp() OVERRIDE {
+ message_ = CreateMessage();
+ command_ = CreateCommand<DeleteInteractionChoiceSetResponse>(message_);
+ app_ = CreateMockApp();
+ }
+ DeleteInteractionChoiceSetResponsePtr command_;
+ MessageSharedPtr message_;
+ MockAppPtr app_;
+};
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_, FindChoiceSet(_)).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ smart_objects::SmartObject* choice_set_id = NULL;
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_ChoiceSetInUse_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+
+ choice_set_map_[0].insert(
+ std::make_pair(kChoiceSetId,
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id])));
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(true));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map())
+ .WillOnce(Return(accessor_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest,
+ Run_SendVrDeleteCommand_PerformInteractionFalse_UNSUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]
+ [am::strings::interaction_choice_set_id]);
+ smart_objects::SmartObject* invalid_choice_set_id = NULL;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app_));
+
+ InSequence seq;
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(invalid_choice_set_id));
+
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
+ EXPECT_CALL(*app_, UpdateHash());
+
+ DeleteInteractionChoiceSetRequestPtr command =
+ CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] =
+ kChoiceSetId;
+ (*message_)[am::strings::msg_params][am::strings::grammar_id] = kGrammarId;
+ (*message_)[am::strings::msg_params][am::strings::choice_set][0]
+ [am::strings::choice_id] = kChoiceId;
+ smart_objects::SmartObject* choice_set_id =
+ &((*message_)[am::strings::msg_params]);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app_));
+
+ InSequence seq;
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+ EXPECT_CALL(*app_, is_perform_interaction_active()).WillOnce(Return(false));
+ EXPECT_CALL(*app_, performinteraction_choice_set_map()).Times(0);
+
+ EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId))
+ .WillOnce(Return(choice_set_id));
+
+ EXPECT_CALL(*app_, app_id())
+ .WillOnce(Return(kConnectionKey))
+ .WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId));
+ EXPECT_CALL(*app_, UpdateHash());
+
+ DeleteInteractionChoiceSetRequestPtr command =
+ CreateCommand<DeleteInteractionChoiceSetRequest>(message_);
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::success] = false;
+
+ EXPECT_CALL(app_mngr_,
+ SendMessageToMobile(CheckMessageSuccess(false), false));
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest, Run_ValidResultCode_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::result_code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageSuccess(true), false));
+ command_->Run();
+}
+
+TEST_F(DeleteInteractionChoiceSetResponseTest,
+ Run_InvalidResultCode_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::result_code] =
+ hmi_apis::Common_Result::INVALID_ENUM;
+
+ EXPECT_CALL(app_mngr_,
+ SendMessageToMobile(CheckMessageSuccess(false), false));
+ command_->Run();
+}
+
+} // namespace delete_interaction_choice_set
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc
index 36c4614343..cc21e5366e 100644
--- a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc
+++ b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc
@@ -34,6 +34,7 @@
#include <string>
#include "application_manager/commands/mobile/delete_sub_menu_request.h"
+#include "application_manager/commands/mobile/delete_sub_menu_response.h"
#include "gtest/gtest.h"
#include "application_manager/commands/command_request_test.h"
@@ -47,34 +48,71 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace delete_sub_menu_request {
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::InSequence;
namespace am = ::application_manager;
-using am::commands::DeleteSubMenuRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
using am::MockHmiInterfaces;
using am::MockMessageHelper;
-typedef SharedPtr<DeleteSubMenuRequest> AddSubMenuPtr;
+using am::commands::DeleteSubMenuRequest;
+using am::commands::DeleteSubMenuResponse;
+
+typedef SharedPtr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr;
+typedef SharedPtr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr;
+
+MATCHER_P(CheckMessageResultCode, result_code, "") {
+ return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() ==
+ result_code;
+}
+
+MATCHER_P(CheckMessageConnectionKey, connection_key, "") {
+ return (*arg)[am::strings::msg_params][am::strings::connection_key].asInt() ==
+ connection_key;
+}
+
+ACTION_P(DeleteCommand, commands_map) {
+ am::CommandsMap::iterator it = (*commands_map).begin();
+ if ((*commands_map).end() != it) {
+ (*commands_map).erase(it);
+ }
+}
namespace {
const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kMenuId = 100u;
+const uint32_t kGrammarId = 101u;
+const int32_t kCmdId = 102;
} // namespace
class DeleteSubMenuRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
DeleteSubMenuRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
- MockMessageHelper& mock_message_helper_;
- sync_primitives::Lock lock_;
+ : accessor_(commands_map_, commands_lock_)
+ , message_(CreateMessage())
+ , command_(CreateCommand<DeleteSubMenuRequest>(message_))
+ , app_(CreateMockApp()) {}
+
+ am::CommandsMap commands_map_;
+ mutable sync_primitives::Lock commands_lock_;
+ DataAccessor<am::CommandsMap> accessor_;
+
+ MessageSharedPtr message_;
+ DeleteSubMenuRequestPtr command_;
+ MockAppPtr app_;
};
-TEST_F(DeleteSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
+class DeleteSubMenuResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
(*msg)[am::strings::msg_params][am::strings::menu_id] = 10u;
@@ -102,14 +140,11 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
am::CommandsMap commands_map;
smart_objects::SmartObject commands_msg(smart_objects::SmartType_Map);
commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &commands_msg));
- DataAccessor<am::CommandsMap> accessor(commands_map, lock_);
+ sync_primitives::Lock lock;
+ DataAccessor<am::CommandsMap> accessor(commands_map, lock);
EXPECT_CALL(*mock_app, commands_map())
.WillOnce(Return(accessor))
.WillOnce(Return(accessor));
@@ -136,9 +171,167 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.asString()
.empty());
}
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
+TEST_F(DeleteSubMenuRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(CheckMessageResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_, FindSubMenu(_)).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_FindSubMenuFalse_UNSUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* invalid_sub_menu = NULL;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(invalid_sub_menu));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ CheckMessageResultCode(mobile_apis::Result::INVALID_ID),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ EXPECT_CALL(*app_, app_id()).Times(0);
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, Run_SendHMIRequest_SUCCESS) {
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ smart_objects::SmartObject* sub_menu =
+ &((*message_)[am::strings::msg_params][am::strings::menu_id]);
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_));
+ EXPECT_CALL(*app_, FindSubMenu(kMenuId)).WillOnce(Return(sub_menu));
+
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ command_->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_UnknownEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ event.set_smart_object(*message_);
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(*app_, RemoveSubMenu(_)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::msg_params][am::strings::vr_commands] =
+ "vr_commands";
+ (*message_)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
+ (*message_)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = kMenuId;
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*message_)[am::strings::params][am::hmi_response::code] = result_code;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+
+ InSequence seq;
+ EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId));
+
+ EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_));
+ EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey));
+ EXPECT_CALL(*app_, RemoveCommand(_)).WillOnce(DeleteCommand(&commands_map_));
+
+ EXPECT_CALL(*app_, RemoveSubMenu(_));
+ EXPECT_CALL(*app_, UpdateHash());
+
+ DeleteSubMenuRequestPtr command =
+ CreateCommand<DeleteSubMenuRequest>(message_);
+
+ command->Init();
+ command->on_event(event);
+}
+
+TEST_F(DeleteSubMenuResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ (*message)[am::strings::msg_params][am::strings::connection_key] =
+ kConnectionKey;
+ DeleteSubMenuResponsePtr command(
+ CreateCommand<DeleteSubMenuResponse>(message));
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(CheckMessageConnectionKey(kConnectionKey), _));
+ command->Run();
+}
+
+TEST_F(DeleteSubMenuRequestTest,
+ DeleteSubmenu_CommandhaventVrCommadsAndMenuParams_DontSendHMIRequest) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ am::mobile_api::Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
+ EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+
+ command_->on_event(event);
+}
+
+TEST_F(DeleteSubMenuRequestTest,
+ DeleteSubmenu_NotAChildOfMenupartam_DontSendHMIRequest) {
+ Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
+ (*message_)[am::strings::msg_params][am::strings::menu_id] = kMenuId;
+ (*message_)[am::strings::msg_params][am::strings::menu_params]
+ [am::hmi_request::parent_id] = kMenuId + 1;
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ am::mobile_api::Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ commands_map_.insert(
+ std::make_pair(0, &((*message_)[am::strings::msg_params])));
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_));
+ EXPECT_CALL(*app_, RemoveCommand(_)).Times(0);
+
+ command_->on_event(event);
+}
+
+} // namespace delete_sub_menu_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
index ff8098b228..4f46a6f715 100644
--- a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc
@@ -44,6 +44,7 @@
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/commands/mobile/diagnostic_message_request.h"
#include "interfaces/MOBILE_API.h"
@@ -51,6 +52,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace diagnostic_message_request {
using ::testing::_;
using ::testing::Return;
@@ -176,6 +178,7 @@ TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) {
command->on_event(event);
}
+} // namespace diagnostic_message_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
index 6f51b4f421..33c84d305a 100644
--- a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc
@@ -51,6 +51,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace dial_number_request {
using ::testing::_;
using ::testing::Return;
@@ -155,15 +156,6 @@ TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
}
TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
- MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
- (*command_msg)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
-
- DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
-
- MockAppPtr app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
-
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
(*event_msg)[am::strings::params][am::hmi_response::code] =
mobile_apis::Result::SUCCESS;
@@ -172,13 +164,23 @@ TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) {
Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber);
event.set_smart_object(*event_msg);
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app));
+
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ DialNumberRequestPtr command(CreateCommand<DialNumberRequest>(command_msg));
command->on_event(event);
}
+} // namespace dial_number_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc
new file mode 100644
index 0000000000..27a8499c09
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/dummy_mobile_commands_test.cc
@@ -0,0 +1,342 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "commands/command_request_test.h"
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+#include "gtest/gtest.h"
+
+#include "mobile/add_command_request.h"
+#include "mobile/add_command_response.h"
+#include "mobile/add_sub_menu_request.h"
+#include "mobile/add_sub_menu_response.h"
+#include "mobile/alert_maneuver_request.h"
+#include "mobile/alert_maneuver_response.h"
+#include "mobile/alert_request.h"
+#include "mobile/alert_response.h"
+#include "mobile/change_registration_request.h"
+#include "mobile/change_registration_response.h"
+#include "mobile/create_interaction_choice_set_request.h"
+#include "mobile/create_interaction_choice_set_response.h"
+#include "mobile/delete_command_request.h"
+#include "mobile/delete_command_response.h"
+#include "mobile/delete_file_request.h"
+#include "mobile/delete_file_response.h"
+#include "mobile/delete_interaction_choice_set_request.h"
+#include "mobile/delete_interaction_choice_set_response.h"
+#include "mobile/delete_sub_menu_request.h"
+#include "mobile/delete_sub_menu_response.h"
+#include "mobile/diagnostic_message_request.h"
+#include "mobile/diagnostic_message_response.h"
+#include "mobile/dial_number_request.h"
+#include "mobile/dial_number_response.h"
+#include "mobile/end_audio_pass_thru_request.h"
+#include "mobile/end_audio_pass_thru_response.h"
+#include "mobile/generic_response.h"
+#include "mobile/get_dtcs_request.h"
+#include "mobile/get_dtcs_response.h"
+#include "mobile/get_vehicle_data_request.h"
+#include "mobile/get_vehicle_data_response.h"
+#include "mobile/get_way_points_request.h"
+#include "mobile/get_way_points_response.h"
+#include "mobile/list_files_request.h"
+#include "mobile/list_files_response.h"
+#include "mobile/on_app_interface_unregistered_notification.h"
+#include "mobile/on_audio_pass_thru_notification.h"
+#include "mobile/on_button_event_notification.h"
+#include "mobile/on_button_press_notification.h"
+#include "mobile/on_command_notification.h"
+#include "mobile/on_driver_distraction_notification.h"
+#include "mobile/on_hash_change_notification.h"
+#include "mobile/on_hmi_status_notification.h"
+#include "mobile/on_hmi_status_notification_from_mobile.h"
+#include "mobile/on_keyboard_input_notification.h"
+#include "mobile/on_language_change_notification.h"
+#include "mobile/on_permissions_change_notification.h"
+#include "mobile/on_system_request_notification.h"
+#include "mobile/on_tbt_client_state_notification.h"
+#include "mobile/on_touch_event_notification.h"
+#include "mobile/on_vehicle_data_notification.h"
+#include "mobile/on_way_point_change_notification.h"
+#include "mobile/perform_audio_pass_thru_request.h"
+#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/perform_interaction_request.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/put_file_request.h"
+#include "mobile/put_file_response.h"
+#include "mobile/read_did_request.h"
+#include "mobile/read_did_response.h"
+#include "mobile/register_app_interface_request.h"
+#include "mobile/register_app_interface_response.h"
+#include "mobile/reset_global_properties_request.h"
+#include "mobile/reset_global_properties_response.h"
+#include "mobile/scrollable_message_request.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/send_location_request.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_request.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_request.h"
+#include "mobile/set_display_layout_response.h"
+#include "mobile/set_global_properties_request.h"
+#include "mobile/set_global_properties_response.h"
+#include "mobile/set_media_clock_timer_request.h"
+#include "mobile/set_media_clock_timer_response.h"
+#include "mobile/show_constant_tbt_request.h"
+#include "mobile/show_constant_tbt_response.h"
+#include "mobile/show_request.h"
+#include "mobile/show_response.h"
+#include "mobile/slider_request.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_request.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_button_request.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/subscribe_vehicle_data_request.h"
+#include "mobile/subscribe_vehicle_data_response.h"
+#include "mobile/subscribe_way_points_request.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/unregister_app_interface_request.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_request.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_vehicle_data_request.h"
+#include "mobile/unsubscribe_vehicle_data_response.h"
+#include "mobile/unsubscribe_way_points_request.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_request.h"
+#include "mobile/update_turn_list_response.h"
+
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace am = application_manager;
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace dummy_mobile_commands_test {
+
+namespace commands = ::application_manager::commands;
+
+using ::testing::_;
+using ::testing::NotNull;
+using ::testing::Types;
+using commands::MessageSharedPtr;
+using ::test::components::event_engine_test::MockEventDispatcher;
+using ::test::components::application_manager_test::MockApplicationManager;
+using ::test::components::application_manager_test::
+ MockApplicationManagerSettings;
+using ::application_manager::ApplicationSharedPtr;
+using ::test::components::application_manager_test::MockApplication;
+
+namespace {
+const std::string kEmptyString_ = "";
+} // namespace
+
+template <class Command>
+class MobileCommandsTest : public components::commands_test::CommandRequestTest<
+ CommandsTestMocks::kIsNice> {
+ public:
+ typedef Command CommandType;
+
+ void InitCommand(const uint32_t& timeout) OVERRIDE {
+ EXPECT_CALL(app_mngr_settings_, default_timeout())
+ .WillOnce(ReturnRef(timeout));
+ ON_CALL(app_mngr_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ON_CALL(app_mngr_, get_settings())
+ .WillByDefault(ReturnRef(app_mngr_settings_));
+ ON_CALL(app_mngr_settings_, app_icons_folder())
+ .WillByDefault(ReturnRef(kEmptyString_));
+ }
+};
+
+template <class Command>
+class MobileCommandsTestFirst : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class MobileCommandsTestSecond : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+template <class Command>
+class MobileCommandsTestThird : public MobileCommandsTest<Command> {
+ public:
+ using typename MobileCommandsTest<Command>::CommandType;
+};
+
+/* macro TYPED_TEST_CASE takes max 50 args. That is why there are few
+ * TYPED_TEST_CASE for HMI and mobile commands
+ */
+
+typedef Types<commands::AddCommandRequest,
+ commands::AddCommandResponse,
+ commands::AddSubMenuRequest,
+ commands::AddSubMenuResponse,
+ commands::AlertManeuverRequest,
+ commands::AlertManeuverResponse,
+ commands::AlertRequest,
+ commands::AlertResponse,
+ commands::ChangeRegistrationRequest,
+ commands::ChangeRegistrationResponse,
+ commands::CreateInteractionChoiceSetRequest,
+ commands::CreateInteractionChoiceSetResponse,
+ commands::DeleteCommandRequest,
+ commands::DeleteCommandResponse,
+ commands::DeleteFileRequest,
+ commands::DeleteFileResponse,
+ commands::DeleteInteractionChoiceSetRequest,
+ commands::DeleteInteractionChoiceSetResponse,
+ commands::DeleteSubMenuRequest,
+ commands::DeleteSubMenuResponse,
+ commands::DiagnosticMessageRequest,
+ commands::DiagnosticMessageResponse,
+ commands::DialNumberRequest,
+ commands::DialNumberResponse,
+ commands::EndAudioPassThruRequest,
+ commands::EndAudioPassThruResponse,
+ commands::GenericResponse,
+ commands::GetDTCsRequest,
+ commands::GetDTCsResponse,
+ commands::GetVehicleDataRequest,
+ commands::GetVehicleDataResponse,
+ commands::GetWayPointsRequest,
+ commands::GetWayPointsResponse,
+ commands::ListFilesRequest,
+ commands::ListFilesResponse,
+ commands::OnAppInterfaceUnregisteredNotification,
+ commands::OnAudioPassThruNotification,
+ commands::mobile::OnButtonEventNotification,
+ commands::mobile::OnButtonPressNotification,
+ commands::OnCommandNotification,
+ commands::mobile::OnDriverDistractionNotification,
+ commands::mobile::OnHashChangeNotification,
+ commands::OnHMIStatusNotification,
+ commands::OnHMIStatusNotificationFromMobile,
+ commands::mobile::OnKeyBoardInputNotification,
+ commands::OnLanguageChangeNotification,
+ commands::OnPermissionsChangeNotification,
+ commands::mobile::OnSystemRequestNotification,
+ commands::OnTBTClientStateNotification,
+ commands::mobile::OnTouchEventNotification>
+ MobileCommandsListFirst;
+
+typedef Types<commands::OnVehicleDataNotification,
+ commands::OnWayPointChangeNotification,
+ commands::PerformAudioPassThruRequest,
+ commands::PerformAudioPassThruResponse,
+ commands::PerformInteractionRequest,
+ commands::PerformInteractionResponse,
+ commands::PutFileRequest,
+ commands::PutFileResponse,
+ commands::ReadDIDRequest,
+ commands::ReadDIDResponse,
+ commands::RegisterAppInterfaceRequest,
+ commands::RegisterAppInterfaceResponse,
+ commands::ResetGlobalPropertiesRequest,
+ commands::ResetGlobalPropertiesResponse,
+ commands::ScrollableMessageRequest,
+ commands::ScrollableMessageResponse,
+ commands::SendLocationRequest,
+ commands::SendLocationResponse,
+ commands::SetAppIconRequest,
+ commands::SetAppIconResponse,
+ commands::SetDisplayLayoutRequest,
+ commands::SetDisplayLayoutResponse,
+ commands::SetGlobalPropertiesRequest,
+ commands::SetGlobalPropertiesResponse,
+ commands::SetMediaClockRequest,
+ commands::SetMediaClockTimerResponse,
+ commands::ShowConstantTBTRequest,
+ commands::ShowConstantTBTResponse,
+ commands::ShowRequest,
+ commands::ShowResponse,
+ commands::SliderRequest,
+ commands::SliderResponse,
+ commands::SpeakRequest,
+ commands::SpeakResponse,
+ commands::SubscribeButtonRequest,
+ commands::SubscribeButtonResponse,
+ commands::SubscribeVehicleDataRequest,
+ commands::SubscribeVehicleDataResponse,
+ commands::SubscribeWayPointsRequest,
+ commands::SubscribeWayPointsResponse,
+ commands::SystemResponse,
+ commands::UnregisterAppInterfaceRequest,
+ commands::UnregisterAppInterfaceResponse,
+ commands::UnsubscribeButtonRequest,
+ commands::UnsubscribeButtonResponse,
+ commands::UnsubscribeVehicleDataRequest> MobileCommandsListSecond;
+
+typedef Types<commands::UnsubscribeVehicleDataResponse,
+ commands::UnSubscribeWayPointsRequest,
+ commands::UnsubscribeWayPointsResponse,
+ commands::UpdateTurnListRequest,
+ commands::UpdateTurnListResponse> MobileCommandsListThird;
+
+TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst);
+TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond);
+TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird);
+
+TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) {
+ utils::SharedPtr<typename TestFixture::CommandType> command =
+ this->template CreateCommand<typename TestFixture::CommandType>();
+ UNUSED(command);
+}
+
+} // namespace dummy_mobile_commands_test
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc
index 79a09c004e..33733f63ed 100644
--- a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc
@@ -49,27 +49,21 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace end_audio_pass_thru_request {
namespace am = ::application_manager;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
using am::commands::MessageSharedPtr;
using am::commands::EndAudioPassThruRequest;
using am::event_engine::Event;
-using am::MockHmiInterfaces;
using am::MockMessageHelper;
typedef SharedPtr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr;
class EndAudioPassThruRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- EndAudioPassThruRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
- MockMessageHelper& mock_message_helper_;
-};
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
const uint32_t kConnectionKey = 2u;
@@ -89,16 +83,6 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
Event event(hmi_apis::FunctionID::UI_EndAudioPassThru);
event.set_smart_object(*event_msg);
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- ON_CALL(hmi_interfaces,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
MessageSharedPtr ui_command_result;
@@ -107,6 +91,9 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
.WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
command->on_event(event);
EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
@@ -123,9 +110,9 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) {
.asString()
.empty());
}
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
+} // namespace end_audio_pass_thru_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
index 4552b1f033..106a59803b 100644
--- a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc
@@ -45,12 +45,14 @@
#include "application_manager/mock_application.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/commands/mobile/get_dtcs_request.h"
+#include "application_manager/mock_message_helper.h"
#include "interfaces/MOBILE_API.h"
namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace get_dtcs_request {
using ::testing::_;
using ::testing::Return;
@@ -58,12 +60,17 @@ namespace am = ::application_manager;
using am::commands::MessageSharedPtr;
using am::commands::GetDTCsRequest;
using am::event_engine::Event;
+using am::MockMessageHelper;
+using testing::Mock;
namespace mobile_result = mobile_apis::Result;
typedef SharedPtr<GetDTCsRequest> GetDTCsRequestPtr;
class GetDTCsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetDTCsRequestTest() : CommandRequestTest<CommandsTestMocks::kIsNice>() {}
+};
TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
@@ -109,8 +116,6 @@ TEST_F(GetDTCsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
}
TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) {
- GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
-
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
(*event_msg)[am::strings::msg_params] = 0;
(*event_msg)[am::strings::params][am::hmi_response::code] =
@@ -123,9 +128,14 @@ TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) {
app_mngr_,
ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
command->on_event(event);
}
+} // namespace get_dtcs_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
index 93fbaa54ca..52aed6feb8 100644
--- a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc
@@ -52,6 +52,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace get_vehicle_data_request {
using ::testing::_;
using ::testing::Return;
@@ -77,7 +78,7 @@ class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest {
am::ApplicationManager& application_manager)
: GetVehicleDataRequest(message, application_manager) {}
- std::vector<std::string>& get_disallowed_params() {
+ policy::RPCParams& get_disallowed_params() {
return removed_parameters_permissions_.disallowed_params;
}
@@ -137,7 +138,7 @@ TEST_F(GetVehicleDataRequestTest, Run_EmptyMsgParams_UNSUCCESS) {
CreateCommand<GetVehicleDataRequest>(command_msg));
const am::VehicleData kEmptyVehicleData;
- EXPECT_CALL(*am::MockMessageHelper::message_helper_mock(), vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(kEmptyVehicleData));
MockAppPtr app(CreateMockApp());
@@ -160,12 +161,11 @@ TEST_F(GetVehicleDataRequestTest,
CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
const am::VehicleData kEmptyVehicleData;
- EXPECT_CALL(*am::MockMessageHelper::message_helper_mock(), vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillRepeatedly(ReturnRef(kEmptyVehicleData));
- std::vector<std::string>& disallowed_params =
- command->get_disallowed_params();
- disallowed_params.push_back("test_param");
+ policy::RPCParams& disallowed_params = command->get_disallowed_params();
+ disallowed_params.insert("test_param");
MockAppPtr app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app));
@@ -189,9 +189,9 @@ TEST_F(GetVehicleDataRequestTest, Run_SUCCESS) {
CreateCommand<GetVehicleDataRequest>(command_msg));
am::VehicleData vehicle_data;
- vehicle_data.insert(
- am::VehicleData::value_type(kMsgParamKey, am::VehicleDataType::SPEED));
- EXPECT_CALL(*am::MockMessageHelper::message_helper_mock(), vehicle_data())
+ vehicle_data.insert(am::VehicleData::value_type(
+ kMsgParamKey, mobile_apis::VehicleDataType::VEHICLEDATA_SPEED));
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
MockAppPtr app(CreateMockApp());
@@ -220,6 +220,11 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
}
TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::DATA_NOT_AVAILABLE;
+ const mobile_result::eType mobile_response_code =
+ mobile_result::DATA_NOT_AVAILABLE;
+
MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
@@ -228,24 +233,21 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) {
CreateCommand<UnwrappedGetVehicleDataRequest>(command_msg));
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_result::VEHICLE_DATA_NOT_AVAILABLE;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
(*event_msg)[am::strings::params][am::strings::error_msg] = "test_error";
(*event_msg)[am::strings::msg_params][am::hmi_response::method] = 0;
Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData);
event.set_smart_object(*event_msg);
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::VEHICLE_DATA_NOT_AVAILABLE), _));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
command->on_event(event);
}
#endif // HMI_DBUS_API
+} // namespace get_vehicle_data_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc
new file mode 100644
index 0000000000..979fb0cc83
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc
@@ -0,0 +1,284 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "mobile/get_way_points_request.h"
+#include "application_manager/smart_object_keys.h"
+#include "mock_message_helper.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/mock_message_helper.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace get_way_points_request {
+
+using namespace mobile_apis::Result;
+using ::testing::Return;
+using ::testing::_;
+using application_manager::commands::GetWayPointsRequest;
+using application_manager::MockMessageHelper;
+using application_manager::MockHmiInterfaces;
+
+typedef SharedPtr<GetWayPointsRequest> CommandPtr;
+typedef mobile_apis::Result::eType MobileResult;
+typedef hmi_apis::Common_Result::eType HmiResult;
+
+namespace {
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppId = 3u;
+const uint32_t kConnectionKey = kAppId;
+const std::string kMethodName = "Navigation.GetWayPoints";
+}
+
+class GetWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetWayPointsRequestTest() : mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ message_ = utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map);
+ (*message_)[am::strings::msg_params] =
+ ::smart_objects::SmartObject(::smart_objects::SmartType_Map);
+
+ command_sptr_ =
+ CreateCommand<application_manager::commands::GetWayPointsRequest>(
+ message_);
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ }
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ utils::SharedPtr<application_manager::commands::GetWayPointsRequest>
+ command_sptr_;
+};
+
+class GetWayPointsRequestOnEventTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetWayPointsRequestOnEventTest() : app_(CreateMockApp()) {}
+
+ void CheckOnEventResponse(const std::string& wayPointsParam,
+ const HmiResult ResultCode,
+ const bool success) {
+ Event event(Event::EventID::Navigation_GetWayPoints);
+ CommandPtr command(CreateCommand<GetWayPointsRequest>());
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::params][am::hmi_response::code] = ResultCode;
+ if ("0" == wayPointsParam) {
+ (*event_msg)[am::strings::msg_params] = 0;
+ } else {
+ (*event_msg)[am::strings::msg_params][am::strings::way_points][0]["123"] =
+ wayPointsParam;
+ }
+
+ event.set_smart_object(*event_msg);
+
+ const MobileResult mobile_result = static_cast<MobileResult>(ResultCode);
+
+ MessageSharedPtr result_msg(
+ CatchMobileCommandResult(CallOnEvent(*command, event)));
+ EXPECT_EQ(
+ mobile_result,
+ static_cast<MobileResult>(
+ (*result_msg)[am::strings::msg_params][am::strings::result_code]
+ .asInt()));
+ EXPECT_EQ(
+ success,
+ (*result_msg)[am::strings::msg_params][am::strings::success].asBool());
+ }
+
+ protected:
+ MockAppPtr app_;
+ MockHmiInterfaces hmi_interfaces_;
+};
+
+TEST_F(GetWayPointsRequestTest,
+ Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ utils::SharedPtr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(null_application_sptr));
+
+ CallRun caller(*command_sptr_);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const mobile_apis::Result::eType result =
+ static_cast<mobile_apis::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED, result);
+}
+
+TEST_F(GetWayPointsRequestTest, Run_ApplicationRegistered_Success) {
+ (*message_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ MockAppPtr application_sptr = CreateMockApp();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(application_sptr));
+ EXPECT_CALL(*application_sptr, app_id()).WillOnce(Return(1));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ CallRun caller(*command_sptr_);
+
+ MessageSharedPtr result_message = CatchHMICommandResult(caller);
+
+ const hmi_apis::FunctionID::eType result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_message)[am::strings::params][am::strings::function_id]
+ .asInt());
+
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_GetWayPoints, result_function_id);
+ EXPECT_EQ(kCorrelationId,
+ (*result_message)[am::strings::params][am::strings::correlation_id]
+ .asUInt());
+}
+
+TEST_F(GetWayPointsRequestTest,
+ OnEvent_NavigationGetWayPointsEvent_SendResponse) {
+ am::event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+
+ event.set_smart_object(*message_);
+
+ CallOnEvent caller(*command_sptr_, event);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const mobile_apis::Result::eType result =
+ static_cast<mobile_apis::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+}
+
+TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) {
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ CommandPtr command(CreateCommand<GetWayPointsRequest>());
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case1) {
+ CheckOnEventResponse("0", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case2) {
+ CheckOnEventResponse("", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case3) {
+ CheckOnEventResponse("test", HmiResult::SUCCESS, true);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case1) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse(" ", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case2) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\t", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case3) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\n", HmiResult::GENERIC_ERROR, false);
+}
+
+TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case4) {
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ CheckOnEventResponse("test\t\n", HmiResult::GENERIC_ERROR, false);
+}
+
+} // namespace get_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/test/commands/mobile/list_files_request_test.cc
index 9b33bc0ade..ae0e523832 100644
--- a/src/components/application_manager/test/commands/mobile/list_files_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/list_files_request_test.cc
@@ -49,6 +49,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace list_files_request {
using ::testing::_;
using ::testing::Return;
@@ -60,7 +61,12 @@ using am::commands::ListFilesRequest;
using am::commands::MessageSharedPtr;
class ListFilesRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ ListFilesRequestTest() : kStoragePath_("storage"), kResponseSize_(1) {}
+ const std::string kStoragePath_;
+ const uint32_t kResponseSize_;
+};
TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) {
SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
@@ -104,7 +110,17 @@ TEST_F(ListFilesRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
SharedPtr<ListFilesRequest> command(CreateCommand<ListFilesRequest>());
+ EXPECT_CALL(app_mngr_, get_settings())
+ .WillRepeatedly(ReturnRef(app_mngr_settings_));
+
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kStoragePath_));
+
+ ON_CALL(app_mngr_settings_, list_files_response_size())
+ .WillByDefault(ReturnRef(kResponseSize_));
+
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
+
ON_CALL(*app, hmi_level())
.WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
@@ -122,6 +138,7 @@ TEST_F(ListFilesRequestTest, Run_SUCCESS) {
.asInt()));
}
+} // namespace list_files_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
index c2da619941..48f4497033 100644
--- a/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_button_notification_commands_test.cc
@@ -51,6 +51,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_button_notification {
namespace am = ::application_manager;
namespace commands = am::commands;
@@ -77,13 +78,13 @@ struct NotificationData {
template <class NotificationDataT>
class OnButtonNotificationCommandsTest
- : public CommandsTest<CommandsTestMocks::kIsNice>,
+ : public CommandsTest<CommandsTestMocks::kNotNice>,
public NotificationDataT {};
typedef Types<NotificationData<commands::mobile::OnButtonEventNotification,
mobile_apis::FunctionID::OnButtonEventID>,
NotificationData<commands::mobile::OnButtonPressNotification,
- mobile_apis::FunctionID::OnButtonPressID>>
+ mobile_apis::FunctionID::OnButtonPressID> >
OnButtonNotificationCommandsList;
MATCHER_P(CheckNotificationMessage, function_id, "") {
@@ -151,6 +152,9 @@ TYPED_TEST(OnButtonNotificationCommandsTest,
SharedPtr<Notification> command(
this->template CreateCommand<Notification>(notification_msg));
+ typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
+
EXPECT_CALL(this->app_mngr_, SendMessageToMobile(_, _)).Times(0);
command->Run();
@@ -223,8 +227,9 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) {
this->template CreateCommand<Notification>(notification_msg));
typename TestFixture::MockAppPtr mock_app = this->CreateMockApp();
+ ON_CALL(*mock_app, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
EXPECT_CALL(this->app_mngr_, application(kAppId)).WillOnce(Return(mock_app));
-
EXPECT_CALL(*mock_app, IsSubscribedToSoftButton(kCustomButtonId))
.WillOnce(Return(true));
@@ -317,6 +322,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
MessageSharedPtr notification_msg(
this->CreateMessage(smart_objects::SmartType_Map));
+ (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
(*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] =
kButtonName;
@@ -330,6 +336,8 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
EXPECT_CALL(*mock_app, hmi_level())
.WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ ON_CALL(*mock_app, IsFullscreen()).WillByDefault(Return(true));
+
EXPECT_CALL(this->app_mngr_, applications_by_button(kButtonName))
.WillOnce(Return(subscribed_apps_list));
@@ -340,6 +348,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) {
command->Run();
}
+} // namespace on_button_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
index b4eb684bb8..def324bfb6 100644
--- a/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_command_notification_test.cc
@@ -45,6 +45,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_command_notification {
namespace am = ::application_manager;
@@ -129,6 +130,7 @@ TEST_F(OnCommandNotificationTest, Run_SUCCESS) {
command->Run();
}
+} // namespace on_command_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
index bc6f507e14..6d7ccb1fa0 100644
--- a/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_hash_change_notification_test.cc
@@ -43,6 +43,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_hash_change_notification {
namespace strings = application_manager::strings;
@@ -55,19 +56,7 @@ using testing::ReturnRef;
using testing::_;
class OnHashChangeNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnHashChangeNotificationTest()
- : message_helper_(*MockMessageHelper::message_helper_mock()) {}
- void SetUp() OVERRIDE {
- Mock::VerifyAndClearExpectations(&message_helper_);
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&message_helper_);
- }
- MockMessageHelper& message_helper_;
-};
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) {
const uint32_t kConnectionKey = 1u;
@@ -82,7 +71,8 @@ TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
EXPECT_CALL(*mock_app, curHash()).WillOnce(ReturnRef(return_string));
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
command->Run();
@@ -111,7 +101,7 @@ TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(MockAppPtr()));
EXPECT_CALL(*mock_app, curHash()).Times(0);
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
command->Run();
@@ -120,6 +110,7 @@ TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) {
(*msg)[strings::params][strings::message_type].asInt());
}
+} // namespace on_hash_change_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
index bb92c19214..78875ad164 100644
--- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc
@@ -42,6 +42,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_hmi_status_notification_from_mobile {
namespace {
const uint32_t kConnectionKey = 1u;
@@ -51,7 +52,7 @@ const connection_handler::DeviceHandle kHandle = 2u;
namespace strings = application_manager::strings;
using application_manager::commands::OnHMIStatusNotificationFromMobile;
-using application_manager::ProtocolVersion;
+using protocol_handler::MajorProtocolVersion;
using application_manager::ApplicationSet;
using testing::Mock;
using testing::Return;
@@ -90,7 +91,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
EXPECT_CALL(*mock_app, protocol_version())
- .WillRepeatedly(Return(ProtocolVersion::kV4));
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
command->Run();
@@ -143,7 +145,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
EXPECT_CALL(*mock_app, protocol_version())
- .WillRepeatedly(Return(ProtocolVersion::kV4));
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true));
command->Run();
@@ -171,7 +174,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
EXPECT_CALL(app_mngr_, applications()).Times(0);
EXPECT_CALL(*mock_app, protocol_version())
- .WillOnce(Return(ProtocolVersion::kV3));
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
EXPECT_CALL(*mock_app, is_foreground()).Times(0);
command->Run();
@@ -198,7 +202,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
EXPECT_CALL(app_mngr_, applications()).Times(0);
EXPECT_CALL(*mock_app, protocol_version())
- .WillOnce(Return(ProtocolVersion::kV3));
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
EXPECT_CALL(*mock_app, is_foreground()).Times(0);
command->Run();
@@ -223,22 +228,19 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false));
EXPECT_CALL(*mock_app, protocol_version())
- .WillOnce(Return(ProtocolVersion::kV4));
+ .WillOnce(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
EXPECT_CALL(app_mngr_, applications()).Times(0);
EXPECT_CALL(*mock_app, is_foreground()).WillOnce(Return(true));
- application_manager::MockMessageHelper& mock_message_helper =
- *application_manager::MockMessageHelper::message_helper_mock();
- Mock::VerifyAndClearExpectations(&mock_message_helper);
- EXPECT_CALL(mock_message_helper, SendQueryApps(kConnectionKey, _));
+ EXPECT_CALL(mock_message_helper_, SendQueryApps(kConnectionKey, _));
command->Run();
ASSERT_EQ(application_manager::MessageType::kNotification,
(*msg)[strings::params][strings::message_type].asInt());
- Mock::VerifyAndClearExpectations(&mock_message_helper);
}
TEST_F(OnHMIStatusNotificationFromMobileTest,
@@ -260,7 +262,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
EXPECT_CALL(*mock_app, protocol_version())
- .WillRepeatedly(Return(ProtocolVersion::kV4));
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5));
EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(false));
EXPECT_CALL(app_mngr_, MarkAppsGreyOut(kHandle, false));
@@ -272,6 +275,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest,
(*msg)[strings::params][strings::message_type].asInt());
}
+} // namespace on_hmi_status_notification_from_mobile
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
index 016bb2bb1d..9cb5610621 100644
--- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc
@@ -40,6 +40,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_hmi_status_notification {
namespace {
const uint32_t kConnectionKey = 1u;
@@ -48,7 +49,7 @@ const uint32_t kConnectionKey = 1u;
namespace strings = application_manager::strings;
using application_manager::commands::OnHMIStatusNotification;
-using application_manager::ProtocolVersion;
+using protocol_handler::MajorProtocolVersion;
using application_manager::MockMessageHelper;
using application_manager::commands::CommandImpl;
using testing::Mock;
@@ -58,9 +59,6 @@ using testing::_;
class OnHMIStatusNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
- OnHMIStatusNotificationTest()
- : message_helper_(*MockMessageHelper::message_helper_mock()) {}
-
MessageSharedPtr CreateMsgParams(
const mobile_apis::HMILevel::eType kHMIState) {
MessageSharedPtr msg = CreateMessage();
@@ -69,13 +67,9 @@ class OnHMIStatusNotificationTest
return msg;
}
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&message_helper_);
- }
-
void SetSendNotificationExpectations(MessageSharedPtr& msg) {
- Mock::VerifyAndClearExpectations(&message_helper_);
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
}
@@ -87,8 +81,6 @@ class OnHMIStatusNotificationTest
ASSERT_EQ(CommandImpl::protocol_version_,
(*msg)[strings::params][strings::protocol_version].asInt());
}
-
- MockMessageHelper& message_helper_;
};
TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) {
@@ -140,7 +132,7 @@ TEST_F(OnHMIStatusNotificationTest, Run_BackgroundAndFalseProperties_SUCCESS) {
EXPECT_CALL(*mock_app, tts_properties_in_none()).WillOnce(Return(false));
EXPECT_CALL(*mock_app, set_tts_properties_in_none(true));
- EXPECT_CALL(message_helper_, SendTTSGlobalProperties(_, false, _));
+ EXPECT_CALL(mock_message_helper_, SendTTSGlobalProperties(_, false, _));
command->Run();
@@ -207,6 +199,7 @@ TEST_F(OnHMIStatusNotificationTest, Run_FullAndTrueProperties_SUCCESS) {
VerifySendNotificationData(msg);
}
+} // namespace on_hmi_status_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc
index 2eeadce078..7313f32dca 100644
--- a/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_keyboard_input_notification_test.cc
@@ -42,6 +42,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_keyboard_input_notification {
namespace strings = application_manager::strings;
@@ -60,11 +61,9 @@ using testing::_;
class OnKeyBoardInputNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
- OnKeyBoardInputNotificationTest()
- : message_helper_(*MockMessageHelper::message_helper_mock()) {}
-
void SetSendNotificationExpectations(MessageSharedPtr msg) {
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
}
@@ -77,14 +76,6 @@ class OnKeyBoardInputNotificationTest
(*msg)[strings::params][strings::protocol_version].asInt());
}
- void SetUp() OVERRIDE {
- Mock::VerifyAndClearExpectations(&message_helper_);
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&message_helper_);
- }
-
MockAppPtr InitAppSetDataAccessor(SharedPtr<ApplicationSet>& app_set) {
app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set);
MockAppPtr app(CreateMockApp());
@@ -94,7 +85,6 @@ class OnKeyBoardInputNotificationTest
return app;
}
- MockMessageHelper& message_helper_;
SharedPtr<ApplicationSet> app_set_;
sync_primitives::Lock lock_;
};
@@ -107,6 +97,8 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) {
MockAppPtr mock_app(InitAppSetDataAccessor(app_set_));
EXPECT_CALL(*mock_app, is_perform_interaction_active()).WillOnce(Return(1));
+ EXPECT_CALL(*mock_app, perform_interaction_layout())
+ .WillOnce(Return(mobile_apis::LayoutMode::KEYBOARD));
EXPECT_CALL(*mock_app, hmi_level()).Times(0);
EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kConnectionKey));
@@ -159,12 +151,13 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) {
EXPECT_CALL(*mock_app, hmi_level())
.WillOnce(Return(mobile_apis::HMILevel::eType::HMI_BACKGROUND));
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
command->Run();
}
+} // namespace on_keyboard_input_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
index 2b5efd29cb..7840e35cec 100644
--- a/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_system_request_notification_test.cc
@@ -45,6 +45,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_system_request_notification {
namespace strings = application_manager::strings;
@@ -63,20 +64,7 @@ const uint32_t kConnectionKey = 1u;
} // namespace
class OnSystemRequestNotificationTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
- public:
- OnSystemRequestNotificationTest()
- : message_helper_(*MockMessageHelper::message_helper_mock()) {}
-
- void SetUp() OVERRIDE {
- Mock::VerifyAndClearExpectations(&message_helper_);
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&message_helper_);
- }
- MockMessageHelper& message_helper_;
-};
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
const RequestType::eType kRequestType = RequestType::PROPRIETARY;
@@ -99,14 +87,15 @@ TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) {
EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
.WillOnce(Return(true));
-#ifdef EXTENDED_POLICY
+#ifdef PROPRIETARY_MODE
EXPECT_CALL(app_mngr_, GetPolicyHandler())
.Times(2)
.WillRepeatedly(ReturnRef(mock_policy_handler));
- EXPECT_CALL(mock_policy_handler, TimeoutExchange()).WillOnce(Return(5u));
-#endif
+ EXPECT_CALL(mock_policy_handler, TimeoutExchangeSec()).WillOnce(Return(5u));
+#endif // PROPRIETARY_MODE
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
command->Run();
@@ -142,7 +131,8 @@ TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) {
EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
.WillOnce(Return(true));
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).WillOnce(Return(false));
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_))
+ .WillOnce(Return(false));
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _));
command->Run();
@@ -175,7 +165,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) {
MockPolicyHandlerInterface mock_policy_handler;
EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _)).Times(0);
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
command->Run();
@@ -202,13 +192,14 @@ TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) {
EXPECT_CALL(mock_policy_handler, IsRequestTypeAllowed(_, _))
.WillOnce(Return(false));
- EXPECT_CALL(message_helper_, PrintSmartObject(_)).Times(0);
+ EXPECT_CALL(mock_message_helper_, PrintSmartObject(_)).Times(0);
EXPECT_CALL(app_mngr_, SendMessageToMobile(msg, _)).Times(0);
;
command->Run();
}
+} // namespace on_system_request_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
index c32c334c0f..59cddc325f 100644
--- a/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_tbt_client_state_notification_test.cc
@@ -46,6 +46,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_tbt_client_state_notification {
namespace am = ::application_manager;
@@ -132,6 +133,7 @@ TEST_F(OnTBTClientStateNotificationTest,
command_->Run();
}
+} // namespace on_tbt_client_state_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
index 2156aa4c97..c90991fdf7 100644
--- a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc
@@ -46,6 +46,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_touch_event_notification {
namespace am = ::application_manager;
@@ -75,10 +76,16 @@ TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) {
std::vector<ApplicationSharedPtr> applications_with_navi;
applications_with_navi.push_back(mock_app);
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
EXPECT_CALL(app_mngr_, applications_with_navi())
.WillOnce(Return(applications_with_navi));
- EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(false));
EXPECT_CALL(*mock_app, app_id()).Times(0);
@@ -117,18 +124,25 @@ TEST_F(OnTouchEventNotificationTest, Run_NotEmptyListOfAppsWithNavi_SUCCESS) {
std::vector<ApplicationSharedPtr> applications_with_navi;
applications_with_navi.push_back(mock_app);
+ std::vector<ApplicationSharedPtr> applications_with_mobile_projection;
+ applications_with_mobile_projection.push_back(mock_app);
+
EXPECT_CALL(app_mngr_, applications_with_navi())
.WillOnce(Return(applications_with_navi));
- EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, applications_with_mobile_projection())
+ .WillOnce(Return(applications_with_mobile_projection));
+
+ EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
- EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _));
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _)).Times(2);
command_->Run();
}
+} // namespace on_touch_event_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
index c71c40d8c2..05d97856e4 100644
--- a/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_vehicle_data_notification_test.cc
@@ -50,6 +50,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_vehicle_data_notification {
namespace am = ::application_manager;
@@ -70,11 +71,9 @@ class OnVehicleDataNotificationTest
: public CommandsTest<CommandsTestMocks::kIsNice> {
public:
OnVehicleDataNotificationTest()
- : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
- , command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
, command_(CreateCommand<OnVehicleDataNotification>(command_msg_)) {}
- am::MockMessageHelper& mock_message_helper_;
MessageSharedPtr command_msg_;
NotificationPtr command_;
};
@@ -112,7 +111,8 @@ TEST_F(OnVehicleDataNotificationTest,
Run_NotEmptyListOfAppsSubscribedForEvent_SUCCESS) {
am::VehicleData test_vehicle_data;
test_vehicle_data.insert(am::VehicleData::value_type(
- am::strings::fuel_level, am::VehicleDataType::FUELLEVEL));
+ am::strings::fuel_level,
+ mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL));
EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(test_vehicle_data));
@@ -125,9 +125,10 @@ TEST_F(OnVehicleDataNotificationTest,
std::vector<ApplicationSharedPtr> applications;
applications.push_back(mock_app);
- EXPECT_CALL(app_mngr_,
- IviInfoUpdated(am::VehicleDataType::FUELLEVEL, kFuelLevel))
- .WillOnce(Return(applications));
+ EXPECT_CALL(
+ app_mngr_,
+ IviInfoUpdated(mobile_apis::VehicleDataType::VEHICLEDATA_FUELLEVEL,
+ kFuelLevel)).WillOnce(Return(applications));
EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId));
::utils::custom_string::CustomString dummy_name("test_app");
@@ -140,6 +141,7 @@ TEST_F(OnVehicleDataNotificationTest,
command_->Run();
}
+} // namespace on_vehicle_data_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc
index aaa6c8f171..b0dd3c142c 100644
--- a/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc
+++ b/src/components/application_manager/test/commands/mobile/on_way_point_change_notification_test.cc
@@ -46,6 +46,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace on_way_point_change_notification {
namespace am = ::application_manager;
@@ -108,6 +109,7 @@ TEST_F(OnWayPointChangeNotificationTest,
command_->Run();
}
+} // namespace on_way_point_change_notification
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
index b6a76d51cc..6c35a5372a 100644
--- a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
+++ b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc
@@ -47,6 +47,7 @@
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace perform_audio_pass_thru_request {
namespace am = application_manager;
@@ -54,26 +55,33 @@ using am::commands::PerformAudioPassThruRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::utils::SharedPtr;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::InSequence;
namespace {
const int32_t kCommandId = 1;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 2u;
+const std::string kCorrectPrompt = "CorrectPrompt";
+const std::string kCorrectType = "CorrectType";
+const std::string kCorrectDisplayText1 = "CorrectDisplayText1";
+const std::string kCorrectDisplayText2 = "CorrectDisplayText2";
+const std::string kFunctionId = "FunctionId";
+const uint32_t kTimeoutForTTSSpeak = 1u;
} // namespace
class PerformAudioPassThruRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
PerformAudioPassThruRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ : mock_app_(CreateMockApp())
+ , message_(utils::MakeShared<SmartObject>(::smart_objects::SmartType_Map))
+ , msg_params_((*message_)[am::strings::msg_params]) {}
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -95,16 +103,36 @@ class PerformAudioPassThruRequestTest
return msg;
}
+ void TestWrongSyntaxInField(const std::string& field) {
+ if (field == am::strings::initial_prompt) {
+ msg_params_[field][0][am::strings::text] = "prompt\\n";
+ } else {
+ msg_params_[field] = "prompt\\n";
+ }
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::INVALID_DATA, result);
+ }
+
void SetUp() OVERRIDE {
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
- }
+ command_sptr_ =
+ CreateCommand<am::commands::PerformAudioPassThruRequest>(message_);
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ application_sptr_ = CreateMockApp();
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(application_sptr_));
}
void ResultCommandExpectations(MessageSharedPtr msg,
@@ -119,9 +147,11 @@ class PerformAudioPassThruRequestTest
}
sync_primitives::Lock lock_;
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
MockAppPtr mock_app_;
+ MessageSharedPtr message_;
+ ::smart_objects::SmartObject& msg_params_;
+ utils::SharedPtr<am::commands::PerformAudioPassThruRequest> command_sptr_;
+ MockAppPtr application_sptr_;
};
TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
@@ -155,33 +185,33 @@ TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) {
(*vr_command_result)[am::strings::msg_params][am::strings::result_code]
.asInt(),
static_cast<int32_t>(am::mobile_api::Result::GENERIC_ERROR));
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
TEST_F(PerformAudioPassThruRequestTest,
OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) {
- MessageSharedPtr msg_ui = CreateFullParamsUISO();
- (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey;
-
- utils::SharedPtr<PerformAudioPassThruRequest> command =
- CreateCommand<PerformAudioPassThruRequest>(msg_ui);
+ MessageSharedPtr mobile_request = CreateFullParamsUISO();
+ (*mobile_request)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
- MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
- (*msg)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
- (*msg)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
- (*msg)[am::strings::msg_params][am::strings::info] =
- "UI is not supported by system";
+ smart_objects::SmartObject initial_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ initial_prompt[0] = smart_objects::SmartObject(smart_objects::SmartType_Map);
+ initial_prompt[0][am::strings::text] = "tts chunk text";
+ initial_prompt[0][am::strings::type] = 0;
+ (*mobile_request)[am::strings::msg_params][am::strings::initial_prompt] =
+ initial_prompt;
- Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
- event.set_smart_object(*msg);
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+ utils::SharedPtr<PerformAudioPassThruRequest> command =
+ CreateCommand<PerformAudioPassThruRequest>(mobile_request);
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- ON_CALL(hmi_interfaces_,
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
MessageSharedPtr response_msg_tts =
CreateMessage(smart_objects::SmartType_Map);
@@ -190,21 +220,565 @@ TEST_F(PerformAudioPassThruRequestTest,
(*response_msg_tts)[am::strings::msg_params][am::strings::cmd_id] = kCmdId;
am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
event_tts.set_smart_object(*response_msg_tts);
- command->on_event(event_tts);
- MessageSharedPtr ui_command_result;
+ MessageSharedPtr response_ui = CreateMessage(smart_objects::SmartType_Map);
+ (*response_ui)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ (*response_ui)[am::strings::msg_params][am::strings::cmd_id] = kCommandId;
+ (*response_ui)[am::strings::msg_params][am::strings::info] =
+ "UI is not supported by system";
+ am::event_engine::Event event_ui(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ event_ui.set_smart_object(*response_ui);
+
+ MessageSharedPtr response_to_mobile;
EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true));
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
- .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+ .WillOnce(DoAll(SaveArg<0>(&response_to_mobile), Return(true)));
+
+ command->Run();
+ command->on_event(event_tts);
+ command->on_event(event_ui);
+
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ false);
+ EXPECT_EQ(
+ (*response_to_mobile)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE));
+ EXPECT_EQ((*response_to_mobile)[am::strings::msg_params][am::strings::info]
+ .asString(),
+ "UI is not supported by system");
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ utils::SharedPtr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(null_application_sptr));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+ EXPECT_EQ(am::mobile_api::Result::APPLICATION_NOT_REGISTERED, result);
+}
+
+TEST_F(PerformAudioPassThruRequestTest, Run_HmiLevelNone_Rejected) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_NONE));
+
+ CallRun caller(*command_sptr_);
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+ EXPECT_EQ(am::mobile_api::Result::REJECTED, result);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInInitialPrompt_InvalidData) {
+ TestWrongSyntaxInField(am::strings::initial_prompt);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInAudioPassDisplayText1_InvalidData) {
+ TestWrongSyntaxInField(am::strings::audio_pass_display_text1);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_WhitespaceInAudioPassDisplayText2_InvalidData) {
+ TestWrongSyntaxInField(am::strings::audio_pass_display_text2);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_TTSSpeakIsAbsent) {
+ // First we need to call SendSpeakRequest()
+ // to enable the "is_active_tts_speak" key
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ // Send speak request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun run_caller(*command_sptr_);
+ run_caller();
+
+ const ::smart_objects::SmartObject& speak_msg_params =
+ (*speak_reqeust_result_msg)[am::strings::msg_params];
+
+ const std::string result_initial_prompt =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
+ .asString();
+ const std::string result_prompt_type =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
+ .asString();
+
+ EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
+ EXPECT_EQ(kCorrectType, result_prompt_type);
+
+ // Now we recieve on_event()
+
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::GENERIC_ERROR;
+ event.set_smart_object(*message_);
+
+ EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
+
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_StopSpeaking))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ CallOnEvent on_event_caller(*command_sptr_, event);
+ MessageSharedPtr command_result = CatchHMICommandResult(on_event_caller);
+
+ const hmi_apis::FunctionID::eType result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*command_result)[am::strings::params][am::strings::function_id]
+ .asInt());
+
+ EXPECT_EQ(hmi_apis::FunctionID::TTS_StopSpeaking, result_function_id);
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteTrue) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+ msg_params_[am::strings::audio_pass_display_text1] = kCorrectDisplayText1;
+ msg_params_[am::strings::audio_pass_display_text2] = kCorrectDisplayText2;
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun caller(*command_sptr_);
+ caller();
+
+ const ::smart_objects::SmartObject& speak_msg_params =
+ (*speak_reqeust_result_msg)[am::strings::msg_params];
+ const ::smart_objects::SmartObject& perform_msg_params =
+ (*perform_result_msg)[am::strings::msg_params];
+
+ const std::string result_initial_prompt =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::text]
+ .asString();
+ const std::string result_prompt_type =
+ speak_msg_params[am::hmi_request::tts_chunks][0][am::strings::type]
+ .asString();
+ const std::string result_display_text_1 =
+ perform_msg_params[am::hmi_request::audio_pass_display_texts][0]
+ [am::hmi_request::field_text].asString();
+ const std::string result_display_text_2 =
+ perform_msg_params[am::hmi_request::audio_pass_display_texts][1]
+ [am::hmi_request::field_text].asString();
+
+ EXPECT_EQ(kCorrectPrompt, result_initial_prompt);
+ EXPECT_EQ(kCorrectType, result_prompt_type);
+ EXPECT_EQ(kCorrectDisplayText1, result_display_text_1);
+ EXPECT_EQ(kCorrectDisplayText2, result_display_text_2);
+
+ EXPECT_EQ(true, perform_msg_params[am::strings::mute_audio].asBool());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ Run_InitPromptCorrect_SpeakAndPerformAPTRequestsSendMuteFalse) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+
+ const bool muted = false;
+
+ msg_params_[am::strings::mute_audio] = muted;
+
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+ }
+ CallRun caller(*command_sptr_);
+ caller();
+
+ EXPECT_EQ(
+ muted,
+ (*perform_result_msg)[am::strings::msg_params][am::strings::mute_audio]
+ .asBool());
+}
+
+TEST_F(
+ PerformAudioPassThruRequestTest,
+ Run_InitPromptEmpty_PerformAndRecordStartNotificationsAndStartRecording) {
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ MessageSharedPtr start_record_result_msg;
+ MessageSharedPtr perform_result_msg;
+ {
+ InSequence dummy;
+
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // Perform audio path thru request sending
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_OnRecordStart))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // Start recording notification sending
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&start_record_result_msg), Return(true)));
+ }
+
+ // Start microphone recording cals
+ EXPECT_CALL(app_mngr_, BeginAudioPassThrough());
+ EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
+
+ CallRun caller(*command_sptr_);
+ caller();
+
+ const hmi_apis::FunctionID::eType start_record_result_function_id =
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*start_record_result_msg)[am::strings::params]
+ [am::strings::function_id].asInt());
+ EXPECT_EQ(hmi_apis::FunctionID::UI_OnRecordStart,
+ start_record_result_function_id);
+}
+
+TEST_F(PerformAudioPassThruRequestTest, OnEvent_UIPAPT_Rejected) {
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::REJECTED;
+ event.set_smart_object(*message_);
+
+ CallOnEvent caller(*command_sptr_, event);
+
+ MessageSharedPtr result_message = CatchMobileCommandResult(caller);
+
+ const am::mobile_api::Result::eType result_code =
+ static_cast<am::mobile_api::Result::eType>(
+ (*result_message)[am::strings::msg_params][am::strings::result_code]
+ .asInt());
+
+ EXPECT_EQ(am::mobile_api::Result::REJECTED, result_code);
+}
- command->on_event(event);
+TEST_F(PerformAudioPassThruRequestTest,
+ OnEvent_TTSSpeakSuccess_UpdateRequestTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ event.set_smart_object(*message_);
+
+ // Start recording notification sending
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ // Start microphone recording cals
+ EXPECT_CALL(app_mngr_, BeginAudioPassThrough());
+ EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_PAPTunsupportedResource_CorrectInfo) {
+ const std::string return_info = "Unsupported phoneme type sent in a prompt";
+
+ am::event_engine::Event event_speak(hmi_apis::FunctionID::TTS_Speak);
+ am::event_engine::Event event_perform(
+ hmi_apis::FunctionID::UI_PerformAudioPassThru);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ event_speak.set_smart_object(*message_);
+
+ (*message_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ event_perform.set_smart_object(*message_);
+
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ // First call on_event for setting result_tts_speak_ to UNSUPPORTED_RESOURCE
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ CallOnEvent caller_speak(*command_sptr_, event_speak);
+ caller_speak();
+
+ // Second call for test correct behavior of UI_PerformAudioPassThru event
+ EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_)).Times(0);
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller_perform(*command_sptr_, event_perform);
+
+ MessageSharedPtr perform_event_result =
+ CatchMobileCommandResult(caller_perform);
+
+ EXPECT_EQ(return_info,
+ (*perform_event_result)[am::strings::msg_params][am::strings::info]
+ .asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_TTSSpeak_UpdateTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak);
+
+ msg_params_[am::strings::connection_key] = kConnectionKey;
+ msg_params_[am::strings::function_id] = kFunctionId;
+ msg_params_[am::strings::correlation_id] = kCorrelationId;
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, BeginAudioPassThrough()).WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+
+ EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
+ EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_OnEvent_TTSOnResetTimeout_UpdateTimeout) {
+ am::event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout);
+
+ msg_params_[am::strings::connection_key] = kConnectionKey;
+ msg_params_[am::strings::function_id] = kFunctionId;
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, BeginAudioPassThrough()).WillOnce(Return(true));
+
+ EXPECT_CALL(
+ app_mngr_,
+ StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+
+ EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt());
+ EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString());
+}
+
+TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) {
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, EndAudioPassThrough()).Times(0);
+
+ CallOnEvent caller(*command_sptr_, event);
+ caller();
+}
+
+TEST_F(PerformAudioPassThruRequestTest, Init_CorrectTimeout) {
+ const uint32_t kDefaultTimeout = command_sptr_->default_timeout();
+ const uint32_t kMaxDuration = 10000u;
+
+ msg_params_[am::strings::max_duration] = kMaxDuration;
+
+ command_sptr_->Init();
+
+ EXPECT_EQ(kDefaultTimeout + kMaxDuration, command_sptr_->default_timeout());
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ onTimeOut_ttsSpeakNotActive_DontSendHMIReqeust) {
+ EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ // For setting current_state_ -> kCompleted
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+
+ command_sptr_->onTimeOut();
+}
+
+TEST_F(PerformAudioPassThruRequestTest,
+ DISABLED_onTimeOut_ttsSpeakActive_SendHMIReqeust) {
+ EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, StopAudioPassThru(_));
+
+ EXPECT_CALL(*application_sptr_, hmi_level())
+ .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL));
+
+ msg_params_[am::strings::initial_prompt][0][am::strings::text] =
+ kCorrectPrompt;
+ msg_params_[am::strings::initial_prompt][0][am::strings::type] = kCorrectType;
+ MessageSharedPtr speak_reqeust_result_msg;
+ MessageSharedPtr perform_result_msg;
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true)));
+
+ // Perform audio path thru request sending
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true)));
+
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ EXPECT_CALL(
+ mock_message_helper_,
+ CreateNegativeResponse(_, _, _, am::mobile_api::Result::GENERIC_ERROR))
+ .WillOnce(Return(msg));
+
+ // For setting is_active_tts_speak -> true
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_))
+ .Times(2)
+ .WillRepeatedly(Return(false));
+ CallRun caller(*command_sptr_);
+ caller();
+
+ // For setting current_state_ -> kCompleted
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL));
+ command_sptr_->SendResponse(true, am::mobile_api::Result::SUCCESS);
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_StopSpeaking)))
+ .WillOnce(Return(false));
- ResultCommandExpectations(ui_command_result, "UI is not supported by system");
+ command_sptr_->onTimeOut();
}
} // namespace perform_audio_pass_thru_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc
index d261dee8ec..a272234e82 100644
--- a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc
+++ b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc
@@ -53,6 +53,7 @@
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace perform_interaction_request {
namespace am = application_manager;
@@ -61,9 +62,7 @@ using am::ApplicationManager;
using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::testing::_;
-using ::testing::Mock;
using ::utils::SharedPtr;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -82,20 +81,12 @@ const uint32_t kConnectionKey = 2u;
class PerformInteractionRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- PerformInteractionRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ PerformInteractionRequestTest() : mock_app_(CreateMockApp()) {}
void SetUp() OVERRIDE {
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
void ResultCommandExpectations(MessageSharedPtr msg,
@@ -110,8 +101,6 @@ class PerformInteractionRequestTest
}
sync_primitives::Lock lock_;
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
MockAppPtr mock_app_;
};
@@ -173,10 +162,6 @@ TEST_F(PerformInteractionRequestTest,
MockAppPtr mock_app;
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app));
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(hmi_interfaces));
-
MessageSharedPtr response_msg_vr =
CreateMessage(smart_objects::SmartType_Map);
(*response_msg_vr)[strings::params][hmi_response::code] =
@@ -196,12 +181,12 @@ TEST_F(PerformInteractionRequestTest,
am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction);
event_ui.set_smart_object(*response_msg_ui);
- EXPECT_CALL(hmi_interfaces,
+ EXPECT_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- EXPECT_CALL(hmi_interfaces,
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
MessageSharedPtr response_to_mobile;
@@ -227,12 +212,12 @@ TEST_F(PerformInteractionRequestTest,
utils::SharedPtr<PerformInteractionRequest> command =
CreateCommand<PerformInteractionRequest>(msg_from_mobile);
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- ON_CALL(hmi_interfaces_,
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
MessageSharedPtr response_msg_vr =
CreateMessage(smart_objects::SmartType_Map);
@@ -271,6 +256,7 @@ TEST_F(PerformInteractionRequestTest,
}
} // namespace perform_interaction_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/put_file_test.cc b/src/components/application_manager/test/commands/mobile/put_file_test.cc
new file mode 100644
index 0000000000..b48ac67501
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/put_file_test.cc
@@ -0,0 +1,351 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+
+#include "mobile/put_file_response.h"
+#include "mobile/put_file_request.h"
+
+#include "utils/make_shared.h"
+#include "utils/file_system.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace put_file {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::AtLeast;
+
+namespace am = ::application_manager;
+
+using am::commands::PutFileRequest;
+using am::commands::PutFileResponse;
+using am::commands::MessageSharedPtr;
+using policy_test::MockPolicyHandlerInterface;
+
+typedef SharedPtr<PutFileRequest> PutFileRequestPtr;
+typedef SharedPtr<PutFileResponse> PutFileResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const std::string kFileName = "sync_file_name.txt";
+const int64_t kOffset = 10u;
+const int64_t kZeroOffset = 0u;
+const std::string kStorageFolder = "./storage";
+const std::string kAppFolder = "app_folder";
+}
+
+class PutFileRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ PutFileRequestTest()
+ : msg_(CreateMessage(::smart_objects::SmartType_Map))
+ , mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ binary_data_.push_back(1u);
+
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::sync_file_name] = kFileName;
+ (*msg_)[am::strings::msg_params][am::strings::persistent_file] = true;
+ (*msg_)[am::strings::msg_params][am::strings::file_type] =
+ mobile_apis::FileType::JSON;
+ (*msg_)[am::strings::params][am::strings::binary_data] = binary_data_;
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ }
+
+ void ExpectReceiveMessageFromSDK() {
+ EXPECT_CALL(mock_policy_handler_,
+ ReceiveMessageFromSDK(kFileName, binary_data_))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ }
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+ std::vector<uint8_t> binary_data_;
+};
+
+class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ PutFileResponceTest() : message_(CreateMessage()) {}
+
+ void SetUp() OVERRIDE {
+ command_sptr_ = CreateCommand<PutFileResponse>(message_);
+ }
+
+ MessageSharedPtr message_;
+ SharedPtr<PutFileResponse> command_sptr_;
+};
+
+TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+
+ message_ref[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ utils::SharedPtr<am::Application> null_application_sptr;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(null_application_sptr));
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(
+ MobileResultCodeIs(mobile_apis::Result::APPLICATION_NOT_REGISTERED),
+ _));
+ command_sptr_->Run();
+}
+
+TEST_F(PutFileResponceTest, Run_ApplicationRegistered_Success) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+
+ message_ref[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ message_ref[am::strings::msg_params][am::strings::success] = true;
+
+ utils::SharedPtr<am::Application> application_sptr =
+ utils::MakeShared<MockApplication>();
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(application_sptr));
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command_sptr_->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_HmiLevelNone_UNSUCCESS) {
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ const uint32_t settings_put_file_in_none = 1u;
+ const uint32_t app_put_file_in_none_count = 2u;
+ EXPECT_CALL(app_mngr_settings_, put_file_in_none())
+ .WillOnce(ReturnRef(settings_put_file_in_none));
+ EXPECT_CALL(*mock_app_, put_file_in_none_count())
+ .WillOnce(Return(app_put_file_in_none_count));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_BinaryDataDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::params].erase(am::strings::binary_data);
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_SyncFileNameDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params].erase(am::strings::sync_file_name);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_FileTypeDoesNotExists_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params].erase(am::strings::file_type);
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_BinaryDataGreaterThanAvaliableSpace_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 0u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::OUT_OF_MEMORY);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_IvalidCreationDirectory_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+
+ const std::string storage_folder = "/storage";
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(storage_folder));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::GENERIC_ERROR);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_IvalidUpdateFile_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 2u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space))
+ .WillOnce(Return(avaliable_space));
+
+ const std::string file_path = kStorageFolder + "/" + kAppFolder;
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(false));
+ EXPECT_CALL(*mock_app_, UpdateFile(_)).WillOnce(Return(false));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_AddFile_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = false;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(*mock_app_, folder_name()).WillOnce(Return(kAppFolder));
+
+ const uint32_t avaliable_space = 2u;
+ EXPECT_CALL(*mock_app_, GetAvailableDiskSpace())
+ .WillOnce(Return(avaliable_space))
+ .WillOnce(Return(avaliable_space));
+
+ const std::string file_path = kStorageFolder + "/" + kAppFolder;
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, file_path, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, AddFile(_)).WillOnce(Return(true));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_SendOnPutFileNotification_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnPutFile)))
+ .WillOnce(Return(true));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::SUCCESS);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(PutFileRequestTest, Run_InvalidPutFile_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::offset] = kZeroOffset;
+ (*msg_)[am::strings::msg_params][am::strings::system_file] = true;
+
+ ExpectReceiveMessageFromSDK();
+ EXPECT_CALL(app_mngr_settings_, system_files_path())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(app_mngr_,
+ SaveBinary(binary_data_, kStorageFolder, kFileName, kZeroOffset))
+ .WillOnce(Return(mobile_apis::Result::INVALID_DATA));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ PutFileRequestPtr command(CreateCommand<PutFileRequest>(msg_));
+ command->Run();
+}
+
+} // namespace put_file
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
index 9028a470a0..c88f4626f0 100644
--- a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc
@@ -41,16 +41,18 @@
#include "application_manager/application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/commands/mobile/read_did_request.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
#include "application_manager/smart_object_keys.h"
-#include "event_engine/event.h"
+#include "application_manager/event_engine/event.h"
namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace read_did_request {
using ::testing::_;
using ::testing::DoAll;
@@ -78,19 +80,23 @@ TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) {
SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>());
- const mobile_apis::Result::eType kResultCode = mobile_apis::Result::SUCCESS;
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_apis::Result::eType mobile_response_code =
+ mobile_apis::Result::SUCCESS;
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] = kResultCode;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
(*event_msg)[am::strings::msg_params] = 0;
event.set_smart_object(*event_msg);
- MessageSharedPtr result_msg(
- CatchMobileCommandResult(CallOnEvent(*command, event)));
- EXPECT_EQ(kResultCode,
- static_cast<mobile_apis::Result::eType>(
- (*result_msg)[am::strings::msg_params][am::strings::result_code]
- .asInt()));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ command->on_event(event);
}
TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) {
@@ -153,6 +159,7 @@ TEST_F(ReadDIDRequestTest, Run_SUCCESS) {
.asInt()));
}
+} // namespace read_did_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
index 5679d49b63..b7a004f199 100644
--- a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc
@@ -43,22 +43,25 @@
#include "application_manager/application.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_helper.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
-#include "utils/data_accessor.h"
#include "protocol_handler/mock_session_observer.h"
#include "connection_handler/mock_connection_handler.h"
#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/mock_resume_ctrl.h"
#include "application_manager/mock_hmi_interface.h"
+#include "utils/data_accessor.h"
#include "utils/custom_string.h"
#include "utils/lock.h"
+#include "utils/macro.h"
namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace register_app_interface_request {
using ::testing::_;
using ::testing::Return;
@@ -89,11 +92,22 @@ class RegisterAppInterfaceRequestTest
RegisterAppInterfaceRequestTest()
: msg_(CreateMessage())
, command_(CreateCommand<RegisterAppInterfaceRequest>(msg_))
- , app_name_("test_app_name_") {
+ , app_name_("test_app_name_")
+ , mock_application_helper_(
+ application_manager_test::MockApplicationHelper::
+ application_helper_mock()) {
InitGetters();
InitLanguage();
}
+ void SetUp() OVERRIDE {
+ testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
+ }
+
+ void TearDown() OVERRIDE {
+ testing::Mock::VerifyAndClearExpectations(&mock_application_helper_);
+ }
+
void InitBasicMessage() {
(*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
(*msg_)[am::strings::msg_params][am::strings::app_id] = kAppId;
@@ -111,6 +125,7 @@ class RegisterAppInterfaceRequestTest
ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(kDummyString));
ON_CALL(*mock_app, language()).WillByDefault(ReturnRef(kMobileLanguage));
ON_CALL(*mock_app, ui_language()).WillByDefault(ReturnRef(kMobileLanguage));
+ ON_CALL(*mock_app, policy_app_id()).WillByDefault(Return(kAppId));
return mock_app;
}
@@ -150,8 +165,9 @@ class RegisterAppInterfaceRequestTest
.WillByDefault(Return(policy::DeviceConsent::kDeviceAllowed));
ON_CALL(app_mngr_, GetDeviceTransportType(_))
.WillByDefault(Return(hmi_apis::Common_TransportType::WIFI));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(app_mngr_, IsAppInReconnectMode(_)).WillByDefault(Return(false));
+ ON_CALL(app_mngr_, application_by_policy_id(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
ON_CALL(
@@ -168,6 +184,43 @@ class RegisterAppInterfaceRequestTest
.WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
}
+ void SetCommonExpectionsOnSwitchedApplication(
+ MockAppPtr mock_app, mobile_apis::Result::eType response_result_code) {
+ EXPECT_CALL(mock_policy_handler_, AddApplication(_, _)).Times(0);
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(response_result_code), _));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered)))
+ .Times(0);
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
+ .Times(0);
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0);
+
+ EXPECT_CALL(
+ app_mngr_,
+ OnApplicationSwitched(
+ MockAppPtr::static_pointer_cast<application_manager::Application>(
+ mock_app)));
+ }
+
MessageSharedPtr msg_;
SharedPtr<RegisterAppInterfaceRequest> command_;
@@ -190,19 +243,28 @@ class RegisterAppInterfaceRequestTest
typedef IsNiceMock<application_manager_test::MockHMICapabilities,
kMocksAreNice>::Result MockHMICapabilities;
- typedef IsNiceMock<am::MockHmiInterfaces, kMocksAreNice>::Result
- MockHmiInterfaces;
-
MockPolicyHandlerInterface mock_policy_handler_;
MockResumeCtrl mock_resume_crt_;
MockConnectionHandler mock_connection_handler_;
MockSessionObserver mock_session_observer_;
MockHMICapabilities mock_hmi_capabilities_;
- MockHmiInterfaces mock_hmi_interfaces_;
+ application_manager_test::MockApplicationHelper& mock_application_helper_;
};
-TEST_F(RegisterAppInterfaceRequestTest, DISABLED_Run_MinimalData_SUCCESS) {
+TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) {
+ EXPECT_TRUE(command_->Init());
+}
+
+TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) {
InitBasicMessage();
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId;
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
MockAppPtr mock_app = CreateBasicMockedApp();
EXPECT_CALL(app_mngr_, application(kConnectionKey))
@@ -214,6 +276,10 @@ TEST_F(RegisterAppInterfaceRequestTest, DISABLED_Run_MinimalData_SUCCESS) {
ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
.WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ utils::MakeShared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
EXPECT_CALL(app_mngr_,
@@ -224,9 +290,9 @@ TEST_F(RegisterAppInterfaceRequestTest, DISABLED_Run_MinimalData_SUCCESS) {
ManageHMICommand(HMIResultCodeIs(
hmi_apis::FunctionID::Buttons_OnButtonSubscription)))
.WillOnce(Return(true));
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
+ .Times(2);
command_->Run();
}
@@ -253,9 +319,17 @@ MATCHER_P(CheckHMIInterfacesRealtedData, expected_data, "") {
}
TEST_F(RegisterAppInterfaceRequestTest,
- DISABLED_Run_HmiInterfacesStateAvailable_SUCCESS) {
+ Run_HmiInterfacesStateAvailable_SUCCESS) {
InitBasicMessage();
+ EXPECT_CALL(app_mngr_, IsStopping())
+ .WillOnce(Return(false))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ ON_CALL(app_mngr_, IsHMICooperating()).WillByDefault(Return(false));
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _));
+ EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false));
+
MockAppPtr mock_app = CreateBasicMockedApp();
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(ApplicationSharedPtr()))
@@ -297,6 +371,10 @@ TEST_F(RegisterAppInterfaceRequestTest,
ON_CALL(mock_policy_handler_, PolicyEnabled()).WillByDefault(Return(true));
ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _))
.WillByDefault(Return(true));
+ policy::StatusNotifier notify_upd_manager =
+ utils::MakeShared<utils::CallNothing>();
+ ON_CALL(mock_policy_handler_, AddApplication(_, _))
+ .WillByDefault(Return(notify_upd_manager));
EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).WillOnce(Return(mock_app));
@@ -323,13 +401,121 @@ TEST_F(RegisterAppInterfaceRequestTest,
ManageHMICommand(
HMIResultCodeIs(hmi_apis::FunctionID::UI_ChangeRegistration)))
.WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
+ .Times(2);
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_CorrectHash_ExpectNoCleanupSuccess) {
+ InitBasicMessage();
+
+ const std::string request_hash_id = "abc123";
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(
+ mock_resume_crt_,
+ CheckApplicationHash(
+ MockAppPtr::static_pointer_cast<application_manager::Application>(
+ mock_app),
+ request_hash_id)).WillOnce(Return(true));
+
+ EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0);
+
+ EXPECT_CALL(mock_application_helper_, RecallApplicationData(_, _)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::SUCCESS);
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_WrongHash_ExpectCleanupResumeFailed) {
+ InitBasicMessage();
+
+ const std::string request_hash_id = "abc123";
+ (*msg_)[am::strings::msg_params][am::strings::hash_id] = request_hash_id;
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(CheckHMIInterfacesRealtedData(expected_message), _));
+ mock_resume_crt_,
+ CheckApplicationHash(
+ MockAppPtr::static_pointer_cast<application_manager::Application>(
+ mock_app),
+ request_hash_id)).WillOnce(Return(false));
+
+ EXPECT_CALL(
+ mock_application_helper_,
+ RecallApplicationData(
+ MockAppPtr::static_pointer_cast<application_manager::Application>(
+ mock_app),
+ _));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::RESUME_FAILED);
+
+ command_->Run();
+}
+
+TEST_F(RegisterAppInterfaceRequestTest,
+ SwitchApplication_NoHash_ExpectCleanupResumeFailed) {
+ InitBasicMessage();
+
+ MockAppPtr mock_app = CreateBasicMockedApp();
+ EXPECT_CALL(app_mngr_, application_by_policy_id(kAppId))
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, IsAppInReconnectMode(kAppId)).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, ProcessReconnection(_, kConnectionKey));
+
+ EXPECT_CALL(
+ mock_application_helper_,
+ RecallApplicationData(
+ MockAppPtr::static_pointer_cast<application_manager::Application>(
+ mock_app),
+ _));
+
+ EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ SetCommonExpectionsOnSwitchedApplication(mock_app,
+ mobile_apis::Result::RESUME_FAILED);
command_->Run();
}
+} // namespace register_app_interface_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc
new file mode 100644
index 0000000000..69fee02262
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc
@@ -0,0 +1,565 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <vector>
+
+#include "mobile/reset_global_properties_request.h"
+#include "mobile/reset_global_properties_response.h"
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace reset_global_properties {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace am = ::application_manager;
+
+using am::commands::ResetGlobalPropertiesRequest;
+using am::commands::ResetGlobalPropertiesResponse;
+using am::commands::MessageSharedPtr;
+using am::event_engine::Event;
+using am::MockMessageHelper;
+
+typedef SharedPtr<ResetGlobalPropertiesRequest> ResetGlobalPropertiesRequestPtr;
+typedef SharedPtr<ResetGlobalPropertiesResponse>
+ ResetGlobalPropertiesResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 10u;
+} // namespace
+
+class ResetGlobalPropertiesRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ protected:
+ ResetGlobalPropertiesRequestTest()
+ : msg_(CreateMessage()), mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ command_ = CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillByDefault(Return(kCorrelationId));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+ ResetGlobalPropertiesRequestPtr command_;
+};
+
+class ResetGlobalPropertiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MockAppPtr invalid_app;
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
+
+ MessageSharedPtr command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true)));
+
+ command_->Run();
+ EXPECT_EQ(
+ (*command_result)[am::strings::msg_params][am::strings::success].asBool(),
+ false);
+ EXPECT_EQ(
+ (*command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::APPLICATION_NOT_REGISTERED));
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidVrHelp_UNSUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::HELPPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][2] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+ (*msg_)[am::strings::msg_params][am::strings::properties][3] =
+ mobile_apis::GlobalProperty::MENUNAME;
+ (*msg_)[am::strings::msg_params][am::strings::properties][4] =
+ mobile_apis::GlobalProperty::MENUICON;
+ (*msg_)[am::strings::msg_params][am::strings::properties][5] =
+ mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ smart_objects::SmartObject so_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ smart_objects::SmartObject timeout_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeout_prompt[am::strings::text] = time_out_prompt[0];
+ timeout_prompt[am::strings::type] =
+ hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+
+ smart_objects::SmartObject so_time_out_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ so_time_out_prompt[0] = timeout_prompt;
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help; // = NULL;
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+
+ command_->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) {
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::HELPPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][2] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+ (*msg_)[am::strings::msg_params][am::strings::properties][3] =
+ mobile_apis::GlobalProperty::MENUNAME;
+ (*msg_)[am::strings::msg_params][am::strings::properties][4] =
+ mobile_apis::GlobalProperty::MENUICON;
+ (*msg_)[am::strings::msg_params][am::strings::properties][5] =
+ mobile_apis::GlobalProperty::KEYBOARDPROPERTIES;
+
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ smart_objects::SmartObject so_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ EXPECT_CALL(*mock_app_, set_help_prompt(so_prompt));
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ smart_objects::SmartObject timeout_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ timeout_prompt[am::strings::text] = time_out_prompt[0];
+ timeout_prompt[am::strings::type] =
+ hmi_apis::Common_SpeechCapabilities::SC_TEXT;
+
+ smart_objects::SmartObject so_time_out_prompt =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ so_time_out_prompt[0] = timeout_prompt;
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(so_time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help =
+ ::utils::MakeShared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ smart_objects::SmartObject msg_params =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ msg_params[am::hmi_request::menu_title] = "";
+
+ EXPECT_CALL(*mock_app_,
+ set_menu_title(msg_params[am::hmi_request::menu_title]));
+
+ const smart_objects::SmartObjectSPtr so_help_prompt =
+ ::utils::MakeShared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(so_help_prompt.get()));
+ EXPECT_CALL(*mock_app_, timeout_prompt())
+ .WillOnce(Return(so_help_prompt.get()));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ OnEvent_UI_SetGlobalProperties_SUCCESS) {
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg_)[am::strings::params][am::hmi_response::code] = result_code;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help =
+ ::utils::MakeShared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ command_->Run();
+
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::ORIGIN_SDL));
+
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ OnEvent_TTS_SetGlobalProperties_SUCCESS) {
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ utils::MakeShared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ MessageSharedPtr ui_msg = CreateMessage();
+ (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*ui_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ ui_event.set_smart_object(*ui_msg);
+
+ command_->Run();
+ command_->on_event(ui_event);
+ event.set_smart_object(*msg_);
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::WARNINGS),
+ am::commands::Command::ORIGIN_SDL));
+
+ command_->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) {
+ MessageSharedPtr message(CreateMessage());
+ ResetGlobalPropertiesResponsePtr command(
+ CreateCommand<ResetGlobalPropertiesResponse>(message));
+
+ EXPECT_CALL(app_mngr_, SendMessageToMobile(message, _));
+ command->Run();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::VRHELPTITLE;
+
+ EXPECT_CALL(*mock_app_, reset_vr_help_title());
+ EXPECT_CALL(*mock_app_, reset_vr_help());
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ smart_objects::SmartObjectSPtr vr_help =
+ ::utils::MakeShared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Map);
+ EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_))
+ .WillOnce(Return(vr_help));
+
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ ResetGlobalPropertiesRequestPtr command =
+ CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+ command->Run();
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS),
+ am::commands::Command::ORIGIN_SDL));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitTTS_Timeout_GENERIC_ERROR_TTSNotRespond) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ utils::MakeShared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ ResetGlobalPropertiesRequestPtr command =
+ CreateCommand<ResetGlobalPropertiesRequest>(msg_);
+ command->Run();
+
+ // Received response only from UI
+ MessageSharedPtr ui_msg = CreateMessage();
+ (*ui_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*ui_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*ui_msg)[am::strings::msg_params] =
+ SmartObject(smart_objects::SmartType_Map);
+ Event ui_event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ ui_event.set_smart_object(*ui_msg);
+ command->on_event(ui_event);
+
+ // TTS doesn't respond, so timeout should send generic error
+ smart_objects::SmartObjectSPtr response =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+ const std::string info = "TTS component does not respond";
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::ORIGIN_SDL));
+ command->onTimeOut();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitUI_Timeout_GENERIC_ERROR_UINotRespond) {
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ utils::MakeShared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+
+ // Received response only from TTS
+ MessageSharedPtr tts_msg = CreateMessage();
+ (*tts_msg)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+ (*tts_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+
+ Event tts_event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ tts_event.set_smart_object(*tts_msg);
+ command_->on_event(tts_event);
+
+ // UI doesn't respond, so timeout should send generic error
+ smart_objects::SmartObjectSPtr response =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+
+ const std::string info = "UI component does not respond";
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::ORIGIN_SDL));
+ command_->onTimeOut();
+}
+
+TEST_F(ResetGlobalPropertiesRequestTest,
+ Run_WaitUIAndTTS_Timeout_GENERIC_ERROR_TTSAndUINotRespond) {
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::UNSUPPORTED_RESOURCE;
+
+ (*msg_)[am::strings::msg_params][am::strings::properties][0] =
+ mobile_apis::GlobalProperty::TIMEOUTPROMPT;
+ (*msg_)[am::strings::msg_params][am::strings::properties][1] =
+ mobile_apis::GlobalProperty::MENUICON;
+
+ std::vector<std::string> time_out_prompt;
+ time_out_prompt.push_back("time_out");
+ EXPECT_CALL(app_mngr_settings_, time_out_promt())
+ .WillOnce(ReturnRef(time_out_prompt));
+
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_));
+
+ smart_objects::SmartObjectSPtr prompt =
+ utils::MakeShared<smart_objects::SmartObject>();
+ *prompt = "prompt";
+
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get()));
+
+ EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::UI_SetGlobalProperties)))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::TTS_SetGlobalProperties)))
+ .WillOnce(Return(true));
+
+ command_->Run();
+ // TTS and UI don't respond, so timeout should send generic error
+ std::string info = "TTS, UI component does not respond";
+ smart_objects::SmartObjectSPtr response =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*response)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::GENERIC_ERROR;
+ EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _))
+ .WillOnce(Return(response));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResponseIs(mobile_apis::Result::GENERIC_ERROR, info, false),
+ am::commands::Command::ORIGIN_SDL));
+ command_->onTimeOut();
+}
+
+} // namespace reset_global_properties
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc
index 02744a66ea..4520e1b120 100644
--- a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc
+++ b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc
@@ -44,35 +44,45 @@
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
+namespace scrollable_message_request {
namespace am = application_manager;
+namespace hmi_response = am::hmi_response;
+namespace mobile_result = mobile_apis::Result;
+namespace am = ::application_manager;
+
using am::commands::ScrollableMessageRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::utils::SharedPtr;
using ::testing::_;
-using ::testing::Mock;
+using ::testing::Eq;
+using ::testing::Ref;
using ::testing::Return;
using ::testing::ReturnRef;
+using namespace am::strings;
+using test::components::policy_test::MockPolicyHandlerInterface;
+
namespace {
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const uint32_t kTimeOut = 30000u;
+const uint32_t kCorrelationId = 10u;
+const uint32_t kFunctionID = 3u;
} // namespace
class ScrollableMessageRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- ScrollableMessageRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
- MockMessageHelper& mock_message_helper_;
typedef TypeIf<kMocksAreNice,
NiceMock<application_manager_test::MockHMICapabilities>,
application_manager_test::MockHMICapabilities>::Result
@@ -98,6 +108,18 @@ class ScrollableMessageRequestTest
return msg;
}
+
+ void SetUp() OVERRIDE {
+ mock_app_ = CreateMockApp();
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+ command_ = CreateCommand<ScrollableMessageRequest>(msg_);
+ }
+
+ MockPolicyHandlerInterface mock_policy_handler_;
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ SharedPtr<ScrollableMessageRequest> command_;
};
typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities;
@@ -114,11 +136,6 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.WillByDefault(Return(mock_app));
ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
MockHMICapabilities hmi_capabilities;
ON_CALL(app_mngr_, hmi_capabilities())
@@ -133,10 +150,6 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
event.set_smart_object(*msg);
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
MessageSharedPtr ui_command_result;
EXPECT_CALL(
app_mngr_,
@@ -159,9 +172,118 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.asString()
.empty());
}
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
+TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_SUCCESS) {
+ (*msg_)[msg_params][timeout] = kTimeOut;
+ (*msg_)[msg_params][interaction_mode] =
+ mobile_apis::InteractionMode::MANUAL_ONLY;
+ EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ command_->Init();
+ EXPECT_EQ(kTimeOut, command_->default_timeout());
+}
+
+TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_UNSUCCESS) {
+ (*msg_)[msg_params][interaction_mode] =
+ mobile_apis::InteractionMode::MANUAL_ONLY;
+ EXPECT_EQ(kDefaultTimeout_, command_->default_timeout());
+ command_->Init();
+ EXPECT_EQ(kTimeOut, command_->default_timeout());
+}
+
+TEST_F(ScrollableMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+ command_->Run();
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ Run_SoftButtonProcessingResultWrogParameters_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_));
+ const mobile_apis::Result::eType processing_result =
+ mobile_apis::Result::ABORTED;
+ smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
+ EXPECT_CALL(
+ mock_message_helper_,
+ ProcessSoftButtons(
+ msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
+ .WillOnce(Return(processing_result));
+ MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command_)));
+ EXPECT_EQ(processing_result,
+ static_cast<mobile_apis::Result::eType>(
+ (*result_msg)[am::strings::msg_params][result_code].asInt()));
+}
+
+TEST_F(ScrollableMessageRequestTest, Run_SoftButtonProcessingResult_SUCCESS) {
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_));
+ smart_objects::SmartObject& msg_params = (*msg_)[am::strings::msg_params];
+ (*msg_)[am::strings::params][am::strings::function_id] = kFunctionID;
+ (*msg_)[am::strings::msg_params][am::strings::soft_buttons][0]
+ [am::strings::soft_button_id] = 0;
+ EXPECT_CALL(
+ mock_message_helper_,
+ ProcessSoftButtons(
+ msg_params, Eq(mock_app_), Ref(mock_policy_handler_), Ref(app_mngr_)))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _));
+
+ MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_)));
+ EXPECT_EQ(hmi_apis::FunctionID::UI_ScrollableMessage,
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*result_msg)[params][function_id].asInt()));
+}
+
+TEST_F(ScrollableMessageRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ OnEvent_ReceivedUIOnResetTimeoutEvent_SUCCESS) {
+ (*msg_)[params][connection_key] = kConnectionKey;
+ (*msg_)[params][correlation_id] = kCorrelationId;
+ EXPECT_CALL(
+ app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout_));
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ DISABLED_OnEvent_ReceivedUIScrollableMessage_SUCCESS) {
+ (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+TEST_F(ScrollableMessageRequestTest,
+ DISABLED_OnEvent_UnsupportedRCAndUICoop_SUCCESS) {
+ (*msg_)[params][hmi_response::code] =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _));
+ Event event(hmi_apis::FunctionID::UI_ScrollableMessage);
+ event.set_smart_object(*msg_);
+ command_->on_event(event);
+}
+
+} // namespace scrollable_message_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc
new file mode 100644
index 0000000000..2a3b5d922a
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2017 Xevo Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Xevo Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+
+#include "mobile/send_haptic_data_request.h"
+#include "mobile/send_haptic_data_response.h"
+
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace send_haptic_data {
+
+using ::testing::_;
+using ::testing::Return;
+
+namespace am = ::application_manager;
+
+using am::commands::SendHapticDataRequest;
+using am::commands::SendHapticDataResponse;
+using am::commands::MessageSharedPtr;
+
+typedef SharedPtr<SendHapticDataRequest> SendHapticDataRequestPtr;
+typedef SharedPtr<SendHapticDataResponse> SendHapticDataResponsePtr;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+}
+
+class SendHapticDataRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SendHapticDataRequestTest()
+ : msg_(CreateMessage(::smart_objects::SmartType_Map))
+ , mock_app_(CreateMockApp()) {}
+
+ void SetUp() OVERRIDE {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ }
+
+ MessageSharedPtr msg_;
+ MockAppPtr mock_app_;
+};
+
+class SendHapticDataResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ SendHapticDataResponseTest() : message_(CreateMessage()) {}
+
+ void SetUp() OVERRIDE {
+ command_sptr_ = CreateCommand<SendHapticDataResponse>(message_);
+ }
+
+ MessageSharedPtr message_;
+ SharedPtr<SendHapticDataResponse> command_sptr_;
+};
+
+TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData)))
+ .WillOnce(Return(true));
+
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(SendHapticDataRequestTest, Run_DISALLOWED) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(false));
+
+ EXPECT_CALL(*mock_app_, mobile_projection_enabled()).WillOnce(Return(false));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).WillOnce(Return(true));
+
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->Run();
+}
+
+TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) {
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::ORIGIN_SDL));
+
+ (*msg_)[am::strings::msg_params] = 0;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ Event event(hmi_apis::FunctionID::UI_SendHapticData);
+ event.set_smart_object(*msg_);
+ SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
+
+ command->Init();
+ command->on_event(event);
+}
+
+TEST_F(SendHapticDataResponseTest, Run_Success) {
+ ::smart_objects::SmartObject& message_ref = *message_;
+ message_ref[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
+ command_sptr_->Init();
+ command_sptr_->Run();
+}
+
+} // namespace send_haptic_data
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc
new file mode 100644
index 0000000000..c5786675d6
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc
@@ -0,0 +1,396 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "application_manager/commands/mobile/send_location_request.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "utils/shared_ptr.h"
+#include "commands/command_request_test.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace send_location_request {
+
+using application_manager::commands::MessageSharedPtr;
+using application_manager::commands::SendLocationRequest;
+using application_manager::MockMessageHelper;
+using test::components::application_manager_test::MockHMICapabilities;
+using smart_objects::SmartObject;
+using utils::SharedPtr;
+using testing::_;
+using testing::Return;
+using testing::ReturnRef;
+
+namespace strings = application_manager::strings;
+namespace hmi_response = application_manager::hmi_response;
+namespace Common_TextFieldName = hmi_apis::Common_TextFieldName;
+
+namespace {
+const uint32_t kConnectionKey = 1u;
+const uint32_t kFunctionID = 2u;
+const uint32_t kAppID = 3u;
+const double kLongitudeDegrees = 13.4;
+const std::string kLocationDescription = "Location_Description";
+const std::string kNewLine = "\\n";
+const std::string kAddressLine = "Address_Line";
+const std::string kPhoneNumber = "Phone_number";
+const std::string kCorrectAddress = "Correct address";
+const std::string kEmptyAddress = "";
+const std::string kAddressWithWrongSyntax = "Wrong Syntax\\n";
+} // namespace
+
+class SendLocationRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ class UnwrappedSendLocationRequest : public SendLocationRequest {
+ public:
+ UnwrappedSendLocationRequest(
+ const MessageSharedPtr& message,
+ application_manager::ApplicationManager& application_manager)
+ : SendLocationRequest(message, application_manager) {}
+
+ ::application_manager::CommandParametersPermissions&
+ get_parameters_permissions() {
+ return parameters_permissions_;
+ }
+ };
+
+ typedef SharedPtr<UnwrappedSendLocationRequest> CommandSPrt;
+
+ SendLocationRequestTest() {
+ mock_app_ = CreateMockApp();
+ disp_cap_ = utils::MakeShared<SmartObject>(smart_objects::SmartType_Map);
+ message_ = CreateMessage();
+ command_ = CreateCommand<UnwrappedSendLocationRequest>(message_);
+ }
+
+ void InitialSetup(MessageSharedPtr message_) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ (*message_)[strings::params][strings::function_id] = kFunctionID;
+ (*message_)[strings::msg_params] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ AllowMandatoryFields();
+ }
+
+ void HMICapabilitiesSetupHelper() {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(true));
+ }
+
+ void HMICapabilitiesSetupWithArguments(
+ Common_TextFieldName::eType field_name) {
+ HMICapabilitiesSetupHelper();
+ (*disp_cap_)[hmi_response::text_fields] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*disp_cap_)[hmi_response::text_fields][0] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*disp_cap_)[hmi_response::text_fields][0][strings::name] = field_name;
+ EXPECT_CALL(mock_hmi_capabilities_, display_capabilities())
+ .Times(2)
+ .WillRepeatedly(Return(disp_cap_.get()));
+ }
+
+ void FinishSetup() {
+ EXPECT_CALL(*mock_app_, hmi_app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Navigation_SendLocation)));
+ }
+
+ void FinishSetupCancelled(mobile_apis::Result::eType result) {
+ EXPECT_CALL(*mock_app_, hmi_app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(result), _));
+ }
+
+ void AllowMandatoryFields() {
+ application_manager::CommandParametersPermissions& permissions =
+ command_->get_parameters_permissions();
+ permissions.allowed_params.insert(strings::longitude_degrees);
+ permissions.allowed_params.insert(strings::latitude_degrees);
+ }
+
+ MockAppPtr mock_app_;
+ MockHMICapabilities mock_hmi_capabilities_;
+ SharedPtr<SmartObject> disp_cap_;
+ MessageSharedPtr message_;
+ CommandSPrt command_;
+};
+
+TEST_F(SendLocationRequestTest, Run_InvalidApp_Success) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ FinishSetupCancelled(mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_DeliveryMode_Success) {
+ InitialSetup(message_);
+ SmartObject msg_params = (*message_)[strings::msg_params];
+ msg_params[strings::delivery_mode] = SmartObject();
+ (*message_)[strings::msg_params] = msg_params;
+ msg_params.erase(strings::delivery_mode);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationNameWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_name] = "Location_Name\\n";
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationName);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationDescriptionWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_description] =
+ kLocationDescription + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::locationDescription);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesAreAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesAreNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] = kAddressLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressLinesWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address_lines] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address_lines][0] =
+ kAddressLine + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::addressLines);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberIsAllowed_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberIsNotAllowed_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::INVALID_ENUM);
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_PhoneNumberWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] =
+ kPhoneNumber + kNewLine;
+ HMICapabilitiesSetupWithArguments(Common_TextFieldName::phoneNumber);
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_AddressesContainWrongSyntax_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::address] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*message_)[strings::msg_params][strings::address]["Address 1"] =
+ kCorrectAddress;
+ (*message_)[strings::msg_params][strings::address]["Address 2"] =
+ kAddressWithWrongSyntax;
+ FinishSetupCancelled(mobile_apis::Result::INVALID_DATA);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageValid_Success) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "1";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ FinishSetup();
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_LocationImageInvalid_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::location_image] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::location_image][strings::value] =
+ "1";
+ EXPECT_CALL(
+ mock_message_helper_,
+ VerifyImage(
+ (*message_)[strings::msg_params][strings::location_image], _, _))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+ FinishSetupCancelled(mobile_apis::Result::ABORTED);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, Run_HMIUINotCoop_Cancelled) {
+ InitialSetup(message_);
+ (*message_)[strings::msg_params][strings::phone_number] = kPhoneNumber;
+ (*disp_cap_)[hmi_response::text_fields] =
+ SmartObject(smart_objects::SmartType_Array);
+ (*disp_cap_)[hmi_response::text_fields][0] =
+ SmartObject(smart_objects::SmartType_Map);
+ (*disp_cap_)[hmi_response::text_fields][0][strings::name] =
+ Common_TextFieldName::phoneNumber;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ EXPECT_CALL(mock_hmi_capabilities_, is_ui_cooperating())
+ .WillOnce(Return(false));
+ FinishSetupCancelled(mobile_apis::Result::UNSUPPORTED_RESOURCE);
+ command_->Run();
+}
+
+TEST_F(SendLocationRequestTest, OnEvent_Success) {
+ mobile_apis::Result::eType response_code = mobile_apis::Result::SUCCESS;
+ (*message_)[strings::params][hmi_response::code] = response_code;
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+
+ Event event(hmi_apis::FunctionID::Navigation_SendLocation);
+ event.set_smart_object(*message_);
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(app));
+
+ command_->on_event(event);
+}
+
+TEST_F(SendLocationRequestTest, OnEvent_Cancelled) {
+ (*message_)[strings::params][hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+ Event event(hmi_apis::FunctionID::Navigation_OnWayPointChange);
+ event.set_smart_object(*message_);
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _))
+ .Times(0);
+ command_->on_event(event);
+}
+
+TEST_F(SendLocationRequestTest, Run_MandatoryParamsDisallowed_InvalidData) {
+ (*message_)[strings::params][strings::connection_key] = kConnectionKey;
+ (*message_)[strings::params][strings::function_id] = kFunctionID;
+ (*message_)[strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+ (*message_)[strings::msg_params][strings::address] = kCorrectAddress;
+ (*message_)[strings::msg_params][strings::longitude_degrees] =
+ kLongitudeDegrees;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ application_manager::CommandParametersPermissions& permissions =
+ command_->get_parameters_permissions();
+ // 1st one allowed
+ permissions.allowed_params.insert(strings::longitude_degrees);
+ // 2nd one disallowed
+ permissions.disallowed_params.insert(strings::latitude_degrees);
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _));
+ command_->Run();
+}
+
+} // namespace send_location_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc
index 9e5e62fc1c..b278479df8 100644
--- a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc
+++ b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc
@@ -47,16 +47,16 @@
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
+namespace set_app_icon_request {
namespace am = application_manager;
using am::commands::SetAppIconRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::utils::SharedPtr;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -69,10 +69,6 @@ const uint32_t kConnectionKey = 2u;
class SetAppIconRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- SetAppIconRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
- MockMessageHelper& mock_message_helper_;
-
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
@@ -116,12 +112,6 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
ON_CALL(*mock_app, set_app_icon_path(_)).WillByDefault(Return(true));
ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(file_path));
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
-
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
@@ -130,10 +120,6 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
Event event(hmi_apis::FunctionID::UI_SetAppIcon);
event.set_smart_object(*msg);
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
MessageSharedPtr ui_command_result;
EXPECT_CALL(
app_mngr_,
@@ -156,9 +142,10 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.asString()
.empty());
}
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
+} // namespace set_app_icon_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc
index 839d9a452e..8444b88d63 100644
--- a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc
+++ b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc
@@ -48,32 +48,42 @@
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace set_display_layout_request {
namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
using am::commands::SetDisplayLayoutRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::utils::SharedPtr;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
+typedef ::utils::SharedPtr<SetDisplayLayoutRequest> CommandPtr;
+
namespace {
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationKey = 2u;
} // namespace
+MATCHER_P(CheckMshCorrId, corr_id, "") {
+ return (*arg)[am::strings::params][am::strings::correlation_id].asUInt() ==
+ corr_id;
+}
+
class SetDisplayLayoutRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- SetDisplayLayoutRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ SetDisplayLayoutRequestTest() : mock_app_(CreateMockApp()) {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -94,18 +104,6 @@ class SetDisplayLayoutRequestTest
return msg;
}
-
- void SetUp() OVERRIDE {
- ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
- ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
- }
typedef TypeIf<kMocksAreNice,
NiceMock<application_manager_test::MockHMICapabilities>,
application_manager_test::MockHMICapabilities>::Result
@@ -123,8 +121,6 @@ class SetDisplayLayoutRequestTest
}
sync_primitives::Lock lock_;
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
MockAppPtr mock_app_;
};
@@ -154,13 +150,10 @@ TEST_F(SetDisplayLayoutRequestTest,
Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
event.set_smart_object(*msg);
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- ON_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillByDefault(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
MessageSharedPtr ui_command_result;
EXPECT_CALL(
app_mngr_,
@@ -172,7 +165,90 @@ TEST_F(SetDisplayLayoutRequestTest,
ResultCommandExpectations(ui_command_result, "UI is not supported by system");
}
+TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+
+ MockAppPtr invalid_mock_app;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(invalid_mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ command->Run();
+}
+
+TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) {
+ MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map));
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+ EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationKey));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetDisplayLayout))
+ .WillRepeatedly(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(CheckMshCorrId(kCorrelationKey)))
+ .WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_InvalidEventId_UNSUCCESS) {
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>());
+ am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ SmartObject msg(smart_objects::SmartType_Map);
+
+ event.set_smart_object(msg);
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities()).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
+ am::event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout);
+ MessageSharedPtr msg = CreateMessage();
+
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params][am::hmi_response::display_capabilities] = 0;
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ event.set_smart_object(*msg);
+
+ MockHMICapabilities hmi_capabilities;
+ MessageSharedPtr dispaly_capabilities_msg = CreateMessage();
+ (*dispaly_capabilities_msg)[am::hmi_response::templates_available] =
+ "templates_available";
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(hmi_capabilities));
+
+ EXPECT_CALL(hmi_capabilities, display_capabilities())
+ .WillOnce(Return(dispaly_capabilities_msg.get()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+
+ CommandPtr command(CreateCommand<SetDisplayLayoutRequest>(msg));
+ command->on_event(event);
+}
+
} // namespace set_display_layout_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc
index 487be74667..641e5636a9 100644
--- a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc
+++ b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc
@@ -47,6 +47,7 @@
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
namespace set_global_properties_request {
namespace am = application_manager;
@@ -54,10 +55,10 @@ using am::commands::SetGlobalPropertiesRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
+using am::CommandsMap;
+using utils::custom_string::CustomString;
using ::utils::SharedPtr;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -65,15 +66,15 @@ namespace {
const int32_t kCommandId = 1;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
-const uint32_t kConnectionKey = 2u;
+const uint32_t kConnectionKey = 1u;
+const std::string kText = "one";
+const uint32_t kPosition = 1u;
} // namespace
class SetGlobalPropertiesRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- SetGlobalPropertiesRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ SetGlobalPropertiesRequestTest() : mock_app_(CreateMockApp()) {}
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -99,16 +100,121 @@ class SetGlobalPropertiesRequestTest
return msg;
}
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ return msg;
+ }
+
+ void VRArraySetupHelper(MessageSharedPtr msg,
+ SmartObject& vr_help_title,
+ SmartObject& vr_help_array) {
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ }
+
+ void OnEventUISetupHelper(MessageSharedPtr msg,
+ SharedPtr<SetGlobalPropertiesRequest> command) {
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ EXPECT_CALL(mock_message_helper_,
+ VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ command->Run();
+ }
+
+ void OnEventTTSSetupHelper(MessageSharedPtr msg,
+ SharedPtr<SetGlobalPropertiesRequest> command) {
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] =
+ timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_,
+ RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title("title");
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ command->Run();
+ }
+
+ void EmptyExpectationsSetupHelper() {
+ EXPECT_CALL(*mock_app_, set_vr_help_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_vr_help(_)).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help_title()).Times(0);
+ EXPECT_CALL(*mock_app_, vr_help()).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ }
+
+ void ExpectInvalidData() {
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
+ am::commands::Command::ORIGIN_SDL));
+ }
+
+ void ExpectVerifyImageVrHelpSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageVrHelpUnsuccess() {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
+ void ExpectVerifyImageSuccess(SmartObject& smart_obj) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(smart_obj, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ }
+
void SetUp() OVERRIDE {
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
}
void ResultCommandExpectations(MessageSharedPtr msg,
@@ -124,23 +230,21 @@ class SetGlobalPropertiesRequestTest
void ExpectationsHmiInterface_Run() {
EXPECT_CALL(
- hmi_interfaces_,
+ mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
.WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
EXPECT_CALL(
- hmi_interfaces_,
+ mock_hmi_interfaces_,
GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
.WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
- ON_CALL(hmi_interfaces_,
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
- ON_CALL(hmi_interfaces_,
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ ON_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
- .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
}
sync_primitives::Lock lock_;
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
MockAppPtr mock_app_;
};
@@ -184,8 +288,6 @@ TEST_F(SetGlobalPropertiesRequestTest,
ON_CALL(mock_message_helper_, VerifyImage(_, _, _))
.WillByDefault(Return(mobile_apis::Result::SUCCESS));
- EXPECT_CALL(*mock_app_, UpdateHash());
-
(*msg_vr)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::SUCCESS;
Event event_vr(hmi_apis::FunctionID::TTS_SetGlobalProperties);
@@ -232,6 +334,8 @@ TEST_F(SetGlobalPropertiesRequestTest,
MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map);
(*response)[am::strings::params][am::hmi_response::code] =
hmi_apis::Common_Result::SUCCESS;
+ (*response)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
(*response)[am::strings::msg_params][am::strings::info] = "qwe";
am::event_engine::Event event_tts(
@@ -243,16 +347,7 @@ TEST_F(SetGlobalPropertiesRequestTest,
utils::SharedPtr<SetGlobalPropertiesRequest> command =
CreateCommand<SetGlobalPropertiesRequest>(response);
- MockAppPtr mock_app(CreateMockApp());
- ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
-
- ON_CALL(mock_message_helper_, HMIToMobileResult(_))
- .WillByDefault(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillRepeatedly(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_))
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
MessageSharedPtr response_to_mobile;
@@ -274,7 +369,861 @@ TEST_F(SetGlobalPropertiesRequestTest,
static_cast<int32_t>(mobile_apis::Result::INVALID_DATA));
}
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ OnEventUISetupHelper(msg, command);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_vr_help(vr_help_array));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(menu_icon));
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::ABORTED)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenVRHelp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::ABORTED)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRIncorrectSyntax_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId;
+ SmartObject vr_help_title("wrong syntax string\\n");
+ SmartObject menu_icon(smart_objects::SmartType_Map);
+ menu_icon[am::strings::value] = "1";
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_icon] = menu_icon;
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+
+ EXPECT_CALL(mock_message_helper_, VerifyImage(menu_icon, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingTitle_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingArray_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ (*msg)[am::strings::msg_params][am::strings::vr_help_title] = vr_help_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRWrongOrder_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help_title("yes");
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ VRArraySetupHelper(msg, vr_help_title, vr_help_array);
+ vr_help_array[1] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[1][am::strings::text] = "two";
+ vr_help_array[1][am::strings::position] = 3u;
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array;
+
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(vr_help_array, _, _))
+ .WillOnce((Return(mobile_apis::Result::SUCCESS)));
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title("Menu_Title");
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, set_menu_title(menu_title));
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_VRCouldNotGenerate_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+ SmartObject menu_title("Menu_Title");
+ (*msg)[am::strings::msg_params][am::hmi_request::menu_title] = menu_title;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject* vr_help_title = NULL;
+ CommandsMap commands_map;
+ SmartObject empty_msg(smart_objects::SmartType_Map);
+ commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &empty_msg));
+ DataAccessor<CommandsMap> accessor(commands_map, lock_);
+ EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(vr_help_title));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::INVALID_DATA),
+ am::commands::Command::ORIGIN_SDL));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title(smart_objects::SmartType_Null);
+ EXPECT_CALL(*mock_app_, vr_help_title())
+ .WillOnce(Return(&vr_help_title))
+ .WillOnce(Return(&vr_help_title));
+
+ CommandsMap commands_map;
+ DataAccessor<CommandsMap> accessor(commands_map, lock_);
+ EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
+ const CustomString name("name");
+ EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(_));
+ EXPECT_CALL(*mock_app_, app_id());
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title(smart_objects::SmartType_Null);
+ EXPECT_CALL(*mock_app_, vr_help_title())
+ .Times(2)
+ .WillRepeatedly(Return(&vr_help_title));
+
+ CommandsMap commands_map;
+ SmartObject command_text(smart_objects::SmartType_Map);
+ commands_map[0] = &command_text;
+ (*commands_map[0])[am::strings::vr_commands] = SmartObject("one");
+ DataAccessor<CommandsMap> accessor(commands_map, lock_);
+ EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
+ EXPECT_CALL(*mock_app_, set_vr_help(_));
+ const CustomString name("name");
+ EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ EXPECT_CALL(*mock_app_, vr_help()).WillOnce(Return(&vr_help_array));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataFromSynonyms_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject keyboard_properties(smart_objects::SmartType_Map);
+ (*msg)[am::strings::msg_params][am::hmi_request::keyboard_properties] =
+ keyboard_properties;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title(smart_objects::SmartType_Null);
+ EXPECT_CALL(*mock_app_, vr_help_title())
+ .Times(2)
+ .WillRepeatedly(Return(&vr_help_title));
+
+ CommandsMap commands_map;
+ DataAccessor<CommandsMap> accessor(commands_map, lock_);
+ EXPECT_CALL(*mock_app_, commands_map()).WillOnce(Return(accessor));
+ SmartObject vr_help_array(smart_objects::SmartType_Array);
+ vr_help_array[0] = SmartObject(smart_objects::SmartType_Map);
+ vr_help_array[0][am::strings::text] = kText;
+ vr_help_array[0][am::strings::position] = kPosition;
+ SmartObject vr_synonyms(smart_objects::SmartType_Array);
+ vr_synonyms[0] = vr_help_array;
+ const CustomString name("name");
+ EXPECT_CALL(*mock_app_, name()).WillOnce(ReturnRef(name));
+ EXPECT_CALL(*mock_app_, set_vr_help_title(SmartObject(name)));
+ EXPECT_CALL(*mock_app_, set_menu_title(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_menu_icon(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title("title");
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] = "Help_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title("title");
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, set_help_prompt(help_prompt));
+ EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(&help_prompt));
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(_)).Times(0);
+ EXPECT_CALL(*mock_app_, timeout_prompt()).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey));
+ SmartObject vr_help_title("title");
+ EXPECT_CALL(*mock_app_, vr_help_title()).WillOnce(Return(&vr_help_title));
+ EXPECT_CALL(*mock_app_, set_help_prompt(_)).Times(0);
+ EXPECT_CALL(*mock_app_, help_prompt()).Times(0);
+ EXPECT_CALL(*mock_app_, set_timeout_prompt(timeout_prompt));
+ EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_TTSIncorrectSyntax_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject timeout_prompt(smart_objects::SmartType_Array);
+ timeout_prompt[0][am::strings::text] = "Timeout_Prompt_One\\n";
+ (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0);
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidHelpPromptText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject help_prompt(smart_objects::SmartType_Array);
+ help_prompt[0][am::strings::text] =
+ "invalid help prompt text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidVrHelpText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help(smart_objects::SmartType_Array);
+ vr_help[0][am::strings::text] =
+ "invalid vr_help text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
+
+ ExpectVerifyImageVrHelpSuccess(vr_help);
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidImageValue_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject vr_help(smart_objects::SmartType_Array);
+ vr_help[0][am::strings::text] = "vr_help";
+ vr_help[0][am::strings::image][am::strings::value] =
+ "invalid value text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help;
+
+ ExpectVerifyImageVrHelpSuccess(vr_help);
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuIcon_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject menu_icon(smart_objects::SmartType_Array);
+ menu_icon[am::strings::value] =
+ "invalid menu icon text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::menu_icon] = menu_icon;
+
+ ExpectVerifyImageSuccess(menu_icon);
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuTitle_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject menu_title(smart_objects::SmartType_Array);
+ menu_title = "invalid menu title text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::menu_title] = menu_title;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_InvalidLimitedCharacterList_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject limited_character_list(smart_objects::SmartType_Array);
+ limited_character_list[0] =
+ "invalid limited character list text with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
+ [am::strings::limited_character_list] = limited_character_list;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ Run_InvalidAutoCompleteText_INVALID_DATA) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject auto_complete_text(smart_objects::SmartType_Array);
+ auto_complete_text =
+ "invalid auto completetext with empty line in the end\\n";
+ (*msg)[am::strings::msg_params][am::strings::keyboard_properties]
+ [am::strings::auto_complete_text] = auto_complete_text;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ ExpectInvalidData();
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_NoData_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ ExpectVerifyImageVrHelpUnsuccess();
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+
+ ExpectVerifyImageVrHelpUnsuccess();
+
+ EmptyExpectationsSetupHelper();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ command->Run();
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ OnEventUISetupHelper(msg, command);
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ OnEventUISetupHelper(msg, command);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
+ .WillOnce(Return(true));
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventUISetupHelper(msg, command);
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(MockAppPtr()));
+
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey)).Times(0);
+ EXPECT_CALL(*mock_app_, UpdateHash()).Times(0);
+
+ Event event(hmi_apis::FunctionID::TTS_Stopped);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_TTSAndSuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventTTSSetupHelper(msg, command);
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+TEST_F(SetGlobalPropertiesRequestTest,
+ OnEvent_TTSAndWarningsResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ const hmi_apis::Common_Result::eType response_code =
+ hmi_apis::Common_Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::code] = response_code;
+ ON_CALL(
+ mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+ SharedPtr<SetGlobalPropertiesRequest> command(
+ CreateCommand<SetGlobalPropertiesRequest>(msg));
+
+ OnEventTTSSetupHelper(msg, command);
+
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE));
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(hmi_apis::Common_Result::WARNINGS));
+}
+
} // namespace set_global_properties_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc
index e7e4513f15..cf668c8b36 100644
--- a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc
+++ b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc
@@ -53,36 +53,33 @@ namespace am = ::application_manager;
using am::commands::SetMediaClockRequest;
using am::commands::MessageSharedPtr;
using am::event_engine::Event;
-using am::MockHmiInterfaces;
using am::MockMessageHelper;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
+namespace UpdateMode = mobile_apis::UpdateMode;
+
typedef SharedPtr<SetMediaClockRequest> SetMediaClockRequestPtr;
namespace {
const uint32_t kConnectionKey = 2u;
+const uint32_t kCorrelationId = 2u;
+const uint32_t kAppID = 2u;
+const uint32_t kHours = 2u;
+const uint32_t kMinutes = 26u;
+const uint32_t kSeconds = 1u;
} // namespace
class SetMediaClockRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- SetMediaClockRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock())
- , mock_app_(CreateMockApp()) {}
+ SetMediaClockRequestTest() : mock_app_(CreateMockApp()) {}
void SetUp() OVERRIDE {
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app_));
ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
- ON_CALL(app_mngr_, hmi_interfaces())
- .WillByDefault(ReturnRef(hmi_interfaces_));
- }
-
- void TearDown() OVERRIDE {
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
void ResultCommandExpectations(MessageSharedPtr msg,
@@ -96,8 +93,20 @@ class SetMediaClockRequestTest
info);
}
- NiceMock<MockHmiInterfaces> hmi_interfaces_;
- MockMessageHelper& mock_message_helper_;
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ return msg;
+ }
+
+ void ExpectationsSetupHelper(bool is_media) {
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(is_media));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ }
+
MockAppPtr mock_app_;
};
@@ -119,14 +128,10 @@ TEST_F(SetMediaClockRequestTest,
Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
event.set_smart_object(*ev_msg);
- EXPECT_CALL(hmi_interfaces_,
+ EXPECT_CALL(mock_hmi_interfaces_,
GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
.WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_RESPONSE));
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
MessageSharedPtr ui_command_result;
EXPECT_CALL(
app_mngr_,
@@ -138,6 +143,208 @@ TEST_F(SetMediaClockRequestTest,
ResultCommandExpectations(ui_command_result, "UI is not supported by system");
}
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTUP;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
+ kSeconds;
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::seconds] = kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID));
+ EXPECT_CALL(app_mngr_, GetNextHMICorrelationID())
+ .WillOnce(Return(kCorrelationId));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI));
+ ON_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountUpWrongTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTUP;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::seconds] = kSeconds;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_UpdateCountDownWrongTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+ (*msg)[am::strings::msg_params][am::strings::start_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::start_time]
+ [am::strings::minutes] = kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::hours] =
+ kHours;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] =
+ kMinutes;
+ (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] =
+ kSeconds;
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, is_media_application()).WillOnce(Return(true));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+ (*msg)[am::strings::msg_params][am::strings::update_mode] =
+ UpdateMode::COUNTDOWN;
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(true);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ ExpectationsSetupHelper(false);
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(*mock_app_, is_media_application()).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+
+ command->Run();
+}
+
+TEST_F(SetMediaClockRequestTest, OnEvent_Success) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Null);
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+
+ MockAppPtr app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app));
+
+ Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer);
+ event.set_smart_object(*msg);
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+ command->on_event(event);
+}
+
+TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<SetMediaClockRequest> command(
+ CreateCommand<SetMediaClockRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
} // namespace set_media_clock_timer_request
} // namespace mobile_commands_test
} // namespace commands_test
diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc
index 89c600362b..4752bac0fd 100644
--- a/src/components/application_manager/test/commands/mobile/show_test.cc
+++ b/src/components/application_manager/test/commands/mobile/show_test.cc
@@ -43,20 +43,22 @@
#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
+namespace show_request {
namespace am = application_manager;
using am::commands::ShowRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
+using test::components::policy_test::MockPolicyHandlerInterface;
using ::utils::SharedPtr;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
@@ -65,12 +67,14 @@ const int32_t kCommandId = 1;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const uint32_t kFunctionID = 3u;
} // namespace
class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
- ShowRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+ ShowRequestTest() {
+ mock_app_ = CreateMockApp();
+ }
sync_primitives::Lock lock_;
MessageSharedPtr CreateFullParamsUISO() {
@@ -92,7 +96,113 @@ class ShowRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
return msg;
}
- MockMessageHelper& mock_message_helper_;
+
+ MessageSharedPtr CreateMsgParams() {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ return msg;
+ }
+
+ void TestSetupHelper(MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ msg_params.erase(field);
+ msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_name] =
+ static_cast<int32_t>(field_name);
+ msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] =
+ text_field_;
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+ }
+
+ void TestSetupHelperWrongSyntax(
+ MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ msg_params[field] = text_field_;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+ }
+
+ void TestSetupHelperWithMetadata(
+ MessageSharedPtr msg,
+ hmi_apis::Common_TextFieldName::eType field_name,
+ const char* field,
+ size_t num_tags,
+ int32_t* field_tags,
+ bool set_field_text = true) {
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::params][am::strings::function_id] = kFunctionID;
+ if (set_field_text) {
+ msg_params[field] = text_field_;
+ }
+ msg_params[am::strings::metadata_tags][field] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = field_tags[i];
+ msg_params[am::strings::metadata_tags][field][i] = current_tag;
+ }
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ EXPECT_EQ((*msg)[am::strings::msg_params], msg_params);
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params.erase(field);
+ msg_params.erase(am::strings::metadata_tags);
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ if (set_field_text) {
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_name] =
+ static_cast<int32_t>(field_name);
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_text] = text_field_;
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_types] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < num_tags; ++i) {
+ const int32_t current_tag = field_tags[i];
+ msg_params[am::hmi_request::show_strings][0]
+ [am::hmi_request::field_types][i] = current_tag;
+ }
+ }
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+ }
+
+ MockAppPtr mock_app_;
+ std::string text_field_;
};
TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
@@ -108,13 +218,6 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
ON_CALL(app_mngr_, application(kConnectionKey))
.WillByDefault(Return(mock_app));
ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- ON_CALL(hmi_interfaces, GetInterfaceFromFunction(_))
- .WillByDefault(
- Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication));
- ON_CALL(hmi_interfaces, GetInterfaceState(_))
- .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::hmi_response::code] =
@@ -124,10 +227,6 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
Event event(hmi_apis::FunctionID::UI_Show);
event.set_smart_object(*msg);
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
MessageSharedPtr vr_command_result;
EXPECT_CALL(
app_mngr_,
@@ -150,9 +249,689 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.asString()
.empty());
}
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
+TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "Soft_Buttons";
+ (*msg)[am::strings::msg_params] = msg_params;
+ SmartObject creation_msg_params(msg_params);
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(
+ mock_message_helper_,
+ SubscribeApplicationToSoftButton(creation_msg_params, _, kFunctionID));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "";
+ (*msg)[am::strings::msg_params] = msg_params;
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler()).Times(0);
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(_, _, _, _)).Times(0);
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(*mock_app_, UnsubscribeFromSoftButtons(kFunctionID));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::soft_buttons] = "Soft_Buttons";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ MockPolicyHandlerInterface mock_policy_handler;
+ EXPECT_CALL(app_mngr_, GetPolicyHandler())
+ .WillOnce(ReturnRef(mock_policy_handler));
+ EXPECT_CALL(mock_message_helper_, ProcessSoftButtons(msg_params, _, _, _))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(mock_message_helper_, SubscribeApplicationToSoftButton(_, _, _))
+ .Times(0);
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "\\n";
+ msg_params[am::strings::graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(_, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "1";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _))
+ .WillOnce(Return(mobile_apis::Result::ABORTED));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject graphic(smart_objects::SmartType_Map);
+ graphic[am::strings::value] = "";
+ msg_params[am::strings::secondary_graphic] = graphic;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_message_helper_, VerifyImage(graphic, _, _)).Times(0);
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 5;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaTitle,
+ hmi_apis::Common_MetadataType::mediaArtist,
+ hmi_apis::Common_MetadataType::rating,
+ hmi_apis::Common_MetadataType::humidity,
+ hmi_apis::Common_MetadataType::currentTemperature};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_2";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField2,
+ am::strings::main_field_2,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_3";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField3,
+ am::strings::main_field_3,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_4";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField4,
+ am::strings::main_field_4,
+ num_tags,
+ tags);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Main_Field_1";
+ const size_t num_tags = 1;
+ int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist};
+ TestSetupHelperWithMetadata(msg,
+ hmi_apis::Common_TextFieldName::mainField1,
+ am::strings::main_field_1,
+ num_tags,
+ tags,
+ false);
+ command->Run();
+
+ MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map);
+ (*ev_msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey;
+ (*ev_msg)[am::strings::msg_params][am::strings::info] = "";
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*ev_msg);
+
+ MessageSharedPtr ui_command_result;
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
+ .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true)));
+
+ command->on_event(event);
+
+ EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success]
+ .asBool(),
+ true);
+ EXPECT_EQ(
+ (*ui_command_result)[am::strings::msg_params][am::strings::result_code]
+ .asInt(),
+ static_cast<int32_t>(mobile_apis::Result::WARNINGS));
+}
+
+TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Clock";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mediaClock,
+ am::strings::media_clock);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Clock\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mediaClock,
+ am::strings::media_clock);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Track";
+ TestSetupHelper(msg,
+ hmi_apis::Common_TextFieldName::mediaTrack,
+ am::strings::media_track);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Media_Track\\n";
+ TestSetupHelperWrongSyntax(msg,
+ hmi_apis::Common_TextFieldName::mediaTrack,
+ am::strings::media_track);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Status_Bar";
+ TestSetupHelper(
+ msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_StatusBar_WrongSyntax) {
+ MessageSharedPtr msg = CreateMessage();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ text_field_ = "Status_Bar\\n";
+ TestSetupHelperWrongSyntax(
+ msg, hmi_apis::Common_TextFieldName::statusBar, am::strings::status_bar);
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ msg_params[am::strings::alignment] = "Alignment";
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject custom_presets(smart_objects::SmartType_Array);
+ custom_presets[0] = "Custom_Presets";
+ msg_params[am::strings::custom_presets] = custom_presets;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId));
+
+ msg_params[am::strings::app_id] = kAppId;
+ msg_params[am::hmi_request::show_strings] =
+ smart_objects::SmartObject(smart_objects::SmartType_Array);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_));
+ EXPECT_CALL(*mock_app_, set_show_command(msg_params));
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) {
+ MessageSharedPtr msg = CreateMsgParams();
+ SmartObject msg_params(smart_objects::SmartType_Map);
+ SmartObject custom_presets(smart_objects::SmartType_Array);
+ custom_presets[0] = "Custom_Presets\\t";
+ msg_params[am::strings::custom_presets] = custom_presets;
+ (*msg)[am::strings::msg_params] = msg_params;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(MockAppPtr()));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
+ MessageSharedPtr msg = CreateMsgParams();
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ EXPECT_CALL(*mock_app_, app_id()).Times(0);
+ EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0);
+ EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0);
+
+ command->Run();
+}
+
+TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::eType::SUCCESS;
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _));
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::WARNINGS;
+ (*msg)[am::strings::params][am::hmi_response::message] = "Response Info";
+ (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+
+ Event event(hmi_apis::FunctionID::UI_Show);
+ event.set_smart_object(*msg);
+
+ EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_));
+
+ command->on_event(event);
+}
+
+TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) {
+ MessageSharedPtr msg = CreateMessage();
+ (*msg)[am::strings::params][am::hmi_response::code] =
+ mobile_apis::Result::SUCCESS;
+
+ SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::UI_Alert);
+ event.set_smart_object(*msg);
+
+ command->on_event(event);
+}
+
+} // namespace show_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc
index b8b2409c15..7ded373d29 100644
--- a/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc
+++ b/src/components/application_manager/test/commands/mobile/simple_notification_commands_test.cc
@@ -37,24 +37,27 @@
#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
#include "application_manager/smart_object_keys.h"
-#include "application_manager/commands/command_impl.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
-#include "application_manager/commands/mobile/on_app_interface_unregistered_notification.h"
-#include "application_manager/commands/mobile/on_audio_pass_thru_notification.h"
-#include "application_manager/commands/mobile/on_driver_distraction_notification.h"
-#include "application_manager/commands/mobile/on_language_change_notification.h"
-#include "application_manager/commands/mobile/on_permissions_change_notification.h"
+#include "application_manager/mock_message_helper.h"
+#include "command_impl.h"
+#include "commands/commands_test.h"
+#include "mobile/on_app_interface_unregistered_notification.h"
+#include "mobile/on_audio_pass_thru_notification.h"
+#include "mobile/on_driver_distraction_notification.h"
+#include "mobile/on_language_change_notification.h"
+#include "mobile/on_permissions_change_notification.h"
namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace simple_notification_commands_test {
namespace am = ::application_manager;
namespace commands = am::commands;
using ::testing::_;
using ::testing::Types;
+using ::testing::Return;
template <class Command>
class MobileNotificationCommandsTest
@@ -89,6 +92,7 @@ TYPED_TEST(MobileNotificationCommandsTest, Run_SendMessageToMobile_SUCCESS) {
command->Run();
}
+} // namespace simple_notification_commands_test
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
index 9534da9561..d80a7e0551 100644
--- a/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
+++ b/src/components/application_manager/test/commands/mobile/simple_response_commands_test.cc
@@ -34,32 +34,55 @@
#include <string>
#include "gtest/gtest.h"
+#include "utils/helpers.h"
#include "utils/shared_ptr.h"
-#include "application_manager/test/include/application_manager/commands/commands_test.h"
+#include "commands/commands_test.h"
#include "application_manager/mock_application_manager.h"
-#include "application_manager/include/application_manager/commands/mobile/read_did_response.h"
-#include "application_manager/include/application_manager/commands/mobile/delete_command_response.h"
-#include "application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h"
-#include "application_manager/include/application_manager/commands/mobile/alert_response.h"
-#include "application_manager/include/application_manager/commands/mobile/list_files_response.h"
-#include "application_manager/include/application_manager/commands/mobile/subscribe_button_response.h"
-#include "application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h"
-#include "application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h"
-#include "application_manager/include/application_manager/commands/mobile/dial_number_response.h"
-#include "application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h"
-#include "application_manager/include/application_manager/commands/mobile/get_dtcs_response.h"
-#include "application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h"
-#include "application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h"
-#include "application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h"
-#include "application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h"
-#include "application_manager/include/application_manager/commands/mobile/update_turn_list_response.h"
+#include "mobile/read_did_response.h"
+#include "mobile/delete_command_response.h"
+#include "mobile/alert_maneuver_response.h"
+#include "mobile/alert_response.h"
+#include "mobile/list_files_response.h"
+#include "mobile/subscribe_button_response.h"
+#include "mobile/add_sub_menu_response.h"
+#include "mobile/diagnostic_message_response.h"
+#include "mobile/dial_number_response.h"
+#include "mobile/end_audio_pass_thru_response.h"
+#include "mobile/get_dtcs_response.h"
+#include "mobile/get_vehicle_data_response.h"
+#include "mobile/unregister_app_interface_response.h"
+#include "mobile/unsubscribe_button_response.h"
+#include "mobile/unsubscribe_way_points_response.h"
+#include "mobile/update_turn_list_response.h"
+#include "mobile/slider_response.h"
+#include "mobile/speak_response.h"
+#include "mobile/subscribe_vehicle_data_response.h"
+#include "mobile/subscribe_way_points_response.h"
+#include "mobile/system_response.h"
+#include "mobile/get_way_points_response.h"
+#include "mobile/perform_interaction_response.h"
+#include "mobile/perform_audio_pass_thru_response.h"
+#include "mobile/set_global_properties_response.h"
+#include "mobile/set_media_clock_timer_response.h"
+#include "mobile/show_constant_tbt_response.h"
+#include "mobile/show_response.h"
+#include "mobile/add_command_response.h"
+#include "mobile/send_location_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/set_display_layout_response.h"
+#include "mobile/generic_response.h"
+#include "mobile/set_app_icon_response.h"
+#include "mobile/scrollable_message_response.h"
+#include "mobile/change_registration_response.h"
namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace simple_response_commands_test {
namespace commands = ::application_manager::commands;
+namespace am = ::application_manager;
using ::testing::_;
using ::testing::NotNull;
@@ -89,7 +112,26 @@ typedef Types<commands::ListFilesResponse,
commands::UnregisterAppInterfaceResponse,
commands::UnsubscribeWayPointsResponse,
commands::UpdateTurnListResponse,
- commands::UnsubscribeButtonResponse> ResponseCommandsList;
+ commands::UnsubscribeButtonResponse,
+ commands::SliderResponse,
+ commands::SpeakResponse,
+ commands::SubscribeVehicleDataResponse,
+ commands::SubscribeWayPointsResponse,
+ commands::SystemResponse,
+ commands::GetWayPointsResponse,
+ commands::PerformInteractionResponse,
+ commands::PerformAudioPassThruResponse,
+ commands::SetGlobalPropertiesResponse,
+ commands::SetMediaClockTimerResponse,
+ commands::ShowConstantTBTResponse,
+ commands::ShowResponse,
+ commands::SystemResponse,
+ commands::AddCommandResponse,
+ commands::SendLocationResponse,
+ commands::SetAppIconResponse,
+ commands::SetDisplayLayoutResponse,
+ commands::ChangeRegistrationResponse> ResponseCommandsList;
+
TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList);
TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
@@ -99,6 +141,58 @@ TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) {
command->Run();
}
+class GenericResponseFromHMICommandsTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+MATCHER_P2(CheckMessageParams, success, result, "") {
+ const bool is_msg_type_correct =
+ (am::MessageType::kResponse) ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::params][am::strings::message_type].asInt());
+ const bool is_success_correct =
+ success == (*arg)[am::strings::msg_params][am::strings::success].asBool();
+ const bool is_result_code_correct =
+ result ==
+ static_cast<int32_t>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+
+ using namespace helpers;
+ return Compare<bool, EQ, ALL>(
+ true, is_msg_type_correct, is_success_correct, is_result_code_correct);
+}
+
+TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+
+ SharedPtr<commands::GenericResponse> command(
+ CreateCommand<commands::GenericResponse>(command_msg));
+
+ EXPECT_CALL(
+ app_mngr_,
+ SendMessageToMobile(
+ CheckMessageParams(false, mobile_apis::Result::INVALID_DATA), false));
+
+ command->Run();
+}
+
+class ScrollableMessageResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {};
+
+TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) {
+ MessageSharedPtr message = CreateMessage();
+ (*message)[am::strings::msg_params][am::strings::result_code] =
+ mobile_apis::Result::SUCCESS;
+
+ MockAppPtr app(CreateMockApp());
+
+ SharedPtr<am::commands::ScrollableMessageResponse> command(
+ CreateCommand<am::commands::ScrollableMessageResponse>(message));
+ EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app));
+ EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_));
+ command->Run();
+}
+
+} // namespace simple_response_commands_test
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc
index 7600d30304..54ac3cccc0 100644
--- a/src/components/application_manager/test/commands/mobile/slider_test.cc
+++ b/src/components/application_manager/test/commands/mobile/slider_test.cc
@@ -43,37 +43,46 @@
#include "application_manager/mock_message_helper.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
+namespace slider_request {
namespace am = application_manager;
using am::commands::SliderRequest;
using am::commands::CommandImpl;
using am::commands::MessageSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
+using policy_test::MockPolicyHandlerInterface;
using ::utils::SharedPtr;
using ::testing::_;
-using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
+typedef SharedPtr<SliderRequest> CommandPtr;
+
namespace {
const int32_t kCommandId = 1;
const uint32_t kAppId = 1u;
const uint32_t kCmdId = 1u;
const uint32_t kConnectionKey = 2u;
+const uint32_t kDefaultTimeout = 1000u;
+const uint32_t kCorrelationId = 2u;
+const uint32_t kFunctionId = 3u;
+const uint32_t kNumTicks = 2u;
+const uint32_t kPositionGreaterTicks = 3u;
+const uint32_t kPositionLessTicks = 1u;
} // namespace
class SliderRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
SliderRequestTest()
- : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
- MockMessageHelper& mock_message_helper_;
- sync_primitives::Lock lock_;
+ : mock_app_(CreateMockApp())
+ , msg_(CreateMessage(smart_objects::SmartType_Map)) {}
MessageSharedPtr CreateFullParamsUISO() {
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
@@ -94,6 +103,37 @@ class SliderRequestTest
return msg;
}
+
+ void PreConditions() {
+ (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg_)[am::strings::msg_params][am::strings::num_ticks] = kNumTicks;
+ (*msg_)[am::strings::msg_params][am::strings::position] =
+ kPositionLessTicks;
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
+ "slider_footer1";
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][1] =
+ "slider_footer2";
+ (*msg_)[am::strings::msg_params][am::strings::slider_header] =
+ "slider_header";
+
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ }
+
+ sync_primitives::Lock lock_;
+
+ MockAppPtr mock_app_;
+ MessageSharedPtr msg_;
+ MockPolicyHandlerInterface mock_policy_handler_;
};
TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
@@ -108,11 +148,6 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.WillByDefault(Return(mock_app));
ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey));
- MockHmiInterfaces hmi_interfaces;
- ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces,
- GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI))
- .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE));
MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
(*msg)[am::strings::params][am::hmi_response::code] =
@@ -122,10 +157,6 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
Event event(hmi_apis::FunctionID::UI_Slider);
event.set_smart_object(*msg);
- EXPECT_CALL(mock_message_helper_,
- HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
- .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE));
-
MessageSharedPtr ui_command_result;
EXPECT_CALL(
app_mngr_,
@@ -148,9 +179,163 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) {
.asString()
.empty());
}
- Mock::VerifyAndClearExpectations(&mock_message_helper_);
}
+class CallOnTimeOut {
+ public:
+ CallOnTimeOut(CommandRequestImpl& command) : command_(command) {}
+
+ void operator()() {
+ command_.onTimeOut();
+ }
+
+ CommandRequestImpl& command_;
+};
+
+TEST_F(SliderRequestTest, Init_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+}
+
+TEST_F(SliderRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ PreConditions();
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+ ExpectManageMobileCommandWithResultCode(
+ mobile_apis::Result::APPLICATION_NOT_REGISTERED);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_PositionGreaterTicks_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::position] =
+ kPositionGreaterTicks;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_SliderFooterNotEqToNumticks_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][2] =
+ "slider_footer3";
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_InvalidSliderHeader_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_header] =
+ "invalid_test_with_empty_str\\n";
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_InvalidSliderFooter_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::slider_footer][0] =
+ "invalid_test_with_empty_str\\n";
+
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_DATA);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, Run_SUCCESS) {
+ PreConditions();
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_Slider)));
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->Run();
+}
+
+TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ EXPECT_TRUE(command->Init());
+
+ EXPECT_CALL(
+ app_mngr_,
+ updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout));
+
+ Event event(hmi_apis::FunctionID::UI_OnResetTimeout);
+ event.set_smart_object(*msg_);
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UI_UnknownEventId_UNSUCCESS) {
+ PreConditions();
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UISliderPositionExists_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::TIMED_OUT;
+ (*msg_)[am::strings::params][am::strings::data]
+ [am::strings::slider_position] = "position";
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::TIMED_OUT);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+TEST_F(SliderRequestTest, OnEvent_UISliderAborted_SUCCESS) {
+ PreConditions();
+ (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout;
+ (*msg_)[am::strings::params][am::hmi_response::code] =
+ hmi_apis::Common_Result::ABORTED;
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED);
+
+ Event event(hmi_apis::FunctionID::UI_Slider);
+ event.set_smart_object(*msg_);
+
+ CommandPtr command(CreateCommand<SliderRequest>(msg_));
+ command->on_event(event);
+}
+
+} // namespace slider_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
} // namespace tests
diff --git a/src/components/application_manager/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/test/commands/mobile/speak_request_test.cc
index 65f1ef36db..f07012d315 100644
--- a/src/components/application_manager/test/commands/mobile/speak_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/speak_request_test.cc
@@ -34,8 +34,9 @@
#include <string>
#include "gtest/gtest.h"
#include "mobile/speak_request.h"
-#include "application_manager/commands/commands_test.h"
-#include "application_manager/commands/command_request_test.h"
+#include "utils/shared_ptr.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
#include "interfaces/HMI_API.h"
#include "interfaces/MOBILE_API.h"
#include "utils/shared_ptr.h"
@@ -43,6 +44,7 @@
#include "utils/make_shared.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
+#include "application_manager/application.h"
#include "application_manager/smart_object_keys.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager.h"
@@ -53,8 +55,11 @@
namespace test {
namespace components {
namespace commands_test {
+namespace mobile_commands_test {
+namespace speak_request {
namespace am = application_manager;
+namespace mobile_result = mobile_apis::Result;
namespace hmi_response = ::application_manager::hmi_response;
namespace strings = ::application_manager::strings;
using am::commands::CommandImpl;
@@ -62,7 +67,6 @@ using am::ApplicationManager;
using am::commands::MessageSharedPtr;
using am::ApplicationSharedPtr;
using am::MockMessageHelper;
-using am::MockHmiInterfaces;
using ::testing::_;
using ::utils::SharedPtr;
using ::testing::Return;
@@ -70,44 +74,39 @@ using ::testing::ReturnRef;
using am::commands::SpeakRequest;
using ::test::components::application_manager_test::MockApplication;
+typedef SharedPtr<SpeakRequest> CommandPtr;
+
+namespace {
+const uint32_t kAppId = 10u;
+const uint32_t kConnectionKey = 5u;
+}
+
class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
SpeakRequestTest()
: request_(CreateMessage(smart_objects::SmartType_Map))
- , response_(CreateMessage(smart_objects::SmartType_Map)) {}
-
- MessageSharedPtr ManageResponse() {
- return response_;
- }
- MessageSharedPtr ManageRequest() {
- return request_;
- }
+ , response_(CreateMessage(smart_objects::SmartType_Map))
+ , app_(CreateMockApp()) {}
void CheckExpectations(const hmi_apis::Common_Result::eType hmi_response,
const mobile_apis::Result::eType mobile_response,
const am::HmiInterfaces::InterfaceState state,
const bool success) {
utils::SharedPtr<SpeakRequest> command =
- CreateCommand<SpeakRequest>(ManageRequest());
+ CreateCommand<SpeakRequest>(request_);
- (*ManageResponse())[strings::params][hmi_response::code] = hmi_response;
- (*ManageResponse())[strings::msg_params] = 0;
+ (*response_)[strings::params][hmi_response::code] = hmi_response;
+ (*response_)[strings::msg_params] = 0;
am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
- event_tts.set_smart_object(*ManageResponse());
+ event_tts.set_smart_object(*response_);
MockAppPtr mock_app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
MessageSharedPtr response_to_mobile;
- MockHmiInterfaces hmi_interfaces;
- EXPECT_CALL(app_mngr_, hmi_interfaces())
- .WillOnce(ReturnRef(hmi_interfaces));
- EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)).WillOnce(Return(state));
- MockMessageHelper* mock_message_helper =
- MockMessageHelper::message_helper_mock();
- EXPECT_CALL(*mock_message_helper, HMIToMobileResult(_))
- .WillOnce(Return(mobile_response));
+ EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillRepeatedly(Return(state));
EXPECT_CALL(app_mngr_,
ManageMobileCommand(
@@ -124,21 +123,21 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {
static_cast<int32_t>(mobile_response));
}
- private:
MessageSharedPtr request_;
MessageSharedPtr response_;
+ MockAppPtr app_;
};
TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) {
utils::SharedPtr<SpeakRequest> command =
- CreateCommand<SpeakRequest>(ManageRequest());
+ CreateCommand<SpeakRequest>(request_);
- (*ManageResponse())[strings::params][hmi_response::code] =
+ (*response_)[strings::params][hmi_response::code] =
hmi_apis::Common_Result::SUCCESS;
- (*ManageResponse())[strings::msg_params] = 0;
+ (*response_)[strings::msg_params] = 0;
am::event_engine::Event event_tts(hmi_apis::FunctionID::TTS_Speak);
- event_tts.set_smart_object(*ManageResponse());
+ event_tts.set_smart_object(*response_);
MockAppPtr mock_app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app));
@@ -184,6 +183,216 @@ TEST_F(SpeakRequestTest,
true);
}
+TEST_F(SpeakRequestTest, Run_ApplicationIsNotRegistered) {
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_))
+ .WillByDefault(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithWhiteSpace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = " ";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar1_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\t";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar2_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar3_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\tdf";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectChar4_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "sd\n rer";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithIncorrectCharInfirstPlace_InvalidData) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "\n";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::INVALID_DATA), _));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgWithEmptyString_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, Run_MsgCorrect_Success) {
+ (*request_)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "asda";
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+ ON_CALL(*app_, app_id()).WillByDefault(Return(kAppId));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::TTS_Speak)));
+
+ command->Run();
+}
+
+TEST_F(SpeakRequestTest, OnEvent_WrongEventId_UNSUCCESS) {
+ Event event(Event::EventID::INVALID_ENUM);
+ CommandPtr command(CreateCommand<SpeakRequest>());
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_Speak_SUCCESS) {
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "1234";
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_SpeakWithWarning_WarningWithSuccess) {
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::WARNINGS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "asda";
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>());
+
+ ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::WARNINGS), _));
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_TTS_OnResetTimeout_UpdateTimeout) {
+ Event event(Event::EventID::TTS_OnResetTimeout);
+ (*request_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*request_)[am::strings::params][am::strings::correlation_id] = kAppId;
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(app_mngr_, updateRequestTimeout(kConnectionKey, kAppId, _));
+
+ command->on_event(event);
+}
+
+TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_result =
+ hmi_apis::Common_Result::SUCCESS;
+
+ Event event(Event::EventID::TTS_Speak);
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params][am::strings::tts_chunks][0]
+ [am::strings::text] = "text";
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_result;
+ (*event_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+
+ event.set_smart_object(*event_msg);
+ CommandPtr command(CreateCommand<SpeakRequest>(request_));
+
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ command->on_event(event);
+}
+
+} // namespace speak_request
+} // namespace mobile_commands_test
} // namespace commands_test
} // namespace component
} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc
index ea82670913..8d31b67a53 100644
--- a/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/subscribe_button_request_test.cc
@@ -50,6 +50,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace subscribe_button_request {
using ::testing::_;
using ::testing::Return;
@@ -196,6 +197,7 @@ TEST_F(SubscribeButtonRequestTest, Run_SUCCESS) {
[am::strings::result_code].asInt()));
}
+} // namespace subscribe_button_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
index ff149504fa..87127231be 100644
--- a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc
@@ -39,6 +39,7 @@
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_application.h"
#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
#include "application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h"
#include "interfaces/MOBILE_API.h"
#include "application_manager/smart_object_keys.h"
@@ -47,8 +48,10 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace subscribe_way_points_request {
using ::testing::_;
+using ::testing::A;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::DoAll;
@@ -68,17 +71,19 @@ TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) {
MockAppPtr app(CreateMockApp());
ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app));
- ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(_))
+ ON_CALL(app_mngr_, IsAppSubscribedForWayPoints(A<am::ApplicationSharedPtr>()))
.WillByDefault(Return(false));
ON_CALL(app_mngr_, IsAnyAppSubscribedForWayPoints())
.WillByDefault(Return(true));
{
InSequence dummy;
- EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
+ EXPECT_CALL(app_mngr_,
+ SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
EXPECT_CALL(*app, UpdateHash());
}
+ command->Init();
MessageSharedPtr mobile_result_msg(
CatchMobileCommandResult(CallRun(*command)));
@@ -94,8 +99,9 @@ TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
Event event(hmi_apis::FunctionID::Navigation_SubscribeWayPoints);
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::SUCCESS;
+ const hmi_apis::Common_Result::eType result_code =
+ hmi_apis::Common_Result::SUCCESS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = result_code;
(*event_msg)[am::strings::msg_params] = 0;
event.set_smart_object(*event_msg);
@@ -104,14 +110,19 @@ TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) {
{
InSequence dummy;
- EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_));
+ EXPECT_CALL(app_mngr_,
+ SubscribeAppForWayPoints(A<am::ApplicationSharedPtr>()));
+ EXPECT_CALL(mock_message_helper_, HMIToMobileResult(result_code))
+ .WillOnce(Return(mobile_apis::Result::SUCCESS));
EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
EXPECT_CALL(*app, UpdateHash());
}
+ command->Init();
command->on_event(event);
}
+} // namespace subscribe_way_points_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/system_request_test.cc b/src/components/application_manager/test/commands/mobile/system_request_test.cc
new file mode 100644
index 0000000000..0e07889b4b
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/system_request_test.cc
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+#include <set>
+
+#include "gtest/gtest.h"
+
+#include "application_manager/commands/mobile/system_request.h"
+#include "application_manager/commands/command_request_test.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/event_engine/event.h"
+#include "application_manager/mock_hmi_interface.h"
+#include "application_manager/policies/mock_policy_handler_interface.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace system_request {
+
+namespace am = application_manager;
+using am::commands::SystemRequest;
+using am::commands::CommandImpl;
+using am::commands::MessageSharedPtr;
+using am::MockHmiInterfaces;
+using am::event_engine::Event;
+using policy_test::MockPolicyHandlerInterface;
+using ::utils::SharedPtr;
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+const std::string kAppPolicyId = "fake-app-id";
+const uint32_t kDefaultTimeout = 1000u;
+const std::string kAppFolderName = "fake-app-name";
+const std::string kAppStorageFolder = "fake-storage";
+const std::string kSystemFilesPath = "/fake/system/files";
+const std::string kFileName = "Filename";
+} // namespace
+
+class SystemRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ SystemRequestTest() : mock_app_(CreateMockApp()) {}
+
+ protected:
+ MessageSharedPtr CreateIVSUMessage() {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey;
+ (*msg)[am::strings::msg_params][am::strings::request_type] =
+ mobile_apis::RequestType::HTTP;
+ (*msg)[am::strings::msg_params][am::strings::file_name] = kFileName;
+ return msg;
+ }
+
+ void PreConditions() {
+ ON_CALL(app_mngr_, application(kConnectionKey))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(app_mngr_, GetPolicyHandler())
+ .WillByDefault(ReturnRef(mock_policy_handler_));
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey));
+ ON_CALL(*mock_app_, policy_app_id()).WillByDefault(Return(kAppPolicyId));
+ ON_CALL(*mock_app_, folder_name()).WillByDefault(Return(kAppFolderName));
+
+ ON_CALL(app_mngr_settings_, system_files_path())
+ .WillByDefault(ReturnRef(kSystemFilesPath));
+ ON_CALL(app_mngr_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+
+ ON_CALL(mock_policy_handler_, IsRequestTypeAllowed(kAppPolicyId, _))
+ .WillByDefault(Return(true));
+ }
+
+ void ExpectManageMobileCommandWithResultCode(
+ const mobile_apis::Result::eType code) {
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(code),
+ am::commands::Command::CommandOrigin::ORIGIN_SDL));
+ }
+
+ MockAppPtr mock_app_;
+ MockPolicyHandlerInterface mock_policy_handler_;
+};
+
+TEST_F(SystemRequestTest, Run_HTTP_FileName_no_binary_data_REJECTED) {
+ PreConditions();
+ MessageSharedPtr msg = CreateIVSUMessage();
+
+ ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED);
+
+ SharedPtr<SystemRequest> command(CreateCommand<SystemRequest>(msg));
+ command->Run();
+}
+
+} // namespace system_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
index b2b1901d4e..3d083f5c45 100644
--- a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc
@@ -44,6 +44,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace unregister_app_interface_request {
namespace am = ::application_manager;
namespace mobile_result = mobile_apis::Result;
@@ -83,13 +84,13 @@ TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) {
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
+ .WillRepeatedly(Return(mock_app));
const mobile_apis::AppInterfaceUnregisteredReason::eType kUnregisterReason =
mobile_apis::AppInterfaceUnregisteredReason::INVALID_ENUM;
MessageSharedPtr dummy_msg(CreateMessage());
- EXPECT_CALL(*am::MockMessageHelper::message_helper_mock(),
+ EXPECT_CALL(mock_message_helper_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
kConnectionKey, kUnregisterReason))
.WillOnce(Return(dummy_msg));
@@ -110,6 +111,7 @@ TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) {
command->Run();
}
+} // namespace unregister_app_interface_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
index 6518d8131a..46a1ce02eb 100644
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc
@@ -6,12 +6,14 @@
#include "application_manager/commands/command_request_test.h"
#include "application_manager/mock_application_manager.h"
#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_hmi_capabilities.h"
#include "application_manager/commands/mobile/unsubscribe_button_request.h"
namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace unsubscribe_button_request {
namespace am = ::application_manager;
namespace mobile_result = mobile_apis::Result;
@@ -29,7 +31,13 @@ const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
} // namespace
class UnsubscribeButtonRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ typedef TypeIf<kMocksAreNice,
+ NiceMock<application_manager_test::MockHMICapabilities>,
+ application_manager_test::MockHMICapabilities>::Result
+ MockHMICapabilities;
+};
TEST_F(UnsubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) {
CommandPtr command(CreateCommand<UnsubscribeButtonRequest>());
@@ -54,13 +62,21 @@ TEST_F(UnsubscribeButtonRequestTest,
CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+ UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(hmi_capabilities));
+ EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
+ EXPECT_CALL(hmi_capabilities, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillOnce(Return(mock_app));
-
EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
.WillOnce(Return(false));
-
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
@@ -68,9 +84,35 @@ TEST_F(UnsubscribeButtonRequestTest,
command->Run();
}
-TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
- const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK;
+TEST_F(UnsubscribeButtonRequestTest,
+ Run_UnsubscribeNotAllowedByHmiCapabilities_UNSUCCESS) {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId;
+ CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(hmi_capabilities));
+ EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ EXPECT_CALL(hmi_capabilities, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::UNSUPPORTED_RESOURCE), _));
+
+ command->Run();
+}
+
+TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
@@ -78,9 +120,19 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
CommandPtr command(CreateCommand<UnsubscribeButtonRequest>(command_msg));
+ UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities;
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(hmi_capabilities));
+ EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true));
+
+ MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map));
+ (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId;
+ EXPECT_CALL(hmi_capabilities, button_capabilities())
+ .WillOnce(Return(button_caps_ptr.get()));
+
MockAppPtr mock_app(CreateMockApp());
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
+ .WillRepeatedly(Return(mock_app));
EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId))
.WillOnce(Return(true));
@@ -93,10 +145,11 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) {
ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
EXPECT_CALL(*mock_app, UpdateHash());
-
+ command->Init();
command->Run();
}
+} // namespace unsubscribe_button_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
index 964f1944c5..bb4824e8f7 100644
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc
@@ -44,6 +44,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_request {
namespace am = ::application_manager;
namespace mobile_result = mobile_apis::Result;
@@ -58,7 +59,8 @@ typedef ::utils::SharedPtr<UnsubscribeVehicleDataRequest> CommandPtr;
namespace {
const uint32_t kConnectionKey = 1u;
const std::string kMsgParamKey = "test_key";
-const am::VehicleDataType kVehicleType = am::VehicleDataType::SPEED;
+const mobile_apis::VehicleDataType::eType kVehicleType =
+ mobile_apis::VehicleDataType::VEHICLEDATA_SPEED;
} // namespace
class UnsubscribeVehicleRequestTest
@@ -90,8 +92,7 @@ TEST_F(UnsubscribeVehicleRequestTest,
kVehicleType;
am::VehicleData data;
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
- .WillOnce(ReturnRef(data));
+ EXPECT_CALL(mock_message_helper_, vehicle_data()).WillOnce(ReturnRef(data));
CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
MockAppPtr mock_app(CreateMockApp());
@@ -114,7 +115,7 @@ TEST_F(UnsubscribeVehicleRequestTest,
am::VehicleData vehicle_data;
vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
@@ -138,7 +139,7 @@ TEST_F(UnsubscribeVehicleRequestTest,
am::VehicleData vehicle_data;
vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
@@ -160,7 +161,7 @@ TEST_F(UnsubscribeVehicleRequestTest, Run_UnsubscribeDataDisabled_UNSUCCESS) {
am::VehicleData vehicle_data;
vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
@@ -180,22 +181,26 @@ void UnsubscribeVehicleRequestTest::UnsubscribeSuccessfully() {
(*command_msg)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
(*command_msg)[am::strings::msg_params][kMsgParamKey] = true;
+
am::VehicleData vehicle_data;
vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
- CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
am::ApplicationSet application_set_;
MockAppPtr mock_app(CreateMockApp());
application_set_.insert(mock_app);
DataAccessor<am::ApplicationSet> accessor(application_set_, app_set_lock_);
+
EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
- EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor));
+ .WillRepeatedly(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor));
EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType))
.WillRepeatedly(Return(true));
+
EXPECT_CALL(*mock_app, UnsubscribeFromIVI(kVehicleType))
.WillRepeatedly(Return(true));
@@ -203,6 +208,7 @@ void UnsubscribeVehicleRequestTest::UnsubscribeSuccessfully() {
app_mngr_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+ CommandPtr command(CreateCommand<UnsubscribeVehicleDataRequest>(command_msg));
command->Run();
}
@@ -222,13 +228,14 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) {
EXPECT_CALL(app_mngr_, application(kConnectionKey))
.WillRepeatedly(Return(mock_app));
vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType));
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data())
+ EXPECT_CALL(mock_message_helper_, vehicle_data())
.WillOnce(ReturnRef(vehicle_data));
EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType))
.WillRepeatedly(Return(false));
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+ command->Init();
command->Run();
am::event_engine::Event test_event(
@@ -236,12 +243,9 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) {
SmartObject message(smart_objects::SmartType_Map);
const hmi_apis::Common_Result::eType hmi_result =
hmi_apis::Common_Result::SUCCESS;
- const mobile_apis::Result::eType mob_result = mobile_apis::Result::SUCCESS;
message[am::strings::params][am::hmi_response::code] = hmi_result;
message[am::strings::msg_params][kMsgParamKey] = true;
test_event.set_smart_object(message);
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
- HMIToMobileResult(hmi_result)).WillOnce(Return(mob_result));
EXPECT_CALL(
app_mngr_,
@@ -265,26 +269,18 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) {
SmartObject message(smart_objects::SmartType_Map);
const hmi_apis::Common_Result::eType hmi_result =
hmi_apis::Common_Result::SUCCESS;
- const mobile_apis::Result::eType mob_result = mobile_apis::Result::SUCCESS;
message[am::strings::params][am::hmi_response::code] = hmi_result;
message[am::strings::msg_params][kMsgParamKey] = true;
test_event.set_smart_object(message);
- EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()),
- HMIToMobileResult(hmi_result)).WillOnce(Return(mob_result));
-
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
- EXPECT_CALL(*mock_app, UpdateHash());
-
command->on_event(test_event);
}
+} // namespace unsubscribe_vehicle_data_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
index 9c87b350b8..532948e5db 100644
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_response_test.cc
@@ -42,6 +42,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace unsubscribe_vehicle_data_response {
namespace commands = ::application_manager::commands;
@@ -103,6 +104,7 @@ TEST_F(UnsubscribeVehicleResponseTest,
command->Run();
}
+} // namespace unsubscribe_vehicle_data_response
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
new file mode 100644
index 0000000000..5615b0cabd
--- /dev/null
+++ b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "mobile/unsubscribe_way_points_request.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+#include "commands/command_request_test.h"
+#include "application_manager/application.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace mobile_commands_test {
+namespace unsubscribe_way_points_request {
+
+namespace am = ::application_manager;
+namespace mobile_result = mobile_apis::Result;
+
+using ::testing::_;
+using ::testing::Return;
+
+using am::commands::UnSubscribeWayPointsRequest;
+using am::commands::MessageSharedPtr;
+
+namespace {
+const uint32_t kConnectionKey = 3u;
+const uint32_t kAppId = 5u;
+} // namespace
+
+class UnSubscribeWayPointsRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ UnSubscribeWayPointsRequestTest()
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ , command_(CreateCommand<UnSubscribeWayPointsRequest>(command_msg_)) {
+ (*command_msg_)[am::strings::params][am::strings::connection_key] =
+ kConnectionKey;
+ }
+
+ MessageSharedPtr command_msg_;
+ ::utils::SharedPtr<UnSubscribeWayPointsRequest> command_;
+};
+
+TEST_F(UnSubscribeWayPointsRequestTest,
+ Run_ApplicationIsNotRegistered_UNSUCCESS) {
+ EXPECT_CALL(app_mngr_, application(_))
+ .WillOnce(Return(ApplicationSharedPtr()));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
+
+ command_->Run();
+}
+
+TEST_F(UnSubscribeWayPointsRequestTest,
+ Run_AppIsNotSubscribedForWayPoints_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ IsAppSubscribedForWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
+
+ command_->Run();
+}
+
+TEST_F(UnSubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_,
+ IsAppSubscribedForWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(HMIResultCodeIs(
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints)));
+
+ command_->Run();
+}
+
+TEST_F(UnSubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app));
+
+ EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
+
+ Event event(hmi_apis::FunctionID::INVALID_ENUM);
+
+ command_->on_event(event);
+}
+
+TEST_F(UnSubscribeWayPointsRequestTest,
+ OnEvent_ReceivedNavigationUnSubscribeWayPointsEvent_SUCCESS) {
+ MockAppPtr mock_app(CreateMockApp());
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillRepeatedly(Return(mock_app));
+
+ MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*event_msg)[am::strings::msg_params] = 0;
+ (*event_msg)[am::strings::params][am::hmi_response::code] =
+ mobile_result::SUCCESS;
+ Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
+ event.set_smart_object(*event_msg);
+
+ EXPECT_CALL(app_mngr_,
+ UnsubscribeAppFromWayPoints(
+ ::testing::Matcher<am::ApplicationSharedPtr>(mock_app)));
+
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+
+ command_->on_event(event);
+}
+
+} // namespace unsubscribe_way_points_request
+} // namespace mobile_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc~ff89c63... Cover UnsubscribeWayPoints and UpdateTurnList by Unit Tests. b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc~ff89c63... Cover UnsubscribeWayPoints and UpdateTurnList by Unit Tests.
deleted file mode 100644
index e4a0d0fb6d..0000000000
--- a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc~ff89c63... Cover UnsubscribeWayPoints and UpdateTurnList by Unit Tests.
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <stdint.h>
-#include <string>
-
-#include "gtest/gtest.h"
-#include "mobile/unsubscribe_way_points_request.h"
-#include "interfaces/MOBILE_API.h"
-#include "utils/shared_ptr.h"
-#include "smart_objects/smart_object.h"
-#include "commands/commands_test.h"
-#include "commands/command_request_test.h"
-#include "application_manager/application.h"
-#include "application_manager/mock_application_manager.h"
-#include "application_manager/mock_application.h"
-#include "application_manager/smart_object_keys.h"
-#include "application_manager/event_engine/event.h"
-
-namespace test {
-namespace components {
-namespace commands_test {
-namespace mobile_commands_test {
-
-namespace am = ::application_manager;
-namespace mobile_result = mobile_apis::Result;
-
-using ::testing::_;
-using ::testing::Return;
-
-using am::commands::UnSubscribeWayPointsRequest;
-using am::commands::MessageSharedPtr;
-
-namespace {
-const uint32_t kConnectionKey = 3u;
-const uint32_t kAppId = 5u;
-} // namespace
-
-class UnSubscribeWayPointsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {
- public:
- UnSubscribeWayPointsRequestTest()
- : command_msg_(CreateMessage(smart_objects::SmartType_Map))
- , command_(CreateCommand<UnSubscribeWayPointsRequest>(command_msg_)) {
- (*command_msg_)[am::strings::params][am::strings::connection_key] =
- kConnectionKey;
- }
-
- MessageSharedPtr command_msg_;
- ::utils::SharedPtr<UnSubscribeWayPointsRequest> command_;
-};
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- Run_ApplicationIsNotRegistered_UNSUCCESS) {
- EXPECT_CALL(app_mngr_, application(_))
- .WillOnce(Return(ApplicationSharedPtr()));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- Run_AppIsNotSubscribedForWayPoints_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, IsAppSubscribedForWayPoints(kAppId))
- .WillOnce(Return(false));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest, Run_AppSubscribedForWayPoints_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, IsAppSubscribedForWayPoints(kAppId))
- .WillOnce(Return(true));
-
- EXPECT_CALL(app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints)));
-
- command_->Run();
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
-
- Event event(hmi_apis::FunctionID::INVALID_ENUM);
-
- command_->on_event(event);
-}
-
-TEST_F(UnSubscribeWayPointsRequestTest,
- OnEvent_ReceivedNavigationUnSubscribeWayPointsEvent_SUCCESS) {
- MockAppPtr mock_app(CreateMockApp());
- EXPECT_CALL(app_mngr_, application(kConnectionKey))
- .WillOnce(Return(mock_app));
-
- MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::msg_params] = 0;
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_result::SUCCESS;
- Event event(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints);
- event.set_smart_object(*event_msg);
-
- EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId));
-
- EXPECT_CALL(app_mngr_, UnsubscribeAppFromWayPoints(kAppId));
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
-
- command_->on_event(event);
-}
-
-} // namespace mobile_commands_test
-} // namespace commands_test
-} // namespace components
-} // namespace test
diff --git a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
index 7c8cb76041..dacabba5fd 100644
--- a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
+++ b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc
@@ -53,6 +53,7 @@ namespace test {
namespace components {
namespace commands_test {
namespace mobile_commands_test {
+namespace update_turn_list_request {
namespace am = ::application_manager;
namespace mobile_result = mobile_apis::Result;
@@ -78,8 +79,7 @@ class UpdateTurnListRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
UpdateTurnListRequestTest()
- : mock_message_helper_(*am::MockMessageHelper::message_helper_mock())
- , command_msg_(CreateMessage(smart_objects::SmartType_Map))
+ : command_msg_(CreateMessage(smart_objects::SmartType_Map))
, command_(CreateCommand<UpdateTurnListRequest>(command_msg_)) {
(*command_msg_)[am::strings::params][am::strings::connection_key] =
kConnectionKey;
@@ -87,7 +87,6 @@ class UpdateTurnListRequestTest
kFunctionId;
}
- am::MockMessageHelper& mock_message_helper_;
MessageSharedPtr command_msg_;
::utils::SharedPtr<UpdateTurnListRequest> command_;
TypeIf<kMocksAreNice,
@@ -264,50 +263,42 @@ TEST_F(UpdateTurnListRequestTest, OnEvent_UnknownEvent_UNSUCCESS) {
TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) {
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::UNSUPPORTED_RESOURCE;
+ const mobile_result::eType mobile_response_code =
mobile_result::UNSUPPORTED_RESOURCE;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
(*event_msg)[am::strings::msg_params] = 0;
Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
event.set_smart_object(*event_msg);
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
-
- EXPECT_CALL(mock_hmi_capabilities, is_ui_cooperating())
- .WillOnce(Return(true));
-
EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_result::UNSUPPORTED_RESOURCE), _));
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
command_->on_event(event);
}
TEST_F(UpdateTurnListRequestTest,
OnEvent_ReceivedNavigationUpdateTurnListEvent_SUCCESS) {
+ const hmi_apis::Common_Result::eType hmi_response_code =
+ hmi_apis::Common_Result::SUCCESS;
+ const mobile_result::eType mobile_response_code = mobile_result::SUCCESS;
+
MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map));
- (*event_msg)[am::strings::params][am::hmi_response::code] =
- mobile_result::SUCCESS;
+ (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_response_code;
(*event_msg)[am::strings::msg_params] = 0;
Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList);
event.set_smart_object(*event_msg);
- MockHMICapabilities mock_hmi_capabilities;
- EXPECT_CALL(app_mngr_, hmi_capabilities())
- .WillOnce(ReturnRef(mock_hmi_capabilities));
-
- EXPECT_CALL(mock_hmi_capabilities, is_ui_cooperating()).Times(0);
-
- EXPECT_CALL(
- app_mngr_,
- ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _));
command_->on_event(event);
}
+} // namespace update_turn_list_request
} // namespace mobile_commands_test
} // namespace commands_test
} // namespace components
diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc
index e88dd2ba4e..440763d4c3 100644
--- a/src/components/application_manager/test/event_engine_test.cc
+++ b/src/components/application_manager/test/event_engine_test.cc
@@ -35,7 +35,7 @@
#include "application_manager/event_engine/event_observer.h"
#include "application_manager/event_engine/event.h"
#include "application_manager/event_engine/event_dispatcher_impl.h"
-#include "application_manager/event_observer_mock.h"
+#include "application_manager/mock_event_observer.h"
#include "application_manager/mock_event_dispatcher.h"
#include "smart_objects/smart_object.h"
#include "utils/make_shared.h"
@@ -45,7 +45,6 @@ namespace test {
namespace components {
namespace event_engine_test {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
using application_manager::event_engine::EventDispatcherImpl;
using application_manager::event_engine::Event;
using application_manager::event_engine::EventObserver;
@@ -178,6 +177,6 @@ TEST_F(EventEngineTest, Event_set_smart_object_ExpectObjectSet) {
EXPECT_EQ(smart_object_with_type_notification, event_->smart_object());
}
-} // namespace event_engine
+} // namespace event_engine_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json
index c174dfcba4..9db6ee78ae 100644
--- a/src/components/application_manager/test/hmi_capabilities.json
+++ b/src/components/application_manager/test/hmi_capabilities.json
@@ -1,465 +1,699 @@
{
- "UI":
- {
+ "UI": {
"language":"EN_US",
- "languages":[
- "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
-"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO"
+ "languages":[
+ "EN_US",
+ "ES_MX",
+ "FR_CA",
+ "DE_DE",
+ "ES_ES",
+ "EN_GB",
+ "RU_RU",
+ "TR_TR",
+ "PL_PL",
+ "FR_FR",
+ "IT_IT",
+ "SV_SE",
+ "PT_PT",
+ "NL_NL",
+ "ZH_TW",
+ "JA_JP",
+ "AR_SA",
+ "KO_KR",
+ "PT_BR",
+ "CS_CZ",
+ "DA_DK",
+ "NO_NO",
+ "NL_BE",
+ "EL_GR",
+ "HU_HU",
+ "FI_FI",
+ "SK_SK",
+ "EN_IN",
+ "TH_TH",
+ "EN_SA",
+ "HE_IL",
+ "RO_RO",
+ "UK_UA",
+ "ID_ID",
+ "VI_VN",
+ "MS_MY",
+ "HI_IN"
],
- "displayCapabilities":
+ "displayCapabilities": {
+ "displayType": "GEN2_8_DMA",
+ "textFields": [
{
- "displayType":"GEN2_8_DMA",
- "textFields": [{
- "name": "mainField1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mainField4",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "statusBar",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaClock",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "mediaTrack",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "alertText3",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "scrollableMessageBody",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "initialInteractionText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "ETA",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "totalDistance",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "navigationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText1",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "audioPassThruDisplayText2",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderHeader",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "sliderFooter",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "notificationText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuName",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "secondaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "tertiaryText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "timeToDestination",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "turnText",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- },
- {
- "name": "menuTitle",
- "characterSet": "TYPE2SET",
- "width": 500,
- "rows": 1
- }
- ],
- "imageFields":
- [
- {
- "name":"softButtonImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"choiceImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"choiceSecondaryImage",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"menuIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"cmdIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"appIcon",
- "imageTypeSupported":
- [
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"graphic",
- "imageTypeSupported":
- [
-
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- },
- {
- "name":"locationImage",
- "imageTypeSupported":
- [
- "GRAPHIC_PNG"
- ],
- "imageResolution":
- {
- "resolutionWidth":35,
- "resolutionHeight":35
- }
- }
-
- ],
- "mediaClockFormats":
- [
- "CLOCK1","CLOCK2","CLOCK3","CLOCKTEXT1","CLOCKTEXT2","CLOCKTEXT3","CLOCKTEXT4"
+ "name": "mainField1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mainField4",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "statusBar",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaClock",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "mediaTrack",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "alertText3",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "scrollableMessageBody",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "initialInteractionText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "ETA",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "totalDistance",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "navigationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText1",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "audioPassThruDisplayText2",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderHeader",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "sliderFooter",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "notificationText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuName",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "secondaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "tertiaryText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "timeToDestination",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "turnText",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ },
+ {
+ "name": "menuTitle",
+ "characterSet": "TYPE2SET",
+ "width": 500,
+ "rows": 1
+ }
],
- "graphicSupported":true,
- "templatesAvailable":
- [
-
- "DEFAULT","MEDIA","NON-MEDIA","ONSCREEN_PRESETS","NAV_FULLSCREEN_MAP","NAV_KEYBOARD",
- "GRAPHIC_WITH_TEXT","TEXT_WITH_GRAPHIC","TILES_ONLY","TEXTBUTTONS_ONLY",
- "GRAPHIC_WITH_TILES","TILES_WITH_GRAPHIC","GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
- "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC","GRAPHIC_WITH_TEXTBUTTONS",
- "TEXTBUTTONS_WITH_GRAPHIC","LARGE_GRAPHIC_WITH_SOFTBUTTONS",
- "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS","LARGE_GRAPHIC_ONLY"
- ],
- "screenParams":
- {
- "resolution":
- {
- "resolutionWidth":800,
- "resolutionHeight":350
- },
- "touchEventAvailable":
- {
- "pressAvailable":true,
- "multiTouchAvailable":false,
- "doublePressAvailable":false
- }
- },
- "numCustomPresetsAvailable":8,
- "imageCapabilities":
- [
+ "imageFields": [
+ {
+ "name": "softButtonImage",
+ "imageTypeSupported": [],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "choiceImage",
+ "imageTypeSupported": [],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "choiceSecondaryImage",
+ "imageTypeSupported": [],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "menuIcon",
+ "imageTypeSupported": [],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "cmdIcon",
+ "imageTypeSupported": [],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "appIcon",
+ "imageTypeSupported": [],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "graphic",
+ "imageTypeSupported": [],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ },
+ {
+ "name": "locationImage",
+ "imageTypeSupported": [
+ "GRAPHIC_PNG"
+ ],
+ "imageResolution": {
+ "resolutionWidth": 35,
+ "resolutionHeight": 35
+ }
+ }
+
+ ],
+ "mediaClockFormats": [
+ "CLOCK1",
+ "CLOCK2",
+ "CLOCK3",
+ "CLOCKTEXT1",
+ "CLOCKTEXT2",
+ "CLOCKTEXT3",
+ "CLOCKTEXT4"
+ ],
+ "graphicSupported": true,
+ "templatesAvailable": [
+
+ "DEFAULT",
+ "MEDIA",
+ "NON-MEDIA",
+ "ONSCREEN_PRESETS",
+ "NAV_FULLSCREEN_MAP",
+ "NAV_KEYBOARD",
+ "GRAPHIC_WITH_TEXT",
+ "TEXT_WITH_GRAPHIC",
+ "TILES_ONLY",
+ "TEXTBUTTONS_ONLY",
+ "GRAPHIC_WITH_TILES",
+ "TILES_WITH_GRAPHIC",
+ "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS",
+ "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC",
+ "GRAPHIC_WITH_TEXTBUTTONS",
+ "TEXTBUTTONS_WITH_GRAPHIC",
+ "LARGE_GRAPHIC_WITH_SOFTBUTTONS",
+ "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS",
+ "LARGE_GRAPHIC_ONLY"
+ ],
+ "screenParams": {
+ "resolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 350
+ },
+ "touchEventAvailable": {
+ "pressAvailable": true,
+ "multiTouchAvailable": false,
+ "doublePressAvailable": false
+ }
+ },
+ "numCustomPresetsAvailable": 8,
+ "imageCapabilities": [
"DYNAMIC",
"STATIC"
]
},
- "audioPassThruCapabilities":
- {
- "samplingRate" : "44KHZ",
- "bitsPerSample" : "RATE_8_BIT",
- "audioType" : "PCM"
+ "audioPassThruCapabilities": {
+ "samplingRate": "44KHZ",
+ "bitsPerSample": "RATE_8_BIT",
+ "audioType": "PCM"
},
- "pcmStreamCapabilities":
- {
- "samplingRate" : "16KHZ",
- "bitsPerSample" : "RATE_16_BIT",
- "audioType" : "PCM"
+ "pcmStreamCapabilities": {
+ "samplingRate": "16KHZ",
+ "bitsPerSample": "RATE_16_BIT",
+ "audioType": "PCM"
},
- "hmiZoneCapabilities":"FRONT",
- "softButtonCapabilities":
- [
- {
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true,
- "imageSupported" :true
- }
+ "hmiZoneCapabilities": "FRONT",
+ "softButtonCapabilities": [
+ {
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true,
+ "imageSupported": true
+ }
+ ],
+ "systemCapabilities": {
+ "navigationCapability": {
+ "sendLocationEnabled": true,
+ "getWayPointsEnabled": true
+ },
+ "phoneCapability": {
+ "dialNumberEnabled": true
+ },
+
+ "remoteControlCapability":{
+ "climateControlCapabilities": [
+ {
+ "moduleName": "primary_climate",
+ "fanSpeedAvailable": true,
+ "desiredTemperatureAvailable": true,
+ "acEnableAvailable": true,
+ "acMaxEnableAvailable": true,
+ "circulateAirEnableAvailable": true,
+ "autoModeEnableAvailable": true,
+ "dualModeEnableAvailable": true,
+ "defrostZoneAvailable": true,
+ "ventilationModeAvailable": true,
+ "defrostZone": [
+ "FRONT",
+ "REAR",
+ "ALL",
+ "NONE"
+ ],
+ "ventilationMode": [
+ "UPPER",
+ "LOWER",
+ "BOTH",
+ "NONE"
+ ]
+ }
+ ],
+ "radioControlCapabilities": [
+ {
+ "moduleName": "radio",
+ "radioEnableAvailable": true,
+ "radioBandAvailable": true,
+ "radioFrequencyAvailable": true,
+ "hdChannelAvailable": true,
+ "rdsDataAvailable": true,
+ "availableHDsAvailable": true,
+ "stateAvailable": true,
+ "signalStrengthAvailable": true,
+ "signalChangeThresholdAvailable": true
+ }
+ ],
+ "buttonCapabilities": [
+ {
+ "name": "AC_MAX",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "AC",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "RECIRCULATE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "FAN_UP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "FAN_DOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "TEMP_UP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "TEMP_DOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "DEFROST_MAX",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "DEFROST",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "DEFROST_REAR",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "UPPER_VENT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "LOWER_VENT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "VOLUME_UP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "VOLUME_DOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "EJECT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "SOURCE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "SHUFFLE",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "name": "REPEAT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
+ }
]
+ },
+ "videoStreamingCapability": {
+ "preferredResolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 350
+ },
+ "maxBitrate": 10000,
+ "supportedFormats": [
+ {
+ "protocol": "RAW",
+ "codec": "H264"
+ },
+ {
+ "protocol": "RTP",
+ "codec": "Theora"
+ }
+ ],
+ "hapticSpatialDataSupported": true
+ }
+ }
},
- "VR":
- {
- "capabilities":["TEXT"],
- "language":"ES_MX",
- "languages":
- [
- "AR_SA", "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
-"JA_JP","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO"
- ]
-},
- "TTS":
- {
- "capabilities":"TEXT",
- "language":"DE_DE",
- "languages":
- [
- "DA_DK","CS_CZ","KO_KR","EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW",
-"JA_JP","AR_SA","PT_BR","NO_NO"
+ "VR": {
+ "capabilities": [
+ "TEXT"
+ ],
+ "language": "ES_MX",
+ "languages": [
+ "AR_SA",
+ "EN_US",
+ "ES_MX",
+ "FR_CA",
+ "DE_DE",
+ "ES_ES",
+ "EN_GB",
+ "RU_RU",
+ "TR_TR",
+ "PL_PL",
+ "FR_FR",
+ "IT_IT",
+ "SV_SE",
+ "PT_PT",
+ "NL_NL",
+ "ZH_TW",
+ "JA_JP",
+ "KO_KR",
+ "PT_BR",
+ "CS_CZ",
+ "DA_DK",
+ "NO_NO"
]
},
- "Buttons":
- {
- "capabilities":
- [
- {
- "name":"PRESET_0",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "TTS": {
+ "capabilities": [
+ "TEXT"
+ ],
+ "language": "DE_DE",
+ "languages": [
+ "DA_DK",
+ "CS_CZ",
+ "KO_KR",
+ "EN_US",
+ "ES_MX",
+ "FR_CA",
+ "DE_DE",
+ "ES_ES",
+ "EN_GB",
+ "RU_RU",
+ "TR_TR",
+ "PL_PL",
+ "FR_FR",
+ "IT_IT",
+ "SV_SE",
+ "PT_PT",
+ "NL_NL",
+ "ZH_TW",
+ "JA_JP",
+ "AR_SA",
+ "PT_BR",
+ "NO_NO"
+ ]
+ },
+ "Buttons": {
+ "capabilities": [
+ {
+ "name": "PRESET_0",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_1",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_1",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_2",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_2",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_3",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_3",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_4",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_4",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_5",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_5",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_6",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_6",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_7",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_7",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_8",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_8",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"PRESET_9",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "PRESET_9",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"OK",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "OK",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"SEEKLEFT",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "SEEKLEFT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"SEEKRIGHT",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "SEEKRIGHT",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"TUNEUP",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "TUNEUP",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
},
{
- "name":"TUNEDOWN",
- "shortPressAvailable":true,
- "longPressAvailable" :true,
- "upDownAvailable" :true
+ "name": "TUNEDOWN",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": true
}
],
- "presetBankCapabilities":
- {
- "onScreenPresetsAvailable":true
+ "presetBankCapabilities": {
+ "onScreenPresetsAvailable": true
}
},
- "VehicleInfo":
- {
- "make" :"Ford",
- "model" :"Fiesta",
- "modelYear" :"2013",
- "trim" :"SE"
+ "VehicleInfo": {
+ "make": "Ford",
+ "model": "Fiesta",
+ "modelYear": "2013",
+ "trim": "SE"
},
- "SyncMessageVersion":
- {
+ "SyncMessageVersion": {
"majorVersion": 3,
"minorVersion": 0
}
diff --git a/src/components/application_manager/test/hmi_capabilities_sc1.json b/src/components/application_manager/test/hmi_capabilities_sc1.json
new file mode 100644
index 0000000000..3731f8eb78
--- /dev/null
+++ b/src/components/application_manager/test/hmi_capabilities_sc1.json
@@ -0,0 +1,9 @@
+{
+ "UI": {
+ "systemCapabilities": {
+ "phoneCapability": {
+ "dialNumberEnabled": true
+ }
+ }
+ }
+}
diff --git a/src/components/application_manager/test/hmi_capabilities_sc2.json b/src/components/application_manager/test/hmi_capabilities_sc2.json
new file mode 100644
index 0000000000..a8578f04f5
--- /dev/null
+++ b/src/components/application_manager/test/hmi_capabilities_sc2.json
@@ -0,0 +1,14 @@
+{
+ "UI": {
+ "systemCapabilities": {
+ "navigationCapability": {
+ "sendLocationEnabled": true,
+ "getWayPointsEnabled": false
+ },
+ "phoneCapability": {
+ },
+ "videoStreamingCapability": {
+ }
+ }
+ }
+}
diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index 738797b122..b8369528aa 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -1,5 +1,8 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Copyright (c) 2017 Xevo Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -13,7 +16,7 @@
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
- * Neither the name of the Ford Motor Company nor the names of its contributors
+ * Neither the name of the copyright holders nor the names of their contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -45,7 +48,7 @@
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/state_controller.h"
-#include "resumption/last_state.h"
+#include "resumption/last_state_impl.h"
#include "application_manager/resumption/resume_ctrl.h"
namespace test {
@@ -59,7 +62,6 @@ using ::testing::AtLeast;
using ::testing::Invoke;
using ::testing::InSequence;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
using namespace application_manager;
class HMICapabilitiesTest : public ::testing::Test {
@@ -95,7 +97,7 @@ class HMICapabilitiesTest : public ::testing::Test {
void SetCooperating();
MockApplicationManager app_mngr_;
event_engine_test::MockEventDispatcher mock_event_dispatcher;
- resumption::LastState last_state_;
+ resumption::LastStateImpl last_state_;
MockApplicationManagerSettings mock_application_manager_settings_;
utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities_test;
const std::string file_name_;
@@ -105,7 +107,8 @@ const char* const cstring_values_[] = {
"EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR",
"PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "EN_AU", "ZH_CN",
"ZH_TW", "JA_JP", "AR_SA", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO",
- "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK"};
+ "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK", "EN_IN", "TH_TH", "EN_SA",
+ "HE_IL", "RO_RO", "UK_UA", "ID_ID", "VI_VN", "MS_MY", "HI_IN"};
const hmi_apis::Common_Language::eType enum_values_[] = {
hmi_apis::Common_Language::EN_US, hmi_apis::Common_Language::ES_MX,
@@ -122,7 +125,12 @@ const hmi_apis::Common_Language::eType enum_values_[] = {
hmi_apis::Common_Language::DA_DK, hmi_apis::Common_Language::NO_NO,
hmi_apis::Common_Language::NL_BE, hmi_apis::Common_Language::EL_GR,
hmi_apis::Common_Language::HU_HU, hmi_apis::Common_Language::FI_FI,
- hmi_apis::Common_Language::SK_SK};
+ hmi_apis::Common_Language::SK_SK, hmi_apis::Common_Language::EN_IN,
+ hmi_apis::Common_Language::TH_TH, hmi_apis::Common_Language::EN_SA,
+ hmi_apis::Common_Language::HE_IL, hmi_apis::Common_Language::RO_RO,
+ hmi_apis::Common_Language::UK_UA, hmi_apis::Common_Language::ID_ID,
+ hmi_apis::Common_Language::VI_VN, hmi_apis::Common_Language::MS_MY,
+ hmi_apis::Common_Language::HI_IN};
struct CStringComparator {
bool operator()(const char* a, const char* b) {
@@ -230,6 +238,13 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
static_cast<hmi_apis::Common_Language::eType>(
tts_supported_languages[2].asInt()));
+ // Check TTS capabilities
+ const smart_objects::SmartObject tts_capabilities =
+ *(hmi_capabilities_test->speech_capabilities());
+ EXPECT_EQ(hmi_apis::Common_SpeechCapabilities::SC_TEXT,
+ static_cast<hmi_apis::Common_SpeechCapabilities::eType>(
+ tts_capabilities[0].asInt()));
+
// Check button capabilities
const smart_objects::SmartObject buttons_capabilities_so =
*(hmi_capabilities_test->button_capabilities());
@@ -345,12 +360,203 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) {
// Check vehicle type
const smart_objects::SmartObject vehicle_type_so =
*(hmi_capabilities_test->vehicle_type());
- EXPECT_TRUE(preset_bank_so["onScreenPresetsAvailable"].asBool());
EXPECT_EQ("Ford", vehicle_type_so["make"].asString());
EXPECT_EQ("Fiesta", vehicle_type_so["model"].asString());
EXPECT_EQ("2013", vehicle_type_so["modelYear"].asString());
EXPECT_EQ("SE", vehicle_type_so["trim"].asString());
+
+ // Check system capabilities
+ smart_objects::SmartObject navigation_capability_so =
+ *(hmi_capabilities_test->navigation_capability());
+
+ EXPECT_TRUE(navigation_capability_so.keyExists("sendLocationEnabled"));
+ EXPECT_TRUE(navigation_capability_so.keyExists("getWayPointsEnabled"));
+ EXPECT_TRUE(navigation_capability_so["sendLocationEnabled"].asBool());
+ EXPECT_TRUE(navigation_capability_so["getWayPointsEnabled"].asBool());
+
+ // since we have navigation capabilities, the feature should be supported
+ EXPECT_TRUE(hmi_capabilities_test->navigation_supported());
+
+ const smart_objects::SmartObject phone_capability_so =
+ *(hmi_capabilities_test->phone_capability());
+
+ EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled"));
+ EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool());
+
+ EXPECT_TRUE(hmi_capabilities_test->phone_call_supported());
+
+ const smart_objects::SmartObject vs_capability_so =
+ *(hmi_capabilities_test->video_streaming_capability());
+
+ EXPECT_TRUE(vs_capability_so.keyExists(strings::preferred_resolution));
+ EXPECT_TRUE(vs_capability_so[strings::preferred_resolution].keyExists(
+ strings::resolution_width));
+ EXPECT_TRUE(vs_capability_so[strings::preferred_resolution].keyExists(
+ strings::resolution_height));
+ EXPECT_EQ(
+ 800,
+ vs_capability_so[strings::preferred_resolution][strings::resolution_width]
+ .asInt());
+ EXPECT_EQ(350,
+ vs_capability_so[strings::preferred_resolution]
+ [strings::resolution_height].asInt());
+ EXPECT_TRUE(vs_capability_so.keyExists(strings::max_bitrate));
+ EXPECT_EQ(10000, vs_capability_so[strings::max_bitrate].asInt());
+ EXPECT_TRUE(vs_capability_so.keyExists(strings::supported_formats));
+ const uint32_t supported_formats_len =
+ vs_capability_so[strings::supported_formats].length();
+ EXPECT_EQ(2u, supported_formats_len);
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][0].keyExists(
+ strings::protocol));
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][0].keyExists(
+ strings::codec));
+ EXPECT_EQ(0,
+ vs_capability_so[strings::supported_formats][0][strings::protocol]
+ .asInt());
+ EXPECT_EQ(
+ 0,
+ vs_capability_so[strings::supported_formats][0][strings::codec].asInt());
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][1].keyExists(
+ strings::protocol));
+ EXPECT_TRUE(vs_capability_so[strings::supported_formats][1].keyExists(
+ strings::codec));
+ EXPECT_EQ(1,
+ vs_capability_so[strings::supported_formats][1][strings::protocol]
+ .asInt());
+ EXPECT_EQ(
+ 2,
+ vs_capability_so[strings::supported_formats][1][strings::codec].asInt());
+
+ EXPECT_TRUE(
+ vs_capability_so.keyExists(strings::haptic_spatial_data_supported));
+ EXPECT_TRUE(
+ vs_capability_so[strings::haptic_spatial_data_supported].asBool());
+
+ EXPECT_TRUE(hmi_capabilities_test->video_streaming_supported());
+
+ // Check remote control capabilites
+ const smart_objects::SmartObject rc_capability_so =
+ *(hmi_capabilities_test->rc_capability());
+
+ EXPECT_TRUE(rc_capability_so.keyExists("climateControlCapabilities"));
+ EXPECT_TRUE(rc_capability_so.keyExists("radioControlCapabilities"));
+ EXPECT_TRUE(rc_capability_so.keyExists("buttonCapabilities"));
+
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["fanSpeedAvailable"]
+ .asBool());
+ EXPECT_TRUE(rc_capability_so["climateControlCapabilities"][0]
+ ["desiredTemperatureAvailable"].asBool());
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["acEnableAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["acMaxEnableAvailable"]
+ .asBool());
+
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["radioBandAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["radioFrequencyAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["hdChannelAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["rdsDataAvailable"]
+ .asBool());
+
+ EXPECT_TRUE(rc_capability_so["buttonCapabilities"][0]["shortPressAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["buttonCapabilities"][0]["longPressAvailable"].asBool());
+ EXPECT_FALSE(
+ rc_capability_so["buttonCapabilities"][0]["upDownAvailable"].asBool());
+}
+
+TEST_F(HMICapabilitiesTest,
+ LoadCapabilitiesFromFileAndVerifyUnsupportedSystemCapabilities) {
+ MockApplicationManager mock_app_mngr;
+ event_engine_test::MockEventDispatcher mock_dispatcher;
+ MockApplicationManagerSettings mock_application_manager_settings;
+
+ const std::string hmi_capabilities_file = "hmi_capabilities_sc1.json";
+
+ EXPECT_CALL(mock_app_mngr, event_dispatcher())
+ .WillOnce(ReturnRef(mock_dispatcher));
+ EXPECT_CALL(mock_app_mngr, get_settings())
+ .WillRepeatedly(ReturnRef(mock_application_manager_settings));
+ EXPECT_CALL(mock_application_manager_settings, hmi_capabilities_file_name())
+ .WillOnce(ReturnRef(hmi_capabilities_file));
+ EXPECT_CALL(mock_dispatcher, add_observer(_, _, _)).Times(1);
+ EXPECT_CALL(mock_dispatcher, remove_observer(_)).Times(1);
+ EXPECT_CALL(mock_application_manager_settings, launch_hmi())
+ .WillOnce(Return(false));
+
+ if (file_system::FileExists("./app_info_data")) {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
+ }
+
+ utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities =
+ utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr);
+ hmi_capabilities->Init(&last_state_);
+
+ // Check system capabilities; only phone capability is available
+ EXPECT_FALSE(hmi_capabilities->navigation_supported());
+ EXPECT_TRUE(hmi_capabilities->phone_call_supported());
+ EXPECT_FALSE(hmi_capabilities->video_streaming_supported());
+ EXPECT_FALSE(hmi_capabilities->rc_supported());
+
+ // verify phone capability
+ const smart_objects::SmartObject phone_capability_so =
+ *(hmi_capabilities->phone_capability());
+ EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled"));
+ EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool());
+}
+
+TEST_F(HMICapabilitiesTest,
+ LoadCapabilitiesFromFileAndVerifyEmptySystemCapabilities) {
+ MockApplicationManager mock_app_mngr;
+ event_engine_test::MockEventDispatcher mock_dispatcher;
+ MockApplicationManagerSettings mock_application_manager_settings;
+
+ const std::string hmi_capabilities_file = "hmi_capabilities_sc2.json";
+
+ EXPECT_CALL(mock_app_mngr, event_dispatcher())
+ .WillOnce(ReturnRef(mock_dispatcher));
+ EXPECT_CALL(mock_app_mngr, get_settings())
+ .WillRepeatedly(ReturnRef(mock_application_manager_settings));
+ EXPECT_CALL(mock_application_manager_settings, hmi_capabilities_file_name())
+ .WillOnce(ReturnRef(hmi_capabilities_file));
+ EXPECT_CALL(mock_dispatcher, add_observer(_, _, _)).Times(1);
+ EXPECT_CALL(mock_dispatcher, remove_observer(_)).Times(1);
+ EXPECT_CALL(mock_application_manager_settings, launch_hmi())
+ .WillOnce(Return(false));
+
+ if (file_system::FileExists("./app_info_data")) {
+ EXPECT_TRUE(::file_system::DeleteFile("./app_info_data"));
+ }
+
+ utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities =
+ utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr);
+ hmi_capabilities->Init(&last_state_);
+
+ // Check system capabilities; only navigation capability is valid, the other
+ // two are empty
+ EXPECT_TRUE(hmi_capabilities->navigation_supported());
+ EXPECT_FALSE(hmi_capabilities->phone_call_supported());
+ EXPECT_FALSE(hmi_capabilities->video_streaming_supported());
+ EXPECT_FALSE(hmi_capabilities->rc_supported());
+
+ // verify navigation capabilities
+ smart_objects::SmartObject navigation_capability_so =
+ *(hmi_capabilities->navigation_capability());
+ EXPECT_TRUE(navigation_capability_so.keyExists("sendLocationEnabled"));
+ EXPECT_TRUE(navigation_capability_so.keyExists("getWayPointsEnabled"));
+ EXPECT_TRUE(navigation_capability_so["sendLocationEnabled"].asBool());
+ EXPECT_FALSE(navigation_capability_so["getWayPointsEnabled"].asBool());
}
TEST_F(HMICapabilitiesTest, VerifyImageType) {
diff --git a/src/components/application_manager/test/hmi_language_handler_test.cc b/src/components/application_manager/test/hmi_language_handler_test.cc
new file mode 100644
index 0000000000..2020da5052
--- /dev/null
+++ b/src/components/application_manager/test/hmi_language_handler_test.cc
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+#include "application_manager/application_manager.h"
+#include "application_manager/hmi_language_handler.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/resumption/resume_ctrl_impl.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/smart_object_keys.h"
+#include "test/resumption/mock_last_state.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "utils/lock.h"
+
+namespace test {
+namespace components {
+namespace hmi_language_handler {
+
+namespace am = ::application_manager;
+
+using am::event_engine::Event;
+using am::ApplicationSet;
+using ::utils::SharedPtr;
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::_;
+
+typedef NiceMock<
+ ::test::components::application_manager_test::MockApplicationManager>
+ MockApplicationManager;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+typedef NiceMock< ::test::components::event_engine_test::MockEventDispatcher>
+ MockEventDispatcher;
+typedef NiceMock<application_manager_test::MockApplication> MockApp;
+
+typedef SharedPtr<MockApp> ApplicationSharedPtr;
+typedef am::HMILanguageHandler::Apps Apps;
+
+namespace {
+const uint32_t kDefaultAppsSize = 0u;
+} // namespace
+
+class HmiLanguageHandlerTest : public ::testing::Test {
+ public:
+ HmiLanguageHandlerTest() {
+ EXPECT_CALL(app_manager_, event_dispatcher())
+ .WillOnce(ReturnRef(event_dispatcher_));
+ hmi_language_handler_ =
+ ::utils::MakeShared<am::HMILanguageHandler>(app_manager_);
+ }
+
+ void InitHMIActiveLanguages(hmi_apis::Common_Language::eType ui_language,
+ hmi_apis::Common_Language::eType vr_language,
+ hmi_apis::Common_Language::eType tts_language) {
+ EXPECT_CALL(hmi_capabilities_, active_ui_language())
+ .WillRepeatedly(Return(ui_language));
+ EXPECT_CALL(hmi_capabilities_, active_vr_language())
+ .WillRepeatedly(Return(vr_language));
+ EXPECT_CALL(hmi_capabilities_, active_tts_language())
+ .WillRepeatedly(Return(tts_language));
+ }
+
+ void InitHMICapabilitiesLanguages(
+ hmi_apis::Common_Language::eType ui_language,
+ hmi_apis::Common_Language::eType vr_language,
+ hmi_apis::Common_Language::eType tts_language) {
+ InitHMIActiveLanguages(ui_language, vr_language, tts_language);
+ hmi_language_handler_->set_default_capabilities_languages(
+ ui_language, vr_language, tts_language);
+ }
+
+ ApplicationSharedPtr CreateMockApp(const uint32_t app_id,
+ bool expect_call = false) const {
+ ApplicationSharedPtr app = ::utils::MakeShared<MockApp>();
+ if (expect_call) {
+ EXPECT_CALL(*app, app_id()).WillRepeatedly(Return(app_id));
+ } else {
+ ON_CALL(*app, app_id()).WillByDefault(Return(app_id));
+ }
+ return app;
+ }
+
+ void AddMockAppsToApplicationSet(ApplicationSet& app_set,
+ const uint32_t start_app_id,
+ uint32_t count,
+ bool expect_call = false) {
+ while (count-- > 0) {
+ app_set.insert(CreateMockApp(start_app_id + count, expect_call));
+ }
+ }
+
+ MockApplicationManager app_manager_;
+ MockHMICapabilities hmi_capabilities_;
+ MockEventDispatcher event_dispatcher_;
+ SharedPtr<am::HMILanguageHandler> hmi_language_handler_;
+ ::sync_primitives::Lock app_set_lock_;
+ resumption_test::MockLastState last_state_;
+};
+
+TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) {
+ // Repeatedly add events to set `is_*_language_received_` flags up
+
+ Event ui_event(hmi_apis::FunctionID::UI_GetLanguage);
+ hmi_language_handler_->on_event(ui_event);
+
+ Event vr_event(hmi_apis::FunctionID::VR_GetLanguage);
+ hmi_language_handler_->on_event(vr_event);
+
+ // After last flag gets up, `VerifyWithPersistedLanguages`
+ // method been called to and then will call `hmi_capabilities`
+ ON_CALL(app_manager_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities_));
+
+ // Set up `active_*_language` and
+ //`persisted_ui_language_` to be the same
+ Json::Value dictionary = Json::Value();
+ ON_CALL(last_state_, get_dictionary()).WillByDefault(ReturnRef(dictionary));
+ hmi_language_handler_->Init(&last_state_);
+ InitHMICapabilitiesLanguages(hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US);
+ // Then `active_*_language` and
+ //`persisted_ui_language_` will be compared.
+ // So if they same app_manager_'s method `applications`
+ // will never be called.
+ EXPECT_CALL(app_manager_, applications()).Times(0);
+ EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
+ Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
+ hmi_language_handler_->on_event(tts_event);
+}
+
+TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_SUCCESS) {
+ Event ui_event(hmi_apis::FunctionID::UI_GetLanguage);
+ hmi_language_handler_->on_event(ui_event);
+ Event vr_event(hmi_apis::FunctionID::VR_GetLanguage);
+ hmi_language_handler_->on_event(vr_event);
+
+ ON_CALL(app_manager_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities_));
+
+ // Set up `active_*_language` and
+ //`persisted_ui_language_` to be different
+ hmi_language_handler_->set_default_capabilities_languages(
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US);
+
+ InitHMIActiveLanguages(hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU);
+
+ ApplicationSet app_set;
+ const uint32_t kAppCount = 5u;
+ // Adding to app set `kAppCount` apps with app_id form 0 to `kAppCount`.
+ AddMockAppsToApplicationSet(app_set, 0u, kAppCount);
+ DataAccessor<ApplicationSet> data_accessor(app_set, app_set_lock_);
+
+ // Because `active_*_language` and
+ //`persisted_ui_language_` are different,
+ // the `applications` will be called and
+ // app data will checked by `CheckApplication` method
+ ON_CALL(app_manager_, applications()).WillByDefault(Return(data_accessor));
+ EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
+
+ Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
+ hmi_language_handler_->on_event(tts_event);
+}
+
+TEST_F(HmiLanguageHandlerTest, OnEvent_AllReceivedLanguagesMismatch_UNSUCCESS) {
+ Event ui_event(hmi_apis::FunctionID::UI_GetLanguage);
+ hmi_language_handler_->on_event(ui_event);
+ Event vr_event(hmi_apis::FunctionID::VR_GetLanguage);
+ hmi_language_handler_->on_event(vr_event);
+
+ ON_CALL(app_manager_, hmi_capabilities())
+ .WillByDefault(ReturnRef(hmi_capabilities_));
+
+ // Set up `active_*_language` and
+ //`persisted_ui_language_` to be different
+ hmi_language_handler_->set_default_capabilities_languages(
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US);
+
+ InitHMIActiveLanguages(hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU);
+
+ ApplicationSet app_set;
+ DataAccessor<ApplicationSet> data_accessor(app_set, app_set_lock_);
+
+ // Send empty application set.
+ ON_CALL(app_manager_, applications()).WillByDefault(Return(data_accessor));
+
+ Event tts_event(hmi_apis::FunctionID::TTS_GetLanguage);
+ hmi_language_handler_->on_event(tts_event);
+}
+
+TEST_F(HmiLanguageHandlerTest,
+ SetHandleResponseRor_InvalidGetLanguage_UNSUCCESS) {
+ // Sending requests with invalid data
+ //`add_observer` method will be never called
+ const hmi_apis::FunctionID::eType kFunctionId =
+ hmi_apis::FunctionID::INVALID_ENUM;
+ const uint32_t kCorrelationId = 0u;
+
+ smart_objects::SmartObject request;
+
+ EXPECT_CALL(event_dispatcher_, add_observer(_, _, _)).Times(0);
+ hmi_language_handler_->set_handle_response_for(request);
+
+ request[am::strings::params] = 0u;
+
+ EXPECT_CALL(event_dispatcher_, add_observer(_, _, _)).Times(0);
+ hmi_language_handler_->set_handle_response_for(request);
+
+ request[am::strings::params][am::strings::function_id] = kFunctionId;
+
+ EXPECT_CALL(event_dispatcher_, add_observer(_, _, _)).Times(0);
+ hmi_language_handler_->set_handle_response_for(request);
+
+ request[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ EXPECT_CALL(event_dispatcher_, add_observer(_, _, _)).Times(0);
+ hmi_language_handler_->set_handle_response_for(request);
+}
+
+TEST_F(HmiLanguageHandlerTest,
+ SetHandleResponseRor_RequestsWithoutNeededKeys_SUCCESS) {
+ // Sending requests with valid data
+ //`add_observer` method will be called
+ const hmi_apis::FunctionID::eType kFunctionId =
+ hmi_apis::FunctionID::UI_GetLanguage;
+ const uint32_t kCorrelationId = 0u;
+
+ smart_objects::SmartObject request;
+ request[am::strings::params][am::strings::function_id] = kFunctionId;
+ request[am::strings::params][am::strings::correlation_id] = kCorrelationId;
+
+ EXPECT_CALL(event_dispatcher_, add_observer(kFunctionId, kCorrelationId, _));
+ hmi_language_handler_->set_handle_response_for(request);
+}
+
+TEST_F(HmiLanguageHandlerTest,
+ HandleWrongLanguageApp_UnregisteredAppId_SUCCESS) {
+ smart_objects::SmartObject msg;
+ msg[am::strings::params][am::strings::app_id] = 5u;
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(msg);
+
+ EXPECT_CALL(app_manager_, hmi_capabilities()).Times(0);
+ hmi_language_handler_->on_event(event);
+
+ EXPECT_CALL(app_manager_, hmi_capabilities())
+ .WillOnce(ReturnRef(hmi_capabilities_));
+
+ // Set up `active_*_language` and
+ //`persisted_ui_language_` to be different
+ hmi_language_handler_->set_default_capabilities_languages(
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US);
+
+ InitHMIActiveLanguages(hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU);
+
+ // Needed to call of `ManageMobileCommand` method
+ ON_CALL(*am::MockMessageHelper::message_helper_mock(),
+ GetOnAppInterfaceUnregisteredNotificationToMobile(_, _))
+ .WillByDefault(Return(::utils::MakeShared<smart_objects::SmartObject>()));
+
+ // Wait for `ManageMobileCommand` call twice.
+ // First time in `SendOnLanguageChangeToMobile`
+ // method, second time in `HandleWrongLanguageApp`.
+ EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(2);
+ EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(1);
+ hmi_language_handler_->on_event(event);
+}
+
+TEST_F(HmiLanguageHandlerTest, OnUnregisterApp_SUCCESS) {
+ const uint32_t app_id = 5u;
+ smart_objects::SmartObject msg;
+ msg[am::strings::params][am::strings::app_id] = app_id;
+
+ Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered);
+ event.set_smart_object(msg);
+
+ EXPECT_CALL(app_manager_, hmi_capabilities()).Times(0);
+ hmi_language_handler_->on_event(event);
+
+ hmi_language_handler_->OnUnregisterApplication(app_id);
+
+ // Set up `active_*_language` and
+ //`persisted_ui_language_` to be different
+ hmi_language_handler_->set_default_capabilities_languages(
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US,
+ hmi_apis::Common_Language::eType::EN_US);
+
+ InitHMIActiveLanguages(hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU,
+ hmi_apis::Common_Language::eType::RU_RU);
+ EXPECT_CALL(app_manager_, ManageMobileCommand(_, _)).Times(0);
+ EXPECT_CALL(app_manager_, UnregisterApplication(_, _, _, _)).Times(0);
+ hmi_language_handler_->on_event(event);
+}
+} // namespace hmi_language_handler
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/include/application_manager/application_manager_mock.h b/src/components/application_manager/test/include/application_manager/application_manager_mock.h
deleted file mode 100644
index 35f5f4dbdb..0000000000
--- a/src/components/application_manager/test/include/application_manager/application_manager_mock.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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"
-#include "application_manager/commands/command.h"
-#include "media_manager/media_manager.h"
-#include "resumption/last_state.h"
-#include "application_manager/policies/policy_handler.h"
-namespace test {
-namespace components {
-namespace state_controller_test {
-namespace am = application_manager;
-
-class ApplicationManagerMock : public application_manager::ApplicationManager {
- public:
- MOCK_METHOD1(Init, bool(resumption::LastState& last_state));
- 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, am::ApplicationSharedPtr(uint32_t app_id));
- MOCK_CONST_METHOD1(application_by_hmi_app,
- 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_METHOD1(application_id, const uint32_t(const int32_t));
- MOCK_METHOD2(set_application_id, void(const int32_t, const uint32_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));
- MOCK_METHOD1(OnApplicationRegistered, void(am::ApplicationSharedPtr));
- MOCK_METHOD2(SendMessageToMobile,
- void(const smart_objects::SmartObjectSPtr message,
- bool final_message));
- MOCK_METHOD1(SendMessageToMobile,
- void(const smart_objects::SmartObjectSPtr message));
- MOCK_METHOD1(SendMessageToHMI,
- void(const smart_objects::SmartObjectSPtr message));
- MOCK_METHOD2(ManageMobileCommand,
- bool(const smart_objects::SmartObjectSPtr message,
- am::commands::Command::CommandOrigin origin));
- MOCK_METHOD1(ManageHMICommand,
- bool(const smart_objects::SmartObjectSPtr message));
- MOCK_CONST_METHOD2(CanAppStream,
- bool(uint32_t app_id,
- protocol_handler::ServiceType service_type));
- MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
- MOCK_METHOD2(SendAudioPassThroughNotification,
- void(uint32_t session_key, std::vector<uint8_t>& binary_data));
- MOCK_CONST_METHOD0(connection_handler,
- connection_handler::ConnectionHandler&());
-};
-} // namespace state_controller_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MANAGER_MOCK_H_
diff --git a/src/components/application_manager/test/include/application_manager/application_mock.h b/src/components/application_manager/test/include/application_manager/application_mock.h
deleted file mode 100644
index 9896ecfdd4..0000000000
--- a/src/components/application_manager/test/include/application_manager/application_mock.h
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_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 test {
-namespace components {
-namespace state_controller_test {
-
-namespace am = application_manager;
-
-namespace custom_str = utils::custom_string;
-
-class MockApplication : public application_manager::Application {
- public:
- // InitialApplicationData
- MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(mac_address, const std::string&());
- MOCK_CONST_METHOD0(mobile_app_id, std::string());
- MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(ngn_media_screen_name,
- const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(language, const mobile_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_mobile_app_id, void(const std::string& mobile_app_id));
- MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name));
- MOCK_METHOD1(set_ngn_media_screen_name,
- void(const smart_objects::SmartObject& ngn_name));
- MOCK_METHOD1(set_language,
- void(const mobile_apis::Language::eType& language));
- MOCK_METHOD1(set_ui_language,
- void(const mobile_apis::Language::eType& ui_language));
-
- // DynamicApplicationData
- 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_layout,
- void(mobile_apis::LayoutMode::eType layout));
- MOCK_CONST_METHOD0(perform_interaction_layout,
- mobile_apis::LayoutMode::eType());
- 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());
- // Application
-
- MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
- MOCK_CONST_METHOD0(curHash, const std::string&());
- MOCK_METHOD0(UpdateHash, void());
- 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(StopStreamingForce,
- 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(app_id, uint32_t());
- MOCK_CONST_METHOD0(name, const custom_str::CustomString&());
- MOCK_METHOD1(set_folder_name, void(const std::string& folder_name));
- MOCK_CONST_METHOD0(folder_name, const std::string());
- MOCK_CONST_METHOD0(is_media_application, bool());
- MOCK_CONST_METHOD0(is_foreground, bool());
- MOCK_METHOD1(set_foreground, void(bool is_foreground));
- 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_METHOD1(set_tts_properties_in_none, void(bool active));
- MOCK_METHOD0(tts_properties_in_none, bool());
- MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
- MOCK_METHOD0(tts_properties_in_full, bool());
- MOCK_METHOD1(set_version, void(const application_manager::Version& version));
- MOCK_METHOD1(set_name, void(const custom_str::CustomString& name));
- MOCK_METHOD1(set_is_media_application, void(bool is_media));
- MOCK_METHOD0(increment_put_file_in_none_count, void());
- MOCK_METHOD0(increment_delete_file_in_none_count, void());
- MOCK_METHOD0(increment_list_files_in_none_count, void());
- MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
- MOCK_METHOD1(set_app_allowed, void(const bool allowed));
- MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
- MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
- MOCK_METHOD1(set_grammar_id, void(uint32_t value));
- MOCK_METHOD1(
- set_protocol_version,
- void(const application_manager::ProtocolVersion& protocol_version));
- MOCK_CONST_METHOD0(protocol_version, application_manager::ProtocolVersion());
- MOCK_METHOD1(set_is_resuming, void(bool is_resuming));
- 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_METHOD0(RemovePostponedState, void());
- MOCK_METHOD1(AddHMIState, void(application_manager::HmiStatePtr state));
- MOCK_METHOD1(RemoveHMIState,
- void(application_manager::HmiState::StateID state_id));
- MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
- MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
- MOCK_CONST_METHOD0(PostponedHmiState,
- const application_manager::HmiStatePtr());
- MOCK_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());
-};
-
-} // namespace state_controller_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_STATE_CONTROLLER_INCLUDE_APPLICATION_MOCK_H_
diff --git a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
index d4cca96431..e5a45c1549 100644
--- a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h
@@ -122,18 +122,6 @@ class CommandRequestTest : public CommandsTest<kIsNice> {
}
};
-MATCHER_P(MobileResultCodeIs, result_code, "") {
- return result_code ==
- static_cast<mobile_apis::Result::eType>(
- (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
-}
-
-MATCHER_P(HMIResultCodeIs, result_code, "") {
- return result_code ==
- static_cast<hmi_apis::FunctionID::eType>(
- (*arg)[am::strings::params][am::strings::function_id].asInt());
-}
-
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
index 232b8fef0b..553126091f 100644
--- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h
+++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h
@@ -42,22 +42,29 @@
#include "utils/make_shared.h"
#include "application_manager/mock_application_manager.h"
#include "test/application_manager/mock_application_manager_settings.h"
+#include "application_manager/mock_hmi_interface.h"
#include "application_manager/mock_application.h"
-
+#include "application_manager/mock_message_helper.h"
namespace test {
namespace components {
namespace commands_test {
+namespace am = ::application_manager;
+
using ::testing::ReturnRef;
+using ::testing::Return;
using ::testing::NiceMock;
+using ::testing::Mock;
+using ::testing::_;
using ::utils::SharedPtr;
using ::smart_objects::SmartObject;
-using ::application_manager::commands::MessageSharedPtr;
+using am::commands::MessageSharedPtr;
using ::test::components::application_manager_test::MockApplicationManager;
using ::test::components::application_manager_test::
MockApplicationManagerSettings;
-using ::application_manager::ApplicationSharedPtr;
+using am::ApplicationSharedPtr;
+using am::MockMessageHelper;
using ::test::components::application_manager_test::MockApplication;
// Depending on the value type will be selected
@@ -93,10 +100,11 @@ class CommandsTest : public ::testing::Test {
typedef typename TypeIf<kIsNice,
NiceMock<MockApplication>,
MockApplication>::Result MockApp;
-
typedef SharedPtr<MockApp> MockAppPtr;
- virtual ~CommandsTest() {}
+ virtual ~CommandsTest() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
static MessageSharedPtr CreateMessage(
const smart_objects::SmartType type = smart_objects::SmartType_Null) {
@@ -131,6 +139,8 @@ class CommandsTest : public ::testing::Test {
MockAppManager app_mngr_;
MockAppManagerSettings app_mngr_settings_;
+ MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_;
+ am::MockMessageHelper& mock_message_helper_;
protected:
virtual void InitCommand(const uint32_t& timeout) {
@@ -140,9 +150,91 @@ class CommandsTest : public ::testing::Test {
.WillByDefault(ReturnRef(timeout));
}
- CommandsTest() {}
+ CommandsTest()
+ : mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) {
+ ON_CALL(app_mngr_, hmi_interfaces())
+ .WillByDefault(ReturnRef(mock_hmi_interfaces_));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_))
+ .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_SDL));
+ ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_))
+ .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE));
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ InitHMIToMobileResultConverter();
+ }
+
+ void InitHMIToMobileResultConverter() {
+ namespace MobileResult = mobile_apis::Result;
+ namespace HMIResult = hmi_apis::Common_Result;
+ auto link_hmi_to_mob_result =
+ [this](HMIResult::eType hmi_result, MobileResult::eType mobile_result) {
+ ON_CALL(mock_message_helper_, HMIToMobileResult(hmi_result))
+ .WillByDefault(Return(mobile_result));
+ };
+ link_hmi_to_mob_result(HMIResult::INVALID_ENUM, MobileResult::INVALID_ENUM);
+ link_hmi_to_mob_result(HMIResult::SUCCESS, MobileResult::SUCCESS);
+ link_hmi_to_mob_result(HMIResult::UNSUPPORTED_REQUEST,
+ MobileResult::UNSUPPORTED_REQUEST);
+ link_hmi_to_mob_result(HMIResult::UNSUPPORTED_RESOURCE,
+ MobileResult::UNSUPPORTED_RESOURCE);
+ link_hmi_to_mob_result(HMIResult::DISALLOWED, MobileResult::DISALLOWED);
+ link_hmi_to_mob_result(HMIResult::REJECTED, MobileResult::REJECTED);
+ link_hmi_to_mob_result(HMIResult::ABORTED, MobileResult::ABORTED);
+ link_hmi_to_mob_result(HMIResult::IGNORED, MobileResult::IGNORED);
+ link_hmi_to_mob_result(HMIResult::RETRY, MobileResult::RETRY);
+ link_hmi_to_mob_result(HMIResult::IN_USE, MobileResult::IN_USE);
+ link_hmi_to_mob_result(HMIResult::TIMED_OUT, MobileResult::TIMED_OUT);
+ link_hmi_to_mob_result(HMIResult::INVALID_DATA, MobileResult::INVALID_DATA);
+ link_hmi_to_mob_result(HMIResult::CHAR_LIMIT_EXCEEDED,
+ MobileResult::CHAR_LIMIT_EXCEEDED);
+ link_hmi_to_mob_result(HMIResult::INVALID_ID, MobileResult::INVALID_ID);
+ link_hmi_to_mob_result(HMIResult::DUPLICATE_NAME,
+ MobileResult::DUPLICATE_NAME);
+ link_hmi_to_mob_result(HMIResult::APPLICATION_NOT_REGISTERED,
+ MobileResult::APPLICATION_NOT_REGISTERED);
+ link_hmi_to_mob_result(HMIResult::WRONG_LANGUAGE,
+ MobileResult::WRONG_LANGUAGE);
+ link_hmi_to_mob_result(HMIResult::OUT_OF_MEMORY,
+ MobileResult::OUT_OF_MEMORY);
+ link_hmi_to_mob_result(HMIResult::TOO_MANY_PENDING_REQUESTS,
+ MobileResult::TOO_MANY_PENDING_REQUESTS);
+ link_hmi_to_mob_result(HMIResult::WARNINGS, MobileResult::WARNINGS);
+ link_hmi_to_mob_result(HMIResult::GENERIC_ERROR,
+ MobileResult::GENERIC_ERROR);
+ link_hmi_to_mob_result(HMIResult::USER_DISALLOWED,
+ MobileResult::USER_DISALLOWED);
+ link_hmi_to_mob_result(HMIResult::TRUNCATED_DATA,
+ MobileResult::TRUNCATED_DATA);
+ link_hmi_to_mob_result(HMIResult::SAVED, MobileResult::SAVED);
+ link_hmi_to_mob_result(HMIResult::DATA_NOT_AVAILABLE,
+ MobileResult::DATA_NOT_AVAILABLE);
+ link_hmi_to_mob_result(HMIResult::READ_ONLY, MobileResult::READ_ONLY);
+ }
};
+MATCHER_P(MobileResultCodeIs, result_code, "") {
+ return result_code ==
+ static_cast<mobile_apis::Result::eType>(
+ (*arg)[application_manager::strings::msg_params]
+ [application_manager::strings::result_code].asInt());
+}
+
+MATCHER_P(HMIResultCodeIs, result_code, "") {
+ return result_code ==
+ static_cast<hmi_apis::FunctionID::eType>(
+ (*arg)[application_manager::strings::params]
+ [application_manager::strings::function_id].asInt());
+}
+
+MATCHER_P3(MobileResponseIs, result_code, result_info, result_success, "") {
+ mobile_apis::Result::eType code = static_cast<mobile_apis::Result::eType>(
+ (*arg)[am::strings::msg_params][am::strings::result_code].asInt());
+ std::string info =
+ (*arg)[am::strings::msg_params][am::strings::info].asString();
+ bool success = (*arg)[am::strings::msg_params][am::strings::success].asBool();
+ return result_code == code && result_info == info &&
+ result_success == success;
+}
+
} // namespace commands_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/include/application_manager/event_observer_mock.h b/src/components/application_manager/test/include/application_manager/event_observer_mock.h
deleted file mode 100644
index 3d3d72c5ab..0000000000
--- a/src/components/application_manager/test/include/application_manager/event_observer_mock.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_
-
-#include "application_manager/event_engine/event_observer.h"
-#include "application_manager/event_engine/event.h"
-#include "gmock/gmock.h"
-
-namespace test {
-namespace components {
-namespace event_engine_test {
-
-class MockEventObserver
- : public application_manager::event_engine::EventObserver {
- public:
- MockEventObserver(
- ::application_manager::event_engine::EventDispatcher& event_dispatcher)
- : application_manager::event_engine::EventObserver(event_dispatcher) {}
- MOCK_METHOD1(on_event,
- void(const application_manager::event_engine::Event& event));
-};
-
-} // namespace event_engine_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h
index f57ce53e38..5bf2f2368e 100644
--- a/src/components/application_manager/test/include/application_manager/mock_application.h
+++ b/src/components/application_manager/test/include/application_manager/mock_application.h
@@ -34,6 +34,7 @@
#include <string>
#include "gmock/gmock.h"
#include "application_manager/application.h"
+#include "application_manager/app_extension.h"
#include "smart_objects/smart_object.h"
#include "utils/custom_string.h"
#include "application_manager/usage_statistics.h"
@@ -43,15 +44,17 @@ namespace components {
namespace application_manager_test {
namespace custom_str = utils::custom_string;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
class MockApplication : public ::application_manager::Application {
public:
MockApplication() {}
MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
MOCK_CONST_METHOD0(curHash, const std::string&());
MOCK_METHOD0(UpdateHash, void());
- MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
- MOCK_METHOD1(set_flag_sending_hash_change_after_awake, void(bool flag));
+ DEPRECATED MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
+ DEPRECATED MOCK_METHOD1(set_flag_sending_hash_change_after_awake,
+ void(bool flag));
+ MOCK_CONST_METHOD0(IsHashChangedDuringSuspend, bool());
+ MOCK_METHOD1(SetHashChangedDuringSuspend, void(const bool flag));
MOCK_CONST_METHOD0(is_application_data_changed, bool());
MOCK_METHOD1(set_is_application_data_changed,
void(bool state_application_data));
@@ -60,6 +63,8 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD0(ChangeSupportingAppHMIType, void());
MOCK_CONST_METHOD0(is_navi, bool());
MOCK_METHOD1(set_is_navi, void(bool allow));
+ MOCK_CONST_METHOD0(mobile_projection_enabled, bool());
+ MOCK_METHOD1(set_mobile_projection_enabled, 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());
@@ -68,6 +73,10 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(set_video_streaming_allowed, void(bool state));
MOCK_CONST_METHOD0(audio_streaming_allowed, bool());
MOCK_METHOD1(set_audio_streaming_allowed, void(bool state));
+ MOCK_CONST_METHOD0(is_audio, bool());
+ MOCK_METHOD2(SetVideoConfig,
+ bool(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params));
MOCK_METHOD1(StartStreaming,
void(protocol_handler::ServiceType service_type));
MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
@@ -121,9 +130,9 @@ class MockApplication : public ::application_manager::Application {
MOCK_METHOD1(set_grammar_id, void(uint32_t value));
MOCK_METHOD1(
set_protocol_version,
- void(const ::application_manager::ProtocolVersion& protocol_version));
+ void(const ::protocol_handler::MajorProtocolVersion& protocol_version));
MOCK_CONST_METHOD0(protocol_version,
- ::application_manager::ProtocolVersion());
+ ::protocol_handler::MajorProtocolVersion());
MOCK_METHOD1(set_is_resuming, void(bool));
MOCK_CONST_METHOD0(is_resuming, bool());
MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file));
@@ -147,6 +156,7 @@ class MockApplication : public ::application_manager::Application {
bool(mobile_apis::FunctionID::eType cmd_id,
::application_manager::TLimitSource source));
MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
+ MOCK_METHOD1(SetInitialState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
MOCK_METHOD1(SetPostponedState,
void(::application_manager::HmiStatePtr state));
@@ -275,10 +285,46 @@ class MockApplication : public ::application_manager::Application {
MOCK_CONST_METHOD0(bundle_id, const std::string&());
MOCK_METHOD1(set_bundle_id, void(const std::string& bundle_id));
MOCK_METHOD0(GetAvailableDiskSpace, uint32_t());
+
MOCK_METHOD1(set_mobile_app_id, void(const std::string& policy_app_id));
MOCK_CONST_METHOD0(is_foreground, bool());
MOCK_METHOD1(set_foreground, void(bool is_foreground));
MOCK_CONST_METHOD0(IsRegistered, bool());
+ MOCK_CONST_METHOD0(SchemaUrl, std::string());
+ MOCK_CONST_METHOD0(PackageName, std::string());
+ MOCK_METHOD1(PushMobileMessage, void(smart_objects::SmartObjectSPtr message));
+ MOCK_METHOD1(
+ SwapMobileMessageQueue,
+ void(::application_manager::MobileMessageQueue& mobile_messages));
+
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_METHOD1(
+ set_system_context,
+ void(const application_manager::mobile_api::SystemContext::eType&));
+ MOCK_METHOD1(
+ set_audio_streaming_state,
+ void(const application_manager::mobile_api::AudioStreamingState::eType&
+ state));
+ MOCK_METHOD1(IsSubscribedToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(SubscribeToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(UnsubscribeFromInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(
+ set_hmi_level,
+ void(const application_manager::mobile_api::HMILevel::eType& hmi_level));
+ MOCK_METHOD1(QueryInterface,
+ application_manager::AppExtensionPtr(
+ application_manager::AppExtensionUID uid));
+ MOCK_METHOD1(AddExtension,
+ bool(application_manager::AppExtensionPtr extention));
+ MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid));
+ MOCK_METHOD0(RemoveExtensions, void());
+ MOCK_CONST_METHOD0(SubscribesIVI,
+ const application_manager::VehicleInfoSubscriptions&());
+
+#endif // SDL_REMOTE_CONTROL
};
} // namespace application_manager_test
diff --git a/src/components/application_manager/test/include/application_manager/mock_application_helper.h b/src/components/application_manager/test/include/application_manager/mock_application_helper.h
new file mode 100644
index 0000000000..1013af26bd
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_application_helper.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_HELPER_H_
+
+#include <gmock/gmock.h>
+#include "application_manager/application.h"
+#include "application_manager/application_manager.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockApplicationHelper {
+ public:
+ MOCK_METHOD2(RecallApplicationData,
+ void(application_manager::ApplicationSharedPtr,
+ application_manager::ApplicationManager&));
+
+ static MockApplicationHelper& application_helper_mock();
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_HELPER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_application_manager.h b/src/components/application_manager/test/include/application_manager/mock_application_manager.h
deleted file mode 100644
index 851592cc32..0000000000
--- a/src/components/application_manager/test/include/application_manager/mock_application_manager.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
-
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-
-#include "application_manager/application_manager.h"
-#include "application_manager/application_manager_impl.h"
-#include "application_manager/application_manager_settings.h"
-#include "application_manager/commands/command.h"
-#include "application_manager/hmi_capabilities.h"
-#include "application_manager/vehicle_info_data.h"
-#include "application_manager/state_controller.h"
-#include "resumption/last_state.h"
-#include "interfaces/MOBILE_API.h"
-#include "application_manager/app_launch/app_launch_ctrl.h"
-#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/state_controller.h"
-
-namespace test {
-namespace components {
-namespace application_manager_test {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-class MockApplicationManager : public application_manager::ApplicationManager {
- public:
- MOCK_METHOD2(Init,
- bool(resumption::LastState& last_state,
- media_manager::MediaManager* media_manager));
- MOCK_METHOD0(Stop, bool());
- MOCK_METHOD1(set_hmi_message_handler,
- void(hmi_message_handler::HMIMessageHandler* handler));
- MOCK_METHOD1(set_protocol_handler,
- void(protocol_handler::ProtocolHandler* handler));
- MOCK_METHOD1(set_connection_handler,
- void(connection_handler::ConnectionHandler* handler));
- MOCK_CONST_METHOD0(applications,
- DataAccessor<application_manager::ApplicationSet>());
- MOCK_CONST_METHOD1(
- application, application_manager::ApplicationSharedPtr(uint32_t app_id));
- MOCK_CONST_METHOD0(active_application,
- application_manager::ApplicationSharedPtr());
- MOCK_CONST_METHOD1(
- application_by_hmi_app,
- application_manager::ApplicationSharedPtr(uint32_t hmi_app_id));
- MOCK_CONST_METHOD1(application_by_policy_id,
- application_manager::ApplicationSharedPtr(
- const std::string& policy_app_id));
- MOCK_METHOD1(
- applications_by_button,
- std::vector<application_manager::ApplicationSharedPtr>(uint32_t button));
- MOCK_METHOD0(applications_with_navi,
- std::vector<application_manager::ApplicationSharedPtr>());
- MOCK_CONST_METHOD0(get_limited_media_application,
- application_manager::ApplicationSharedPtr());
- MOCK_CONST_METHOD0(get_limited_navi_application,
- application_manager::ApplicationSharedPtr());
- MOCK_CONST_METHOD0(get_limited_voice_application,
- application_manager::ApplicationSharedPtr());
- MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id));
- MOCK_METHOD2(set_application_id,
- void(const int32_t correlation_id, const uint32_t app_id));
- MOCK_METHOD3(OnHMILevelChanged,
- void(uint32_t app_id,
- mobile_apis::HMILevel::eType from,
- mobile_apis::HMILevel::eType to));
- MOCK_METHOD1(
- SendHMIStatusNotification,
- void(const utils::SharedPtr<application_manager::Application> app));
- MOCK_METHOD2(SendMessageToMobile,
- void(application_manager::commands::MessageSharedPtr, bool));
- MOCK_METHOD1(
- SendMessageToHMI,
- void(const application_manager::commands::MessageSharedPtr message));
- MOCK_METHOD1(
- ManageHMICommand,
- bool(const application_manager::commands::MessageSharedPtr message));
- MOCK_METHOD2(
- ManageMobileCommand,
- bool(const application_manager::commands::MessageSharedPtr message,
- application_manager::commands::Command::CommandOrigin origin));
- MOCK_CONST_METHOD1(
- GetDefaultHmiLevel,
- mobile_apis::HMILevel::eType(
- application_manager::ApplicationConstSharedPtr application));
- MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&());
- MOCK_CONST_METHOD0(hmi_capabilities,
- const application_manager::HMICapabilities&());
- MOCK_METHOD2(ProcessQueryApp,
- void(const smart_objects::SmartObject& sm_object,
- const uint32_t connection_key));
- MOCK_CONST_METHOD0(is_attenuated_supported, bool());
- MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited,
- bool(application_manager::ApplicationConstSharedPtr app));
- MOCK_METHOD1(OnApplicationRegistered,
- void(application_manager::ApplicationSharedPtr app));
- MOCK_CONST_METHOD0(connection_handler,
- connection_handler::ConnectionHandler&());
- MOCK_CONST_METHOD0(protocol_handler, protocol_handler::ProtocolHandler&());
- MOCK_METHOD0(GetPolicyHandler, policy::PolicyHandlerInterface&());
- MOCK_METHOD0(GetNextHMICorrelationID, uint32_t());
- MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
- MOCK_METHOD1(EndNaviServices, void(uint32_t app_id));
- MOCK_METHOD0(BeginAudioPassThrough, bool());
- MOCK_METHOD0(EndAudioPassThrough, bool());
- MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
- MOCK_METHOD0(OnHMIStartedCooperation, void());
- MOCK_CONST_METHOD0(IsHMICooperating, bool());
- MOCK_METHOD2(IviInfoUpdated,
- std::vector<application_manager::ApplicationSharedPtr>(
- application_manager::VehicleDataType vehicle_info,
- int value));
- MOCK_METHOD1(RegisterApplication,
- application_manager::ApplicationSharedPtr(const utils::SharedPtr<
- smart_objects::SmartObject>& request_for_registration));
- MOCK_METHOD0(SendUpdateAppList, void());
- MOCK_METHOD2(MarkAppsGreyOut,
- void(const connection_handler::DeviceHandle handle,
- bool is_greyed_out));
- MOCK_CONST_METHOD1(IsAppsQueriedFrom,
- bool(const connection_handler::DeviceHandle handle));
- MOCK_CONST_METHOD0(IsStopping, bool());
- MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList,
- void(const uint32_t app_id));
- MOCK_METHOD4(
- SaveBinary,
- mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data,
- const std::string& file_path,
- const std::string& file_name,
- const int64_t offset));
- MOCK_METHOD1(SetAllAppsAllowed, void(const bool allowed));
- MOCK_METHOD1(set_driver_distraction, void(bool is_distracting));
- MOCK_METHOD6(StartAudioPassThruThread,
- void(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));
- MOCK_METHOD0(StartDevicesDiscovery, void());
- MOCK_METHOD1(StopAudioPassThru, void(int32_t application_key));
- MOCK_METHOD3(TerminateRequest,
- void(const uint32_t connection_key,
- const uint32_t corr_id,
- const int32_t function_id));
- MOCK_METHOD4(UnregisterApplication,
- void(const uint32_t&, mobile_apis::Result::eType, bool, bool));
- MOCK_METHOD3(updateRequestTimeout,
- void(uint32_t connection_key,
- uint32_t mobile_correlation_id,
- uint32_t new_timeout_value));
- MOCK_METHOD0(state_controller, application_manager::StateController&());
- MOCK_METHOD1(SetUnregisterAllApplicationsReason,
- void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
- MOCK_METHOD1(HeadUnitReset,
- void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
- MOCK_CONST_METHOD2(HMILevelAllowsStreaming,
- bool(uint32_t app_id,
- protocol_handler::ServiceType service_type));
- MOCK_METHOD5(CheckPolicyPermissions,
- mobile_apis::Result::eType(
- const std::string&,
- mobile_apis::HMILevel::eType,
- mobile_apis::FunctionID::eType,
- const application_manager::RPCParams&,
- application_manager::CommandParametersPermissions*));
- MOCK_CONST_METHOD2(IsApplicationForbidden,
- bool(uint32_t connection_key,
- const std::string& policy_app_id));
- MOCK_METHOD0(resume_controller, resumption::ResumeCtrl&());
- MOCK_METHOD0(hmi_interfaces, application_manager::HmiInterfaces&());
- MOCK_METHOD0(app_launch_ctrl, app_launch::AppLaunchCtrl&());
- MOCK_METHOD1(
- GetDeviceTransportType,
- hmi_apis::Common_TransportType::eType(const std::string& transport_type));
- MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, void(const uint32_t app_id));
- MOCK_METHOD0(GenerateGrammarID, uint32_t());
- MOCK_CONST_METHOD1(GetUserConsentForDevice,
- policy::DeviceConsent(const std::string& device_id));
- MOCK_METHOD1(OnAppUnauthorized, void(const uint32_t& app_id));
- MOCK_METHOD1(ActivateApplication,
- bool(application_manager::ApplicationSharedPtr app));
- MOCK_METHOD3(OnAppStreaming,
- void(uint32_t app_id,
- protocol_handler::ServiceType service_type,
- bool state));
- MOCK_CONST_METHOD4(CreateRegularState,
- application_manager::HmiStatePtr(
- uint32_t app_id,
- mobile_apis::HMILevel::eType hmi_level,
- mobile_apis::AudioStreamingState::eType audio_state,
- mobile_apis::SystemContext::eType system_context));
- MOCK_METHOD2(SendAudioPassThroughNotification,
- void(uint32_t session_key, std::vector<uint8_t>& binary_data));
- MOCK_CONST_METHOD2(CanAppStream,
- bool(uint32_t app_id,
- protocol_handler::ServiceType service_type));
- MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
- MOCK_CONST_METHOD0(get_settings,
- const application_manager::ApplicationManagerSettings&());
- MOCK_METHOD0(event_dispatcher,
- application_manager::event_engine::EventDispatcher&());
-
- MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints, bool(const uint32_t));
- MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t));
- MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t));
- MOCK_CONST_METHOD0(IsAnyAppSubscribedForWayPoints, bool());
- MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<int32_t>());
- MOCK_CONST_METHOD1(
- WaitingApplicationByID,
- application_manager::ApplicationConstSharedPtr(const uint32_t));
- MOCK_CONST_METHOD0(
- AppsWaitingForRegistration,
- DataAccessor<application_manager::AppsWaitRegistrationSet>());
-};
-
-} // namespace application_manager_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_event_observer.h b/src/components/application_manager/test/include/application_manager/mock_event_observer.h
new file mode 100644
index 0000000000..8af31c1998
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_event_observer.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_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_OBSERVER_H_
+
+#include "application_manager/event_engine/event_observer.h"
+#include "application_manager/event_engine/event.h"
+#include "gmock/gmock.h"
+
+namespace test {
+namespace components {
+namespace event_engine_test {
+
+class MockEventObserver
+ : public application_manager::event_engine::EventObserver {
+ public:
+ MockEventObserver(
+ ::application_manager::event_engine::EventDispatcher& event_dispatcher)
+ : application_manager::event_engine::EventObserver(event_dispatcher) {}
+ MOCK_METHOD1(on_event,
+ void(const application_manager::event_engine::Event& event));
+};
+
+} // namespace event_engine_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_OBSERVER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
index a8664f5e2c..468bdbe5eb 100644
--- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
+++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h
@@ -61,6 +61,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD0(is_ivi_cooperating, bool());
MOCK_METHOD1(set_is_ivi_cooperating, void(const bool value));
+ MOCK_CONST_METHOD0(is_rc_cooperating, bool());
+ MOCK_METHOD1(set_is_rc_cooperating, void(const bool value));
+
MOCK_CONST_METHOD0(attenuated_supported, bool());
MOCK_METHOD1(set_attenuated_supported, void(const bool state));
@@ -154,6 +157,30 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD0(phone_call_supported, bool());
MOCK_METHOD1(set_phone_call_supported, void(const bool supported));
+ MOCK_CONST_METHOD0(video_streaming_supported, bool());
+ MOCK_METHOD1(set_video_streaming_supported, void(const bool supported));
+
+ MOCK_CONST_METHOD0(rc_supported, bool());
+ MOCK_METHOD1(set_rc_supported, void(const bool supported));
+
+ MOCK_CONST_METHOD0(navigation_capability,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_navigation_capability,
+ void(const smart_objects::SmartObject& navigation_capability));
+
+ MOCK_CONST_METHOD0(phone_capability, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_phone_capability,
+ void(const smart_objects::SmartObject& phone_capability));
+
+ MOCK_CONST_METHOD0(video_streaming_capability,
+ const smart_objects::SmartObject*());
+ MOCK_METHOD1(
+ set_video_streaming_capability,
+ void(const smart_objects::SmartObject& video_streaming_capability));
+ MOCK_CONST_METHOD0(rc_capability, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_rc_capability,
+ void(const smart_objects::SmartObject& rc_capability));
+
MOCK_METHOD1(Init, void(resumption::LastState* last_state));
MOCK_CONST_METHOD0(ccpu_version, const std::string&());
diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h
new file mode 100644
index 0000000000..cf40d7b98b
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_hmi_command_factory.h
@@ -0,0 +1,60 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
+
+#include <gmock/gmock.h>
+#include "application_manager/application_manager.h"
+#include "application_manager/commands/command.h"
+#include "smart_objects/smart_object.h"
+#include "utils/shared_ptr.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockHMICommandFactory {
+ public:
+ MOCK_METHOD2(CreateCommand,
+ utils::SharedPtr<application_manager::commands::Command>(
+ const utils::SharedPtr<smart_objects::SmartObject>&,
+ application_manager::ApplicationManager&));
+
+ static MockHMICommandFactory* mock_hmi_command_factory();
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_HMI_COMMAND_FACTORY_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
index d30905fc7c..7598e33e19 100644
--- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h
+++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_MESSAGE_HELPER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_MESSAGE_HELPER_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_
#include "gmock/gmock.h"
#include "application_manager/application.h"
#include "application_manager/message_helper.h"
@@ -39,10 +39,10 @@
#include "policy/policy_types.h"
#include "application_manager/policies/policy_handler_interface.h"
#include "application_manager/application_manager.h"
+#include "smart_objects/smart_object.h"
namespace application_manager {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
class MockMessageHelper {
public:
MOCK_METHOD1(GetHashUpdateNotification,
@@ -65,9 +65,15 @@ class MockMessageHelper {
const mobile_api::Result::eType mobile_result));
MOCK_METHOD1(StringToHMILevel,
mobile_api::HMILevel::eType(const std::string& hmi_level));
- MOCK_METHOD1(CreateDeviceListSO,
+ MOCK_METHOD3(CreateDeviceListSO,
smart_objects::SmartObjectSPtr(
- const connection_handler::DeviceMap& devices));
+ const connection_handler::DeviceMap& devices,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendNaviSetVideoConfig,
+ void(int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params));
MOCK_METHOD2(SendNaviStartStream,
void(int32_t connection_key, ApplicationManager& app_mngr));
MOCK_METHOD2(SendNaviStopStream,
@@ -107,17 +113,36 @@ class MockMessageHelper {
uint32_t correlation_id,
ApplicationManager& app_mngr));
MOCK_METHOD1(SendGetSystemInfoRequest, void(ApplicationManager& app_mngr));
-
+ MOCK_METHOD4(SendActivateAppToHMI,
+ void(uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority));
+ MOCK_METHOD2(SendHMIStatusNotification,
+ void(const Application& application_impl,
+ ApplicationManager& application_manager));
MOCK_METHOD4(SendPolicyUpdate,
void(const std::string& file_path,
- int timeout,
+ const uint32_t timeout,
const std::vector<int>& retries,
ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendDecryptCertificateToHMI,
+ void(const std::string& file_name,
+ ApplicationManager& app_mngr));
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ MOCK_METHOD4(
+ SendGetListOfPermissionsResponse,
+ void(const std::vector<policy::FunctionalGroupPermission>& permissions,
+ const policy::ExternalConsentStatus& external_consent_status,
+ uint32_t correlation_id,
+ ApplicationManager& app_mngr));
+#else
MOCK_METHOD3(
SendGetListOfPermissionsResponse,
void(const std::vector<policy::FunctionalGroupPermission>& permissions,
uint32_t correlation_id,
ApplicationManager& app_mngr));
+#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
MOCK_METHOD3(SendOnPermissionsChangeNotification,
void(uint32_t connection_key,
const policy::Permissions& permissions,
@@ -240,9 +265,35 @@ class MockMessageHelper {
ApplicationManager& application_manager));
MOCK_METHOD1(StringifiedHMILevel,
std::string(const mobile_apis::HMILevel::eType hmi_level));
+ MOCK_METHOD2(GetDeviceMacAddressForHandle,
+ std::string(const uint32_t device_handle,
+ const ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendDeleteCommandRequest,
+ void(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendDeleteSubmenuRequest,
+ void(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendDeleteChoiceSetRequest,
+ void(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD2(SendResetPropertiesRequest,
+ void(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendUnsubscribeButtonNotification,
+ void(mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
+ MOCK_METHOD3(SendUnsubscribeIVIRequest,
+ void(int32_t ivi_id,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr));
static MockMessageHelper* message_helper_mock();
};
} // namespace application_manager
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_MESSAGE_HELPER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_MESSAGE_HELPER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_request.h b/src/components/application_manager/test/include/application_manager/mock_request.h
new file mode 100644
index 0000000000..e4cfa84841
--- /dev/null
+++ b/src/components/application_manager/test/include/application_manager/mock_request.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_REQUEST_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/commands/command.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+using ::testing::Return;
+
+class MockRequest : public application_manager::commands::Command {
+ public:
+ MockRequest(uint32_t connection_key, uint32_t correlation_id) {
+ ON_CALL(*this, correlation_id()).WillByDefault(Return(correlation_id));
+ ON_CALL(*this, connection_key()).WillByDefault(Return(connection_key));
+ }
+
+ 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 is_allowed));
+
+ MOCK_CONST_METHOD0(connection_key, uint32_t());
+ MOCK_CONST_METHOD0(correlation_id, uint32_t());
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_REQUEST_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
index b06b207f84..fb264b7d82 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h
@@ -48,7 +48,9 @@ class MockResumeCtrl : public resumption::ResumeCtrl {
MOCK_METHOD1(RemoveApplicationFromSaved,
bool(app_mngr::ApplicationConstSharedPtr application));
MOCK_METHOD0(OnSuspend, void());
+ MOCK_METHOD0(OnIgnitionOff, void());
MOCK_METHOD0(OnAwake, void());
+ MOCK_CONST_METHOD0(is_suspended, bool());
MOCK_METHOD0(StopSavePersistentDataTimer, void());
MOCK_METHOD2(StartResumption,
bool(app_mngr::ApplicationSharedPtr application,
diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
index 09fe8d38b3..cfec034653 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
@@ -37,13 +37,13 @@
#include "application_manager/application.h"
#include "application_manager/mock_application_manager_settings.h"
#include "application_manager/mock_application_manager.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
namespace resumption_test {
namespace app_mngr = application_manager;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
class MockResumptionData : public ::resumption::ResumptionData {
public:
@@ -60,11 +60,13 @@ class MockResumptionData : public ::resumption::ResumptionData {
uint32_t(const std::string& policy_app_id,
const std::string& device_id));
MOCK_METHOD0(OnSuspend, void());
+ MOCK_METHOD0(IncrementIgnOffCount, 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_METHOD0(DecrementIgnOffCount, void());
MOCK_CONST_METHOD3(GetSavedApplication,
bool(const std::string& policy_app_id,
const std::string& device_id,
diff --git a/src/components/application_manager/test/include/application_manager/mock_statistics_manager.h b/src/components/application_manager/test/include/application_manager/mock_statistics_manager.h
deleted file mode 100644
index 668959fe2e..0000000000
--- a/src/components/application_manager/test/include/application_manager/mock_statistics_manager.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_MOCK_STATISTICS_MANAGER_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_MOCK_STATISTICS_MANAGER_H_
-
-#include <string>
-
-#include "gmock/gmock.h"
-
-#include "policy/usage_statistics/statistics_manager.h"
-#include "application_manager/usage_statistics.h"
-
-namespace test {
-namespace components {
-namespace application_manager_test {
-
-using namespace ::usage_statistics;
-class MockStatisticsManager : public StatisticsManager {
- public:
- MOCK_METHOD1(Increment, void(GlobalCounterId type));
- MOCK_METHOD2(Increment, void(const std::string& app_id, AppCounterId type));
- MOCK_METHOD3(Set,
- void(const std::string& app_id,
- AppInfoId type,
- const std::string& value));
- MOCK_METHOD3(Add,
- void(const std::string& app_id,
- AppStopwatchId type,
- int32_t timespan_seconds));
- virtual ~MockStatisticsManager() {}
-};
-
-} // namespace application_manager_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_MOCK_STATISTICS_MANAGER_H_
diff --git a/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
index bc5d444eed..cd4632965c 100644
--- a/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
+++ b/src/components/application_manager/test/include/application_manager/mock_telemetry_observer.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
+#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
#include "gmock/gmock.h"
#include "application_manager/telemetry_observer.h"
@@ -50,4 +50,4 @@ class MockAMTelemetryObserver
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
diff --git a/src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h b/src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h
deleted file mode 100644
index 51a0678b24..0000000000
--- a/src/components/application_manager/test/include/application_manager/policy_handler_interface_mock.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_POLICY_HANDLER_INTERFACE_MOCK_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_POLICY_HANDLER_INTERFACE_MOCK_H_
-
-#include "application_manager/policies/policy_handler_interface.h"
-#include "gmock/gmock.h"
-#include "policy/policy_types.h"
-
-namespace policy {
-
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
- public:
- MOCK_METHOD0(LoadPolicyLibrary, bool());
- MOCK_CONST_METHOD0(PolicyEnabled, bool());
- MOCK_METHOD0(InitPolicyTable, bool());
- MOCK_METHOD0(ResetPolicyTable, bool());
- MOCK_METHOD0(ClearUserConsent, bool());
- MOCK_METHOD2(SendMessageToSDK,
- bool(const policy::BinaryMessage& pt_string,
- const std::string& url));
- MOCK_METHOD2(ReceiveMessageFromSDK,
- bool(const std::string& file,
- const policy::BinaryMessage& pt_string));
- MOCK_METHOD0(UnloadPolicyLibrary, bool());
- MOCK_METHOD3(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
- const policy::Permissions& permissions,
- const policy::HMILevel& default_hmi));
- MOCK_METHOD2(OnPermissionsUpdated,
- void(const std::string& policy_app_id,
- const policy::Permissions& permissions));
- MOCK_METHOD3(OnSnapshotCreated,
- void(const policy::BinaryMessage& pt_string,
- const std::vector<int>& retry_delay_seconds,
- int timeout_exchange));
- MOCK_CONST_METHOD2(GetPriority,
- bool(const std::string& policy_app_id,
- std::string* priority));
- MOCK_METHOD5(CheckPermissions,
- void(const policy::PTString& app_id,
- const policy::PTString& hmi_level,
- const policy::PTString& rpc,
- const policy::RPCParams& rpc_params,
- policy::CheckPermissionResult& result));
- MOCK_CONST_METHOD1(GetNotificationsNumber,
- uint32_t(const std::string& priority));
- MOCK_CONST_METHOD1(GetUserConsentForDevice,
- policy::DeviceConsent(const std::string& device_id));
- MOCK_CONST_METHOD2(GetDefaultHmi,
- bool(const std::string& policy_app_id,
- std::string* default_hmi));
-
- MOCK_METHOD3(GetInitialAppData,
- bool(const std::string& application_id,
- policy::StringArray* nicknames,
- policy::StringArray* app_hmi_types));
- MOCK_METHOD2(GetInitialAppData,
- bool(const std::string& application_id,
- policy::StringArray* nicknames));
- MOCK_METHOD1(GetInitialAppData, bool(const std::string& application_id));
- MOCK_METHOD2(GetUpdateUrls,
- void(int service_type, policy::EndpointUrls& end_points));
- MOCK_METHOD0(ResetRetrySequence, void());
- MOCK_METHOD0(NextRetryTimeout, uint32_t());
- MOCK_METHOD0(TimeoutExchange, int());
- MOCK_METHOD0(OnExceededTimeout, void());
- MOCK_METHOD0(OnSystemReady, void());
- MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
- MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener));
- MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener));
- MOCK_CONST_METHOD0(GetStatisticManager,
- utils::SharedPtr<usage_statistics::StatisticsManager>());
- MOCK_CONST_METHOD2(CheckSystemAction,
- bool(mobile_apis::SystemAction::eType system_action,
- const std::string& policy_app_id));
- MOCK_METHOD1(KmsChanged, void(int kms));
- MOCK_METHOD2(OnActivateApp,
- void(uint32_t connection_key, uint32_t correlation_id));
- MOCK_METHOD2(OnAllowSDLFunctionalityNotification,
- void(bool is_allowed, const std::string& device_id));
- MOCK_METHOD0(OnIgnitionCycleOver, void());
- MOCK_METHOD1(OnPendingPermissionChange,
- void(const std::string& policy_app_id));
- MOCK_METHOD1(PTExchangeAtUserRequest, void(uint32_t correlation_id));
- MOCK_METHOD2(AddDevice,
- void(const std::string& device_id,
- const std::string& connection_type));
- MOCK_METHOD2(SetDeviceInfo,
- void(const std::string& device_id,
- const policy::DeviceInfo& device_info));
- MOCK_METHOD2(OnAppPermissionConsent,
- void(const uint32_t connection_key,
- const policy::PermissionConsent& permissions));
- MOCK_METHOD3(OnGetUserFriendlyMessage,
- void(const std::vector<std::string>& message_codes,
- const std::string& language,
- uint32_t correlation_id));
- MOCK_METHOD2(OnGetListOfPermissions,
- void(const uint32_t connection_key,
- const uint32_t correlation_id));
- MOCK_METHOD1(OnGetStatusUpdate, void(const uint32_t correlation_id));
- MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
- MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
- std::string(const std::string& policy_app_id));
- MOCK_METHOD1(OnSystemInfoChanged, void(const std::string& language));
- MOCK_METHOD3(OnGetSystemInfo,
- void(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language));
- MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
- MOCK_METHOD0(OnVIIsReady, void());
- MOCK_METHOD1(OnVehicleDataUpdated,
- void(const smart_objects::SmartObject& message));
- MOCK_METHOD1(RemoveDevice, void(const std::string& device_id));
- MOCK_METHOD1(AddStatisticsInfo, void(int type));
- MOCK_METHOD1(OnSystemError, void(int code));
- MOCK_CONST_METHOD0(GetAppIdForSending, uint32_t());
- MOCK_METHOD1(
- GetAppName,
- utils::custom_string::CustomString(const std::string& policy_app_id));
- MOCK_METHOD1(OnUpdateHMIAppType,
- void(std::map<std::string, policy::StringArray> app_hmi_types));
- MOCK_METHOD1(OnCertificateUpdated, void(const std::string& certificate_data));
- MOCK_METHOD1(OnCertificateDecrypted, void(bool is_succeeded));
- MOCK_METHOD0(CanUpdate, bool());
- MOCK_METHOD2(OnDeviceConsentChanged,
- void(const std::string& device_id, bool is_allowed));
- MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
- void(const policy::AppPermissions& permissions,
- const std::string& policy_app_id));
- MOCK_METHOD0(OnPTExchangeNeeded, void());
- MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>& apps));
- MOCK_METHOD1(AddApplication, void(const std::string& application_id));
- MOCK_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
- MOCK_METHOD0(OnUpdateRequestSentToMobile, void());
- MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
- MOCK_METHOD0(OnAppsSearchStarted, void());
- MOCK_METHOD0(OnAppsSearchCompleted, void());
- MOCK_METHOD1(OnAppRegisteredOnMobile,
- void(const std::string& application_id));
- MOCK_CONST_METHOD2(IsRequestTypeAllowed,
- bool(const std::string& policy_app_id,
- mobile_apis::RequestType::eType type));
- MOCK_CONST_METHOD1(
- GetAppRequestTypes,
- const std::vector<std::string>(const std::string& policy_app_id));
- MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
- MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
- MOCK_METHOD2(Increment,
- void(const std::string& app_id,
- usage_statistics::AppCounterId type));
- MOCK_METHOD3(Set,
- 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,
- int32_t timespan_seconds));
- MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
- MOCK_CONST_METHOD0(get_settings, const policy::PolicySettings&());
-
- private:
- MOCK_METHOD2(OnAppPermissionConsentInternal,
- void(const uint32_t connection_key,
- policy::PermissionConsent& permissions));
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_POLICY_HANDLER_INTERFACE_MOCK_H_
diff --git a/src/components/application_manager/test/include/application_manager/resumption_data_mock.h b/src/components/application_manager/test/include/application_manager/resumption_data_mock.h
deleted file mode 100644
index 6625b3e5b3..0000000000
--- a/src/components/application_manager/test/include/application_manager/resumption_data_mock.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
-* Copyright (c) 2016, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_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"
-#include "application_manager/mock_application_manager_settings.h"
-#include "application_manager/mock_application_manager.h"
-
-namespace test {
-namespace components {
-namespace resumption_test {
-namespace app_mngr = application_manager;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
-class MockResumptionData : public ::resumption::ResumptionData {
- public:
- MockResumptionData(const application_manager_test::MockApplicationManager&
- application_manager)
- : ResumptionData(application_manager) {}
- 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_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());
- MOCK_METHOD2(DropAppDataResumption,
- bool(const std::string& device_id, const std::string& app_id));
- MOCK_METHOD0(Persist, void());
-};
-
-} // 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/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
index b648b8ab82..436c8c165e 100644
--- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h
+++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h
@@ -73,7 +73,7 @@ class ResumptionDataTest : public ::testing::Test {
void CheckSavedApp(sm::SmartObject& saved_data);
// Set data for resumption
virtual void PrepareData();
- utils::SharedPtr<NiceMock<application_manager_test::MockApplication>>
+ utils::SharedPtr<NiceMock<application_manager_test::MockApplication> >
app_mock;
profile::Profile profile_;
diff --git a/src/components/application_manager/test/include/application_manager/statistics_manager_mock.h b/src/components/application_manager/test/include/application_manager/statistics_manager_mock.h
deleted file mode 100644
index cff4194118..0000000000
--- a/src/components/application_manager/test/include/application_manager/statistics_manager_mock.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_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 "policy/usage_statistics/statistics_manager.h"
-
-namespace test {
-namespace components {
-namespace state_controller_test {
-
-namespace us = usage_statistics;
-
-class MockStatisticsManager : 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/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt
index bfc0228bbb..8ebb2dea0e 100755
--- a/src/components/application_manager/test/message_helper/CMakeLists.txt
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt
@@ -30,14 +30,9 @@
if(BUILD_TESTS)
-set(appMain_DIR ${CMAKE_SOURCE_DIR}/src/appMain)
-
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/application_manager/test/message_helper/include
- ${COMPONENTS_DIR}/application_manager/test/state_controller/include
- ${COMPONENTS_DIR}/include
- ${COMPONENTS_DIR}
+ ${COMPONENTS_DIR}/application_manager/test/include/
)
set(LIBRARIES
@@ -52,8 +47,15 @@ set(LIBRARIES
Utils
)
+if(REMOTE_CONTROL)
+ SET (LIBRARIES
+ FunctionalModule
+ ${LIBRARIES}
+ )
+endif(REMOTE_CONTROL)
+
set(SOURCES
- #message_helper_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/message_helper/message_helper_test.cc
)
create_test("message_helper_test" "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt.user b/src/components/application_manager/test/message_helper/CMakeLists.txt.user
deleted file mode 100755
index e7522c1793..0000000000
--- a/src/components/application_manager/test/message_helper/CMakeLists.txt.user
+++ /dev/null
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.5.1, 2015-11-19T12:59:06. -->
-<qtcreator>
- <data>
- <variable>EnvironmentId</variable>
- <value type="QByteArray">{6965f0e8-9b58-4b26-8426-81354d6c3400}</value>
- </data>
- <data>
- <variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">0</value>
- </data>
- <data>
- <variable>ProjectExplorer.Project.EditorSettings</variable>
- <valuemap type="QVariantMap">
- <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
- <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
- <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
- <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
- <value type="QString" key="language">Cpp</value>
- <valuemap type="QVariantMap" key="value">
- <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
- </valuemap>
- </valuemap>
- <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
- <value type="QString" key="language">QmlJS</value>
- <valuemap type="QVariantMap" key="value">
- <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
- </valuemap>
- </valuemap>
- <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
- <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
- <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
- <value type="int" key="EditorConfiguration.IndentSize">4</value>
- <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
- <value type="int" key="EditorConfiguration.MarginColumn">80</value>
- <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
- <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
- <value type="int" key="EditorConfiguration.PaddingMode">1</value>
- <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
- <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
- <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
- <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
- <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
- <value type="int" key="EditorConfiguration.TabSize">8</value>
- <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
- <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
- <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
- <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
- <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
- <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
- </valuemap>
- </data>
- <data>
- <variable>ProjectExplorer.Project.PluginSettings</variable>
- <valuemap type="QVariantMap"/>
- </data>
- <data>
- <variable>ProjectExplorer.Project.Target.0</variable>
- <valuemap type="QVariantMap">
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.1 GCC 64bit</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.1 GCC 64bit</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.55.gcc_64_kit</value>
- <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
- <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
- <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
- <value type="bool" key="CMakeProjectManager.CMakeBuildConfiguration.UseNinja">false</value>
- <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/oherasym/sdl_panasonic/src/components/application_manager/test/message_helper-build</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
- <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
- <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
- <value type="bool" key="CMakeProjectManager.MakeStep.Clean">false</value>
- <value type="QString" key="CMakeProjectManager.MakeStep.MakeCommand"></value>
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
- </valuemap>
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
- <value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments">clean</value>
- <valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
- <value type="bool" key="CMakeProjectManager.MakeStep.Clean">true</value>
- <value type="QString" key="CMakeProjectManager.MakeStep.MakeCommand"></value>
- <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
- <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
- <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">all</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
- <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
- <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
- <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
- <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
- <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
- <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
- <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
- <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
- <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
- <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
- <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
- <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
- <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
- <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
- <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
- <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
- <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
- <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
- <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
- <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
- <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
- <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
- <value type="int">0</value>
- <value type="int">1</value>
- <value type="int">2</value>
- <value type="int">3</value>
- <value type="int">4</value>
- <value type="int">5</value>
- <value type="int">6</value>
- <value type="int">7</value>
- <value type="int">8</value>
- <value type="int">9</value>
- <value type="int">10</value>
- <value type="int">11</value>
- <value type="int">12</value>
- <value type="int">13</value>
- <value type="int">14</value>
- </valuelist>
- <value type="int" key="PE.EnvironmentAspect.Base">2</value>
- <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
- <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
- <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
- <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
- <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
- <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
- <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
- <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
- <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
- <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
- </valuemap>
- <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
- </valuemap>
- </data>
- <data>
- <variable>ProjectExplorer.Project.TargetCount</variable>
- <value type="int">1</value>
- </data>
- <data>
- <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
- <value type="int">18</value>
- </data>
- <data>
- <variable>Version</variable>
- <value type="int">18</value>
- </data>
-</qtcreator>
diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc
index 77e791dc82..289e4f5d05 100644
--- a/src/components/application_manager/test/message_helper/message_helper_test.cc
+++ b/src/components/application_manager/test/message_helper/message_helper_test.cc
@@ -37,7 +37,7 @@
#include "utils/macro.h"
#include "utils/make_shared.h"
#include "application_manager/policies/policy_handler.h"
-#include "application_manager/test/resumption/include/application_mock.h"
+#include "application_manager/mock_application.h"
#include "utils/custom_string.h"
#include "policy/mock_policy_settings.h"
#include "application_manager/policies/policy_handler.h"
@@ -46,23 +46,30 @@
#include "application_manager/state_controller.h"
#include "application_manager/resumption/resume_ctrl.h"
-namespace application_manager {
+#ifdef EXTERNAL_PROPRIETARY_MODE
+#include "policy/policy_external/include/policy/policy_types.h"
+#endif
+
namespace test {
+namespace components {
+namespace application_manager_test {
namespace HmiLanguage = hmi_apis::Common_Language;
namespace HmiResults = hmi_apis::Common_Result;
namespace MobileResults = mobile_apis::Result;
-typedef ::test::components::resumption_test::MockApplication AppMock;
-typedef utils::SharedPtr<AppMock> MockApplicationSharedPtr;
+using namespace application_manager;
+
+typedef utils::SharedPtr<MockApplication> MockApplicationSharedPtr;
typedef std::vector<std::string> StringArray;
-typedef ::application_manager::Application App;
-typedef utils::SharedPtr<App> ApplicationSharedPtr;
+typedef utils::SharedPtr<application_manager::Application> ApplicationSharedPtr;
using testing::AtLeast;
using testing::ReturnRefOfCopy;
using testing::ReturnRef;
using testing::Return;
+using testing::SaveArg;
+using testing::_;
TEST(MessageHelperTestCreate,
CreateBlockedByPoliciesResponse_SmartObject_Equal) {
@@ -74,7 +81,7 @@ TEST(MessageHelperTestCreate,
bool success = false;
smart_objects::SmartObjectSPtr ptr =
- MessageHelper::CreateBlockedByPoliciesResponse(
+ application_manager::MessageHelper::CreateBlockedByPoliciesResponse(
function_id, result, correlation_id, connection_key);
EXPECT_TRUE(ptr);
@@ -89,7 +96,8 @@ TEST(MessageHelperTestCreate,
obj[strings::params][strings::correlation_id].asUInt());
EXPECT_EQ(connection_key,
obj[strings::params][strings::connection_key].asUInt());
- EXPECT_EQ(kV2, obj[strings::params][strings::protocol_version].asInt());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2,
+ obj[strings::params][strings::protocol_version].asInt());
}
TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) {
@@ -146,7 +154,7 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
smart_objects::SmartObjectSPtr objPtr =
MakeShared<smart_objects::SmartObject>();
@@ -200,7 +208,7 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
smart_objects::SmartObjectSPtr smartObjectPtr =
utils::MakeShared<smart_objects::SmartObject>();
@@ -241,7 +249,7 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddCommandRequestToHMI_SendSmartObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
CommandsMap vis;
DataAccessor<CommandsMap> data_accessor(vis, true);
smart_objects::SmartObjectSPtr smartObjectPtr =
@@ -282,7 +290,7 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
application_manager::ChoiceSetMap vis;
DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
@@ -297,7 +305,7 @@ TEST(MessageHelperTestCreate,
TEST(MessageHelperTestCreate,
CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
application_manager::ChoiceSetMap vis;
DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true);
smart_objects::SmartObjectSPtr smartObjectPtr =
@@ -343,7 +351,7 @@ TEST(MessageHelperTestCreate,
}
TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
application_manager::SubMenuMap vis;
DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
smart_objects::SmartObjectSPtr smartObjectPtr =
@@ -382,7 +390,7 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) {
TEST(MessageHelperTestCreate,
CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) {
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
application_manager::SubMenuMap vis;
DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true);
@@ -441,7 +449,9 @@ class MessageHelperTest : public ::testing::Test {
"RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE",
"PT-PT", "NL-NL", "EN-AU", "ZH-CN", "ZH-TW", "JA-JP",
"AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO",
- "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK"}
+ "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK", "EN-IN",
+ "TH-TH", "EN-SA", "HE-IL", "RO-RO", "UK-UA", "ID-ID",
+ "VI-VN", "MS-MY", "HI-IN"}
, hmi_result_strings{"SUCCESS",
"UNSUPPORTED_REQUEST",
"UNSUPPORTED_RESOURCE",
@@ -699,7 +709,7 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_CorrectStrings_True) {
TEST_F(MessageHelperTest,
GetIVISubscriptionRequests_ValidApplication_HmiRequestNotEmpty) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating data acessor
application_manager::VehicleInfoSubscriptions vis;
DataAccessor<application_manager::VehicleInfoSubscriptions> data_accessor(
@@ -718,7 +728,7 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
policy_handler_test::MockPolicySettings policy_settings_;
@@ -734,7 +744,7 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
ProcessSoftButtons_IncorectSoftButonValue_InvalidData) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject object;
smart_objects::SmartObject& buttons = object[strings::soft_buttons];
@@ -752,7 +762,7 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::STATIC;
@@ -765,7 +775,7 @@ TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) {
TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject image;
image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -778,9 +788,39 @@ TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) {
EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
}
+TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageTypeIsStatic_Success) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating input data for method
+ smart_objects::SmartObject image;
+ image[strings::image_type] = mobile_apis::ImageType::STATIC;
+ image[strings::value] = "icon.png";
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImageApplyPath(
+ image, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::SUCCESS, result);
+ EXPECT_EQ("icon.png", image[strings::value].asString());
+}
+
+TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageValueNotValid_InvalidData) {
+ // Creating sharedPtr to MockApplication
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
+ // Creating input data for method
+ smart_objects::SmartObject image;
+ image[strings::image_type] = mobile_apis::ImageType::DYNAMIC;
+ // Invalid value
+ image[strings::value] = " ";
+ // Method call
+ mobile_apis::Result::eType result = MessageHelper::VerifyImageApplyPath(
+ image, appSharedMock, mock_application_manager);
+ // EXPECT
+ EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result);
+}
+
TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::STATIC;
@@ -795,7 +835,7 @@ TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) {
TEST_F(MessageHelperTest,
VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject images;
images[0][strings::image_type] = mobile_apis::ImageType::DYNAMIC;
@@ -813,7 +853,7 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
@@ -830,7 +870,7 @@ TEST_F(MessageHelperTest,
TEST_F(MessageHelperTest,
VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) {
// Creating sharedPtr to MockApplication
- MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>();
// Creating input data for method
smart_objects::SmartObject message;
message[0][strings::image][strings::image_type] =
@@ -891,7 +931,7 @@ TEST_F(MessageHelperTest, StringToHmiLevel_LevelString_EqEType) {
TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) {
// Create application mock
- MockApplicationSharedPtr appSharedPtr = utils::MakeShared<AppMock>();
+ MockApplicationSharedPtr appSharedPtr = utils::MakeShared<MockApplication>();
// Prepare data for method
smart_objects::SmartObject message_params;
size_t function_id = 1;
@@ -901,6 +941,126 @@ TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) {
MessageHelper::SubscribeApplicationToSoftButton(
message_params, appSharedPtr, function_id);
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) {
+ std::vector<policy::FunctionalGroupPermission> permissions;
+ policy::ExternalConsentStatus external_consent_status;
+ policy::FunctionalGroupPermission permission;
+ permission.state = policy::GroupConsent::kGroupAllowed;
+ permissions.push_back(permission);
+
+ smart_objects::SmartObjectSPtr result;
+ EXPECT_CALL(mock_application_manager, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const uint32_t correlation_id = 0u;
+ MessageHelper::SendGetListOfPermissionsResponse(permissions,
+ external_consent_status,
+ correlation_id,
+ mock_application_manager);
+
+ ASSERT_TRUE(result);
+
+ EXPECT_EQ(hmi_apis::FunctionID::SDL_GetListOfPermissions,
+ (*result)[strings::params][strings::function_id].asInt());
+
+ smart_objects::SmartObject& msg_params = (*result)[strings::msg_params];
+ const std::string external_consent_status_key = "externalConsentStatus";
+ EXPECT_TRUE(msg_params.keyExists(external_consent_status_key));
+ EXPECT_TRUE(msg_params[external_consent_status_key].empty());
+}
+
+TEST_F(MessageHelperTest,
+ SendGetListOfPermissionsResponse_ExternalConsentStatusNonEmpty_SUCCESS) {
+ std::vector<policy::FunctionalGroupPermission> permissions;
+
+ policy::ExternalConsentStatus external_consent_status;
+ const int32_t entity_type_1 = 1;
+ const int32_t entity_id_1 = 2;
+ const policy::EntityStatus entity_status_1 = policy::kStatusOn;
+ const policy::EntityStatus entity_status_2 = policy::kStatusOff;
+ const int32_t entity_type_2 = 3;
+ const int32_t entity_id_2 = 4;
+ external_consent_status.insert(policy::ExternalConsentStatusItem(
+ entity_type_1, entity_id_1, entity_status_1));
+ external_consent_status.insert(policy::ExternalConsentStatusItem(
+ entity_type_2, entity_id_2, entity_status_2));
+
+ smart_objects::SmartObjectSPtr result;
+ EXPECT_CALL(mock_application_manager, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ const uint32_t correlation_id = 0u;
+ MessageHelper::SendGetListOfPermissionsResponse(permissions,
+ external_consent_status,
+ correlation_id,
+ mock_application_manager);
+
+ ASSERT_TRUE(result);
+
+ smart_objects::SmartObject& msg_params = (*result)[strings::msg_params];
+ const std::string external_consent_status_key = "externalConsentStatus";
+ EXPECT_TRUE(msg_params.keyExists(external_consent_status_key));
+
+ smart_objects::SmartArray* status_array =
+ msg_params[external_consent_status_key].asArray();
+ EXPECT_TRUE(external_consent_status.size() == status_array->size());
+
+ const std::string entityType = "entityType";
+ const std::string entityID = "entityID";
+ const std::string status = "status";
+
+ smart_objects::SmartObject item_1_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ item_1_so[entityType] = entity_type_1;
+ item_1_so[entityID] = entity_id_1;
+ item_1_so[status] = hmi_apis::Common_EntityStatus::ON;
+
+ smart_objects::SmartObject item_2_so =
+ smart_objects::SmartObject(smart_objects::SmartType_Map);
+ item_2_so[entityType] = entity_type_2;
+ item_2_so[entityID] = entity_id_2;
+ item_2_so[status] = hmi_apis::Common_EntityStatus::OFF;
+
+ EXPECT_TRUE(status_array->end() !=
+ std::find(status_array->begin(), status_array->end(), item_1_so));
+ EXPECT_TRUE(status_array->end() !=
+ std::find(status_array->begin(), status_array->end(), item_2_so));
+}
+#endif
+
+TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) {
+ smart_objects::SmartObjectSPtr result;
+ EXPECT_CALL(mock_application_manager, ManageHMICommand(_))
+ .WillOnce(DoAll(SaveArg<0>(&result), Return(true)));
+
+ int32_t app_id = 123;
+ smart_objects::SmartObject video_params(smart_objects::SmartType_Map);
+ video_params[strings::protocol] =
+ hmi_apis::Common_VideoStreamingProtocol::RTP;
+ video_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::H264;
+ video_params[strings::width] = 640;
+ video_params[strings::height] = 480;
+
+ MessageHelper::SendNaviSetVideoConfig(
+ app_id, mock_application_manager, video_params);
+
+ EXPECT_EQ(hmi_apis::FunctionID::Navigation_SetVideoConfig,
+ (*result)[strings::params][strings::function_id].asInt());
+
+ smart_objects::SmartObject& msg_params = (*result)[strings::msg_params];
+ EXPECT_TRUE(msg_params.keyExists(strings::config));
+
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::protocol));
+ EXPECT_EQ(1, msg_params[strings::config][strings::protocol].asInt());
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::codec));
+ EXPECT_EQ(0, msg_params[strings::config][strings::codec].asInt());
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::width));
+ EXPECT_EQ(640, msg_params[strings::config][strings::width].asInt());
+ EXPECT_TRUE(msg_params[strings::config].keyExists(strings::height));
+ EXPECT_EQ(480, msg_params[strings::config][strings::height].asInt());
+}
+} // namespace application_manager_test
+} // namespace components
} // namespace test
-} // namespace application_manager
diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc
index 34a817d096..2fe28d8249 100644
--- a/src/components/application_manager/test/mobile_message_handler_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_test.cc
@@ -43,8 +43,9 @@
#include "protocol/raw_message.h"
#include "utils/make_shared.h"
-namespace application_manager {
namespace test {
+namespace components {
+namespace application_manager_test {
using protocol_handler::RawMessage;
using protocol_handler::RawMessagePtr;
@@ -52,8 +53,10 @@ using protocol_handler::ServiceType;
using protocol_handler::MessagePriority;
using protocol_handler::PROTOCOL_HEADER_V2_SIZE;
using application_manager::MobileMessageHandler;
-using application_manager::ProtocolVersion;
+using protocol_handler::MajorProtocolVersion;
using ::testing::_;
+using ::application_manager::Message;
+using ::application_manager::MobileMessage;
using testing::Return;
@@ -137,7 +140,7 @@ class MobileMessageHandlerTest : public testing::Test {
EXPECT_EQ(full_data_size, message->data_size());
EXPECT_EQ(payload_size, message->payload_size());
EXPECT_TRUE(message->has_binary_data());
- EXPECT_EQ(MessageType::kNotification, message->type());
+ EXPECT_EQ(application_manager::MessageType::kNotification, message->type());
}
void TestHandlingIncomingMessageWithoutBinaryDataProtocol(
@@ -157,23 +160,24 @@ class MobileMessageHandlerTest : public testing::Test {
EXPECT_EQ(full_data_size, message->data_size());
EXPECT_EQ(payload_size, message->payload_size());
EXPECT_FALSE(message->has_binary_data());
- EXPECT_EQ(MessageType::kNotification, message->type());
+ EXPECT_EQ(application_manager::MessageType::kNotification, message->type());
}
- MobileMessage CreateMessageForSending(uint32_t protocol_version,
- uint32_t function_id,
- uint32_t correlation_id,
- uint32_t connection_key,
- const std::string& json_msg,
- BinaryData* data = NULL) {
+ MobileMessage CreateMessageForSending(
+ uint32_t protocol_version,
+ uint32_t function_id,
+ uint32_t correlation_id,
+ uint32_t connection_key,
+ const std::string& json_msg,
+ const application_manager::BinaryData* data = NULL) {
MobileMessage message = utils::MakeShared<Message>(
MessagePriority::FromServiceType(ServiceType::kRpc));
message->set_function_id(function_id);
message->set_correlation_id(correlation_id);
message->set_connection_key(connection_key);
message->set_protocol_version(
- static_cast<ProtocolVersion>(protocol_version));
- message->set_message_type(MessageType::kNotification);
+ static_cast<protocol_handler::MajorProtocolVersion>(protocol_version));
+ message->set_message_type(application_manager::MessageType::kNotification);
if (data) {
message->set_binary_data(data);
}
@@ -214,7 +218,8 @@ class MobileMessageHandlerTest : public testing::Test {
void TestHandlingOutgoingMessageProtocolWithBinaryData(
const uint32_t protocol_version) {
// Arrange
- BinaryData* bin_dat = new BinaryData;
+ application_manager::BinaryData* bin_dat =
+ new application_manager::BinaryData;
bin_dat->push_back('\a');
const uint32_t function_id = 247u;
@@ -251,9 +256,10 @@ TEST(mobile_message_test, basic_test) {
MobileMessage message =
utils::MakeShared<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);
+ application_manager::BinaryData binary_data;
+ binary_data.push_back('X');
+ message->set_binary_data(
+ (const application_manager::BinaryData*)&binary_data);
EXPECT_TRUE(message->has_binary_data());
}
@@ -264,7 +270,7 @@ TEST_F(
size_t payload_size = data.size();
std::srand(time(0));
// Generate unknown random protocol version except 1-3
- uint32_t protocol_version = 4 + rand() % UINT32_MAX;
+ uint32_t protocol_version = 5 + rand() % UINT32_MAX;
Message* message =
HandleIncomingMessage(protocol_version, data, payload_size);
@@ -282,7 +288,7 @@ TEST_F(
const uint32_t correlation_id = 92u;
const uint32_t connection_key = 1u;
// Generate unknown random protocol version except 1-3
- uint32_t protocol_version = 4 + rand() % UINT32_MAX;
+ uint32_t protocol_version = 5 + rand() % UINT32_MAX;
MobileMessage message_to_send = CreateMessageForSending(
protocol_version, function_id, correlation_id, connection_key, data);
@@ -350,5 +356,6 @@ TEST_F(
TestHandlingOutgoingMessageProtocolWithBinaryData(protocol_version);
}
+} // namespace application_manager_test
+} // namespace components
} // namespace test
-} // namespace application_manager
diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
index 8301bf6f18..a19ea991b9 100644
--- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc
+++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc
@@ -45,9 +45,11 @@
using protocol_handler::RawMessage;
using protocol_handler::RawMessagePtr;
using protocol_handler::PROTOCOL_HEADER_V1_SIZE;
+using application_manager::MobileMessageHandler;
-namespace application_manager {
namespace test {
+namespace components {
+namespace application_manager_test {
const int32_t connection_key_p1 = 1;
const int32_t protocol_version_1 = 1;
@@ -105,10 +107,12 @@ TEST(MobileMessageHandlerTestV1Test,
HandleOutgoingMessageProtocol_SendMessage_ExpectEqual) {
uint32_t connection_key = 1;
- MobileMessage message =
- utils::MakeShared<Message>(protocol_handler::MessagePriority::kDefault);
+ application_manager::MobileMessage message =
+ utils::MakeShared<application_manager::Message>(
+ protocol_handler::MessagePriority::kDefault);
- message->set_protocol_version(application_manager::ProtocolVersion::kV1);
+ message->set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1);
message->set_json_message(data_json);
message->set_connection_key(connection_key_p1);
@@ -118,9 +122,11 @@ TEST(MobileMessageHandlerTestV1Test,
ASSERT_TRUE(ptr);
EXPECT_EQ(connection_key, ptr->connection_key());
- EXPECT_EQ(static_cast<uint32_t>(application_manager::ProtocolVersion::kV1),
+ EXPECT_EQ(static_cast<uint32_t>(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1),
ptr->protocol_version());
}
+} // namespace application_manager_test
+} // namespace components
} // namespace test
-} // namespace application_manager
diff --git a/src/components/application_manager/test/mock_application_helper.cc b/src/components/application_manager/test/mock_application_helper.cc
new file mode 100644
index 0000000000..c64a56e53e
--- /dev/null
+++ b/src/components/application_manager/test/mock_application_helper.cc
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "application_manager/mock_application_helper.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+MockApplicationHelper& MockApplicationHelper::application_helper_mock() {
+ static ::testing::NiceMock<MockApplicationHelper> application_helper_mock;
+ return application_helper_mock;
+}
+
+} // application_manager_test
+} // components
+} // test
+
+namespace application_manager {
+
+void DeleteApplicationData(ApplicationSharedPtr app,
+ ApplicationManager& app_manager) {
+ test::components::application_manager_test::MockApplicationHelper::
+ application_helper_mock().RecallApplicationData(app, app_manager);
+}
+} // application_managers
diff --git a/src/components/application_manager/test/mock_hmi_command_factory.cc b/src/components/application_manager/test/mock_hmi_command_factory.cc
new file mode 100644
index 0000000000..c2b4644f86
--- /dev/null
+++ b/src/components/application_manager/test/mock_hmi_command_factory.cc
@@ -0,0 +1,57 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <gmock/gmock.h>
+#include "application_manager/hmi_command_factory.h"
+#include "application_manager/mock_hmi_command_factory.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+MockHMICommandFactory* MockHMICommandFactory::mock_hmi_command_factory() {
+ static MockHMICommandFactory mock_hmi_command_factory;
+ return &mock_hmi_command_factory;
+}
+
+} // application_manager_test
+} // components
+} // test
+
+namespace application_manager {
+CommandSharedPtr HMICommandFactory::CreateCommand(
+ const commands::MessageSharedPtr& message,
+ ApplicationManager& application_manager) {
+ return test::components::application_manager_test::MockHMICommandFactory::
+ mock_hmi_command_factory()->CreateCommand(message, application_manager);
+}
+} // application_manager
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 57cfa5a26e..2a74f5b3b1 100644
--- a/src/components/application_manager/test/mock_message_helper.cc
+++ b/src/components/application_manager/test/mock_message_helper.cc
@@ -33,6 +33,8 @@
#include "application_manager/message_helper.h"
#include "application_manager/mock_message_helper.h"
#include "application_manager/policies/policy_handler_interface.h"
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
namespace application_manager {
@@ -41,6 +43,13 @@ void MessageHelper::SendHashUpdateNotification(uint32_t const app_id,
MockMessageHelper::message_helper_mock()->SendHashUpdateNotification(
app_id, app_mngr);
}
+void MessageHelper::SendNaviSetVideoConfig(
+ int32_t app_id,
+ ApplicationManager& app_mngr,
+ const smart_objects::SmartObject& video_params) {
+ MockMessageHelper::message_helper_mock()->SendNaviSetVideoConfig(
+ app_id, app_mngr, video_params);
+}
void MessageHelper::SendNaviStartStream(int32_t connection_key,
ApplicationManager& app_mngr) {
MockMessageHelper::message_helper_mock()->SendNaviStartStream(connection_key,
@@ -68,6 +77,12 @@ void MessageHelper::SendOnDataStreaming(protocol_handler::ServiceType service,
service, available, app_mngr);
}
+void MessageHelper::SendDecryptCertificateToHMI(const std::string& file_name,
+ ApplicationManager& app_mngr) {
+ MockMessageHelper::message_helper_mock()->SendDecryptCertificateToHMI(
+ file_name, app_mngr);
+}
+
smart_objects::SmartObjectSPtr GetHashUpdateNotification(
const uint32_t app_id) {
return MockMessageHelper::message_helper_mock()->GetHashUpdateNotification(
@@ -115,9 +130,12 @@ mobile_api::HMILevel::eType MessageHelper::StringToHMILevel(
return MockMessageHelper::message_helper_mock()->StringToHMILevel(hmi_level);
}
-smart_objects::SmartObjectSPtr CreateDeviceListSO(
- const connection_handler::DeviceMap& devices) {
- return MockMessageHelper::message_helper_mock()->CreateDeviceListSO(devices);
+smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO(
+ const connection_handler::DeviceMap& devices,
+ const policy::PolicyHandlerInterface& policy_handler,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->CreateDeviceListSO(
+ devices, policy_handler, app_mngr);
}
void MessageHelper::SendOnAppPermissionsChangedNotification(
@@ -164,10 +182,18 @@ void MessageHelper::CreateGetVehicleDataRequest(
void MessageHelper::SendGetListOfPermissionsResponse(
const std::vector<policy::FunctionalGroupPermission>& permissions,
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ const policy::ExternalConsentStatus& external_consent_status,
+#endif // EXTERNAL_PROPRIETARY_MODE
uint32_t correlation_id,
ApplicationManager& app_mngr) {
MockMessageHelper::message_helper_mock()->SendGetListOfPermissionsResponse(
- permissions, correlation_id, app_mngr);
+ permissions,
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ external_consent_status,
+#endif // EXTERNAL_PROPRIETARY_MODE
+ correlation_id,
+ app_mngr);
}
void MessageHelper::SendOnPermissionsChangeNotification(
@@ -196,13 +222,32 @@ void MessageHelper::SendSDLActivateAppResponse(
}
void MessageHelper::SendPolicyUpdate(const std::string& file_path,
- int timeout,
+ const uint32_t timeout,
const std::vector<int>& retries,
ApplicationManager& app_mngr) {
MockMessageHelper::message_helper_mock()->SendPolicyUpdate(
file_path, timeout, retries, app_mngr);
}
+#ifdef SDL_REMOTE_CONTROL
+void MessageHelper::SendActivateAppToHMI(
+ uint32_t const app_id,
+ ApplicationManager& application_manager,
+ hmi_apis::Common_HMILevel::eType level,
+ bool send_policy_priority) {
+ MockMessageHelper::message_helper_mock()->SendActivateAppToHMI(
+ app_id, application_manager, level, send_policy_priority);
+}
+
+void MessageHelper::SendHMIStatusNotification(
+ const Application& application_impl,
+ ApplicationManager& application_manager) {
+ MockMessageHelper::message_helper_mock()->SendHMIStatusNotification(
+ application_impl, application_manager);
+}
+
+#endif // SDL_REMOTE_CONTROL
+
void MessageHelper::SendUpdateSDLResponse(const std::string& result,
uint32_t correlation_id,
ApplicationManager& app_mngr) {
@@ -223,7 +268,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
}
MockMessageHelper* MockMessageHelper::message_helper_mock() {
- static MockMessageHelper message_helper_mock;
+ static ::testing::NiceMock<MockMessageHelper> message_helper_mock;
return &message_helper_mock;
}
void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
@@ -450,4 +495,52 @@ std::string MessageHelper::StringifiedHMILevel(
hmi_level);
}
+std::string MessageHelper::GetDeviceMacAddressForHandle(
+ const uint32_t device_handle, const ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->GetDeviceMacAddressForHandle(
+ device_handle, app_mngr);
+}
+
+void MessageHelper::SendDeleteCommandRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendDeleteCommandRequest(
+ cmd, application, app_mngr);
+}
+
+void MessageHelper::SendDeleteSubmenuRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendDeleteSubmenuRequest(
+ cmd, application, app_mngr);
+}
+
+void MessageHelper::SendDeleteChoiceSetRequest(smart_objects::SmartObject* cmd,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendDeleteChoiceSetRequest(
+ cmd, application, app_mngr);
+}
+
+void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendResetPropertiesRequest(
+ application, app_mngr);
+}
+
+void MessageHelper::SendUnsubscribeButtonNotification(
+ mobile_apis::ButtonName::eType button,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()
+ ->SendUnsubscribeButtonNotification(button, application, app_mngr);
+}
+
+void MessageHelper::SendUnsubscribeIVIRequest(int32_t ivi_id,
+ ApplicationSharedPtr application,
+ ApplicationManager& app_mngr) {
+ return MockMessageHelper::message_helper_mock()->SendUnsubscribeIVIRequest(
+ ivi_id, application, app_mngr);
+}
+
} // namespace application_manager
diff --git a/src/components/application_manager/test/policy_event_observer_test.cc b/src/components/application_manager/test/policy_event_observer_test.cc
index 25b54453e5..9b97f054b3 100644
--- a/src/components/application_manager/test/policy_event_observer_test.cc
+++ b/src/components/application_manager/test/policy_event_observer_test.cc
@@ -42,12 +42,11 @@ namespace test {
namespace components {
namespace policy_test {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
using application_manager::event_engine::Event;
using namespace policy;
using testing::_;
-using ::testing::Return;
+namespace smart_objects = ::smart_objects;
class PolicyEventObserverTest : public ::testing::Test {
public:
@@ -135,6 +134,6 @@ TEST_F(PolicyEventObserverTest,
CheckResultsOnEvent(0u, 1u);
}
-} // namespace policy_event_observer
+} // namespace policy_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc
index 44b4791f85..66efe45e30 100644
--- a/src/components/application_manager/test/policy_handler_test.cc
+++ b/src/components/application_manager/test/policy_handler_test.cc
@@ -36,7 +36,7 @@
#include "gmock/gmock.h"
#include "application_manager/policies/policy_handler.h"
-#include "policy/mock_policy_manager.h"
+#include "application_manager/policies/delegates/app_permission_delegate.h"
#include "connection_handler/connection_handler_impl.h"
#include "application_manager/application_manager_impl.h"
#include "application_manager/application_impl.h"
@@ -57,6 +57,7 @@
#include "policy/usage_statistics/statistics_manager.h"
#include "interfaces/MOBILE_API.h"
#include "policy/mock_policy_settings.h"
+#include "utils/make_shared.h"
#include "application_manager/mock_application.h"
#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol_handler/mock_session_observer.h"
@@ -65,6 +66,9 @@
#include "application_manager/policies/mock_policy_handler_observer.h"
#include "application_manager/mock_event_dispatcher.h"
#include "application_manager/mock_state_controller.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "policy/mock_policy_manager.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
namespace test {
namespace components {
@@ -74,6 +78,7 @@ using namespace application_manager;
using namespace policy;
using namespace utils::custom_string;
using testing::_;
+using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::NiceMock;
@@ -81,6 +86,9 @@ using ::testing::SetArgReferee;
using ::testing::SetArgPointee;
using ::testing::DoAll;
using ::testing::SetArgReferee;
+using ::testing::Mock;
+
+const std::string kDummyData = "some_data";
class PolicyHandlerTest : public ::testing::Test {
public:
@@ -96,9 +104,26 @@ class PolicyHandlerTest : public ::testing::Test {
, kPreloadPTFile_("sdl_preloaded_pt.json")
, kAppStorageFolder_("storage")
, app_set(test_app, app_lock)
- , kAppId_(10u)
+ , kAppId1_(10u)
+ , kAppId2_(11u)
+ , kConnectionKey_(1u)
+ , kCorrelationKey_(2u)
, kSnapshotFile_("snapshot")
- , kSnapshotStorage_("snapshot_storage") {}
+ , kSnapshotStorage_("snapshot_storage")
+ , kGroupAliasAllowed_("allowed")
+ , kGroupAliasDisallowed_("disallowed")
+ , kGroupNameAllowed_("name_allowed")
+ , kGroupNameDisallowed_("name_disallowed")
+ , kCallsCount_(1u)
+ , kTimeout_(1000u)
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock()) {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ ~PolicyHandlerTest() {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ Mock::VerifyAndClearExpectations(&app_manager_);
+ }
protected:
NiceMock<MockPolicySettings> policy_settings_;
@@ -107,6 +132,8 @@ class PolicyHandlerTest : public ::testing::Test {
connection_handler_test::MockConnectionHandler conn_handler;
protocol_handler_test::MockSessionObserver mock_session_observer;
application_manager_test::MockStateController mock_state_controller;
+ components::usage_statistics_test::MockStatisticsManager
+ mock_statistics_manager_;
PolicyHandler policy_handler_;
utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
application_manager_test::MockApplicationManager app_manager_;
@@ -122,11 +149,22 @@ class PolicyHandlerTest : public ::testing::Test {
ApplicationSet test_app;
sync_primitives::Lock app_lock;
DataAccessor<ApplicationSet> app_set;
- const uint32_t kAppId_;
+ const uint32_t kAppId1_;
+ const uint32_t kAppId2_;
+ const uint32_t kConnectionKey_;
+ const uint32_t kCorrelationKey_;
const std::string kSnapshotFile_;
const std::string kSnapshotStorage_;
+ const std::string kGroupAliasAllowed_;
+ const std::string kGroupAliasDisallowed_;
+ const std::string kGroupNameAllowed_;
+ const std::string kGroupNameDisallowed_;
+ const uint32_t kCallsCount_;
+ const uint32_t kTimeout_;
+ application_manager::MockMessageHelper& mock_message_helper_;
virtual void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set));
ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
ON_CALL(app_manager_, event_dispatcher())
@@ -146,6 +184,7 @@ class PolicyHandlerTest : public ::testing::Test {
}
virtual void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
ON_CALL(mock_event_dispatcher_, remove_observer(_, _));
}
@@ -179,13 +218,84 @@ class PolicyHandlerTest : public ::testing::Test {
.WillOnce(ReturnRef(kSnapshotFile_));
EXPECT_CALL(policy_settings_, system_files_path())
.WillOnce(ReturnRef(kSnapshotStorage_));
- EXPECT_CALL(*mock_policy_manager_, TimeoutExchange()).WillOnce(Return(1));
+#ifdef PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_, TimeoutExchangeMSec())
+ .WillOnce(Return(1));
EXPECT_CALL(*mock_policy_manager_, RetrySequenceDelaysSeconds())
.WillOnce(Return(retry_sequence_delay_seconds));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendPolicyUpdate(_, _, _, _));
+#endif // PROPRIETARY_MODE
+ EXPECT_CALL(mock_message_helper_, SendPolicyUpdate(_, _, _, _));
+ }
+
+ void TestOnPermissionsUpdated(const std::string& default_hmi_level,
+ const mobile_apis::HMILevel::eType hmi_level) {
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(default_hmi_level))
+ .WillOnce(Return(hmi_level));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
+ EXPECT_CALL(app_manager_, state_controller()).Times(0);
+
+ Permissions permissions;
+ policy_handler_.OnPermissionsUpdated(
+ kPolicyAppId_, permissions, default_hmi_level);
+ }
+
+ void CreateFunctionalGroupPermission(
+ const GroupConsent state,
+ const std::string& group_alias,
+ const std::string& group_name,
+ policy::FunctionalGroupPermission& group_permission) {
+ group_permission.state = state;
+ group_permission.group_alias = group_alias;
+ group_permission.group_name = group_name;
+ }
+
+ policy_table::AppHmiTypes HmiTypes(const policy_table::AppHMIType hmi_type) {
+ policy_table::AppHmiTypes hmi_types;
+ hmi_types.push_back(hmi_type);
+ return hmi_types;
+ }
+};
+
+namespace {
+/**
+ * @brief The WaitAsync class
+ * can wait for a certain amount of function calls from different
+ * threads, or a timeout expires.
+ */
+class WaitAsync {
+ public:
+ WaitAsync(const uint32_t count, const uint32_t timeout)
+ : count_(count), timeout_(timeout) {}
+
+ void Notify() {
+ count_--;
+ cond_var_.NotifyOne();
+ }
+
+ bool Wait(sync_primitives::AutoLock& auto_lock) {
+ while (count_ > 0) {
+ sync_primitives::ConditionalVariable::WaitStatus wait_status =
+ cond_var_.WaitFor(auto_lock, timeout_);
+ if (wait_status == sync_primitives::ConditionalVariable::kTimeout) {
+ return false;
+ }
+ }
+ return true;
}
+
+ private:
+ int count_;
+ const uint32_t timeout_;
+ sync_primitives::ConditionalVariable cond_var_;
};
+}
TEST_F(PolicyHandlerTest, LoadPolicyLibrary_Method_ExpectLibraryLoaded) {
// Check before policy enabled from ini file
@@ -220,6 +330,16 @@ TEST_F(PolicyHandlerTest,
EXPECT_FALSE(policy_handler_.ResetPolicyTable());
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+TEST_F(PolicyHandlerTest, ResetPolicyTable_PTNotInitialised_PTNotReset) {
+ // Arrange
+ EXPECT_CALL(app_manager_, event_dispatcher());
+ EnablePolicy();
+ EXPECT_TRUE(policy_handler_.LoadPolicyLibrary());
+ // Check
+ EXPECT_FALSE(policy_handler_.ResetPolicyTable());
+}
+#else
TEST_F(PolicyHandlerTest, ResetPolicyTable_PTNotInitialised_PTNotReset) {
// Arrange
EnablePolicy();
@@ -228,6 +348,8 @@ TEST_F(PolicyHandlerTest, ResetPolicyTable_PTNotInitialised_PTNotReset) {
EXPECT_TRUE(policy_handler_.ResetPolicyTable());
}
+#endif
+
TEST_F(PolicyHandlerTest,
ResetPolicyTable_WithPreloadedFile_ExpectPolicyTableReset) {
// Arrange
@@ -270,8 +392,7 @@ TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK) {
BinaryMessage msg(json.begin(), json.end());
// Checks
EXPECT_CALL(app_manager_, GetNextHMICorrelationID());
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- CreateGetVehicleDataRequest(_, _, _));
+ EXPECT_CALL(mock_message_helper_, CreateGetVehicleDataRequest(_, _, _));
EXPECT_CALL(*mock_policy_manager_, PTUpdatedAt(_, _));
EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(true));
EXPECT_CALL(*mock_policy_manager_, CleanupUnpairedDevices());
@@ -286,11 +407,9 @@ TEST_F(PolicyHandlerTest, ReceiveMessageFromSDK_PTNotLoaded) {
EXPECT_CALL(*mock_policy_manager_, LoadPT("", msg)).WillOnce(Return(false));
EXPECT_CALL(*mock_policy_manager_, ForcePTExchange()).WillOnce(Return(""));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnStatusUpdate(_, _));
EXPECT_CALL(app_manager_, GetNextHMICorrelationID()).Times(0);
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- CreateGetVehicleDataRequest(_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_, CreateGetVehicleDataRequest(_, _, _))
+ .Times(0);
policy_handler_.ReceiveMessageFromSDK("", msg);
}
@@ -308,34 +427,66 @@ TEST_F(PolicyHandlerTest, UnloadPolicyLibrary_method_ExpectLibraryUnloaded) {
TEST_F(PolicyHandlerTest, OnPermissionsUpdated_method_With2Parameters) {
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
// Act
Permissions perms;
policy_handler_.OnPermissionsUpdated(kPolicyAppId_, perms);
}
+TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) {
+ utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(_, _, _)).Times(0);
+
+ Permissions permissions;
+ policy_handler_.OnPermissionsUpdated(kPolicyAppId_, permissions);
+}
+
+TEST_F(PolicyHandlerTest, OnPermissionsUpdated_InvalidApp_UNSUCCESS) {
+ utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
+ .WillOnce(Return(mock_app_))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
+
+ Permissions permissions;
+ policy_handler_.OnPermissionsUpdated(kPolicyAppId_, permissions, "HMI_FULL");
+}
+
+TEST_F(PolicyHandlerTest, OnPermissionsUpdated_HmiLevelInvalidEnum_UNSUCCESS) {
+ TestOnPermissionsUpdated("INVALID_ENUM", mobile_apis::HMILevel::INVALID_ENUM);
+}
+
+TEST_F(PolicyHandlerTest,
+ OnPermissionsUpdated_HmiLevelEqualsToCurrentHmiLevel_UNSUCCESS) {
+ TestOnPermissionsUpdated("HMI_NONE", mobile_apis::HMILevel::HMI_NONE);
+}
+
TEST_F(PolicyHandlerTest,
OnPermissionsUpdated_MethodWith3Parameters_FromNONE_ToFULL) {
// Set hmi level from NONE to FULL
const std::string new_kHmiLevel_string = "HMI_FULL";
mobile_apis::HMILevel::eType new_hmi_level = mobile_apis::HMILevel::HMI_FULL;
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.Times(2)
.WillRepeatedly(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- StringToHMILevel(new_kHmiLevel_string))
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(new_kHmiLevel_string))
.WillOnce(Return(new_hmi_level));
EXPECT_CALL(*mock_app_, hmi_level())
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
@@ -353,18 +504,17 @@ TEST_F(PolicyHandlerTest,
mobile_apis::HMILevel::eType new_hmi_level =
mobile_apis::HMILevel::HMI_LIMITED;
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.Times(2)
.WillRepeatedly(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- StringToHMILevel(new_kHmiLevel_string))
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(new_kHmiLevel_string))
.WillOnce(Return(new_hmi_level));
EXPECT_CALL(*mock_app_, hmi_level())
.WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
@@ -381,18 +531,17 @@ TEST_F(PolicyHandlerTest,
std::string new_kHmiLevel_string = "HMI_FULL";
mobile_apis::HMILevel::eType new_hmi_level = mobile_apis::HMILevel::HMI_FULL;
// Check expectations
- EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.Times(2)
.WillRepeatedly(Return(mock_app_));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- StringToHMILevel(new_kHmiLevel_string))
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(new_kHmiLevel_string))
.WillOnce(Return(new_hmi_level));
EXPECT_CALL(*mock_app_, hmi_level())
.WillOnce(Return(mobile_apis::HMILevel::HMI_LIMITED));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnPermissionsChangeNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnPermissionsChangeNotification(kAppId1_, _, _));
EXPECT_CALL(app_manager_, state_controller()).Times(0);
// Act
@@ -416,12 +565,28 @@ TEST_F(PolicyHandlerTest, CheckPermissions) {
CheckPermissionResult result;
RPCParams kRpc_params;
// Check expectations
+ const uint32_t device = 3;
+ const mobile_apis::HMILevel::eType hmi_level =
+ mobile_apis::HMILevel::HMI_NONE;
+ EXPECT_CALL(*mock_app_, hmi_level()).WillOnce(Return(hmi_level));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(device));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+#ifdef EXTERNAL_PROPRIETARY_MODE
EXPECT_CALL(
*mock_policy_manager_,
CheckPermissions(kPolicyAppId_, kHmiLevel_, kRpc_, kRpc_params, _));
+
+#else // EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_,
+ CheckPermissions(
+ kDeviceId, kPolicyAppId_, kHmiLevel_, kRpc_, kRpc_params, _));
+#endif // EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_message_helper_, StringifiedHMILevel(hmi_level))
+ .WillOnce(Return(kHmiLevel_));
+ EXPECT_CALL(mock_message_helper_, GetDeviceMacAddressForHandle(device, _))
+ .WillOnce(Return(kDeviceId));
// Act
- policy_handler_.CheckPermissions(
- kPolicyAppId_, kHmiLevel_, kRpc_, kRpc_params, result);
+ policy_handler_.CheckPermissions(mock_app_, kRpc_, kRpc_params, result);
}
TEST_F(PolicyHandlerTest, GetNotificationsNumber) {
@@ -465,42 +630,44 @@ TEST_F(PolicyHandlerTest, GetInitialAppData) {
policy_handler_.GetInitialAppData(kPolicyAppId_, nicknames, app_hmi_types);
}
-TEST_F(PolicyHandlerTest, GetServiceUrls) {
+TEST_F(PolicyHandlerTest, GetUpdateUrls) {
// Arrange
EnablePolicyAndPolicyManagerMock();
EndpointUrls endpoints;
- const std::string service_type_ = "0x0";
+ const std::string service_type = "0x0";
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, GetServiceUrls(service_type_, _));
+ EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls(service_type, _));
// Act
- policy_handler_.GetServiceUrls(service_type_, endpoints);
+ policy_handler_.GetUpdateUrls(service_type, endpoints);
}
-TEST_F(PolicyHandlerTest, ResetRetrySequence) {
+TEST_F(PolicyHandlerTest, NextRetryTimeout) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, ResetRetrySequence());
+ EXPECT_CALL(*mock_policy_manager_, NextRetryTimeout());
// Act
- policy_handler_.ResetRetrySequence();
+ policy_handler_.NextRetryTimeout();
}
-TEST_F(PolicyHandlerTest, NextRetryTimeout) {
+TEST_F(PolicyHandlerTest, TimeoutExchangeSec) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, NextRetryTimeout());
+ EXPECT_CALL(*mock_policy_manager_, TimeoutExchangeMSec())
+ .WillOnce(Return(1000));
// Act
- policy_handler_.NextRetryTimeout();
+ EXPECT_EQ(1u, policy_handler_.TimeoutExchangeSec());
}
-TEST_F(PolicyHandlerTest, TimeoutExchange) {
+TEST_F(PolicyHandlerTest, TimeoutExchangeMsec) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, TimeoutExchange());
+ EXPECT_CALL(*mock_policy_manager_, TimeoutExchangeMSec())
+ .WillOnce(Return(1000));
// Act
- policy_handler_.TimeoutExchange();
+ EXPECT_EQ(1000u, policy_handler_.TimeoutExchangeMSec());
}
TEST_F(PolicyHandlerTest, OnExceededTimeout) {
@@ -611,15 +778,48 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
AppPermissions permissions(kPolicyAppId_);
permissions.appPermissionsConsentNeeded = true;
- // Check expectations
+// Check expectations
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ const connection_handler::DeviceHandle device_handle = 0u;
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillRepeatedly(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ utils::SharedPtr<usage_statistics_test::MockStatisticsManager>
+ mock_statistics_manager =
+ utils::MakeShared<usage_statistics_test::MockStatisticsManager>();
+ UsageStatistics usage_stats(
+ "0",
+ utils::SharedPtr<usage_statistics::StatisticsManager>(
+ mock_statistics_manager));
+ EXPECT_CALL(*application1, usage_report()).WillOnce(ReturnRef(usage_stats));
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(DeviceConsent::kDeviceHasNoConsent));
+ EXPECT_CALL(app_manager_, state_controller())
+ .WillRepeatedly(ReturnRef(mock_state_controller));
+ EXPECT_CALL(*mock_statistics_manager, Increment(_, _))
+ .WillRepeatedly(Return());
+ EXPECT_CALL(*application1, device()).WillRepeatedly(Return(device_handle));
+ EXPECT_CALL(*application1, is_audio()).WillRepeatedly(Return(false));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
+ EXPECT_CALL(
+ mock_session_observer,
+ GetDataOnDeviceID(
+ testing::Matcher<transport_manager::DeviceHandle>(device_handle),
+ _,
+ _,
+ _,
+ _));
+#endif // EXTERNAL_PROPRIETARY_MODE
+
EXPECT_CALL(*application1, policy_app_id()).WillOnce(Return(kPolicyAppId_));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
ON_CALL(*mock_policy_manager_, Increment(_, _)).WillByDefault(Return());
EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(_));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendSDLActivateAppResponse(_, _, _));
- ON_CALL(*application1, app_id()).WillByDefault(Return(kAppId_));
+ EXPECT_CALL(mock_message_helper_, SendSDLActivateAppResponse(_, _, _));
+ ON_CALL(*application1, app_id()).WillByDefault(Return(kAppId1_));
// Act
policy_handler_.OnActivateApp(connection_key, correlation_id);
}
@@ -627,9 +827,55 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key,
TEST_F(PolicyHandlerTest, OnActivateApp) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- const uint32_t connection_key = 1;
- const uint32_t correlation_id = 2;
- TestActivateApp(connection_key, correlation_id);
+ TestActivateApp(kConnectionKey_, kCorrelationKey_);
+}
+
+TEST_F(PolicyHandlerTest, OnActivateApp_InvalidApp_UNSUCCESS) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application(kConnectionKey_))
+ .WillOnce(Return(invalid_app));
+
+ EXPECT_CALL(mock_message_helper_, SendSDLActivateAppResponse(_, _, _))
+ .Times(0);
+ policy_handler_.OnActivateApp(kConnectionKey_, kCorrelationKey_);
+}
+
+TEST_F(PolicyHandlerTest, OnActivateApp_AppIsRevoked_AppNotActivated) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, ActivateApplication(_)).Times(0);
+ EXPECT_CALL(app_manager_, application(kConnectionKey_))
+ .WillOnce(Return(mock_app_));
+
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.appRevoked = true;
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ utils::SharedPtr<usage_statistics_test::MockStatisticsManager>
+ mock_statistics_manager =
+ utils::MakeShared<usage_statistics_test::MockStatisticsManager>();
+ UsageStatistics usage_stats(
+ "0",
+ utils::SharedPtr<usage_statistics::StatisticsManager>(
+ mock_statistics_manager));
+ EXPECT_CALL(*mock_app_, usage_report()).WillOnce(ReturnRef(usage_stats));
+ const std::string default_mac = "00:00:00:00:00:00";
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(default_mac))
+ .WillOnce(Return(DeviceConsent::kDeviceAllowed));
+#endif // EXTERNAL_PROPRIETARY_MODE
+
+ // Check expectations
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+ ON_CALL(*mock_policy_manager_, Increment(_, _)).WillByDefault(Return());
+ EXPECT_CALL(*mock_policy_manager_, RemovePendingPermissionChanges(_));
+ EXPECT_CALL(mock_message_helper_, SendSDLActivateAppResponse(_, _, _));
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_));
+ // Act
+ policy_handler_.OnActivateApp(kConnectionKey_, kCorrelationKey_);
}
TEST_F(PolicyHandlerTest, OnIgnitionCycleOver) {
@@ -651,7 +897,7 @@ void PolicyHandlerTest::OnPendingPermissionChangePrecondition(
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
- EXPECT_CALL(*application, app_id()).WillRepeatedly(Return(kAppId_));
+ EXPECT_CALL(*application, app_id()).WillRepeatedly(Return(kAppId1_));
EXPECT_CALL(*application, hmi_level()).WillRepeatedly(Return(hmi_level));
}
@@ -663,8 +909,8 @@ TEST_F(PolicyHandlerTest,
// Check expectations
AppPermissions permissions(kPolicyAppId_);
permissions.appPermissionsConsentNeeded = false;
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnAppPermissionsChangedNotification(kAppId_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0);
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
@@ -681,8 +927,8 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInLimitedConsentNeeded) {
AppPermissions permissions(kPolicyAppId_);
permissions.appPermissionsConsentNeeded = true;
// Check expectations
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
EXPECT_CALL(*mock_policy_manager_,
@@ -701,8 +947,8 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppLimitedAndRevoked) {
// Check expectations
EXPECT_CALL(app_manager_, state_controller())
.WillRepeatedly(ReturnRef(mock_state_controller));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(mock_state_controller,
SetRegularState(_,
mobile_apis::HMILevel::HMI_NONE,
@@ -725,8 +971,8 @@ TEST_F(PolicyHandlerTest, OnPendingPermissionChange_AppInBackgroundAndRevoked) {
permissions.isAppPermissionsRevoked = true;
// Check expectations
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
@@ -747,15 +993,15 @@ TEST_F(PolicyHandlerTest,
NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message =
utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
// Check expectations
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnAppPermissionsChangedNotification(kAppId_, _, _));
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ EXPECT_CALL(mock_message_helper_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_,
+ kAppId1_,
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
.WillOnce(Return(message));
EXPECT_CALL(app_manager_,
@@ -769,6 +1015,25 @@ TEST_F(PolicyHandlerTest,
}
TEST_F(PolicyHandlerTest,
+ OnPendingPermissionChange_AppInLIMITEDAndRequestTypeChanged_SUCCESS) {
+ OnPendingPermissionChangePrecondition(
+ mobile_apis::HMILevel::eType::HMI_LIMITED);
+ AppPermissions permissions(kPolicyAppId_);
+ permissions.requestTypeChanged = true;
+
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _));
+
+ EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
+ .WillOnce(Return(permissions));
+
+ EXPECT_CALL(*mock_policy_manager_,
+ RemovePendingPermissionChanges(kPolicyAppId_));
+
+ policy_handler_.OnPendingPermissionChange(kPolicyAppId_);
+}
+
+TEST_F(PolicyHandlerTest,
OnPendingPermissionChange_AppInBackgroundAndUnauthorized) {
// Arrange
OnPendingPermissionChangePrecondition(
@@ -780,15 +1045,15 @@ TEST_F(PolicyHandlerTest,
utils::MakeShared<NsSmartDeviceLink::NsSmartObjects::SmartObject>();
// Check expectations
// Notification won't be sent
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnAppPermissionsChangedNotification(kAppId_, _, _)).Times(0);
+ EXPECT_CALL(mock_message_helper_,
+ SendOnAppPermissionsChangedNotification(kAppId1_, _, _)).Times(0);
EXPECT_CALL(*mock_policy_manager_, GetAppPermissionsChanges(_))
.WillOnce(Return(permissions));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ EXPECT_CALL(mock_message_helper_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
- kAppId_,
+ kAppId1_,
mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED))
.WillOnce(Return(message));
EXPECT_CALL(app_manager_,
@@ -805,9 +1070,8 @@ TEST_F(PolicyHandlerTest, PTExchangeAtUserRequest) {
// Arrange
ChangePolicyManagerToMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, ForcePTExchange());
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendUpdateSDLResponse(_, _, _));
+ EXPECT_CALL(*mock_policy_manager_, ForcePTExchangeAtUserRequest());
+ EXPECT_CALL(mock_message_helper_, SendUpdateSDLResponse(_, _, _));
// Act
const uint32_t correlation_id = 2;
policy_handler_.PTExchangeAtUserRequest(correlation_id);
@@ -841,10 +1105,27 @@ TEST_F(PolicyHandlerTest, OnGetUserFriendlyMessage) {
std::vector<std::string> message_codes;
const std::string language("ru-ru");
const uint32_t correlation_id = 2;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ const hmi_apis::Common_Language::eType default_language =
+ hmi_apis::Common_Language::EN_US;
+ const std::string default_language_string = "EN_US";
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities;
+ EXPECT_CALL(app_manager_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities));
+ EXPECT_CALL(mock_message_helper_, CommonLanguageToString(default_language))
+ .WillOnce(Return(default_language_string));
+ EXPECT_CALL(mock_hmi_capabilities, active_ui_language())
+ .WillOnce(Return(default_language));
+ EXPECT_CALL(
+ *mock_policy_manager_,
+ GetUserFriendlyMessages(message_codes, language, default_language_string))
+ .WillOnce(Return(std::vector<UserFriendlyMessage>()));
+#else
EXPECT_CALL(*mock_policy_manager_,
GetUserFriendlyMessages(message_codes, language))
.WillOnce(Return(std::vector<UserFriendlyMessage>()));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+#endif // EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(mock_message_helper_,
SendGetUserFriendlyMessageResponse(_, _, _));
// Act
policy_handler_.OnGetUserFriendlyMessage(
@@ -857,17 +1138,17 @@ TEST_F(PolicyHandlerTest, OnGetStatusUpdate) {
const uint32_t correlation_id = 2;
// Check expectations
EXPECT_CALL(*mock_policy_manager_, GetPolicyTableStatus());
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ EXPECT_CALL(mock_message_helper_,
SendGetStatusUpdateResponse(_, correlation_id, _));
// Act
policy_handler_.OnGetStatusUpdate(correlation_id);
}
TEST_F(PolicyHandlerTest, OnUpdateStatusChanged) {
+ ChangePolicyManagerToMock();
// Check expectations
const std::string& status("new status");
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnStatusUpdate(status, _));
+ EXPECT_CALL(mock_message_helper_, SendOnStatusUpdate(status, _));
// Act
policy_handler_.OnUpdateStatusChanged(status);
}
@@ -887,7 +1168,15 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) {
EXPECT_CALL(conn_handler, get_session_observer())
.WillOnce(ReturnRef(session_observer));
- EXPECT_CALL(session_observer, GetDataOnDeviceID(0u, _, _, _, _));
+ const transport_manager::DeviceHandle handle = 0u;
+
+ EXPECT_CALL(session_observer,
+ GetDataOnDeviceID(
+ testing::Matcher<transport_manager::DeviceHandle>(handle),
+ _,
+ _,
+ _,
+ _));
// Act
policy_handler_.OnCurrentDeviceIdUpdateRequired(kPolicyAppId_);
@@ -930,8 +1219,7 @@ TEST_F(PolicyHandlerTest, OnSystemInfoUpdateRequired) {
// Arrange
ChangePolicyManagerToMock();
// Check expectations
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendGetSystemInfoRequest(_));
+ EXPECT_CALL(mock_message_helper_, SendGetSystemInfoRequest(_));
// Act
policy_handler_.OnSystemInfoUpdateRequired();
}
@@ -952,8 +1240,7 @@ TEST_F(PolicyHandlerTest, OnVIIsReady) {
ChangePolicyManagerToMock();
// Check expectations
EXPECT_CALL(app_manager_, GetNextHMICorrelationID());
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- CreateGetVehicleDataRequest(_, _, _));
+ EXPECT_CALL(mock_message_helper_, CreateGetVehicleDataRequest(_, _, _));
// Act
policy_handler_.OnVIIsReady();
}
@@ -1016,7 +1303,7 @@ TEST_F(PolicyHandlerTest, SendOnAppPermissionsChanged) {
// Check expectations
EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_))
.WillOnce(Return(application));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
+ EXPECT_CALL(mock_message_helper_,
SendOnAppPermissionsChangedNotification(_, _, _));
AppPermissions permissions(kPolicyAppId_);
// Act
@@ -1028,8 +1315,6 @@ TEST_F(PolicyHandlerTest, OnPTExchangeNeeded) {
EnablePolicyAndPolicyManagerMock();
// Check expectations
EXPECT_CALL(*mock_policy_manager_, ForcePTExchange());
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendOnStatusUpdate(_, _));
// Act
policy_handler_.OnPTExchangeNeeded();
}
@@ -1038,9 +1323,13 @@ TEST_F(PolicyHandlerTest, AddApplication) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, AddApplication(kPolicyAppId_));
+ EXPECT_CALL(
+ *mock_policy_manager_,
+ AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)))
+ .WillOnce(Return(utils::MakeShared<utils::CallNothing>()));
// Act
- policy_handler_.AddApplication(kPolicyAppId_);
+ policy_handler_.AddApplication(kPolicyAppId_,
+ HmiTypes(policy_table::AHT_DEFAULT));
}
TEST_F(PolicyHandlerTest, HeartBeatTimeout) {
@@ -1065,9 +1354,9 @@ TEST_F(PolicyHandlerTest, OnAppsSearchCompleted) {
// Arrange
EnablePolicyAndPolicyManagerMock();
// Check expectations
- EXPECT_CALL(*mock_policy_manager_, OnAppsSearchCompleted());
+ EXPECT_CALL(*mock_policy_manager_, OnAppsSearchCompleted(true));
// Act
- policy_handler_.OnAppsSearchCompleted();
+ policy_handler_.OnAppsSearchCompleted(true);
}
TEST_F(PolicyHandlerTest, OnAppRegisteredOnMobile) {
@@ -1172,37 +1461,144 @@ TEST_F(PolicyHandlerTest, OnGetListOfPermissions) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- const uint32_t kAppId_ = 10u;
- const uint32_t kCorId = 1u;
+ const uint32_t app_id = 10u;
+ const uint32_t corr_id = 1u;
const std::string default_mac = "00:00:00:00:00:00";
test_app.insert(mock_app_);
// Expectations
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForApp(default_mac, _, _));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendGetListOfPermissionsResponse(_, kCorId, _));
-
- EXPECT_CALL(app_manager_, application(kAppId_))
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(app_manager_, application(app_id))
.WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(std::string()));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _));
- policy_handler_.OnGetListOfPermissions(kAppId_, kCorId);
+ policy_handler_.OnGetListOfPermissions(app_id, corr_id);
}
TEST_F(PolicyHandlerTest, OnGetListOfPermissions_WithoutConnectionKey) {
// Arrange
EnablePolicyAndPolicyManagerMock();
- const uint32_t kAppId_ = 0u;
- const uint32_t kCorId = 1u;
+ const uint32_t app_id = 0u;
+ const uint32_t corr_id = 1u;
+ const std::string default_mac = "00:00:00:00:00:00";
+ test_app.insert(mock_app_);
+
+ // Expectations
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForApp(default_mac, _, _));
+
+ EXPECT_CALL(app_manager_, application(app_id))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(std::string()));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _));
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status =
+ policy::ExternalConsentStatus();
+ EXPECT_CALL(
+ mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, external_consent_status, corr_id, _));
+ EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
+ .WillOnce(Return(external_consent_status));
+#else
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, corr_id, _));
+#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
+
+ policy_handler_.OnGetListOfPermissions(app_id, corr_id);
+}
+
+ACTION_P(SetGroupPermissions, permissions) {
+ arg2 = permissions;
+}
+
+TEST_F(PolicyHandlerTest, OnGetListOfPermissions_GroupPermissions_SUCCESS) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ policy::FunctionalGroupPermission group_permission_disallowed1;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupDisallowed,
+ kGroupAliasDisallowed_,
+ kGroupNameDisallowed_,
+ group_permission_disallowed1);
+
+ policy::FunctionalGroupPermission group_permission_disallowed2;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupDisallowed,
+ kGroupAliasDisallowed_,
+ kGroupNameDisallowed_,
+ group_permission_disallowed2);
+
+ policy::FunctionalGroupPermission group_permission_allowed1;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed1);
+
+ policy::FunctionalGroupPermission group_permission_allowed2;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed2);
+
+ std::vector<policy::FunctionalGroupPermission> group_permissions;
+ group_permissions.push_back(group_permission_allowed1);
+ group_permissions.push_back(group_permission_allowed2);
+ group_permissions.push_back(group_permission_disallowed1);
+ group_permissions.push_back(group_permission_disallowed2);
+
+ const uint32_t app_id = 0u;
+ const uint32_t corr_id = 1u;
+ const std::string default_mac = "00:00:00:00:00:00";
test_app.insert(mock_app_);
// Expectations
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForApp(_, _, _))
+ .WillOnce(SetGroupPermissions(group_permissions));
+
+ EXPECT_CALL(app_manager_, application(app_id))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendGetListOfPermissionsResponse(_, kCorId, _));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(std::string()));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _));
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ policy::ExternalConsentStatus external_consent_status =
+ policy::ExternalConsentStatus();
+ EXPECT_CALL(
+ mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, external_consent_status, corr_id, _));
+ EXPECT_CALL(*mock_policy_manager_, GetExternalConsentStatus())
+ .WillOnce(Return(external_consent_status));
+#else
+ EXPECT_CALL(mock_message_helper_,
+ SendGetListOfPermissionsResponse(_, corr_id, _));
+#endif // #ifdef EXTERNAL_PROPRIETARY_MODE
- policy_handler_.OnGetListOfPermissions(kAppId_, kCorId);
+ policy_handler_.OnGetListOfPermissions(app_id, corr_id);
}
TEST_F(PolicyHandlerTest, RetrieveCertificate) {
@@ -1218,87 +1614,132 @@ TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlNotAdded) {
EnablePolicyAndPolicyManagerMock();
BinaryMessage msg;
EndpointUrls test_data;
-#ifdef EXTENDED_POLICY
+#if defined(PROPRIETARY_MODE) || defined(EXTERNAL_PROPRIETARY_MODE)
ExtendedPolicyExpectations();
-#else
- EXPECT_CALL(*mock_policy_manager_, GetServiceUrls(_, _))
+#endif // PROPRIETARY_MODE || EXTERNAL_PROPRIETARY_MODE
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ std::vector<int> retry_delay_seconds;
+ const uint32_t timeout_exchange = 10u;
+ // TODO(AKutsan): Policy move issues
+ EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls("0x07", _))
.WillRepeatedly(SetArgReferee<1>(test_data));
-#endif // EXTENDED_POLICY
-
+ policy_handler_.OnSnapshotCreated(msg, retry_delay_seconds, timeout_exchange);
+#else // EXTERNAL_PROPRIETARY_MODE
policy_handler_.OnSnapshotCreated(msg);
+#endif // EXTERNAL_PROPRIETARY_MODE
}
+TEST_F(PolicyHandlerTest,
+ OnAllowSDLFunctionalityNotification_AllowedWithDevId_AppActivated) {
+ // Arrange
+
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t connection_key = 1u;
+ const uint32_t correlation_id = 2u;
+ TestActivateApp(connection_key, correlation_id);
+
+ const bool is_allowed = true;
+ std::vector<std::string> device_macs;
+ device_macs.push_back(kPolicyAppId_);
+
+ // Not called because id was setted
+ EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_)).Times(0);
+ EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
+ .WillRepeatedly(Return(true));
+
+ policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed,
+ kPolicyAppId_);
+}
+#ifdef EXTERNAL_PROPRIETARY_MODE
TEST_F(PolicyHandlerTest, OnSnapshotCreated_UrlAdded) {
EnablePolicyAndPolicyManagerMock();
BinaryMessage msg;
EndpointUrls test_data;
EndpointData data("some_data");
+ std::vector<int> retry_delay_seconds;
+ const uint32_t timeout_exchange = 10u;
test_data.push_back(data);
-#ifdef EXTENDED_POLICY
+ ExtendedPolicyExpectations();
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillRepeatedly(Return(mock_app_));
+
+ policy_handler_.OnSnapshotCreated(msg, retry_delay_seconds, timeout_exchange);
+}
+#else // EXTERNAL_PROPRIETARY_MODE
+// TODO(LevchenkoS): Find out what is wrong with this test on HTTP Policy
+TEST_F(PolicyHandlerTest, DISABLED_OnSnapshotCreated_UrlAdded) {
+ EnablePolicyAndPolicyManagerMock();
+ BinaryMessage msg;
+ EndpointUrls test_data;
+ EndpointData data(kDummyData);
+ test_data.push_back(data);
+ ApplicationSharedPtr mock_app;
+
+#ifdef PROPRIETARY_MODE
ExtendedPolicyExpectations();
#else
- EXPECT_CALL(*mock_policy_manager_, GetServiceUrls(_, _))
+ AppIdURL next_app_url = std::make_pair(0, 0);
+ EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls("0x07", _))
.WillRepeatedly(SetArgReferee<1>(test_data));
+ EXPECT_CALL(*mock_policy_manager_, GetNextUpdateUrl(_))
+ .WillOnce(Return(next_app_url));
+ EXPECT_CALL(app_manager_, application_by_policy_id(_))
+ .WillOnce(Return(mock_app));
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
EXPECT_CALL(conn_handler, get_session_observer())
.WillOnce(ReturnRef(mock_session_observer));
EXPECT_CALL(*mock_app_, device()).WillOnce(Return(0));
EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendPolicySnapshotNotification(_, _, _, _));
+ EXPECT_CALL(mock_message_helper_, SendPolicySnapshotNotification(_, _, _, _));
// Check expectations for get app id
GetAppIDForSending();
// Expectations
- EXPECT_CALL(app_manager_, application(kAppId_))
+ EXPECT_CALL(app_manager_, application(kAppId1_))
.WillRepeatedly(Return(mock_app_));
EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
-#endif // EXTENDED_POLICY
+#endif // PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_, OnUpdateStarted());
policy_handler_.OnSnapshotCreated(msg);
}
+#endif // EXTERNAL_PROPRIETARY_MODE
TEST_F(PolicyHandlerTest,
- OnAllowSDLFunctionalityNotification_AllowedWithDevId_AppActivated) {
+ OnAllowSDLFunctionalityNotification_Allowed_WithoutDevId_AppActivated) {
// Arrange
-
- EnablePolicyAndPolicyManagerMock();
- const uint32_t connection_key = 1;
- const uint32_t correlation_id = 2;
- TestActivateApp(connection_key, correlation_id);
-
const bool is_allowed = true;
std::vector<std::string> device_macs;
device_macs.push_back(kPolicyAppId_);
+ EnablePolicyAndPolicyManagerMock();
+ TestActivateApp(kConnectionKey_, kCorrelationKey_);
- // Not called because id was setted
- EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_)).Times(0);
- EXPECT_CALL(conn_handler, GetDeviceID(kPolicyAppId_, _))
- .WillRepeatedly(Return(true));
+ // Device ID is not setted by us
+ EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_))
+ .WillOnce(SetArgReferee<0>(device_macs));
- policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed,
- kPolicyAppId_);
+ EXPECT_CALL(*mock_policy_manager_,
+ SetUserConsentForDevice(kPolicyAppId_, is_allowed));
+
+ policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed, "");
}
TEST_F(PolicyHandlerTest,
- OnAllowSDLFunctionalityNotification_Allowed_WithoutDevId_AppActivated) {
- // Arrange
- const bool is_allowed = true;
+ OnAllowSDLFunctionalityNotification_DefaultDeviceId_UNSUCCESS) {
+ const std::string default_mac_address("00:00:00:00:00:00");
std::vector<std::string> device_macs;
- device_macs.push_back(kPolicyAppId_);
+ device_macs.push_back(default_mac_address);
EnablePolicyAndPolicyManagerMock();
- const uint32_t connection_key = 1;
- const uint32_t correlation_id = 2;
- TestActivateApp(connection_key, correlation_id);
+ TestActivateApp(kConnectionKey_, kCorrelationKey_);
- // Device ID is not setted by us
EXPECT_CALL(conn_handler, GetConnectedDevicesMAC(_))
.WillOnce(SetArgReferee<0>(device_macs));
- EXPECT_CALL(*mock_policy_manager_,
- SetUserConsentForDevice(kPolicyAppId_, is_allowed));
+ EXPECT_CALL(*mock_policy_manager_, SetUserConsentForDevice(_, _)).Times(0);
+ const bool is_allowed = true;
policy_handler_.OnAllowSDLFunctionalityNotification(is_allowed, "");
}
@@ -1385,14 +1826,32 @@ TEST_F(PolicyHandlerTest, OnDeviceConsentChanged_PredatePolicyNotAllowed) {
policy_handler_.OnDeviceConsentChanged(kPolicyAppId_, is_allowed);
}
+#ifdef EXTERNAL_PROPRIETARY_MODE
+TEST_F(PolicyHandlerTest, OnCertificateUpdated) {
+ const std::string app_storage = "storage";
+ file_system::CreateFile("storage/certificate");
+ EXPECT_CALL(policy_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(app_storage));
+ const std::string cert_data = "data";
+
+ const std::string full_file_name =
+ file_system::GetAbsolutePath(app_storage) + "/certificate";
+ EXPECT_CALL(mock_message_helper_,
+ SendDecryptCertificateToHMI(full_file_name, _));
+ policy_handler_.OnCertificateUpdated(cert_data);
+}
+#else
TEST_F(PolicyHandlerTest, OnCertificateUpdated) {
application_manager_test::MockPolicyHandlerObserver policy_handler_observer;
policy_handler_.add_listener(&policy_handler_observer);
- std::string cert_data = "data";
+ const std::string cert_data = "data";
+ EnablePolicy();
+
EXPECT_CALL(policy_handler_observer, OnCertificateUpdated(cert_data));
policy_handler_.OnCertificateUpdated(cert_data);
}
+#endif
TEST_F(PolicyHandlerTest, GetAppIdForSending_WithoutApps) {
// Arrange
@@ -1413,7 +1872,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_GetDefaultMacAddress) {
// Check expectations
test_app.insert(mock_app_);
EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
EXPECT_CALL(app_manager_, connection_handler())
.WillOnce(ReturnRef(conn_handler));
@@ -1425,7 +1886,7 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_GetDefaultMacAddress) {
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
.WillRepeatedly(Return(kDeviceAllowed));
// Act
- EXPECT_EQ(kAppId_, policy_handler_.GetAppIdForSending());
+ EXPECT_EQ(kAppId1_, policy_handler_.GetAppIdForSending());
}
void PolicyHandlerTest::GetAppIDForSending() {
@@ -1433,9 +1894,13 @@ void PolicyHandlerTest::GetAppIDForSending() {
test_app.insert(mock_app_);
// Check expectations
- EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
- EXPECT_CALL(mock_session_observer, GetDataOnDeviceID(_, _, _, _, _))
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
.WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
@@ -1446,33 +1911,596 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_SetMacAddress) {
// Arrange
GetAppIDForSending();
// Act
- EXPECT_EQ(kAppId_, policy_handler_.GetAppIdForSending());
+ EXPECT_EQ(kAppId1_, policy_handler_.GetAppIdForSending());
+}
+
+TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_full =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ const uint32_t app_in_full_id = 1;
+ EXPECT_CALL(*mock_app_in_full, app_id())
+ .WillRepeatedly(Return(app_in_full_id));
+ EXPECT_CALL(*mock_app_in_full, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
+ ON_CALL(*mock_app_in_full, IsRegistered()).WillByDefault(Return(true));
+
+ test_app.insert(mock_app_in_full);
+
+ utils::SharedPtr<application_manager_test::MockApplication>
+ mock_app_in_limited =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ const uint32_t app_in_limited_id = 2;
+ EXPECT_CALL(*mock_app_in_limited, app_id())
+ .WillRepeatedly(Return(app_in_limited_id));
+ EXPECT_CALL(*mock_app_in_limited, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_LIMITED));
+ ON_CALL(*mock_app_in_limited, IsRegistered()).WillByDefault(Return(true));
+
+ test_app.insert(mock_app_in_limited);
+
+ utils::SharedPtr<application_manager_test::MockApplication>
+ mock_app_in_background =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ const uint32_t app_in_background_id = 3;
+ EXPECT_CALL(*mock_app_in_background, app_id())
+ .WillRepeatedly(Return(app_in_background_id));
+ EXPECT_CALL(*mock_app_in_background, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_BACKGROUND));
+ ON_CALL(*mock_app_in_background, IsRegistered()).WillByDefault(Return(true));
+
+ test_app.insert(mock_app_in_background);
+
+ utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_none =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ const uint32_t app_in_none_id = 4;
+ EXPECT_CALL(*mock_app_in_none, app_id())
+ .WillRepeatedly(Return(app_in_none_id));
+ EXPECT_CALL(*mock_app_in_none, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app_in_none, IsRegistered()).Times(0);
+
+ test_app.insert(mock_app_in_none);
+
+ // Check expectations
+
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
+ .WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
+ .WillRepeatedly(Return(kDeviceAllowed));
+
+ // Act
+ EXPECT_NE(app_in_none_id, policy_handler_.GetAppIdForSending());
}
-TEST_F(PolicyHandlerTest, SendMessageToSDK) {
- // Precondition
+TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) {
+ // Arrange
+ EnablePolicyAndPolicyManagerMock();
+
+ utils::SharedPtr<application_manager_test::MockApplication>
+ mock_app_in_none_1 =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ const uint32_t app_in_none_id_1 = 1;
+ EXPECT_CALL(*mock_app_in_none_1, app_id())
+ .WillRepeatedly(Return(app_in_none_id_1));
+ EXPECT_CALL(*mock_app_in_none_1, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_FULL));
+ ON_CALL(*mock_app_in_none_1, IsRegistered()).WillByDefault(Return(true));
+
+ test_app.insert(mock_app_in_none_1);
+
+ utils::SharedPtr<application_manager_test::MockApplication>
+ mock_app_in_none_2 =
+ utils::MakeShared<application_manager_test::MockApplication>();
+ const uint32_t app_in_none_id_2 = 2;
+ EXPECT_CALL(*mock_app_in_none_2, app_id())
+ .WillRepeatedly(Return(app_in_none_id_2));
+ EXPECT_CALL(*mock_app_in_none_2, hmi_level())
+ .WillRepeatedly(Return(mobile_api::HMILevel::HMI_NONE));
+ ON_CALL(*mock_app_in_none_2, IsRegistered()).WillByDefault(Return(true));
+
+ test_app.insert(mock_app_in_none_2);
+
+ // Check expectations
+
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
+ .WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
+ .WillRepeatedly(Return(kDeviceAllowed));
+
+ // Act
+
+ const uint32_t app_id = policy_handler_.GetAppIdForSending();
+
+ EXPECT_EQ(app_in_none_id_1 || app_in_none_id_2, app_id);
+}
+
+TEST_F(PolicyHandlerTest,
+ SendMessageToSDK_SuitableAppPresent_ExpectedNotificationSending) {
BinaryMessage msg;
const std::string url = "test_url";
EnablePolicyAndPolicyManagerMock();
test_app.insert(mock_app_);
- // Check expectations for get app id
- GetAppIDForSending();
- // Expectations
- EXPECT_CALL(app_manager_, application(kAppId_))
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
.WillRepeatedly(Return(mock_app_));
- EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true));
+
+ const connection_handler::DeviceHandle test_device_id = 1u;
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(test_device_id));
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceAllowed));
- EXPECT_CALL(*MockMessageHelper::message_helper_mock(),
- SendPolicySnapshotNotification(kAppId_, msg, url, _));
// Act
+ EXPECT_CALL(mock_message_helper_,
+ SendPolicySnapshotNotification(kAppId1_, msg, url, _));
EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, url));
}
+TEST_F(PolicyHandlerTest,
+ SendMessageToSDK_NoSuitableApp_ExpectedNotificationNotSent) {
+ BinaryMessage msg;
+ const std::string url = "test_url";
+ EnablePolicyAndPolicyManagerMock();
+ test_app.insert(mock_app_);
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillRepeatedly(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillRepeatedly(Return(true));
+
+ const connection_handler::DeviceHandle test_device_id = 1u;
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(test_device_id));
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceDisallowed));
+
+ // Expected to get 0 as application id so SDL does not have valid application
+ // with such id
+ EXPECT_CALL(app_manager_, application(0))
+ .WillOnce(Return(
+ utils::SharedPtr<application_manager_test::MockApplication>()));
+
+ EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url));
+}
+
TEST_F(PolicyHandlerTest, CanUpdate) {
GetAppIDForSending();
EXPECT_TRUE(policy_handler_.CanUpdate());
}
+TEST_F(PolicyHandlerTest, CanUpdate_TwoApplicationForSending_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ utils::SharedPtr<application_manager_test::MockApplication> second_mock_app =
+ utils::MakeShared<application_manager_test::MockApplication>();
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*second_mock_app, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(*second_mock_app, app_id()).WillRepeatedly(Return(kAppId2_));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ // Check expectations
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+ test_app.insert(mock_app_);
+ test_app.insert(second_mock_app);
+
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, _, _, _))
+ .WillOnce(DoAll(SetArgPointee<3>(kMacAddr_), Return(0)));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(kMacAddr_))
+ .WillRepeatedly(Return(kDeviceAllowed));
+
+ EXPECT_TRUE(policy_handler_.CanUpdate());
+}
+
+ACTION_P(NotifyAsync, waiter) {
+ waiter->Notify();
+}
+
+TEST_F(PolicyHandlerTest,
+ DISABLED_OnAppPermissionConsentInternal_ValidConnectionKey_SUCCESS) {
+ ChangePolicyManagerToMock();
+ const uint32_t device = 2u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillOnce(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillOnce(ReturnRef(mock_session_observer));
+ EXPECT_CALL(mock_session_observer,
+ GetDataOnDeviceID(
+ testing::Matcher<transport_manager::DeviceHandle>(device),
+ _,
+ NULL,
+ _,
+ _)).WillOnce(Return(1u));
+
+ EXPECT_CALL(app_manager_, application(kConnectionKey_))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+ EXPECT_CALL(*mock_app_, device()).WillOnce(Return(device));
+
+ sync_primitives::Lock wait_hmi_lock_first;
+ sync_primitives::AutoLock auto_lock_first(wait_hmi_lock_first);
+ WaitAsync waiter_first(kCallsCount_, kTimeout_);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_, SetUserConsentForApp(_, _))
+ .WillOnce(NotifyAsync(&waiter_first));
+#else
+ EXPECT_CALL(*mock_policy_manager_, SetUserConsentForApp(_))
+ .WillOnce(NotifyAsync(&waiter_first));
+#endif
+ ExternalConsentStatusItem item(1u, 1u, kStatusOn);
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ sync_primitives::Lock wait_hmi_lock_second;
+ sync_primitives::AutoLock auto_lock_second(wait_hmi_lock_second);
+ WaitAsync waiter_second(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ kConnectionKey_, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(kConnectionKey_, permissions);
+
+#endif
+ EXPECT_TRUE(waiter_first.Wait(auto_lock_first));
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_TRUE(waiter_second.Wait(auto_lock_second));
+#endif
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_NoAppsPreviouslyStored_UNUSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t invalid_connection_key = 0u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(app_manager_, application(_)).Times(0);
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ EXPECT_FALSE(waiter.Wait(auto_lock));
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_NoAppsPreviouslyStored_FAILED) {
+ EnablePolicyAndPolicyManagerMock();
+ const uint32_t invalid_connection_key = 0u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(app_manager_, application(_)).Times(0);
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ ON_CALL(*mock_policy_manager_, IsNeedToUpdateExternalConsentStatus(_))
+ .WillByDefault(Return(false));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ EXPECT_FALSE(waiter.Wait(auto_lock));
+}
+
+ACTION_P(SetDeviceParamsMacAdress, mac_adress) {
+ *arg3 = mac_adress;
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_ExistAppsPreviouslyStored_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ test_app.insert(mock_app_);
+
+ const uint32_t invalid_connection_key = 0u;
+ const uint32_t device = 2u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(1u));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+
+ EXPECT_CALL(
+ mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, NULL, _, _))
+ .WillRepeatedly(DoAll(SetDeviceParamsMacAdress(kMacAddr_), (Return(1u))));
+
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillRepeatedly(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillRepeatedly(ReturnRef(mock_session_observer));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(device));
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(DoAll(NotifyAsync(&waiter), Return(true)));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ Mock::VerifyAndClearExpectations(mock_app_.get());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_TRUE(waiter.Wait(auto_lock));
+#endif
+}
+
+TEST_F(PolicyHandlerTest,
+ OnAppPermissionConsentInternal_ExistAppsPreviouslyStored_FAIL) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ test_app.insert(mock_app_);
+
+ const uint32_t invalid_connection_key = 0u;
+ const uint32_t device = 2u;
+
+ PermissionConsent permissions;
+ permissions.device_id = kDeviceId_;
+ permissions.consent_source = "consent_source";
+
+ policy::FunctionalGroupPermission group_permission_allowed;
+ CreateFunctionalGroupPermission(GroupConsent::kGroupAllowed,
+ kGroupAliasAllowed_,
+ kGroupNameAllowed_,
+ group_permission_allowed);
+
+ permissions.group_permissions.push_back(group_permission_allowed);
+ EXPECT_CALL(app_manager_, applications()).WillRepeatedly(Return(app_set));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(1u));
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillRepeatedly(Return(kPolicyAppId_));
+
+ EXPECT_CALL(
+ mock_session_observer,
+ GetDataOnDeviceID(
+ testing::An<transport_manager::DeviceHandle>(), _, NULL, _, _))
+ .WillRepeatedly(DoAll(SetDeviceParamsMacAdress(kMacAddr_), (Return(1u))));
+
+ EXPECT_CALL(app_manager_, connection_handler())
+ .WillRepeatedly(ReturnRef(conn_handler));
+ EXPECT_CALL(conn_handler, get_session_observer())
+ .WillRepeatedly(ReturnRef(mock_session_observer));
+
+ EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(device));
+
+ ExternalConsentStatusItem item = {1u, 1u, kStatusOn};
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ ON_CALL(*mock_policy_manager_, IsNeedToUpdateExternalConsentStatus(_))
+ .WillByDefault(Return(false));
+ EXPECT_CALL(*mock_policy_manager_,
+ SetExternalConsentStatus(external_consent_status))
+ .WillOnce(Return(true));
+ policy_handler_.OnAppPermissionConsent(
+ invalid_connection_key, permissions, external_consent_status);
+#else
+ policy_handler_.OnAppPermissionConsent(invalid_connection_key, permissions);
+#endif
+
+ Mock::VerifyAndClearExpectations(mock_app_.get());
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ EXPECT_FALSE(waiter.Wait(auto_lock));
+#endif
+}
+
+TEST_F(PolicyHandlerTest, GetLockScreenIconUrl_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(*mock_policy_manager_, GetLockScreenIconUrl());
+
+ policy_handler_.GetLockScreenIconUrl();
+}
+
+TEST_F(PolicyHandlerTest, RemoveListener_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ application_manager_test::MockPolicyHandlerObserver policy_handler_observer;
+ policy_handler_.add_listener(&policy_handler_observer);
+ std::map<std::string, StringArray> app_hmi_types;
+ StringArray arr;
+ arr.push_back("test_hmi_type");
+ app_hmi_types["app1"] = arr;
+
+ EXPECT_CALL(policy_handler_observer, OnUpdateHMIAppType(_));
+ policy_handler_.OnUpdateHMIAppType(app_hmi_types);
+
+ policy_handler_.remove_listener(&policy_handler_observer);
+
+ EXPECT_CALL(policy_handler_observer, OnUpdateHMIAppType(_)).Times(0);
+ policy_handler_.OnUpdateHMIAppType(app_hmi_types);
+}
+
+TEST_F(PolicyHandlerTest, AddStatisticsInfo_UnknownStatistics_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ policy_handler_.AddStatisticsInfo(
+ hmi_apis::Common_StatisticsType::INVALID_ENUM);
+}
+
+TEST_F(PolicyHandlerTest, AddStatisticsInfo_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+
+ EXPECT_CALL(*mock_policy_manager_, Increment(_))
+ .WillOnce(NotifyAsync(&waiter));
+
+ policy_handler_.AddStatisticsInfo(
+ hmi_apis::Common_StatisticsType::iAPP_BUFFER_FULL);
+ EXPECT_TRUE(waiter.Wait(auto_lock));
+}
+
+TEST_F(PolicyHandlerTest, OnSystemError_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ sync_primitives::Lock wait_hmi_lock;
+ sync_primitives::AutoLock auto_lock(wait_hmi_lock);
+ WaitAsync waiter(kCallsCount_, kTimeout_);
+ EXPECT_CALL(*mock_policy_manager_, Increment(_))
+ .WillOnce(NotifyAsync(&waiter));
+
+ policy_handler_.OnSystemError(hmi_apis::Common_SystemError::SYNC_REBOOTED);
+ EXPECT_TRUE(waiter.Wait(auto_lock));
+
+ WaitAsync waiter1(kCallsCount_, kTimeout_);
+ EXPECT_CALL(*mock_policy_manager_, Increment(_))
+ .WillOnce(NotifyAsync(&waiter1));
+
+ policy_handler_.OnSystemError(
+ hmi_apis::Common_SystemError::SYNC_OUT_OF_MEMMORY);
+ EXPECT_TRUE(waiter1.Wait(auto_lock));
+}
+
+ACTION_P(SetEndpoint, endpoint) {
+ arg1 = endpoint;
+}
+
+TEST_F(PolicyHandlerTest, RemoteAppsUrl_EndpointsEmpty_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ const std::string service_type("queryAppsUrl");
+ EndpointUrls endpoints;
+
+ EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls(service_type, _))
+ .WillOnce(SetEndpoint(endpoints));
+
+ const std::string default_url("");
+ EXPECT_EQ(default_url, policy_handler_.RemoteAppsUrl());
+}
+
+TEST_F(PolicyHandlerTest, RemoteAppsUrl_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ const std::string url("url");
+ EndpointData endpoint_data;
+ endpoint_data.url.push_back(url);
+
+ EndpointUrls endpoints;
+ endpoints.push_back(endpoint_data);
+
+ const std::string service_type("queryAppsUrl");
+ EXPECT_CALL(*mock_policy_manager_, GetUpdateUrls(service_type, _))
+ .WillOnce(SetEndpoint(endpoints));
+
+ EXPECT_EQ(url, policy_handler_.RemoteAppsUrl());
+}
+
} // namespace policy_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc
new file mode 100644
index 0000000000..7faf3e36cb
--- /dev/null
+++ b/src/components/application_manager/test/rc_policy_handler_test.cc
@@ -0,0 +1,400 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <vector>
+#include <fstream>
+#include "gmock/gmock.h"
+
+#include "application_manager/policies/policy_handler.h"
+#include "application_manager/policies/delegates/app_permission_delegate.h"
+#include "policy/mock_cache_manager.h"
+#include "application_manager/mock_message_helper.h"
+#include "connection_handler/mock_connection_handler_settings.h"
+#include "policy/policy_types.h"
+#include "policy/access_remote.h"
+#include "json/reader.h"
+#include "json/writer.h"
+#include "json/value.h"
+#include "smart_objects/smart_object.h"
+#include "utils/make_shared.h"
+#include "utils/custom_string.h"
+#include "interfaces/MOBILE_API.h"
+#include "policy/mock_policy_settings.h"
+#include "application_manager/mock_application.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "protocol_handler/mock_session_observer.h"
+#include "connection_handler/mock_connection_handler.h"
+#include "application_manager/mock_application_manager.h"
+#include "application_manager/policies/mock_policy_handler_observer.h"
+#include "application_manager/mock_event_dispatcher.h"
+#include "policy/mock_policy_manager.h"
+
+namespace test {
+namespace components {
+namespace rc_policy_handler_test {
+
+using namespace application_manager;
+using namespace policy;
+using namespace utils::custom_string;
+using testing::_;
+using ::testing::Mock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+using ::testing::DoAll;
+using ::testing::SetArgPointee;
+
+class RCPolicyHandlerTest : public ::testing::Test {
+ public:
+ RCPolicyHandlerTest()
+ : policy_handler_(policy_settings_, app_manager_)
+ , kPolicyAppId_("fake_app_id")
+ , kMacAddr_("kMacAddr_ess")
+ , kDeviceId_("fake_device_id")
+ , kHmiLevel_("NONE")
+ , default_hmi_("fake_hmi")
+ , app_set(test_app, app_lock)
+ , kAppId1_(10u)
+ , kAppId2_(11u)
+ , kConnectionKey_(1u)
+ , kCorrelationKey_(2u)
+ , kUrl_("test_url")
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock()) {}
+
+ protected:
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ utils::SharedPtr<application_manager_test::MockApplication> mock_app_;
+ connection_handler_test::MockConnectionHandler conn_handler;
+ protocol_handler_test::MockSessionObserver mock_session_observer;
+ components::usage_statistics_test::MockStatisticsManager
+ mock_statistics_manager_;
+ PolicyHandler policy_handler_;
+ utils::SharedPtr<policy_manager_test::MockPolicyManager> mock_policy_manager_;
+ application_manager_test::MockApplicationManager app_manager_;
+ const std::string kPolicyAppId_;
+ const std::string kMacAddr_;
+ const std::string kDeviceId_;
+ const std::string kHmiLevel_;
+ std::string default_hmi_;
+ ApplicationSet test_app;
+ sync_primitives::Lock app_lock;
+ DataAccessor<ApplicationSet> app_set;
+ const uint32_t kAppId1_;
+ const uint32_t kAppId2_;
+ const uint32_t kConnectionKey_;
+ const uint32_t kCorrelationKey_;
+ const std::string kUrl_;
+ application_manager::MockMessageHelper& mock_message_helper_;
+
+ virtual void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set));
+ ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
+ mock_policy_manager_ =
+ utils::MakeShared<policy_manager_test::MockPolicyManager>();
+ ASSERT_TRUE(mock_policy_manager_.valid());
+
+ ON_CALL(app_manager_, connection_handler())
+ .WillByDefault(ReturnRef(conn_handler));
+ ON_CALL(conn_handler, get_session_observer())
+ .WillByDefault(ReturnRef(mock_session_observer));
+
+ mock_app_ = utils::MakeShared<application_manager_test::MockApplication>();
+ }
+
+ virtual void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ }
+
+ void ChangePolicyManagerToMock() {
+ policy_handler_.SetPolicyManager(mock_policy_manager_);
+ }
+
+ void EnablePolicy() {
+ ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true));
+ }
+
+ void EnablePolicyAndPolicyManagerMock() {
+ EnablePolicy();
+ ChangePolicyManagerToMock();
+ }
+};
+
+TEST_F(RCPolicyHandlerTest,
+ SendMessageToSDK_RemoteControlInvalidMobileAppId_UNSUCCESS) {
+ // Precondition
+ BinaryMessage msg;
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set));
+ test_app.insert(mock_app_);
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillRepeatedly(Return(mock_app_));
+ const std::string empty_mobile_app_id("");
+ EXPECT_CALL(*mock_app_, policy_app_id())
+ .WillOnce(Return(empty_mobile_app_id));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceAllowed));
+
+ EXPECT_CALL(mock_message_helper_, SendPolicySnapshotNotification(_, _, _, _))
+ .Times(0);
+ EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, kUrl_));
+}
+
+TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControl_SUCCESS) {
+ BinaryMessage msg;
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set));
+ test_app.insert(mock_app_);
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_));
+ ON_CALL(*mock_app_, hmi_level())
+ .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true));
+
+ EXPECT_CALL(app_manager_, application(kAppId1_))
+ .WillRepeatedly(Return(mock_app_));
+
+ EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_));
+
+ EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_))
+ .WillOnce(Return(kDeviceAllowed));
+
+ EXPECT_CALL(mock_message_helper_,
+ SendPolicySnapshotNotification(kAppId1_, _, kUrl_, _));
+ EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, kUrl_));
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidApp_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(invalid_app));
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(_)).Times(0);
+
+ const std::string hmi_level("HMI_FULL");
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidHmiLevel_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("INVALID_ENUM");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM));
+
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_HmiLevelFull_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_FULL");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_));
+ EXPECT_CALL(mock_message_helper_, SendActivateAppToHMI(kAppId1_, _, _, _));
+
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_HmiLevelChanged_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_LIMITED");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(*mock_app_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ EXPECT_CALL(app_manager_,
+ ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_LIMITED));
+
+ EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _));
+
+ policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, CheckModule_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+
+ const PTString module("module");
+ EXPECT_CALL(*mock_policy_manager_, CheckModule(kPolicyAppId_, module))
+ .WillOnce(Return(true));
+
+ EXPECT_TRUE(policy_handler_.CheckModule(kPolicyAppId_, module));
+}
+
+ACTION_P(SetDeviceHandle, handle) {
+ *arg1 = handle;
+}
+
+TEST_F(RCPolicyHandlerTest,
+ OnRemoteAppPermissionsChanged_DifferentDeviceHandle_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(*mock_policy_manager_,
+ SendAppPermissionsChanged(kDeviceId_, kPolicyAppId_));
+
+ policy_handler_.OnRemoteAppPermissionsChanged(kDeviceId_, kPolicyAppId_);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_InvalidApp_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ utils::SharedPtr<application_manager_test::MockApplication> invalid_app;
+ EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app));
+ EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
+
+ const std::string hmi_level("HMI_NONE");
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_HmiLevelInvalidEnum_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("INVALID_ENUM");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM));
+
+ EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
+
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_ValidAppAndHmiLevel_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_NONE");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+
+ EXPECT_CALL(app_manager_,
+ ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _));
+
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest,
+ OnUpdateHMIStatusFourParams_HmiLevelInvalidEnum_UNSUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("INVALID_ENUM");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM));
+
+ EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0);
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_ValidParams_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_))
+ .WillOnce(Return(mock_app_));
+
+ const std::string hmi_level("HMI_NONE");
+ EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level))
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE));
+
+ EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_));
+ EXPECT_CALL(app_manager_,
+ ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_NONE));
+ EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _));
+
+ policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level);
+}
+
+TEST_F(RCPolicyHandlerTest, GetModuleTypes_GetModuleTypes_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ std::vector<std::string> modules;
+
+ EXPECT_CALL(*mock_policy_manager_, GetModuleTypes(kPolicyAppId_, &modules))
+ .WillOnce(Return(true));
+
+ EXPECT_TRUE(policy_handler_.GetModuleTypes(kPolicyAppId_, &modules));
+}
+
+TEST_F(RCPolicyHandlerTest, CheckHMIType_ValidTypes_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ mobile_apis::AppHMIType::eType hmi = mobile_apis::AppHMIType::MEDIA;
+
+ const smart_objects::SmartObjectSPtr app_types =
+ utils::MakeShared<smart_objects::SmartObject>(
+ smart_objects::SmartType_Array);
+ (*app_types)[strings::app_hmi_type][0] = mobile_apis::AppHMIType::MEDIA;
+ (*app_types)[strings::app_hmi_type][1] =
+ mobile_apis::AppHMIType::BACKGROUND_PROCESS;
+
+ std::vector<int> policy_hmi_types;
+ policy_hmi_types.push_back(mobile_apis::AppHMIType::MEDIA);
+ policy_hmi_types.push_back(mobile_apis::AppHMIType::BACKGROUND_PROCESS);
+
+ EXPECT_CALL(*mock_policy_manager_, GetHMITypes(kPolicyAppId_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(policy_hmi_types), Return(true)));
+
+ EXPECT_TRUE(policy_handler_.CheckHMIType(
+ kPolicyAppId_, hmi, &(*app_types.get())[strings::app_hmi_type]));
+}
+
+} // namespace rc_policy_handler_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc
index 6d08e5bf56..e053d51c34 100644
--- a/src/components/application_manager/test/request_controller/request_controller_test.cc
+++ b/src/components/application_manager/test/request_controller/request_controller_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,8 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdint.h>
+
#include "gtest/gtest.h"
#include "application_manager/request_controller.h"
+#include "application_manager/request_info.h"
#include "application_manager/mock_request.h"
#include "utils/shared_ptr.h"
#include "smart_objects/smart_object.h"
@@ -47,96 +50,153 @@
#include "application_manager/resumption/resume_ctrl.h"
#include "application_manager/mock_request_controller_settings.h"
#include "application_manager/mock_application_manager.h"
+#include "utils/test_async_waiter.h"
namespace test {
namespace components {
namespace request_controller_test {
-using application_manager::request_controller::RequestController;
-using application_manager::request_controller::RequestInfo;
+using ::application_manager::request_controller::RequestController;
+using ::application_manager::request_controller::RequestInfo;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::NiceMock;
-typedef utils::SharedPtr<application_manager_test::MockRequest> RequestPtr;
+typedef NiceMock<application_manager_test::MockRequest> MRequest;
+typedef utils::SharedPtr<MRequest> RequestPtr;
typedef utils::SharedPtr<RequestController> RequestControllerSPtr;
+namespace {
+const size_t kNumberOfRequests = 10u;
+const uint32_t kTimeScale = 5000u; // 5 seconds
+const uint32_t kMaxRequestAmount = 2u;
+const uint32_t kDefaultCorrelationID = 1u;
+const uint32_t kDefaultConnectionKey = 0u;
+const uint32_t kDefaultTimeout = 100u;
+const uint32_t kThreadPoolSize = 1u;
+} // namespace
+
class RequestControllerTestClass : public ::testing::Test {
public:
- RequestControllerTestClass()
- : request_ctrl_(utils::MakeShared<RequestController>(
- mock_request_controller_settings_)) {
- register_request_ = GetMockRequest();
+ struct TestSettings {
+ uint32_t app_hmi_level_none_requests_time_scale_;
+ uint32_t app_hmi_level_none_time_scale_max_requests_;
+ uint32_t app_time_scale_max_requests_;
+ uint32_t app_requests_time_scale_;
+ uint32_t pending_requests_amount_;
+
+ TestSettings(const uint32_t app_hmi_level_none_requests_time_scale = 0u,
+ const uint32_t app_hmi_level_none_time_scale_max_requests = 0u,
+ const uint32_t app_time_scale_max_requests = 0u,
+ const uint32_t app_requests_time_scale = 0u,
+ const uint32_t pending_requests_amount = 0u)
+ : app_hmi_level_none_requests_time_scale_(
+ app_hmi_level_none_requests_time_scale)
+ , app_hmi_level_none_time_scale_max_requests_(
+ app_hmi_level_none_time_scale_max_requests)
+ , app_time_scale_max_requests_(app_time_scale_max_requests)
+ , app_requests_time_scale_(app_requests_time_scale)
+ , pending_requests_amount_(pending_requests_amount) {}
+ };
+
+ RequestControllerTestClass() {
+ ON_CALL(mock_request_controller_settings_, thread_pool_size())
+ .WillByDefault(Return(kThreadPoolSize));
+ request_ctrl_ =
+ utils::MakeShared<RequestController>(mock_request_controller_settings_);
+ }
+
+ RequestPtr GetMockRequest(
+ const uint32_t correlation_id = kDefaultCorrelationID,
+ const uint32_t connection_key = kDefaultConnectionKey,
+ const uint32_t default_timeout = kDefaultTimeout) {
+ RequestPtr output =
+ utils::MakeShared<MRequest>(connection_key, correlation_id);
+ ON_CALL(*output, default_timeout()).WillByDefault(Return(default_timeout));
+ return output;
}
RequestController::TResult AddRequest(
- const RequestInfo::RequestType request_type,
- const bool RegisterRequest = false,
+ const TestSettings& settings,
+ RequestPtr request,
+ const RequestInfo::RequestType request_type =
+ RequestInfo::RequestType::HMIRequest,
const mobile_apis::HMILevel::eType& hmi_level =
mobile_apis::HMILevel::INVALID_ENUM) {
- RequestPtr request;
- if (RegisterRequest) {
- request = register_request_;
- EXPECT_CALL(*register_request_, default_timeout()).WillOnce(Return(0));
- } else {
- request = empty_register_request_;
- }
if (RequestInfo::RequestType::HMIRequest == request_type) {
return request_ctrl_->addHMIRequest(request);
}
+ CallSettings(settings);
return request_ctrl_->addMobileRequest(request, hmi_level);
}
- RequestPtr GetMockRequest(const uint32_t id = 1,
- const uint32_t connection_key = 0) {
- return utils::MakeShared<application_manager_test::MockRequest>(
- connection_key, id);
- }
- void CallSettings() {
- EXPECT_CALL(mock_request_controller_settings_,
- app_hmi_level_none_time_scale())
- .WillOnce(ReturnRef(kDefaultAppHmiLevelNoneRequestsTimeScale));
- EXPECT_CALL(mock_request_controller_settings_,
- app_hmi_level_none_time_scale_max_requests())
- .WillOnce(ReturnRef(kDefaultAppHmiLevelNoneTimeScaleMaxRequests));
-
- EXPECT_CALL(mock_request_controller_settings_, app_time_scale())
- .WillOnce(ReturnRef(kDefaultAppRequestsTimeScale));
- EXPECT_CALL(mock_request_controller_settings_,
- app_time_scale_max_requests())
- .WillOnce(ReturnRef(kDefaultAppTimeScaleMaxRequests));
-
- EXPECT_CALL(mock_request_controller_settings_, pending_requests_amount())
- .WillOnce(ReturnRef(kDefaultPendingRequestsAmount));
+ void CallSettings(const TestSettings& settings) const {
+ ON_CALL(mock_request_controller_settings_, app_hmi_level_none_time_scale())
+ .WillByDefault(
+ ReturnRef(settings.app_hmi_level_none_requests_time_scale_));
+
+ ON_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale_max_requests())
+ .WillByDefault(
+ ReturnRef(settings.app_hmi_level_none_time_scale_max_requests_));
+
+ ON_CALL(mock_request_controller_settings_, app_time_scale())
+ .WillByDefault(ReturnRef(settings.app_requests_time_scale_));
+
+ ON_CALL(mock_request_controller_settings_, app_time_scale_max_requests())
+ .WillByDefault(ReturnRef(settings.app_time_scale_max_requests_));
+
+ ON_CALL(mock_request_controller_settings_, pending_requests_amount())
+ .WillByDefault(ReturnRef(settings.pending_requests_amount_));
}
- application_manager_test::MockRequestControlerSettings
+ NiceMock<application_manager_test::MockRequestControlerSettings>
mock_request_controller_settings_;
- RequestPtr register_request_;
- RequestPtr empty_register_request_;
RequestControllerSPtr request_ctrl_;
-
- const uint32_t kDefaultAppHmiLevelNoneRequestsTimeScale = 10;
- const uint32_t kDefaultAppHmiLevelNoneTimeScaleMaxRequests = 100u;
- const uint32_t kDefaultAppTimeScaleMaxRequests = 0;
- const uint32_t kDefaultAppRequestsTimeScale = 0;
- const uint32_t kDefaultPendingRequestsAmount = 0;
+ RequestPtr empty_mock_request_;
+ const TestSettings default_settings_;
};
-TEST_F(RequestControllerTestClass, CheckPosibilitytoAdd_HMI_FULL_SUCCESS) {
- CallSettings();
- EXPECT_EQ(RequestController::TResult::SUCCESS,
- AddRequest(RequestInfo::RequestType::MobileRequest,
- true,
- mobile_apis::HMILevel::HMI_FULL));
+TEST_F(RequestControllerTestClass,
+ CheckPosibilitytoAdd_ZeroValueLimiters_SUCCESS) {
+ // Test case than pending_requests_amount,
+ // app_time_scale_max_requests_ and
+ // app_hmi_level_none_time_scale_max_requests_ equals 0
+ // (in the default settings they setted to 0)
+ for (size_t i = 0; i < kMaxRequestAmount; ++i) {
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(default_settings_,
+ GetMockRequest(i),
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_FULL));
+ }
}
-TEST_F(RequestControllerTestClass, CheckPosibilitytoAdd_HMI_NONE_SUCCESS) {
- CallSettings();
- EXPECT_EQ(RequestController::TResult::SUCCESS,
- AddRequest(RequestInfo::RequestType::MobileRequest,
- true,
- mobile_apis::HMILevel::HMI_NONE));
+TEST_F(
+ RequestControllerTestClass,
+ CheckPosibilitytoAdd_ExcessPendingRequestsAmount_TooManyPendingRequests) {
+ TestSettings settings;
+ settings.pending_requests_amount_ = kNumberOfRequests;
+
+ request_ctrl_->DestroyThreadpool();
+
+ // Adding requests to fit in pending_requests_amount_
+ for (size_t i = 0; i < kNumberOfRequests; ++i) {
+ EXPECT_EQ(RequestController::TResult::SUCCESS,
+ AddRequest(settings,
+ GetMockRequest(),
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_FULL));
+ }
+
+ // Trying to add one more extra request
+ // Expect overflow and TOO_MANY_PENDING_REQUESTS result
+ EXPECT_EQ(RequestController::TResult::TOO_MANY_PENDING_REQUESTS,
+ AddRequest(settings,
+ GetMockRequest(),
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_FULL));
}
TEST_F(RequestControllerTestClass, IsLowVoltage_SetOnLowVoltage_TRUE) {
@@ -151,36 +211,55 @@ TEST_F(RequestControllerTestClass, IsLowVoltage_SetOnWakeUp_FALSE) {
EXPECT_EQ(result, request_ctrl_->IsLowVoltage());
}
+TEST_F(RequestControllerTestClass, AddMobileRequest_SetValidData_SUCCESS) {
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(default_settings_,
+ GetMockRequest(),
+ RequestInfo::RequestType::MobileRequest,
+ mobile_apis::HMILevel::HMI_FULL));
+}
+
TEST_F(RequestControllerTestClass,
AddMobileRequest_SetInvalidData_INVALID_DATA) {
EXPECT_EQ(RequestController::INVALID_DATA,
- AddRequest(RequestInfo::RequestType::MobileRequest,
- false,
+ AddRequest(default_settings_,
+ empty_mock_request_,
+ RequestInfo::RequestType::MobileRequest,
mobile_apis::HMILevel::HMI_NONE));
}
-TEST_F(RequestControllerTestClass, addHMIRequest_AddRequest_SUCCESS) {
+TEST_F(RequestControllerTestClass, AddHMIRequest_AddRequest_SUCCESS) {
EXPECT_EQ(RequestController::SUCCESS,
- AddRequest(RequestInfo::RequestType::HMIRequest, true));
+ AddRequest(default_settings_,
+ GetMockRequest(),
+ RequestInfo::RequestType::HMIRequest));
}
-TEST_F(RequestControllerTestClass, addHMIRequest_AddInvalidData_INVALID_DATA) {
+TEST_F(RequestControllerTestClass, AddHMIRequest_AddInvalidData_INVALID_DATA) {
EXPECT_EQ(RequestController::INVALID_DATA,
- AddRequest(RequestInfo::RequestType::HMIRequest));
+ AddRequest(default_settings_,
+ empty_mock_request_,
+ RequestInfo::RequestType::HMIRequest));
}
-TEST_F(RequestControllerTestClass, ZeroValuePendingRequestsAmount) {
- // Bigger than pending_requests_amount count
- const uint32_t big_count_of_requests_for_test_ = 10;
- for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) {
- CallSettings();
- EXPECT_EQ(RequestController::SUCCESS,
- AddRequest(RequestInfo::RequestType::MobileRequest,
- true,
- mobile_apis::HMILevel::HMI_FULL));
- }
+TEST_F(RequestControllerTestClass, OnTimer_SUCCESS) {
+ const uint32_t request_timeout = 1u;
+ RequestPtr mock_request = GetMockRequest(
+ kDefaultCorrelationID, kDefaultConnectionKey, request_timeout);
+
+ TestAsyncWaiter waiter;
+ EXPECT_EQ(RequestController::SUCCESS,
+ AddRequest(default_settings_,
+ mock_request,
+ RequestInfo::RequestType::MobileRequest));
+
+ EXPECT_CALL(*mock_request, onTimeOut())
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ // Waiting for call of `onTimeOut` for `kTimeScale` seconds
+ EXPECT_TRUE(waiter.WaitFor(1, kTimeScale));
}
-} // namespace request_controller
+} // namespace request_controller_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc
index 886736fa97..11b2d2f259 100644
--- a/src/components/application_manager/test/request_info_test.cc
+++ b/src/components/application_manager/test/request_info_test.cc
@@ -31,6 +31,7 @@
*/
#include "application_manager/request_info.h"
+#include "application_manager/mock_request.h"
#include <iostream>
#include <vector>
#include <limits>
@@ -44,30 +45,6 @@ namespace test {
namespace components {
namespace application_manager_test {
-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 {
- return connection_key_;
- }
- virtual uint32_t correlation_id() const {
- return correlation_id_;
- }
-};
-
class TestRequestInfo : public request_info::RequestInfo {
public:
TestRequestInfo(request_info::RequestPtr request,
@@ -115,7 +92,7 @@ class RequestInfoTest : public ::testing::Test {
};
TEST_F(RequestInfoTest, RequestInfoEqualEndTime) {
- std::vector<utils::SharedPtr<TestRequestInfo>> requests;
+ std::vector<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 = CreateTestInfo(
@@ -142,7 +119,7 @@ TEST_F(RequestInfoTest, AddRemoveHMIRequests) {
}
TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
- std::vector<utils::SharedPtr<TestRequestInfo>> requests;
+ std::vector<utils::SharedPtr<TestRequestInfo> > requests;
// Add hmi requests
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
@@ -158,7 +135,7 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size());
// Delete every request
- std::vector<utils::SharedPtr<TestRequestInfo>>::iterator req_it =
+ std::vector<utils::SharedPtr<TestRequestInfo> >::iterator req_it =
requests.begin();
for (; req_it != requests.end(); ++req_it) {
@@ -177,107 +154,6 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) {
EXPECT_EQ(0u, request_info_set_.Size());
}
-TEST_F(RequestInfoTest, CheckRequestsMaxCount) {
- const uint32_t app_hmi_level_time_scale = 100;
- const uint32_t hmi_level_count = 1000;
-
- // Count of added requests is less than max possible
- std::vector<utils::SharedPtr<TestRequestInfo>> requests;
- for (uint32_t i = 0; i < hmi_level_count - 1; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
- CreateTestInfo(mobile_connection_key1_,
- i,
- request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
- default_timeout_);
-
- request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
- requests.push_back(request);
- EXPECT_TRUE(request_info_set_.Add(request));
- }
- EXPECT_EQ(hmi_level_count - 1, request_info_set_.Size());
-
- EXPECT_TRUE(request_info_set_.CheckHMILevelTimeScaleMaxRequest(
- mobile_apis::HMILevel::HMI_FULL,
- mobile_connection_key1_,
- app_hmi_level_time_scale,
- hmi_level_count));
-
- // Adding new request is correct
- utils::SharedPtr<TestRequestInfo> new_request =
- CreateTestInfo(mobile_connection_key1_,
- hmi_level_count,
- request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
- default_timeout_);
- new_request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
- EXPECT_TRUE(request_info_set_.Add(new_request));
- EXPECT_EQ(hmi_level_count, request_info_set_.Size());
-
- // Count of added requests is max
- EXPECT_FALSE(request_info_set_.CheckHMILevelTimeScaleMaxRequest(
- mobile_apis::HMILevel::HMI_FULL,
- mobile_connection_key1_,
- app_hmi_level_time_scale,
- hmi_level_count));
-
- utils::SharedPtr<TestRequestInfo> new_request2 =
- CreateTestInfo(mobile_connection_key1_,
- hmi_level_count + 1,
- request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
- default_timeout_);
-
- EXPECT_TRUE(request_info_set_.Add(new_request2));
-}
-
-TEST_F(RequestInfoTest, CheckMaxCountOfRequest) {
- const uint32_t app_hmi_level_time_scale = 100;
- const uint32_t hmi_level_count = 1000;
-
- // Count of added requests is less than max possible
- std::vector<utils::SharedPtr<TestRequestInfo>> requests;
- for (uint32_t i = 0; i < hmi_level_count - 1; ++i) {
- utils::SharedPtr<TestRequestInfo> request =
- CreateTestInfo(mobile_connection_key1_,
- i,
- request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
- default_timeout_);
- request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
- requests.push_back(request);
- EXPECT_TRUE(request_info_set_.Add(request));
- }
- EXPECT_EQ(hmi_level_count - 1, request_info_set_.Size());
-
- EXPECT_TRUE(request_info_set_.CheckTimeScaleMaxRequest(
- mobile_connection_key1_, app_hmi_level_time_scale, hmi_level_count));
-
- // Adding new request is correct
- utils::SharedPtr<TestRequestInfo> new_request =
- CreateTestInfo(mobile_connection_key1_,
- hmi_level_count,
- request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
- default_timeout_);
- new_request->set_hmi_level(mobile_apis::HMILevel::HMI_FULL);
- EXPECT_TRUE(request_info_set_.Add(new_request));
- EXPECT_EQ(hmi_level_count, request_info_set_.Size());
-
- // Count of added requests is max
- EXPECT_FALSE(request_info_set_.CheckTimeScaleMaxRequest(
- mobile_connection_key1_, app_hmi_level_time_scale, hmi_level_count));
-
- utils::SharedPtr<TestRequestInfo> new_request2 =
- CreateTestInfo(mobile_connection_key1_,
- hmi_level_count + 1,
- request_info::RequestInfo::MobileRequest,
- date_time::DateTime::getCurrentTime(),
- default_timeout_);
-
- EXPECT_TRUE(request_info_set_.Add(new_request2));
-}
-
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
utils::SharedPtr<TestRequestInfo> mobile_request1 =
CreateTestInfo(mobile_connection_key1_,
@@ -299,7 +175,7 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) {
}
TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) {
- std::vector<utils::SharedPtr<TestRequestInfo>> requests;
+ std::vector<utils::SharedPtr<TestRequestInfo> > requests;
const uint32_t count_of_mobile_request1 = 200;
const uint32_t count_of_mobile_request2 = 100;
for (uint32_t i = 0; i < count_of_mobile_request1; ++i) {
@@ -361,14 +237,14 @@ TEST_F(RequestInfoTest, RequestInfoSetFront) {
}
TEST_F(RequestInfoTest, RequestInfoSetFind) {
- std::vector<std::pair<uint32_t, uint32_t>> appid_connection_id;
+ std::vector<std::pair<uint32_t, uint32_t> > appid_connection_id;
for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) {
appid_connection_id.push_back(
std::pair<uint32_t, uint32_t>(i, count_of_requests_for_test_ - i));
}
- std::vector<std::pair<uint32_t, uint32_t>>::iterator req_it =
+ std::vector<std::pair<uint32_t, uint32_t> >::iterator req_it =
appid_connection_id.begin();
- const std::vector<std::pair<uint32_t, uint32_t>>::iterator end =
+ const std::vector<std::pair<uint32_t, uint32_t> >::iterator end =
appid_connection_id.end();
for (; req_it != end; ++req_it) {
diff --git a/src/components/application_manager/test/request_tracker_test.cc b/src/components/application_manager/test/request_tracker_test.cc
new file mode 100644
index 0000000000..ee09e0a3e0
--- /dev/null
+++ b/src/components/application_manager/test/request_tracker_test.cc
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "utils/macro.h"
+#include "application_manager/request_tracker.h"
+#include "application_manager/mock_request_controller_settings.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+
+namespace test {
+namespace components {
+namespace request_controller_test {
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+class RequestTrackerTestClass : public ::testing::Test {
+ public:
+ RequestTrackerTestClass() : tracker_(mock_request_controller_settings_) {}
+
+ void SetDefaultConstraints() {
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale())
+ .WillRepeatedly(ReturnRef(kDefaultAppHmiLevelNoneRequestsTimeScale));
+
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale_max_requests())
+ .WillRepeatedly(ReturnRef(kDefaultAppHmiLevelNoneTimeScaleMaxRequests));
+
+ EXPECT_CALL(mock_request_controller_settings_, app_time_scale())
+ .WillRepeatedly(ReturnRef(kDefaultAppRequestsTimeScale));
+
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_time_scale_max_requests())
+ .WillRepeatedly(ReturnRef(kDefaultAppTimeScaleMaxRequests));
+ }
+
+ protected:
+ application_manager_test::MockRequestControlerSettings
+ mock_request_controller_settings_;
+
+ application_manager::request_controller::RequestTracker tracker_;
+
+ const uint32_t kDefaultAppHmiLevelNoneRequestsTimeScale = 10u;
+ const uint32_t kDefaultAppHmiLevelNoneTimeScaleMaxRequests = 100u;
+ const uint32_t kDefaultAppTimeScaleMaxRequests = 5u;
+ const uint32_t kDefaultAppRequestsTimeScale = 200u;
+};
+
+TEST_F(RequestTrackerTestClass, TrackAppRequestInNone_ExpectSuccessTillLimit) {
+ const uint32_t app_id = 1u;
+ const mobile_apis::HMILevel::eType none_level =
+ mobile_apis::HMILevel::HMI_NONE;
+
+ SetDefaultConstraints();
+
+ for (uint32_t i = 0; i < kDefaultAppHmiLevelNoneTimeScaleMaxRequests; ++i) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, none_level));
+ }
+
+ EXPECT_EQ(application_manager::request_controller::TrackResult::
+ kNoneLevelMaxRequestsExceeded,
+ tracker_.Track(app_id, none_level));
+}
+
+TEST_F(RequestTrackerTestClass,
+ TrackAppRequestInNone_NoLimits_ExpectAlwaysSuccess) {
+ const uint32_t no_limit = 0;
+
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale())
+ .WillRepeatedly(ReturnRef(no_limit));
+
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale_max_requests())
+ .WillRepeatedly(ReturnRef(no_limit));
+
+ const uint32_t app_id = 1u;
+ const mobile_apis::HMILevel::eType none_level =
+ mobile_apis::HMILevel::HMI_NONE;
+
+ for (uint32_t i = 0; i < kDefaultAppHmiLevelNoneTimeScaleMaxRequests; ++i) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, none_level));
+ }
+
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, none_level));
+}
+
+TEST_F(RequestTrackerTestClass,
+ TrackAppRequestInOtherThanNone_ExpectSuccessTillLimit) {
+ const uint32_t app_id = 1u;
+ mobile_apis::HMILevel::eType hmi_level =
+ mobile_apis::HMILevel::HMI_BACKGROUND;
+
+ SetDefaultConstraints();
+
+ for (uint32_t i = 0; i < kDefaultAppTimeScaleMaxRequests; ++i) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, hmi_level));
+ if (i % 2) {
+ hmi_level = mobile_apis::HMILevel::HMI_FULL;
+ } else {
+ hmi_level = mobile_apis::HMILevel::HMI_LIMITED;
+ }
+ }
+
+ EXPECT_EQ(application_manager::request_controller::TrackResult::
+ kMaxRequestsExceeded,
+ tracker_.Track(app_id, hmi_level));
+}
+
+TEST_F(RequestTrackerTestClass,
+ TrackAppRequestInOtherThanNone_NoLimits_ExpectAlwaysSuccess) {
+ const uint32_t no_limit = 0;
+
+ EXPECT_CALL(mock_request_controller_settings_, app_time_scale())
+ .WillRepeatedly(ReturnRef(no_limit));
+
+ EXPECT_CALL(mock_request_controller_settings_, app_time_scale_max_requests())
+ .WillRepeatedly(ReturnRef(no_limit));
+
+ const uint32_t app_id = 1u;
+ mobile_apis::HMILevel::eType hmi_level =
+ mobile_apis::HMILevel::HMI_BACKGROUND;
+
+ for (uint32_t i = 0; i < kDefaultAppTimeScaleMaxRequests; ++i) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, hmi_level));
+ if (i % 2) {
+ hmi_level = mobile_apis::HMILevel::HMI_FULL;
+ } else {
+ hmi_level = mobile_apis::HMILevel::HMI_LIMITED;
+ }
+ }
+
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, hmi_level));
+}
+
+TEST_F(RequestTrackerTestClass,
+ TrackTwoAppsRequestInNone_ExpectSuccessTillLimit) {
+ const uint32_t app_id_1 = 1u;
+ const uint32_t app_id_2 = 2u;
+
+ const mobile_apis::HMILevel::eType none_level =
+ mobile_apis::HMILevel::HMI_NONE;
+
+ SetDefaultConstraints();
+
+ for (uint32_t i = 0; i < kDefaultAppHmiLevelNoneTimeScaleMaxRequests; ++i) {
+ if (i % 2) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id_1, none_level));
+ } else {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id_2, none_level));
+ }
+ }
+
+ for (uint32_t i = 0; i < kDefaultAppHmiLevelNoneTimeScaleMaxRequests / 2;
+ ++i) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id_1, none_level));
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id_2, none_level));
+ }
+
+ EXPECT_EQ(application_manager::request_controller::TrackResult::
+ kNoneLevelMaxRequestsExceeded,
+ tracker_.Track(app_id_1, none_level));
+
+ EXPECT_EQ(application_manager::request_controller::TrackResult::
+ kNoneLevelMaxRequestsExceeded,
+ tracker_.Track(app_id_2, none_level));
+}
+
+TEST_F(RequestTrackerTestClass,
+ TrackAppRequestInNone_DoPause_TrackAgain_ExpectSuccessTillLimit) {
+ const uint32_t max_requests = 5;
+ const uint32_t time_scale_ms = 1;
+
+ sync_primitives::ConditionalVariable awaiter;
+ sync_primitives::Lock lock;
+ sync_primitives::AutoLock auto_lock(lock);
+
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale())
+ .WillRepeatedly(ReturnRef(time_scale_ms));
+
+ EXPECT_CALL(mock_request_controller_settings_,
+ app_hmi_level_none_time_scale_max_requests())
+ .WillRepeatedly(ReturnRef(max_requests));
+
+ const uint32_t app_id = 1u;
+ const mobile_apis::HMILevel::eType none_level =
+ mobile_apis::HMILevel::HMI_NONE;
+
+ for (uint32_t i = 0; i < max_requests; ++i) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, none_level));
+ }
+
+ awaiter.WaitFor(auto_lock, time_scale_ms * 2);
+
+ for (uint32_t i = 0; i < max_requests; ++i) {
+ EXPECT_EQ(application_manager::request_controller::TrackResult::kSuccess,
+ tracker_.Track(app_id, none_level));
+ }
+
+ EXPECT_EQ(application_manager::request_controller::TrackResult::
+ kNoneLevelMaxRequestsExceeded,
+ tracker_.Track(app_id, none_level));
+}
+
+} // namespace request_controller
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
index 27376e8118..85801d7e73 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,7 @@ namespace components {
namespace resumption_test {
using ::testing::_;
+using ::testing::A;
using ::testing::Return;
using ::testing::ReturnRef;
using ::testing::DoAll;
@@ -61,6 +62,7 @@ using ::testing::SetArgReferee;
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::AtLeast;
+using ::testing::Eq;
using namespace application_manager_test;
using namespace resumption;
@@ -77,17 +79,21 @@ class ResumeCtrlTest : public ::testing::Test {
, kTestDevId_(5u)
, kTestGrammarId_(10)
, kHash_("saved_hash")
- , kAppResumingTimeout_(30000000u) {}
+ , kAppResumingTimeout_(30000u) // miliseconds
+ , kTestTimeStamp_(1452074434u) {}
virtual void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&app_mngr_);
ON_CALL(app_mngr_, event_dispatcher())
.WillByDefault(ReturnRef(mock_event_dispatcher_));
- mock_storage =
- ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData>>(
+ mock_storage_ =
+ ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(
app_mngr_);
- app_mock = utils::MakeShared<NiceMock<MockApplication>>();
- res_ctrl = utils::MakeShared<ResumeCtrlImpl>(app_mngr_);
- res_ctrl->set_resumption_storage(mock_storage);
+ app_mock_ = utils::MakeShared<NiceMock<MockApplication> >();
+ const_app_ =
+ static_cast<application_manager::ApplicationConstSharedPtr>(app_mock_);
+ res_ctrl_ = utils::MakeShared<ResumeCtrlImpl>(app_mngr_);
+ res_ctrl_->set_resumption_storage(mock_storage_);
ON_CALL(app_mngr_, state_controller())
.WillByDefault(ReturnRef(state_controller_));
@@ -99,12 +105,15 @@ class ResumeCtrlTest : public ::testing::Test {
ON_CALL(mock_application_manager_settings_, app_resuming_timeout())
.WillByDefault(ReturnRef(kAppResumingTimeout_));
}
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&app_mngr_);
+ }
void GetInfoFromApp() {
- ON_CALL(*app_mock, policy_app_id())
+ ON_CALL(*app_mock_, policy_app_id())
.WillByDefault(Return(kTestPolicyAppId_));
- ON_CALL(*app_mock, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
- ON_CALL(*app_mock, device()).WillByDefault(Return(kTestDevId_));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(kTestAppId_));
+ ON_CALL(*app_mock_, mac_address()).WillByDefault(ReturnRef(kMacAddress_));
+ ON_CALL(*app_mock_, device()).WillByDefault(Return(kTestDevId_));
+ ON_CALL(*app_mock_, app_id()).WillByDefault(Return(kTestAppId_));
}
NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_;
@@ -112,20 +121,22 @@ class ResumeCtrlTest : public ::testing::Test {
mock_application_manager_settings_;
application_manager_test::MockApplicationManager app_mngr_;
MockStateController state_controller_;
- utils::SharedPtr<ResumeCtrl> res_ctrl;
- utils::SharedPtr<NiceMock<resumption_test::MockResumptionData>> mock_storage;
- utils::SharedPtr<NiceMock<MockApplication>> app_mock;
- // app_mock.app_id() will return this value
+ utils::SharedPtr<ResumeCtrl> res_ctrl_;
+ utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> >
+ mock_storage_;
+ utils::SharedPtr<NiceMock<MockApplication> > app_mock_;
+ application_manager::ApplicationConstSharedPtr const_app_;
const uint32_t kTestAppId_;
const std::string kTestPolicyAppId_;
const std::string kMacAddress_;
const mobile_apis::HMILevel::eType kDefaultTestLevel_;
const uint32_t kCorId_;
- // app_mock.Device() will return this value
const uint32_t kTestDevId_;
const uint32_t kTestGrammarId_;
const std::string kHash_;
const uint32_t kAppResumingTimeout_;
+ const uint32_t kTestTimeStamp_;
+ sync_primitives::Lock app_set_lock_;
};
/**
@@ -139,15 +150,16 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGrammarId) {
// Check RestoreApplicationData
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
- EXPECT_CALL(*mock_storage,
- GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
-
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
@@ -163,15 +175,16 @@ TEST_F(ResumeCtrlTest, StartResumption_WithoutGrammarId) {
saved_app[application_manager::strings::hash_id] = kHash_;
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_)).Times(0);
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_)).Times(0);
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+ bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_FALSE(res);
}
@@ -210,14 +223,15 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
test_application_files;
// Check RestoreApplicationData
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_files; ++i) {
- EXPECT_CALL(*app_mock,
+ EXPECT_CALL(*app_mock_,
AddFile(CheckAppFile(
true,
true,
@@ -225,7 +239,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithFiles) {
static_cast<mobile_apis::FileType::eType>(file_types[i]))));
}
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
@@ -247,15 +261,16 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
test_application_submenues;
// Check RestoreApplicationData
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_submenues; ++i) {
- EXPECT_CALL(*app_mock, AddSubMenu(i, test_application_submenues[i]));
+ EXPECT_CALL(*app_mock_, AddSubMenu(i, test_application_submenues[i]));
}
smart_objects::SmartObjectList requests;
@@ -265,8 +280,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) {
CreateAddSubMenuRequestToHMI(_, kCorId_))
.WillRepeatedly(Return(requests));
- EXPECT_CALL(*app_mock, UpdateHash());
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
@@ -287,16 +302,17 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
saved_app[application_manager::strings::application_commands] =
test_application_commands;
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
// Check RestoreApplicationData
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_commands; ++i) {
- EXPECT_CALL(*app_mock, AddCommand(i, test_application_commands[i]));
+ EXPECT_CALL(*app_mock_, AddCommand(i, test_application_commands[i]));
}
smart_objects::SmartObjectList requests;
@@ -304,7 +320,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) {
CreateAddCommandRequestToHMI(_, _))
.WillRepeatedly(Return(requests));
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
@@ -338,16 +354,17 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
application_choice_sets;
// Check RestoreApplicationData
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, UpdateHash());
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_choice_sets; ++i) {
- EXPECT_CALL(*app_mock, AddChoiceSet(i, application_choice_sets[i]));
+ EXPECT_CALL(*app_mock_, AddChoiceSet(i, application_choice_sets[i]));
}
smart_objects::SmartObjectList requests;
@@ -355,7 +372,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithChoiceSet) {
CreateAddVRCommandRequestFromChoiceToHMI(_))
.WillRepeatedly(Return(requests));
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
@@ -369,21 +386,22 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithGlobalProperties) {
test_global_properties;
// Check RestoreApplicationData
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
SendGlobalPropertiesToHMI(_));
- EXPECT_CALL(*app_mock, load_global_properties(test_global_properties));
+ EXPECT_CALL(*app_mock_, load_global_properties(test_global_properties));
- EXPECT_CALL(*app_mock, UpdateHash());
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
@@ -403,29 +421,30 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) {
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
- saved_app[application_manager::strings::application_subscribtions] =
+ saved_app[application_manager::strings::application_subscriptions] =
test_subscriptions;
// Check RestoreApplicationData
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
for (uint32_t i = 0; i < count_of_buttons; ++i) {
EXPECT_CALL(
- *app_mock,
+ *app_mock_,
SubscribeToButton(static_cast<mobile_apis::ButtonName::eType>(i)));
}
- EXPECT_CALL(*app_mock, UpdateHash());
+ EXPECT_CALL(*app_mock_, UpdateHash());
EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(),
SendAllOnButtonSubscriptionNotificationsForApp(_, _)).Times(2);
- bool res = res_ctrl->StartResumption(app_mock, kHash_);
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
@@ -434,9 +453,9 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
smart_objects::SmartObject test_subscriptions;
smart_objects::SmartObject app_vi;
- int vtype = application_manager::VehicleDataType::GPS;
+ int vtype = mobile_apis::VehicleDataType::VEHICLEDATA_GPS;
uint i = 0;
- for (; vtype < application_manager::VehicleDataType::STEERINGWHEEL;
+ for (; vtype < mobile_apis::VehicleDataType::VEHICLEDATA_STEERINGWHEEL;
++i, ++vtype) {
app_vi[i] = vtype;
}
@@ -447,42 +466,69 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToIVI) {
smart_objects::SmartObject saved_app;
saved_app[application_manager::strings::hash_id] = kHash_;
saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
- saved_app[application_manager::strings::application_subscribtions] =
+ saved_app[application_manager::strings::application_subscriptions] =
test_subscriptions;
// Check RestoreApplicationData
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*app_mock, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
for (size_t i = 0; i < app_vi.length(); ++i) {
EXPECT_CALL(
- *app_mock,
- SubscribeToIVI(static_cast<application_manager::VehicleDataType>(i)));
+ *app_mock_,
+ SubscribeToIVI(static_cast<mobile_apis::VehicleDataType::eType>(i)));
}
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, kHash_);
+ EXPECT_CALL(*app_mock_, UpdateHash());
+ const bool res = res_ctrl_->StartResumption(app_mock_, kHash_);
EXPECT_TRUE(res);
}
+TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscriptionToWayPoints) {
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::hash_id] = kHash_;
+ saved_app[application_manager::strings::grammar_id] = kTestGrammarId_;
+ saved_app[application_manager::strings::subscribed_for_way_points] = true;
+ saved_app[application_manager::strings::time_stamp] = kTestTimeStamp_;
+
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_CALL(*app_mock_, set_grammar_id(kTestGrammarId_));
+ EXPECT_CALL(
+ app_mngr_,
+ SubscribeAppForWayPoints(A<application_manager::ApplicationSharedPtr>()));
+ const mobile_apis::HMILevel::eType hmi_test_level =
+ mobile_apis::HMILevel::HMI_FULL;
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(hmi_test_level));
+ EXPECT_CALL(state_controller_, SetRegularState(_, hmi_test_level));
+
+ const bool result = res_ctrl_->StartResumption(app_mock_, kHash_);
+ EXPECT_TRUE(result);
+}
+
TEST_F(ResumeCtrlTest, StartResumptionOnlyHMILevel) {
smart_objects::SmartObject saved_app;
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillOnce(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
- .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- bool res = res_ctrl->StartResumptionOnlyHMILevel(app_mock);
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ const bool res = res_ctrl_->StartResumptionOnlyHMILevel(app_mock_);
EXPECT_TRUE(res);
}
@@ -496,15 +542,17 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) {
EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(*mock_storage, RemoveApplicationFromSaved(_, _))
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
- .WillRepeatedly(Return(policy::kDeviceAllowed));
- res_ctrl->StartAppHmiStateResumption(app_mock);
+ ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(app_mock_);
}
TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
@@ -517,10 +565,11 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInBackground) {
EXPECT_CALL(app_mngr_, state_controller()).Times(0);
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- res_ctrl->StartAppHmiStateResumption(app_mock);
+ res_ctrl_->StartAppHmiStateResumption(app_mock_);
}
/**
@@ -538,14 +587,15 @@ TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) {
EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type))
.Times(AtLeast(1));
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
- .WillOnce(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mock, set_is_resuming(true));
+ ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ EXPECT_CALL(*app_mock_, set_is_resuming(true));
- bool res = res_ctrl->RestoreAppHMIState(app_mock);
+ const bool res = res_ctrl_->RestoreAppHMIState(app_mock_);
EXPECT_TRUE(res);
}
@@ -554,18 +604,46 @@ TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) {
saved_app[application_manager::strings::hmi_level] = kDefaultTestLevel_;
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillRepeatedly(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
GetInfoFromApp();
EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillOnce(Return(kDefaultTestLevel_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
- res_ctrl->SetupDefaultHMILevel(app_mock);
+ res_ctrl_->SetupDefaultHMILevel(app_mock_);
+}
+
+TEST_F(ResumeCtrlTest, ApplicationResumptiOnTimer_AppInFull) {
+ ON_CALL(app_mngr_, application(kTestAppId_)).WillByDefault(Return(app_mock_));
+
+ mobile_apis::HMILevel::eType restored_test_type = eType::HMI_FULL;
+ const uint32_t ign_off_count = 0u;
+ smart_objects::SmartObject saved_app;
+ saved_app[application_manager::strings::ign_off_count] = ign_off_count;
+ saved_app[application_manager::strings::hmi_level] = restored_test_type;
+
+ MockStateController state_controller;
+ EXPECT_CALL(app_mngr_, state_controller())
+ .WillOnce(ReturnRef(state_controller));
+ EXPECT_CALL(state_controller, SetRegularState(_, restored_test_type))
+ .Times(AtLeast(1));
+ GetInfoFromApp();
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(true));
+
+ ON_CALL(app_mngr_, GetUserConsentForDevice(kMacAddress_))
+ .WillByDefault(Return(policy::kDeviceAllowed));
+ res_ctrl_->StartAppHmiStateResumption(app_mock_);
}
/**
@@ -577,10 +655,11 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_WithoutCheckPolicy) {
EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(*app_mock_, set_is_resuming(true));
EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
- bool res = res_ctrl->SetAppHMIState(app_mock, kDefaultTestLevel_, false);
+ const bool res =
+ res_ctrl_->SetAppHMIState(app_mock_, kDefaultTestLevel_, false);
EXPECT_TRUE(res);
}
@@ -589,10 +668,10 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMILimited_WithoutCheckPolicy) {
GetInfoFromApp();
EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(*app_mock_, set_is_resuming(true));
EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- bool res = res_ctrl->SetAppHMIState(app_mock, test_type, false);
+ const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, false);
EXPECT_TRUE(res);
}
@@ -600,14 +679,14 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithoutCheckPolicy) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
// GetDefaultHmiLevel should not be called
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_)).Times(0);
+ EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(const_app_)).Times(0);
EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345")).Times(0);
- EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(*app_mock_, set_is_resuming(true));
EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- bool res = res_ctrl->SetAppHMIState(app_mock, test_type, false);
+ const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, false);
EXPECT_TRUE(res);
}
@@ -615,14 +694,14 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevAllowed) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
- .WillOnce(Return(policy::kDeviceAllowed));
+ ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceAllowed));
- EXPECT_CALL(*app_mock, set_is_resuming(true));
+ EXPECT_CALL(*app_mock_, set_is_resuming(true));
EXPECT_CALL(state_controller_, SetRegularState(_, test_type))
.Times(AtLeast(1));
- bool res = res_ctrl->SetAppHMIState(app_mock, test_type, true);
+ const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, true);
EXPECT_TRUE(res);
}
@@ -630,78 +709,124 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) {
mobile_apis::HMILevel::eType test_type = eType::HMI_FULL;
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetUserConsentForDevice("12345"))
- .WillOnce(Return(policy::kDeviceDisallowed));
+ ON_CALL(app_mngr_, GetUserConsentForDevice("12345"))
+ .WillByDefault(Return(policy::kDeviceDisallowed));
- EXPECT_CALL(*app_mock, set_is_resuming(true));
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillOnce(Return(kDefaultTestLevel_));
+ EXPECT_CALL(*app_mock_, set_is_resuming(true));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
EXPECT_CALL(state_controller_, SetRegularState(_, kDefaultTestLevel_))
.Times(AtLeast(1));
- bool res = res_ctrl->SetAppHMIState(app_mock, test_type, true);
+ const bool res = res_ctrl_->SetAppHMIState(app_mock_, test_type, true);
EXPECT_FALSE(res);
}
+TEST_F(ResumeCtrlTest, SaveAllApplications) {
+ utils::SharedPtr<application_manager_test::MockApplication> test_app =
+ ::utils::MakeShared<application_manager_test::MockApplication>();
+ EXPECT_CALL(*test_app, app_id()).WillRepeatedly(Return(kTestAppId_));
+
+ application_manager::ApplicationSet app_set;
+ app_set.insert(test_app);
+
+ DataAccessor<application_manager::ApplicationSet> accessor(app_set,
+ app_set_lock_);
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ EXPECT_CALL(*mock_storage_, SaveApplication(Eq(test_app)));
+ res_ctrl_->SaveAllApplications();
+}
+
+TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) {
+ utils::SharedPtr<application_manager::Application> mock_app =
+ ::utils::MakeShared<application_manager_test::MockApplication>();
+
+ application_manager::ApplicationSet app_set;
+
+ DataAccessor<application_manager::ApplicationSet> accessor(app_set,
+ app_set_lock_);
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ EXPECT_CALL(*mock_storage_, SaveApplication(mock_app)).Times(0);
+ res_ctrl_->SaveAllApplications();
+}
+
TEST_F(ResumeCtrlTest, SaveApplication) {
utils::SharedPtr<application_manager::Application> app_sh_mock =
::utils::MakeShared<application_manager_test::MockApplication>();
- EXPECT_CALL(*mock_storage, SaveApplication(app_sh_mock));
- res_ctrl->SaveApplication(app_sh_mock);
+ EXPECT_CALL(*mock_storage_, SaveApplication(app_sh_mock));
+ res_ctrl_->SaveApplication(app_sh_mock);
}
TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionHasStarted) {
smart_objects::SmartObject saved_app;
GetInfoFromApp();
- EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_))
- .WillOnce(Return(kDefaultTestLevel_));
- EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
- .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- ON_CALL(*app_mock, app_id()).WillByDefault(Return(kTestAppId_));
+ ON_CALL(app_mngr_, GetDefaultHmiLevel(const_app_))
+ .WillByDefault(Return(kDefaultTestLevel_));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*app_mock_, app_id()).WillByDefault(Return(kTestAppId_));
- bool res = res_ctrl->StartResumptionOnlyHMILevel(app_mock);
+ const bool res = res_ctrl_->StartResumptionOnlyHMILevel(app_mock_);
EXPECT_TRUE(res);
utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
::utils::MakeShared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(kTestAppId_));
- res_ctrl->OnAppActivated(app_sh_mock);
+ res_ctrl_->OnAppActivated(app_sh_mock);
}
TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) {
utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock =
::utils::MakeShared<application_manager_test::MockApplication>();
EXPECT_CALL(*app_sh_mock, app_id()).Times(0);
- res_ctrl->OnAppActivated(app_sh_mock);
+ res_ctrl_->OnAppActivated(app_sh_mock);
}
TEST_F(ResumeCtrlTest, IsHMIApplicationIdExist) {
uint32_t hmi_app_id = 10;
- EXPECT_CALL(*mock_storage, IsHMIApplicationIdExist(hmi_app_id))
+ EXPECT_CALL(*mock_storage_, IsHMIApplicationIdExist(hmi_app_id))
.WillOnce(Return(true));
- EXPECT_TRUE(res_ctrl->IsHMIApplicationIdExist(hmi_app_id));
+ 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(kTestPolicyAppId_, device_id))
+ EXPECT_CALL(*mock_storage_, GetHMIApplicationID(kTestPolicyAppId_, device_id))
.WillOnce(Return(hmi_app_id));
EXPECT_EQ(hmi_app_id,
- res_ctrl->GetHMIApplicationID(kTestPolicyAppId_, device_id));
+ res_ctrl_->GetHMIApplicationID(kTestPolicyAppId_, device_id));
}
TEST_F(ResumeCtrlTest, IsApplicationSaved) {
- std::string policy_app_id = "policy_app_id";
- std::string device_id = "device_id";
+ const bool is_app_saved = true;
+ EXPECT_CALL(*mock_storage_,
+ IsApplicationSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(is_app_saved));
+ EXPECT_TRUE(res_ctrl_->IsApplicationSaved(kTestPolicyAppId_, kMacAddress_));
+}
- 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, OnAppRegistrationStart) {
+ const bool is_app_saved = false;
+ EXPECT_CALL(*mock_storage_,
+ IsApplicationSaved(kTestPolicyAppId_, kMacAddress_))
+ .WillOnce(Return(is_app_saved));
+ res_ctrl_->OnAppRegistrationStart(kTestPolicyAppId_, kMacAddress_);
+}
+
+TEST_F(ResumeCtrlTest, OnAppRegistrationEnd) {
+ const uint32_t timeout = 1000u;
+ EXPECT_CALL(mock_application_manager_settings_,
+ app_resumption_save_persistent_data_timeout())
+ .WillOnce(ReturnRef(timeout));
+ res_ctrl_->OnAppRegistrationEnd();
}
TEST_F(ResumeCtrlTest, CheckPersistenceFiles_WithoutCommandAndChoiceSets) {
@@ -711,10 +836,11 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFiles_WithoutCommandAndChoiceSets) {
saved_app[application_manager::strings::hmi_level] = HMI_FULL;
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl->CheckPersistenceFilesForResumption(app_mock));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
@@ -727,14 +853,15 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithCommands) {
test_application_commands;
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(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));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
}
TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
@@ -747,16 +874,34 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
test_choice_sets;
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(_, _, _))
- .WillOnce(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl->CheckPersistenceFilesForResumption(app_mock));
+ EXPECT_TRUE(res_ctrl_->CheckPersistenceFilesForResumption(app_mock_));
}
// TODO (VVeremjova) APPLINK-16718
TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) {
- EXPECT_CALL(*mock_storage, OnSuspend());
- res_ctrl->OnSuspend();
+ EXPECT_CALL(*mock_storage_, IncrementIgnOffCount());
+ res_ctrl_->OnSuspend();
+}
+
+TEST_F(ResumeCtrlTest, OnSuspend_EmptyApplicationlist) {
+ utils::SharedPtr<application_manager::Application> mock_app =
+ ::utils::MakeShared<application_manager_test::MockApplication>();
+
+ application_manager::ApplicationSet app_set;
+
+ DataAccessor<application_manager::ApplicationSet> accessor(app_set,
+ app_set_lock_);
+
+ ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
+ EXPECT_CALL(*mock_storage_, SaveApplication(mock_app)).Times(0);
+
+ EXPECT_CALL(*mock_storage_, IncrementIgnOffCount()).Times(0);
+ EXPECT_CALL(*mock_storage_, Persist());
+ res_ctrl_->OnSuspend();
}
TEST_F(ResumeCtrlTest, OnAwake) {
@@ -764,15 +909,16 @@ TEST_F(ResumeCtrlTest, OnAwake) {
EXPECT_CALL(mock_application_manager_settings_,
app_resumption_save_persistent_data_timeout())
.WillOnce(ReturnRef(timeout));
- EXPECT_CALL(*mock_storage, OnAwake());
- res_ctrl->OnAwake();
+ EXPECT_CALL(*mock_storage_, DecrementIgnOffCount()).Times(0);
+ res_ctrl_->OnAwake();
}
TEST_F(ResumeCtrlTest, RemoveApplicationFromSaved) {
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, RemoveApplicationFromSaved(_, _))
+ EXPECT_CALL(*mock_storage_,
+ RemoveApplicationFromSaved(kTestPolicyAppId_, kMacAddress_))
.WillOnce(Return(true));
- EXPECT_TRUE(res_ctrl->RemoveApplicationFromSaved(app_mock));
+ EXPECT_TRUE(res_ctrl_->RemoveApplicationFromSaved(app_mock_));
}
TEST_F(ResumeCtrlTest, CheckApplicationkHash_) {
@@ -780,18 +926,18 @@ TEST_F(ResumeCtrlTest, CheckApplicationkHash_) {
saved_app[application_manager::strings::hash_id] = kHash_;
GetInfoFromApp();
- EXPECT_CALL(*mock_storage, GetSavedApplication(kTestPolicyAppId_, _, _))
- .WillRepeatedly(DoAll(SetArgReferee<2>(saved_app), Return(true)));
- EXPECT_TRUE(res_ctrl->CheckApplicationHash(app_mock, kHash_));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetArgReferee<2>(saved_app), Return(true)));
+ EXPECT_TRUE(res_ctrl_->CheckApplicationHash(app_mock_, kHash_));
}
TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_NoAskedApp_INVALID_ENUM) {
- const std::string app_id = "test_app_id";
- const std::string device_id = "test_device_id";
- EXPECT_CALL(*mock_storage, GetSavedApplication(app_id, device_id, _))
- .WillOnce(Return(false));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(Return(false));
EXPECT_EQ(mobile_apis::HMILevel::INVALID_ENUM,
- res_ctrl->GetSavedAppHmiLevel(app_id, device_id));
+ res_ctrl_->GetSavedAppHmiLevel(kTestPolicyAppId_, kMacAddress_));
}
ACTION_P(SetHmiLevel, hmi_level) {
@@ -799,14 +945,14 @@ ACTION_P(SetHmiLevel, hmi_level) {
}
TEST_F(ResumeCtrlTest, GetSavedAppHmiLevel_AskedAppFound_INVALID_ENUM) {
- const std::string app_id = "test_app_id";
- const std::string device_id = "test_device_id";
const mobile_apis::HMILevel::eType hmi_level =
mobile_apis::HMILevel::HMI_FULL;
- EXPECT_CALL(*mock_storage, GetSavedApplication(app_id, device_id, _))
- .WillOnce(DoAll(SetHmiLevel(hmi_level), Return(true)));
- EXPECT_EQ(hmi_level, res_ctrl->GetSavedAppHmiLevel(app_id, device_id));
+ ON_CALL(*mock_storage_,
+ GetSavedApplication(kTestPolicyAppId_, kMacAddress_, _))
+ .WillByDefault(DoAll(SetHmiLevel(hmi_level), Return(true)));
+ EXPECT_EQ(hmi_level,
+ res_ctrl_->GetSavedAppHmiLevel(kTestPolicyAppId_, kMacAddress_));
}
} // namespace resumption_test
diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
index 2fc1e5e5ec..001e06ca58 100644
--- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc
@@ -36,8 +36,8 @@
#include "application_manager/mock_application.h"
#include "application_manager/mock_application_manager_settings.h"
#include "interfaces/MOBILE_API.h"
-#include "sql_database.h"
-#include "sql_query.h"
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
#include "utils/make_shared.h"
#include "utils/file_system.h"
#include "application_manager/resumption_data_test.h"
@@ -165,7 +165,7 @@ class ResumptionDataDBTest : public ResumptionDataTest {
"DELETE FROM `applicationCommandsArray`; "
"DELETE FROM `applicationFilesArray`; "
"DELETE FROM `applicationSubMenuArray`; "
- "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `applicationSubscriptionsArray`; "
"DELETE FROM `_internal_data`; ";
private:
@@ -728,7 +728,7 @@ TEST_F(ResumptionDataDBTest, OnSuspend) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
}
@@ -740,18 +740,18 @@ TEST_F(ResumptionDataDBTest, OnSuspendFourTimes) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(-1, result);
@@ -765,11 +765,11 @@ TEST_F(ResumptionDataDBTest, OnSuspendOnAwake) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
}
@@ -782,7 +782,7 @@ TEST_F(ResumptionDataDBTest, Awake_AppNotSuspended) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
}
@@ -795,12 +795,12 @@ TEST_F(ResumptionDataDBTest, TwiceAwake_AppNotSuspended) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
- res_db()->OnAwake();
+ res_db()->IncrementIgnOffCount();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
CheckSavedDB();
}
@@ -826,14 +826,14 @@ TEST_F(ResumptionDataDBTest, GetIgnOffTime_AfterSuspendAndAwake) {
last_ign_off_time = res_db()->GetIgnOffTime();
EXPECT_EQ(0u, last_ign_off_time);
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
uint32_t after_suspend;
after_suspend = res_db()->GetIgnOffTime();
EXPECT_LE(last_ign_off_time, after_suspend);
uint32_t after_awake;
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
after_awake = res_db()->GetIgnOffTime();
EXPECT_LE(after_suspend, after_awake);
@@ -848,7 +848,7 @@ TEST_F(ResumptionDataDBTest, DropAppResumptionData) {
EXPECT_TRUE(res_db()->DropAppDataResumption(kMacAddress_, policy_app_id_));
- am::smart_objects::SmartObject app;
+ smart_objects::SmartObject app;
EXPECT_TRUE(res_db()->GetSavedApplication(policy_app_id_, kMacAddress_, app));
EXPECT_TRUE(app.keyExists(am::strings::application_commands) &&
@@ -863,8 +863,8 @@ TEST_F(ResumptionDataDBTest, DropAppResumptionData) {
EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
app[am::strings::application_global_properties].empty());
- EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
- app[am::strings::application_subscribtions].empty());
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscriptions) &&
+ app[am::strings::application_subscriptions].empty());
EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
app[am::strings::application_files].empty());
diff --git a/src/components/application_manager/test/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
index 0f51d29e0e..a38afd8bdf 100644
--- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
#include "application_manager/mock_application.h"
#include "application_manager/mock_resumption_data.h"
#include "interfaces/MOBILE_API.h"
-#include "resumption/last_state.h"
+#include "resumption/last_state_impl.h"
#include "application_manager/resumption_data_test.h"
#include "formatters/CFormatterJsonBase.h"
@@ -81,7 +81,7 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
}
void CheckSavedJson() {
- Value& dictionary = last_state_.dictionary;
+ Value& dictionary = last_state_.get_dictionary();
ASSERT_TRUE(dictionary[am::strings::resumption].isObject());
ASSERT_TRUE(
dictionary[am::strings::resumption][am::strings::resume_app_list]
@@ -97,13 +97,13 @@ class ResumptionDataJsonTest : public ResumptionDataTest {
}
void SetZeroIgnOff() {
- Value& dictionary = last_state_.dictionary;
+ Value& dictionary = last_state_.get_dictionary();
Value& res = dictionary[am::strings::resumption];
res[am::strings::last_ign_off_time] = 0;
- last_state_.SaveToFileSystem();
+ last_state_.SaveStateToFileSystem();
}
- resumption::LastState last_state_;
+ resumption::LastStateImpl last_state_;
ResumptionDataJson res_json;
};
@@ -257,7 +257,7 @@ TEST_F(ResumptionDataJsonTest, OnSuspend) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
}
@@ -268,13 +268,13 @@ TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
- res_json.OnSuspend();
- res_json.OnSuspend();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
+ res_json.IncrementIgnOffCount();
+ res_json.IncrementIgnOffCount();
EXPECT_TRUE(-1 != res_json.IsApplicationSaved(policy_app_id_, kMacAddress_));
}
@@ -285,11 +285,11 @@ TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
}
@@ -300,7 +300,7 @@ TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
}
@@ -311,12 +311,12 @@ TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
- res_json.OnAwake();
+ res_json.IncrementIgnOffCount();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
CheckSavedJson();
}
@@ -339,14 +339,14 @@ TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
last_ign_off_time = res_json.GetIgnOffTime();
EXPECT_EQ(0u, last_ign_off_time);
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
uint32_t after_suspend;
after_suspend = res_json.GetIgnOffTime();
EXPECT_LE(last_ign_off_time, after_suspend);
uint32_t after_awake;
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
after_awake = res_json.GetIgnOffTime();
EXPECT_LE(after_suspend, after_awake);
@@ -375,8 +375,8 @@ TEST_F(ResumptionDataJsonTest, DropAppDataResumption) {
EXPECT_TRUE(app.keyExists(am::strings::application_global_properties) &&
app[am::strings::application_global_properties].empty());
- EXPECT_TRUE(app.keyExists(am::strings::application_subscribtions) &&
- app[am::strings::application_subscribtions].empty());
+ EXPECT_TRUE(app.keyExists(am::strings::application_subscriptions) &&
+ app[am::strings::application_subscriptions].empty());
EXPECT_TRUE(app.keyExists(am::strings::application_files) &&
app[am::strings::application_files].empty());
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index 8070244bf2..65e01b6119 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -35,7 +35,7 @@
#include "gtest/gtest.h"
#include "application_manager/usage_statistics.h"
-#include "application_manager/resumption_data_mock.h"
+#include "application_manager/mock_resumption_data.h"
#include "utils/custom_string.h"
#include "application_manager/application.h"
#include "utils/data_accessor.h"
@@ -72,7 +72,7 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) {
CheckGlobalProporties(
resume_app_list[am::strings::application_global_properties]);
- CheckSubscriptions(resume_app_list[am::strings::application_subscribtions]);
+ CheckSubscriptions(resume_app_list[am::strings::application_subscriptions]);
}
void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) {
@@ -539,8 +539,8 @@ void ResumptionDataTest::SetKeyboardProperties() {
void ResumptionDataTest::SetSubscriptions() {
btn_subscr.insert(ButtonName::eType::CUSTOM_BUTTON);
btn_subscr.insert(ButtonName::eType::OK);
- ivi.insert(0);
- ivi.insert(5);
+ ivi.insert(static_cast<mobile_apis::VehicleDataType::eType>(0));
+ ivi.insert(static_cast<mobile_apis::VehicleDataType::eType>(5));
}
} // namespace resumption_test
diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc
index 08fa0a3eb5..28a3383086 100644
--- a/src/components/application_manager/test/resumption_sql_queries_test.cc
+++ b/src/components/application_manager/test/resumption_sql_queries_test.cc
@@ -79,7 +79,7 @@ const string kDeleteData =
"DELETE FROM `applicationCommandsArray`; "
"DELETE FROM `applicationFilesArray`; "
"DELETE FROM `applicationSubMenuArray`; "
- "DELETE FROM `applicationSubscribtionsArray`; "
+ "DELETE FROM `applicationSubscriptionsArray`; "
"DELETE FROM `_internal_data`; "
"COMMIT; "
"VACUUM;";
@@ -326,7 +326,7 @@ class ResumptionSqlQueriesTest : public ::testing::Test {
db_schema.push_back("applicationCommandsArray");
db_schema.push_back("applicationFilesArray");
db_schema.push_back("applicationSubMenuArray");
- db_schema.push_back("applicationSubscribtionsArray");
+ db_schema.push_back("applicationSubscriptionsArray");
db_schema.push_back("_internal_data");
std::sort(db_schema.begin(), db_schema.end());
}
@@ -1386,7 +1386,7 @@ TEST_F(ResumptionSqlQueriesTest,
}
TEST_F(ResumptionSqlQueriesTest,
- kDeleteApplicationSubscribtionsArray_ExpectDataDeleted) {
+ kDeleteApplicationSubscriptionsArray_ExpectDataDeleted) {
// Arrange
SQLQuery temp_query(db());
int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId();
@@ -1410,12 +1410,12 @@ TEST_F(ResumptionSqlQueriesTest,
key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId();
FillAppSubscriptionsArrayTable(temp_query, 7, 2, key1);
// Check
- const std::string select_count_applicationSubscribtionsArray =
- "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
+ const std::string select_count_applicationSubscriptionsArray =
+ "SELECT COUNT(*) FROM applicationSubscriptionsArray;";
ValToPosPair p1(0, app_id2);
ValToPosPair p2(1, device_id);
- CheckDeleteQuery(select_count_applicationSubscribtionsArray,
- kDeleteApplicationSubscribtionsArray,
+ CheckDeleteQuery(select_count_applicationSubscriptionsArray,
+ kDeleteApplicationSubscriptionsArray,
p1,
p2,
1,
@@ -2211,17 +2211,17 @@ TEST_F(ResumptionSqlQueriesTest, kInsertSubscriptions_ExpectDataInserted) {
SQLQuery temp_query(db());
FillAppSubscriptionsArrayTable(temp_query, 2, 3, 4);
// Checks
- const std::string select_count_applicationSubscribtionsArray =
- "SELECT COUNT(*) FROM applicationSubscribtionsArray;";
- CheckSelectQuery(select_count_applicationSubscribtionsArray, 1, 0);
+ const std::string select_count_applicationSubscriptionsArray =
+ "SELECT COUNT(*) FROM applicationSubscriptionsArray;";
+ CheckSelectQuery(select_count_applicationSubscriptionsArray, 1, 0);
const std::string select_idApplication =
- "SELECT idApplication FROM applicationSubscribtionsArray;";
+ "SELECT idApplication FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_idApplication, 4, 0);
const std::string select_vehicleValue =
- "SELECT vehicleValue FROM applicationSubscribtionsArray;";
+ "SELECT vehicleValue FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_vehicleValue, 2, 0);
const std::string select_ButtonNameValue =
- "SELECT ButtonNameValue FROM applicationSubscribtionsArray;";
+ "SELECT ButtonNameValue FROM applicationSubscriptionsArray;";
CheckSelectQuery(select_ButtonNameValue, 3, 0);
}
diff --git a/src/components/application_manager/test/state_controller/CMakeLists.txt b/src/components/application_manager/test/state_controller/CMakeLists.txt
index 50dd931309..8f1a202055 100644
--- a/src/components/application_manager/test/state_controller/CMakeLists.txt
+++ b/src/components/application_manager/test/state_controller/CMakeLists.txt
@@ -33,6 +33,7 @@ if(BUILD_TESTS)
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/application_manager/test/include
+ ${POLICY_MOCK_INCLUDE_PATH}
)
set(LIBRARIES
@@ -42,7 +43,7 @@ set(LIBRARIES
)
set(SOURCES
- state_controller_test.cc
+ ${COMPONENTS_DIR}/application_manager/test/state_controller/state_controller_test.cc
${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
)
diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc
index f19a0896d1..fe4d1d2ee8 100644
--- a/src/components/application_manager/test/state_controller/state_controller_test.cc
+++ b/src/components/application_manager/test/state_controller/state_controller_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include "connection_handler/mock_connection_handler_settings.h"
#include "connection_handler/connection_handler_impl.h"
#include "transport_manager/mock_transport_manager.h"
-#include "application_manager/statistics_manager_mock.h"
#include "utils/lock.h"
#include "utils/data_accessor.h"
#include "utils/make_shared.h"
@@ -48,6 +47,7 @@
#include "application_manager/smart_object_keys.h"
#include "application_manager/mock_message_helper.h"
#include "policy/mock_policy_settings.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
#include "protocol_handler/mock_session_observer.h"
#include "connection_handler/mock_connection_handler.h"
#include "application_manager/policies/mock_policy_handler_interface.h"
@@ -69,12 +69,15 @@ using ::testing::InSequence;
using ::testing::Truly;
using ::testing::AtLeast;
-static application_manager::MockMessageHelper* message_helper_mock_;
-
namespace test {
namespace components {
namespace state_controller_test {
+namespace constants {
+const uint32_t kCorrID = 314u;
+const uint32_t kHMIAppID = 2718u;
+}
+
struct HmiStatesComparator {
mobile_apis::HMILevel::eType hmi_level_;
mobile_apis::AudioStreamingState::eType audio_streaming_state_;
@@ -130,9 +133,17 @@ class StateControllerImplTest : public ::testing::Test {
: ::testing::Test()
, usage_stat("0",
utils::SharedPtr<usage_statistics::StatisticsManager>(
+ new usage_statistics_test::MockStatisticsManager))
+ , applications_(application_set_, applications_lock_)
+ , message_helper_mock_(
+ *application_manager::MockMessageHelper::message_helper_mock()) {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
+
+ ~StateControllerImplTest() {
+ Mock::VerifyAndClearExpectations(&message_helper_mock_);
+ }
- new state_controller_test::MockStatisticsManager))
- , applications_(application_set_, applications_lock_) {}
NiceMock<application_manager_test::MockApplicationManager> app_manager_mock_;
NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_;
NiceMock<connection_handler_test::MockConnectionHandler>
@@ -191,6 +202,7 @@ class StateControllerImplTest : public ::testing::Test {
mock_connection_handler__settings;
transport_manager_test::MockTransportManager mock_transport_manager;
connection_handler::ConnectionHandlerImpl* conn_handler;
+ application_manager::MockMessageHelper& message_helper_mock_;
am::HmiStatePtr createHmiState(
mobile_apis::HMILevel::eType hmi_level,
@@ -201,7 +213,7 @@ class StateControllerImplTest : public ::testing::Test {
namespace SystemContext = mobile_apis::SystemContext;
am::HmiStatePtr state =
- utils::MakeShared<am::HmiState>(simple_app_id_, app_manager_mock_);
+ utils::MakeShared<am::HmiState>(simple_app_, app_manager_mock_);
state->set_hmi_level(hmi_level);
state->set_audio_streaming_state(aidio_ss);
state->set_system_context(system_context);
@@ -209,6 +221,26 @@ class StateControllerImplTest : public ::testing::Test {
}
/**
+ * @brief Template created for the future if different hmi
+ * states are needed.
+ */
+ template <class HmiStateType>
+ am::HmiStatePtr CreateHmiStateByHmiStateType(
+ const mobile_apis::HMILevel::eType hmi_level,
+ const mobile_apis::AudioStreamingState::eType audio_ss,
+ const mobile_apis::SystemContext::eType system_context,
+ const am::ApplicationSharedPtr app) {
+ am::HmiStatePtr new_state =
+ utils::MakeShared<HmiStateType>(app, app_manager_mock_);
+
+ new_state->set_hmi_level(hmi_level);
+ new_state->set_audio_streaming_state(audio_ss);
+ new_state->set_system_context(system_context);
+
+ return new_state;
+ }
+
+ /**
* @brief Prepare list of resultant HMI states for testing HMIState
* @param result_hmi state will contain resultant HMI states.
*/
@@ -455,7 +487,7 @@ class StateControllerImplTest : public ::testing::Test {
ApplicationType AppType(uint32_t app_id) {
// TODO(AOleynik): Currently there is ongoing discussion regarding mixed
// application properties, i.e. is_media_application flag from RAI and
- // AppHMITypes (NAVIGATION, etc.). Most likely logic should be changed
+ // AppHmiTypes (NAVIGATION, etc.). Most likely logic should be changed
// after conclusion on APPLINK-20231
std::vector<am::ApplicationSharedPtr>::iterator app = std::find_if(
applications_list_.begin(),
@@ -559,9 +591,9 @@ class StateControllerImplTest : public ::testing::Test {
app_type = AppType(app_id);
app = (*it_begin);
am::HmiStatePtr state_first =
- utils::MakeShared<T>(app_id, app_manager_mock_);
+ utils::MakeShared<T>(app, app_manager_mock_);
am::HmiStatePtr state_second =
- utils::MakeShared<Q>(app_id, app_manager_mock_);
+ utils::MakeShared<Q>(app, app_manager_mock_);
TestSetSeveralState(
app, state_first, state_second, app_type, call_back_result);
TestSetSeveralState(
@@ -600,8 +632,6 @@ class StateControllerImplTest : public ::testing::Test {
namespace AudioStreamingState = mobile_apis::AudioStreamingState;
namespace SystemContext = mobile_apis::SystemContext;
// Valid states for not audio app
- message_helper_mock_ =
- application_manager::MockMessageHelper::message_helper_mock();
valid_states_for_not_audio_app_.push_back(
createHmiState(HMILevel::HMI_NONE,
AudioStreamingState::NOT_AUDIBLE,
@@ -867,7 +897,7 @@ class StateControllerImplTest : public ::testing::Test {
new smart_objects::SmartObject();
(*bc_activate_app_request)[am::strings::params]
[am::strings::correlation_id] = corr_id;
- ON_CALL(*message_helper_mock_,
+ ON_CALL(message_helper_mock_,
GetBCActivateAppRequestToHMI(_, _, _, hmi_lvl, _, _))
.WillByDefault(Return(bc_activate_app_request));
@@ -951,6 +981,64 @@ class StateControllerImplTest : public ::testing::Test {
mobile_apis::SystemContext::SYSCTXT_MAIN);
}
+ void ApplyTempStatesForApplication(
+ NiceMock<application_manager_test::MockApplication>& 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 (size_t i = 0; i < state_ids.size(); ++i) {
+ am::HmiState::StateID state_id = state_ids[i];
+ EXPECT_CALL(application,
+ AddHMIState(Truly(HmiStatesIDComparator(state_id))));
+ 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_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] =
+ true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+ 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_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] =
+ true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::EMERGENCY_EVENT;
+ 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);
+ }
+ }
+
void CheckStateApplyingForApplication(
NiceMock<application_manager_test::MockApplication>& application,
std::vector<am::HmiState::StateID>& state_ids) {
@@ -1213,7 +1301,7 @@ TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) {
// Audio resume app when HMI level is LIMITED or FULL gets audible state
if (state_to_setup->hmi_level() == HMILevel::HMI_LIMITED) {
EXPECT_CALL(*audio_app_mock, is_resuming()).WillRepeatedly(Return(true));
- EXPECT_CALL(*message_helper_mock_,
+ EXPECT_CALL(message_helper_mock_,
SendOnResumeAudioSourceToHMI(media_navi_vc_app_id_, _));
state_to_check->set_audio_streaming_state(AudioStreamingState::AUDIBLE);
@@ -1741,7 +1829,7 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) {
for (; it != hmi_states.end(); ++it) {
am::HmiStatePtr hmi_state = it->first;
- am::HmiStatePtr initial_hmi_state = it->first;
+ am::HmiStatePtr initial_hmi_state = it2->first;
Common_HMILevel::eType hmi_level = it->second;
SetBCActivateAppRequestToHMI(hmi_level, corr_id);
@@ -1893,8 +1981,8 @@ TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviVCApp) {
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
- am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
- simple_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_phone_call =
+ utils::MakeShared<am::PhoneCallHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_phone_call,
APP_TYPE_NON_MEDIA,
@@ -1902,8 +1990,8 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) {
}
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
- am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
- media_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_phone_call =
+ utils::MakeShared<am::PhoneCallHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_phone_call,
APP_TYPE_MEDIA,
@@ -1912,7 +2000,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) {
TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
am::HmiStatePtr state_phone_call = utils::MakeShared<am::PhoneCallHmiState>(
- media_navi_app_id_, app_manager_mock_);
+ media_navi_app_, app_manager_mock_);
TestSetState(media_navi_app_,
state_phone_call,
APP_TYPE_NAVI,
@@ -1921,7 +2009,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) {
TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(simple_app_id_, app_manager_mock_);
+ utils::MakeShared<am::VRHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_vr,
APP_TYPE_NON_MEDIA,
@@ -1930,7 +2018,7 @@ TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
am::HmiStatePtr state_vr =
- utils::MakeShared<am::VRHmiState>(media_app_id_, app_manager_mock_);
+ utils::MakeShared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -1938,8 +2026,8 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) {
}
TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
- am::HmiStatePtr state_vr = utils::MakeShared<am::VRHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_vr =
+ utils::MakeShared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_vr,
APP_TYPE_MEDIA,
@@ -1949,7 +2037,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) {
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_id_, app_manager_mock_);
+ utils::MakeShared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(simple_app_,
@@ -1961,7 +2049,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForNonMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(simple_app_id_, app_manager_mock_);
+ utils::MakeShared<am::TTSHmiState>(simple_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(simple_app_,
@@ -1973,7 +2061,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_id_, app_manager_mock_);
+ utils::MakeShared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_app_,
@@ -1985,7 +2073,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_tts =
- utils::MakeShared<am::TTSHmiState>(media_app_id_, app_manager_mock_);
+ utils::MakeShared<am::TTSHmiState>(media_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_app_,
@@ -1996,8 +2084,8 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedNotSupported) {
- am::HmiStatePtr state_tts = utils::MakeShared<am::TTSHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_tts =
+ utils::MakeShared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(media_navi_vc_app_,
@@ -2008,8 +2096,8 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetTTSStateForMediaNaviVCApplicationAttenuatedSupported) {
- am::HmiStatePtr state_tts = utils::MakeShared<am::TTSHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_tts =
+ utils::MakeShared<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(media_navi_vc_app_,
@@ -2020,7 +2108,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(simple_app_id_,
+ utils::MakeShared<am::NaviStreamingHmiState>(simple_app_,
app_manager_mock_);
TestSetState(simple_app_,
state_navi_streming,
@@ -2031,7 +2119,7 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) {
TEST_F(StateControllerImplTest,
SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_app_id_,
+ utils::MakeShared<am::NaviStreamingHmiState>(media_app_,
app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
@@ -2044,7 +2132,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetNaviStreamingStateMediaApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_app_id_,
+ utils::MakeShared<am::NaviStreamingHmiState>(media_app_,
app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
@@ -2057,8 +2145,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetNaviStreamingStateVCApplicationAttenuatedNotSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(vc_app_id_,
- app_manager_mock_);
+ utils::MakeShared<am::NaviStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(false));
TestSetState(vc_app_,
@@ -2070,8 +2157,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest,
SetNaviStreamingStateVCApplicationAttenuatedSupported) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(vc_app_id_,
- app_manager_mock_);
+ utils::MakeShared<am::NaviStreamingHmiState>(vc_app_, app_manager_mock_);
EXPECT_CALL(app_manager_mock_, is_attenuated_supported())
.WillRepeatedly(Return(true));
TestSetState(vc_app_,
@@ -2082,7 +2168,7 @@ TEST_F(StateControllerImplTest,
TEST_F(StateControllerImplTest, SetNaviStreamingStateNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(navi_app_id_,
+ utils::MakeShared<am::NaviStreamingHmiState>(navi_app_,
app_manager_mock_);
TestSetState(navi_app_,
state_navi_streming,
@@ -2092,7 +2178,7 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateNaviApplication) {
TEST_F(StateControllerImplTest, SetNaviStreamingStateMediaNaviApplication) {
am::HmiStatePtr state_navi_streming =
- utils::MakeShared<am::NaviStreamingHmiState>(media_navi_app_id_,
+ utils::MakeShared<am::NaviStreamingHmiState>(media_navi_app_,
app_manager_mock_);
TestSetState(media_navi_app_,
state_navi_streming,
@@ -2101,8 +2187,8 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateMediaNaviApplication) {
}
TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
- am::HmiStatePtr state_safety_mode = utils::MakeShared<am::SafetyModeHmiState>(
- simple_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_safety_mode =
+ utils::MakeShared<am::SafetyModeHmiState>(simple_app_, app_manager_mock_);
TestSetState(simple_app_,
state_safety_mode,
APP_TYPE_NON_MEDIA,
@@ -2111,7 +2197,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) {
TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
am::HmiStatePtr state_safety_mode =
- utils::MakeShared<am::VRHmiState>(media_app_id_, app_manager_mock_);
+ utils::MakeShared<am::VRHmiState>(media_app_, app_manager_mock_);
TestSetState(media_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2120,8 +2206,8 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) {
TEST_F(StateControllerImplTest,
SetSafetyModeStateForMediaNaviVoiceApplication) {
- am::HmiStatePtr state_safety_mode = utils::MakeShared<am::VRHmiState>(
- media_navi_vc_app_id_, app_manager_mock_);
+ am::HmiStatePtr state_safety_mode =
+ utils::MakeShared<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_);
TestSetState(media_navi_vc_app_,
state_safety_mode,
APP_TYPE_MEDIA,
@@ -2372,7 +2458,7 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
EXPECT_CALL(*simple_app_ptr_, is_resuming()).WillRepeatedly(Return(false));
- EXPECT_CALL(*message_helper_mock_,
+ EXPECT_CALL(message_helper_mock_,
SendOnResumeAudioSourceToHMI(simple_app_id_, _)).Times(0);
EXPECT_CALL(*simple_app_ptr_,
SetPostponedState(Truly(HmiStatesComparator(check_state))))
@@ -2390,7 +2476,7 @@ TEST_F(StateControllerImplTest, SetRegularStateMediaToNonMediaApp_VR_Stopped) {
EXPECT_CALL(*media_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
- EXPECT_CALL(*message_helper_mock_,
+ EXPECT_CALL(message_helper_mock_,
SendOnResumeAudioSourceToHMI(media_app_id_, _));
EXPECT_CALL(*media_app_ptr_,
SetPostponedState(Truly(HmiStatesComparator(check_state))))
@@ -2478,6 +2564,424 @@ TEST_F(StateControllerImplTest,
state_ctrl_->SetRegularState(media_app_, check_state, false);
}
+TEST_F(StateControllerImplTest,
+ SetStateForNaviApp_BCOnPhoneCall_SetPostponedState) {
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ using namespace am::event_engine;
+
+ // Precondition
+ Event event(FunctionID::BasicCommunication_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+
+ event.set_smart_object(message);
+ state_ctrl_->on_event(event);
+
+ am::HmiStatePtr hmi_state = FullAudibleState();
+
+ EXPECT_CALL(*navi_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*navi_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(hmi_state));
+
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+
+ state_ctrl_->SetRegularState(navi_app_, hmi_state, false);
+}
+
+TEST_F(StateControllerImplTest,
+ SetStateForNaviApp_BCOnPhoneCall_NotPostponedState) {
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ using namespace am::event_engine;
+
+ // Precondition
+ Event event(FunctionID::BasicCommunication_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = false;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+
+ event.set_smart_object(message);
+ state_ctrl_->on_event(event);
+
+ am::HmiStatePtr hmi_state = FullAudibleState();
+
+ EXPECT_CALL(*navi_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*navi_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+
+ EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(hmi_state));
+
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+
+ EXPECT_CALL(*navi_app_ptr_, SetPostponedState(_)).Times(0);
+
+ state_ctrl_->SetRegularState(navi_app_, hmi_state, false);
+}
+
+TEST_F(StateControllerImplTest,
+ SetStateForNaviApp_BCOnPhoneCall_SetPostponedStateWithActivation) {
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ using namespace am::event_engine;
+ using namespace constants;
+
+ const uint32_t app_id = navi_app_->app_id();
+ // Precondition
+ Event event(FunctionID::BasicCommunication_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = true;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+
+ event.set_smart_object(message);
+ state_ctrl_->on_event(event);
+
+ am::HmiStatePtr hmi_state = FullAudibleState();
+
+ EXPECT_CALL(*navi_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*navi_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*navi_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
+
+ SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID);
+
+ EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(hmi_state));
+
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+
+ state_ctrl_->SetRegularState(navi_app_, hmi_state, true);
+}
+
+TEST_F(StateControllerImplTest,
+ SetStateForNaviApp_BCOnPhoneCall_NotPostponedStateWithActivation) {
+ using namespace hmi_apis;
+ using namespace smart_objects;
+ using namespace am::event_engine;
+ using namespace constants;
+
+ const uint32_t app_id = navi_app_->app_id();
+ // Precondition
+ Event event(FunctionID::BasicCommunication_OnEventChanged);
+ SmartObject message;
+ message[am::strings::msg_params][am::hmi_notification::is_active] = false;
+ message[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+
+ event.set_smart_object(message);
+ state_ctrl_->on_event(event);
+
+ am::HmiStatePtr hmi_state = FullAudibleState();
+
+ EXPECT_CALL(*navi_app_ptr_, is_resuming()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*navi_app_ptr_, is_navi()).WillRepeatedly(Return(true));
+ EXPECT_CALL(*navi_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
+
+ SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID);
+
+ EXPECT_CALL(app_manager_mock_, IsAppTypeExistsInFullOrLimited(_))
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*navi_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(hmi_state));
+
+ EXPECT_CALL(app_manager_mock_, active_application())
+ .WillRepeatedly(Return(am::ApplicationSharedPtr()));
+
+ EXPECT_CALL(*navi_app_ptr_, SetPostponedState(_)).Times(0);
+
+ state_ctrl_->SetRegularState(navi_app_, hmi_state, true);
+}
+
+TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectHmiLevel) {
+ smart_objects::SmartObject msg;
+ const uint32_t app_id = simple_app_->app_id();
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+ EXPECT_CALL(app_manager_mock_, application(app_id))
+ .WillOnce(Return(simple_app_));
+ EXPECT_CALL(*simple_app_ptr_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_BACKGROUND));
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).Times(0);
+ state_ctrl_->on_event(event);
+}
+
+TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedIncorrectApp) {
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = 0;
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+ const am::ApplicationSharedPtr incorrect_app;
+ EXPECT_CALL(app_manager_mock_, application(_))
+ .WillOnce(Return(incorrect_app));
+ EXPECT_CALL(*simple_app_ptr_, hmi_level()).Times(0);
+ state_ctrl_->on_event(event);
+}
+
+TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedAudioApplication) {
+ const uint32_t app_id = simple_app_->app_id();
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_LIMITED,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ // OnAppDeactivated
+ EXPECT_CALL(app_manager_mock_, application(app_id))
+ .WillOnce(Return(simple_app_));
+ EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
+ EXPECT_CALL(*simple_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ // DeactivateApp
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(BackgroundState()))
+ .WillOnce(Return(BackgroundState()));
+ state_ctrl_->on_event(event);
+}
+
+TEST_F(StateControllerImplTest, OnEventOnAppDeactivatedNotAudioApplication) {
+ const uint32_t app_id = simple_app_->app_id();
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+ const HmiStatePtr state =
+ createHmiState(mobile_apis::HMILevel::HMI_BACKGROUND,
+ mobile_apis::AudioStreamingState::NOT_AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ // OnAppDeactivated
+ EXPECT_CALL(app_manager_mock_, application(app_id))
+ .WillOnce(Return(simple_app_));
+ EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
+ EXPECT_CALL(*simple_app_ptr_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ // DeactivateApp
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(state));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(false));
+
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillOnce(Return(BackgroundState()))
+ .WillOnce(Return(BackgroundState()));
+ state_ctrl_->on_event(event);
+}
+
+TEST_F(StateControllerImplTest, OnEventOnAppActivatedIncorrectApp) {
+ smart_objects::SmartObject msg;
+ const uint32_t incorrect_app_ID = 0;
+ msg[am::strings::msg_params][am::strings::app_id] = incorrect_app_ID;
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+ const am::ApplicationSharedPtr incorrect_app;
+ EXPECT_CALL(app_manager_mock_, application(_))
+ .WillOnce(Return(incorrect_app));
+ EXPECT_CALL(*simple_app_ptr_, app_id()).Times(0);
+ state_ctrl_->on_event(event);
+}
+
+TEST_F(StateControllerImplTest, OnEventOnAppActivated) {
+ using namespace constants;
+
+ smart_objects::SmartObject msg;
+ for (std::vector<am::ApplicationSharedPtr>::const_iterator it =
+ applications_list_.begin();
+ it != applications_list_.end();
+ ++it) {
+ uint32_t app_id = (*it)->app_id();
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+
+ EXPECT_CALL(app_manager_mock_, application(app_id)).WillOnce(Return(*it));
+ // SetRegularState
+ EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
+ EXPECT_CALL(*simple_app_ptr_, IsAudioApplication())
+ .WillRepeatedly(Return(true));
+
+ smart_objects::SmartObjectSPtr activate_app =
+ utils::MakeShared<smart_objects::SmartObject>();
+ (*activate_app)[am::strings::params][am::strings::correlation_id] = kCorrID;
+ SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID);
+ state_ctrl_->on_event(event);
+ }
+}
+
+TEST_F(StateControllerImplTest, IsStateActive) {
+ HmiStatePtr state = createHmiState(mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN);
+ state->set_state_id(HmiState::STATE_ID_CURRENT);
+ EXPECT_TRUE(state_ctrl_->IsStateActive(state->state_id()));
+ state->set_state_id(HmiState::STATE_ID_REGULAR);
+ EXPECT_TRUE(state_ctrl_->IsStateActive(state->state_id()));
+ state->set_state_id(HmiState::STATE_ID_TTS_SESSION);
+ EXPECT_FALSE(state_ctrl_->IsStateActive(state->state_id()));
+}
+
+TEST_F(StateControllerImplTest, IsStateActiveApplyCorrectTempStates) {
+ InsertApplication(simple_app_);
+ ApplyTempStatesForApplication(*simple_app_ptr_, valid_state_ids_);
+ std::vector<am::HmiState::StateID>::const_iterator it =
+ valid_state_ids_.begin();
+ for (; it != valid_state_ids_.end(); ++it) {
+ EXPECT_TRUE(state_ctrl_->IsStateActive(*it));
+ }
+}
+
+TEST_F(StateControllerImplTest, IsStateActiveApplyNotCorrectTempStates) {
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+ const hmi_apis::FunctionID::eType event_id = hmi_apis::FunctionID::VR_Started;
+ am::event_engine::Event event(event_id);
+ event.set_smart_object(msg);
+ state_ctrl_->on_event(event);
+ EXPECT_FALSE(state_ctrl_->IsStateActive(HmiState::STATE_ID_AUDIO_SOURCE));
+}
+
+TEST_F(StateControllerImplTest, OnApplicationRegisteredDifferentStates) {
+ const uint32_t app_id = simple_app_->app_id();
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+ event.set_smart_object(msg);
+ state_ctrl_->on_event(event);
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+ event.set_smart_object(msg);
+ state_ctrl_->on_event(event);
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::DEACTIVATE_HMI;
+ event.set_smart_object(msg);
+ state_ctrl_->on_event(event);
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::EMBEDDED_NAVI;
+ event.set_smart_object(msg);
+ state_ctrl_->on_event(event);
+
+ const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
+ mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN,
+ simple_app_);
+
+ EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(old_state));
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_)).Times(4);
+
+ const am::HmiStatePtr default_state =
+ CreateHmiStateByHmiStateType<am::HmiState>(
+ mobile_apis::HMILevel::HMI_BACKGROUND,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN,
+ simple_app_);
+
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState()).WillOnce(Return(old_state));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(default_state));
+
+ EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_));
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _));
+
+ state_ctrl_->OnApplicationRegistered(simple_app_,
+ mobile_apis::HMILevel::HMI_BACKGROUND);
+}
+
+TEST_F(StateControllerImplTest, OnApplicationRegisteredEqualStates) {
+ const uint32_t app_id = simple_app_->app_id();
+ smart_objects::SmartObject msg;
+ msg[am::strings::msg_params][am::strings::app_id] = app_id;
+ msg[am::strings::msg_params][am::hmi_notification::is_active] = true;
+
+ const hmi_apis::FunctionID::eType event_id =
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged;
+ am::event_engine::Event event(event_id);
+
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::AUDIO_SOURCE;
+ event.set_smart_object(msg);
+ state_ctrl_->on_event(event);
+ msg[am::strings::msg_params][am::hmi_notification::event_name] =
+ hmi_apis::Common_EventTypes::PHONE_CALL;
+ event.set_smart_object(msg);
+ state_ctrl_->on_event(event);
+
+ const am::HmiStatePtr old_state = CreateHmiStateByHmiStateType<am::HmiState>(
+ mobile_apis::HMILevel::HMI_FULL,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN,
+ simple_app_);
+
+ EXPECT_CALL(*simple_app_ptr_, app_id()).WillRepeatedly(Return(app_id));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(old_state));
+ EXPECT_CALL(*simple_app_ptr_, AddHMIState(_)).Times(2);
+
+ const am::HmiStatePtr default_state =
+ CreateHmiStateByHmiStateType<am::HmiState>(
+ mobile_apis::HMILevel::HMI_BACKGROUND,
+ mobile_apis::AudioStreamingState::AUDIBLE,
+ mobile_apis::SystemContext::SYSCTXT_MAIN,
+ simple_app_);
+ EXPECT_CALL(*simple_app_ptr_, RegularHmiState())
+ .WillOnce(Return(default_state));
+ EXPECT_CALL(*simple_app_ptr_, CurrentHmiState())
+ .WillRepeatedly(Return(default_state));
+
+ EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(0);
+ EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0);
+ EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0);
+
+ state_ctrl_->OnApplicationRegistered(simple_app_,
+ mobile_apis::HMILevel::HMI_BACKGROUND);
+}
+
} // namespace state_controller_test
} // namespace components
} // namespace test
diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc
index b5d1da0992..6efef83052 100644
--- a/src/components/application_manager/test/usage_statistics_test.cc
+++ b/src/components/application_manager/test/usage_statistics_test.cc
@@ -34,8 +34,8 @@
#include <memory>
#include "gmock/gmock.h"
#include "smart_objects/enum_schema_item.h"
-#include "policy/mock_statistics_manager.h"
-#include "mock_app_stopwatch.h"
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "policy/usage_statistics/mock_app_stopwatch.h"
#include "utils/make_shared.h"
#include "utils/shared_ptr.h"
diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc
index 0f52639575..cce0b2abf2 100644
--- a/src/components/application_manager/test/zero_request_amount_test.cc
+++ b/src/components/application_manager/test/zero_request_amount_test.cc
@@ -46,7 +46,7 @@
namespace test {
namespace components {
-namespace application {
+namespace application_manager_test {
using namespace ::profile;
using namespace application_manager::request_controller;
@@ -164,6 +164,6 @@ TEST(RequestControlTest, ZeroValueAppTimeScaleMaxRequests) {
request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL);
}
-} // namespace application
+} // namespace application_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/config_profile/CMakeLists.txt b/src/components/config_profile/CMakeLists.txt
index 107fd58127..4ed382039a 100644
--- a/src/components/config_profile/CMakeLists.txt
+++ b/src/components/config_profile/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,20 +28,27 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
- include
+ ${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/utils/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
${LOG4CXX_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ${COMPONENTS_DIR}/config_profile/src/profile.cc
- ${COMPONENTS_DIR}/config_profile/src/ini_file.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
+set(LIBRARIES
+ Utils
+)
+
+collect_sources(SOURCES "${PATHS}")
add_library("ConfigProfile" ${SOURCES})
-target_link_libraries("ConfigProfile" Utils)
+target_link_libraries("ConfigProfile" ${LIBRARIES})
if(BUILD_TESTS)
add_subdirectory(test)
diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 14983a46b2..61dddf55b0 100644
--- a/src/components/config_profile/include/config_profile/profile.h
+++ b/src/components/config_profile/include/config_profile/profile.h
@@ -110,8 +110,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
/**
* @brief Returns true, if SDL 4.0 is enabled
+ * @deprecated use max_supported_protocol_version instead
*/
- bool enable_protocol_4() const OVERRIDE;
+ DEPRECATED bool enable_protocol_4() const OVERRIDE;
/**
* @brief Returns application icons folder path
@@ -130,6 +131,26 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint32_t& app_icons_amount_to_remove() const OVERRIDE;
/**
+ * @brief Returns the maximum payload size for control services
+ */
+ size_t maximum_control_payload_size() const OVERRIDE;
+
+ /**
+ * @brief Returns the maximum payload size for RPC services
+ */
+ size_t maximum_rpc_payload_size() const OVERRIDE;
+
+ /**
+ * @brief Returns the maximum payload size for audio services
+ */
+ size_t maximum_audio_payload_size() const OVERRIDE;
+
+ /**
+ * @brief Returns the maximum payload size for video services
+ */
+ size_t maximum_video_payload_size() const OVERRIDE;
+
+ /**
* @brief Returns the path to the config file
*/
const std::string& config_file_name() const;
@@ -137,7 +158,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
/**
* @brief Sets the path to the config file
*/
- void config_file_name(const std::string& fileName);
+ void set_config_file_name(const std::string& file_name);
/**
* @brief Returns server address
@@ -155,9 +176,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const uint16_t video_streaming_port() const OVERRIDE;
/**
- * @brief Returns port for audio streaming
- */
- const uint16_t audio_streaming_port() const;
+ * @brief Returns port for audio streaming
+ */
+ const uint16_t audio_streaming_port() const OVERRIDE;
/**
* @brief Returns streaming timeout
@@ -191,6 +212,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::vector<std::string>& vr_commands() const;
/**
+ * @brief Returns folder containing all plugins
+ */
+ const std::string& plugins_folder() const OVERRIDE;
+
+ /**
* @brief Maximum command id available for mobile app
*/
const uint32_t& max_cmd_id() const;
@@ -209,7 +235,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
/**
* @brief Returns desirable thread stack size
*/
- const uint64_t& thread_min_stack_size() const;
+ const uint64_t thread_min_stack_size() const;
/**
* @brief Returns true if audio mixing is supported
@@ -323,7 +349,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
/*
* @brief Returns file name for storing applications data
*/
- const std::string& app_info_storage() const;
+ const std::string& app_info_storage() const OVERRIDE;
/*
* @brief Path to preloaded policy file
@@ -344,10 +370,19 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
// TransportManageSettings interface
+ /*
+ * @brief Returns true if last state singleton is used
+ */
bool use_last_state() const OVERRIDE;
+ /**
+ * @brief Timeout in transport manager before disconnect
+ */
uint32_t transport_manager_disconnect_timeout() const OVERRIDE;
+ /**
+ * @brief Returns port for TCP transport adapter
+ */
uint16_t transport_manager_tcp_adapter_port() const OVERRIDE;
// TransportManageMMESettings interface
@@ -620,11 +655,30 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
*/
const bool enable_app_launch_ios() const OVERRIDE;
- /*
+ /**
+ * @brief Returns the millisecond count before timeout
+ * for transport change feature occures.
+ */
+ uint32_t app_transport_change_timer() const OVERRIDE;
+
+ /**
+ * @brief Returns the millisecond count used as addition
+ * value for transport change timer
+ */
+ uint32_t app_transport_change_timer_addition() const OVERRIDE;
+
+ /**
* @brief Updates all related values from ini file
*/
void UpdateValues();
+ /**
+ * @brief Gets reading result of all related values from ini file
+ * @returns TRUE if no error appeared during updating
+ * otherwise FALSE
+ */
+ const bool ErrorOccured() const;
+
const uint32_t& list_files_response_size() const OVERRIDE;
const std::string& recording_file_source() const OVERRIDE;
@@ -637,8 +691,21 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const OVERRIDE;
+ /**
+ * @brief Returns error description
+ * @return Actual error description if error appears otherwise empty line
+ */
+ const std::string ErrorDescription() const;
+
private:
/**
+ * @brief Checks that filename consists of portable symbols
+ * @param file_name - file name to check
+ * @return FALSE if file name has unportable symbols otherwise TRUE
+ */
+ bool IsFileNamePortable(const std::string& file_name) const;
+
+ /**
* @brief Reads a string value from the profile and interpret it
* as \c true on "true" value or as \c false on any other value
*
@@ -739,10 +806,13 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string app_config_folder_;
std::string app_storage_folder_;
std::string app_resource_folder_;
- bool enable_protocol_4_;
std::string app_icons_folder_;
uint32_t app_icons_folder_max_size_;
uint32_t app_icons_amount_to_remove_;
+ size_t maximum_control_payload_size_;
+ size_t maximum_rpc_payload_size_;
+ size_t maximum_audio_payload_size_;
+ size_t maximum_video_payload_size_;
std::string config_file_name_;
std::string server_address_;
uint16_t server_port_;
@@ -836,6 +906,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
std::string iap_pool_protocol_mask_;
std::string iap_system_config_;
std::string iap2_system_config_;
+ std::string plugins_folder_;
int iap2_hub_connect_attempts_;
int iap_hub_connection_wait_timeout_;
uint16_t tts_global_properties_timeout_;
@@ -855,6 +926,10 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
uint16_t max_number_of_ios_device_;
uint16_t wait_time_between_apps_;
bool enable_app_launch_ios_;
+ uint32_t app_tranport_change_timer_;
+ uint32_t app_tranport_change_timer_addition_;
+ bool error_occured_;
+ std::string error_description_;
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 d6d72060e8..3245b096cb 100644
--- a/src/components/config_profile/src/ini_file.cc
+++ b/src/components/config_profile/src/ini_file.cc
@@ -39,6 +39,8 @@
#include <limits.h>
#include <stdint.h>
+#include "utils/logger.h"
+
#ifndef _WIN32
#include <unistd.h>
#else
@@ -53,6 +55,8 @@
namespace profile {
+CREATE_LOGGERPTR_GLOBAL(logger_, "Profile")
+
char* ini_write_inst(const char* fname, uint8_t flag) {
FILE* fp = 0;
@@ -188,15 +192,18 @@ char ini_write_value(const char* fname,
fd = mkstemp(temp_fname);
if (-1 == fd) {
+ fclose(rd_fp);
return FALSE;
}
wr_fp = fdopen(fd, "w");
if (NULL == wr_fp) {
unlink(temp_fname);
close(fd);
+ fclose(rd_fp);
return FALSE;
}
} else {
+ fclose(rd_fp);
return FALSE;
}
}
@@ -269,9 +276,11 @@ char ini_write_value(const char* fname,
fclose(wr_fp);
fclose(rd_fp);
- remove(fname);
if (0 != rename(temp_fname, fname)) {
- remove(temp_fname);
+ if (0 != remove(temp_fname)) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Unable to remove temp file: " << std::string(temp_fname));
+ }
return FALSE;
}
diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc
index 1a38b77254..4137476d63 100644
--- a/src/components/config_profile/src/profile.cc
+++ b/src/components/config_profile/src/profile.cc
@@ -38,6 +38,8 @@
#include <sstream>
#include <algorithm>
+#include <string>
+
#include "config_profile/ini_file.h"
#include "utils/logger.h"
#include "utils/threads/thread.h"
@@ -83,6 +85,7 @@ const char* kFilesystemRestrictionsSection = "FILESYSTEM RESTRICTIONS";
const char* kIAPSection = "IAP";
const char* kProtocolHandlerSection = "ProtocolHandler";
const char* kSDL4Section = "SDL4";
+const char* kSDL5Section = "SDL5";
const char* kResumptionSection = "Resumption";
const char* kAppLaunchSection = "AppLaunch";
@@ -98,10 +101,13 @@ const char* kAppStorageFolderKey = "AppStorageFolder";
const char* kAppResourseFolderKey = "AppResourceFolder";
const char* kLogsEnabledKey = "LogsEnabled";
const char* kAppConfigFolderKey = "AppConfigFolder";
-const char* kEnableProtocol4Key = "EnableProtocol4";
const char* kAppIconsFolderKey = "AppIconsFolder";
const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize";
const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove";
+const char* kMaximumControlPayloadSizeKey = "MaximumControlPayloadSize";
+const char* kMaximumRpcPayloadSizeKey = "MaximumRpcPayloadSize";
+const char* kMaximumAudioPayloadSizeKey = "MaximumAudioPayloadSize";
+const char* kMaximumVideoPayloadSizeKey = "MaximumVideoPayloadSize";
const char* kLaunchHMIKey = "LaunchHMI";
const char* kDefaultSDLVersion = "";
#ifdef WEB_HMI
@@ -135,6 +141,7 @@ const char* kTimeoutPromptKey = "TimeOutPromt";
const char* kHelpTitleKey = "HelpTitle";
const char* kHelpCommandKey = "HelpCommand";
const char* kSystemFilesPathKey = "SystemFilesPath";
+const char* kPluginsFolderKey = "PluginFolder";
const char* kHeartBeatTimeoutKey = "HeartBeatTimeout";
const char* kMaxSupportedProtocolVersionKey = "MaxSupportedProtocolVersion";
const char* kUseLastStateKey = "UseLastState";
@@ -204,6 +211,9 @@ const char* kRemoveBundleIDattemptsKey = "RemoveBundleIDattempts";
const char* kMaxNumberOfiOSDeviceKey = "MaxNumberOfiOSDevice";
const char* kWaitTimeBetweenAppsKey = "WaitTimeBetweenApps";
const char* kEnableAppLaunchIOSKey = "EnableAppLaunchIOS";
+const char* kAppTransportChangeTimerKey = "AppTransportChangeTimer";
+const char* kAppTransportChangeTimerAdditionKey =
+ "AppTransportChangeTimerAddition";
#ifdef WEB_HMI
const char* kDefaultLinkToWebHMI = "HMI/index.html";
#endif // WEB_HMI
@@ -213,6 +223,7 @@ const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json";
const char* kDefaultServerAddress = "127.0.0.1";
const char* kDefaultAppInfoFileName = "app_info.dat";
const char* kDefaultSystemFilesPath = "/tmp/fs/mp/images/ivsu_cache";
+const char* kDefaultPluginsPath = "plugins";
const char* kDefaultTtsDelimiter = ",";
const uint32_t kDefaultAudioDataStoppedTimeout = 1000;
const uint32_t kDefaultVideoDataStoppedTimeout = 1000;
@@ -236,7 +247,7 @@ const uint32_t kDefaultBeforeUpdateHours = 24;
const uint32_t kDefaultHubProtocolIndex = 0;
const uint32_t kDefaultHeartBeatTimeout = 0;
-const uint16_t kDefaultMaxSupportedProtocolVersion = 3;
+const uint16_t kDefaultMaxSupportedProtocolVersion = 5;
const uint16_t kDefautTransportManagerTCPPort = 12345;
const uint16_t kDefaultServerPort = 8087;
const uint16_t kDefaultVideoStreamingPort = 5050;
@@ -284,6 +295,10 @@ const uint16_t kDefaultOpenAttemptTimeoutMs = 500;
const uint32_t kDefaultAppIconsFolderMaxSize = 104857600;
const uint32_t kDefaultAppIconsAmountToRemove = 1;
const uint16_t kDefaultAttemptsToOpenResumptionDB = 5;
+const size_t kDefaultMaximumControlPayloadSize = 0;
+const size_t kDefaultMaximumRpcPayloadSize = 0;
+const size_t kDefaultMaximumAudioPayloadSize = 0;
+const size_t kDefaultMaximumVideoPayloadSize = 0;
const uint16_t kDefaultOpenAttemptTimeoutMsResumptionDB = 500;
const uint16_t kDefaultAppLaunchWaitTime = 5000;
const uint16_t kDefaultAppLaunchMaxRetryAttempt = 3;
@@ -292,6 +307,10 @@ const uint16_t kDefaultRemoveBundleIDattempts = 3;
const uint16_t kDefaultMaxNumberOfiOSDevice = 10;
const uint16_t kDefaultWaitTimeBetweenApps = 4000;
const bool kDefaultEnableAppLaunchIOS = true;
+const uint32_t kDefaultAppTransportChangeTimer = 500u;
+const uint32_t kDefaultAppTransportChangeTimerAddition = 0u;
+const std::string kAllowedSymbols =
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-";
} // namespace
namespace profile {
@@ -309,15 +328,19 @@ Profile::Profile()
app_config_folder_()
, app_storage_folder_()
, app_resource_folder_()
- , enable_protocol_4_(false)
, app_icons_folder_()
, app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize)
, app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove)
+ , maximum_control_payload_size_(kDefaultMaximumControlPayloadSize)
+ , maximum_rpc_payload_size_(kDefaultMaximumRpcPayloadSize)
+ , maximum_audio_payload_size_(kDefaultMaximumAudioPayloadSize)
+ , maximum_video_payload_size_(kDefaultMaximumVideoPayloadSize)
, config_file_name_(kDefaultConfigFileName)
, server_address_(kDefaultServerAddress)
, server_port_(kDefaultServerPort)
, video_streaming_port_(kDefaultVideoStreamingPort)
, audio_streaming_port_(kDefaultAudioStreamingPort)
+ , stop_streaming_timeout_(kDefaultStopStreamingTimeout)
, time_testing_port_(kDefaultTimeTestingPort)
, hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName)
, help_prompt_()
@@ -328,6 +351,8 @@ Profile::Profile()
, max_cmd_id_(kDefaultMaxCmdId)
, default_timeout_(kDefaultTimeout)
, app_resuming_timeout_(kDefaultAppResumingTimeout)
+ , app_resumption_save_persistent_data_timeout_(
+ kDefaultAppSavePersistentDataTimeout)
, app_dir_quota_(kDefaultDirQuota)
, app_hmi_level_none_time_scale_max_requests_(
kDefaultAppHmiLevelNoneTimeScaleMaxRequests)
@@ -359,6 +384,8 @@ Profile::Profile()
, recording_file_source_(kDefaultRecordingFileSourceName)
, recording_file_name_(kDefaultRecordingFileName)
, application_list_update_timeout_(kDefaultApplicationListUpdateTimeout)
+ , max_thread_pool_size_(kDefaultMaxThreadPoolSize)
+ , default_hub_protocol_index_(kDefaultHubProtocolIndex)
, iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask)
, iap_hub_protocol_mask_(kDefaultHubProtocolMask)
, iap_pool_protocol_mask_(kDefaultPoolProtocolMask)
@@ -369,6 +396,8 @@ Profile::Profile()
, tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout)
, attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB)
, open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB)
+ , resumption_delay_before_ign_(kDefaultResumptionDelayBeforeIgn)
+ , resumption_delay_after_ign_(kDefaultResumptionDelayAfterIgn)
, hash_string_size_(kDefaultHashStringSize)
, use_db_for_resumption_(false)
, attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB)
@@ -380,7 +409,12 @@ Profile::Profile()
, remove_bundle_id_attempts_(kDefaultRemoveBundleIDattempts)
, max_number_of_ios_device_(kDefaultMaxNumberOfiOSDevice)
, wait_time_between_apps_(kDefaultWaitTimeBetweenApps)
- , enable_app_launch_ios_(kDefaultEnableAppLaunchIOS) {
+ , enable_app_launch_ios_(kDefaultEnableAppLaunchIOS)
+ , app_tranport_change_timer_(kDefaultAppTransportChangeTimer)
+ , app_tranport_change_timer_addition_(
+ kDefaultAppTransportChangeTimerAddition)
+ , error_occured_(false)
+ , error_description_() {
// SDL version
ReadStringValue(
&sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey);
@@ -388,9 +422,9 @@ Profile::Profile()
Profile::~Profile() {}
-void Profile::config_file_name(const std::string& fileName) {
- if (false == fileName.empty()) {
- config_file_name_ = fileName;
+void Profile::set_config_file_name(const std::string& file_name) {
+ if (false == file_name.empty()) {
+ config_file_name_ = file_name;
UpdateValues();
}
}
@@ -426,7 +460,7 @@ const std::string& Profile::app_resource_folder() const {
}
bool Profile::enable_protocol_4() const {
- return enable_protocol_4_;
+ return max_supported_protocol_version_ >= 4;
}
const std::string& Profile::app_icons_folder() const {
@@ -441,6 +475,22 @@ const uint32_t& Profile::app_icons_amount_to_remove() const {
return app_icons_amount_to_remove_;
}
+size_t Profile::maximum_control_payload_size() const {
+ return maximum_control_payload_size_;
+}
+
+size_t Profile::maximum_rpc_payload_size() const {
+ return maximum_rpc_payload_size_;
+}
+
+size_t Profile::maximum_audio_payload_size() const {
+ return maximum_audio_payload_size_;
+}
+
+size_t Profile::maximum_video_payload_size() const {
+ return maximum_video_payload_size_;
+}
+
const std::string& Profile::hmi_capabilities_file_name() const {
return hmi_capabilities_file_name_;
}
@@ -501,7 +551,7 @@ const uint16_t& Profile::time_testing_port() const {
return time_testing_port_;
}
-const uint64_t& Profile::thread_min_stack_size() const {
+const uint64_t Profile::thread_min_stack_size() const {
return min_tread_stack_size_;
}
@@ -621,6 +671,9 @@ const std::string& Profile::system_files_path() const {
return system_files_path_;
}
+const std::string& Profile::plugins_folder() const {
+ return plugins_folder_;
+}
const std::vector<uint32_t>& Profile::supported_diag_modes() const {
return supported_diag_modes_;
}
@@ -862,6 +915,14 @@ const bool Profile::enable_app_launch_ios() const {
return enable_app_launch_ios_;
}
+uint32_t Profile::app_transport_change_timer() const {
+ return app_tranport_change_timer_;
+}
+
+uint32_t Profile::app_transport_change_timer_addition() const {
+ return app_tranport_change_timer_addition_;
+}
+
const uint16_t Profile::max_number_of_ios_device() const {
return max_number_of_ios_device_;
}
@@ -874,6 +935,21 @@ const uint16_t Profile::wait_time_between_apps() const {
return wait_time_between_apps_;
}
+const bool Profile::ErrorOccured() const {
+ return error_occured_;
+}
+
+const std::string Profile::ErrorDescription() const {
+ return error_description_;
+}
+
+bool Profile::IsFileNamePortable(const std::string& file_name) const {
+ if (file_name.find_first_not_of(kAllowedSymbols) != std::string::npos) {
+ return false;
+ }
+ return true;
+}
+
void Profile::UpdateValues() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -980,17 +1056,6 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(app_resource_folder_, kAppResourseFolderKey, kMainSection);
- // 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(),
@@ -1025,6 +1090,39 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(
app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, kSDL4Section);
+ ReadUIntValue(&maximum_control_payload_size_,
+ kDefaultMaximumControlPayloadSize,
+ kSDL5Section,
+ kMaximumControlPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(maximum_control_payload_size_,
+ kMaximumControlPayloadSizeKey,
+ kSDL5Section);
+
+ ReadUIntValue(&maximum_rpc_payload_size_,
+ kDefaultMaximumRpcPayloadSize,
+ kSDL5Section,
+ kMaximumRpcPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(
+ maximum_rpc_payload_size_, kMaximumRpcPayloadSizeKey, kSDL5Section);
+
+ ReadUIntValue(&maximum_audio_payload_size_,
+ kDefaultMaximumAudioPayloadSize,
+ kSDL5Section,
+ kMaximumAudioPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(
+ maximum_audio_payload_size_, kMaximumAudioPayloadSizeKey, kSDL5Section);
+
+ ReadUIntValue(&maximum_video_payload_size_,
+ kDefaultMaximumVideoPayloadSize,
+ kSDL5Section,
+ kMaximumVideoPayloadSizeKey);
+
+ LOG_UPDATED_VALUE(
+ maximum_video_payload_size_, kMaximumVideoPayloadSizeKey, kSDL5Section);
+
// Application info file name
ReadStringValue(&app_info_storage_,
kDefaultAppInfoFileName,
@@ -1479,6 +1577,10 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(system_files_path_, kSystemFilesPathKey, kMainSection);
+ // Plugins folder
+ ReadStringValue(
+ &plugins_folder_, kDefaultPluginsPath, kMainSection, kPluginsFolderKey);
+ LOG_UPDATED_VALUE(plugins_folder_, kPluginsFolderKey, kMainSection);
// Heartbeat timeout
ReadUIntValue(&heart_beat_timeout_,
kDefaultHeartBeatTimeout,
@@ -1567,6 +1669,11 @@ void Profile::UpdateValues() {
LOG_UPDATED_VALUE(
policy_snapshot_file_name_, kPathToSnapshotKey, kPolicySection);
+ if (!IsFileNamePortable(policy_snapshot_file_name_)) {
+ error_occured_ = true;
+ error_description_ = "PathToSnapshot has forbidden(non-portable) symbols";
+ }
+
// Attempts number for opening policy DB
ReadUIntValue(&attempts_to_open_policy_db_,
kDefaultAttemptsToOpenPolicyDB,
@@ -1600,10 +1707,11 @@ void Profile::UpdateValues() {
kProtocolHandlerSection,
kMaxSupportedProtocolVersionKey);
- // if .ini file contains protocol version less than 2 or more than 3
- // max_supported_protocol_version_ = 3
- if (max_supported_protocol_version_ < 2) {
- max_supported_protocol_version_ = 3;
+ if (max_supported_protocol_version_ < 1) {
+ max_supported_protocol_version_ = 1;
+ } else if (max_supported_protocol_version_ >
+ kDefaultMaxSupportedProtocolVersion) {
+ max_supported_protocol_version_ = kDefaultMaxSupportedProtocolVersion;
}
LOG_UPDATED_BOOL_VALUE(enable_policy_, kEnablePolicy, kPolicySection);
@@ -1792,6 +1900,23 @@ void Profile::UpdateValues() {
LOG_UPDATED_BOOL_VALUE(
enable_app_launch_ios_, kEnableAppLaunchIOSKey, kAppLaunchSection);
+
+ ReadUIntValue(&app_tranport_change_timer_,
+ kDefaultAppTransportChangeTimer,
+ kMainSection,
+ kAppTransportChangeTimerKey);
+
+ LOG_UPDATED_VALUE(
+ app_tranport_change_timer_, kAppTransportChangeTimerKey, kMainSection);
+
+ ReadUIntValue(&app_tranport_change_timer_addition_,
+ kDefaultAppTransportChangeTimerAddition,
+ kMainSection,
+ kAppTransportChangeTimerAdditionKey);
+
+ LOG_UPDATED_VALUE(app_tranport_change_timer_addition_,
+ kAppTransportChangeTimerAdditionKey,
+ kMainSection);
}
bool Profile::ReadValue(bool* value,
diff --git a/src/components/config_profile/test/CMakeLists.txt b/src/components/config_profile/test/CMakeLists.txt
index 1246bff066..597be8fe00 100644
--- a/src/components/config_profile/test/CMakeLists.txt
+++ b/src/components/config_profile/test/CMakeLists.txt
@@ -28,23 +28,20 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${GMOCK_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/config_profile/include
)
-
-set(testSources
- profile_test.cc
- ini_file_test.cc
-)
-
-set(testLibraries
+set(LIBRARIES
gmock
ConfigProfile
)
+
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+create_test(config_profile_test "${SOURCES}" "${LIBRARIES}")
file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
@@ -52,6 +49,3 @@ file(COPY smartDeviceLink_invalid_pairs.ini DESTINATION ${CMAKE_CURRENT_BINARY_D
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
index 2f256c8b51..0443f061a2 100644
--- a/src/components/config_profile/test/ini_file_test.cc
+++ b/src/components/config_profile/test/ini_file_test.cc
@@ -36,7 +36,7 @@
namespace test {
namespace components {
-namespace profile {
+namespace profile_test {
using namespace ::profile;
@@ -325,6 +325,6 @@ TEST(IniFileTest, ParseLineWithComment) {
EXPECT_STREQ(line, res);
}
-} // namespace profile
+} // namespace profile_test
} // namespace components
} // namespace test
diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc
index 59ebb2820b..e7d62f4740 100644
--- a/src/components/config_profile/test/profile_test.cc
+++ b/src/components/config_profile/test/profile_test.cc
@@ -40,7 +40,7 @@
namespace test {
namespace components {
-namespace profile {
+namespace profile_test {
using namespace ::profile;
@@ -76,7 +76,7 @@ TEST_F(ProfileTest, SetConfigFileWithoutCallUpdate) {
EXPECT_EQ(vr_help_title_, profile_.vr_help_title());
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
// Value was updated
@@ -91,7 +91,7 @@ TEST_F(ProfileTest, SetConfigFileWithUpdate) {
// Default value
uint32_t thread_min_stack_size = threads::Thread::kMinStackSize;
EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size());
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
// Value was updated
@@ -108,7 +108,7 @@ TEST_F(ProfileTest, SetConfigFileWithUpdate) {
TEST_F(ProfileTest, UpdateManyTimesDefaultFile) {
// using for check logger's work - core dump when this test was started and
// log4cxx exists in test derictory
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
// Update config many times
for (int i = 0; i < 10; i++) {
@@ -123,7 +123,7 @@ TEST_F(ProfileTest, UpdateIntValues) {
EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size());
// Set config file with default name
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
// Value changes
@@ -136,7 +136,7 @@ TEST_F(ProfileTest, UpdateIntValues) {
EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size());
// Set new config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Value changes
@@ -151,7 +151,7 @@ TEST_F(ProfileTest, UpdateIntValues) {
EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size());
// Set config file with default name again
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
// Value should be changed
@@ -166,7 +166,7 @@ TEST_F(ProfileTest, UpdateBoolValues) {
EXPECT_FALSE(profile_.enable_policy());
// Set config file
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
// Check values
EXPECT_TRUE(profile_.launch_hmi());
EXPECT_TRUE(profile_.enable_policy());
@@ -180,7 +180,7 @@ TEST_F(ProfileTest, UpdateBoolValues) {
EXPECT_FALSE(profile_.is_redecoding_enabled());
// Change config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Parameters after updating
@@ -208,7 +208,7 @@ TEST_F(ProfileTest, UpdateStringValue) {
EXPECT_EQ(recording_file_name, profile_.recording_file_name());
EXPECT_EQ(server_address, profile_.server_address());
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
// Check values
@@ -234,7 +234,7 @@ TEST_F(ProfileTest, UpdateInt_ValueAppearsInFileTwice) {
uint32_t server_port = 8087;
EXPECT_EQ(server_port, profile_.server_port());
// Change config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Update config file
// First server_port = 8088
@@ -246,7 +246,7 @@ TEST_F(ProfileTest, UpdateBool_ValueAppearsInFileTwice) {
// Default values
EXPECT_FALSE(profile_.is_mixing_audio_supported());
// Change config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Update config file
// First value is false
@@ -258,7 +258,7 @@ TEST_F(ProfileTest, UpdateVectorOfString_ValueAppearsInFileTwice) {
std::vector<std::string> time_out_promt;
EXPECT_EQ(time_out_promt, profile_.time_out_promt());
// Change config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Update config file
time_out_promt.push_back("Please say a command,");
@@ -270,7 +270,7 @@ TEST_F(ProfileTest, UpdateString_ValueAppearsInFileTwice) {
std::string recording_file_name = "record.wav";
EXPECT_EQ(recording_file_name, profile_.recording_file_name());
// Change config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Update config file
recording_file_name = "video.wav";
@@ -284,7 +284,7 @@ TEST_F(ProfileTest, UpdatePairsValue) {
value.second = 0;
EXPECT_EQ(value, profile_.get_vehicle_data_frequency());
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name());
value.first = 5;
@@ -305,7 +305,7 @@ TEST_F(ProfileTest, PairsValueEmpty) {
value.second = 0;
EXPECT_EQ(value, profile_.read_did_frequency());
- profile_.config_file_name("smartDeviceLink_invalid_pairs.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_pairs.ini");
EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name());
// Default values
@@ -325,7 +325,7 @@ TEST_F(ProfileTest, CharValueInPairInsteadOfInt) {
value.second = 0;
EXPECT_EQ(value, profile_.get_vehicle_data_frequency());
- profile_.config_file_name("smartDeviceLink_invalid_string.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_string.ini");
EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name());
EXPECT_EQ(value, profile_.get_vehicle_data_frequency());
@@ -337,7 +337,7 @@ TEST_F(ProfileTest, CharValueInPairInsteadOfInt) {
}
TEST_F(ProfileTest, EmptyValuesInPair) {
- profile_.config_file_name("smartDeviceLink_invalid_pairs.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_pairs.ini");
EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name());
std::pair<uint32_t, int32_t> value;
@@ -358,7 +358,7 @@ TEST_F(ProfileTest, IntInsteadOfPair) {
value.second = 0;
EXPECT_EQ(value, profile_.start_stream_retry_amount());
- profile_.config_file_name("smartDeviceLink_invalid_pairs.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_pairs.ini");
EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name());
// Ini file includes only one element
value.first = 9;
@@ -377,7 +377,7 @@ TEST_F(ProfileTest, WrongIntValue) {
EXPECT_EQ(heart_beat_timeout, profile_.heart_beat_timeout());
// Change config file
- profile_.config_file_name("smartDeviceLink_invalid_int.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_int.ini");
EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name());
// Value in file includes letters. Check that value is default
@@ -395,7 +395,7 @@ TEST_F(ProfileTest, WrongMaxIntValue) {
EXPECT_EQ(maxvalue, profile_.max_cmd_id());
// Change config file
- profile_.config_file_name("smartDeviceLink_invalid_int.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_int.ini");
EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name());
// Value in file is more than could be saved.
@@ -416,7 +416,7 @@ TEST_F(ProfileTest, WrongMinIntValue) {
EXPECT_EQ(server_port, profile_.server_port());
// Change config file
- profile_.config_file_name("smartDeviceLink_invalid_int.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_int.ini");
EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name());
// File include 0, value should be lefted as default
@@ -441,7 +441,7 @@ TEST_F(ProfileTest, CheckCorrectValueWhenOtherValueInvalid) {
EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size());
// Change config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Check that value is default
@@ -462,7 +462,7 @@ TEST_F(ProfileTest, CheckCorrectValueWhenOtherValueInvalid) {
TEST_F(ProfileTest, PairsValueInsteadOfInt) {
// Set new config file
- profile_.config_file_name("smartDeviceLink_invalid_int.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_int.ini");
EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name());
// Get first number
uint32_t list_files_in_none = 5;
@@ -482,7 +482,7 @@ TEST_F(ProfileTest, StringValueIncludeSlashesAndRussianLetters) {
std::string app_storage_folder = "";
std::string current_dir = file_system::CurrentWorkingDirectory();
- profile_.config_file_name("smartDeviceLink_invalid_string.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_string.ini");
EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name());
// Check values
@@ -508,7 +508,7 @@ TEST_F(ProfileTest, StringUpperBoundValue) {
EXPECT_EQ(vr_help_title, profile_.vr_help_title());
EXPECT_EQ(recording_file_name, profile_.recording_file_name());
- profile_.config_file_name("smartDeviceLink_invalid_string.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_string.ini");
EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name());
// Total count of elements in ini file's string will be less 512
@@ -548,14 +548,14 @@ TEST_F(ProfileTest, CapitalLetterInBoolValue) {
EXPECT_FALSE(profile_.enable_policy());
// Set config file
- profile_.config_file_name("smartDeviceLink.ini");
+ profile_.set_config_file_name("smartDeviceLink.ini");
// Check values
EXPECT_TRUE(profile_.launch_hmi());
EXPECT_TRUE(profile_.enable_policy());
EXPECT_FALSE(profile_.is_redecoding_enabled());
// Change config file
- profile_.config_file_name("smartDeviceLink_invalid_boolean.ini");
+ profile_.set_config_file_name("smartDeviceLink_invalid_boolean.ini");
EXPECT_EQ("smartDeviceLink_invalid_boolean.ini", profile_.config_file_name());
// Parameters after updating
@@ -569,7 +569,7 @@ TEST_F(ProfileTest, CapitalLetterInBoolValue) {
TEST_F(ProfileTest, CheckReadStringValue) {
// Set new config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
std::string app_storage_folder_;
@@ -586,7 +586,7 @@ TEST_F(ProfileTest, CheckReadStringValue) {
TEST_F(ProfileTest, CheckReadBoolValue) {
// Set new config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
bool enable_policy;
@@ -600,7 +600,7 @@ TEST_F(ProfileTest, CheckReadBoolValue) {
TEST_F(ProfileTest, CheckReadIntValue) {
// Set new config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
int server_port = 0;
@@ -611,7 +611,7 @@ TEST_F(ProfileTest, CheckReadIntValue) {
TEST_F(ProfileTest, CheckIntContainer) {
// Set new config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
bool isread = false;
@@ -639,7 +639,7 @@ TEST_F(ProfileTest, CheckIntContainer) {
}
TEST_F(ProfileTest, CheckVectorContainer) {
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
// Get diag_modes after updating
@@ -668,7 +668,7 @@ TEST_F(ProfileTest, CheckVectorContainer) {
TEST_F(ProfileTest, CheckStringContainer) {
// Set new config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
bool isread = false;
@@ -697,7 +697,7 @@ TEST_F(ProfileTest, CheckStringContainer) {
#ifdef ENABLE_SECURITY
TEST_F(ProfileTest, CheckIntContainerInSecurityData) {
// Set new config file
- profile_.config_file_name("smartDeviceLink_test.ini");
+ profile_.set_config_file_name("smartDeviceLink_test.ini");
EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name());
std::vector<int> force_unprotected_list = profile_.ReadIntContainer(
@@ -724,6 +724,6 @@ TEST_F(ProfileTest, CheckIntContainerInSecurityData) {
}
#endif
-} // namespace profile
+} // namespace profile_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/CMakeLists.txt b/src/components/connection_handler/CMakeLists.txt
index dc1b2d24d6..fd2aa876cd 100644
--- a/src/components/connection_handler/CMakeLists.txt
+++ b/src/components/connection_handler/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,31 +28,31 @@
# 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
- include
- ${COMPONENTS_DIR}/protocol_handler/include/
- ${COMPONENTS_DIR}/utils/include/
- ${ENCRYPTION_INCLUDE_DIRECTORY}
- ${LOG4CXX_INCLUDE_DIRECTORY}
+ include
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${ENCRYPTION_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ${CH_SRC_DIR}/connection_handler_impl.cc
- ${CH_SRC_DIR}/connection.cc
- ${CH_SRC_DIR}/device.cc
- ${CH_SRC_DIR}/heartbeat_monitor.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
set(LIBRARIES
- ProtocolLibrary
+ ProtocolLibrary
+ encryption
+ Utils
)
+collect_sources(SOURCES "${PATHS}")
add_library(connectionHandler ${SOURCES})
-target_link_libraries(connectionHandler encryption)
+target_link_libraries(connectionHandler ${LIBRARIES})
if(BUILD_TESTS)
- add_subdirectory(test)
+ add_subdirectory(test)
endif()
diff --git a/src/components/connection_handler/include/connection_handler/connection.h b/src/components/connection_handler/include/connection_handler/connection.h
index aafc562505..b0f9586046 100644
--- a/src/components/connection_handler/include/connection_handler/connection.h
+++ b/src/components/connection_handler/include/connection_handler/connection.h
@@ -41,6 +41,7 @@
#include "connection_handler/device.h"
#include "connection_handler/heartbeat_monitor.h"
#include "protocol/service_type.h"
+#include "protocol_handler/protocol_packet.h"
#ifdef ENABLE_SECURITY
namespace security_manager {
@@ -75,8 +76,10 @@ struct Service {
Service()
: service_type(protocol_handler::kInvalidServiceType)
, is_protected_(false) {}
+
explicit Service(protocol_handler::ServiceType service_type)
: service_type(service_type), is_protected_(false) {}
+
bool operator==(const protocol_handler::ServiceType service_type) const {
return this->service_type == service_type;
}
@@ -95,6 +98,7 @@ struct Session {
#endif // ENABLE_SECURITY
Session()
: service_list()
+ , protocol_version(::protocol_handler::PROTOCOL_VERSION_2)
#ifdef ENABLE_SECURITY
, ssl_context(NULL)
#endif // ENABLE_SECURITY
@@ -207,6 +211,17 @@ class Connection {
*/
void SetProtectionFlag(const uint8_t session_id,
const protocol_handler::ServiceType& service_type);
+
+ /**
+ * @brief Check if session contains service with specified service type
+ * @param session_id id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ bool SessionServiceExists(
+ const uint8_t session_id,
+ const protocol_handler::ServiceType& service_type) const;
+
#endif // ENABLE_SECURITY
/**
* @brief Returns map of sessions which have been opened in
diff --git a/src/components/connection_handler/include/connection_handler/connection_handler.h b/src/components/connection_handler/include/connection_handler/connection_handler.h
deleted file mode 100644
index 7e7a7db114..0000000000
--- a/src/components/connection_handler/include/connection_handler/connection_handler.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
-#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
-
-#include "connection_handler/connection_handler_settings.h"
-#include "transport_manager/transport_manager_listener.h"
-#include "protocol_handler/session_observer.h"
-#include "connection_handler/device.h"
-#include "connection_handler/connection.h"
-#include "connection_handler/devices_discovery_starter.h"
-
-/**
- * \namespace connection_handler
- * \brief SmartDeviceLink connection_handler namespace.
- */
-namespace connection_handler {
-
-enum CloseSessionReason { kCommon = 0, kFlood, kMalformed, kUnauthorizedApp };
-
-class ConnectionHandlerObserver;
-
-/**
- * \class ConnectionHandler
- * \brief SmartDeviceLink ConnectionHandler interface class
- */
-class ConnectionHandler {
- public:
- /**
- * \brief Sets observer pointer for ConnectionHandler.
- * \param observer Pointer to observer object.
- **/
- virtual void set_connection_handler_observer(
- ConnectionHandlerObserver* observer) = 0;
-
- virtual void StartTransportManager() = 0;
-
- virtual void ConnectToDevice(
- connection_handler::DeviceHandle device_handle) = 0;
-
- /**
- * @brief RunAppOnDevice allows to run specific application on the certain
- *device.
- *
- * @param device_handle device identifier to run application on.
- *
- * @param app_id application id also known as bundle id on some devices to
- *run.
- */
- virtual void RunAppOnDevice(const std::string& device_handle,
- const std::string& bundle_id) const = 0;
-
- virtual void ConnectToAllDevices() = 0;
-
- /**
- * @brief Close the connection revoked by Policy
- * @param connection_key pair of connection and session id
- */
- virtual void CloseRevokedConnection(uint32_t connection_key) = 0;
-
- /**
- * \brief Close all associated sessions and close the connection pointed by
- * handle
- */
- virtual void CloseConnection(ConnectionHandle connection_handle) = 0;
-
- /**
- * \brief Return count of session for specified connection
- * \param connection_key pair of connection handle and session id
- */
- virtual uint32_t GetConnectionSessionsCount(uint32_t connection_key) = 0;
-
- /**
- * Gets device id by mac address
- * @param mac_address
- * @return true if successfully
- */
- virtual bool GetDeviceID(const std::string& mac_address,
- DeviceHandle* device_handle) = 0;
-
- /**
- * Close session associated with the key
- */
- virtual void CloseSession(uint32_t key, CloseSessionReason close_reason) = 0;
-
- /**
- * Close session
- */
- virtual void CloseSession(ConnectionHandle connection_handle,
- 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
- *
- * \param connection_key pair of connection and session id
- */
- virtual void StartSessionHeartBeat(uint32_t connection_key) = 0;
-
- /**
- * \brief Send heartbeat to mobile app
- */
- virtual void SendHeartBeat(ConnectionHandle connection_handle,
- uint8_t session_id) = 0;
-
- /**
- * Sets heart beat timeout for specified session
- * @param connection_key pair of connection and session id
- * @param timeout in milliseconds
- */
- virtual void SetHeartBeatTimeout(uint32_t connection_key,
- uint32_t timeout) = 0;
-
- /**
- * \brief Keep connection associated with the key from being closed by
- * heartbeat monitor
- */
- virtual void KeepConnectionAlive(uint32_t connection_key,
- uint8_t session_id) = 0;
-
- /**
- * \brief binds protocol version with session
- *
- * \param connection_key pair of connection and session id
- * \param protocol_version contains protocol version of
- * \registered application.
- */
- virtual void BindProtocolVersionWithSession(uint32_t connection_key,
- uint8_t protocol_version) = 0;
-
- /**
- * \brief information about given Connection Key.
- * \param key Unique key used by other components as session identifier
- * \param app_id Returned: ApplicationID
- * \param sessions_list Returned: List of session keys
- * \param device_id Returned: DeviceID
- * \return int32_t -1 in case of error or 0 in case of success
- */
- virtual int32_t GetDataOnSessionKey(uint32_t key,
- uint32_t* app_id,
- std::list<int32_t>* sessions_list,
- uint32_t* device_id) const = 0;
- /**
- * @brief GetConnectedDevicesMAC allows to obtain MAC adresses for all
- * currently connected devices.
- *
- * @param device_macs collection of MAC adresses for connected devices.
- */
- virtual void GetConnectedDevicesMAC(
- std::vector<std::string>& device_macs) const = 0;
-
- /**
- * \brief Connection handler settings getter
- * \return pointer to connection handler settings class
- */
- virtual const ConnectionHandlerSettings& get_settings() const = 0;
-
- virtual const protocol_handler::SessionObserver& get_session_observer() = 0;
-
- virtual DevicesDiscoveryStarter& get_device_discovery_starter() = 0;
-
- protected:
- /**
- * \brief Destructor
- */
- virtual ~ConnectionHandler() {}
-};
-} // namespace connection_handler
-
-#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
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 cd8aec0ff3..3aa304aabc 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
@@ -49,6 +49,7 @@
#include "utils/logger.h"
#include "utils/macro.h"
+#include "utils/message_queue.h"
#include "utils/lock.h"
#include "utils/stl_utils.h"
#include "utils/rwlock.h"
@@ -136,6 +137,24 @@ class ConnectionHandlerImpl
void OnDeviceRemoved(
const transport_manager::DeviceInfo& device_info) OVERRIDE;
+ /**
+ * @brief OnDeviceSwitchingStart notifies listeners on device transport
+ * switching start
+ * @param device_uid_from the id of the device which has to switch its
+ * transport
+ * @param device_uid_to the id of the device on new transport
+ */
+ void OnDeviceSwitchingStart(const std::string& device_uid_from,
+ const std::string& device_uid_to) FINAL;
+
+ /**
+ * @brief OnDeviceSwitchingFinish notifies listeners on device transport
+ * switching completion
+ * @param device_uid the id for the device which is fails to reconnect.
+ */
+ void OnDeviceSwitchingFinish(
+ const transport_manager::DeviceUID& device_uid) FINAL;
+
void OnScanDevicesFinished() OVERRIDE;
void OnScanDevicesFailed(
const transport_manager::SearchDeviceError& error) OVERRIDE;
@@ -181,6 +200,7 @@ class ConnectionHandlerImpl
* \param is_protected would be service protected
* \param hash_id pointer for session hash identifier
* \return uint32_t Id (number) of new session if successful, otherwise 0.
+ * \deprecated
*/
virtual uint32_t OnSessionStartedCallback(
const transport_manager::ConnectionUID connection_handle,
@@ -191,6 +211,24 @@ class ConnectionHandlerImpl
/**
* \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates start of new session.
+ * Result must be notified through NotifySessionStartedContext().
+ * \param connection_handle Connection identifier within which session
+ * has to be started.
+ * \param sessionId Identifier of the session to be start
+ * \param service_type Type of service
+ * \param protocol_version Version of protocol
+ * \param is_protected would be service protected
+ * \param params configuration parameters specified by mobile
+ */
+ virtual void OnSessionStartedCallback(
+ const transport_manager::ConnectionUID connection_handle,
+ const uint8_t session_id,
+ const protocol_handler::ServiceType& service_type,
+ const bool is_protected,
+ const BsonObject* params);
+ /**
+ * \brief Callback function used by ProtocolHandler
* when Mobile Application initiates session ending.
* \param connection_handle Connection identifier within which session exists
* \param sessionId Identifier of the session to be ended
@@ -198,12 +236,28 @@ class ConnectionHandlerImpl
* protocol.
* If not equal to hash assigned to session on start then operation fails.
* \return uint32_t 0 if operation fails, session key otherwise
+ * \deprecated
*/
uint32_t OnSessionEndedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t session_id,
const uint32_t& hashCode,
const protocol_handler::ServiceType& service_type) OVERRIDE;
+ /**
+ * \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates session ending.
+ * \param connection_handle Connection identifier within which session exists
+ * \param sessionId Identifier of the session to be ended
+ * \param hashCode Hash used only in second version of SmartDeviceLink
+ * protocol. (Set to HASH_ID_WRONG if the hash is incorrect)
+ * If not equal to hash assigned to session on start then operation fails.
+ * \return uint32_t 0 if operation fails, session key otherwise
+ */
+ uint32_t OnSessionEndedCallback(
+ const transport_manager::ConnectionUID connection_handle,
+ const uint8_t session_id,
+ uint32_t* hashCode,
+ const protocol_handler::ServiceType& service_type) OVERRIDE;
/**
* \brief Callback function used by ProtocolHandler
@@ -296,6 +350,16 @@ class ConnectionHandlerImpl
const uint32_t& key,
const protocol_handler::ServiceType& service_type) OVERRIDE;
+ /**
+ * @brief Check if session contains service with specified service type
+ * @param connection_key unique id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ bool SessionServiceExists(
+ const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type) const OVERRIDE;
+
security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const OVERRIDE;
#endif // ENABLE_SECURITY
@@ -425,6 +489,29 @@ class ConnectionHandlerImpl
uint8_t session_id,
uint8_t& protocol_version) const OVERRIDE;
+ /**
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ int32_t GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ connection_handler::DeviceHandle* device_id) const OVERRIDE;
+
+ /**
+ * DEPRECATED
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
int32_t GetDataOnSessionKey(uint32_t key,
uint32_t* app_id,
std::list<int32_t>* sessions_list,
@@ -435,6 +522,22 @@ class ConnectionHandlerImpl
const protocol_handler::SessionObserver& get_session_observer();
DevicesDiscoveryStarter& get_device_discovery_starter();
+ /**
+ * \brief Invoked when observer's OnServiceStartedCallback is completed
+ * \param session_key the key of started session passed to
+ * OnServiceStartedCallback().
+ * \param result true if observer accepts starting service, false otherwise
+ * \param rejected_params list of rejected parameters' name. Only valid when
+ * result is false. Note that even if result is false, this may be empty.
+ *
+ * \note This is invoked only once but can be invoked by multiple threads.
+ * Also it can be invoked before OnServiceStartedCallback() returns.
+ **/
+ virtual void NotifyServiceStartedResult(
+ uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params);
+
private:
/**
* \brief Disconnect application.
@@ -480,6 +583,10 @@ class ConnectionHandlerImpl
*/
utils::StlMapDeleter<ConnectionList> connection_list_deleter_;
+ sync_primitives::Lock start_service_context_map_lock_;
+ std::map<uint32_t, protocol_handler::SessionContext>
+ start_service_context_map_;
+
#ifdef BUILD_TESTS
// Methods for test usage
public:
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
deleted file mode 100644
index 54b8d3a92e..0000000000
--- a/src/components/connection_handler/include/connection_handler/connection_handler_observer.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
-#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
-
-#include "connection_handler/device.h"
-#include "connection_handler/connection.h"
-#include "connection_handler/connection_handler.h"
-#include "protocol/service_type.h"
-
-#ifdef ENABLE_SECURITY
-#include "security_manager/ssl_context.h"
-#endif // ENABLE_SECURITY
-
-/**
- * \namespace connection_handler
- * \brief SmartDeviceLink connection_handler namespace.
- */
-namespace connection_handler {
-
-/**
- * \class ConnectionHandlerObserver
- * \brief ConnectionHandlerObserver class
- */
-class ConnectionHandlerObserver {
- public:
- /**
- * \brief Available devices list updated.
- *
- * Called when device scanning initiated with scanForNewDevices
- * is completed.
- *
- * \param DeviceList New list of available devices.
- **/
- virtual void OnDeviceListUpdated(
- const connection_handler::DeviceMap& device_list) = 0;
-
- /**
- * @brief Reaction to "Find new applications" request
- */
- virtual void OnFindNewApplicationsRequest() = 0;
-
- /**
- * \brief Removes device.
- *
- * Called when device has been removed from a list.
- *
- * \param DeviceHandle Handle of removed device.
- **/
- virtual void RemoveDevice(
- const connection_handler::DeviceHandle& device_handle) = 0;
-
- /**
- * \brief Callback function used by connection_handler
- * when Mobile Application initiates start of new service.
- * \param deviceHandle Device identifier within which session has to be
- * started.
- * \param sessionKey Key of started session.
- * \param type Established service type
- */
- virtual bool OnServiceStartedCallback(
- const connection_handler::DeviceHandle& device_handle,
- const int32_t& session_key,
- const protocol_handler::ServiceType& type) = 0;
-
- /**
- * \brief Callback function used by connection_handler
- * when Mobile Application initiates service ending.
- * \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,
- const connection_handler::CloseSessionReason& close_reason) = 0;
-
-#ifdef ENABLE_SECURITY
- virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
- uint32_t key) const = 0;
-#endif // ENABLE_SECURITY
- protected:
- /**
- * \brief Destructor
- */
- virtual ~ConnectionHandlerObserver() {}
-};
-} // namespace connection_handler
-
-#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
diff --git a/src/components/connection_handler/include/connection_handler/device.h b/src/components/connection_handler/include/connection_handler/device.h
index cee0bf8875..26376c1d8d 100644
--- a/src/components/connection_handler/include/connection_handler/device.h
+++ b/src/components/connection_handler/include/connection_handler/device.h
@@ -36,6 +36,7 @@
#include <string>
#include <map>
#include <vector>
+#include "transport_manager/common.h"
/**
* \namespace connection_handler
@@ -46,7 +47,7 @@ namespace connection_handler {
/**
* \brief Type for DeviceHandle
*/
-typedef uint32_t DeviceHandle;
+typedef transport_manager::DeviceHandle DeviceHandle;
typedef std::vector<int32_t> AppList;
/**
@@ -112,6 +113,6 @@ class Device {
/**
* \brief Type for Devices map
*/
-typedef std::map<int32_t, Device> DeviceMap;
+typedef std::map<DeviceHandle, Device> DeviceMap;
} // namespace connection_handler
#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_DEVICE_H_
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 f6ef9a9829..4d1d07112c 100644
--- a/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
+++ b/src/components/connection_handler/include/connection_handler/heartbeat_monitor.h
@@ -29,8 +29,8 @@
* 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_INCLUDE_HEARTBEAT_MONITOR_H_
-#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_HEARTBEAT_MONITOR_H_
+#ifndef SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_HEARTBEAT_MONITOR_H_
+#define SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_HEARTBEAT_MONITOR_H_
#include <stdint.h>
#include <map>
@@ -125,4 +125,4 @@ class HeartBeatMonitor : public threads::ThreadDelegate {
} // namespace connection_handler
-#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_HEARTBEAT_MONITOR_H_
+#endif // SRC_COMPONENTS_CONNECTION_HANDLER_INCLUDE_CONNECTION_HANDLER_HEARTBEAT_MONITOR_H_
diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc
index 7bb54d4493..d494611643 100644
--- a/src/components/connection_handler/src/connection.cc
+++ b/src/components/connection_handler/src/connection.cc
@@ -39,6 +39,7 @@
#include "protocol_handler/protocol_packet.h"
#include "utils/logger.h"
#include "utils/macro.h"
+#include "utils/helpers.h"
#ifdef ENABLE_SECURITY
#include "security_manager/ssl_context.h"
@@ -148,6 +149,10 @@ bool Connection::AddNewService(uint8_t session_id,
LOG4CXX_WARN(logger_, "Wrong service " << static_cast<int>(service_type));
return false;
}
+
+ LOG4CXX_DEBUG(logger_,
+ "Add service " << service_type << " for session "
+ << static_cast<uint32_t>(session_id));
sync_primitives::AutoLock lock(session_map_lock_);
SessionMap::iterator session_it = session_map_.find(session_id);
@@ -156,6 +161,20 @@ bool Connection::AddNewService(uint8_t session_id,
return false;
}
Session& session = session_it->second;
+
+ if (session.protocol_version <= protocol_handler::PROTOCOL_VERSION_2 &&
+ helpers::Compare<protocol_handler::ServiceType,
+ helpers::EQ,
+ helpers::ONE>(
+ service_type,
+ protocol_handler::ServiceType::kAudio,
+ protocol_handler::ServiceType::kMobileNav)) {
+ LOG4CXX_WARN(logger_,
+ "Audio and video services are disallowed for protocol version "
+ "2 or lower");
+ return false;
+ }
+
Service* service = session.FindService(service_type);
// if service already exists
if (service) {
@@ -294,6 +313,23 @@ void Connection::SetProtectionFlag(
service_rpc->is_protected_ = true;
}
}
+
+bool Connection::SessionServiceExists(
+ const uint8_t session_id,
+ const protocol_handler::ServiceType& service_type) const {
+ 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()) {
+ LOG4CXX_WARN(logger_, "Session not found in this connection!");
+ return false;
+ }
+
+ const Session& session = session_it->second;
+ return session.FindService(service_type);
+}
+
#endif // ENABLE_SECURITY
ConnectionHandle Connection::connection_handle() const {
@@ -352,8 +388,7 @@ bool Connection::SupportHeartBeat(uint8_t session_id) {
}
Session& session = session_it->second;
return (
- (::protocol_handler::PROTOCOL_VERSION_3 == session.protocol_version ||
- ::protocol_handler::PROTOCOL_VERSION_4 == session.protocol_version) &&
+ (session.protocol_version >= ::protocol_handler::PROTOCOL_VERSION_3) &&
(0 != heartbeat_timeout_));
}
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 62a1f46fba..7ea9efa1cc 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -38,6 +38,7 @@
#include "connection_handler/connection_handler_impl.h"
#include "transport_manager/info.h"
+#include "encryption/hashing.h"
#ifdef ENABLE_SECURITY
#include "security_manager/security_manager.h"
@@ -69,7 +70,9 @@ ConnectionHandlerImpl::ConnectionHandlerImpl(
, protocol_handler_(NULL)
, connection_list_lock_()
, connection_handler_observer_lock_()
- , connection_list_deleter_(&connection_list_) {}
+ , connection_list_deleter_(&connection_list_)
+ , start_service_context_map_lock_()
+ , start_service_context_map_() {}
ConnectionHandlerImpl::~ConnectionHandlerImpl() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -82,6 +85,9 @@ void ConnectionHandlerImpl::Stop() {
RemoveConnection(itr->second->connection_handle());
itr = connection_list_.begin();
}
+
+ sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
+ start_service_context_map_.clear();
}
void ConnectionHandlerImpl::set_connection_handler_observer(
@@ -131,15 +137,21 @@ void ConnectionHandlerImpl::OnDeviceFound(
void ConnectionHandlerImpl::OnDeviceAdded(
const transport_manager::DeviceInfo& device_info) {
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::AutoReadLock read_lock(connection_handler_observer_lock_);
- if (connection_handler_observer_) {
- connection_handler_observer_->OnDeviceListUpdated(device_list_);
+ auto handle = device_info.device_handle();
+
+ Device device(handle,
+ device_info.name(),
+ device_info.mac_address(),
+ device_info.connection_type());
+
+ auto result = device_list_.insert(std::make_pair(handle, device));
+
+ if (!result.second) {
+ LOG4CXX_ERROR(logger_,
+ "Device with handle " << handle
+ << " is known already. "
+ "Information won't be updated.");
+ return;
}
}
@@ -169,10 +181,54 @@ void ConnectionHandlerImpl::OnDeviceRemoved(
RemoveConnection(*it);
}
- device_list_.erase(device_info.device_handle());
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->RemoveDevice(device_info.device_handle());
+ connection_handler_observer_->OnDeviceListUpdated(device_list_);
+ }
+ device_list_.erase(device_info.device_handle());
+}
+
+void ConnectionHandlerImpl::OnDeviceSwitchingFinish(
+ const transport_manager::DeviceUID& device_uid) {
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnDeviceSwitchingFinish(
+ encryption::MakeHash(device_uid));
+ }
+}
+
+namespace {
+struct DeviceFinder {
+ explicit DeviceFinder(const std::string& device_uid)
+ : device_uid_(device_uid) {}
+ bool operator()(const DeviceMap::value_type& device) {
+ return device_uid_ == device.second.mac_address();
+ }
+
+ private:
+ const std::string& device_uid_;
+};
+} // namespace
+
+void ConnectionHandlerImpl::OnDeviceSwitchingStart(
+ const std::string& device_uid_from, const std::string& device_uid_to) {
+ auto device_from =
+ std::find_if(device_list_.begin(),
+ device_list_.end(),
+ DeviceFinder(encryption::MakeHash(device_uid_from)));
+
+ auto device_to =
+ std::find_if(device_list_.begin(),
+ device_list_.end(),
+ DeviceFinder(encryption::MakeHash(device_uid_to)));
+
+ DCHECK_OR_RETURN_VOID(device_list_.end() != device_from);
+ DCHECK_OR_RETURN_VOID(device_list_.end() != device_to);
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ connection_handler_observer_->OnDeviceSwitchingStart(device_from->second,
+ device_to->second);
}
}
@@ -289,6 +345,7 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
if (hash_id) {
*hash_id = protocol_handler::HASH_ID_WRONG;
}
+
#ifdef ENABLE_SECURITY
if (!AllowProtection(get_settings(), service_type, is_protected)) {
return 0;
@@ -347,6 +404,139 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
return new_session_id;
}
+void ConnectionHandlerImpl::OnSessionStartedCallback(
+ const transport_manager::ConnectionUID connection_handle,
+ const uint8_t session_id,
+ const protocol_handler::ServiceType& service_type,
+ const bool is_protected,
+ const BsonObject* params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::vector<std::string> rejected_params;
+ protocol_handler::SessionContext context(connection_handle,
+ session_id,
+ 0,
+ service_type,
+ protocol_handler::HASH_ID_WRONG,
+ is_protected);
+
+#ifdef ENABLE_SECURITY
+ if (!AllowProtection(get_settings(), service_type, is_protected)) {
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
+ }
+#endif // ENABLE_SECURITY
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
+ }
+
+ Connection* connection = it->second;
+ context.is_new_service_ =
+ !connection->SessionServiceExists(session_id, service_type);
+
+ if ((0 == session_id) && (protocol_handler::kRpc == service_type)) {
+ context.new_session_id_ = connection->AddNewSession();
+ if (0 == context.new_session_id_) {
+ LOG4CXX_ERROR(logger_, "Couldn't start new session!");
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
+ }
+ context.hash_id_ = KeyFromPair(connection_handle, context.new_session_id_);
+ } else { // Could be create new service or protected exists one
+ if (!connection->AddNewService(session_id, service_type, is_protected)) {
+ LOG4CXX_ERROR(logger_,
+ "Couldn't establish "
+#ifdef ENABLE_SECURITY
+ << (is_protected ? "protected" : "non-protected")
+#endif // ENABLE_SECURITY
+ << " service " << static_cast<int>(service_type)
+ << " for session " << static_cast<int>(session_id));
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ return;
+ }
+ context.new_session_id_ = session_id;
+ context.hash_id_ = protocol_handler::HASH_ID_NOT_SUPPORTED;
+ }
+ sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
+ if (connection_handler_observer_) {
+ const uint32_t session_key =
+ KeyFromPair(connection_handle, context.new_session_id_);
+
+ uint32_t app_id = 0;
+ GetDataOnSessionKey(
+ session_key, &app_id, NULL, static_cast<DeviceHandle*>(NULL));
+ if (app_id > 0) {
+ context.is_ptu_required_ =
+ !connection_handler_observer_->CheckAppIsNavi(app_id);
+ }
+
+ {
+ sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
+ start_service_context_map_[session_key] = context;
+ }
+
+ connection_handler_observer_->OnServiceStartedCallback(
+ connection->connection_device_handle(),
+ session_key,
+ service_type,
+ params);
+ } else {
+ if (protocol_handler_) {
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ }
+ }
+}
+
+void ConnectionHandlerImpl::NotifyServiceStartedResult(
+ uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ protocol_handler::SessionContext context;
+ {
+ sync_primitives::AutoLock auto_lock(start_service_context_map_lock_);
+ auto it = start_service_context_map_.find(session_key);
+ if (it == start_service_context_map_.end()) {
+ LOG4CXX_ERROR(logger_, "context for start service not found!");
+ return;
+ }
+ context = it->second;
+ start_service_context_map_.erase(it);
+ }
+
+ Connection* connection = NULL;
+ {
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::iterator it = connection_list_.find(context.connection_id_);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "connection not found");
+ return;
+ }
+ connection = it->second;
+ }
+
+ if (!result) {
+ LOG4CXX_WARN(logger_,
+ "Service starting forbidden by connection_handler_observer");
+ if (protocol_handler::kRpc == context.service_type_) {
+ connection->RemoveSession(context.new_session_id_);
+ } else {
+ connection->RemoveService(context.initial_session_id_,
+ context.service_type_);
+ }
+ context.new_session_id_ = 0;
+ }
+
+ if (protocol_handler_ != NULL) {
+ protocol_handler_->NotifySessionStarted(context, rejected_params);
+ }
+}
+
void ConnectionHandlerImpl::OnApplicationFloodCallBack(
const uint32_t& connection_key) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -382,12 +572,23 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
const uint8_t session_id,
const uint32_t& hashCode,
const protocol_handler::ServiceType& service_type) {
+ uint32_t hashValue = hashCode;
+ return OnSessionEndedCallback(
+ connection_handle, session_id, &hashValue, service_type);
+}
+
+uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
+ const transport_manager::ConnectionUID connection_handle,
+ const uint8_t session_id,
+ uint32_t* hashCode,
+ const protocol_handler::ServiceType& service_type) {
LOG4CXX_AUTO_TRACE(logger_);
connection_list_lock_.AcquireForReading();
ConnectionList::iterator it = connection_list_.find(connection_handle);
if (connection_list_.end() == it) {
LOG4CXX_WARN(logger_, "Unknown connection!");
+ connection_list_lock_.Release();
return 0;
}
std::pair<int32_t, Connection*> connection_item = *it;
@@ -401,12 +602,13 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback(
"Session " << static_cast<uint32_t>(session_id)
<< " to be removed");
// old version of protocol doesn't support hash
- if (protocol_handler::HASH_ID_NOT_SUPPORTED != hashCode) {
- if (protocol_handler::HASH_ID_WRONG == hashCode ||
- session_key != hashCode) {
+ if (protocol_handler::HASH_ID_NOT_SUPPORTED != *hashCode) {
+ if (protocol_handler::HASH_ID_WRONG == *hashCode ||
+ session_key != *hashCode) {
LOG4CXX_WARN(logger_,
"Wrong hash_id for session "
<< static_cast<uint32_t>(session_id));
+ *hashCode = protocol_handler::HASH_ID_WRONG;
return 0;
}
}
@@ -470,7 +672,7 @@ int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
uint32_t key,
uint32_t* app_id,
std::list<int32_t>* sessions_list,
- uint32_t* device_id) const {
+ connection_handler::DeviceHandle* device_id) const {
LOG4CXX_AUTO_TRACE(logger_);
const int32_t error_result = -1;
@@ -514,6 +716,18 @@ int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
return 0;
}
+int32_t ConnectionHandlerImpl::GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ uint32_t* device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DeviceHandle handle;
+ int32_t result = GetDataOnSessionKey(key, app_id, sessions_list, &handle);
+ *device_id = static_cast<uint32_t>(handle);
+ return result;
+}
+
const ConnectionHandlerSettings& ConnectionHandlerImpl::get_settings() const {
return settings_;
}
@@ -664,10 +878,29 @@ void ConnectionHandlerImpl::SetProtectionFlag(
connection.SetProtectionFlag(session_id, service_type);
}
+bool ConnectionHandlerImpl::SessionServiceExists(
+ const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ transport_manager::ConnectionUID connection_handle = 0;
+ uint8_t session_id = 0;
+ PairFromKey(connection_key, &connection_handle, &session_id);
+
+ sync_primitives::AutoReadLock lock(connection_list_lock_);
+ ConnectionList::const_iterator it = connection_list_.find(connection_handle);
+ if (connection_list_.end() == it) {
+ LOG4CXX_ERROR(logger_, "Unknown connection!");
+ return false;
+ }
+ const Connection& connection = *it->second;
+ return connection.SessionServiceExists(session_id, service_type);
+}
+
security_manager::SSLContext::HandshakeContext
ConnectionHandlerImpl::GetHandshakeContext(uint32_t key) const {
return connection_handler_observer_->GetHandshakeContext(key);
}
+
#endif // ENABLE_SECURITY
void ConnectionHandlerImpl::StartDevicesDiscovery() {
@@ -944,6 +1177,7 @@ void ConnectionHandlerImpl::OnConnectionEnded(
ConnectionList::iterator itr = connection_list_.find(connection_id);
if (connection_list_.end() == itr) {
LOG4CXX_ERROR(logger_, "Connection not found!");
+ connection_list_lock_.Release();
return;
}
std::auto_ptr<Connection> connection(itr->second);
diff --git a/src/components/connection_handler/test/CMakeLists.txt b/src/components/connection_handler/test/CMakeLists.txt
index 32da4bdcd8..033a45e97d 100644
--- a/src/components/connection_handler/test/CMakeLists.txt
+++ b/src/components/connection_handler/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,9 +28,7 @@
# 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
@@ -46,15 +44,7 @@ set(LIBRARIES
ProtocolHandler
)
-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}")
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+create_test(connection_handler_test "${SOURCES}" "${LIBRARIES}")
-endif()
+file(COPY ${CMAKE_SOURCE_DIR}/src/appMain/smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc
index 08f2198fa0..a951598917 100644
--- a/src/components/connection_handler/test/connection_handler_impl_test.cc
+++ b/src/components/connection_handler/test/connection_handler_impl_test.cc
@@ -40,10 +40,11 @@
#include "security_manager/mock_security_manager.h"
#include "security_manager/mock_ssl_context.h"
#include "protocol_handler/mock_protocol_handler.h"
-#include "connection_handler/connection_handler_observer_mock.h"
+#include "connection_handler/mock_connection_handler_observer.h"
#include "connection_handler/mock_connection_handler_settings.h"
#include "transport_manager/mock_transport_manager.h"
#include "encryption/hashing.h"
+#include "utils/test_async_waiter.h"
namespace test {
namespace components {
@@ -53,10 +54,23 @@ using namespace ::connection_handler;
using ::protocol_handler::ServiceType;
using namespace ::protocol_handler;
using ::testing::_;
+using ::testing::ByRef;
+using ::testing::DoAll;
using ::testing::InSequence;
using ::testing::Mock;
using ::testing::Return;
using ::testing::ReturnRefOfCopy;
+using ::testing::SaveArg;
+using ::testing::SaveArgPointee;
+
+// custom action to call a member function with 3 arguments
+ACTION_P5(InvokeMemberFuncWithArg3, ptr, memberFunc, a, b, c) {
+ (ptr->*memberFunc)(a, b, c);
+}
+
+namespace {
+const uint32_t kAsyncExpectationsTimeout = 10000u;
+}
// For service types and PROTECTION_ON/OFF
@@ -103,24 +117,53 @@ class ConnectionHandlerTest : public ::testing::Test {
// Remove all specific services
}
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_);
+ protocol_handler_test::MockProtocolHandler temp_protocol_handler;
+ connection_handler_->set_protocol_handler(&temp_protocol_handler);
+ EXPECT_CALL(temp_protocol_handler, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&out_context_));
+
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+ connection_handler_->set_protocol_handler(NULL);
+ EXPECT_NE(0u, out_context_.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
+ out_context_.hash_id_);
+ connection_key_ =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
}
uint32_t SessionHash(const uint32_t connection, const uint32_t session) {
return connection_handler_->KeyFromPair(connection, session);
}
void AddTestService(ServiceType service_type) {
- EXPECT_NE(0u, 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_);
+ EXPECT_NE(0u, out_context_.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, out_context_.new_session_id_),
+ out_context_.hash_id_);
+ connection_key_ =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
+
+ // Set protocol version to 3 if audio or video service should be tested
+ if (service_type == ServiceType::kAudio ||
+ service_type == ServiceType::kMobileNav) {
+ ChangeProtocol(uid_,
+ out_context_.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_3);
+ }
+
+ SessionContext context;
+ protocol_handler_test::MockProtocolHandler temp_protocol_handler;
+ connection_handler_->set_protocol_handler(&temp_protocol_handler);
+ EXPECT_CALL(temp_protocol_handler, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ service_type,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(0));
+ connection_handler_->set_protocol_handler(NULL);
+ EXPECT_EQ(context.new_session_id_, out_context_.new_session_id_);
}
// Check Service Wrapper
@@ -246,8 +289,7 @@ class ConnectionHandlerTest : public ::testing::Test {
transport_manager::DeviceHandle device_handle_;
transport_manager::ConnectionUID uid_;
uint32_t connection_key_;
- uint32_t start_session_id_;
- uint32_t out_hash_id_;
+ protocol_handler::SessionContext out_context_;
std::string connection_type_;
std::string device_name_;
@@ -262,11 +304,17 @@ 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_);
+ protocol_handler::SessionContext context;
+
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context));
+
+ connection_handler_->OnSessionStartedCallback(
+ uid_, sessionID, kRpc, PROTECTION_ON, static_cast<BsonObject*>(NULL));
// Unknown connection error is '0'
- EXPECT_EQ(0u, result_fail);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ EXPECT_EQ(0u, context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context.hash_id_);
ASSERT_TRUE(connection_handler_->getConnectionList().empty());
}
@@ -301,11 +349,12 @@ TEST_F(ConnectionHandlerTest, GetAppIdOnSessionKey) {
AddTestSession();
uint32_t app_id = 0;
- const uint32_t testid = SessionHash(uid_, start_session_id_);
+ const uint32_t testid = SessionHash(uid_, out_context_.new_session_id_);
+ connection_handler::DeviceHandle null_handle = 0;
EXPECT_EQ(0,
connection_handler_->GetDataOnSessionKey(
- connection_key_, &app_id, NULL, NULL));
+ connection_key_, &app_id, NULL, &null_handle));
EXPECT_EQ(testid, app_id);
}
@@ -313,9 +362,10 @@ TEST_F(ConnectionHandlerTest, GetAppIdOnSessionKey_SessionNotStarted) {
AddTestDeviceConnection();
uint32_t app_id = 0;
+ connection_handler::DeviceHandle null_handle = 0;
EXPECT_EQ(-1,
connection_handler_->GetDataOnSessionKey(
- connection_key_, &app_id, NULL, NULL));
+ connection_key_, &app_id, NULL, &null_handle));
}
TEST_F(ConnectionHandlerTest, GetDeviceID) {
@@ -366,7 +416,8 @@ TEST_F(ConnectionHandlerTest, GetApplicationsOnDevice) {
0,
connection_handler_->GetDataOnDeviceID(handle, NULL, &applications_list));
- uint32_t test_id = connection_handler_->KeyFromPair(uid_, start_session_id_);
+ uint32_t test_id =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
EXPECT_EQ(1u, applications_list.size());
EXPECT_EQ(test_id, applications_list.front());
@@ -378,7 +429,7 @@ TEST_F(ConnectionHandlerTest, GetDefaultProtocolVersion) {
uint8_t protocol_version = 0;
EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(
- uid_, start_session_id_, protocol_version));
+ uid_, out_context_.new_session_id_, protocol_version));
EXPECT_EQ(PROTOCOL_VERSION_2, protocol_version);
}
@@ -386,11 +437,11 @@ TEST_F(ConnectionHandlerTest, GetDefaultProtocolVersion) {
TEST_F(ConnectionHandlerTest, GetProtocolVersion) {
AddTestDeviceConnection();
AddTestSession();
- ChangeProtocol(uid_, start_session_id_, PROTOCOL_VERSION_3);
+ ChangeProtocol(uid_, out_context_.new_session_id_, PROTOCOL_VERSION_3);
uint8_t protocol_version = 0;
EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(
- uid_, start_session_id_, protocol_version));
+ uid_, out_context_.new_session_id_, protocol_version));
EXPECT_EQ(PROTOCOL_VERSION_3, protocol_version);
}
@@ -400,14 +451,14 @@ TEST_F(ConnectionHandlerTest, GetProtocolVersionAfterBinding) {
AddTestSession();
uint8_t protocol_version = 0;
EXPECT_TRUE(connection_handler_->ProtocolVersionUsed(
- uid_, start_session_id_, protocol_version));
+ uid_, out_context_.new_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));
+ uid_, out_context_.new_session_id_, protocol_version));
EXPECT_EQ(PROTOCOL_VERSION_3, protocol_version);
}
@@ -419,15 +470,22 @@ TEST_F(ConnectionHandlerTest, GetPairFromKey) {
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);
+ EXPECT_EQ(out_context_.new_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_));
+ ChangeProtocol(uid_, out_context_.new_session_id_, PROTOCOL_VERSION_3);
+ EXPECT_TRUE(connection_handler_->IsHeartBeatSupported(
+ uid_, out_context_.new_session_id_));
+}
+
+MATCHER_P(SameDevice, device, "") {
+ return arg.device_handle() == device.device_handle() &&
+ arg.user_friendly_name() == device.user_friendly_name() &&
+ arg.mac_address() == device.mac_address() &&
+ arg.connection_type() == device.connection_type();
}
TEST_F(ConnectionHandlerTest, SendEndServiceWithoutSetProtocolHandler) {
@@ -448,7 +506,7 @@ TEST_F(ConnectionHandlerTest, SendEndService) {
TEST_F(ConnectionHandlerTest, OnFindNewApplicationsRequest) {
AddTestDeviceConnection();
AddTestSession();
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -458,7 +516,7 @@ TEST_F(ConnectionHandlerTest, OnFindNewApplicationsRequest) {
}
TEST_F(ConnectionHandlerTest, OnFindNewApplicationsRequestWithoutObserver) {
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
EXPECT_CALL(mock_connection_handler_observer, OnFindNewApplicationsRequest())
.Times(0);
@@ -466,7 +524,7 @@ TEST_F(ConnectionHandlerTest, OnFindNewApplicationsRequestWithoutObserver) {
}
TEST_F(ConnectionHandlerTest, OnFindNewApplicationsRequestWithoutSession) {
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -480,7 +538,7 @@ TEST_F(ConnectionHandlerTest, OnMalformedMessageCallback) {
AddTestSession();
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -506,15 +564,15 @@ TEST_F(ConnectionHandlerTest, OnApplicationFloodCallBack) {
AddTestSession();
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_)).Times(1);
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kCommon));
@@ -534,13 +592,14 @@ TEST_F(ConnectionHandlerTest, OnApplicationFloodCallBack_SessionFound) {
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_));
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_));
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kFlood));
@@ -558,7 +617,7 @@ TEST_F(ConnectionHandlerTest, StartDevicesDiscovery) {
AddTestDeviceConnection();
AddTestSession();
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -599,7 +658,7 @@ TEST_F(ConnectionHandlerTest, UpdateDeviceList) {
// Precondition
AddTestDeviceConnection();
AddTestSession();
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -678,7 +737,7 @@ TEST_F(ConnectionHandlerTest, OnDeviceRemoved_ServiceNotStarted) {
connection_handler_->OnDeviceAdded(device1);
connection_handler_->OnDeviceAdded(device2);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -697,7 +756,7 @@ TEST_F(ConnectionHandlerTest, OnDeviceRemoved_ServiceStarted) {
const transport_manager::DeviceInfo device1(
device_handle_, mac_address_, device_name_, connection_type_);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -715,7 +774,7 @@ TEST_F(ConnectionHandlerTest, OnConnectionClosed) {
AddTestDeviceConnection();
AddTestSession();
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -732,7 +791,7 @@ TEST_F(ConnectionHandlerTest, OnUnexpectedDisconnect) {
AddTestDeviceConnection();
AddTestSession();
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
@@ -805,27 +864,41 @@ TEST_F(ConnectionHandlerTest, CloseSessionWithCommonReason) {
AddTestSession();
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kCommon))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kAudio, kCommon))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(connection_key_, kBulk, kCommon)).Times(1);
+ OnServiceEndedCallback(connection_key_, kBulk, kCommon))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(connection_key_, kRpc, kCommon)).Times(1);
+ OnServiceEndedCallback(connection_key_, kRpc, kCommon))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
connection_handler_->CloseSession(connection_key_, kCommon);
- Mock::AsyncVerifyAndClearExpectations(10000);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ConnectionHandlerTest, CloseSessionWithFloodReason) {
@@ -833,27 +906,41 @@ TEST_F(ConnectionHandlerTest, CloseSessionWithFloodReason) {
AddTestSession();
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kFlood))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(connection_key_, kAudio, kFlood)).Times(1);
+ OnServiceEndedCallback(connection_key_, kAudio, kFlood))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(connection_key_, kBulk, kFlood)).Times(1);
+ OnServiceEndedCallback(connection_key_, kBulk, kFlood))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(connection_key_, kRpc, kFlood)).Times(1);
+ OnServiceEndedCallback(connection_key_, kRpc, kFlood))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
connection_handler_->CloseSession(connection_key_, kFlood);
- Mock::AsyncVerifyAndClearExpectations(10000);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ConnectionHandlerTest, CloseSessionWithMalformedMessage) {
@@ -861,30 +948,39 @@ TEST_F(ConnectionHandlerTest, CloseSessionWithMalformedMessage) {
AddTestSession();
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(0);
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_)).Times(0);
+
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kAudio, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kBulk, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kRpc, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
connection_handler_->CloseSession(connection_key_, kMalformed);
- Mock::AsyncVerifyAndClearExpectations(10000);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithMalformedMessage) {
@@ -892,30 +988,39 @@ TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithMalformedMessage) {
AddTestSession();
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(0);
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_)).Times(0);
+
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kAudio, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kBulk, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kRpc, kMalformed))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
connection_handler_->CloseConnectionSessions(uid_, kMalformed);
- Mock::AsyncVerifyAndClearExpectations(10000);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithCommonReason) {
@@ -923,55 +1028,113 @@ TEST_F(ConnectionHandlerTest, CloseConnectionSessionsWithCommonReason) {
AddTestSession();
AddTestService(kAudio);
AddTestService(kMobileNav);
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendEndSession(uid_, start_session_id_))
- .Times(1);
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(mock_protocol_handler_,
+ SendEndSession(uid_, out_context_.new_session_id_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
InSequence seq;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kMobileNav, kCommon))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
OnServiceEndedCallback(connection_key_, kAudio, kCommon))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(connection_key_, kBulk, kCommon)).Times(1);
+ OnServiceEndedCallback(connection_key_, kBulk, kCommon))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceEndedCallback(connection_key_, kRpc, kCommon)).Times(1);
+ OnServiceEndedCallback(connection_key_, kRpc, kCommon))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
connection_handler_->CloseConnectionSessions(uid_, kCommon);
- Mock::AsyncVerifyAndClearExpectations(10000);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ConnectionHandlerTest, StartService_withServices) {
// Add virtual device and connection
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext audio_context, video_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&audio_context))
+ .WillOnce(SaveArg<0>(&video_context));
// 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_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, audio_context.new_session_id_);
+ CheckServiceExists(uid_, audio_context.new_session_id_, kAudio, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, audio_context.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_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, video_context.new_session_id_);
+ CheckServiceExists(uid_, video_context.new_session_id_, kMobileNav, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
+
+ connection_handler_->set_protocol_handler(NULL);
}
-TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) {
+TEST_F(ConnectionHandlerTest, StartService_withServices_withParams) {
AddTestDeviceConnection();
+ AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext video_context;
+ // create a dummy pointer
+ int dummy = 0;
+ std::vector<std::string> empty;
+ BsonObject* dummy_param = reinterpret_cast<BsonObject*>(&dummy);
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&video_context));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_param);
+ EXPECT_EQ(out_context_.new_session_id_, video_context.new_session_id_);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kMobileNav, true);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, video_context.hash_id_);
+
+ connection_handler_->set_protocol_handler(NULL);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) {
+ AddTestDeviceConnection();
+ uint32_t dummy_hash = 0u;
const uint32_t end_session_result =
- connection_handler_->OnSessionEndedCallback(uid_, 0u, 0u, kAudio);
+ connection_handler_->OnSessionEndedCallback(
+ uid_, 0u, &dummy_hash, kAudio);
EXPECT_EQ(0u, end_session_result);
CheckSessionExists(uid_, 0);
}
@@ -979,29 +1142,42 @@ TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) {
TEST_F(ConnectionHandlerTest, ServiceStop_UnExistService) {
AddTestDeviceConnection();
AddTestSession();
+ uint32_t dummy_hash = 0u;
const uint32_t end_session_result =
connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, 0u, kAudio);
+ uid_, out_context_.new_session_id_, &dummy_hash, kAudio);
EXPECT_EQ(0u, end_session_result);
- CheckServiceExists(uid_, start_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, false);
}
TEST_F(ConnectionHandlerTest, ServiceStop) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext audio_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillRepeatedly(SaveArg<0>(&audio_context));
+
// 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_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, audio_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, audio_context.hash_id_);
const uint32_t end_session_result =
connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, some_hash_id, kAudio);
+ uid_, out_context_.new_session_id_, &some_hash_id, kAudio);
EXPECT_EQ(connection_key_, end_session_result);
- CheckServiceExists(uid_, start_session_id_, kAudio, false);
+ CheckServiceExists(uid_, out_context_.new_session_id_, kAudio, false);
}
}
@@ -1010,17 +1186,18 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckHash) {
for (uint32_t session = 0; session < 0xFF; ++session) {
AddTestSession();
- const uint32_t hash = connection_key_;
- const uint32_t wrong_hash = hash + 1;
+ uint32_t hash = connection_key_;
+ uint32_t wrong_hash = hash + 1;
const uint32_t end_audio_wrong_hash =
connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, wrong_hash, kRpc);
+ uid_, out_context_.new_session_id_, &wrong_hash, kRpc);
EXPECT_EQ(0u, end_audio_wrong_hash);
- CheckSessionExists(uid_, start_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, wrong_hash);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
const uint32_t end_audio = connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, hash, kRpc);
+ uid_, out_context_.new_session_id_, &hash, kRpc);
EXPECT_EQ(connection_key_, end_audio);
CheckSessionExists(uid_, 0);
}
@@ -1031,17 +1208,18 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckSpecificHash) {
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;
+ uint32_t wrong_hash = protocol_handler::HASH_ID_WRONG;
+ 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);
+ uid_, out_context_.new_session_id_, &wrong_hash, kRpc);
EXPECT_EQ(0u, end_audio_wrong_hash);
- CheckSessionExists(uid_, start_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, wrong_hash);
+ CheckSessionExists(uid_, out_context_.new_session_id_);
const uint32_t end_audio = connection_handler_->OnSessionEndedCallback(
- uid_, start_session_id_, hash, kRpc);
+ uid_, out_context_.new_session_id_, &hash, kRpc);
EXPECT_EQ(connection_key_, end_audio);
CheckSessionExists(uid_, 0);
}
@@ -1050,22 +1228,221 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckSpecificHash) {
TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) {
// Add virtual device and connection
AddTestDeviceConnection();
+ out_context_.initial_session_id_ = 1u;
// Expect that rpc service has started
- connection_handler_test::ConnectionHandlerObserverMock
+ connection_handler_test::MockConnectionHandlerObserver
mock_connection_handler_observer;
connection_handler_->set_connection_handler_observer(
&mock_connection_handler_observer);
+ std::vector<std::string> empty;
uint32_t session_key =
- connection_handler_->KeyFromPair(uid_, start_session_id_);
+ connection_handler_->KeyFromPair(uid_, out_context_.initial_session_id_);
EXPECT_CALL(mock_connection_handler_observer,
- OnServiceStartedCallback(device_handle_, session_key, kRpc))
+ OnServiceStartedCallback(device_handle_, _, kRpc, NULL))
+ .WillOnce(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key,
+ true,
+ ByRef(empty)));
+
+ EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
.WillOnce(Return(true));
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&out_context_));
+
// Start new session with RPC service
- uint32_t new_session_id = connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+
+ EXPECT_NE(0u, out_context_.new_session_id_);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStarted_Video_SUCCESS) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ int dummy = 0;
+ BsonObject* dummy_params = reinterpret_cast<BsonObject*>(&dummy);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ uint32_t session_key =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ std::vector<std::string> empty;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key, kMobileNav, dummy_params))
+ .WillOnce(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key,
+ true,
+ ByRef(empty)));
+ EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
+ .WillOnce(Return(true));
+
+ // confirm that NotifySessionStarted() is called
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&out_context_));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+
+ EXPECT_NE(0u, out_context_.new_session_id_);
+}
+
+TEST_F(ConnectionHandlerTest, ServiceStarted_Video_FAILURE) {
+ AddTestDeviceConnection();
+ AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ int dummy = 0;
+ BsonObject* dummy_params = reinterpret_cast<BsonObject*>(&dummy);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ uint32_t session_key =
+ connection_handler_->KeyFromPair(uid_, out_context_.new_session_id_);
+ std::vector<std::string> empty;
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key, kMobileNav, dummy_params))
+ .WillOnce(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key,
+ false,
+ ByRef(empty)));
+ EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
+ .WillOnce(Return(true));
+
+ // confirm that NotifySessionStarted() is called
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&out_context_));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+
+ EXPECT_EQ(0u, out_context_.new_session_id_);
+}
+
+/*
+ * Simulate two OnSessionStartedCallback calls, and connection handler observer
+ * returns a positive reply for the first call with delay and a negative reply
+ * for the second call immediately.
+ */
+TEST_F(ConnectionHandlerTest, ServiceStarted_Video_Multiple) {
+ AddTestDeviceConnection();
+
+ SessionContext context_first, context_second;
+
+ protocol_handler_test::MockProtocolHandler temp_protocol_handler;
+ connection_handler_->set_protocol_handler(&temp_protocol_handler);
+ EXPECT_CALL(temp_protocol_handler, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context_first))
+ .WillOnce(SaveArg<0>(&context_second));
+
+ // add two sessions
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+
+ EXPECT_NE(0u, context_first.new_session_id_);
+ EXPECT_NE(0u, context_second.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, context_first.new_session_id_),
+ context_first.hash_id_);
+ EXPECT_EQ(SessionHash(uid_, context_second.new_session_id_),
+ context_second.hash_id_);
+ CheckSessionExists(uid_, context_first.new_session_id_);
+ CheckSessionExists(uid_, context_second.new_session_id_);
+
+ connection_handler_->set_protocol_handler(NULL);
- EXPECT_NE(0u, new_session_id);
+ int dummy = 0;
+ BsonObject* dummy_params = reinterpret_cast<BsonObject*>(&dummy);
+
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+ uint32_t session_key1 =
+ connection_handler_->KeyFromPair(uid_, context_first.new_session_id_);
+ uint32_t session_key2 =
+ connection_handler_->KeyFromPair(uid_, context_second.new_session_id_);
+
+ std::vector<std::string> empty;
+ ChangeProtocol(uid_,
+ context_first.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_3);
+ ChangeProtocol(uid_,
+ context_second.new_session_id_,
+ protocol_handler::PROTOCOL_VERSION_3);
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key1, kMobileNav, dummy_params))
+ // don't call NotifyServiceStartedResult() with this event
+ .Times(1);
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnServiceStartedCallback(
+ device_handle_, session_key2, kMobileNav, dummy_params))
+ // call NotifyServiceStartedResult() twice, first for the second session
+ // then for the first session
+ .WillOnce(DoAll(InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key2,
+ false,
+ ByRef(empty)),
+ InvokeMemberFuncWithArg3(
+ connection_handler_,
+ &ConnectionHandler::NotifyServiceStartedResult,
+ session_key1,
+ true,
+ ByRef(empty))));
+ EXPECT_CALL(mock_connection_handler_observer, CheckAppIsNavi(_))
+ .Times(2)
+ .WillRepeatedly(Return(true));
+
+ // verify that connection handler will not mix up the two results
+ SessionContext new_context_first, new_context_second;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, empty))
+ .WillOnce(SaveArg<0>(&new_context_second))
+ .WillOnce(SaveArg<0>(&new_context_first));
+
+ connection_handler_->OnSessionStartedCallback(uid_,
+ context_first.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ context_second.new_session_id_,
+ kMobileNav,
+ PROTECTION_OFF,
+ dummy_params);
+
+ EXPECT_NE(0u, new_context_first.new_session_id_); // result is positive
+ EXPECT_EQ(0u, new_context_second.new_session_id_); // result is negative
}
TEST_F(ConnectionHandlerTest,
@@ -1077,16 +1454,24 @@ TEST_F(ConnectionHandlerTest,
// Forbid start kRPC without encryption
protected_services_.push_back(kRpc);
SetSpecificServices();
+
+ SessionContext fail_context;
+ SessionContext positive_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&fail_context))
+ .WillOnce(SaveArg<0>(&positive_context));
+
// Start new session with RPC service
- const uint32_t session_id_fail =
- connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id_fail);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ EXPECT_EQ(0u, fail_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, fail_context.hash_id_);
#else
- EXPECT_EQ(1u, session_id_fail);
- EXPECT_EQ(SessionHash(uid_, session_id_fail), out_hash_id_);
+ EXPECT_EQ(1u, fail_context.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, fail_context.new_session_id_),
+ fail_context.hash_id_);
#endif // ENABLE_SECURITY
// Allow start kRPC without encryption
@@ -1094,11 +1479,13 @@ TEST_F(ConnectionHandlerTest,
protected_services_.push_back(kControl);
SetSpecificServices();
// 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_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_OFF, static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, positive_context.new_session_id_);
+ CheckService(
+ uid_, positive_context.new_session_id_, kRpc, NULL, PROTECTION_OFF);
+ EXPECT_EQ(SessionHash(uid_, positive_context.new_session_id_),
+ positive_context.hash_id_);
}
TEST_F(ConnectionHandlerTest,
@@ -1111,14 +1498,21 @@ TEST_F(ConnectionHandlerTest,
unprotected_services_.push_back(UnnamedService::kServedService2);
unprotected_services_.push_back(kControl);
SetSpecificServices();
+
+ SessionContext fail_context;
+ SessionContext positive_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&fail_context))
+ .WillOnce(SaveArg<0>(&positive_context));
+
// Start new session with RPC service
- const uint32_t session_id_fail =
- connection_handler_->OnSessionStartedCallback(
- uid_, 0, kRpc, PROTECTION_ON, NULL);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_ON, static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id_fail);
+ EXPECT_EQ(0u, fail_context.new_session_id_);
#else
- EXPECT_EQ(1u, session_id_fail);
+ EXPECT_EQ(1u, fail_context.new_session_id_);
#endif // ENABLE_SECURITY
// Allow start kRPC with encryption
@@ -1126,19 +1520,23 @@ TEST_F(ConnectionHandlerTest,
unprotected_services_.push_back(kControl);
SetSpecificServices();
// 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_);
+ connection_handler_->OnSessionStartedCallback(
+ uid_, 0, kRpc, PROTECTION_ON, static_cast<BsonObject*>(NULL));
+ EXPECT_NE(0u, positive_context.new_session_id_);
+ EXPECT_EQ(SessionHash(uid_, positive_context.new_session_id_),
+ positive_context.hash_id_);
// Protection steal FALSE because of APPlink Protocol implementation
- CheckService(uid_, session_id, kRpc, NULL, PROTECTION_OFF);
+ CheckService(
+ uid_, positive_context.new_session_id_, kRpc, NULL, PROTECTION_OFF);
}
TEST_F(ConnectionHandlerTest,
SessionStarted_StartService_SecureSpecific_Unprotect) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
// Forbid start kAudio without encryption
protected_services_.push_back(UnnamedService::kServedService1);
@@ -1146,13 +1544,23 @@ TEST_F(ConnectionHandlerTest,
protected_services_.push_back(UnnamedService::kServedService2);
protected_services_.push_back(kControl);
SetSpecificServices();
+
+ SessionContext context_first, context_second;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context_first))
+ .WillOnce(SaveArg<0>(&context_second));
+
// Start new session with Audio service
- const uint32_t session_id2 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id2);
+ EXPECT_EQ(0u, context_first.new_session_id_);
#else
- EXPECT_EQ(1u, session_id2);
+ EXPECT_EQ(1u, context_first.new_session_id_);
#endif // ENABLE_SECURITY
// Allow start kAudio without encryption
protected_services_.clear();
@@ -1161,16 +1569,20 @@ TEST_F(ConnectionHandlerTest,
protected_services_.push_back(UnnamedService::kServedService2);
protected_services_.push_back(kControl);
SetSpecificServices();
- const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
// 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);
+ EXPECT_EQ(out_context_.new_session_id_, context_second.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_second.hash_id_);
+ CheckService(
+ uid_, context_second.new_session_id_, kRpc, NULL, PROTECTION_OFF);
#else
- EXPECT_EQ(0u, session_id3);
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
+ EXPECT_EQ(0u, context_second.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_second.hash_id_);
#endif // ENABLE_SECURITY
}
@@ -1178,6 +1590,8 @@ TEST_F(ConnectionHandlerTest,
SessionStarted_StartService_SecureSpecific_Protect) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
// Forbid start kAudio with encryption
unprotected_services_.push_back(UnnamedService::kServedService1);
@@ -1185,69 +1599,104 @@ TEST_F(ConnectionHandlerTest,
unprotected_services_.push_back(UnnamedService::kServedService2);
unprotected_services_.push_back(kControl);
SetSpecificServices();
+
+ SessionContext rejected_context, positive_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&rejected_context))
+ .WillOnce(SaveArg<0>(&positive_context));
+
// Start new session with Audio service
- const uint32_t session_id_reject =
- connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_ON, NULL);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(0u, session_id_reject);
+ EXPECT_EQ(0u, rejected_context.new_session_id_);
#else
- EXPECT_EQ(1u, session_id_reject);
+ EXPECT_EQ(1u, rejected_context.new_session_id_);
#endif // ENABLE_SECURITY
// Allow start kAudio with encryption
unprotected_services_.clear();
SetSpecificServices();
- const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kAudio, PROTECTION_ON, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
// 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);
+ EXPECT_EQ(out_context_.new_session_id_, positive_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, positive_context.hash_id_);
+ CheckService(
+ uid_, positive_context.new_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);
+ EXPECT_EQ(0u, positive_context.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, positive_context.hash_id_);
+ CheckService(
+ uid_, positive_context.new_session_id_, kAudio, NULL, PROTECTION_OFF);
#endif // ENABLE_SECURITY
}
TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) {
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
+ SessionContext context_new, context_second, context_third;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&context_new))
+ .WillOnce(SaveArg<0>(&context_second))
+ .WillOnce(SaveArg<0>(&context_third));
// Start RPC protection
- const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kRpc, PROTECTION_ON, &out_hash_id_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kRpc,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(start_session_id_, session_id_new);
+ EXPECT_EQ(out_context_.new_session_id_, context_new.new_session_id_);
// 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);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_new.hash_id_);
+ CheckService(uid_, context_new.new_session_id_, kRpc, NULL, PROTECTION_ON);
#else
- EXPECT_EQ(0u, session_id_new);
+ EXPECT_EQ(0u, context_new.new_session_id_);
// Post protection nedd no hash
- EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_);
- CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_OFF);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_new.hash_id_);
+ CheckService(uid_, context_new.new_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);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_OFF,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, context_second.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_second.hash_id_);
+ CheckService(
+ uid_, context_second.new_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_);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#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);
+ EXPECT_EQ(out_context_.new_session_id_, context_third.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, context_third.hash_id_);
+ CheckService(
+ uid_, context_third.new_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);
+ EXPECT_EQ(0u, context_third.new_session_id_);
+ EXPECT_EQ(protocol_handler::HASH_ID_WRONG, context_third.hash_id_);
+ CheckService(
+ uid_, context_third.new_session_id_, kAudio, NULL, PROTECTION_OFF);
#endif // ENABLE_SECURITY
}
@@ -1255,14 +1704,21 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtectBulk) {
AddTestDeviceConnection();
AddTestSession();
- const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback(
- uid_, start_session_id_, kBulk, PROTECTION_ON, NULL);
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kBulk,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
#ifdef ENABLE_SECURITY
- EXPECT_EQ(start_session_id_, session_id_new);
- CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_ON);
+ EXPECT_EQ(out_context_.new_session_id_, new_context.new_session_id_);
+ CheckService(uid_, new_context.new_session_id_, kRpc, NULL, PROTECTION_ON);
#else
- EXPECT_EQ(0u, session_id_new);
- CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_OFF);
+ EXPECT_EQ(0u, new_context.new_session_id_);
+ CheckService(uid_, new_context.new_session_id_, kRpc, NULL, PROTECTION_OFF);
#endif // ENABLE_SECURITY
}
@@ -1341,6 +1797,9 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) {
testing::StrictMock<security_manager_test::MockSSLContext> mock_ssl_context;
AddTestDeviceConnection();
AddTestSession();
+ ChangeProtocol(
+ uid_, out_context_.new_session_id_, protocol_handler::PROTOCOL_VERSION_3);
+
EXPECT_EQ(
connection_handler_->SetSSLContext(connection_key_, &mock_ssl_context),
::security_manager::SecurityManager::ERROR_SUCCESS);
@@ -1351,11 +1810,24 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) {
// kAudio is not exists yet
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio),
reinterpret_cast<security_manager::SSLContext*>(NULL));
+
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+
// 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);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kAudio,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(new_context.new_session_id_, out_context_.new_session_id_);
+ CheckService(uid_,
+ new_context.new_session_id_,
+ kAudio,
+ &mock_ssl_context,
+ PROTECTION_ON);
// kAudio is not exists yet
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio),
@@ -1376,11 +1848,23 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedRPC) {
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
reinterpret_cast<security_manager::SSLContext*>(NULL));
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+
// 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);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kRpc,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, new_context.new_session_id_);
+ CheckService(uid_,
+ new_context.new_session_id_,
+ kRpc,
+ &mock_ssl_context,
+ PROTECTION_ON);
// kRpc is protected
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
@@ -1404,11 +1888,23 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedBulk) {
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
reinterpret_cast<security_manager::SSLContext*>(NULL));
+ SessionContext new_context;
+ connection_handler_->set_protocol_handler(&mock_protocol_handler_);
+ EXPECT_CALL(mock_protocol_handler_, NotifySessionStarted(_, _))
+ .WillOnce(SaveArg<0>(&new_context));
+
// 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);
+ connection_handler_->OnSessionStartedCallback(uid_,
+ out_context_.new_session_id_,
+ kBulk,
+ PROTECTION_ON,
+ static_cast<BsonObject*>(NULL));
+ EXPECT_EQ(out_context_.new_session_id_, new_context.new_session_id_);
+ CheckService(uid_,
+ new_context.new_session_id_,
+ kRpc,
+ &mock_ssl_context,
+ PROTECTION_ON);
// kRpc is protected
EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc),
@@ -1424,8 +1920,9 @@ TEST_F(ConnectionHandlerTest, SendHeartBeat) {
AddTestDeviceConnection();
AddTestSession();
connection_handler_->set_protocol_handler(&mock_protocol_handler_);
- EXPECT_CALL(mock_protocol_handler_, SendHeartBeat(uid_, start_session_id_));
- connection_handler_->SendHeartBeat(uid_, start_session_id_);
+ EXPECT_CALL(mock_protocol_handler_,
+ SendHeartBeat(uid_, out_context_.new_session_id_));
+ connection_handler_->SendHeartBeat(uid_, out_context_.new_session_id_);
}
TEST_F(ConnectionHandlerTest, RunAppOnDevice_NoAppOnDevice_UNSUCCESS) {
@@ -1462,6 +1959,41 @@ TEST_F(ConnectionHandlerTest, RunAppOnDevice_AppOnDevice_SUCCESS) {
connection_handler_->RunAppOnDevice(hash_of_mac_address, bundle_id);
}
+TEST_F(ConnectionHandlerTest, OnDeviceConnectionSwitching) {
+ connection_handler_test::MockConnectionHandlerObserver
+ mock_connection_handler_observer;
+ connection_handler_->set_connection_handler_observer(
+ &mock_connection_handler_observer);
+
+ const transport_manager::DeviceInfo device_info_1(
+ device_handle_, mac_address_, device_name_, connection_type_);
+
+ connection_handler_->OnDeviceAdded(device_info_1);
+
+ const auto second_mac_address = "second_mac_address";
+ const transport_manager::DeviceInfo device_info_2(device_handle_ + 1,
+ second_mac_address,
+ "second_device_name",
+ "second_connection_type");
+
+ connection_handler_->OnDeviceAdded(device_info_2);
+
+ connection_handler::Device d1(device_info_1.device_handle(),
+ device_info_1.name(),
+ device_info_1.mac_address(),
+ device_info_1.connection_type());
+
+ connection_handler::Device d2(device_info_2.device_handle(),
+ device_info_2.name(),
+ device_info_2.mac_address(),
+ device_info_2.connection_type());
+
+ EXPECT_CALL(mock_connection_handler_observer,
+ OnDeviceSwitchingStart(SameDevice(d1), SameDevice(d2)));
+
+ connection_handler_->OnDeviceSwitchingStart(mac_address_, second_mac_address);
+}
+
} // namespace connection_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc
index e36e9aa65c..5fd6b40e0e 100644
--- a/src/components/connection_handler/test/connection_test.cc
+++ b/src/components/connection_handler/test/connection_test.cc
@@ -71,6 +71,11 @@ class ConnectionTest : public ::testing::Test {
delete connection_handler_;
}
void StartSession() {
+ StartDefaultSession();
+ connection_->UpdateProtocolVersionSession(
+ session_id, protocol_handler::PROTOCOL_VERSION_3);
+ }
+ void StartDefaultSession() {
session_id = connection_->AddNewSession();
EXPECT_NE(session_id, 0u);
const SessionMap sessionMap = connection_->session_map();
@@ -142,13 +147,13 @@ TEST_F(ConnectionTest, Session_TryGetProtocolVersionWithoutSession) {
}
TEST_F(ConnectionTest, Session_GetDefaultProtocolVersion) {
- StartSession();
+ StartDefaultSession();
uint8_t protocol_version;
EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
EXPECT_EQ(static_cast<uint8_t>(PROTOCOL_VERSION_2), protocol_version);
}
TEST_F(ConnectionTest, Session_UpdateProtocolVersion) {
- StartSession();
+ StartDefaultSession();
uint8_t protocol_version = static_cast<uint8_t>(PROTOCOL_VERSION_3);
connection_->UpdateProtocolVersionSession(session_id, protocol_version);
EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
@@ -157,7 +162,7 @@ TEST_F(ConnectionTest, Session_UpdateProtocolVersion) {
TEST_F(ConnectionTest, HeartBeat_NotSupported) {
// Arrange
- StartSession();
+ StartDefaultSession();
uint8_t protocol_version;
EXPECT_TRUE(connection_->ProtocolVersion(session_id, protocol_version));
EXPECT_EQ(static_cast<uint8_t>(PROTOCOL_VERSION_2), protocol_version);
@@ -201,6 +206,32 @@ TEST_F(ConnectionTest, HeartBeat_Protocol4_ZeroHeartBeat_NotSupported) {
EXPECT_FALSE(connection_->SupportHeartBeat(session_id));
}
+TEST_F(ConnectionTest, HeartBeat_Protocol5_PositiveHeartBeat_Supported) {
+ // Arrange
+ StartSession();
+ // Check execution if protocol version is 5
+ const uint8_t protocol_version = static_cast<uint8_t>(PROTOCOL_VERSION_5);
+ connection_->UpdateProtocolVersionSession(session_id, protocol_version);
+ EXPECT_TRUE(connection_->SupportHeartBeat(session_id));
+}
+
+TEST_F(ConnectionTest, HeartBeat_Protocol5_ZeroHeartBeat_NotSupported) {
+ // Correctc of connection (need connection with heartbeat=0)
+ delete connection_;
+ connection_ = 0;
+
+ const ConnectionHandle connectionHandle = 0;
+ const DeviceHandle device_handle = 0u;
+ const uint32_t heart_beat = 0u;
+ connection_ = new Connection(
+ connectionHandle, device_handle, connection_handler_, heart_beat);
+ StartSession();
+ // Check execution if protocol version is 5
+ const uint8_t protocol_version = static_cast<uint8_t>(PROTOCOL_VERSION_5);
+ connection_->UpdateProtocolVersionSession(session_id, protocol_version);
+ EXPECT_FALSE(connection_->SupportHeartBeat(session_id));
+}
+
// Try to add service without session
TEST_F(ConnectionTest, Session_AddNewServiceWithoutSession) {
EXPECT_EQ(connection_->AddNewService(session_id, kAudio, true),
@@ -462,6 +493,6 @@ TEST_F(ConnectionTest, SetProtectionFlagForBulk) {
#endif // ENABLE_SECURITY
-} // namespace connection_handle
+} // namespace connection_handler_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/test/device_test.cc b/src/components/connection_handler/test/device_test.cc
index ea9aa746b5..8c6d0af57a 100644
--- a/src/components/connection_handler/test/device_test.cc
+++ b/src/components/connection_handler/test/device_test.cc
@@ -36,7 +36,7 @@
namespace test {
namespace components {
-namespace connection_handle {
+namespace connection_handler_test {
using namespace connection_handler;
TEST(ConnectionDevice, CompareDevicesWithDifferentMacAddresses) {
@@ -75,6 +75,6 @@ TEST(ConnectionDevice, MacAddressHash) {
EXPECT_EQ(hashed_mac_address, test_device.mac_address());
}
-} // namespace connection_handle
+} // namespace connection_handlet_test
} // namespace components
} // namespace test
diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc
index 2c928fe458..4c67c97191 100644
--- a/src/components/connection_handler/test/heart_beat_monitor_test.cc
+++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc
@@ -37,6 +37,7 @@
#include "connection_handler/connection.h"
#include "connection_handler/connection_handler.h"
#include "connection_handler/mock_connection_handler.h"
+#include "utils/test_async_waiter.h"
namespace {
const int32_t MILLISECONDS_IN_SECOND = 1000;
@@ -47,6 +48,8 @@ const int32_t MICROSECONDS_IN_SECOND = 1000 * 1000;
namespace test {
namespace components {
namespace connection_handler_test {
+
+using ::testing::DoAll;
using ::testing::_;
class HeartBeatMonitorTest : public testing::Test {
@@ -83,8 +86,6 @@ TEST_F(HeartBeatMonitorTest, TimerNotStarted) {
EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0);
conn->AddNewSession();
- testing::Mock::AsyncVerifyAndClearExpectations(
- kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
}
TEST_F(HeartBeatMonitorTest, TimerNotElapsed) {
@@ -94,21 +95,29 @@ TEST_F(HeartBeatMonitorTest, TimerNotElapsed) {
const uint32_t session = conn->AddNewSession();
conn->StartHeartBeat(session);
- testing::Mock::AsyncVerifyAndClearExpectations(
- kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
}
TEST_F(HeartBeatMonitorTest, TimerElapsed) {
const uint32_t session = conn->AddNewSession();
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(connection_handler_mock, CloseSession(_, session, _))
- .WillOnce(RemoveSession(conn, session));
- EXPECT_CALL(connection_handler_mock, CloseConnection(_));
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, session)));
+ times++;
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
conn->StartHeartBeat(session);
- testing::Mock::AsyncVerifyAndClearExpectations(
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
+
+ EXPECT_TRUE(waiter.WaitFor(
+ times,
+ 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, KeptAlive) {
@@ -130,10 +139,18 @@ TEST_F(HeartBeatMonitorTest, KeptAlive) {
TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
const uint32_t session = conn->AddNewSession();
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session));
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(connection_handler_mock, CloseSession(_, session, _))
- .WillOnce(RemoveSession(conn, session));
- EXPECT_CALL(connection_handler_mock, CloseConnection(_));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, session)));
+ times++;
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
conn->StartHeartBeat(session);
usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
@@ -143,24 +160,42 @@ TEST_F(HeartBeatMonitorTest, NotKeptAlive) {
usleep(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND);
conn->KeepAlive(session);
usleep(2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
+
+ EXPECT_TRUE(waiter.WaitFor(
+ times,
+ 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) {
const uint32_t kSession1 = conn->AddNewSession();
const uint32_t kSession2 = conn->AddNewSession();
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession1, _))
- .WillOnce(RemoveSession(conn, kSession1));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(conn, kSession1)));
+ times++;
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));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ RemoveSession(conn, kSession2)));
+ times++;
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession1))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession2))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
conn->StartHeartBeat(kSession1);
conn->StartHeartBeat(kSession2);
- testing::Mock::AsyncVerifyAndClearExpectations(
- 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND);
+
+ EXPECT_TRUE(waiter.WaitFor(
+ times,
+ 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
@@ -173,25 +208,31 @@ TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) {
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
- testing::Mock::AsyncVerifyAndClearExpectations(kTimeout *
- MICROSECONDS_IN_MILLISECONDS);
}
TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) {
const uint32_t kSession = conn->AddNewSession();
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(connection_handler_mock, CloseSession(_, kSession, _))
- .WillOnce(RemoveSession(conn, kSession));
- EXPECT_CALL(connection_handler_mock, CloseConnection(_));
- EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), RemoveSession(conn, kSession)));
+ times++;
+ EXPECT_CALL(connection_handler_mock, CloseConnection(_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+ EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, kSession))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
const uint32_t kNewTimeout = kTimeout - MICROSECONDS_IN_MILLISECONDS;
conn->StartHeartBeat(kSession);
conn->SetHeartBeatTimeout(kNewTimeout, kSession);
- // new timeout less than old timeout so mock object should be invoked
- testing::Mock::AsyncVerifyAndClearExpectations(kTimeout * 2 *
- MICROSECONDS_IN_MILLISECONDS);
+
+ EXPECT_TRUE(waiter.WaitFor(
+ times,
+ 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND));
}
} // namespace connection_handler_test
diff --git a/src/components/connection_handler/test/include/connection_handler/connection_handler_observer_mock.h b/src/components/connection_handler/test/include/connection_handler/connection_handler_observer_mock.h
deleted file mode 100644
index aa22f1aa1c..0000000000
--- a/src/components/connection_handler/test/include/connection_handler/connection_handler_observer_mock.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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/dbus/CMakeLists.txt b/src/components/dbus/CMakeLists.txt
index 7e7f2af787..26ff9373bf 100644
--- a/src/components/dbus/CMakeLists.txt
+++ b/src/components/dbus/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,6 +28,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${DBUS_INCLUDE_DIRS}
@@ -40,23 +41,25 @@ include_directories (
${CMAKE_BINARY_DIR}/src/components/
)
-set (SOURCES
- ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/introspection_xml.cc
${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_adapter.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_message.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/src/dbus_message_controller.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/src/schema.cc
)
+collect_sources(SOURCES "${PATHS}")
-set (LIBRARIES dbus-1 -L${DBUS_LIBS_DIRECTORY})
-
+set(LIBRARIES
+ HMI_API
+ Utils
+ dbus-1
+)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/message_descriptions.cc
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
- --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
+ --outdir ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_message_descriptions.py
)
@@ -64,14 +67,13 @@ add_custom_command(
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/introspection_xml.cc
COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
- --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
- --outdir ${CMAKE_CURRENT_BINARY_DIR}
+ --infile ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
+ --outdir ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/QT_HMI_API.xml
${CMAKE_CURRENT_SOURCE_DIR}/codegen/make_introspection_c.py
)
add_library("DBus" ${SOURCES})
-ADD_DEPENDENCIES("DBus" Utils install-3rd_party_dbus)
target_link_libraries("DBus" "${LIBRARIES}")
diff --git a/src/components/dbus/codegen/introspection_xml.cc b/src/components/dbus/codegen/introspection_xml.cc
new file mode 100644
index 0000000000..210c232a4d
--- /dev/null
+++ b/src/components/dbus/codegen/introspection_xml.cc
@@ -0,0 +1,327 @@
+// Warning! This file is generated by 'make_introspection_c.py'. Edit at your
+// own risk.
+/**
+ * @file instrospections_xml.cc
+ * @brief D-Bus introspection XML as C-string
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+char introspection_xml[] = {
+ 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x6e, 0x6f,
+ 0x64, 0x65, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d,
+ 0x2f, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f,
+ 0x70, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x44, 0x2d, 0x42, 0x55, 0x53,
+ 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x72,
+ 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e,
+ 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70,
+ 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64,
+ 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x73,
+ 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x64, 0x62, 0x75,
+ 0x73, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73,
+ 0x70, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c,
+ 0x6e, 0x6f, 0x64, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x2f,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6f, 0x72, 0x64, 0x2f, 0x68, 0x6d, 0x69,
+ 0x22, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x66,
+ 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64, 0x6c, 0x2e,
+ 0x42, 0x61, 0x73, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x3c, 0x73, 0x69, 0x67,
+ 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
+ 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
+ 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69,
+ 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
+ 0x6e, 0x53, 0x44, 0x4c, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
+ 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x52,
+ 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x73,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
+ 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61,
+ 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x67,
+ 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
+ 0x29, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62, 0x29,
+ 0x29, 0x73, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x28, 0x62,
+ 0x61, 0x73, 0x29, 0x69, 0x69, 0x62, 0x28, 0x62, 0x61, 0x69, 0x29, 0x28,
+ 0x62, 0x62, 0x29, 0x28, 0x62, 0x61, 0x69, 0x29, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x74, 0x74, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x76, 0x72, 0x53, 0x79, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x73,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x73,
+ 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x56, 0x72,
+ 0x47, 0x72, 0x61, 0x6d, 0x6d, 0x61, 0x72, 0x73, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x70,
+ 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c,
+ 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67,
+ 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
+ 0x41, 0x70, 0x70, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
+ 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
+ 0x65, 0x64, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6e,
+ 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6c,
+ 0x6f, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x50,
+ 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69,
+ 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x20,
+ 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20,
+ 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x79, 0x6e, 0x63,
+ 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65,
+ 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
+ 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f,
+ 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69,
+ 0x2e, 0x73, 0x64, 0x6c, 0x2e, 0x55, 0x49, 0x22, 0x3e, 0x3c, 0x73, 0x69,
+ 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
+ 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74,
+ 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67,
+ 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,
+ 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
+ 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d,
+ 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64,
+ 0x6c, 0x2e, 0x53, 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x41, 0x63, 0x74,
+ 0x69, 0x76, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
+ 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
+ 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x53, 0x44,
+ 0x4c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
+ 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28,
+ 0x62, 0x62, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
+ 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x69, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64,
+ 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50,
+ 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
+ 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
+ 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69,
+ 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29,
+ 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41,
+ 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
+ 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x69, 0x65, 0x6e,
+ 0x64, 0x6c, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64,
+ 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x73,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
+ 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
+ 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
+ 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x28, 0x62, 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
+ 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
+ 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74,
+ 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73,
+ 0x74, 0x4f, 0x66, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
+ 0x6e, 0x73, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64,
+ 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
+ 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,
+ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62,
+ 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
+ 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f,
+ 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
+ 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
+ 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43,
+ 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
+ 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c,
+ 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x47, 0x65, 0x74, 0x55, 0x52, 0x4c, 0x53, 0x22, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22,
+ 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72,
+ 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
+ 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f,
+ 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x72,
+ 0x6c, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
+ 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x73,
+ 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
+ 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72,
+ 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x76, 0x6f,
+ 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
+ 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76,
+ 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
+ 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29, 0x29, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74,
+ 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
+ 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70,
+ 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61,
+ 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6f,
+ 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62,
+ 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74,
+ 0x75, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e,
+ 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e,
+ 0x3c, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3e, 0x00}; \ No newline at end of file
diff --git a/src/components/dbus/include/dbus/dbus_adapter.h b/src/components/dbus/include/dbus/dbus_adapter.h
index 3877649e10..42a2ac1140 100644
--- a/src/components/dbus/include/dbus/dbus_adapter.h
+++ b/src/components/dbus/include/dbus/dbus_adapter.h
@@ -35,6 +35,7 @@
#include <string>
#include "smart_objects/smart_object.h"
#include "dbus/schema.h"
+#include "dbus/message_descriptions.h"
struct DBusConnection;
struct DBusMessage;
@@ -42,8 +43,6 @@ struct DBusMessageIter;
namespace dbus {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
/**
* \brief class for work with DBus
*/
diff --git a/src/components/dbus/include/dbus/dbus_message.h b/src/components/dbus/include/dbus/dbus_message.h
index 10f419f445..23e672d0fc 100644
--- a/src/components/dbus/include/dbus/dbus_message.h
+++ b/src/components/dbus/include/dbus/dbus_message.h
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DBUS_DBUS_MESSAGE_H
-#define DBUS_DBUS_MESSAGE_H
+#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
+#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
#include <stdint.h>
#include <string>
@@ -176,4 +176,4 @@ MessageRef Signal(const char* path, const char* interface, const char* name);
#include "dbus/dbus_message_inl.h"
-#endif // DBUS_DBUS_MESSAGE_H
+#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_H_
diff --git a/src/components/dbus/include/dbus/dbus_message_controller.h b/src/components/dbus/include/dbus/dbus_message_controller.h
index 0d0638d84f..a4a3718ce3 100644
--- a/src/components/dbus/include/dbus/dbus_message_controller.h
+++ b/src/components/dbus/include/dbus/dbus_message_controller.h
@@ -36,19 +36,18 @@
#include <string>
#include <map>
#include "dbus/dbus_adapter.h"
+#include "smart_objects/smart_object.h"
namespace dbus {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
class DBusMessageController : public DBusAdapter {
public:
/**
- * \brief constructs DBus message controller
- * \param sdlServiceName name of service SDL
- * \param sdlObjectPath path of object SDL
- * \param hmiServiceName name of service HMI
- * \param hmiObjectPath path of object HMI
+ * @brief constructs DBus message controller
+ * @param sdlServiceName name of service SDL
+ * @param sdlObjectPath path of object SDL
+ * @param hmiServiceName name of service HMI
+ * @param hmiObjectPath path of object HMI
*/
DBusMessageController(const std::string& sdlServiceName,
const std::string& sdlObjectPath,
@@ -56,28 +55,41 @@ class DBusMessageController : public DBusAdapter {
const std::string& hmiObjectPath);
/**
- * \brief destructs DBus message controller
+ * @brief destructs DBus message controller
*/
virtual ~DBusMessageController();
/**
- * \brief subscribes to the DBus signal.
- * \param interface name of interface in HMI
- * \param signal name of signal
+ * @brief subscribes to the DBus signal.
+ * @param interface name of interface in HMI
+ * @param signal name of signal
*/
void SubscribeTo(const std::string& interface, const std::string& signal);
/**
- * \brief Method for receiving thread.
+ * @brief Method for receiving thread.
*/
void* MethodForReceiverThread(void*);
+ /**
+ * @brief Main thread loop.
+ */
+ bool Run();
+
+ /**
+ * @brief Signal shutdown for thread loop.
+ */
+ void Shutdown();
+
protected:
/**
- * \brief sends message to core
- * \param obj
+ * @brief sends message to core
+ * @param obj
*/
virtual void SendMessageToCore(const smart_objects::SmartObject& obj) = 0;
+
+ private:
+ bool shutdown_;
};
} // namespace dbus
diff --git a/src/components/dbus/include/dbus/dbus_message_inl.h b/src/components/dbus/include/dbus/dbus_message_inl.h
index 1a10f828de..ba9bfaa78d 100644
--- a/src/components/dbus/include/dbus/dbus_message_inl.h
+++ b/src/components/dbus/include/dbus/dbus_message_inl.h
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DBUS_MESSAGE_INL_H
-#define DBUS_MESSAGE_INL_H
+#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
+#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
#include "dbus/dbus_message.h"
@@ -211,4 +211,4 @@ inline void MessageWriter::PutString(const std::string& value) {
} // namespace dbus
-#endif // DBUS_MESSAGE_INL_H
+#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_DBUS_MESSAGE_INL_H_
diff --git a/src/components/dbus/include/dbus/schema.h b/src/components/dbus/include/dbus/schema.h
index e269bd2596..3dfe49cc95 100644
--- a/src/components/dbus/include/dbus/schema.h
+++ b/src/components/dbus/include/dbus/schema.h
@@ -29,8 +29,8 @@
* 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_
+#ifndef SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
+#define SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
#include <string>
#include <vector>
@@ -95,4 +95,4 @@ class DBusSchema {
} // namespace dbus
-#endif // SRC_COMPONENTS_DBUS_SCHEMA_INCLUDE_DBUS_SCHEMA_SCHEMA_H_
+#endif // SRC_COMPONENTS_DBUS_INCLUDE_DBUS_SCHEMA_H_
diff --git a/src/components/dbus/src/dbus_adapter.cc b/src/components/dbus/src/dbus_adapter.cc
index b4f4b86dd2..33d05a728b 100644
--- a/src/components/dbus/src/dbus_adapter.cc
+++ b/src/components/dbus/src/dbus_adapter.cc
@@ -33,12 +33,14 @@
#include "dbus/dbus_adapter.h"
#include <dbus/dbus.h>
#include <sstream>
-#include "formatters/CSmartFactory.hpp"
+#include "formatters/CSmartFactory.h"
#include "utils/logger.h"
+#include "smart_objects/smart_object.h"
+#include "introspection_xml.cc"
+#include "message_descriptions.cc"
using ford_message_descriptions::ParameterDescription;
namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
extern char introspection_xml[];
@@ -516,7 +518,8 @@ bool DBusAdapter::SetValue(
dbus_int32_t integerValue = 0;
double floatValue = 0;
dbus_bool_t booleanValue = false;
- const char* stringValue;
+ std::string stringValue;
+ const char* cStringValue;
switch (rules->type) {
case ford_message_descriptions::ParameterType::Array:
return SetArrayValue(
@@ -550,8 +553,9 @@ bool DBusAdapter::SetValue(
break;
case ford_message_descriptions::ParameterType::String:
type = DBUS_TYPE_STRING;
- stringValue = param.asString().c_str();
- value = &stringValue;
+ stringValue = param.asString();
+ cStringValue = stringValue.c_str();
+ value = &cStringValue;
break;
default:
LOG4CXX_ERROR(logger_, "DBus: Unknown type of argument");
diff --git a/src/components/dbus/src/dbus_message_controller.cc b/src/components/dbus/src/dbus_message_controller.cc
index 166037e900..59f08d6695 100644
--- a/src/components/dbus/src/dbus_message_controller.cc
+++ b/src/components/dbus/src/dbus_message_controller.cc
@@ -31,7 +31,7 @@
*/
#include "dbus/dbus_message_controller.h"
-#include "formatters/CSmartFactory.hpp"
+#include "formatters/CSmartFactory.h"
namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
@@ -41,8 +41,8 @@ DBusMessageController::DBusMessageController(const std::string& sdlServiceName,
const std::string& sdlObjectPath,
const std::string& hmiServiceName,
const std::string& hmiObjectPath)
- : DBusAdapter(
- sdlServiceName, sdlObjectPath, hmiServiceName, hmiObjectPath) {}
+ : DBusAdapter(sdlServiceName, sdlObjectPath, hmiServiceName, hmiObjectPath)
+ , shutdown_(false) {}
void DBusMessageController::SubscribeTo(const std::string& interface,
const std::string& signal) {
@@ -67,7 +67,12 @@ void DBusMessageController::SubscribeTo(const std::string& interface,
DBusMessageController::~DBusMessageController() {}
void* DBusMessageController::MethodForReceiverThread(void*) {
- while (true) {
+ Run();
+ return NULL;
+}
+
+bool DBusMessageController::Run() {
+ while (!shutdown_) {
smart_objects::SmartObject obj(smart_objects::SmartType_Map);
obj[sos::S_PARAMS][sos::S_PROTOCOL_VERSION] = 2;
obj[sos::S_PARAMS][sos::S_PROTOCOL_TYPE] = 1;
@@ -75,7 +80,11 @@ void* DBusMessageController::MethodForReceiverThread(void*) {
SendMessageToCore(obj);
}
}
- return NULL;
+ return true;
+}
+
+void DBusMessageController::Shutdown() {
+ shutdown_ = true;
}
} // namespace dbus
diff --git a/src/components/dbus/src/introspection_xml.cc b/src/components/dbus/src/introspection_xml.cc
new file mode 100644
index 0000000000..210c232a4d
--- /dev/null
+++ b/src/components/dbus/src/introspection_xml.cc
@@ -0,0 +1,327 @@
+// Warning! This file is generated by 'make_introspection_c.py'. Edit at your
+// own risk.
+/**
+ * @file instrospections_xml.cc
+ * @brief D-Bus introspection XML as C-string
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+char introspection_xml[] = {
+ 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x6e, 0x6f,
+ 0x64, 0x65, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d,
+ 0x2f, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x65, 0x73, 0x6b, 0x74, 0x6f,
+ 0x70, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x44, 0x2d, 0x42, 0x55, 0x53,
+ 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x49, 0x6e, 0x74, 0x72,
+ 0x6f, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e,
+ 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70,
+ 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64,
+ 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x73,
+ 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x2f, 0x64, 0x62, 0x75,
+ 0x73, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x73,
+ 0x70, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c,
+ 0x6e, 0x6f, 0x64, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x2f,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x6f, 0x72, 0x64, 0x2f, 0x68, 0x6d, 0x69,
+ 0x22, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x66,
+ 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64, 0x6c, 0x2e,
+ 0x42, 0x61, 0x73, 0x69, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x3c, 0x73, 0x69, 0x67,
+ 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
+ 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
+ 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69,
+ 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
+ 0x6e, 0x53, 0x44, 0x4c, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
+ 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x52,
+ 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x73,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
+ 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61,
+ 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x52, 0x65, 0x67,
+ 0x69, 0x73, 0x74, 0x65, 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
+ 0x29, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62, 0x29,
+ 0x29, 0x73, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x28, 0x62,
+ 0x61, 0x73, 0x29, 0x69, 0x69, 0x62, 0x28, 0x62, 0x61, 0x69, 0x29, 0x28,
+ 0x62, 0x62, 0x29, 0x28, 0x62, 0x61, 0x69, 0x29, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x74, 0x74, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x29, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x76, 0x72, 0x53, 0x79, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x73,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61, 0x73,
+ 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x56, 0x72,
+ 0x47, 0x72, 0x61, 0x6d, 0x6d, 0x61, 0x72, 0x73, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x70,
+ 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c,
+ 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67,
+ 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e,
+ 0x41, 0x70, 0x70, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
+ 0x72, 0x65, 0x64, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74,
+ 0x65, 0x64, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x50, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6e,
+ 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x74, 0x68, 0x6f,
+ 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6c,
+ 0x6f, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x50,
+ 0x75, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69,
+ 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x20,
+ 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20,
+ 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x79, 0x6e, 0x63,
+ 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x73, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x66, 0x69, 0x6c, 0x65,
+ 0x54, 0x79, 0x70, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65,
+ 0x6e, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f,
+ 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x63, 0x6f, 0x6d, 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69,
+ 0x2e, 0x73, 0x64, 0x6c, 0x2e, 0x55, 0x49, 0x22, 0x3e, 0x3c, 0x73, 0x69,
+ 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f,
+ 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74,
+ 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67,
+ 0x6e, 0x61, 0x6c, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,
+ 0x61, 0x63, 0x65, 0x3e, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61,
+ 0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6d,
+ 0x2e, 0x66, 0x6f, 0x72, 0x64, 0x2e, 0x68, 0x6d, 0x69, 0x2e, 0x73, 0x64,
+ 0x6c, 0x2e, 0x53, 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x41, 0x63, 0x74,
+ 0x69, 0x76, 0x61, 0x74, 0x65, 0x41, 0x70, 0x70, 0x22, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x61, 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
+ 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
+ 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x53, 0x44,
+ 0x4c, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
+ 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28,
+ 0x62, 0x62, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
+ 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x69, 0x73, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e,
+ 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64,
+ 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50,
+ 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
+ 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
+ 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69,
+ 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29,
+ 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41,
+ 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x62, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
+ 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x46, 0x72, 0x69, 0x65, 0x6e,
+ 0x64, 0x6c, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x64,
+ 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x73,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
+ 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64,
+ 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75,
+ 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74,
+ 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
+ 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x28, 0x62, 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
+ 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73, 0x29, 0x28, 0x62, 0x73,
+ 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74,
+ 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73,
+ 0x74, 0x4f, 0x66, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
+ 0x6e, 0x73, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x49, 0x44, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f, 0x64,
+ 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
+ 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,
+ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62,
+ 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x3e, 0x3c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53,
+ 0x44, 0x4c, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43, 0x6f,
+ 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x6d,
+ 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69,
+ 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74,
+ 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72, 0x65, 0x74, 0x43,
+ 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x64, 0x69, 0x72,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f, 0x75, 0x74, 0x22,
+ 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20,
+ 0x2f, 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c,
+ 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x22, 0x47, 0x65, 0x74, 0x55, 0x52, 0x4c, 0x53, 0x22, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x22, 0x69, 0x6e, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67,
+ 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22,
+ 0x6f, 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x72,
+ 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
+ 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x6f,
+ 0x75, 0x74, 0x22, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x75, 0x72,
+ 0x6c, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62,
+ 0x61, 0x28, 0x73, 0x28, 0x62, 0x73, 0x29, 0x29, 0x29, 0x22, 0x20, 0x2f,
+ 0x3e, 0x3c, 0x2f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3e, 0x3c, 0x73,
+ 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x4f, 0x6e, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73,
+ 0x69, 0x6f, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0x3e,
+ 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61,
+ 0x70, 0x70, 0x49, 0x44, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22,
+ 0x69, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x73, 0x41, 0x70, 0x70, 0x50, 0x65, 0x72,
+ 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x76, 0x6f,
+ 0x6b, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
+ 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76,
+ 0x6f, 0x6b, 0x65, 0x64, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28,
+ 0x62, 0x61, 0x28, 0x73, 0x69, 0x28, 0x62, 0x62, 0x29, 0x29, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x61, 0x70, 0x70, 0x52, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
+ 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74,
+ 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61,
+ 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x61, 0x70, 0x70,
+ 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64,
+ 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x62, 0x29,
+ 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3d, 0x22, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22,
+ 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x69, 0x29, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70,
+ 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x28, 0x62, 0x61,
+ 0x69, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x44, 0x4c, 0x43, 0x6f,
+ 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x22,
+ 0x3e, 0x3c, 0x61, 0x72, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22,
+ 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x28, 0x73, 0x73, 0x28, 0x62, 0x69, 0x29, 0x28, 0x62, 0x62,
+ 0x29, 0x29, 0x22, 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e,
+ 0x61, 0x6c, 0x3e, 0x3c, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x20, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x4f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x61, 0x72,
+ 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x74, 0x61, 0x74,
+ 0x75, 0x73, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x69, 0x22,
+ 0x20, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x3e,
+ 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e,
+ 0x3c, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x3e, 0x00}; \ No newline at end of file
diff --git a/src/components/dbus/src/message_descriptions.cc b/src/components/dbus/src/message_descriptions.cc
new file mode 100644
index 0000000000..1a5e499a7f
--- /dev/null
+++ b/src/components/dbus/src/message_descriptions.cc
@@ -0,0 +1,10424 @@
+// Warning! This file is generated by 'make_message_descriptions.py'. Edit at
+// your own risk.
+/**
+ * @file message_descriptions.cc
+ * @brief Generated HMI API message descriptions for D-Bus
+ *
+ * This file is a part of HMI D-Bus layer.
+ */
+// Copyright (c) 2013, Ford Motor Company
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+//
+// Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided with the
+// distribution.
+//
+// Neither the name of the Ford Motor Company nor the names of its contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 'A PARTICULAR PURPOSE
+// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+
+#include "dbus/message_descriptions.h"
+
+namespace {
+
+struct Structs {
+ static const ford_message_descriptions::ParameterDescription*
+ Common__Coordinate__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__DeviceInfo__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__UserFriendlyMessage__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__PermissionItem__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ServiceInfo__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TextField__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ButtonCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__VehicleDataResult__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TouchCoord__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TouchEvent__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__PresetBankCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__Image__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__SoftButton__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TTSChunk__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__HMIApplication__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__MenuParams__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__Choice__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__VrHelpItem__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TimeFormat__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TouchEventCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ImageResolution__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ScreenParams__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ImageField__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__VideoStreamingFormat__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__VideoConfig__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__DisplayCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__SoftButtonCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__HMICapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__AudioPassThruCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TextFieldStruct__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__KeyboardProperties__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__Turn__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__VehicleType__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__GPSData__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__SingleTireStatus__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__DIDResult__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__HeadLampStatus__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__TireStatus__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__BeltStatus__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__BodyInformation__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__DeviceStatus__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ECallInfo__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__AirbagStatus__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__EmergencyEvent__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ClusterModeStatus__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__MyKey__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__RdsData__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__RadioControlData__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__RadioControlCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__Temperature__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ClimateControlData__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ClimateControlCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__ModuleData__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__DateTime__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__OASISAddress__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__LocationDetails__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__NavigationCapability__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__PhoneCapability__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__VideoStreamingCapability__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__SystemCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__RemoteControlCapabilities__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__Rectangle__parameters[];
+ static const ford_message_descriptions::ParameterDescription*
+ Common__HapticRect__parameters[];
+};
+
+const ford_message_descriptions::ParameterDescription
+ Common__Coordinate__parameter1 = {
+ "latitudeDegrees", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Common__Coordinate__parameter2 = {
+ "longitudeDegrees", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__Coordinate__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Coordinate__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Coordinate__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceInfo__parameter1 = {
+ "name", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceInfo__parameter2 = {
+ "id", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceInfo__parameter3 = {
+ "transportType", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceInfo__parameter4 = {
+ "isSDLAllowed", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__DeviceInfo__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceInfo__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceInfo__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceInfo__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceInfo__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__UserFriendlyMessage__parameter1 = {
+ "messageCode", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__UserFriendlyMessage__parameter2 = {
+ "ttsString", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__UserFriendlyMessage__parameter3 = {
+ "label", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__UserFriendlyMessage__parameter4 = {
+ "line1", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__UserFriendlyMessage__parameter5 = {
+ "line2", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__UserFriendlyMessage__parameter6 = {
+ "textBody", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__UserFriendlyMessage__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__UserFriendlyMessage__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__UserFriendlyMessage__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__UserFriendlyMessage__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__UserFriendlyMessage__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__UserFriendlyMessage__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__UserFriendlyMessage__parameter6,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__PermissionItem__parameter1 = {
+ "name", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__PermissionItem__parameter2 = {
+ "id", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__PermissionItem__parameter3 = {
+ "allowed", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__PermissionItem__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__PermissionItem__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__PermissionItem__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__PermissionItem__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ServiceInfo__parameter1 = {
+ "url", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ServiceInfo__parameter2 = {
+ "policyAppId", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ServiceInfo__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ServiceInfo__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ServiceInfo__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TextField__parameter1 = {
+ "name", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TextField__parameter2 = {
+ "characterSet", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TextField__parameter3 = {
+ "width", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TextField__parameter4 = {
+ "rows", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TextField__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TextField__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TextField__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TextField__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TextField__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ButtonCapabilities__parameter1 = {
+ "name", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ButtonCapabilities__parameter2 = {
+ "shortPressAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ButtonCapabilities__parameter3 = {
+ "longPressAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ButtonCapabilities__parameter4 = {
+ "upDownAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ButtonCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ButtonCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ButtonCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ButtonCapabilities__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ButtonCapabilities__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__VehicleDataResult__parameter1 = {
+ "dataType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__VehicleDataResult__parameter2 = {
+ "resultCode", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__VehicleDataResult__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VehicleDataResult__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VehicleDataResult__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TouchCoord__parameter1 = {
+ "x", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TouchCoord__parameter2 = {
+ "y", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TouchCoord__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchCoord__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchCoord__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TouchEvent__parameter1 = {
+ "id", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TouchEvent__parameter2_array = {
+ "ts", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ArrayDescription
+ Common__TouchEvent__parameter2 = {
+ {"ts", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEvent__parameter2_array,
+ "i"};
+const ford_message_descriptions::StructDescription
+ Common__TouchEvent__parameter3_array = {
+ {"c", ford_message_descriptions::Struct, true},
+ Structs::Common__TouchCoord__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__TouchEvent__parameter3 = {
+ {"c", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEvent__parameter3_array,
+ "(ii)"};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TouchEvent__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEvent__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEvent__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEvent__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__PresetBankCapabilities__parameter1 = {
+ "onScreenPresetsAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__PresetBankCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__PresetBankCapabilities__parameter1,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__Image__parameter1 = {
+ "value", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__Image__parameter2 = {
+ "imageType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__Image__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Image__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Image__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButton__parameter1 = {
+ "type", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButton__parameter2 = {
+ "text", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription
+ Common__SoftButton__parameter3 = {
+ {"image", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButton__parameter4 = {
+ "isHighlighted", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButton__parameter5 = {
+ "softButtonID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButton__parameter6 = {
+ "systemAction", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__SoftButton__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButton__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButton__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButton__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButton__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButton__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButton__parameter6,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TTSChunk__parameter1 = {
+ "text", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TTSChunk__parameter2 = {
+ "type", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TTSChunk__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TTSChunk__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TTSChunk__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter1 = {
+ "appName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter2 = {
+ "ngnMediaScreenAppName", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter3 = {
+ "icon", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription
+ Common__HMIApplication__parameter4 = {
+ {"deviceInfo", ford_message_descriptions::Struct, true},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter5 = {
+ "policyAppID", ford_message_descriptions::String, true};
+const ford_message_descriptions::StructDescription
+ Common__HMIApplication__parameter6_array = {
+ {"ttsName", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__HMIApplication__parameter6 = {
+ {"ttsName", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter6_array,
+ "(si)"};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter7_array = {
+ "vrSynonyms", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ Common__HMIApplication__parameter7 = {
+ {"vrSynonyms", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter7_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter8 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter9 = {
+ "hmiDisplayLanguageDesired", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter10 = {
+ "isMediaApplication", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter11_array = {
+ "appType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ Common__HMIApplication__parameter11 = {
+ {"appType", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter11_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter12 = {
+ "greyOut", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__HMIApplication__parameter13_array = {
+ "requestType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ Common__HMIApplication__parameter13 = {
+ {"requestType", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter13_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__HMIApplication__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMIApplication__parameter13,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__MenuParams__parameter1 = {
+ "parentID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__MenuParams__parameter2 = {
+ "position", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__MenuParams__parameter3 = {
+ "menuName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__MenuParams__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__MenuParams__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__MenuParams__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__MenuParams__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__Choice__parameter1 = {
+ "choiceID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__Choice__parameter2 = {
+ "menuName", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription Common__Choice__parameter3 =
+ {{"image", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__Choice__parameter4 = {
+ "secondaryText", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__Choice__parameter5 = {
+ "tertiaryText", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription Common__Choice__parameter6 =
+ {{"secondaryImage", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__Choice__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Choice__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Choice__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Choice__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Choice__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Choice__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Choice__parameter6,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__VrHelpItem__parameter1 = {
+ "text", ford_message_descriptions::String, true};
+const ford_message_descriptions::StructDescription
+ Common__VrHelpItem__parameter2 = {
+ {"image", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__VrHelpItem__parameter3 = {
+ "position", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__VrHelpItem__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VrHelpItem__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VrHelpItem__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VrHelpItem__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TimeFormat__parameter1 = {
+ "hours", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TimeFormat__parameter2 = {
+ "minutes", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TimeFormat__parameter3 = {
+ "seconds", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TimeFormat__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TimeFormat__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TimeFormat__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TimeFormat__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TouchEventCapabilities__parameter1 = {
+ "pressAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TouchEventCapabilities__parameter2 = {
+ "multiTouchAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TouchEventCapabilities__parameter3 = {
+ "doublePressAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TouchEventCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEventCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEventCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TouchEventCapabilities__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ImageResolution__parameter1 = {
+ "resolutionWidth", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ImageResolution__parameter2 = {
+ "resolutionHeight", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ImageResolution__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ImageResolution__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ImageResolution__parameter2,
+ NULL};
+
+const ford_message_descriptions::StructDescription
+ Common__ScreenParams__parameter1 = {
+ {"resolution", ford_message_descriptions::Struct, true},
+ Structs::Common__ImageResolution__parameters};
+const ford_message_descriptions::StructDescription
+ Common__ScreenParams__parameter2 = {
+ {"touchEventAvailable", ford_message_descriptions::Struct, false},
+ Structs::Common__TouchEventCapabilities__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ScreenParams__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ScreenParams__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ScreenParams__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ImageField__parameter1 = {
+ "name", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ImageField__parameter2_array = {
+ "imageTypeSupported", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ Common__ImageField__parameter2 = {
+ {"imageTypeSupported", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ImageField__parameter2_array,
+ "i"};
+const ford_message_descriptions::StructDescription
+ Common__ImageField__parameter3 = {
+ {"imageResolution", ford_message_descriptions::Struct, false},
+ Structs::Common__ImageResolution__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ImageField__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ImageField__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ImageField__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ImageField__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__VideoStreamingFormat__parameter1 = {
+ "protocol", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__VideoStreamingFormat__parameter2 = {
+ "codec", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__VideoStreamingFormat__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoStreamingFormat__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoStreamingFormat__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__VideoConfig__parameter1 = {
+ "protocol", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__VideoConfig__parameter2 = {
+ "codec", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__VideoConfig__parameter3 = {
+ "width", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__VideoConfig__parameter4 = {
+ "height", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__VideoConfig__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoConfig__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoConfig__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoConfig__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoConfig__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__DisplayCapabilities__parameter1 = {
+ "displayType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::StructDescription
+ Common__DisplayCapabilities__parameter2_array = {
+ {"textFields", ford_message_descriptions::Struct, true},
+ Structs::Common__TextField__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__DisplayCapabilities__parameter2 = {
+ {"textFields", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter2_array,
+ "(iiii)"};
+const ford_message_descriptions::StructDescription
+ Common__DisplayCapabilities__parameter3_array = {
+ {"imageFields", ford_message_descriptions::Struct, true},
+ Structs::Common__ImageField__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__DisplayCapabilities__parameter3 = {
+ {"imageFields", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter3_array,
+ "(i(bai)(b(ii)))"};
+const ford_message_descriptions::ParameterDescription
+ Common__DisplayCapabilities__parameter4_array = {
+ "mediaClockFormats", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ Common__DisplayCapabilities__parameter4 = {
+ {"mediaClockFormats", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter4_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ Common__DisplayCapabilities__parameter5_array = {
+ "imageCapabilities", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ Common__DisplayCapabilities__parameter5 = {
+ {"imageCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter5_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ Common__DisplayCapabilities__parameter6 = {
+ "graphicSupported", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__DisplayCapabilities__parameter7_array = {
+ "templatesAvailable", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ Common__DisplayCapabilities__parameter7 = {
+ {"templatesAvailable", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter7_array,
+ "s"};
+const ford_message_descriptions::StructDescription
+ Common__DisplayCapabilities__parameter8 = {
+ {"screenParams", ford_message_descriptions::Struct, false},
+ Structs::Common__ScreenParams__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__DisplayCapabilities__parameter9 = {
+ "numCustomPresetsAvailable", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__DisplayCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DisplayCapabilities__parameter9,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButtonCapabilities__parameter1 = {
+ "shortPressAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButtonCapabilities__parameter2 = {
+ "longPressAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButtonCapabilities__parameter3 = {
+ "upDownAvailable", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__SoftButtonCapabilities__parameter4 = {
+ "imageSupported", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__SoftButtonCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButtonCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButtonCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButtonCapabilities__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SoftButtonCapabilities__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__HMICapabilities__parameter1 = {
+ "navigation", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__HMICapabilities__parameter2 = {
+ "phoneCall", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__HMICapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMICapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HMICapabilities__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__AudioPassThruCapabilities__parameter1 = {
+ "samplingRate", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AudioPassThruCapabilities__parameter2 = {
+ "bitsPerSample", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AudioPassThruCapabilities__parameter3 = {
+ "audioType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__AudioPassThruCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AudioPassThruCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AudioPassThruCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AudioPassThruCapabilities__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TextFieldStruct__parameter1 = {
+ "fieldName", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__TextFieldStruct__parameter2 = {
+ "fieldText", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TextFieldStruct__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TextFieldStruct__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TextFieldStruct__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__KeyboardProperties__parameter1 = {
+ "language", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__KeyboardProperties__parameter2 = {
+ "keyboardLayout", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__KeyboardProperties__parameter3 = {
+ "keypressMode", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__KeyboardProperties__parameter4_array = {
+ "limitedCharacterList", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ Common__KeyboardProperties__parameter4 = {
+ {"limitedCharacterList", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__KeyboardProperties__parameter4_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ Common__KeyboardProperties__parameter5 = {
+ "autoCompleteText", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__KeyboardProperties__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__KeyboardProperties__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__KeyboardProperties__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__KeyboardProperties__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__KeyboardProperties__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__KeyboardProperties__parameter5,
+ NULL};
+
+const ford_message_descriptions::StructDescription Common__Turn__parameter1 = {
+ {"navigationText", ford_message_descriptions::Struct, false},
+ Structs::Common__TextFieldStruct__parameters};
+const ford_message_descriptions::StructDescription Common__Turn__parameter2 = {
+ {"turnIcon", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__Turn__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Turn__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Turn__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__VehicleType__parameter1 = {
+ "make", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__VehicleType__parameter2 = {
+ "model", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__VehicleType__parameter3 = {
+ "modelYear", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__VehicleType__parameter4 = {
+ "trim", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__VehicleType__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VehicleType__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VehicleType__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VehicleType__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VehicleType__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter1 = {
+ "longitudeDegrees", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter2 = {
+ "latitudeDegrees", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter3 = {
+ "utcYear", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter4 = {
+ "utcMonth", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter5 = {
+ "utcDay", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter6 = {
+ "utcHours", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter7 = {
+ "utcMinutes", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter8 = {
+ "utcSeconds", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter9 = {
+ "compassDirection", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter10 = {
+ "pdop", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter11 = {
+ "hdop", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter12 = {
+ "vdop", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter13 = {
+ "actual", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter14 = {
+ "satellites", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter15 = {
+ "dimension", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter16 = {
+ "altitude", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter17 = {
+ "heading", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ Common__GPSData__parameter18 = {
+ "speed", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__GPSData__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__GPSData__parameter18,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__SingleTireStatus__parameter1 = {
+ "status", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__SingleTireStatus__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__SingleTireStatus__parameter1,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__DIDResult__parameter1 = {
+ "resultCode", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__DIDResult__parameter2 = {
+ "didLocation", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Common__DIDResult__parameter3 = {
+ "data", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__DIDResult__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DIDResult__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DIDResult__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DIDResult__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__HeadLampStatus__parameter1 = {
+ "lowBeamsOn", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__HeadLampStatus__parameter2 = {
+ "highBeamsOn", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__HeadLampStatus__parameter3 = {
+ "ambientLightSensorStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__HeadLampStatus__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HeadLampStatus__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HeadLampStatus__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HeadLampStatus__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__TireStatus__parameter1 = {
+ "pressureTelltale", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::StructDescription
+ Common__TireStatus__parameter2 = {
+ {"leftFront", ford_message_descriptions::Struct, false},
+ Structs::Common__SingleTireStatus__parameters};
+const ford_message_descriptions::StructDescription
+ Common__TireStatus__parameter3 = {
+ {"rightFront", ford_message_descriptions::Struct, false},
+ Structs::Common__SingleTireStatus__parameters};
+const ford_message_descriptions::StructDescription
+ Common__TireStatus__parameter4 = {
+ {"leftRear", ford_message_descriptions::Struct, false},
+ Structs::Common__SingleTireStatus__parameters};
+const ford_message_descriptions::StructDescription
+ Common__TireStatus__parameter5 = {
+ {"rightRear", ford_message_descriptions::Struct, false},
+ Structs::Common__SingleTireStatus__parameters};
+const ford_message_descriptions::StructDescription
+ Common__TireStatus__parameter6 = {
+ {"innerLeftRear", ford_message_descriptions::Struct, false},
+ Structs::Common__SingleTireStatus__parameters};
+const ford_message_descriptions::StructDescription
+ Common__TireStatus__parameter7 = {
+ {"innerRightRear", ford_message_descriptions::Struct, false},
+ Structs::Common__SingleTireStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__TireStatus__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TireStatus__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TireStatus__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TireStatus__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TireStatus__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TireStatus__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TireStatus__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__TireStatus__parameter7,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter1 = {
+ "driverBeltDeployed", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter2 = {
+ "passengerBeltDeployed", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter3 = {
+ "passengerBuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter4 = {
+ "driverBuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter5 = {
+ "leftRow2BuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter6 = {
+ "passengerChildDetected", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter7 = {
+ "rightRow2BuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter8 = {
+ "middleRow2BuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter9 = {
+ "middleRow3BuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter10 = {
+ "leftRow3BuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter11 = {
+ "rightRow3BuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter12 = {
+ "leftRearInflatableBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter13 = {
+ "rightRearInflatableBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter14 = {
+ "middleRow1BeltDeployed", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BeltStatus__parameter15 = {
+ "middleRow1BuckleBelted", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__BeltStatus__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BeltStatus__parameter15,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__BodyInformation__parameter1 = {
+ "parkBrakeActive", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__BodyInformation__parameter2 = {
+ "ignitionStableStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__BodyInformation__parameter3 = {
+ "ignitionStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__BodyInformation__parameter4 = {
+ "driverDoorAjar", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BodyInformation__parameter5 = {
+ "passengerDoorAjar", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BodyInformation__parameter6 = {
+ "rearLeftDoorAjar", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__BodyInformation__parameter7 = {
+ "rearRightDoorAjar", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__BodyInformation__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BodyInformation__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BodyInformation__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BodyInformation__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BodyInformation__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BodyInformation__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BodyInformation__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__BodyInformation__parameter7,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter1 = {
+ "voiceRecOn", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter2 = {
+ "btIconOn", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter3 = {
+ "callActive", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter4 = {
+ "phoneRoaming", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter5 = {
+ "textMsgAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter6 = {
+ "battLevelStatus", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter7 = {
+ "stereoAudioOutputMuted", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter8 = {
+ "monoAudioOutputMuted", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter9 = {
+ "signalLevelStatus", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter10 = {
+ "primaryAudioSource", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DeviceStatus__parameter11 = {
+ "eCallEventActive", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__DeviceStatus__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__DeviceStatus__parameter11,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ECallInfo__parameter1 = {
+ "eCallNotificationStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ECallInfo__parameter2 = {
+ "auxECallNotificationStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ECallInfo__parameter3 = {
+ "eCallConfirmationStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ECallInfo__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ECallInfo__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ECallInfo__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ECallInfo__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter1 = {
+ "driverAirbagDeployed", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter2 = {
+ "driverSideAirbagDeployed", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter3 = {
+ "driverCurtainAirbagDeployed", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter4 = {
+ "passengerAirbagDeployed", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter5 = {"passengerCurtainAirbagDeployed",
+ ford_message_descriptions::Enum,
+ true};
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter6 = {
+ "driverKneeAirbagDeployed", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter7 = {
+ "passengerSideAirbagDeployed", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__AirbagStatus__parameter8 = {
+ "passengerKneeAirbagDeployed", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__AirbagStatus__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__AirbagStatus__parameter8,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__EmergencyEvent__parameter1 = {
+ "emergencyEventType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__EmergencyEvent__parameter2 = {
+ "fuelCutoffStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__EmergencyEvent__parameter3 = {
+ "rolloverEvent", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__EmergencyEvent__parameter4 = {
+ "maximumChangeVelocity", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__EmergencyEvent__parameter5 = {
+ "multipleEvents", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__EmergencyEvent__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__EmergencyEvent__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__EmergencyEvent__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__EmergencyEvent__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__EmergencyEvent__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__EmergencyEvent__parameter5,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ClusterModeStatus__parameter1 = {
+ "powerModeActive", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ClusterModeStatus__parameter2 = {
+ "powerModeQualificationStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ClusterModeStatus__parameter3 = {
+ "carModeStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ClusterModeStatus__parameter4 = {
+ "powerModeStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ClusterModeStatus__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClusterModeStatus__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClusterModeStatus__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClusterModeStatus__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClusterModeStatus__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__MyKey__parameter1 = {
+ "e911Override", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__MyKey__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__MyKey__parameter1,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter1 = {
+ "PS", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter2 = {
+ "RT", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter3 = {
+ "CT", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter4 = {
+ "PI", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter5 = {
+ "PTY", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter6 = {
+ "TP", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter7 = {
+ "TA", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RdsData__parameter8 = {
+ "REG", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__RdsData__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RdsData__parameter8,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter1 = {
+ "frequencyInteger", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter2 = {
+ "frequencyFraction", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter3 = {
+ "band", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::StructDescription
+ Common__RadioControlData__parameter4 = {
+ {"rdsData", ford_message_descriptions::Struct, false},
+ Structs::Common__RdsData__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter5 = {
+ "availableHDs", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter6 = {
+ "hdChannel", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter7 = {
+ "signalStrength", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter8 = {
+ "signalChangeThreshold", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter9 = {
+ "radioEnable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlData__parameter10 = {
+ "state", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__RadioControlData__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlData__parameter10,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter1 = {
+ "moduleName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter2 = {
+ "radioEnableAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter3 = {
+ "radioBandAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter4 = {
+ "radioFrequencyAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter5 = {
+ "hdChannelAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter6 = {
+ "rdsDataAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter7 = {
+ "availableHDsAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter8 = {
+ "stateAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter9 = {
+ "signalStrengthAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__RadioControlCapabilities__parameter10 = {
+ "signalChangeThresholdAvailable",
+ ford_message_descriptions::Boolean,
+ false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__RadioControlCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RadioControlCapabilities__parameter10,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__Temperature__parameter1 = {
+ "unit", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Common__Temperature__parameter2 = {
+ "value", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__Temperature__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Temperature__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Temperature__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter1 = {
+ "fanSpeed", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::StructDescription
+ Common__ClimateControlData__parameter2 = {
+ {"currentTemperature", ford_message_descriptions::Struct, false},
+ Structs::Common__Temperature__parameters};
+const ford_message_descriptions::StructDescription
+ Common__ClimateControlData__parameter3 = {
+ {"desiredTemperature", ford_message_descriptions::Struct, false},
+ Structs::Common__Temperature__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter4 = {
+ "acEnable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter5 = {
+ "circulateAirEnable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter6 = {
+ "autoModeEnable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter7 = {
+ "defrostZone", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter8 = {
+ "dualModeEnable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter9 = {
+ "acMaxEnable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlData__parameter10 = {
+ "ventilationMode", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ClimateControlData__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlData__parameter10,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter1 = {
+ "moduleName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter2 = {
+ "currentTemperatureAvailable",
+ ford_message_descriptions::Boolean,
+ false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter3 = {
+ "fanSpeedAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter4 = {
+ "desiredTemperatureAvailable",
+ ford_message_descriptions::Boolean,
+ false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter5 = {
+ "acEnableAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter6 = {
+ "acMaxEnableAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter7 = {
+ "circulateAirEnableAvailable",
+ ford_message_descriptions::Boolean,
+ false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter8 = {
+ "autoModeEnableAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter9 = {
+ "dualModeEnableAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter10 = {
+ "defrostZoneAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter11_array = {
+ "defrostZone", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ Common__ClimateControlCapabilities__parameter11 = {
+ {"defrostZone", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter11_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter12 = {
+ "ventilationModeAvailable", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__ClimateControlCapabilities__parameter13_array = {
+ "ventilationMode", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ Common__ClimateControlCapabilities__parameter13 = {
+ {"ventilationMode", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter13_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ClimateControlCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ClimateControlCapabilities__parameter13,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__ModuleData__parameter1 = {
+ "moduleType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::StructDescription
+ Common__ModuleData__parameter2 = {
+ {"radioControlData", ford_message_descriptions::Struct, false},
+ Structs::Common__RadioControlData__parameters};
+const ford_message_descriptions::StructDescription
+ Common__ModuleData__parameter3 = {
+ {"climateControlData", ford_message_descriptions::Struct, false},
+ Structs::Common__ClimateControlData__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__ModuleData__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ModuleData__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ModuleData__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__ModuleData__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter1 = {
+ "millisecond", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter2 = {
+ "second", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter3 = {
+ "minute", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter4 = {
+ "hour", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter5 = {
+ "day", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter6 = {
+ "month", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter7 = {
+ "year", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter8 = {
+ "tz_hour", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Common__DateTime__parameter9 = {
+ "tz_minute", ford_message_descriptions::Integer, false};
+/*const ford_message_descriptions::ParameterDescription*
+ Structs::Common__DateTime__parameters[] = {
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter1,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter2,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter3,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter4,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter5,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter6,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter7,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter8,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__DateTime__parameter9,
+ NULL };*/
+
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter1 = {
+ "countryName", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter2 = {
+ "countryCode", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter3 = {
+ "postalCode", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter4 = {
+ "administrativeArea", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter5 = {
+ "subAdministrativeArea", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter6 = {
+ "locality", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter7 = {
+ "subLocality", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter8 = {
+ "thoroughfare", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__OASISAddress__parameter9 = {
+ "subThoroughfare", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__OASISAddress__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__OASISAddress__parameter9,
+ NULL};
+
+const ford_message_descriptions::StructDescription
+ Common__LocationDetails__parameter1 = {
+ {"coordinate", ford_message_descriptions::Struct, false},
+ Structs::Common__Coordinate__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__LocationDetails__parameter2 = {
+ "locationName", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__LocationDetails__parameter3_array = {
+ "addressLines", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ Common__LocationDetails__parameter3 = {
+ {"addressLines", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter3_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ Common__LocationDetails__parameter4 = {
+ "locationDescription", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Common__LocationDetails__parameter5 = {
+ "phoneNumber", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription
+ Common__LocationDetails__parameter6 = {
+ {"locationImage", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::StructDescription
+ Common__LocationDetails__parameter7 = {
+ {"searchAddress", ford_message_descriptions::Struct, false},
+ Structs::Common__OASISAddress__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__LocationDetails__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__LocationDetails__parameter7,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__NavigationCapability__parameter1 = {
+ "sendLocationEnabled", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ Common__NavigationCapability__parameter2 = {
+ "getWayPointsEnabled", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__NavigationCapability__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__NavigationCapability__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__NavigationCapability__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__PhoneCapability__parameter1 = {
+ "dialNumberEnabled", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__PhoneCapability__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__PhoneCapability__parameter1,
+ NULL};
+
+const ford_message_descriptions::StructDescription
+ Common__VideoStreamingCapability__parameter1 = {
+ {"preferredResolution", ford_message_descriptions::Struct, false},
+ Structs::Common__ImageResolution__parameters};
+const ford_message_descriptions::ParameterDescription
+ Common__VideoStreamingCapability__parameter2 = {
+ "maxBitrate", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::StructDescription
+ Common__VideoStreamingCapability__parameter3_array = {
+ {"supportedFormats", ford_message_descriptions::Struct, true},
+ Structs::Common__VideoStreamingFormat__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__VideoStreamingCapability__parameter3 = {
+ {"supportedFormats", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoStreamingCapability__parameter3_array,
+ "(ii)"};
+const ford_message_descriptions::ParameterDescription
+ Common__VideoStreamingCapability__parameter4 = {
+ "hapticSpatialDataSupported",
+ ford_message_descriptions::Boolean,
+ false};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__VideoStreamingCapability__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoStreamingCapability__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoStreamingCapability__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoStreamingCapability__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__VideoStreamingCapability__parameter4,
+ NULL};
+
+const ford_message_descriptions::StructDescription
+ Common__SystemCapabilities__parameter1 = {
+ {"navigationCapability", ford_message_descriptions::Struct, false},
+ Structs::Common__NavigationCapability__parameters};
+const ford_message_descriptions::StructDescription
+ Common__SystemCapabilities__parameter2 = {
+ {"phoneCapability", ford_message_descriptions::Struct, false},
+ Structs::Common__PhoneCapability__parameters};
+const ford_message_descriptions::StructDescription
+ Common__SystemCapabilities__parameter3 = {
+ {"videoStreamingCapability", ford_message_descriptions::Struct, false},
+ Structs::Common__VideoStreamingCapability__parameters};
+/*const ford_message_descriptions::ParameterDescription*
+ Structs::Common__SystemCapabilities__parameters[] = {
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter1,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter2,
+ (const
+ ford_message_descriptions::ParameterDescription*)&Common__SystemCapabilities__parameter3,
+ NULL };*/
+
+const ford_message_descriptions::StructDescription
+ Common__RemoteControlCapabilities__parameter1_array = {
+ {"climateControlCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__ClimateControlCapabilities__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__RemoteControlCapabilities__parameter1 = {
+ {"climateControlCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RemoteControlCapabilities__parameter1_array,
+ "(s(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bai)(bb)(bai))"};
+const ford_message_descriptions::StructDescription
+ Common__RemoteControlCapabilities__parameter2_array = {
+ {"radioControlCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__RadioControlCapabilities__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__RemoteControlCapabilities__parameter2 = {
+ {"radioControlCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RemoteControlCapabilities__parameter2_array,
+ "(s(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb)(bb))"};
+const ford_message_descriptions::StructDescription
+ Common__RemoteControlCapabilities__parameter3_array = {
+ {"buttonCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__ButtonCapabilities__parameters};
+const ford_message_descriptions::ArrayDescription
+ Common__RemoteControlCapabilities__parameter3 = {
+ {"buttonCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RemoteControlCapabilities__parameter3_array,
+ "(ibbb)"};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__RemoteControlCapabilities__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RemoteControlCapabilities__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RemoteControlCapabilities__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__RemoteControlCapabilities__parameter3,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__Rectangle__parameter1 = {
+ "x", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Common__Rectangle__parameter2 = {
+ "y", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Common__Rectangle__parameter3 = {
+ "width", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Common__Rectangle__parameter4 = {
+ "height", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__Rectangle__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Rectangle__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Rectangle__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Rectangle__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__Rectangle__parameter4,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription
+ Common__HapticRect__parameter1 = {
+ "id", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ Common__HapticRect__parameter2 = {
+ {"rect", ford_message_descriptions::Struct, true},
+ Structs::Common__Rectangle__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Structs::Common__HapticRect__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HapticRect__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Common__HapticRect__parameter2,
+ NULL};
+
+const ford_message_descriptions::ParameterDescription*
+ Buttons__GetCapabilities__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Buttons__GetCapabilities__request = {
+ "Buttons",
+ "GetCapabilities",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Buttons_GetCapabilities,
+ Buttons__GetCapabilities__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ Buttons__GetCapabilities__response__parameter1_array = {
+ {"capabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__ButtonCapabilities__parameters};
+const ford_message_descriptions::ArrayDescription
+ Buttons__GetCapabilities__response__parameter1 = {
+ {"capabilities", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__GetCapabilities__response__parameter1_array,
+ "(ibbb)"};
+const ford_message_descriptions::StructDescription
+ Buttons__GetCapabilities__response__parameter2 = {
+ {"presetBankCapabilities", ford_message_descriptions::Struct, false},
+ Structs::Common__PresetBankCapabilities__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Buttons__GetCapabilities__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__GetCapabilities__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__GetCapabilities__response__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Buttons__GetCapabilities__response = {
+ "Buttons",
+ "GetCapabilities",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Buttons_GetCapabilities,
+ Buttons__GetCapabilities__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonEvent__notification__parameter1 = {
+ "name", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonEvent__notification__parameter2 = {
+ "mode", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonEvent__notification__parameter3 = {
+ "customButtonID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonEvent__notification__parameter4 = {
+ "appID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ Buttons__OnButtonEvent__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonEvent__notification__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Buttons__OnButtonEvent__notification = {
+ "Buttons",
+ "OnButtonEvent",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::Buttons_OnButtonEvent,
+ Buttons__OnButtonEvent__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonPress__notification__parameter1 = {
+ "name", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonPress__notification__parameter2 = {
+ "mode", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonPress__notification__parameter3 = {
+ "customButtonID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonPress__notification__parameter4 = {
+ "appID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ Buttons__OnButtonPress__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonPress__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonPress__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonPress__notification__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonPress__notification__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Buttons__OnButtonPress__notification = {
+ "Buttons",
+ "OnButtonPress",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::Buttons_OnButtonPress,
+ Buttons__OnButtonPress__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonSubscription__notification__parameter1 = {
+ "name", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonSubscription__notification__parameter2 = {
+ "isSubscribed", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ Buttons__OnButtonSubscription__notification__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Buttons__OnButtonSubscription__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Buttons__OnButtonSubscription__notification__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Buttons__OnButtonSubscription__notification = {
+ "Buttons",
+ "OnButtonSubscription",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::Buttons_OnButtonSubscription,
+ Buttons__OnButtonSubscription__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnReady__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnReady__notification = {
+ "BasicCommunication",
+ "OnReady",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnReady,
+ BasicCommunication__OnReady__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnStartDeviceDiscovery__notification__parameters[] = {
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnStartDeviceDiscovery__notification = {
+ "BasicCommunication",
+ "OnStartDeviceDiscovery",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery,
+ BasicCommunication__OnStartDeviceDiscovery__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnUpdateDeviceList__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnUpdateDeviceList__notification = {
+ "BasicCommunication",
+ "OnUpdateDeviceList",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList,
+ BasicCommunication__OnUpdateDeviceList__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPhoneCall__notification__parameter1 = {
+ "isActive", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnPhoneCall__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPhoneCall__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnPhoneCall__notification = {
+ "BasicCommunication",
+ "OnPhoneCall",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnPhoneCall,
+ BasicCommunication__OnPhoneCall__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnEmergencyEvent__notification__parameter1 = {
+ "enabled", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnEmergencyEvent__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnEmergencyEvent__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnEmergencyEvent__notification = {
+ "BasicCommunication",
+ "OnEmergencyEvent",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnEmergencyEvent,
+ BasicCommunication__OnEmergencyEvent__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnResumeAudioSource__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnResumeAudioSource__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnResumeAudioSource__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnResumeAudioSource__notification = {
+ "BasicCommunication",
+ "OnResumeAudioSource",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource,
+ BasicCommunication__OnResumeAudioSource__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnSDLPersistenceComplete__notification__parameters[] = {
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnSDLPersistenceComplete__notification = {
+ "BasicCommunication",
+ "OnSDLPersistenceComplete",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete,
+ BasicCommunication__OnSDLPersistenceComplete__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ BasicCommunication__UpdateAppList__request__parameter1_array = {
+ {"applications", ford_message_descriptions::Struct, true},
+ Structs::Common__HMIApplication__parameters};
+const ford_message_descriptions::ArrayDescription
+ BasicCommunication__UpdateAppList__request__parameter1 = {
+ {"applications", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__UpdateAppList__request__parameter1_array,
+ "(s(bs)(bs)(ss(bi)(bb))s(ba(si))(bas)iib(bai)(bb)(bai))"};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__UpdateAppList__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__UpdateAppList__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__UpdateAppList__request = {
+ "BasicCommunication",
+ "UpdateAppList",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList,
+ BasicCommunication__UpdateAppList__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__UpdateAppList__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__UpdateAppList__response = {
+ "BasicCommunication",
+ "UpdateAppList",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_UpdateAppList,
+ BasicCommunication__UpdateAppList__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ BasicCommunication__UpdateDeviceList__request__parameter1_array = {
+ {"deviceList", ford_message_descriptions::Struct, true},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ArrayDescription
+ BasicCommunication__UpdateDeviceList__request__parameter1 = {
+ {"deviceList", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__UpdateDeviceList__request__parameter1_array,
+ "(ss(bi)(bb))"};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__UpdateDeviceList__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__UpdateDeviceList__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__UpdateDeviceList__request = {
+ "BasicCommunication",
+ "UpdateDeviceList",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList,
+ BasicCommunication__UpdateDeviceList__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__UpdateDeviceList__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__UpdateDeviceList__response = {
+ "BasicCommunication",
+ "UpdateDeviceList",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList,
+ BasicCommunication__UpdateDeviceList__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnFileRemoved__notification__parameter1 = {
+ "fileName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnFileRemoved__notification__parameter2 = {
+ "fileType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnFileRemoved__notification__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnFileRemoved__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnFileRemoved__notification__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnFileRemoved__notification = {
+ "BasicCommunication",
+ "OnFileRemoved",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnFileRemoved,
+ BasicCommunication__OnFileRemoved__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ BasicCommunication__AllowDeviceToConnect__request__parameter1 = {
+ {"device", ford_message_descriptions::Struct, true},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__AllowDeviceToConnect__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__AllowDeviceToConnect__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__AllowDeviceToConnect__request = {
+ "BasicCommunication",
+ "AllowDeviceToConnect",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_AllowDeviceToConnect,
+ BasicCommunication__AllowDeviceToConnect__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__AllowDeviceToConnect__response__parameter1 = {
+ "allow", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__AllowDeviceToConnect__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__AllowDeviceToConnect__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__AllowDeviceToConnect__response = {
+ "BasicCommunication",
+ "AllowDeviceToConnect",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_AllowDeviceToConnect,
+ BasicCommunication__AllowDeviceToConnect__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ BasicCommunication__OnDeviceChosen__notification__parameter1 = {
+ {"deviceInfo", ford_message_descriptions::Struct, true},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnDeviceChosen__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnDeviceChosen__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnDeviceChosen__notification = {
+ "BasicCommunication",
+ "OnDeviceChosen",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen,
+ BasicCommunication__OnDeviceChosen__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ BasicCommunication__OnFindApplications__notification__parameter1 = {
+ {"deviceInfo", ford_message_descriptions::Struct, false},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnFindApplications__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnFindApplications__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnFindApplications__notification = {
+ "BasicCommunication",
+ "OnFindApplications",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnFindApplications,
+ BasicCommunication__OnFindApplications__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__ActivateApp__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__ActivateApp__request__parameter2 = {
+ "priority", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__ActivateApp__request__parameter3 = {
+ "level", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__ActivateApp__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__ActivateApp__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__ActivateApp__request = {
+ "BasicCommunication",
+ "ActivateApp",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ BasicCommunication__ActivateApp__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__ActivateApp__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__ActivateApp__response = {
+ "BasicCommunication",
+ "ActivateApp",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_ActivateApp,
+ BasicCommunication__ActivateApp__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppActivated__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnAppActivated__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppActivated__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnAppActivated__notification = {
+ "BasicCommunication",
+ "OnAppActivated",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppActivated,
+ BasicCommunication__OnAppActivated__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppDeactivated__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppDeactivated__notification__parameter2 = {
+ "reason", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnAppDeactivated__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppDeactivated__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppDeactivated__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnAppDeactivated__notification = {
+ "BasicCommunication",
+ "OnAppDeactivated",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated,
+ BasicCommunication__OnAppDeactivated__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ BasicCommunication__OnAppRegistered__notification__parameter1 = {
+ {"application", ford_message_descriptions::Struct, true},
+ Structs::Common__HMIApplication__parameters};
+const ford_message_descriptions::StructDescription
+ BasicCommunication__OnAppRegistered__notification__parameter2_array = {
+ {"ttsName", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ BasicCommunication__OnAppRegistered__notification__parameter2 = {
+ {"ttsName", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter2_array,
+ "(si)"};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppRegistered__notification__parameter3_array = {
+ "vrSynonyms", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ BasicCommunication__OnAppRegistered__notification__parameter3 = {
+ {"vrSynonyms", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter3_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppRegistered__notification__parameter4 = {
+ "resumeVrGrammars", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppRegistered__notification__parameter5 = {
+ "priority", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnAppRegistered__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppRegistered__notification__parameter5,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnAppRegistered__notification = {
+ "BasicCommunication",
+ "OnAppRegistered",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppRegistered,
+ BasicCommunication__OnAppRegistered__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppUnregistered__notification__parameter1 = {
+ "unexpectedDisconnect", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnAppUnregistered__notification__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnAppUnregistered__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppUnregistered__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnAppUnregistered__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnAppUnregistered__notification = {
+ "BasicCommunication",
+ "OnAppUnregistered",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered,
+ BasicCommunication__OnAppUnregistered__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnExitApplication__notification__parameter1 = {
+ "reason", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnExitApplication__notification__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnExitApplication__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnExitApplication__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnExitApplication__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnExitApplication__notification = {
+ "BasicCommunication",
+ "OnExitApplication",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnExitApplication,
+ BasicCommunication__OnExitApplication__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnExitAllApplications__notification__parameter1 = {
+ "reason", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnExitAllApplications__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnExitAllApplications__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnExitAllApplications__notification = {
+ "BasicCommunication",
+ "OnExitAllApplications",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications,
+ BasicCommunication__OnExitAllApplications__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnAwakeSDL__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnAwakeSDL__notification = {
+ "BasicCommunication",
+ "OnAwakeSDL",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnAwakeSDL,
+ BasicCommunication__OnAwakeSDL__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__MixingAudioSupported__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__MixingAudioSupported__request = {
+ "BasicCommunication",
+ "MixingAudioSupported",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
+ BasicCommunication__MixingAudioSupported__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__MixingAudioSupported__response__parameter1 = {
+ "attenuatedSupported", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__MixingAudioSupported__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__MixingAudioSupported__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__MixingAudioSupported__response = {
+ "BasicCommunication",
+ "MixingAudioSupported",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported,
+ BasicCommunication__MixingAudioSupported__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__PlayTone__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__PlayTone__notification__parameter2 = {
+ "methodName", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__PlayTone__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__PlayTone__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__PlayTone__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__PlayTone__notification = {
+ "BasicCommunication",
+ "PlayTone",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_PlayTone,
+ BasicCommunication__PlayTone__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__DialNumber__request__parameter1 = {
+ "number", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__DialNumber__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__DialNumber__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__DialNumber__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__DialNumber__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__DialNumber__request = {
+ "BasicCommunication",
+ "DialNumber",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_DialNumber,
+ BasicCommunication__DialNumber__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__DialNumber__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__DialNumber__response = {
+ "BasicCommunication",
+ "DialNumber",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_DialNumber,
+ BasicCommunication__DialNumber__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter1 = {
+ "requestType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter2 = {
+ "url", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter3 = {
+ "fileType", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter4 = {
+ "offset", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter5 = {
+ "length", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter6 = {
+ "timeout", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter7 = {
+ "fileName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemRequest__notification__parameter8 = {
+ "appID", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnSystemRequest__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemRequest__notification__parameter8,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnSystemRequest__notification = {
+ "BasicCommunication",
+ "OnSystemRequest",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnSystemRequest,
+ BasicCommunication__OnSystemRequest__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__SystemRequest__request__parameter1 = {
+ "requestType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__SystemRequest__request__parameter2 = {
+ "fileName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__SystemRequest__request__parameter3 = {
+ "appID", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__SystemRequest__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__SystemRequest__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__SystemRequest__request = {
+ "BasicCommunication",
+ "SystemRequest",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_SystemRequest,
+ BasicCommunication__SystemRequest__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__SystemRequest__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__SystemRequest__response = {
+ "BasicCommunication",
+ "SystemRequest",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_SystemRequest,
+ BasicCommunication__SystemRequest__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__PolicyUpdate__request__parameter1 = {
+ "file", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__PolicyUpdate__request__parameter2 = {
+ "timeout", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__PolicyUpdate__request__parameter3_array = {
+ "retry", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ArrayDescription
+ BasicCommunication__PolicyUpdate__request__parameter3 = {
+ {"retry", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter3_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__PolicyUpdate__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__PolicyUpdate__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__PolicyUpdate__request = {
+ "BasicCommunication",
+ "PolicyUpdate",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_PolicyUpdate,
+ BasicCommunication__PolicyUpdate__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__PolicyUpdate__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__PolicyUpdate__response = {
+ "BasicCommunication",
+ "PolicyUpdate",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_PolicyUpdate,
+ BasicCommunication__PolicyUpdate__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnSDLClose__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnSDLClose__notification = {
+ "BasicCommunication",
+ "OnSDLClose",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnSDLClose,
+ BasicCommunication__OnSDLClose__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPutFile__notification__parameter1 = {
+ "offset", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPutFile__notification__parameter2 = {
+ "length", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPutFile__notification__parameter3 = {
+ "fileSize", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPutFile__notification__parameter4 = {
+ "FileName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPutFile__notification__parameter5 = {
+ "syncFileName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPutFile__notification__parameter6 = {
+ "fileType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnPutFile__notification__parameter7 = {
+ "persistentFile", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnPutFile__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnPutFile__notification__parameter7,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnPutFile__notification = {
+ "BasicCommunication",
+ "OnPutFile",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnPutFile,
+ BasicCommunication__OnPutFile__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__GetSystemInfo__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__GetSystemInfo__request = {
+ "BasicCommunication",
+ "GetSystemInfo",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_GetSystemInfo,
+ BasicCommunication__GetSystemInfo__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__GetSystemInfo__response__parameter1 = {
+ "ccpu_version", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__GetSystemInfo__response__parameter2 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__GetSystemInfo__response__parameter3 = {
+ "wersCountryCode", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__GetSystemInfo__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__GetSystemInfo__response__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__GetSystemInfo__response = {
+ "BasicCommunication",
+ "GetSystemInfo",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_GetSystemInfo,
+ BasicCommunication__GetSystemInfo__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnSystemInfoChanged__notification__parameter1 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnSystemInfoChanged__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnSystemInfoChanged__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnSystemInfoChanged__notification = {
+ "BasicCommunication",
+ "OnSystemInfoChanged",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged,
+ BasicCommunication__OnSystemInfoChanged__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnIgnitionCycleOver__notification__parameters[] = {
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnIgnitionCycleOver__notification = {
+ "BasicCommunication",
+ "OnIgnitionCycleOver",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver,
+ BasicCommunication__OnIgnitionCycleOver__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__DecryptCertificate__request__parameter1 = {
+ "fileName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__DecryptCertificate__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__DecryptCertificate__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__DecryptCertificate__request = {
+ "BasicCommunication",
+ "DecryptCertificate",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::BasicCommunication_DecryptCertificate,
+ BasicCommunication__DecryptCertificate__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__DecryptCertificate__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__DecryptCertificate__response = {
+ "BasicCommunication",
+ "DecryptCertificate",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::BasicCommunication_DecryptCertificate,
+ BasicCommunication__DecryptCertificate__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnEventChanged__notification__parameter1 = {
+ "eventName", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ BasicCommunication__OnEventChanged__notification__parameter2 = {
+ "isActive", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ BasicCommunication__OnEventChanged__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnEventChanged__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&BasicCommunication__OnEventChanged__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ BasicCommunication__OnEventChanged__notification = {
+ "BasicCommunication",
+ "OnEventChanged",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::BasicCommunication_OnEventChanged,
+ BasicCommunication__OnEventChanged__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__IsReady__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription VR__IsReady__request = {
+ "VR",
+ "IsReady",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_IsReady,
+ VR__IsReady__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__IsReady__response__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ VR__IsReady__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__IsReady__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription VR__IsReady__response = {
+ "VR",
+ "IsReady",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_IsReady,
+ VR__IsReady__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__Started__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription VR__Started__notification =
+ {"VR",
+ "Started",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VR_Started,
+ VR__Started__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__Stopped__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription VR__Stopped__notification =
+ {"VR",
+ "Stopped",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VR_Stopped,
+ VR__Stopped__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__AddCommand__request__parameter1 = {
+ "cmdID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VR__AddCommand__request__parameter2_array = {
+ "vrCommands", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ VR__AddCommand__request__parameter2 = {
+ {"vrCommands", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__AddCommand__request__parameter2_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ VR__AddCommand__request__parameter3 = {
+ "type", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ VR__AddCommand__request__parameter4 = {
+ "grammarID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VR__AddCommand__request__parameter5 = {
+ "appID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ VR__AddCommand__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__AddCommand__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__AddCommand__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__AddCommand__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__AddCommand__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__AddCommand__request__parameter5,
+ NULL};
+const ford_message_descriptions::MessageDescription VR__AddCommand__request = {
+ "VR",
+ "AddCommand",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_AddCommand,
+ VR__AddCommand__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__AddCommand__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription VR__AddCommand__response = {
+ "VR",
+ "AddCommand",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_AddCommand,
+ VR__AddCommand__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__DeleteCommand__request__parameter1 = {
+ "cmdID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VR__DeleteCommand__request__parameter2 = {
+ "type", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ VR__DeleteCommand__request__parameter3 = {
+ "grammarID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VR__DeleteCommand__request__parameter4 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VR__DeleteCommand__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__DeleteCommand__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__DeleteCommand__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__DeleteCommand__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__DeleteCommand__request__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription VR__DeleteCommand__request =
+ {"VR",
+ "DeleteCommand",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_DeleteCommand,
+ VR__DeleteCommand__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__DeleteCommand__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VR__DeleteCommand__response = {"VR",
+ "DeleteCommand",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_DeleteCommand,
+ VR__DeleteCommand__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ VR__PerformInteraction__request__parameter1_array = {
+ {"helpPrompt", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ VR__PerformInteraction__request__parameter1 = {
+ {"helpPrompt", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter1_array,
+ "(si)"};
+const ford_message_descriptions::StructDescription
+ VR__PerformInteraction__request__parameter2_array = {
+ {"initialPrompt", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ VR__PerformInteraction__request__parameter2 = {
+ {"initialPrompt", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter2_array,
+ "(si)"};
+const ford_message_descriptions::StructDescription
+ VR__PerformInteraction__request__parameter3_array = {
+ {"timeoutPrompt", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ VR__PerformInteraction__request__parameter3 = {
+ {"timeoutPrompt", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter3_array,
+ "(si)"};
+const ford_message_descriptions::ParameterDescription
+ VR__PerformInteraction__request__parameter4 = {
+ "timeout", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VR__PerformInteraction__request__parameter5_array = {
+ "grammarID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ArrayDescription
+ VR__PerformInteraction__request__parameter5 = {
+ {"grammarID", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter5_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ VR__PerformInteraction__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__request__parameter5,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VR__PerformInteraction__request = {
+ "VR",
+ "PerformInteraction",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_PerformInteraction,
+ VR__PerformInteraction__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__PerformInteraction__response__parameter1 = {
+ "choiceID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ VR__PerformInteraction__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__PerformInteraction__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VR__PerformInteraction__response = {
+ "VR",
+ "PerformInteraction",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_PerformInteraction,
+ VR__PerformInteraction__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__OnCommand__notification__parameter1 = {
+ "cmdID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VR__OnCommand__notification__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VR__OnCommand__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__OnCommand__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__OnCommand__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VR__OnCommand__notification = {"VR",
+ "OnCommand",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VR_OnCommand,
+ VR__OnCommand__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__ChangeRegistration__request__parameter1_array = {
+ "vrSynonyms", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ VR__ChangeRegistration__request__parameter1 = {
+ {"vrSynonyms", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__ChangeRegistration__request__parameter1_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ VR__ChangeRegistration__request__parameter2 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ VR__ChangeRegistration__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VR__ChangeRegistration__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__ChangeRegistration__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__ChangeRegistration__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__ChangeRegistration__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VR__ChangeRegistration__request = {
+ "VR",
+ "ChangeRegistration",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_ChangeRegistration,
+ VR__ChangeRegistration__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__ChangeRegistration__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VR__ChangeRegistration__response = {
+ "VR",
+ "ChangeRegistration",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_ChangeRegistration,
+ VR__ChangeRegistration__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__OnLanguageChange__notification__parameter1 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VR__OnLanguageChange__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__OnLanguageChange__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VR__OnLanguageChange__notification = {
+ "VR",
+ "OnLanguageChange",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VR_OnLanguageChange,
+ VR__OnLanguageChange__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__GetSupportedLanguages__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VR__GetSupportedLanguages__request = {
+ "VR",
+ "GetSupportedLanguages",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_GetSupportedLanguages,
+ VR__GetSupportedLanguages__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__GetSupportedLanguages__response__parameter1_array = {
+ "languages", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ VR__GetSupportedLanguages__response__parameter1 = {
+ {"languages", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__GetSupportedLanguages__response__parameter1_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ VR__GetSupportedLanguages__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__GetSupportedLanguages__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VR__GetSupportedLanguages__response = {
+ "VR",
+ "GetSupportedLanguages",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_GetSupportedLanguages,
+ VR__GetSupportedLanguages__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__GetLanguage__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription VR__GetLanguage__request = {
+ "VR",
+ "GetLanguage",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_GetLanguage,
+ VR__GetLanguage__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__GetLanguage__response__parameter1 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VR__GetLanguage__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__GetLanguage__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription VR__GetLanguage__response =
+ {"VR",
+ "GetLanguage",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_GetLanguage,
+ VR__GetLanguage__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VR__GetCapabilities__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VR__GetCapabilities__request = {"VR",
+ "GetCapabilities",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VR_GetCapabilities,
+ VR__GetCapabilities__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VR__GetCapabilities__response__parameter1_array = {
+ "vrCapabilities", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ VR__GetCapabilities__response__parameter1 = {
+ {"vrCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__GetCapabilities__response__parameter1_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ VR__GetCapabilities__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VR__GetCapabilities__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VR__GetCapabilities__response = {"VR",
+ "GetCapabilities",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VR_GetCapabilities,
+ VR__GetCapabilities__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__GetCapabilities__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__GetCapabilities__request = {"TTS",
+ "GetCapabilities",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_GetCapabilities,
+ TTS__GetCapabilities__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ TTS__GetCapabilities__response__parameter1_array = {
+ "speechCapabilities", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ TTS__GetCapabilities__response__parameter1 = {
+ {"speechCapabilities", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__GetCapabilities__response__parameter1_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ TTS__GetCapabilities__response__parameter2_array = {
+ "prerecordedSpeechCapabilities", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ TTS__GetCapabilities__response__parameter2 = {
+ {"prerecordedSpeechCapabilities",
+ ford_message_descriptions::Array,
+ true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__GetCapabilities__response__parameter2_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ TTS__GetCapabilities__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__GetCapabilities__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__GetCapabilities__response__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__GetCapabilities__response = {
+ "TTS",
+ "GetCapabilities",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_GetCapabilities,
+ TTS__GetCapabilities__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__Started__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription TTS__Started__notification =
+ {"TTS",
+ "Started",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::TTS_Started,
+ TTS__Started__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__Stopped__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription TTS__Stopped__notification =
+ {"TTS",
+ "Stopped",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::TTS_Stopped,
+ TTS__Stopped__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__IsReady__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription TTS__IsReady__request = {
+ "TTS",
+ "IsReady",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_IsReady,
+ TTS__IsReady__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ TTS__IsReady__response__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ TTS__IsReady__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__IsReady__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription TTS__IsReady__response = {
+ "TTS",
+ "IsReady",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_IsReady,
+ TTS__IsReady__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ TTS__Speak__request__parameter1_array = {
+ {"ttsChunks", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ TTS__Speak__request__parameter1 = {
+ {"ttsChunks", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__Speak__request__parameter1_array,
+ "(si)"};
+const ford_message_descriptions::ParameterDescription
+ TTS__Speak__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ TTS__Speak__request__parameter3 = {
+ "speakType", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ TTS__Speak__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__Speak__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__Speak__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__Speak__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription TTS__Speak__request = {
+ "TTS",
+ "Speak",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_Speak,
+ TTS__Speak__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__Speak__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription TTS__Speak__response = {
+ "TTS",
+ "Speak",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_Speak,
+ TTS__Speak__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__StopSpeaking__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription TTS__StopSpeaking__request =
+ {"TTS",
+ "StopSpeaking",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_StopSpeaking,
+ TTS__StopSpeaking__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__StopSpeaking__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__StopSpeaking__response = {"TTS",
+ "StopSpeaking",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_StopSpeaking,
+ TTS__StopSpeaking__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ TTS__ChangeRegistration__request__parameter1_array = {
+ {"ttsName", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ TTS__ChangeRegistration__request__parameter1 = {
+ {"ttsName", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__ChangeRegistration__request__parameter1_array,
+ "(si)"};
+const ford_message_descriptions::ParameterDescription
+ TTS__ChangeRegistration__request__parameter2 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ TTS__ChangeRegistration__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ TTS__ChangeRegistration__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__ChangeRegistration__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__ChangeRegistration__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__ChangeRegistration__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__ChangeRegistration__request = {
+ "TTS",
+ "ChangeRegistration",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_ChangeRegistration,
+ TTS__ChangeRegistration__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__ChangeRegistration__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__ChangeRegistration__response = {
+ "TTS",
+ "ChangeRegistration",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_ChangeRegistration,
+ TTS__ChangeRegistration__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ TTS__OnLanguageChange__notification__parameter1 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ TTS__OnLanguageChange__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__OnLanguageChange__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__OnLanguageChange__notification = {
+ "TTS",
+ "OnLanguageChange",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::TTS_OnLanguageChange,
+ TTS__OnLanguageChange__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__GetSupportedLanguages__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__GetSupportedLanguages__request = {
+ "TTS",
+ "GetSupportedLanguages",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_GetSupportedLanguages,
+ TTS__GetSupportedLanguages__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ TTS__GetSupportedLanguages__response__parameter1_array = {
+ "languages", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ TTS__GetSupportedLanguages__response__parameter1 = {
+ {"languages", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__GetSupportedLanguages__response__parameter1_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ TTS__GetSupportedLanguages__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__GetSupportedLanguages__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__GetSupportedLanguages__response = {
+ "TTS",
+ "GetSupportedLanguages",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_GetSupportedLanguages,
+ TTS__GetSupportedLanguages__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__GetLanguage__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription TTS__GetLanguage__request =
+ {"TTS",
+ "GetLanguage",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_GetLanguage,
+ TTS__GetLanguage__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ TTS__GetLanguage__response__parameter1 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ TTS__GetLanguage__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__GetLanguage__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription TTS__GetLanguage__response =
+ {"TTS",
+ "GetLanguage",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_GetLanguage,
+ TTS__GetLanguage__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ TTS__SetGlobalProperties__request__parameter1_array = {
+ {"helpPrompt", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ TTS__SetGlobalProperties__request__parameter1 = {
+ {"helpPrompt", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__SetGlobalProperties__request__parameter1_array,
+ "(si)"};
+const ford_message_descriptions::StructDescription
+ TTS__SetGlobalProperties__request__parameter2_array = {
+ {"timeoutPrompt", ford_message_descriptions::Struct, true},
+ Structs::Common__TTSChunk__parameters};
+const ford_message_descriptions::ArrayDescription
+ TTS__SetGlobalProperties__request__parameter2 = {
+ {"timeoutPrompt", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__SetGlobalProperties__request__parameter2_array,
+ "(si)"};
+const ford_message_descriptions::ParameterDescription
+ TTS__SetGlobalProperties__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ TTS__SetGlobalProperties__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__SetGlobalProperties__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__SetGlobalProperties__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__SetGlobalProperties__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__SetGlobalProperties__request = {
+ "TTS",
+ "SetGlobalProperties",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::TTS_SetGlobalProperties,
+ TTS__SetGlobalProperties__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ TTS__SetGlobalProperties__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__SetGlobalProperties__response = {
+ "TTS",
+ "SetGlobalProperties",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::TTS_SetGlobalProperties,
+ TTS__SetGlobalProperties__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ TTS__OnResetTimeout__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ TTS__OnResetTimeout__notification__parameter2 = {
+ "methodName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ TTS__OnResetTimeout__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__OnResetTimeout__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&TTS__OnResetTimeout__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ TTS__OnResetTimeout__notification = {
+ "TTS",
+ "OnResetTimeout",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::TTS_OnResetTimeout,
+ TTS__OnResetTimeout__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__Alert__request__parameter1_array = {
+ {"alertStrings", ford_message_descriptions::Struct, true},
+ Structs::Common__TextFieldStruct__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__Alert__request__parameter1 = {
+ {"alertStrings", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter1_array,
+ "(is)"};
+const ford_message_descriptions::ParameterDescription
+ UI__Alert__request__parameter2 = {
+ "duration", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ UI__Alert__request__parameter3_array = {
+ {"softButtons", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButton__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__Alert__request__parameter3 = {
+ {"softButtons", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter3_array,
+ "(i(bs)(b(si))(bb)ii)"};
+const ford_message_descriptions::ParameterDescription
+ UI__Alert__request__parameter4 = {
+ "progressIndicator", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ UI__Alert__request__parameter5 = {
+ "alertType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ UI__Alert__request__parameter6 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__Alert__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__request__parameter6,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__Alert__request = {
+ "UI",
+ "Alert",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_Alert,
+ UI__Alert__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__Alert__response__parameter1 = {
+ "tryAgainTime", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__Alert__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Alert__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__Alert__response = {
+ "UI",
+ "Alert",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_Alert,
+ UI__Alert__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__Show__request__parameter1_array = {
+ {"showStrings", ford_message_descriptions::Struct, true},
+ Structs::Common__TextFieldStruct__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__Show__request__parameter1 = {
+ {"showStrings", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter1_array,
+ "(is)"};
+const ford_message_descriptions::ParameterDescription
+ UI__Show__request__parameter2 = {
+ "alignment", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::StructDescription
+ UI__Show__request__parameter3 = {
+ {"graphic", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::StructDescription
+ UI__Show__request__parameter4 = {
+ {"secondaryGraphic", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::StructDescription
+ UI__Show__request__parameter5_array = {
+ {"softButtons", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButton__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__Show__request__parameter5 = {
+ {"softButtons", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter5_array,
+ "(i(bs)(b(si))(bb)ii)"};
+const ford_message_descriptions::ParameterDescription
+ UI__Show__request__parameter6_array = {
+ "customPresets", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ UI__Show__request__parameter6 = {
+ {"customPresets", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter6_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ UI__Show__request__parameter7 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__Show__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Show__request__parameter7,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__Show__request = {
+ "UI",
+ "Show",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_Show,
+ UI__Show__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__Show__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription UI__Show__response = {
+ "UI",
+ "Show",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_Show,
+ UI__Show__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__AddCommand__request__parameter1 = {
+ "cmdID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ UI__AddCommand__request__parameter2 = {
+ {"menuParams", ford_message_descriptions::Struct, false},
+ Structs::Common__MenuParams__parameters};
+const ford_message_descriptions::StructDescription
+ UI__AddCommand__request__parameter3 = {
+ {"cmdIcon", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription
+ UI__AddCommand__request__parameter4 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__AddCommand__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__AddCommand__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__AddCommand__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__AddCommand__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__AddCommand__request__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__AddCommand__request = {
+ "UI",
+ "AddCommand",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_AddCommand,
+ UI__AddCommand__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__AddCommand__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription UI__AddCommand__response = {
+ "UI",
+ "AddCommand",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_AddCommand,
+ UI__AddCommand__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__DeleteCommand__request__parameter1 = {
+ "cmdID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__DeleteCommand__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__DeleteCommand__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__DeleteCommand__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__DeleteCommand__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__DeleteCommand__request =
+ {"UI",
+ "DeleteCommand",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_DeleteCommand,
+ UI__DeleteCommand__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__DeleteCommand__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__DeleteCommand__response = {"UI",
+ "DeleteCommand",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_DeleteCommand,
+ UI__DeleteCommand__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__AddSubMenu__request__parameter1 = {
+ "menuID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ UI__AddSubMenu__request__parameter2 = {
+ {"menuParams", ford_message_descriptions::Struct, true},
+ Structs::Common__MenuParams__parameters};
+const ford_message_descriptions::ParameterDescription
+ UI__AddSubMenu__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__AddSubMenu__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__AddSubMenu__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__AddSubMenu__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__AddSubMenu__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__AddSubMenu__request = {
+ "UI",
+ "AddSubMenu",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_AddSubMenu,
+ UI__AddSubMenu__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__AddSubMenu__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription UI__AddSubMenu__response = {
+ "UI",
+ "AddSubMenu",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_AddSubMenu,
+ UI__AddSubMenu__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__DeleteSubMenu__request__parameter1 = {
+ "menuID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__DeleteSubMenu__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__DeleteSubMenu__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__DeleteSubMenu__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__DeleteSubMenu__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__DeleteSubMenu__request =
+ {"UI",
+ "DeleteSubMenu",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_DeleteSubMenu,
+ UI__DeleteSubMenu__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__DeleteSubMenu__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__DeleteSubMenu__response = {"UI",
+ "DeleteSubMenu",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_DeleteSubMenu,
+ UI__DeleteSubMenu__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__PerformInteraction__request__parameter1 = {
+ {"initialText", ford_message_descriptions::Struct, false},
+ Structs::Common__TextFieldStruct__parameters};
+const ford_message_descriptions::StructDescription
+ UI__PerformInteraction__request__parameter2_array = {
+ {"choiceSet", ford_message_descriptions::Struct, true},
+ Structs::Common__Choice__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__PerformInteraction__request__parameter2 = {
+ {"choiceSet", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter2_array,
+ "(i(bs)(b(si))(bs)(bs)(b(si)))"};
+const ford_message_descriptions::ParameterDescription
+ UI__PerformInteraction__request__parameter3 = {
+ "vrHelpTitle", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription
+ UI__PerformInteraction__request__parameter4_array = {
+ {"vrHelp", ford_message_descriptions::Struct, true},
+ Structs::Common__VrHelpItem__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__PerformInteraction__request__parameter4 = {
+ {"vrHelp", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter4_array,
+ "(s(b(si))i)"};
+const ford_message_descriptions::ParameterDescription
+ UI__PerformInteraction__request__parameter5 = {
+ "timeout", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__PerformInteraction__request__parameter6 = {
+ "interactionLayout", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ UI__PerformInteraction__request__parameter7 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__PerformInteraction__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__request__parameter7,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__PerformInteraction__request = {
+ "UI",
+ "PerformInteraction",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_PerformInteraction,
+ UI__PerformInteraction__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__PerformInteraction__response__parameter1 = {
+ "choiceID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ UI__PerformInteraction__response__parameter2 = {
+ "manualTextEntry", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__PerformInteraction__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformInteraction__response__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__PerformInteraction__response = {
+ "UI",
+ "PerformInteraction",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_PerformInteraction,
+ UI__PerformInteraction__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__SetMediaClockTimer__request__parameter1 = {
+ {"startTime", ford_message_descriptions::Struct, false},
+ Structs::Common__TimeFormat__parameters};
+const ford_message_descriptions::StructDescription
+ UI__SetMediaClockTimer__request__parameter2 = {
+ {"endTime", ford_message_descriptions::Struct, false},
+ Structs::Common__TimeFormat__parameters};
+const ford_message_descriptions::ParameterDescription
+ UI__SetMediaClockTimer__request__parameter3 = {
+ "updateMode", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ UI__SetMediaClockTimer__request__parameter4 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__SetMediaClockTimer__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetMediaClockTimer__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetMediaClockTimer__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetMediaClockTimer__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetMediaClockTimer__request__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SetMediaClockTimer__request = {
+ "UI",
+ "SetMediaClockTimer",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_SetMediaClockTimer,
+ UI__SetMediaClockTimer__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__SetMediaClockTimer__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SetMediaClockTimer__response = {
+ "UI",
+ "SetMediaClockTimer",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_SetMediaClockTimer,
+ UI__SetMediaClockTimer__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__SetGlobalProperties__request__parameter1 = {
+ "vrHelpTitle", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription
+ UI__SetGlobalProperties__request__parameter2_array = {
+ {"vrHelp", ford_message_descriptions::Struct, true},
+ Structs::Common__VrHelpItem__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__SetGlobalProperties__request__parameter2 = {
+ {"vrHelp", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetGlobalProperties__request__parameter2_array,
+ "(s(b(si))i)"};
+const ford_message_descriptions::ParameterDescription
+ UI__SetGlobalProperties__request__parameter3 = {
+ "menuTitle", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription
+ UI__SetGlobalProperties__request__parameter4 = {
+ {"menuIcon", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::StructDescription
+ UI__SetGlobalProperties__request__parameter5 = {
+ {"keyboardProperties", ford_message_descriptions::Struct, false},
+ Structs::Common__KeyboardProperties__parameters};
+const ford_message_descriptions::ParameterDescription
+ UI__SetGlobalProperties__request__parameter6 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__SetGlobalProperties__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetGlobalProperties__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetGlobalProperties__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetGlobalProperties__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetGlobalProperties__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetGlobalProperties__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetGlobalProperties__request__parameter6,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SetGlobalProperties__request = {
+ "UI",
+ "SetGlobalProperties",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_SetGlobalProperties,
+ UI__SetGlobalProperties__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__SetGlobalProperties__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SetGlobalProperties__response = {
+ "UI",
+ "SetGlobalProperties",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_SetGlobalProperties,
+ UI__SetGlobalProperties__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnCommand__notification__parameter1 = {
+ "cmdID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__OnCommand__notification__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnCommand__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnCommand__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnCommand__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnCommand__notification = {"UI",
+ "OnCommand",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnCommand,
+ UI__OnCommand__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnSystemContext__notification__parameter1 = {
+ "systemContext", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ UI__OnSystemContext__notification__parameter2 = {
+ "appID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnSystemContext__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnSystemContext__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnSystemContext__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnSystemContext__notification = {
+ "UI",
+ "OnSystemContext",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnSystemContext,
+ UI__OnSystemContext__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__GetCapabilities__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__GetCapabilities__request = {"UI",
+ "GetCapabilities",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_GetCapabilities,
+ UI__GetCapabilities__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__GetCapabilities__response__parameter1 = {
+ {"displayCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__DisplayCapabilities__parameters};
+const ford_message_descriptions::StructDescription
+ UI__GetCapabilities__response__parameter2 = {
+ {"audioPassThruCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__AudioPassThruCapabilities__parameters};
+const ford_message_descriptions::ParameterDescription
+ UI__GetCapabilities__response__parameter3 = {
+ "hmiZoneCapabilities", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::StructDescription
+ UI__GetCapabilities__response__parameter4_array = {
+ {"softButtonCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButtonCapabilities__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__GetCapabilities__response__parameter4 = {
+ {"softButtonCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetCapabilities__response__parameter4_array,
+ "(bbbb)"};
+const ford_message_descriptions::StructDescription
+ UI__GetCapabilities__response__parameter5 = {
+ {"hmiCapabilities", ford_message_descriptions::Struct, false},
+ Structs::Common__HMICapabilities__parameters};
+const ford_message_descriptions::ParameterDescription*
+ UI__GetCapabilities__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetCapabilities__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetCapabilities__response__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetCapabilities__response__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetCapabilities__response__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetCapabilities__response__parameter5,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__GetCapabilities__response = {"UI",
+ "GetCapabilities",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_GetCapabilities,
+ UI__GetCapabilities__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__ChangeRegistration__request__parameter1 = {
+ "appName", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ UI__ChangeRegistration__request__parameter2 = {
+ "ngnMediaScreenAppName", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ UI__ChangeRegistration__request__parameter3 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ UI__ChangeRegistration__request__parameter4_array = {
+ "appHMIType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ UI__ChangeRegistration__request__parameter4 = {
+ {"appHMIType", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ChangeRegistration__request__parameter4_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ UI__ChangeRegistration__request__parameter5 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__ChangeRegistration__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ChangeRegistration__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ChangeRegistration__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ChangeRegistration__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ChangeRegistration__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ChangeRegistration__request__parameter5,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__ChangeRegistration__request = {
+ "UI",
+ "ChangeRegistration",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_ChangeRegistration,
+ UI__ChangeRegistration__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__ChangeRegistration__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__ChangeRegistration__response = {
+ "UI",
+ "ChangeRegistration",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_ChangeRegistration,
+ UI__ChangeRegistration__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnLanguageChange__notification__parameter1 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnLanguageChange__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnLanguageChange__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnLanguageChange__notification = {
+ "UI",
+ "OnLanguageChange",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnLanguageChange,
+ UI__OnLanguageChange__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__GetSupportedLanguages__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__GetSupportedLanguages__request = {
+ "UI",
+ "GetSupportedLanguages",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_GetSupportedLanguages,
+ UI__GetSupportedLanguages__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__GetSupportedLanguages__response__parameter1_array = {
+ "languages", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ UI__GetSupportedLanguages__response__parameter1 = {
+ {"languages", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetSupportedLanguages__response__parameter1_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ UI__GetSupportedLanguages__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetSupportedLanguages__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__GetSupportedLanguages__response = {
+ "UI",
+ "GetSupportedLanguages",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_GetSupportedLanguages,
+ UI__GetSupportedLanguages__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__GetLanguage__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription UI__GetLanguage__request = {
+ "UI",
+ "GetLanguage",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_GetLanguage,
+ UI__GetLanguage__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__GetLanguage__response__parameter1 = {
+ "language", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__GetLanguage__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__GetLanguage__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__GetLanguage__response =
+ {"UI",
+ "GetLanguage",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_GetLanguage,
+ UI__GetLanguage__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnDriverDistraction__notification__parameter1 = {
+ "state", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnDriverDistraction__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnDriverDistraction__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnDriverDistraction__notification = {
+ "UI",
+ "OnDriverDistraction",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnDriverDistraction,
+ UI__OnDriverDistraction__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__SetAppIcon__request__parameter1 = {
+ {"syncFileName", ford_message_descriptions::Struct, true},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription
+ UI__SetAppIcon__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__SetAppIcon__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetAppIcon__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetAppIcon__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__SetAppIcon__request = {
+ "UI",
+ "SetAppIcon",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_SetAppIcon,
+ UI__SetAppIcon__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__SetAppIcon__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription UI__SetAppIcon__response = {
+ "UI",
+ "SetAppIcon",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_SetAppIcon,
+ UI__SetAppIcon__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__SetDisplayLayout__request__parameter1 = {
+ "displayLayout", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ UI__SetDisplayLayout__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__SetDisplayLayout__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SetDisplayLayout__request = {"UI",
+ "SetDisplayLayout",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_SetDisplayLayout,
+ UI__SetDisplayLayout__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__SetDisplayLayout__response__parameter1 = {
+ {"displayCapabilities", ford_message_descriptions::Struct, false},
+ Structs::Common__DisplayCapabilities__parameters};
+const ford_message_descriptions::StructDescription
+ UI__SetDisplayLayout__response__parameter2_array = {
+ {"buttonCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__ButtonCapabilities__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__SetDisplayLayout__response__parameter2 = {
+ {"buttonCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__response__parameter2_array,
+ "(ibbb)"};
+const ford_message_descriptions::StructDescription
+ UI__SetDisplayLayout__response__parameter3_array = {
+ {"softButtonCapabilities", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButtonCapabilities__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__SetDisplayLayout__response__parameter3 = {
+ {"softButtonCapabilities", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__response__parameter3_array,
+ "(bbbb)"};
+const ford_message_descriptions::StructDescription
+ UI__SetDisplayLayout__response__parameter4 = {
+ {"presetBankCapabilities", ford_message_descriptions::Struct, false},
+ Structs::Common__PresetBankCapabilities__parameters};
+const ford_message_descriptions::ParameterDescription*
+ UI__SetDisplayLayout__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__response__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__response__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SetDisplayLayout__response__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SetDisplayLayout__response = {
+ "UI",
+ "SetDisplayLayout",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_SetDisplayLayout,
+ UI__SetDisplayLayout__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__ShowCustomForm__request__parameter1 = {
+ "customFormID", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ UI__ShowCustomForm__request__parameter2 = {
+ "parentFormID", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__ShowCustomForm__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ShowCustomForm__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ShowCustomForm__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__ShowCustomForm__request = {"UI",
+ "ShowCustomForm",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_ShowCustomForm,
+ UI__ShowCustomForm__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__ShowCustomForm__response__parameter1 = {
+ "info", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__ShowCustomForm__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ShowCustomForm__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__ShowCustomForm__response = {"UI",
+ "ShowCustomForm",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_ShowCustomForm,
+ UI__ShowCustomForm__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnKeyboardInput__notification__parameter1 = {
+ "event", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ UI__OnKeyboardInput__notification__parameter2 = {
+ "data", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnKeyboardInput__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnKeyboardInput__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnKeyboardInput__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnKeyboardInput__notification = {
+ "UI",
+ "OnKeyboardInput",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnKeyboardInput,
+ UI__OnKeyboardInput__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnTouchEvent__notification__parameter1 = {
+ "type", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::StructDescription
+ UI__OnTouchEvent__notification__parameter2_array = {
+ {"event", ford_message_descriptions::Struct, true},
+ Structs::Common__TouchEvent__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__OnTouchEvent__notification__parameter2 = {
+ {"event", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnTouchEvent__notification__parameter2_array,
+ "(iaia(ii))"};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnTouchEvent__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnTouchEvent__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnTouchEvent__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnTouchEvent__notification = {
+ "UI",
+ "OnTouchEvent",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnTouchEvent,
+ UI__OnTouchEvent__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__Slider__request__parameter1 = {
+ "numTicks", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__Slider__request__parameter2 = {
+ "position", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__Slider__request__parameter3 = {
+ "sliderHeader", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ UI__Slider__request__parameter4_array = {
+ "sliderFooter", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ UI__Slider__request__parameter4 = {
+ {"sliderFooter", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__request__parameter4_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ UI__Slider__request__parameter5 = {
+ "timeout", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__Slider__request__parameter6 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__Slider__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__request__parameter6,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__Slider__request = {
+ "UI",
+ "Slider",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_Slider,
+ UI__Slider__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__Slider__response__parameter1 = {
+ "sliderPosition", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__Slider__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__Slider__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__Slider__response = {
+ "UI",
+ "Slider",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_Slider,
+ UI__Slider__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ UI__ScrollableMessage__request__parameter1 = {
+ {"messageText", ford_message_descriptions::Struct, true},
+ Structs::Common__TextFieldStruct__parameters};
+const ford_message_descriptions::ParameterDescription
+ UI__ScrollableMessage__request__parameter2 = {
+ "timeout", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ UI__ScrollableMessage__request__parameter3_array = {
+ {"softButtons", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButton__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__ScrollableMessage__request__parameter3 = {
+ {"softButtons", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ScrollableMessage__request__parameter3_array,
+ "(i(bs)(b(si))(bb)ii)"};
+const ford_message_descriptions::ParameterDescription
+ UI__ScrollableMessage__request__parameter4 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__ScrollableMessage__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ScrollableMessage__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ScrollableMessage__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ScrollableMessage__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ScrollableMessage__request__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__ScrollableMessage__request = {
+ "UI",
+ "ScrollableMessage",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_ScrollableMessage,
+ UI__ScrollableMessage__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__ScrollableMessage__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__ScrollableMessage__response = {
+ "UI",
+ "ScrollableMessage",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_ScrollableMessage,
+ UI__ScrollableMessage__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__PerformAudioPassThru__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ UI__PerformAudioPassThru__request__parameter2_array = {
+ {"audioPassThruDisplayTexts", ford_message_descriptions::Struct, true},
+ Structs::Common__TextFieldStruct__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__PerformAudioPassThru__request__parameter2 = {
+ {"audioPassThruDisplayTexts", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformAudioPassThru__request__parameter2_array,
+ "(is)"};
+const ford_message_descriptions::ParameterDescription
+ UI__PerformAudioPassThru__request__parameter3 = {
+ "maxDuration", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__PerformAudioPassThru__request__parameter4 = {
+ "muteAudio", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__PerformAudioPassThru__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformAudioPassThru__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformAudioPassThru__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformAudioPassThru__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__PerformAudioPassThru__request__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__PerformAudioPassThru__request = {
+ "UI",
+ "PerformAudioPassThru",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_PerformAudioPassThru,
+ UI__PerformAudioPassThru__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__PerformAudioPassThru__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__PerformAudioPassThru__response = {
+ "UI",
+ "PerformAudioPassThru",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_PerformAudioPassThru,
+ UI__PerformAudioPassThru__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__EndAudioPassThru__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__EndAudioPassThru__request = {"UI",
+ "EndAudioPassThru",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_EndAudioPassThru,
+ UI__EndAudioPassThru__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__EndAudioPassThru__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__EndAudioPassThru__response = {
+ "UI",
+ "EndAudioPassThru",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_EndAudioPassThru,
+ UI__EndAudioPassThru__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__IsReady__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription UI__IsReady__request = {
+ "UI",
+ "IsReady",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_IsReady,
+ UI__IsReady__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__IsReady__response__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__IsReady__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__IsReady__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__IsReady__response = {
+ "UI",
+ "IsReady",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_IsReady,
+ UI__IsReady__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__ClosePopUp__request__parameter1 = {
+ "methodName", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription*
+ UI__ClosePopUp__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__ClosePopUp__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription UI__ClosePopUp__request = {
+ "UI",
+ "ClosePopUp",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_ClosePopUp,
+ UI__ClosePopUp__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__ClosePopUp__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription UI__ClosePopUp__response = {
+ "UI",
+ "ClosePopUp",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_ClosePopUp,
+ UI__ClosePopUp__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnResetTimeout__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ UI__OnResetTimeout__notification__parameter2 = {
+ "methodName", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnResetTimeout__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnResetTimeout__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnResetTimeout__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnResetTimeout__notification = {
+ "UI",
+ "OnResetTimeout",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnResetTimeout,
+ UI__OnResetTimeout__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__OnRecordStart__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ UI__OnRecordStart__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__OnRecordStart__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__OnRecordStart__notification = {
+ "UI",
+ "OnRecordStart",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::UI_OnRecordStart,
+ UI__OnRecordStart__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ UI__SendHapticData__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ UI__SendHapticData__request__parameter2_array = {
+ {"hapticRectData", ford_message_descriptions::Struct, true},
+ Structs::Common__HapticRect__parameters};
+const ford_message_descriptions::ArrayDescription
+ UI__SendHapticData__request__parameter2 = {
+ {"hapticRectData", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SendHapticData__request__parameter2_array,
+ "(i(dddd))"};
+const ford_message_descriptions::ParameterDescription*
+ UI__SendHapticData__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SendHapticData__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&UI__SendHapticData__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SendHapticData__request = {"UI",
+ "SendHapticData",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::UI_SendHapticData,
+ UI__SendHapticData__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ UI__SendHapticData__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ UI__SendHapticData__response = {"UI",
+ "SendHapticData",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::UI_SendHapticData,
+ UI__SendHapticData__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__IsReady__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__IsReady__request = {"Navigation",
+ "IsReady",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_IsReady,
+ Navigation__IsReady__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__IsReady__response__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__IsReady__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__IsReady__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__IsReady__response = {"Navigation",
+ "IsReady",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_IsReady,
+ Navigation__IsReady__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__SendLocation__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__SendLocation__request__parameter2 = {
+ "longitudeDegrees", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__SendLocation__request__parameter3 = {
+ "latitudeDegrees", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__SendLocation__request__parameter4 = {
+ "locationName", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Navigation__SendLocation__request__parameter5 = {
+ "locationDescription", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ Navigation__SendLocation__request__parameter6_array = {
+ "addressLines", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ Navigation__SendLocation__request__parameter6 = {
+ {"addressLines", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter6_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ Navigation__SendLocation__request__parameter7 = {
+ "phoneNumber", ford_message_descriptions::String, false};
+const ford_message_descriptions::StructDescription
+ Navigation__SendLocation__request__parameter8 = {
+ {"locationImage", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__SendLocation__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SendLocation__request__parameter8,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__SendLocation__request = {
+ "Navigation",
+ "SendLocation",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_SendLocation,
+ Navigation__SendLocation__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__SendLocation__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__SendLocation__response = {
+ "Navigation",
+ "SendLocation",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_SendLocation,
+ Navigation__SendLocation__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__DialNumber__request__parameter1 = {
+ "number", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__DialNumber__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__DialNumber__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__DialNumber__request = {
+ "Navigation",
+ "DialNumber",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_DialNumber,
+ Navigation__DialNumber__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__DialNumber__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__DialNumber__response = {
+ "Navigation",
+ "DialNumber",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_DialNumber,
+ Navigation__DialNumber__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ Navigation__ShowConstantTBT__request__parameter1_array = {
+ {"navigationTexts", ford_message_descriptions::Struct, true},
+ Structs::Common__TextFieldStruct__parameters};
+const ford_message_descriptions::ArrayDescription
+ Navigation__ShowConstantTBT__request__parameter1 = {
+ {"navigationTexts", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter1_array,
+ "(is)"};
+const ford_message_descriptions::StructDescription
+ Navigation__ShowConstantTBT__request__parameter2 = {
+ {"turnIcon", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::StructDescription
+ Navigation__ShowConstantTBT__request__parameter3 = {
+ {"nextTurnIcon", ford_message_descriptions::Struct, false},
+ Structs::Common__Image__parameters};
+const ford_message_descriptions::ParameterDescription
+ Navigation__ShowConstantTBT__request__parameter4 = {
+ "distanceToManeuver", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__ShowConstantTBT__request__parameter5 = {
+ "distanceToManeuverScale", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__ShowConstantTBT__request__parameter6 = {
+ "maneuverComplete", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::StructDescription
+ Navigation__ShowConstantTBT__request__parameter7_array = {
+ {"softButtons", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButton__parameters};
+const ford_message_descriptions::ArrayDescription
+ Navigation__ShowConstantTBT__request__parameter7 = {
+ {"softButtons", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter7_array,
+ "(i(bs)(b(si))(bb)ii)"};
+const ford_message_descriptions::ParameterDescription
+ Navigation__ShowConstantTBT__request__parameter8 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__ShowConstantTBT__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__ShowConstantTBT__request__parameter8,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__ShowConstantTBT__request = {
+ "Navigation",
+ "ShowConstantTBT",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_ShowConstantTBT,
+ Navigation__ShowConstantTBT__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__ShowConstantTBT__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__ShowConstantTBT__response = {
+ "Navigation",
+ "ShowConstantTBT",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_ShowConstantTBT,
+ Navigation__ShowConstantTBT__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ Navigation__AlertManeuver__request__parameter1_array = {
+ {"softButtons", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButton__parameters};
+const ford_message_descriptions::ArrayDescription
+ Navigation__AlertManeuver__request__parameter1 = {
+ {"softButtons", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__AlertManeuver__request__parameter1_array,
+ "(i(bs)(b(si))(bb)ii)"};
+const ford_message_descriptions::ParameterDescription
+ Navigation__AlertManeuver__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__AlertManeuver__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__AlertManeuver__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__AlertManeuver__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__AlertManeuver__request = {
+ "Navigation",
+ "AlertManeuver",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_AlertManeuver,
+ Navigation__AlertManeuver__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__AlertManeuver__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__AlertManeuver__response = {
+ "Navigation",
+ "AlertManeuver",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_AlertManeuver,
+ Navigation__AlertManeuver__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ Navigation__UpdateTurnList__request__parameter1_array = {
+ {"turnList", ford_message_descriptions::Struct, true},
+ Structs::Common__Turn__parameters};
+const ford_message_descriptions::ArrayDescription
+ Navigation__UpdateTurnList__request__parameter1 = {
+ {"turnList", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__UpdateTurnList__request__parameter1_array,
+ "((b(is))(b(si)))"};
+const ford_message_descriptions::StructDescription
+ Navigation__UpdateTurnList__request__parameter2_array = {
+ {"softButtons", ford_message_descriptions::Struct, true},
+ Structs::Common__SoftButton__parameters};
+const ford_message_descriptions::ArrayDescription
+ Navigation__UpdateTurnList__request__parameter2 = {
+ {"softButtons", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__UpdateTurnList__request__parameter2_array,
+ "(i(bs)(b(si))(bb)ii)"};
+const ford_message_descriptions::ParameterDescription
+ Navigation__UpdateTurnList__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__UpdateTurnList__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__UpdateTurnList__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__UpdateTurnList__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__UpdateTurnList__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__UpdateTurnList__request = {
+ "Navigation",
+ "UpdateTurnList",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ Navigation__UpdateTurnList__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__UpdateTurnList__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__UpdateTurnList__response = {
+ "Navigation",
+ "UpdateTurnList",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_UpdateTurnList,
+ Navigation__UpdateTurnList__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__OnTBTClientState__notification__parameter1 = {
+ "state", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__OnTBTClientState__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__OnTBTClientState__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__OnTBTClientState__notification = {
+ "Navigation",
+ "OnTBTClientState",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::Navigation_OnTBTClientState,
+ Navigation__OnTBTClientState__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ Navigation__SetVideoConfig__request__parameter1 = {
+ {"config", ford_message_descriptions::Struct, true},
+ Structs::Common__VideoConfig__parameters};
+const ford_message_descriptions::ParameterDescription
+ Navigation__SetVideoConfig__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__SetVideoConfig__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SetVideoConfig__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SetVideoConfig__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__SetVideoConfig__request = {
+ "Navigation",
+ "SetVideoConfig",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_SetVideoConfig,
+ Navigation__SetVideoConfig__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__SetVideoConfig__response__parameter1_array = {
+ "rejectedParams", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ Navigation__SetVideoConfig__response__parameter1 = {
+ {"rejectedParams", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SetVideoConfig__response__parameter1_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__SetVideoConfig__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__SetVideoConfig__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__SetVideoConfig__response = {
+ "Navigation",
+ "SetVideoConfig",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_SetVideoConfig,
+ Navigation__SetVideoConfig__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__StartStream__request__parameter1 = {
+ "url", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__StartStream__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StartStream__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__StartStream__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__StartStream__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StartStream__request = {
+ "Navigation",
+ "StartStream",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_StartStream,
+ Navigation__StartStream__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StartStream__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StartStream__response = {
+ "Navigation",
+ "StartStream",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_StartStream,
+ Navigation__StartStream__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__StopStream__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StopStream__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__StopStream__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StopStream__request = {
+ "Navigation",
+ "StopStream",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_StopStream,
+ Navigation__StopStream__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StopStream__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StopStream__response = {
+ "Navigation",
+ "StopStream",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_StopStream,
+ Navigation__StopStream__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__StartAudioStream__request__parameter1 = {
+ "url", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__StartAudioStream__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StartAudioStream__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__StartAudioStream__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__StartAudioStream__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StartAudioStream__request = {
+ "Navigation",
+ "StartAudioStream",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_StartAudioStream,
+ Navigation__StartAudioStream__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StartAudioStream__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StartAudioStream__response = {
+ "Navigation",
+ "StartAudioStream",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_StartAudioStream,
+ Navigation__StartAudioStream__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__StopAudioStream__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StopAudioStream__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__StopAudioStream__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StopAudioStream__request = {
+ "Navigation",
+ "StopAudioStream",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_StopAudioStream,
+ Navigation__StopAudioStream__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__StopAudioStream__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__StopAudioStream__response = {
+ "Navigation",
+ "StopAudioStream",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_StopAudioStream,
+ Navigation__StopAudioStream__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__OnAudioDataStreaming__notification__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__OnAudioDataStreaming__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__OnAudioDataStreaming__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__OnAudioDataStreaming__notification = {
+ "Navigation",
+ "OnAudioDataStreaming",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::Navigation_OnAudioDataStreaming,
+ Navigation__OnAudioDataStreaming__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__OnVideoDataStreaming__notification__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__OnVideoDataStreaming__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__OnVideoDataStreaming__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__OnVideoDataStreaming__notification = {
+ "Navigation",
+ "OnVideoDataStreaming",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::Navigation_OnVideoDataStreaming,
+ Navigation__OnVideoDataStreaming__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__GetWayPoints__request__parameter1 = {
+ "wayPointType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ Navigation__GetWayPoints__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__GetWayPoints__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__GetWayPoints__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__GetWayPoints__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__GetWayPoints__request = {
+ "Navigation",
+ "GetWayPoints",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_GetWayPoints,
+ Navigation__GetWayPoints__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ Navigation__GetWayPoints__response__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::StructDescription
+ Navigation__GetWayPoints__response__parameter2_array = {
+ {"wayPoints", ford_message_descriptions::Struct, true},
+ Structs::Common__LocationDetails__parameters};
+const ford_message_descriptions::ArrayDescription
+ Navigation__GetWayPoints__response__parameter2 = {
+ {"wayPoints", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__GetWayPoints__response__parameter2_array,
+ "((b(dd))(bs)(bas)(bs)(bs)(b(si))(b((bs)(bs)(bs)(bs)(bs)(bs)(bs)(bs)("
+ "bs))))"};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__GetWayPoints__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__GetWayPoints__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__GetWayPoints__response__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__GetWayPoints__response = {
+ "Navigation",
+ "GetWayPoints",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_GetWayPoints,
+ Navigation__GetWayPoints__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ Navigation__OnWayPointChange__notification__parameter1_array = {
+ {"wayPoints", ford_message_descriptions::Struct, true},
+ Structs::Common__LocationDetails__parameters};
+const ford_message_descriptions::ArrayDescription
+ Navigation__OnWayPointChange__notification__parameter1 = {
+ {"wayPoints", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__OnWayPointChange__notification__parameter1_array,
+ "((b(dd))(bs)(bas)(bs)(bs)(b(si))(b((bs)(bs)(bs)(bs)(bs)(bs)(bs)(bs)("
+ "bs))))"};
+const ford_message_descriptions::ParameterDescription*
+ Navigation__OnWayPointChange__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&Navigation__OnWayPointChange__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__OnWayPointChange__notification = {
+ "Navigation",
+ "OnWayPointChange",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::Navigation_OnWayPointChange,
+ Navigation__OnWayPointChange__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__SubscribeWayPoints__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__SubscribeWayPoints__request = {
+ "Navigation",
+ "SubscribeWayPoints",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints,
+ Navigation__SubscribeWayPoints__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__SubscribeWayPoints__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__SubscribeWayPoints__response = {
+ "Navigation",
+ "SubscribeWayPoints",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_SubscribeWayPoints,
+ Navigation__SubscribeWayPoints__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__UnsubscribeWayPoints__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__UnsubscribeWayPoints__request = {
+ "Navigation",
+ "UnsubscribeWayPoints",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints,
+ Navigation__UnsubscribeWayPoints__request__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ Navigation__UnsubscribeWayPoints__response__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ Navigation__UnsubscribeWayPoints__response = {
+ "Navigation",
+ "UnsubscribeWayPoints",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints,
+ Navigation__UnsubscribeWayPoints__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__IsReady__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__IsReady__request = {"VehicleInfo",
+ "IsReady",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_IsReady,
+ VehicleInfo__IsReady__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__IsReady__response__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__IsReady__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__IsReady__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__IsReady__response = {
+ "VehicleInfo",
+ "IsReady",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_IsReady,
+ VehicleInfo__IsReady__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetVehicleType__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetVehicleType__request = {
+ "VehicleInfo",
+ "GetVehicleType",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
+ VehicleInfo__GetVehicleType__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleType__response__parameter1 = {
+ {"vehicleType", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleType__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetVehicleType__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleType__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetVehicleType__response = {
+ "VehicleInfo",
+ "GetVehicleType",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleType,
+ VehicleInfo__GetVehicleType__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__ReadDID__request__parameter1 = {
+ "ecuName", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__ReadDID__request__parameter2_array = {
+ "didLocation", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ArrayDescription
+ VehicleInfo__ReadDID__request__parameter2 = {
+ {"didLocation", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__ReadDID__request__parameter2_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__ReadDID__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__ReadDID__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__ReadDID__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__ReadDID__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__ReadDID__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__ReadDID__request = {"VehicleInfo",
+ "ReadDID",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_ReadDID,
+ VehicleInfo__ReadDID__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__ReadDID__response__parameter1_array = {
+ {"didResult", ford_message_descriptions::Struct, true},
+ Structs::Common__DIDResult__parameters};
+const ford_message_descriptions::ArrayDescription
+ VehicleInfo__ReadDID__response__parameter1 = {
+ {"didResult", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__ReadDID__response__parameter1_array,
+ "(ii(bs))"};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__ReadDID__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__ReadDID__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__ReadDID__response = {
+ "VehicleInfo",
+ "ReadDID",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_ReadDID,
+ VehicleInfo__ReadDID__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDTCs__request__parameter1 = {
+ "ecuName", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDTCs__request__parameter2 = {
+ "dtcMask", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDTCs__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetDTCs__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDTCs__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetDTCs__request = {"VehicleInfo",
+ "GetDTCs",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetDTCs,
+ VehicleInfo__GetDTCs__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDTCs__response__parameter1 = {
+ "ecuHeader", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDTCs__response__parameter2_array = {
+ "dtc", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ VehicleInfo__GetDTCs__response__parameter2 = {
+ {"dtc", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter2_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetDTCs__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDTCs__response__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetDTCs__response = {
+ "VehicleInfo",
+ "GetDTCs",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetDTCs,
+ VehicleInfo__GetDTCs__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__DiagnosticMessage__request__parameter1 = {
+ "targetID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__DiagnosticMessage__request__parameter2 = {
+ "messageLength", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__DiagnosticMessage__request__parameter3_array = {
+ "messageData", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ArrayDescription
+ VehicleInfo__DiagnosticMessage__request__parameter3 = {
+ {"messageData", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter3_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__DiagnosticMessage__request__parameter4 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__DiagnosticMessage__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__DiagnosticMessage__request__parameter4,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__DiagnosticMessage__request = {
+ "VehicleInfo",
+ "DiagnosticMessage",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
+ VehicleInfo__DiagnosticMessage__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__DiagnosticMessage__response__parameter1_array = {
+ "messageDataResult", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ArrayDescription
+ VehicleInfo__DiagnosticMessage__response__parameter1 = {
+ {"messageDataResult", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__DiagnosticMessage__response__parameter1_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__DiagnosticMessage__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__DiagnosticMessage__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__DiagnosticMessage__response = {
+ "VehicleInfo",
+ "DiagnosticMessage",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage,
+ VehicleInfo__DiagnosticMessage__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter1 = {
+ "gps", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter2 = {
+ "speed", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter3 = {
+ "rpm", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter4 = {
+ "fuelLevel", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter5 = {
+ "fuelLevel_State", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter6 = {
+ "instantFuelConsumption", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter7 = {
+ "externalTemperature", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter8 = {
+ "prndl", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter9 = {
+ "tirePressure", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter10 = {
+ "odometer", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter11 = {
+ "beltStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter12 = {
+ "bodyInformation", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter13 = {
+ "deviceStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter14 = {
+ "driverBraking", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter15 = {
+ "wiperStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter16 = {
+ "headLampStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter17 = {
+ "engineTorque", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter18 = {
+ "accPedalPosition", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter19 = {
+ "steeringWheelAngle", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter20 = {
+ "eCallInfo", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter21 = {
+ "airbagStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter22 = {
+ "emergencyEvent", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter23 = {
+ "clusterModeStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVehicleData__request__parameter24 = {
+ "myKey", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription* VehicleInfo__SubscribeVehicleData__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter18,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter19,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter20,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter21,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter22,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter23,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__request__parameter24,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeVehicleData__request = {
+ "VehicleInfo",
+ "SubscribeVehicleData",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
+ VehicleInfo__SubscribeVehicleData__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter2 = {
+ {"speed", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter3 = {
+ {"rpm", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter4 = {
+ {"fuelLevel", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter5 = {
+ {"fuelLevel_State", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter6 = {
+ {"instantFuelConsumption", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter7 = {
+ {"externalTemperature", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter8 = {
+ {"prndl", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter9 = {
+ {"tirePressure", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter10 = {
+ {"odometer", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter11 = {
+ {"beltStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter12 = {
+ {"bodyInformation", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter13 = {
+ {"deviceStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter14 = {
+ {"driverBraking", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter15 = {
+ {"wiperStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter16 = {
+ {"headLampStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter17 = {
+ {"engineTorque", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter18 = {
+ {"accPedalPosition", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter19 = {
+ {"steeringWheelAngle", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter20 = {
+ {"eCallInfo", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter21 = {
+ {"airbagStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter22 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter23 = {
+ {"clusterModes", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeVehicleData__response__parameter24 = {
+ {"myKey", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription* VehicleInfo__SubscribeVehicleData__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter18,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter19,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter20,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter21,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter22,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter23,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVehicleData__response__parameter24,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeVehicleData__response = {
+ "VehicleInfo",
+ "SubscribeVehicleData",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData,
+ VehicleInfo__SubscribeVehicleData__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter2 = {
+ "gps", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter3 = {
+ "speed", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter4 = {
+ "rpm", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter5 = {
+ "fuelLevel", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter6 = {
+ "fuelLevel_State", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter7 = {
+ "instantFuelConsumption", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter8 = {
+ "externalTemperature", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter9 = {
+ "prndl", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter10 = {
+ "tirePressure", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter11 = {
+ "odometer", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter12 = {
+ "beltStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter13 = {
+ "bodyInformation", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter14 = {
+ "deviceStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter15 = {
+ "driverBraking", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter16 = {
+ "wiperStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter17 = {
+ "headLampStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter18 = {
+ "engineTorque", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter19 = {
+ "accPedalPosition", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter20 = {
+ "steeringWheelAngle", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter21 = {
+ "eCallInfo", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter22 = {
+ "airbagStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter23 = {
+ "emergencyEvent", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter24 = {
+ "clusterModeStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVehicleData__request__parameter25 = {
+ "myKey", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription* VehicleInfo__UnsubscribeVehicleData__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter18,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter19,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter20,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter21,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter22,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter23,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter24,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__request__parameter25,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeVehicleData__request = {
+ "VehicleInfo",
+ "UnsubscribeVehicleData",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
+ VehicleInfo__UnsubscribeVehicleData__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter2 = {
+ {"speed", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter3 = {
+ {"rpm", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter4 = {
+ {"fuelLevel", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter5 = {
+ {"fuelLevel_State", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter6 = {
+ {"instantFuelConsumption", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter7 = {
+ {"externalTemperature", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter8 = {
+ {"prndl", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter9 = {
+ {"tirePressure", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter10 = {
+ {"odometer", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter11 = {
+ {"beltStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter12 = {
+ {"bodyInformation", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter13 = {
+ {"deviceStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter14 = {
+ {"driverBraking", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter15 = {
+ {"wiperStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter16 = {
+ {"headLampStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter17 = {
+ {"engineTorque", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter18 = {
+ {"accPedalPosition", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter19 = {
+ {"steeringWheelAngle", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter20 = {
+ {"eCallInfo", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter21 = {
+ {"airbagStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter22 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter23 = {
+ {"clusterModes", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeVehicleData__response__parameter24 = {
+ {"myKey", ford_message_descriptions::Struct, false},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription* VehicleInfo__UnsubscribeVehicleData__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter18,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter19,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter20,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter21,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter22,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter23,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVehicleData__response__parameter24,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeVehicleData__response = {
+ "VehicleInfo",
+ "UnsubscribeVehicleData",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData,
+ VehicleInfo__UnsubscribeVehicleData__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter1 = {
+ "gps", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter2 = {
+ "speed", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter3 = {
+ "rpm", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter4 = {
+ "fuelLevel", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter5 = {
+ "fuelLevel_State", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter6 = {
+ "instantFuelConsumption", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter7 = {
+ "externalTemperature", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter8 = {
+ "vin", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter9 = {
+ "prndl", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter10 = {
+ "tirePressure", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter11 = {
+ "odometer", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter12 = {
+ "beltStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter13 = {
+ "bodyInformation", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter14 = {
+ "deviceStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter15 = {
+ "driverBraking", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter16 = {
+ "wiperStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter17 = {
+ "headLampStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter18 = {
+ "engineTorque", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter19 = {
+ "accPedalPosition", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter20 = {
+ "steeringWheelAngle", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter21 = {
+ "eCallInfo", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter22 = {
+ "airbagStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter23 = {
+ "emergencyEvent", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter24 = {
+ "clusterModeStatus", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__request__parameter25 = {
+ "myKey", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription* VehicleInfo__GetVehicleData__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter18,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter19,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter20,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter21,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter22,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter23,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter24,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__request__parameter25,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetVehicleData__request = {
+ "VehicleInfo",
+ "GetVehicleData",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData,
+ VehicleInfo__GetVehicleData__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, false},
+ Structs::Common__GPSData__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter2 = {
+ "speed", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter3 = {
+ "rpm", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter4 = {
+ "fuelLevel", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter5 = {
+ "fuelLevel_State", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter6 = {
+ "instantFuelConsumption", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter7 = {
+ "externalTemperature", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter8 = {
+ "vin", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter9 = {
+ "prndl", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter10 = {
+ {"tirePressure", ford_message_descriptions::Struct, false},
+ Structs::Common__TireStatus__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter11 = {
+ "odometer", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter12 = {
+ {"beltStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__BeltStatus__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter13 = {
+ {"bodyInformation", ford_message_descriptions::Struct, false},
+ Structs::Common__BodyInformation__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter14 = {
+ {"deviceStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__DeviceStatus__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter15 = {
+ "driverBraking", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter16 = {
+ "wiperStatus", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter17 = {
+ {"headLampStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__HeadLampStatus__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter18 = {
+ "engineTorque", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter19 = {
+ "accPedalPosition", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVehicleData__response__parameter20 = {
+ "steeringWheelAngle", ford_message_descriptions::Float, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter21 = {
+ {"eCallInfo", ford_message_descriptions::Struct, false},
+ Structs::Common__ECallInfo__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter22 = {
+ {"airbagStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__AirbagStatus__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter23 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, false},
+ Structs::Common__EmergencyEvent__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter24 = {
+ {"clusterModeStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__ClusterModeStatus__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetVehicleData__response__parameter25 = {
+ {"myKey", ford_message_descriptions::Struct, false},
+ Structs::Common__MyKey__parameters};
+const ford_message_descriptions::ParameterDescription* VehicleInfo__GetVehicleData__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter18,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter19,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter20,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter21,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter22,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter23,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter24,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVehicleData__response__parameter25,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetVehicleData__response = {
+ "VehicleInfo",
+ "GetVehicleData",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetVehicleData,
+ VehicleInfo__GetVehicleData__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, false},
+ Structs::Common__GPSData__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter2 = {
+ "speed", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter3 = {
+ "rpm", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter4 = {
+ "fuelLevel", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter5 = {
+ "fuelLevel_State", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter6 = {
+ "instantFuelConsumption", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter7 = {
+ "externalTemperature", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter8 = {
+ "vin", ford_message_descriptions::String, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter9 = {
+ "prndl", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter10 = {
+ {"tirePressure", ford_message_descriptions::Struct, false},
+ Structs::Common__TireStatus__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter11 = {
+ "odometer", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter12 = {
+ {"beltStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__BeltStatus__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter13 = {
+ {"bodyInformation", ford_message_descriptions::Struct, false},
+ Structs::Common__BodyInformation__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter14 = {
+ {"deviceStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__DeviceStatus__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter15 = {
+ "driverBraking", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter16 = {
+ "wiperStatus", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter17 = {
+ {"headLampStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__HeadLampStatus__parameters};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter18 = {
+ "engineTorque", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter19 = {
+ "accPedalPosition", ford_message_descriptions::Float, false};
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVehicleData__notification__parameter20 = {
+ "steeringWheelAngle", ford_message_descriptions::Float, false};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter21 = {
+ {"eCallInfo", ford_message_descriptions::Struct, false},
+ Structs::Common__ECallInfo__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter22 = {
+ {"airbagStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__AirbagStatus__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter23 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, false},
+ Structs::Common__EmergencyEvent__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter24 = {
+ {"clusterModeStatus", ford_message_descriptions::Struct, false},
+ Structs::Common__ClusterModeStatus__parameters};
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnVehicleData__notification__parameter25 = {
+ {"myKey", ford_message_descriptions::Struct, false},
+ Structs::Common__MyKey__parameters};
+const ford_message_descriptions::ParameterDescription* VehicleInfo__OnVehicleData__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter8,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter9,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter10,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter11,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter12,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter13,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter14,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter15,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter16,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter17,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter18,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter19,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter20,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter21,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter22,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter23,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter24,
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVehicleData__notification__parameter25,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnVehicleData__notification = {
+ "VehicleInfo",
+ "OnVehicleData",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnVehicleData,
+ VehicleInfo__OnVehicleData__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetGpsData__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetGpsData__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetGpsData__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetGpsData__request = {
+ "VehicleInfo",
+ "GetGpsData",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetGpsData,
+ VehicleInfo__GetGpsData__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetGpsData__response__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, true},
+ Structs::Common__GPSData__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetGpsData__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetGpsData__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetGpsData__response = {
+ "VehicleInfo",
+ "GetGpsData",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetGpsData,
+ VehicleInfo__GetGpsData__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetSpeed__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetSpeed__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetSpeed__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetSpeed__request = {
+ "VehicleInfo",
+ "GetSpeed",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetSpeed,
+ VehicleInfo__GetSpeed__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetSpeed__response__parameter1 = {
+ "speed", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetSpeed__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetSpeed__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetSpeed__response = {
+ "VehicleInfo",
+ "GetSpeed",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetSpeed,
+ VehicleInfo__GetSpeed__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetRpm__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetRpm__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetRpm__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetRpm__request = {"VehicleInfo",
+ "GetRpm",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetRpm,
+ VehicleInfo__GetRpm__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetRpm__response__parameter1 = {
+ "rpm", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetRpm__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetRpm__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetRpm__response = {"VehicleInfo",
+ "GetRpm",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetRpm,
+ VehicleInfo__GetRpm__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetFuelLevel__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetFuelLevel__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetFuelLevel__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetFuelLevel__request = {
+ "VehicleInfo",
+ "GetFuelLevel",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevel,
+ VehicleInfo__GetFuelLevel__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetFuelLevel__response__parameter1 = {
+ "fuelLevel", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetFuelLevel__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetFuelLevel__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetFuelLevel__response = {
+ "VehicleInfo",
+ "GetFuelLevel",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevel,
+ VehicleInfo__GetFuelLevel__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetFuelLevelState__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetFuelLevelState__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetFuelLevelState__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetFuelLevelState__request = {
+ "VehicleInfo",
+ "GetFuelLevelState",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
+ VehicleInfo__GetFuelLevelState__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetFuelLevelState__response__parameter1 = {
+ "fuelLevel_State", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetFuelLevelState__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetFuelLevelState__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetFuelLevelState__response = {
+ "VehicleInfo",
+ "GetFuelLevelState",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState,
+ VehicleInfo__GetFuelLevelState__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetInstantFuelConsumption__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetInstantFuelConsumption__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetInstantFuelConsumption__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetInstantFuelConsumption__request = {
+ "VehicleInfo",
+ "GetInstantFuelConsumption",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
+ VehicleInfo__GetInstantFuelConsumption__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetInstantFuelConsumption__response__parameter1 = {
+ "instantFuelConsumption", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetInstantFuelConsumption__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetInstantFuelConsumption__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetInstantFuelConsumption__response = {
+ "VehicleInfo",
+ "GetInstantFuelConsumption",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption,
+ VehicleInfo__GetInstantFuelConsumption__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetExternalTemperature__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetExternalTemperature__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetExternalTemperature__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetExternalTemperature__request = {
+ "VehicleInfo",
+ "GetExternalTemperature",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
+ VehicleInfo__GetExternalTemperature__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetExternalTemperature__response__parameter1 = {
+ "externalTemperature", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetExternalTemperature__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetExternalTemperature__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetExternalTemperature__response = {
+ "VehicleInfo",
+ "GetExternalTemperature",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature,
+ VehicleInfo__GetExternalTemperature__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVin__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetVin__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVin__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetVin__request = {"VehicleInfo",
+ "GetVin",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetVin,
+ VehicleInfo__GetVin__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetVin__response__parameter1 = {
+ "vin", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetVin__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetVin__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetVin__response = {"VehicleInfo",
+ "GetVin",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetVin,
+ VehicleInfo__GetVin__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetPrndl__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetPrndl__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetPrndl__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetPrndl__request = {
+ "VehicleInfo",
+ "GetPrndl",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetPrndl,
+ VehicleInfo__GetPrndl__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetPrndl__response__parameter1 = {
+ "prndl", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetPrndl__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetPrndl__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetPrndl__response = {
+ "VehicleInfo",
+ "GetPrndl",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetPrndl,
+ VehicleInfo__GetPrndl__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetTirePressure__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetTirePressure__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetTirePressure__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetTirePressure__request = {
+ "VehicleInfo",
+ "GetTirePressure",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetTirePressure,
+ VehicleInfo__GetTirePressure__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetTirePressure__response__parameter1 = {
+ {"tirePressure", ford_message_descriptions::Struct, true},
+ Structs::Common__TireStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetTirePressure__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetTirePressure__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetTirePressure__response = {
+ "VehicleInfo",
+ "GetTirePressure",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetTirePressure,
+ VehicleInfo__GetTirePressure__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetOdometer__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetOdometer__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetOdometer__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetOdometer__request = {
+ "VehicleInfo",
+ "GetOdometer",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetOdometer,
+ VehicleInfo__GetOdometer__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetOdometer__response__parameter1 = {
+ "odometer", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetOdometer__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetOdometer__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetOdometer__response = {
+ "VehicleInfo",
+ "GetOdometer",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetOdometer,
+ VehicleInfo__GetOdometer__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetBeltStatus__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetBeltStatus__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetBeltStatus__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetBeltStatus__request = {
+ "VehicleInfo",
+ "GetBeltStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetBeltStatus,
+ VehicleInfo__GetBeltStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetBeltStatus__response__parameter1 = {
+ {"beltStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__BeltStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetBeltStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetBeltStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetBeltStatus__response = {
+ "VehicleInfo",
+ "GetBeltStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetBeltStatus,
+ VehicleInfo__GetBeltStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetBodyInformation__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetBodyInformation__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetBodyInformation__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetBodyInformation__request = {
+ "VehicleInfo",
+ "GetBodyInformation",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
+ VehicleInfo__GetBodyInformation__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetBodyInformation__response__parameter1 = {
+ {"bodyInformation", ford_message_descriptions::Struct, true},
+ Structs::Common__BodyInformation__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetBodyInformation__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetBodyInformation__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetBodyInformation__response = {
+ "VehicleInfo",
+ "GetBodyInformation",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetBodyInformation,
+ VehicleInfo__GetBodyInformation__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDeviceStatus__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetDeviceStatus__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDeviceStatus__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetDeviceStatus__request = {
+ "VehicleInfo",
+ "GetDeviceStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus,
+ VehicleInfo__GetDeviceStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetDeviceStatus__response__parameter1 = {
+ {"deviceStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__DeviceStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetDeviceStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDeviceStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetDeviceStatus__response = {
+ "VehicleInfo",
+ "GetDeviceStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus,
+ VehicleInfo__GetDeviceStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDriverBraking__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetDriverBraking__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDriverBraking__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetDriverBraking__request = {
+ "VehicleInfo",
+ "GetDriverBraking",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetDriverBraking,
+ VehicleInfo__GetDriverBraking__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetDriverBraking__response__parameter1 = {
+ "driverBraking", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetDriverBraking__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetDriverBraking__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetDriverBraking__response = {
+ "VehicleInfo",
+ "GetDriverBraking",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetDriverBraking,
+ VehicleInfo__GetDriverBraking__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetWiperStatus__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetWiperStatus__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetWiperStatus__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetWiperStatus__request = {
+ "VehicleInfo",
+ "GetWiperStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetWiperStatus,
+ VehicleInfo__GetWiperStatus__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetWiperStatus__response__parameter1 = {
+ "wiperStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetWiperStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetWiperStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetWiperStatus__response = {
+ "VehicleInfo",
+ "GetWiperStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetWiperStatus,
+ VehicleInfo__GetWiperStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetHeadLampStatus__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetHeadLampStatus__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetHeadLampStatus__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetHeadLampStatus__request = {
+ "VehicleInfo",
+ "GetHeadLampStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
+ VehicleInfo__GetHeadLampStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetHeadLampStatus__response__parameter1 = {
+ {"headLampStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__HeadLampStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetHeadLampStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetHeadLampStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetHeadLampStatus__response = {
+ "VehicleInfo",
+ "GetHeadLampStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus,
+ VehicleInfo__GetHeadLampStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetEngineTorque__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetEngineTorque__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetEngineTorque__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetEngineTorque__request = {
+ "VehicleInfo",
+ "GetEngineTorque",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetEngineTorque,
+ VehicleInfo__GetEngineTorque__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetEngineTorque__response__parameter1 = {
+ "engineTorque", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetEngineTorque__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetEngineTorque__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetEngineTorque__response = {
+ "VehicleInfo",
+ "GetEngineTorque",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetEngineTorque,
+ VehicleInfo__GetEngineTorque__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetAccPedalPosition__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetAccPedalPosition__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetAccPedalPosition__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetAccPedalPosition__request = {
+ "VehicleInfo",
+ "GetAccPedalPosition",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition,
+ VehicleInfo__GetAccPedalPosition__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetAccPedalPosition__response__parameter1 = {
+ "accPedalPosition", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetAccPedalPosition__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetAccPedalPosition__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetAccPedalPosition__response = {
+ "VehicleInfo",
+ "GetAccPedalPosition",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition,
+ VehicleInfo__GetAccPedalPosition__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetSteeringWheelAngle__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetSteeringWheelAngle__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetSteeringWheelAngle__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetSteeringWheelAngle__request = {
+ "VehicleInfo",
+ "GetSteeringWheelAngle",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
+ VehicleInfo__GetSteeringWheelAngle__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetSteeringWheelAngle__response__parameter1 = {
+ "steeringWheelAngle", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetSteeringWheelAngle__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetSteeringWheelAngle__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetSteeringWheelAngle__response = {
+ "VehicleInfo",
+ "GetSteeringWheelAngle",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle,
+ VehicleInfo__GetSteeringWheelAngle__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetECallInfo__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetECallInfo__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetECallInfo__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetECallInfo__request = {
+ "VehicleInfo",
+ "GetECallInfo",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetECallInfo,
+ VehicleInfo__GetECallInfo__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetECallInfo__response__parameter1 = {
+ {"eCallInfo", ford_message_descriptions::Struct, true},
+ Structs::Common__ECallInfo__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetECallInfo__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetECallInfo__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetECallInfo__response = {
+ "VehicleInfo",
+ "GetECallInfo",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetECallInfo,
+ VehicleInfo__GetECallInfo__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetAirbagStatus__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetAirbagStatus__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetAirbagStatus__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetAirbagStatus__request = {
+ "VehicleInfo",
+ "GetAirbagStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus,
+ VehicleInfo__GetAirbagStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetAirbagStatus__response__parameter1 = {
+ {"airbagStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__AirbagStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetAirbagStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetAirbagStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetAirbagStatus__response = {
+ "VehicleInfo",
+ "GetAirbagStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus,
+ VehicleInfo__GetAirbagStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetEmergencyEvent__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetEmergencyEvent__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetEmergencyEvent__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetEmergencyEvent__request = {
+ "VehicleInfo",
+ "GetEmergencyEvent",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent,
+ VehicleInfo__GetEmergencyEvent__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetEmergencyEvent__response__parameter1 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, true},
+ Structs::Common__EmergencyEvent__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetEmergencyEvent__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetEmergencyEvent__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetEmergencyEvent__response = {
+ "VehicleInfo",
+ "GetEmergencyEvent",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent,
+ VehicleInfo__GetEmergencyEvent__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetClusterModeStatus__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetClusterModeStatus__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetClusterModeStatus__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetClusterModeStatus__request = {
+ "VehicleInfo",
+ "GetClusterModeStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
+ VehicleInfo__GetClusterModeStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetClusterModeStatus__response__parameter1 = {
+ {"clusterModeStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__ClusterModeStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetClusterModeStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetClusterModeStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetClusterModeStatus__response = {
+ "VehicleInfo",
+ "GetClusterModeStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus,
+ VehicleInfo__GetClusterModeStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__GetMyKey__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetMyKey__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetMyKey__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetMyKey__request = {
+ "VehicleInfo",
+ "GetMyKey",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_GetMyKey,
+ VehicleInfo__GetMyKey__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__GetMyKey__response__parameter1 = {
+ {"myKey", ford_message_descriptions::Struct, true},
+ Structs::Common__MyKey__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__GetMyKey__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__GetMyKey__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__GetMyKey__response = {
+ "VehicleInfo",
+ "GetMyKey",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_GetMyKey,
+ VehicleInfo__GetMyKey__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnGpsData__notification__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, true},
+ Structs::Common__GPSData__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnGpsData__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnGpsData__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnGpsData__notification = {
+ "VehicleInfo",
+ "OnGpsData",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnGpsData,
+ VehicleInfo__OnGpsData__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnSpeed__notification__parameter1 = {
+ "speed", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnSpeed__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnSpeed__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnSpeed__notification = {
+ "VehicleInfo",
+ "OnSpeed",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnSpeed,
+ VehicleInfo__OnSpeed__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnRpm__notification__parameter1 = {
+ "rpm", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnRpm__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnRpm__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnRpm__notification = {
+ "VehicleInfo",
+ "OnRpm",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnRpm,
+ VehicleInfo__OnRpm__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnFuelLevel__notification__parameter1 = {
+ "fuelLevel", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnFuelLevel__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnFuelLevel__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnFuelLevel__notification = {
+ "VehicleInfo",
+ "OnFuelLevel",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnFuelLevel,
+ VehicleInfo__OnFuelLevel__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnFuelLevelState__notification__parameter1 = {
+ "fuelLevel_State", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnFuelLevelState__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnFuelLevelState__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnFuelLevelState__notification = {
+ "VehicleInfo",
+ "OnFuelLevelState",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState,
+ VehicleInfo__OnFuelLevelState__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnInstantFuelConsumption__notification__parameter1 = {
+ "instantFuelConsumption", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnInstantFuelConsumption__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnInstantFuelConsumption__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnInstantFuelConsumption__notification = {
+ "VehicleInfo",
+ "OnInstantFuelConsumption",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption,
+ VehicleInfo__OnInstantFuelConsumption__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnExternalTemperature__notification__parameter1 = {
+ "externalTemperature", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnExternalTemperature__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnExternalTemperature__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnExternalTemperature__notification = {
+ "VehicleInfo",
+ "OnExternalTemperature",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature,
+ VehicleInfo__OnExternalTemperature__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnVin__notification__parameter1 = {
+ "vin", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnVin__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnVin__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnVin__notification = {
+ "VehicleInfo",
+ "OnVin",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnVin,
+ VehicleInfo__OnVin__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnPrndl__notification__parameter1 = {
+ "prndl", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnPrndl__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnPrndl__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnPrndl__notification = {
+ "VehicleInfo",
+ "OnPrndl",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnPrndl,
+ VehicleInfo__OnPrndl__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnTirePressure__notification__parameter1 = {
+ {"tirePressure", ford_message_descriptions::Struct, true},
+ Structs::Common__TireStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnTirePressure__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnTirePressure__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnTirePressure__notification = {
+ "VehicleInfo",
+ "OnTirePressure",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnTirePressure,
+ VehicleInfo__OnTirePressure__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnOdometer__notification__parameter1 = {
+ "odometer", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnOdometer__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnOdometer__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnOdometer__notification = {
+ "VehicleInfo",
+ "OnOdometer",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnOdometer,
+ VehicleInfo__OnOdometer__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnBeltStatus__notification__parameter1 = {
+ {"beltStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__BeltStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnBeltStatus__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnBeltStatus__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnBeltStatus__notification = {
+ "VehicleInfo",
+ "OnBeltStatus",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnBeltStatus,
+ VehicleInfo__OnBeltStatus__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnBodyInformation__notification__parameter1 = {
+ {"bodyInformation", ford_message_descriptions::Struct, true},
+ Structs::Common__BodyInformation__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnBodyInformation__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnBodyInformation__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnBodyInformation__notification = {
+ "VehicleInfo",
+ "OnBodyInformation",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnBodyInformation,
+ VehicleInfo__OnBodyInformation__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnDeviceStatus__notification__parameter1 = {
+ {"deviceStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__DeviceStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnDeviceStatus__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnDeviceStatus__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnDeviceStatus__notification = {
+ "VehicleInfo",
+ "OnDeviceStatus",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus,
+ VehicleInfo__OnDeviceStatus__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnDriverBraking__notification__parameter1 = {
+ "driverBraking", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnDriverBraking__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnDriverBraking__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnDriverBraking__notification = {
+ "VehicleInfo",
+ "OnDriverBraking",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnDriverBraking,
+ VehicleInfo__OnDriverBraking__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnWiperStatus__notification__parameter1 = {
+ "wiperStatus", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnWiperStatus__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnWiperStatus__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnWiperStatus__notification = {
+ "VehicleInfo",
+ "OnWiperStatus",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnWiperStatus,
+ VehicleInfo__OnWiperStatus__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnHeadLampStatus__notification__parameter1 = {
+ {"headLampStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__HeadLampStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnHeadLampStatus__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnHeadLampStatus__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnHeadLampStatus__notification = {
+ "VehicleInfo",
+ "OnHeadLampStatus",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus,
+ VehicleInfo__OnHeadLampStatus__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnEngineTorque__notification__parameter1 = {
+ "engineTorque", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnEngineTorque__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnEngineTorque__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnEngineTorque__notification = {
+ "VehicleInfo",
+ "OnEngineTorque",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnEngineTorque,
+ VehicleInfo__OnEngineTorque__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnAccPedalPosition__notification__parameter1 = {
+ "accPedalPosition", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnAccPedalPosition__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnAccPedalPosition__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnAccPedalPosition__notification = {
+ "VehicleInfo",
+ "OnAccPedalPosition",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition,
+ VehicleInfo__OnAccPedalPosition__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__OnSteeringWheelAngle__notification__parameter1 = {
+ "steeringWheelAngle", ford_message_descriptions::Float, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnSteeringWheelAngle__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnSteeringWheelAngle__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnSteeringWheelAngle__notification = {
+ "VehicleInfo",
+ "OnSteeringWheelAngle",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle,
+ VehicleInfo__OnSteeringWheelAngle__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnECallInfo__notification__parameter1 = {
+ {"eCallInfo", ford_message_descriptions::Struct, true},
+ Structs::Common__ECallInfo__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnECallInfo__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnECallInfo__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnECallInfo__notification = {
+ "VehicleInfo",
+ "OnECallInfo",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnECallInfo,
+ VehicleInfo__OnECallInfo__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnAirbagStatus__notification__parameter1 = {
+ {"airbagStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__AirbagStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnAirbagStatus__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnAirbagStatus__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnAirbagStatus__notification = {
+ "VehicleInfo",
+ "OnAirbagStatus",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnAirbagStatus,
+ VehicleInfo__OnAirbagStatus__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnEmergencyEvent__notification__parameter1 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, true},
+ Structs::Common__EmergencyEvent__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnEmergencyEvent__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnEmergencyEvent__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnEmergencyEvent__notification = {
+ "VehicleInfo",
+ "OnEmergencyEvent",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnEmergencyEvent,
+ VehicleInfo__OnEmergencyEvent__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnClusterModeStatus__notification__parameter1 = {
+ {"clusterModeStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__ClusterModeStatus__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnClusterModeStatus__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnClusterModeStatus__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnClusterModeStatus__notification = {
+ "VehicleInfo",
+ "OnClusterModeStatus",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnClusterModeStatus,
+ VehicleInfo__OnClusterModeStatus__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__OnMyKey__notification__parameter1 = {
+ {"myKey", ford_message_descriptions::Struct, true},
+ Structs::Common__MyKey__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__OnMyKey__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__OnMyKey__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__OnMyKey__notification = {
+ "VehicleInfo",
+ "OnMyKey",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::VehicleInfo_OnMyKey,
+ VehicleInfo__OnMyKey__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeGps__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeGps__request = {
+ "VehicleInfo",
+ "SubscribeGps",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeGps,
+ VehicleInfo__SubscribeGps__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeGps__response__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeGps__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeGps__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeGps__response = {
+ "VehicleInfo",
+ "SubscribeGps",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeGps,
+ VehicleInfo__SubscribeGps__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeGps__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeGps__request = {
+ "VehicleInfo",
+ "UnsubscribeGps",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps,
+ VehicleInfo__UnsubscribeGps__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeGps__response__parameter1 = {
+ {"gps", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeGps__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeGps__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeGps__response = {
+ "VehicleInfo",
+ "UnsubscribeGps",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps,
+ VehicleInfo__UnsubscribeGps__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeSpeed__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeSpeed__request = {
+ "VehicleInfo",
+ "SubscribeSpeed",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed,
+ VehicleInfo__SubscribeSpeed__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeSpeed__response__parameter1 = {
+ {"speed", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeSpeed__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeSpeed__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeSpeed__response = {
+ "VehicleInfo",
+ "SubscribeSpeed",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed,
+ VehicleInfo__SubscribeSpeed__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeSpeed__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeSpeed__request = {
+ "VehicleInfo",
+ "UnsubscribeSpeed",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed,
+ VehicleInfo__UnsubscribeSpeed__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeSpeed__response__parameter1 = {
+ {"speed", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeSpeed__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeSpeed__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeSpeed__response = {
+ "VehicleInfo",
+ "UnsubscribeSpeed",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed,
+ VehicleInfo__UnsubscribeSpeed__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeRpm__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeRpm__request = {
+ "VehicleInfo",
+ "SubscribeRpm",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeRpm,
+ VehicleInfo__SubscribeRpm__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeRpm__response__parameter1 = {
+ {"rpm", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeRpm__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeRpm__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeRpm__response = {
+ "VehicleInfo",
+ "SubscribeRpm",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeRpm,
+ VehicleInfo__SubscribeRpm__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeRpm__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeRpm__request = {
+ "VehicleInfo",
+ "UnsubscribeRpm",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm,
+ VehicleInfo__UnsubscribeRpm__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeRpm__response__parameter1 = {
+ {"rpm", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeRpm__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeRpm__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeRpm__response = {
+ "VehicleInfo",
+ "UnsubscribeRpm",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm,
+ VehicleInfo__UnsubscribeRpm__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeFuelLevel__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeFuelLevel__request = {
+ "VehicleInfo",
+ "SubscribeFuelLevel",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel,
+ VehicleInfo__SubscribeFuelLevel__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeFuelLevel__response__parameter1 = {
+ {"fuelLevel", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeFuelLevel__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeFuelLevel__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeFuelLevel__response = {
+ "VehicleInfo",
+ "SubscribeFuelLevel",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel,
+ VehicleInfo__SubscribeFuelLevel__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeFuelLevel__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeFuelLevel__request = {
+ "VehicleInfo",
+ "UnsubscribeFuelLevel",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
+ VehicleInfo__UnsubscribeFuelLevel__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeFuelLevel__response__parameter1 = {
+ {"fuelLevel", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeFuelLevel__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeFuelLevel__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeFuelLevel__response = {
+ "VehicleInfo",
+ "UnsubscribeFuelLevel",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel,
+ VehicleInfo__UnsubscribeFuelLevel__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeFuelLevel_State__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeFuelLevel_State__request = {
+ "VehicleInfo",
+ "SubscribeFuelLevel_State",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
+ VehicleInfo__SubscribeFuelLevel_State__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeFuelLevel_State__response__parameter1 = {
+ {"fuelLevel_State", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeFuelLevel_State__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeFuelLevel_State__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeFuelLevel_State__response = {
+ "VehicleInfo",
+ "SubscribeFuelLevel_State",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State,
+ VehicleInfo__SubscribeFuelLevel_State__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeFuelLevel_State__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeFuelLevel_State__request = {
+ "VehicleInfo",
+ "UnsubscribeFuelLevel_State",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
+ VehicleInfo__UnsubscribeFuelLevel_State__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeFuelLevel_State__response__parameter1 = {
+ {"fuelLevel_State", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeFuelLevel_State__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeFuelLevel_State__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeFuelLevel_State__response = {
+ "VehicleInfo",
+ "UnsubscribeFuelLevel_State",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State,
+ VehicleInfo__UnsubscribeFuelLevel_State__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeInstantFuelConsumption__request__parameters[] = {
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeInstantFuelConsumption__request = {
+ "VehicleInfo",
+ "SubscribeInstantFuelConsumption",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
+ VehicleInfo__SubscribeInstantFuelConsumption__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeInstantFuelConsumption__response__parameter1 = {
+ {"instantFuelConsumption", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeInstantFuelConsumption__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeInstantFuelConsumption__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeInstantFuelConsumption__response = {
+ "VehicleInfo",
+ "SubscribeInstantFuelConsumption",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption,
+ VehicleInfo__SubscribeInstantFuelConsumption__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeInstantFuelConsumption__request__parameters[] = {
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeInstantFuelConsumption__request = {
+ "VehicleInfo",
+ "UnsubscribeInstantFuelConsumption",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
+ VehicleInfo__UnsubscribeInstantFuelConsumption__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameter1 = {
+ {"instantFuelConsumption", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeInstantFuelConsumption__response = {
+ "VehicleInfo",
+ "UnsubscribeInstantFuelConsumption",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption,
+ VehicleInfo__UnsubscribeInstantFuelConsumption__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeExternalTemperature__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeExternalTemperature__request = {
+ "VehicleInfo",
+ "SubscribeExternalTemperature",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
+ VehicleInfo__SubscribeExternalTemperature__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeExternalTemperature__response__parameter1 = {
+ {"externalTemperature", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeExternalTemperature__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeExternalTemperature__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeExternalTemperature__response = {
+ "VehicleInfo",
+ "SubscribeExternalTemperature",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature,
+ VehicleInfo__SubscribeExternalTemperature__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeExternalTemperature__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeExternalTemperature__request = {
+ "VehicleInfo",
+ "UnsubscribeExternalTemperature",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
+ VehicleInfo__UnsubscribeExternalTemperature__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeExternalTemperature__response__parameter1 = {
+ {"externalTemperature", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeExternalTemperature__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeExternalTemperature__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeExternalTemperature__response = {
+ "VehicleInfo",
+ "UnsubscribeExternalTemperature",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature,
+ VehicleInfo__UnsubscribeExternalTemperature__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribePrndl__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribePrndl__request = {
+ "VehicleInfo",
+ "SubscribePrndl",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribePrndl,
+ VehicleInfo__SubscribePrndl__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribePrndl__response__parameter1 = {
+ {"prndl", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribePrndl__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribePrndl__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribePrndl__response = {
+ "VehicleInfo",
+ "SubscribePrndl",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribePrndl,
+ VehicleInfo__SubscribePrndl__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribePrndl__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribePrndl__request = {
+ "VehicleInfo",
+ "UnsubscribePrndl",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl,
+ VehicleInfo__UnsubscribePrndl__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribePrndl__response__parameter1 = {
+ {"prndl", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribePrndl__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribePrndl__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribePrndl__response = {
+ "VehicleInfo",
+ "UnsubscribePrndl",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl,
+ VehicleInfo__UnsubscribePrndl__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeVin__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeVin__request = {
+ "VehicleInfo",
+ "SubscribeVin",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVin,
+ VehicleInfo__SubscribeVin__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__SubscribeVin__response__parameter1 = {
+ "vin", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeVin__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeVin__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeVin__response = {
+ "VehicleInfo",
+ "SubscribeVin",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeVin,
+ VehicleInfo__SubscribeVin__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeVin__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeVin__request = {
+ "VehicleInfo",
+ "UnsubscribeVin",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin,
+ VehicleInfo__UnsubscribeVin__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ VehicleInfo__UnsubscribeVin__response__parameter1 = {
+ "vin", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeVin__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeVin__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeVin__response = {
+ "VehicleInfo",
+ "UnsubscribeVin",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin,
+ VehicleInfo__UnsubscribeVin__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeTirePressure__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeTirePressure__request = {
+ "VehicleInfo",
+ "SubscribeTirePressure",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
+ VehicleInfo__SubscribeTirePressure__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeTirePressure__response__parameter1 = {
+ {"tirePressure", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeTirePressure__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeTirePressure__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeTirePressure__response = {
+ "VehicleInfo",
+ "SubscribeTirePressure",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure,
+ VehicleInfo__SubscribeTirePressure__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeTirePressure__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeTirePressure__request = {
+ "VehicleInfo",
+ "UnsubscribeTirePressure",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
+ VehicleInfo__UnsubscribeTirePressure__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeTirePressure__response__parameter1 = {
+ {"tirePressure", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeTirePressure__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeTirePressure__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeTirePressure__response = {
+ "VehicleInfo",
+ "UnsubscribeTirePressure",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure,
+ VehicleInfo__UnsubscribeTirePressure__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeOdometer__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeOdometer__request = {
+ "VehicleInfo",
+ "SubscribeOdometer",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer,
+ VehicleInfo__SubscribeOdometer__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeOdometer__response__parameter1 = {
+ {"odometer", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeOdometer__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeOdometer__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeOdometer__response = {
+ "VehicleInfo",
+ "SubscribeOdometer",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer,
+ VehicleInfo__SubscribeOdometer__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeOdometer__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeOdometer__request = {
+ "VehicleInfo",
+ "UnsubscribeOdometer",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer,
+ VehicleInfo__UnsubscribeOdometer__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeOdometer__response__parameter1 = {
+ {"odometer", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeOdometer__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeOdometer__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeOdometer__response = {
+ "VehicleInfo",
+ "UnsubscribeOdometer",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer,
+ VehicleInfo__UnsubscribeOdometer__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeBeltStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeBeltStatus__request = {
+ "VehicleInfo",
+ "SubscribeBeltStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
+ VehicleInfo__SubscribeBeltStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeBeltStatus__response__parameter1 = {
+ {"beltStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeBeltStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeBeltStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeBeltStatus__response = {
+ "VehicleInfo",
+ "SubscribeBeltStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus,
+ VehicleInfo__SubscribeBeltStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeBeltStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeBeltStatus__request = {
+ "VehicleInfo",
+ "UnsubscribeBeltStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
+ VehicleInfo__UnsubscribeBeltStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeBeltStatus__response__parameter1 = {
+ {"beltStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeBeltStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeBeltStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeBeltStatus__response = {
+ "VehicleInfo",
+ "UnsubscribeBeltStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus,
+ VehicleInfo__UnsubscribeBeltStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeBodyInformation__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeBodyInformation__request = {
+ "VehicleInfo",
+ "SubscribeBodyInformation",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
+ VehicleInfo__SubscribeBodyInformation__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeBodyInformation__response__parameter1 = {
+ {"bodyInformation", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeBodyInformation__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeBodyInformation__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeBodyInformation__response = {
+ "VehicleInfo",
+ "SubscribeBodyInformation",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation,
+ VehicleInfo__SubscribeBodyInformation__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeBodyInformation__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeBodyInformation__request = {
+ "VehicleInfo",
+ "UnsubscribeBodyInformation",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
+ VehicleInfo__UnsubscribeBodyInformation__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeBodyInformation__response__parameter1 = {
+ {"bodyInformation", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeBodyInformation__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeBodyInformation__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeBodyInformation__response = {
+ "VehicleInfo",
+ "UnsubscribeBodyInformation",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation,
+ VehicleInfo__UnsubscribeBodyInformation__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeDeviceStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeDeviceStatus__request = {
+ "VehicleInfo",
+ "SubscribeDeviceStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
+ VehicleInfo__SubscribeDeviceStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeDeviceStatus__response__parameter1 = {
+ {"deviceStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeDeviceStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeDeviceStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeDeviceStatus__response = {
+ "VehicleInfo",
+ "SubscribeDeviceStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus,
+ VehicleInfo__SubscribeDeviceStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeDeviceStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeDeviceStatus__request = {
+ "VehicleInfo",
+ "UnsubscribeDeviceStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
+ VehicleInfo__UnsubscribeDeviceStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeDeviceStatus__response__parameter1 = {
+ {"deviceStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeDeviceStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeDeviceStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeDeviceStatus__response = {
+ "VehicleInfo",
+ "UnsubscribeDeviceStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus,
+ VehicleInfo__UnsubscribeDeviceStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeDriverBraking__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeDriverBraking__request = {
+ "VehicleInfo",
+ "SubscribeDriverBraking",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
+ VehicleInfo__SubscribeDriverBraking__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeDriverBraking__response__parameter1 = {
+ {"driverBraking", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeDriverBraking__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeDriverBraking__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeDriverBraking__response = {
+ "VehicleInfo",
+ "SubscribeDriverBraking",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking,
+ VehicleInfo__SubscribeDriverBraking__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeDriverBraking__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeDriverBraking__request = {
+ "VehicleInfo",
+ "UnsubscribeDriverBraking",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
+ VehicleInfo__UnsubscribeDriverBraking__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeDriverBraking__response__parameter1 = {
+ {"driverBraking", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeDriverBraking__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeDriverBraking__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeDriverBraking__response = {
+ "VehicleInfo",
+ "UnsubscribeDriverBraking",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking,
+ VehicleInfo__UnsubscribeDriverBraking__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeWiperStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeWiperStatus__request = {
+ "VehicleInfo",
+ "SubscribeWiperStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
+ VehicleInfo__SubscribeWiperStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeWiperStatus__response__parameter1 = {
+ {"wiperStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeWiperStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeWiperStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeWiperStatus__response = {
+ "VehicleInfo",
+ "SubscribeWiperStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus,
+ VehicleInfo__SubscribeWiperStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeWiperStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeWiperStatus__request = {
+ "VehicleInfo",
+ "UnsubscribeWiperStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
+ VehicleInfo__UnsubscribeWiperStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeWiperStatus__response__parameter1 = {
+ {"wiperStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeWiperStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeWiperStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeWiperStatus__response = {
+ "VehicleInfo",
+ "UnsubscribeWiperStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus,
+ VehicleInfo__UnsubscribeWiperStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeHeadLampStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeHeadLampStatus__request = {
+ "VehicleInfo",
+ "SubscribeHeadLampStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
+ VehicleInfo__SubscribeHeadLampStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeHeadLampStatus__response__parameter1 = {
+ {"headLampStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeHeadLampStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeHeadLampStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeHeadLampStatus__response = {
+ "VehicleInfo",
+ "SubscribeHeadLampStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus,
+ VehicleInfo__SubscribeHeadLampStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeHeadLampStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeHeadLampStatus__request = {
+ "VehicleInfo",
+ "UnsubscribeHeadLampStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
+ VehicleInfo__UnsubscribeHeadLampStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeHeadLampStatus__response__parameter1 = {
+ {"headLampStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeHeadLampStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeHeadLampStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeHeadLampStatus__response = {
+ "VehicleInfo",
+ "UnsubscribeHeadLampStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus,
+ VehicleInfo__UnsubscribeHeadLampStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeEngineTorque__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeEngineTorque__request = {
+ "VehicleInfo",
+ "SubscribeEngineTorque",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
+ VehicleInfo__SubscribeEngineTorque__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeEngineTorque__response__parameter1 = {
+ {"engineTorque", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeEngineTorque__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeEngineTorque__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeEngineTorque__response = {
+ "VehicleInfo",
+ "SubscribeEngineTorque",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque,
+ VehicleInfo__SubscribeEngineTorque__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeEngineTorque__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeEngineTorque__request = {
+ "VehicleInfo",
+ "UnsubscribeEngineTorque",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
+ VehicleInfo__UnsubscribeEngineTorque__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeEngineTorque__response__parameter1 = {
+ {"engineTorque", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeEngineTorque__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeEngineTorque__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeEngineTorque__response = {
+ "VehicleInfo",
+ "UnsubscribeEngineTorque",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque,
+ VehicleInfo__UnsubscribeEngineTorque__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeAccPedalPosition__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeAccPedalPosition__request = {
+ "VehicleInfo",
+ "SubscribeAccPedalPosition",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
+ VehicleInfo__SubscribeAccPedalPosition__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeAccPedalPosition__response__parameter1 = {
+ {"accPedalPosition", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeAccPedalPosition__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeAccPedalPosition__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeAccPedalPosition__response = {
+ "VehicleInfo",
+ "SubscribeAccPedalPosition",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition,
+ VehicleInfo__SubscribeAccPedalPosition__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeAccPedalPosition__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeAccPedalPosition__request = {
+ "VehicleInfo",
+ "UnsubscribeAccPedalPosition",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
+ VehicleInfo__UnsubscribeAccPedalPosition__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeAccPedalPosition__response__parameter1 = {
+ {"accPedalPosition", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeAccPedalPosition__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeAccPedalPosition__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeAccPedalPosition__response = {
+ "VehicleInfo",
+ "UnsubscribeAccPedalPosition",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition,
+ VehicleInfo__UnsubscribeAccPedalPosition__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeSteeringWheelAngle__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeSteeringWheelAngle__request = {
+ "VehicleInfo",
+ "SubscribeSteeringWheelAngle",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
+ VehicleInfo__SubscribeSteeringWheelAngle__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeSteeringWheelAngle__response__parameter1 = {
+ {"steeringWheelAngle", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeSteeringWheelAngle__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeSteeringWheelAngle__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeSteeringWheelAngle__response = {
+ "VehicleInfo",
+ "SubscribeSteeringWheelAngle",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle,
+ VehicleInfo__SubscribeSteeringWheelAngle__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeSteeringWheelAngle__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeSteeringWheelAngle__request = {
+ "VehicleInfo",
+ "UnsubscribeSteeringWheelAngle",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
+ VehicleInfo__UnsubscribeSteeringWheelAngle__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameter1 = {
+ {"steeringWheelAngle", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeSteeringWheelAngle__response = {
+ "VehicleInfo",
+ "UnsubscribeSteeringWheelAngle",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle,
+ VehicleInfo__UnsubscribeSteeringWheelAngle__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeECallInfo__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeECallInfo__request = {
+ "VehicleInfo",
+ "SubscribeECallInfo",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
+ VehicleInfo__SubscribeECallInfo__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeECallInfo__response__parameter1 = {
+ {"eCallInfo", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeECallInfo__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeECallInfo__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeECallInfo__response = {
+ "VehicleInfo",
+ "SubscribeECallInfo",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo,
+ VehicleInfo__SubscribeECallInfo__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeECallInfo__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeECallInfo__request = {
+ "VehicleInfo",
+ "UnsubscribeECallInfo",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
+ VehicleInfo__UnsubscribeECallInfo__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeECallInfo__response__parameter1 = {
+ {"eCallInfo", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeECallInfo__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeECallInfo__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeECallInfo__response = {
+ "VehicleInfo",
+ "UnsubscribeECallInfo",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo,
+ VehicleInfo__UnsubscribeECallInfo__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeAirbagStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeAirbagStatus__request = {
+ "VehicleInfo",
+ "SubscribeAirbagStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
+ VehicleInfo__SubscribeAirbagStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeAirbagStatus__response__parameter1 = {
+ {"airbagStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeAirbagStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeAirbagStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeAirbagStatus__response = {
+ "VehicleInfo",
+ "SubscribeAirbagStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus,
+ VehicleInfo__SubscribeAirbagStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeAirbagStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeAirbagStatus__request = {
+ "VehicleInfo",
+ "UnsubscribeAirbagStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
+ VehicleInfo__UnsubscribeAirbagStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeAirbagStatus__response__parameter1 = {
+ {"airbagStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeAirbagStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeAirbagStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeAirbagStatus__response = {
+ "VehicleInfo",
+ "UnsubscribeAirbagStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus,
+ VehicleInfo__UnsubscribeAirbagStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeEmergencyEvent__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeEmergencyEvent__request = {
+ "VehicleInfo",
+ "SubscribeEmergencyEvent",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
+ VehicleInfo__SubscribeEmergencyEvent__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeEmergencyEvent__response__parameter1 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeEmergencyEvent__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeEmergencyEvent__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeEmergencyEvent__response = {
+ "VehicleInfo",
+ "SubscribeEmergencyEvent",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent,
+ VehicleInfo__SubscribeEmergencyEvent__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeEmergencyEvent__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeEmergencyEvent__request = {
+ "VehicleInfo",
+ "UnsubscribeEmergencyEvent",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
+ VehicleInfo__UnsubscribeEmergencyEvent__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeEmergencyEvent__response__parameter1 = {
+ {"emergencyEvent", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeEmergencyEvent__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeEmergencyEvent__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeEmergencyEvent__response = {
+ "VehicleInfo",
+ "UnsubscribeEmergencyEvent",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent,
+ VehicleInfo__UnsubscribeEmergencyEvent__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeClusterModeStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeClusterModeStatus__request = {
+ "VehicleInfo",
+ "SubscribeClusterModeStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
+ VehicleInfo__SubscribeClusterModeStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeClusterModeStatus__response__parameter1 = {
+ {"clusterModeStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeClusterModeStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeClusterModeStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeClusterModeStatus__response = {
+ "VehicleInfo",
+ "SubscribeClusterModeStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus,
+ VehicleInfo__SubscribeClusterModeStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeClusterModeStatus__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeClusterModeStatus__request = {
+ "VehicleInfo",
+ "UnsubscribeClusterModeStatus",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
+ VehicleInfo__UnsubscribeClusterModeStatus__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeClusterModeStatus__response__parameter1 = {
+ {"clusterModeStatus", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeClusterModeStatus__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeClusterModeStatus__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeClusterModeStatus__response = {
+ "VehicleInfo",
+ "UnsubscribeClusterModeStatus",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus,
+ VehicleInfo__UnsubscribeClusterModeStatus__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeMyKey__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeMyKey__request = {
+ "VehicleInfo",
+ "SubscribeMyKey",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey,
+ VehicleInfo__SubscribeMyKey__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__SubscribeMyKey__response__parameter1 = {
+ {"myKey", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__SubscribeMyKey__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__SubscribeMyKey__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__SubscribeMyKey__response = {
+ "VehicleInfo",
+ "SubscribeMyKey",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey,
+ VehicleInfo__SubscribeMyKey__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeMyKey__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeMyKey__request = {
+ "VehicleInfo",
+ "UnsubscribeMyKey",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey,
+ VehicleInfo__UnsubscribeMyKey__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ VehicleInfo__UnsubscribeMyKey__response__parameter1 = {
+ {"myKey", ford_message_descriptions::Struct, true},
+ Structs::Common__VehicleDataResult__parameters};
+const ford_message_descriptions::ParameterDescription*
+ VehicleInfo__UnsubscribeMyKey__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&VehicleInfo__UnsubscribeMyKey__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ VehicleInfo__UnsubscribeMyKey__response = {
+ "VehicleInfo",
+ "UnsubscribeMyKey",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey,
+ VehicleInfo__UnsubscribeMyKey__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__ActivateApp__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__ActivateApp__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription SDL__ActivateApp__request =
+ {"SDL",
+ "ActivateApp",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::SDL_ActivateApp,
+ SDL__ActivateApp__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__ActivateApp__response__parameter1 = {
+ "isSDLAllowed", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::StructDescription
+ SDL__ActivateApp__response__parameter2 = {
+ {"device", ford_message_descriptions::Struct, false},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription
+ SDL__ActivateApp__response__parameter3 = {
+ "isPermissionsConsentNeeded", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ SDL__ActivateApp__response__parameter4 = {
+ "isAppPermissionsRevoked", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::StructDescription
+ SDL__ActivateApp__response__parameter5_array = {
+ {"appRevokedPermissions", ford_message_descriptions::Struct, true},
+ Structs::Common__PermissionItem__parameters};
+const ford_message_descriptions::ArrayDescription
+ SDL__ActivateApp__response__parameter5 = {
+ {"appRevokedPermissions", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter5_array,
+ "(si(bb))"};
+const ford_message_descriptions::ParameterDescription
+ SDL__ActivateApp__response__parameter6 = {
+ "isAppRevoked", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ SDL__ActivateApp__response__parameter7 = {
+ "priority", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ SDL__ActivateApp__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__ActivateApp__response__parameter7,
+ NULL};
+const ford_message_descriptions::MessageDescription SDL__ActivateApp__response =
+ {"SDL",
+ "ActivateApp",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::SDL_ActivateApp,
+ SDL__ActivateApp__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__GetUserFriendlyMessage__request__parameter1_array = {
+ "messageCodes", ford_message_descriptions::String, true};
+const ford_message_descriptions::ArrayDescription
+ SDL__GetUserFriendlyMessage__request__parameter1 = {
+ {"messageCodes", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter1_array,
+ "s"};
+const ford_message_descriptions::ParameterDescription
+ SDL__GetUserFriendlyMessage__request__parameter2 = {
+ "language", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetUserFriendlyMessage__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetUserFriendlyMessage__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__GetUserFriendlyMessage__request = {
+ "SDL",
+ "GetUserFriendlyMessage",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::SDL_GetUserFriendlyMessage,
+ SDL__GetUserFriendlyMessage__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ SDL__GetUserFriendlyMessage__response__parameter1_array = {
+ {"messages", ford_message_descriptions::Struct, true},
+ Structs::Common__UserFriendlyMessage__parameters};
+const ford_message_descriptions::ArrayDescription
+ SDL__GetUserFriendlyMessage__response__parameter1 = {
+ {"messages", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetUserFriendlyMessage__response__parameter1_array,
+ "(s(bs)(bs)(bs)(bs)(bs))"};
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetUserFriendlyMessage__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetUserFriendlyMessage__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__GetUserFriendlyMessage__response = {
+ "SDL",
+ "GetUserFriendlyMessage",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::SDL_GetUserFriendlyMessage,
+ SDL__GetUserFriendlyMessage__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ SDL__OnAllowSDLFunctionality__notification__parameter1 = {
+ {"device", ford_message_descriptions::Struct, false},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAllowSDLFunctionality__notification__parameter2 = {
+ "allowed", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAllowSDLFunctionality__notification__parameter3 = {
+ "source", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnAllowSDLFunctionality__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAllowSDLFunctionality__notification__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnAllowSDLFunctionality__notification = {
+ "SDL",
+ "OnAllowSDLFunctionality",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality,
+ SDL__OnAllowSDLFunctionality__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__OnReceivedPolicyUpdate__notification__parameter1 = {
+ "policyfile", ford_message_descriptions::String, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnReceivedPolicyUpdate__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnReceivedPolicyUpdate__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnReceivedPolicyUpdate__notification = {
+ "SDL",
+ "OnReceivedPolicyUpdate",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate,
+ SDL__OnReceivedPolicyUpdate__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnPolicyUpdate__notification__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnPolicyUpdate__notification = {
+ "SDL",
+ "OnPolicyUpdate",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnPolicyUpdate,
+ SDL__OnPolicyUpdate__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__GetListOfPermissions__request__parameter1 = {
+ "appID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetListOfPermissions__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetListOfPermissions__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__GetListOfPermissions__request = {
+ "SDL",
+ "GetListOfPermissions",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::SDL_GetListOfPermissions,
+ SDL__GetListOfPermissions__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ SDL__GetListOfPermissions__response__parameter1_array = {
+ {"allowedFunctions", ford_message_descriptions::Struct, true},
+ Structs::Common__PermissionItem__parameters};
+const ford_message_descriptions::ArrayDescription
+ SDL__GetListOfPermissions__response__parameter1 = {
+ {"allowedFunctions", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetListOfPermissions__response__parameter1_array,
+ "(si(bb))"};
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetListOfPermissions__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetListOfPermissions__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__GetListOfPermissions__response = {
+ "SDL",
+ "GetListOfPermissions",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::SDL_GetListOfPermissions,
+ SDL__GetListOfPermissions__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionConsent__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, false};
+const ford_message_descriptions::StructDescription
+ SDL__OnAppPermissionConsent__notification__parameter2_array = {
+ {"consentedFunctions", ford_message_descriptions::Struct, true},
+ Structs::Common__PermissionItem__parameters};
+const ford_message_descriptions::ArrayDescription
+ SDL__OnAppPermissionConsent__notification__parameter2 = {
+ {"consentedFunctions", ford_message_descriptions::Array, true},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter2_array,
+ "(si(bb))"};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionConsent__notification__parameter3 = {
+ "source", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnAppPermissionConsent__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionConsent__notification__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnAppPermissionConsent__notification = {
+ "SDL",
+ "OnAppPermissionConsent",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnAppPermissionConsent,
+ SDL__OnAppPermissionConsent__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionChanged__notification__parameter1 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionChanged__notification__parameter2 = {
+ "isAppPermissionsRevoked", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::StructDescription
+ SDL__OnAppPermissionChanged__notification__parameter3_array = {
+ {"appRevokedPermissions", ford_message_descriptions::Struct, true},
+ Structs::Common__PermissionItem__parameters};
+const ford_message_descriptions::ArrayDescription
+ SDL__OnAppPermissionChanged__notification__parameter3 = {
+ {"appRevokedPermissions", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter3_array,
+ "(si(bb))"};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionChanged__notification__parameter4 = {
+ "appRevoked", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionChanged__notification__parameter5 = {
+ "appPermissionsConsentNeeded",
+ ford_message_descriptions::Boolean,
+ false};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionChanged__notification__parameter6 = {
+ "appUnauthorized", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionChanged__notification__parameter7 = {
+ "priority", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnAppPermissionChanged__notification__parameter8_array = {
+ "requestType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ArrayDescription
+ SDL__OnAppPermissionChanged__notification__parameter8 = {
+ {"requestType", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter8_array,
+ "i"};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnAppPermissionChanged__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter3,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter4,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter5,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter6,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter7,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnAppPermissionChanged__notification__parameter8,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnAppPermissionChanged__notification = {
+ "SDL",
+ "OnAppPermissionChanged",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnAppPermissionChanged,
+ SDL__OnAppPermissionChanged__notification__parameters};
+
+const ford_message_descriptions::StructDescription
+ SDL__OnSDLConsentNeeded__notification__parameter1 = {
+ {"device", ford_message_descriptions::Struct, true},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnSDLConsentNeeded__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnSDLConsentNeeded__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnSDLConsentNeeded__notification = {
+ "SDL",
+ "OnSDLConsentNeeded",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnSDLConsentNeeded,
+ SDL__OnSDLConsentNeeded__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ SDL__UpdateSDL__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription SDL__UpdateSDL__request = {
+ "SDL",
+ "UpdateSDL",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::SDL_UpdateSDL,
+ SDL__UpdateSDL__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__UpdateSDL__response__parameter1 = {
+ "result", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__UpdateSDL__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__UpdateSDL__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription SDL__UpdateSDL__response = {
+ "SDL",
+ "UpdateSDL",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::SDL_UpdateSDL,
+ SDL__UpdateSDL__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetStatusUpdate__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__GetStatusUpdate__request = {"SDL",
+ "GetStatusUpdate",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::SDL_GetStatusUpdate,
+ SDL__GetStatusUpdate__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__GetStatusUpdate__response__parameter1 = {
+ "status", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetStatusUpdate__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetStatusUpdate__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__GetStatusUpdate__response = {
+ "SDL",
+ "GetStatusUpdate",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::SDL_GetStatusUpdate,
+ SDL__GetStatusUpdate__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__OnStatusUpdate__notification__parameter1 = {
+ "status", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnStatusUpdate__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnStatusUpdate__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnStatusUpdate__notification = {
+ "SDL",
+ "OnStatusUpdate",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnStatusUpdate,
+ SDL__OnStatusUpdate__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__OnSystemError__notification__parameter1 = {
+ "error", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnSystemError__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnSystemError__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnSystemError__notification = {
+ "SDL",
+ "OnSystemError",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnSystemError,
+ SDL__OnSystemError__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__AddStatisticsInfo__notification__parameter1 = {
+ "statisticType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__AddStatisticsInfo__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__AddStatisticsInfo__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__AddStatisticsInfo__notification = {
+ "SDL",
+ "AddStatisticsInfo",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_AddStatisticsInfo,
+ SDL__AddStatisticsInfo__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__GetURLS__request__parameter1 = {
+ "service", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetURLS__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetURLS__request__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription SDL__GetURLS__request = {
+ "SDL",
+ "GetURLS",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::SDL_GetURLS,
+ SDL__GetURLS__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ SDL__GetURLS__response__parameter1_array = {
+ {"urls", ford_message_descriptions::Struct, true},
+ Structs::Common__ServiceInfo__parameters};
+const ford_message_descriptions::ArrayDescription
+ SDL__GetURLS__response__parameter1 = {
+ {"urls", ford_message_descriptions::Array, false},
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetURLS__response__parameter1_array,
+ "(s(bs))"};
+const ford_message_descriptions::ParameterDescription*
+ SDL__GetURLS__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__GetURLS__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription SDL__GetURLS__response = {
+ "SDL",
+ "GetURLS",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::SDL_GetURLS,
+ SDL__GetURLS__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ SDL__OnDeviceStateChanged__notification__parameter1 = {
+ "deviceState", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ SDL__OnDeviceStateChanged__notification__parameter2 = {
+ "deviceInternalId", ford_message_descriptions::String, true};
+const ford_message_descriptions::StructDescription
+ SDL__OnDeviceStateChanged__notification__parameter3 = {
+ {"deviceId", ford_message_descriptions::Struct, false},
+ Structs::Common__DeviceInfo__parameters};
+const ford_message_descriptions::ParameterDescription*
+ SDL__OnDeviceStateChanged__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&SDL__OnDeviceStateChanged__notification__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ SDL__OnDeviceStateChanged__notification = {
+ "SDL",
+ "OnDeviceStateChanged",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::SDL_OnDeviceStateChanged,
+ SDL__OnDeviceStateChanged__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ RC__IsReady__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription RC__IsReady__request = {
+ "RC",
+ "IsReady",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::RC_IsReady,
+ RC__IsReady__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ RC__IsReady__response__parameter1 = {
+ "available", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ RC__IsReady__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__IsReady__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription RC__IsReady__response = {
+ "RC",
+ "IsReady",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::RC_IsReady,
+ RC__IsReady__response__parameters};
+
+const ford_message_descriptions::ParameterDescription*
+ RC__GetCapabilities__request__parameters[] = {NULL};
+const ford_message_descriptions::MessageDescription
+ RC__GetCapabilities__request = {"RC",
+ "GetCapabilities",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::RC_GetCapabilities,
+ RC__GetCapabilities__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ RC__GetCapabilities__response__parameter1 = {
+ {"remoteControlCapability", ford_message_descriptions::Struct, false},
+ Structs::Common__RemoteControlCapabilities__parameters};
+const ford_message_descriptions::ParameterDescription*
+ RC__GetCapabilities__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetCapabilities__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__GetCapabilities__response = {"RC",
+ "GetCapabilities",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::RC_GetCapabilities,
+ RC__GetCapabilities__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ RC__SetInteriorVehicleData__request__parameter1 = {
+ {"moduleData", ford_message_descriptions::Struct, true},
+ Structs::Common__ModuleData__parameters};
+const ford_message_descriptions::ParameterDescription
+ RC__SetInteriorVehicleData__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ RC__SetInteriorVehicleData__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__SetInteriorVehicleData__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__SetInteriorVehicleData__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__SetInteriorVehicleData__request = {
+ "RC",
+ "SetInteriorVehicleData",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::RC_SetInteriorVehicleData,
+ RC__SetInteriorVehicleData__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ RC__SetInteriorVehicleData__response__parameter1 = {
+ {"moduleData", ford_message_descriptions::Struct, true},
+ Structs::Common__ModuleData__parameters};
+const ford_message_descriptions::ParameterDescription*
+ RC__SetInteriorVehicleData__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__SetInteriorVehicleData__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__SetInteriorVehicleData__response = {
+ "RC",
+ "SetInteriorVehicleData",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::RC_SetInteriorVehicleData,
+ RC__SetInteriorVehicleData__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ RC__GetInteriorVehicleData__request__parameter1 = {
+ "moduleType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ RC__GetInteriorVehicleData__request__parameter2 = {
+ "subscribe", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ RC__GetInteriorVehicleData__request__parameter3 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ RC__GetInteriorVehicleData__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter2,
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleData__request__parameter3,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__GetInteriorVehicleData__request = {
+ "RC",
+ "GetInteriorVehicleData",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData,
+ RC__GetInteriorVehicleData__request__parameters};
+
+const ford_message_descriptions::StructDescription
+ RC__GetInteriorVehicleData__response__parameter1 = {
+ {"moduleData", ford_message_descriptions::Struct, true},
+ Structs::Common__ModuleData__parameters};
+const ford_message_descriptions::ParameterDescription
+ RC__GetInteriorVehicleData__response__parameter2 = {
+ "isSubscribed", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription*
+ RC__GetInteriorVehicleData__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleData__response__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleData__response__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__GetInteriorVehicleData__response = {
+ "RC",
+ "GetInteriorVehicleData",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::RC_GetInteriorVehicleData,
+ RC__GetInteriorVehicleData__response__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ RC__GetInteriorVehicleDataConsent__request__parameter1 = {
+ "moduleType", ford_message_descriptions::Enum, true};
+const ford_message_descriptions::ParameterDescription
+ RC__GetInteriorVehicleDataConsent__request__parameter2 = {
+ "appID", ford_message_descriptions::Integer, true};
+const ford_message_descriptions::ParameterDescription*
+ RC__GetInteriorVehicleDataConsent__request__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleDataConsent__request__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleDataConsent__request__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__GetInteriorVehicleDataConsent__request = {
+ "RC",
+ "GetInteriorVehicleDataConsent",
+ hmi_apis::messageType::request,
+ hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
+ RC__GetInteriorVehicleDataConsent__request__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ RC__GetInteriorVehicleDataConsent__response__parameter1 = {
+ "allowed", ford_message_descriptions::Boolean, true};
+const ford_message_descriptions::ParameterDescription*
+ RC__GetInteriorVehicleDataConsent__response__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__GetInteriorVehicleDataConsent__response__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__GetInteriorVehicleDataConsent__response = {
+ "RC",
+ "GetInteriorVehicleDataConsent",
+ hmi_apis::messageType::response,
+ hmi_apis::FunctionID::RC_GetInteriorVehicleDataConsent,
+ RC__GetInteriorVehicleDataConsent__response__parameters};
+
+const ford_message_descriptions::StructDescription
+ RC__OnInteriorVehicleData__notification__parameter1 = {
+ {"moduleData", ford_message_descriptions::Struct, true},
+ Structs::Common__ModuleData__parameters};
+const ford_message_descriptions::ParameterDescription*
+ RC__OnInteriorVehicleData__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__OnInteriorVehicleData__notification__parameter1,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__OnInteriorVehicleData__notification = {
+ "RC",
+ "OnInteriorVehicleData",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::RC_OnInteriorVehicleData,
+ RC__OnInteriorVehicleData__notification__parameters};
+
+const ford_message_descriptions::ParameterDescription
+ RC__OnRemoteControlSettings__notification__parameter1 = {
+ "allowed", ford_message_descriptions::Boolean, false};
+const ford_message_descriptions::ParameterDescription
+ RC__OnRemoteControlSettings__notification__parameter2 = {
+ "accessMode", ford_message_descriptions::Enum, false};
+const ford_message_descriptions::ParameterDescription*
+ RC__OnRemoteControlSettings__notification__parameters[] = {
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__OnRemoteControlSettings__notification__parameter1,
+ (const ford_message_descriptions::
+ ParameterDescription*)&RC__OnRemoteControlSettings__notification__parameter2,
+ NULL};
+const ford_message_descriptions::MessageDescription
+ RC__OnRemoteControlSettings__notification = {
+ "RC",
+ "OnRemoteControlSettings",
+ hmi_apis::messageType::notification,
+ hmi_apis::FunctionID::RC_OnRemoteControlSettings,
+ RC__OnRemoteControlSettings__notification__parameters};
+}
+
+namespace ford_message_descriptions {
+
+const MessageDescription* message_descriptions[] = {
+ &Buttons__GetCapabilities__request,
+ &Buttons__GetCapabilities__response,
+ &Buttons__OnButtonEvent__notification,
+ &Buttons__OnButtonPress__notification,
+ &Buttons__OnButtonSubscription__notification,
+ &BasicCommunication__OnReady__notification,
+ &BasicCommunication__OnStartDeviceDiscovery__notification,
+ &BasicCommunication__OnUpdateDeviceList__notification,
+ &BasicCommunication__OnPhoneCall__notification,
+ &BasicCommunication__OnEmergencyEvent__notification,
+ &BasicCommunication__OnResumeAudioSource__notification,
+ &BasicCommunication__OnSDLPersistenceComplete__notification,
+ &BasicCommunication__UpdateAppList__request,
+ &BasicCommunication__UpdateAppList__response,
+ &BasicCommunication__UpdateDeviceList__request,
+ &BasicCommunication__UpdateDeviceList__response,
+ &BasicCommunication__OnFileRemoved__notification,
+ &BasicCommunication__AllowDeviceToConnect__request,
+ &BasicCommunication__AllowDeviceToConnect__response,
+ &BasicCommunication__OnDeviceChosen__notification,
+ &BasicCommunication__OnFindApplications__notification,
+ &BasicCommunication__ActivateApp__request,
+ &BasicCommunication__ActivateApp__response,
+ &BasicCommunication__OnAppActivated__notification,
+ &BasicCommunication__OnAppDeactivated__notification,
+ &BasicCommunication__OnAppRegistered__notification,
+ &BasicCommunication__OnAppUnregistered__notification,
+ &BasicCommunication__OnExitApplication__notification,
+ &BasicCommunication__OnExitAllApplications__notification,
+ &BasicCommunication__OnAwakeSDL__notification,
+ &BasicCommunication__MixingAudioSupported__request,
+ &BasicCommunication__MixingAudioSupported__response,
+ &BasicCommunication__PlayTone__notification,
+ &BasicCommunication__DialNumber__request,
+ &BasicCommunication__DialNumber__response,
+ &BasicCommunication__OnSystemRequest__notification,
+ &BasicCommunication__SystemRequest__request,
+ &BasicCommunication__SystemRequest__response,
+ &BasicCommunication__PolicyUpdate__request,
+ &BasicCommunication__PolicyUpdate__response,
+ &BasicCommunication__OnSDLClose__notification,
+ &BasicCommunication__OnPutFile__notification,
+ &BasicCommunication__GetSystemInfo__request,
+ &BasicCommunication__GetSystemInfo__response,
+ &BasicCommunication__OnSystemInfoChanged__notification,
+ &BasicCommunication__OnIgnitionCycleOver__notification,
+ &BasicCommunication__DecryptCertificate__request,
+ &BasicCommunication__DecryptCertificate__response,
+ &BasicCommunication__OnEventChanged__notification,
+ &VR__IsReady__request,
+ &VR__IsReady__response,
+ &VR__Started__notification,
+ &VR__Stopped__notification,
+ &VR__AddCommand__request,
+ &VR__AddCommand__response,
+ &VR__DeleteCommand__request,
+ &VR__DeleteCommand__response,
+ &VR__PerformInteraction__request,
+ &VR__PerformInteraction__response,
+ &VR__OnCommand__notification,
+ &VR__ChangeRegistration__request,
+ &VR__ChangeRegistration__response,
+ &VR__OnLanguageChange__notification,
+ &VR__GetSupportedLanguages__request,
+ &VR__GetSupportedLanguages__response,
+ &VR__GetLanguage__request,
+ &VR__GetLanguage__response,
+ &VR__GetCapabilities__request,
+ &VR__GetCapabilities__response,
+ &TTS__GetCapabilities__request,
+ &TTS__GetCapabilities__response,
+ &TTS__Started__notification,
+ &TTS__Stopped__notification,
+ &TTS__IsReady__request,
+ &TTS__IsReady__response,
+ &TTS__Speak__request,
+ &TTS__Speak__response,
+ &TTS__StopSpeaking__request,
+ &TTS__StopSpeaking__response,
+ &TTS__ChangeRegistration__request,
+ &TTS__ChangeRegistration__response,
+ &TTS__OnLanguageChange__notification,
+ &TTS__GetSupportedLanguages__request,
+ &TTS__GetSupportedLanguages__response,
+ &TTS__GetLanguage__request,
+ &TTS__GetLanguage__response,
+ &TTS__SetGlobalProperties__request,
+ &TTS__SetGlobalProperties__response,
+ &TTS__OnResetTimeout__notification,
+ &UI__Alert__request,
+ &UI__Alert__response,
+ &UI__Show__request,
+ &UI__Show__response,
+ &UI__AddCommand__request,
+ &UI__AddCommand__response,
+ &UI__DeleteCommand__request,
+ &UI__DeleteCommand__response,
+ &UI__AddSubMenu__request,
+ &UI__AddSubMenu__response,
+ &UI__DeleteSubMenu__request,
+ &UI__DeleteSubMenu__response,
+ &UI__PerformInteraction__request,
+ &UI__PerformInteraction__response,
+ &UI__SetMediaClockTimer__request,
+ &UI__SetMediaClockTimer__response,
+ &UI__SetGlobalProperties__request,
+ &UI__SetGlobalProperties__response,
+ &UI__OnCommand__notification,
+ &UI__OnSystemContext__notification,
+ &UI__GetCapabilities__request,
+ &UI__GetCapabilities__response,
+ &UI__ChangeRegistration__request,
+ &UI__ChangeRegistration__response,
+ &UI__OnLanguageChange__notification,
+ &UI__GetSupportedLanguages__request,
+ &UI__GetSupportedLanguages__response,
+ &UI__GetLanguage__request,
+ &UI__GetLanguage__response,
+ &UI__OnDriverDistraction__notification,
+ &UI__SetAppIcon__request,
+ &UI__SetAppIcon__response,
+ &UI__SetDisplayLayout__request,
+ &UI__SetDisplayLayout__response,
+ &UI__ShowCustomForm__request,
+ &UI__ShowCustomForm__response,
+ &UI__OnKeyboardInput__notification,
+ &UI__OnTouchEvent__notification,
+ &UI__Slider__request,
+ &UI__Slider__response,
+ &UI__ScrollableMessage__request,
+ &UI__ScrollableMessage__response,
+ &UI__PerformAudioPassThru__request,
+ &UI__PerformAudioPassThru__response,
+ &UI__EndAudioPassThru__request,
+ &UI__EndAudioPassThru__response,
+ &UI__IsReady__request,
+ &UI__IsReady__response,
+ &UI__ClosePopUp__request,
+ &UI__ClosePopUp__response,
+ &UI__OnResetTimeout__notification,
+ &UI__OnRecordStart__notification,
+ &UI__SendHapticData__request,
+ &UI__SendHapticData__response,
+ &Navigation__IsReady__request,
+ &Navigation__IsReady__response,
+ &Navigation__SendLocation__request,
+ &Navigation__SendLocation__response,
+ &Navigation__DialNumber__request,
+ &Navigation__DialNumber__response,
+ &Navigation__ShowConstantTBT__request,
+ &Navigation__ShowConstantTBT__response,
+ &Navigation__AlertManeuver__request,
+ &Navigation__AlertManeuver__response,
+ &Navigation__UpdateTurnList__request,
+ &Navigation__UpdateTurnList__response,
+ &Navigation__OnTBTClientState__notification,
+ &Navigation__SetVideoConfig__request,
+ &Navigation__SetVideoConfig__response,
+ &Navigation__StartStream__request,
+ &Navigation__StartStream__response,
+ &Navigation__StopStream__request,
+ &Navigation__StopStream__response,
+ &Navigation__StartAudioStream__request,
+ &Navigation__StartAudioStream__response,
+ &Navigation__StopAudioStream__request,
+ &Navigation__StopAudioStream__response,
+ &Navigation__OnAudioDataStreaming__notification,
+ &Navigation__OnVideoDataStreaming__notification,
+ &Navigation__GetWayPoints__request,
+ &Navigation__GetWayPoints__response,
+ &Navigation__OnWayPointChange__notification,
+ &Navigation__SubscribeWayPoints__request,
+ &Navigation__SubscribeWayPoints__response,
+ &Navigation__UnsubscribeWayPoints__request,
+ &Navigation__UnsubscribeWayPoints__response,
+ &VehicleInfo__IsReady__request,
+ &VehicleInfo__IsReady__response,
+ &VehicleInfo__GetVehicleType__request,
+ &VehicleInfo__GetVehicleType__response,
+ &VehicleInfo__ReadDID__request,
+ &VehicleInfo__ReadDID__response,
+ &VehicleInfo__GetDTCs__request,
+ &VehicleInfo__GetDTCs__response,
+ &VehicleInfo__DiagnosticMessage__request,
+ &VehicleInfo__DiagnosticMessage__response,
+ &VehicleInfo__SubscribeVehicleData__request,
+ &VehicleInfo__SubscribeVehicleData__response,
+ &VehicleInfo__UnsubscribeVehicleData__request,
+ &VehicleInfo__UnsubscribeVehicleData__response,
+ &VehicleInfo__GetVehicleData__request,
+ &VehicleInfo__GetVehicleData__response,
+ &VehicleInfo__OnVehicleData__notification,
+ &VehicleInfo__GetGpsData__request,
+ &VehicleInfo__GetGpsData__response,
+ &VehicleInfo__GetSpeed__request,
+ &VehicleInfo__GetSpeed__response,
+ &VehicleInfo__GetRpm__request,
+ &VehicleInfo__GetRpm__response,
+ &VehicleInfo__GetFuelLevel__request,
+ &VehicleInfo__GetFuelLevel__response,
+ &VehicleInfo__GetFuelLevelState__request,
+ &VehicleInfo__GetFuelLevelState__response,
+ &VehicleInfo__GetInstantFuelConsumption__request,
+ &VehicleInfo__GetInstantFuelConsumption__response,
+ &VehicleInfo__GetExternalTemperature__request,
+ &VehicleInfo__GetExternalTemperature__response,
+ &VehicleInfo__GetVin__request,
+ &VehicleInfo__GetVin__response,
+ &VehicleInfo__GetPrndl__request,
+ &VehicleInfo__GetPrndl__response,
+ &VehicleInfo__GetTirePressure__request,
+ &VehicleInfo__GetTirePressure__response,
+ &VehicleInfo__GetOdometer__request,
+ &VehicleInfo__GetOdometer__response,
+ &VehicleInfo__GetBeltStatus__request,
+ &VehicleInfo__GetBeltStatus__response,
+ &VehicleInfo__GetBodyInformation__request,
+ &VehicleInfo__GetBodyInformation__response,
+ &VehicleInfo__GetDeviceStatus__request,
+ &VehicleInfo__GetDeviceStatus__response,
+ &VehicleInfo__GetDriverBraking__request,
+ &VehicleInfo__GetDriverBraking__response,
+ &VehicleInfo__GetWiperStatus__request,
+ &VehicleInfo__GetWiperStatus__response,
+ &VehicleInfo__GetHeadLampStatus__request,
+ &VehicleInfo__GetHeadLampStatus__response,
+ &VehicleInfo__GetEngineTorque__request,
+ &VehicleInfo__GetEngineTorque__response,
+ &VehicleInfo__GetAccPedalPosition__request,
+ &VehicleInfo__GetAccPedalPosition__response,
+ &VehicleInfo__GetSteeringWheelAngle__request,
+ &VehicleInfo__GetSteeringWheelAngle__response,
+ &VehicleInfo__GetECallInfo__request,
+ &VehicleInfo__GetECallInfo__response,
+ &VehicleInfo__GetAirbagStatus__request,
+ &VehicleInfo__GetAirbagStatus__response,
+ &VehicleInfo__GetEmergencyEvent__request,
+ &VehicleInfo__GetEmergencyEvent__response,
+ &VehicleInfo__GetClusterModeStatus__request,
+ &VehicleInfo__GetClusterModeStatus__response,
+ &VehicleInfo__GetMyKey__request,
+ &VehicleInfo__GetMyKey__response,
+ &VehicleInfo__OnGpsData__notification,
+ &VehicleInfo__OnSpeed__notification,
+ &VehicleInfo__OnRpm__notification,
+ &VehicleInfo__OnFuelLevel__notification,
+ &VehicleInfo__OnFuelLevelState__notification,
+ &VehicleInfo__OnInstantFuelConsumption__notification,
+ &VehicleInfo__OnExternalTemperature__notification,
+ &VehicleInfo__OnVin__notification,
+ &VehicleInfo__OnPrndl__notification,
+ &VehicleInfo__OnTirePressure__notification,
+ &VehicleInfo__OnOdometer__notification,
+ &VehicleInfo__OnBeltStatus__notification,
+ &VehicleInfo__OnBodyInformation__notification,
+ &VehicleInfo__OnDeviceStatus__notification,
+ &VehicleInfo__OnDriverBraking__notification,
+ &VehicleInfo__OnWiperStatus__notification,
+ &VehicleInfo__OnHeadLampStatus__notification,
+ &VehicleInfo__OnEngineTorque__notification,
+ &VehicleInfo__OnAccPedalPosition__notification,
+ &VehicleInfo__OnSteeringWheelAngle__notification,
+ &VehicleInfo__OnECallInfo__notification,
+ &VehicleInfo__OnAirbagStatus__notification,
+ &VehicleInfo__OnEmergencyEvent__notification,
+ &VehicleInfo__OnClusterModeStatus__notification,
+ &VehicleInfo__OnMyKey__notification,
+ &VehicleInfo__SubscribeGps__request,
+ &VehicleInfo__SubscribeGps__response,
+ &VehicleInfo__UnsubscribeGps__request,
+ &VehicleInfo__UnsubscribeGps__response,
+ &VehicleInfo__SubscribeSpeed__request,
+ &VehicleInfo__SubscribeSpeed__response,
+ &VehicleInfo__UnsubscribeSpeed__request,
+ &VehicleInfo__UnsubscribeSpeed__response,
+ &VehicleInfo__SubscribeRpm__request,
+ &VehicleInfo__SubscribeRpm__response,
+ &VehicleInfo__UnsubscribeRpm__request,
+ &VehicleInfo__UnsubscribeRpm__response,
+ &VehicleInfo__SubscribeFuelLevel__request,
+ &VehicleInfo__SubscribeFuelLevel__response,
+ &VehicleInfo__UnsubscribeFuelLevel__request,
+ &VehicleInfo__UnsubscribeFuelLevel__response,
+ &VehicleInfo__SubscribeFuelLevel_State__request,
+ &VehicleInfo__SubscribeFuelLevel_State__response,
+ &VehicleInfo__UnsubscribeFuelLevel_State__request,
+ &VehicleInfo__UnsubscribeFuelLevel_State__response,
+ &VehicleInfo__SubscribeInstantFuelConsumption__request,
+ &VehicleInfo__SubscribeInstantFuelConsumption__response,
+ &VehicleInfo__UnsubscribeInstantFuelConsumption__request,
+ &VehicleInfo__UnsubscribeInstantFuelConsumption__response,
+ &VehicleInfo__SubscribeExternalTemperature__request,
+ &VehicleInfo__SubscribeExternalTemperature__response,
+ &VehicleInfo__UnsubscribeExternalTemperature__request,
+ &VehicleInfo__UnsubscribeExternalTemperature__response,
+ &VehicleInfo__SubscribePrndl__request,
+ &VehicleInfo__SubscribePrndl__response,
+ &VehicleInfo__UnsubscribePrndl__request,
+ &VehicleInfo__UnsubscribePrndl__response,
+ &VehicleInfo__SubscribeVin__request,
+ &VehicleInfo__SubscribeVin__response,
+ &VehicleInfo__UnsubscribeVin__request,
+ &VehicleInfo__UnsubscribeVin__response,
+ &VehicleInfo__SubscribeTirePressure__request,
+ &VehicleInfo__SubscribeTirePressure__response,
+ &VehicleInfo__UnsubscribeTirePressure__request,
+ &VehicleInfo__UnsubscribeTirePressure__response,
+ &VehicleInfo__SubscribeOdometer__request,
+ &VehicleInfo__SubscribeOdometer__response,
+ &VehicleInfo__UnsubscribeOdometer__request,
+ &VehicleInfo__UnsubscribeOdometer__response,
+ &VehicleInfo__SubscribeBeltStatus__request,
+ &VehicleInfo__SubscribeBeltStatus__response,
+ &VehicleInfo__UnsubscribeBeltStatus__request,
+ &VehicleInfo__UnsubscribeBeltStatus__response,
+ &VehicleInfo__SubscribeBodyInformation__request,
+ &VehicleInfo__SubscribeBodyInformation__response,
+ &VehicleInfo__UnsubscribeBodyInformation__request,
+ &VehicleInfo__UnsubscribeBodyInformation__response,
+ &VehicleInfo__SubscribeDeviceStatus__request,
+ &VehicleInfo__SubscribeDeviceStatus__response,
+ &VehicleInfo__UnsubscribeDeviceStatus__request,
+ &VehicleInfo__UnsubscribeDeviceStatus__response,
+ &VehicleInfo__SubscribeDriverBraking__request,
+ &VehicleInfo__SubscribeDriverBraking__response,
+ &VehicleInfo__UnsubscribeDriverBraking__request,
+ &VehicleInfo__UnsubscribeDriverBraking__response,
+ &VehicleInfo__SubscribeWiperStatus__request,
+ &VehicleInfo__SubscribeWiperStatus__response,
+ &VehicleInfo__UnsubscribeWiperStatus__request,
+ &VehicleInfo__UnsubscribeWiperStatus__response,
+ &VehicleInfo__SubscribeHeadLampStatus__request,
+ &VehicleInfo__SubscribeHeadLampStatus__response,
+ &VehicleInfo__UnsubscribeHeadLampStatus__request,
+ &VehicleInfo__UnsubscribeHeadLampStatus__response,
+ &VehicleInfo__SubscribeEngineTorque__request,
+ &VehicleInfo__SubscribeEngineTorque__response,
+ &VehicleInfo__UnsubscribeEngineTorque__request,
+ &VehicleInfo__UnsubscribeEngineTorque__response,
+ &VehicleInfo__SubscribeAccPedalPosition__request,
+ &VehicleInfo__SubscribeAccPedalPosition__response,
+ &VehicleInfo__UnsubscribeAccPedalPosition__request,
+ &VehicleInfo__UnsubscribeAccPedalPosition__response,
+ &VehicleInfo__SubscribeSteeringWheelAngle__request,
+ &VehicleInfo__SubscribeSteeringWheelAngle__response,
+ &VehicleInfo__UnsubscribeSteeringWheelAngle__request,
+ &VehicleInfo__UnsubscribeSteeringWheelAngle__response,
+ &VehicleInfo__SubscribeECallInfo__request,
+ &VehicleInfo__SubscribeECallInfo__response,
+ &VehicleInfo__UnsubscribeECallInfo__request,
+ &VehicleInfo__UnsubscribeECallInfo__response,
+ &VehicleInfo__SubscribeAirbagStatus__request,
+ &VehicleInfo__SubscribeAirbagStatus__response,
+ &VehicleInfo__UnsubscribeAirbagStatus__request,
+ &VehicleInfo__UnsubscribeAirbagStatus__response,
+ &VehicleInfo__SubscribeEmergencyEvent__request,
+ &VehicleInfo__SubscribeEmergencyEvent__response,
+ &VehicleInfo__UnsubscribeEmergencyEvent__request,
+ &VehicleInfo__UnsubscribeEmergencyEvent__response,
+ &VehicleInfo__SubscribeClusterModeStatus__request,
+ &VehicleInfo__SubscribeClusterModeStatus__response,
+ &VehicleInfo__UnsubscribeClusterModeStatus__request,
+ &VehicleInfo__UnsubscribeClusterModeStatus__response,
+ &VehicleInfo__SubscribeMyKey__request,
+ &VehicleInfo__SubscribeMyKey__response,
+ &VehicleInfo__UnsubscribeMyKey__request,
+ &VehicleInfo__UnsubscribeMyKey__response,
+ &SDL__ActivateApp__request,
+ &SDL__ActivateApp__response,
+ &SDL__GetUserFriendlyMessage__request,
+ &SDL__GetUserFriendlyMessage__response,
+ &SDL__OnAllowSDLFunctionality__notification,
+ &SDL__OnReceivedPolicyUpdate__notification,
+ &SDL__OnPolicyUpdate__notification,
+ &SDL__GetListOfPermissions__request,
+ &SDL__GetListOfPermissions__response,
+ &SDL__OnAppPermissionConsent__notification,
+ &SDL__OnAppPermissionChanged__notification,
+ &SDL__OnSDLConsentNeeded__notification,
+ &SDL__UpdateSDL__request,
+ &SDL__UpdateSDL__response,
+ &SDL__GetStatusUpdate__request,
+ &SDL__GetStatusUpdate__response,
+ &SDL__OnStatusUpdate__notification,
+ &SDL__OnSystemError__notification,
+ &SDL__AddStatisticsInfo__notification,
+ &SDL__GetURLS__request,
+ &SDL__GetURLS__response,
+ &SDL__OnDeviceStateChanged__notification,
+ &RC__IsReady__request,
+ &RC__IsReady__response,
+ &RC__GetCapabilities__request,
+ &RC__GetCapabilities__response,
+ &RC__SetInteriorVehicleData__request,
+ &RC__SetInteriorVehicleData__response,
+ &RC__GetInteriorVehicleData__request,
+ &RC__GetInteriorVehicleData__response,
+ &RC__GetInteriorVehicleDataConsent__request,
+ &RC__GetInteriorVehicleDataConsent__response,
+ &RC__OnInteriorVehicleData__notification,
+ &RC__OnRemoteControlSettings__notification,
+ NULL};
+}
diff --git a/src/components/dbus/test/CMakeLists.txt b/src/components/dbus/test/CMakeLists.txt
index d96f2388fb..914bd2ca84 100644
--- a/src/components/dbus/test/CMakeLists.txt
+++ b/src/components/dbus/test/CMakeLists.txt
@@ -28,13 +28,21 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${GMOCK_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/dbus/include/
+ ${COMPONENTS_DIR}/dbus/test/include/
)
+#FIXME: exclude some tests
+set (EXCLUDE_PATHS
+ dbus_message_controller_test.cc
+)
+
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" ${EXCLUDE_PATHS})
+
set (LIBRARIES
gmock
DBus
@@ -42,12 +50,4 @@ set (LIBRARIES
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()
-
+create_test(test_DBus_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/dbus/test/test_dbus_adapter.cc b/src/components/dbus/test/dbus_adapter_test.cc
index 74a6de1aa9..74a6de1aa9 100644
--- a/src/components/dbus/test/test_dbus_adapter.cc
+++ b/src/components/dbus/test/dbus_adapter_test.cc
diff --git a/src/components/dbus/test/dbus_message_controller_test.cc b/src/components/dbus/test/dbus_message_controller_test.cc
new file mode 100644
index 0000000000..c06e144f9b
--- /dev/null
+++ b/src/components/dbus/test/dbus_message_controller_test.cc
@@ -0,0 +1,116 @@
+/*
+ * \file test_dbus_adapter.cc
+ * \brief
+ *
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <pthread.h>
+#include <gtest/gtest.h>
+#include <gmock/gmock.h>
+#include "dbus/mock_dbus_message_controller.h"
+#include "dbus/mock_subscriber.h"
+
+using ::testing::_;
+
+namespace test {
+namespace components {
+namespace dbus {
+
+ACTION_P(SignalTest, test) {
+ if (test->thread_id != pthread_self()) {
+ pthread_mutex_lock(&test->test_mutex);
+ pthread_cond_signal(&test->test_cond);
+ pthread_mutex_unlock(&test->test_mutex);
+ } else {
+ test->one_thread = true;
+ }
+}
+
+class DBusMessageControllerTest : public ::testing::Test {
+ public:
+ volatile bool one_thread;
+ pthread_t thread_id;
+ static pthread_mutex_t test_mutex;
+ static pthread_cond_t test_cond;
+
+ protected:
+ MockDBusMessageController* controller_;
+ MockSubscriber* subscriber_;
+
+ static void SetUpTestCase() {}
+
+ static void TearDownTestCase() {}
+
+ virtual void SetUp() {
+ const std::string kService = "sdl.core.test_api";
+ const std::string kPath = "/dbus_test";
+ controller_ = new MockDBusMessageController(kService, kPath);
+ subscriber_ = new MockSubscriber(kService, kPath);
+ ASSERT_TRUE(controller_->Init());
+ ASSERT_TRUE(subscriber_->Start());
+ }
+
+ void TearDown() OVERRIDE {
+ delete controller_;
+ delete subscriber_;
+ }
+
+ bool waitCond(int seconds) {
+ if (one_thread)
+ return true;
+ timespec elapsed;
+ clock_gettime(CLOCK_REALTIME, &elapsed);
+ elapsed.tv_sec += seconds;
+ return pthread_cond_timedwait(&test_cond, &test_mutex, &elapsed) !=
+ ETIMEDOUT;
+ }
+};
+
+pthread_mutex_t DBusMessageControllerTest::test_mutex;
+pthread_cond_t DBusMessageControllerTest::test_cond;
+
+TEST_F(DBusMessageControllerTest, Receive) {
+ std::string text = "Test message for call method DBus";
+ EXPECT_CALL(*controller_, Recv(text)).Times(1).WillOnce(SignalTest(this));
+ subscriber_->Send(text);
+ EXPECT_TRUE(waitCond(1));
+}
+
+TEST_F(DBusMessageControllerTest, DISABLED_Send) {
+ const std::string kText = "Test message for signal DBus";
+ // EXPECT_CALL(*subscriber_, Receive(kText)).Times(1);
+ controller_->Send(kText);
+}
+
+} // namespace dbus
+} // namespace components
+} // namespace test
diff --git a/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h b/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h
new file mode 100644
index 0000000000..30410a6c7e
--- /dev/null
+++ b/src/components/dbus/test/include/dbus/mock_dbus_message_controller.h
@@ -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.
+*/
+
+#ifndef SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
+#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
+
+#include <pthread.h>
+#include "dbus/dbus_message_controller.h"
+
+namespace test {
+namespace components {
+namespace dbus_test {
+
+class MockDBusMessageController : public ::dbus::DBusMessageController {
+ public:
+ MOCK_METHOD1(Recv, void(std::string&));
+
+ MockDBusMessageController(const std::string& serviceName,
+ const std::string& path)
+ : DBusMessageController(serviceName, path), thread_() {}
+
+ virtual void processResponse(std::string method, Json::Value& root) {}
+ virtual void processRequest(Json::Value& root) {}
+ virtual void processNotification(Json::Value& root) {}
+
+ bool Init() {
+ return ::hmi_message_handler::DBusMessageController::Init() &&
+ pthread_create(&thread_, 0, &Run, this) == 0;
+ }
+
+ private:
+ pthread_t thread_;
+ static void* Run(void* data) {
+ if (NULL != data) {
+ static_cast<MockDBusMessageController*>(data)
+ ->MethodForReceiverThread(nullptr);
+ }
+ return 0;
+ }
+};
+
+} // namespace dbus_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_DBUS_MESSAGE_CONTROLLER_H_
diff --git a/src/components/dbus/test/include/dbus/mock_subscriber.h b/src/components/dbus/test/include/dbus/mock_subscriber.h
new file mode 100644
index 0000000000..b2a369e371
--- /dev/null
+++ b/src/components/dbus/test/include/dbus/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_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
+#define SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
+
+#include <string>
+
+struct DBusConnection;
+
+namespace test {
+namespace components {
+namespace dbus {
+
+class MockSubscriber {
+ public:
+ MockSubscriber(const std::string nameService, const std::string path);
+ virtual ~MockSubscriber();
+ virtual void Receive();
+ bool Start();
+ void Send(const std::string& message);
+
+ private:
+ std::string nameService_;
+ std::string path_;
+ DBusConnection* conn_;
+};
+
+} // namespace dbus
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_DBUS_TEST_INCLUDE_DBUS_MOCK_SUBSCRIBER_H_
diff --git a/src/components/dbus/test/mock_subscriber.cc b/src/components/dbus/test/mock_subscriber.cc
new file mode 100644
index 0000000000..2c5dccaa50
--- /dev/null
+++ b/src/components/dbus/test/mock_subscriber.cc
@@ -0,0 +1,71 @@
+/**
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "dbus/dbus.h"
+#include "dbus/mock_subscriber.h"
+
+namespace test {
+namespace components {
+namespace dbus {
+
+MockSubscriber::MockSubscriber(const std::string nameService,
+ const std::string path)
+ : nameService_(nameService), path_(path), conn_(NULL) {}
+
+MockSubscriber::~MockSubscriber() {}
+
+void MockSubscriber::Receive() {}
+
+bool MockSubscriber::Start() {
+ DBusError err;
+ dbus_error_init(&err);
+ conn_ = dbus_bus_get(DBUS_BUS_SESSION, &err);
+ if (dbus_error_is_set(&err)) {
+ dbus_error_free(&err);
+ return false;
+ }
+
+ std::string rule = "type='signal',interface='" + nameService_ + "'";
+ dbus_bus_add_match(conn_, rule.c_str(), &err);
+ dbus_connection_flush(conn_);
+ if (dbus_error_is_set(&err)) {
+ dbus_error_free(&err);
+ return false;
+ }
+ return true;
+}
+
+void MockSubscriber::Send(const std::string& message) {}
+
+} // namespace dbus
+} // namespace components
+} // namespace test
diff --git a/src/components/dbus/test/test_schema.cc b/src/components/dbus/test/schema_test.cc
index 37831279b9..37831279b9 100644
--- a/src/components/dbus/test/test_schema.cc
+++ b/src/components/dbus/test/schema_test.cc
diff --git a/src/components/dbus/test/test_dbus_message_controller.cc b/src/components/dbus/test/test_dbus_message_controller.cc
deleted file mode 100644
index 5c5d4e69d5..0000000000
--- a/src/components/dbus/test/test_dbus_message_controller.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * \file test_dbus_adapter.cc
- * \brief
- *
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <pthread.h>
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-#include "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());
- }
-
- void TearDown() OVERRIDE {
- delete controller_;
- delete subscriber_;
- }
-
- bool waitCond(int seconds) {
- if (one_thread)
- return true;
- timespec elapsed;
- clock_gettime(CLOCK_REALTIME, &elapsed);
- elapsed.tv_sec += seconds;
- return pthread_cond_timedwait(&test_cond, &test_mutex, &elapsed) !=
- ETIMEDOUT;
- }
-};
-
-pthread_mutex_t DBusMessageControllerTest::test_mutex;
-pthread_cond_t DBusMessageControllerTest::test_cond;
-
-TEST_F(DBusMessageControllerTest, Receive) {
- std::string text = "Test message for call method DBus";
- EXPECT_CALL(*controller_, Recv(text)).Times(1).WillOnce(SignalTest(this));
- subscriber_->Send(text);
- EXPECT_TRUE(waitCond(1));
-}
-
-TEST_F(DBusMessageControllerTest, DISABLED_Send) {
- const std::string kText = "Test message for signal DBus";
- // EXPECT_CALL(*subscriber_, Receive(kText)).Times(1);
- controller_->Send(kText);
-}
-
-} // namespace hmi_message_handler
-} // namespace components
-} // namespace test
diff --git a/src/components/formatters/CMakeLists.txt b/src/components/formatters/CMakeLists.txt
index 1858342ff3..ffd6f333e5 100644
--- a/src/components/formatters/CMakeLists.txt
+++ b/src/components/formatters/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,8 +28,7 @@
# 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
include/
@@ -41,22 +40,19 @@ include_directories (
${COMPONENTS_DIR}/utils/include
)
-set (SOURCES
- ${FORMATTERS_SRC_DIR}/CSmartFactory.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
-set (FORMATTER_SOURCES
- ${FORMATTERS_SRC_DIR}/CFormatterJsonBase.cc
- ${FORMATTERS_SRC_DIR}/CFormatterJsonSDLRPCv1.cc
- ${FORMATTERS_SRC_DIR}/CFormatterJsonSDLRPCv2.cc
- ${FORMATTERS_SRC_DIR}/formatter_json_rpc.cc
- ${FORMATTERS_SRC_DIR}/meta_formatter.cc
- ${FORMATTERS_SRC_DIR}/generic_json_formatter.cc
+set (LIBRARIES
+ Utils
+ SmartObjects
)
-add_library("formatters" ${SOURCES}
- ${FORMATTER_SOURCES}
-)
+collect_sources(SOURCES "${PATHS}")
+add_library("formatters" ${SOURCES})
+target_link_libraries("formatters" "${LIBRARIES}")
if(BUILD_TESTS)
add_subdirectory(test)
diff --git a/src/components/formatters/include/formatters/CFormatterJsonBase.h b/src/components/formatters/include/formatters/CFormatterJsonBase.h
index be4ee3e2cc..1df706839f 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonBase.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonBase.h
@@ -32,8 +32,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#ifndef __CFORMATTERJSONBASE_HPP__
-#define __CFORMATTERJSONBASE_HPP__
+#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
+#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
#include "smart_objects/smart_object.h"
#include "json/json.h"
@@ -116,4 +116,4 @@ class CFormatterJsonBase {
}
} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
-#endif // __CFORMATTERJSONBASE_HPP__
+#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONBASE_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
index e78a115f6c..f22b1216ab 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv1.h
@@ -27,8 +27,8 @@
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#ifndef __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV1_HPP__
-#define __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV1_HPP__
+#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_
+#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_
#include "json/json.h"
@@ -236,4 +236,4 @@ int32_t Formatters::CFormatterJsonSDLRPCv1::fromString(
}
} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
-#endif // __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV1_HPP__
+#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV1_H_
diff --git a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
index a260ecd080..8260a35959 100644
--- a/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
+++ b/src/components/formatters/include/formatters/CFormatterJsonSDLRPCv2.h
@@ -28,8 +28,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#ifndef __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV2_HPP__
-#define __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV2_HPP__
+#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_
+#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_
#include "json/json.h"
@@ -184,4 +184,4 @@ inline bool CFormatterJsonSDLRPCv2::fromString(
}
} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
-#endif // __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS__CFORMATTERJSONSDLRPCV2_HPP__
+#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CFORMATTERJSONSDLRPCV2_H_
diff --git a/src/components/formatters/include/formatters/CSmartFactory.h b/src/components/formatters/include/formatters/CSmartFactory.h
index 223d22fbbe..9fed89253b 100644
--- a/src/components/formatters/include/formatters/CSmartFactory.h
+++ b/src/components/formatters/include/formatters/CSmartFactory.h
@@ -32,8 +32,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#ifndef __CSMARTFACTORY_HPP__
-#define __CSMARTFACTORY_HPP__
+#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_
+#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
@@ -407,4 +407,4 @@ bool operator<(const SmartSchemaKey<FunctionIdEnum, MessageTypeEnum>& l,
}
}
}
-#endif //__CSMARTFACTORY_HPP__
+#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_CSMARTFACTORY_H_
diff --git a/src/components/formatters/include/formatters/formatter_json_rpc.h b/src/components/formatters/include/formatters/formatter_json_rpc.h
index db122fa1a2..3d921ea901 100644
--- a/src/components/formatters/include/formatters/formatter_json_rpc.h
+++ b/src/components/formatters/include/formatters/formatter_json_rpc.h
@@ -32,8 +32,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#ifndef SMARTDEVICELINK_COMPONENTS_JSONHANDLER_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
-#define SMARTDEVICELINK_COMPONENTS_JSONHANDLER_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
+#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
+#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
#include <string>
#include <sys/stat.h>
@@ -494,4 +494,4 @@ int32_t FormatterJsonRpc::ParseFunctionId(const Json::Value& method_value,
} // namespace NsJSONHandler
} // namespace NsSmartDeviceLink
-#endif // SMARTDEVICELINK_COMPONENTS_JSONHANDLER_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
+#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_FORMATTER_JSON_RPC_H_
diff --git a/src/components/formatters/include/formatters/generic_json_formatter.h b/src/components/formatters/include/formatters/generic_json_formatter.h
index 580a49d73a..2b5d95fd4a 100644
--- a/src/components/formatters/include/formatters/generic_json_formatter.h
+++ b/src/components/formatters/include/formatters/generic_json_formatter.h
@@ -32,8 +32,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#ifndef SMARTDEVICELINK_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
-#define SMARTDEVICELINK_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
+#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
+#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
#include "CFormatterJsonBase.h"
@@ -68,4 +68,4 @@ class GenericJsonFormatter : public CFormatterJsonBase {
} // namespace NsJSONHandler
} // namespace NsSmartDeviceLink
-#endif // SMARTDEVICELINK_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
+#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_GENERIC_JSON_FORMATTER_H_
diff --git a/src/components/formatters/include/formatters/meta_formatter.h b/src/components/formatters/include/formatters/meta_formatter.h
index 65b8c19863..20abb3b848 100644
--- a/src/components/formatters/include/formatters/meta_formatter.h
+++ b/src/components/formatters/include/formatters/meta_formatter.h
@@ -33,8 +33,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-#ifndef __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS_METAFORMATTER_H__
-#define __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS_METAFORMATTER_H__
+#ifndef SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_
+#define SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_
#include "smart_objects/smart_object.h"
#include "smart_objects/smart_schema.h"
@@ -75,4 +75,4 @@ class CMetaFormatter {
} // namespace NsSmartDeviceLink::NsJSONHandler
} // namespace NsSmartDeviceLink::NsJSONHandler::Formatters
-#endif // __SMARTDEVICELINKCORE_JSONHANDLER_FORMATTERS_METAFORMATTER_H__
+#endif // SRC_COMPONENTS_FORMATTERS_INCLUDE_FORMATTERS_META_FORMATTER_H_
diff --git a/src/components/formatters/test/CMakeLists.txt b/src/components/formatters/test/CMakeLists.txt
index d245626dae..27a0cdf791 100644
--- a/src/components/formatters/test/CMakeLists.txt
+++ b/src/components/formatters/test/CMakeLists.txt
@@ -29,14 +29,14 @@
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
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_BINARY_DIR}/src/components
${JSONCPP_INCLUDE_DIRECTORY}
)
@@ -49,19 +49,15 @@ set(LIBRARIES
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
+set (SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${CMAKE_CURRENT_SOURCE_DIR}
)
-create_test("formatters_test" "${SOURCES}" "${LIBRARIES}")
+set (EXCLUDE_PATHS
+)
+
+collect_sources(SOURCES "")
+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
index f98af88328..3713d076e2 100644
--- a/src/components/formatters/test/CSmartFactory_test.cc
+++ b/src/components/formatters/test/CSmartFactory_test.cc
@@ -67,7 +67,9 @@ TEST(CSmartFactoryTest,
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -79,7 +81,9 @@ TEST(CSmartFactoryTest,
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -99,7 +103,9 @@ TEST(
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -120,7 +126,9 @@ TEST(
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OUT_OF_RANGE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -141,7 +149,9 @@ TEST(
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -163,7 +173,9 @@ TEST(CSmartFactoryTest,
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -185,7 +197,9 @@ TEST(
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -221,7 +235,9 @@ TEST(
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());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -236,7 +252,9 @@ TEST(CSmartFactoryTest,
obj["position"] = 200;
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -251,7 +269,9 @@ TEST(
obj["text"] = "test";
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(1u, keys.size());
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -266,7 +286,9 @@ TEST(CSmartFactoryTest,
obj["position"] = 200;
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -281,10 +303,14 @@ TEST(CSmartFactoryTest,
obj["position"] = 200;
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -301,11 +327,15 @@ TEST(
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
// Check object "image"
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -321,11 +351,15 @@ TEST(
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
// Check object "image"
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -342,11 +376,15 @@ TEST(
obj["image"]["text"] = "test2";
obj["image"]["position"] = 100;
// Check object "image"
- EXPECT_EQ(Errors::eType::OK, obj["image"].validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj["image"].validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_TRUE(obj.isValid());
}
@@ -363,7 +401,9 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(2u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
@@ -381,7 +421,9 @@ TEST(
std::set<std::string> keys = obj.enumerate();
EXPECT_EQ(3u, keys.size());
// Check global object
- EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::INVALID_VALUE, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_FALSE(obj.isValid());
}
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
index 91701c8aab..a4d40b4478 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv1_test.cc
@@ -42,7 +42,9 @@ namespace formatters {
TEST(CFormatterJsonSDLRPCv1Test, EmptySmartObjectToString) {
SmartObject srcObj;
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
@@ -71,7 +73,10 @@ TEST(CFormatterJsonSDLRPCv1Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER,
+ srcObj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv1::toString(srcObj, jsonString);
@@ -102,7 +107,9 @@ TEST(CFormatterJsonSDLRPCv1Test,
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
srcObj[S_MSG_PARAMS][""] = "";
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -333,7 +340,9 @@ TEST(CFormatterJsonSDLRPCv1Test, StringRequestToSmObj) {
inputJsonString, obj);
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 5);
@@ -477,7 +486,9 @@ TEST(CFormatterJsonSDLRPCv1Test, StringNotificationToSmartObject) {
MessageTypeTest::eType>(
inputJsonString, obj);
EXPECT_EQ(CFormatterJsonSDLRPCv1::kSuccess, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], 13);
diff --git a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
index feb7dd3129..c7e6f61674 100644
--- a/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
+++ b/src/components/formatters/test/cFormatterJsonSDLRPCv2_test.cc
@@ -41,7 +41,9 @@ namespace formatters {
TEST(CFormatterJsonSDLRPCv2Test, EmptySmartObjectToString) {
SmartObject srcObj;
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
@@ -64,7 +66,10 @@ TEST(CFormatterJsonSDLRPCv2Test, SmObjWithRequestWithoutMsgNotValid_ToString) {
srcObj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER,
+ srcObj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
bool result = CFormatterJsonSDLRPCv2::toString(srcObj, jsonString);
@@ -88,7 +93,9 @@ TEST(CFormatterJsonSDLRPCv2Test,
srcObj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
srcObj[S_MSG_PARAMS][""] = "";
- EXPECT_EQ(Errors::eType::OK, srcObj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, srcObj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string jsonString;
@@ -262,7 +269,9 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithoutCorIdToSmObj) {
MessageTypeTest::request);
EXPECT_EQ(true, result);
- EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::MISSING_MANDATORY_PARAMETER, obj.validate(&report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
EXPECT_EQ(obj[S_PARAMS][S_PROTOCOL_TYPE], 0);
@@ -307,7 +316,9 @@ TEST(CFormatterJsonSDLRPCv2Test, StringRequestWithCorIdToSmObj) {
corId);
EXPECT_EQ(true, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::request);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::RegisterAppInterface);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], corId);
@@ -372,7 +383,9 @@ TEST(CFormatterJsonSDLRPCv2Test, StringNotificationToSmartObject) {
MessageTypeTest::notification,
corId);
EXPECT_EQ(true, result);
- EXPECT_EQ(Errors::eType::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::eType::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
EXPECT_EQ(obj[S_PARAMS][S_MESSAGE_TYPE], MessageTypeTest::notification);
EXPECT_EQ(obj[S_PARAMS][S_FUNCTION_ID], FunctionIDTest::SetGlobalProperties);
EXPECT_EQ(obj[S_PARAMS][S_CORRELATION_ID], corId);
diff --git a/src/components/formatters/test/formatter_json_rpc_test.cc b/src/components/formatters/test/formatter_json_rpc_test.cc
index c2b0d73394..e882bed618 100644
--- a/src/components/formatters/test/formatter_json_rpc_test.cc
+++ b/src/components/formatters/test/formatter_json_rpc_test.cc
@@ -42,8 +42,8 @@
#include <set>
#include "gtest/gtest.h"
#include "formatters/CSmartFactory.h"
-#include "HMI_API_schema.h"
-#include "MOBILE_API_schema.h"
+#include "interfaces/HMI_API_schema.h"
+#include "interfaces/MOBILE_API_schema.h"
namespace test {
namespace components {
@@ -149,7 +149,9 @@ TEST(FormatterJsonRPCTest, UpperBoundValuesInSystemRequest_ToString_Success) {
hmi_apis::HMI_API factory;
EXPECT_TRUE(factory.attachSchema(obj, false));
- EXPECT_EQ(Errors::OK, obj.validate());
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::OK, obj.validate(&report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
std::string result;
// Convert SmartObject to Json string
EXPECT_TRUE(FormatterJsonRpc::ToString(obj, result));
diff --git a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
index d195fe1833..8f5ee96ce5 100644
--- a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
+++ b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h
@@ -30,14 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_SMARTFACTORYTESTHELPER_H_
-#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_SMARTFACTORYTESTHELPER_H_
+#ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_SMARTFACTORYTESTHELPER_H_
+#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_SMARTFACTORYTESTHELPER_H_
#include <map>
#include <set>
#include "formatters/CSmartFactory.h"
-#include "HMI_API_schema.h"
+#include "interfaces/HMI_API_schema.h"
#include "smart_objects/always_true_schema_item.h"
#include "smart_objects/always_false_schema_item.h"
#include "smart_objects/array_schema_item.h"
@@ -157,4 +157,4 @@ class CSmartFactoryTest : public CSmartFactory<FunctionIdTest::eType,
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_SMARTFACTORYTESTHELPER_H_
+#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_SMARTFACTORYTESTHELPER_H_
diff --git a/src/components/formatters/test/include/formatters/create_smartSchema.h b/src/components/formatters/test/include/formatters/create_smartSchema.h
index 3514b7fe94..4d7a217317 100644
--- a/src/components/formatters/test/include/formatters/create_smartSchema.h
+++ b/src/components/formatters/test/include/formatters/create_smartSchema.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_CREATESMARTSCHEMA_H_
-#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_CREATESMARTSCHEMA_H_
+#ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_CREATE_SMARTSCHEMA_H_
+#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_CREATE_SMARTSCHEMA_H_
#include "formatters/CFormatterJsonSDLRPCv1.h"
#include "SmartFactoryTestHelper.h"
@@ -77,4 +77,4 @@ CSmartSchema initSchemaForMetaFormatter();
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_CREATESMARTSCHEMA_H_
+#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_CREATE_SMARTSCHEMA_H_
diff --git a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
index 1494c75c4b..a58f69e386 100644
--- a/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
+++ b/src/components/formatters/test/include/formatters/meta_formatter_test_helper.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_METAFORMATTERTESTHELPER_H_
-#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_METAFORMATTERTESTHELPER_H_
+#ifndef SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_META_FORMATTER_TEST_HELPER_H_
+#define SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_META_FORMATTER_TEST_HELPER_H_
#include "gtest/gtest.h"
@@ -79,4 +79,4 @@ class CMetaFormatterTestHelper : public ::testing::Test {
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_METAFORMATTERTESTHELPER_H_
+#endif // SRC_COMPONENTS_FORMATTERS_TEST_INCLUDE_FORMATTERS_META_FORMATTER_TEST_HELPER_H_
diff --git a/src/components/formatters/test/meta_formatter_test.cc b/src/components/formatters/test/meta_formatter_test.cc
index 27f5e70e8f..87f05ab50e 100644
--- a/src/components/formatters/test/meta_formatter_test.cc
+++ b/src/components/formatters/test/meta_formatter_test.cc
@@ -68,20 +68,6 @@ TEST_F(CMetaFormatterTestHelper,
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);
@@ -112,13 +98,6 @@ TEST_F(CMetaFormatterTestHelper, NormalSchemaWithEmptyObject) {
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,
@@ -138,11 +117,8 @@ TEST_F(CMetaFormatterTestHelper,
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());
+ EXPECT_EQ(
+ 0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["patchVersion"].asInt());
}
TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyMap) {
@@ -189,11 +165,6 @@ TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyMap) {
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) {
@@ -231,11 +202,6 @@ TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyArray) {
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,
@@ -323,13 +289,6 @@ TEST_F(CMetaFormatterTestHelper,
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());
diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc
index 75663d4488..1497fbf281 100644
--- a/src/components/formatters/test/src/create_smartSchema.cc
+++ b/src/components/formatters/test/src/create_smartSchema.cc
@@ -338,7 +338,7 @@ CSmartSchema initSchemaForMetaFormatter() {
ISchemaItemPtr majorVersion_SchemaItem = TNumberSchemaItem<int>::create();
ISchemaItemPtr minorVersion_SchemaItem = TNumberSchemaItem<int>::create();
-
+ ISchemaItemPtr patchVersion_SchemaItem = TNumberSchemaItem<int>::create();
ISchemaItemPtr syncMsg_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(0),
TSchemaItemParameter<size_t>(1000),
@@ -355,6 +355,8 @@ CSmartSchema initSchemaForMetaFormatter() {
CObjectSchemaItem::SMember(majorVersion_SchemaItem, false);
schemaSyncMsgVersionMap["minorVersion"] =
CObjectSchemaItem::SMember(minorVersion_SchemaItem, false);
+ schemaSyncMsgVersionMap["patchVersion"] =
+ CObjectSchemaItem::SMember(patchVersion_SchemaItem, false);
;
// Map of parameters
diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc
index a963c08a52..897c8d364d 100644
--- a/src/components/formatters/test/src/meta_formatter_test_helper.cc
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -109,17 +109,6 @@ void CMetaFormatterTestHelper::
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(
@@ -130,11 +119,6 @@ void CMetaFormatterTestHelper::FillObjectWithoutSomeMandatoryFields(
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;
@@ -193,23 +177,13 @@ void CMetaFormatterTestHelper::FillObjectWithDefaultValues(SmartObject& obj) {
obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 0;
obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 0;
+ obj[S_MSG_PARAMS]["syncMsgVersion"]["patchVersion"] = 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
diff --git a/src/components/functional_module/CMakeLists.txt b/src/components/functional_module/CMakeLists.txt
new file mode 100644
index 0000000000..07db91fc38
--- /dev/null
+++ b/src/components/functional_module/CMakeLists.txt
@@ -0,0 +1,58 @@
+if (ENABLE_GCOV)
+ set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs")
+else()
+ set(GCOV_FLAGS "")
+endif()
+
+set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wno-deprecated-declarations -Wall -Werror ${GCOV_FLAGS}")
+
+if (CMAKE_BUILD_TYPE)
+ if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
+ set(CMAKE_CXX_FLAGS_DEBUG "")
+ else ()
+ set(CMAKE_CXX_FLAGS_RELEASE "")
+ set(CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG")
+ endif()
+endif()
+
+set(GCOV gcov)
+
+include_directories (
+ ${COMPONENTS_DIR}/functional_module/include/
+ ${COMPONENTS_DIR}/remote_control/include/
+ ${COMPONENTS_DIR}/include/
+ ${COMPONENTS_DIR}/application_manager/include
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/utils/include
+ ${POLICY_PATH}/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+
+ ${COMPONENTS_DIR}/application_manager/test/include/
+)
+
+set (SOURCES
+ ./src/generic_module.cc
+ ./src/plugin_manager.cc
+ ./src/timer/timer_director.cc
+)
+set (LIBRARIES
+ ApplicationManager
+ jsoncpp
+)
+
+add_library("FunctionalModule" ${SOURCES})
+target_link_libraries("FunctionalModule" ${LIBRARIES} )
+
+if(ENABLE_LOG)
+ target_link_libraries("FunctionalModule" log4cxx -L${LOG4CXX_LIBS_DIRECTORY} ${GCOV})
+endif()
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/functional_module/include/functional_module/function_ids.h b/src/components/functional_module/include/functional_module/function_ids.h
new file mode 100644
index 0000000000..1a504df6c9
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/function_ids.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace functional_modules {
+
+enum RCFunctionID {
+ // Remote SDL functions ids
+ BUTTON_PRESS = mobile_apis::FunctionID::ButtonPressID,
+ GET_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::GetInteriorVehicleDataID,
+ SET_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::SetInteriorVehicleDataID,
+ ON_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::OnInteriorVehicleDataID,
+ ON_REMOTE_CONTROL_SETTINGS = hmi_apis::FunctionID::RC_OnRemoteControlSettings,
+};
+
+namespace hmi_api {
+const char get_interior_vehicle_data[] = "RC.GetInteriorVehicleData";
+const char set_interior_vehicle_data[] = "RC.SetInteriorVehicleData";
+const char on_interior_vehicle_data[] = "RC.OnInteriorVehicleData";
+const char button_press[] = "Buttons.ButtonPress";
+const char on_remote_control_settings[] = "RC.OnRemoteControlSettings";
+
+const char get_user_consent[] = "RC.GetInteriorVehicleDataConsent";
+const char on_app_deactivated[] = "BasicCommunication.OnAppDeactivated";
+const char sdl_activate_app[] = "SDL.ActivateApp";
+}
+
+} // namespace functional_modules
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
diff --git a/src/components/functional_module/include/functional_module/generic_module.h b/src/components/functional_module/include/functional_module/generic_module.h
new file mode 100644
index 0000000000..15d572be6d
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/generic_module.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
+
+#include <deque>
+#include <string>
+#include "functional_module/module_observer.h"
+#include "functional_module/function_ids.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/service.h"
+
+namespace functional_modules {
+
+/**
+ * @brief The PolicyEvent enum defines events related to policy
+ */
+enum PolicyEvent { kApplicationPolicyUpdated = 0, kApplicationsDisabled };
+
+/**
+ * @brief The ApplicationEvent enum defines events related to single application
+ */
+enum ApplicationEvent { kApplicationExit = 0, kApplicationUnregistered };
+
+enum ProcessResult {
+ NONE = -1,
+ PROCESSED,
+ PARTIALLY_PROCESSED,
+ CANNOT_PROCESS,
+ FAILED
+};
+
+enum ServiceState { IDLE = 0, SUSPENDED, LOWVOLTAGE, HMI_ADAPTER_INITIALIZED };
+
+typedef std::string HMIFunctionID;
+
+class GenericModule;
+typedef utils::SharedPtr<GenericModule> ModulePtr;
+
+struct PluginInfo {
+ std::string name;
+ int version;
+ std::deque<RCFunctionID> rc_function_list;
+ std::deque<HMIFunctionID> hmi_function_list;
+};
+
+class GenericModule {
+ public:
+ typedef std::deque<ModuleObserver*> Observers;
+
+ virtual ~GenericModule();
+ ModuleID GetModuleID() const {
+ return kModuleId_;
+ }
+ virtual PluginInfo GetPluginInfo() const = 0;
+
+ /**
+ * @brief Setter for service (interface for plugin t access SDL functionality)
+ * @param service pointer to new service instance
+ */
+ virtual void set_service(application_manager::ServicePtr service);
+
+ /**
+ * @brief Returns pointer to SDL core service interface
+ * @return pointer to core service interface
+ */
+ virtual application_manager::ServicePtr service();
+
+ virtual ProcessResult ProcessMessage(application_manager::MessagePtr msg) = 0;
+ virtual ProcessResult ProcessHMIMessage(
+ application_manager::MessagePtr msg) = 0;
+ virtual void OnServiceStateChanged(ServiceState state);
+
+ /**
+ * @brief Adds pointer to observer of module to be notified about
+ * exceptional sutiations in module.
+ * Raw pointer is passed to avoid circular dependencies.
+ * Module is not responsible for freeing observer's memory.
+ */
+ void AddObserver(ModuleObserver* const observer);
+
+ /**
+ * @brief Removes pointer to observer of module when it's no loger
+ * wants to be notified about exceptional sutiations in module.
+ * Raw pointer is passed to avoid circular dependencies.
+ * Module is not responsible for freeing observer's memory.
+ */
+ void RemoveObserver(ModuleObserver* const observer);
+
+ /**
+ * @brief Remove extension created for specified application
+ * @param app_id application id
+ */
+ virtual void RemoveAppExtension(uint32_t app_id) = 0;
+
+ /**
+ * @brief Check registering app can be handled by plugin
+ * @param msg Registration message
+ * @param app Application basis already create by Core
+ */
+ virtual bool IsAppForPlugin(
+ application_manager::ApplicationSharedPtr app) = 0;
+
+ /**
+ * @brief Notify about change of HMILevel of plugin's app
+ * @param app App with new HMILevel
+ * @param old_level Old HMILevel of app
+ */
+ virtual void OnAppHMILevelChanged(
+ application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType old_level) = 0;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) = 0;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(PolicyEvent event) = 0;
+
+ protected:
+ explicit GenericModule(ModuleID module_id);
+ void NotifyObservers(ModuleObserver::Errors error);
+
+ /**
+ * @brief Remove extension for all applications
+ */
+ virtual void RemoveAppExtensions() = 0;
+
+ private:
+ application_manager::ServicePtr service_;
+ const ModuleID kModuleId_;
+
+ Observers observers_;
+ ServiceState state_;
+
+ friend class DriverGenericModuleTest;
+ DISALLOW_COPY_AND_ASSIGN(GenericModule);
+};
+
+} // namespace functional_modules
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
diff --git a/src/components/functional_module/include/functional_module/module_observer.h b/src/components/functional_module/include/functional_module/module_observer.h
new file mode 100644
index 0000000000..a5e34db040
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/module_observer.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_
+
+namespace functional_modules {
+
+typedef int ModuleID;
+
+class ModuleObserver {
+ public:
+ enum Errors { NONE = -1, OUT_OF_MEMORY, FS_FAILURE };
+ virtual ~ModuleObserver() {}
+
+ /**
+ * @brief OnError callback for module to notify SDL about internal error
+ * @param error error type
+ * @param module_id module that triggered error
+ */
+ virtual void OnError(Errors error, ModuleID module_id) = 0;
+};
+} // namespace functional_modules {
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_
diff --git a/src/components/functional_module/include/functional_module/plugin_manager.h b/src/components/functional_module/include/functional_module/plugin_manager.h
new file mode 100644
index 0000000000..c573d843b2
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/plugin_manager.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
+
+#include <map>
+#include <string>
+#include "functional_module/generic_module.h"
+#include "application_manager/service.h"
+#include "application_manager/message.h"
+
+namespace functional_modules {
+
+class PluginManager : public ModuleObserver {
+ public:
+ PluginManager();
+ ~PluginManager();
+ typedef std::map<ModuleID, ModulePtr> Modules;
+
+ /**
+ * @brief LoadPlugins initialize loading plugins
+ * @param plugin_path path to search to plugin shared libraries
+ * @return count of loaded plugins
+ */
+ int LoadPlugins(const std::string& plugin_path);
+
+ /**
+ * @brief UnloadPlugins unload from memory all plugins
+ */
+ void UnloadPlugins();
+
+ /**
+ * @brief IsMessageForPlugin Verifies whether mobile message will be processed
+ * by plugins
+ * @param msg Mobile message
+ * @return True if any of plugins will process the message, otherwise - false
+ */
+ bool IsMessageForPlugin(application_manager::MessagePtr msg);
+
+ /**
+ * @brief IsHMIMessageForPlugin Verifies whether HMI message will be processed
+ * by plugins
+ * @param msg HMI message
+ * @return True if any of plugins will process the message, otherwise - false
+ */
+ bool IsHMIMessageForPlugin(application_manager::MessagePtr msg);
+
+ /**
+ * @brief ProcessMessage forwards mobile message to modules if any is
+ * subsribed for the message.
+ * @param msg Mobile message to process
+ * @return Result of processing
+ */
+ ProcessResult ProcessMessage(application_manager::MessagePtr msg);
+
+ /**
+ * @brief ProcessHMIMessage forwards HMI message to modules if any is
+ * subscribed for the message
+ * @param msg HMI message to process
+ * @return Result of processing
+ */
+ ProcessResult ProcessHMIMessage(application_manager::MessagePtr msg);
+ void SetServiceHandler(application_manager::ServicePtr service) {
+ service_ = service;
+ }
+ void OnServiceStateChanged(ServiceState state);
+ void OnError(ModuleObserver::Errors error, ModuleID module_id) FINAL;
+
+ /**
+ * @brief Remove extension created for specified application
+ * @param app_id application id
+ */
+ void RemoveAppExtension(uint32_t app_id);
+
+ /**
+ * @brief Check if app cooperates with one or more plugins, init it
+ * inside plugin accordingly if needed.
+ * @param app Application in question.
+ */
+ bool IsAppForPlugins(application_manager::ApplicationSharedPtr app);
+
+ /**
+ * Check if app cooperates with plugin
+ * @param app application
+ * @param module_id unique identifier of plugin
+ * @return true if application cooperates with this plugin
+ */
+ bool IsAppForPlugin(application_manager::ApplicationSharedPtr app,
+ ModuleID module_id) const;
+
+ /**
+ * @brief Notify plugins about change of HMILevel of app
+ * if app is related to plugin
+ * @param app App with new HMILevel
+ * @param old_level Old HMILevel of app
+ */
+ void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType old_level);
+
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ void OnApplicationEvent(
+ functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application);
+
+ /**
+ * @brief OnPolicyEvent Notifies modules on certain events from policy
+ * @param event Policy event
+ */
+ void OnPolicyEvent(functional_modules::PolicyEvent event);
+
+ Modules& plugins();
+
+ private:
+ Modules plugins_;
+ std::map<ModuleID, void*> dlls_;
+ std::map<RCFunctionID, ModulePtr> mobile_subscribers_;
+ std::map<HMIFunctionID, ModulePtr> hmi_subscribers_;
+ application_manager::ServicePtr service_;
+
+ DISALLOW_COPY_AND_ASSIGN(PluginManager);
+};
+
+} // namespace functional_modules
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
diff --git a/src/components/functional_module/include/functional_module/timer/module_timer.h b/src/components/functional_module/include/functional_module/timer/module_timer.h
new file mode 100644
index 0000000000..e24259241b
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/timer/module_timer.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
+
+#include <list>
+#include <deque>
+#include <algorithm>
+#include <time.h>
+#include "utils/lock.h"
+
+namespace functional_modules {
+
+typedef unsigned int TimeUnit; // seconds
+
+class Trackable {
+ public:
+ Trackable() : start_time_(0) {}
+ virtual ~Trackable() {}
+
+ /**
+ * @brief custom_interval getter for custom interval
+ * @return return timer interval for trackable message
+ */
+ virtual TimeUnit custom_interval() const {
+ return 0;
+ }
+
+ /**
+ * @brief start_time getter for start time of message
+ * @return start time of message
+ */
+ virtual TimeUnit start_time() const {
+ return start_time_;
+ }
+
+ /**
+ * @brief set_start_time setting start time of message
+ * @param start_time start time
+ */
+ virtual void set_start_time(TimeUnit start_time) {
+ start_time_ = start_time;
+ }
+
+ private:
+ TimeUnit start_time_;
+};
+
+template <class Trackable>
+class TimerObserver {
+ public:
+ virtual ~TimerObserver() {}
+ virtual void OnTimeoutTriggered(const Trackable& expired) = 0;
+};
+
+template <class Trackable>
+class ModuleTimer {
+ public:
+ ModuleTimer();
+ ~ModuleTimer();
+ void set_period(TimeUnit period) {
+ period_ = period;
+ }
+ TimeUnit period() const {
+ return period_;
+ }
+ void AddObserver(TimerObserver<Trackable>* observer);
+ void RemoveObserver(TimerObserver<Trackable>* observer);
+
+ void CheckTimeout();
+ /**
+ * @brief Gets time in seconds when the nearest request timeout will be
+ * triggered
+ * @return time in seconds when the nearest request timeout will be triggered
+ */
+ TimeUnit GetSecondsToNearestTimeout();
+
+ /*
+ * @brief Adds object to be tracked by timer.
+ If same object is already added replaces it with new one
+ correspondingly updating start time of tracking.
+ */
+ void AddTrackable(const Trackable& object);
+ void RemoveTrackable(const Trackable& object);
+
+ protected:
+ void Notify(const Trackable& object);
+ void OnTimeout(const Trackable& object);
+ TimeUnit CurrentTime() const;
+ typename std::list<Trackable> trackables_;
+ volatile TimeUnit period_;
+
+ private:
+ std::deque<TimerObserver<Trackable>*> observers_;
+ mutable sync_primitives::Lock trackables_lock_;
+ friend class ModuleTimerTest;
+};
+
+template <class Trackable>
+ModuleTimer<Trackable>::ModuleTimer()
+ : period_(10) {}
+
+template <class Trackable>
+ModuleTimer<Trackable>::~ModuleTimer() {
+ observers_.clear();
+ sync_primitives::AutoLock auto_lock(trackables_lock_);
+ trackables_.clear();
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::AddObserver(TimerObserver<Trackable>* observer) {
+ DCHECK(observer);
+ if (!observer) {
+ return;
+ }
+ observers_.push_back(observer);
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::RemoveObserver(
+ TimerObserver<Trackable>* observer) {
+ DCHECK(observer);
+ if (!observer) {
+ return;
+ }
+ for (typename std::deque<TimerObserver<Trackable>*>::iterator it =
+ observers_.begin();
+ observers_.end() != it;
+ ++it) {
+ if (*it == observer) {
+ observers_.erase(it);
+ return;
+ }
+ }
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::CheckTimeout() {
+ sync_primitives::AutoLock trackables_lock(trackables_lock_);
+ for (typename std::list<Trackable>::iterator it = trackables_.begin();
+ trackables_.end() != it;
+ ++it) {
+ TimeUnit period = it->custom_interval();
+ if (!period) {
+ period = period_;
+ }
+ if (CurrentTime() - it->start_time() >= period) {
+ OnTimeout(*it);
+ it = trackables_.erase(it);
+ }
+ }
+}
+
+template <class Trackable>
+TimeUnit ModuleTimer<Trackable>::GetSecondsToNearestTimeout() {
+ sync_primitives::AutoLock trackables_lock(trackables_lock_);
+ TimeUnit result = period_;
+ for (typename std::list<Trackable>::iterator it = trackables_.begin();
+ trackables_.end() != it;
+ ++it) {
+ TimeUnit period = it->custom_interval();
+ if (!period) {
+ period = period_;
+ }
+ const TimeUnit current_secs_to_timeout =
+ period - (CurrentTime() - it->start_time());
+ if (result > current_secs_to_timeout) {
+ result = current_secs_to_timeout;
+ }
+ }
+ return result;
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::AddTrackable(const Trackable& object) {
+ sync_primitives::AutoLock trackables_lock(trackables_lock_);
+ trackables_.remove(object);
+ trackables_.push_back(object);
+ trackables_.back().set_start_time(CurrentTime());
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::RemoveTrackable(const Trackable& object) {
+ sync_primitives::AutoLock trackables_lock(trackables_lock_);
+ trackables_.remove(object);
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::Notify(const Trackable& object) {
+ for (typename std::deque<TimerObserver<Trackable>*>::const_iterator it =
+ observers_.begin();
+ observers_.end() != it;
+ ++it) {
+ (*it)->OnTimeoutTriggered(object);
+ }
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::OnTimeout(const Trackable& object) {
+ Notify(object);
+}
+
+template <class Trackable>
+TimeUnit ModuleTimer<Trackable>::CurrentTime() const {
+ // TODO(PV): move outside to platform-dependant parts
+ struct timespec current_time;
+ if (0 == clock_gettime(CLOCK_MONOTONIC, &current_time)) {
+ return current_time.tv_sec;
+ } else {
+ return 0;
+ }
+}
+
+} // namespace functional_modules
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
diff --git a/src/components/functional_module/include/functional_module/timer/timer_director.h b/src/components/functional_module/include/functional_module/timer/timer_director.h
new file mode 100644
index 0000000000..fb67b9b5de
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/timer/timer_director.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
+
+#include <map>
+#include "utils/threads/thread.h"
+#include "utils/conditional_variable.h"
+#include "functional_module/timer/module_timer.h"
+
+namespace functional_modules {
+
+template <class T>
+class TimerThreadDelegate : public threads::ThreadDelegate {
+ public:
+ explicit TimerThreadDelegate(ModuleTimer<T>& timer);
+ void threadMain();
+ void exitThreadMain();
+
+ /**
+ * @brief Reset awaiting timer by notifying cond var
+ */
+ void ResetTimer();
+
+ private:
+ ModuleTimer<T>& timer_;
+ volatile bool keep_running_;
+ mutable sync_primitives::Lock keep_running_lock_;
+ mutable sync_primitives::ConditionalVariable keep_running_cond_;
+ friend class TimerThreadDelegateTest;
+};
+
+class TimerDirector {
+ public:
+ TimerDirector();
+ ~TimerDirector();
+
+ /**
+ * @brief Register timer for execution in separate thread.
+ Registers only one timer of a type. Attempt to register timer
+ of already existing type will fail.
+ */
+ template <class T>
+ void RegisterTimer(ModuleTimer<T>& timer);
+ template <class T>
+ void UnregisterTimer(const ModuleTimer<T>& timer);
+ void UnregisterAllTimers();
+ /**
+ * @brief Reset awaiting timeout for specified module timer
+ * @param timer timer to reset awaiting timeout
+ */
+ template <class T>
+ void ResetTimer(ModuleTimer<T>& timer);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TimerDirector);
+ std::map<std::string, threads::Thread*> timer_threads_;
+};
+
+} // namespace functional_modules
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
diff --git a/src/components/functional_module/src/generic_module.cc b/src/components/functional_module/src/generic_module.cc
new file mode 100644
index 0000000000..142b1ef58c
--- /dev/null
+++ b/src/components/functional_module/src/generic_module.cc
@@ -0,0 +1,54 @@
+#include "functional_module/generic_module.h"
+namespace functional_modules {
+
+typedef std::deque<ModuleObserver*>::iterator ModuleObserverIterator;
+
+GenericModule::GenericModule(ModuleID module_id)
+ : kModuleId_(module_id), state_(ServiceState::IDLE) {}
+
+GenericModule::~GenericModule() {
+ observers_.clear();
+}
+
+void GenericModule::AddObserver(ModuleObserver* const observer) {
+ DCHECK(observer);
+ if (!observer) {
+ return;
+ }
+ observers_.push_back(observer);
+}
+
+void GenericModule::RemoveObserver(ModuleObserver* const observer) {
+ DCHECK(observer);
+ if (!observer) {
+ return;
+ }
+ for (ModuleObserverIterator it = observers_.begin(); observers_.end() != it;
+ ++it) {
+ if (*it == observer) {
+ observers_.erase(it);
+ return;
+ }
+ }
+}
+
+void GenericModule::NotifyObservers(ModuleObserver::Errors error) {
+ for (ModuleObserverIterator it = observers_.begin(); observers_.end() != it;
+ ++it) {
+ (*it)->OnError(error, kModuleId_);
+ }
+}
+
+void GenericModule::set_service(application_manager::ServicePtr service) {
+ service_ = service;
+}
+
+void GenericModule::OnServiceStateChanged(ServiceState state) {
+ state_ = state;
+}
+
+application_manager::ServicePtr GenericModule::service() {
+ return service_;
+}
+
+} // namespace functional_modules
diff --git a/src/components/functional_module/src/plugin_manager.cc b/src/components/functional_module/src/plugin_manager.cc
new file mode 100644
index 0000000000..a32fdbf773
--- /dev/null
+++ b/src/components/functional_module/src/plugin_manager.cc
@@ -0,0 +1,396 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <dlfcn.h>
+#include <algorithm>
+#include "functional_module/plugin_manager.h"
+#include "functional_module/function_ids.h"
+#include "protocol/common.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+#include "json/json.h"
+
+namespace functional_modules {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PluginManager")
+
+namespace {
+const std::string ExtractMethodName(application_manager::MessagePtr msg) {
+ DCHECK_OR_RETURN(msg, "");
+ Json::Value value;
+ Json::Reader reader;
+ reader.parse(msg->json_message(), value);
+
+ const char* kMethod = "method";
+ const char* kResult = "result";
+ const char* kError = "error";
+ const char* kData = "data";
+
+ if (value.isMember(kMethod)) {
+ return value.get(kMethod, "").asCString();
+ }
+ if (value.isMember(kResult)) {
+ const Json::Value& result = value.get(kResult, Json::Value());
+ return result.get(kMethod, "").asCString();
+ }
+ if (value.isMember(kError)) {
+ const Json::Value& error = value.get(kError, Json::Value());
+ const Json::Value& data = error.get(kData, Json::Value());
+ return data.get(kMethod, "").asCString();
+ }
+
+ return std::string();
+}
+} // namespace
+
+typedef std::map<ModuleID, ModulePtr>::iterator PluginsIterator;
+typedef std::map<RCFunctionID, ModulePtr>::iterator PluginFunctionsIterator;
+typedef std::map<HMIFunctionID, ModulePtr>::iterator PluginHMIFunctionsIterator;
+
+PluginManager::PluginManager() : service_() {
+ LOG4CXX_DEBUG(logger_, "Creating plugin mgr");
+}
+
+PluginManager::~PluginManager() {
+ mobile_subscribers_.clear();
+ hmi_subscribers_.clear();
+ UnloadPlugins();
+}
+
+int PluginManager::LoadPlugins(const std::string& plugin_path) {
+ LOG4CXX_INFO(logger_, "Loading plugins from " << plugin_path);
+ std::vector<std::string> plugin_files = file_system::ListFiles(plugin_path);
+ for (size_t i = 0; i < plugin_files.size(); ++i) {
+ size_t pos = plugin_files[i].find_last_of(".");
+ if (std::string::npos != pos) {
+ if (plugin_files[i].substr(pos + 1).compare("so") != 0) {
+ continue;
+ }
+ } else {
+ continue;
+ }
+ std::string full_name = plugin_path + '/' + plugin_files[i];
+ void* generic_plugin_dll = dlopen(full_name.c_str(), RTLD_LAZY);
+ if (NULL == generic_plugin_dll) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to open dll " << plugin_files[i] << "\n"
+ << dlerror());
+ continue;
+ }
+ typedef GenericModule* (*Create)();
+ Create create_manager =
+ reinterpret_cast<Create>(dlsym(generic_plugin_dll, "Create"));
+ char* error_string = dlerror();
+ if (NULL != error_string) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to export dll's " << plugin_files[i] << " symbols\n"
+ << error_string);
+ dlclose(generic_plugin_dll);
+ continue;
+ }
+ ModulePtr module = create_manager();
+ if (!module) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to create plugin main class " << plugin_files[i]);
+ dlclose(generic_plugin_dll);
+ continue;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Opened and working plugin from " << plugin_files[i]
+ << " with id "
+ << module->GetModuleID());
+ dlls_.insert(std::pair<ModuleID, void*>(module->GetModuleID(),
+ generic_plugin_dll));
+ plugins_.insert(
+ std::pair<ModuleID, ModulePtr>(module->GetModuleID(), module));
+ std::deque<RCFunctionID> subscribers =
+ module->GetPluginInfo().rc_function_list;
+ for (size_t i = 0; i < subscribers.size(); ++i) {
+ mobile_subscribers_.insert(
+ std::pair<RCFunctionID, ModulePtr>(subscribers[i], module));
+ }
+
+ std::deque<HMIFunctionID> hmi_subscribers =
+ module->GetPluginInfo().hmi_function_list;
+ for (size_t i = 0; i < hmi_subscribers.size(); ++i) {
+ hmi_subscribers_.insert(
+ std::pair<HMIFunctionID, ModulePtr>(hmi_subscribers[i], module));
+ }
+ module->set_service(service_);
+ module->AddObserver(this);
+ }
+ }
+ return plugins_.size();
+}
+
+void PluginManager::UnloadPlugins() {
+ for (Modules::iterator it = plugins_.begin(); plugins_.end() != it; ++it) {
+ it->second->RemoveObserver(this);
+ }
+ plugins_.clear();
+
+ for (std::map<ModuleID, void*>::iterator it = dlls_.begin();
+ dlls_.end() != it;
+ ++it) {
+ dlclose(it->second);
+ }
+ dlls_.clear();
+}
+
+bool PluginManager::IsMessageForPlugin(application_manager::MessagePtr msg) {
+ DCHECK(msg);
+ if (!msg) {
+ LOG4CXX_ERROR(logger_, "Null pointer message was received.");
+ return false;
+ }
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN !=
+ msg->protocol_version() &&
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI !=
+ msg->protocol_version()) {
+ RCFunctionID id = static_cast<RCFunctionID>(msg->function_id());
+ return (mobile_subscribers_.find(id) != mobile_subscribers_.end());
+ } else {
+ return false;
+ }
+}
+
+bool PluginManager::IsHMIMessageForPlugin(application_manager::MessagePtr msg) {
+ DCHECK(msg);
+ if (!msg) {
+ LOG4CXX_ERROR(logger_, "Null pointer message was received.");
+ return false;
+ }
+
+ Json::Value value;
+ Json::Reader reader;
+ reader.parse(msg->json_message(), value);
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI ==
+ msg->protocol_version()) {
+ std::string msg_method;
+ // Request or notification from HMI
+ if (value.isMember("method") && value["method"].isString()) {
+ msg_method = value["method"].asCString();
+ // Response from HMI
+ } else if (value.isMember("result") && value["result"].isMember("method") &&
+ value["result"]["method"].isString()) {
+ msg_method = value["result"]["method"].asCString();
+ // Error response from HMI
+ } else if (value.isMember("error") && value["error"].isMember("data") &&
+ value["error"]["data"].isMember("method") &&
+ value["error"]["data"]["method"].isString()) {
+ msg_method = value["error"]["data"]["method"].asCString();
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Message with HMI protocol version can not be handled by "
+ "plugin manager, because required 'method' field was not "
+ "found, or was containing an invalid string.");
+ return false;
+ }
+
+ return (hmi_subscribers_.find(msg_method) != hmi_subscribers_.end());
+ }
+
+ return false;
+}
+
+ProcessResult PluginManager::ProcessMessage(
+ application_manager::MessagePtr msg) {
+ DCHECK(msg);
+ if (!msg) {
+ LOG4CXX_ERROR(logger_, "Null pointer message was received.");
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ protocol_handler::MajorProtocolVersion version = msg->protocol_version();
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN ==
+ version ||
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI == version) {
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ ProcessResult result = ProcessResult::CANNOT_PROCESS;
+ PluginFunctionsIterator subscribed_plugin_itr =
+ mobile_subscribers_.find(static_cast<RCFunctionID>(msg->function_id()));
+ if (mobile_subscribers_.end() != subscribed_plugin_itr) {
+ result = subscribed_plugin_itr->second->ProcessMessage(msg);
+ if (ProcessResult::PROCESSED != result) {
+ LOG4CXX_ERROR(logger_, "Plugin failed to process message.");
+ }
+ }
+
+ return result;
+}
+
+ProcessResult PluginManager::ProcessHMIMessage(
+ application_manager::MessagePtr msg) {
+ DCHECK_OR_RETURN(msg, ProcessResult::CANNOT_PROCESS);
+
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI !=
+ msg->protocol_version()) {
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ const std::string& msg_method = ExtractMethodName(msg);
+ if (msg_method.empty()) {
+ LOG4CXX_WARN(logger_,
+ "Message with HMI protocol version can not be handled by "
+ "plugin manager, because required 'method' field was not "
+ "found, or was containing an invalid string.");
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Parsed method name is " << msg_method);
+
+ ProcessResult result = ProcessResult::CANNOT_PROCESS;
+ PluginHMIFunctionsIterator subscribed_plugin_itr =
+ hmi_subscribers_.find(msg_method);
+ if (hmi_subscribers_.end() != subscribed_plugin_itr) {
+ result = subscribed_plugin_itr->second->ProcessHMIMessage(msg);
+ }
+
+ return result;
+}
+
+void PluginManager::OnServiceStateChanged(ServiceState state) {
+ for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
+ it->second->OnServiceStateChanged(state);
+ }
+}
+
+void PluginManager::OnError(ModuleObserver::Errors error, ModuleID module_id) {
+ std::string error_string;
+ switch (error) {
+ case ModuleObserver::Errors::OUT_OF_MEMORY:
+ error_string = "Module run out of memory.";
+ break;
+ case ModuleObserver::Errors::FS_FAILURE:
+ error_string = "Plugin failed to run file system operation.";
+ break;
+ default: {
+ LOG4CXX_ERROR(logger_,
+ "Error " << error_string << " was received from module "
+ << module_id);
+ } break;
+ }
+}
+
+void PluginManager::RemoveAppExtension(uint32_t app_id) {
+ for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
+ it->second->RemoveAppExtension(app_id);
+ }
+}
+
+bool PluginManager::IsAppForPlugins(
+ application_manager::ApplicationSharedPtr app) {
+ DCHECK(app);
+ if (!app) {
+ return false;
+ }
+
+ bool res = false;
+ for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
+ res = res || it->second->IsAppForPlugin(app);
+ }
+ return res;
+}
+
+bool PluginManager::IsAppForPlugin(
+ application_manager::ApplicationSharedPtr app, ModuleID module_id) const {
+ DCHECK_OR_RETURN(app, false);
+ Modules::const_iterator i = plugins_.find(module_id);
+ return i != plugins_.end() ? i->second->IsAppForPlugin(app) : false;
+}
+
+void PluginManager::OnAppHMILevelChanged(
+ application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType old_level) {
+ DCHECK_OR_RETURN_VOID(app);
+ for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
+ if (it->second->IsAppForPlugin(app)) {
+ LOG4CXX_DEBUG(logger_,
+ "Application " << app->name().AsMBString() << " of plugin "
+ << it->second->GetModuleID()
+ << " has changed level from " << old_level
+ << " to " << app->hmi_level());
+ it->second->OnAppHMILevelChanged(app, old_level);
+ }
+ }
+}
+
+typedef std::map<ModuleID, ModulePtr>::value_type PluginsValueType;
+
+struct HandleApplicationEvent {
+ private:
+ const functional_modules::ApplicationEvent event_;
+ application_manager::ApplicationSharedPtr application_;
+
+ public:
+ HandleApplicationEvent(functional_modules::ApplicationEvent e,
+ application_manager::ApplicationSharedPtr application)
+ : event_(e), application_(application) {}
+ void operator()(PluginsValueType& p) {
+ p.second->OnApplicationEvent(event_, application_);
+ }
+};
+
+struct HandlePolicyEvent {
+ private:
+ const functional_modules::PolicyEvent event_;
+
+ public:
+ HandlePolicyEvent(functional_modules::PolicyEvent e) : event_(e) {}
+ void operator()(PluginsValueType& p) {
+ p.second->OnPolicyEvent(event_);
+ }
+};
+
+void PluginManager::OnApplicationEvent(
+ functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (application) {
+ std::for_each(plugins_.begin(),
+ plugins_.end(),
+ HandleApplicationEvent(event, application));
+ }
+}
+
+void PluginManager::OnPolicyEvent(PolicyEvent event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::for_each(plugins_.begin(), plugins_.end(), HandlePolicyEvent(event));
+}
+
+PluginManager::Modules& PluginManager::plugins() {
+ return plugins_;
+}
+
+} // namespace functional_modules
diff --git a/src/components/functional_module/src/timer/timer_director.cc b/src/components/functional_module/src/timer/timer_director.cc
new file mode 100644
index 0000000000..81ce117851
--- /dev/null
+++ b/src/components/functional_module/src/timer/timer_director.cc
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <typeinfo>
+#include "functional_module/timer/timer_director.h"
+#include "remote_control/rc_module_timer.h"
+#include "utils/logger.h"
+
+namespace functional_modules {
+
+template <class T>
+TimerThreadDelegate<T>::TimerThreadDelegate(ModuleTimer<T>& timer)
+ : timer_(timer), keep_running_(false) {}
+
+template <class T>
+void TimerThreadDelegate<T>::threadMain() {
+ if (keep_running_) {
+ this->exitThreadMain();
+ }
+ {
+ sync_primitives::AutoLock run_lock(keep_running_lock_);
+ keep_running_ = true;
+ }
+ sync_primitives::AutoLock run_lock(keep_running_lock_);
+ while (keep_running_) {
+ const TimeUnit msecs_to_wait = timer_.GetSecondsToNearestTimeout() * 1000;
+ sync_primitives::ConditionalVariable::WaitStatus wait_status =
+ keep_running_cond_.WaitFor(run_lock, msecs_to_wait);
+ if (sync_primitives::ConditionalVariable::kTimeout == wait_status &&
+ keep_running_) {
+ timer_.CheckTimeout();
+ }
+ }
+}
+
+template <class T>
+void TimerThreadDelegate<T>::exitThreadMain() {
+ if (keep_running_) {
+ sync_primitives::AutoLock run_lock(keep_running_lock_);
+ keep_running_ = false;
+ keep_running_cond_.NotifyOne();
+ }
+}
+
+template <class T>
+void TimerThreadDelegate<T>::ResetTimer() {
+ if (keep_running_) {
+ sync_primitives::AutoLock run_lock(keep_running_lock_);
+ keep_running_cond_.NotifyOne();
+ }
+}
+
+TimerDirector::TimerDirector() {}
+
+TimerDirector::~TimerDirector() {
+ UnregisterAllTimers();
+}
+
+template <class T>
+void TimerDirector::RegisterTimer(ModuleTimer<T>& timer) {
+ std::string type_name = typeid(timer).name();
+ std::map<std::string, threads::Thread*>::iterator it =
+ timer_threads_.find(type_name);
+ if (timer_threads_.end() != it) {
+ // Attempt to register timer of already existing type fail.
+ return;
+ }
+ TimerThreadDelegate<T>* delegate = new TimerThreadDelegate<T>(timer);
+ threads::Thread* thread = threads::CreateThread(type_name.c_str(), delegate);
+
+ const size_t kStackSize = 16384;
+ if (thread->start(threads::ThreadOptions(kStackSize))) {
+ timer_threads_.insert(std::make_pair(type_name, thread));
+ } else {
+ // Failed to start timer thread for
+ }
+}
+
+template void TimerDirector::RegisterTimer<remote_control::TrackableMessage>(
+ ModuleTimer<remote_control::TrackableMessage>& timer);
+
+template <class T>
+void TimerDirector::UnregisterTimer(const ModuleTimer<T>& timer) {
+ std::string type_name = typeid(timer).name();
+ std::map<std::string, threads::Thread*>::iterator it =
+ timer_threads_.find(type_name);
+ if (timer_threads_.end() == it) {
+ /// Failed to unregister timer that was not registered
+ return;
+ }
+ threads::ThreadDelegate* delegate = it->second->delegate();
+ DeleteThread(it->second);
+ delete delegate;
+ timer_threads_.erase(it);
+}
+
+template void TimerDirector::UnregisterTimer<remote_control::TrackableMessage>(
+ const ModuleTimer<remote_control::TrackableMessage>& timer);
+
+template <class T>
+void TimerDirector::ResetTimer(ModuleTimer<T>& timer) {
+ const std::string type_name = typeid(timer).name();
+ std::map<std::string, threads::Thread*>::iterator it =
+ timer_threads_.find(type_name);
+ if (timer_threads_.end() == it) {
+ return;
+ }
+ TimerThreadDelegate<T>* delegate =
+ static_cast<TimerThreadDelegate<T>*>(it->second->delegate());
+ delegate->ResetTimer();
+}
+
+template void TimerDirector::ResetTimer<remote_control::TrackableMessage>(
+ ModuleTimer<remote_control::TrackableMessage>& timer);
+
+void TimerDirector::UnregisterAllTimers() {
+ for (std::map<std::string, threads::Thread*>::iterator it =
+ timer_threads_.begin();
+ timer_threads_.end() != it;
+ ++it) {
+ threads::ThreadDelegate* delegate = it->second->delegate();
+ DeleteThread(it->second);
+ delete delegate;
+ }
+ timer_threads_.clear();
+}
+
+} // namespace functional_modules
diff --git a/src/components/functional_module/test/CMakeLists.txt b/src/components/functional_module/test/CMakeLists.txt
new file mode 100644
index 0000000000..c4e966c84e
--- /dev/null
+++ b/src/components/functional_module/test/CMakeLists.txt
@@ -0,0 +1,53 @@
+include_directories (
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/
+ ${CMAKE_SOURCE_DIR}/src/components/include/
+ ${CMAKE_SOURCE_DIR}/src/components/application_manager/include
+ ${CMAKE_SOURCE_DIR}/src/components/connection_handler/include
+ ${CMAKE_SOURCE_DIR}/src/components/utils/include
+ ${CMAKE_SOURCE_DIR}/src/components/policy/include
+ ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+ include
+ plugins
+)
+
+set (LIBRARIES
+ gtest
+ gmock
+ gmock_main
+ FunctionalModule
+ dl
+ ApplicationManager
+ jsoncpp
+ Utils
+ ConfigProfile
+ gcov
+)
+
+set(SOURCES
+ ./src/generic_module_test.cc
+ ./src/plugin_manager_test.cc
+ ./src/module_timer_test.cc
+)
+
+# use, i.e. don't skip the full RPATH for the build tree
+SET(CMAKE_SKIP_BUILD_RPATH FALSE)
+
+# when building, don't use the install RPATH already
+# (but later on when installing)
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+
+SET(RPATH_DIRECTORIES
+ /usr/local/lib
+ /usr/local
+ ${CMAKE_BINARY_DIR}/src/components/utils
+)
+
+SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}")
+
+add_subdirectory(plugins)
+
+create_test("function_module_test" "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/functional_module/test/include/driver_generic_module_test.h b/src/components/functional_module/test/include/driver_generic_module_test.h
new file mode 100644
index 0000000000..23751f51c2
--- /dev/null
+++ b/src/components/functional_module/test/include/driver_generic_module_test.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_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_
+
+#include "functional_module/generic_module.h"
+
+namespace functional_modules {
+
+class DriverGenericModuleTest : public GenericModule {
+ public:
+ explicit DriverGenericModuleTest(ModuleID module_id)
+ : GenericModule(module_id) {}
+ virtual ~DriverGenericModuleTest() {}
+ virtual PluginInfo GetPluginInfo() const {
+ PluginInfo info;
+ info.name = "DriverGenericModuleTest";
+ info.version = 1;
+ return info;
+ }
+ virtual ProcessResult ProcessMessage(application_manager::MessagePtr msg) {
+ NotifyObservers(ModuleObserver::FS_FAILURE);
+ return ProcessResult::FAILED;
+ }
+ virtual ProcessResult ProcessHMIMessage(application_manager::MessagePtr msg) {
+ return ProcessResult::PROCESSED;
+ }
+ virtual void RemoveAppExtension(uint32_t app_id) {}
+ virtual void RemoveAppExtensions() {}
+ bool IsAppForPlugin(application_manager::ApplicationSharedPtr app) {
+ return true;
+ }
+
+ void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr,
+ mobile_apis::HMILevel::eType) {}
+
+ const Observers& observers() {
+ return observers_;
+ }
+
+ void OnApplicationEvent(functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr app) {}
+
+ void OnPolicyEvent(functional_modules::PolicyEvent event) {}
+
+ void OnUnregisterApplication(const uint32_t app_id) {}
+};
+
+} // namespace functional_modules
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_
diff --git a/src/components/functional_module/test/include/mock_application.h b/src/components/functional_module/test/include/mock_application.h
new file mode 100644
index 0000000000..95bd4a0505
--- /dev/null
+++ b/src/components/functional_module/test/include/mock_application.h
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/application.h"
+#include "application_manager/usage_statistics.h"
+#include "smart_objects/smart_object.h"
+
+namespace application_manager {
+
+class MockApplication : public Application {
+ public:
+ MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(curHash, const std::string&());
+ MOCK_METHOD0(UpdateHash, void());
+ MOCK_METHOD0(CloseActiveMessage, void());
+ MOCK_CONST_METHOD0(IsFullscreen, bool());
+ MOCK_METHOD0(MakeFullscreen, bool());
+ MOCK_CONST_METHOD0(IsAudible, bool());
+ MOCK_METHOD0(MakeNotAudible, void());
+ MOCK_CONST_METHOD0(allowed_support_navigation, bool());
+ MOCK_METHOD1(set_allowed_support_navigation, void(bool allow));
+ MOCK_CONST_METHOD0(hmi_supports_navi_streaming, bool());
+ MOCK_METHOD1(set_hmi_supports_navi_streaming, void(const bool& supports));
+ MOCK_CONST_METHOD0(app_allowed, bool());
+ MOCK_CONST_METHOD0(has_been_activated, bool());
+ MOCK_CONST_METHOD0(version, const Version&());
+ MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id));
+ MOCK_CONST_METHOD0(hmi_app_id, uint32_t());
+ MOCK_CONST_METHOD0(app_id, uint32_t());
+ MOCK_CONST_METHOD0(name, const std::string&());
+ MOCK_CONST_METHOD0(folder_name, const std::string());
+ MOCK_CONST_METHOD0(is_media_application, bool());
+ MOCK_CONST_METHOD0(hmi_level, const mobile_api::HMILevel::eType&());
+ MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(system_context, const mobile_api::SystemContext::eType&());
+ MOCK_CONST_METHOD0(audio_streaming_state,
+ const mobile_api::AudioStreamingState::eType&());
+ MOCK_CONST_METHOD0(app_icon_path, const std::string&());
+ MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
+ MOCK_METHOD1(set_tts_speak_state, void(bool state_tts_speak));
+ MOCK_METHOD0(tts_speak_state, bool());
+ MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
+ MOCK_METHOD0(tts_properties_in_none, bool());
+ MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
+ MOCK_METHOD0(tts_properties_in_full, bool());
+ MOCK_METHOD1(set_version, void(const Version& version));
+ MOCK_METHOD1(set_name, void(const std::string& name));
+ MOCK_METHOD1(set_is_media_application, void(bool is_media));
+ MOCK_METHOD1(set_hmi_level,
+ void(const mobile_api::HMILevel::eType& hmi_level));
+ MOCK_METHOD0(increment_put_file_in_none_count, void());
+ MOCK_METHOD0(increment_delete_file_in_none_count, void());
+ MOCK_METHOD0(increment_list_files_in_none_count, void());
+ MOCK_METHOD1(set_system_context,
+ void(const mobile_api::SystemContext::eType& system_context));
+ MOCK_METHOD1(set_audio_streaming_state,
+ void(const mobile_api::AudioStreamingState::eType& state));
+ MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
+ MOCK_METHOD1(set_app_allowed, void(const bool& allowed));
+ MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
+ MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
+ MOCK_METHOD1(set_grammar_id, void(uint32_t value));
+ MOCK_METHOD1(set_protocol_version,
+ void(const ProtocolVersion& protocol_version));
+ MOCK_CONST_METHOD0(protocol_version, ProtocolVersion());
+ MOCK_METHOD1(AddFile, bool(AppFile& file));
+ MOCK_CONST_METHOD0(getAppFiles, const AppFilesMap&());
+ MOCK_METHOD1(UpdateFile, bool(AppFile& file));
+ MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
+ MOCK_METHOD1(GetFile, const AppFile*(const std::string& file_name));
+ MOCK_METHOD1(SubscribeToButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(IsSubscribedToButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(UnsubscribeFromButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type_));
+ MOCK_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type_));
+ MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type_));
+ MOCK_METHOD2(IsCommandLimitsExceeded,
+ bool(mobile_apis::FunctionID::eType cmd_id,
+ TLimitSource source));
+ MOCK_METHOD0(usage_report, UsageStatistics&());
+ MOCK_METHOD1(SetInitialState, void(HmiStatePtr state));
+ MOCK_METHOD2(SubscribeToSoftButtons,
+ void(int32_t cmd_id, const SoftButtonID& softbuttons_id));
+ MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
+ MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
+ MOCK_METHOD1(QueryInterface, AppExtensionPtr(AppExtensionUID uid));
+ MOCK_METHOD1(AddExtension, bool(AppExtensionPtr extention));
+ MOCK_METHOD1(RemoveExtension, bool(AppExtensionUID uid));
+ MOCK_METHOD0(RemoveExtensions, void());
+ MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(vr_help, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(tbt_state, const mobile_api::TBTState::eType&());
+ MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(SubscribedButtons,
+ const std::set<mobile_apis::ButtonName::eType>&());
+ MOCK_CONST_METHOD0(SubscribesIVI,
+ const application_manager::VehicleInfoSubscriptions&());
+ MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_help_prompt,
+ void(const smart_objects::SmartObject& help_prompt));
+ MOCK_METHOD1(set_timeout_prompt,
+ void(const smart_objects::SmartObject& timeout_prompt));
+ MOCK_METHOD1(set_vr_help_title,
+ void(const smart_objects::SmartObject& vr_help_title));
+ MOCK_METHOD0(reset_vr_help_title, void());
+ MOCK_METHOD1(set_vr_help, void(const smart_objects::SmartObject& vr_help));
+ MOCK_METHOD0(reset_vr_help, void());
+ MOCK_METHOD1(set_tbt_state,
+ void(const mobile_api::TBTState::eType& tbt_state));
+ MOCK_METHOD1(set_show_command,
+ void(const smart_objects::SmartObject& show_command));
+ MOCK_METHOD1(set_tbt_show_command,
+ void(const smart_objects::SmartObject& tbt_show));
+ MOCK_METHOD1(set_keyboard_props,
+ void(const smart_objects::SmartObject& keyboard_props));
+ MOCK_METHOD1(set_menu_title,
+ void(const smart_objects::SmartObject& menu_title));
+ MOCK_METHOD1(set_menu_icon,
+ void(const smart_objects::SmartObject& menu_icon));
+ MOCK_METHOD2(AddCommand,
+ void(uint32_t cmd_id,
+ const smart_objects::SmartObject& command));
+ MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id));
+ MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id));
+ MOCK_METHOD2(AddSubMenu,
+ void(uint32_t menu_id, const smart_objects::SmartObject& menu));
+ MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id));
+ MOCK_CONST_METHOD1(FindSubMenu,
+ smart_objects::SmartObject*(uint32_t menu_id));
+ MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name));
+ MOCK_METHOD2(AddChoiceSet,
+ void(uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set));
+ MOCK_METHOD1(RemoveChoiceSet, void(uint32_t choice_set_id));
+ MOCK_METHOD1(FindChoiceSet,
+ smart_objects::SmartObject*(uint32_t choice_set_id));
+ MOCK_METHOD2(AddPerformInteractionChoiceSet,
+ void(uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set));
+ MOCK_METHOD0(DeletePerformInteractionChoiceSetMap, void());
+ MOCK_CONST_METHOD0(performinteraction_choice_set_map,
+ DataAccessor<PerformChoiceSetMap>());
+ MOCK_CONST_METHOD1(FindPerformInteractionChoiceSet,
+ smart_objects::SmartObject*(uint32_t choice_set_id));
+ MOCK_CONST_METHOD0(commands_map, DataAccessor<CommandsMap>());
+ MOCK_CONST_METHOD0(sub_menu_map, DataAccessor<SubMenuMap>());
+ MOCK_CONST_METHOD0(choice_set_map, DataAccessor<ChoiceSetMap>());
+ MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active));
+ MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t());
+ MOCK_METHOD1(set_perform_interaction_ui_corrid, void(uint32_t choice));
+ MOCK_CONST_METHOD0(perform_interaction_ui_corrid, uint32_t());
+ MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode));
+ MOCK_CONST_METHOD0(perform_interaction_mode, int32_t());
+ MOCK_METHOD1(set_reset_global_properties_active, void(bool active));
+ MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
+ MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(mobile_app_id, std::string());
+ MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(ngn_media_screen_name,
+ const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(language, const mobile_api::Language::eType&());
+ MOCK_CONST_METHOD0(ui_language, const mobile_api::Language::eType&());
+ MOCK_METHOD1(set_app_types,
+ void(const smart_objects::SmartObject& app_types));
+ MOCK_METHOD1(set_vr_synonyms,
+ void(const smart_objects::SmartObject& vr_synonyms));
+ MOCK_METHOD1(set_mobile_app_id,
+ void(const smart_objects::SmartObject& mobile_app_id));
+ MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name));
+ MOCK_METHOD1(set_ngn_media_screen_name,
+ void(const smart_objects::SmartObject& ngn_name));
+ MOCK_METHOD1(set_language, void(const mobile_api::Language::eType& language));
+ MOCK_METHOD1(set_ui_language,
+ void(const mobile_api::Language::eType& ui_language));
+ MOCK_METHOD1(load_global_properties,
+ void(const smart_objects::SmartObject& so));
+ MOCK_METHOD1(set_mobile_app_id, void(const std::string& mobile_app_id));
+ MOCK_METHOD0(ChangeSupportingAppHMIType, void());
+ MOCK_CONST_METHOD0(is_navi, bool());
+ MOCK_METHOD1(set_is_navi, void(bool allow));
+ MOCK_CONST_METHOD0(hmi_supports_navi_video_streaming, bool());
+ MOCK_METHOD1(set_hmi_supports_navi_video_streaming, void(bool supports));
+ MOCK_CONST_METHOD0(hmi_supports_navi_audio_streaming, bool());
+ MOCK_METHOD1(set_hmi_supports_navi_audio_streaming, void(bool supports));
+ MOCK_CONST_METHOD0(is_voice_communication_supported, bool());
+ MOCK_METHOD1(set_voice_communication_supported, void(bool));
+ MOCK_METHOD1(set_activated, bool(bool is_active));
+ MOCK_CONST_METHOD0(is_foreground, bool());
+ MOCK_METHOD1(set_foreground, void(bool is_foreground));
+ MOCK_CONST_METHOD0(IsAudioApplication, bool());
+ MOCK_CONST_METHOD0(video_stream_retry_active, bool());
+ MOCK_METHOD1(set_video_stream_retry_active, void(bool active));
+ MOCK_CONST_METHOD0(audio_stream_retry_active, bool());
+ MOCK_METHOD1(set_audio_stream_retry_active, void(bool active));
+ MOCK_METHOD0(OnVideoStreamRetry, void());
+ MOCK_METHOD0(OnAudioStreamRetry, void());
+ MOCK_METHOD1(SubscribeToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(IsSubscribedToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(UnsubscribeFromInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_
diff --git a/src/components/functional_module/test/include/mock_module_observer.h b/src/components/functional_module/test/include/mock_module_observer.h
new file mode 100644
index 0000000000..bfa5117b29
--- /dev/null
+++ b/src/components/functional_module/test/include/mock_module_observer.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_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_
+
+#include "gmock/gmock.h"
+#include "functional_module/module_observer.h"
+
+namespace functional_modules {
+
+class MockModuleObserver : public ModuleObserver {
+ public:
+ MOCK_METHOD2(OnError, void(Errors error, ModuleID module_id));
+ int ObserverMethod() {
+ return 13;
+ }
+};
+
+} // namespace functional_modules
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_
diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h
new file mode 100644
index 0000000000..d1fa7f2747
--- /dev/null
+++ b/src/components/functional_module/test/include/mock_service.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_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_
+
+#include "gmock/gmock.h"
+#include "application_manager/service.h"
+
+namespace application_manager {
+
+class MockService : public Service {
+ public:
+ MOCK_METHOD1(CheckPolicyPermissions,
+ mobile_apis::Result::eType(MessagePtr msg));
+ MOCK_METHOD1(GetApplication, ApplicationSharedPtr(ApplicationId app_id));
+ MOCK_METHOD1(SendMessageToHMI, void(const MessagePtr& message));
+ MOCK_METHOD1(SendMessageToMobile, void(const MessagePtr& message));
+ MOCK_METHOD0(GetNextCorrelationID, uint32_t());
+ MOCK_METHOD1(GetApplications,
+ std::vector<ApplicationSharedPtr>(AppExtensionUID));
+ MOCK_METHOD2(ChangeNotifyHMILevel,
+ void(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level));
+ MOCK_METHOD2(NotifyHMIAboutHMILevel,
+ void(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level));
+ MOCK_CONST_METHOD0(GetRCCapabilities, const smart_objects::SmartObject*());
+ MOCK_METHOD2(CheckModule,
+ bool(const ApplicationId& app_id, const std::string& module));
+ MOCK_METHOD1(RemoveHMIFakeParameters,
+ void(application_manager::MessagePtr& message));
+ MOCK_CONST_METHOD1(IsRemoteControlApplication,
+ bool(ApplicationSharedPtr app));
+ MOCK_CONST_METHOD1(IsInterfaceAvailable,
+ bool(const HmiInterfaces::InterfaceID interface));
+ MOCK_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& application_id,
+ std::vector<std::string>* modules));
+ MOCK_METHOD1(ValidateMessageBySchema,
+ application_manager::MessageValidationResult(
+ const application_manager::Message& message));
+ MOCK_CONST_METHOD0(GetSettings, const ApplicationManagerSettings&());
+};
+}
+// namespace application_manager
+
+#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_
diff --git a/src/components/functional_module/test/include/module_timer_test.h b/src/components/functional_module/test/include/module_timer_test.h
new file mode 100644
index 0000000000..456346b544
--- /dev/null
+++ b/src/components/functional_module/test/include/module_timer_test.h
@@ -0,0 +1,56 @@
+#include "utils/macro.h"
+#include "functional_module/timer/module_timer.h"
+
+namespace functional_modules {
+
+class TestTrackable : public Trackable {
+ public:
+ explicit TestTrackable(TimeUnit interval = 0)
+ : Trackable(), custom_interval_(interval) {}
+
+ virtual TimeUnit custom_interval() const {
+ return custom_interval_;
+ }
+
+ bool operator==(const TestTrackable& other) const {
+ return custom_interval_ == other.custom_interval_;
+ }
+
+ private:
+ TimeUnit custom_interval_;
+};
+
+class ModuleTimerTest {
+ public:
+ ModuleTimerTest(ModuleTimer<TestTrackable>& timer) : timer_(timer) {}
+
+ TimeUnit period() const {
+ return timer_.period_;
+ }
+
+ int observers_size() const {
+ return timer_.observers_.size();
+ }
+
+ int trackables_size() const {
+ return timer_.trackables_.size();
+ }
+
+ TestTrackable trackable(const TestTrackable& track) const {
+ return *std::find(
+ timer_.trackables_.begin(), timer_.trackables_.end(), track);
+ }
+
+ TimeUnit current_time() const {
+ return timer_.CurrentTime();
+ }
+
+ private:
+ ModuleTimer<TestTrackable>& timer_;
+};
+
+class MockTimerObserver : public TimerObserver<TestTrackable> {
+ public:
+ MOCK_METHOD1(OnTimeoutTriggered, void(const TestTrackable& expired));
+};
+} // namespace functional_modules
diff --git a/src/components/functional_module/test/plugins/CMakeLists.txt b/src/components/functional_module/test/plugins/CMakeLists.txt
new file mode 100644
index 0000000000..7afe8387b8
--- /dev/null
+++ b/src/components/functional_module/test/plugins/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(target PluginMock)
+
+include_directories (
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/
+ ${CMAKE_SOURCE_DIR}/src/components/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+)
+
+set(SOURCES
+ ./mock_generic_module.cc
+)
+
+add_library(${target} SHARED ${SOURCES})
+target_link_libraries(${target})
+add_dependencies(${target} MOBILE_API HMI_API)
diff --git a/src/components/functional_module/test/plugins/mock_generic_module.cc b/src/components/functional_module/test/plugins/mock_generic_module.cc
new file mode 100644
index 0000000000..dcf6d7d4fe
--- /dev/null
+++ b/src/components/functional_module/test/plugins/mock_generic_module.cc
@@ -0,0 +1,23 @@
+#include "mock_generic_module.h"
+
+using functional_modules::GenericModule;
+using functional_modules::RCFunctionID;
+using functional_modules::PluginInfo;
+
+using ::testing::_;
+using ::testing::Return;
+
+MockGenericModule::MockGenericModule() : GenericModule(19) {
+ PluginInfo info;
+ info.name = "MockGenericModule";
+ info.version = 1;
+ info.rc_function_list.push_back(static_cast<RCFunctionID>(101));
+ info.hmi_function_list.push_back("HMI-Func-1");
+
+ EXPECT_CALL(*this, GetPluginInfo()).Times(2).WillRepeatedly(Return(info));
+ EXPECT_CALL(*this, set_service(_)).Times(1);
+}
+
+extern "C" GenericModule* Create() {
+ return new MockGenericModule();
+}
diff --git a/src/components/functional_module/test/plugins/mock_generic_module.h b/src/components/functional_module/test/plugins/mock_generic_module.h
new file mode 100644
index 0000000000..faea0f135d
--- /dev/null
+++ b/src/components/functional_module/test/plugins/mock_generic_module.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_
+#define TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_
+
+#include "gmock/gmock.h"
+#include "functional_module/generic_module.h"
+
+using functional_modules::GenericModule;
+using functional_modules::PluginInfo;
+using functional_modules::ProcessResult;
+using functional_modules::ServiceState;
+
+using ::testing::_;
+using ::testing::Return;
+
+class MockGenericModule : public GenericModule {
+ public:
+ MockGenericModule();
+ MOCK_CONST_METHOD0(GetPluginInfo, PluginInfo());
+ MOCK_METHOD1(set_service, void(application_manager::ServicePtr service));
+ MOCK_METHOD0(service, application_manager::ServicePtr());
+ MOCK_METHOD1(ProcessMessage,
+ ProcessResult(application_manager::MessagePtr msg));
+ MOCK_METHOD1(ProcessHMIMessage,
+ ProcessResult(application_manager::MessagePtr msg));
+ MOCK_METHOD1(OnServiceStateChanged, void(ServiceState state));
+ MOCK_METHOD1(RemoveAppExtension, void(uint32_t app_id));
+ MOCK_METHOD1(IsAppForPlugin,
+ bool(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD2(OnAppHMILevelChanged,
+ void(application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType old_level));
+ MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
+ MOCK_METHOD0(RemoveAppExtensions, void());
+};
+
+#endif // TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_
diff --git a/src/components/functional_module/test/src/generic_module_test.cc b/src/components/functional_module/test/src/generic_module_test.cc
new file mode 100644
index 0000000000..71d8325f6d
--- /dev/null
+++ b/src/components/functional_module/test/src/generic_module_test.cc
@@ -0,0 +1,106 @@
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+
+#include "driver_generic_module_test.h"
+
+#include "mock_module_observer.h"
+#include "mock_service.h"
+
+using application_manager::ServicePtr;
+using application_manager::MockService;
+
+using ::testing::_;
+
+namespace functional_modules {
+
+TEST(GenericModuleTest, SetService) {
+ DriverGenericModuleTest module(18);
+ MockService* mock_service = new MockService();
+ ServicePtr exp_service(mock_service);
+
+ module.set_service(exp_service);
+ ServicePtr out_service = module.service();
+
+ EXPECT_EQ(exp_service.get(), out_service.get());
+}
+
+TEST(GenericModuleTest, RemoveObserver) {
+ DriverGenericModuleTest module(18);
+ MockModuleObserver* observer = new MockModuleObserver();
+ module.AddObserver(observer);
+
+ module.RemoveObserver(observer);
+ const DriverGenericModuleTest::Observers& empty = module.observers();
+ ASSERT_TRUE(empty.empty());
+ delete observer;
+}
+
+TEST(GenericModuleTest, EmptyRemoveObserver) {
+ DriverGenericModuleTest module(18);
+ MockModuleObserver* observer = new MockModuleObserver();
+ module.RemoveObserver(observer);
+ const DriverGenericModuleTest::Observers& empty = module.observers();
+ ASSERT_TRUE(empty.empty());
+ delete observer;
+}
+
+TEST(GenericModuleTest, WrongRemoveObserver) {
+ DriverGenericModuleTest module(18);
+ MockModuleObserver observer;
+ module.AddObserver(&observer);
+
+ MockModuleObserver* wrong_observer = new MockModuleObserver();
+ module.RemoveObserver(wrong_observer);
+ const DriverGenericModuleTest::Observers& empty = module.observers();
+ ASSERT_EQ(1u, empty.size());
+ EXPECT_EQ(&observer, empty[0]);
+ delete wrong_observer;
+}
+
+TEST(GenericModuleTest, CrashRemovedObserver) {
+ DriverGenericModuleTest module(18);
+ MockModuleObserver* observer = new MockModuleObserver();
+ module.AddObserver(observer);
+ EXPECT_EQ(13, observer->ObserverMethod());
+ module.RemoveObserver(observer);
+ EXPECT_EQ(13, observer->ObserverMethod());
+ delete observer;
+ MockModuleObserver second_observer;
+ module.AddObserver(&second_observer);
+ EXPECT_EQ(13, second_observer.ObserverMethod());
+ module.RemoveObserver(&second_observer);
+ EXPECT_EQ(13, second_observer.ObserverMethod());
+}
+
+TEST(GenericModuleTest, NotifyObservers) {
+ DriverGenericModuleTest module(3);
+ MockModuleObserver observer;
+ module.AddObserver(&observer);
+
+ EXPECT_CALL(observer, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
+
+ application_manager::MessagePtr message;
+ module.ProcessMessage(message);
+}
+
+TEST(GenericModuleTest, NotifyObserversComplex) {
+ DriverGenericModuleTest module(3);
+ MockModuleObserver observer_1;
+ module.AddObserver(&observer_1);
+ MockModuleObserver observer_2;
+ module.AddObserver(&observer_2);
+
+ EXPECT_CALL(observer_1, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
+ EXPECT_CALL(observer_2, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
+
+ application_manager::MessagePtr message;
+ module.ProcessMessage(message);
+
+ module.RemoveObserver(&observer_1);
+ EXPECT_CALL(observer_1, OnError(ModuleObserver::FS_FAILURE, 3)).Times(0);
+ EXPECT_CALL(observer_2, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1);
+
+ module.ProcessMessage(message);
+}
+
+} // namespace functional_modules
diff --git a/src/components/functional_module/test/src/module_timer_test.cc b/src/components/functional_module/test/src/module_timer_test.cc
new file mode 100644
index 0000000000..668c3e2955
--- /dev/null
+++ b/src/components/functional_module/test/src/module_timer_test.cc
@@ -0,0 +1,123 @@
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "module_timer_test.h"
+
+namespace functional_modules {
+
+TEST(ModuleTimerTest, set_period) {
+ ModuleTimer<TestTrackable> timer;
+ timer.set_period(10000);
+ ModuleTimerTest test(timer);
+ EXPECT_EQ(10000u, test.period());
+}
+
+TEST(ModuleTimerTest, add_observer) {
+ ModuleTimer<TestTrackable> timer;
+ ModuleTimerTest test(timer);
+ for (size_t i = 0; i < 5; ++i) {
+ MockTimerObserver observer;
+ timer.AddObserver(&observer);
+ }
+ EXPECT_EQ(5, test.observers_size());
+}
+
+TEST(ModuleTimerTest, remove_observer) {
+ ModuleTimer<TestTrackable> timer;
+ ModuleTimerTest test(timer);
+
+ MockTimerObserver observer;
+ timer.AddObserver(&observer);
+ MockTimerObserver observer2;
+ timer.AddObserver(&observer2);
+ timer.RemoveObserver(&observer);
+ EXPECT_EQ(1, test.observers_size());
+ MockTimerObserver observer3;
+ timer.RemoveObserver(&observer3);
+ EXPECT_EQ(1, test.observers_size());
+ timer.RemoveObserver(&observer2);
+ EXPECT_EQ(0, test.observers_size());
+}
+
+TEST(ModuleTimerTest, start) {
+ ModuleTimer<TestTrackable> timer;
+ ModuleTimerTest test(timer);
+ timer.set_period(1);
+ MockTimerObserver observer;
+ timer.AddObserver(&observer);
+ TestTrackable track;
+ timer.AddTrackable(track);
+ sleep(2);
+ EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(1);
+ timer.CheckTimeout();
+ EXPECT_EQ(0, test.trackables_size());
+ timer.set_period(4);
+ timer.AddTrackable(track);
+ sleep(2);
+ EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(0);
+ timer.CheckTimeout();
+ EXPECT_EQ(1, test.trackables_size());
+ TestTrackable track2(1);
+ timer.AddTrackable(track2);
+ timer.AddTrackable(track);
+ sleep(2);
+ EXPECT_CALL(observer, OnTimeoutTriggered(track2)).Times(1);
+ EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(0);
+ timer.CheckTimeout();
+ EXPECT_EQ(1, test.trackables_size());
+}
+
+TEST(ModuleTimerTest, add_trackable) {
+ ModuleTimer<TestTrackable> timer;
+ ModuleTimerTest test(timer);
+ timer.AddTrackable(TestTrackable());
+ ASSERT_EQ(1, test.trackables_size());
+ // adding the same object twice
+ timer.AddTrackable(TestTrackable());
+ EXPECT_EQ(1, test.trackables_size());
+ // adding another object
+ TestTrackable track(3);
+ timer.AddTrackable(track);
+ ASSERT_EQ(2, test.trackables_size());
+ EXPECT_TRUE(test.trackable(track).start_time() - test.current_time() < 1);
+ timer.AddTrackable(track);
+ sleep(3);
+ EXPECT_TRUE(test.current_time() - test.trackable(track).start_time() < 4 &&
+ test.current_time() - test.trackable(track).start_time() > 2);
+}
+
+TEST(ModuleTimerTest, remove_trackable) {
+ ModuleTimer<TestTrackable> timer;
+ ModuleTimerTest test(timer);
+ EXPECT_EQ(0, test.trackables_size());
+ TestTrackable track1;
+ TestTrackable track2(1);
+ timer.AddTrackable(track1);
+ timer.AddTrackable(track2);
+ EXPECT_EQ(2, test.trackables_size());
+ timer.RemoveTrackable(track2);
+ ASSERT_EQ(1, test.trackables_size());
+ TestTrackable track3(2);
+ timer.RemoveTrackable(track3);
+ ASSERT_EQ(1, test.trackables_size());
+ timer.RemoveTrackable(track1);
+ ASSERT_EQ(0, test.trackables_size());
+}
+
+TEST(ModuleTimerTest, notify) {
+ ModuleTimer<TestTrackable> timer;
+ ModuleTimerTest test(timer);
+ timer.set_period(1);
+ MockTimerObserver observer;
+ timer.AddObserver(&observer);
+ TestTrackable track;
+ timer.AddTrackable(track);
+ TestTrackable track2(2);
+ timer.AddTrackable(track2);
+ sleep(2);
+ EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(1);
+ EXPECT_CALL(observer, OnTimeoutTriggered(track2)).Times(0);
+ timer.CheckTimeout();
+ EXPECT_EQ(1, test.trackables_size());
+}
+
+} // namespace functional_modules
diff --git a/src/components/functional_module/test/src/plugin_manager_test.cc b/src/components/functional_module/test/src/plugin_manager_test.cc
new file mode 100644
index 0000000000..f99b8b798e
--- /dev/null
+++ b/src/components/functional_module/test/src/plugin_manager_test.cc
@@ -0,0 +1,148 @@
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
+#include "functional_module/plugin_manager.h"
+#include "mock_generic_module.h"
+#include "mock_service.h"
+#include "application_manager/mock_application.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+using application_manager::Message;
+using protocol_handler::MajorProtocolVersion;
+using application_manager::MockService;
+using test::components::application_manager_test::MockApplication;
+using ::testing::NiceMock;
+using ::testing::Expectation;
+using ::testing::ReturnRef;
+
+namespace functional_modules {
+
+class PluginManagerTest : public ::testing::Test {
+ public:
+ PluginManagerTest()
+ : manager(utils::MakeShared<PluginManager>())
+ , service(utils::MakeShared<MockService>()) {}
+
+ protected:
+ utils::SharedPtr<PluginManager> manager;
+ utils::SharedPtr<MockService> service;
+ MockGenericModule* module;
+
+ void SetUp() OVERRIDE {
+ manager->SetServiceHandler(service);
+
+ ASSERT_EQ(1, manager->LoadPlugins("./plugins/"));
+ const PluginManager::Modules& plugins = manager->plugins();
+ PluginManager::Modules::const_iterator i = plugins.begin();
+ module = static_cast<MockGenericModule*>(i->second.get());
+ }
+};
+
+TEST_F(PluginManagerTest, ChangePluginsState) {
+ ServiceState kState = ServiceState::SUSPENDED;
+ EXPECT_CALL(*module, OnServiceStateChanged(kState));
+ manager->OnServiceStateChanged(kState);
+}
+
+TEST_F(PluginManagerTest, RemoveAppExtension) {
+ const uint32_t kAppId = 2;
+ EXPECT_CALL(*module, RemoveAppExtension(kAppId)).Times(1);
+ manager->RemoveAppExtension(kAppId);
+}
+
+TEST_F(PluginManagerTest, ProcessMessageFail) {
+ Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc));
+ application_manager::MessagePtr message(msg);
+ msg->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN);
+ EXPECT_CALL(*module, ProcessMessage(message)).Times(0);
+ manager->ProcessMessage(message);
+}
+
+TEST_F(PluginManagerTest, ProcessMessagePass) {
+ Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc));
+ application_manager::MessagePtr message(msg);
+ msg->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_3);
+ msg->set_function_id(101); // see MockGenericModule
+ EXPECT_CALL(*module, ProcessMessage(message))
+ .Times(1)
+ .WillOnce(Return(ProcessResult::PROCESSED));
+ manager->ProcessMessage(message);
+}
+
+TEST_F(PluginManagerTest, SDL_events_triggers_module) {
+ using namespace functional_modules;
+ std::vector<ApplicationEvent> app_events;
+ app_events.push_back(ApplicationEvent::kApplicationExit);
+ app_events.push_back(ApplicationEvent::kApplicationUnregistered);
+
+ application_manager::ApplicationSharedPtr dummy_ptr =
+ utils::MakeShared<MockApplication>();
+ std::vector<ApplicationEvent>::const_iterator ev = app_events.begin();
+ for (; app_events.end() != ev; ++ev) {
+ EXPECT_CALL(*module, OnApplicationEvent(*ev, dummy_ptr));
+ manager->OnApplicationEvent(*ev, dummy_ptr);
+ }
+
+ std::vector<PolicyEvent> policy_events;
+ policy_events.push_back(PolicyEvent::kApplicationPolicyUpdated);
+ policy_events.push_back(PolicyEvent::kApplicationsDisabled);
+
+ std::vector<PolicyEvent>::const_iterator ev_policy = policy_events.begin();
+ for (; policy_events.end() != ev_policy; ++ev_policy) {
+ EXPECT_CALL(*module, OnPolicyEvent(*ev_policy));
+ manager->OnPolicyEvent(*ev_policy);
+ }
+}
+
+TEST_F(PluginManagerTest, ProcessHMIMessageFail) {
+ Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc));
+ application_manager::MessagePtr message(msg);
+ message->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN);
+ EXPECT_CALL(*module, ProcessHMIMessage(message)).Times(0);
+ manager->ProcessHMIMessage(message);
+}
+
+TEST_F(PluginManagerTest, ProcessHMIMessagePass) {
+ Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc));
+ application_manager::MessagePtr message(msg);
+ message->set_protocol_version(MajorProtocolVersion::PROTOCOL_VERSION_HMI);
+ std::string json = "{\"method\": \"HMI-Func-1\"}"; // see MockGenericModule
+ message->set_json_message(json);
+ EXPECT_CALL(*module, ProcessHMIMessage(message))
+ .Times(1)
+ .WillOnce(Return(ProcessResult::PROCESSED));
+ manager->ProcessHMIMessage(message);
+}
+
+TEST_F(PluginManagerTest, IsAppForPlugins) {
+ using test::components::application_manager_test::MockApplication;
+ MockApplication* app = new MockApplication();
+ application_manager::ApplicationSharedPtr app_ptr(app);
+ EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).Times(1);
+ manager->IsAppForPlugins(app_ptr);
+}
+
+TEST_F(PluginManagerTest, OnAppHMILevelChanged) {
+ using test::components::application_manager_test::MockApplication;
+ NiceMock<MockApplication>* app = new NiceMock<MockApplication>();
+ application_manager::ApplicationSharedPtr app_ptr(app);
+
+ const application_manager::custom_str::CustomString name("name");
+ ON_CALL(*app, name()).WillByDefault(ReturnRef(name));
+ mobile_apis::HMILevel::eType level = mobile_apis::HMILevel::eType::HMI_NONE;
+ ON_CALL(*app, hmi_level()).WillByDefault(Return(level));
+
+ Expectation is_for_plugin =
+ EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(true));
+ EXPECT_CALL(*module, OnAppHMILevelChanged(app_ptr, _))
+ .Times(1)
+ .After(is_for_plugin);
+ manager->OnAppHMILevelChanged(app_ptr,
+ mobile_apis::HMILevel::eType::HMI_FULL);
+}
+
+} // namespace functional_modules
diff --git a/src/components/hmi_message_handler/CMakeLists.txt b/src/components/hmi_message_handler/CMakeLists.txt
index aa10729458..9fb233b446 100644
--- a/src/components/hmi_message_handler/CMakeLists.txt
+++ b/src/components/hmi_message_handler/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, 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.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
include/
@@ -44,32 +46,46 @@ include_directories (
${COMPONENTS_DIR}/dbus/include/
${CMAKE_SOURCE_DIR}/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/hmi_message_handler/include
+ ${COMPONENTS_DIR}/hmi_message_handler/src
+ ${BOOST_INCLUDE_DIR}
)
-IF (HMIADAPTER STREQUAL "dbus")
- set (DBUS_SOURCE ./src/dbus_message_adapter.cc)
- set (DBUS_ADAPTER DBus)
-ENDIF ()
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+
+if (HMIADAPTER STREQUAL "dbus")
+ set(EXCLUDE_PATHS messagebroker_adapter.cc)
+ set(DBUS_ADAPTER DBus)
+else()
+ set(EXCLUDE_PATHS dbus_message_adapter.cc)
+ set(DBUS_ADAPTER)
+endif ()
-set (SOURCES
- ${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_impl.cc
- ${COMPONENTS_DIR}/hmi_message_handler/src/mqueue_adapter.cc
- ${DBUS_SOURCE}
+list(APPEND EXCLUDE_PATHS
+ mqueue_adapter.cc
)
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+
set(LIBRARIES
- Utils
- ${DBUS_ADAPTER}
- ${RTLIB}
+ Utils
+ ${DBUS_ADAPTER}
+ ${RTLIB}
)
add_library("HMIMessageHandler" ${SOURCES})
+
+if (HMIADAPTER STREQUAL "messagebroker")
+ add_dependencies("HMIMessageHandler" Boost)
+endif()
+
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
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
index 4dc74f71e8..beb7a9ad1d 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/dbus_message_adapter.h
@@ -40,8 +40,6 @@
namespace hmi_message_handler {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
/**
* \brief adapter for DBus
*/
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
deleted file mode 100644
index d2a3a5b907..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
-
-#include "hmi_message_handler/hmi_message_sender.h"
-
-namespace hmi_message_handler {
-/**
- * \class HMIMessageAdapter
- * \brief Interface class describing methods neccessary for exchanging message
- * between ApplicationManager and HMI. Adapter for concrete transport connection
- * SDL with HMI has to implement this interface.
- */
-class HMIMessageAdapter : public HMIMessageSender {
- protected:
- /**
- * \brief Interface for subscriptions.
- * Each class implementing interface should use it according to
- * standarts of transport for which it is to be an adapter.
- * For example, Adapter for MessageBroker will use it to subscribe to
- * notifications
- * from HMI.
- */
- virtual void SubscribeTo() = 0;
-};
-
-} // namespace hmi_message_handler
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
index bd118032d6..f2a5ce2dd8 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h
@@ -51,7 +51,7 @@ class HMIMessageAdapterImpl : public HMIMessageAdapter {
/**
* \brief Destructor
*/
- virtual ~HMIMessageAdapterImpl();
+ ~HMIMessageAdapterImpl();
protected:
virtual HMIMessageHandler* handler() const {
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
deleted file mode 100644
index 217075e89f..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
-
-#include "hmi_message_handler/hmi_message_sender.h"
-#include "hmi_message_handler/hmi_message_observer.h"
-#include "hmi_message_handler/hmi_message_handler_settings.h"
-
-namespace hmi_message_handler {
-
-class HMIMessageAdapter;
-/**
- * \class HMIMessageHandler
- * \brief Abstract class for handling different HMI adapters;
- * establishing interface for message exchange between SDL core and HMI.
- */
-class HMIMessageHandler : public HMIMessageObserver, public HMIMessageSender {
- public:
- virtual ~HMIMessageHandler() {}
- virtual void AddHMIMessageAdapter(HMIMessageAdapter* adapter) = 0;
- virtual void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) = 0;
-
- /**
- * \brief Hmi message handler settings getter
- * \return pointer to hmi message handler settings class
- */
- virtual const HMIMessageHandlerSettings& get_settings() const = 0;
-};
-
-} // namespace hmi_message_handler
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
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 3b829b0f27..0d85c30fc2 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
@@ -89,14 +89,14 @@ class HMIMessageHandlerImpl : public HMIMessageHandler,
explicit HMIMessageHandlerImpl(const HMIMessageHandlerSettings& settings);
~HMIMessageHandlerImpl();
- void OnMessageReceived(MessageSharedPointer message);
- void SendMessageToHMI(MessageSharedPointer message);
+ void OnMessageReceived(MessageSharedPointer message) OVERRIDE;
+ void SendMessageToHMI(MessageSharedPointer message) OVERRIDE;
void set_message_observer(HMIMessageObserver* observer);
- void OnErrorSending(MessageSharedPointer message);
- void AddHMIMessageAdapter(HMIMessageAdapter* adapter);
- void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter);
+ void OnErrorSending(MessageSharedPointer message) OVERRIDE;
+ void AddHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
+ void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
- virtual const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
+ const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
#ifdef BUILD_TESTS
std::set<HMIMessageAdapter*> message_adapters() const {
@@ -106,21 +106,30 @@ class HMIMessageHandlerImpl : public HMIMessageHandler,
HMIMessageObserver* observer() const {
return observer_;
}
+
+ impl::ToHmiQueue* messages_to_hmi() {
+ return &messages_to_hmi_;
+ }
+
+ impl::FromHmiQueue* messages_from_hmi() {
+ return &messages_from_hmi_;
+ }
#endif // BUILD_TESTS
private:
// threads::MessageLoopThread<*>::Handler implementations
// CALLED ON messages_from_hmi_ THREAD!
- virtual void Handle(const impl::MessageFromHmi message) OVERRIDE;
+ void Handle(const impl::MessageFromHmi message) OVERRIDE;
// CALLED ON messages_to_hmi_ THREAD!
- virtual void Handle(const impl::MessageToHmi message) OVERRIDE;
+ void Handle(const impl::MessageToHmi message) OVERRIDE;
private:
const HMIMessageHandlerSettings& settings_;
HMIMessageObserver* observer_;
- mutable sync_primitives::Lock observer_locker_;
std::set<HMIMessageAdapter*> message_adapters_;
+ mutable sync_primitives::Lock observer_locker_;
+ mutable sync_primitives::Lock message_adapters_locker_;
// Construct message threads when everything is already created
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
deleted file mode 100644
index f2f84b13e7..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_observer.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
-
-#include "utils/shared_ptr.h"
-
-namespace application_manager {
-class Message;
-}
-
-namespace hmi_message_handler {
-
-class HMIMessageObserver {
- public:
- virtual void OnMessageReceived(
- utils::SharedPtr<application_manager::Message> message) = 0;
- virtual void OnErrorSending(
- utils::SharedPtr<application_manager::Message> message) = 0;
-};
-}
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
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
deleted file mode 100644
index f00b493aa1..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_sender.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
-
-#include "application_manager/message.h"
-
-namespace hmi_message_handler {
-typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
-
-class HMIMessageSender {
- public:
- virtual void SendMessageToHMI(MessageSharedPointer message) = 0;
-};
-}
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
new file mode 100644
index 0000000000..98d5260259
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/mb_controller.h
@@ -0,0 +1,156 @@
+#ifndef MB_CONTROLLER_H
+#define MB_CONTROLLER_H
+
+#include <iostream>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
+#include <boost/asio/bind_executor.hpp>
+#include <boost/asio/strand.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/thread/thread.hpp>
+#include <algorithm>
+#include <cstdlib>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <string>
+#include <thread>
+#include <vector>
+#include <map>
+#include "json/json.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "utils/atomic_object.h"
+#include "websocket_session.h"
+
+using namespace boost::beast::websocket;
+
+namespace hmi_message_handler {
+
+CREATE_LOGGERPTR_GLOBAL(mb_logger_, "HMIMessageHandler")
+
+enum ErrorCode {
+ CONTROLLER_EXISTS = -32000,
+ SUBSCRIBTION_EXISTS = -32001,
+ INVALID_REQUEST = -32600
+};
+
+class WebsocketSession;
+
+class CMessageBrokerController
+ : public std::enable_shared_from_this<CMessageBrokerController> {
+ public:
+ CMessageBrokerController(const std::string& address,
+ uint16_t port,
+ std::string name,
+ int num_ports);
+
+ ~CMessageBrokerController();
+
+ bool StartListener();
+
+ bool Run();
+
+ void WaitForConnection();
+
+ void StartSession(boost::system::error_code ec);
+
+ void OnAccept(
+ boost::system::error_code ec,
+ boost::asio::strand<boost::asio::io_context::executor_type>& strand,
+ stream<boost::asio::ip::tcp::socket>& ws);
+
+ void OnRead(boost::system::error_code ec, std::size_t bytes_transferred);
+
+ bool isNotification(Json::Value& message);
+
+ void sendNotification(Json::Value& message);
+
+ bool isResponse(Json::Value& message);
+
+ void sendResponse(Json::Value& message);
+
+ void sendJsonMessage(Json::Value& message);
+
+ void subscribeTo(std::string property);
+
+ void registerController(int id = 0);
+
+ void unregisterController();
+
+ void* MethodForReceiverThread(void* arg);
+
+ bool Connect();
+
+ void exitReceivingThread();
+
+ virtual void processResponse(std::string method, Json::Value& root) = 0;
+
+ virtual void processRequest(Json::Value& root) = 0;
+
+ virtual void processNotification(Json::Value& root) = 0;
+
+ std::string getMethodName(std::string& method);
+
+ std::string GetComponentName(std::string& method);
+
+ void processInternalRequest(Json::Value& message,
+ WebsocketSession* ws_session);
+
+ void pushRequest(Json::Value& message, WebsocketSession* ws_session);
+
+ // Registry
+ bool addController(WebsocketSession* ws_session, std::string name);
+
+ void deleteController(WebsocketSession* ws_session);
+
+ void deleteController(std::string name);
+
+ void removeSubscribersBySession(const WebsocketSession* ws);
+
+ bool addSubscriber(WebsocketSession* ws_session, std::string name);
+
+ void deleteSubscriber(WebsocketSession* ws, std::string name);
+
+ int getSubscribersFd(std::string name,
+ std::vector<WebsocketSession*>& result);
+
+ int getNextControllerId();
+
+ private:
+ boost::asio::io_context ioc_;
+ const std::string& address_;
+ uint16_t port_;
+ std::string name_;
+ int num_threads_;
+ std::vector<std::thread> thread_vector_;
+
+ boost::asio::ip::tcp::acceptor acceptor_;
+ boost::asio::ip::tcp::socket socket_;
+ boost::beast::multi_buffer buffer_;
+ boost::asio::ip::tcp::endpoint endpoint_;
+
+ int mControllersIdCounter;
+
+ // Registry
+ std::vector<std::shared_ptr<hmi_message_handler::WebsocketSession> >
+ mConnectionList;
+ sync_primitives::Lock mConnectionListLock;
+
+ std::map<std::string, WebsocketSession*> mControllersList;
+ sync_primitives::Lock mControllersListLock;
+
+ std::multimap<std::string, WebsocketSession*> mSubscribersList;
+ sync_primitives::Lock mSubscribersListLock;
+
+ std::map<std::string, WebsocketSession*> mRequestList;
+ sync_primitives::Lock mRequestListLock;
+
+ std::atomic_bool shutdown_;
+};
+
+} // hmi_message_handler
+
+#endif /* MB_CONTROLLER_H */ \ No newline at end of file
diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
index f582cb2b81..423f331297 100644
--- a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h
@@ -35,15 +35,16 @@
#include <string>
-#include "mb_controller.hpp"
+#include "hmi_message_handler/mb_controller.h"
#include "hmi_message_handler/hmi_message_adapter_impl.h"
#include "utils/threads/thread_validator.h"
namespace hmi_message_handler {
-class MessageBrokerAdapter : public HMIMessageAdapterImpl,
- public NsMessageBroker::CMessageBrokerController,
- public threads::SingleThreadValidator {
+class MessageBrokerAdapter
+ : public HMIMessageAdapterImpl,
+ public hmi_message_handler::CMessageBrokerController,
+ public threads::SingleThreadValidator {
public:
MessageBrokerAdapter(HMIMessageHandler* handler_param,
const std::string& server_address,
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
deleted file mode 100644
index 69634ea00e..0000000000
--- a/src/components/hmi_message_handler/include/hmi_message_handler/mqueue_adapter.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_MQUEUE_ADAPTER_H_
-
-#include <memory>
-#include <mqueue.h>
-#include "utils/threads/thread.h"
-#include "hmi_message_handler/hmi_message_adapter_impl.h"
-
-namespace hmi_message_handler {
-
-class ReceiverThreadDelegate;
-
-/**
- * \brief HMI message adapter for mqueue
- */
-class MqueueAdapter : public HMIMessageAdapterImpl {
- public:
- MqueueAdapter(HMIMessageHandler* hmi_message_handler);
- virtual ~MqueueAdapter();
-
- protected:
- virtual void SendMessageToHMI(MessageSharedPointer message);
- virtual void SubscribeTo();
-
- 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/include/hmi_message_handler/websocket_session.h b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
new file mode 100644
index 0000000000..c084bd7769
--- /dev/null
+++ b/src/components/hmi_message_handler/include/hmi_message_handler/websocket_session.h
@@ -0,0 +1,178 @@
+#ifndef WEBSOCKET_SESSION_H
+#define WEBSOCKET_SESSION_H
+
+#include <iostream>
+#include <boost/beast/core.hpp>
+#include <boost/beast/websocket.hpp>
+#include <boost/asio/bind_executor.hpp>
+#include <boost/asio/strand.hpp>
+#include <boost/asio/placeholders.hpp>
+#include <boost/asio/ip/tcp.hpp>
+#include <boost/make_shared.hpp>
+#include <boost/thread/thread.hpp>
+#include <algorithm>
+#include <cstdlib>
+#include <functional>
+#include <iostream>
+#include <memory>
+#include <string>
+#include <thread>
+#include <vector>
+#include <mutex>
+#include <queue>
+#include "json/json.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+#include "utils/atomic_object.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/message_queue.h"
+
+using namespace boost::beast::websocket;
+using ::utils::MessageQueue;
+
+#ifdef DEBUG_ON
+/**
+* \def DBG_MSG
+* \brief Debug message output with file name and line number.
+* \param x formatted debug message.
+* \return printf construction.
+*/
+#define DBG_MSG(x) \
+ printf("%s:%d ", __FILE__, __LINE__); \
+ printf x
+#else
+#define DBG_MSG(x)
+#endif
+
+#define DBG_MSG_ERROR(x) \
+ printf("ERROR!!! %s:%d ", __FILE__, __LINE__); \
+ printf x
+
+typedef std::queue<std::shared_ptr<std::string> > AsyncQueue;
+typedef std::shared_ptr<std::string> Message;
+
+namespace hmi_message_handler {
+
+CREATE_LOGGERPTR_GLOBAL(ws_logger_, "HMIMessageHandler")
+
+class CMessageBrokerController;
+
+class WebsocketSession : public std::enable_shared_from_this<WebsocketSession> {
+ boost::beast::websocket::stream<boost::asio::ip::tcp::socket> ws_;
+ boost::asio::strand<boost::asio::io_context::executor_type> strand_;
+ boost::beast::multi_buffer buffer_;
+ boost::beast::multi_buffer send_buffer_;
+ CMessageBrokerController* controller_;
+
+ public:
+ WebsocketSession(boost::asio::ip::tcp::socket socket,
+ CMessageBrokerController* controller);
+
+ ~WebsocketSession();
+
+ void Accept();
+
+ void Shutdown();
+
+ bool IsShuttingDown();
+
+ void Recv(boost::system::error_code ec);
+
+ void Send(std::string& message, Json::Value& json_message);
+
+ void SendFromQueue();
+
+ void sendJsonMessage(Json::Value& message);
+
+ void OnWrite(boost::system::error_code ec,
+ std::size_t bytes_transferred,
+ std::shared_ptr<std::string> message);
+
+ void Read(boost::system::error_code ec, std::size_t bytes_transferred);
+
+ int getNextMessageId();
+
+ void prepareMessage(Json::Value& root);
+
+ void prepareErrorMessage(int errCode,
+ std::string errMessage,
+ Json::Value& error);
+
+ std::string getDestinationComponentName(Json::Value& root);
+
+ bool isNotification(Json::Value& root);
+
+ bool isResponse(Json::Value& root);
+
+ std::string findMethodById(std::string id);
+
+ void registerController(int id = 0);
+
+ void unregisterController();
+
+ void subscribeTo(std::string property);
+
+ void unsubscribeFrom(std::string property);
+
+ bool checkMessage(Json::Value& root, Json::Value& error);
+
+ std::string getControllersName();
+
+ std::string GetComponentName(std::string& method);
+
+ protected:
+ sync_primitives::atomic_bool stop;
+
+ private:
+ void onMessageReceived(Json::Value message);
+
+ std::map<std::string, std::string> mWaitResponseQueue;
+
+ std::string m_receivingBuffer;
+
+ int mControllersIdStart;
+
+ int mControllersIdCurrent;
+
+ Json::Reader m_reader;
+ Json::FastWriter m_writer;
+ Json::FastWriter m_receiverWriter;
+
+ sync_primitives::Lock queue_lock_;
+ sync_primitives::Lock message_queue_lock_;
+ std::atomic_bool shutdown_;
+
+ MessageQueue<Message, AsyncQueue> message_queue_;
+
+ class LoopThreadDelegate : public threads::ThreadDelegate {
+ public:
+ LoopThreadDelegate(MessageQueue<Message, AsyncQueue>* message_queue,
+ WebsocketSession* handler);
+
+ virtual void threadMain() OVERRIDE;
+ virtual void exitThreadMain() OVERRIDE;
+
+ void OnWrite();
+
+ void SetShutdown();
+
+ private:
+ void DrainQueue();
+ MessageQueue<Message, AsyncQueue>& message_queue_;
+ WebsocketSession& handler_;
+ sync_primitives::Lock queue_lock_;
+ sync_primitives::ConditionalVariable queue_new_items_;
+ std::atomic_bool write_pending_;
+ std::atomic_bool shutdown_;
+
+ sync_primitives::Lock write_lock_;
+ };
+
+ LoopThreadDelegate* thread_delegate_;
+ threads::Thread* thread_;
+};
+
+} // hmi_message_handler
+
+#endif /* WEBSOCKET_SESSION_H */ \ No newline at end of file
diff --git a/src/components/hmi_message_handler/mock_hmi_message_handler.h b/src/components/hmi_message_handler/mock_hmi_message_handler.h
new file mode 100644
index 0000000000..d9060088ff
--- /dev/null
+++ b/src/components/hmi_message_handler/mock_hmi_message_handler.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_H_
+
+#include "gmock/gmock.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+
+namespace test {
+namespace components {
+namespace hmi_message_handler_test {
+
+using hmi_message_handler::HMIMessageAdapter;
+using hmi_message_handler::HMIMessageHandlerSettings;
+using hmi_message_handler::MessageSharedPointer;
+
+class MockHMIMessageHandler : public ::hmi_message_handler::HMIMessageHandler {
+ public:
+ MOCK_METHOD1(AddHMIMessageAdapter, void(HMIMessageAdapter* adapter));
+ MOCK_METHOD1(RemoveHMIMessageAdapter, void(HMIMessageAdapter* adapter));
+ MOCK_CONST_METHOD0(get_settings, const HMIMessageHandlerSettings&());
+ MOCK_METHOD1(OnMessageReceived,
+ void(utils::SharedPtr<application_manager::Message> message));
+ MOCK_METHOD1(OnErrorSending,
+ void(utils::SharedPtr<application_manager::Message> message));
+ MOCK_METHOD1(SendMessageToHMI, void(MessageSharedPointer message));
+};
+} // namespace hmi_message_handler_test
+} // namespace components
+} // namespace test
+#endif // SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_H_ \ No newline at end of file
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 6a5bda5bfb..5b0b11e557 100644
--- a/src/components/hmi_message_handler/src/dbus_message_adapter.cc
+++ b/src/components/hmi_message_handler/src/dbus_message_adapter.cc
@@ -34,8 +34,8 @@
#include <sstream>
#include "utils/logger.h"
#include "formatters/CSmartFactory.h"
+#include "smart_objects/smart_object.h"
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
namespace sos = NsSmartDeviceLink::NsJSONHandler::strings;
namespace hmi_message_handler {
@@ -126,8 +126,6 @@ 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");
@@ -181,7 +179,8 @@ void DBusMessageAdapter::SendMessageToCore(
// merge
// MessagePriority::FromServiceType(message.servicetype)
// shall be used instead
- message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
+ message->set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
message->set_smart_object(obj);
handler()->OnMessageReceived(message);
LOG4CXX_INFO(logger_, "Successfully sent to observer");
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 4e0d8e45ba..70865f7771 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
@@ -68,7 +68,7 @@ void HMIMessageHandlerImpl::OnMessageReceived(MessageSharedPointer message) {
}
void HMIMessageHandlerImpl::SendMessageToHMI(MessageSharedPointer message) {
- LOG4CXX_INFO(logger_, "HMIMessageHandlerImpl::~sendMessageToHMI()");
+ LOG4CXX_INFO(logger_, "SendMessageToHMI");
messages_to_hmi_.PostMessage(impl::MessageToHmi(message));
}
@@ -94,6 +94,7 @@ void HMIMessageHandlerImpl::AddHMIMessageAdapter(HMIMessageAdapter* adapter) {
LOG4CXX_WARN(logger_, "HMIMessageAdapter is not valid!");
return;
}
+ sync_primitives::AutoLock lock(message_adapters_locker_);
message_adapters_.insert(adapter);
}
@@ -104,6 +105,7 @@ void HMIMessageHandlerImpl::RemoveHMIMessageAdapter(
LOG4CXX_WARN(logger_, "HMIMessageAdapter is not valid!");
return;
}
+ sync_primitives::AutoLock lock(message_adapters_locker_);
message_adapters_.erase(adapter);
}
@@ -123,6 +125,7 @@ void HMIMessageHandlerImpl::Handle(const impl::MessageFromHmi message) {
LOG4CXX_INFO(logger_, "Message from hmi given away.");
}
void HMIMessageHandlerImpl::Handle(const impl::MessageToHmi message) {
+ sync_primitives::AutoLock lock(message_adapters_locker_);
for (std::set<HMIMessageAdapter*>::iterator it = message_adapters_.begin();
it != message_adapters_.end();
++it) {
diff --git a/src/components/hmi_message_handler/src/mb_controller.cc b/src/components/hmi_message_handler/src/mb_controller.cc
new file mode 100644
index 0000000000..ec0d1f8bd8
--- /dev/null
+++ b/src/components/hmi_message_handler/src/mb_controller.cc
@@ -0,0 +1,475 @@
+
+#include "hmi_message_handler/mb_controller.h"
+
+using namespace boost::beast::websocket;
+namespace hmi_message_handler {
+
+CMessageBrokerController::CMessageBrokerController(const std::string& address,
+ uint16_t port,
+ std::string name,
+ int num_threads)
+ : address_(address)
+ , acceptor_(ioc_)
+ , socket_(ioc_)
+ , mControllersIdCounter(1) {
+ port_ = port;
+ name_ = name;
+ num_threads_ = num_threads;
+ endpoint_ = {boost::asio::ip::make_address(address),
+ static_cast<unsigned short>(port)};
+ shutdown_ = false;
+}
+
+CMessageBrokerController::~CMessageBrokerController() {
+ boost::system::error_code ec;
+ socket_.close();
+ acceptor_.close(ec);
+ if (ec) {
+ std::string str_err = "ErrorMessage Close: " + ec.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ }
+ shutdown_ = true;
+ ioc_.stop();
+}
+
+bool CMessageBrokerController::StartListener() {
+ boost::system::error_code error;
+ acceptor_.open(endpoint_.protocol(), error);
+ if (error) {
+ std::string str_err = "ErrorOpen: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+
+ acceptor_.set_option(boost::asio::socket_base::reuse_address(true), error);
+ if (error) {
+ std::string str_err = "ErrorSetOption: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+ acceptor_.bind(endpoint_, error);
+ if (error) {
+ std::string str_err = "ErrorBind: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+ acceptor_.listen(boost::asio::socket_base::max_listen_connections, error);
+ if (error) {
+ std::string str_err = "ErrorListen: " + error.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ return false;
+ }
+ return true;
+}
+
+bool CMessageBrokerController::Run() {
+ if (acceptor_.is_open() && !shutdown_) {
+ acceptor_.async_accept(socket_,
+ std::bind(&CMessageBrokerController::StartSession,
+ this,
+ std::placeholders::_1));
+ ioc_.run();
+ return true;
+ }
+ return false;
+}
+
+void CMessageBrokerController::WaitForConnection() {
+ if (acceptor_.is_open() && !shutdown_) {
+ acceptor_.async_accept(socket_,
+ std::bind(&CMessageBrokerController::StartSession,
+ this,
+ std::placeholders::_1));
+ }
+}
+
+void CMessageBrokerController::StartSession(boost::system::error_code ec) {
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ ioc_.stop();
+ return;
+ }
+ if (shutdown_) {
+ return;
+ }
+ std::shared_ptr<WebsocketSession> ws_ptr =
+ std::make_shared<WebsocketSession>(std::move(socket_), this);
+ ws_ptr->Accept();
+
+ mConnectionListLock.Acquire();
+ mConnectionList.push_back(ws_ptr);
+ mConnectionListLock.Release();
+
+ WaitForConnection();
+}
+
+bool CMessageBrokerController::isNotification(Json::Value& message) {
+ bool ret = false;
+ if (false == message.isMember("id")) {
+ ret = true;
+ }
+ return ret;
+}
+
+void CMessageBrokerController::sendNotification(Json::Value& message) {
+ std::string methodName = message["method"].asString();
+ std::vector<WebsocketSession*> result;
+ int subscribersCount = getSubscribersFd(methodName, result);
+ if (0 < subscribersCount) {
+ std::vector<WebsocketSession*>::iterator it;
+ for (it = result.begin(); it != result.end(); it++) {
+ (*it)->sendJsonMessage(message);
+ }
+ } else {
+ LOG4CXX_ERROR(mb_logger_, ("No subscribers for this property!\n"));
+ }
+}
+
+bool CMessageBrokerController::isResponse(Json::Value& message) {
+ bool ret = false;
+ if ((true == message.isMember("result")) ||
+ (true == message.isMember("error"))) {
+ ret = true;
+ }
+ return ret;
+}
+
+void CMessageBrokerController::sendResponse(Json::Value& message) {
+ WebsocketSession* ws;
+ std::map<std::string, WebsocketSession*>::iterator it;
+ sync_primitives::AutoLock request_lock(mRequestListLock);
+
+ std::string id = message["id"].asString();
+ it = mRequestList.find(id);
+ if (it != mRequestList.end()) {
+ ws = it->second;
+ ws->sendJsonMessage(message);
+ mRequestList.erase(it);
+ }
+}
+
+void CMessageBrokerController::sendJsonMessage(Json::Value& message) {
+ if (isNotification(message)) {
+ sendNotification(message);
+ return;
+ } else if (isResponse(message)) {
+ sendResponse(message);
+ return;
+ }
+
+ // Send request
+ WebsocketSession* ws;
+ std::map<std::string, WebsocketSession*>::iterator it;
+ std::string method = message["method"].asString();
+ std::string component_name = GetComponentName(method);
+
+ sync_primitives::AutoLock lock(mControllersListLock);
+ it = mControllersList.find(component_name);
+ if (it != mControllersList.end()) {
+ ws = it->second;
+ ws->sendJsonMessage(message);
+ }
+}
+
+void CMessageBrokerController::subscribeTo(std::string property) {}
+
+void CMessageBrokerController::registerController(int id) {}
+
+void CMessageBrokerController::unregisterController() {}
+
+void* CMessageBrokerController::MethodForReceiverThread(void* arg) {
+ return NULL;
+}
+
+bool CMessageBrokerController::Connect() {
+ return true;
+}
+
+void CMessageBrokerController::exitReceivingThread() {
+ shutdown_ = true;
+ mConnectionListLock.Acquire();
+ std::vector<std::shared_ptr<hmi_message_handler::WebsocketSession> >::iterator
+ it;
+ for (it = mConnectionList.begin(); it != mConnectionList.end();) {
+ (*it)->Shutdown();
+ mConnectionList.erase(it++);
+ }
+ mConnectionListLock.Release();
+
+ boost::system::error_code ec;
+ socket_.close();
+ acceptor_.cancel(ec);
+ if (ec) {
+ std::string str_err = "ErrorMessage Cancel: " + ec.message();
+ LOG4CXX_ERROR(mb_logger_, str_err);
+ }
+ acceptor_.close(ec);
+ if (ec) {
+ std::string str_err = "ErrorMessage Close: " + ec.message();
+ }
+ ioc_.stop();
+}
+
+std::string CMessageBrokerController::getMethodName(std::string& method) {
+ std::string return_string = "";
+ if (method != "") {
+ int position = method.find(".");
+ if (position != -1) {
+ return_string = method.substr(position + 1);
+ }
+ }
+ return return_string;
+}
+
+std::string CMessageBrokerController::GetComponentName(std::string& method) {
+ std::string return_string = "";
+ if (method != "") {
+ int position = method.find(".");
+ if (position != -1) {
+ return_string = method.substr(0, position);
+ }
+ }
+ return return_string;
+}
+
+bool CMessageBrokerController::addController(WebsocketSession* ws_session,
+ std::string name) {
+ bool result = false;
+ std::map<std::string, WebsocketSession*>::iterator it;
+
+ sync_primitives::AutoLock lock(mControllersListLock);
+ it = mControllersList.find(name);
+ if (it == mControllersList.end()) {
+ mControllersList.insert(
+ std::map<std::string, WebsocketSession*>::value_type(name, ws_session));
+ result = true;
+ } else {
+ LOG4CXX_ERROR(mb_logger_, ("Controller already exists!\n"));
+ }
+ return result;
+}
+
+void CMessageBrokerController::deleteController(WebsocketSession* ws_session) {
+ {
+ sync_primitives::AutoLock lock(mControllersListLock);
+ std::map<std::string, WebsocketSession*>::iterator it;
+ for (it = mControllersList.begin(); it != mControllersList.end();) {
+ if (it->second == ws_session) {
+ mControllersList.erase(it++);
+ } else {
+ it++;
+ }
+ }
+ }
+ removeSubscribersBySession(ws_session);
+}
+
+void CMessageBrokerController::deleteController(std::string name) {
+ std::map<std::string, WebsocketSession*>::iterator it;
+ WebsocketSession* ws;
+ {
+ sync_primitives::AutoLock lock(mControllersListLock);
+ it = mControllersList.find(name);
+ if (it != mControllersList.end()) {
+ ws = it->second;
+ mControllersList.erase(it);
+ } else {
+ return;
+ }
+ }
+ removeSubscribersBySession(ws);
+}
+
+void CMessageBrokerController::removeSubscribersBySession(
+ const WebsocketSession* ws) {
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::multimap<std::string, WebsocketSession*>::iterator it_s =
+ mSubscribersList.begin();
+ for (; it_s != mSubscribersList.end();) {
+ if (it_s->second == ws) {
+ mSubscribersList.erase(it_s++);
+ } else {
+ ++it_s;
+ }
+ }
+}
+
+void CMessageBrokerController::pushRequest(Json::Value& message,
+ WebsocketSession* ws_session) {
+ sync_primitives::AutoLock lock(mRequestListLock);
+ std::string id = message["id"].asString();
+ mRequestList.insert(
+ std::map<std::string, WebsocketSession*>::value_type(id, ws_session));
+}
+
+bool CMessageBrokerController::addSubscriber(WebsocketSession* ws_session,
+ std::string name) {
+ bool result = true;
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
+ std::multimap<std::string, WebsocketSession*>::iterator> p =
+ mSubscribersList.equal_range(name);
+ if (p.first != p.second) {
+ std::multimap<std::string, WebsocketSession*>::iterator itr;
+ for (itr = p.first; itr != p.second; itr++) {
+ if (ws_session == itr->second) {
+ result = false;
+ LOG4CXX_ERROR(mb_logger_, ("Subscriber already exists!\n"));
+ }
+ }
+ }
+ if (result) {
+ mSubscribersList.insert(
+ std::map<std::string, WebsocketSession*>::value_type(name, ws_session));
+ }
+ return result;
+}
+
+void CMessageBrokerController::deleteSubscriber(WebsocketSession* ws,
+ std::string name) {
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
+ std::multimap<std::string, WebsocketSession*>::iterator> p =
+ mSubscribersList.equal_range(name);
+ if (p.first != p.second) {
+ std::multimap<std::string, WebsocketSession*>::iterator itr;
+ for (itr = p.first; itr != p.second;) {
+ if (ws == itr->second) {
+ mSubscribersList.erase(itr++);
+ } else {
+ ++itr;
+ }
+ }
+ }
+}
+
+int CMessageBrokerController::getSubscribersFd(
+ std::string name, std::vector<WebsocketSession*>& result) {
+ int res = 0;
+ std::map<std::string, WebsocketSession*>::iterator it;
+
+ sync_primitives::AutoLock lock(mSubscribersListLock);
+ std::pair<std::multimap<std::string, WebsocketSession*>::iterator,
+ std::multimap<std::string, WebsocketSession*>::iterator> p =
+ mSubscribersList.equal_range(name);
+ if (p.first != p.second) {
+ std::multimap<std::string, WebsocketSession*>::iterator itr;
+ for (itr = p.first; itr != p.second; itr++) {
+ result.push_back(itr->second);
+ }
+ }
+
+ res = result.size();
+ return res;
+}
+
+void CMessageBrokerController::processInternalRequest(
+ Json::Value& message, WebsocketSession* ws_session) {
+ std::string method = message["method"].asString();
+ std::string methodName = getMethodName(method);
+ if (methodName == "registerComponent") {
+ Json::Value params = message["params"];
+ if (params.isMember("componentName") &&
+ params["componentName"].isString()) {
+ std::string controllerName = params["componentName"].asString();
+ if (addController(ws_session, controllerName)) {
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = getNextControllerId();
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = CONTROLLER_EXISTS;
+ err["message"] = "Controller has been already registered.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else if (methodName == "subscribeTo") {
+ Json::Value params = message["params"];
+ if (params.isMember("propertyName") && params["propertyName"].isString()) {
+ std::string propertyName = params["propertyName"].asString();
+ if (addSubscriber(ws_session, propertyName)) {
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = "OK";
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = CONTROLLER_EXISTS;
+ err["message"] = "Subscribe has been already registered.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+
+ } else if (methodName == "unregisterComponent") {
+ Json::Value params = message["params"];
+ if (params.isMember("componentName") &&
+ params["componentName"].isString()) {
+ std::string controllerName = params["componentName"].asString();
+ deleteController(controllerName);
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = "OK";
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else if (methodName == "unsubscribeFrom") {
+ Json::Value params = message["params"];
+ if (params.isMember("propertyName") && params["propertyName"].isString()) {
+ std::string propertyName = params["propertyName"].asString();
+ deleteSubscriber(ws_session, propertyName);
+ Json::Value response;
+ response["id"] = message["id"];
+ response["jsonrpc"] = "2.0";
+ response["result"] = "OK";
+ ws_session->sendJsonMessage(response);
+ } else {
+ Json::Value error, err;
+ error["id"] = message["id"];
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Wrong method parameter.";
+ error["error"] = err;
+ ws_session->sendJsonMessage(error);
+ }
+ } else {
+ }
+}
+
+int CMessageBrokerController::getNextControllerId() {
+ return 1000 * mControllersIdCounter++;
+}
+}
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index 27cf9df8cd..53a0d84362 100644
--- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc
+++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,13 +39,13 @@ namespace hmi_message_handler {
CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-typedef NsMessageBroker::CMessageBrokerController MessageBrokerController;
+typedef hmi_message_handler::CMessageBrokerController MessageBrokerController;
MessageBrokerAdapter::MessageBrokerAdapter(HMIMessageHandler* handler_param,
const std::string& server_address,
uint16_t port)
: HMIMessageAdapterImpl(handler_param)
- , MessageBrokerController(server_address, port, "SDL") {
+ , MessageBrokerController(server_address, port, "SDL", 8) {
LOG4CXX_TRACE(logger_, "Created MessageBrokerAdapter");
}
@@ -108,6 +108,7 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("BasicCommunication.OnUpdateDeviceList");
MessageBrokerController::subscribeTo("BasicCommunication.OnFindApplications");
MessageBrokerController::subscribeTo("BasicCommunication.OnAppActivated");
+ MessageBrokerController::subscribeTo("BasicCommunication.OnAwakeSDL");
MessageBrokerController::subscribeTo("BasicCommunication.OnExitApplication");
MessageBrokerController::subscribeTo(
"BasicCommunication.OnExitAllApplications");
@@ -135,6 +136,8 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("SDL.OnDeviceStateChanged");
MessageBrokerController::subscribeTo("SDL.OnPolicyUpdate");
MessageBrokerController::subscribeTo("BasicCommunication.OnEventChanged");
+ MessageBrokerController::subscribeTo("RC.OnInteriorVehicleData");
+ MessageBrokerController::subscribeTo("RC.OnRemoteControlSettings");
LOG4CXX_INFO(logger_, "Subscribed to notifications.");
}
@@ -150,6 +153,7 @@ void* MessageBrokerAdapter::SubscribeAndBeginReceiverThread(void* param) {
void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) {
LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "MB_Adapter: " << root);
if (root.isNull()) {
// LOG
return;
@@ -171,7 +175,8 @@ void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) {
protocol_handler::MessagePriority::kDefault));
// message->set_message_type()
message->set_json_message(message_string);
- message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
+ message->set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
if (!handler()) {
LOG4CXX_WARN(logger_, "handler is NULL");
diff --git a/src/components/hmi_message_handler/src/mqueue_adapter.cc b/src/components/hmi_message_handler/src/mqueue_adapter.cc
deleted file mode 100644
index 4cfebbe9e8..0000000000
--- a/src/components/hmi_message_handler/src/mqueue_adapter.cc
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "hmi_message_handler/mqueue_adapter.h"
-#include "hmi_message_handler/hmi_message_handler.h"
-#include "utils/logger.h"
-
-namespace hmi_message_handler {
-
-const uint32_t kMqueueSize = 100;
-const uint32_t kMqueueMessageSize = 65536;
-const char* kSdlToHmiQueue = "/sdl_to_hmi";
-const char* kHmiToSdlQueue = "/hmi_to_sdl";
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "HMIMessageHandler")
-
-class ReceiverThreadDelegate : public threads::ThreadDelegate {
- public:
- ReceiverThreadDelegate(mqd_t mqueue_descriptor,
- HMIMessageHandler* hmi_message_handler)
- : mqueue_descriptor_(mqueue_descriptor)
- , hmi_message_handler_(hmi_message_handler) {}
-
- private:
- virtual void threadMain() {
- while (true) {
- static char buffer[kMqueueMessageSize];
- const ssize_t size =
- mq_receive(mqueue_descriptor_, buffer, kMqueueMessageSize, NULL);
- if (-1 == size) {
- LOG4CXX_ERROR(logger_, "Message queue receive failed, error " << errno);
- continue;
- }
- const std::string message_string(buffer, buffer + size);
- LOG4CXX_DEBUG(logger_, "Message: " << message_string);
- MessageSharedPointer message(new application_manager::Message(
- protocol_handler::MessagePriority::kDefault));
- message->set_json_message(message_string);
- message->set_protocol_version(application_manager::ProtocolVersion::kHMI);
- hmi_message_handler_->OnMessageReceived(message);
- }
- }
-
- const mqd_t mqueue_descriptor_;
- HMIMessageHandler* hmi_message_handler_;
-};
-
-MqueueAdapter::MqueueAdapter(HMIMessageHandler* hmi_message_handler)
- : HMIMessageAdapterImpl(hmi_message_handler)
- , sdl_to_hmi_mqueue_(-1)
- , hmi_to_sdl_mqueue_(-1)
- , receiver_thread_(NULL) {
- mq_attr mq_attributes;
- mq_attributes.mq_maxmsg = kMqueueSize;
- mq_attributes.mq_msgsize = kMqueueMessageSize;
- sdl_to_hmi_mqueue_ =
- mq_open(kSdlToHmiQueue, O_CREAT | O_RDWR, S_IRWXU, &mq_attributes);
- if (-1 == sdl_to_hmi_mqueue_) {
- LOG4CXX_ERROR(logger_,
- "Could not open message queue " << kSdlToHmiQueue
- << ", error " << errno);
- return;
- }
- hmi_to_sdl_mqueue_ =
- mq_open(kHmiToSdlQueue, O_CREAT | O_RDWR, S_IRWXU, &mq_attributes);
- if (-1 == hmi_to_sdl_mqueue_) {
- LOG4CXX_ERROR(logger_,
- "Could not open message queue " << kHmiToSdlQueue
- << ", error " << errno);
- return;
- }
- 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() {
- 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);
- mq_unlink(kSdlToHmiQueue);
-}
-
-void MqueueAdapter::SendMessageToHMI(const MessageSharedPointer message) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- if (-1 == sdl_to_hmi_mqueue_) {
- LOG4CXX_ERROR(logger_, "Message queue is not opened");
- return;
- }
- const std::string& json = message->json_message();
- if (json.size() > kMqueueMessageSize) {
- LOG4CXX_ERROR(logger_, "Message size " << json.size() << " is too big");
- return;
- }
- const int rc = mq_send(sdl_to_hmi_mqueue_, json.c_str(), json.size(), 0);
- if (0 != rc) {
- LOG4CXX_ERROR(logger_, "Could not send message, error " << errno);
- return;
- }
-}
-
-void MqueueAdapter::SubscribeTo() {
- // empty implementation of pure virtual method, actually it's not called
-}
-
-} // namespace hmi_message_handler
diff --git a/src/components/hmi_message_handler/src/websocket_session.cc b/src/components/hmi_message_handler/src/websocket_session.cc
new file mode 100644
index 0000000000..19227a1555
--- /dev/null
+++ b/src/components/hmi_message_handler/src/websocket_session.cc
@@ -0,0 +1,292 @@
+#include "hmi_message_handler/websocket_session.h"
+#include "hmi_message_handler/mb_controller.h"
+#include <unistd.h>
+using namespace boost::beast::websocket;
+namespace hmi_message_handler {
+
+WebsocketSession::WebsocketSession(boost::asio::ip::tcp::socket socket,
+ CMessageBrokerController* controller)
+ : ws_(std::move(socket))
+ , strand_(ws_.get_executor())
+ , controller_(controller)
+ , stop(false)
+ , m_receivingBuffer("")
+ , mControllersIdStart(-1)
+ , mControllersIdCurrent(0)
+ , shutdown_(false)
+ , thread_delegate_(new LoopThreadDelegate(&message_queue_, this))
+ , thread_(threads::CreateThread("WS Async Send", thread_delegate_)) {
+ thread_->start(threads::ThreadOptions());
+}
+
+WebsocketSession::~WebsocketSession() {}
+
+void WebsocketSession::Accept() {
+ ws_.async_accept(boost::asio::bind_executor(
+ strand_,
+ std::bind(
+ &WebsocketSession::Recv, shared_from_this(), std::placeholders::_1)));
+}
+
+void WebsocketSession::Shutdown() {
+ shutdown_ = true;
+ thread_delegate_->SetShutdown();
+ thread_->join();
+ delete thread_delegate_;
+ threads::DeleteThread(thread_);
+}
+
+bool WebsocketSession::IsShuttingDown() {
+ return shutdown_;
+}
+
+void WebsocketSession::Recv(boost::system::error_code ec) {
+ if (shutdown_) {
+ return;
+ }
+
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(ws_logger_, str_err);
+ shutdown_ = true;
+ thread_delegate_->SetShutdown();
+ controller_->deleteController(this);
+ return;
+ }
+
+ ws_.async_read(buffer_,
+ boost::asio::bind_executor(strand_,
+ std::bind(&WebsocketSession::Read,
+ shared_from_this(),
+ std::placeholders::_1,
+ std::placeholders::_2)));
+}
+
+void WebsocketSession::Send(std::string& message, Json::Value& json_message) {
+ if (shutdown_) {
+ return;
+ }
+ std::shared_ptr<std::string> message_ptr =
+ std::make_shared<std::string>(message);
+ message_queue_.push(message_ptr);
+}
+
+void WebsocketSession::sendJsonMessage(Json::Value& message) {
+ std::string str_msg = m_writer.write(message);
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ if (!isNotification(message) && !isResponse(message)) {
+ mWaitResponseQueue.insert(std::map<std::string, std::string>::value_type(
+ message["id"].asString(), message["method"].asString()));
+ }
+
+ Send(str_msg, message);
+}
+
+void WebsocketSession::Read(boost::system::error_code ec,
+ std::size_t bytes_transferred) {
+ boost::ignore_unused(bytes_transferred);
+ if (ec) {
+ std::string str_err = "ErrorMessage: " + ec.message();
+ LOG4CXX_ERROR(ws_logger_, str_err);
+ shutdown_ = true;
+ thread_delegate_->SetShutdown();
+ controller_->deleteController(this);
+ buffer_.consume(buffer_.size());
+ return;
+ }
+
+ std::string data = boost::beast::buffers_to_string(buffer_.data());
+ m_receivingBuffer += data;
+
+ Json::Value root;
+ if (!m_reader.parse(m_receivingBuffer, root)) {
+ std::string str_err = "Invalid JSON Message: " + data;
+ LOG4CXX_ERROR(ws_logger_, str_err);
+ return;
+ }
+
+ std::string wmes = m_receiverWriter.write(root);
+ ssize_t beginpos = m_receivingBuffer.find(wmes);
+ if (-1 != beginpos) {
+ m_receivingBuffer.erase(0, beginpos + wmes.length());
+ } else {
+ m_receivingBuffer.clear();
+ }
+ onMessageReceived(root);
+
+ buffer_.consume(buffer_.size());
+
+ Recv(ec);
+}
+
+std::string WebsocketSession::GetComponentName(std::string& method) {
+ std::string return_string = "";
+ if (method != "") {
+ int position = method.find(".");
+ if (position != -1) {
+ return_string = method.substr(0, position);
+ }
+ }
+ return return_string;
+}
+
+void WebsocketSession::onMessageReceived(Json::Value message) {
+ // Determine message type and process...
+ Json::Value error;
+ if (checkMessage(message, error)) {
+ if (isNotification(message)) {
+ controller_->processNotification(message);
+ } else if (isResponse(message)) {
+ std::string id = message["id"].asString();
+ std::string method = findMethodById(id);
+ if ("" != method) {
+ if ("MB.registerComponent" == method) {
+ if (message.isMember("result") && message["result"].isInt()) {
+ mControllersIdStart = message["result"].asInt();
+ } else {
+ LOG4CXX_ERROR(ws_logger_,
+ "Not possible to initialize mControllersIdStart!");
+ }
+ } else if ("MB.subscribeTo" == method ||
+ "MB.unregisterComponent" == method ||
+ "MB.unsubscribeFrom" == method) {
+ // nothing to do for now
+ } else {
+ controller_->processResponse(method, message);
+ }
+ } else {
+ LOG4CXX_ERROR(ws_logger_,
+ "Request with id: " + id + " has not been found!");
+ }
+ } else {
+ std::string method = message["method"].asString();
+ std::string component_name = GetComponentName(method);
+
+ if (component_name == "MB") {
+ controller_->processInternalRequest(message, this);
+ } else {
+ controller_->pushRequest(message, this);
+ controller_->processRequest(message);
+ }
+ }
+ } else {
+ LOG4CXX_ERROR(ws_logger_, "Message contains wrong data!\n");
+ sendJsonMessage(error);
+ }
+}
+
+bool WebsocketSession::isNotification(Json::Value& root) {
+ bool ret = false;
+ if (false == root.isMember("id")) {
+ ret = true;
+ }
+ return ret;
+}
+
+bool WebsocketSession::isResponse(Json::Value& root) {
+ bool ret = false;
+ if ((true == root.isMember("result")) || (true == root.isMember("error"))) {
+ ret = true;
+ }
+ return ret;
+}
+
+std::string WebsocketSession::findMethodById(std::string id) {
+ sync_primitives::AutoLock auto_lock(queue_lock_);
+ std::string res = "";
+ std::map<std::string, std::string>::iterator it;
+ it = mWaitResponseQueue.find(id);
+ if (it != mWaitResponseQueue.end()) {
+ res = (*it).second;
+ mWaitResponseQueue.erase(it);
+ }
+ return res;
+}
+
+bool WebsocketSession::checkMessage(Json::Value& root, Json::Value& error) {
+ Json::Value err;
+ /* check the JSON-RPC version => 2.0 */
+ if (!root.isObject() || !root.isMember("jsonrpc") ||
+ root["jsonrpc"] != "2.0") {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = hmi_message_handler::INVALID_REQUEST;
+ err["message"] = "Invalid MessageBroker request.";
+ error["error"] = err;
+ return false;
+ }
+
+ if (root.isMember("id") && (root["id"].isArray() || root["id"].isObject())) {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = hmi_message_handler::INVALID_REQUEST;
+ err["message"] = "Invalid MessageBroker request.";
+ error["error"] = err;
+ 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()) {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = hmi_message_handler::INVALID_REQUEST;
+ err["message"] = "Invalid MessageBroker request.";
+ error["error"] = err;
+ return false;
+ }
+ /* Check the params is an object*/
+ if (root.isMember("params") && !root["params"].isObject()) {
+ error["id"] = Json::Value::null;
+ error["jsonrpc"] = "2.0";
+ err["code"] = INVALID_REQUEST;
+ err["message"] = "Invalid JSONRPC params.";
+ error["error"] = err;
+ return false;
+ }
+ } else if (!root.isMember("result") && !root.isMember("error")) {
+ return false;
+ }
+ return true;
+}
+
+WebsocketSession::LoopThreadDelegate::LoopThreadDelegate(
+ MessageQueue<Message, AsyncQueue>* message_queue, WebsocketSession* handler)
+ : message_queue_(*message_queue), handler_(*handler), shutdown_(false) {}
+
+void WebsocketSession::LoopThreadDelegate::threadMain() {
+ while (!message_queue_.IsShuttingDown() && !shutdown_) {
+ DrainQueue();
+ message_queue_.wait();
+ }
+ DrainQueue();
+}
+
+void WebsocketSession::LoopThreadDelegate::exitThreadMain() {
+ shutdown_ = true;
+ if (!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
+}
+
+void WebsocketSession::LoopThreadDelegate::DrainQueue() {
+ while (!message_queue_.empty()) {
+ Message message_ptr;
+ message_queue_.pop(message_ptr);
+ if (!shutdown_) {
+ handler_.ws_.write(boost::asio::buffer(*message_ptr));
+ };
+ }
+}
+
+void WebsocketSession::LoopThreadDelegate::SetShutdown() {
+ shutdown_ = true;
+ if (!message_queue_.IsShuttingDown()) {
+ message_queue_.Shutdown();
+ }
+}
+} \ No newline at end of file
diff --git a/src/components/hmi_message_handler/test/CMakeLists.txt b/src/components/hmi_message_handler/test/CMakeLists.txt
index 98e9fd5653..9e855c563e 100644
--- a/src/components/hmi_message_handler/test/CMakeLists.txt
+++ b/src/components/hmi_message_handler/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${GMOCK_INCLUDE_DIRECTORY}
@@ -36,27 +37,26 @@ include_directories (
${COMPONENTS_DIR}/hmi_message_handler/test/include
)
+if (HMIADAPTER STREQUAL "messagebroker")
+ set(EXCLUDE_PATHS)
+else()
+ set(EXCLUDE_PATHS hmi_message_handler_impl_test.cc)
+endif()
+
set(LIBRARIES
gmock
ApplicationManager
HMIMessageHandler
jsoncpp
- MessageBrokerClient
- MessageBrokerServer
+ ${BROKER_LIBRARIES}
ConfigProfile
)
-set(SOURCES
-${COMPONENTS_DIR}/hmi_message_handler/test/hmi_message_handler_impl_test.cc
-${COMPONENTS_DIR}/hmi_message_handler/test/hmi_message_adapter_test.cc
-)
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
-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
- )
+if (HMIADAPTER STREQUAL "messagebroker")
+ GET_PROPERTY(BOOST_LIBS_DIRECTORY GLOBAL PROPERTY GLOBAL_BOOST_LIBS)
+ list(APPEND LIBRARIES ${BOOST_LIBS_DIRECTORY}/libboost_system.so)
endif()
-create_test("hmi_message_handler_test" "${SOURCES}" "${LIBRARIES}")
-endif()
+create_test(hmi_message_handler_test "${SOURCES}" "${LIBRARIES}")
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
deleted file mode 100644
index ac9a36aa16..0000000000
--- a/src/components/hmi_message_handler/test/dbus_message_adapter_test.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include <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/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
index b0f63c6a0c..eead7106c6 100644
--- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
@@ -42,7 +42,7 @@ namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::ReturnRef;
+using ::testing::Return;
using hmi_message_handler::HMIMessageHandlerImpl;
typedef utils::SharedPtr<MockHMIMessageAdapterImpl>
@@ -53,7 +53,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
mock_hmi_message_handler_settings;
const uint64_t stack_size = 1000u;
ON_CALL(mock_hmi_message_handler_settings, thread_min_stack_size())
- .WillByDefault(ReturnRef(stack_size));
+ .WillByDefault(Return(stack_size));
HMIMessageHandler* message_handler =
new hmi_message_handler::HMIMessageHandlerImpl(
mock_hmi_message_handler_settings);
diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index 06cca74ba9..fd459ea094 100644
--- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,13 +36,16 @@
#include "hmi_message_handler/messagebroker_adapter.h"
#include "hmi_message_handler/mock_hmi_message_observer.h"
#include "hmi_message_handler/mock_hmi_message_handler_settings.h"
-#include "utils/make_shared.h"
+#include "hmi_message_handler/mock_hmi_message_adapter_impl.h"
+#include "utils/test_async_waiter.h"
namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::ReturnRef;
+using ::testing::Return;
+using ::testing::_;
+
class HMIMessageHandlerImplTest : public ::testing::Test {
public:
HMIMessageHandlerImplTest()
@@ -53,20 +56,23 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
protected:
hmi_message_handler::MessageBrokerAdapter* mb_adapter_;
hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_;
- hmi_message_handler::MockHMIMessageObserver* mock_hmi_message_observer_;
+ MockHMIMessageObserver* mock_hmi_message_observer_;
+
testing::NiceMock<MockHMIMessageHandlerSettings>
mock_hmi_message_handler_settings;
const uint64_t stack_size = 1000u;
virtual void SetUp() OVERRIDE {
ON_CALL(mock_hmi_message_handler_settings, thread_min_stack_size())
- .WillByDefault(ReturnRef(stack_size));
+ .WillByDefault(Return(stack_size));
hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(
mock_hmi_message_handler_settings);
+ ASSERT_TRUE(NULL != hmi_handler_);
mb_adapter_ = new hmi_message_handler::MessageBrokerAdapter(
- hmi_handler_, "localhost", 22);
- mock_hmi_message_observer_ =
- new hmi_message_handler::MockHMIMessageObserver();
+ hmi_handler_, "127.0.0.1", 8087);
+ ASSERT_TRUE(NULL != mb_adapter_);
+ mock_hmi_message_observer_ = new MockHMIMessageObserver();
+ ASSERT_TRUE(NULL != mock_hmi_message_observer_);
hmi_handler_->set_message_observer(mock_hmi_message_observer_);
EXPECT_TRUE(NULL != hmi_handler_->observer());
}
@@ -77,6 +83,13 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
delete hmi_handler_;
delete mb_adapter_;
}
+
+ hmi_message_handler::MessageSharedPointer CreateMessage() {
+ // The ServiceType doesn't really matter
+ return new application_manager::Message(
+ protocol_handler::MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kInvalidServiceType));
+ }
};
TEST_F(HMIMessageHandlerImplTest,
@@ -91,16 +104,23 @@ TEST_F(HMIMessageHandlerImplTest,
TEST_F(HMIMessageHandlerImplTest,
OnErrorSending_NotEmptyMessage_ExpectOnErrorSendingProceeded) {
// Arrange
- utils::SharedPtr<application_manager::Message> message(
- utils::MakeShared<application_manager::Message>(
- protocol_handler::MessagePriority::FromServiceType(
- protocol_handler::ServiceType::kControl)));
+ utils::SharedPtr<application_manager::Message> message = CreateMessage();
EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(message));
// Act
hmi_handler_->OnErrorSending(message);
}
+TEST_F(HMIMessageHandlerImplTest, OnErrorSending_InvalidObserver_Cancelled) {
+ // Arrange
+ utils::SharedPtr<application_manager::Message> message = CreateMessage();
+
+ hmi_handler_->set_message_observer(NULL);
+ EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(_)).Times(0);
+ // Act
+ hmi_handler_->OnErrorSending(message);
+}
+
TEST_F(HMIMessageHandlerImplTest,
AddHMIMessageAdapter_AddExistedAdapter_ExpectAdded) {
// Check before action
@@ -131,6 +151,44 @@ TEST_F(HMIMessageHandlerImplTest, RemoveHMIMessageAdapter_ExpectRemoved) {
EXPECT_TRUE(hmi_handler_->message_adapters().empty());
}
+// TODO(atimchenko) SDLOPEN-44 Wrong message to observer
+TEST_F(HMIMessageHandlerImplTest,
+ DISABLED_OnMessageReceived_ValidObserver_Success) {
+ hmi_message_handler::MessageSharedPointer message = CreateMessage();
+ EXPECT_CALL(*mock_hmi_message_observer_, OnMessageReceived(message));
+
+ hmi_handler_->OnMessageReceived(message);
+ // Wait for the message to be processed
+ hmi_handler_->messages_from_hmi()->WaitDumpQueue();
+}
+
+TEST_F(HMIMessageHandlerImplTest, OnMessageReceived_InvalidObserver_Cancelled) {
+ hmi_message_handler::MessageSharedPointer message = CreateMessage();
+ EXPECT_CALL(*mock_hmi_message_observer_, OnMessageReceived(_)).Times(0);
+ // Make the observer invalid
+ hmi_handler_->set_message_observer(NULL);
+ hmi_handler_->OnMessageReceived(message);
+ hmi_handler_->messages_from_hmi()->WaitDumpQueue();
+}
+
+TEST_F(HMIMessageHandlerImplTest, SendMessageToHMI_Success) {
+ hmi_message_handler::MessageSharedPointer message = CreateMessage();
+
+ TestAsyncWaiter waiter;
+
+ MockHMIMessageAdapterImpl message_adapter(hmi_handler_);
+ EXPECT_CALL(message_adapter, SendMessageToHMI(message))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+
+ hmi_handler_->AddHMIMessageAdapter(&message_adapter);
+ hmi_handler_->SendMessageToHMI(message);
+
+ // Wait for the message to be processed
+ hmi_handler_->messages_to_hmi()->WaitDumpQueue();
+
+ EXPECT_TRUE(waiter.WaitFor(1, 100));
+}
+
} // namespace hmi_message_handler_test
} // namespace components
} // namespace test
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
deleted file mode 100644
index eb449f7121..0000000000
--- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_dbus_message_controller.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef 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_hmi_message_observer.h b/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_hmi_message_observer.h
deleted file mode 100644
index 09a8935ae7..0000000000
--- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_hmi_message_observer.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
-* Copyright (c) 2015, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_OBSERVER_H_
-#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_OBSERVER_H_
-
-#include "gmock/gmock.h"
-#include "utils/shared_ptr.h"
-#include "utils/singleton.h"
-#include "hmi_message_handler/hmi_message_observer.h"
-#include "application_manager/message.h"
-
-namespace hmi_message_handler {
-
-using ::hmi_message_handler::HMIMessageObserver;
-
-class MockHMIMessageObserver : public HMIMessageObserver,
- public utils::Singleton<MockHMIMessageObserver> {
- public:
- MOCK_METHOD1(OnMessageReceived,
- void(utils::SharedPtr<application_manager::Message> message));
- MOCK_METHOD1(OnErrorSending,
- void(utils::SharedPtr<application_manager::Message> message));
- virtual ~MockHMIMessageObserver() {}
-};
-} // namespace hmi_message_handler
-
-#endif // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_TEST_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_OBSERVER_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
deleted file mode 100644
index 62ccafb19a..0000000000
--- a/src/components/hmi_message_handler/test/include/hmi_message_handler/mock_subscriber.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef 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/mock_subscriber.cc b/src/components/hmi_message_handler/test/mock_subscriber.cc
deleted file mode 100644
index c52d47b008..0000000000
--- a/src/components/hmi_message_handler/test/mock_subscriber.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
-* Copyright (c) 2014, Ford Motor Company
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions are met:
-*
-* Redistributions of source code must retain the above copyright notice, this
-* list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright notice,
-* this list of conditions and the following
-* disclaimer in the documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of the Ford Motor Company nor the names of its contributors
-* may be used to endorse or promote products derived from this software
-* without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#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
deleted file mode 100644
index e5c5d2a396..0000000000
--- a/src/components/hmi_message_handler/test/mqueue_adapter_test.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <gtest/gtest.h>
-#include <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/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
new file mode 100644
index 0000000000..eb9159f0b3
--- /dev/null
+++ b/src/components/include/application_manager/application_manager.h
@@ -0,0 +1,720 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
+
+#include <string>
+#include <vector>
+#include <set>
+#include "application_manager/application.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/commands/command.h"
+#include "connection_handler/connection_handler.h"
+#include "utils/data_accessor.h"
+#include "utils/shared_ptr.h"
+#include "telemetry_monitor/telemetry_observable.h"
+#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/application_manager_settings.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/hmi_interfaces.h"
+#include "policy/policy_types.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "functional_module/plugin_manager.h"
+#endif
+
+namespace resumption {
+class LastState;
+}
+
+namespace app_launch {
+class AppLaunchCtrl;
+} // namespace app_launch
+namespace media_manager {
+class MediaManager;
+}
+
+// Other compomnents class declaration
+namespace hmi_message_handler {
+class HMIMessageHandler;
+}
+namespace protocol_handler {
+class ProtocolHandler;
+}
+namespace connection_handler {
+class ConnectionHandler;
+}
+namespace resumption {
+class ResumeCtrl;
+}
+
+namespace application_manager {
+
+namespace event_engine {
+class EventDispatcher;
+}
+
+class Application;
+class StateControllerImpl;
+struct CommandParametersPermissions;
+using policy::RPCParams;
+typedef std::vector<ApplicationSharedPtr> AppSharedPtrs;
+struct ApplicationsAppIdSorter {
+ bool operator()(const ApplicationSharedPtr lhs,
+ const ApplicationSharedPtr rhs) const {
+ return lhs->app_id() < rhs->app_id();
+ }
+};
+
+struct ApplicationsPolicyAppIdSorter {
+ bool operator()(const ApplicationSharedPtr lhs,
+ const ApplicationSharedPtr rhs) {
+ if (lhs->policy_app_id() == rhs->policy_app_id()) {
+ return lhs->device() < rhs->device();
+ }
+ return lhs->policy_app_id() < rhs->policy_app_id();
+ }
+};
+
+typedef std::set<ApplicationSharedPtr, ApplicationsAppIdSorter> ApplicationSet;
+
+typedef std::set<ApplicationSharedPtr, ApplicationsPolicyAppIdSorter>
+ AppsWaitRegistrationSet;
+
+// typedef for Applications list iterator
+typedef ApplicationSet::iterator ApplicationSetIt;
+
+// typedef for Applications list const iterator
+typedef ApplicationSet::const_iterator ApplicationSetConstIt;
+
+class ApplicationManager {
+ public:
+ virtual ~ApplicationManager() {}
+
+ /**
+ * Inits application manager
+ */
+ virtual bool Init(resumption::LastState& last_state,
+ media_manager::MediaManager* media_manager) = 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;
+
+ virtual DataAccessor<ApplicationSet> applications() const = 0;
+
+ virtual ApplicationSharedPtr application(uint32_t app_id) const = 0;
+ virtual ApplicationSharedPtr active_application() const = 0;
+
+ /**
+ * Function used only by HMI request/response/notification base classes
+ * to change HMI app id to Mobile app id and vice versa.
+ * Don't use it inside Core
+ */
+ virtual ApplicationSharedPtr application_by_hmi_app(
+ uint32_t hmi_app_id) const = 0;
+
+ virtual ApplicationSharedPtr application_by_policy_id(
+ const std::string& policy_app_id) const = 0;
+
+ virtual AppSharedPtrs applications_by_button(uint32_t button) = 0;
+ virtual AppSharedPtrs applications_with_navi() = 0;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief application find application by device and policy identifier
+ * @param device_id device id
+ * @param policy_app_id poilcy identifier
+ * @return pointer to application in case if application exist, in other case
+ * return empty shared pointer
+ */
+ virtual ApplicationSharedPtr application(
+ const std::string& device_id, const std::string& policy_app_id) const = 0;
+
+ virtual void ChangeAppsHMILevel(uint32_t app_id,
+ mobile_apis::HMILevel::eType level) = 0;
+
+ virtual std::vector<std::string> devices(
+ const std::string& policy_app_id) const = 0;
+
+ virtual void SendPostMessageToMobile(const MessagePtr& message) = 0;
+
+ virtual void SendPostMessageToHMI(const MessagePtr& message) = 0;
+
+ virtual functional_modules::PluginManager& GetPluginManager() = 0;
+#endif // SDL_REMOTE_CONTROL
+
+ virtual std::vector<ApplicationSharedPtr>
+ applications_with_mobile_projection() = 0;
+ /**
+ * @brief Returns media application with LIMITED HMI Level if exists
+ *
+ * @return Shared pointer to application if application does not
+ * exist returns empty shared pointer.
+ */
+ virtual ApplicationSharedPtr get_limited_media_application() const = 0;
+
+ /**
+ * @brief Returns navigation application with LIMITED HMI Level if exists
+ *
+ * @return Shared pointer to application if application does not
+ * exist returns empty shared pointer
+ */
+ virtual ApplicationSharedPtr get_limited_navi_application() const = 0;
+
+ /**
+ * @brief Returns voice communication application with
+ * LIMITED HMI Level if exists
+ *
+ * @return Shared pointer to application if application does not
+ * exist returns empty shared pointer
+ */
+ virtual ApplicationSharedPtr get_limited_voice_application() const = 0;
+
+ virtual ApplicationSharedPtr get_limited_mobile_projection_application()
+ const = 0;
+
+ /**
+ * @brief Retrieves application id associated with correlation id
+ *
+ * @param correlation_id Correlation ID of the HMI request
+ *
+ * @return application id associated with correlation id
+ */
+ virtual uint32_t application_id(const int32_t correlation_id) = 0;
+
+ /**
+ * @brief Sets application id correlation id
+ *
+ * @param correlation_id Correlation ID of the HMI request
+ * @param app_id Application ID
+ */
+ virtual void set_application_id(const int32_t correlation_id,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief OnHMILevelChanged the callback that allows SDL to react when
+ * application's HMI level has been changed.
+ *
+ * @param app_id application identifier for which HMILevel has been chaned.
+ *
+ * @param from previous HMILevel.
+ * @param to current HMILevel.
+ */
+ virtual void OnHMILevelChanged(uint32_t app_id,
+ mobile_apis::HMILevel::eType from,
+ mobile_apis::HMILevel::eType to) = 0;
+
+ /**
+ * @brief Sends HMI status notification to mobile
+ *
+ * @param application_impl application with changed HMI status
+ *
+ **/
+ virtual void SendHMIStatusNotification(
+ const utils::SharedPtr<Application> app) = 0;
+
+ /**
+ * DEPRECATED
+ * @brief Checks if Application is subscribed for way points
+ * @param Application AppID
+ * @return true if Application is subscribed for way points
+ * otherwise false
+ */
+ virtual bool IsAppSubscribedForWayPoints(const uint32_t app_id) const = 0;
+
+ /**
+ * DEPRECATED
+ * @brief Subscribe Application for way points
+ * @param Application AppID
+ */
+ virtual void SubscribeAppForWayPoints(const uint32_t app_id) = 0;
+
+ /**
+ * DEPRECATED
+ * @brief Unsubscribe Application for way points
+ * @param Application AppID
+ */
+ virtual void UnsubscribeAppFromWayPoints(const uint32_t app_id) = 0;
+
+ /**
+ * @brief Checks if Application is subscribed for way points
+ * @param Application pointer
+ * @return true if Application is subscribed for way points
+ * otherwise false
+ */
+ virtual bool IsAppSubscribedForWayPoints(ApplicationSharedPtr app) const = 0;
+
+ /**
+ * @brief Subscribe Application for way points
+ * @param Application pointer
+ */
+ virtual void SubscribeAppForWayPoints(ApplicationSharedPtr app) = 0;
+
+ /**
+ * @brief Unsubscribe Application for way points
+ * @param Application pointer
+ */
+ virtual void UnsubscribeAppFromWayPoints(ApplicationSharedPtr app) = 0;
+
+ /**
+ * @brief Is Any Application is subscribed for way points
+ * @return true if some app is subscribed otherwise false
+ */
+ virtual bool IsAnyAppSubscribedForWayPoints() const = 0;
+
+ /**
+ * @brief Get subscribed for way points
+ * @return reference to set of subscribed apps for way points
+ */
+ virtual const std::set<int32_t> GetAppsSubscribedForWayPoints() const = 0;
+
+ virtual void SendMessageToMobile(const commands::MessageSharedPtr message,
+ bool final_message = false) = 0;
+
+ virtual void SendMessageToHMI(const commands::MessageSharedPtr message) = 0;
+
+ virtual void RemoveHMIFakeParameters(
+ application_manager::MessagePtr& message) = 0;
+
+ virtual bool ManageHMICommand(const commands::MessageSharedPtr message) = 0;
+ virtual bool ManageMobileCommand(const commands::MessageSharedPtr message,
+ commands::Command::CommandOrigin origin) = 0;
+
+ virtual MessageValidationResult ValidateMessageBySchema(
+ const Message& message) = 0;
+
+ virtual mobile_api::HMILevel::eType GetDefaultHmiLevel(
+ ApplicationConstSharedPtr application) const = 0;
+ /**
+ * @brief hmi_capabilities return capabilities of hmi
+ * @return capabilities of hmi
+ */
+ virtual HMICapabilities& hmi_capabilities() = 0;
+
+ virtual const HMICapabilities& hmi_capabilities() const = 0;
+
+ virtual void ProcessQueryApp(const smart_objects::SmartObject& sm_object,
+ const uint32_t connection_key) = 0;
+
+ /**
+ * @brief ProcessReconnection handles reconnection flow for application on
+ * transport switch
+ * @param application Pointer to switched application, must be validated
+ * before passing
+ * @param connection_key Connection key from registration request of switched
+ * application
+ */
+ virtual void ProcessReconnection(ApplicationSharedPtr application,
+ const uint32_t connection_key) = 0;
+
+ virtual bool is_attenuated_supported() const = 0;
+
+ /**
+ * @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
+ */
+ virtual bool IsAppTypeExistsInFullOrLimited(
+ ApplicationConstSharedPtr app) const = 0;
+
+ /**
+ * @brief Sets default HMI level and configure application after its
+ * registration
+ * @param app Application
+ */
+ virtual void OnApplicationRegistered(ApplicationSharedPtr app) = 0;
+
+ /**
+ * @brief OnApplicationSwitched starts activies postponed during application
+ * transport switching
+ * @param app Application
+ */
+ virtual void OnApplicationSwitched(ApplicationSharedPtr app) = 0;
+
+ virtual connection_handler::ConnectionHandler& connection_handler() const = 0;
+ virtual protocol_handler::ProtocolHandler& protocol_handler() const = 0;
+ virtual policy::PolicyHandlerInterface& GetPolicyHandler() = 0;
+ virtual const policy::PolicyHandlerInterface& GetPolicyHandler() const = 0;
+
+ virtual uint32_t GetNextHMICorrelationID() = 0;
+ virtual uint32_t GenerateNewHMIAppID() = 0;
+
+ /**
+ * @brief Ends opened navi services (audio/video) for application
+ * @param app_id Application id
+ */
+ virtual void EndNaviServices(uint32_t app_id) = 0;
+
+ /* @brief Starts audio passthru process
+ *
+ * @return true on success, false if passthru is already in process
+ */
+ virtual bool BeginAudioPassThrough() = 0;
+
+ /*
+ * @brief Finishes already started audio passthru process
+ *
+ * @return true on success, false if passthru is not active
+ */
+ virtual bool EndAudioPassThrough() = 0;
+
+ virtual void ConnectToDevice(const std::string& device_mac) = 0;
+
+ virtual void OnHMIStartedCooperation() = 0;
+
+ virtual bool IsHMICooperating() const = 0;
+ /**
+ * @brief Notifies all components interested in Vehicle Data update
+ * i.e. new value of odometer etc and returns list of applications
+ * subscribed for event.
+ * @param vehicle_info Enum value of type of vehicle data
+ * @param new value (for integer values currently) of vehicle data
+ */
+ virtual AppSharedPtrs IviInfoUpdated(
+ mobile_apis::VehicleDataType::eType vehicle_info, int value) = 0;
+
+ virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr<
+ smart_objects::SmartObject>& request_for_registration) = 0;
+
+ virtual void SendUpdateAppList() = 0;
+
+ virtual void MarkAppsGreyOut(const connection_handler::DeviceHandle handle,
+ bool is_greyed_out) = 0;
+
+ /**
+ * @brief Returns pointer to application-to-be-registered (from QUERY_APP
+ * list)
+ * @param hmi_id HMI application id
+ * @return Pointer to application or uninitialized shared pointer
+ */
+ virtual ApplicationConstSharedPtr WaitingApplicationByID(
+ const uint32_t hmi_id) const = 0;
+
+ /**
+ * @brief Returns list of applications-to-be-registered (QUERY_APP list)
+ * @return Locked list of applications
+ */
+ virtual DataAccessor<AppsWaitRegistrationSet> AppsWaitingForRegistration()
+ const = 0;
+
+ virtual bool IsAppsQueriedFrom(
+ const connection_handler::DeviceHandle handle) const = 0;
+
+ virtual bool IsStopping() const = 0;
+
+ virtual void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) = 0;
+
+ virtual mobile_apis::Result::eType SaveBinary(
+ const std::vector<uint8_t>& binary_data,
+ const std::string& file_path,
+ const std::string& file_name,
+ const int64_t offset) = 0;
+ /*
+ * @brief Sets SDL access to all mobile apps
+ *
+ * @param allowed SDL access to all mobile apps
+ */
+ virtual void SetAllAppsAllowed(const bool allowed) = 0;
+
+ /*
+ * @brief Sets state for driver distraction
+ *
+ * @param state New state to be set
+ */
+ virtual void set_driver_distraction_state(
+ const hmi_apis::Common_DriverDistractionState::eType state) = 0;
+
+ /*
+ * @brief Starts audio pass thru thread
+ *
+ * @param session_key Session key of connection for Mobile side
+ * @param correlation_id Correlation id for response for Mobile side
+ * @param max_duration Max duration of audio recording in milliseconds
+ * @param sampling_rate Value for rate(8, 16, 22, 44 kHz)
+ * @param bits_per_sample The quality the audio is recorded.
+ * @param audio_type Type of audio data
+ */
+ virtual void 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) = 0;
+
+ virtual void StartDevicesDiscovery() = 0;
+
+ virtual void StopAudioPassThru(int32_t application_key) = 0;
+
+ /**
+ * @brief TerminateRequest forces termination of request
+ * @param connection_key - application id of request
+ * @param corr_id correlation id of request
+ * @param function_id function id of request
+ */
+ virtual void TerminateRequest(const uint32_t connection_key,
+ const uint32_t corr_id,
+ const int32_t function_id) = 0;
+
+ /*
+ * @brief Closes application by id
+ *
+ * @param app_id Application id
+ * @param reason reason of unregistering application
+ * @param is_resuming describes - is this unregister
+ * is normal or need to be resumed\
+ * @param is_unexpected_disconnect
+ * Indicates if connection was unexpectedly lost(TM layer, HB)
+ */
+ virtual void UnregisterApplication(const uint32_t& app_id,
+ mobile_apis::Result::eType reason,
+ bool is_resuming = false,
+ bool is_unexpected_disconnect = false) = 0;
+
+ /**
+ * @ Updates request timeout
+ *
+ * @param connection_key Connection key of application
+ * @param mobile_correlation_id Correlation ID of the mobile request
+ * @param new_timeout_value New timeout in milliseconds to be set
+ */
+ virtual void updateRequestTimeout(uint32_t connection_key,
+ uint32_t mobile_correlation_id,
+ uint32_t new_timeout_value) = 0;
+
+ virtual StateController& state_controller() = 0;
+
+ virtual void SetUnregisterAllApplicationsReason(
+ mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0;
+
+ /*
+ * @brief Called on Master_reset or Factory_defaults
+ * when User chooses to reset HU.
+ * Resets Policy Table if applicable.
+ */
+ virtual void HeadUnitReset(
+ mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0;
+
+ /**
+ * @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
+ */
+ virtual bool HMILevelAllowsStreaming(
+ uint32_t app_id, protocol_handler::ServiceType service_type) const = 0;
+
+ /**
+ * @brief Checks, if given RPC is allowed at current HMI level for specific
+ * application in policy table
+ * @param policy_app_id Application id
+ * @param hmi_level Current HMI level of application
+ * @param function_id FunctionID of RPC
+ * @param params_permissions Permissions for RPC parameters (e.g.
+ * SubscribeVehicleData) defined in policy table
+ * @return SUCCESS, if allowed, otherwise result code of check
+ */
+ virtual mobile_apis::Result::eType CheckPolicyPermissions(
+ const ApplicationSharedPtr app,
+ const std::string& function_id,
+ const RPCParams& rpc_params,
+ CommandParametersPermissions* params_permissions = NULL) = 0;
+
+ /**
+ * @brief IsApplicationForbidden allows to distinguish if application is
+ * not allowed to register, because of spamming.
+ *
+ * @param connection_key the connection key ofthe required application
+ *
+ * @param policy_app_id application's mobile(policy) identifier.
+ *
+ * @return true in case application is allowed to register, false otherwise.
+ */
+ virtual bool IsApplicationForbidden(
+ uint32_t connection_key, const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief IsAppInReconnectMode check if application belongs to session
+ * affected by transport switching at the moment
+ * @param policy_app_id Application id
+ * @return True if application is registered within session being switched,
+ * otherwise - false
+ */
+ virtual bool IsAppInReconnectMode(const std::string& policy_app_id) const = 0;
+
+ virtual resumption::ResumeCtrl& resume_controller() = 0;
+
+ /**
+ * @brief hmi_interfaces getter for hmi_interfaces component, that handle
+ * hmi_instrfaces state
+ * @return reference to hmi_interfaces component
+ */
+ virtual HmiInterfaces& hmi_interfaces() = 0;
+
+ virtual app_launch::AppLaunchCtrl& app_launch_ctrl() = 0;
+
+ /*
+ * @brief Converts connection string transport type representation
+ * to HMI Common_TransportType
+ *
+ * @param transport_type String representing connection type
+ *
+ * @return Corresponding HMI TransporType value
+ */
+ virtual hmi_apis::Common_TransportType::eType GetDeviceTransportType(
+ const std::string& transport_type) = 0;
+
+ /**
+ * @brief method adds application
+ * to tts_global_properties_app_list_
+ * @param app_id contains application which will
+ * send TTS global properties after timeout
+ */
+ virtual void AddAppToTTSGlobalPropertiesList(const uint32_t app_id) = 0;
+
+ /**
+ * Generate grammar ID
+ *
+ * @return New grammar ID
+ */
+ virtual uint32_t GenerateGrammarID() = 0;
+
+ virtual policy::DeviceConsent GetUserConsentForDevice(
+ const std::string& device_id) const = 0;
+
+ /**
+ * @brief Handle sequence for unauthorized application
+ * @param app_id Application id
+ */
+ virtual void OnAppUnauthorized(const uint32_t& app_id) = 0;
+
+ virtual bool ActivateApplication(ApplicationSharedPtr app) = 0;
+
+ /**
+ * @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
+ */
+ virtual void OnAppStreaming(uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool state) = 0;
+
+ /**
+ * @brief CreateRegularState create regular HMI state for application
+ * @param app Application
+ * @param hmi_level of returned state
+ * @param audio_state of returned state
+ * @param system_context of returned state
+ * @return new regular HMI state
+ */
+ virtual HmiStatePtr CreateRegularState(
+ utils::SharedPtr<Application> app,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::SystemContext::eType system_context) const = 0;
+
+ /**
+ * DEPRECATED
+ * @brief CreateRegularState create regular HMI state for application
+ * @param app_id Application id
+ * @param hmi_level of returned state
+ * @param audio_state of returned state
+ * @param system_context of returned state
+ * @return new regular HMI state
+ */
+ virtual HmiStatePtr CreateRegularState(
+ uint32_t app_id,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::SystemContext::eType system_context) const = 0;
+
+ virtual void SendAudioPassThroughNotification(
+ uint32_t session_key, std::vector<uint8_t>& binary_data) = 0;
+
+ /**
+ * @brief Checks if application can stream (streaming service is started and
+ * streaming is enabled in application)
+ * @param app_id Application id
+ * @param service_type Service type to check
+ * @return True if streaming is allowed, false in other case
+ */
+ virtual bool CanAppStream(
+ uint32_t app_id, protocol_handler::ServiceType service_type) const = 0;
+
+ /**
+ * @brief ForbidStreaming forbid the stream over the certain application.
+ * @param app_id the application's id which should stop streaming.
+ */
+ virtual void ForbidStreaming(uint32_t app_id) = 0;
+
+ /**
+ * @brief Called when application completes streaming configuration
+ * @param app_id Streaming application id
+ * @param service_type Streaming service type
+ * @param result true if configuration is successful, false otherwise
+ * @param rejected_params list of rejected parameters' name. Valid
+ * only when result is false.
+ */
+ virtual void OnStreamingConfigured(
+ uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params) = 0;
+
+ virtual const ApplicationManagerSettings& get_settings() const = 0;
+
+ virtual event_engine::EventDispatcher& event_dispatcher() = 0;
+
+ virtual uint32_t GetAvailableSpaceForApp(const std::string& folder_name) = 0;
+ virtual void OnTimerSendTTSGlobalProperties() = 0;
+ virtual void OnLowVoltage() = 0;
+ virtual void OnWakeUp() = 0;
+};
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_APPLICATION_MANAGER_H_
diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h
index 899b098359..e745a831c6 100644
--- a/src/components/include/application_manager/application_manager_settings.h
+++ b/src/components/include/application_manager/application_manager_settings.h
@@ -63,6 +63,7 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual bool launch_hmi() const = 0;
virtual const uint32_t& delete_file_in_none() const = 0;
virtual const std::vector<uint32_t>& supported_diag_modes() const = 0;
+ virtual const std::string& app_info_storage() const = 0;
virtual const uint32_t& list_files_in_none() const = 0;
virtual const std::string& tts_delimiter() const = 0;
virtual const uint32_t& put_file_in_none() const = 0;
@@ -86,13 +87,14 @@ class ApplicationManagerSettings : public RequestControlerSettings,
virtual const uint32_t& app_resuming_timeout() const = 0;
virtual uint16_t attempts_to_open_resumption_db() const = 0;
virtual uint16_t open_attempt_timeout_ms_resumption_db() const = 0;
- virtual void config_file_name(const std::string& fileName) = 0;
+ virtual void set_config_file_name(const std::string& fileName) = 0;
virtual const std::pair<uint32_t, int32_t>& start_stream_retry_amount()
const = 0;
virtual const std::string& app_icons_folder() const = 0;
virtual const uint32_t& app_icons_folder_max_size() const = 0;
virtual const uint32_t& app_icons_amount_to_remove() const = 0;
virtual const uint32_t& list_files_response_size() const = 0;
+ virtual const std::string& plugins_folder() const = 0;
};
} // namespace application_manager
diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
index 39cedf3273..1283584ef8 100644
--- a/src/components/include/application_manager/hmi_capabilities.h
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -38,18 +38,12 @@
#include "json/json.h"
#include "utils/macro.h"
#include "application_manager/hmi_language_handler.h"
+#include "smart_objects/smart_object.h"
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
namespace resumption {
class LastState;
}
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
-
namespace application_manager {
class ApplicationManager;
@@ -96,6 +90,9 @@ class HMICapabilities {
virtual bool is_ivi_cooperating() const = 0;
virtual void set_is_ivi_cooperating(const bool value) = 0;
+ virtual bool is_rc_cooperating() const = 0;
+ virtual void set_is_rc_cooperating(const bool value) = 0;
+
/*
* @brief Interface used to store information about software version of the
*target
@@ -415,6 +412,93 @@ class HMICapabilities {
*/
virtual bool phone_call_supported() const = 0;
+ /*
+ * @brief Interface to store whether HMI supports video streaming
+ *
+ * @param supported Indicates whether video streaming is supported by HMI
+ */
+ virtual void set_video_streaming_supported(const bool supported) = 0;
+
+ /*
+ * @brief Retrieves whether HMI supports video streaming
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool video_streaming_supported() const = 0;
+
+ /*
+ * @brief Interface to store whether HMI supports remote control
+ *
+ * @param supported Indicates whether remote control is supported by HMI
+ */
+ virtual void set_rc_supported(const bool supported) = 0;
+
+ /*
+ * @brief Retrieves whether HMI supports remote control
+ *
+ * @return TRUE if it supported, otherwise FALSE
+ */
+ virtual bool rc_supported() const = 0;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the navigation "System Capability"
+ *
+ * @param navigation_capability contains information related
+ * to the navigation system capability.
+ */
+ virtual void set_navigation_capability(
+ const smart_objects::SmartObject& navigation_capability) = 0;
+
+ /*
+ * @brief Retrieves information regarding the navigation system capability
+ *
+ * @return NAVIGATION system capability
+ */
+ virtual const smart_objects::SmartObject* navigation_capability() const = 0;
+
+ /*
+ * @brief Interface used to store information regarding
+ * the phone "System Capability"
+ *
+ * @param phone_capability contains information related
+ * to the phone system capability.
+ */
+ virtual void set_phone_capability(
+ const smart_objects::SmartObject& phone_capability) = 0;
+
+ /*
+ * @brief Retrieves information regarding the phone call system capability
+ *
+ * @return PHONE_CALL system capability
+ */
+ virtual const smart_objects::SmartObject* phone_capability() const = 0;
+
+ /*
+ * @brief Sets HMI's video streaming related capability information
+ *
+ * @param video_streaming_capability the video streaming related capabilities
+ */
+ virtual void set_video_streaming_capability(
+ const smart_objects::SmartObject& video_streaming_capability) = 0;
+
+ /*
+ * @brief Retrieves HMI's video streaming related capabilities
+ *
+ * @return HMI's video streaming related capability information
+ */
+ virtual const smart_objects::SmartObject* video_streaming_capability()
+ const = 0;
+
+ /**
+ * @brief Sets available RC capabilities for further usage by RC functionality
+ * @param rc_capability capabilities to set
+ */
+ virtual void set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) = 0;
+
+ virtual const smart_objects::SmartObject* rc_capability() const = 0;
+
virtual void Init(resumption::LastState* last_state) = 0;
/**
diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h
index 8fdb56b6df..f0859ece38 100644
--- a/src/components/include/application_manager/policies/policy_handler_interface.h
+++ b/src/components/include/application_manager/policies/policy_handler_interface.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -39,15 +39,21 @@
#include <vector>
#include <queue>
#include "interfaces/MOBILE_API.h"
-#include "policy/policy_types.h"
#include "application_manager/policies/policy_handler_observer.h"
+#include "application_manager/core_service.h"
+#include "application_manager/application.h"
#include "policy/usage_statistics/statistics_manager.h"
#include "utils/custom_string.h"
+#include "utils/callable.h"
#include "policy/policy_settings.h"
#include "smart_objects/smart_object.h"
+#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
+using namespace ::rpc::policy_table_interface_base;
namespace policy {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+
class PolicyHandlerInterface {
public:
virtual ~PolicyHandlerInterface() {}
@@ -69,13 +75,21 @@ class PolicyHandlerInterface {
virtual void OnPermissionsUpdated(const std::string& policy_app_id,
const Permissions& permissions) = 0;
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ virtual void OnSnapshotCreated(const BinaryMessage& pt_string,
+ const std::vector<int>& retry_delay_seconds,
+ uint32_t timeout_exchange) = 0;
+#else // EXTERNAL_PROPRIETARY_MODE
+ virtual void OnSnapshotCreated(const BinaryMessage& pt_string) = 0;
+#endif // EXTERNAL_PROPRIETARY_MODE
+
virtual bool GetPriority(const std::string& policy_app_id,
std::string* priority) const = 0;
- virtual void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result) = 0;
+ virtual void CheckPermissions(
+ const application_manager::ApplicationSharedPtr app,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) = 0;
virtual uint32_t GetNotificationsNumber(
const std::string& priority) const = 0;
@@ -86,12 +100,24 @@ class PolicyHandlerInterface {
virtual bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
StringArray* app_hmi_types = NULL) = 0;
- virtual void GetServiceUrls(const std::string& service_type,
- EndpointUrls& end_points) = 0;
+ virtual void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) = 0;
+ virtual void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) = 0;
virtual std::string GetLockScreenIconUrl() const = 0;
- virtual void ResetRetrySequence() = 0;
virtual uint32_t NextRetryTimeout() = 0;
- virtual int TimeoutExchange() = 0;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ virtual uint32_t TimeoutExchangeSec() const = 0;
+
+ /**
+ * Gets timeout to wait until receive response
+ * @return timeout in miliseconds
+ */
+ virtual uint32_t TimeoutExchangeMSec() const = 0;
virtual void OnExceededTimeout() = 0;
virtual void OnSystemReady() = 0;
virtual void PTUpdatedAt(Counters counter, int value) = 0;
@@ -131,11 +157,11 @@ class PolicyHandlerInterface {
/**
* @brief Process user consent on mobile data connection access
- * @param Device id or empty string, if concern to all SDL functionality
- * @param User consent from response
+ * @param is_allowed - user consent from response
+ * @param device_mac - mac adress of device
*/
virtual void OnAllowSDLFunctionalityNotification(
- bool is_allowed, const std::string& device_id) = 0;
+ bool is_allowed, const std::string& device_mac) = 0;
/**
* @brief Increment counter for ignition cycles
@@ -166,14 +192,23 @@ class PolicyHandlerInterface {
virtual void SetDeviceInfo(const std::string& device_id,
const DeviceInfo& device_info) = 0;
- /**
- * @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
- */
+/**
+*@brief Processes data from OnAppPermissionConsent notification with
+*permissions changes and ExternalConsent status changes done by user
+*@param connection_key Connection key of application, 0 if no key has been
+*provided
+*@param permissions Groups permissions changes
+*@param external_consent_status Customer connectivity settings status changes
+*/
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ virtual void OnAppPermissionConsent(
+ const uint32_t connection_key,
+ const PermissionConsent& permissions,
+ const ExternalConsentStatus& external_consent_status) = 0;
+#else
virtual void OnAppPermissionConsent(const uint32_t connection_key,
const PermissionConsent& permissions) = 0;
+#endif
/**
* @brief Get appropriate message parameters and send them with response
@@ -282,6 +317,11 @@ class PolicyHandlerInterface {
virtual void OnCertificateUpdated(const std::string& certificate_data) = 0;
+ virtual void OnPTUFinished(const bool ptu_result) = 0;
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ virtual void OnCertificateDecrypted(bool is_succeeded) = 0;
+#endif // EXTERNAL_PROPRIETARY_MODE
virtual bool CanUpdate() = 0;
virtual void OnDeviceConsentChanged(const std::string& device_id,
@@ -295,8 +335,11 @@ class PolicyHandlerInterface {
* @brief Allows to add new or update existed application during
* registration process
* @param application_id The policy aplication id.
+ * @return function that will notify update manager about new application
*/
- virtual void AddApplication(const std::string& application_id) = 0;
+ virtual StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) = 0;
/**
* Checks whether application is revoked
@@ -326,7 +369,7 @@ class PolicyHandlerInterface {
/**
* @brief Handler on applications search completed
*/
- virtual void OnAppsSearchCompleted() = 0;
+ virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
/**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
@@ -360,7 +403,13 @@ class PolicyHandlerInterface {
* @return Structure with vehicle information
*/
virtual const VehicleInfo GetVehicleInfo() const = 0;
-
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ /**
+ * @brief Gets meta information
+ * @return meta information
+ */
+ virtual const policy::MetaInfo GetMetaInfo() const = 0;
+#endif // EXTERNAL_PROPRIETARY_MODE
virtual void Increment(usage_statistics::GlobalCounterId type) = 0;
virtual void Increment(const std::string& app_id,
usage_statistics::AppCounterId type) = 0;
@@ -378,9 +427,105 @@ class PolicyHandlerInterface {
virtual const PolicySettings& get_settings() const = 0;
virtual const std::string RemoteAppsUrl() const = 0;
+ /**
+ * @brief OnDeviceSwitching Notifies policy manager on device switch event so
+ * policy permissions should be processed accordingly
+ * @param device_id_from Id of device being switched
+ * @param device_id_to Id of device on the new transport
+ */
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Sets HMI default type for specified application
+ * @param application_id ID application
+ * @param app_types list of HMI types
+ */
+ virtual void SetDefaultHmiTypes(
+ const std::string& application_id,
+ const smart_objects::SmartObject* app_types) = 0;
+
+ /**
+ * Checks if application has HMI type
+ * @param application_id ID application
+ * @param hmi HMI type to check
+ * @param app_types additional list of HMI type to search in it
+ * @return true if hmi is contained in policy or app_types
+ */
+ virtual bool CheckHMIType(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types) = 0;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in HMI status
+ * @param device_id Device on which app is running
+ * @param policy_app_id ID of application
+ * @param hmi_level new HMI level for this application
+ */
+ virtual void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * Gets all allowed module types
+ * @param app_id unique identifier of application
+ * @param list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+#endif // SDL_REMOTE_CONTROL
+
private:
+/**
+ * @brief Processes data received via OnAppPermissionChanged notification
+ * from. Being started asyncronously from AppPermissionDelegate class.
+ * Sets updated permissions and ExternalConsent for registered applications
+*and
+ * applications which already have appropriate group assigned which related to
+ * devices already known by policy
+ * @param connection_key Connection key of application, 0 if no key has been
+ * provided within notification
+ * @param external_consent_status Customer connectivity settings changes to
+*process
+*@param permissions Permissions changes to process
+ */
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ virtual void OnAppPermissionConsentInternal(
+ const uint32_t connection_key,
+ const ExternalConsentStatus& external_consent_status,
+ PermissionConsent& out_permissions) = 0;
+#else
virtual void OnAppPermissionConsentInternal(
- const uint32_t connection_key, PermissionConsent& permissions) = 0;
+ const uint32_t connection_key, PermissionConsent& out_permissions) = 0;
+#endif
friend class AppPermissionDelegate;
};
diff --git a/src/components/include/application_manager/policies/policy_handler_observer.h b/src/components/include/application_manager/policies/policy_handler_observer.h
new file mode 100644
index 0000000000..1c32102184
--- /dev/null
+++ b/src/components/include/application_manager/policies/policy_handler_observer.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_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_OBSERVER_H_
+
+#include <map>
+#include <vector>
+#include <string>
+
+namespace policy {
+
+class PolicyHandlerObserver {
+ public:
+ virtual void OnUpdateHMIAppType(
+ std::map<std::string, std::vector<std::string> > app_hmi_types) {}
+
+ virtual bool OnCertificateUpdated(const std::string& certificate_data) {
+ return false;
+ }
+
+ virtual void OnPTUFinished(const bool ptu_result) {}
+
+ virtual ~PolicyHandlerObserver() {}
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_POLICIES_POLICY_HANDLER_OBSERVER_H_
diff --git a/src/components/include/application_manager/request_controller_settings.h b/src/components/include/application_manager/request_controller_settings.h
index 297b3f7ba1..04b47a3b78 100644
--- a/src/components/include/application_manager/request_controller_settings.h
+++ b/src/components/include/application_manager/request_controller_settings.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H
-#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H
+#ifndef SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H_
namespace application_manager {
class RequestControlerSettings {
@@ -45,4 +45,4 @@ class RequestControlerSettings {
virtual const uint32_t& pending_requests_amount() const = 0;
};
} // namespace application_manager
-#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H
+#endif // SRC_COMPONENTS_INCLUDE_APPLICATION_MANAGER_REQUEST_CONTROLLER_SETTINGS_H_
diff --git a/src/components/include/connection_handler/connection_handler.h b/src/components/include/connection_handler/connection_handler.h
new file mode 100644
index 0000000000..1fcf5e4477
--- /dev/null
+++ b/src/components/include/connection_handler/connection_handler.h
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
+#define SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
+
+#include "connection_handler/connection_handler_settings.h"
+#include "transport_manager/transport_manager_listener.h"
+#include "protocol_handler/session_observer.h"
+#include "connection_handler/device.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/devices_discovery_starter.h"
+#include "utils/macro.h"
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+
+enum CloseSessionReason { kCommon = 0, kFlood, kMalformed, kUnauthorizedApp };
+
+class ConnectionHandlerObserver;
+
+/**
+ * \class ConnectionHandler
+ * \brief SmartDeviceLink ConnectionHandler interface class
+ */
+class ConnectionHandler {
+ public:
+ /**
+ * \brief Sets observer pointer for ConnectionHandler.
+ * \param observer Pointer to observer object.
+ **/
+ virtual void set_connection_handler_observer(
+ ConnectionHandlerObserver* observer) = 0;
+
+ virtual void StartTransportManager() = 0;
+
+ virtual void ConnectToDevice(
+ connection_handler::DeviceHandle device_handle) = 0;
+
+ /**
+ * @brief RunAppOnDevice allows to run specific application on the certain
+ *device.
+ *
+ * @param device_handle device identifier to run application on.
+ *
+ * @param app_id application id also known as bundle id on some devices to
+ *run.
+ */
+ virtual void RunAppOnDevice(const std::string& device_handle,
+ const std::string& bundle_id) const = 0;
+
+ virtual void ConnectToAllDevices() = 0;
+
+ /**
+ * @brief Close the connection revoked by Policy
+ * @param connection_key pair of connection and session id
+ */
+ virtual void CloseRevokedConnection(uint32_t connection_key) = 0;
+
+ /**
+ * \brief Close all associated sessions and close the connection pointed by
+ * handle
+ */
+ virtual void CloseConnection(ConnectionHandle connection_handle) = 0;
+
+ /**
+ * \brief Return count of session for specified connection
+ * \param connection_key pair of connection handle and session id
+ */
+ virtual uint32_t GetConnectionSessionsCount(uint32_t connection_key) = 0;
+
+ /**
+ * Gets device id by mac address
+ * @param mac_address
+ * @return true if successfully
+ */
+ virtual bool GetDeviceID(const std::string& mac_address,
+ DeviceHandle* device_handle) = 0;
+
+ /**
+ * Close session associated with the key
+ */
+ virtual void CloseSession(uint32_t key, CloseSessionReason close_reason) = 0;
+
+ /**
+ * Close session
+ */
+ virtual void CloseSession(ConnectionHandle connection_handle,
+ 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
+ *
+ * \param connection_key pair of connection and session id
+ */
+ virtual void StartSessionHeartBeat(uint32_t connection_key) = 0;
+
+ /**
+ * \brief Send heartbeat to mobile app
+ */
+ virtual void SendHeartBeat(ConnectionHandle connection_handle,
+ uint8_t session_id) = 0;
+
+ /**
+ * Sets heart beat timeout for specified session
+ * @param connection_key pair of connection and session id
+ * @param timeout in milliseconds
+ */
+ virtual void SetHeartBeatTimeout(uint32_t connection_key,
+ uint32_t timeout) = 0;
+
+ /**
+ * \brief Keep connection associated with the key from being closed by
+ * heartbeat monitor
+ */
+ virtual void KeepConnectionAlive(uint32_t connection_key,
+ uint8_t session_id) = 0;
+
+ /**
+ * \brief binds protocol version with session
+ *
+ * \param connection_key pair of connection and session id
+ * \param protocol_version contains protocol version of
+ * \registered application.
+ */
+ virtual void BindProtocolVersionWithSession(uint32_t connection_key,
+ uint8_t protocol_version) = 0;
+
+ /**
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ virtual int32_t GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ connection_handler::DeviceHandle* device_id) const = 0;
+
+ /**
+ * DEPRECATED
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ DEPRECATED virtual int32_t GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ uint32_t* device_id) const = 0;
+
+ /**
+ * @brief GetConnectedDevicesMAC allows to obtain MAC adresses for all
+ * currently connected devices.
+ *
+ * @param device_macs collection of MAC adresses for connected devices.
+ */
+ virtual void GetConnectedDevicesMAC(
+ std::vector<std::string>& device_macs) const = 0;
+
+ /**
+ * \brief Connection handler settings getter
+ * \return pointer to connection handler settings class
+ */
+ virtual const ConnectionHandlerSettings& get_settings() const = 0;
+
+ virtual const protocol_handler::SessionObserver& get_session_observer() = 0;
+
+ virtual DevicesDiscoveryStarter& get_device_discovery_starter() = 0;
+
+ /**
+ * \brief Invoked when observer's OnServiceStartedCallback is completed
+ * \param session_key the key of started session passed to
+ * OnServiceStartedCallback().
+ * \param result true if observer accepts starting service, false otherwise
+ * \param rejected_params list of rejected parameters' name. Only valid when
+ * result is false. Note that even if result is false, this may be empty.
+ *
+ * \note This is invoked only once but can be invoked by multiple threads.
+ * Also it can be invoked before OnServiceStartedCallback() returns.
+ **/
+ virtual void NotifyServiceStartedResult(
+ uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params) = 0;
+
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~ConnectionHandler() {}
+};
+} // namespace connection_handler
+
+#endif // SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_H_
diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h
new file mode 100644
index 0000000000..1bd919f30e
--- /dev/null
+++ b/src/components/include/connection_handler/connection_handler_observer.h
@@ -0,0 +1,168 @@
+/*
+ * 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_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
+
+#include <string>
+#include "connection_handler/device.h"
+#include "connection_handler/connection.h"
+#include "connection_handler/connection_handler.h"
+#include "protocol/service_type.h"
+
+#ifdef ENABLE_SECURITY
+#include "security_manager/ssl_context.h"
+#endif // ENABLE_SECURITY
+
+struct BsonObject;
+
+/**
+ * \namespace connection_handler
+ * \brief SmartDeviceLink connection_handler namespace.
+ */
+namespace connection_handler {
+
+/**
+ * \class ConnectionHandlerObserver
+ * \brief ConnectionHandlerObserver class
+ */
+class ConnectionHandlerObserver {
+ public:
+ /**
+ * \brief Available devices list updated.
+ *
+ * Called when device scanning initiated with scanForNewDevices
+ * is completed.
+ *
+ * \param DeviceList New list of available devices.
+ **/
+ virtual void OnDeviceListUpdated(
+ const connection_handler::DeviceMap& device_list) = 0;
+
+ /**
+ * @brief Reaction to "Find new applications" request
+ */
+ virtual void OnFindNewApplicationsRequest() = 0;
+
+ /**
+ * \brief Removes device.
+ *
+ * Called when device has been removed from a list.
+ *
+ * \param DeviceHandle Handle of removed device.
+ **/
+ virtual void RemoveDevice(
+ const connection_handler::DeviceHandle& device_handle) = 0;
+
+ /**
+ * \brief Callback function used by connection_handler
+ * when Mobile Application initiates start of new service.
+ * \param deviceHandle Device identifier within which session has to be
+ * started.
+ * \param sessionKey Key of started session.
+ * \param type Established service type
+ */
+ virtual bool OnServiceStartedCallback(
+ const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type) = 0;
+
+ /**
+ * \brief Callback function used by connection_handler
+ * when Mobile Application initiates start of new service.
+ * Result must be notified through NotifyServiceStartedResult().
+ * \param deviceHandle Device identifier within which session has to be
+ * started.
+ * \param sessionKey Key of started session.
+ * \param type Established service type
+ * \param params Configuration parameters for this service
+ */
+ virtual void OnServiceStartedCallback(
+ const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params) = 0;
+
+ /**
+ * \brief Callback function used by connection_handler
+ * when Mobile Application initiates service ending.
+ * \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,
+ const connection_handler::CloseSessionReason& close_reason) = 0;
+
+ /**
+ * @brief OnDeviceSwitchingStart is invoked on device transport switching
+ * start (e.g. from Bluetooth to USB)
+ * @param device_from device params being switched to new transport
+ * @param device_to device params on the new transport
+ */
+ virtual void OnDeviceSwitchingStart(const Device& device_from,
+ const Device& device_to) = 0;
+
+ /**
+ * @brief OnDeviceSwitchingFinish is invoked on device trasport switching end
+ * i.e. timeout for switching is expired
+ * @param device_uid UID of device being switched
+ */
+ virtual void OnDeviceSwitchingFinish(const std::string& device_uid) = 0;
+
+#ifdef ENABLE_SECURITY
+ /**
+ * @brief Get unique handshake context by application id
+ * @param key id of application
+ * @return generated handshake context or empty context if application with
+ * provided id does not exist
+ */
+ virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
+ uint32_t key) const = 0;
+
+ /**
+ * @brief Check if application with specified app_id has NAVIGATION HMI type
+ * @param app_id id of application to check
+ * @return true if application is navi otherwise returns false
+ */
+ virtual bool CheckAppIsNavi(const uint32_t app_id) const = 0;
+#endif // ENABLE_SECURITY
+ protected:
+ /**
+ * \brief Destructor
+ */
+ virtual ~ConnectionHandlerObserver() {}
+};
+} // namespace connection_handler
+
+#endif // SRC_COMPONENTS_INCLUDE_CONNECTION_HANDLER_CONNECTION_HANDLER_OBSERVER_H_
diff --git a/src/components/include/hmi_message_handler/hmi_message_adapter.h b/src/components/include/hmi_message_handler/hmi_message_adapter.h
new file mode 100644
index 0000000000..704cc619be
--- /dev/null
+++ b/src/components/include/hmi_message_handler/hmi_message_adapter.h
@@ -0,0 +1,66 @@
+/*
+ * 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_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
+#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
+
+#include "hmi_message_handler/hmi_message_sender.h"
+
+namespace hmi_message_handler {
+/**
+ * \class HMIMessageAdapter
+ * \brief Interface class describing methods neccessary for exchanging message
+ * between ApplicationManager and HMI. Adapter for concrete transport connection
+ * SDL with HMI has to implement this interface.
+ */
+class HMIMessageAdapter : public HMIMessageSender {
+ public:
+ /**
+ * \brief Destructor
+ */
+ virtual ~HMIMessageAdapter() {}
+
+ protected:
+ /**
+ * \brief Interface for subscriptions.
+ * Each class implementing interface should use it according to
+ * standarts of transport for which it is to be an adapter.
+ * For example, Adapter for MessageBroker will use it to subscribe to
+ * notifications
+ * from HMI.
+ */
+ virtual void SubscribeTo() = 0;
+};
+
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_ADAPTER_H_
diff --git a/src/components/include/hmi_message_handler/hmi_message_handler.h b/src/components/include/hmi_message_handler/hmi_message_handler.h
new file mode 100644
index 0000000000..411d19fb75
--- /dev/null
+++ b/src/components/include/hmi_message_handler/hmi_message_handler.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
+#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
+
+#include "hmi_message_handler/hmi_message_sender.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+#include "hmi_message_handler/hmi_message_handler_settings.h"
+
+namespace hmi_message_handler {
+
+class HMIMessageAdapter;
+/**
+ * \class HMIMessageHandler
+ * \brief Abstract class for handling different HMI adapters;
+ * establishing interface for message exchange between SDL core and HMI.
+ */
+class HMIMessageHandler : public HMIMessageObserver, public HMIMessageSender {
+ public:
+ virtual ~HMIMessageHandler() {}
+ virtual void AddHMIMessageAdapter(HMIMessageAdapter* adapter) = 0;
+ virtual void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) = 0;
+
+ /**
+ * \brief Hmi message handler settings getter
+ * \return pointer to hmi message handler settings class
+ */
+ virtual const HMIMessageHandlerSettings& get_settings() const = 0;
+};
+
+} // namespace hmi_message_handler
+
+#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_H_
diff --git a/src/components/include/hmi_message_handler/hmi_message_handler_settings.h b/src/components/include/hmi_message_handler/hmi_message_handler_settings.h
index 5386869555..8b24f2cf7d 100644
--- a/src/components/include/hmi_message_handler/hmi_message_handler_settings.h
+++ b/src/components/include/hmi_message_handler/hmi_message_handler_settings.h
@@ -44,7 +44,7 @@ class HMIMessageHandlerSettings {
public:
virtual ~HMIMessageHandlerSettings() {}
- virtual const uint64_t& thread_min_stack_size() const = 0;
+ virtual const uint64_t thread_min_stack_size() const = 0;
};
} // namespace hmi_message_handler
#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_SETTINGS_H_
diff --git a/src/components/include/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h
new file mode 100644
index 0000000000..0676615b53
--- /dev/null
+++ b/src/components/include/hmi_message_handler/hmi_message_observer.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
+
+#include "utils/shared_ptr.h"
+
+namespace application_manager {
+class Message;
+}
+
+namespace hmi_message_handler {
+
+class HMIMessageObserver {
+ public:
+ virtual ~HMIMessageObserver() {}
+ virtual void OnMessageReceived(
+ utils::SharedPtr<application_manager::Message> message) = 0;
+ virtual void OnErrorSending(
+ utils::SharedPtr<application_manager::Message> message) = 0;
+};
+}
+
+#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_
diff --git a/src/components/include/hmi_message_handler/hmi_message_sender.h b/src/components/include/hmi_message_handler/hmi_message_sender.h
new file mode 100644
index 0000000000..91c20a1986
--- /dev/null
+++ b/src/components/include/hmi_message_handler/hmi_message_sender.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
+#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
+
+#include "application_manager/message.h"
+
+namespace hmi_message_handler {
+typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
+
+class HMIMessageSender {
+ public:
+ virtual ~HMIMessageSender() {}
+ virtual void SendMessageToHMI(MessageSharedPointer message) = 0;
+};
+}
+
+#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_SENDER_H_
diff --git a/src/components/include/media_manager/media_manager.h b/src/components/include/media_manager/media_manager.h
new file mode 100644
index 0000000000..64acbcbc0b
--- /dev/null
+++ b/src/components/include/media_manager/media_manager.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 SRC_COMPONENTS_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
+
+#include <string>
+#include "protocol/service_type.h"
+#include "media_manager/media_manager_settings.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 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 void FramesProcessed(int32_t application_key,
+ int32_t frame_number) = 0;
+ /**
+ * \brief Media manager settings getter
+ * \return pointer to media manager settings class
+ */
+ virtual const MediaManagerSettings& settings() const = 0;
+
+ virtual ~MediaManager() {}
+};
+
+} // namespace media_manager
+
+#endif // SRC_COMPONENTS_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h
new file mode 100644
index 0000000000..e850a3fa2b
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -0,0 +1,180 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
+
+#include <queue>
+
+#include "policy/policy_types.h"
+#include "utils/custom_string.h"
+
+namespace policy {
+
+namespace custom_str = utils::custom_string;
+
+class PolicyListener {
+ public:
+ virtual ~PolicyListener() {}
+ 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 OnUpdateStatusChanged(const std::string&) = 0;
+
+ /**
+ * Gets device ID
+ * @param policy_app_id
+ * @return device ID
+ * @deprecated see std::vector<std::string> GetDevicesIds(const std::string&)
+ */
+ virtual std::string OnCurrentDeviceIdUpdateRequired(
+ const std::string& policy_app_id) = 0;
+ virtual void OnSystemInfoUpdateRequired() = 0;
+ virtual custom_str::CustomString GetAppName(
+ const std::string& policy_app_id) = 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,
+ uint32_t timeout_exceed) = 0;
+
+ /**
+ * @brief Make appropriate changes for related applications permissions and
+ * notify them, if it possible
+ * @param device_id Unique device id, which consent had been changed
+ * @param device_consent Device consent, which is done by user
+ */
+ virtual void OnDeviceConsentChanged(const std::string& device_id,
+ bool is_allowed) = 0;
+
+ /**
+ * @brief Sends OnAppPermissionsChanged notification to HMI
+ * @param permissions contains parameter for OnAppPermisionChanged
+ * @param policy_app_id contains policy application id
+ */
+ virtual void SendOnAppPermissionsChanged(
+ const AppPermissions& permissions,
+ const std::string& policy_app_id) const = 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;
+
+ /**
+ * @brief OnPTUFinishedd the callback which signals PTU has finished
+ *
+ * @param ptu_result the result from the PTU - true if successful,
+ * otherwise false.
+ */
+ virtual void OnPTUFinished(const bool ptu_result) = 0;
+
+ /**
+ * @brief Collects currently registered applications ids linked to their
+ * device id
+ * @return Collection of device_id-to-app_id links
+ */
+ virtual void GetRegisteredLinks(
+ std::map<std::string, std::string>& out_links) const = 0;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * Gets devices ids by policy application id
+ * @param policy_app_id
+ * @return list devices ids
+ */
+ virtual std::vector<std::string> GetDevicesIds(
+ const std::string& policy_app_id) = 0;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) = 0;
+
+ /**
+ * Notifies about changing HMI status
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+#endif // SDL_REMOTE_CONTROL
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h
new file mode 100644
index 0000000000..24905671fa
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -0,0 +1,655 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
+
+#include <vector>
+
+#include "utils/callable.h"
+
+#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_listener.h"
+#include "policy/usage_statistics/statistics_manager.h"
+
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/access_remote.h"
+#endif // SDL_REMOTE_CONTROL
+
+namespace policy {
+class PolicySettings;
+typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+
+class PolicyManager : public usage_statistics::StatisticsManager {
+ public:
+ /**
+ * @brief The NotificationMode enum defines whether application will be
+ * notified about changes done (e.g. after consents were changed) or not
+ */
+ enum NotificationMode { kSilentMode, kNotifyApplicationMode };
+ virtual ~PolicyManager() {}
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ virtual void set_listener(PolicyListener* listener) = 0;
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ virtual bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) = 0;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ virtual bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) = 0;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ virtual bool ResetPT(const std::string& file_name) = 0;
+
+ /**
+ * @brief Gets last URL for sending PTS to from PT itself
+ * @param service_type Service specifies user of URL
+ * @return last URL or empty string if endpoint entry is empty
+ */
+ virtual std::string GetUpdateUrl(int service_type) = 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 void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) = 0;
+ virtual void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_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 PTU is needed, for this PTS has to be formed and sent.
+ */
+ virtual void RequestPTUpdate() = 0;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param CheckPermissionResult containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) = 0;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ virtual bool ResetUserConsent() = 0;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ virtual std::string GetPolicyTableStatus() const = 0;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ virtual void KmsChanged(int kilometers) = 0;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ virtual void IncrementIgnitionCycles() = 0;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ virtual std::string ForcePTExchange() = 0;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ virtual std::string ForcePTExchangeAtUserRequest() = 0;
+
+ /**
+ * @brief Resets retry sequence
+ */
+ virtual void ResetRetrySequence() = 0;
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ virtual int NextRetryTimeout() = 0;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ virtual uint32_t TimeoutExchangeMSec() = 0;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ virtual void OnExceededTimeout() = 0;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ virtual void OnUpdateStarted() = 0;
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ virtual DeviceConsent GetUserConsentForDevice(
+ const std::string& device_id) const = 0;
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ virtual void GetUserConsentForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) = 0;
+
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ virtual void SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) = 0;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ const bool is_device_allowed) = 0;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ virtual void PTUpdatedAt(Counters counter, int value) = 0;
+
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ virtual bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) = 0;
+
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ virtual void AddDevice(const std::string& device_id,
+ const std::string& connection_type) = 0;
+
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ virtual void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) = 0;
+
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ * @param mode notification mode
+ */
+ virtual void SetUserConsentForApp(const PermissionConsent& permissions,
+ const NotificationMode mode) = 0;
+
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const = 0;
+
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const = 0;
+
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @param active_hmi_language Currently active language
+ * @return Array of structs with appropriate message parameters
+ */
+ virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ const std::vector<std::string>& message_code,
+ const std::string& language,
+ const std::string& active_hmi_language) = 0;
+
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ virtual void GetPermissionsForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) = 0;
+
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ virtual AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) = 0;
+
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
+
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ virtual std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ virtual void SetSystemLanguage(const std::string& language) = 0;
+
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ virtual void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ virtual void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) = 0;
+
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ virtual void MarkUnpairedDevice(const std::string& device_id) = 0;
+
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
+ virtual StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) = 0;
+
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool CleanupUnpairedDevices() = 0;
+
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ virtual void OnSystemReady() = 0;
+
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ virtual uint32_t GetNotificationsNumber(
+ const std::string& priority) const = 0;
+
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ virtual void SetVINValue(const std::string& value) = 0;
+
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ virtual bool IsPredataPolicy(const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0;
+
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0;
+
+ /**
+ * @brief Handler on applications search started
+ */
+ virtual void OnAppsSearchStarted() = 0;
+
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
+
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
+
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ virtual const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const = 0;
+
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ virtual const VehicleInfo GetVehicleInfo() const = 0;
+
+ /**
+ * @brief Gets meta information
+ * @return meta information
+ */
+ virtual const MetaInfo GetMetaInfo() const = 0;
+
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ virtual std::string RetrieveCertificate() const = 0;
+
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ virtual bool HasCertificate() const = 0;
+
+ /**
+ * @brief Sets decrypted certificate in policy table
+ * @param certificate content of certificate
+ */
+ virtual void SetDecryptedCertificate(const std::string& certificate) = 0;
+
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
+ virtual const PolicySettings& get_settings() const = 0;
+
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
+ virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ virtual void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ virtual bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) = 0;
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) = 0;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ virtual void set_access_remote(
+ utils::SharedPtr<AccessRemote> access_remote) = 0;
+#endif // SDL_REMOTE_CONTROL
+
+ /**
+ * @brief Checks if there is existing URL in the EndpointUrls vector with
+ * index saved in the policy manager and if not, it moves to the next
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
+ virtual AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const = 0;
+
+ /**
+ * @brief Checks, if SDL needs to update it's policy table section
+ "external_consent_status"
+ * @param ExternalConsent status
+ * @return true if such check is needed, false - if not.
+ */
+ virtual bool IsNeedToUpdateExternalConsentStatus(
+ const ExternalConsentStatus& status) const = 0;
+
+ /**
+ * @brief Saves customer connectivity settings status
+ * @param status ExternalConsent status
+ * @return true if succeeded, otherwise - false
+ */
+ virtual bool SetExternalConsentStatus(
+ const ExternalConsentStatus& status) = 0;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return ExternalConsent status
+ */
+ virtual ExternalConsentStatus GetExternalConsentStatus() = 0;
+
+ protected:
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ virtual bool ExceededIgnitionCycles() = 0;
+
+ /**
+ * @brief 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
+
+extern "C" policy::PolicyManager* CreateManager();
+extern "C" void DeleteManager(policy::PolicyManager*);
+
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
diff --git a/src/components/include/policy/policy_external/policy/policy_settings.h b/src/components/include/policy/policy_external/policy/policy_settings.h
new file mode 100644
index 0000000000..def9fca05a
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/policy_settings.h
@@ -0,0 +1,42 @@
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
+#include <string>
+#include <stdint.h>
+
+namespace policy {
+class PolicySettings {
+ public:
+ /**
+ * @brief Should Policy be turned off? (Library not loaded)
+ * @return Flag
+ */
+ virtual bool enable_policy() const = 0;
+ /*
+ * @brief Path to preloaded policy file
+ */
+ virtual const std::string& preloaded_pt_file() const = 0;
+
+ /**
+ * @brief Returns application storage path
+ */
+ virtual const std::string& app_storage_folder() const = 0;
+
+ virtual uint16_t attempts_to_open_policy_db() const = 0;
+
+ virtual uint16_t open_attempt_timeout_ms() const = 0;
+
+ /**
+ * @brief Path to policies snapshot file
+ * @return file path
+ */
+ virtual const std::string& policies_snapshot_file_name() const = 0;
+
+ /**
+ * @brief Returns system files folder path
+ */
+ virtual const std::string& system_files_path() const = 0;
+
+ virtual ~PolicySettings() {}
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
diff --git a/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h b/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h
new file mode 100644
index 0000000000..3f01a30a62
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+
+#include "policy/usage_statistics/statistics_manager.h"
+
+namespace usage_statistics {
+
+class AppStopwatch {
+ public:
+ virtual ~AppStopwatch() {}
+ virtual void Start(AppStopwatchId stopwatch_type) = 0;
+ virtual void Switch(AppStopwatchId stopwatch_type) = 0;
+ virtual void WriteTime() = 0;
+};
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
diff --git a/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h
new file mode 100644
index 0000000000..7186400ff4
--- /dev/null
+++ b/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+
+#include <stdint.h>
+#include <string>
+
+namespace usage_statistics {
+
+enum GlobalCounterId {
+ GLOBAL_COUNTER_NONE,
+ IAP_BUFFER_FULL,
+ SYNC_OUT_OF_MEMORY,
+ SYNC_REBOOTS
+};
+
+enum AppInfoId { APP_INFO_NONE, LANGUAGE_GUI, LANGUAGE_VUI };
+
+enum AppStopwatchId {
+ STOPWATCH_NONE,
+ SECONDS_HMI_FULL,
+ SECONDS_HMI_LIMITED,
+ SECONDS_HMI_BACKGROUND,
+ SECONDS_HMI_NONE
+};
+
+enum AppCounterId {
+ APP_COUNTER_NONE,
+ USER_SELECTIONS,
+ REJECTIONS_SYNC_OUT_OF_MEMORY,
+ REJECTIONS_NICKNAME_MISMATCH,
+ REJECTIONS_DUPLICATE_NAME,
+ REJECTED_RPC_CALLS,
+ RPCS_IN_HMI_NONE,
+ REMOVALS_MISBEHAVED,
+ RUN_ATTEMPTS_WHILE_REVOKED,
+ COUNT_OF_TLS_ERRORS,
+};
+
+class StatisticsManager {
+ public:
+ virtual ~StatisticsManager() {}
+
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ virtual void Increment(GlobalCounterId type) = 0;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ virtual void Increment(const std::string& app_id, AppCounterId type) = 0;
+
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ virtual void Set(const std::string& app_id,
+ AppInfoId type,
+ const std::string& value) = 0;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ virtual void Add(const std::string& app_id,
+ AppStopwatchId type,
+ int32_t timespan_seconds) = 0;
+};
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h
new file mode 100644
index 0000000000..e8de37d5de
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/policy_listener.h
@@ -0,0 +1,155 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
+
+#include <queue>
+
+#include "policy/policy_types.h"
+#include "utils/custom_string.h"
+
+namespace policy {
+
+namespace custom_str = utils::custom_string;
+
+class PolicyListener {
+ public:
+ virtual ~PolicyListener() {}
+ 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 OnUpdateStatusChanged(const std::string&) = 0;
+ virtual std::string OnCurrentDeviceIdUpdateRequired(
+ const std::string& policy_app_id) = 0;
+ virtual void OnSystemInfoUpdateRequired() = 0;
+ virtual custom_str::CustomString GetAppName(
+ const std::string& policy_app_id) = 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) = 0;
+
+ /**
+ * @brief Make appropriate changes for related applications permissions and
+ * notify them, if it possible
+ * @param device_id Unique device id, which consent had been changed
+ * @param device_consent Device consent, which is done by user
+ */
+ virtual void OnDeviceConsentChanged(const std::string& device_id,
+ bool is_allowed) = 0;
+
+ /**
+ * @brief Sends OnAppPermissionsChanged notification to HMI
+ * @param permissions contains parameter for OnAppPermisionChanged
+ * @param policy_app_id contains policy application id
+ */
+ virtual void SendOnAppPermissionsChanged(
+ const AppPermissions& permissions,
+ const std::string& policy_app_id) const = 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;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * Gets devices ids by policy application id
+ * @param policy_app_id
+ * @return list devices ids
+ */
+ virtual std::vector<std::string> GetDevicesIds(
+ const std::string& policy_app_id) = 0;
+
+ /**
+ * Notifies about changing HMI level
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMILevel(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+ /**
+ * @brief Notifies Remote apps about change in permissions
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void OnRemoteAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) = 0;
+
+ /**
+ * Notifies about changing HMI status
+ * @param device_id unique identifier of device
+ * @param policy_app_id unique identifier of application in policy
+ * @param hmi_level default HMI level for this application
+ */
+ virtual void OnUpdateHMIStatus(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level) = 0;
+
+#endif // SDL_REMOTE_CONTROL
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h
new file mode 100644
index 0000000000..3e90cfc094
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -0,0 +1,610 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
+
+#include <vector>
+#include <cstdint>
+
+#include "utils/callable.h"
+#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_listener.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/access_remote.h"
+#endif // SDL_REMOTE_CONTROL
+
+namespace policy {
+class PolicySettings;
+typedef utils::SharedPtr<utils::Callable> StatusNotifier;
+
+class PolicyManager : public usage_statistics::StatisticsManager {
+ public:
+ virtual ~PolicyManager() {}
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ virtual void set_listener(PolicyListener* listener) = 0;
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ virtual bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) = 0;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ virtual bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) = 0;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ virtual bool ResetPT(const std::string& file_name) = 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 Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @param out_end_points output vector of urls
+ */
+ virtual void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) = 0;
+ virtual void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) = 0;
+
+ /**
+ * @brief PTU is needed, for this PTS has to be formed and sent.
+ */
+ virtual bool RequestPTUpdate() = 0;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param device_id Id of device of application
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed and list of
+ * allowed params.
+ */
+ virtual void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) = 0;
+
+ /**
+ * @brief Changes isConsentNeeded for app pending permissions, in case
+ * user set permissions before app activation.
+ * @param Unique app id
+ * @param Current permissions for app
+ */
+ virtual void CheckPendingPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions) = 0;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ virtual bool ResetUserConsent() = 0;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ virtual std::string GetPolicyTableStatus() const = 0;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ virtual void KmsChanged(int kilometers) = 0;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ virtual void IncrementIgnitionCycles() = 0;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ virtual std::string ForcePTExchange() = 0;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ virtual std::string ForcePTExchangeAtUserRequest() = 0;
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ virtual uint32_t NextRetryTimeout() = 0;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ virtual uint32_t TimeoutExchangeMSec() = 0;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ virtual void OnExceededTimeout() = 0;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ virtual void OnUpdateStarted() = 0;
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ virtual DeviceConsent GetUserConsentForDevice(
+ const std::string& device_id) const = 0;
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ virtual void GetUserConsentForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) = 0;
+
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ virtual void SetUserConsentForDevice(const std::string& device_id,
+ bool is_allowed) = 0;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ virtual bool ReactOnUserDevConsentForApp(const std::string app_id,
+ bool is_device_allowed) = 0;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ virtual void PTUpdatedAt(Counters counter, int value) = 0;
+
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ virtual bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) = 0;
+
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ virtual void AddDevice(const std::string& device_id,
+ const std::string& connection_type) = 0;
+
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ virtual void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) = 0;
+
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ */
+ virtual void SetUserConsentForApp(const PermissionConsent& permissions) = 0;
+
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const = 0;
+
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const = 0;
+
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @return Array of structs with appropriate message parameters
+ */
+ virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ const std::vector<std::string>& message_code,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ virtual void GetPermissionsForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) = 0;
+
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ virtual AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) = 0;
+
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
+
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ virtual std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ virtual void SetSystemLanguage(const std::string& language) = 0;
+
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ virtual void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ virtual void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) = 0;
+
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ virtual void MarkUnpairedDevice(const std::string& device_id) = 0;
+
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
+ virtual StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) = 0;
+
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool CleanupUnpairedDevices() = 0;
+
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ virtual void OnSystemReady() = 0;
+
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ virtual uint32_t GetNotificationsNumber(
+ const std::string& priority) const = 0;
+
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ virtual void SetVINValue(const std::string& value) = 0;
+
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ virtual bool IsPredataPolicy(const std::string& policy_app_id) const = 0;
+
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0;
+
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0;
+
+ /**
+ * @brief Handler on applications search started
+ */
+ virtual void OnAppsSearchStarted() = 0;
+
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
+
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ virtual const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const = 0;
+
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ virtual const VehicleInfo GetVehicleInfo() const = 0;
+
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
+
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ virtual std::string RetrieveCertificate() const = 0;
+
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ virtual bool HasCertificate() const = 0;
+
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
+ virtual const PolicySettings& get_settings() const = 0;
+
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
+ virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ virtual void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ virtual bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) = 0;
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ virtual void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) = 0;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ virtual void set_access_remote(
+ utils::SharedPtr<AccessRemote> access_remote) = 0;
+#endif // SDL_REMOTE_CONTROL
+
+ /**
+ * @brief Checks if there is existing URL in the EndpointUrls vector with
+ * index saved in the policy manager and if not, it moves to the next
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
+ virtual AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const = 0;
+
+ protected:
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ virtual bool ExceededIgnitionCycles() = 0;
+
+ /**
+ * @brief 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
+
+extern "C" policy::PolicyManager* CreateManager();
+extern "C" void DeleteManager(policy::PolicyManager*);
+
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
diff --git a/src/components/include/policy/policy_regular/policy/policy_settings.h b/src/components/include/policy/policy_regular/policy/policy_settings.h
new file mode 100644
index 0000000000..def9fca05a
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/policy_settings.h
@@ -0,0 +1,42 @@
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
+#include <string>
+#include <stdint.h>
+
+namespace policy {
+class PolicySettings {
+ public:
+ /**
+ * @brief Should Policy be turned off? (Library not loaded)
+ * @return Flag
+ */
+ virtual bool enable_policy() const = 0;
+ /*
+ * @brief Path to preloaded policy file
+ */
+ virtual const std::string& preloaded_pt_file() const = 0;
+
+ /**
+ * @brief Returns application storage path
+ */
+ virtual const std::string& app_storage_folder() const = 0;
+
+ virtual uint16_t attempts_to_open_policy_db() const = 0;
+
+ virtual uint16_t open_attempt_timeout_ms() const = 0;
+
+ /**
+ * @brief Path to policies snapshot file
+ * @return file path
+ */
+ virtual const std::string& policies_snapshot_file_name() const = 0;
+
+ /**
+ * @brief Returns system files folder path
+ */
+ virtual const std::string& system_files_path() const = 0;
+
+ virtual ~PolicySettings() {}
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_SETTINGS_H_
diff --git a/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h
new file mode 100644
index 0000000000..0bcd585737
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+
+#include "policy/usage_statistics/statistics_manager.h"
+
+namespace usage_statistics {
+
+class AppStopwatch {
+ public:
+ virtual ~AppStopwatch() {}
+ virtual void Start(AppStopwatchId stopwatch_type) = 0;
+ virtual void Switch(AppStopwatchId stopwatch_type) = 0;
+ virtual void WriteTime() = 0;
+};
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
diff --git a/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h
new file mode 100644
index 0000000000..23df30510b
--- /dev/null
+++ b/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+
+#include <stdint.h>
+#include <string>
+
+namespace usage_statistics {
+
+enum GlobalCounterId {
+ GLOBAL_COUNTER_NONE,
+ IAP_BUFFER_FULL,
+ SYNC_OUT_OF_MEMORY,
+ SYNC_REBOOTS
+};
+
+enum AppInfoId { APP_INFO_NONE, LANGUAGE_GUI, LANGUAGE_VUI };
+
+enum AppStopwatchId {
+ STOPWATCH_NONE,
+ SECONDS_HMI_FULL,
+ SECONDS_HMI_LIMITED,
+ SECONDS_HMI_BACKGROUND,
+ SECONDS_HMI_NONE
+};
+
+enum AppCounterId {
+ APP_COUNTER_NONE,
+ USER_SELECTIONS,
+ REJECTIONS_SYNC_OUT_OF_MEMORY,
+ REJECTIONS_NICKNAME_MISMATCH,
+ REJECTIONS_DUPLICATE_NAME,
+ REJECTED_RPC_CALLS,
+ RPCS_IN_HMI_NONE,
+ REMOVALS_MISBEHAVED,
+ RUN_ATTEMPTS_WHILE_REVOKED,
+ COUNT_OF_TLS_ERRORS,
+};
+
+class StatisticsManager {
+ public:
+ virtual ~StatisticsManager() {}
+
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ virtual void Increment(GlobalCounterId type) = 0;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ virtual void Increment(const std::string& app_id, AppCounterId type) = 0;
+
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ virtual void Set(const std::string& app_id,
+ AppInfoId type,
+ const std::string& value) = 0;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ virtual void Add(const std::string& app_id,
+ AppStopwatchId type,
+ int32_t timespan_seconds) = 0;
+};
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
diff --git a/src/components/include/policy/policy_settings.h b/src/components/include/policy/policy_settings.h
deleted file mode 100644
index 7e5b7d6f93..0000000000
--- a/src/components/include/policy/policy_settings.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef POLICY_HANDLER_SETTINGS_H
-#define POLICY_HANDLER_SETTINGS_H
-#include <string>
-#include <stdint.h>
-
-namespace policy {
-class PolicySettings {
- public:
- /**
- * @brief Should Policy be turned off? (Library not loaded)
- * @return Flag
- */
- virtual bool enable_policy() const = 0;
- /*
- * @brief Path to preloaded policy file
- */
- virtual const std::string& preloaded_pt_file() const = 0;
-
- /**
- * @brief Returns application storage path
- */
- virtual const std::string& app_storage_folder() const = 0;
-
- virtual uint16_t attempts_to_open_policy_db() const = 0;
-
- virtual uint16_t open_attempt_timeout_ms() const = 0;
-
- /**
- * @brief Path to policies snapshot file
- * @return file path
- */
- virtual const std::string& policies_snapshot_file_name() const = 0;
-
- /**
- * @brief Returns system files folder path
- */
- virtual const std::string& system_files_path() const = 0;
-
- virtual ~PolicySettings() {}
-};
-} // namespace policy
-#endif // POLICY_HANDLER_SETTINGS_H
diff --git a/src/components/include/policy/policy_types.h b/src/components/include/policy/policy_types.h
deleted file mode 100644
index f03278619c..0000000000
--- a/src/components/include/policy/policy_types.h
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_POLICY_TYPES_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_TYPES_H_
-
-#include <string>
-#include <vector>
-#include <map>
-#include <set>
-#include "utils/shared_ptr.h"
-#include "utils/helpers.h"
-
-namespace policy {
-
-// TODO(PV): specify errors
-enum PolicyErrorEnum {};
-
-const std::string kDefaultDeviceMacAddress = "00:00:00:00:00:00";
-const std::string kDefaultDeviceName = "MyDevice";
-const std::string kDefaultDeviceConnectionType = "UNKNOWN";
-
-/**
- * @brief Constants for special ids in application policies section of
- * policy table
- */
-const std::string kPreDataConsentId = "pre_DataConsent";
-const std::string kDefaultId = "default";
-const std::string kDeviceId = "device";
-
-/*
- * @brief Status of policy table update
- */
-enum PolicyTableStatus {
- StatusUpToDate = 0,
- StatusUpdatePending,
- StatusUpdateRequired,
- StatusUnknown
-};
-
-// Code generator uses String class name, so this typedef was renamed to PTSring
-typedef std::string PTString;
-typedef std::vector<uint8_t> BinaryMessage;
-typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
-
-typedef std::string HMILevel;
-typedef std::string Parameter;
-typedef std::string RpcName;
-typedef std::vector<std::string> RPCParams;
-
-typedef std::map<std::string, std::set<policy::HMILevel> > HMIPermissions;
-typedef std::map<std::string, std::set<policy::Parameter> >
- ParameterPermissions;
-
-struct RpcPermissions {
- HMIPermissions hmi_permissions;
- ParameterPermissions parameter_permissions;
-};
-
-typedef std::map<RpcName, RpcPermissions> Permissions;
-
-/**
- * @brief Typedef for use with AllowApp request/notification
- */
-typedef std::vector<std::string> PermissionsList;
-
-/**
- * @brief Typedef for getting initial application data, e.g. nickname list
- */
-typedef std::vector<std::string> StringArray;
-
-enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed };
-
-/**
- * @struct Stores result of check:
- * if HMI Level was allowed for RPC to work in
- * and list of parameters allowed for RPC if specified in PT.
- */
-struct CheckPermissionResult {
- CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {}
-
- PermitResult hmi_level_permitted;
- std::vector<PTString> list_of_allowed_params;
- std::vector<PTString> list_of_disallowed_params;
- std::vector<PTString> list_of_undefined_params;
-};
-
-/**
- @struct Holds Url string and optional policy app id.
- */
-struct EndpointData {
- explicit EndpointData(const std::string& url_string = "")
- : app_id("default") {
- if (false == url_string.empty()) {
- url.push_back(url_string);
- }
- }
- std::vector<std::string> url;
- std::string app_id;
-};
-
-typedef std::vector<EndpointData> EndpointUrls;
-
-/**
- * @brief Struct contains device data to be used for dialogs, generation of IDs
- */
-struct DeviceParams {
- DeviceParams()
- : device_name(kDefaultDeviceName)
- , device_mac_address(kDefaultDeviceMacAddress)
- , device_connection_type(kDefaultDeviceConnectionType)
- , device_handle(0) {}
-
- std::string device_name;
- std::string device_mac_address;
- std::string device_connection_type;
- uint32_t device_handle;
-};
-
-/**
- * @brief User consent for device data usage
- */
-enum DeviceConsent {
- kDeviceAllowed = 0,
- kDeviceDisallowed,
- kDeviceHasNoConsent
-};
-
-/**
- * @brief Struct contains parameters, which can be received during application
- * registration and should be stored in policy table
- */
-struct DeviceInfo {
- DeviceInfo() : max_number_rfcom_ports(0) {}
-
- std::string hardware;
- std::string firmware_rev;
- std::string os;
- std::string os_ver;
- 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;
- static const std::string bluetooth("BLUETOOTH");
- static const std::string wifi("WIFI");
- if (Compare<std::string, EQ, ONE>(deviceType, bluetooth, wifi)) {
- connection_type.assign("BTMAC");
- }
- }
-};
-
-/**
- * @brief User consent for functional group
- */
-enum GroupConsent { kGroupAllowed = 0, kGroupDisallowed, kGroupUndefined };
-
-/**
- * @brief Contains user permission for RPC functional group with specific name
- * and id from DB
- */
-struct FunctionalGroupPermission {
- FunctionalGroupPermission() : group_id(0), state(kGroupUndefined) {}
-
- bool operator==(const FunctionalGroupPermission& rhs) {
- if (this->group_id == rhs.group_id &&
- this->group_alias == rhs.group_alias &&
- this->group_name == rhs.group_name) {
- return true;
- }
- return false;
- }
-
- std::string group_alias;
- std::string group_name;
- int32_t group_id;
- GroupConsent state;
-};
-
-/**
- * @brief Stores data to be sent to HMI on application permissions change
- */
-struct AppPermissions {
- AppPermissions(const std::string& app_id)
- : application_id(app_id)
- , isAppPermissionsRevoked(false)
- , appRevoked(false)
- , appPermissionsConsentNeeded(false)
- , appUnauthorized(false)
- , requestTypeChanged(false) {}
-
- std::string application_id;
- bool isAppPermissionsRevoked;
- std::vector<policy::FunctionalGroupPermission> appRevokedPermissions;
- bool appRevoked;
- bool appPermissionsConsentNeeded;
- bool appUnauthorized;
- bool isSDLAllowed;
- std::string priority;
- DeviceParams deviceInfo;
- bool requestTypeChanged;
- std::vector<std::string> requestType;
-};
-
-/**
- * @brief Contains parameters for user-defined consent for appication
- * functional groups on given device
- */
-struct PermissionConsent {
- std::string device_id;
- std::string policy_app_id;
- std::vector<FunctionalGroupPermission> group_permissions;
- std::string consent_source;
-};
-
-/**
- * @brief Contain data for GetUserFriendyMessage response
- */
-struct UserFriendlyMessage {
- std::string message_code;
-};
-
-/**
- * @brief Types of functional groups in policy table
- */
-enum GroupType {
- kTypeDefault = 0, // groups assigned to 'default' permissions section
- kTypeAllowed, // groups allowed by user for specific application
- kTypeDisallowed, // groups disallowed by user for specific application
- kTypeUnconsented, // groups disallowed by default but consent may be changed
- // by user
- kTypePreconsented, // groups allowed for specific application without
- // user consent by default (could be changed by user)
- kTypeGeneral, // groups assigned to specific application
- kTypePreDataConsented, // groups assigned to 'pre_DataConsent' permissions
- // section
- kTypeDevice // groups assigned to 'device' permissions section
-};
-
-/**
- * @brief Array of functional group id from DB
- */
-typedef std::vector<int32_t> FunctionalGroupIDs;
-
-/**
- * @brief Array of functional group ids sorted by types
- */
-typedef std::map<GroupType, FunctionalGroupIDs> FunctionalIdType;
-
-/**
- * @brief Array of functional group ids binded to user_consent_prompt (e.g.
- * VehicleData) and group name (e.g. VehicleData-4)
- */
-typedef std::map<uint32_t, std::pair<std::string, std::string> >
- FunctionalGroupNames;
-
-/**
- * @brief Array of device ids, which are an identifiers in policy table
- */
-typedef std::vector<std::string> DeviceIds;
-
-/**
- * @brief Counters that calculated on receiving of succesful update
- */
-enum Counters { KILOMETERS, DAYS_AFTER_EPOCH };
-
-/**
- * @struct Vehicle information
- */
-struct VehicleInfo {
- std::string vehicle_make;
- std::string vehicle_model;
- std::string vehicle_year;
-};
-
-/**
- * @brief The MetaInfo information
- */
-struct MetaInfo {
- std::string ccpu_version;
- std::string wers_country_code;
- std::string language;
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_TYPES_H_
diff --git a/src/components/include/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/usage_statistics/statistics_manager.h
deleted file mode 100644
index 2b2c875d11..0000000000
--- a/src/components/include/policy/usage_statistics/statistics_manager.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
-
-#include <stdint.h>
-#include <string>
-
-namespace usage_statistics {
-
-enum GlobalCounterId { IAP_BUFFER_FULL, SYNC_OUT_OF_MEMORY, SYNC_REBOOTS };
-
-enum AppInfoId { LANGUAGE_GUI, LANGUAGE_VUI };
-
-enum AppStopwatchId {
- SECONDS_HMI_FULL,
- SECONDS_HMI_LIMITED,
- SECONDS_HMI_BACKGROUND,
- SECONDS_HMI_NONE
-};
-
-enum AppCounterId {
- USER_SELECTIONS,
- REJECTIONS_SYNC_OUT_OF_MEMORY,
- REJECTIONS_NICKNAME_MISMATCH,
- REJECTIONS_DUPLICATE_NAME,
- REJECTED_RPC_CALLS,
- RPCS_IN_HMI_NONE,
- REMOVALS_MISBEHAVED,
- RUN_ATTEMPTS_WHILE_REVOKED,
- COUNT_OF_TLS_ERRORS,
-};
-
-class StatisticsManager {
- public:
- virtual ~StatisticsManager() {}
- virtual void Increment(GlobalCounterId type) = 0;
- virtual void Increment(const std::string& app_id, AppCounterId type) = 0;
- virtual void Set(const std::string& app_id,
- AppInfoId type,
- const std::string& value) = 0;
- virtual void Add(const std::string& app_id,
- AppStopwatchId type,
- int32_t timespan_seconds) = 0;
-};
-
-} // namespace usage_statistics
-
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
diff --git a/src/components/include/protocol/bson_object_keys.h b/src/components/include/protocol/bson_object_keys.h
new file mode 100644
index 0000000000..6f80aeec2b
--- /dev/null
+++ b/src/components/include/protocol/bson_object_keys.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+namespace protocol_handler {
+
+namespace strings {
+
+extern const char* hash_id;
+extern const char* protocol_version;
+extern const char* mtu;
+extern const char* rejected_params;
+extern const char* height;
+extern const char* width;
+extern const char* video_protocol;
+extern const char* video_codec;
+
+} // namespace strings
+
+} // namespace protocol_handler
diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h
index ce4c4adf6f..00d57a9bf5 100644
--- a/src/components/include/protocol/common.h
+++ b/src/components/include/protocol/common.h
@@ -56,8 +56,9 @@ const uint8_t PROTOCOL_HEADER_V2_SIZE = 12;
*\brief Protocol versions constants
* First 4-bit field of AppLink protocol packet
*/
-enum {
-
+enum MajorProtocolVersion {
+ PROTOCOL_VERSION_UNKNOWN = -1,
+ PROTOCOL_VERSION_HMI = 0x00,
/**
*\brief Constant: number of protocol version (1).
*/
@@ -85,6 +86,12 @@ enum {
*/
PROTOCOL_VERSION_4 = 0x04,
/**
+ *@brief Constant: number of protocol version (5).
+ * Supports constructed payloads for protocol packets
+ * SDL4.4 feature.
+ */
+ PROTOCOL_VERSION_5 = 0x05,
+ /**
*\brief Maximum value of packet version field (size 4-bit) specified AppLink
*Protocol v.7
*/
diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h
index 183db21532..6aafd7d53f 100644
--- a/src/components/include/protocol_handler/protocol_handler.h
+++ b/src/components/include/protocol_handler/protocol_handler.h
@@ -43,6 +43,8 @@ namespace protocol_handler {
class ProtocolObserver;
class SessionObserver;
+struct SessionContext;
+
/**
* \class ProtocolHandler
* \brief Interface for component parsing protocol header
@@ -108,6 +110,39 @@ class ProtocolHandler {
virtual const ProtocolHandlerSettings& get_settings() const = 0;
virtual SessionObserver& get_session_observer() = 0;
+ /**
+ * \brief Called by connection handler to notify the result of
+ * OnSessionStartedCallback().
+ * \param connection_id Identifier of connection within which session exists
+ * \param session_id session ID passed to OnSessionStartedCallback()
+ * \param generated_session_id Generated session ID, will be 0 if session is
+ * not started
+ * \param hash_id Generated Hash ID
+ * \param protection whether the service will be protected
+ * \param rejected_params list of parameters' name that are rejected.
+ * Only valid when generated_session_id is 0. Note, even if
+ * generated_session_id is 0, the list may be empty.
+ */
+ DEPRECATED virtual void NotifySessionStartedResult(
+ int32_t connection_id,
+ uint8_t session_id,
+ uint8_t generated_session_id,
+ uint32_t hash_id,
+ bool protection,
+ std::vector<std::string>& rejected_params) = 0;
+
+ /**
+ * @brief Called by connection handler to notify the context of
+ * OnSessionStartedCallback().
+ * @param context reference to structure with started session data
+ * @param rejected_params list of parameters name that are rejected.
+ * Only valid when generated_session_id is 0. Note, even if
+ * generated_session_id is 0, the list may be empty.
+ */
+ virtual void NotifySessionStarted(
+ const SessionContext& context,
+ std::vector<std::string>& rejected_params) = 0;
+
protected:
/**
* \brief Destructor
diff --git a/src/components/include/protocol_handler/protocol_handler_settings.h b/src/components/include/protocol_handler/protocol_handler_settings.h
index 987b0ac449..e1107cb2a9 100644
--- a/src/components/include/protocol_handler/protocol_handler_settings.h
+++ b/src/components/include/protocol_handler/protocol_handler_settings.h
@@ -15,6 +15,10 @@ class ProtocolHandlerSettings {
virtual ~ProtocolHandlerSettings() {}
virtual size_t maximum_payload_size() const = 0;
+ virtual size_t maximum_control_payload_size() const = 0;
+ virtual size_t maximum_rpc_payload_size() const = 0;
+ virtual size_t maximum_audio_payload_size() const = 0;
+ virtual size_t maximum_video_payload_size() const = 0;
virtual size_t message_frequency_count() const = 0;
virtual size_t message_frequency_time() const = 0;
virtual bool malformed_message_filtering() const = 0;
@@ -25,11 +29,16 @@ class ProtocolHandlerSettings {
*/
virtual uint32_t heart_beat_timeout() const = 0;
- virtual uint16_t max_supported_protocol_version() const = 0;
/*
* @brief Protocol version, from .ini file.
*/
- virtual bool enable_protocol_4() const = 0;
+ virtual uint16_t max_supported_protocol_version() const = 0;
+
+ /*
+ * @brief Returns true, if SDL 4.0 is enabled
+ * @deprecated Use max_supported_protocol_version instead
+ */
+ DEPRECATED virtual bool enable_protocol_4() const = 0;
virtual uint32_t multiframe_waiting_timeout() const = 0;
#ifdef ENABLE_SECURITY
diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h
index 5e630c6c74..ccf000a18d 100644
--- a/src/components/include/protocol_handler/session_observer.h
+++ b/src/components/include/protocol_handler/session_observer.h
@@ -36,13 +36,17 @@
#include <list>
#include <string>
#include "transport_manager/transport_manager.h"
+#include "utils/macro.h"
#ifdef ENABLE_SECURITY
#include "security_manager/ssl_context.h"
#endif // ENABLE_SECURITY
- /**
- *\namespace protocol_handlerHandler
- *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
- */
+
+struct BsonObject;
+
+/**
+ *\namespace protocol_handler
+ *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality.
+ */
namespace protocol_handler {
/**
* \brief HASH_ID constants.
@@ -52,6 +56,60 @@ namespace protocol_handler {
enum { HASH_ID_NOT_SUPPORTED = 0, HASH_ID_WRONG = 0xFFFF0000 };
/**
+ * @brief Struct with data containing attributes of starting session
+ **/
+struct SessionContext {
+ transport_manager::ConnectionUID connection_id_;
+ uint8_t initial_session_id_;
+ uint8_t new_session_id_;
+ protocol_handler::ServiceType service_type_;
+ uint32_t hash_id_;
+ bool is_protected_;
+ bool is_new_service_;
+ bool is_ptu_required_;
+
+ /**
+ * @brief Constructor
+ */
+ SessionContext()
+ : connection_id_(0)
+ , initial_session_id_(0)
+ , new_session_id_(0)
+ , service_type_(protocol_handler::kInvalidServiceType)
+ , hash_id_(0)
+ , is_protected_(false)
+ , is_new_service_(false)
+ , is_ptu_required_(false) {}
+
+ /**
+ * @brief Constructor
+ * @param connection_id_ Connection identifier within which session is
+ * started.
+ * @param session_id Session ID specified to OnSessionStartedCallback()
+ * @param new_session_id Session ID generated
+ * @param service_type Type of service
+ * @param hash_id Hash ID generated from connection_handle and
+ * new_session_id
+ * @param is_protected Whether service will be protected
+ * @param is_new_service Whether service was already established
+ **/
+ SessionContext(transport_manager::ConnectionUID connection_id,
+ uint8_t session_id,
+ uint8_t new_session_id,
+ protocol_handler::ServiceType service_type,
+ uint32_t hash_id,
+ const bool is_protected)
+ : connection_id_(connection_id)
+ , initial_session_id_(session_id)
+ , new_session_id_(new_session_id)
+ , service_type_(service_type)
+ , hash_id_(hash_id)
+ , is_protected_(is_protected)
+ , is_new_service_(false)
+ , is_ptu_required_(false) {}
+};
+
+/**
* \class SessionObserver
* \brief Interface for making a bridge between ProtocolHandler and
* ConnectionHandler components.
@@ -72,8 +130,9 @@ class SessionObserver {
* \param is_protected would be service protected
* \param hash_id pointer for session hash identifier, uint32_t* hash_id
* \return uint32_t Id (number) of new session if successful, otherwise 0.
+ * \deprecated
*/
- virtual uint32_t OnSessionStartedCallback(
+ DEPRECATED virtual uint32_t OnSessionStartedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
const protocol_handler::ServiceType& service_type,
@@ -82,6 +141,25 @@ class SessionObserver {
/**
* \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates start of new session.
+ * Result must be notified through NotifySessionStartedContext().
+ * \param connection_handle Connection identifier within which session
+ * has to be started.
+ * \param sessionId Identifier of the session to be start
+ * \param service_type Type of service
+ * \param protocol_version Version of protocol
+ * \param is_protected would be service protected
+ * \param params configuration parameters specified by mobile
+ */
+ virtual void OnSessionStartedCallback(
+ const transport_manager::ConnectionUID connection_handle,
+ const uint8_t sessionId,
+ const protocol_handler::ServiceType& service_type,
+ const bool is_protected,
+ const BsonObject* params) = 0;
+
+ /**
+ * \brief Callback function used by ProtocolHandler
* when Mobile Application initiates session ending.
* \param connection_handle Connection identifier within which session exists
* \param sessionId Identifier of the session to be ended
@@ -90,8 +168,9 @@ class SessionObserver {
* If not equal to hash assigned to session on start then operation fails.
* \param service_type Type of service
* \return uint32_t 0 if operation fails, session key otherwise
+ * \deprecated
*/
- virtual uint32_t OnSessionEndedCallback(
+ DEPRECATED virtual uint32_t OnSessionEndedCallback(
const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
const uint32_t& hashCode,
@@ -99,6 +178,23 @@ class SessionObserver {
/**
* \brief Callback function used by ProtocolHandler
+ * when Mobile Application initiates session ending.
+ * \param connection_handle Connection identifier within which session exists
+ * \param sessionId Identifier of the session to be ended
+ * \param hashCode Hash used only in second version of SmartDeviceLink
+ * protocol. (Set to HASH_ID_WRONG if the hash is incorrect)
+ * If not equal to hash assigned to session on start then operation fails.
+ * \param service_type Type of service
+ * \return uint32_t 0 if operation fails, session key otherwise
+ */
+ virtual uint32_t OnSessionEndedCallback(
+ const transport_manager::ConnectionUID connection_handle,
+ const uint8_t sessionId,
+ uint32_t* hashCode,
+ 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
*/
@@ -135,6 +231,7 @@ class SessionObserver {
uint8_t* sessionId) const = 0;
/**
+ * DEPRECATED
* \brief information about given Connection Key.
* \param key Unique key used by other components as session identifier
* \param app_id Returned: ApplicationID
@@ -148,6 +245,20 @@ class SessionObserver {
uint32_t* device_id) const = 0;
/**
+ * \brief information about given Connection Key.
+ * \param key Unique key used by other components as session identifier
+ * \param app_id Returned: ApplicationID
+ * \param sessions_list Returned: List of session keys
+ * \param device_id Returned: DeviceID
+ * \return int32_t -1 in case of error or 0 in case of success
+ */
+ virtual int32_t GetDataOnSessionKey(
+ uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ transport_manager::DeviceHandle* device_id) const = 0;
+
+ /**
* \brief information about device
* \param device_handle
* \param device_name Returned: name of device
@@ -216,6 +327,16 @@ class SessionObserver {
const uint32_t& key,
const protocol_handler::ServiceType& service_type) = 0;
+ /**
+ * @brief Check if session contains service with specified service type
+ * @param connection_key unique id of session to check
+ * @param service_type type of service to check
+ * @return true if session contains service with specified service type
+ */
+ virtual bool SessionServiceExists(
+ const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type) const = 0;
+
virtual security_manager::SSLContext::HandshakeContext GetHandshakeContext(
uint32_t key) const = 0;
#endif // ENABLE_SECURITY
diff --git a/src/components/include/protocol_handler/telemetry_observer.h b/src/components/include/protocol_handler/telemetry_observer.h
new file mode 100644
index 0000000000..a76fbce717
--- /dev/null
+++ b/src/components/include/protocol_handler/telemetry_observer.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_INCLUDE_PROTOCOL_HANDLER_TELEMETRY_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_TELEMETRY_OBSERVER_H_
+#include "protocol/common.h"
+
+#include <stdint.h>
+#include "utils/date_time.h"
+
+namespace protocol_handler {
+
+class PHTelemetryObserver {
+ public:
+ struct MessageMetric {
+ RawMessagePtr raw_msg;
+ uint32_t message_id;
+ uint8_t connection_key;
+ TimevalStruct begin;
+ TimevalStruct end;
+ };
+ virtual void StartMessageProcess(uint32_t message_id,
+ const TimevalStruct& start_time) = 0;
+ virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m) = 0;
+ virtual ~PHTelemetryObserver() {}
+};
+} // protocol_handler
+#endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_TELEMETRY_OBSERVER_H_
diff --git a/src/components/include/rpc_base/validation_report.h b/src/components/include/rpc_base/validation_report.h
new file mode 100644
index 0000000000..82f265e594
--- /dev/null
+++ b/src/components/include/rpc_base/validation_report.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
+
+#include <string>
+#include <list>
+
+namespace rpc {
+
+class ValidationReport;
+typedef std::list<ValidationReport> ValidationReports;
+
+class ValidationReport {
+ public:
+ explicit ValidationReport(const std::string& object_name);
+ const std::string& object_name() const;
+ const std::string& validation_info() const;
+ void set_validation_info(const std::string& info);
+ const ValidationReports& subobject_reports() const;
+ ValidationReport& ReportSubobject(const std::string& object_name);
+
+ private:
+ std::string object_name_;
+ std::string validation_info_;
+ ValidationReports subobject_reports_;
+};
+
+std::string PrettyFormat(const ValidationReport& report);
+
+// Implementation
+
+namespace impl {
+inline void PrettyFormat(const ValidationReport& report,
+ const std::string& parent_path,
+ std::string* result) {
+ std::string object_path = parent_path;
+ if (!object_path.empty() && report.object_name()[0] != '[') {
+ object_path.append(".");
+ }
+ const ValidationReports& subreports = report.subobject_reports();
+ object_path.append(report.object_name());
+ if (!report.validation_info().empty()) {
+ // Insert newline between entries
+ if (!result->empty()) {
+ result->append("\n");
+ }
+ result->append(object_path);
+ result->append(": ");
+ result->append(report.validation_info());
+ }
+ for (ValidationReports::const_iterator i = subreports.begin(),
+ end = subreports.end();
+ i != end;
+ ++i) {
+ PrettyFormat(*i, object_path, result);
+ }
+}
+} // namespace impl
+
+inline ValidationReport::ValidationReport(const std::string& object_name)
+ : object_name_(object_name) {}
+
+inline const std::string& ValidationReport::object_name() const {
+ return object_name_;
+}
+
+inline const std::string& ValidationReport::validation_info() const {
+ return validation_info_;
+}
+
+inline void ValidationReport::set_validation_info(const std::string& info) {
+ validation_info_ = info;
+}
+
+inline const std::list<ValidationReport>& ValidationReport::subobject_reports()
+ const {
+ return subobject_reports_;
+}
+
+inline ValidationReport& ValidationReport::ReportSubobject(
+ const std::string& object_name) {
+ subobject_reports_.push_back(ValidationReport(object_name));
+ return subobject_reports_.back();
+}
+
+inline std::string PrettyFormat(const ValidationReport& report) {
+ std::string result;
+ impl::PrettyFormat(report, "", &result);
+ return result;
+}
+
+} // namespace rpc
+
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_VALIDATION_REPORT_H_
diff --git a/src/components/include/security_manager/security_manager.h b/src/components/include/security_manager/security_manager.h
index 8ed0ff2912..8f772f6a13 100644
--- a/src/components/include/security_manager/security_manager.h
+++ b/src/components/include/security_manager/security_manager.h
@@ -128,6 +128,24 @@ class SecurityManager : public protocol_handler::ProtocolObserver {
virtual void StartHandshake(uint32_t connection_key) = 0;
/**
+ * @brief Check whether certificate should be updated
+ * @return true if certificate should be updated otherwise false
+ */
+ virtual bool IsCertificateUpdateRequired() = 0;
+
+ /**
+ * @brief Notify all listeners that certificate update required
+ * Allows to notify that certificate should be updated
+ */
+ virtual void NotifyOnCertificateUpdateRequired() = 0;
+
+ /**
+ * @brief Check if policy certificate data is empty
+ * @return true if policy certificate data is empty otherwise false
+ */
+ virtual bool IsPolicyCertificateDataEmpty() = 0;
+
+ /**
* \brief Add/Remove for SecurityManagerListener
*/
virtual void AddListener(SecurityManagerListener* const listener) = 0;
diff --git a/src/components/include/security_manager/security_manager_listener.h b/src/components/include/security_manager/security_manager_listener.h
index 577c7c4378..aeb3334a56 100644
--- a/src/components/include/security_manager/security_manager_listener.h
+++ b/src/components/include/security_manager/security_manager_listener.h
@@ -31,6 +31,9 @@
*/
#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_LISTENER_H_
#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_LISTENER_H_
+
+#include <string>
+
namespace security_manager {
class SecurityManagerListener {
@@ -48,6 +51,14 @@ class SecurityManagerListener {
* @brief Notify listeners that certificate update is required.
*/
virtual void OnCertificateUpdateRequired() = 0;
+
+ /**
+ * @brief Get certificate data from policy
+ * @param reference to string where to save certificate data
+ * @return true if listener saved some data to string otherwise false
+ */
+ virtual bool GetPolicyCertificateData(std::string& data) const = 0;
+
virtual ~SecurityManagerListener() {}
};
} // namespace security_manager
diff --git a/src/components/include/security_manager/security_manager_settings.h b/src/components/include/security_manager/security_manager_settings.h
index 70f0452ef2..c6b97f85cc 100644
--- a/src/components/include/security_manager/security_manager_settings.h
+++ b/src/components/include/security_manager/security_manager_settings.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_SUCURITY_MANAGER_SUCURITY_MANAGER_SETTINGS_H_
-#define SRC_COMPONENTS_INCLUDE_SUCURITY_MANAGER_SUCURITY_MANAGER_SETTINGS_H_
+#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_SETTINGS_H_
namespace security_manager {
enum Mode { CLIENT, SERVER };
@@ -55,4 +55,4 @@ class CryptoManagerSettings {
};
} // namespace security_manager
-#endif // SRC_COMPONENTS_INCLUDE_SUCURITY_MANAGER_SUCURITY_MANAGER_SETTINGS_H_
+#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_MANAGER_SETTINGS_H_
diff --git a/src/components/include/security_manager/security_query.h b/src/components/include/security_manager/security_query.h
index 71d148b909..cdad1c746c 100644
--- a/src/components/include/security_manager/security_query.h
+++ b/src/components/include/security_manager/security_query.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
-#define SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
+#ifndef SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
+#define SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
#include <stdint.h>
#include <cstddef>
@@ -191,4 +191,4 @@ class SecurityQuery {
*/
typedef utils::SharedPtr<SecurityQuery> SecurityQueryPtr;
} // namespace security_manager
-#endif // SRC_COMPONENTS_SECURITY_MANAGER_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
+#endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_
diff --git a/src/components/include/telemetry_monitor/telemetry_observable.h b/src/components/include/telemetry_monitor/telemetry_observable.h
index bafa916925..034deb3c2e 100644
--- a/src/components/include/telemetry_monitor/telemetry_observable.h
+++ b/src/components/include/telemetry_monitor/telemetry_observable.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_RESOURCE_OBSERVEABLE_H
-#define SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_RESOURCE_OBSERVEABLE_H
+#ifndef SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TELEMETRY_OBSERVABLE_H_
+#define SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TELEMETRY_OBSERVABLE_H_
namespace telemetry_monitor {
template <class TelemetryObserver>
@@ -40,4 +40,4 @@ class TelemetryObservable {
virtual void SetTelemetryObserver(TelemetryObserver* observer) = 0;
};
} // namespace telemetry_monitor
-#endif // SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_RESOURCE_OBSERVEABLE_H
+#endif // SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TELEMETRY_OBSERVABLE_H_
diff --git a/src/components/include/test/application_manager/mock_app_launch_settings.h b/src/components/include/test/application_manager/mock_app_launch_settings.h
index 2ceaefcae4..c59eb276ce 100644
--- a/src/components/include/test/application_manager/mock_app_launch_settings.h
+++ b/src/components/include/test/application_manager/mock_app_launch_settings.h
@@ -33,7 +33,6 @@
#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_LAUNCH_SETTINGS_H_
#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APP_LAUNCH_SETTINGS_H_
-#include <string>
#include "gmock/gmock.h"
#include "application_manager/app_launch_settings.h"
diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h
new file mode 100644
index 0000000000..58edcb637a
--- /dev/null
+++ b/src/components/include/test/application_manager/mock_application_manager.h
@@ -0,0 +1,321 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "application_manager/application_manager.h"
+#include "application_manager/application_manager_impl.h"
+#include "application_manager/application_manager_settings.h"
+#include "application_manager/commands/command.h"
+#include "application_manager/hmi_capabilities.h"
+#include "application_manager/state_controller.h"
+#include "application_manager/message.h"
+#include "resumption/last_state.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/app_launch/app_launch_ctrl.h"
+#include "application_manager/event_engine/event_dispatcher.h"
+#include "application_manager/state_controller.h"
+#include "smart_objects/smart_object.h"
+
+namespace test {
+namespace components {
+namespace application_manager_test {
+
+class MockApplicationManager : public application_manager::ApplicationManager {
+ public:
+ MOCK_METHOD2(Init,
+ bool(resumption::LastState& last_state,
+ media_manager::MediaManager* media_manager));
+ MOCK_METHOD0(Stop, bool());
+ MOCK_METHOD1(set_hmi_message_handler,
+ void(hmi_message_handler::HMIMessageHandler* handler));
+ MOCK_METHOD1(set_protocol_handler,
+ void(protocol_handler::ProtocolHandler* handler));
+ MOCK_METHOD1(set_connection_handler,
+ void(connection_handler::ConnectionHandler* handler));
+ MOCK_CONST_METHOD0(applications,
+ DataAccessor<application_manager::ApplicationSet>());
+ MOCK_CONST_METHOD1(
+ application, application_manager::ApplicationSharedPtr(uint32_t app_id));
+ MOCK_CONST_METHOD0(active_application,
+ application_manager::ApplicationSharedPtr());
+
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_CONST_METHOD2(application,
+ application_manager::ApplicationSharedPtr(
+ const std::string& device_id,
+ const std::string& policy_app_id));
+ MOCK_METHOD2(ChangeAppsHMILevel,
+ void(uint32_t app_id, mobile_apis::HMILevel::eType level));
+ MOCK_METHOD0(GetPluginManager, functional_modules::PluginManager&());
+ MOCK_CONST_METHOD1(
+ devices, std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_METHOD1(SendPostMessageToMobile,
+ void(const application_manager::MessagePtr& message));
+ MOCK_METHOD1(SendPostMessageToHMI,
+ void(const application_manager::MessagePtr& message));
+#endif // SDL_REMOTE_CONTROL
+
+ MOCK_CONST_METHOD1(
+ application_by_hmi_app,
+ application_manager::ApplicationSharedPtr(uint32_t hmi_app_id));
+ MOCK_CONST_METHOD1(application_by_policy_id,
+ application_manager::ApplicationSharedPtr(
+ const std::string& policy_app_id));
+ MOCK_METHOD1(
+ applications_by_button,
+ std::vector<application_manager::ApplicationSharedPtr>(uint32_t button));
+ MOCK_METHOD0(applications_with_navi,
+ std::vector<application_manager::ApplicationSharedPtr>());
+ MOCK_METHOD0(applications_with_mobile_projection,
+ std::vector<application_manager::ApplicationSharedPtr>());
+ MOCK_CONST_METHOD0(get_limited_media_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_navi_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_voice_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_CONST_METHOD0(get_limited_mobile_projection_application,
+ application_manager::ApplicationSharedPtr());
+ MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id));
+ MOCK_METHOD2(set_application_id,
+ void(const int32_t correlation_id, const uint32_t app_id));
+ MOCK_METHOD3(OnHMILevelChanged,
+ void(uint32_t app_id,
+ mobile_apis::HMILevel::eType from,
+ mobile_apis::HMILevel::eType to));
+ MOCK_METHOD1(
+ SendHMIStatusNotification,
+ void(const utils::SharedPtr<application_manager::Application> app));
+ MOCK_METHOD2(SendMessageToMobile,
+ void(application_manager::commands::MessageSharedPtr, bool));
+ MOCK_METHOD1(
+ SendMessageToHMI,
+ void(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD1(RemoveHMIFakeParameters,
+ void(application_manager::MessagePtr& message));
+ MOCK_METHOD1(
+ ManageHMICommand,
+ bool(const application_manager::commands::MessageSharedPtr message));
+ MOCK_METHOD2(
+ ManageMobileCommand,
+ bool(const application_manager::commands::MessageSharedPtr message,
+ application_manager::commands::Command::CommandOrigin origin));
+ MOCK_CONST_METHOD1(
+ GetDefaultHmiLevel,
+ mobile_apis::HMILevel::eType(
+ application_manager::ApplicationConstSharedPtr application));
+ MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&());
+ MOCK_CONST_METHOD0(hmi_capabilities,
+ const application_manager::HMICapabilities&());
+ MOCK_METHOD2(ProcessQueryApp,
+ void(const smart_objects::SmartObject& sm_object,
+ const uint32_t connection_key));
+ MOCK_CONST_METHOD0(is_attenuated_supported, bool());
+ MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited,
+ bool(application_manager::ApplicationConstSharedPtr app));
+ MOCK_METHOD1(OnApplicationRegistered,
+ void(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD1(OnApplicationSwitched,
+ void(application_manager::ApplicationSharedPtr app));
+ MOCK_CONST_METHOD0(connection_handler,
+ connection_handler::ConnectionHandler&());
+ MOCK_CONST_METHOD0(protocol_handler, protocol_handler::ProtocolHandler&());
+ MOCK_METHOD0(GetPolicyHandler, policy::PolicyHandlerInterface&());
+ MOCK_CONST_METHOD0(GetPolicyHandler, const policy::PolicyHandlerInterface&());
+ MOCK_METHOD0(GetNextHMICorrelationID, uint32_t());
+ MOCK_METHOD0(GenerateNewHMIAppID, uint32_t());
+ MOCK_METHOD1(EndNaviServices, void(uint32_t app_id));
+ MOCK_METHOD0(BeginAudioPassThrough, bool());
+ MOCK_METHOD0(EndAudioPassThrough, bool());
+ MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac));
+ MOCK_METHOD0(OnHMIStartedCooperation, void());
+ MOCK_CONST_METHOD0(IsHMICooperating, bool());
+ MOCK_METHOD2(IviInfoUpdated,
+ std::vector<application_manager::ApplicationSharedPtr>(
+ mobile_apis::VehicleDataType::eType vehicle_info,
+ int value));
+ MOCK_METHOD1(RegisterApplication,
+ application_manager::ApplicationSharedPtr(const utils::SharedPtr<
+ smart_objects::SmartObject>& request_for_registration));
+ MOCK_METHOD0(SendUpdateAppList, void());
+ MOCK_METHOD2(MarkAppsGreyOut,
+ void(const connection_handler::DeviceHandle handle,
+ bool is_greyed_out));
+ MOCK_CONST_METHOD1(IsAppsQueriedFrom,
+ bool(const connection_handler::DeviceHandle handle));
+ MOCK_CONST_METHOD0(IsStopping, bool());
+ MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList,
+ void(const uint32_t app_id));
+ MOCK_METHOD4(
+ SaveBinary,
+ mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data,
+ const std::string& file_path,
+ const std::string& file_name,
+ const int64_t offset));
+ MOCK_METHOD1(SetAllAppsAllowed, void(const bool allowed));
+ MOCK_METHOD1(
+ set_driver_distraction_state,
+ void(const hmi_apis::Common_DriverDistractionState::eType state));
+ MOCK_METHOD6(StartAudioPassThruThread,
+ void(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));
+ MOCK_METHOD0(StartDevicesDiscovery, void());
+ MOCK_METHOD1(StopAudioPassThru, void(int32_t application_key));
+ MOCK_METHOD3(TerminateRequest,
+ void(const uint32_t connection_key,
+ const uint32_t corr_id,
+ const int32_t function_id));
+ MOCK_METHOD4(UnregisterApplication,
+ void(const uint32_t&, mobile_apis::Result::eType, bool, bool));
+ MOCK_METHOD3(updateRequestTimeout,
+ void(uint32_t connection_key,
+ uint32_t mobile_correlation_id,
+ uint32_t new_timeout_value));
+ MOCK_METHOD0(state_controller, application_manager::StateController&());
+ MOCK_METHOD1(SetUnregisterAllApplicationsReason,
+ void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
+ MOCK_METHOD1(HeadUnitReset,
+ void(mobile_apis::AppInterfaceUnregisteredReason::eType reason));
+ MOCK_CONST_METHOD2(HMILevelAllowsStreaming,
+ bool(uint32_t app_id,
+ protocol_handler::ServiceType service_type));
+ MOCK_METHOD4(CheckPolicyPermissions,
+ mobile_apis::Result::eType(
+ const application_manager::ApplicationSharedPtr app,
+ const std::string& function_id,
+ const application_manager::RPCParams& rpc_params,
+ application_manager::CommandParametersPermissions*
+ params_permissions));
+ MOCK_CONST_METHOD2(IsApplicationForbidden,
+ bool(uint32_t connection_key,
+ const std::string& policy_app_id));
+ MOCK_METHOD0(resume_controller, resumption::ResumeCtrl&());
+ MOCK_METHOD0(hmi_interfaces, application_manager::HmiInterfaces&());
+ MOCK_METHOD0(app_launch_ctrl, app_launch::AppLaunchCtrl&());
+ MOCK_METHOD1(
+ GetDeviceTransportType,
+ hmi_apis::Common_TransportType::eType(const std::string& transport_type));
+ MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, void(const uint32_t app_id));
+ MOCK_METHOD0(GenerateGrammarID, uint32_t());
+ MOCK_CONST_METHOD1(GetUserConsentForDevice,
+ policy::DeviceConsent(const std::string& device_id));
+ MOCK_METHOD1(OnAppUnauthorized, void(const uint32_t& app_id));
+ MOCK_METHOD1(ActivateApplication,
+ bool(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD3(OnAppStreaming,
+ void(uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool state));
+ MOCK_CONST_METHOD4(CreateRegularState,
+ application_manager::HmiStatePtr(
+ application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::SystemContext::eType system_context));
+ DEPRECATED MOCK_CONST_METHOD4(
+ CreateRegularState,
+ application_manager::HmiStatePtr(
+ uint32_t app_id,
+ mobile_apis::HMILevel::eType hmi_level,
+ mobile_apis::AudioStreamingState::eType audio_state,
+ mobile_apis::SystemContext::eType system_context));
+
+ MOCK_METHOD2(SendAudioPassThroughNotification,
+ void(uint32_t session_key, std::vector<uint8_t>& binary_data));
+ MOCK_CONST_METHOD2(CanAppStream,
+ bool(uint32_t app_id,
+ protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id));
+ MOCK_CONST_METHOD0(get_settings,
+ const application_manager::ApplicationManagerSettings&());
+ MOCK_METHOD0(event_dispatcher,
+ application_manager::event_engine::EventDispatcher&());
+
+ DEPRECATED MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints,
+ bool(const uint32_t));
+ DEPRECATED MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t));
+ DEPRECATED MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t));
+ MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints,
+ bool(application_manager::ApplicationSharedPtr));
+ MOCK_METHOD1(SubscribeAppForWayPoints,
+ void(application_manager::ApplicationSharedPtr));
+ MOCK_METHOD1(UnsubscribeAppFromWayPoints,
+ void(application_manager::ApplicationSharedPtr));
+ MOCK_CONST_METHOD0(IsAnyAppSubscribedForWayPoints, bool());
+ MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<int32_t>());
+ MOCK_CONST_METHOD1(
+ WaitingApplicationByID,
+ application_manager::ApplicationConstSharedPtr(const uint32_t));
+ MOCK_CONST_METHOD0(
+ AppsWaitingForRegistration,
+ DataAccessor<application_manager::AppsWaitRegistrationSet>());
+
+ MOCK_METHOD1(ReplaceMobileWithHMIAppId,
+ void(smart_objects::SmartObject& message));
+ MOCK_METHOD1(ReplaceHMIWithMobileAppId,
+ void(smart_objects::SmartObject& message));
+ MOCK_METHOD1(GetAvailableSpaceForApp,
+ uint32_t(const std::string& folder_name));
+ MOCK_METHOD0(OnTimerSendTTSGlobalProperties, void());
+ MOCK_METHOD0(OnLowVoltage, void());
+ MOCK_METHOD0(OnWakeUp, void());
+ MOCK_METHOD4(OnStreamingConfigured,
+ void(uint32_t app_id,
+ protocol_handler::ServiceType service_type,
+ bool result,
+ std::vector<std::string>& rejected_params));
+ MOCK_METHOD1(ValidateMessageBySchema,
+ application_manager::MessageValidationResult(
+ const application_manager::Message& message));
+ MOCK_METHOD2(ProcessReconnection,
+ void(application_manager::ApplicationSharedPtr application,
+ const uint32_t connection_key));
+ MOCK_CONST_METHOD1(IsAppInReconnectMode,
+ bool(const std::string& policy_app_id));
+};
+
+} // namespace application_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_MOCK_APPLICATION_MANAGER_H_
diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h
index eee121149e..25cf994566 100644
--- a/src/components/include/test/application_manager/mock_application_manager_settings.h
+++ b/src/components/include/test/application_manager/mock_application_manager_settings.h
@@ -57,6 +57,7 @@ class MockApplicationManagerSettings
const std::pair<uint32_t, int32_t>&());
MOCK_CONST_METHOD0(hash_string_size, uint32_t());
MOCK_CONST_METHOD0(app_storage_folder, const std::string&());
+ MOCK_CONST_METHOD0(app_info_storage, const std::string&());
MOCK_CONST_METHOD0(app_dir_quota, const uint32_t&());
MOCK_CONST_METHOD0(stop_streaming_timeout, uint32_t());
MOCK_CONST_METHOD0(application_list_update_timeout, uint32_t());
@@ -94,13 +95,14 @@ class MockApplicationManagerSettings
MOCK_CONST_METHOD0(app_resuming_timeout, const uint32_t&());
MOCK_CONST_METHOD0(attempts_to_open_resumption_db, uint16_t());
MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, uint16_t());
- MOCK_METHOD1(config_file_name, void(const std::string& fileName));
+ MOCK_METHOD1(set_config_file_name, void(const std::string& fileName));
// The following line won't really compile, as the return
// type has multiple template arguments. To fix it, use a
// typedef for the return type.
MOCK_CONST_METHOD0(start_stream_retry_amount,
const std::pair<uint32_t, int32_t>&());
MOCK_CONST_METHOD0(app_icons_folder, const std::string&());
+ MOCK_CONST_METHOD0(plugins_folder, const std::string&());
MOCK_CONST_METHOD0(app_icons_folder_max_size, const uint32_t&());
MOCK_CONST_METHOD0(app_icons_amount_to_remove, const uint32_t&());
MOCK_CONST_METHOD0(list_files_response_size, const uint32_t&());
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
index a4498f5934..931fd6cfb4 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
@@ -30,18 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_POLICY_HANDLER_INTERFACE_H_
-#define SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_POLICY_HANDLER_INTERFACE_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_POLICIES_MOCK_POLICY_HANDLER_INTERFACE_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_POLICIES_MOCK_POLICY_HANDLER_INTERFACE_H_
#include "application_manager/policies/policy_handler_interface.h"
+#include "application_manager/application_manager.h"
#include "gmock/gmock.h"
#include "policy/policy_types.h"
+#include "smart_objects/smart_object.h"
namespace test {
namespace components {
namespace policy_test {
-namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
public:
MOCK_METHOD0(LoadPolicyLibrary, bool());
@@ -63,18 +64,23 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD2(OnPermissionsUpdated,
void(const std::string& policy_app_id,
const policy::Permissions& permissions));
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
MOCK_METHOD3(OnSnapshotCreated,
void(const policy::BinaryMessage& pt_string,
const std::vector<int>& retry_delay_seconds,
- int timeout_exchange));
+ uint32_t timeout_exchange));
+#else // EXTERNAL_PROPRIETARY_MODE
+ MOCK_METHOD1(OnSnapshotCreated, void(const policy::BinaryMessage& pt_string));
+#endif // EXTERNAL_PROPRIETARY_MODE
+
MOCK_CONST_METHOD2(GetPriority,
bool(const std::string& policy_app_id,
std::string* priority));
- MOCK_METHOD5(CheckPermissions,
- void(const policy::PTString& app_id,
- const policy::PTString& hmi_level,
+ MOCK_METHOD4(CheckPermissions,
+ void(const application_manager::ApplicationSharedPtr app,
const policy::PTString& rpc,
- const policy::RPCParams& rpc_params,
+ const application_manager::RPCParams& rpc_params,
policy::CheckPermissionResult& result));
MOCK_CONST_METHOD1(GetNotificationsNumber,
uint32_t(const std::string& priority));
@@ -93,11 +99,13 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
policy::StringArray* nicknames));
MOCK_METHOD1(GetInitialAppData, bool(const std::string& application_id));
MOCK_METHOD2(GetUpdateUrls,
- void(int service_type, policy::EndpointUrls& end_points));
+ void(const uint32_t service_type,
+ policy::EndpointUrls& end_points));
MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
MOCK_METHOD0(ResetRetrySequence, void());
MOCK_METHOD0(NextRetryTimeout, uint32_t());
- MOCK_METHOD0(TimeoutExchange, int());
+ MOCK_CONST_METHOD0(TimeoutExchangeSec, uint32_t());
+ MOCK_CONST_METHOD0(TimeoutExchangeMSec, uint32_t());
MOCK_METHOD0(OnExceededTimeout, void());
MOCK_METHOD0(OnSystemReady, void());
MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
@@ -123,9 +131,17 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD2(SetDeviceInfo,
void(const std::string& device_id,
const policy::DeviceInfo& device_info));
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ MOCK_METHOD3(
+ OnAppPermissionConsent,
+ void(const uint32_t connection_key,
+ const policy::PermissionConsent& permissions,
+ const policy::ExternalConsentStatus& external_consent_status));
+#else
MOCK_METHOD2(OnAppPermissionConsent,
void(const uint32_t connection_key,
const policy::PermissionConsent& permissions));
+#endif
MOCK_METHOD3(OnGetUserFriendlyMessage,
void(const std::vector<std::string>& message_codes,
const std::string& language,
@@ -156,6 +172,7 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
MOCK_METHOD1(OnUpdateHMIAppType,
void(std::map<std::string, policy::StringArray> app_hmi_types));
MOCK_METHOD1(OnCertificateUpdated, void(const std::string& certificate_data));
+ MOCK_METHOD1(OnPTUFinished, void(const bool ptu_result));
MOCK_METHOD1(OnCertificateDecrypted, void(bool is_succeeded));
MOCK_METHOD0(CanUpdate, bool());
MOCK_METHOD2(OnDeviceConsentChanged,
@@ -165,12 +182,16 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
const std::string& policy_app_id));
MOCK_METHOD0(OnPTExchangeNeeded, void());
MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>& apps));
- MOCK_METHOD1(AddApplication, void(const std::string& application_id));
+ MOCK_METHOD2(
+ AddApplication,
+ policy::StatusNotifier(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
MOCK_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
MOCK_METHOD0(OnUpdateRequestSentToMobile, void());
MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
MOCK_METHOD0(OnAppsSearchStarted, void());
- MOCK_METHOD0(OnAppsSearchCompleted, void());
+ MOCK_METHOD1(OnAppsSearchCompleted, void(const bool trigger_ptu));
MOCK_METHOD1(OnAppRegisteredOnMobile,
void(const std::string& application_id));
MOCK_CONST_METHOD2(IsRequestTypeAllowed,
@@ -180,6 +201,11 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
GetAppRequestTypes,
const std::vector<std::string>(const std::string& policy_app_id));
MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
+
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
+#endif // EXTERNAL_PROPRIETARY_MODE
+
MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
MOCK_METHOD2(Increment,
void(const std::string& app_id,
@@ -192,21 +218,62 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface {
void(const std::string& app_id,
usage_statistics::AppStopwatchId type,
int32_t timespan_seconds));
+#ifdef ENABLE_SECURITY
MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
+#endif // ENABLE_SECURITY
MOCK_CONST_METHOD0(get_settings, const policy::PolicySettings&());
MOCK_CONST_METHOD0(RemoteAppsUrl, const std::string());
- MOCK_METHOD2(GetServiceUrls,
+ MOCK_METHOD2(GetUpdateUrls,
void(const std::string& service_type,
policy::EndpointUrls& end_points));
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_METHOD3(OnUpdateHMILevel,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+ MOCK_METHOD3(CheckHMIType,
+ bool(const std::string& application_id,
+ mobile_apis::AppHMIType::eType hmi,
+ const smart_objects::SmartObject* app_types));
+
+ MOCK_METHOD2(CheckModule,
+ bool(const policy::PTString& app_id,
+ const policy::PTString& module));
+
+ MOCK_METHOD2(OnRemoteAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+
+ MOCK_METHOD3(OnUpdateHMIStatus,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+ MOCK_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& policy_app_id,
+ std::vector<std::string>* modules));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const std::string& application_id,
+ const smart_objects::SmartObject* app_types));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+#endif // SDL_REMOTE_CONTROL
+
private:
+#ifdef EXTERNAL_PROPRIETARY_MODE
+ MOCK_METHOD3(OnAppPermissionConsentInternal,
+ void(const uint32_t,
+ const policy::ExternalConsentStatus&,
+ policy::PermissionConsent&));
+#else
MOCK_METHOD2(OnAppPermissionConsentInternal,
- void(const uint32_t connection_key,
- policy::PermissionConsent& permissions));
+ void(const uint32_t, policy::PermissionConsent&));
+#endif
};
} // namespace policy_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_POLICY_HANDLER_INTERFACE_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_POLICIES_MOCK_POLICY_HANDLER_INTERFACE_H_
diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
index cc0f73126b..e8ed0e90e2 100644
--- a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
+++ b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h
@@ -49,6 +49,7 @@ class MockPolicyHandlerObserver : public ::policy::PolicyHandlerObserver {
MOCK_METHOD1(OnUpdateHMIAppType,
void(std::map<std::string, std::vector<std::string> >));
MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&));
+ MOCK_METHOD1(OnPTUFinished, void(const bool ptu_result));
};
} // namespace application_manager_test
} // namespace components
diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h
index e17224b097..f1416c999e 100644
--- a/src/components/include/test/connection_handler/mock_connection_handler.h
+++ b/src/components/include/test/connection_handler/mock_connection_handler.h
@@ -84,11 +84,18 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
void(uint32_t connection_key, uint8_t session_id));
MOCK_METHOD2(BindProtocolVersionWithSession,
void(uint32_t connection_key, uint8_t protocol_version));
+
+ // DEPRECATED
MOCK_CONST_METHOD4(GetDataOnSessionKey,
int32_t(uint32_t key,
uint32_t* app_id,
std::list<int32_t>* sessions_list,
uint32_t* device_id));
+ MOCK_CONST_METHOD4(GetDataOnSessionKey,
+ int32_t(uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ connection_handler::DeviceHandle* device_id));
MOCK_CONST_METHOD0(get_settings,
const connection_handler::ConnectionHandlerSettings&());
MOCK_METHOD0(get_session_observer,
@@ -96,6 +103,10 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler {
MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&());
MOCK_CONST_METHOD1(GetConnectedDevicesMAC,
void(std::vector<std::string>& macs));
+ MOCK_METHOD3(NotifyServiceStartedResult,
+ void(uint32_t session_key,
+ bool result,
+ std::vector<std::string>& rejected_params));
};
} // namespace connection_handler_test
diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
new file mode 100644
index 0000000000..f1c605eaca
--- /dev/null
+++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_OBSERVER_H_
+
+#include "gmock/gmock.h"
+#include "connection_handler/connection_handler_observer.h"
+
+namespace test {
+namespace components {
+namespace connection_handler_test {
+
+class MockConnectionHandlerObserver
+ : 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));
+ DEPRECATED MOCK_METHOD3(
+ OnServiceStartedCallback,
+ bool(const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type));
+ MOCK_METHOD4(OnServiceStartedCallback,
+ void(const connection_handler::DeviceHandle& device_handle,
+ const int32_t& session_key,
+ const protocol_handler::ServiceType& type,
+ const BsonObject* params));
+ 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));
+
+ MOCK_METHOD2(OnDeviceSwitchingStart,
+ void(const connection_handler::Device& device_from,
+ const connection_handler::Device& device_to));
+ MOCK_METHOD1(OnDeviceSwitchingFinish, void(const std::string& device_uid));
+ MOCK_CONST_METHOD1(CheckAppIsNavi, bool(const uint32_t app_id));
+};
+
+} // namespace connection_handler_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_CONNECTION_HANDLER_MOCK_CONNECTION_HANDLER_OBSERVER_H_
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_adapter.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_adapter.h
new file mode 100644
index 0000000000..4f6559314d
--- /dev/null
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_adapter.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 SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_ADAPTER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_ADAPTER_H_
+
+#include "gmock/gmock.h"
+#include "hmi_message_handler/hmi_message_adapter.h"
+
+namespace test {
+namespace components {
+namespace hmi_message_handler_test {
+
+using hmi_message_handler::HMIMessageAdapter;
+
+class MockHMIMessageAdapter : public HMIMessageAdapter {
+ public:
+ MOCK_METHOD0(SubscribeTo, void());
+};
+
+} // namespace hmi_message_handler_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_ADAPTER_H_
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_handler.h
deleted file mode 100644
index 19aa92f932..0000000000
--- a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_H_
-
-#include "gmock/gmock.h"
-#include "hmi_message_handler/hmi_message_handler.h"
-
-namespace test {
-namespace components {
-namespace hmi_message_handler_test {
-
-using hmi_message_handler::HMIMessageAdapter;
-
-class MockHMIMessageHandler : public ::hmi_message_handler::HMIMessageHandler {
- public:
- MOCK_METHOD1(AddHMIMessageAdapter, void(HMIMessageAdapter* adapter));
- MOCK_METHOD1(RemoveHMIMessageAdapter, void(HMIMessageAdapter* adapter));
-};
-} // namespace hmi_message_handler_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_H_
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h
index a3f73ac965..a7e93ec25c 100644
--- a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_SETTINGS_H_
-#define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_SETTINGS_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_SETTINGS_H_
#include <stdint.h>
#include "gmock/gmock.h"
@@ -44,9 +44,9 @@ namespace hmi_message_handler_test {
class MockHMIMessageHandlerSettings
: public ::hmi_message_handler::HMIMessageHandlerSettings {
public:
- MOCK_CONST_METHOD0(thread_min_stack_size, const uint64_t&());
+ MOCK_CONST_METHOD0(thread_min_stack_size, const uint64_t());
};
} // namespace hmi_message_handler_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_SETTINGS_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_HANDLER_SETTINGS_H_
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h
new file mode 100644
index 0000000000..859d164231
--- /dev/null
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.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_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_OBSERVER_H_
+
+#include "gmock/gmock.h"
+#include "utils/singleton.h"
+#include "hmi_message_handler/hmi_message_observer.h"
+
+namespace test {
+namespace components {
+namespace hmi_message_handler_test {
+
+class MockHMIMessageObserver : public hmi_message_handler::HMIMessageObserver,
+ public utils::Singleton<MockHMIMessageObserver> {
+ public:
+ MOCK_METHOD1(OnMessageReceived,
+ void(utils::SharedPtr<application_manager::Message> message));
+ MOCK_METHOD1(OnErrorSending,
+ void(utils::SharedPtr<application_manager::Message> message));
+ virtual ~MockHMIMessageObserver() {}
+};
+
+} // namespace hmi_message_handler_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_OBSERVER_H_
diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_sender.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_sender.h
new file mode 100644
index 0000000000..82b0fec738
--- /dev/null
+++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_sender.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_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_SENDER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_SENDER_H_
+
+#include "gmock/gmock.h"
+#include "hmi_message_handler/hmi_message_handler.h"
+
+namespace test {
+namespace components {
+namespace hmi_message_handler_test {
+
+class MockHMIMessageSender : public hmi_message_handler::HMIMessageSender {
+ public:
+ MOCK_METHOD1(SendMessageToHMI, void(MessageSharedPointer message));
+};
+
+} // namespace hmi_message_handler_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_HMI_MESSAGE_HANDLER_MOCK_HMI_MESSAGE_SENDER_H_
diff --git a/src/components/include/test/media_manager/mock_media_manager.h b/src/components/include/test/media_manager/mock_media_manager.h
new file mode 100644
index 0000000000..9cd2a05fc0
--- /dev/null
+++ b/src/components/include/test/media_manager/mock_media_manager.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_H_
+
+#include "gmock/gmock.h"
+#include "media_manager/media_manager.h"
+
+namespace test {
+namespace components {
+namespace media_manager_test {
+
+class MockMediaManager : public media_manager::MediaManager {
+ public:
+ MOCK_METHOD1(PlayA2DPSource, void(int32_t application_key));
+ MOCK_METHOD1(StopA2DPSource, void(int32_t application_key));
+ MOCK_METHOD3(StartMicrophoneRecording,
+ void(int32_t application_key,
+ const std::string& outputFileName,
+ int32_t duration));
+ MOCK_METHOD1(StopMicrophoneRecording, void(int32_t application_key));
+ MOCK_METHOD2(StartStreaming,
+ void(int32_t application_key,
+ protocol_handler::ServiceType service_type));
+ MOCK_METHOD2(StopStreaming,
+ void(int32_t application_key,
+ protocol_handler::ServiceType service_type));
+ MOCK_METHOD2(FramesProcessed,
+ void(int32_t application_key, int32_t frame_number));
+ MOCK_CONST_METHOD0(settings, const MediaManagerSettings&());
+};
+
+} // namespace media_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_H_
diff --git a/src/components/include/test/media_manager/mock_media_manager_settings.h b/src/components/include/test/media_manager/mock_media_manager_settings.h
index 5ef9e276b2..83e2252787 100644
--- a/src/components/include/test/media_manager/mock_media_manager_settings.h
+++ b/src/components/include/test/media_manager/mock_media_manager_settings.h
@@ -29,8 +29,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE__TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_SETTINGS_H_
-#define SRC_COMPONENTS_INCLUDE__TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_SETTINGS_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_SETTINGS_H_
#include <gmock/gmock.h>
#include <string>
@@ -60,4 +60,4 @@ class MockMediaManagerSettings : public ::media_manager::MediaManagerSettings {
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE__TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_SETTINGS_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_MEDIA_MANAGER_MOCK_MEDIA_MANAGER_SETTINGS_H_
diff --git a/src/components/include/test/policy/mock_policy_manager.h b/src/components/include/test/policy/mock_policy_manager.h
deleted file mode 100644
index a6169cdebc..0000000000
--- a/src/components/include/test/policy/mock_policy_manager.h
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
-
-#include <string>
-#include <vector>
-#include "gmock/gmock.h"
-#include "policy/policy_listener.h"
-#include "policy/policy_types.h"
-#include "policy/usage_statistics/statistics_manager.h"
-
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_manager.h"
-
-namespace policy_table = ::rpc::policy_table_interface_base;
-
-using namespace policy;
-
-namespace test {
-namespace components {
-namespace policy_manager_test {
-
-class MockPolicyManager : public PolicyManager {
- public:
- MOCK_METHOD1(set_listener, void(PolicyListener* listener));
- MOCK_METHOD2(InitPT,
- bool(const std::string& file_name,
- const PolicySettings* settings));
- MOCK_METHOD2(LoadPT,
- bool(const std::string& file, const BinaryMessage& pt_content));
- MOCK_METHOD1(ResetPT, bool(const std::string& file_name));
- MOCK_CONST_METHOD1(GetUpdateUrl, std::string(int service_type));
- MOCK_METHOD2(GetUpdateUrls, void(int service_type, EndpointUrls& end_points));
- MOCK_METHOD0(RequestPTUpdate, bool());
- MOCK_METHOD5(CheckPermissions,
- void(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result));
- MOCK_METHOD0(ResetUserConsent, bool());
- MOCK_CONST_METHOD0(GetPolicyTableStatus, std::string());
- MOCK_METHOD1(KmsChanged, void(int kilometers));
- MOCK_METHOD0(IncrementIgnitionCycles, void());
- MOCK_METHOD0(ForcePTExchange, std::string());
- MOCK_METHOD0(ResetRetrySequence, void());
- MOCK_METHOD0(NextRetryTimeout, uint32_t());
- MOCK_METHOD0(TimeoutExchange, int());
- MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector<int>());
- MOCK_METHOD0(OnExceededTimeout, void());
- MOCK_METHOD0(OnUpdateStarted, void());
- MOCK_CONST_METHOD1(GetUserConsentForDevice,
- DeviceConsent(const std::string& device_id));
- MOCK_METHOD3(
- GetUserConsentForApp,
- void(const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<policy::FunctionalGroupPermission>& permissions));
- MOCK_METHOD2(SetUserConsentForDevice,
- void(const std::string& device_id, const bool is_allowed));
- MOCK_METHOD2(ReactOnUserDevConsentForApp,
- bool(const std::string app_id, bool is_device_allowed));
- MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
-
- MOCK_METHOD3(GetInitialAppData,
- bool(const std::string&,
- policy::StringArray*,
- policy::StringArray*));
-
- MOCK_METHOD2(AddDevice,
- void(const std::string& device_id,
- const std::string& connection_type));
- MOCK_METHOD2(SetDeviceInfo,
- void(const std::string& device_id,
- const policy::DeviceInfo& device_info));
- MOCK_METHOD1(SetUserConsentForApp,
- void(const policy::PermissionConsent& permissions));
- MOCK_CONST_METHOD2(GetDefaultHmi,
- bool(const std::string& policy_app_id,
- std::string* default_hmi));
- MOCK_CONST_METHOD2(GetPriority,
- bool(const std::string& policy_app_id,
- std::string* priority));
- MOCK_METHOD2(GetUserFriendlyMessages,
- std::vector<policy::UserFriendlyMessage>(
- const std::vector<std::string>& message_code,
- const std::string& language));
- MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
- MOCK_METHOD3(
- GetPermissionsForApp,
- void(const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<policy::FunctionalGroupPermission>& permissions));
- MOCK_METHOD1(GetAppPermissionsChanges,
- policy::AppPermissions(const std::string& policy_app_id));
- MOCK_METHOD1(RemovePendingPermissionChanges, void(const std::string& app_id));
- MOCK_CONST_METHOD1(GetCurrentDeviceId,
- std::string&(const std::string& policy_app_id));
- MOCK_METHOD1(SetSystemLanguage, void(const std::string& language));
- MOCK_METHOD3(SetSystemInfo,
- void(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language));
- MOCK_METHOD1(SendNotificationOnPermissionsUpdated,
- void(const std::string& application_id));
- MOCK_METHOD1(MarkUnpairedDevice, void(const std::string& device_id));
- MOCK_METHOD1(AddApplication, void(const std::string& application_id));
- MOCK_METHOD0(CleanupUnpairedDevices, bool());
- MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
- MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
- MOCK_METHOD0(OnSystemReady, void());
- MOCK_CONST_METHOD1(GetNotificationsNumber,
- uint32_t(const std::string& priority));
- MOCK_METHOD1(SetVINValue, void(const std::string& value));
- MOCK_METHOD1(IsPredataPolicy, bool(const std::string& policy_app_id));
- MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
- MOCK_METHOD1(SaveUpdateStatusRequired, void(bool is_update_needed));
- MOCK_METHOD0(OnAppsSearchStarted, void());
- MOCK_METHOD0(OnAppsSearchCompleted, void());
- MOCK_METHOD1(OnAppRegisteredOnMobile,
- void(const std::string& application_id));
- MOCK_CONST_METHOD1(
- GetAppRequestTypes,
- const std::vector<std::string>(const std::string policy_app_id));
- MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
- MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
- MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
- MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
- MOCK_METHOD0(ExceededIgnitionCycles, bool());
- MOCK_METHOD0(ExceededDays, bool());
- MOCK_METHOD0(StartPTExchange, void());
- MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
- MOCK_METHOD2(Increment,
- void(const std::string& app_id,
- usage_statistics::AppCounterId type));
- MOCK_METHOD3(Set,
- 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,
- int32_t timespan_seconds));
- MOCK_CONST_METHOD0(get_settings, const PolicySettings&());
- MOCK_METHOD1(set_settings, void(const PolicySettings* get_settings));
- MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
- MOCK_METHOD2(GetServiceUrls,
- void(const std::string& service_type, EndpointUrls& end_points));
-};
-} // namespace policy_manager_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
new file mode 100644
index 0000000000..5aa92446b6
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/cache_manager_interface.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+using namespace ::policy;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
+ public:
+ MOCK_CONST_METHOD2(GetConsentsPriority,
+ ConsentPriorityType(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_METHOD4(CheckPermissions,
+ void(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result));
+ MOCK_METHOD0(IsPTPreloaded, bool());
+ MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
+ MOCK_METHOD1(KilometersBeforeExchange, int(int current));
+ MOCK_CONST_METHOD1(GetPermissionsList, bool(StringArray& perm_list));
+ MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
+ bool(Counters counter, int value));
+ MOCK_METHOD1(DaysBeforeExchange, int(uint16_t current));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+
+ MOCK_METHOD2(SaveDeviceConsentToCache,
+ void(const std::string& device_id, const bool is_allowed));
+
+ MOCK_METHOD1(ResetCalculatedPermissionsForDevice,
+ void(const std::string& device_id));
+ MOCK_METHOD0(ResetIgnitionCycles, void());
+ MOCK_METHOD0(TimeoutResponse, int());
+ MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds));
+ MOCK_CONST_METHOD1(IsDeviceConsentCached, bool(const std::string& device_id));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
+ MOCK_CONST_METHOD1(GetDeviceConsent,
+ DeviceConsent(const std::string& device_id));
+ MOCK_METHOD2(SetDeviceConsent,
+ void(const std::string& device_id, bool is_allowed));
+
+ MOCK_CONST_METHOD2(HasDeviceSpecifiedConsent,
+ bool(const std::string& device_id, const bool is_allowed));
+ MOCK_CONST_METHOD1(GetCachedDeviceConsent,
+ DeviceConsent(const std::string& device_id));
+ MOCK_METHOD1(SetVINValue, bool(const std::string& value));
+ MOCK_METHOD3(GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language,
+ const std::string& active_hmi_language));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const std::string& service_type,
+ EndpointUrls& out_end_points));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const uint32_t service_type, EndpointUrls& out_end_points));
+ MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_METHOD1(
+ GetNotificationsNumber,
+ policy_table::NumberOfNotificationsType(const std::string& priority));
+ MOCK_CONST_METHOD2(GetPriority,
+ bool(const std::string& policy_app_id,
+ std::string& priority));
+ MOCK_METHOD2(Init,
+ bool(const std::string& file_name,
+ const PolicySettings* settings));
+ MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
+ MOCK_METHOD1(Save, bool(const policy_table::Table& table));
+ MOCK_CONST_METHOD0(UpdateRequired, bool());
+ MOCK_METHOD1(SaveUpdateRequired, void(bool status));
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types));
+ MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD1(GetFunctionalGroupings,
+ bool(policy_table::FunctionalGroupings& groups));
+ MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetIsDefault, bool(const std::string& app_id));
+ MOCK_METHOD1(SetIsPredata, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
+ MOCK_CONST_METHOD2(GetDefaultHMI,
+ bool(const std::string& app_id, std::string& default_hmi));
+ MOCK_METHOD0(ResetUserConsent, bool());
+ MOCK_CONST_METHOD3(GetUserPermissionsForDevice,
+ bool(const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types));
+ MOCK_CONST_METHOD2(
+ GetDeviceGroupsFromPolicies,
+ bool(rpc::policy_table_interface_base::Strings& groups,
+ rpc::policy_table_interface_base::Strings& preconsented_groups));
+ MOCK_METHOD2(AddDevice,
+ bool(const std::string& device_id,
+ const std::string& connection_type));
+ MOCK_METHOD8(SetDeviceData,
+ bool(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type));
+ MOCK_METHOD3(SetUserPermissionsForDevice,
+ bool(const std::string& device_id,
+ const StringArray& consented_groups,
+ const StringArray& disallowed_groups));
+ MOCK_METHOD2(ReactOnUserDevConsentForApp,
+ bool(const std::string& app_id, bool is_device_allowed));
+ MOCK_METHOD2(SetUserPermissionsForApp,
+ bool(const PermissionConsent& permissions,
+ bool* out_app_permissions_changed));
+ MOCK_METHOD3(SetMetaInfo,
+ bool(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language));
+ MOCK_CONST_METHOD0(IsMetaInfoPresent, bool());
+ MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
+ MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
+ MOCK_METHOD2(Increment,
+ void(const std::string& app_id,
+ usage_statistics::AppCounterId type));
+ MOCK_METHOD3(Set,
+ 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_METHOD2(CountUnconsentedGroups,
+ int(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
+ MOCK_METHOD2(GetAllAppGroups,
+ void(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids));
+ MOCK_METHOD2(GetPreConsentedGroups,
+ void(const std::string& app_id,
+ FunctionalGroupIDs& preconsented_groups));
+ MOCK_METHOD4(GetConsentedGroups,
+ void(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups));
+ MOCK_METHOD3(GetUnconsentedGroups,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups));
+ MOCK_METHOD2(RemoveAppConsentForGroup,
+ void(const std::string& app_id, const std::string& group_name));
+ MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_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, bool(const std::string& file_name));
+ MOCK_METHOD0(LoadFromBackup, bool());
+ MOCK_METHOD2(LoadFromFile,
+ bool(const std::string& file_name, policy_table::Table&));
+ MOCK_METHOD0(Backup, void());
+ MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_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_CONST_METHOD2(AppHasHMIType,
+ bool(const std::string& application_id,
+ policy_table::AppHMIType hmi_type));
+
+ 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(GetPT, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(GetMetaInfo, const MetaInfo());
+ MOCK_CONST_METHOD0(GetCertificate, std::string());
+ MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
+ MOCK_METHOD1(set_settings, void(const PolicySettings* settings));
+ MOCK_METHOD1(GetHMITypes,
+ const policy_table::AppHMITypes*(const std::string& app_id));
+ MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id));
+
+ MOCK_METHOD1(SetExternalConsentStatus, bool(const ExternalConsentStatus&));
+ MOCK_METHOD0(GetExternalConsentStatus, ExternalConsentStatus());
+ MOCK_METHOD0(GetExternalConsentEntities, ExternalConsentStatus());
+ MOCK_METHOD1(GetGroupsWithSameEntities,
+ GroupsByExternalConsentStatus(const ExternalConsentStatus&));
+ MOCK_METHOD0(GetKnownLinksFromPT, std::map<std::string, std::string>());
+ MOCK_METHOD1(SetExternalConsentForApp, void(const PermissionConsent&));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
new file mode 100644
index 0000000000..ad2f1fd56c
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h
@@ -0,0 +1,111 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
+
+#include <string>
+#include <map>
+#include <queue>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/policy_listener.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+#include "utils/custom_string.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+namespace custom_str = utils::custom_string;
+
+class MockPolicyListener : public ::policy::PolicyListener {
+ public:
+ MOCK_METHOD3(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions,
+ const policy::HMILevel& default_hmi));
+ MOCK_METHOD2(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions));
+ MOCK_METHOD1(OnPendingPermissionChange,
+ void(const std::string& policy_app_id));
+ MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
+ MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
+ std::string(const std::string& policy_app_id));
+ MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
+ MOCK_METHOD1(GetAppName,
+ custom_str::CustomString(const std::string& policy_app_id));
+ MOCK_METHOD0(OnUserRequestedUpdateCheckRequired, void());
+ MOCK_METHOD2(OnDeviceConsentChanged,
+ void(const std::string& device_id, bool is_allowed));
+ MOCK_METHOD1(OnUpdateHMIAppType,
+ void(std::map<std::string, policy::StringArray>));
+ MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>&));
+ MOCK_METHOD3(OnSnapshotCreated,
+ void(const policy::BinaryMessage& pt_string,
+ const std::vector<int>& retry_seconds,
+ uint32_t timeout_exceed));
+ MOCK_METHOD0(CanUpdate, bool());
+ MOCK_METHOD1(OnCertificateUpdated, void(const std::string&));
+ MOCK_METHOD1(OnPTUFinished, void(const bool ptu_result));
+ MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
+ void(const policy::AppPermissions&, const std::string&));
+ MOCK_METHOD1(GetDevicesIds,
+ std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_METHOD3(OnUpdateHMILevel,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+ MOCK_CONST_METHOD1(GetRegisteredLinks,
+ void(std::map<std::string, std::string>&));
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent));
+ MOCK_METHOD2(OnRemoteAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_METHOD3(OnUpdateHMIStatus,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+#endif // SDL_REMOTE_CONTROL
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
new file mode 100644
index 0000000000..9e487da4ba
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
+
+#include <string>
+#include <vector>
+#include "gmock/gmock.h"
+#include "policy/policy_listener.h"
+#include "policy/policy_types.h"
+#include "policy/usage_statistics/statistics_manager.h"
+
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_manager.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+using namespace policy;
+
+namespace test {
+namespace components {
+namespace policy_manager_test {
+
+class MockPolicyManager : public PolicyManager {
+ public:
+ MOCK_METHOD1(set_listener, void(PolicyListener* listener));
+ MOCK_METHOD2(InitPT,
+ bool(const std::string& file_name,
+ const PolicySettings* settings));
+ MOCK_METHOD2(LoadPT,
+ bool(const std::string& file, const BinaryMessage& pt_content));
+ MOCK_METHOD1(ResetPT, bool(const std::string& file_name));
+ MOCK_METHOD1(GetUpdateUrl, std::string(int service_type));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const uint32_t service_type, EndpointUrls& out_end_points));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const std::string& service_type,
+ EndpointUrls& out_end_points));
+ MOCK_METHOD0(RequestPTUpdate, void());
+ MOCK_METHOD5(CheckPermissions,
+ void(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result));
+ MOCK_METHOD0(ResetUserConsent, bool());
+ MOCK_CONST_METHOD0(GetPolicyTableStatus, std::string());
+ MOCK_METHOD1(KmsChanged, void(int kilometers));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+ MOCK_METHOD0(ForcePTExchange, std::string());
+ MOCK_METHOD0(ForcePTExchangeAtUserRequest, std::string());
+ MOCK_METHOD0(ResetRetrySequence, void());
+ MOCK_METHOD0(NextRetryTimeout, int());
+ MOCK_METHOD0(TimeoutExchangeMSec, uint32_t());
+ MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector<int>());
+ MOCK_METHOD0(OnExceededTimeout, void());
+ MOCK_METHOD0(OnUpdateStarted, void());
+ MOCK_CONST_METHOD1(GetUserConsentForDevice,
+ DeviceConsent(const std::string& device_id));
+ MOCK_METHOD3(
+ GetUserConsentForApp,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<policy::FunctionalGroupPermission>& permissions));
+ MOCK_METHOD2(SetUserConsentForDevice,
+ void(const std::string& device_id, const bool is_allowed));
+ MOCK_METHOD2(ReactOnUserDevConsentForApp,
+ bool(const std::string& app_id, bool is_device_allowed));
+ MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
+
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string&,
+ policy::StringArray*,
+ policy::StringArray*));
+
+ MOCK_METHOD2(AddDevice,
+ void(const std::string& device_id,
+ const std::string& connection_type));
+ MOCK_METHOD2(SetDeviceInfo,
+ void(const std::string& device_id,
+ const policy::DeviceInfo& device_info));
+ MOCK_METHOD2(SetUserConsentForApp,
+ void(const policy::PermissionConsent& permissions,
+ const NotificationMode mode));
+ MOCK_CONST_METHOD2(GetDefaultHmi,
+ bool(const std::string& policy_app_id,
+ std::string* default_hmi));
+ MOCK_CONST_METHOD2(GetPriority,
+ bool(const std::string& policy_app_id,
+ std::string* priority));
+ MOCK_METHOD3(GetUserFriendlyMessages,
+ std::vector<policy::UserFriendlyMessage>(
+ const std::vector<std::string>& message_code,
+ const std::string& language,
+ const std::string& active_hmi_language));
+ MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD3(
+ GetPermissionsForApp,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<policy::FunctionalGroupPermission>& permissions));
+ MOCK_METHOD1(GetAppPermissionsChanges,
+ policy::AppPermissions(const std::string& policy_app_id));
+ MOCK_METHOD1(RemovePendingPermissionChanges, void(const std::string& app_id));
+ MOCK_CONST_METHOD1(GetCurrentDeviceId,
+ std::string&(const std::string& policy_app_id));
+ MOCK_METHOD1(SetSystemLanguage, void(const std::string& language));
+ MOCK_METHOD3(SetSystemInfo,
+ void(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language));
+ MOCK_METHOD1(SendNotificationOnPermissionsUpdated,
+ void(const std::string& application_id));
+ MOCK_METHOD1(MarkUnpairedDevice, void(const std::string& device_id));
+ MOCK_METHOD2(
+ AddApplication,
+ StatusNotifier(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const std::string& application_id,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD2(GetHMITypes,
+ bool(const std::string& application_id,
+ std::vector<int>* app_types));
+ MOCK_METHOD2(CheckModule,
+ bool(const PTString& app_id, const PTString& module));
+ MOCK_METHOD2(SendAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& policy_app_id,
+ std::vector<std::string>* modules));
+ MOCK_METHOD1(set_access_remote,
+ void(utils::SharedPtr<AccessRemote> access_remote));
+#endif // SDL_REMOTE_CONTROL
+
+ MOCK_METHOD0(CleanupUnpairedDevices, bool());
+ MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
+ MOCK_METHOD0(OnSystemReady, void());
+ MOCK_CONST_METHOD1(GetNotificationsNumber,
+ uint32_t(const std::string& priority));
+ MOCK_METHOD1(SetVINValue, void(const std::string& value));
+ MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
+ MOCK_METHOD1(SaveUpdateStatusRequired, void(bool is_update_needed));
+ MOCK_METHOD0(OnAppsSearchStarted, void());
+ MOCK_METHOD1(OnAppsSearchCompleted, void(const bool trigger_ptu));
+ MOCK_METHOD1(OnAppRegisteredOnMobile,
+ void(const std::string& application_id));
+ MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_CONST_METHOD1(
+ GetAppRequestTypes,
+ const std::vector<std::string>(const std::string policy_app_id));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
+ MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
+ MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
+ MOCK_CONST_METHOD0(HasCertificate, bool());
+ MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
+ MOCK_METHOD0(ExceededIgnitionCycles, bool());
+ MOCK_METHOD0(ExceededDays, bool());
+ MOCK_METHOD0(StartPTExchange, void());
+ MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
+ MOCK_METHOD2(Increment,
+ void(const std::string& app_id,
+ usage_statistics::AppCounterId type));
+ MOCK_METHOD3(Set,
+ 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,
+ int32_t timespan_seconds));
+ MOCK_CONST_METHOD0(get_settings, const PolicySettings&());
+ MOCK_METHOD1(set_settings, void(const PolicySettings* get_settings));
+ MOCK_METHOD1(GetNextUpdateUrl, AppIdURL(const EndpointUrls& urls));
+ MOCK_CONST_METHOD2(RetrySequenceUrl,
+ AppIdURL(const struct RetrySequenceURL&,
+ const EndpointUrls& urls));
+ MOCK_METHOD1(SetExternalConsentStatus, bool(const ExternalConsentStatus&));
+ MOCK_METHOD0(GetExternalConsentStatus, ExternalConsentStatus());
+ MOCK_CONST_METHOD1(IsNeedToUpdateExternalConsentStatus,
+ bool(const ExternalConsentStatus&));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+};
+} // namespace policy_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
new file mode 100644
index 0000000000..eafc1df4fe
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/mock_policy_settings.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_SETTINGS_H_
+
+#include "gmock/gmock.h"
+#include <string>
+#include "policy/policy_settings.h"
+
+namespace test {
+namespace components {
+namespace policy_handler_test {
+
+class MockPolicySettings : public ::policy::PolicySettings {
+ public:
+ MOCK_CONST_METHOD0(enable_policy, bool());
+ MOCK_CONST_METHOD0(preloaded_pt_file, const std::string&());
+ MOCK_CONST_METHOD0(app_storage_folder, const std::string&());
+ MOCK_CONST_METHOD0(attempts_to_open_policy_db, uint16_t());
+ MOCK_CONST_METHOD0(open_attempt_timeout_ms, uint16_t());
+ MOCK_CONST_METHOD0(policies_snapshot_file_name, const std::string&());
+ MOCK_CONST_METHOD0(system_files_path, const std::string&());
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_SETTINGS_H_
diff --git a/src/components/include/test/policy/policy_external/policy/usage_statistics/mock_app_stopwatch.h b/src/components/include/test/policy/policy_external/policy/usage_statistics/mock_app_stopwatch.h
new file mode 100644
index 0000000000..3cbb878655
--- /dev/null
+++ b/src/components/include/test/policy/policy_external/policy/usage_statistics/mock_app_stopwatch.h
@@ -0,0 +1,54 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_APP_STOPWATCH_H_
+
+#include "gmock/gmock.h"
+#include "policy/usage_statistics/app_stopwatch.h"
+#include "policy/usage_statistics/statistics_manager.h"
+
+namespace test {
+namespace components {
+namespace usage_statistics_test {
+
+class MockAppStopwatch : public usage_statistics::AppStopwatch {
+ public:
+ MOCK_METHOD1(Start, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD1(Switch, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD0(WriteTime, void());
+};
+
+} // namespace usage_statistics_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_APP_STOPWATCH_H_
diff --git a/src/components/include/test/policy/mock_statistics_manager.h b/src/components/include/test/policy/policy_external/policy/usage_statistics/mock_statistics_manager.h
index e58adea124..e58adea124 100644
--- a/src/components/include/test/policy/mock_statistics_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/usage_statistics/mock_statistics_manager.h
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
new file mode 100644
index 0000000000..ed3a5088c1
--- /dev/null
+++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
@@ -0,0 +1,223 @@
+/*
+ * 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_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/cache_manager_interface.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+namespace policy_table = rpc::policy_table_interface_base;
+using namespace ::policy;
+
+class MockCacheManagerInterface : public CacheManagerInterface {
+ public:
+ MOCK_METHOD4(CheckPermissions,
+ void(const policy_table::Strings& groups,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result));
+ MOCK_METHOD0(IsPTPreloaded, bool());
+ MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
+ MOCK_METHOD1(KilometersBeforeExchange, int(int current));
+ MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
+ bool(Counters counter, int value));
+ MOCK_METHOD1(DaysBeforeExchange, int(int current));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+ MOCK_METHOD0(ResetIgnitionCycles, void());
+ MOCK_METHOD0(TimeoutResponse, int());
+ MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
+ MOCK_METHOD1(SetVINValue, bool(const std::string& value));
+ MOCK_METHOD2(GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language));
+
+ MOCK_METHOD1(
+ GetNotificationsNumber,
+ policy_table::NumberOfNotificationsType(const std::string& priority));
+ MOCK_CONST_METHOD2(GetPriority,
+ bool(const std::string& policy_app_id,
+ std::string& priority));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const std::string& service_type,
+ EndpointUrls& out_end_points));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const uint32_t service_type, EndpointUrls& out_end_points));
+ MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_METHOD2(Init,
+ bool(const std::string& file_name,
+ const PolicySettings* settings));
+ MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
+ MOCK_METHOD1(Save, bool(const policy_table::Table& table));
+ MOCK_CONST_METHOD0(UpdateRequired, bool());
+ MOCK_METHOD1(SaveUpdateRequired, void(bool status));
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types));
+ MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD1(GetFunctionalGroupings,
+ bool(policy_table::FunctionalGroupings& groups));
+ MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetIsDefault, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
+ MOCK_CONST_METHOD2(GetDefaultHMI,
+ bool(const std::string& app_id, std::string& default_hmi));
+ MOCK_METHOD0(ResetUserConsent, bool());
+ MOCK_CONST_METHOD3(GetUserPermissionsForDevice,
+ bool(const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types));
+ MOCK_CONST_METHOD2(
+ GetDeviceGroupsFromPolicies,
+ bool(rpc::policy_table_interface_base::Strings& groups,
+ rpc::policy_table_interface_base::Strings& preconsented_groups));
+ MOCK_METHOD2(AddDevice,
+ bool(const std::string& device_id,
+ const std::string& connection_type));
+ MOCK_METHOD8(SetDeviceData,
+ bool(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type));
+ MOCK_METHOD3(SetUserPermissionsForDevice,
+ bool(const std::string& device_id,
+ const StringArray& consented_groups,
+ const StringArray& disallowed_groups));
+ MOCK_METHOD2(ReactOnUserDevConsentForApp,
+ bool(const std::string& app_id, bool is_device_allowed));
+ MOCK_METHOD1(SetUserPermissionsForApp,
+ bool(const PermissionConsent& permissions));
+ MOCK_METHOD3(SetMetaInfo,
+ bool(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language));
+ MOCK_CONST_METHOD0(IsMetaInfoPresent, bool());
+ MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
+ MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
+ MOCK_METHOD2(Increment,
+ void(const std::string& app_id,
+ usage_statistics::AppCounterId type));
+ MOCK_METHOD3(Set,
+ 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_METHOD2(CountUnconsentedGroups,
+ int(const std::string& policy_app_id,
+ const std::string& device_id));
+ MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
+ MOCK_METHOD2(GetAllAppGroups,
+ void(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids));
+ MOCK_METHOD2(GetPreConsentedGroups,
+ void(const std::string& app_id,
+ FunctionalGroupIDs& preconsented_groups));
+ MOCK_METHOD4(GetConsentedGroups,
+ void(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups));
+ MOCK_METHOD3(GetUnconsentedGroups,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups));
+ MOCK_METHOD2(RemoveAppConsentForGroup,
+ void(const std::string& app_id, const std::string& group_name));
+ MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_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, bool(const std::string& file_name));
+ MOCK_METHOD0(LoadFromBackup, bool());
+ MOCK_METHOD2(LoadFromFile,
+ bool(const std::string& file_name, policy_table::Table&));
+ MOCK_METHOD0(Backup, void());
+ MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_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(pt, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD1(GetHMITypes,
+ const policy_table::AppHMITypes*(const std::string& app_id));
+ MOCK_CONST_METHOD0(GetCertificate, std::string());
+ MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
+ MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id));
+ MOCK_CONST_METHOD2(AppHasHMIType,
+ bool(const std::string& application_id,
+ policy_table::AppHMIType hmi_type));
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
new file mode 100644
index 0000000000..d98a0279d7
--- /dev/null
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
@@ -0,0 +1,104 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
+
+#include <string>
+
+#include "gmock/gmock.h"
+
+#include "policy/policy_listener.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+#include "utils/custom_string.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+namespace custom_str = utils::custom_string;
+
+class MockPolicyListener : public ::policy::PolicyListener {
+ public:
+ MOCK_METHOD3(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions,
+ const policy::HMILevel& default_hmi));
+ MOCK_METHOD2(OnPermissionsUpdated,
+ void(const std::string& policy_app_id,
+ const policy::Permissions& permissions));
+ MOCK_METHOD1(OnPendingPermissionChange,
+ void(const std::string& policy_app_id));
+ MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
+ MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
+ std::string(const std::string& policy_app_id));
+ MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
+ MOCK_METHOD1(GetAppName,
+ custom_str::CustomString(const std::string& policy_app_id));
+ MOCK_METHOD0(OnUserRequestedUpdateCheckRequired, void());
+ MOCK_METHOD2(OnDeviceConsentChanged,
+ void(const std::string& device_id, bool is_allowed));
+ MOCK_METHOD1(OnUpdateHMIAppType,
+ void(std::map<std::string, policy::StringArray>));
+ MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>&));
+ MOCK_METHOD1(OnSnapshotCreated, void(const policy::BinaryMessage& pt_string));
+ MOCK_METHOD0(CanUpdate, bool());
+ MOCK_METHOD1(OnCertificateUpdated, void(const std::string&));
+ MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
+ void(const policy::AppPermissions&, const std::string&));
+ MOCK_METHOD3(OnUpdateHMILevel,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+ MOCK_METHOD1(GetDevicesIds,
+ std::vector<std::string>(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(GetRegisteredLinks,
+ void(std::map<std::string, std::string>&));
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent));
+ MOCK_METHOD2(OnRemoteAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_METHOD3(OnUpdateHMIStatus,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ const std::string& hmi_level));
+#endif // SDL_REMOTE_CONTROL
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
new file mode 100644
index 0000000000..82012b83c7
--- /dev/null
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
+
+#include <string>
+#include <vector>
+#include "gmock/gmock.h"
+#include "policy/policy_listener.h"
+#include "policy/policy_types.h"
+#include "policy/usage_statistics/statistics_manager.h"
+
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_manager.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace test {
+namespace components {
+namespace policy_manager_test {
+
+namespace {
+using namespace policy;
+}
+
+class MockPolicyManager : public PolicyManager {
+ public:
+ MOCK_METHOD1(set_listener, void(PolicyListener* listener));
+ MOCK_METHOD2(InitPT,
+ bool(const std::string& file_name,
+ const PolicySettings* settings));
+ MOCK_METHOD2(LoadPT,
+ bool(const std::string& file, const BinaryMessage& pt_content));
+ MOCK_METHOD1(ResetPT, bool(const std::string& file_name));
+
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const uint32_t service_type, EndpointUrls& out_end_points));
+ MOCK_METHOD2(GetUpdateUrls,
+ void(const std::string& service_type,
+ EndpointUrls& out_end_points));
+ MOCK_METHOD0(RequestPTUpdate, bool());
+ MOCK_METHOD5(CheckPermissions,
+ void(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result));
+ MOCK_METHOD0(ResetUserConsent, bool());
+ MOCK_CONST_METHOD0(GetPolicyTableStatus, std::string());
+ MOCK_METHOD1(KmsChanged, void(int kilometers));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+ MOCK_METHOD0(ForcePTExchange, std::string());
+ MOCK_METHOD0(ForcePTExchangeAtUserRequest, std::string());
+ MOCK_METHOD0(ResetRetrySequence, void());
+ MOCK_METHOD0(NextRetryTimeout, uint32_t());
+ MOCK_METHOD0(TimeoutExchangeMSec, uint32_t());
+ MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector<int>());
+ MOCK_METHOD0(OnExceededTimeout, void());
+ MOCK_METHOD0(OnUpdateStarted, void());
+ MOCK_CONST_METHOD1(GetUserConsentForDevice,
+ DeviceConsent(const std::string& device_id));
+ MOCK_METHOD3(
+ GetUserConsentForApp,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<policy::FunctionalGroupPermission>& permissions));
+ MOCK_METHOD2(SetUserConsentForDevice,
+ void(const std::string& device_id, const bool is_allowed));
+ MOCK_METHOD2(ReactOnUserDevConsentForApp,
+ bool(const std::string app_id, bool is_device_allowed));
+ MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
+
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string&,
+ policy::StringArray*,
+ policy::StringArray*));
+
+ MOCK_METHOD2(AddDevice,
+ void(const std::string& device_id,
+ const std::string& connection_type));
+ MOCK_METHOD2(SetDeviceInfo,
+ void(const std::string& device_id,
+ const policy::DeviceInfo& device_info));
+ MOCK_METHOD1(SetUserConsentForApp,
+ void(const policy::PermissionConsent& permissions));
+ MOCK_CONST_METHOD2(GetDefaultHmi,
+ bool(const std::string& policy_app_id,
+ std::string* default_hmi));
+ MOCK_CONST_METHOD2(GetPriority,
+ bool(const std::string& policy_app_id,
+ std::string* priority));
+ MOCK_METHOD2(GetUserFriendlyMessages,
+ std::vector<policy::UserFriendlyMessage>(
+ const std::vector<std::string>& message_code,
+ const std::string& language));
+ MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD3(
+ GetPermissionsForApp,
+ void(const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<policy::FunctionalGroupPermission>& permissions));
+ MOCK_METHOD1(GetAppPermissionsChanges,
+ policy::AppPermissions(const std::string& policy_app_id));
+ MOCK_METHOD1(RemovePendingPermissionChanges, void(const std::string& app_id));
+ MOCK_CONST_METHOD1(GetCurrentDeviceId,
+ std::string&(const std::string& policy_app_id));
+ MOCK_METHOD1(SetSystemLanguage, void(const std::string& language));
+ MOCK_METHOD3(SetSystemInfo,
+ void(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language));
+ MOCK_METHOD1(SendNotificationOnPermissionsUpdated,
+ void(const std::string& application_id));
+ MOCK_METHOD1(MarkUnpairedDevice, void(const std::string& device_id));
+ MOCK_METHOD2(
+ AddApplication,
+ StatusNotifier(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types));
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const std::string& application_id,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD2(GetHMITypes,
+ bool(const std::string& application_id,
+ std::vector<int>* app_types));
+ MOCK_METHOD2(CheckModule,
+ bool(const PTString& app_id, const PTString& module));
+ MOCK_METHOD2(SendAppPermissionsChanged,
+ void(const std::string& device_id,
+ const std::string& application_id));
+ MOCK_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& policy_app_id,
+ std::vector<std::string>* modules));
+ MOCK_METHOD1(set_access_remote,
+ void(utils::SharedPtr<AccessRemote> access_remote));
+#endif // SDL_REMOTE_CONTROL
+ MOCK_METHOD0(CleanupUnpairedDevices, bool());
+ MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
+ MOCK_METHOD0(OnSystemReady, void());
+ MOCK_CONST_METHOD1(GetNotificationsNumber,
+ uint32_t(const std::string& priority));
+ MOCK_METHOD1(SetVINValue, void(const std::string& value));
+ MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& policy_app_id));
+ MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
+ MOCK_METHOD1(SaveUpdateStatusRequired, void(bool is_update_needed));
+ MOCK_METHOD0(OnAppsSearchStarted, void());
+ MOCK_METHOD1(OnAppsSearchCompleted, void(const bool trigger_ptu));
+ MOCK_METHOD1(OnAppRegisteredOnMobile,
+ void(const std::string& application_id));
+ MOCK_CONST_METHOD1(
+ GetAppRequestTypes,
+ const std::vector<std::string>(const std::string policy_app_id));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
+ MOCK_CONST_METHOD0(GetMetaInfo, const policy::MetaInfo());
+ MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
+ MOCK_CONST_METHOD0(HasCertificate, bool());
+ MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
+ MOCK_METHOD0(ExceededIgnitionCycles, bool());
+ MOCK_METHOD0(ExceededDays, bool());
+ MOCK_METHOD0(StartPTExchange, void());
+
+ // --- Statistics Manager section
+ MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
+ MOCK_METHOD2(Increment,
+ void(const std::string& app_id,
+ usage_statistics::AppCounterId type));
+ MOCK_METHOD3(Set,
+ 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,
+ int32_t timespan_seconds));
+ MOCK_CONST_METHOD0(get_settings, const PolicySettings&());
+ MOCK_METHOD1(set_settings, void(const PolicySettings* get_settings));
+ MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
+ MOCK_METHOD1(GetNextUpdateUrl, AppIdURL(const EndpointUrls& urls));
+ MOCK_CONST_METHOD2(RetrySequenceUrl,
+ AppIdURL(const struct RetrySequenceURL&,
+ const EndpointUrls& urls));
+ MOCK_METHOD6(CheckPermissions,
+ void(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result));
+ MOCK_METHOD2(
+ CheckPendingPermissionsChanges,
+ void(const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions));
+
+ MOCK_METHOD2(OnDeviceSwitching,
+ void(const std::string& device_id_from,
+ const std::string& device_id_to));
+};
+
+} // namespace policy_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
diff --git a/src/components/include/test/policy/mock_policy_settings.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
index 438e697c51..438e697c51 100644
--- a/src/components/include/test/policy/mock_policy_settings.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_settings.h
diff --git a/src/components/policy/test/include/mock_app_stopwatch.h b/src/components/include/test/policy/policy_regular/policy/usage_statistics/mock_app_stopwatch.h
index 481d887cb2..481d887cb2 100644
--- a/src/components/policy/test/include/mock_app_stopwatch.h
+++ b/src/components/include/test/policy/policy_regular/policy/usage_statistics/mock_app_stopwatch.h
diff --git a/src/components/include/test/policy/usage_statistics/mock_statistics_manager.h b/src/components/include/test/policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h
index e58adea124..e58adea124 100644
--- a/src/components/include/test/policy/usage_statistics/mock_statistics_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/usage_statistics/mock_statistics_manager.h
diff --git a/src/components/include/test/policy/usage_statistics/mock_app_stopwatch.h b/src/components/include/test/policy/usage_statistics/mock_app_stopwatch.h
index 481d887cb2..aa29d2c78b 100644
--- a/src/components/include/test/policy/usage_statistics/mock_app_stopwatch.h
+++ b/src/components/include/test/policy/usage_statistics/mock_app_stopwatch.h
@@ -34,7 +34,6 @@
#include "gmock/gmock.h"
#include "policy/usage_statistics/app_stopwatch.h"
-#include "policy/usage_statistics/statistics_manager.h"
namespace test {
namespace components {
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h
index 44287edd4d..79c2188cdf 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h
@@ -62,6 +62,16 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler {
MOCK_CONST_METHOD0(get_settings,
const ::protocol_handler::ProtocolHandlerSettings&());
MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&());
+ DEPRECATED MOCK_METHOD6(NotifySessionStartedResult,
+ void(int32_t connection_id,
+ uint8_t session_id,
+ uint8_t generated_session_id,
+ uint32_t hash_id,
+ bool protection,
+ std::vector<std::string>& rejected_params));
+ MOCK_METHOD2(NotifySessionStarted,
+ void(const ::protocol_handler::SessionContext& context,
+ std::vector<std::string>& rejected_params));
};
} // namespace protocol_handler_test
} // namespace components
diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
index d12e7899e0..8ddeded889 100644
--- a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
+++ b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h
@@ -43,6 +43,10 @@ class MockProtocolHandlerSettings
: public protocol_handler::ProtocolHandlerSettings {
public:
MOCK_CONST_METHOD0(maximum_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_control_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_rpc_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_audio_payload_size, size_t());
+ MOCK_CONST_METHOD0(maximum_video_payload_size, size_t());
MOCK_CONST_METHOD0(message_frequency_count, size_t());
MOCK_CONST_METHOD0(message_frequency_time, size_t());
MOCK_CONST_METHOD0(malformed_message_filtering, bool());
diff --git a/src/components/include/test/protocol_handler/mock_protocol_observer.h b/src/components/include/test/protocol_handler/mock_protocol_observer.h
new file mode 100644
index 0000000000..257ea5ad9f
--- /dev/null
+++ b/src/components/include/test/protocol_handler/mock_protocol_observer.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_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_PROTOCOL_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_PROTOCOL_OBSERVER_H_
+
+#include "gmock/gmock.h"
+#include <string>
+#include "protocol_handler/protocol_observer.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+
+/*
+ * MOCK implementation of ::protocol_handler::ProtocolObserver interface
+ */
+class MockProtocolObserver : 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_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_PROTOCOL_OBSERVER_H_
diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h
index 994c78b961..3d54b97fad 100644
--- a/src/components/include/test/protocol_handler/mock_session_observer.h
+++ b/src/components/include/test/protocol_handler/mock_session_observer.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_MOCK_H_
-#define TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_MOCK_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_SESSION_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_SESSION_OBSERVER_H_
#include <gmock/gmock.h>
#include <string>
@@ -46,19 +46,31 @@ namespace protocol_handler_test {
*/
class MockSessionObserver : public ::protocol_handler::SessionObserver {
public:
- MOCK_METHOD5(
+ DEPRECATED MOCK_METHOD5(
OnSessionStartedCallback,
uint32_t(const transport_manager::ConnectionUID connection_handle,
const uint8_t sessionId,
const protocol_handler::ServiceType& service_type,
const bool is_protected,
uint32_t* hash_id));
+ MOCK_METHOD5(OnSessionStartedCallback,
+ void(const transport_manager::ConnectionUID connection_handle,
+ const uint8_t sessionId,
+ const protocol_handler::ServiceType& service_type,
+ const bool is_protected,
+ const BsonObject* params));
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_METHOD4(
+ OnSessionEndedCallback,
+ uint32_t(const transport_manager::ConnectionUID connection_handle,
+ const uint8_t sessionId,
+ uint32_t* hashCode,
+ const protocol_handler::ServiceType& service_type));
MOCK_METHOD1(OnApplicationFloodCallBack,
void(const uint32_t& connection_key));
MOCK_METHOD1(OnMalformedMessageCallback,
@@ -75,13 +87,27 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
int32_t(uint32_t key,
uint32_t* app_id,
std::list<int32_t>* sessions_list,
- uint32_t* device_id));
+ transport_manager::DeviceHandle* device_id));
+ DEPRECATED MOCK_CONST_METHOD4(GetDataOnSessionKey,
+ int32_t(uint32_t key,
+ uint32_t* app_id,
+ std::list<int32_t>* sessions_list,
+ uint32_t* device_id));
+
MOCK_CONST_METHOD5(GetDataOnDeviceID,
- int32_t(uint32_t device_handle,
+ int32_t(transport_manager::DeviceHandle device_handle,
std::string* device_name,
std::list<uint32_t>* applications_list,
std::string* mac_address,
std::string* connection_type));
+
+ DEPRECATED MOCK_CONST_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_CONST_METHOD2(IsHeartBeatSupported,
bool(transport_manager::ConnectionUID connection_handle,
uint8_t session_id));
@@ -100,6 +126,9 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
MOCK_METHOD2(SetProtectionFlag,
void(const uint32_t& key,
const protocol_handler::ServiceType& service_type));
+ MOCK_CONST_METHOD2(SessionServiceExists,
+ bool(const uint32_t connection_key,
+ const protocol_handler::ServiceType& service_type));
MOCK_CONST_METHOD1(
GetHandshakeContext,
security_manager::SSLContext::HandshakeContext(uint32_t key));
@@ -108,4 +137,4 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver {
} // namespace protocol_handler_test
} // namespace components
} // namespace test
-#endif // TEST_COMPONENTS_INCLUDE_PROTOCOL_HANDLER_SESSION_OBSERVER_MOCK_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_SESSION_OBSERVER_H_
diff --git a/src/components/include/test/protocol_handler/mock_telemetry_observer.h b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
new file mode 100644
index 0000000000..1c87de4d5a
--- /dev/null
+++ b/src/components/include/test/protocol_handler/mock_telemetry_observer.h
@@ -0,0 +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.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_TELEMETRY_OBSERVER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_TELEMETRY_OBSERVER_H_
+
+#include "gmock/gmock.h"
+
+#include "protocol_handler/telemetry_observer.h"
+
+namespace test {
+namespace components {
+namespace protocol_handler_test {
+
+class MockPHTelemetryObserver : public PHTelemetryObserver {
+ public:
+ MOCK_METHOD2(StartMessageProcess,
+ void(uint32_t message_id, const TimevalStruct& start_time));
+ MOCK_METHOD1(EndMessageProcess, void(utils::SharedPtr<MessageMetric> m));
+};
+
+} // namespace protocol_handler_test
+} // namespace components
+} // namespace test
+#endif // SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_TELEMETRY_OBSERVER_H_
diff --git a/src/components/include/test/resumption/mock_last_state.h b/src/components/include/test/resumption/mock_last_state.h
new file mode 100644
index 0000000000..9f4b11cbbf
--- /dev/null
+++ b/src/components/include/test/resumption/mock_last_state.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_RESUMPTION_MOCK_LAST_STATE_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_RESUMPTION_MOCK_LAST_STATE_H_
+
+#include "gmock/gmock.h"
+#include "resumption/last_state.h"
+
+namespace test {
+namespace components {
+namespace resumption_test {
+
+class MockLastState : public resumption::LastState {
+ public:
+ MOCK_METHOD0(SaveStateToFileSystem, void());
+ MOCK_METHOD0(get_dictionary, Json::Value&());
+};
+
+} // namespace resumption_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_RESUMPTION_MOCK_LAST_STATE_H_
diff --git a/src/components/include/test/security_manager/mock_security_manager.h b/src/components/include/test/security_manager/mock_security_manager.h
index e3d95cd94f..11890cb071 100644
--- a/src/components/include/test/security_manager/mock_security_manager.h
+++ b/src/components/include/test/security_manager/mock_security_manager.h
@@ -65,6 +65,9 @@ class MockSecurityManager : public ::security_manager::SecurityManager {
void(const ::protocol_handler::RawMessagePtr));
MOCK_METHOD1(OnMobileMessageSent,
void(const ::protocol_handler::RawMessagePtr));
+ MOCK_METHOD0(IsCertificateUpdateRequired, bool());
+ MOCK_METHOD0(NotifyOnCertificateUpdateRequired, void());
+ MOCK_METHOD0(IsPolicyCertificateDataEmpty, bool());
};
/*
diff --git a/src/components/include/test/security_manager/mock_security_manager_listener.h b/src/components/include/test/security_manager/mock_security_manager_listener.h
index 9e5dd03698..a06762a09d 100644
--- a/src/components/include/test/security_manager/mock_security_manager_listener.h
+++ b/src/components/include/test/security_manager/mock_security_manager_listener.h
@@ -48,6 +48,7 @@ class MockSecurityManagerListener
bool(uint32_t connection_key,
::security_manager::SSLContext::HandshakeResult result));
MOCK_METHOD0(OnCertificateUpdateRequired, void());
+ MOCK_CONST_METHOD1(GetPolicyCertificateData, bool(std::string& data));
};
} // namespace security_manager_test
} // namespace components
diff --git a/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h b/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h
index 9ba4528ecf..dd07f1d3c8 100644
--- a/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h
+++ b/src/components/include/test/telemetry_monitor/mock_telemetry_observable.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TEST_MOCK_TELEMETRY_OBSERVEABLE_H
-#define SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TEST_MOCK_TELEMETRY_OBSERVEABLE_H
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_TELEMETRY_MONITOR_MOCK_TELEMETRY_OBSERVABLE_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_TELEMETRY_MONITOR_MOCK_TELEMETRY_OBSERVABLE_H_
#include "gmock/gmock.h"
#include "telemetry_monitor/telemetry_observable.h"
@@ -52,4 +52,4 @@ class MockTelemetryObservable : public telemetry_monitor::TelemetryObservable<
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TELEMETRY_MONITOR_TEST_MOCK_TELEMETRY_OBSERVEABLE_H
+#endif // SRC_COMPONENTS_INCLUDE_TEST_TELEMETRY_MONITOR_MOCK_TELEMETRY_OBSERVABLE_H_
diff --git a/src/components/include/test/telemetry_monitor/mock_telemetry_observer.h b/src/components/include/test/telemetry_monitor/mock_telemetry_observer.h
deleted file mode 100644
index e638048126..0000000000
--- a/src/components/include/test/telemetry_monitor/mock_telemetry_observer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
-
-#include <string>
-#include "gmock/gmock.h"
-#include "transport_manager/telemetry_observer.h"
-#include "protocol/raw_message.h"
-namespace test {
-namespace components {
-namespace transport_manager_test {
-
-class TMTelemetryObserverMock
- : public ::transport_manager::TMTelemetryObserver {
- 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_TRANSPORT_MANAGER_MOCK_TIME_METRIC_OBSERVER_H_
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_listener.h b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
new file mode 100644
index 0000000000..f4c4fdcf68
--- /dev/null
+++ b/src/components/include/test/transport_manager/mock_transport_manager_listener.h
@@ -0,0 +1,94 @@
+/*
+ * 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_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_LISTENER_H_
+
+#include "gmock/gmock.h"
+
+#include "transport_manager/transport_manager_listener.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace transport_manager;
+using ::protocol_handler::RawMessage;
+using ::protocol_handler::RawMessagePtr;
+
+class MockTransportManagerListener : public TransportManagerListener {
+ public:
+ MOCK_METHOD1(OnDeviceListUpdated,
+ void(const std::vector<DeviceInfo>& device_info));
+ 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(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(const ConnectionUID connection_id));
+ MOCK_METHOD2(OnUnexpectedDisconnect,
+ void(const ConnectionUID connection_id,
+ const CommunicationError& error));
+ MOCK_METHOD2(OnConnectionClosedFailure,
+ void(const ConnectionUID connection_id,
+ const DisconnectError& 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 ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD1(OnTMMessageReceiveFailed, void(const DataReceiveError& error));
+ MOCK_METHOD1(OnTMMessageSend,
+ void(const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD2(OnTMMessageSendFailed,
+ void(const DataSendError& error,
+ const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD2(OnDeviceSwitchingStart,
+ void(const DeviceUID& device_uid_from,
+ const DeviceUID& device_uid_to));
+ MOCK_METHOD1(OnDeviceSwitchingFinish, void(const DeviceUID& device_uid));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_LISTENER_H_
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h
index 9e868977d3..24e9c701a7 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h
@@ -29,8 +29,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H
-#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H_
#include "gmock/gmock.h"
#include "protocol_handler/protocol_handler.h"
@@ -59,4 +59,4 @@ class MockTransportManagerMMESettings
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H
+#endif // SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_MME_SETTINGS_H_
diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
index a879723475..88112df003 100644
--- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h
+++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h
@@ -29,8 +29,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H
-#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H_
#include "gmock/gmock.h"
#include "protocol_handler/protocol_handler.h"
@@ -59,10 +59,12 @@ class MockTransportManagerSettings
MOCK_CONST_METHOD0(iap_system_config, const std::string&());
MOCK_CONST_METHOD0(iap2_system_config, const std::string&());
MOCK_CONST_METHOD0(iap_hub_connection_wait_timeout, uint32_t());
+ MOCK_CONST_METHOD0(app_transport_change_timer, uint32_t());
+ MOCK_CONST_METHOD0(app_transport_change_timer_addition, uint32_t());
};
} // namespace transport_manager_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H
+#endif // SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_device.h b/src/components/include/test/transport_manager/transport_adapter/mock_device.h
new file mode 100644
index 0000000000..6829e98d1d
--- /dev/null
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_device.h
@@ -0,0 +1,71 @@
+/*
+ * 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_MOCK_DEVICE_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_DEVICE_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/device.h"
+#include "transport_manager/common.h"
+#include "transport_manager/tcp/tcp_device.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class MockDevice : public ::transport_manager::transport_adapter::Device {
+ public:
+ MockDevice(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_CONST_METHOD1(LaunchApp, void(const std::string& bundle_id));
+ MOCK_METHOD0(Stop, void());
+};
+
+class MockTCPDevice : public ::transport_manager::transport_adapter::TcpDevice {
+ public:
+ MockTCPDevice(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_TRANSPORT_MANAGER_MOCK_DEVICE_H_
diff --git a/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
new file mode 100644
index 0000000000..c37c41d4f8
--- /dev/null
+++ b/src/components/include/test/transport_manager/transport_adapter/mock_transport_adapter.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/transport_adapter.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class MockTransportAdapter
+ : 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_METHOD2(RunAppOnDevice, void(const std::string&, const std::string&));
+ 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(RemoveFinalizedConnection,
+ void(const ::transport_manager::DeviceUID& device_handle,
+ const ::transport_manager::ApplicationHandle& app_handle));
+ 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));
+
+ MOCK_CONST_METHOD1(StopDevice,
+ void(const ::transport_manager::DeviceUID& device_id));
+ MOCK_CONST_METHOD0(DoTransportSwitch, void());
+ MOCK_METHOD1(DeviceSwitched,
+ void(const ::transport_manager::DeviceUID& device_handle));
+ MOCK_CONST_METHOD0(GetSwitchableDevices,
+ transport_manager::SwitchableDevices());
+#ifdef TELEMETRY_MONITOR
+ MOCK_METHOD0(GetTelemetryObserver,
+ ::transport_manager::TMTelemetryObserver*());
+#endif // TELEMETRY_MONITOR
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_INCLUDE_TEST_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_H_
diff --git a/src/components/include/test/utils/test_async_waiter.h b/src/components/include/test/utils/test_async_waiter.h
new file mode 100644
index 0000000000..fee7672e93
--- /dev/null
+++ b/src/components/include/test/utils/test_async_waiter.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_UTILS_TEST_ASYNC_WAITER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_UTILS_TEST_ASYNC_WAITER_H_
+
+#include <stdint.h>
+
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+
+namespace test {
+
+/**
+ * @brief The TestAsyncWaiter class
+ * Tool with condition variable style interface
+ * to be used in unit tests for asynchronous calls waiting.
+ * Could wait specified number of calls, waiting for timeout is also supported
+ *
+ * Usage example:
+ * TEST() {
+ * TestAsyncWaiter waiter;
+ * EXPECT_CALL(mock, InterestingCall())
+ * .Times(n)
+ * .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
+ * EXPECT_TRUE(waiter.WaitFor(n, 1000));
+ * }
+ */
+class TestAsyncWaiter {
+ public:
+ TestAsyncWaiter() : notified_(false), count_(0), lock_(), cond_var_() {}
+
+ /**
+ * @brief WaitFor
+ * Waits for specified number of notifications but not longer
+ * than given timeout for each notification
+ * @param wait_count Number of notifications to wait for
+ * @param milliseconds Timeout in milliseconds
+ * @return True if specified number of notifications have been received,
+ * false otherwise (return by timeout)
+ */
+ bool WaitFor(const uint32_t wait_count, const uint32_t milliseconds) {
+ sync_primitives::AutoLock auto_lock(lock_);
+ while (count_ < wait_count) {
+ notified_ = false;
+ if (sync_primitives::ConditionalVariable::kTimeout ==
+ cond_var_.WaitFor(auto_lock, milliseconds)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @brief Notify
+ * Notifies async waiter
+ */
+ void Notify() {
+ sync_primitives::AutoLock auto_lock(lock_);
+ notified_ = true;
+ ++count_;
+ cond_var_.Broadcast();
+ }
+
+ private:
+ bool notified_;
+ uint32_t count_;
+ sync_primitives::Lock lock_;
+ sync_primitives::ConditionalVariable cond_var_;
+};
+
+ACTION_P(NotifyTestAsyncWaiter, test_async_waiter) {
+ test_async_waiter->Notify();
+}
+
+} // namespace test
+#endif // SRC_COMPONENTS_INCLUDE_TEST_UTILS_TEST_ASYNC_WAITER_H_
diff --git a/src/components/include/transport_manager/common.h b/src/components/include/transport_manager/common.h
index c1fc51dc8a..58bcf6bb17 100644
--- a/src/components/include/transport_manager/common.h
+++ b/src/components/include/transport_manager/common.h
@@ -35,6 +35,7 @@
#include <vector>
#include <string>
+#include <map>
/**
* @brief - transport_manager namespace
@@ -58,7 +59,7 @@ enum {
/**
* @brief Type definition for variable that hold handle of device.
*/
-typedef unsigned int DeviceHandle;
+typedef size_t DeviceHandle;
/**
* @brief Type definition for variable that hold connection unique identifier.
@@ -90,5 +91,12 @@ typedef int ApplicationHandle;
* @brief Type definition for vector that contain ApplicationHandle variables.
*/
typedef std::vector<ApplicationHandle> ApplicationList;
+
+/**
+ * @brief SwitchableDevices defines list of devices having transport switch id
+ * i.e. able to switch their transport. Maps unique device id (MAC, serial etc.)
+ * to transport switch id (e.g. connection UUID for iAP2 transport)
+ */
+typedef std::map<DeviceUID, std::string> SwitchableDevices;
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_COMMON_H_
diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h
index 3adb6cd2e6..148e715050 100644
--- a/src/components/include/transport_manager/transport_adapter/device.h
+++ b/src/components/include/transport_manager/transport_adapter/device.h
@@ -58,6 +58,22 @@ class Device {
: name_(name)
, unique_device_id_(unique_device_id)
, keep_on_disconnect_(false) {}
+
+ /**
+ * Constructor for creating device supporting transport switch
+ * @brief Device constructor
+ * @param name Device name
+ * @param unique_device_id Unique device id
+ * @param transport_switch_id Id used for transport switching flow
+ */
+ Device(const std::string& name,
+ const DeviceUID& unique_device_id,
+ std::string transport_switch_id)
+ : name_(name)
+ , unique_device_id_(unique_device_id)
+ , transport_switch_id_(transport_switch_id)
+ , keep_on_disconnect_(false) {}
+
/**
* @brief Destructor.
**/
@@ -114,6 +130,14 @@ class Device {
keep_on_disconnect_ = keep_on_disconnect;
}
+ /**
+ * @brief transport_switch_id Returns id used for transport switching
+ * flow of device. Filled if applicable, otherwise - empty.
+ */
+ inline std::string transport_switch_id() const {
+ return transport_switch_id_;
+ }
+
private:
/**
* @brief Device user-friendly name.
@@ -124,6 +148,11 @@ class Device {
* @brief Unique device identifier across all devices.
**/
DeviceUID unique_device_id_;
+ /**
+ * @brief transport_switch_id_ ID used to switch device from one to another
+ * transport. Filled if applicable, otherwise - empty
+ */
+ std::string transport_switch_id_;
/**
* @brief If true, device will remain in list even if all its connections
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 ee726ff1d3..7f6d347535 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h
@@ -56,10 +56,22 @@ namespace transport_adapter {
class TransportAdapterListener;
-// TODO(EZamakhov): cahnge to DeviceUID
-// typedef std::string DeviceType;
-
-enum DeviceType { AOA, PASA_AOA, BLUETOOTH, PASA_BLUETOOTH, MME, TCP, UNKNOWN };
+/**
+ * @brief The DeviceType enum defines types based on available transport
+ * adapters
+ * @deprecated PASA_AOA, PASA_BLUETOOTH, MME
+ */
+enum DeviceType {
+ AOA,
+ PASA_AOA,
+ BLUETOOTH,
+ PASA_BLUETOOTH,
+ MME,
+ IOS_BT,
+ IOS_USB,
+ TCP,
+ UNKNOWN
+};
typedef std::map<DeviceType, std::string> DeviceTypes;
@@ -278,6 +290,28 @@ class TransportAdapter {
*/
virtual std::string DeviceName(const DeviceUID& device_id) const = 0;
+ /**
+ * @brief StopDevice Stop all activity on device without removing it from
+ * devices list
+ * @param device_id unique device identifier that has to be stopped.
+ */
+ virtual void StopDevice(const DeviceUID& device_id) const = 0;
+
+ /**
+ * @brief DoTransportSwitch notifies listeners of transport adapter events
+ * that transport switching is requested by system
+ */
+ virtual void DoTransportSwitch() const = 0;
+
+ /**
+ * @brief DeviceSwitched is triggered for adapter to proceed with possible
+ * further switching steps required on device side. E.g. to notify device
+ * on end of switching so it can disconnect transport being switched from.
+ * @param device_handle Device id to notify on event
+ */
+ virtual void DeviceSwitched(const DeviceUID& device_handle) = 0;
+
+ virtual SwitchableDevices GetSwitchableDevices() const = 0;
#ifdef TELEMETRY_MONITOR
/**
* @brief Return Time metric observer
diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
index 7879a136b2..18f4ccb2d1 100644
--- a/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
+++ b/src/components/include/transport_manager/transport_adapter/transport_adapter_event.h
@@ -39,6 +39,27 @@
namespace transport_manager {
+/**
+ * @enum Available types of events.
+ */
+enum class EventTypeEnum {
+ ON_SEARCH_DONE = 0,
+ ON_SEARCH_FAIL,
+ ON_DEVICE_LIST_UPDATED,
+ ON_FIND_NEW_APPLICATIONS_REQUEST,
+ ON_CONNECT_DONE,
+ ON_CONNECT_FAIL,
+ ON_DISCONNECT_DONE,
+ ON_DISCONNECT_FAIL,
+ ON_SEND_DONE,
+ ON_SEND_FAIL,
+ ON_RECEIVED_DONE,
+ ON_RECEIVED_FAIL,
+ ON_COMMUNICATION_ERROR,
+ ON_UNEXPECTED_DISCONNECT,
+ ON_TRANSPORT_SWITCH_REQUESTED
+};
+
class TransportAdapterEvent {
public:
TransportAdapterEvent() {}
@@ -52,7 +73,7 @@ class TransportAdapterEvent {
* @param data Smart pointer to the raw message.
* @param error Error class that contains details of this error situation.
*/
- TransportAdapterEvent(int type,
+ TransportAdapterEvent(EventTypeEnum type,
transport_adapter::TransportAdapter* adapter,
const DeviceUID& device_handle,
const ApplicationHandle& application_id,
@@ -64,10 +85,35 @@ class TransportAdapterEvent {
, transport_adapter(adapter)
, event_data(data)
, event_error(error) {}
+
+ /**
+ * DEPRECATED
+ * @brief Constructor.
+ *
+ * @param type Event type.
+ * @param transport_adapter Transport adapter
+ * @param device_handle Handle of device.
+ * @param application_id Handle of application.
+ * @param data Smart pointer to the raw message.
+ * @param error Error class that contains details of this error situation.
+ */
+ TransportAdapterEvent(int type,
+ transport_adapter::TransportAdapter* adapter,
+ const DeviceUID& device_handle,
+ const ApplicationHandle& application_id,
+ ::protocol_handler::RawMessagePtr data,
+ BaseErrorPtr error)
+ : event_type(static_cast<EventTypeEnum>(type))
+ , application_id(application_id)
+ , device_uid(device_handle)
+ , transport_adapter(adapter)
+ , event_data(data)
+ , event_error(error) {}
+
/**
* @brief Value that describe event type.
*/
- int event_type;
+ EventTypeEnum event_type;
/**
* @brief Handle of application
*/
diff --git a/src/components/include/transport_manager/transport_manager_listener.h b/src/components/include/transport_manager/transport_manager_listener.h
index e9f49e3152..d336eade45 100644
--- a/src/components/include/transport_manager/transport_manager_listener.h
+++ b/src/components/include/transport_manager/transport_manager_listener.h
@@ -70,6 +70,23 @@ class TransportManagerListener {
virtual void OnDeviceRemoved(const DeviceInfo& device_info) = 0;
/**
+ * @brief OnDeviceSwitchingStart allows to notify listener that device is
+ * going to switch its connection.
+ * @param device_uid_from the id of the device which has to switch its
+ * transport
+ * @param device_uid_to the id of the device on new transport
+ */
+ virtual void OnDeviceSwitchingStart(const DeviceUID& device_uid_from,
+ const DeviceUID& device_uid_to) = 0;
+
+ /**
+ * @brief OnDeviceSwitchingFinish notifies listener that device reconnection
+ * fails due to some reason.
+ * @param device_uid the id for the device which is fails to reconnect.
+ */
+ virtual void OnDeviceSwitchingFinish(const DeviceUID& device_uid) = 0;
+
+ /**
* @brief Reaction to the event, when scanning of devices is finished.
*/
virtual void OnScanDevicesFinished() = 0;
diff --git a/src/components/include/transport_manager/transport_manager_listener_empty.h b/src/components/include/transport_manager/transport_manager_listener_empty.h
index c5eb0be37c..ca6c573a06 100644
--- a/src/components/include/transport_manager/transport_manager_listener_empty.h
+++ b/src/components/include/transport_manager/transport_manager_listener_empty.h
@@ -69,6 +69,23 @@ class TransportManagerListenerEmpty : public TransportManagerListener {
void OnDeviceRemoved(const DeviceInfo& device_info) OVERRIDE {}
/**
+ * @brief OnDeviceSwitchingStart allows to notify listener that device is
+ * going to switch its connection. This default implementation does nothing.
+ * @param device_uid_from the id of the device which has to switch its
+ * transport
+ * @param device_uid_to the id of the device on new transport
+ */
+ void OnDeviceSwitchingStart(const DeviceUID& device_uid_from,
+ const DeviceUID& device_uid_to) OVERRIDE {}
+
+ /**
+ * @brief OnDeviceSwitchingFinish notifies listener that device reconnection
+ * fails due to some reason. This default implementation does nothing.
+ * @param device_uid the id for the device which is fails to reconnect.
+ */
+ void OnDeviceSwitchingFinish(const DeviceUID& device_uid) OVERRIDE {}
+
+ /**
* @brief Reaction to the event, when scanning of devices is finished.
*/
void OnScanDevicesFinished() OVERRIDE {}
diff --git a/src/components/include/transport_manager/transport_manager_settings.h b/src/components/include/transport_manager/transport_manager_settings.h
index f33c5344e0..feb3fa2c02 100644
--- a/src/components/include/transport_manager/transport_manager_settings.h
+++ b/src/components/include/transport_manager/transport_manager_settings.h
@@ -51,6 +51,18 @@ class TransportManagerSettings : public TransportManagerMMESettings {
* @brief Returns port for TCP transport adapter
*/
virtual uint16_t transport_manager_tcp_adapter_port() const = 0;
+
+ /**
+ * @brief Returns the millisecond count before timeout
+ * for transport change feature occures.
+ */
+ virtual uint32_t app_transport_change_timer() const = 0;
+
+ /**
+ * @brief Returns the millisecond count as addition to
+ * the transport change timeout value.
+ */
+ virtual uint32_t app_transport_change_timer_addition() const = 0;
};
} // namespace transport_manager
#endif // SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_SETTINGS_H_
diff --git a/src/components/include/utils/callable.h b/src/components/include/utils/callable.h
new file mode 100644
index 0000000000..aff91814bf
--- /dev/null
+++ b/src/components/include/utils/callable.h
@@ -0,0 +1,26 @@
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H
+#define SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H
+
+#include "utils/macro.h"
+
+namespace utils {
+/**
+ * @brief The Callable class allows
+ * to create functor to call in other context
+ */
+class Callable {
+ public:
+ virtual void operator()() const = 0;
+ virtual ~Callable() {}
+};
+
+/**
+ * @brief The CallNothing class functior that to nothing
+ */
+class CallNothing : public Callable {
+ // Callable interface
+ public:
+ void operator()() const OVERRIDE {}
+};
+} // namespace utils
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_CALLABLE_H
diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h
index 0e029e4b06..e6f3b6b3ca 100644
--- a/src/components/include/utils/macro.h
+++ b/src/components/include/utils/macro.h
@@ -113,6 +113,13 @@
return; \
}
+#define EXPORT_FUNCTION(TypeName) extern "C" TypeName* Create();
+
+#define EXPORT_FUNCTION_IMPL(TypeName) \
+ extern "C" TypeName* Create() { \
+ return new TypeName(); \
+ }
+
#define NOTREACHED() DCHECK(!"Unreachable code")
// Allows to perform static check that virtual function from base class is
@@ -134,6 +141,26 @@
#ifdef BUILD_TESTS
#define FRIEND_TEST(test_case_name, test_name) \
friend class test_case_name##_##test_name##_Test
+#else // BUILD_TESTS
+#define FRIEND_TEST(test_case_name, test_name)
+#endif // BUILD_TESTS
+
+/*
+* @brief deprecate a method declaration, a warning will be thrown by your
+* compiler if a method with this macro is used
+*/
+#if __cplusplus > 201103L
+#define DEPRECATED [[deprecated]]
+#else
+#ifdef __GNUC__
+#define DEPRECATED __attribute__((deprecated))
+#define DEPRECATED_CLASS __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#define DEPRECATED __declspec(deprecated)
+#else
+#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
+#define DEPRECATED
+#endif
#endif
#endif // SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_
diff --git a/src/components/include/utils/memory_barrier.h b/src/components/include/utils/memory_barrier.h
index 43c7c9df14..f9452d76ad 100644
--- a/src/components/include/utils/memory_barrier.h
+++ b/src/components/include/utils/memory_barrier.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
-#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MEMORY_BARRIER_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_MEMORY_BARRIER_H_
#ifdef __QNXNTO__
#include <sys/cpuinline.h>
@@ -51,4 +51,4 @@ inline void memory_barrier() {
} // namespace utils
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_MEMORY_BARRIER_H_
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_MEMORY_BARRIER_H_
diff --git a/src/components/include/utils/scope_guard.h b/src/components/include/utils/scope_guard.h
index bc60a7d288..a425356c0e 100644
--- a/src/components/include/utils/scope_guard.h
+++ b/src/components/include/utils/scope_guard.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_SCOPE_GUARD_H
-#define SRC_COMPONENTS_INCLUDE_UTILS_SCOPE_GUARD_H
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_SCOPE_GUARD_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_SCOPE_GUARD_H_
namespace utils {
@@ -323,4 +323,4 @@ ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj,
return ObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1);
}
}
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_SCOPE_GUARD_H
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_SCOPE_GUARD_H_
diff --git a/src/components/include/utils/threads/CMakeLists.txt b/src/components/include/utils/threads/CMakeLists.txt
deleted file mode 100644
index f97039c21b..0000000000
--- a/src/components/include/utils/threads/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(UtilsIncludeDir ${COMPONENTS_DIR/utils/include)
-
-include_directories (
- ${UtilsIncludeDir}
-) \ No newline at end of file
diff --git a/src/components/include/utils/threads/async_runner.h b/src/components/include/utils/threads/async_runner.h
index c6da0638f4..64c9d09939 100644
--- a/src/components/include/utils/threads/async_runner.h
+++ b/src/components/include/utils/threads/async_runner.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_UTILS_ASYNC_RUNNER_H_
-#define SRC_COMPONENTS_INCLUDE_UTILS_ASYNC_RUNNER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_UTILS_THREADS_ASYNC_RUNNER_H_
+#define SRC_COMPONENTS_INCLUDE_UTILS_THREADS_ASYNC_RUNNER_H_
#include <string>
#include <queue>
@@ -123,4 +123,4 @@ class AsyncRunner {
} // namespace threads
-#endif // SRC_COMPONENTS_INCLUDE_UTILS_ASYNC_RUNNER_H_
+#endif // SRC_COMPONENTS_INCLUDE_UTILS_THREADS_ASYNC_RUNNER_H_
diff --git a/src/components/include/utils/threads/thread.h b/src/components/include/utils/threads/thread.h
index c81b912e9a..cba79b20bd 100644
--- a/src/components/include/utils/threads/thread.h
+++ b/src/components/include/utils/threads/thread.h
@@ -100,6 +100,7 @@ class Thread {
sync_primitives::ConditionalVariable run_cond_;
public:
+ static int count;
/**
* @brief Starts the thread.
* @return true if the thread was successfully started.
diff --git a/src/components/interfaces/CMakeLists.txt b/src/components/interfaces/CMakeLists.txt
index bcb47976ea..1ea481f11a 100644
--- a/src/components/interfaces/CMakeLists.txt
+++ b/src/components/interfaces/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,54 +28,49 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/generators.cmake)
include_directories (
- ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/include
+ ${COMPONENTS_DIR}/utils/include
${COMPONENTS_DIR}/formatters/include
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${CMAKE_BINARY_DIR}
)
-
-GenerateInterface("v4_protocol_v1_2_no_extra.xml" "NsSmartDeviceLinkRPC::V1" "sdlrpcv1")
-GenerateInterface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2")
-
-IF (${HMI_JSON_API})
- GenerateInterface("HMI_API.xml" "hmi_apis" "jsonrpc")
-ENDIF (${HMI_JSON_API})
-IF (${HMI_DBUS_API})
- set(hpp_file
- "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h"
- "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h"
- )
+generate_interface("v4_protocol_v1_2_no_extra.xml" "NsSmartDeviceLinkRPC::V1" "sdlrpcv1")
+add_library(v4_protocol_v1_2_no_extra ${CMAKE_CURRENT_BINARY_DIR}/v4_protocol_v1_2_no_extra_schema.cc)
- set(cpp_file "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc")
- set(full_xml_name "${CMAKE_CURRENT_SOURCE_DIR}/QT_HMI_API.xml")
+generate_interface("MOBILE_API.xml" "mobile_apis" "sdlrpcv2")
+add_library(MOBILE_API ${CMAKE_CURRENT_BINARY_DIR}/MOBILE_API_schema.cc)
- add_custom_command( OUTPUT ${hpp_file} ${cpp_file}
- COMMAND ${INTEFRACE_GENERATOR_CMD} ${full_xml_name} hmi_apis ${CMAKE_CURRENT_BINARY_DIR} "--parser-type" "jsonrpc"
- DEPENDS ${INTERFACE_GENERATOR_DEPENDENCIES} ${full_xml_name}
- COMMENT "Generating files:\n ${hpp_file}\n ${cpp_file}\nfrom:\n QT_HMI_API.xml ..."
- VERBATIM
- )
+if(HMI_JSON_API)
+ generate_interface("HMI_API.xml" "hmi_apis" "jsonrpc")
+ add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
+endif()
- include_directories (
- ${COMPONENTS_DIR}/smart_objects/include
- ${COMPONENTS_DIR}/formatters/include/
- ${CMAKE_BINARY_DIR}
- )
+if(HMI_DBUS_API)
+ generate_interface("QT_HMI_API.xml" "hmi_apis" "jsonrpc")
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h")
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API.h"
+ )
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h"
- DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h")
- add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.h"
+ )
+ add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
COMMAND sed "-e" "s/QT_HMI_API/HMI_API/g" "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" > "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/QT_HMI_API_schema.cc" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.h" "${CMAKE_CURRENT_BINARY_DIR}/HMI_API.h")
- add_library(HMI_API "${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc")
-ENDIF (${HMI_DBUS_API})
+
+ add_library(HMI_API ${CMAKE_CURRENT_BINARY_DIR}/HMI_API_schema.cc)
+endif()
+
+target_link_libraries(v4_protocol_v1_2_no_extra Utils)
+target_link_libraries(MOBILE_API Utils)
+target_link_libraries(HMI_API Utils)
-add_dependencies(HMI_API Utils)
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index bba3579680..ab3933fc0f 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -1,7 +1,10 @@
<?xml version="1.0" standalone="yes"?>
<!--
-* Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Copyright (c) 2017 Xevo Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,7 +37,7 @@
<interfaces name="SmartDeviceLink HMI API">
-<interface name="Common" version="1.4" date="2016-05-11">
+<interface name="Common" version="1.7.0" date="2017-10-20">
<enum name="Result">
<element name="SUCCESS" value="0"/>
@@ -63,6 +66,7 @@
<element name="USER_DISALLOWED" value="23"/>
<element name="TRUNCATED_DATA" value="24"/>
<element name="SAVED" value="25"/>
+ <element name="READ_ONLY" value="26"/>
</enum>
<enum name="TransportType">
@@ -92,6 +96,27 @@
<element name="PRESET_9"/>
<element name="CUSTOM_BUTTON"/>
<element name="SEARCH"/>
+ <!-- Climate Buttons -->
+ <element name="AC_MAX" />
+ <element name="AC" />
+ <element name="RECIRCULATE" />
+ <element name="FAN_UP" />
+ <element name="FAN_DOWN" />
+ <element name="TEMP_UP" />
+ <element name="TEMP_DOWN" />
+ <element name="DEFROST_MAX" />
+ <element name="DEFROST" />
+ <element name="DEFROST_REAR" />
+ <element name="UPPER_VENT" />
+ <element name="LOWER_VENT" />
+
+ <!-- Radio Buttons -->
+ <element name="VOLUME_UP" />
+ <element name="VOLUME_DOWN" />
+ <element name="EJECT" />
+ <element name="SOURCE" />
+ <element name="SHUFFLE" />
+ <element name="REPEAT" />
</enum>
<enum name="ButtonEventMode">
@@ -200,6 +225,36 @@
<element name="SK-SK" internal_name="SK_SK">
<description>Slovak - Slovakia</description>
</element>
+ <element name="EN-IN" internal_name="EN_IN">
+ <description>English - India</description>
+ </element>
+ <element name="TH-TH" internal_name="TH_TH">
+ <description>Thai - Thailand</description>
+ </element>
+ <element name="EN-SA" internal_name="EN_SA">
+ <description>English - Middle East</description>
+ </element>
+ <element name="HE-IL" internal_name="HE_IL">
+ <description>Hebrew - Israel</description>
+ </element>
+ <element name="RO-RO" internal_name="RO_RO">
+ <description>Romanian - Romania</description>
+ </element>
+ <element name="UK-UA" internal_name="UK_UA">
+ <description>Ukrainian - Ukraine</description>
+ </element>
+ <element name="ID-ID" internal_name="ID_ID">
+ <description>Indonesian - Indonesia</description>
+ </element>
+ <element name="VI-VN" internal_name="VI_VN">
+ <description>Vietnamese - Vietnam</description>
+ </element>
+ <element name="MS-MY" internal_name="MS_MY">
+ <description>Malay - Malaysia</description>
+ </element>
+ <element name="HI-IN" internal_name="HI_IN">
+ <description>Hindi - India</description>
+ </element>
</enum>
<enum name="SoftButtonType">
@@ -234,6 +289,8 @@
<element name="BACKGROUND_PROCESS" />
<element name="TESTING" />
<element name="SYSTEM" />
+ <element name="PROJECTION" />
+ <element name="REMOTE_CONTROL" />
</enum>
<enum name="WayPointType">
@@ -502,6 +559,45 @@
<element name="turnText"/>
</enum>
+<enum name="MetadataType">
+ <element name="mediaTitle">
+ <description>The data in this field contains the title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaArtist">
+ <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
+ </element>
+ <element name="mediaAlbum">
+ <description>The data in this field contains the album title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaYear">
+ <description>The data in this field contains the creation year of the currently playing audio track.</description>
+ </element>
+ <element name="mediaGenre">
+ <description>The data in this field contains the genre of the currently playing audio track.</description>
+ </element>
+ <element name="mediaStation">
+ <description>The data in this field contains the name of the current source for the media.</description>
+ </element>
+ <element name="rating">
+ <description>The data in this field is a rating.</description>
+ </element>
+ <element name="currentTemperature">
+ <description>The data in this field is the current temperature.</description>
+ </element>
+ <element name="maximumTemperature">
+ <description>The data in this field is the maximum temperature for the day.</description>
+ </element>
+ <element name="minimumTemperature">
+ <description>The data in this field is the minimum temperature for the day.</description>
+ </element>
+ <element name="weatherTerm">
+ <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
+ </element>
+ <element name="humidity">
+ <description>The data in this field describes the current humidity value.</description>
+ </element>
+</enum>
+
<enum name="ImageFieldName">
<element name="softButtonImage">
<description>The image field for SoftButton</description>
@@ -824,6 +920,7 @@
<element name="BEGIN"/>
<element name="MOVE"/>
<element name="END"/>
+ <element name="CANCEL"/>
</enum>
<enum name="WarningLightStatus">
@@ -1206,23 +1303,107 @@
<element name="QUEUE" />
</enum>
+<enum name="VideoStreamingProtocol">
+ <description>Enum for each type of video streaming protocol type.</description>
+ <element name="RAW">
+ <description>
+ Raw stream bytes that contains no timestamp data and is the lowest supported video streaming
+ </description>
+ </element>
+ <element name="RTP">
+ <description>
+ RTP facilitates the transfer of real-time data. Information provided by this protocol include
+ timestamps (for synchronization), sequence numbers (for packet loss and reordering detection)
+ and the payload format which indicates the encoded format of the data.
+ </description>
+ </element>
+ <element name="RTSP">
+ <description>
+ The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the
+ Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP)
+ for media stream delivery. However, some vendors implement proprietary transport protocols.
+ </description>
+ </element>
+ <element name="RTMP">
+ <description>
+ Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by
+ Macromedia for streaming audio, video and data over the Internet, between a Flash player
+ and a server. Macromedia is now owned by Adobe, which has released an incomplete version
+ of the specification of the protocol for public use.
+ </description>
+ </element>
+ <element name="WEBM">
+ <description>
+ The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and
+ Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.
+ </description>
+ </element>
+</enum>
+
+<enum name="VideoStreamingCodec">
+ <description>Enum for each type of video streaming codec.</description>
+ <element name="H264">
+ <description>
+ A block-oriented motion-compensation-based video compression standard.
+ As of 2014 it is one of the most commonly used formats for the recording, compression, and
+ distribution of video content.
+ </description>
+ </element>
+ <element name="H265">
+ <description>
+ High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video
+ compression standard, one of several potential successors to the widely used AVC (H.264 or
+ MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio
+ at the same level of video quality, or substantially improved video quality at the same
+ bit rate. It supports resolutions up to 8192x4320, including 8K UHD.
+ </description>
+ </element>
+ <element name="Theora">
+ <description>
+ Theora is derived from the formerly proprietary VP3 codec, released into the public domain
+ by On2 Technologies. It is broadly comparable in design and bitrate efficiency to
+ MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of
+ the features present in some of these other codecs. It is comparable in open standards
+ philosophy to the BBC's Dirac codec.
+ </description>
+ </element>
+ <element name="VP8">
+ <description>
+ VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and
+ Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct
+ successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for
+ Open Media (AOMedia) are based on VP8.
+ </description>
+ </element>
+ <element name="VP9">
+ <description>
+ Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD)
+ and also enables lossless compression.
+ </description>
+ </element>
+</enum>
+
<!-- Policies -->
-<enum name="UpdateResult">
+ <enum name="UpdateResult">
<element name="UP_TO_DATE"/>
<element name="UPDATING" />
<element name="UPDATE_NEEDED"/>
</enum>
+
<enum name="SystemError">
<element name="SYNC_REBOOTED"/>
<element name="SYNC_OUT_OF_MEMMORY" />
</enum>
+
<enum name="StatisticsType">
<element name="iAPP_BUFFER_FULL"/>
</enum>
+
<enum name="ConsentSource">
<element name="GUI"/>
<element name="VUI" />
</enum>
+
<enum name="DeviceState">
<element name="UNKNOWN"/>
<element name="UNPAIRED"/>
@@ -1235,17 +1416,18 @@
<param name="line2" type="String" mandatory="false"/>
<param name="textBody" type="String" mandatory="false"/>
</struct>
+
<struct name="PermissionItem">
- <param name="name" type="String" mandatory="true">
- <description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
- </param>
- <param name="id" type="Integer" mandatory="true">
- <description>Id of corresponding functional group, needed by SDL.</description>
- </param>
- <param name="allowed" type="Boolean" mandatory="false">
- <description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
- </param>
- </struct>
+ <param name="name" type="String" mandatory="true">
+ <description>Code of message of user-friendly text about functional group to be allowed/disallowed</description>
+ </param>
+ <param name="id" type="Integer" mandatory="true">
+ <description>Id of corresponding functional group, needed by SDL.</description>
+ </param>
+ <param name="allowed" type="Boolean" mandatory="false">
+ <description>Specifies whether functionality was allowed/disallowed. If ommited - no information about User Consent is yet found for app.</description>
+ </param>
+ </struct>
<struct name="ServiceInfo">
<param name="url" type="String" mandatory="true">
<description>Get URL based on service type.</description>
@@ -1254,19 +1436,318 @@
<description>ID of application that requested this RPC.</description>
</param>
</struct>
+
+ <enum name="EntityStatus">
+ <element name="ON"/>
+ <element name="OFF"/>
+ </enum>
+
+ <struct name="ExternalConsentStatus">
+ <param name="entityType" type="Integer" minvalue="0" maxvalue="128" mandatory="true">
+ <description>The entityType which status is informed by "status" param.</description>
+ </param>
+ <param name="entityID" type="Integer" minvalue="0" maxvalue="128" mandatory="true">
+ <description>The corresponding ID of entityType which status is informed by "status" param</description>
+ </param>
+ <param name="status" type="Common.EntityStatus" mandatory="true">
+ <description>Status of the ExternalConsentStatus entity: "ON" or "OFF". </description>
+ </param>
+ </struct>
<!-- End of Policies -->
+<!-- Remote Control -->
+<enum name="ModuleType">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ </enum>
+
+ <enum name="RadioBand">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <struct name="RdsData">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false">
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false">
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false">
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <enum name="RadioState">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <struct name="RadioControlData">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="Common.RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="Common.RdsData" mandatory="false">
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>number of HD sub-channels if available</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>Current HD sub-channel if available</description>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false is the radio is off</description>
+ </param>
+ <param name="state" type="Common.RadioState" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the radio control module.</description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="DefrostZone">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="TemperatureUnit">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="Temperature">
+ <param name="unit" type="TemperatureUnit" mandatory="true" >
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true" >
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="desiredTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="ClimateControlCapabilities">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the climate control module.</description>
+ </param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="Common.DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="ModuleData">
+ <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ </param>
+ <param name="radioControlData" type="Common.RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
+ </param>
+ </struct>
+
+<enum name="RCAccessMode">
+ <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
+ <element name="AUTO_ALLOW"/>
+ <element name="AUTO_DENY"/>
+ <element name="ASK_DRIVER"/>
+</enum>
+
+<!-- End Remote Control -->
<struct name="TextField">
- <param name="name" type="Common.TextFieldName">
+ <param name="name" type="Common.TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
</param>
- <param name="characterSet" type="Common.CharacterSet">
+ <param name="characterSet" type="Common.CharacterSet" mandatory="true">
<description>The character set that is supported in this field. See CharacterSet.</description>
</param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500">
+ <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
<description>The number of characters in one row of this field.</description>
</param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8">
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
<description>The number of rows of this field.</description>
</param>
</struct>
@@ -1289,10 +1770,10 @@
<struct name="VehicleDataResult">
<description>Individual published data request result</description>
- <param name="dataType" type="Common.VehicleDataType">
+ <param name="dataType" type="Common.VehicleDataType" mandatory="true">
<description>Defined published data element type.</description>
</param>
- <param name="resultCode" type="Common.VehicleDataResultCode">
+ <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
<description>Published data result code.</description>
</param>
</struct>
@@ -1547,6 +2028,32 @@
</param>
</struct>
+<struct name="VideoStreamingFormat">
+ <description>Video streaming formats and their specifications.</description>
+ <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="true">
+ <description>Protocol type, see VideoStreamingProtocol</description>
+ </param>
+ <param name="codec" type="Common.VideoStreamingCodec" mandatory="true">
+ <description>Codec type, see VideoStreamingCodec</description>
+ </param>
+</struct>
+
+<struct name="VideoConfig">
+ <description>Configuration of a video stream.</description>
+ <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="false">
+ <description>The video protocol configuration</description>
+ </param>
+ <param name="codec" type="Common.VideoStreamingCodec" mandatory="false">
+ <description>The video codec configuration</description>
+ </param>
+ <param name="width" type="Integer" mandatory="false">
+ <description>Width of the video stream, in pixels.</description>
+ </param>
+ <param name="height" type="Integer" mandatory="false">
+ <description>Height of the video stream, in pixels.</description>
+ </param>
+</struct>
+
<struct name="DisplayCapabilities">
<description>Contains information about the display capabilities.</description>
<param name="displayType" type="Common.DisplayType" mandatory="true">
@@ -1605,6 +2112,9 @@
<param name="phoneCall" type="Boolean" mandatory="false">
<description>Availability of build in phone. True: Available, False: Not Available</description>
</param>
+ <param name="videoStreaming" type="Boolean" mandatory="false">
+ <description>Availability of built-in video streaming. True: Available, False: Not Available</description>
+ </param>
</struct>
<struct name="AudioPassThruCapabilities">
@@ -1624,6 +2134,9 @@
<param name="fieldText" type="String" maxlength="500" mandatory="true">
<description>The text itself.</description>
</param>
+ <param name="fieldTypes" type="Common.MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the field.</description>
+ </param>
</struct>
<struct name="KeyboardProperties">
@@ -1902,73 +2415,73 @@
</struct>
<struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
</param>
- <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
</param>
- <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus">
+ <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus" mandatory="true">
<description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
</param>
</struct>
<struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
</struct>
<struct name="EmergencyEvent">
- <param name="emergencyEventType" type="Common.EmergencyEventType">
+ <param name="emergencyEventType" type="Common.EmergencyEventType" mandatory="true">
<description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
</param>
- <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus">
+ <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus" mandatory="true">
<description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
</param>
- <param name="rolloverEvent" type="Common.VehicleDataEventStatus">
+ <param name="rolloverEvent" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus">
+ <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="multipleEvents" type="Common.VehicleDataEventStatus">
+ <param name="multipleEvents" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
</struct>
<struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean">
+ <param name="powerModeActive" type="Boolean" mandatory="true">
<description>References signal "PowerMode_UB".</description>
</param>
- <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus">
+ <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus" mandatory="true">
<description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
</param>
- <param name="carModeStatus" type="Common.CarModeStatus">
+ <param name="carModeStatus" type="Common.CarModeStatus" mandatory="true">
<description>References signal "CarMode". See CarMode.</description>
</param>
- <param name="powerModeStatus" type="Common.PowerModeStatus">
+ <param name="powerModeStatus" type="Common.PowerModeStatus" mandatory="true">
<description>References signal "PowerMode". See PowerMode.</description>
</param>
</struct>
@@ -2064,9 +2577,92 @@
</param>
</struct>
+ <struct name="NavigationCapability">
+ <description>Extended capabilities for an onboard navigation system</description>
+ <param name="sendLocationEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to add locations to the onboard nav</description>
+ </param>
+ <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to return way points from onboard nav</description>
+ </param>
+ </struct>
+
+ <struct name="PhoneCapability">
+ <description>Extended capabilities of the module's phone feature</description>
+ <param name="dialNumberEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the abiulity to perform dial number</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingCapability">
+ <description>Contains information about this system's video streaming capabilities.</description>
+ <param name="preferredResolution" type="Common.ImageResolution" mandatory="false">
+ <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
+ </param>
+ <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
+ <description>The maximum bitrate of video stream that is supported, in kbps.</description>
+ </param>
+ <param name="supportedFormats" type="Common.VideoStreamingFormat" array="true" mandatory="false">
+ <description>
+ Detailed information on each format supported by this system, in its preferred order
+ (i.e. the first element in the array is most preferable to the system).
+ Each object will contain a VideoStreamingFormat that describes what can be expected.
+ </description>
+ </param>
+ <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
+ <description>True if the system can utilize the haptic spatial data from the source being streamed. </description>
+ </param>
+ </struct>
+
+ <struct name="SystemCapabilities">
+ <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ </param>
+ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ </param>
+ <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="RemoteControlCapabilities">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <description>If included, the platform supports RC button controls with the included button names.</description >
+ </param>
+ </struct>
+
+ <struct name="Rectangle">
+ <param name="x" type="Float" mandatory="true">
+ <description>The X-coordinate of the user control</description>
+ </param>
+ <param name="y" type="Float" mandatory="true">
+ <description>The Y-coordinate of the user control</description>
+ </param>
+ <param name="width" type="Float" mandatory="true">
+ <description>The width of the user control's bounding rectangle</description>
+ </param>
+ <param name="height" type="Float" mandatory="true">
+ <description>The height of the user control's bounding rectangle</description>
+ </param>
+ </struct>
+
+ <struct name="HapticRect">
+ <description>Defines haptic rectangle data for each user control object for video streaming application</description>
+ <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>A user control spatial identifier</description>
+ </param>
+ <param name="rect" type="Common.Rectangle" mandatory="true">
+ <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
+ </param>
+ </struct>
+
</interface>
-<interface name="Buttons" version="1.1" date="2016-08-18">
+<interface name="Buttons" version="1.3.0" date="2017-07-18">
<function name="GetCapabilities" messagetype="request">
<description>Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities</description>
</function>
@@ -2078,6 +2674,23 @@
<description>Must be returned if the platform supports custom on-screen Presets</description>
</param>
</function>
+
+ <function name="ButtonPress" messagetype="request">
+ <description>Method is invoked when the application tries to press a button</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ <description>The module where the button should be pressed</description>
+ </param>
+ <param name="buttonName" type="Common.ButtonName" mandatory="true" />
+ <param name="buttonPressMode" type="Common.ButtonPressMode" mandatory="true" >
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application that triggers the permission prompt.</description>
+ </param>
+ </function>
+ <function name="ButtonPress" messagetype="response">
+ </function>
+
<function name="OnButtonEvent" messagetype="notification">
<description>HU system must notify about every UP/DOWN event for buttons</description>
<param name="name" type="Common.ButtonName" mandatory="true"/>
@@ -2133,7 +2746,7 @@
</function>
</interface>
-<interface name="BasicCommunication" version="1.0" date="2013-04-12">
+<interface name="BasicCommunication" version="1.2.1" date="2017-08-02">
<function name="OnReady" messagetype="notification">
<description>HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI.</description>
</function>
@@ -2143,21 +2756,6 @@
<function name="OnUpdateDeviceList" messagetype="notification">
<description>Notification from HMI to SDL sent when HMI requires update of device list (i.e. when user clicks 'Change Device' button)</description>
</function>
- <function name="OnPhoneCall" messagetype="notification">
- <description>Sender: HMI->SDL. When: upon phone-call event started or ended</description>
- <param name="isActive" type="Boolean" mandatory="true">
- <description>Must be 'true' - when the phone call is started on HMI. Must be 'false' when the phone call is ended on HMI</description>
- </param>
- </function>
- <function name="OnEmergencyEvent" messagetype="notification">
- <description>
- "Sender: HMI->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">
@@ -2310,7 +2908,7 @@
</function>
<function name="DialNumber" messagetype="request">
<description>Request from SDL to call a specific number.</description>
- <param name="number" type="String" maxlength="40">
+ <param name="number" type="String" maxlength="40" mandatory="true">
<description>The number to dial. Only the character + and numbers are allowed.</description>
</param>
<param name="appID" type="Integer" mandatory="true">
@@ -2359,8 +2957,8 @@
<param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
<description>The path to file.</description>
</param>
- <param name="appID" type="Integer" mandatory="false">
- <description>ID of application that requested this RPC.</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal ID of the application that requested this RPC.</description>
</param>
</function>
<function name="SystemRequest" messagetype="response">
@@ -2458,17 +3056,16 @@
<function name="OnIgnitionCycleOver" messagetype="notification">
<description>Notification from system to SDL to let it know that ignition cycle is over.</description>
</function>
- <!-- End of Policies -->
- <function name="OnDeactivateHMI" messagetype="notification">
- <description>
- Sender: HMI->SDL. When: in case GAL/DIO is active or disabling
- </description>
- <param name="isDeactivated" type="Boolean" mandatory="true">
- <description>
- Must be 'true' - GAL/DIO is active. Must be 'false' when GAL/DIO is disabling
- </description>
+ <function name="DecryptCertificate" messagetype="request">
+ <description>Sender: SDL->HMI. Purpose: to decrypt the certificate received via the Updated Policy Table. </description>
+ <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
+ <description>The path to the file with the encrypted certificate from the PolicyTable.</description>
</param>
</function>
+ <function name="DecryptCertificate" messagetype="response">
+ <description>SUCCESS - in case the certificate is decrypted and placed to the same file from request.</description>
+ </function>
+ <!-- End of Policies -->
<function name="OnEventChanged" messagetype="notification">
<description>Sender: HMI->SDL. When event is become active</description>
<param name="eventName" type="Common.EventTypes" mandatory="true">
@@ -2480,7 +3077,7 @@
</function>
</interface>
-<interface name="VR" version="1.0" date="2013-04-17">
+<interface name="VR" version="1.1.0" date="2017-04-27">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response provides information about presence of VR module and its readiness to cooperate with SDL.</description>
</function>
@@ -2629,7 +3226,7 @@
</function>
</interface>
-<interface name="TTS" version="1.0" date="2013-04-18">
+<interface name="TTS" version="1.1.0" date="2017-04-27">
<description>RPCs for communication between TTS and SDL.</description>
<function name="GetCapabilities" messagetype="request">
<description>Method is invoked at system start-up. SDL requests the information about all supported hardware and their capabilities</description>
@@ -2755,7 +3352,7 @@
</function>
</interface>
-<interface name="UI" version="1.0" date="2013-04-16">
+<interface name="UI" version="1.2.0" date="2017-09-05">
<function name="Alert" messagetype="request">
<description>Request from SDL to show an alert message on the display.</description>
<param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
@@ -2947,7 +3544,7 @@
<description>Optional text to label an app menu button (for certain touchscreen platforms).</description>
</param>
<param name="menuIcon" type="Common.Image" mandatory="false">
- <description>>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
+ <description>Optional icon to draw on an app menu button (for certain touchscreen platforms).</description>
</param>
<param name="keyboardProperties" type="Common.KeyboardProperties" mandatory="false">
<description>On-screen keybaord configuration (if available).</description>
@@ -2994,6 +3591,9 @@
<param name="hmiCapabilities" type="Common.HMICapabilities" mandatory="false">
<description>Specifies the HMI’s capabilities. See HMICapabilities.</description>
</param>
+ <param name="systemCapabilities" type="Common.SystemCapabilities" mandatory="false">
+ <description>Specifies system capabilities. See SystemCapabilities</description>
+ </param>
</function>
<function name="ChangeRegistration" messagetype="request">
<description>Request from SmartDeviceLink to HMI to change language for app.</description>
@@ -3246,9 +3846,25 @@
<description>ID of application related to this RPC.</description>
</param>
</function>
+ <function name="SendHapticData" messagetype="request">
+ <description>Send the UI spatial data from MOBILE. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal ID of the application that requested this RPC.</description>
+ </param>
+ <param name="hapticRectData" type="Common.HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
+ <description>
+ Array of rectangle data structures that represent the locations of all user controls present on the HMI.
+ This data should be updated if/when the application presents a new screen.
+ When a request is sent, if successful, it will replace all rectangle data previously sent through RPC.
+ Avoidance of doubt, when an empty hapticRectData, it will be clear all rectangle data previously sent through RPC.
+ </description>
+ </param>
+ </function>
+ <function name="SendHapticData" messagetype="response">
+ </function>
</interface>
-<interface name="Navigation" version="1.2" date="2016-06-09">
+<interface name="Navigation" version="1.5.0" date="2017-08-15">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL.</description>
@@ -3363,6 +3979,27 @@
<description>Current State of TBT client</description>
</param>
</function>
+ <function name="SetVideoConfig" messagetype="request">
+ <description>Request from SDL to HMI to ask whether HMI accepts a video stream with given configuration.</description>
+ <param name="config" type="Common.VideoConfig" mandatory="true">
+ <description>Configuration of a video stream.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetVideoConfig" messagetype="response">
+ <description>
+ Response from HMI to SDL whether the configuration is accepted.
+ In a negative response, a list of rejected parameters are supplied.
+ </description>
+ <param name="rejectedParams" type="String" array="true" minsize="1" maxsize="1000" mandatory="false">
+ <description>
+ List of params of VideoConfig struct which are not accepted by HMI, e.g. "protocol" and "codec".
+ This param exists only when the response is negative.
+ </description>
+ </param>
+ </function>
<function name="StartStream" messagetype="request">
<description>Request from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
<param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
@@ -3415,12 +4052,12 @@
</function>
<function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
<description>Request for getting waypoint/destination data.</description>
- <param name="wayPointType" type="Common.WayPointType" defvalue="ALL" mandatory="false">
+ <param name="wayPointType" type="Common.WayPointType" mandatory="true">
<description>To request for either the destination only or for all waypoints including destination</description>
</param>
- <param name="appID" type="Integer" mandatory="true">
- <description>ID of the application.</description>
- </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application.</description>
+ </param>
</function>
<function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response">
<param name="appID" type="Integer" mandatory="true">
@@ -3453,7 +4090,7 @@
</interface>
-<interface name="VehicleInfo" version="1.0" date="2013-04-21">
+<interface name="VehicleInfo" version="1.1.0" date="2017-04-27">
<function name="IsReady" messagetype="request">
<description>Method is invoked at system startup. Response should provide information about presence of any of vehicle information modules (ECU, GPS, etc) and their readiness to cooperate with SDL.</description>
</function>
@@ -4085,7 +4722,7 @@
</interface>
<!-- Policies -->
-<interface name="SDL" version="1.0" date="2014-03-12">
+<interface name="SDL" version="1.1.0" date="2017-04-27">
<function name="ActivateApp" messagetype="request">
<param name="appID" type="Integer" mandatory="true">
</param>
@@ -4161,19 +4798,22 @@
<param name="allowedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="0" maxsize="100">
<description>If no permissions were specified for application the array will come empty.</description>
</param>
+ <param name="externalConsentStatus" type="Common.ExternalConsentStatus" mandatory="true" array="true" minsize="0" maxsize="100">
+ <description>External User Consent Settings (defined by entityType and entityID) status: enabled/disabled. If empty array is returned, SDL does not have any stored status.</description>
+ </param>
</function>
<function name="OnAppPermissionConsent" messagetype="notification">
<description>Initiated by HMI for specifying the allowance for the application to perform some functionality. Duplicates functionality of the request, needed if HMI has specific ways to allow/disallow functionality (i.e.Setting Menu)</description>
<param name="appID" type="Integer" mandatory="false">
- <description>Information about the application. See HMIApplication. If omitted - allow/disallow all applications </description>
- </param>
- <param name="consentedFunctions" type="Common.PermissionItem" mandatory="true" array="true" minsize="1" maxsize="100">
+ <description>Information about the application. See HMIApplication. If omitted - allow/disallow all applications </description>
</param>
+ <param name="consentedFunctions" type="Common.PermissionItem" mandatory="false" array="true" minsize="1" maxsize="100"/>
+ <param name="externalConsentStatus" type="Common.ExternalConsentStatus" mandatory="false" array="true" minsize="1" maxsize="100"/>
<param name="source" type="Common.ConsentSource" mandatory="true"/>
</function>
- <function name="OnAppPermissionChanged" messagetype="notification">
+ <function name="OnAppPermissionChanged" messagetype="notification">
<description>Notification from SDL to HMI. Occurs when app permissions were reduced. If no permission specified means that app was dissallowed and has to be unregitstered.</description>
<param name="appID" type="Integer" mandatory="true"/>
<param name="isAppPermissionsRevoked" type="Boolean" mandatory="false"/>
@@ -4246,4 +4886,94 @@
<param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
</function>
</interface>
+
+<interface name="RC" version="1.1.0" date="2017-07-18">
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if vehicle RC modules are present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system startup by SDL to request information about Remote Control capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false">
+ <description>See RemoteControlCapabilities, all available RC modules and buttons shall be returned.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ <description>The module type and data to set</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal SDL-assigned ID of the related application</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" messagetype="response">
+ <description>Used to set the values of one zone and one data type within that zone</description>
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ </function>
+
+<function name="GetInteriorVehicleData" messagetype="request">
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ <description>The module data to retrieve from the vehicle for that type</description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
+ <description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal SDL-assigned ID of the related application</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleData" messagetype="response">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>Is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleDescription.
+ if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleDataConsent" messagetype="request">
+ <description>Sender: SDL->HMI. </description>
+ <description>HMI is expected to display a permission prompt to the driver showing the RC module and app details (for example, app's name).
+ The driver is expected to have an ability to grant or deny the permission.</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true">
+ <description>The module type that the app requests to control.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application that triggers the permission prompt.</description>
+ </param>
+ </function>
+ <function name="GetInteriorVehicleDataConsent" messagetype="response">
+ <param name="allowed" type="Boolean" mandatory="true">
+ <description>"true" - if the driver grants the permission for controlling to the named app;
+ "false" - in case the driver denies the permission for controlling to the named app.</description>
+ </param>
+</function>
+
+<function name="OnInteriorVehicleData" messagetype="notification">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+</function>
+
+<function name="OnRemoteControlSettings" messagetype="notification">
+ <description>Sender: vehicle -> RSDL. Notification about remote-control settings changed. Sent after User`s choice through HMI.</description>
+ <param name="allowed" type="Boolean" mandatory="false" >
+ <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
+ </param>
+ <param name="accessMode" type="Common.RCAccessMode" mandatory="false" >
+ <description>The remote control access mode specified by the driver via HMI.</description>
+ </param>
+</function>
+</interface>
</interfaces>
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 4e535c4db3..a1c64aecda 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -1,5361 +1,6052 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="Ford Sync RAPI" version="4.2" date="2016-11-16">
-
- <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 VEHICLE_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>
- <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="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="TRUNCATED_DATA">
- <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
- </element>
- <element name="UNSUPPORTED_VERSION">
- <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="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>
- <element name="NL-BE" internal_name="NL_BE">
- <description>Dutch (Flemish) - Belgium</description>
- </element>
- <element name="EL-GR" internal_name="EL_GR">
- <description>Greek - Greece</description>
- </element>
- <element name="HU-HU" internal_name="HU_HU">
- <description>Hungarian - Hungary</description>
- </element>
- <element name="FI-FI" internal_name="FI_FI">
- <description>Finnish - Finland</description>
- </element>
- <element name="SK-SK" internal_name="SK_SK">
- <description>Slovak - Slovakia</description>
- </element>
-</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" />
- <element name="UNSUPPORTED_HMI_RESOURCE" />
- </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" />
- <element name="SDL_GENERIC" />
- </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>
-
- <enum name="DeliveryMode">
- <description>The mode in which the SendLocation request is sent</description>
- <element name="PROMPT" />
- <element name="DESTINATION" />
- <element name="QUEUE" />
- </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>
-
- <struct name="AppInfo">
- <description>Contains detailed information about the registered application.</description>
-
- <param name="appDisplayName" type="String" maxlength="100" mandatory="true">
- <description>The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).</description>
- </param>
-
- <param name="appBundleID" type="String" maxlength="256" mandatory="true">
- <description>The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform.</description>
- </param>
-
- <param name="appVersion" type="String" maxlength="256" mandatory="true">
- <description>Represents the build version number of this particular mobile app.</description>
- </param>
-
- <param name="appIcon" type="String" maxlength="500" mandatory="false">
- <description>A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).</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" />
- <element name="GetWayPointsID" value="41" hexvalue="29" />
- <element name="SubscribeWayPointsID" value="42" hexvalue="2A"/>
- <element name="UnsubscribeWayPointsID" value="43" hexvalue="2B"/>
-
-<!--
- Base Notifications
- Range = 0x 0000 8000 - 0x 0000 FFFF
--->
-
- <element name="OnHMIStatusID" value="32768" hexvalue="8000" />
- <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" />
- <element name="OnButtonEventID" value="32770" hexvalue="8002" />
- <element name="OnButtonPressID" value="32771" hexvalue="8003" />
- <element name="OnVehicleDataID" value="32772" hexvalue="8004" />
- <element name="OnCommandID" value="32773" hexvalue="8005" />
- <element name="OnTBTClientStateID" value="32774" hexvalue="8006" />
- <element name="OnDriverDistractionID" value="32775" hexvalue="8007" />
- <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" />
- <element name="OnAudioPassThruID" value="32777" hexvalue="8009" />
- <element name="OnLanguageChangeID" value="32778" hexvalue="800A" />
- <element name="OnKeyboardInputID" value="32779" hexvalue="800B" />
- <element name="OnTouchEventID" value="32780" hexvalue="800C" />
- <element name="OnSystemRequestID" value="32781" hexvalue="800D" />
- <element name="OnHashChangeID" value="32782" hexvalue="800E" />
- <element name="OnWayPointChangeID" value="32783" hexvalue="800F" />
-
-<!--
- 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>
-
- <struct name="DateTime">
- <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
- <description>Milliseconds </description>
- </param>
- <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
- <description>Seconds part of time</description>
- </param>
- <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
- <description>Minutes part of time</description>
- </param>
- <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
- <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
- </param>
- <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
- <description>Day of the month</description>
- </param>
- <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
- <description>Month of the year</description>
- </param>
- <param name="year" type="Integer" maxvalue="4095" mandatory="false">
- <description>The year in YYYY format</description>
- </param>
- <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
- <description>Time zone offset in Hours wrt UTC.</description>
- </param>
- <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
- <description>Time zone offset in Min wrt UTC.</description>
- </param>
- </struct>
-
- <enum name="WayPointType">
- <description>Describes what kind of waypoint is requested/provided.</description>
- <element name="ALL" />
- <element name="DESTINATION" />
- </enum>
-
- <struct name="Coordinate">
- <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
- <description>Latitude of the location.</description>
- </param>
- <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
- <description>Longitude of the location.</description>
- </param>
- </struct>
-
-<struct name="OASISAddress">
- <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Name of the country (localized)</description>
- </param>
- <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
- <description>Name of country (ISO 3166-2)</description>
- </param>
- <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
- <description>(PLZ, ZIP, PIN, CAP etc.)</description>
- </param>
- <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of country (e.g. state)</description>
- </param>
- <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of e.g. state (e.g. county)</description>
- </param>
- <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. city/village</description>
- </param>
- <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for e.g. district</description>
- </param>
- <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Hypernym for street, road etc.</description>
- </param>
- <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
- <description>Portion of thoroughfare e.g. house number</description>
- </param>
-</struct>
-
- <struct name="LocationDetails">
- <param name="coordinate" type="Coordinate" mandatory="false">
- <description>Latitude/Longitude of the location.</description>
- </param>
- <param name="locationName" type="String" maxlength="500" mandatory="false">
- <description>Name of location.</description>
- </param>
- <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
- <description>Location address for display purposes only</description>
- </param>
- <param name="locationDescription" type="String" maxlength="500" mandatory="false">
- <description>Description intended location / establishment (if applicable)</description>
- </param>
- <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
- <description>Phone number of location / establishment.</description>
- </param>
- <param name="locationImage" type="Image" mandatory="false">
- <description>Image / icon of intended location.</description>
- </param>
- <param name="searchAddress" type="OASISAddress" mandatory="false">
- <description>Address to be used by navigation engines for search</description>
- </param>
- </struct>
- <!-- 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>
- <param name="appInfo" type="AppInfo" mandatory="false">
- <description>
- See AppInfo.
- </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="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" 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="false">
- </param>
- <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
- </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>
-
- <param name="timeStamp" type="DateTime" mandatory="false">
- <description>
- timestamp in ISO 8601 format
- </description>
- </param>
-
- <param name="address" type="OASISAddress" mandatory="false">
- <description>Address to be used for setting destination</description>
- </param>
- <param name="deliveryMode" type="DeliveryMode" mandatory="false">
- <description>Defines the mode of prompt for user</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" 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="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="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>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request">
- <description>To subscribe in getting changes for Waypoints/destinations</description>
- </function>
-
- <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response">
- <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="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <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>
- </function>
-
- <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
- <description>Request for getting waypoint/destination data.</description>
- <param name="wayPointType" type="WayPointType" defvalue="ALL" mandatory="false">
- <description>To request for either the destination only or for all waypoints including destination</description>
- </param>
- </function>
-
- <function name="GetWayPoints" functionID="GetWayPointsID" 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="TIMED_OUT"/>
- <element name="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <element name="IGNORED"/>
- <element name="IN_USE"/>
- <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="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request">
- <description>Request to unsubscribe from WayPoints and Destination</description>
- </function>
-
- <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" 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="GENERIC_ERROR"/>
- <element name="REJECTED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- <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="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</description>
- </param>
- </function>
-
- <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification">
- <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
- <param name="wayPoints" type="LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
- <description>See LocationDetails</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>
+<?xml version="1.0" standalone="no"?>
+<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
+
+<interface name="SmartDeviceLink RAPI" version="4.5.0" date="2017-09-22">
+ <enum name="Result" internal_scope="base">
+ <element name="SUCCESS">
+ <description>The request succeeded</description>
+ </element>
+ <element name="UNSUPPORTED_REQUEST">
+ <description>The request is not supported by the headunit</description>
+ </element>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>
+ A button that was requested for subscription is not supported under the current system.
+ </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>
+ <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="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 the headunit 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).There may be a maximum of 1000 pending requests at a time.</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="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="TRUNCATED_DATA">
+ <description>The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available.</description>
+ </element>
+ <element name="UNSUPPORTED_VERSION">
+ <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 the headunit.</description>
+ </element>
+ <element name="CANCEL_ROUTE">
+ <description>User selected to Cancel Route.</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="DATA_NOT_AVAILABLE">
+ <description>The requested information is currently not available. This is different than UNSUPPORTED_RESOURCE because it implies the data is at some point available. </description>
+ </element>
+ <element name="READ_ONLY">
+ <description>The value being set is read only</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 the headunit 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 the headunit 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>
+ <element name="NL-BE" internal_name="NL_BE">
+ <description>Dutch (Flemish) - Belgium</description>
+ </element>
+ <element name="EL-GR" internal_name="EL_GR">
+ <description>Greek - Greece</description>
+ </element>
+ <element name="HU-HU" internal_name="HU_HU">
+ <description>Hungarian - Hungary</description>
+ </element>
+ <element name="FI-FI" internal_name="FI_FI">
+ <description>Finnish - Finland</description>
+ </element>
+ <element name="SK-SK" internal_name="SK_SK">
+ <description>Slovak - Slovakia</description>
+ </element>
+ <element name="EN-IN" internal_name="EN_IN">
+ <description>English - India</description>
+ </element>
+ <element name="TH-TH" internal_name="TH_TH">
+ <description>Thai - Thailand</description>
+ </element>
+ <element name="EN-SA" internal_name="EN_SA">
+ <description>English - Middle East</description>
+ </element>
+ <element name="HE-IL" internal_name="HE_IL">
+ <description>Hebrew - Israel</description>
+ </element>
+ <element name="RO-RO" internal_name="RO_RO">
+ <description>Romanian - Romania</description>
+ </element>
+ <element name="UK-UA" internal_name="UK_UA">
+ <description>Ukrainian - Ukraine</description>
+ </element>
+ <element name="ID-ID" internal_name="ID_ID">
+ <description>Indonesian - Indonesia</description>
+ </element>
+ <element name="VI-VN" internal_name="VI_VN">
+ <description>Vietnamese - Vietnam</description>
+ </element>
+ <element name="MS-MY" internal_name="MS_MY">
+ <description>Malay - Malaysia</description>
+ </element>
+ <element name="HI-IN" internal_name="HI_IN">
+ <description>Hindi - India</description>
+ </element>
+ </enum>
+
+ <enum name="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>
+ <element name="COUNTDOWN" >
+ <description>Starts the media clock timer counting downwards, as in time remaining.</description>
+ </element>
+ <element name="PAUSE" >
+ <description>Pauses the media clock timer</description>
+ </element>
+ <element name="RESUME" >
+ <description>Resume the media clock timer</description>
+ </element>
+ <element name="CLEAR" >
+ <description>Clears the media clock timer (previously done through Show->mediaClock)</description>
+ </element>
+ </enum>
+
+ <enum name="TimerMode">
+ <element name="UP" >
+ <description>Causes the media clock timer to update from 0:00 to a specified time</description>
+ </element>
+ <element name="DOWN" >
+ <description>Causes the media clock timer to update from a specified time to 0:00</description>
+ </element>
+ <element name="NONE" >
+ <description>Indicates to not use the media clock timer</description>
+ </element>
+ </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. No Voice Interaction.</description>
+ </element>
+ <element name="VR_ONLY" >
+ <description>This mode causes the interaction to only occur using the headunits VR system. Selections are made by saying the command.</description>
+ </element>
+ <element name="BOTH" >
+ <description>This mode causes both a VR and display selection option for an interaction. The user will first be asked via Voice Interaction (if available). If this is unsuccessful, the system will switch to manual input.</description>
+ </element>
+ </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>
+ <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>
+ <element name="LIST_ONLY" >
+ <description>This mode causes the interaction to display the previous set of choices as a list.</description>
+ </element>
+ <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>
+ <element name="KEYBOARD" >
+ <description>This mode causes the interaction to immediately display a keyboard entry through the HMI.</description>
+ </element>
+ </enum>
+
+ <enum name="HMILevel">
+ <description>Enumeration 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>Enumeration 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. 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 the module 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" />
+ <element name="UNSUPPORTED_HMI_RESOURCE" />
+ </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" mandatory="true"/>
+ <param name="bitsPerSample" type="BitsPerSample" mandatory="true"/>
+ <param name="audioType" type="AudioType" mandatory="true"/>
+ </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 the module</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" />
+ <!-- Climate Buttons -->
+ <element name="AC_MAX" />
+ <element name="AC" />
+ <element name="RECIRCULATE" />
+ <element name="FAN_UP" />
+ <element name="FAN_DOWN" />
+ <element name="TEMP_UP" />
+ <element name="TEMP_DOWN" />
+ <element name="DEFROST_MAX" />
+ <element name="DEFROST" />
+ <element name="DEFROST_REAR" />
+ <element name="UPPER_VENT" />
+ <element name="LOWER_VENT" />
+ <!-- Radio Buttons -->
+ <element name="VOLUME_UP" />
+ <element name="VOLUME_DOWN" />
+ <element name="EJECT" />
+ <element name="SOURCE" />
+ <element name="SHUFFLE" />
+ <element name="REPEAT" />
+ </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" />
+ <element name="SDL_GENERIC" />
+ </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>
+
+ <enum name="DeliveryMode">
+ <description>The mode in which the SendLocation request is sent</description>
+ <element name="PROMPT" />
+ <element name="DESTINATION" />
+ <element name="QUEUE" />
+ </enum>
+
+ <enum name="VideoStreamingProtocol">
+ <description>Enum for each type of video streaming protocol type.</description>
+ <element name="RAW">
+ <description>Raw stream bytes that contains no timestamp data and is the lowest supported video streaming</description>
+ </element>
+ <element name="RTP">
+ <description>RTP facilitates the transfer of real-time data. Information provided by this protocol include timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) and the payload format which indicates the encoded format of the data.</description>
+ </element>
+ <element name="RTSP">
+ <description>The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery. However, some vendors implement proprietary transport protocols. </description>
+ </element>
+ <element name="RTMP">
+ <description> Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by Macromedia for streaming audio, video and data over the Internet, between a Flash player and a server. Macromedia is now owned by Adobe, which has released an incomplete version of the specification of the protocol for public use.</description>
+ </element>
+ <element name="WEBM">
+ <description>The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.</description>
+ </element>
+ </enum>
+
+ <enum name="VideoStreamingCodec">
+ <description>Enum for each type of video streaming codec.</description>
+ <element name="H264">
+ <description>A block-oriented motion-compensation-based video compression standard. As of 2014 it is one of the most commonly used formats for the recording, compression, and distribution of video content.</description>
+ </element>
+ <element name="H265">
+ <description>High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard, one of several potential successors to the widely used AVC (H.264 or MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio at the same level of video quality, or substantially improved video quality at the same bit rate. It supports resolutions up to 8192x4320, including 8K UHD.</description>
+ </element>
+ <element name="Theora">
+ <description>Theora is derived from the formerly proprietary VP3 codec, released into the public domain by On2 Technologies. It is broadly comparable in design and bitrate efficiency to MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of the features present in some of these other codecs. It is comparable in open standards philosophy to the BBC's Dirac codec.</description>
+ </element>
+ <element name="VP8">
+ <description>VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for Open Media (AOMedia) are based on VP8.</description>
+ </element>
+ <element name="VP9">
+ <description>Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) and also enables lossless compression.</description>
+ </element>
+ </enum>
+
+ <struct name="Image">
+ <param name="value" minlength="0" maxlength="65535" type="String" mandatory="true">
+ <description>Either the static hex icon value or the binary image file name identifier (sent by PutFile).</description>
+ </param>
+ <param name="imageType" type="ImageType" mandatory="true">
+ <description>Describes, whether it is a static or dynamic image.</description>
+ </param>
+ </struct>
+
+ <struct name="SoftButton">
+ <param name="type" type="SoftButtonType" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true"/>
+ <param name="menuName" type="String" maxlength="500" mandatory="true"/>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true"/>
+ <param name="image" type="Image" mandatory="false"/>
+ <param name="secondaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional secondary text to display; e.g. address of POI in a search result entry</description>
+ </param>
+ <param name="tertiaryText" maxlength="500" type="String" mandatory="false">
+ <description>Optional tertiary text to display; e.g. distance to POI for a search result entry</description>
+ </param>
+ <param name="secondaryImage" type="Image" mandatory="false">
+ <description>Optional secondary image struct for choice</description>
+ </param>
+ </struct>
+
+ <struct name="VrHelpItem">
+ <param name="text" maxlength="500" type="String" mandatory="true">
+ <description>Text to display for VR Help item</description>
+ </param>
+ <param name="image" type="Image" mandatory="false">
+ <description>Image struct for VR Help item</description>
+ </param>
+ <param name="position" type="Integer" minvalue="1" maxvalue="100" mandatory="true">
+ <description>Position to display item in VR Help list</description>
+ </param>
+ </struct>
+
+ <struct name="SyncMsgVersion">
+ <description>Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application</description>
+
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="10" mandatory="true">
+ <description>The major version indicates versions that is not-compatible to previous versions.</description>
+ </param>
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
+ <description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
+ </param>
+ <param name="patchVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
+ <description>The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version </description>
+ </param>
+ </struct>
+
+ <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 latitude</description>
+ </element>
+ <element name="3D" internal_name="Dimension_3D">
+ <description>Longitude and latitude 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" mandatory="true">
+ <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>
+
+ <enum name="ModuleType">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ </enum>
+
+ <enum name="DefrostZone">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="RadioBand">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <enum name="RadioState">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <enum name="TemperatureUnit">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="BeltStatus">
+ <param name="driverBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverBuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerChildDetected" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow2BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRow3BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="leftRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="rightRearInflatableBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BeltDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="middleRow1BuckleBelted" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="BodyInformation">
+ <param name="parkBrakeActive" type="Boolean" mandatory="true">
+ <description>References signal "PrkBrkActv_B_Actl".</description>
+ </param>
+ <param name="ignitionStableStatus" type="IgnitionStableStatus" mandatory="true">
+ <description>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</description>
+ </param>
+ <param name="ignitionStatus" type="IgnitionStatus" mandatory="true">
+ <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" mandatory="true">
+ <description>References signal "CPM_VoiceRec_STAT".</description>
+ </param>
+ <param name="btIconOn" type="Boolean" mandatory="true">
+ <description>References signal "BT_ICON".</description>
+ </param>
+ <param name="callActive" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Call_Active_STAT".</description>
+ </param>
+ <param name="phoneRoaming" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Phone_Roaming_STAT".</description>
+ </param>
+ <param name="textMsgAvailable" type="Boolean" mandatory="true">
+ <description>References signal "CPM_TextMsg_AVAL".</description>
+ </param>
+ <param name="battLevelStatus" type="DeviceLevelStatus" mandatory="true">
+ <description>Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="stereoAudioOutputMuted" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Stereo_Audio_Output".</description>
+ </param>
+ <param name="monoAudioOutputMuted" type="Boolean" mandatory="true">
+ <description>References signal "CPM_Mono_Audio_Output".</description>
+ </param>
+ <param name="signalLevelStatus" type="DeviceLevelStatus" mandatory="true">
+ <description>Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus.</description>
+ </param>
+ <param name="primaryAudioSource" type="PrimaryAudioSource" mandatory="true">
+ <description>References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource.</description>
+ </param>
+ <param name="eCallEventActive" type="Boolean" mandatory="true">
+ <description>References signal "eCall_Event".</description>
+ </param>
+ </struct>
+
+ <struct name="HeadLampStatus">
+ <param name="lowBeamsOn" type="Boolean" mandatory="true">
+ <description>Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat".</description>
+ </param>
+ <param name="highBeamsOn" type="Boolean" mandatory="true">
+ <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>
+
+ <struct name="AppInfo">
+ <description>Contains detailed information about the registered application.</description>
+
+ <param name="appDisplayName" type="String" maxlength="100" mandatory="true">
+ <description>The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).</description>
+ </param>
+
+ <param name="appBundleID" type="String" maxlength="256" mandatory="true">
+ <description>The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform.</description>
+ </param>
+
+ <param name="appVersion" type="String" maxlength="256" mandatory="true">
+ <description>Represents the build version number of this particular mobile app.</description>
+ </param>
+
+ <param name="appIcon" type="String" maxlength="500" mandatory="false">
+ <description>A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).</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" mandatory="true">
+ <description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="auxECallNotificationStatus" type="VehicleDataNotificationStatus" mandatory="true">
+ <description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
+ </param>
+ <param name="eCallConfirmationStatus" type="ECallConfirmationStatus" mandatory="true">
+ <description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="AirbagStatus">
+ <param name="driverAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerCurtainAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="driverKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerSideAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ <param name="passengerKneeAirbagDeployed" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="EmergencyEvent">
+ <param name="emergencyEventType" type="EmergencyEventType" mandatory="true">
+ <description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
+ </param>
+ <param name="fuelCutoffStatus" type="FuelCutoffStatus" mandatory="true">
+ <description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
+ </param>
+ <param name="rolloverEvent" type="VehicleDataEventStatus" mandatory="true">
+ <description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+
+ <param name="maximumChangeVelocity" type="Integer" minvalue="0" maxvalue="255" mandatory="true">
+ <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" mandatory="true">
+ <description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
+ </param>
+ </struct>
+
+ <struct name="ClusterModeStatus">
+ <param name="powerModeActive" type="Boolean" mandatory="true">
+ <description>References signal "PowerMode_UB".</description>
+ </param>
+ <param name="powerModeQualificationStatus" type="PowerModeQualificationStatus" mandatory="true">
+ <description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
+ </param>
+ <param name="carModeStatus" type="CarModeStatus" mandatory="true">
+ <description>References signal "CarMode". See CarMode.</description>
+ </param>
+ <param name="powerModeStatus" type="PowerModeStatus" mandatory="true">
+ <description>References signal "PowerMode". See PowerMode.</description>
+ </param>
+ </struct>
+
+ <struct name="MyKey">
+ <param name="e911Override" type="VehicleDataStatus" mandatory="true">
+ <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" mandatory="true">
+ <description>Status of the Tire Pressure Telltale. See WarningLightStatus.</description>
+ </param>
+ <param name="leftFront" type="SingleTireStatus" mandatory="true">
+ <description>The status of the left front tire.</description>
+ </param>
+ <param name="rightFront" type="SingleTireStatus" mandatory="true">
+ <description>The status of the right front tire.</description>
+ </param>
+ <param name="leftRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the left rear tire.</description>
+ </param>
+ <param name="rightRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the right rear tire.</description>
+ </param>
+ <param name="innerLeftRear" type="SingleTireStatus" mandatory="true">
+ <description>The status of the inner left rear.</description>
+ </param>
+ <param name="innerRightRear" type="SingleTireStatus" mandatory="true">
+ <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" mandatory="true">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="true">
+ </param>
+ <param name="utcYear" type="Integer" minvalue="2010" maxvalue="2100" mandatory="true">
+ <description>The current UTC year.</description>
+ </param>
+ <param name="utcMonth" type="Integer" minvalue="1" maxvalue="12" mandatory="true">
+ <description>The current UTC month.</description>
+ </param>
+ <param name="utcDay" type="Integer" minvalue="1" maxvalue="31" mandatory="true">
+ <description>The current UTC day.</description>
+ </param>
+ <param name="utcHours" type="Integer" minvalue="0" maxvalue="23" mandatory="true">
+ <description>The current UTC hour.</description>
+ </param>
+ <param name="utcMinutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <description>The current UTC minute.</description>
+ </param>
+ <param name="utcSeconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
+ <description>The current UTC second.</description>
+ </param>
+ <param name="compassDirection" type="CompassDirection" mandatory="true">
+ <description>See CompassDirection.</description>
+ </param>
+ <param name="pdop" type="Float" minvalue="0" maxvalue="10" defvalue="0" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <description>VDOP. If value is unknown, value shall be set to 0.</description>
+ </param>
+ <param name="actual" type="Boolean" mandatory="true">
+ <description>
+ True, if actual.
+ False, if inferred.
+ </description>
+ </param>
+ <param name="satellites" type="Integer" minvalue="0" maxvalue="31" mandatory="true">
+ <description>Number of satellites in view</description>
+ </param>
+ <param name="dimension" type="Dimension" mandatory="true">
+ <description>See Dimension</description>
+ </param>
+ <param name="altitude" type="Float" minvalue="-10000" maxvalue="10000" mandatory="true">
+ <description>Altitude in meters</description>
+ </param>
+ <param name="heading" type="Float" minvalue="0" maxvalue="359.99" mandatory="true">
+ <description>The heading. North is 0. Resolution is 0.01</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="500" mandatory="true">
+ <description>The speed in KPH</description>
+ </param>
+ </struct>
+
+ <struct name="VehicleDataResult">
+ <description>Individual published data request result</description>
+ <param name="dataType" type="VehicleDataType" mandatory="true">
+ <description>Defined published data element type.</description>
+ </param>
+ <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
+ <description>Published data result code.</description>
+ </param>
+ </struct>
+
+ <struct name="DIDResult">
+ <description>Individual requested DID result and data</description>
+ <param name="resultCode" type="VehicleDataResultCode" mandatory="true">
+ <description>Individual DID result code.</description>
+ </param>
+ <param name="didLocation" type="Integer" minvalue="0" maxvalue="65535" mandatory="true">
+ <description>Location of raw data 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" mandatory="true">
+ <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" mandatory="true"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ </struct>
+
+ <struct name="TextField">
+ <param name="name" type="TextFieldName" mandatory="true">
+ <description>The name that identifies the field. See TextFieldName.</description>
+ </param>
+ <param name="characterSet" type="CharacterSet" mandatory="true">
+ <description>The character set that is supported in this field. See CharacterSet.</description>
+ </param>
+ <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
+ <description>The number of characters in one row of this field.</description>
+ </param>
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
+ <description>The number of rows of this field.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageResolution">
+ <param name="resolutionWidth" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution width.</description>
+ </param>
+ <param name="resolutionHeight" type="Integer" minvalue="1" maxvalue="10000" mandatory="true">
+ <description>The image resolution height.</description>
+ </param>
+ </struct>
+
+ <struct name="ImageField">
+ <param name="name" type="ImageFieldName" mandatory="true">
+ <description>The name that identifies the field. See ImageFieldName.</description>
+ </param>
+ <param name="imageTypeSupported" type="FileType" minsize="1" maxsize="100" array="true" mandatory="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"/>
+ <element name="CANCEL"/>
+ </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" mandatory="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" mandatory="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" mandatory="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" mandatory="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" mandatory="true">
+ <description>Name of the individual RPC in the policy table.</description>
+ </param>
+ <param name="hmiPermissions" type="HMIPermissions" mandatory="true"/>
+ <param name="parameterPermissions" type="ParameterPermissions" mandatory="true"/>
+ </struct>
+
+ <struct name="DisplayCapabilities">
+ <description>Contains information about the display capabilities.</description>
+ <param name="displayType" type="DisplayType" mandatory="true">
+ <description>The type of the display. See DisplayType</description>
+ </param>
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
+ <description>A set of all fields that support text data. See TextField</description>
+ </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" mandatory="true">
+ <description>A set of all supported formats of the media clock. See MediaClockFormat</description>
+ </param>
+ <param name="graphicSupported" type="Boolean" mandatory="true">
+ <description>The display's persistent screen supports referencing a static or dynamic image.</description>
+ </param>
+ <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="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" mandatory="true">
+ <description>The name of the button. See ButtonName.</description>
+ </param>
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <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>
+ <param name="videoStreaming" type="Boolean" mandatory="false">
+ <description>Availability of video streaming. </description>
+ </param>
+ <param name="remoteControl" type="Boolean" mandatory="false">
+ <description>Availability of remote control feature. 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" mandatory="true">
+ <description>Text to show in the menu for this sub menu.</description>
+ </param>
+ </struct>
+ <struct name="TTSChunk">
+ <description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
+ <param name="text" minlength="0" maxlength="500" type="String" mandatory="true">
+ <description>
+ The text or phonemes to speak.
+ May not be empty.
+ </description>
+ </param>
+ <param name="type" type="SpeechCapabilities" mandatory="true">
+ <description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
+ </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 about 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" />
+ <element name="PROJECTION" />
+ <element name="REMOTE_CONTROL" />
+ </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. 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" />
+ <element name="ButtonPressID" value="41" hexvalue="29" />
+ <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" />
+ <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" />
+ <element name="GetWayPointsID" value="45" hexvalue="2D" />
+ <element name="SubscribeWayPointsID" value="46" hexvalue="2E" />
+ <element name="UnsubscribeWayPointsID" value="47" hexvalue="2F" />
+ <element name="GetSystemCapabilityID" value="48" hexvalue="30" />
+ <element name="SendHapticDataID" value="49" hexvalue="31" />
+
+ <!--
+ Base Notifications
+ Range = 0x 0000 8000 - 0x 0000 FFFF
+ -->
+
+ <element name="OnHMIStatusID" value="32768" hexvalue="8000" />
+ <element name="OnAppInterfaceUnregisteredID" value="32769" hexvalue="8001" />
+ <element name="OnButtonEventID" value="32770" hexvalue="8002" />
+ <element name="OnButtonPressID" value="32771" hexvalue="8003" />
+ <element name="OnVehicleDataID" value="32772" hexvalue="8004" />
+ <element name="OnCommandID" value="32773" hexvalue="8005" />
+ <element name="OnTBTClientStateID" value="32774" hexvalue="8006" />
+ <element name="OnDriverDistractionID" value="32775" hexvalue="8007" />
+ <element name="OnPermissionsChangeID" value="32776" hexvalue="8008" />
+ <element name="OnAudioPassThruID" value="32777" hexvalue="8009" />
+ <element name="OnLanguageChangeID" value="32778" hexvalue="800A" />
+ <element name="OnKeyboardInputID" value="32779" hexvalue="800B" />
+ <element name="OnTouchEventID" value="32780" hexvalue="800C" />
+ <element name="OnSystemRequestID" value="32781" hexvalue="800D" />
+ <element name="OnHashChangeID" value="32782" hexvalue="800E" />
+ <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" />
+ <element name="OnWayPointChangeID" value="32784" hexvalue="8010" />
+
+ <!--
+ 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>
+
+ <struct name="DateTime">
+ <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Milliseconds </description>
+ </param>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
+ <description>Seconds part of time</description>
+ </param>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>Minutes part of time</description>
+ </param>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
+ </param>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <description>Day of the month</description>
+ </param>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <description>Month of the year</description>
+ </param>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="false">
+ <description>The year in YYYY format</description>
+ </param>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
+ <description>Time zone offset in Hours wrt UTC.</description>
+ </param>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
+ <description>Time zone offset in Min wrt UTC.</description>
+ </param>
+ </struct>
+
+ <enum name="WayPointType">
+ <description>Describes what kind of waypoint is requested/provided.</description>
+ <element name="ALL" />
+ <element name="DESTINATION" />
+ </enum>
+
+ <struct name="Coordinate">
+ <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
+ <description>Latitude of the location.</description>
+ </param>
+ <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
+ <description>Longitude of the location.</description>
+ </param>
+ </struct>
+
+ <struct name="OASISAddress">
+ <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Name of the country (localized)</description>
+ </param>
+ <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
+ <description>Name of country (ISO 3166-2)</description>
+ </param>
+ <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
+ <description>(PLZ, ZIP, PIN, CAP etc.)</description>
+ </param>
+ <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of country (e.g. state)</description>
+ </param>
+ <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of e.g. state (e.g. county)</description>
+ </param>
+ <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. city/village</description>
+ </param>
+ <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. district</description>
+ </param>
+ <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for street, road etc.</description>
+ </param>
+ <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of thoroughfare e.g. house number</description>
+ </param>
+ </struct>
+
+ <struct name="LocationDetails">
+ <param name="coordinate" type="Coordinate" mandatory="false">
+ <description>Latitude/Longitude of the location.</description>
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description>Name of location.</description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>Location address for display purposes only</description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description>Description intended location / establishment (if applicable)</description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description>Phone number of location / establishment.</description>
+ </param>
+ <param name="locationImage" type="Image" mandatory="false">
+ <description>Image / icon of intended location.</description>
+ </param>
+ <param name="searchAddress" type="OASISAddress" mandatory="false">
+ <description>Address to be used by navigation engines for search</description>
+ </param>
+ </struct>
+
+ <enum name="SystemCapabilityType">
+ <description>Enumerations of all available system capability types</description>
+ <element name="NAVIGATION"/>
+ <element name="PHONE_CALL"/>
+ <element name="VIDEO_STREAMING"/>
+ <element name="REMOTE_CONTROL"/>
+ </enum>
+
+ <struct name="NavigationCapability">
+ <description>Extended capabilities for an onboard navigation system</description>
+ <param name="sendLocationEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to add locations to the onboard nav</description>
+ </param>
+ <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to return way points from onboard nav</description>
+ </param>
+ </struct>
+
+ <struct name="PhoneCapability">
+ <description>Extended capabilities of the module's phone feature</description>
+ <param name="dialNumberEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to perform dial number</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingFormat">
+ <description>Video streaming formats and their specifications.</description>
+ <param name="protocol" type="VideoStreamingProtocol" mandatory="true">
+ <description>Protocol type, see VideoStreamingProtocol</description>
+ </param>
+ <param name="codec" type="VideoStreamingCodec" mandatory="true">
+ <description>Codec type, see VideoStreamingCodec</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingCapability">
+ <description>Contains information about this system's video streaming capabilities.</description>
+ <param name="preferredResolution" type="ImageResolution" mandatory="false">
+ <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
+ </param>
+ <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
+ <description>The maximum bitrate of video stream that is supported, in kbps.</description>
+ </param>
+ <param name="supportedFormats" type="VideoStreamingFormat" array="true" mandatory="false">
+ <description>Detailed information on each format supported by this system, in its preferred order (i.e. the first element in the array is most preferable to the system). Each object will contain a VideoStreamingFormat that describes what can be expected.</description>
+ </param>
+ <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
+ <description>True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. </description>
+ </param>
+ </struct>
+
+ <!---Remote control -->
+
+ <struct name="Temperature">
+ <param name="unit" type="TemperatureUnit" mandatory="true">
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true">
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="RdsData">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false">
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false">
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false">
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlData">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="RdsData" mandatory="false">
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>number of HD sub-channels if available</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>Current HD sub-channel if available</description>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false is the radio is off</description>
+ </param>
+ <param name="state" type="RadioState" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Temperature" mandatory="false">
+ </param>
+ <param name="desiredTemperature" type="Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="VentilationMode" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="ModuleData">
+ <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ </param>
+ <param name="radioControlData" type="RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <!-- need an ID in the future -->
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>
+ The short friendly name of the climate control module.
+ It should not be used to identify a module by mobile application.
+ </description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlCapabilities">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <!-- need an ID in the future -->
+ <param name="moduleName" type="String" maxlength="100" mandatory="true">
+ <description>The short friendly name of the climate control module.
+ It should not be used to identify a module by mobile application.</description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="RemoteControlCapabilities">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC radio controls.For this baseline version, maxsize=1. i.e. only one radio control module is supported.</description >
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <description>If included, the platform supports RC button controls with the included button names.</description >
+ </param>
+ </struct>
+
+ <!-- End of RC -->
+ <struct name="SystemCapability">
+ <description>The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist</description>
+ <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
+ <description>Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other para included.</description>
+ </param>
+ <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ <description>Describes extended capabilities for onboard navigation system </description>
+ </param>
+ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
+ <description>Describes extended capabilities of the module's phone feature</description>
+ </param>
+ </struct>
+
+ <enum name="MetadataType">
+ <element name="mediaTitle">
+ <description>The data in this field contains the title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaArtist">
+ <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
+ </element>
+ <element name="mediaAlbum">
+ <description>The data in this field contains the album title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaYear">
+ <description>The data in this field contains the creation year of the currently playing audio track.</description>
+ </element>
+ <element name="mediaGenre">
+ <description>The data in this field contains the genre of the currently playing audio track.</description>
+ </element>
+ <element name="mediaStation">
+ <description>The data in this field contains the name of the current source for the media.</description>
+ </element>
+ <element name="rating">
+ <description>The data in this field is a rating.</description>
+ </element>
+ <element name="currentTemperature">
+ <description>The data in this field is the current temperature.</description>
+ </element>
+ <element name="maximumTemperature">
+ <description>The data in this field is the maximum temperature for the day.</description>
+ </element>
+ <element name="minimumTemperature">
+ <description>The data in this field is the minimum temperature for the day.</description>
+ </element>
+ <element name="weatherTerm">
+ <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
+ </element>
+ <element name="humidity">
+ <description>The data in this field describes the current humidity value.</description>
+ </element>
+ </enum>
+
+ <struct name="MetadataTags">
+ <param name="mainField1" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField1" text field.</description>
+ </param>
+ <param name="mainField2" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField2" text field.</description>
+ </param>
+ <param name="mainField3" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField3" text field.</description>
+ </param>
+ <param name="mainField4" type="MetadataType" minsize="0" maxsize="5" array="true" mandatory="false">
+ <description>The type of data contained in the "mainField4" text field.</description>
+ </param>
+ </struct>
+
+ <struct name="Rectangle">
+ <param name="x" type="Float" mandatory="true">
+ <description>The upper left X-coordinate of the rectangle</description>
+ </param>
+ <param name="y" type="Float" mandatory="true">
+ <description>The upper left Y-coordinate of the rectangle</description>
+ </param>
+ <param name="width" type="Float" mandatory="true">
+ <description>The width of the rectangle</description>
+ </param>
+ <param name="height" type="Float" mandatory="true">
+ <description>The height of the rectangle</description>
+ </param>
+ </struct>
+
+ <struct name="HapticRect">
+ <description>Defines haptic data for each user control object for video streaming application</description>
+ <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>A user control spatial identifier</description>
+ </param>
+ <param name="rect" type="Rectangle" mandatory="true">
+ <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
+ </param>
+ </struct>
+
+ <!-- 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" mandatory="true">
+ <description>See SyncMsgVersion</description>
+ </param>
+
+ <param name="appName" type="String" maxlength="100" mandatory="true">
+ <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" mandatory="true">
+ <description>
+ Indicates if the application is a media or a non-media application.
+ Only media applications will be able to stream audio to the module that is audible outside of the BT media source.
+ </description>
+ </param>
+ <param name="languageDesired" type="Language" mandatory="true">
+ <description>
+ See Language
+ Current app's expected VR+TTS language
+ If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+ <param name="hmiDisplayLanguageDesired" type="Language" mandatory="true">
+ <description>
+ See Language
+ Current app's expected display language
+ If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus.
+ </description>
+ </param>
+
+ <param name="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>
+ <param name="appInfo" type="AppInfo" mandatory="false">
+ <description>
+ See AppInfo.
+ </description>
+ </param>
+ </function>
+
+ <function name="RegisterAppInterface" functionID="RegisterAppInterfaceID" messagetype="response">
+ <description>The response to registerAppInterface</description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="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 the module. See "Language" for options.</description>
+ </param>
+
+ <param name="hmiDisplayLanguage" type="Language" mandatory="false">
+ <description>The currently active display language on the module. 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">
+ <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="pcmStreamCapabilities" type="AudioPassThruCapabilities" array="false" 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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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 module 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 keyboard configuration (if available).</description>
+ </param>
+ </function>
+
+ <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</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" mandatory="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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description>Unique ID used for this interaction choice set.</description>
+ </param>
+
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
+ </function>
+
+ <function name="CreateInteractionChoiceSet" functionID="CreateInteractionChoiceSetID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</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" mandatory="true">
+ <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 initial 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" mandatory="true">
+ <description>See InteractionMode.</description>
+ </param>
+
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="0" maxsize="100" minvalue="0" maxvalue="2000000000" array="true" mandatory="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 occurring.
+ 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 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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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 the module's capabilities.
+ If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped.
+ </description>
+ </param>
+
+ <param name="mediaTrack" type="String" minlength="0" maxlength="500" mandatory="false">
+ <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>
+
+ <param name="metadataTags" type="MetadataTags" mandatory="false">
+ <description>App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4.
+ If omitted on supported displays, the currently set metadata tags will not change.
+ If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed.</description>
+ </param>
+ </function>
+
+ <function name="Show" functionID="ShowID" messagetype="response">
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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>
+ The module 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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description>Name of the button to subscribe.</description>
+ </param>
+ </function>
+
+ <function name="SubscribeButton" functionID="SubscribeButtonID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</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" mandatory="true">
+ <description>Name of the button to unsubscribe.</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeButton" functionID="UnsubscribeButtonID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description>
+ true, if successful
+ false, if failed
+ </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="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 module from a mobile device, such as icons and album art
+ Not supported on first generation of SDL enabled modules.
+ 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 occurred.</description>
+ <description>Not supported on first generation SDL enabled vehicles. </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <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 module in the app's local cache.
+ Not supported on first generation SDL enabled 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 occurred.
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_REQUEST"/>
+ </param>
+
+ <param name="spaceAvailable" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>Provides the total local space available on the module 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 SDL enabled 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 SDL enabled vehicles.
+ </description>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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 the module 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" mandatory="true">
+ <description>Provides the total local space available on the module 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 the module as the app's icon
+ Not supported on first generation SDL enabled 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 occurred.
+ Not supported on First generation SDL enabled vehicles.
+ </description>
+
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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="false">
+ </param>
+ <param name="latitudeDegrees" type="Float" minvalue="-90" maxvalue="90" mandatory="false">
+ </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>
+
+ <param name="timeStamp" type="DateTime" mandatory="false">
+ <description>
+ timestamp in ISO 8601 format
+ </description>
+ </param>
+
+ <param name="address" type="OASISAddress" mandatory="false">
+ <description>Address to be used for setting destination</description>
+ </param>
+ <param name="deliveryMode" type="DeliveryMode" mandatory="false">
+ <description>Defines the mode of prompt for user</description>
+ </param>
+ </function>
+
+ <function name="SendLocation" functionID="SendLocationID" messagetype="response" >
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</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" mandatory="true">
+ <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" mandatory="true">
+ <description>true, if successful</description>
+ <description>false, if failed</description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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="ButtonPress" functionID="ButtonPressID" messagetype="request">
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ <description>The module where the button should be pressed</description>
+ </param>
+ <param name="buttonName" type="ButtonName" mandatory="true">
+ <description>The name of supported RC climate or radio button.</description>
+ </param>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ </function>
+
+ <function name="ButtonPress" functionID="ButtonPressID" messagetype="response">
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <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"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleType" type="ModuleType" mandatory="true">
+ <description>
+ The type of a RC module to retrieve module data from the vehicle.
+ In the future, this should be the Identification of a module.
+ </description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
+ <description>
+ If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType.
+ If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType.
+ </description>
+ </param>
+ </function>
+
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>
+ It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType.
+ if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.
+ </description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ <description>The module data to set for the requested RC module.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response">
+ <description>Used to set the values of one remote control module </description>
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="READ_ONLY"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request">
+ <description>To subscribe in getting changes for Waypoints/destinations</description>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <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>
+ </function>
+
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
+ <description>Request for getting waypoint/destination data.</description>
+ <param name="wayPointType" type="WayPointType" mandatory="true">
+ <description>To request for either the destination only or for all waypoints including destination</description>
+ </param>
+ </function>
+
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="TIMED_OUT"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <element name="IGNORED"/>
+ <element name="IN_USE"/>
+ <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="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request">
+ <description>Request to unsubscribe from WayPoints and Destination</description>
+ </function>
+
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ <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="wayPoints" type="LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="request">
+ <description>Request for expanded information about a supported system/HMI capability</description>
+ <param name="systemCapabilityType" type="SystemCapabilityType" mandatory="true">
+ <description>The type of system capability to get more information on</description>
+ </param>
+ </function>
+
+ <function name="GetSystemCapability" functionID="GetSystemCapabilityID" messagetype="response">
+ <param name="systemCapability" type="SystemCapability" mandatory="true">
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE">
+ <description>The capability does not exist on the module</description>
+ </element>
+ <element name="DATA_NOT_AVAILABLE">
+ <description>The capability should exist on the module but there was an error retrieving the data.</description>
+ </element>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="request">
+ <description>Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
+ <param name="hapticRectData" type="HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
+ <description>Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared</description>
+ </param>
+ </function>
+
+ <function name="SendHapticData" functionID="SendHapticDataID" messagetype="response">
+ <param name="success" type="Boolean" platform="documentation" mandatory="true">
+ <description> true if successful; false if failed </description>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ <description>Provides additional human readable info regarding the result.</description>
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="GENERIC_ERROR"/>
+ </param>
+ </function>
+
+ <!-- Notifications -->
+
+ <function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
+ <param name="hmiLevel" type="HMILevel" mandatory="true">
+ <description>See HMILevel</description>
+ </param>
+
+ <param name="audioStreamingState" type="AudioStreamingState" mandatory="true">
+ <description>See AudioStreamingState</description>
+ </param>
+
+ <param name="systemContext" type="SystemContext" mandatory="true">
+ <description>See SystemContext</description>
+ </param>
+ </function>
+
+ <function name="OnAppInterfaceUnregistered" functionID="OnAppInterfaceUnregisteredID" messagetype="notification">
+ <param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
+ <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" mandatory="true"/>
+ <param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
+ <description>Indicates whether this is an UP or DOWN event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <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" mandatory="true"/>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="customButtonID" type="Integer" minvalue="0" maxvalue="65536" mandatory="false">
+ <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" mandatory="true">
+ <description>Command ID, which is related to a specific menu entry</description>
+ </param>
+
+ <param name="triggerSource" type="TriggerSource" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="true">
+ <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" mandatory="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" mandatory="true">
+ <description>Current SDL voice engine (VR+TTS) language</description>
+ </param>
+ <param name="hmiDisplayLanguage" type="Language" mandatory="true">
+ <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" 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="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="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="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification">
+ <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
+ <param name="wayPoints" type="LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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" mandatory="true">
+ <description> true, if successful; false, if failed </description>
+ </param>
+
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true">
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="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 85a4d4143f..0c86d4eea3 100644
--- a/src/components/interfaces/QT_HMI_API.xml
+++ b/src/components/interfaces/QT_HMI_API.xml
@@ -1,6 +1,5 @@
-<?xml version="1.0" standalone="yes"?>
<!--
-* Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,6 +28,11 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. -->
+
+<!--
+ * DEPRECATED, use HMI_API instead. This API is used with the DBus adapter,
+ * which will be removed or refactored to use HMI_API in the next major release
+-->
<interfaces name="SmartDeviceLink HMI API">
<interface name="Common" version="1.1" date="2013-10-02">
<enum name="Result">
@@ -57,6 +61,8 @@
<element name="GENERIC_ERROR" value="22"/>
<element name="USER_DISALLOWED" value="23"/>
<element name="TRUNCATED_DATA" value="24"/>
+ <element name="SAVED" value="25"/>
+ <element name="READ_ONLY" value="26"/>
</enum>
<enum name="TransportType">
<description>
@@ -191,6 +197,36 @@
<element name="SK-SK" internal_name="SK_SK">
<description>Slovak - Slovakia</description>
</element>
+ <element name="EN-IN" internal_name="EN_IN">
+ <description>English - India</description>
+ </element>
+ <element name="TH-TH" internal_name="TH_TH">
+ <description>Thai - Thailand</description>
+ </element>
+ <element name="EN-SA" internal_name="EN_SA">
+ <description>English - Middle East</description>
+ </element>
+ <element name="HE-IL" internal_name="HE_IL">
+ <description>Hebrew - Israel</description>
+ </element>
+ <element name="RO-RO" internal_name="RO_RO">
+ <description>Romanian - Romania</description>
+ </element>
+ <element name="UK-UA" internal_name="UK_UA">
+ <description>Ukrainian - Ukraine</description>
+ </element>
+ <element name="ID-ID" internal_name="ID_ID">
+ <description>Indonesian - Indonesia</description>
+ </element>
+ <element name="VI-VN" internal_name="VI_VN">
+ <description>Vietnamese - Vietnam</description>
+ </element>
+ <element name="MS-MY" internal_name="MS_MY">
+ <description>Malay - Malaysia</description>
+ </element>
+ <element name="HI-IN" internal_name="HI_IN">
+ <description>Hindi - India</description>
+ </element>
</enum>
<enum name="SoftButtonType">
<description>Contains information about the SoftButton capabilities.</description>
@@ -223,6 +259,20 @@
<element name="TESTING"/>
<element name="SYSTEM"/>
</enum>
+ <enum name="WayPointType">
+ <description>Describes what kind of waypoint is requested/provided.</description>
+ <element name="ALL" />
+ <element name="DESTINATION" />
+ </enum>
+
+ <struct name="Coordinate">
+ <param name="latitudeDegrees" minvalue="-90" maxvalue="90" type="Float" mandatory="true">
+ <description>Latitude of the location.</description>
+ </param>
+ <param name="longitudeDegrees" minvalue="-180" maxvalue="180" type="Float" mandatory="true">
+ <description>Longitude of the location.</description>
+ </param>
+ </struct>
<enum name="LayoutMode">
<description>For touchscreen interactions, the mode of how the choices are presented.</description>
<element name="ICON_ONLY"/>
@@ -334,7 +384,7 @@
<element name="IGNITION_OFF"/>
<element name="MASTER_RESET"/>
<element name="FACTORY_DEFAULTS"/>
- <element name="SUSPEND" />
+ <element name="SUSPEND"/>
</enum>
<enum name="DisplayType">
<description>The possible types of HU display.</description>
@@ -373,15 +423,18 @@
<element name="DYNAMIC"/>
</enum>
<enum name="ApplicationExitReason">
- <element name="DRIVER_DISTRACTION_VIOLATION" >
+ <element name="DRIVER_DISTRACTION_VIOLATION">
<description>By getting this value, SDL puts the named app to NONE HMILevel</description>
</element>
- <element name="USER_EXIT" >
+ <element name="USER_EXIT">
<description>By getting this value, SDL puts the named app to NONE HMILevel</description>
</element>
<element name="UNAUTHORIZED_TRANSPORT_REGISTRATION">
<description>By getting this value, SDL unregisters the named application</description>
</element>
+ <element name="UNSUPPORTED_HMI_RESOURCE">
+ <description>By getting this value, SDL unregisters the named application</description>
+ </element>
</enum>
<enum name="TextFieldName">
<element name="mainField1">
@@ -478,6 +531,44 @@
<!-- TO DO to be removed -->
<element name="turnText"/>
</enum>
+ <enum name="MetadataType">
+ <element name="mediaTitle">
+ <description>The data in this field contains the title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaArtist">
+ <description>The data in this field contains the artist or creator of the currently playing audio track.</description>
+ </element>
+ <element name="mediaAlbum">
+ <description>The data in this field contains the album title of the currently playing audio track.</description>
+ </element>
+ <element name="mediaYear">
+ <description>The data in this field contains the creation year of the currently playing audio track.</description>
+ </element>
+ <element name="mediaGenre">
+ <description>The data in this field contains the genre of the currently playing audio track.</description>
+ </element>
+ <element name="mediaStation">
+ <description>The data in this field contains the name of the current source for the media.</description>
+ </element>
+ <element name="rating">
+ <description>The data in this field is a rating.</description>
+ </element>
+ <element name="currentTemperature">
+ <description>The data in this field is the current temperature.</description>
+ </element>
+ <element name="maximumTemperature">
+ <description>The data in this field is the maximum temperature for the day.</description>
+ </element>
+ <element name="minimumTemperature">
+ <description>The data in this field is the minimum temperature for the day.</description>
+ </element>
+ <element name="weatherTerm">
+ <description>The data in this field describes the current weather (ex. cloudy, clear, etc.).</description>
+ </element>
+ <element name="humidity">
+ <description>The data in this field describes the current humidity value.</description>
+ </element>
+ </enum>
<enum name="ImageFieldName">
<element name="softButtonImage">
<description>The image field for SoftButton</description>
@@ -908,7 +999,7 @@
<description>Enumeration listing possible keyboard events.</description>
<element name="KEYPRESS"/>
<element name="ENTRY_SUBMITTED"/>
- <element name="ENTRY_VOICE" />
+ <element name="ENTRY_VOICE"/>
<element name="ENTRY_CANCELLED"/>
<element name="ENTRY_ABORTED"/>
</enum>
@@ -954,20 +1045,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" />
+ <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>
@@ -1092,25 +1183,124 @@
</enum>
<enum name="MethodName">
<description>Defines the type of the request which causes text-to-speech prompt</description>
- <element name="ALERT" />
- <element name="SPEAK" />
- <element name="AUDIO_PASS_THRU" />
- <element name="ALERT_MANEUVER" />
+ <element name="ALERT"/>
+ <element name="SPEAK"/>
+ <element name="AUDIO_PASS_THRU"/>
+ <element name="ALERT_MANEUVER"/>
</enum>
<enum name="AlertType">
<description>Defines the type of the request which causes text-to-speech prompt</description>
-<element name="UI" />
-<element name="BOTH" />
+<element name="UI"/>
+<element name="BOTH"/>
</enum>
<enum name="HMILevel">
<element name="FULL"/>
- <element name="LIMITED" />
+ <element name="LIMITED"/>
<element name="BACKGROUND"/>
<element name="NONE"/>
</enum>
+<enum name="EventTypes">
+ <description>Reflects the current active event</description>
+ <element name="AUDIO_SOURCE">
+ <description>Navigated to audio(radio, etc)</description>
+ </element>
+ <element name="EMBEDDED_NAVI">
+ <description>Navigated to navigation screen</description>
+ </element>
+ <element name="PHONE_CALL">
+ <description>Phone call is active</description>
+ </element>
+ <element name="EMERGENCY_EVENT">
+ <description>Active emergency event, active parking event</description>
+ </element>
+ <element name="DEACTIVATE_HMI">
+ <description> GAL/DIO is active </description>
+ </element>
+</enum>
+
+<enum name="VideoStreamingProtocol">
+ <description>Enum for each type of video streaming protocol type.</description>
+ <element name="RAW">
+ <description>
+ Raw stream bytes that contains no timestamp data and is the lowest supported video streaming
+ </description>
+ </element>
+ <element name="RTP">
+ <description>
+ RTP facilitates the transfer of real-time data. Information provided by this protocol include
+ timestamps (for synchronization), sequence numbers (for packet loss and reordering detection)
+ and the payload format which indicates the encoded format of the data.
+ </description>
+ </element>
+ <element name="RTSP">
+ <description>
+ The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the
+ Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP)
+ for media stream delivery. However, some vendors implement proprietary transport protocols.
+ </description>
+ </element>
+ <element name="RTMP">
+ <description>
+ Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by
+ Macromedia for streaming audio, video and data over the Internet, between a Flash player
+ and a server. Macromedia is now owned by Adobe, which has released an incomplete version
+ of the specification of the protocol for public use.
+ </description>
+ </element>
+ <element name="WEBM">
+ <description>
+ The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and
+ Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio.
+ </description>
+ </element>
+</enum>
+
+<enum name="VideoStreamingCodec">
+ <description>Enum for each type of video streaming codec.</description>
+ <element name="H264">
+ <description>
+ A block-oriented motion-compensation-based video compression standard.
+ As of 2014 it is one of the most commonly used formats for the recording, compression, and
+ distribution of video content.
+ </description>
+ </element>
+ <element name="H265">
+ <description>
+ High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video
+ compression standard, one of several potential successors to the widely used AVC (H.264 or
+ MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio
+ at the same level of video quality, or substantially improved video quality at the same
+ bit rate. It supports resolutions up to 8192x4320, including 8K UHD.
+ </description>
+ </element>
+ <element name="Theora">
+ <description>
+ Theora is derived from the formerly proprietary VP3 codec, released into the public domain
+ by On2 Technologies. It is broadly comparable in design and bitrate efficiency to
+ MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of
+ the features present in some of these other codecs. It is comparable in open standards
+ philosophy to the BBC's Dirac codec.
+ </description>
+ </element>
+ <element name="VP8">
+ <description>
+ VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and
+ Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct
+ successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for
+ Open Media (AOMedia) are based on VP8.
+ </description>
+ </element>
+ <element name="VP9">
+ <description>
+ Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD)
+ and also enables lossless compression.
+ </description>
+ </element>
+</enum>
+
<!-- Policies -->
<enum name="UpdateResult">
<element name="UP_TO_DATE"/>
@@ -1143,7 +1333,7 @@
<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>
+ <description>Sent by SDL in UpdateDeviceList. &#8217;true&#8217; &#8211; if device is allowed for PolicyTable Exchange; &#8216;false&#8217; &#8211; if device is NOT allowed for PolicyTable Exchange </description>
</param>
</struct>
<struct name="UserFriendlyMessage" scope="internal">
@@ -1175,16 +1365,16 @@
</struct>
<!-- End of Policies -->
<struct name="TextField">
- <param name="name" type="Common.TextFieldName">
+ <param name="name" type="Common.TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
</param>
- <param name="characterSet" type="Common.CharacterSet">
+ <param name="characterSet" type="Common.CharacterSet" mandatory="true">
<description>The character set that is supported in this field. See CharacterSet.</description>
</param>
- <param name="width" type="Integer" minvalue="1" maxvalue="500">
+ <param name="width" type="Integer" minvalue="1" maxvalue="500" mandatory="true">
<description>The number of characters in one row of this field.</description>
</param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="8">
+ <param name="rows" type="Integer" minvalue="1" maxvalue="8" mandatory="true">
<description>The number of rows of this field.</description>
</param>
</struct>
@@ -1205,27 +1395,13 @@
</struct>
<struct name="VehicleDataResult">
<description>Individual published data request result</description>
- <param name="dataType" type="Common.VehicleDataType">
+ <param name="dataType" type="Common.VehicleDataType" mandatory="true">
<description>Defined published data element type.</description>
</param>
- <param name="resultCode" type="Common.VehicleDataResultCode">
+ <param name="resultCode" type="Common.VehicleDataResultCode" mandatory="true">
<description>Published data result code.</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="String" mandatory="true">
- <description>The ID of the device connected: either hash of device's USB serial number(in case of USB connection) or hash of device's MAC address(in case of BlueTooth or WIFI connection).</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="TouchCoord">
<param name="x" type="Integer" mandatory="true" minvalue="0" maxvalue="10000">
<description>The x coordinate of the touch.</description>
@@ -1315,7 +1491,7 @@
<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" >
+ <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.
@@ -1446,6 +1622,31 @@
<description>The image resolution of this field.</description>
</param>
</struct>
+ <struct name="VideoStreamingFormat">
+ <description>Video streaming formats and their specifications.</description>
+ <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="true">
+ <description>Protocol type, see VideoStreamingProtocol</description>
+ </param>
+ <param name="codec" type="Common.VideoStreamingCodec" mandatory="true">
+ <description>Codec type, see VideoStreamingCodec</description>
+ </param>
+ </struct>
+
+ <struct name="VideoConfig">
+ <description>Configuration of a video stream.</description>
+ <param name="protocol" type="Common.VideoStreamingProtocol" mandatory="false">
+ <description>The video protocol configuration</description>
+ </param>
+ <param name="codec" type="Common.VideoStreamingCodec" mandatory="false">
+ <description>The video codec configuration</description>
+ </param>
+ <param name="width" type="Integer" mandatory="false">
+ <description>Width of the video stream, in pixels.</description>
+ </param>
+ <param name="height" type="Integer" mandatory="false">
+ <description>Height of the video stream, in pixels.</description>
+ </param>
+ </struct>
<struct name="DisplayCapabilities">
<description>Contains information about the display capabilities.</description>
<param name="displayType" type="Common.DisplayType" mandatory="true">
@@ -1785,70 +1986,70 @@
</param>
</struct>
<struct name="ECallInfo">
- <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <param name="eCallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification_4A". See VehicleDataNotificationStatus.</description>
</param>
- <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus">
+ <param name="auxECallNotificationStatus" type="Common.VehicleDataNotificationStatus" mandatory="true">
<description>References signal "eCallNotification". See VehicleDataNotificationStatus.</description>
</param>
- <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus">
+ <param name="eCallConfirmationStatus" type="Common.ECallConfirmationStatus" mandatory="true">
<description>References signal "eCallConfirmation". See ECallConfirmationStatus.</description>
</param>
</struct>
<struct name="AirbagStatus">
- <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerCurtainAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="driverKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerSideAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus">
+ <param name="passengerKneeAirbagDeployed" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
</struct>
<struct name="EmergencyEvent">
- <param name="emergencyEventType" type="Common.EmergencyEventType">
+ <param name="emergencyEventType" type="Common.EmergencyEventType" mandatory="true">
<description>References signal "VedsEvntType_D_Ltchd". See EmergencyEventType.</description>
</param>
- <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus">
+ <param name="fuelCutoffStatus" type="Common.FuelCutoffStatus" mandatory="true">
<description>References signal "RCM_FuelCutoff". See FuelCutoffStatus.</description>
</param>
- <param name="rolloverEvent" type="Common.VehicleDataEventStatus">
+ <param name="rolloverEvent" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus">
+ <param name="maximumChangeVelocity" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
- <param name="multipleEvents" type="Common.VehicleDataEventStatus">
+ <param name="multipleEvents" type="Common.VehicleDataEventStatus" mandatory="true">
<description>References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus.</description>
</param>
</struct>
<struct name="ClusterModeStatus">
- <param name="powerModeActive" type="Boolean">
+ <param name="powerModeActive" type="Boolean" mandatory="true">
<description>References signal "PowerMode_UB".</description>
</param>
- <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus">
+ <param name="powerModeQualificationStatus" type="Common.PowerModeQualificationStatus" mandatory="true">
<description>References signal "PowerModeQF". See PowerModeQualificationStatus.</description>
</param>
- <param name="carModeStatus" type="Common.CarModeStatus">
+ <param name="carModeStatus" type="Common.CarModeStatus" mandatory="true">
<description>References signal "CarMode". See CarMode.</description>
</param>
- <param name="powerModeStatus" type="Common.PowerModeStatus">
+ <param name="powerModeStatus" type="Common.PowerModeStatus" mandatory="true">
<description>References signal "PowerMode". See PowerMode.</description>
</param>
</struct>
@@ -1858,6 +2059,452 @@
</param>
</struct>
<!--end of IVI part-->
+ <!-- Remote Control -->
+ <enum name="ModuleType">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ </enum>
+
+ <enum name="RadioBand">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <struct name="RdsData">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false">
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false">
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false">
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <enum name="RadioState">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <struct name="RadioControlData">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="Common.RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="Common.RdsData" mandatory="false">
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>number of HD sub-channels if available</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>Current HD sub-channel if available</description>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false is the radio is off</description>
+ </param>
+ <param name="state" type="Common.RadioState" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the radio control module.</description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="DefrostZone">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="TemperatureUnit">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="Temperature">
+ <param name="unit" type="TemperatureUnit" mandatory="true" >
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true" >
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="desiredTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="ClimateControlCapabilities">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the climate control module.</description>
+ </param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="Common.DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="ModuleData">
+ <description>The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ </param>
+ <param name="radioControlData" type="Common.RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
+ </param>
+ </struct>
+
+ <enum name="RCAccessMode">
+ <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
+ <element name="AUTO_ALLOW"/>
+ <element name="AUTO_DENY"/>
+ <element name="ASK_DRIVER"/>
+ </enum>
+<struct name="DateTime">
+ <param name="millisecond" type="Integer" minvalue="0" maxvalue="999" mandatory="false">
+ <description>Milliseconds </description>
+ </param>
+ <param name="second" type="Integer" minvalue="0" maxvalue="60" mandatory="false">
+ <description>Seconds part of time</description>
+ </param>
+ <param name="minute" type="Integer" minvalue="0" maxvalue="59" mandatory="false">
+ <description>Minutes part of time</description>
+ </param>
+ <param name="hour" type="Integer" minvalue="0" maxvalue="23" mandatory="false">
+ <description>Hours part of time. Note that this structure accepts time only in 24 Hr format</description>
+ </param>
+ <param name="day" type="Integer" minvalue="1" maxvalue="31" mandatory="false">
+ <description>Day of the month</description>
+ </param>
+ <param name="month" type="Integer" minvalue="1" maxvalue="12" mandatory="false">
+ <description>Month of the year</description>
+ </param>
+ <param name="year" type="Integer" maxvalue="4095" mandatory="false">
+ <description>The year in YYYY format</description>
+ </param>
+ <param name="tz_hour" type="Integer" minvalue="-12" maxvalue="14" defvalue="0" mandatory="false">
+ <description>Time zone offset in Hours wrt UTC.</description>
+ </param>
+ <param name="tz_minute" type="Integer" minvalue="0" maxvalue="59" defvalue="0" mandatory="false">
+ <description>Time zone offset in Min wrt UTC.</description>
+ </param>
+</struct>
+
+<struct name="OASISAddress">
+ <param name="countryName" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Name of the country (localized)</description>
+ </param>
+ <param name="countryCode" minlength="0" maxlength="50" type="String" mandatory="false">
+ <description>Name of country (ISO 3166-2)</description>
+ </param>
+ <param name="postalCode" minlength="0" maxlength="16" type="String" mandatory="false">
+ <description>(PLZ, ZIP, PIN, CAP etc.)</description>
+ </param>
+ <param name="administrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of country (e.g. state)</description>
+ </param>
+ <param name="subAdministrativeArea" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of e.g. state (e.g. county)</description>
+ </param>
+ <param name="locality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. city/village</description>
+ </param>
+ <param name="subLocality" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for e.g. district</description>
+ </param>
+ <param name="thoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Hypernym for street, road etc.</description>
+ </param>
+ <param name="subThoroughfare" minlength="0" maxlength="200" type="String" mandatory="false">
+ <description>Portion of thoroughfare e.g. house number</description>
+ </param>
+</struct>
+
+ <struct name="LocationDetails">
+ <param name="coordinate" type="Coordinate" mandatory="false">
+ <description>Latitude/Longitude of the location.</description>
+ </param>
+ <param name="locationName" type="String" maxlength="500" mandatory="false">
+ <description>Name of location.</description>
+ </param>
+ <param name="addressLines" type="String" maxlength="500" minsize="0" maxsize="4" array="true" mandatory="false">
+ <description>Location address for display purposes only</description>
+ </param>
+ <param name="locationDescription" type="String" maxlength="500" mandatory="false">
+ <description>Description intended location / establishment (if applicable)</description>
+ </param>
+ <param name="phoneNumber" type="String" maxlength="500" mandatory="false">
+ <description>Phone number of location / establishment.</description>
+ </param>
+ <param name="locationImage" type="Image" mandatory="false">
+ <description>Image / icon of intended location.</description>
+ </param>
+ <param name="searchAddress" type="OASISAddress" mandatory="false">
+ <description>Address to be used by navigation engines for search</description>
+ </param>
+ </struct>
+
+ <struct name="NavigationCapability">
+ <description>Extended capabilities for an onboard navigation system</description>
+ <param name="sendLocationEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to add locations to the onboard nav</description>
+ </param>
+ <param name="getWayPointsEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the ability to return way points from onboard nav</description>
+ </param>
+ </struct>
+
+ <struct name="PhoneCapability">
+ <description>Extended capabilities of the module's phone feature</description>
+ <param name="dialNumberEnabled" type="Boolean" mandatory="false">
+ <description>If the module has the abiulity to perform dial number</description>
+ </param>
+ </struct>
+
+ <struct name="VideoStreamingCapability">
+ <description>Contains information about this system's video streaming capabilities.</description>
+ <param name="preferredResolution" type="Common.ImageResolution" mandatory="false">
+ <description>The preferred resolution of a video stream for decoding and rendering on HMI.</description>
+ </param>
+ <param name="maxBitrate" type="Integer" minvalue="0" maxvalue="2147483647" mandatory="false">
+ <description>The maximum bitrate of video stream that is supported, in kbps.</description>
+ </param>
+ <param name="supportedFormats" type="Common.VideoStreamingFormat" array="true" mandatory="false">
+ <description>
+ Detailed information on each format supported by this system, in its preferred order
+ (i.e. the first element in the array is most preferable to the system).
+ Each object will contain a VideoStreamingFormat that describes what can be expected.
+ </description>
+ </param>
+ <param name="hapticSpatialDataSupported" type="Boolean" mandatory="false">
+ <description>True if the system can utilize the haptic spatial data from the source being streamed. </description>
+ </param>
+ </struct>
+
+ <struct name="SystemCapabilities">
+ <param name="navigationCapability" type="NavigationCapability" mandatory="false">
+ </param>
+ <param name="phoneCapability" type="PhoneCapability" mandatory="false">
+ </param>
+ <param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="RemoteControlCapabilities">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <description>If included, the platform supports RC button controls with the included button names.</description >
+ </param>
+ </struct>
+
+ <struct name="Rectangle">
+ <param name="x" type="Float" mandatory="true">
+ <description>The X-coordinate of the user control</description>
+ </param>
+ <param name="y" type="Float" mandatory="true">
+ <description>The Y-coordinate of the user control</description>
+ </param>
+ <param name="width" type="Float" mandatory="true">
+ <description>The width of the user control's bounding rectangle</description>
+ </param>
+ <param name="height" type="Float" mandatory="true">
+ <description>The height of the user control's bounding rectangle</description>
+ </param>
+ </struct>
+
+ <struct name="HapticRect">
+ <description>Defines haptic rectangle data for each user control object for video streaming application</description>
+ <param name="id" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
+ <description>A user control spatial identifier</description>
+ </param>
+ <param name="rect" type="Common.Rectangle" mandatory="true">
+ <description>The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.</description>
+ </param>
+ </struct>
</interface>
<interface name="Buttons" version="1.0" date="2013-04-12">
<function name="GetCapabilities" messagetype="request" provider="hmi">
@@ -1904,9 +2551,9 @@
</function>
<function name="OnButtonSubscription" messagetype="notification">
<description>
- Sender: SDL->HMI. Purpose: to notify about button subscription state is changed for the named application
+ Sender: SDL-&gt;HMI. Purpose: to notify about button subscription state is changed for the named application
</description>
- <param name="name" type="Common.ButtonName" mandatory="true" />
+ <param name="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':
@@ -1932,14 +2579,14 @@
<description>Notification from HMI to SDL sent when HMI requires update of device list (i.e. when user clicks 'Change Device' button)</description>
</function>
<function name="OnPhoneCall" messagetype="notification">
- <description>Sender: HMI->SDL. When: upon phone-call event started or ended</description>
+ <description>Sender: HMI-&gt;SDL. When: upon phone-call event started or ended</description>
<param name="isActive" type="Boolean" mandatory="true">
<description>Must be 'true' - when the phone call is started on HMI. Must be 'false' when the phone call is ended on HMI</description>
</param>
</function>
<function name="OnEmergencyEvent" messagetype="notification">
<description>
- "Sender: HMI->SDL. Conditions: when HMI enters the mode of "911 Assist", or other rear view camera,
+ "Sender: HMI-&gt;SDL. Conditions: when HMI enters the mode of "911 Assist", or other rear view camera,
or something else in the future. Purpose: for SDL to change the audioStreamingState of the related apps to
NOT_AUDIBLE when "enabled:true" and back to AUDIBLE when "enabled:false""
</description>
@@ -2087,7 +2734,7 @@
</function>
<function name="OnAwakeSDL" messagetype="notification">
<description>
- Sender: HMI->SDL. Must be sent to return SDL to normal operation after 'Suspend' or 'LowVoltage' events
+ Sender: HMI-&gt;SDL. Must be sent to return SDL to normal operation after 'Suspend' or 'LowVoltage' events
</description>
</function>
<function name="MixingAudioSupported" messagetype="request" provider="hmi">
@@ -2108,6 +2755,17 @@
<description>Defines the name of app's request that initiates playing a tone</description>
</param>
</function>
+ <function name="DialNumber" messagetype="request">
+ <description>Request from SDL to call a specific number.</description>
+ <param name="number" type="String" maxlength="40" mandatory="true">
+ <description>The number to dial. Only the character + and numbers are allowed.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that concerns this RPC.</description>
+ </param>
+ </function>
+ <function name="DialNumber" messagetype="response">
+ </function>
<!-- Policies -->
<!-- SyncP RPC-->
<function name="OnSystemRequest" messagetype="notification" provider="hmi">
@@ -2237,6 +2895,24 @@
<function name="OnIgnitionCycleOver" messagetype="notification" provider="hmi">
<description>Notification from system to SDL to let it know that ignition cycle is over.</description>
</function>
+ <function name="DecryptCertificate" messagetype="request">
+ <description>Sender: SDL-&gt;HMI. Purpose: to decrypt the certificate received via the Updated Policy Table. </description>
+ <param name="fileName" type="String" maxlength="255" minlength="1" mandatory="true">
+ <description>The path to the file with the encrypted certificate from the PolicyTable.</description>
+ </param>
+ </function>
+ <function name="DecryptCertificate" messagetype="response">
+ <description>SUCCESS - in case the certificate is decrypted and placed to the same file from request.</description>
+ </function>
+ <function name="OnEventChanged" messagetype="notification">
+ <description>Sender: HMI->SDL. When event is become active</description>
+ <param name="eventName" type="Common.EventTypes" mandatory="true">
+ <description>Specifies the types of active events.</description>
+ </param>
+ <param name="isActive" type="Boolean" mandatory="true">
+ <description>Must be 'true' - when the event is started on HMI. Must be 'false' when the event is ended on HMI</description>
+ </param>
+ </function>
<!-- End of Policies -->
</interface>
<interface name="VR" version="1.0" date="2013-04-17">
@@ -2433,7 +3109,7 @@
</function>
<function name="ChangeRegistration" messagetype="request" provider="hmi">
<description>Request from SmartDeviceLink to HMI to change language of TTS.</description>
- <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false" >
+ <param name="ttsName" type="Common.TTSChunk" minsize="1" maxsize="100" array="true" mandatory="false">
<description>
Request new ttsName registration
TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green".
@@ -2496,7 +3172,7 @@
</function>
<function name="OnResetTimeout" messagetype="notification">
<description>
- Sender: HMI->SDL. HMI must send this notification every 10 sec. in case the 'methodName'
+ Sender: HMI-&gt;SDL. HMI must send this notification every 10 sec. in case the 'methodName'
results long processing on HMI
</description>
<param name="appID" type="Integer" mandatory="true">
@@ -2744,7 +3420,7 @@
<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>
+ <description>Specifies the HMI&#8217;s capabilities. See HMICapabilities.</description>
</param>
</function>
<function name="ChangeRegistration" messagetype="request" provider="hmi">
@@ -2919,7 +3595,7 @@
</function>
<function name="Slider" messagetype="response">
<param name="sliderPosition" type="Integer" minvalue="1" maxvalue="26" mandatory="false">
- <description>Current slider position. Must be returned when the user has clicked the &#x2018;Save&#x2019; or &#x2018;Canceled&#x2019; button or by the timeout </description>
+ <description>Current slider position. Must be returned when the user has clicked the &#8216;Save&#8217; or &#8216;Canceled&#8217; button or by the timeout </description>
</param>
</function>
<function name="ScrollableMessage" messagetype="request" provider="hmi">
@@ -2998,6 +3674,22 @@
<description>ID of application related to this RPC.</description>
</param>
</function>
+ <function name="SendHapticData" messagetype="request">
+ <description>Send the UI spatial data from MOBILE. This data will be utilized by the HMI to determine how and when haptic events should occur</description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal ID of the application that requested this RPC.</description>
+ </param>
+ <param name="hapticRectData" type="Common.HapticRect" minsize="0" maxsize="1000" mandatory="false" array="true">
+ <description>
+ Array of rectangle data structures that represent the locations of all user controls present on the HMI.
+ This data should be updated if/when the application presents a new screen.
+ When a request is sent, if successful, it will replace all rectangle data previously sent through RPC.
+ Avoidance of doubt, when an empty hapticRectData, it will be clear all rectangle data previously sent through RPC.
+ </description>
+ </param>
+ </function>
+ <function name="SendHapticData" messagetype="response">
+ </function>
</interface>
<interface name="Navigation" version="1.0" date="2013-05-22">
<function name="IsReady" messagetype="request" provider="hmi">
@@ -3033,34 +3725,17 @@
<description> Image / icon of intended location (if applicable and supported) </description>
</param>
</function>
- <function name="SendLocation" messagetype="response" >
+ <function name="SendLocation" messagetype="response">
</function>
<function name="DialNumber" functionID="DialNumberID" messagetype="request">
<description>Dials a phone number and switches to phone application.</description>
- <param name="number" type="String" maxlength="40">
+ <param name="number" type="String" maxlength="40" mandatory="true">
<description>Phone number is a string, which can be up to 40 chars.</description>
</param>
</function>
<function name="DialNumber" functionID="DialNumberID" messagetype="response">
- <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>
<function name="ShowConstantTBT" messagetype="request" provider="hmi">
@@ -3130,6 +3805,27 @@
<description>Current State of TBT client</description>
</param>
</function>
+ <function name="SetVideoConfig" messagetype="request">
+ <description>Request from SDL to HMI to ask whether HMI accepts a video stream with given configuration.</description>
+ <param name="config" type="Common.VideoConfig" mandatory="true">
+ <description>Configuration of a video stream.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application related to this RPC.</description>
+ </param>
+ </function>
+ <function name="SetVideoConfig" messagetype="response">
+ <description>
+ Response from HMI to SDL whether the configuration is accepted.
+ In a negative response, a list of rejected parameters are supplied.
+ </description>
+ <param name="rejectedParams" type="String" array="true" minsize="1" maxsize="1000" mandatory="false">
+ <description>
+ List of params of VideoConfig struct which are not accepted by HMI, e.g. "protocol" and "codec".
+ This param exists only when the response is negative.
+ </description>
+ </param>
+ </function>
<function name="StartStream" messagetype="request" provider="hmi">
<description>Request from SmartDeviceLinkCore to HMI to start playing video streaming.</description>
<param name="url" type="String" minlength="21" maxlength="500" mandatory="true">
@@ -3169,18 +3865,54 @@
<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>
+ <description>Sender: SDL-&gt;HMI. Purpose: notify about raw audio data presence over the URL provided via StartAudioStream SDL's request.</description>
<param name="available" type="Boolean" mandatory="true">
<description>If "true" - audio data started. If "false" - audio data stopped.</description>
</param>
</function>
<function name="OnVideoDataStreaming" messagetype="notification">
- <description>Sender: SDL->HMI. Purpose: notify about raw video data presence over the URL provided via StartStream SDL's request.</description>
+ <description>Sender: SDL-&gt;HMI. Purpose: notify about raw video data presence over the URL provided via StartStream SDL's request.</description>
<param name="available" type="Boolean" mandatory="true">
<description>If "true" - video data started. If "false" - video data stopped.</description>
</param>
</function>
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="request">
+ <description>Request for getting waypoint/destination data.</description>
+ <param name="wayPointType" type="Common.WayPointType" mandatory="true">
+ <description>To request for either the destination only or for all waypoints including destination</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application.</description>
+ </param>
+ </function>
+ <function name="GetWayPoints" functionID="GetWayPointsID" messagetype="response">
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application.</description>
+ </param>
+ <param name="wayPoints" type="Common.LocationDetails" mandatory="false" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+ <function name="OnWayPointChange" functionID="OnWayPointChangeID" messagetype="notification">
+ <description>Notification which provides the entire LocationDetails when there is a change to any waypoints or destination.</description>
+ <param name="wayPoints" type="Common.LocationDetails" mandatory="true" array="true" minsize="1" maxsize="10">
+ <description>See LocationDetails</description>
+ </param>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="request">
+ <description>To subscribe in getting changes for Waypoints/destinations</description>
+ </function>
+
+ <function name="SubscribeWayPoints" functionID="SubscribeWayPointsID" messagetype="response">
+ </function>
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="request">
+ <description>Request to unsubscribe from WayPoints and Destination</description>
+ </function>
+
+ <function name="UnsubscribeWayPoints" functionID="UnsubscribeWayPointsID" messagetype="response">
+ </function>
</interface>
<interface name="VehicleInfo" version="1.0" date="2013-04-21">
@@ -3263,6 +3995,555 @@
</description>
</param>
</function>
+ <function name="SubscribeVehicleData" messagetype="request">
+ <description>
+ Subscribes for specific published data items.
+ The data will be only sent if it has changed.
+ The application will be notified by the onVehicleData notification whenever new data is available.
+ To unsubscribe the notifications, use unsubscribe with the same subscriptionType.
+ </description>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="SubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="UnsubscribeVehicleData" messagetype="request">
+ <description>
+ This function is used to unsubscribe the notifications from the subscribeVehicleData function.
+ </description>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of application that requested this RPC.</description>
+ </param>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius.</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="UnsubscribeVehicleData" messagetype="response">
+ <param name="gps" type="Common.VehicleDataResult" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Common.VehicleDataResult" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Common.VehicleDataResult" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.VehicleDataResult" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Common.VehicleDataResult" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Common.VehicleDataResult" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="prndl" type="Common.VehicleDataResult" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.VehicleDataResult" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Common.VehicleDataResult" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.VehicleDataResult" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Common.VehicleDataResult" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Common.VehicleDataResult" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Common.VehicleDataResult" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <!-- Ford Specific Data Items -->
+ <param name="eCallInfo" type="Common.VehicleDataResult" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModes" type="Common.VehicleDataResult" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.VehicleDataResult" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ <!-- / Ford Specific Data Items -->
+ </function>
+ <function name="GetVehicleData" messagetype="request">
+ <description>Non periodic vehicle data read request.</description>
+ <param name="gps" type="Boolean" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Boolean" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Boolean" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Boolean" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Boolean" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Boolean" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Boolean" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="Boolean" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Boolean" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Boolean" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Boolean" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Boolean" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Boolean" mandatory="false">
+ <description>The body information including ignition status and internal temp</description>
+ </param>
+ <param name="deviceStatus" type="Boolean" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Boolean" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Boolean" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Boolean" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Boolean" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Boolean" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Boolean" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Boolean" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Boolean" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Boolean" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Boolean" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Boolean" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+ <function name="GetVehicleData" messagetype="response">
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number</description>
+ </param>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
+ <function name="OnVehicleData" messagetype="notification">
+ <description>Callback for the periodic and non periodic vehicle data read function.</description>
+ <param name="gps" type="Common.GPSData" mandatory="false">
+ <description>See GPSData</description>
+ </param>
+ <param name="speed" type="Float" minvalue="0" maxvalue="700" mandatory="false">
+ <description>The vehicle speed in kilometers per hour</description>
+ </param>
+ <param name="rpm" type="Integer" minvalue="0" maxvalue="20000" mandatory="false">
+ <description>The number of revolutions per minute of the engine</description>
+ </param>
+ <param name="fuelLevel" type="Float" minvalue="-6" maxvalue="106" mandatory="false">
+ <description>The fuel level in the tank (percentage)</description>
+ </param>
+ <param name="fuelLevel_State" type="Common.ComponentVolumeStatus" mandatory="false">
+ <description>The fuel level state</description>
+ </param>
+ <param name="instantFuelConsumption" type="Float" minvalue="0" maxvalue="25575" mandatory="false">
+ <description>The instantaneous fuel consumption in microlitres</description>
+ </param>
+ <param name="externalTemperature" type="Float" minvalue="-40" maxvalue="100" mandatory="false">
+ <description>The external temperature in degrees celsius</description>
+ </param>
+ <param name="vin" type="String" maxlength="17" mandatory="false">
+ <description>Vehicle identification number.</description>
+ </param>
+ <param name="prndl" type="Common.PRNDL" mandatory="false">
+ <description>See PRNDL</description>
+ </param>
+ <param name="tirePressure" type="Common.TireStatus" mandatory="false">
+ <description>See TireStatus</description>
+ </param>
+ <param name="odometer" type="Integer" minvalue="0" maxvalue="17000000" mandatory="false">
+ <description>Odometer in km</description>
+ </param>
+ <param name="beltStatus" type="Common.BeltStatus" mandatory="false">
+ <description>The status of the seat belts</description>
+ </param>
+ <param name="bodyInformation" type="Common.BodyInformation" mandatory="false">
+ <description>The body information including power modes</description>
+ </param>
+ <param name="deviceStatus" type="Common.DeviceStatus" mandatory="false">
+ <description>The device status including signal and battery strength</description>
+ </param>
+ <param name="driverBraking" type="Common.VehicleDataEventStatus" mandatory="false">
+ <description>The status of the brake pedal</description>
+ </param>
+ <param name="wiperStatus" type="Common.WiperStatus" mandatory="false">
+ <description>The status of the wipers</description>
+ </param>
+ <param name="headLampStatus" type="Common.HeadLampStatus" mandatory="false">
+ <description>Status of the head lamps</description>
+ </param>
+ <param name="engineTorque" type="Float" minvalue="-1000" maxvalue="2000" mandatory="false">
+ <description>Torque value for engine (in Nm) on non-diesel variants</description>
+ </param>
+ <param name="accPedalPosition" type="Float" minvalue="0" maxvalue="100" mandatory="false">
+ <description>Accelerator pedal position (percentage depressed)</description>
+ </param>
+ <param name="steeringWheelAngle" type="Float" minvalue="-2000" maxvalue="2000" mandatory="false">
+ <description>Current angle of the steering wheel (in deg)</description>
+ </param>
+ <param name="eCallInfo" type="Common.ECallInfo" mandatory="false">
+ <description>Emergency Call notification and confirmation data</description>
+ </param>
+ <param name="airbagStatus" type="Common.AirbagStatus" mandatory="false">
+ <description>The status of the air bags</description>
+ </param>
+ <param name="emergencyEvent" type="Common.EmergencyEvent" mandatory="false">
+ <description>Information related to an emergency event (and if it occurred)</description>
+ </param>
+ <param name="clusterModeStatus" type="Common.ClusterModeStatus" mandatory="false">
+ <description>The status modes of the cluster</description>
+ </param>
+ <param name="myKey" type="Common.MyKey" mandatory="false">
+ <description>Information related to the MyKey feature</description>
+ </param>
+ </function>
<!--Qt HMI version of GetVehicleData-->
<function name="GetGpsData" messagetype="request" provider="hmi">
<param name="appID" type="Integer" mandatory="true">
@@ -4140,8 +5421,97 @@
</function>
<function name="OnDeviceStateChanged" messagetype="notification" scope="internal" provider="hmi">
<param name="deviceState" type="Common.DeviceState" mandatory="true"/>
- <param name="deviceInternalId" type="String" mandatory="true" minlength="0" maxlength="500" />
+ <param name="deviceInternalId" type="String" mandatory="true" minlength="0" maxlength="500"/>
<param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
</function>
</interface>
-</interfaces>
+<interface name="RC" version="1.1.0" date="2017-07-18">
+ <function name="IsReady" messagetype="request">
+ <description>Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if vehicle RC modules are present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system startup by SDL to request information about Remote Control capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false">
+ <description>See RemoteControlCapabilities, all available RC modules and buttons shall be returned.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ <description>The module type and data to set</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal SDL-assigned ID of the related application</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" messagetype="response">
+ <description>Used to set the values of one zone and one data type within that zone</description>
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ </function>
+
+<function name="GetInteriorVehicleData" messagetype="request">
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ <description>The module data to retrieve from the vehicle for that type</description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
+ <description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal SDL-assigned ID of the related application</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleData" messagetype="response">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>Is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request.
+ if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleDescription.
+ if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe.</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleDataConsent" messagetype="request">
+ <description>Sender: SDL->HMI. </description>
+ <description>HMI is expected to display a permission prompt to the driver showing the RC module and app details (for example, app's name).
+ The driver is expected to have an ability to grant or deny the permission.</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true">
+ <description>The module type that the app requests to control.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application that triggers the permission prompt.</description>
+ </param>
+ </function>
+ <function name="GetInteriorVehicleDataConsent" messagetype="response">
+ <param name="allowed" type="Boolean" mandatory="true">
+ <description>"true" - if the driver grants the permission for controlling to the named app;
+ "false" - in case the driver denies the permission for controlling to the named app.</description>
+ </param>
+</function>
+
+<function name="OnInteriorVehicleData" messagetype="notification">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+</function>
+
+<function name="OnRemoteControlSettings" messagetype="notification">
+ <description>Sender: vehicle -> RSDL. Notification about remote-control settings changed. Sent after User`s choice through HMI.</description>
+ <param name="allowed" type="Boolean" mandatory="false" >
+ <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
+ </param>
+ <param name="accessMode" type="Common.RCAccessMode" mandatory="false" >
+ <description>The remote control access mode specified by the driver via HMI.</description>
+ </param>
+</function>
+</interface>
+</interfaces> \ No newline at end of file
diff --git a/src/components/interfaces/v4_protocol_v1_2_no_extra.xml b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
index ead8596ee6..cc522d9f1c 100644
--- a/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
+++ b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml
@@ -326,16 +326,16 @@
</enum>
<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="choiceID" type="Integer" minvalue="0" maxvalue="65535" mandatory="true"/>
+ <param name="menuName" type="String" maxlength="500" mandatory="true"/>
+ <param name="vrCommands" type="String" minsize="1" maxsize="100" maxlength="99" array="true" mandatory="true"/>
</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="1">
+ <param name="majorVersion" type="Integer" minvalue="1" maxvalue="1" mandatory="true">
<description>The major version indicates versions that is not-compatible to previous versions.</description>
</param>
- <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000">
+ <param name="minorVersion" type="Integer" minvalue="0" maxvalue="1000" mandatory="true">
<description>The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality)</description>
</param>
</struct>
@@ -349,53 +349,53 @@
</element>
</enum>
<struct name="StartTime">
- <param name="hours" type="Integer" minvalue="0" maxvalue="59">
+ <param name="hours" type="Integer" minvalue="0" maxvalue="59" mandatory="true">
<description>The hour of the media clock.</description>
<description>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"/>
+ <param name="minutes" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
+ <param name="seconds" type="Integer" minvalue="0" maxvalue="59" mandatory="true"/>
</struct>
<struct name="TextField">
- <param name="name" type="TextFieldName">
+ <param name="name" type="TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
</param>
- <param name="characterSet" type="CharacterSet">
+ <param name="characterSet" type="CharacterSet" mandatory="true">
<description>The character set that is supported in this field. See CharacterSet.</description>
</param>
- <param name="width" type="Integer" minvalue="1" maxvalue="40">
+ <param name="width" type="Integer" minvalue="1" maxvalue="40" mandatory="true">
<description>The number of characters in one row of this field.</description>
</param>
- <param name="rows" type="Integer" minvalue="1" maxvalue="3">
+ <param name="rows" type="Integer" minvalue="1" maxvalue="3" mandatory="true">
<description>The number of rows of this field.</description>
</param>
</struct>
<struct name="DisplayCapabilities">
<description>Contains information about the display capabilities.</description>
- <param name="displayType" type="DisplayType">
+ <param name="displayType" type="DisplayType" mandatory="true">
<description>The type of the display. See DisplayType</description>
</param>
- <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true">
+ <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="true">
<description>A set of all fields that support text data. See TextField</description>
</param>
- <param name="mediaClockFormats" type="MediaClockFormat" minsize="1" maxsize="100" array="true">
+ <param name="mediaClockFormats" type="MediaClockFormat" minsize="1" maxsize="100" array="true" mandatory="true">
<description>A set of all supported formats of the media clock. See MediaClockFormat</description>
</param>
</struct>
<struct name="ButtonCapabilities">
<description>Contains information about a buttons capabilities.</description>
- <param name="name" type="ButtonName">
+ <param name="name" type="ButtonName" mandatory="true">
<description>The name of the button. See ButtonName.</description>
</param>
- <param name="shortPressAvailable" type="Boolean">
+ <param name="shortPressAvailable" type="Boolean" mandatory="true">
<description>The button supports a short press.</description>
<description>Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked.</description>
</param>
- <param name="longPressAvailable" type="Boolean">
+ <param name="longPressAvailable" type="Boolean" mandatory="true">
<description>The button supports a LONG press.</description>
<description>Whenever the button is pressed long, onButtonPressed( LONG) will be invoked.</description>
</param>
- <param name="upDownAvailable" type="Boolean">
+ <param name="upDownAvailable" type="Boolean" mandatory="true">
<description>The button supports "button down" and "button up".</description>
<description>Whenever the button is pressed, onButtonEvent( DOWN) will be invoked.</description>
<description>Whenever the button is released, onButtonEvent( UP) will be invoked.</description>
@@ -413,17 +413,17 @@
<description>if position is greater or equal than the number of items on top level, the sub menu will be appended to the end.</description>
<description>If this param was omitted the entry will be added at the end.</description>
</param>
- <param name="menuName" type="String" maxlength="500">
+ <param name="menuName" type="String" maxlength="500" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
</struct>
<struct name="TTSChunk">
<description>A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI)</description>
- <param name="text" maxlength="500" type="String">
+ <param name="text" maxlength="500" type="String" mandatory="true">
<description>The text or phonemes to speak.</description>
<description>May not be empty.</description>
</param>
- <param name="type" type="SpeechCapabilities">
+ <param name="type" type="SpeechCapabilities" mandatory="true">
<description>Describes, whether it is text or a specific phoneme set. See SpeechCapabilities</description>
</param>
</struct>
@@ -431,10 +431,10 @@
<function name="RegisterAppInterface" messagetype="request">
<description>Establishes an interface with a mobile application.</description>
<description>Before registerAppInterface no other commands will be accepted/executed.</description>
- <param name="syncMsgVersion" type="SyncMsgVersion">
+ <param name="syncMsgVersion" type="SyncMsgVersion" mandatory="true">
<description>See SyncMsgVersion</description>
</param>
- <param name="appName" type="String" maxlength="100">
+ <param name="appName" type="String" maxlength="100" mandatory="true">
<description>The mobile application name, e.g. "Ford Drive Green".</description>
<description>Needs to be unique over all applications.</description>
<description>May not be empty.</description>
@@ -457,11 +457,11 @@
<description>If not provided, the default is equal to False"</description>
<description>Indicates if the mobile application wants to use vehicle data like GPS or speed.</description>
</param>
- <param name="isMediaApplication" type="Boolean">
+ <param name="isMediaApplication" type="Boolean" mandatory="true">
<description>Indicates if the application is a media or a non-media application.</description>
<description>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">
+ <param name="languageDesired" type="Language" mandatory="true">
<description>See Language</description>
<description>If the language doesn't match the active language on Sync, it will be rejected.</description>
<description>If the language is changed, while an app is registered, it will get disconnected.</description>
@@ -475,11 +475,11 @@
</function>
<function name="RegisterAppInterface" messagetype="response">
<description>The response to registerAppInterface</description>
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -527,11 +527,11 @@
<description>Will fail, if no registerAppInterface was completed successfully before.</description>
</function>
<function name="UnregisterAppInterface" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -559,11 +559,11 @@
<issue creator="rs">Do we want to add VR threshold params?</issue>
</function>
<function name="SetGlobalProperties" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -579,16 +579,16 @@
</function>
<function name="ResetGlobalProperties" messagetype="request">
<description>Allows resetting global properties.</description>
- <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true">
+ <param name="properties" type="GlobalProperty" minsize="1" maxsize="100" array="true" mandatory="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" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -605,7 +605,7 @@
<function name="AddCommand" messagetype="request">
<description>Adds a command to the in application menu.</description>
<description>Either menuParams or vrCommands must be provided.</description>
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <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">
@@ -617,11 +617,11 @@
</param>
</function>
<function name="AddCommand" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -639,16 +639,16 @@
</function>
<function name="DeleteCommand" 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">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>ID of the command(s) to delete.</description>
</param>
</function>
<function name="DeleteCommand" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -666,7 +666,7 @@
</function>
<function name="AddSubMenu" messagetype="request">
<description>Adds a sub menu to the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>unique ID of the sub menu to add.</description>
</param>
<param name="position" type="Integer" minvalue="0" maxvalue="1000" mandatory="false">
@@ -677,16 +677,16 @@
<description>Position of any submenu will always be located before the return and exit options</description>
<description>If this param was omitted the entry will be added at the end.</description>
</param>
- <param name="menuName" maxlength="500" type="String">
+ <param name="menuName" maxlength="500" type="String" mandatory="true">
<description>Text to show in the menu for this sub menu.</description>
</param>
</function>
<function name="AddSubMenu" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -704,16 +704,16 @@
</function>
<function name="DeleteSubMenu" messagetype="request">
<description>Deletes a submenu from the in-application menu.</description>
- <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="menuID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>The "menuID" of the submenu to delete. (See addSubMenu.menuID)</description>
</param>
</function>
<function name="DeleteSubMenu" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -731,17 +731,17 @@
</function>
<function name="CreateInteractionChoiceSet" messagetype="request">
<description>creates interaction choice set to be used later by performInteraction</description>
- <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>Unique ID used for this interaction choice set.</description>
</param>
- <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true"/>
+ <param name="choiceSet" type="Choice" minsize="1" maxsize="100" array="true" mandatory="true"/>
</function>
<function name="CreateInteractionChoiceSet" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -759,18 +759,18 @@
</function>
<function name="PerformInteraction" messagetype="request">
<description>Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow).</description>
- <param name="initialText" type="String" maxlength="500">
+ <param name="initialText" type="String" maxlength="500" mandatory="true">
<description>Text to be displayed first.</description>
</param>
- <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <param name="initialPrompt" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
<description>This is the intial prompt spoken to the user at the start of an interaction</description>
<description>An array of text chunks of type TTSChunk. See TTSChunk</description>
<description>The array must have at least one item</description>
</param>
- <param name="interactionMode" type="InteractionMode">
+ <param name="interactionMode" type="InteractionMode" mandatory="true">
<description>See InteractionMode.</description>
</param>
- <param name="interactionChoiceSetIDList" type="Integer" minsize="1" maxsize="100" minvalue="0" maxvalue="2000000000" array="true">
+ <param name="interactionChoiceSetIDList" type="Integer" minsize="1" maxsize="100" minvalue="0" maxvalue="2000000000" array="true" mandatory="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">
@@ -789,11 +789,11 @@
</param>
</function>
<function name="PerformInteraction" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -819,16 +819,16 @@
<function name="DeleteInteractionChoiceSet" 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">
+ <param name="interactionChoiceSetID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>ID of the interaction choice set to delete.</description>
</param>
</function>
<function name="DeleteInteractionChoiceSet" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -867,11 +867,11 @@
</param>
</function>
<function name="Alert" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -917,11 +917,11 @@
</param>
</function>
<function name="Show" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -937,17 +937,17 @@
</function>
<function name="Speak" messagetype="request">
<description>Speaks a text.</description>
- <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true">
+ <param name="ttsChunks" type="TTSChunk" minsize="1" maxsize="100" array="true" mandatory="true">
<description>An array of text chunks of type TTSChunk. See TTSChunk</description>
<description>The array must have at least one item</description>
</param>
</function>
<function name="Speak" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -969,17 +969,17 @@
<description>startTime must be provided for "run"</description>
<description>startTime will be ignored for "pause" and "resum"</description>
</param>
- <param name="updateMode" type="UpdateMode">
+ <param name="updateMode" type="UpdateMode" mandatory="true">
<description>Enumeration to control the media clock.</description>
<description>In case of pause or resume, 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" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1002,11 +1002,11 @@
</param>
</function>
<function name="EncodedSyncPData" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1024,16 +1024,16 @@
<description>Subscribes to built-in HMI buttons.</description>
<description>The application will be notified by the OnButtonEvent and OnButtonPress.</description>
<description>To unsubscribe the notifications, use unsubscribeButton.</description>
- <param name="buttonName" type="ButtonName">
+ <param name="buttonName" type="ButtonName" mandatory="true">
<description>Name of the button to subscribe.</description>
</param>
</function>
<function name="SubscribeButton" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1051,16 +1051,16 @@
</function>
<function name="UnsubscribeButton" messagetype="request">
<description>Unsubscribes from built-in HMI buttons.</description>
- <param name="buttonName" type="ButtonName">
+ <param name="buttonName" type="ButtonName" mandatory="true">
<description>Name of the button to unsubscribe.</description>
</param>
</function>
<function name="UnsubscribeButton" messagetype="response">
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="SUCCESS"/>
<element name="INVALID_DATA"/>
@@ -1079,11 +1079,11 @@
<function name="GenericResponse" messagetype="response">
<description>Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error.</description>
<description>Currently, only resultCode INVALID_DATA is used.</description>
- <param name="success" type="Boolean">
+ <param name="success" type="Boolean" mandatory="true">
<description>true, if successful</description>
<description>false, if failed</description>
</param>
- <param name="resultCode" type="Result">
+ <param name="resultCode" type="Result" mandatory="true">
<description>See Result</description>
<element name="INVALID_DATA"/>
</param>
@@ -1093,40 +1093,40 @@
</function>
<!-- Notifications -->
<function name="OnHMIStatus" messagetype="notification">
- <param name="hmiLevel" type="HMILevel">
+ <param name="hmiLevel" type="HMILevel" mandatory="true">
<description>See HMILevel</description>
</param>
- <param name="audioStreamingState" type="AudioStreamingState">
+ <param name="audioStreamingState" type="AudioStreamingState" mandatory="true">
<description>See AudioStreamingState</description>
</param>
- <param name="systemContext" type="SystemContext">
+ <param name="systemContext" type="SystemContext" mandatory="true">
<description>See SystemContext</description>
</param>
</function>
<function name="OnAppInterfaceUnregistered" messagetype="notification">
- <param name="reason" type="AppInterfaceUnregisteredReason">
+ <param name="reason" type="AppInterfaceUnregisteredReason" mandatory="true">
<description>See AppInterfaceUnregisteredReason</description>
</param>
</function>
<function name="OnButtonEvent" 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">
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonEventMode" type="ButtonEventMode" mandatory="true">
<description>Indicates whether this is an UP or DOWN event.</description>
</param>
</function>
<function name="OnButtonPress" 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">
+ <param name="buttonName" type="ButtonName" mandatory="true"/>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true">
<description>Indicates whether this is a LONG or SHORT button press event.</description>
</param>
</function>
<function name="OnCommand" messagetype="notification">
- <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000">
+ <param name="cmdID" type="Integer" minvalue="0" maxvalue="2000000000" mandatory="true">
<description>Command ID, which is related to a specific menu entry.</description>
</param>
- <param name="triggerSource" type="TriggerSource">
+ <param name="triggerSource" type="TriggerSource" mandatory="true">
<description>See TriggerSource</description>
</param>
</function>
@@ -1138,13 +1138,13 @@
</function>
<function name="OnTBTClientState" messagetype="notification">
<description>Provides applications with notifications specific to the current TBT client status on the module</description>
- <param name="state" type="TBTState">
+ <param name="state" type="TBTState" mandatory="true">
<description>Current State of TBT client</description>
</param>
</function>
<function name="OnDriverDistraction" messagetype="notification">
<description>Provides driver distraction state to mobile applications</description>
- <param name="state" type="DriverDistractionState">
+ <param name="state" type="DriverDistractionState" mandatory="true">
<description>Current State of Driver Distraction</description>
</param>
</function>
diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt
index 3ca02357ab..4913102c9c 100644
--- a/src/components/media_manager/CMakeLists.txt
+++ b/src/components/media_manager/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,93 +28,84 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-if (EXTENDED_MEDIA_MODE)
-find_package(Gstreamer-1.0 REQUIRED)
-find_package(Glib-2.0 REQUIRED)
-find_package(PkgConfig)
-pkg_check_modules(GLIB2 REQUIRED glib-2.0)
-add_definitions(${GLIB2_CFLAGS})
-set(default_includes
- ${GSTREAMER_gst_INCLUDE_DIR}
- ${GSTREAMER_gstconfig_INCLUDE_DIR}
- ${GLIB_glib_2_INCLUDE_DIR}
-)
-set(default_sources
- ${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/audio/file_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/file_video_streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/pipe_streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/socket_streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/file_streamer_adapter.cc
-)
-set(LIBRARIES
- ${GSTREAMER_gstreamer_LIBRARY}
- ApplicationManager
- pulse-simple
- pulse
- gobject-2.0
- glib-2.0
-)
-else(EXTENDED_MEDIA_MODE)
-set(default_includes
-)
-
-set(default_sources
- ${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/audio/file_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/file_video_streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/pipe_streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/socket_streamer_adapter.cc
- ${COMPONENTS_DIR}/media_manager/src/file_streamer_adapter.cc
-)
-set(LIBRARIES
- ProtocolLibrary
-)
-endif()
-
-include_directories (
- include
+include_directories(
+ ${COMPONENTS_DIR}/media_manager/include/
${COMPONENTS_DIR}/media_manager/include/audio/
${COMPONENTS_DIR}/media_manager/include/video/
+ ${COMPONENTS_DIR}/remote_control/include/
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/protocol_handler/include/
${COMPONENTS_DIR}/connection_handler/include/
${COMPONENTS_DIR}/application_manager/include/
${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/policy/include/
+ ${COMPONENTS_DIR}/rpc_base/include/
+ ${COMPONENTS_DIR}/functional_module/include/
${COMPONENTS_DIR}/hmi_message_handler/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/config_profile/include/
${JSONCPP_INCLUDE_DIRECTORY}
${CMAKE_BINARY_DIR}/src/components/
- ${COMPONENTS_DIR}/policy/include/
- ${default_includes}
+ ${POLICY_PATH}/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
${LOG4CXX_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ${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
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+
+set(EXCLUDE_PATHS
+ video_stream_to_file_adapter.cc
+)
+
+set(LIBRARIES
+ MOBILE_API
+ ProtocolLibrary
+ Utils
)
-add_library("MediaManager" ${SOURCES} ${default_sources})
+if(EXTENDED_MEDIA_MODE)
+ find_package(Gstreamer-1.0 REQUIRED)
+ find_package(Glib-2.0 REQUIRED)
+ find_package(PkgConfig)
+ pkg_check_modules(GLIB2 REQUIRED glib-2.0)
+ add_definitions(${GLIB2_CFLAGS})
+
+ include_directories(
+ ${GSTREAMER_gst_INCLUDE_DIR}
+ ${GSTREAMER_gstconfig_INCLUDE_DIR}
+ ${GLIB_glib_2_INCLUDE_DIR}
+ )
+ list(APPEND EXCLUDE_PATHS
+ )
+ list(APPEND LIBRARIES
+ ${GSTREAMER_gstreamer_LIBRARY}
+ pulse-simple
+ pulse
+ gobject-2.0
+ glib-2.0
+ )
+else()
+ list(APPEND EXCLUDE_PATHS
+ a2dp_source_player_adapter.cc
+ from_mic_recorder_adapter.cc
+ from_mic_to_file_recorder_thread.cc
+ )
+endif()
+
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+add_library("MediaManager" ${SOURCES})
target_link_libraries("MediaManager" ${LIBRARIES})
+if(ENABLE_LOG)
+ target_link_libraries("MediaManager" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
if(BUILD_TESTS)
add_subdirectory(test)
endif()
-
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 b956f2c9e2..3645a9cb81 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
@@ -38,12 +38,7 @@
#include "utils/threads/thread_delegate.h"
#include "utils/conditional_variable.h"
#include "utils/lock.h"
-
-namespace NsSmartDeviceLink {
-namespace NsSmartObjects {
-class SmartObject;
-}
-}
+#include "smart_objects/smart_object.h"
namespace application_manager {
class ApplicationManager;
diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h
index f0c6d3c48f..ded709b1fa 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
@@ -74,6 +74,7 @@ class FromMicToFileRecorderThread : public threads::ThreadDelegate {
} GstTimeout;
void initArgs();
+ void deinitArgs();
void psleep(void* timeout);
diff --git a/src/components/media_manager/include/media_manager/file_streamer_adapter.h b/src/components/media_manager/include/media_manager/file_streamer_adapter.h
index 293c6721ee..c4c91a98d8 100644
--- a/src/components/media_manager/include/media_manager/file_streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/file_streamer_adapter.h
@@ -54,6 +54,8 @@ class FileStreamerAdapter : public StreamerAdapter {
const std::string& app_storage_folder);
virtual ~FileStreamer();
+ virtual void Close() {}
+
protected:
virtual bool Connect();
virtual void Disconnect();
diff --git a/src/components/media_manager/include/media_manager/media_manager.h b/src/components/media_manager/include/media_manager/media_manager.h
deleted file mode 100644
index 53e3690c13..0000000000
--- a/src/components/media_manager/include/media_manager/media_manager.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
-#define SRC_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_MANAGER_H_
-
-#include <string>
-#include "protocol/service_type.h"
-#include "media_manager/media_manager_settings.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 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 void FramesProcessed(int32_t application_key,
- int32_t frame_number) = 0;
- /**
- * \brief Media manager settings getter
- * \return pointer to media manager settings class
- */
- virtual const MediaManagerSettings& settings() const = 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 c84a5a884f..7fbd4f2f6f 100644
--- a/src/components/media_manager/include/media_manager/media_manager_impl.h
+++ b/src/components/media_manager/include/media_manager/media_manager_impl.h
@@ -86,9 +86,10 @@ class MediaManagerImpl : public MediaManager,
void set_mock_mic_listener(MediaListenerPtr media_listener);
void set_mock_mic_recorder(MediaAdapterImpl* media_adapter);
void set_mock_streamer(protocol_handler::ServiceType stype,
- MediaAdapterImpl* mock_stream);
- void set_mock_streamer_listener(protocol_handler::ServiceType stype,
- MediaAdapterListener* mock_stream);
+ ::utils::SharedPtr<MediaAdapterImpl> mock_stream);
+ void set_mock_streamer_listener(
+ protocol_handler::ServiceType stype,
+ ::utils::SharedPtr<MediaAdapterListener> mock_stream);
#endif // BUILD_TESTS
protected:
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 1e998ef82f..c079e04954 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
@@ -53,6 +53,8 @@ class PipeStreamerAdapter : public StreamerAdapter {
const std::string& app_storage_folder);
virtual ~PipeStreamer();
+ virtual void Close() {}
+
protected:
virtual bool Connect();
virtual void Disconnect();
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 45311b6077..3b647a0b83 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
@@ -55,6 +55,8 @@ class SocketStreamerAdapter : public StreamerAdapter {
const std::string& header);
virtual ~SocketStreamer();
+ virtual void Close();
+
protected:
virtual bool Connect();
virtual void Disconnect();
diff --git a/src/components/media_manager/include/media_manager/streamer_adapter.h b/src/components/media_manager/include/media_manager/streamer_adapter.h
index 30353b8d09..5ac8e05cac 100644
--- a/src/components/media_manager/include/media_manager/streamer_adapter.h
+++ b/src/components/media_manager/include/media_manager/streamer_adapter.h
@@ -72,6 +72,8 @@ class StreamerAdapter : public MediaAdapterImpl {
virtual void threadMain();
virtual void exitThreadMain();
+ virtual void Close() = 0;
+
protected:
virtual bool Connect() = 0;
virtual void Disconnect() = 0;
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 24b12cabad..9b0057dfe8 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
@@ -52,7 +52,11 @@
namespace media_manager {
using sync_primitives::AutoLock;
-const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1;
+#ifdef EXTENDED_MEDIA_MODE
+const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 50;
+#else
+const int32_t AudioStreamSenderThread::kAudioPassThruTimeout = 1000;
+#endif
const uint32_t kMqueueMessageSize = 4095;
CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
@@ -63,6 +67,7 @@ AudioStreamSenderThread::AudioStreamSenderThread(
application_manager::ApplicationManager& app_mngr)
: session_key_(session_key)
, fileName_(fileName)
+ , offset_(0)
, shouldBeStoped_(false)
, shouldBeStoped_lock_()
, shouldBeStoped_cv_()
@@ -79,7 +84,7 @@ void AudioStreamSenderThread::threadMain() {
while (false == getShouldBeStopped()) {
AutoLock auto_lock(shouldBeStoped_lock_);
- shouldBeStoped_cv_.WaitFor(auto_lock, kAudioPassThruTimeout * 1000);
+ shouldBeStoped_cv_.WaitFor(auto_lock, kAudioPassThruTimeout);
sendAudioChunkToMobile();
}
}
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 a02ec17f90..647db1e1a3 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
@@ -42,7 +42,10 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager")
FromMicRecorderListener::FromMicRecorderListener(
const std::string& file_name,
application_manager::ApplicationManager& app_mngr)
- : reader_(NULL), file_name_(file_name), application_manager_(app_mngr) {}
+ : reader_(NULL)
+ , file_name_(file_name)
+ , current_application_(0)
+ , application_manager_(app_mngr) {}
FromMicRecorderListener::~FromMicRecorderListener() {
LOG4CXX_AUTO_TRACE(logger_);
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 0239795d75..99548e71bd 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
@@ -32,6 +32,7 @@
#include "media_manager/audio/from_mic_to_file_recorder_thread.h"
#include <unistd.h>
+#include <cstring>
#include <sstream>
#include "utils/logger.h"
@@ -88,11 +89,23 @@ void FromMicToFileRecorderThread::initArgs() {
argv_[3] = new gchar[3];
argv_[4] = new gchar[durationString_.length() + 1];
- argv_[0] = const_cast<gchar*>(std::string("AudioManager").c_str());
- argv_[1] = const_cast<gchar*>(oKey_.c_str());
- argv_[2] = const_cast<gchar*>(outputFileName_.c_str());
- argv_[3] = const_cast<gchar*>(tKey_.c_str());
- argv_[4] = const_cast<gchar*>(durationString_.c_str());
+ std::strcpy(argv_[0], "AudioManager");
+ std::strcpy(argv_[1], oKey_.c_str());
+ std::strcpy(argv_[2], outputFileName_.c_str());
+ std::strcpy(argv_[3], tKey_.c_str());
+ std::strcpy(argv_[4], durationString_.c_str());
+}
+
+void FromMicToFileRecorderThread::deinitArgs() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (argv_) {
+ for (int32_t i = 0; i < argc_; i++) {
+ delete[] argv_[i];
+ }
+ delete[] argv_;
+ argv_ = NULL;
+ }
}
void FromMicToFileRecorderThread::threadMain() {
@@ -136,6 +149,13 @@ void FromMicToFileRecorderThread::threadMain() {
"length of time in seconds to capture",
"int32_t"},
{NULL}};
+ // g_option_context_parse() modifies params, so keep argc_ and argv_
+ int32_t argc = argc_;
+ gchar** argv = new gchar* [argc];
+ for (int32_t i = 0; i < argc; i++) {
+ argv[i] = argv_[i];
+ }
+
#ifndef GLIB_VERSION_2_32 // g_thread_init() does nothing since 2.32
if (!g_thread_supported()) {
g_thread_init(NULL);
@@ -145,7 +165,7 @@ void FromMicToFileRecorderThread::threadMain() {
context = g_option_context_new("-- M-AUDIO RAW");
g_option_context_add_main_entries(context, entries, NULL);
g_option_context_add_group(context, gst_init_get_option_group());
- if (!g_option_context_parse(context, &argc_, &argv_, &err)) {
+ if (!g_option_context_parse(context, &argc, &argv, &err)) {
g_error("%s\n", err->message);
}
@@ -159,7 +179,10 @@ void FromMicToFileRecorderThread::threadMain() {
LOG4CXX_TRACE(logger_, "Duration set to: " << duration);
// Initialize gstreamer and setup the main loop information
- gst_init(&argc_, &argv_);
+ gst_init(&argc, &argv);
+
+ delete[] argv;
+ argv = NULL;
pipeline = gst_pipeline_new("vga2usb-h264");
@@ -207,10 +230,7 @@ void FromMicToFileRecorderThread::threadMain() {
gst_object_unref(GST_OBJECT(pipeline));
g_option_context_free(context);
- if (argv_) {
- delete[] argv_;
- argv_ = NULL;
- }
+ deinitArgs();
return;
}
}
@@ -238,10 +258,7 @@ void FromMicToFileRecorderThread::threadMain() {
g_main_loop_unref(loop);
g_option_context_free(context);
- if (argv_) {
- delete[] argv_;
- argv_ = NULL;
- }
+ deinitArgs();
loop = NULL;
}
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index b89fc4c71f..6a9ded9029 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -96,13 +96,15 @@ void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) {
#endif // EXTENDED_MEDIA_MODE
-void MediaManagerImpl::set_mock_streamer(protocol_handler::ServiceType stype,
- MediaAdapterImpl* mock_stream) {
+void MediaManagerImpl::set_mock_streamer(
+ protocol_handler::ServiceType stype,
+ ::utils::SharedPtr<MediaAdapterImpl> mock_stream) {
streamer_[stype] = mock_stream;
}
void MediaManagerImpl::set_mock_streamer_listener(
- protocol_handler::ServiceType stype, MediaAdapterListener* mock_stream) {
+ protocol_handler::ServiceType stype,
+ ::utils::SharedPtr<MediaAdapterListener> mock_stream) {
streamer_listener_[stype] = mock_stream;
}
diff --git a/src/components/media_manager/src/socket_streamer_adapter.cc b/src/components/media_manager/src/socket_streamer_adapter.cc
index 2bb0fe10ec..60b01c901b 100644
--- a/src/components/media_manager/src/socket_streamer_adapter.cc
+++ b/src/components/media_manager/src/socket_streamer_adapter.cc
@@ -108,13 +108,21 @@ bool SocketStreamerAdapter::SocketStreamer::Connect() {
return true;
}
+void SocketStreamerAdapter::SocketStreamer::Close() {
+ Disconnect();
+}
+
void SocketStreamerAdapter::SocketStreamer::Disconnect() {
LOG4CXX_AUTO_TRACE(logger);
if (0 < send_socket_fd_) {
+ shutdown(send_socket_fd_, SHUT_RDWR);
close(send_socket_fd_);
+ send_socket_fd_ = 0;
}
if (0 < socket_fd_) {
+ shutdown(socket_fd_, SHUT_RDWR);
close(socket_fd_);
+ socket_fd_ = 0;
}
}
diff --git a/src/components/media_manager/src/streamer_adapter.cc b/src/components/media_manager/src/streamer_adapter.cc
index 20c067da1c..90a40b1add 100644
--- a/src/components/media_manager/src/streamer_adapter.cc
+++ b/src/components/media_manager/src/streamer_adapter.cc
@@ -44,9 +44,12 @@ StreamerAdapter::StreamerAdapter(Streamer* const streamer)
}
StreamerAdapter::~StreamerAdapter() {
- delete streamer_;
+ if (streamer_) {
+ streamer_->Close();
+ }
thread_->join();
threads::DeleteThread(thread_);
+ delete streamer_;
}
void StreamerAdapter::StartActivity(int32_t application_key) {
diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt
index ede6f27f95..f5d596f681 100644
--- a/src/components/media_manager/test/CMakeLists.txt
+++ b/src/components/media_manager/test/CMakeLists.txt
@@ -28,7 +28,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
@@ -46,9 +46,7 @@ if(EXTENDED_MEDIA_MODE)
)
endif()
-set(SOURCES
- ${COMPONENTS_DIR}/media_manager/test/media_manager_impl_test.cc
-)
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
set(LIBRARIES
SmartObjects
@@ -74,7 +72,3 @@ create_test("media_manager_test" "${SOURCES}" "${LIBRARIES}")
if(ENABLE_LOG)
target_link_libraries("media_manager_test" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
endif()
-
-endif()
-
-# vim: set ts=2 sw=2 et:
diff --git a/src/components/media_manager/test/include/media_manager/media_adapter_impl_mock.h b/src/components/media_manager/test/include/media_manager/media_adapter_impl_mock.h
deleted file mode 100644
index ff9c2fec9f..0000000000
--- a/src/components/media_manager/test/include/media_manager/media_adapter_impl_mock.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_MOCK_H_
-#define TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_MOCK_H_
-
-#include <gmock/gmock.h>
-#include "media_manager/media_adapter_impl.h"
-#include "media_adapter_listener_mock.h"
-#include "media_manager/media_adapter_listener.h"
-#include "media_adapter_mock.h"
-#include "utils/macro.h"
-#include "protocol_handler/protocol_handler.h"
-
-namespace test {
-namespace components {
-namespace media_manager_test {
-
-/*
- * MOCK implementation of ::media_manager::MediaAdapterImpl
- */
-using namespace media_manager;
-typedef utils::SharedPtr<MediaAdapterListener> MediaListenerPtr;
-class MockMediaAdapterImpl : public ::media_manager::MediaAdapterImpl {
- public:
- MOCK_METHOD1(AddListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
- MOCK_METHOD1(RemoveListener,
- void(const utils::SharedPtr<MediaAdapterListener>&));
- MOCK_METHOD2(SendData,
- void(int32_t application_key,
- const ::protocol_handler::RawMessagePtr message));
- MOCK_METHOD1(StartActivity, void(int32_t application_key));
- MOCK_METHOD1(StopActivity, void(int32_t application_key));
- MOCK_CONST_METHOD1(is_app_performing_activity, bool(int32_t application_key));
-};
-
-} // namespace media_manager_test
-} // namespace components
-} // namespace test
-
-#endif // TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_IMPL_MOCK_H_
diff --git a/src/components/media_manager/test/include/media_manager/media_adapter_listener_mock.h b/src/components/media_manager/test/include/media_manager/media_adapter_listener_mock.h
deleted file mode 100644
index 2ba64479b6..0000000000
--- a/src/components/media_manager/test/include/media_manager/media_adapter_listener_mock.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_LISTENER_MOCK_H_
-#define TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_LISTENER_MOCK_H_
-
-#include <gmock/gmock.h>
-#include "media_manager/media_adapter_listener.h"
-
-namespace test {
-namespace components {
-namespace media_manager_test {
-
-/*
- * MOCK implementation of ::media_manager::MediaAdapterListener
- */
-class MockMediaAdapterListener : public ::media_manager::MediaAdapterListener {
- public:
- MOCK_METHOD2(OnDataReceived,
- void(int32_t application_key, const int32_t& data));
- MOCK_METHOD1(OnActivityStarted, void(int32_t application_key));
- MOCK_METHOD1(OnActivityEnded, void(int32_t application_key));
- MOCK_METHOD2(OnErrorReceived,
- void(int32_t application_key, const int32_t& data));
-};
-
-} // namespace media_manager_test
-} // namespace components
-} // namespace test
-
-#endif // TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_LISTENER_MOCK_H_
diff --git a/src/components/media_manager/test/include/media_manager/media_adapter_mock.h b/src/components/media_manager/test/include/media_manager/media_adapter_mock.h
deleted file mode 100644
index 576a1a1a9f..0000000000
--- a/src/components/media_manager/test/include/media_manager/media_adapter_mock.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_MOCK_H_
-#define TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_MOCK_H_
-
-#include <gmock/gmock.h>
-#include "media_manager/media_manager.h"
-#include "media_manager/media_adapter.h"
-
-namespace test {
-namespace components {
-namespace media_manager_test {
-
-/*
- * MOCK implementation of ::media_manager::MediaAdapter
- */
-class MockMediaAdapter : public ::media_manager::MediaAdapter {
- public:
- MOCK_METHOD2(SendData,
- void(int32_t application_key,
- const ::protocol_handler::RawMessagePtr message));
- MOCK_METHOD1(StartActivity, void(int32_t application_key));
- MOCK_METHOD1(StopActivity, void(int32_t application_key));
- MOCK_CONST_METHOD1(is_app_performing_activity, bool(int32_t application_key));
-};
-
-} // namespace media_manager_test
-} // namespace components
-} // namespace test
-
-#endif // TEST_COMPONENTS_MEDIA_MANAGER_INCLUDE_MEDIA_MANAGER_MEDIA_ADAPTER_MOCK_H_
diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter.h
new file mode 100644
index 0000000000..908b371b26
--- /dev/null
+++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_H_
+
+#include "gmock/gmock.h"
+#include "media_manager/media_manager.h"
+#include "media_manager/media_adapter.h"
+
+namespace test {
+namespace components {
+namespace media_manager_test {
+
+/*
+ * MOCK implementation of ::media_manager::MediaAdapter
+ */
+class MockMediaAdapter : public ::media_manager::MediaAdapter {
+ public:
+ MOCK_METHOD2(SendData,
+ void(int32_t application_key,
+ const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD1(StartActivity, void(int32_t application_key));
+ MOCK_METHOD1(StopActivity, void(int32_t application_key));
+ MOCK_CONST_METHOD1(is_app_performing_activity, bool(int32_t application_key));
+};
+
+} // namespace media_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_H_
diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
new file mode 100644
index 0000000000..80b2ee3377
--- /dev/null
+++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_IMPL_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_IMPL_H_
+
+#include "gmock/gmock.h"
+#include "media_manager/media_adapter_impl.h"
+
+namespace test {
+namespace components {
+namespace media_manager_test {
+
+using namespace media_manager;
+
+class MockMediaAdapterImpl : public ::media_manager::MediaAdapterImpl {
+ public:
+ MOCK_METHOD1(AddListener,
+ void(const utils::SharedPtr<MediaAdapterListener>&));
+ MOCK_METHOD1(RemoveListener,
+ void(const utils::SharedPtr<MediaAdapterListener>&));
+ MOCK_METHOD2(SendData,
+ void(int32_t application_key,
+ const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD1(StartActivity, void(int32_t application_key));
+ MOCK_METHOD1(StopActivity, void(int32_t application_key));
+ MOCK_CONST_METHOD1(is_app_performing_activity, bool(int32_t application_key));
+};
+
+} // namespace media_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_IMPL_H_
diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter_listener.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter_listener.h
new file mode 100644
index 0000000000..f916a8af7f
--- /dev/null
+++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter_listener.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_LISTENER_H_
+#define SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_LISTENER_H_
+
+#include "gmock/gmock.h"
+#include "media_manager/media_adapter_listener.h"
+
+namespace test {
+namespace components {
+namespace media_manager_test {
+
+/*
+ * MOCK implementation of ::media_manager::MediaAdapterListener
+ */
+class MockMediaAdapterListener : public ::media_manager::MediaAdapterListener {
+ public:
+ MOCK_METHOD2(OnDataReceived,
+ void(int32_t application_key, const int32_t& data));
+ MOCK_METHOD1(OnActivityStarted, void(int32_t application_key));
+ MOCK_METHOD1(OnActivityEnded, void(int32_t application_key));
+ MOCK_METHOD2(OnErrorReceived,
+ void(int32_t application_key, const int32_t& data));
+};
+
+} // namespace media_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_MEDIA_MANAGER_TEST_INCLUDE_MEDIA_MANAGER_MOCK_MEDIA_ADAPTER_LISTENER_H_
diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc
index 8db510580c..a9dc27d7a3 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,148 +32,379 @@
#include "gmock/gmock.h"
#include "media_manager/media_manager_impl.h"
-#include "media_manager/media_adapter_mock.h"
-#include "media_manager/media_adapter_listener_mock.h"
-#include "media_manager/media_adapter_impl_mock.h"
-#include "protocol_handler/mock_protocol_handler.h"
+#include "media_manager/mock_media_adapter.h"
+#include "media_manager/mock_media_adapter_impl.h"
+#include "media_manager/mock_media_adapter_listener.h"
#include "media_manager/mock_media_manager_settings.h"
-#include "application_manager/mock_application_manager.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/state_controller.h"
+#include "application_manager/message.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "resumption/last_state.h"
+#include "application_manager/state_controller.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "protocol/common.h"
+#include "utils/make_shared.h"
+#include "utils/shared_ptr.h"
+#include "utils/file_system.h"
+#include "utils/scope_guard.h"
namespace test {
namespace components {
namespace media_manager_test {
+using namespace file_system;
+using namespace ::media_manager;
using ::testing::_;
+using ::testing::Return;
using ::testing::ReturnRef;
-using protocol_handler::ServiceType;
+using ::utils::SharedPtr;
+using ::utils::ScopeGuard;
+using ::utils::MakeGuard;
+using ::testing::NiceMock;
+using ::protocol_handler::ServiceType;
+using ::protocol_handler::RawMessagePtr;
+using application_manager::ApplicationSharedPtr;
+using application_manager::BinaryData;
+
+namespace {
+const uint16_t kVideoStreamingPort = 8901u;
+const uint16_t kAudioStreamingPort = 8000u;
+const int32_t kApplicationKey = 1;
+const int32_t kDuration = 1000;
+const std::string kStorageFolder = "test_storage_folder";
+const std::string kOutputFile = "test_output_file";
+const std::string kResourceFolder = "test_resource_folder";
+const std::string kRecordingFileSource = "test_recording_file_source";
+const std::string kNamedVideoPipePath = "named_video_pipe_path";
+const std::string kNamedAudioPipePath = "named_audio_pipe_path";
+const std::string kVideoStreamFile = "video_stream_file";
+const std::string kAudioStreamFile = "audio_stream_file";
+const std::string kServerAddress = "server_address";
+const std::string kSocketValue = "socket";
+const std::string kPipeValue = "pipe";
+const std::string kFileValue = "file";
+const std::string kDefaultValue = "";
+const std::string kOutputFilePath = kStorageFolder + "/" + kOutputFile;
+const uint32_t kProtocolVersion = ::protocol_handler::PROTOCOL_VERSION_2;
+const uint32_t kConnectionKey = 1u;
+
+void dealloc_data(uint8_t* data) {
+ delete[] data;
+}
+
+void dealloc_file(std::ofstream* test_file) {
+ delete test_file;
+}
+} // namespace
+
+typedef NiceMock<application_manager_test::MockApplication> MockApp;
+typedef SharedPtr<MockApp> MockAppPtr;
+typedef SharedPtr<MockMediaAdapterImpl> MockMediaAdapterImplPtr;
class MediaManagerImplTest : public ::testing::Test {
+ public:
+ // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
+ MediaManagerImplTest() : media_adapter_mock_(new MockMediaAdapter()) {
+ media_adapter_listener_mock_ =
+ utils::MakeShared<MockMediaAdapterListener>();
+ ON_CALL(mock_media_manager_settings_, video_server_type())
+ .WillByDefault(ReturnRef(kDefaultValue));
+ ON_CALL(mock_media_manager_settings_, audio_server_type())
+ .WillByDefault(ReturnRef(kDefaultValue));
+ mock_app_ = ::utils::MakeShared<MockApp>();
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
protected:
+ void StartMicrophoneCheckHelper() {
+ EXPECT_CALL(app_mngr_, application(kApplicationKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+#ifndef EXTENDED_MEDIA_MODE
+ EXPECT_CALL(mock_media_manager_settings_, app_resource_folder())
+ .WillOnce(ReturnRef(kResourceFolder));
+ EXPECT_CALL(mock_media_manager_settings_, recording_file_source())
+ .WillOnce(ReturnRef(kRecordingFileSource));
+#endif
+ }
+
+ void InitMediaManagerPrecondition(const std::string& server_type) {
+ EXPECT_CALL(mock_media_manager_settings_, video_server_type())
+ .WillRepeatedly(ReturnRef(server_type));
+ EXPECT_CALL(mock_media_manager_settings_, audio_server_type())
+ .WillRepeatedly(ReturnRef(server_type));
+ }
+
+ void InitMediaManagerSocketServerType() {
+ InitMediaManagerPrecondition(kSocketValue);
+ EXPECT_CALL(mock_media_manager_settings_, server_address())
+ .WillRepeatedly(ReturnRef(kServerAddress));
+ EXPECT_CALL(mock_media_manager_settings_, video_streaming_port())
+ .WillOnce(Return(kVideoStreamingPort));
+ EXPECT_CALL(mock_media_manager_settings_, audio_streaming_port())
+ .WillOnce(Return(kAudioStreamingPort));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void InitMediaManagerPipeServerType() {
+ InitMediaManagerPrecondition(kPipeValue);
+ EXPECT_CALL(mock_media_manager_settings_, named_video_pipe_path())
+ .WillOnce(ReturnRef(kNamedAudioPipePath));
+ EXPECT_CALL(mock_media_manager_settings_, named_audio_pipe_path())
+ .WillOnce(ReturnRef(kNamedAudioPipePath));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillRepeatedly(ReturnRef(kStorageFolder));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void InitMediaManagerFileServerType() {
+ InitMediaManagerPrecondition(kFileValue);
+ EXPECT_CALL(mock_media_manager_settings_, video_stream_file())
+ .WillOnce(ReturnRef(kVideoStreamFile));
+ EXPECT_CALL(mock_media_manager_settings_, audio_stream_file())
+ .WillOnce(ReturnRef(kAudioStreamFile));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillRepeatedly(ReturnRef(kStorageFolder));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void ReceivedMessage(const ServiceType service_type) {
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, service_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, WakeUpStreaming(service_type));
+ MockMediaAdapterImplPtr mock_media_streamer =
+ utils::MakeShared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(service_type, mock_media_streamer);
+ media_manager_impl_->set_mock_streamer_listener(
+ service_type, media_adapter_listener_mock_);
+ EXPECT_CALL(*mock_media_streamer, SendData(kConnectionKey, _));
+ EmulateMobileMessage(service_type);
+ }
+
+ void EmulateMobileMessage(const ServiceType serviceType) {
+ const uint32_t data_sending_size = 3u;
+ unsigned char data_sending[data_sending_size] = {0x20, 0x07, 0x01};
+ const RawMessagePtr raw_message_ptr(
+ new ::protocol_handler::RawMessage(kConnectionKey,
+ kProtocolVersion,
+ data_sending,
+ data_sending_size,
+ serviceType));
+ media_manager_impl_->OnMessageReceived(raw_message_ptr);
+ media_manager_impl_->OnMobileMessageSent(raw_message_ptr);
+ }
+
+ application_manager_test::MockApplicationManager app_mngr_;
+ MockAppPtr mock_app_;
+ SharedPtr<MockMediaAdapterListener> media_adapter_listener_mock_;
+ MockMediaAdapter* media_adapter_mock_;
const ::testing::NiceMock<MockMediaManagerSettings>
mock_media_manager_settings_;
- const std::string kDefaultValue_ = "";
+ SharedPtr<MediaManagerImpl> media_manager_impl_;
};
-TEST_F(MediaManagerImplTest, PlayA2DPSource) {
- MockMediaAdapter* media_mock_ = new MockMediaAdapter();
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithUnsupportedServiceType_Cancelled) {
+ EXPECT_CALL(app_mngr_, CanAppStream(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EmulateMobileMessage(ServiceType::kInvalidServiceType);
+}
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithAudioServiceType_ApplicationNotFound_Cancelled) {
+ const ServiceType audio_type = ServiceType::kAudio;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, audio_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EmulateMobileMessage(audio_type);
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithVideoServiceType_ApplicationNotFound_Cancelled) {
+ const ServiceType video_type = ServiceType::kMobileNav;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, video_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EmulateMobileMessage(video_type);
+}
- mediaManagerImpl.set_mock_a2dp_player(media_mock_);
- EXPECT_CALL(*media_mock_, StartActivity(application_key));
- mediaManagerImpl.PlayA2DPSource(application_key);
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithAudioServiceType_ForbidStreaming_Cancelled) {
+ const ServiceType audio_type = ServiceType::kAudio;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, audio_type))
+ .WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, ForbidStreaming(kConnectionKey));
+ EmulateMobileMessage(audio_type);
}
-TEST_F(MediaManagerImplTest, StopA2DPSource) {
- MockMediaAdapter* media_mock_ = new MockMediaAdapter();
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithVideoServiceType_ForbidStreaming_Cancelled) {
+ const ServiceType video_type = ServiceType::kMobileNav;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, video_type))
+ .WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, ForbidStreaming(kConnectionKey));
+ EmulateMobileMessage(video_type);
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest, OnMessageReceived_WithAudioServiceType_SUCCESS) {
+ ReceivedMessage(ServiceType::kAudio);
+}
- mediaManagerImpl.set_mock_a2dp_player(media_mock_);
- EXPECT_CALL(*media_mock_, StopActivity(application_key));
- mediaManagerImpl.StopA2DPSource(application_key);
+TEST_F(MediaManagerImplTest, OnMessageReceived_WithVideoServiceType_SUCCESS) {
+ ReceivedMessage(ServiceType::kMobileNav);
}
-TEST_F(MediaManagerImplTest, StopMicrophoneRecording) {
- MockMediaAdapterListener* media_adapter_listener_mock_ =
- new MockMediaAdapterListener();
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectSocketValue) {
+ InitMediaManagerSocketServerType();
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectPipeValue) {
+ InitMediaManagerPipeServerType();
+}
- mediaManagerImpl.set_mock_mic_listener(media_adapter_listener_mock_);
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectFileValue) {
+ InitMediaManagerFileServerType();
+}
+
+TEST_F(MediaManagerImplTest, PlayA2DPSource_WithCorrectA2DP_SUCCESS) {
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
+ EXPECT_CALL(*media_adapter_mock_, StartActivity(kApplicationKey));
+ media_manager_impl_->PlayA2DPSource(kApplicationKey);
+}
+
+TEST_F(MediaManagerImplTest, StopA2DPSource_WithCorrectA2DP_SUCCESS) {
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
+ EXPECT_CALL(*media_adapter_mock_, StopActivity(kApplicationKey));
+ media_manager_impl_->StopA2DPSource(kApplicationKey);
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_SourceFileIsWritable_ExpectTrue) {
+ StartMicrophoneCheckHelper();
+ if (!DirectoryExists(kStorageFolder)) {
+ CreateDirectory(kStorageFolder);
+ }
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ EXPECT_TRUE(CreateFile(kOutputFilePath));
+
+ const std::string record_file_path =
+ kResourceFolder + "/" + kRecordingFileSource;
+ if (!DirectoryExists(kResourceFolder)) {
+ CreateDirectory(kResourceFolder);
+ }
+ EXPECT_FALSE(FileExists(record_file_path));
+ EXPECT_TRUE(CreateFile(record_file_path));
+ std::ofstream* test_file = Open(record_file_path);
+ ScopeGuard file_guard = MakeGuard(dealloc_file, test_file);
+ UNUSED(file_guard);
+ EXPECT_TRUE(test_file->is_open());
+ const uint32_t data_size = 4u;
+ uint8_t* data = new uint8_t[data_size];
+ ScopeGuard data_guard = MakeGuard(dealloc_data, data);
+ UNUSED(data_guard);
+ for (uint32_t i = 0u; i < data_size; ++i) {
+ data[i] = i;
+ }
+ EXPECT_TRUE(Write(test_file, data, data_size));
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+ BinaryData result;
+ EXPECT_TRUE(ReadBinaryFile(record_file_path, result));
+ EXPECT_FALSE(result.empty());
+ for (uint32_t i = 0u; i < data_size; ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+ EXPECT_TRUE(RemoveDirectory(kResourceFolder, true));
+ EXPECT_TRUE(RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_OutputFileNotExists_ExpectFalse) {
+ StartMicrophoneCheckHelper();
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_OutputFileCouldNotDeleted_ExpectTrue) {
+ StartMicrophoneCheckHelper();
+ if (!DirectoryExists(kStorageFolder)) {
+ CreateDirectory(kStorageFolder);
+ }
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ EXPECT_TRUE(CreateFile(kOutputFilePath));
+ chmod(kOutputFilePath.c_str(), S_IRUSR);
+ EXPECT_FALSE(DeleteFile(kOutputFilePath));
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
+ EXPECT_TRUE(FileExists(kOutputFilePath));
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+ chmod(kOutputFilePath.c_str(), S_IWUSR);
+ EXPECT_TRUE(RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(MediaManagerImplTest, StopMicrophoneRecording_SUCCESS) {
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
#ifdef EXTENDED_MEDIA_MODE
MockMediaAdapterImpl* media_adapter_recorder_mock =
new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_mic_recorder(media_adapter_recorder_mock);
- EXPECT_CALL(*media_adapter_recorder_mock, StopActivity(application_key));
+ media_manager_impl_->set_mock_mic_recorder(media_adapter_recorder_mock);
+ EXPECT_CALL(*media_adapter_recorder_mock, StopActivity(kApplicationKey));
#endif // EXTENDED_MEDIA_MODE
- EXPECT_CALL(*media_adapter_listener_mock_, OnActivityEnded(application_key));
+ EXPECT_CALL(*media_adapter_listener_mock_, OnActivityEnded(kApplicationKey));
#ifdef EXTENDED_MEDIA_MODE
EXPECT_CALL(*media_adapter_recorder_mock, RemoveListener(_));
#endif // EXTENDED_MEDIA_MODE
- mediaManagerImpl.StopMicrophoneRecording(application_key);
+ media_manager_impl_->StopMicrophoneRecording(kApplicationKey);
}
-TEST_F(MediaManagerImplTest, StartStopStreaming) {
- application_manager_test::MockApplicationManager mock_application_manager;
-
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
-
- int32_t application_key = 1;
- MockMediaAdapterImpl* mock_audio_media_streamer = new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kAudio,
- mock_audio_media_streamer);
- MockMediaAdapterImpl* mock_nav_media_streamer = new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kMobileNav,
- mock_nav_media_streamer);
-
- EXPECT_CALL(*mock_audio_media_streamer, StartActivity(application_key));
- mediaManagerImpl.StartStreaming(application_key,
- protocol_handler::ServiceType::kAudio);
-
- EXPECT_CALL(*mock_nav_media_streamer, StartActivity(application_key));
- mediaManagerImpl.StartStreaming(application_key,
- protocol_handler::ServiceType::kMobileNav);
+TEST_F(MediaManagerImplTest,
+ StartStopStreaming_AudioAndVideoServiceType_SUCCESS) {
+ MockMediaAdapterImplPtr mock_audio_media_streamer =
+ utils::MakeShared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(ServiceType::kAudio,
+ mock_audio_media_streamer);
+ MockMediaAdapterImplPtr mock_nav_media_streamer =
+ utils::MakeShared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(ServiceType::kMobileNav,
+ mock_nav_media_streamer);
- EXPECT_CALL(*mock_audio_media_streamer, StopActivity(application_key));
- mediaManagerImpl.StopStreaming(application_key,
- protocol_handler::ServiceType::kAudio);
-
- EXPECT_CALL(*mock_nav_media_streamer, StopActivity(application_key));
- mediaManagerImpl.StopStreaming(application_key,
- protocol_handler::ServiceType::kMobileNav);
+ EXPECT_CALL(*mock_audio_media_streamer, StartActivity(kApplicationKey));
+ media_manager_impl_->StartStreaming(kApplicationKey, ServiceType::kAudio);
+ EXPECT_CALL(*mock_nav_media_streamer, StartActivity(kApplicationKey));
+ media_manager_impl_->StartStreaming(kApplicationKey, ServiceType::kMobileNav);
+ EXPECT_CALL(*mock_audio_media_streamer, StopActivity(kApplicationKey));
+ media_manager_impl_->StopStreaming(kApplicationKey, ServiceType::kAudio);
+ EXPECT_CALL(*mock_nav_media_streamer, StopActivity(kApplicationKey));
+ media_manager_impl_->StopStreaming(kApplicationKey, ServiceType::kMobileNav);
}
-TEST_F(MediaManagerImplTest, CheckFramesProcessed) {
- application_manager_test::MockApplicationManager mock_application_manager;
-
+TEST_F(MediaManagerImplTest,
+ CheckFramesProcessed_WithCorrectFramesNumber_SUCCESS) {
ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
+ .WillByDefault(ReturnRef(kDefaultValue));
ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
+ .WillByDefault(ReturnRef(kDefaultValue));
protocol_handler_test::MockProtocolHandler mock_protocol_handler;
- mediaManagerImpl.SetProtocolHandler(&mock_protocol_handler);
- int32_t application_key = 1;
- int32_t frame_number = 10;
-
+ media_manager_impl_->SetProtocolHandler(&mock_protocol_handler);
+ const int32_t frame_number = 10;
EXPECT_CALL(mock_protocol_handler,
- SendFramesNumber(application_key, frame_number));
- mediaManagerImpl.FramesProcessed(application_key, frame_number);
+ SendFramesNumber(kApplicationKey, frame_number));
+ media_manager_impl_->FramesProcessed(kApplicationKey, frame_number);
}
} // namespace media_manager_test
diff --git a/src/components/policy/CMakeLists.txt b/src/components/policy/CMakeLists.txt
deleted file mode 100644
index 3a2b0829dc..0000000000
--- a/src/components/policy/CMakeLists.txt
+++ /dev/null
@@ -1,110 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-set(target Policy)
-set(install_destination bin)
-set(copy_destination ${CMAKE_BINARY_DIR}/src/appMain)
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
-
-include_directories (
- ${COMPONENTS_DIR}/policy/include
- ${COMPONENTS_DIR}/rpc_base/include
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/utils/include/
- ${COMPONENTS_DIR}/config_profile/include
- ${LOG4CXX_INCLUDE_DIRECTORY}
-)
-
-set(SOURCES
- ${COMPONENTS_DIR}/policy/src/policy_manager_impl.cc
- ${COMPONENTS_DIR}/policy/src/policy_helper.cc
- ${COMPONENTS_DIR}/policy/src/policy_table.cc
- ${COMPONENTS_DIR}/policy/src/sql_pt_queries.cc
- ${COMPONENTS_DIR}/policy/src/sql_pt_representation.cc
- ${COMPONENTS_DIR}/policy/src/update_status_manager.cc
- ${COMPONENTS_DIR}/policy/src/cache_manager.cc
- ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
-)
-
-# --- Table struct section
-set(policy_struct_target policy_struct)
-set(POLICY_TABLE_SOURCES
- ${COMPONENTS_DIR}/policy/src/policy_table/enums.cc
- ${COMPONENTS_DIR}/policy/src/policy_table/types.cc
- ${COMPONENTS_DIR}/policy/src/policy_table/validation.cc
-)
-
-add_library(${policy_struct_target} ${POLICY_TABLE_SOURCES})
-target_link_libraries(${policy_struct_target} Utils)
-# --- end of Table struct section
-
-# --- Usage statistics section
-set(USAGE_STATISTICS_SOURCES
- ${COMPONENTS_DIR}/policy/src/usage_statistics/counter.cc
-)
-add_library(UsageStatistics ${USAGE_STATISTICS_SOURCES})
-# --- end of Usage statistics section
-
-set(LIBRARIES ConfigProfile policy_struct dbms jsoncpp Utils)
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- # --- QDB Wrapper
- include_directories (${COMPONENTS_DIR}/utils/include/utils)
-else ()
- # --- SQLite Wrapper
- include_directories (${COMPONENTS_DIR}/utils/include/utils)
- list(APPEND LIBRARIES sqlite3)
-endif ()
-
-add_library(${target} SHARED ${SOURCES})
-target_link_libraries(${target} ${LIBRARIES} )
-
-if(ENABLE_LOG)
- target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
-endif()
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-
-if(BUILD_TESTS)
- add_subdirectory(test)
-endif() # BUILD_TESTS
diff --git a/src/components/policy/doc/grc/conf.smartDeviceLinkCore b/src/components/policy/doc/grc/conf.smartDeviceLinkCore
deleted file mode 100644
index 11c7643c68..0000000000
--- a/src/components/policy/doc/grc/conf.smartDeviceLinkCore
+++ /dev/null
@@ -1,34 +0,0 @@
-# source filename
-regexp=\w+\.(?:cpp|h)
-colours=yellow
-===
-regexp=^(ERROR|FATAL)
-colours=red on_yellow
-===
-regexp=^WARN
-colours=red
-===
-regexp=^INFO
-colours=blue
-===
-regexp=^TRACE
-colours=magenta
-===
-# component
-regexp=(?<=\])\[[^]]+\]
-colours=cyan
-===
-# something invalid
-regexp=(?i)invalid
-colours=red
-===
-# RPC message start
-regexp=^\{$
-colours=bold
-count=block
-===
-# RPC message end
-regexp=^\}$
-colours=bold
-count=unblock
-
diff --git a/src/components/policy/doc/install.txt b/src/components/policy/doc/install.txt
deleted file mode 100644
index 8076f427bc..0000000000
--- a/src/components/policy/doc/install.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-* Introduction
- ================
- smartDeviceLinkCore is an application which manages the transport, connection and communication between a head unit and mobile device.
-
-* OS and Hardware
- =========
- Ubuntu 12.04.01 LTS 32-bit OS on the PC with USB-dongle
- Application has been tested using 2 types of USB-dongle:
- D-Link DBT-122
- STLab B-121mini
-
-* External components
- ===================
- For build application we need:
- libbluetooth3, the BlueZ library
- libbluetooth-dev, the development files to link to the BluetZ library.
- Install libraries:
- sudo apt-get install libbluetooth3
- sudo apt-get install libbluetooth-dev
-
- We are using cmake to create build configurations.
- Install cmake:
- sudo apt-get install cmake
-
- Also, make sure the g++ compiler is installed:
- sudo apt-get install g++
-
- To start web-based HMI we need web-browser with web-socket RFC6455 support.
- For example Google Chromium. Install it using:
- sudo apt-get install chromium-browser
-
- To run InterfaceGenerator some python libraries are required and must be
- installed with following command:
- sudo pip install -r tools/InterfaceGenerator/requirements.txt
-
- For logging Apache log4cxx library is used. Install required packages with the following command:
- sudo apt-get install liblog4cxx10 liblog4cxx10-dev
-
- For installing pulseaudio development files which neededfor audio management fetures run:
- sudo apt-get install libpulse-dev
-
- For installing gstreamer development files which needed for audio management fetures:
- First add gstreamer repositories to your apt source list (/etc/apt/sources.list):
- deb http://ppa.launchpad.net/gstreamer-developers/ppa/ubuntu <distributive codename> main
- deb-src http://ppa.launchpad.net/gstreamer-developers/ppa/ubuntu <distributive codename> main
- use code name relevant to the Ubuntu version which you use instead of <distributive codename>.
- Run:
- sudo apt-get update
- and:
- sudo apt-get install gstreamer1.0*
-
-* Build application
- =================
- We support "out of sources" concept for build from R3.0.0
- It means all generated by build tools files will be stored in separate folder.
- Temporary build of application requires two steps.
- 1. Enter src/thirdPartyLibs/logger
- build logger:
-
- 1. Create directory outside of SmartDeviceLink project directory.
- For example "build" folder in the same folder with SmartDeviceLink git repo folder which has a name "git_repo":
- You will have folders structure like this:
- /home/projects/smart_device_link
- |--build
- |--git_repo
- |--doc
- |--src
- |--test
- |--DoxyFile
- \--CMakeLists.txt
- Enter this folder:
- cd build
-
- 2. Create build configuration using cmake:
- 2.1 For Debug configuration
- cmake ../git_repo
- 2.2 For Release configuration, run:
- cmake -DCMAKE_BUILD_TYPE=Release ../git_repo
- 2.3 For Debug configuration with tests, run:
- cmake -DBUILD_TESTS=On ../git_repo
-
- 3. Make project:
- make
-
- Ready to use release application will be in build/src/appMain/smartDeviceLinkCore
-
- 4. If You built configuration with tests (see 2.3 above), then You can run all project tests and see overall result with:
- make test
-
- 5. For creating the doxygen documentation run:
- make doxygen
diff --git a/src/components/policy/doc/readme.txt b/src/components/policy/doc/readme.txt
deleted file mode 100644
index f80aed0ffd..0000000000
--- a/src/components/policy/doc/readme.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-* Introduction
- ================
- smartDeviceCore is an application which manages the transport, connection and communication between a head unit and mobile device.
-
-* OS and Hardware
- =========
- Ubuntu 12.04.1 LTS 32-bit OS on the PC with USB-dongle
- Application has been tested using 2 types of USB-dongle:
- D-Link DBT-122
- STLab B-121mini
-
- * External components
- ===================
- For start application we need:
- libbluetooth3, the BlueZ library
- Install library:
- sudo apt-get install libbluetooth3
- To start web-based HMI we need web-browser with web-socket RFC6455 support.
- 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 set path to hmi in config file
- For example:
- LinkToWebHMI = ${path_to_HMI_repository}/index.html
-
-* Running application
- ====================
- Plug USB-dongle in.
- Switch Bluetooth on a mobile device ON and make the device discoverable.
- Pair mobile device with PC using Ubuntu tools.
- Device should contain SmartDeviceLink compatible application installed.
- Start application with command:
- ./smartDeviceLinkCore
- Application starts to search devices and starts HMI in cromium-browser.
- In case HMI has not been started please start web-based HMI manually in browser opening src/components/HMI/index.html.
- SmartDeviceLinkCore is searching Bluetooth devices with a correspondibg service.
- Go to info menu in HMI and press App button.
- Press change Devices button.
- Select the device from a list.
- Application opens all available ports on devices and starts communication.
- Returning to the App menu all applications will be shown in a list.
-
-* Colorized logs
- ==============
- You can have colorized log output of smartDeviceLinkCore's messages in the terminal with the help of grc:
-
- 1. Make sure grc is installed:
- sudo apt-get install grc
-
- 2. Copy the config files from the grc/ directory into ~/.grc/ directory:
- mkdir ~/.grc
- cp grc/* ~/.grc/
-
- 3. Add an alias to your shell's config (usually, ~/.bashrc or ~/.zshrc):
- alias grca='grc -es --colour=auto'
-
- Either restart the shell session or source the edited file:
- source ~/.bashrc
- or
- source ~/.zshrc
-
- 4. Start the smartDeviceLink core with the following command:
- grca ./smartDeviceLinkCore
-
- 5. PROFIT
-
diff --git a/src/components/policy/include/policy/cache_manager.h b/src/components/policy/include/policy/cache_manager.h
deleted file mode 100644
index 3a46d395f3..0000000000
--- a/src/components/policy/include/policy/cache_manager.h
+++ /dev/null
@@ -1,768 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_INCLUDE_CACHE_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_CACHE_MANAGER_H_
-
-#include <map>
-
-#include "utils/shared_ptr.h"
-#include "policy/pt_representation.h"
-#include "policy/pt_ext_representation.h"
-#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/cache_manager_interface.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
-
-#include "utils/lock.h"
-#include "utils/conditional_variable.h"
-#include "policy/policy_types.h"
-
-namespace policy {
-class PolicySettings;
-
-class CacheManager : public CacheManagerInterface {
- public:
- CacheManager();
- ~CacheManager();
-
- /**
- * @brief Check if specified RPC for specified application
- * has permission to be executed in specified HMI Level
- * and also its permitted params.
- * @param app_id Id of application provided during registration
- * @param hmi_level Current HMI Level of application
- * @param rpc Name of RPC
- * @return CheckPermissionResult containing flag if HMI Level is allowed
- * and list of allowed params.
- */
- virtual void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result);
-
- /**
- * @brief Returns true if Policy Table was not updated yet
- * from preloaded pt file.
- */
- virtual bool IsPTPreloaded();
-
- /**
- * Gets number of ignition cycles before next update policy table
- * @return number of ignition cycles
- */
- virtual int IgnitionCyclesBeforeExchange();
-
- /**
- * Gets value in kilometers before next update policy table
- * @param current value in kilometers from the odometers
- * @return value in kilometers
- */
- virtual int KilometersBeforeExchange(int current);
-
- /**
- * @brief Sets counter value that passed for recieved successful PT UPdate
- */
- virtual bool SetCountersPassedForSuccessfulUpdate(Counters counter,
- int value);
-
- /**
- * Gets value in days before next update policy table
- * @param current value in days after epoch
- * @return value in days
- */
- virtual int DaysBeforeExchange(int current);
-
- /**
- * @brief Increment number of ignition cycles since last exchange by 1
- */
- virtual void IncrementIgnitionCycles();
-
- /**
- * @brief Reset number of ignition cycles since last exchange to 0
- */
- virtual void ResetIgnitionCycles();
-
- /**
- * @brief Returns timeout to wait for a response of PT update
- * @return value in seconds
- */
- virtual int TimeoutResponse();
-
- /**
- * @brief Returns number of seconds between each try of sending PTS
- * @param seconds Return value: array of 5 elements
- * @return bool Success of operation
- */
- virtual bool SecondsBetweenRetries(std::vector<int>& seconds);
-
- /**
- * @brief Get information about vehicle
- */
- virtual const VehicleInfo GetVehicleInfo() const;
-
- /**
- * @brief Allows to update 'vin' field in module_meta table.
- *
- * @param new 'vin' value.
- *
- * @return true in case when data has been successfully updated,
- * false otherwise.
- */
- bool SetVINValue(const std::string& value);
-
- /**
- * @brief Get message text for displaying/pronouncing for user
- * dependent on language and context.
- * @param msg_codes Context of message (Driver distraction, Grant permission
- * etc)
- * @param language Language of the message
- * @return Array of appropriate messages parameters
- */
- std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language);
-
- /**
- * @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 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
- * depending on application priority.
- * @param priority Priority of application
- */
- virtual rpc::policy_table_interface_base::NumberOfNotificationsType
- GetNotificationsNumber(const std::string& priority);
-
- /**
- * @brief Get priority for given application
- * @param policy_app_id Unique application id
- * @param priority Priority for application or empty, if value was not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string& priority) const OVERRIDE;
-
- /**
- * @brief Initialized Policy Table (load)
- * @return bool Success of operation
- */
- bool Init(const std::string& file_name, const PolicySettings* settings);
-
- /**
- * @brief Get snapshot of Policy Table
- * including app_policies, functional_groups,
- * device_info, statistics, excluding user messages
- * @return Generated structure for obtaining Json string.
- */
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
-
- /**
- * Applies policy table to the current table
- * @param update_pt policy table
- * @return true if successfully
- */
- 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
- */
- bool UpdateRequired() const;
-
- /**
- * @brief Saves flag updateRequired
- * @param status update status if true then update required.
- */
- void SaveUpdateRequired(bool status);
-
- /**
- * @brief GetInitialAppData Retrieves data from app_policies
- * about app on its registration
- * @param app_id id of registered app.
- * All outputs are filled in only if not null
- * @param nicknames Synonyms for application
- * @param app_hmi_types app_types Section on HMI where app can
- * appear (Navigation, Phone etc)
- * @return true in case initial application data was obtained successfuly.
- */
- bool GetInitialAppData(const std::string& app_id,
- StringArray& nicknames,
- StringArray& app_hmi_types);
-
- /**
- * Checks if the application is revoked
- * @param app_id application id
- * @return true if application is revoked
- */
- bool IsApplicationRevoked(const std::string& app_id) const;
-
- /**
- * @brief Get functional groupings from DB
- * @param groups Known functional groupings
- * @return true, if succeeded, otherwise - false
- */
- bool GetFunctionalGroupings(policy_table::FunctionalGroupings& groups);
-
- /**
- * Checks if the application is represented in policy table
- * @param app_id application id
- * @return true if application is represented in policy table
- */
- bool IsApplicationRepresented(const std::string& app_id) const;
-
- /**
- * Checks if the application has default policy
- * @param app_id application id
- * @return true if application has default policy
- */
- bool IsDefaultPolicy(const std::string& app_id);
-
- /**
- * @brief SetIsDefault Sets is_default flag for application
- * @param app_id app specific application
- * @return true in case opperation was done successfully.
- */
- bool SetIsDefault(const std::string& app_id);
-
- /**
- * Checks if the application has pre_data policy
- * @param app_id application id
- * @return true if application has pre_data policy
- */
- bool IsPredataPolicy(const std::string& app_id);
-
- /**
- * Sets default policy for application
- * @param app_id application id
- * @return true if success
- */
- bool SetDefaultPolicy(const std::string& app_id);
-
- /**
- * @brief Is application allowed to send notifications while in
- * Backgound or limited mode.
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
-
- /**
- * @brief Is application allowed to move foreground at will?
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- bool CanAppStealFocus(const std::string& app_id) const;
-
- /**
- * @brief Gets default_hmi for given application
- * @param policy_app_id Unique application id
- * @param default_hmi Default HMI level for application or empty, if value was
- * not set
- * @return true, if succedeed, otherwise - false
- */
- bool GetDefaultHMI(const std::string& app_id, std::string& default_hmi) const;
-
- /**
- * @brief Reset user consent for device data and applications permissions
- * @return
- */
- bool ResetUserConsent();
-
- /**
- * @brief Get user permissions for device data usage
- * @param device_id Generated or obtained id of device
- * @param consented_groups Groups consented by user
- * @param disallowed_groups Groups not consented by user
- * @return true, if query was successfull, otherwise - false
- */
- bool GetUserPermissionsForDevice(const std::string& device_id,
- StringArray& consented_groups,
- StringArray& disallowed_groups) const;
-
- /**
- * @brief Gets list of groups permissions from policy table
- * @param device_id Unique device id, which hosts specific application
- * @param policy_app_id Unique application id
- * @param group_types Group list sorted by permission status
- * @return true, if query was successfull, otherwise - false
- */
- bool GetPermissionsForApp(const std::string& device_id,
- const std::string& app_id,
- FunctionalIdType& group_types);
-
- /**
- * @brief Get device groups and preconsented groups from policies section
- * @param groups List of groups to be consented for device usage
- * @param preconsented_groups List of preconsented groups for device usage
- * @return true, if query was successful, otherwise - false
- */
- bool GetDeviceGroupsFromPolicies(
- rpc::policy_table_interface_base::Strings& groups,
- rpc::policy_table_interface_base::Strings& preconsented_groups) const;
-
- /**
- * @brief Add's information about mobile device in Policy Table.
- * @param device_id Generated or obtained id of device
- * @param connection_type device connection type
- * @return bool Success of operation
- */
- bool AddDevice(const std::string& device_id,
- const std::string& connection_type);
-
- /**
- * @brief Record information about mobile device in Policy Table.
- * @param device_id Generated or obtained id of device
- * @return bool Success of operation
- */
- bool SetDeviceData(const std::string& device_id,
- const std::string& hardware = "",
- const std::string& firmware = "",
- const std::string& os = "",
- const std::string& os_version = "",
- const std::string& carrier = "",
- const uint32_t number_of_ports = 0,
- const std::string& connection_type = "");
-
- /**
- * @brief Sets user consent for particular mobile device,
- * i.e. to use device for exchanging of Policy Table.
- * @return bool Success of operation
- */
- bool SetUserPermissionsForDevice(
- const std::string& device_id,
- const StringArray& consented_groups = StringArray(),
- const StringArray& disallowed_groups = StringArray());
-
- /**
- * @brief Update Application Policies as reaction
- * on User allowing/disallowing device this app is running on.
- */
- bool ReactOnUserDevConsentForApp(const std::string& app_id,
- bool is_device_allowed);
-
- /**
- * @brief Set user consent on functional groups
- * @param permissions User consent on functional group
- * @return true, if operation succedeed, otherwise - false
- */
- bool SetUserPermissionsForApp(const PermissionConsent& permissions);
-
- /**
- * @brief Records information about head unit system to PT
- * @return bool Success of operation
- */
- bool SetMetaInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
-
- /**
- * @brief Checks, if specific head unit is present in PT
- * @return boot Suceess, if present, otherwise - false
- */
- bool IsMetaInfoPresent() const;
-
- /**
- * @brief Set current system language
- * @param language System language
- * @return true, if succedeed, otherwise - false
- */
- bool SetSystemLanguage(const std::string& language);
-
- /**
- * Increments global counter
- * @param type type of counter
- */
- void Increment(usage_statistics::GlobalCounterId type);
-
- /**
- * Increments counter of application
- * @param app_id id application
- * @param type type of counter
- */
- void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type);
-
- /**
- * Sets value of application information
- * @param app_id id application
- * @param type type of information
- * @param value value of information
- */
- void Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value);
-
- /**
- * Adds value to stopwatch of application
- * @param app_id id application
- * @param type type of stopwatch
- * @param seconds value for adding in seconds
- */
- void Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int seconds);
-
- /**
- * @brief CountUnconsentedGroups allows to obtain the count of unconsented
- * groups for specific application.
- * @param policy_app_id application id.
- * @param device_id device id.
- * @return the count of unconsented groups
- */
- int CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id);
-
- /**
- * @brief Gets functional group names and user_consent_prompts, if any
- * @param Array to be filled with group ids, names and functional prompts
- * @return true, if succeeded, otherwise - false
- */
- bool GetFunctionalGroupNames(FunctionalGroupNames& names);
-
- /**
- * @brief GetAllAppGroups allows to obtain all groups for certain application.
- * @param app_id specific application id.
- * @param all_group_ids parameter to fill.
- */
- void GetAllAppGroups(const std::string& app_id,
- FunctionalGroupIDs& all_group_ids);
- /**
- * @brief GetPreConsentedGroups allows to obtain all pre-consented groups for
- * specific application.
- * @param app_id specific application id.
- * @param preconsented_groups parameter to fill.
- */
- void GetPreConsentedGroups(const std::string& app_id,
- FunctionalGroupIDs& preconsented_groups);
- /**
- * @brief GetConsentedGroups allows to obtain list of allowed and disallowed
- * groups for specific application on certain device.
- * @param device_id certain device
- * @param app_id application id.
- * @param allowed_groups list of allowed groups
- * @param disallowed_groups list of disallowed groups
- */
- void GetConsentedGroups(const std::string& device_id,
- const std::string& app_id,
- FunctionalGroupIDs& allowed_groups,
- FunctionalGroupIDs& disallowed_groups);
-
- /**
- * @brief GetUnconsentedGroups allows to obtain list of allowed and disallowed
- * groups for specific application on certain device.
- * @param device_id certain device
- * @param policy_app_id application id.
- * @param unconsented_groups list of unconsented groups.
- */
- void GetUnconsentedGroups(const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalGroupIDs& unconsented_groups);
-
- void RemoveAppConsentForGroup(const std::string& app_id,
- const std::string& group_name);
-
- /**
- * @brief Set app policy to pre_DataConsented policy
- * @param app_id Policy ID of application to be changed
- * @return true, if succeeded, otherwise - false
- */
- bool SetPredataPolicy(const std::string& app_id);
-
- /**
- * @brief Removes unpaired devices
- * @return true if success
- */
- bool CleanupUnpairedDevices();
-
- /**
- * Sets flag of unpaired device
- * @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, bool unpaired = true);
-
- /**
- * Resets Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
- */
- bool ResetPT(const std::string& file_name);
-
- /**
- * @brief LoadFromBackup allows to load policy into the cache from backup.
- * @return true in case operation was successful.
- */
- bool LoadFromBackup();
-
- /**
- * @brief LoadFromFile allows to load policy cache from preloaded table.
- * @param file_name preloaded
- * @return
- */
- bool LoadFromFile(const std::string& file_name, policy_table::Table& table);
-
- /**
- * @brief Backup allows to save cache onto hard drive.
- */
- void Backup();
-
- /**
- * Returns heart beat timeout
- * @param app_id application id
- * @return if timeout was set then value in milliseconds greater zero
- * otherwise heart beat for specific application isn't set
- */
- uint32_t HeartBeatTimeout(const std::string& app_id) const;
-
- /**
- * @brief Allows to generate hash from the specified string.
- * The djb2 algorithm uses for hash generation.
- * @param str_to_hash - the string from which hash should be generated.
- * @return integer hash for the specified string.
- */
- 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;
-
- /**
- * @brief GetCertificate allows to obtain certificate in order to
- * make secure connection
- *
- * @return The certificate in PKCS#7.
- */
- virtual std::string GetCertificate() const OVERRIDE;
-
- /**
- * @brief MergePreloadPT allows to load policy table from certain JSON file,
- * and then decide if merge is needed. The merge is needed in case when
- *preload
- * JSON date is different than current database.
- *
- * @param file_name the preloaded policy table JSON file.
- */
- void MergePreloadPT(const std::string& file_name);
-
- /**
- * @brief MergeMC allows to merge ModuleConfig section by definite rules.
- *
- * The rules are:
- * 1. Add new fields (known to PoliciesManager) & sub-sections if such are
- * present in the updated Preloaded PT
- * 2. "vehicle_make", “model”, “year” – leave the fields & values as they were
- * in the database
- * 3. For all other fields – overwrite the values with the new ones from
- *preloaded PT.
- *
- * @param new_pt the policy table loaded from updated preload JSON file.
- *
- * @param pt the exists database.
- */
- void MergeMC(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt);
-
- /**
- * @brief MergeFG allows to merge FunctionalGroupings sections by definite
- *rules.
- *
- * The rules are:
- * 1. If functional_group_name exists in both database (LocalPT) and updated
- * PreloadedPT -> PoliciesManager must overwrite it (that is, replace such
- * functional_group_name in the database by the one from Pre-PT).
- * 2. If functional_group_name exists in updated PreloadedPT and does not
- * exist in database (LocalPT), PoliciesManager must add such group to the
- *database.
- * 3. If functional_group_name does not exist in updated PreloadedPT and
- * exists in the database (LocalPT), PoliciesManager must leave such group in
- * the database without changes.
- *
- * @param new_pt the policy table loaded from updated preload JSON file.
- *
- * @param pt the exists database.
- */
- void MergeFG(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt);
-
- /**
- * @brief MergeAP Allows to merge ApplicationPolicies section by definite
- *relues.
- * The rules are:
- * 1. Leave “<appID>” sub-sections as they were in the database (fields &
- *their values).
- * 2. Over-write "default", "device", "pre_DataConsent" subsections.
- *
- * @param new_pt the policy table loaded from updated preload JSON file.
- *
- * @param pt the exists database.
- */
- void MergeAP(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt);
-
- /**
- * @brief MergeCFM allows to merge ConsumerFriendlyMessages section by
- *definite rules.
- *
- * The rules are:
- * 1. If friendly_message_name exists in both database (LocalPT) and updated
- * Preloaded PT -> PoliciesManager must overwrite it.
- * 2. If friendly_message_name exists in updated Preloaded PT and does not
- * exist in database (LocalPT), PoliciesManager must add such
- * friendly_message_name to the database (LocalPT).
- * 3. If friendly_message_name does not exist in updated Preloaded PT and
- * exists in the database (LocalPT), PoliciesManager must leave such
- * friendly_message_name in the database without changes.
- *
- * @param new_pt the policy table loaded from updated preload JSON file.
- *
- * @param pt the exists database
- */
- void MergeCFM(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt);
-
- const PolicySettings& get_settings() const;
-
-#ifdef BUILD_TESTS
- utils::SharedPtr<policy_table::Table> GetPT() const {
- return pt_;
- }
-#endif
-
- private:
- std::string currentDateTime();
- struct AppHMITypeToString {
- std::string operator()(rpc::Enum<policy_table::AppHMIType> value) {
- return std::string(policy_table::EnumToJsonString(value));
- }
- };
-
- void GetGroupNameByHashID(const int32_t group_id, std::string& group_name);
- void FillDeviceSpecificData();
- bool AppExists(const std::string& app_id) const;
- long ConvertSecondsToMinute(int seconds);
-
- /**
- * @brief Checks snapshot initialization and initializes to default values, if
- * necessary
- */
- 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_;
- bool update_required;
- 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_;
- const PolicySettings* settings_;
-};
-} // namespace policy
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_CACHE_MANAGER_H_
diff --git a/src/components/policy/include/policy/cache_manager_interface.h b/src/components/policy/include/policy/cache_manager_interface.h
deleted file mode 100644
index 2b8a9fa101..0000000000
--- a/src/components/policy/include/policy/cache_manager_interface.h
+++ /dev/null
@@ -1,631 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
-#define SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
-
-#include <string>
-#include <vector>
-
-#include "utils/shared_ptr.h"
-#include "policy/usage_statistics/counter.h"
-#include "policy/policy_types.h"
-#include "policy/policy_settings.h"
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-namespace policy {
-
-class CacheManagerInterface {
- public:
- virtual ~CacheManagerInterface() {}
-
- /**
- * @brief Check if specified RPC for specified application
- * has permission to be executed in specified HMI Level
- * and also its permitted params.
- * @param app_id Id of application provided during registration
- * @param hmi_level Current HMI Level of application
- * @param rpc Name of RPC
- * @return CheckPermissionResult containing flag if HMI Level is allowed
- * and list of allowed params.
- */
- virtual void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result) = 0;
-
- /**
- * @brief Returns true if Policy Table was not updated yet
- * from preloaded pt file.
- */
- virtual bool IsPTPreloaded() = 0;
-
- /**
- * Gets number of ignition cycles before next update policy table
- * @return number of ignition cycles
- */
- virtual int IgnitionCyclesBeforeExchange() = 0;
-
- /**
- * Gets value in kilometers before next update policy table
- * @param current value in kilometers from the odometers
- * @return value in kilometers
- */
- virtual int KilometersBeforeExchange(int current) = 0;
-
- /**
- * @brief Sets counter value that passed for recieved successful PT UPdate
- */
- virtual bool SetCountersPassedForSuccessfulUpdate(Counters counter,
- int value) = 0;
-
- /**
- * Gets value in days before next update policy table
- * @param current value in days after epoch
- * @return value in days
- */
- virtual int DaysBeforeExchange(int current) = 0;
-
- /**
- * @brief Increment number of ignition cycles since last exchange by 1
- */
- virtual void IncrementIgnitionCycles() = 0;
-
- /**
- * @brief Reset number of ignition cycles since last exchange to 0
- */
- virtual void ResetIgnitionCycles() = 0;
-
- /**
- * @brief Returns timeout to wait for a response of PT update
- * @return value in seconds
- */
- virtual int TimeoutResponse() = 0;
-
- /**
- * @brief Returns number of seconds between each try of sending PTS
- * @param seconds Return value: array of 5 elements
- * @return bool Success of operation
- */
- virtual bool SecondsBetweenRetries(std::vector<int>& seconds) = 0;
-
- /**
- * @brief Get information about vehicle
- */
- virtual const VehicleInfo GetVehicleInfo() const = 0;
-
- /**
- * @brief Allows to update 'vin' field in module_meta table.
- *
- * @param new 'vin' value.
- *
- * @return true in case when data has been successfully updated,
- * false otherwise.
- */
- virtual bool SetVINValue(const std::string& value) = 0;
-
- /**
- * @brief Get message text for displaying/pronouncing for user
- * dependent on language and context.
- * @param msg_codes Context of message (Driver distraction, Grant permission
- * etc)
- * @param language Language of the message
- * @return Array of appropriate messages parameters
- */
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes,
- const std::string& language) = 0;
-
- /**
- * @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 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
- * depending on application priority.
- * @param priority Priority of application
- */
- virtual policy_table::NumberOfNotificationsType GetNotificationsNumber(
- const std::string& priority) = 0;
-
- /**
- * @brief Get priority for given application
- * @param policy_app_id Unique application id
- * @param priority Priority for application or empty, if value was not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string& priority) const = 0;
-
- /**
- * @brief Initialized Policy Table (load)
- * @return bool Success of operation
- */
- virtual bool Init(const std::string& file_name,
- const PolicySettings* settings) = 0;
-
- /**
- * @brief Get snapshot of Policy Table
- * including app_policies, functional_groups,
- * device_info, statistics, excluding user messages
- * @return Generated structure for obtaining Json string.
- */
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
-
- /**
- * Applies policy table to the current table
- * @param update_pt policy table
- * @return true if successfully
- */
- 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
- */
- virtual bool UpdateRequired() const = 0;
-
- /**
- * @brief Saves flag updateRequired
- * @param status update status if true then update required.
- */
- virtual void SaveUpdateRequired(bool status) = 0;
-
- /**
- * @brief GetInitialAppData Retrieves data from app_policies
- * about app on its registration
- * @param app_id id of registered app.
- * All outputs are filled in only if not null
- * @param nicknames Synonyms for application
- * @param app_hmi_types app_types Section on HMI where app can
- * appear (Navigation, Phone etc)
- * @return true in case initial application data was obtained successfuly.
- */
- virtual bool GetInitialAppData(const std::string& app_id,
- StringArray& nicknames,
- StringArray& app_hmi_types) = 0;
-
- /**
- * Checks if the application is revoked
- * @param app_id application id
- * @return true if application is revoked
- */
- virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
-
- /**
- * @brief Get functional groupings from DB
- * @param groups Known functional groupings
- * @return true, if succeeded, otherwise - false
- */
- virtual bool GetFunctionalGroupings(
- policy_table::FunctionalGroupings& groups) = 0;
-
- /**
- * Checks if the application is represented in policy table
- * @param app_id application id
- * @return true if application is represented in policy table
- */
- virtual bool IsApplicationRepresented(const std::string& app_id) const = 0;
-
- /**
- * Checks if the application has default policy
- * @param app_id application id
- * @return true if application has default policy
- */
- virtual bool IsDefaultPolicy(const std::string& app_id) = 0;
-
- /**
- * @brief SetIsDefault Sets is_default flag for application
- * @param app_id app specific application
- * @return true in case opperation was done successfully.
- */
- virtual bool SetIsDefault(const std::string& app_id) = 0;
-
- /**
- * Checks if the application has pre_data policy
- * @param app_id application id
- * @return true if application has pre_data policy
- */
- virtual bool IsPredataPolicy(const std::string& app_id) = 0;
-
- /**
- * Sets default policy for application
- * @param app_id application id
- * @return true if success
- */
- virtual bool SetDefaultPolicy(const std::string& app_id) = 0;
-
- /**
- * @brief Is application allowed to send notifications while in
- * Backgound or limited mode.
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
-
- /**
- * @brief Is application allowed to move foreground at will?
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
-
- /**
- * @brief Get default_hmi for given application
- * @param policy_app_id Unique application id
- * @param default_hmi Default HMI level for application or empty, if value was
- * not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetDefaultHMI(const std::string& app_id,
- std::string& default_hmi) const = 0;
-
- /**
- * @brief Reset user consent for device data and applications permissions
- * @return
- */
- virtual bool ResetUserConsent() = 0;
-
- /**
- * @brief Get user permissions for device data usage
- * @param device_id Generated or obtained id of device
- * @param consented_groups Groups consented by user
- * @param disallowed_groups Groups not consented by user
- * @return true, if query was successfull, otherwise - false
- */
- virtual bool GetUserPermissionsForDevice(
- const std::string& device_id,
- StringArray& consented_groups,
- StringArray& disallowed_groups) const = 0;
-
- /**
- * @brief Gets list of groups permissions from policy table
- * @param device_id Unique device id, which hosts specific application
- * @param policy_app_id Unique application id
- * @param group_types Group list sorted by permission status
- * @return true, if query was successfull, otherwise - false
- */
- virtual bool GetPermissionsForApp(const std::string& device_id,
- const std::string& app_id,
- FunctionalIdType& group_types) = 0;
-
- /**
- * @brief Get device groups and preconsented groups from policies section
- * @param groups List of groups to be consented for device usage
- * @param preconsented_groups List of preconsented groups for device usage
- * @return true, if query was successful, otherwise - false
- */
- virtual bool GetDeviceGroupsFromPolicies(
- rpc::policy_table_interface_base::Strings& groups,
- rpc::policy_table_interface_base::Strings& preconsented_groups) const = 0;
-
- /**
- * @brief Add's information about mobile device in Policy Table.
- * @param device_id Generated or obtained id of device
- * @param connection_type device connection type
- * @return bool Success of operation
- */
- virtual bool AddDevice(const std::string& device_id,
- const std::string& connection_type) = 0;
-
- /**
- * @brief Record information about mobile device in Policy Table.
- * @param device_id Generated or obtained id of device
- * @return bool Success of operation
- */
- virtual bool SetDeviceData(const std::string& device_id,
- const std::string& hardware,
- const std::string& firmware,
- const std::string& os,
- const std::string& os_version,
- const std::string& carrier,
- const uint32_t number_of_ports,
- const std::string& connection_type) = 0;
-
- /**
- * @brief Sets user consent for particular mobile device,
- * i.e. to use device for exchanging of Policy Table.
- * @return bool Success of operation
- */
- virtual bool SetUserPermissionsForDevice(
- const std::string& device_id,
- const StringArray& consented_groups,
- const StringArray& disallowed_groups) = 0;
-
- /**
- * @brief Update Application Policies as reaction
- * on User allowing/disallowing device this app is running on.
- */
- virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
- bool is_device_allowed) = 0;
-
- /**
- * @brief Set user consent on functional groups
- * @param permissions User consent on functional group
- * @return true, if operation succedeed, otherwise - false
- */
- virtual bool SetUserPermissionsForApp(
- const PermissionConsent& permissions) = 0;
-
- /**
- * @brief Records information about head unit system to PT
- * @return bool Success of operation
- */
- virtual bool SetMetaInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language) = 0;
-
- /**
- * @brief Checks, if specific head unit is present in PT
- * @return boot Suceess, if present, otherwise - false
- */
- virtual bool IsMetaInfoPresent() const = 0;
-
- /**
- * @brief Set current system language
- * @param language System language
- * @return true, if succedeed, otherwise - false
- */
- virtual bool SetSystemLanguage(const std::string& language) = 0;
-
- /**
- * Increments global counter
- * @param type type of counter
- */
- virtual void Increment(usage_statistics::GlobalCounterId type) = 0;
-
- /**
- * Increments counter of application
- * @param app_id id application
- * @param type type of counter
- */
- virtual void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type) = 0;
-
- /**
- * Sets value of application information
- * @param app_id id application
- * @param type type of information
- * @param value value of information
- */
- virtual void Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value) = 0;
-
- /**
- * Adds value to stopwatch of application
- * @param app_id id application
- * @param type type of stopwatch
- * @param seconds value for adding in seconds
- */
- virtual void Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int seconds) = 0;
-
- /**
- * @brief CountUnconsentedGroups allows to obtain the count of unconsented
- * groups for specific application.
- * @param policy_app_id application id.
- * @param device_id device id.
- * @param the count of unconsented groups
- */
- 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
- * @param Array to be filled with group ids, names and functional prompts
- * @return true, if succeeded, otherwise - false
- */
- virtual bool GetFunctionalGroupNames(FunctionalGroupNames& names) = 0;
-
- /**
- * @brief GetAllAppGroups allows to obtain all groups for certain application.
- * @param app_id specific application id.
- * @param all_group_ids parameter to fill.
- */
- virtual void GetAllAppGroups(const std::string& app_id,
- FunctionalGroupIDs& all_group_ids) = 0;
- /**
- * @brief GetPreConsentedGroups allows to obtain all pre-consented groups for
- * specific application.
- * @param app_id specific application id.
- * @param preconsented_groups parameter to fill.
- */
- virtual void GetPreConsentedGroups(
- const std::string& app_id, FunctionalGroupIDs& preconsented_groups) = 0;
- /**
- * @brief GetConsentedGroups allows to obtain list of allowed and disallowed
- * groups for specific application on certain device.
- * @param device_id certain device
- * @param app_id application id.
- * @param allowed_groups list of allowed groups
- * @param disallowed_groups list of disallowed groups
- */
- virtual void GetConsentedGroups(const std::string& device_id,
- const std::string& app_id,
- FunctionalGroupIDs& allowed_groups,
- FunctionalGroupIDs& disallowed_groups) = 0;
-
- /**
- * @brief GetUnconsentedGroups allows to obtain list of allowed and disallowed
- * groups for specific application on certain device.
- * @param device_id certain device
- * @param policy_app_id application id.
- * @param unconsented_groups list of unconsented groups.
- */
- virtual void GetUnconsentedGroups(const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalGroupIDs& unconsented_groups) = 0;
-
- virtual void RemoveAppConsentForGroup(const std::string& app_id,
- const std::string& group_name) = 0;
-
- /**
- * @brief Set app policy to pre_DataConsented policy
- * @param app_id Policy ID of application to be changed
- * @return true, if succeeded, otherwise - false
- */
- virtual bool SetPredataPolicy(const std::string& app_id) = 0;
-
- /**
- * @brief Removes unpaired devices
- * @return true if success
- */
- virtual bool CleanupUnpairedDevices() = 0;
-
- /**
- * Sets flag of unpaired device
- * @param device_id Unique device id
- * @param unpaired True, if should be marked as unpaired, otherwise - false
- * @return true if success
- */
- virtual bool SetUnpairedDevice(const std::string& device_id,
- bool unpaired = true) = 0;
-
- /**
- * Resets Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
- */
- virtual bool ResetPT(const std::string& file_name) = 0;
-
- /**
- * @brief LoadFromBackup allows to load policy into the cache from backup.
- * @return true in case operation was successful.
- */
- virtual bool LoadFromBackup() = 0;
-
- /**
- * @brief LoadFromFile allows to load policy cache from preloaded table.
- * @param file_name preloaded
- * @param table object which will be filled during file parsing.
- * @return true in case file was successfuly loaded, false otherwise.
- */
- virtual bool LoadFromFile(const std::string& file_name,
- policy_table::Table& table) = 0;
-
- /**
- * @brief Backup allows to save cache onto hard drive.
- */
- virtual void Backup() = 0;
-
- /**
- * Returns heart beat timeout
- * @param app_id application id
- * @return if timeout was set then value in milliseconds greater zero
- * otherwise heart beat for specific application isn't set
- */
- virtual uint32_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;
-
- /**
- * @brief GetCertificate allows to obtain certificate in order to
- * make secure connection
- *
- * @return The certificate in PKCS#7.
- */
- virtual std::string GetCertificate() const = 0;
-
-#ifdef BUILD_TESTS
- /**
- * @brief GetPT allows to obtain SharedPtr to PT.
- * Used ONLY in Unit tests
- * @return SharedPTR to PT
- *
- */
- virtual utils::SharedPtr<policy_table::Table> GetPT() const = 0;
-#endif
-};
-
-typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
diff --git a/src/components/policy/include/policy/policy_helper.h b/src/components/policy/include/policy/policy_helper.h
deleted file mode 100644
index 746c5efeba..0000000000
--- a/src/components/policy/include/policy/policy_helper.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_POLICY_HELPER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_HELPER_H_
-
-#include "policy/policy_table/functions.h"
-#include "utils/shared_ptr.h"
-#include "policy/policy_types.h"
-
-namespace policy {
-class PolicyManagerImpl;
-
-const std::string kAllowedKey = "allowed";
-const std::string kUserDisallowedKey = "userDisallowed";
-const std::string kUndefinedKey = "undefined";
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-typedef policy_table::Strings::const_iterator StringsConstItr;
-typedef policy_table::ApplicationPolicies::const_iterator AppPoliciesConstItr;
-typedef policy_table::HmiLevels::const_iterator HMILevelsConstItr;
-typedef policy_table::Parameters::const_iterator ParametersConstItr;
-typedef policy_table::FunctionalGroupings::const_iterator FuncGroupConstItr;
-
-typedef policy_table::ApplicationPolicies::value_type AppPoliciesValueType;
-typedef policy_table::Rpc::value_type RpcValueType;
-typedef policy_table::Strings::value_type StringsValueType;
-
-/*
- * @brief Helper struct to compare functional group names
- */
-struct CompareGroupName {
- explicit CompareGroupName(const StringsValueType& group_name);
- bool operator()(const StringsValueType& group_name_to_compare) const;
-
- private:
- const StringsValueType& group_name_;
-};
-
-/*
- * @brief Used for compare of policies parameters mapped with specific
- * application ids
- */
-bool operator!=(const policy_table::ApplicationParams& first,
- const policy_table::ApplicationParams& second);
-
-/*
- * @brief Helper struct for checking changes of application policies, which
- * come with update along with current data snapshot
- * In case of policies changed for some application, current data will be
- * updated and notification will be sent to application
- */
-struct CheckAppPolicy {
- CheckAppPolicy(PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
- 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& 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_;
-};
-
-/*
- * @brief Fill permissions data with merged rpc permissions for hmi levels and
- * parameters
- */
-struct FillNotificationData {
- FillNotificationData(Permissions& data,
- GroupConsent group_state,
- GroupConsent undefined_group_consent);
- bool operator()(const RpcValueType& rpc);
- void UpdateHMILevels(const policy_table::HmiLevels& in_hmi,
- std::set<HMILevel>& out_hmi);
- void UpdateParameters(const policy_table::Parameters& in_parameters,
- std::set<Parameter>& out_parameter);
-
- private:
- void ExcludeSame();
- void ExcludeSameHMILevels(std::set<HMILevel>& source,
- const std::set<HMILevel>& target);
- void ExcludeSameParameters(std::set<Parameter>& source,
- const std::set<Parameter>& target);
- void InitRpcKeys(const std::string& rpc_name);
- std::string current_key_;
- Permissions& data_;
-};
-
-/*
- * @brief Checks for functional group presence and pass it to helper struct,
- * which fills permissions data according to group consent
- */
-struct ProcessFunctionalGroup {
- ProcessFunctionalGroup(
- const policy_table::FunctionalGroupings& fg,
- const std::vector<FunctionalGroupPermission>& group_permissions,
- Permissions& data,
- GroupConsent undefined_group_consent = GroupConsent::kGroupDisallowed);
- bool operator()(const StringsValueType& group_name);
-
- private:
- GroupConsent GetGroupState(const std::string& group_name);
- const policy_table::FunctionalGroupings& fg_;
- const std::vector<FunctionalGroupPermission>& group_permissions_;
- Permissions& data_;
- GroupConsent undefined_group_consent_;
-};
-
-struct FunctionalGroupInserter {
- FunctionalGroupInserter(const policy_table::Strings& preconsented_groups,
- PermissionsList& list);
- void operator()(const StringsValueType& group_name);
-
- private:
- PermissionsList& list_;
- const policy_table::Strings& preconsented_;
-};
-
-/**
- * @brief Fills FunctionalGroupPermissions with provided params
- * @param ids Functional group ids from DB
- * @param names Group names and user_consent_prompt
- * @param state User consent for group
- * @param permissions Struct to be filled with provided params
- */
-void FillFunctionalGroupPermissions(
- FunctionalGroupIDs& ids,
- FunctionalGroupNames& names,
- GroupConsent state,
- std::vector<FunctionalGroupPermission>& permissions);
-
-/**
- * @brief Checks, if application is predefined, e.g. "default", i.e. which is
- * must be present in policy table
- * @param app Application struct
- * @return true, if app is predefined, otherwise - false
- */
-bool IsPredefinedApp(const AppPoliciesValueType& app);
-
-/**
- * @brief Excludes same values
- * @param from Source, which should be checked
- * @param what Target, which should be excluded from source
- * @return Values without excluded
- */
-FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
- const FunctionalGroupIDs& what);
-
-/**
- * @brief Merges all values without same values
- * @param first First source of values
- * @param second Second source of values
- * @return Merged values w/o same values
- */
-FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
- const FunctionalGroupIDs& second);
-
-/**
- * @brief Finds same values
- * @param first First source of values
- * @param second Second source of values
- * @return Same values set, if any found
- */
-FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
- const FunctionalGroupIDs& second);
-
-/**
- * @brief Unwrap application policies from predefined values to specific policy
- * values, i.e. if application has "default", it will be assigned default
- * policies
- * @param app_policies Application policies to unwrap
- * @return true, if succeded, otherwise - false
- */
-bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies);
-}
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_HELPER_H_
diff --git a/src/components/policy/include/policy/policy_listener.h b/src/components/policy/include/policy/policy_listener.h
deleted file mode 100644
index 197dfd5c8a..0000000000
--- a/src/components/policy/include/policy/policy_listener.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_LISTENER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_LISTENER_H_
-
-#include <queue>
-
-#include "policy/policy_types.h"
-#include "utils/custom_string.h"
-
-namespace policy {
-
-namespace custom_str = utils::custom_string;
-
-class PolicyListener {
- public:
- virtual ~PolicyListener() {}
- 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 OnUpdateStatusChanged(const std::string&) = 0;
- virtual std::string OnCurrentDeviceIdUpdateRequired(
- const std::string& policy_app_id) = 0;
- virtual void OnSystemInfoUpdateRequired() = 0;
- virtual custom_str::CustomString GetAppName(
- const std::string& policy_app_id) = 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
- *
- */
- virtual void OnSnapshotCreated(const BinaryMessage& pt_string) = 0;
-
- /**
- * @brief Make appropriate changes for related applications permissions and
- * notify them, if it possible
- * @param device_id Unique device id, which consent had been changed
- * @param device_consent Device consent, which is done by user
- */
- 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/include/policy/policy_manager.h b/src/components/policy/include/policy/policy_manager.h
deleted file mode 100644
index 70ec5d23a2..0000000000
--- a/src/components/policy/include/policy/policy_manager.h
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_MANAGER_H_
-
-#include <vector>
-#include <cstdint>
-
-#include "policy/policy_types.h"
-#include "policy/policy_listener.h"
-#include "policy/usage_statistics/statistics_manager.h"
-
-namespace policy {
-class PolicySettings;
-
-class PolicyManager : public usage_statistics::StatisticsManager {
- public:
- virtual ~PolicyManager() {}
-
- virtual void set_listener(PolicyListener* listener) = 0;
-
- /**
- * Inits Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
- */
- virtual bool InitPT(const std::string& file_name,
- const PolicySettings* settings) = 0;
-
- /**
- * @brief Updates Policy Table from binary message received from
- * mobile device. Saves to Policy Table diff between Policy Table
- * sent in snapshot and received Policy Table.
- * @param file name of file with update policy table
- * @param pt_content PTU as binary string
- * @return bool Success of operation
- */
- virtual bool LoadPT(const std::string& file,
- const BinaryMessage& pt_content) = 0;
-
- /**
- * Resets Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
- */
- virtual bool ResetPT(const std::string& file_name) = 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 Gets all URLs for sending PTS to from PT itself.
- * @param service_type Service specifies user of URL
- * @return vector of urls
- */
- 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.
- */
- virtual bool RequestPTUpdate() = 0;
-
- /**
- * @brief Check if specified RPC for specified application
- * has permission to be executed in specified HMI Level
- * and also its permitted params.
- * @param app_id Id of application provided during registration
- * @param hmi_level Current HMI Level of application
- * @param rpc Name of RPC
- * @param CheckPermissionResult containing flag if HMI Level is allowed
- * and list of allowed params.
- */
- virtual void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result) = 0;
-
- /**
- * @brief Clear all record of user consents. Used during Factory Reset.
- * @return bool Success of operation
- */
- virtual bool ResetUserConsent() = 0;
-
- /**
- * @brief Returns current status of policy table for HMI
- * @return Current status of policy table
- */
- virtual std::string GetPolicyTableStatus() const = 0;
-
- /**
- * Checks is PT exceeded kilometers
- * @param kilometers current kilometers at odometer
- * @return true if exceeded
- */
- virtual void KmsChanged(int kilometers) = 0;
-
- /**
- * Increments counter of ignition cycles
- */
- virtual void IncrementIgnitionCycles() = 0;
-
- /**
- * @brief ExchangeByUserRequest
- */
- virtual std::string ForcePTExchange() = 0;
-
- /**
- * Resets retry sequence
- */
- virtual void ResetRetrySequence() = 0;
-
- /**
- * Gets timeout to wait before next retry updating PT
- * If timeout is equal to zero then the retry sequence is not need.
- * @return timeout in seconds
- */
- virtual uint32_t NextRetryTimeout() = 0;
-
- /**
- * Gets timeout to wait until receive response
- * @return timeout in seconds
- */
- virtual int TimeoutExchange() = 0;
-
- /**
- * @brief List of timeouts in seconds between retries
- * when attempt to update PT fails
- * @return List of delays between attempts.
- */
- virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0;
-
- /**
- * Handler of exceeding timeout of exchanging policy table
- */
- virtual void OnExceededTimeout() = 0;
-
- /**
- * @brief Handler of PTS sending out
- */
- virtual void OnUpdateStarted() = 0;
-
- /**
- * @brief Check user consent for mobile device data connection
- * @param device_id Unique device identifier
- * @return status of device consent
- */
- virtual DeviceConsent GetUserConsentForDevice(
- const std::string& device_id) const = 0;
-
- /**
- * @brief Get user consent for application
- * @param device_id Device id
- * @param policy_app_id Unique application id
- * @param permissions Array of functional groups permissions
- */
- virtual void GetUserConsentForApp(
- const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions) = 0;
-
- /**
- * @brief Set user consent for mobile device data connection
- * @param device_id Unique device identifier
- * @param is_allowed User consent for usage device data connection
- */
- virtual void SetUserConsentForDevice(const std::string& device_id,
- bool is_allowed) = 0;
-
- /**
- * @brief Update Application Policies as reaction
- * on User allowing/disallowing device this app is running on.
- */
- virtual bool ReactOnUserDevConsentForApp(const std::string app_id,
- bool is_device_allowed) = 0;
- /**
- * Sets counter value that passed for receiving PT UPdate.
- */
- virtual void PTUpdatedAt(Counters counter, int value) = 0;
-
- /**
- * @brief Retrieves data from app_policies about app on its registration:
- * @param app_id - id of registered app
- * @param app_types Section on HMI where app can appear (Navigation, Phone
- * etc)
- * @param nicknames Synonyms for application
- */
- virtual bool GetInitialAppData(const std::string& application_id,
- StringArray* nicknames = NULL,
- StringArray* app_hmi_types = NULL) = 0;
-
- /**
- * @brief Add's device to policy table
- * @param device_id Device mac address
- * @param connection_type Device connection type
- */
- virtual void AddDevice(const std::string& device_id,
- const std::string& connection_type) = 0;
-
- /**
- * @brief Stores device parameters received during application registration
- * to policy table
- * @param device_id Device mac address
- * @param device_info Received device parameters
- */
- virtual void SetDeviceInfo(const std::string& device_id,
- const DeviceInfo& device_info) = 0;
-
- /**
- * @brief Set user consent for application functional groups
- * @param permissions User-defined application group pemissions.
- * The permissions is not const reference because it may contains
- * valid data as well as invalid. So we will remove all invalid data
- * from this structure.
- */
- virtual void SetUserConsentForApp(const PermissionConsent& permissions) = 0;
-
- /**
- * @brief Get default HMI level for application
- * @param policy_app_id Unique application id
- * @param default_hmi Default HMI level for application or empty, if value
- * was not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi) const = 0;
-
- /**
- * @brief Get priority for application
- * @param policy_app_id Unique application id
- * @param priority Priority for application or empty, if value was not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string* priority) const = 0;
-
- /**
- * @brief Get user friendly messages for given RPC messages and language
- * @param message_codes RPC message codes
- * @param language Language
- * @return Array of structs with appropriate message parameters
- */
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
- const std::vector<std::string>& message_code,
- const std::string& language) = 0;
-
- /**
- * Checks if the application is revoked
- * @param app_id application id
- * @return true if application is revoked
- */
- virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
-
- /**
- * @brief Get resulting RPCs permissions for application which started on
- * specific device
- * @param device_id Device id
- * @param policy_app_id Unique application id
- * @param permissions Array of functional groups permissions
- */
- virtual void GetPermissionsForApp(
- const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions) = 0;
-
- /**
- * @brief Gets specific application permissions changes since last policy
- * table update
- * @param policy_app_id Unique application id
- * @return Permissions changes
- */
- virtual AppPermissions GetAppPermissionsChanges(
- const std::string& policy_app_id) = 0;
-
- virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
-
- /**
- * @brief Return device id, which hosts specific application
- * @param Application id, which is required to update device id
- */
- virtual std::string& GetCurrentDeviceId(
- const std::string& policy_app_id) const = 0;
-
- /**
- * @brief Set current system language
- * @param language Language
- */
- virtual void SetSystemLanguage(const std::string& language) = 0;
-
- /**
- * @brief Set data from GetSystemInfo response to policy table
- * @param ccpu_version CCPU version
- * @param wers_country_code WERS country code
- * @param language System language
- */
- virtual void SetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language) = 0;
-
- /**
- * @brief Send OnPermissionsUpdated for choosen application
- * @param application_id
- */
- virtual void SendNotificationOnPermissionsUpdated(
- const std::string& application_id) = 0;
-
- /**
- * Marks device as upaired
- * @param device_id id device
- */
- virtual void MarkUnpairedDevice(const std::string& device_id) = 0;
-
- /**
- * @brief Adds, application to the db or update existed one
- * run PTU if policy update is necessary for application.
- * @param Application id assigned by Ford to the application
- */
- virtual void AddApplication(const std::string& application_id) = 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
- */
- virtual bool CleanupUnpairedDevices() = 0;
-
- /**
- * @brief Check if app can keep context.
- */
- virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
-
- /**
- * @brief Check if app can steal focus.
- */
- virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
-
- /**
- * @brief Runs necessary operations, which is depends on external system
- * state, e.g. getting system-specific parameters which are need to be
- * filled into policy table
- */
- virtual void OnSystemReady() = 0;
-
- /**
- * @brief GetNotificationNumber
- * @param priority
- * @return
- */
- virtual uint32_t GetNotificationsNumber(
- const std::string& priority) const = 0;
-
- /**
- * @brief Allows to update Vehicle Identification Number in policy table.
- * @param new value for the parameter.
- */
- virtual void SetVINValue(const std::string& value) = 0;
-
- /**
- * @brief Checks, if application has policy assigned w/o data consent
- * @param policy_app_id Unique application id
- * @return true, if policy assigned w/o data consent, otherwise -false
- */
- virtual bool IsPredataPolicy(const std::string& policy_app_id) = 0;
-
- /**
- * Returns heart beat timeout
- * @param app_id application id
- * @return if timeout was set then value in milliseconds greater zero
- * otherwise heart beat for specific application isn't set
- */
- virtual uint32_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;
-
- /**
- * @brief Get information about vehicle
- */
- virtual const VehicleInfo GetVehicleInfo() const = 0;
-
- /**
- * @brief OnAppRegisteredOnMobile alows to handle event when application were
- * succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU.
- *
- * @param application_id registered application.
- */
- virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
-
- /**
- * @brief RetrieveCertificate Allows to obtain certificate in order
- * to start secure connection.
- *
- * @return The certificate in PKCS#7 format.
- */
- virtual std::string RetrieveCertificate() const = 0;
-
- virtual const PolicySettings& get_settings() 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
-
-extern "C" policy::PolicyManager* CreateManager();
-extern "C" void DeleteManager(policy::PolicyManager*);
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_MANAGER_H_
diff --git a/src/components/policy/include/policy/policy_manager_impl.h b/src/components/policy/include/policy/policy_manager_impl.h
deleted file mode 100644
index 66a96bf7a7..0000000000
--- a/src/components/policy/include/policy/policy_manager_impl.h
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
-
-#include <string>
-#include <list>
-#include <cstdint>
-
-#include "utils/shared_ptr.h"
-#include "utils/lock.h"
-#include "policy/policy_manager.h"
-#include "policy/policy_table.h"
-#include "policy/cache_manager_interface.h"
-#include "policy/update_status_manager.h"
-#include "policy/policy_table/functions.h"
-#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/policy_helper.h"
-#include "utils/timer.h"
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-namespace policy {
-struct CheckAppPolicy;
-
-class PolicyManagerImpl : public PolicyManager {
- public:
- PolicyManagerImpl();
- virtual void set_listener(PolicyListener* listener);
- PolicyListener* listener() const {
- return listener_;
- }
- virtual bool InitPT(const std::string& file_name,
- const PolicySettings* settings);
- virtual bool LoadPT(const std::string& file, const BinaryMessage& pt_content);
- virtual bool ResetPT(const std::string& file_name);
-
- virtual void GetServiceUrls(const std::string& service_type,
- EndpointUrls& end_points);
-
- virtual std::string GetLockScreenIconUrl() const;
- virtual bool 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 void KmsChanged(int kilometers);
- virtual void IncrementIgnitionCycles();
- virtual std::string ForcePTExchange();
- virtual std::string GetPolicyTableStatus() const;
- virtual void ResetRetrySequence();
- virtual uint32_t NextRetryTimeout();
- virtual int TimeoutExchange();
- virtual const std::vector<int> RetrySequenceDelaysSeconds();
- virtual void OnExceededTimeout();
- virtual void OnUpdateStarted();
- virtual void PTUpdatedAt(Counters counter, int value);
-
- /**
- * Refresh data about retry sequence from policy table
- */
- virtual void RefreshRetrySequence();
- virtual DeviceConsent GetUserConsentForDevice(
- const std::string& device_id) const OVERRIDE;
- virtual void GetUserConsentForApp(
- const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
- virtual void SetUserConsentForDevice(const std::string& device_id,
- bool is_allowed);
- virtual bool ReactOnUserDevConsentForApp(const std::string app_id,
- bool is_device_allowed);
- virtual bool GetInitialAppData(const std::string& application_id,
- StringArray* nicknames = NULL,
- StringArray* app_hmi_types = NULL);
-
- virtual void AddDevice(const std::string& device_id,
- const std::string& connection_type);
-
- virtual void SetDeviceInfo(const std::string& device_id,
- const DeviceInfo& device_info);
-
- virtual void SetUserConsentForApp(const PermissionConsent& permissions);
-
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi) const;
-
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string* priority) const;
-
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
- const std::vector<std::string>& message_code,
- const std::string& language);
-
- virtual bool IsApplicationRevoked(const std::string& app_id) const;
-
- virtual void GetPermissionsForApp(
- const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
-
- virtual std::string& GetCurrentDeviceId(
- const std::string& policy_app_id) const;
-
- virtual void SetSystemLanguage(const std::string& language);
-
- virtual void SetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
- virtual void OnSystemReady();
-
- virtual uint32_t GetNotificationsNumber(
- const std::string& priority) const OVERRIDE;
-
- virtual void SetVINValue(const std::string& value);
-
- // Interface StatisticsManager (begin)
- 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);
- // Interface StatisticsManager (end)
-
- AppPermissions GetAppPermissionsChanges(const std::string& policy_app_id);
- void RemovePendingPermissionChanges(const std::string& app_id);
-
- void SendNotificationOnPermissionsUpdated(const std::string& application_id);
-
- bool CleanupUnpairedDevices();
-
- bool CanAppKeepContext(const std::string& app_id) const;
- bool CanAppStealFocus(const std::string& app_id) const;
- void MarkUnpairedDevice(const std::string& device_id);
-
- void AddApplication(const std::string& application_id);
-
- virtual void RemoveAppConsentForGroup(const std::string& app_id,
- const std::string& group_name);
-
- virtual uint32_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);
-
- virtual void OnAppsSearchStarted();
-
- virtual void OnAppsSearchCompleted();
-
-#ifdef BUILD_TESTS
- inline CacheManagerInterfaceSPtr GetCache() {
- return cache_;
- }
-#endif // BUILD_TESTS
- virtual const std::vector<std::string> GetAppRequestTypes(
- const std::string policy_app_id) const;
-
- virtual const VehicleInfo GetVehicleInfo() const;
-
- virtual void OnAppRegisteredOnMobile(
- const std::string& application_id) OVERRIDE;
-
- virtual std::string RetrieveCertificate() const OVERRIDE;
-
- 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
-
- const PolicySettings& get_settings() const OVERRIDE;
-
- private:
- void CheckTriggers();
- /*
- * @brief Checks policy table update along with current data for any changes
- * in assigned functional group list of application
- *
- * @param Policy table update struct
- */
- void CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot);
-
- /**
- * @brief Fill structure to be sent with OnPermissionsChanged notification
- *
- * @param Policy table struct, which contains rpc functional groups data
- * @param List of rpc functional group names, which should be checked
- * @param group_permission User permissions for functional groups
- * @param Notification struct to be filled and sent
- */
- void PrepareNotificationData(
- const policy_table::FunctionalGroupings& groups,
- const policy_table::Strings& group_names,
- const std::vector<FunctionalGroupPermission>& group_permission,
- Permissions& notification_data);
-
- /**
- * @brief Validate PermissionConsent structure according to currently
- * assigned groups
- * @param permissions PermissionConsent structure that should be validated.
- * @return PermissonConsent struct, which contains no foreign groups
- */
- PermissionConsent EnsureCorrectPermissionConsent(
- const PermissionConsent& permissions_to_check);
-
- /**
- * @brief Allows to process case when added application is not present in
- * policy db.
- * @param policy application id.
- * @param cuuren consent for application's device.
- */
- void AddNewApplication(const std::string& application_id,
- DeviceConsent device_consent);
-
- /**
- * @brief Allows to process case when added application is already
- * in policy db.
- * @param policy application id.
- * @param cuuren consent for application's device.
- */
- void PromoteExistedApplication(const std::string& application_id,
- DeviceConsent device_consent);
-
- /**
- * @brief Check if certain application already in policy db.
- * @param policy application id.
- * @return true if application presents false otherwise.
- */
- 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;
-
- void RetrySequence();
-
- private:
- PolicyListener* listener_;
-
- UpdateStatusManager update_status_manager_;
- CacheManagerInterfaceSPtr cache_;
- sync_primitives::Lock apps_registration_lock_;
- sync_primitives::Lock app_permissions_diff_lock_;
- std::map<std::string, AppPermissions> app_permissions_diff_;
-
- /**
- * Timeout to wait response with UpdatePT
- */
- uint32_t retry_sequence_timeout_;
-
- /**
- * Seconds between retries to update PT
- */
- std::vector<int> retry_sequence_seconds_;
-
- /**
- * Current index trying of retry sequence
- */
- uint32_t retry_sequence_index_;
-
- /**
- * Lock for guarding retry sequence
- */
- sync_primitives::Lock retry_sequence_lock_;
-
- /**
- * Timer to retry UpdatePT
- */
- timer::Timer timer_retry_sequence_;
-
- /**
- * @brief Device id, which is used during PTU handling for specific
- * application
- */
- mutable std::string last_device_id_;
-
- bool ignition_check;
-
- const PolicySettings* settings_;
- friend struct CheckAppPolicy;
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
diff --git a/src/components/policy/include/policy/policy_table.h b/src/components/policy/include/policy/policy_table.h
deleted file mode 100644
index fdd4c9c2fc..0000000000
--- a/src/components/policy/include/policy/policy_table.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_POLICY_TABLE_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_TABLE_H_
-
-#include "utils/shared_ptr.h"
-#include "policy/pt_representation.h"
-#include "policy/pt_ext_representation.h"
-
-namespace policy {
-
-class PolicyTable {
- public:
- PolicyTable();
- explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
- virtual ~PolicyTable();
-
- /**
- * @brief Returns current implementation of
- * actual class storing policy table.
- * @return PTRepresentation* Policy Table Content Handler
- */
- utils::SharedPtr<PTRepresentation> pt_data() const {
- return pt_data_;
- }
-
- private:
- utils::SharedPtr<PTRepresentation> pt_data_;
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_TABLE_H_
diff --git a/src/components/policy/include/policy/policy_table/enums.h b/src/components/policy/include/policy/policy_table/enums.h
deleted file mode 100644
index 523c2e9d04..0000000000
--- a/src/components/policy/include/policy/policy_table/enums.h
+++ /dev/null
@@ -1,113 +0,0 @@
-// This file is generated, do not edit
-#ifndef POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_ENUMS_H_
-#define POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_ENUMS_H_
-#include <string>
-
-namespace rpc {
-namespace policy_table_interface_base {
-
-enum Priority {
- P_EMERGENCY,
- P_NAVIGATION,
- P_VOICECOM,
- P_COMMUNICATION,
- P_NORMAL,
- P_NONE,
-};
-
-bool IsValidEnum(Priority val);
-const char* EnumToJsonString(Priority val);
-bool EnumFromJsonString(const std::string& literal, Priority* result);
-
-enum HmiLevel {
- HL_BACKGROUND,
- HL_FULL,
- HL_LIMITED,
- HL_NONE,
-};
-bool IsValidEnum(HmiLevel val);
-const char* EnumToJsonString(HmiLevel val);
-bool EnumFromJsonString(const std::string& literal, HmiLevel* result);
-
-enum Parameter {
- P_GPS,
- P_SPEED,
- P_ENGINETORQUE,
- P_EXTERNALTEMPERATURE,
- P_FUELLEVEL,
- P_FUELLEVEL_STATE,
- P_HEADLAMPSTATUS,
- P_INSTANTFUELCONSUMPTION,
- P_ODOMETER,
- P_TIREPRESSURE,
- P_WIPERSTATUS,
- P_VIN,
- P_ACCPEDALPOSITION,
- P_BELTSTATUS,
- P_DRIVERBRAKING,
- P_PRNDL,
- P_RPM,
- P_STEERINGWHEELANGLE,
- P_MYKEY,
- P_AIRBAGSTATUS,
- P_BODYINFORMATION,
- P_CLUSTERMODESTATUS,
- P_DEVICESTATUS,
- P_EMERGENCYEVENT,
- P_ECALLINFO,
-};
-bool IsValidEnum(Parameter val);
-const char* EnumToJsonString(Parameter val);
-bool EnumFromJsonString(const std::string& literal, Parameter* result);
-
-enum AppHMIType {
- AHT_DEFAULT,
- AHT_COMMUNICATION,
- AHT_MEDIA,
- AHT_MESSAGING,
- AHT_NAVIGATION,
- AHT_INFORMATION,
- AHT_SOCIAL,
- AHT_BACKGROUND_PROCESS,
- AHT_TESTING,
- AHT_SYSTEM,
-};
-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;
-
-} // namespace policy_table_interface_base
-} // namespace rpc
-
-#endif // POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_ENUMS_H_
diff --git a/src/components/policy/include/policy/policy_table/functions.h b/src/components/policy/include/policy/policy_table/functions.h
deleted file mode 100644
index ee4b16b649..0000000000
--- a/src/components/policy/include/policy/policy_table/functions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// This file is generated, do not edit
-#ifndef POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_FUNCTIONS_H_
-#define POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_FUNCTIONS_H_
-#include "./enums.h"
-#include "./types.h"
-
-#endif // POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_FUNCTIONS_H_
diff --git a/src/components/policy/include/policy/policy_table/types.h b/src/components/policy/include/policy/policy_table/types.h
deleted file mode 100644
index 77ef575139..0000000000
--- a/src/components/policy/include/policy/policy_table/types.h
+++ /dev/null
@@ -1,441 +0,0 @@
-// This file is generated, do not edit
-#ifndef POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_TYPES_H_
-#define POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_TYPES_H_
-#include <climits>
-
-#include "./enums.h"
-#include "rpc_base/rpc_message.h"
-namespace Json {
-class Value;
-} // namespace Json
-namespace rpc {
-namespace policy_table_interface_base {
-struct AppLevel;
-struct ApplicationParams;
-struct DeviceParams;
-struct MessageLanguages;
-struct MessageString;
-struct RpcParameters;
-struct Rpcs;
-} // namespace policy_table_interface_base
-} // namespace rpc
-
-namespace rpc {
-namespace policy_table_interface_base {
-
-// According to HMI API
-#define ODO_MAX 17000000
-
-typedef Array<String<1, 255>, 0, 255> Strings;
-
-typedef Array<Enum<AppHMIType>, 0, 255> AppHMITypes;
-
-typedef Array<Enum<HmiLevel>, 0, 4> HmiLevels;
-
-typedef Array<Enum<Parameter>, 0, 24> Parameters;
-
-typedef Map<RpcParameters, 0, 50> Rpc;
-
-typedef Array<String<10, 255>, 1, 255> URL;
-
-typedef Map<URL, 1, 255> URLList;
-
-typedef Map<URLList, 1, 255> ServiceEndpoints;
-
-typedef uint8_t NumberOfNotificationsType;
-typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 6>
- NumberOfNotificationsPerMinute;
-
-typedef Array<Integer<uint16_t, 1, 1000>, 0, 10> SecondsBetweenRetries;
-
-typedef Map<MessageString, 0, 500> Languages;
-
-typedef Map<MessageLanguages, 0, 255> Messages;
-
-typedef Map<AppLevel, 0, 255> AppLevels;
-
-typedef Map<Stringifyable<Nullable<ApplicationParams>>, 1, 1000>
- ApplicationPolicies;
-
-typedef Map<Rpcs, 1, 255> FunctionalGroupings;
-
-typedef Map<DeviceParams, 0, 255> DeviceData;
-
-typedef Array<Enum<RequestType>, 0, 255> RequestTypes;
-
-struct PolicyBase : CompositeType {
- public:
- Enum<Priority> priority;
-
- public:
- PolicyBase();
- PolicyBase(Priority priority);
- 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(Priority priority);
- ~DevicePolicy();
- explicit DevicePolicy(const Json::Value* value__);
-};
-
-struct ApplicationParams : PolicyBase {
- public:
- Strings groups;
- Optional<Strings> nicknames;
- Optional<AppHMITypes> AppHMIType;
- Optional<RequestTypes> RequestType;
- Optional<Integer<uint16_t, 0, 65225>> memory_kb;
- Optional<Integer<uint32_t, 0, UINT_MAX>> heart_beat_timeout_ms;
- Optional<String<0, 255>> certificate;
-
- public:
- ApplicationParams();
- ApplicationParams(const Strings& groups, Priority priority);
- ~ApplicationParams();
- explicit ApplicationParams(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 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;
- Optional<Parameters> parameters;
-
- public:
- RpcParameters();
- explicit RpcParameters(const HmiLevels& hmi_levels);
- ~RpcParameters();
- explicit RpcParameters(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 Rpcs : CompositeType {
- public:
- Optional<String<1, 255>> user_consent_prompt;
- Nullable<Rpc> rpcs;
-
- public:
- Rpcs();
- explicit Rpcs(const Rpc& rpcs);
- ~Rpcs();
- explicit Rpcs(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 ModuleConfig : CompositeType {
- public:
- Optional<Map<String<0, 100>, 0, 255>> device_certificates;
- Optional<Boolean> preloaded_pt;
- Integer<uint8_t, 0, 255> exchange_after_x_ignition_cycles;
- Integer<int64_t, 0, 4294967296ll> exchange_after_x_kilometers;
- Integer<uint8_t, 0, 255> exchange_after_x_days;
- Integer<uint16_t, 0, 65535> timeout_after_x_seconds;
- SecondsBetweenRetries seconds_between_retries;
- ServiceEndpoints endpoints;
- NumberOfNotificationsPerMinute notifications_per_minute_by_priority;
- Optional<String<1, 100>> vehicle_make;
- Optional<String<1, 100>> vehicle_model;
- Optional<String<4, 4>> vehicle_year;
- Optional<String<0, 10>> preloaded_date;
- 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);
- ~ModuleConfig();
- explicit ModuleConfig(const Json::Value* value__);
- void SafeCopyFrom(const ModuleConfig& from);
- 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 MessageString : CompositeType {
- public:
- Optional<String<1, 65535>> line1;
- Optional<String<1, 65535>> line2;
- Optional<String<1, 65535>> tts;
- Optional<String<1, 65535>> label;
- Optional<String<1, 65535>> textBody;
-
- public:
- MessageString();
- ~MessageString();
- explicit MessageString(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 MessageLanguages : CompositeType {
- public:
- Languages languages;
-
- public:
- MessageLanguages();
- explicit MessageLanguages(const Languages& languages);
- ~MessageLanguages();
- explicit MessageLanguages(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 ConsumerFriendlyMessages : CompositeType {
- public:
- String<1, 100> version;
- Optional<Messages> messages;
-
- public:
- ConsumerFriendlyMessages();
- explicit ConsumerFriendlyMessages(const std::string& version);
- ~ConsumerFriendlyMessages();
- explicit ConsumerFriendlyMessages(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 ModuleMeta : CompositeType {
- public:
- Optional<Integer<uint32_t, 0, ODO_MAX>> pt_exchanged_at_odometer_x;
- Optional<Integer<uint16_t, 0, 65535>> pt_exchanged_x_days_after_epoch;
- Optional<Integer<uint16_t, 0, 65535>> ignition_cycles_since_last_exchange;
-
- public:
- ModuleMeta();
- ~ModuleMeta();
- explicit ModuleMeta(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;
-
- private:
- bool Validate() const;
-};
-
-struct AppLevel : CompositeType {
- public:
- Integer<uint16_t, 0, 65535> minutes_in_hmi_full;
- String<1, 10> app_registration_language_gui;
- String<0, 10> app_registration_language_vui;
- Integer<uint16_t, 0, 65535> minutes_in_hmi_limited;
- Integer<uint16_t, 0, 65535> minutes_in_hmi_background;
- Integer<uint16_t, 0, 65535> minutes_in_hmi_none;
- Integer<uint16_t, 0, 65535> count_of_user_selections;
- Integer<uint16_t, 0, 65535> count_of_rejections_sync_out_of_memory;
- Integer<uint16_t, 0, 65535> count_of_rejections_nickname_mismatch;
- Integer<uint16_t, 0, 65535> count_of_rejections_duplicate_name;
- Integer<uint16_t, 0, 65535> count_of_rejected_rpc_calls;
- Integer<uint16_t, 0, 65535> count_of_rpcs_sent_in_hmi_none;
- Integer<uint16_t, 0, 65535> count_of_removals_for_bad_behavior;
- Integer<uint16_t, 0, 65535> count_of_tls_errors;
- Integer<uint16_t, 0, 65535> count_of_run_attempts_while_revoked;
-
- public:
- AppLevel();
- AppLevel(uint16_t minutes_in_hmi_full,
- const std::string& app_registration_language_gui,
- const std::string& app_registration_language_vui,
- uint16_t minutes_in_hmi_limited,
- uint16_t minutes_in_hmi_background,
- uint16_t minutes_in_hmi_none,
- uint16_t count_of_user_selections,
- uint16_t count_of_rejections_sync_out_of_memory,
- uint16_t count_of_rejections_nickname_mismatch,
- uint16_t count_of_rejections_duplicate_name,
- uint16_t count_of_rejected_rpc_calls,
- uint16_t count_of_rpcs_sent_in_hmi_none,
- uint16_t count_of_removals_for_bad_behavior,
- uint16_t count_of_tls_errors,
- uint16_t count_of_run_attempts_while_revoked);
- ~AppLevel();
- explicit AppLevel(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;
-
- private:
- bool Validate() const;
-};
-
-struct UsageAndErrorCounts : CompositeType {
- public:
- Optional<AppLevels> app_level;
-
- public:
- UsageAndErrorCounts();
- ~UsageAndErrorCounts();
- explicit UsageAndErrorCounts(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 DeviceParams : CompositeType {
- public:
- DeviceParams();
- ~DeviceParams();
- explicit DeviceParams(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;
-
- private:
- bool Validate() const;
-};
-
-struct PolicyTable : CompositeType {
- public:
- ApplicationPoliciesSection app_policies_section;
- FunctionalGroupings functional_groupings;
- Optional<ConsumerFriendlyMessages> consumer_friendly_messages;
- ModuleConfig module_config;
- Optional<ModuleMeta> module_meta;
- Optional<UsageAndErrorCounts> usage_and_error_counts;
- Optional<DeviceData> device_data;
-
- public:
- PolicyTable();
- 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;
- 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 Table : CompositeType {
- public:
- PolicyTable policy_table;
-
- public:
- Table();
- explicit Table(const PolicyTable& policy_table);
- ~Table();
- explicit Table(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;
-};
-} // namespace policy_table_interface_base
-} // namespace rpc
-
-#endif // POLICY_TABLE_INTERFACE_BASE_POLICY_TABLE_INTERFACE_BASE_TYPES_H_
diff --git a/src/components/policy/include/policy/pt_ext_representation.h b/src/components/policy/include/policy/pt_ext_representation.h
deleted file mode 100644
index 2c5db4f002..0000000000
--- a/src/components/policy/include/policy/pt_ext_representation.h
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_EXT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
-
-#include "policy/pt_representation.h"
-
-namespace policy {
-
-enum StatisticsType {
- S_NONE = 0,
- S_IAP_BUFFER_FULL,
- S_SYNC_OUT_OF_MEMORY,
- S_SYNC_REBOOTS,
- S_MINS_HMI_FULL,
- S_MINS_HMI_LIMITED,
- S_MINS_HMI_BACKGROUND,
- S_MINS_HMI_NONE,
- S_RFCOM_LIMIT_REACHED,
- S_USER_SELECTIONS,
- S_REJECTIONS_SYNC_OUT_OF_MEMORY,
- S_REJECTIONS_NICKNAME_MISMATCH,
- S_REJECTIONS_DUPLICATE_NAME,
- S_REJECTED_RPC_CALLS,
- S_RPCS_IN_HMI_NONE,
- S_REMOVALS_MISBEHAVED,
- S_RUN_ATTEMPTS_WHILE_REVOKED
-};
-
-enum LanguageType { L_NONE = 0, L_GUI, L_VUI };
-
-class PTExtRepresentation : public virtual PTRepresentation {
- public:
- virtual ~PTExtRepresentation() {}
-
- /**
- * @brief Is application allowed to send notifications while in
- * Backgound or limited mode.
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- virtual bool CanAppKeepContext(const std::string& app_id) = 0;
-
- /**
- * @brief Is application allowed to move foreground at will?
- * @param app_id Application id
- * @return bool Allowed/disallowed.
- */
- virtual bool CanAppStealFocus(const std::string& app_id) = 0;
-
- /**
- * @brief Get default_hmi for given application
- * @param policy_app_id Unique application id
- * @param default_hmi Default HMI level for application or empty, if value was
- * not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetDefaultHMI(const std::string& policy_app_id,
- std::string* default_hmi) = 0;
-
- /**
- * @brief Reset user consent for device data and applications permissions
- * @return
- */
- virtual bool ResetUserConsent() = 0;
-
- /**
- * @brief Reset user consent for device data
- * @return
- */
- virtual bool ResetDeviceConsents() = 0;
-
- /**
- * @brief Reset user consent for applications permissions
- * @return
- */
- virtual bool ResetAppConsents() = 0;
-
- /**
- * @brief Get user permissions for device data usage
- * @param device_id Generated or obtained id of device
- * @param consented_groups Groups consented by user
- * @param disallowed_groups Groups not consented by user
- * @return true, if query was successfull, otherwise - false
- */
- virtual bool GetUserPermissionsForDevice(
- const std::string& device_id,
- StringArray* consented_groups = NULL,
- StringArray* disallowed_groups = NULL) = 0;
-
- /**
- * @brief Gets list of groups permissions from policy table
- * @param device_id Unique device id, which hosts specific application
- * @param policy_app_id Unique application id
- * @param group_types Group list sorted by permission status
- * @return true, if query was successfull, otherwise - false
- */
- virtual bool GetPermissionsForApp(const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalIdType* group_types) = 0;
-
- /**
- * @brief Get device groups and preconsented groups from policies section
- * @param groups List of groups to be consented for device usage
- * @param preconsented_groups List of preconsented groups for device usage
- * @return true, if query was successful, otherwise - false
- */
- virtual bool GetDeviceGroupsFromPolicies(
- policy_table::Strings* groups = NULL,
- policy_table::Strings* preconsented_groups = NULL) = 0;
-
- /**
- * @brief Record information about mobile device in Policy Table.
- * @param device_id Generated or obtained id of device
- * @return bool Success of operation
- */
- virtual bool SetDeviceData(const std::string& device_id,
- const std::string& hardware = "",
- const std::string& firmware = "",
- const std::string& os = "",
- const std::string& os_version = "",
- const std::string& carrier = "",
- const uint32_t number_of_ports = 0,
- const std::string& connection_type = "") = 0;
-
- /**
- * @brief Sets user consent for particular mobile device,
- * i.e. to use device for exchanging of Policy Table.
- * @return bool Success of operation
- */
- virtual bool SetUserPermissionsForDevice(
- const std::string& device_id,
- const StringArray& consented_groups = StringArray(),
- const StringArray& disallowed_gropus = StringArray()) = 0;
-
- /**
- * @brief Update Application Policies as reaction
- * on User allowing/disallowing device this app is running on.
- */
- virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
- bool is_device_allowed) = 0;
-
- /**
- * @brief Set user consent on functional groups
- * @param permissions User consent on functional group
- * @return true, if operation succedeed, otherwise - false
- */
- virtual bool SetUserPermissionsForApp(
- const PermissionConsent& permissions) = 0;
-
- /**
- * @brief Counter for statistics information: adds 1 to existing number.
- * @param type Type of statistics (errors, mins in mode etc)
- * @return bool Success of operation
- */
- virtual bool IncreaseStatisticsData(StatisticsType type) = 0;
-
- /**
- * @brief Records information about what language
- * application tried to register with.
- * @param app_id Id of application
- * @param type - language for UI/VR
- * @param language Language
- * @return bool Success of operation
- */
- virtual bool SetAppRegistrationLanguage(const std::string& app_id,
- LanguageType type,
- const std::string& language) = 0;
-
- /**
- * @brief Records information about head unit system to PT
- * @return bool Success of operation
- */
- virtual bool SetMetaInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language) = 0;
-
- /**
- * @brief Checks, if specific head unit is present in PT
- * @return boot Suceess, if present, otherwise - false
- */
- virtual bool IsMetaInfoPresent() = 0;
-
- /**
- * @brief Kms pass since last successfull PT update
- */
- virtual int GetKmFromSuccessfulExchange() = 0;
-
- /**
- * @brief Days pass since last successfull PT update
- */
- virtual int GetDayFromScsExchange() = 0;
-
- /**
- * @brief Ignition cycles pass since last successfull PT update
- */
- virtual int GetIgnitionsFromScsExchange() = 0;
-
- /**
- * @brief Set current system language
- * @param language System language
- * @return true, if succedeed, otherwise - false
- */
- virtual bool SetSystemLanguage(const std::string& language) = 0;
-
- /**
- * Increments global counter
- * @param type type of counter
- */
- virtual void Increment(const std::string& type) const = 0;
-
- /**
- * Increments counter of application
- * @param app_id id application
- * @param type type of counter
- */
- virtual void Increment(const std::string& app_id,
- const std::string& type) const = 0;
-
- /**
- * Sets value of application information
- * @param app_id id application
- * @param type type of information
- * @param value value of information
- */
- virtual void Set(const std::string& app_id,
- const std::string& type,
- const std::string& value) const = 0;
-
- /**
- * Adds value to stopwatch of application
- * @param app_id id application
- * @param type type of stopwatch
- * @param seconds value for adding in seconds
- */
- virtual void Add(const std::string& app_id,
- const std::string& type,
- int seconds) const = 0;
-
- virtual bool CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- int* result) const = 0;
-
- /**
- * @brief Gets functional group names and user_consent_prompts, if any
- * @param Array to be filled with group ids, names and functional prompts
- * @return true, if succeeded, otherwise - false
- */
- // TODO(AOleynik): Possibly, we can get rid of this method. Check this.
- virtual bool GetFunctionalGroupNames(policy::FunctionalGroupNames& names) = 0;
-
- /**
- * @brief Set app policy to pre_DataConsented policy
- * @param app_id Policy ID of application to be changed
- * @return true, if succeeded, otherwise - false
- */
- virtual bool SetPredataPolicy(const std::string& app_id) = 0;
-
- /**
- * @brief Updates application policy to either pre_DataConsented or not
- * @param app_id Policy Id of application to be checked
- * @param is_pre_data True of False to setting app policy to be
- * pre_DataConsented
- * @return true, if succeeded, otherwise - false
- */
- virtual bool SetIsPredata(const std::string& app_id, bool is_pre_data) = 0;
-
- /**
- * @brief Removes unpaired devices
- * @return true if success
- */
- virtual bool CleanupUnpairedDevices(const DeviceIds& device_ids) const = 0;
-
- /**
- * Sets flag of unpaired device
- * @param device_id Unique device id
- * @param unpaired True, if unpaired, otherwise - false
- * @return true if success
- */
- virtual bool SetUnpairedDevice(const std::string& device_id,
- bool unpaired) const = 0;
-
- /**
- * Gets list of unpaired devices
- * @param device_ids output list
- * @return true if success
- */
- virtual bool UnpairedDevicesList(DeviceIds* device_ids) const = 0;
-
- /**
- * @brief Remove application consent for particular group
- * @param policy_app_id Unique application id
- * @param functional_group_name Functional group name, which consents should
- * be removed
- * @return true, in case of success, otherwise - false
- */
- virtual bool RemoveAppConsentForGroup(
- const std::string& policy_app_id,
- const std::string& functional_group_name) const = 0;
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/include/policy/pt_representation.h b/src/components/policy/include/policy/pt_representation.h
deleted file mode 100644
index 122f5326d8..0000000000
--- a/src/components/policy/include/policy/pt_representation.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_REPRESENTATION_H_
-
-#include <vector>
-#include <string>
-#include "policy/policy_types.h"
-#include "policy/policy_table/types.h"
-#include "policy/policy_settings.h"
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-namespace policy {
-
-enum InitResult { NONE = 0, EXISTS, SUCCESS, FAIL };
-
-class PTRepresentation {
- public:
- virtual ~PTRepresentation() {}
-
- /**
- * @brief Check if specified RPC for specified application
- * has permission to be executed in specified HMI Level
- * and also its permitted params.
- * @param app_id Id of application provided during registration
- * @param hmi_level Current HMI Level of application
- * @param rpc Name of RPC
- * @params CheckPermissionResult containing flag if HMI Level is allowed
- * and list of allowed params.
- */
- virtual void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result) = 0;
-
- /**
- * @brief Returns true if Policy Table was not updated yet
- * from preloaded pt file.
- */
- virtual bool IsPTPreloaded() = 0;
-
- virtual bool RefreshDB() = 0;
- /**
- * Gets number of ignition cycles before next update policy table
- * @return number of ignition cycles
- */
- virtual int IgnitionCyclesBeforeExchange() = 0;
-
- /**
- * Gets value in kilometers before next update policy table
- * @param current value in kilometers from the odometers
- * @return value in kilometers
- */
- virtual int KilometersBeforeExchange(int current) = 0;
-
- /**
- * @brief Sets kilometers and days after epoch, that passed for recieved
- * successful PT UPdate
- */
- virtual bool SetCountersPassedForSuccessfulUpdate(int kilometers,
- int days_after_epoch) = 0;
-
- /**
- * Gets value in days before next update policy table
- * @param current value in days after epoch
- * @return value in days
- */
- virtual int DaysBeforeExchange(int current) = 0;
-
- /**
- * @brief Increment number of ignition cycles since last exchange by 1
- */
- virtual void IncrementIgnitionCycles() = 0;
-
- /**
- * @brief Reset number of ignition cycles since last exchange to 0
- */
- virtual void ResetIgnitionCycles() = 0;
-
- /**
- * @brief Returns timeout to wait for a response of PT update
- * @return value in seconds
- */
- virtual int TimeoutResponse() = 0;
-
- /**
- * @brief Returns number of seconds between each try of sending PTS
- * @param seconds Return value: array of 5 elements
- * @return bool Success of operation
- */
- virtual bool SecondsBetweenRetries(std::vector<int>* seconds) = 0;
-
- /**
- * @brief Get information about vehicle
- */
- virtual const VehicleInfo GetVehicleInfo() const = 0;
-
- /**
- * @brief Allows to update 'vin' field in module_meta table.
- *
- * @param new 'vin' value.
- *
- * @return true in case when data has been successfully updated,
- * false otherwise.
- */
- virtual bool SetVINValue(const std::string& value) = 0;
-
- /**
- * @brief Get message text for displaying/pronouncing for user
- * dependent on language and context.
- * @param msg_codes Context of message (Driver distraction, Grant permission
- * etc)
- * @param language Language of the message
- * @return Array of appropriate messages parameters
- */
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes,
- const std::string& language) = 0;
-
- /**
- * @brief Get list of URL to send PTS to
- * @param service_type If URLs for specific service are preset,
- * return them otherwise default URLs.
- */
- 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
- */
- virtual int GetNotificationsNumber(const std::string& priority) = 0;
-
- /**
- * @brief Get priority for given application
- * @param policy_app_id Unique application id
- * @param priority Priority for application or empty, if value was not set
- * @return true, if succedeed, otherwise - false
- */
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string* priority) = 0;
-
- /**
- * @brief Initialized Policy Table (load)
- * @return bool Success of operation
- */
- virtual InitResult Init(const PolicySettings* settings) = 0;
-
- /**
- * @brief Close policy table
- * @return bool Success of operation
- */
- virtual bool Close() = 0;
-
- /**
- * @brief Removes policy table content.
- * @return bool Success of operation
- */
- virtual bool Clear() = 0;
-
- /**
- * Drops policy table (schema and content)
- * @return true if successfully
- */
- virtual bool Drop() = 0;
-
- /**
- * @brief Get snapshot of Policy Table
- * including app_policies, functional_groups,
- * device_info, statistics, excluding user messages
- * @return Generated structure for obtaining Json string.
- */
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
-
- virtual bool Save(const policy_table::Table& table) = 0;
-
- /**
- * Gets flag updateRequired
- * @return true if update is required
- */
- virtual bool UpdateRequired() const = 0;
-
- /**
- * Saves flag updateRequired
- */
- virtual void SaveUpdateRequired(bool value) = 0;
-
- /*
- Retrieves data from app_policies about app on its registration:
- app_id - id of registered app; all outputs are filled in only if not null
- output: nicknames Synonyms for application
- output: app_types Section on HMI where app can appear (Navigation, Phone etc)
- */
- virtual bool GetInitialAppData(const std::string& app_id,
- StringArray* nicknames = NULL,
- StringArray* app_types = NULL) = 0;
-
- /**
- * Checks if the application is revoked
- * @param app_id application id
- * @return true if application is revoked
- */
- virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
-
- /**
- * @brief Get functional groupings from DB
- * @param groups Known functional groupings
- * @return true, if succeeded, otherwise - false
- */
- virtual bool GetFunctionalGroupings(
- policy_table::FunctionalGroupings& groups) = 0;
-
- /**
- * Checks if the application is represented in policy table
- * @param app_id application id
- * @return true if application is represented in policy table
- */
- virtual bool IsApplicationRepresented(const std::string& app_id) const = 0;
-
- /**
- * Checks if the application has default policy
- * @param app_id application id
- * @return true if application has default policy
- */
- virtual bool IsDefaultPolicy(const std::string& app_id) const = 0;
-
- /**
- * Checks if the application has pre_data policy
- * @param app_id application id
- * @return true if application has pre_data policy
- */
- virtual bool IsPredataPolicy(const std::string& app_id) const = 0;
-
- /**
- * Sets default policy for application
- * @param app_id application id
- * @return true if success
- */
- virtual bool SetDefaultPolicy(const std::string& app_id) = 0;
-
- /**
- * @brief SaveApplicationCustomData allows to save specific data to database.
- * This data is only for internal use.
- * @param app_id the application id for which the data will be saved.
- * @param is_revoked parameter to save.
- * @param is_default parameter to save.
- * @param is_predata parameter to save.
- */
- virtual bool SaveApplicationCustomData(const std::string& app_id,
- bool is_revoked,
- bool is_default,
- bool is_predata) = 0;
-
- virtual void WriteDb() = 0;
-
- /**
- * @brief RemoveDB allows to remove the database.
- * It will either remove or do nothing in case file not exists or any other
- * troubles are happens during this operation.
- */
- virtual void RemoveDB() const = 0;
-
- /**
- * @brief Checks if DB version is actual to current schema
- * @return true if actual, otherwise - false
- */
- virtual bool IsDBVersionActual() const = 0;
-
- /**
- * @brief Updates DB version according to current schema
- * @return true if success, otherwise - false
- */
- virtual bool UpdateDBVersion() const = 0;
-
- protected:
- const PolicySettings& get_settings() const {
- DCHECK(settings_);
- return *settings_;
- }
- const PolicySettings* settings_;
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_PT_REPRESENTATION_H_
diff --git a/src/components/policy/include/policy/sql_pt_ext_queries.h b/src/components/policy/include/policy/sql_pt_ext_queries.h
deleted file mode 100644
index 2b65df45f3..0000000000
--- a/src/components/policy/include/policy/sql_pt_ext_queries.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Copyright (c) 2013, " Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, " with or without
- modification, " are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, " this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice, "
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
- CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
- CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
-
-#include <string>
-
-namespace policy {
-namespace sql_pt_ext {
-
-extern const std::string kSelectKeepContext;
-extern const std::string kSelectStealFocus;
-extern const std::string kResetDeviceConsents;
-extern const std::string kResetAppConsents;
-extern const std::string kCountDeviceConsentGroup;
-extern const std::string kCountDevice;
-extern const std::string kSelectDeviceConsentedGroup;
-extern const std::string kUpdateDeviceConsentedGroup;
-extern const std::string kUpdateDevice;
-extern const std::string kInsertDeviceConsentedGroup;
-extern const std::string kInsertDevice;
-extern const std::string kSelectDeviceData;
-extern const std::string kSelectConsentGroup;
-extern const std::string kInsertPreconsentedGroups;
-extern const std::string kSelectPreconsentedGroups;
-extern const std::string kDeletePreconsentedGroups;
-extern const std::string kSelectUsageAndErrorCount;
-extern const std::string kSelectAppLevels;
-extern const std::string kUpdateGlobalCounters;
-extern const std::string kInsertDeviceData;
-extern const std::string kDeleteDeviceData;
-extern const std::string kInsertConsentGroups;
-extern const std::string kCountUnconsentedGroups;
-extern const std::string kSelectModuleMeta;
-extern const std::string kUpdateMetaParams;
-extern const std::string kUpdateModuleMetaVinParam;
-extern const std::string kSaveModuleMeta;
-extern const std::string kSelectMetaParams;
-extern const std::string kCountAppLevel;
-extern const std::string kUpdateGroupPermissions;
-extern const std::string kSelectDefaultHmi;
-extern const std::string kInsertApplication;
-extern const std::string kSelectFriendlyMsg;
-extern const std::string kCollectFriendlyMsg;
-extern const std::string kSelectAppGroupsId;
-extern const std::string kSelectConsentedGroupsId;
-extern const std::string kCountAppConsents;
-extern const std::string kSelectPreconsentedGroupsId;
-extern const std::string kSelectFunctionalGroupNames;
-extern const std::string kSelectAppPolicies;
-extern const std::string kUpdateMetaLanguage;
-extern const std::string kDeleteDeviceConsent;
-extern const std::string kDeleteAppGroupConsent;
-extern const std::string kSelectGroupId;
-extern const std::string kSelectApplicationIsPreData;
-extern const std::string kUpdateIsPredata;
-extern const std::string kHasAppPreloadedGroups;
-extern const std::string kUpdateUnpairedDevice;
-extern const std::string kSelectUnpairedDevices;
-extern const std::string kHasMsgLanguageCode;
-extern const std::string kDeletePreconsentedGroupsByApplicationId;
-extern const std::string kDeleteAppConsent;
-
-} // namespace sql_pt_ext
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
diff --git a/src/components/policy/include/policy/sql_pt_ext_representation.h b/src/components/policy/include/policy/sql_pt_ext_representation.h
deleted file mode 100644
index 1d33750b12..0000000000
--- a/src/components/policy/include/policy/sql_pt_ext_representation.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_SQL_PT_EXT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
-
-#include <string>
-#include "policy/sql_pt_representation.h"
-#include "policy/pt_ext_representation.h"
-
-namespace policy {
-
-class SQLPTExtRepresentation : public SQLPTRepresentation,
- public PTExtRepresentation {
- public:
- bool CanAppKeepContext(const std::string& app_id);
- bool CanAppStealFocus(const std::string& app_id);
- bool GetDefaultHMI(const std::string& policy_app_id,
- std::string* default_hmi);
- bool ResetUserConsent();
- bool ResetDeviceConsents();
- bool ResetAppConsents();
- bool GetUserPermissionsForDevice(const std::string& device_id,
- StringArray* consented_groups = NULL,
- StringArray* disallowed_groups = NULL);
-
- bool GetPermissionsForApp(const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalIdType* group_types);
-
- bool GetDeviceGroupsFromPolicies(
- policy_table::Strings* groups = NULL,
- policy_table::Strings* preconsented_groups = NULL);
- bool SetDeviceData(const std::string& device_id,
- const std::string& hardware = "",
- const std::string& firmware = "",
- const std::string& os = "",
- const std::string& os_version = "",
- const std::string& carrier = "",
- const uint32_t number_of_ports = 0,
- const std::string& connection_type = "");
- bool SetUserPermissionsForDevice(
- const std::string& device_id,
- const StringArray& consented_groups = StringArray(),
- const StringArray& disallowed_groups = StringArray());
-
- bool ReactOnUserDevConsentForApp(const std::string& app_id,
- bool is_device_allowed);
-
- bool SetUserPermissionsForApp(const PermissionConsent& permissions);
-
- std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language);
-
- bool IncreaseStatisticsData(StatisticsType type) {
- return true;
- }
- bool SetAppRegistrationLanguage(const std::string& app_id,
- LanguageType type,
- const std::string& language) {
- return true;
- }
-
- bool SetMetaInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
-
- bool IsMetaInfoPresent();
-
- bool SetSystemLanguage(const std::string& language);
-
- int GetKmFromSuccessfulExchange() {
- return true;
- }
- int GetDayFromScsExchange() {
- return true;
- }
- int GetIgnitionsFromScsExchange() {
- return true;
- }
-
- bool GetFunctionalGroupNames(FunctionalGroupNames& names);
- bool CleanupUnpairedDevices(const DeviceIds& device_ids) const;
-
- void Increment(const std::string& type) const;
- void Increment(const std::string& app_id, const std::string& type) const;
- void Set(const std::string& app_id,
- const std::string& type,
- const std::string& value) const;
- void Add(const std::string& app_id,
- const std::string& type,
- int seconds) const;
- bool SetDefaultPolicy(const std::string& app_id);
- bool SetPredataPolicy(const std::string& app_id);
- bool SetIsPredata(const std::string& app_id, bool is_pre_data);
- bool IsPredataPolicy(const std::string& app_id) const;
- bool SetUnpairedDevice(const std::string& device_id, bool unpaired) const;
- bool UnpairedDevicesList(DeviceIds* device_ids) const;
- bool RemoveAppConsentForGroup(const std::string& policy_app_id,
- const std::string& functional_group_name) const;
-
- virtual bool SetVINValue(const std::string& value);
-
- private:
- void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
- void GatherPreconsentedGroup(const std::string& app_id,
- policy_table::Strings* groups) const;
- bool GatherUsageAndErrorCounts(
- policy_table::UsageAndErrorCounts* counts) const;
- bool GatherAppLevels(policy_table::AppLevels* apps) const;
- void GatherDeviceData(policy_table::DeviceData* data) const;
- void GatherConsentGroup(const std::string& device_id,
- policy_table::UserConsentRecords* records) const;
- bool GatherApplicationPoliciesSection(
- policy_table::ApplicationPoliciesSection* policies) const;
- bool SaveDeviceData(const policy_table::DeviceData& devices);
- bool GatherConsumerFriendlyMessages(
- policy_table::ConsumerFriendlyMessages* messages) const;
- bool SaveConsentGroup(const std::string& device_id,
- const policy_table::UserConsentRecords& records);
- bool SaveApplicationPoliciesSection(
- const policy_table::ApplicationPoliciesSection& policies);
- bool SaveSpecificAppPolicy(
- const policy_table::ApplicationPolicies::value_type& app);
- bool SaveDevicePolicy(const policy_table::DevicePolicy& device);
- bool SavePreconsentedGroup(const std::string& app_id,
- const policy_table::Strings& groups);
- bool SaveMessageString(const std::string& type,
- const std::string& lang,
- const policy_table::MessageString& strings);
-
- virtual bool SaveUsageAndErrorCounts(
- const policy_table::UsageAndErrorCounts& counts);
-
- virtual bool SaveModuleMeta(const policy_table::ModuleMeta& meta);
-
- bool SaveAppCounters(const policy_table::AppLevels& app_levels);
-
- bool SaveGlobalCounters(const policy_table::UsageAndErrorCounts& counts);
-
- bool IsExistAppLevel(const std::string& app_id) const;
-
- bool GetAllAppGroups(const std::string& policy_app_id,
- FunctionalGroupIDs& all_groups);
-
- bool GetConsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- FunctionalGroupIDs& allowed_groups,
- FunctionalGroupIDs& disallowed_groups);
-
- bool GetPreconsentedGroups(const std::string& policy_app_id,
- FunctionalGroupIDs& preconsented_groups);
-
- void FillFunctionalGroupPermissions(
- FunctionalGroupIDs& ids,
- FunctionalGroupNames& names,
- GroupConsent state,
- std::vector<FunctionalGroupPermission>& permissions);
- bool CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id,
- int* result) const;
-
- /**
- * @brief Checks, if there is message present with requested language in PT
- * @param message Message name
- * @param language Required message language
- * @return True, if message with requested language is present, otherwise -
- * false
- */
- bool IsMsgLanguagePresent(const std::string& message,
- const std::string& language);
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/include/policy/sql_pt_queries.h b/src/components/policy/include/policy/sql_pt_queries.h
deleted file mode 100644
index cf3028b0a0..0000000000
--- a/src/components/policy/include/policy/sql_pt_queries.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- Copyright (c) 2013, " Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, " with or without
- modification, " are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, " this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice, "
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
- CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
- CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR 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_SQL_PT_QUERIES_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_QUERIES_H_
-
-#include <string>
-
-namespace policy {
-namespace sql_pt {
-
-extern const std::string kSelectPriority;
-extern const std::string kCreateSchema;
-extern const std::string kDropSchema;
-extern const std::string kDeleteData;
-extern const std::string kCheckPgNumber;
-extern const std::string kCheckDBIntegrity;
-extern const std::string kSelectRpc;
-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;
-extern const std::string kSelectNotificationsPerPriority;
-extern const std::string kSelectAppLevels;
-extern const std::string kSelectDeviceData;
-extern const std::string kSelectFunctionalGroups;
-extern const std::string kSelectAllRpcs;
-extern const std::string kSelectUserMsgsVersion;
-extern const std::string kSelectAppPolicies;
-extern const std::string kCollectFriendlyMsg;
-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;
-extern const std::string kSelectDays;
-extern const std::string kSelectTimeoutResponse;
-extern const std::string kInsertFunctionalGroup;
-extern const std::string kInsertRpc;
-extern const std::string kInsertRpcWithParameter;
-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;
-extern const std::string kUpdateVersion;
-extern const std::string kUpdateModuleConfig;
-extern const std::string kInsertEndpoint;
-extern const std::string kInsertSecondsBetweenRetry;
-extern const std::string kInsertNotificationsByPriority;
-extern const std::string kInsertDeviceData;
-extern const std::string kInsertAppLevel;
-extern const std::string kDeleteSecondsBetweenRetries;
-extern const std::string kDeleteEndpoint;
-extern const std::string kDeleteAppLevel;
-extern const std::string kDeleteMessageString;
-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;
-extern const std::string kUpdateFlagUpdateRequired;
-extern const std::string kSelectFlagUpdateRequired;
-extern const std::string kUpdateCountersSuccessfulUpdate;
-extern const std::string kSelectApplicationRevoked;
-extern const std::string kUpdateApplicationCustomData;
-extern const std::string kSelectApplicationRepresented;
-extern const std::string kSelectApplicationIsDefault;
-extern const std::string kUpdateIsDefault;
-extern const std::string kInsertInitData;
-extern const std::string kDeleteAppGroupByApplicationId;
-extern const std::string kInsertApplicationFull;
-extern const std::string kDeletePreconsentedGroupsByApplicationId;
-extern const std::string kSelectApplicationFull;
-extern const std::string kUpdatePreloaded;
-extern const std::string kSelectDBVersion;
-extern const std::string kUpdateDBVersion;
-extern const std::string kSaveModuleMeta;
-extern const std::string kSelectModuleMeta;
-
-} // namespace sql_pt
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_QUERIES_H_
diff --git a/src/components/policy/include/policy/sql_pt_representation.h b/src/components/policy/include/policy/sql_pt_representation.h
deleted file mode 100644
index 89ee3788f0..0000000000
--- a/src/components/policy/include/policy/sql_pt_representation.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_SQL_PT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
-
-#include <string>
-#include <vector>
-#include "policy/pt_representation.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-namespace utils {
-namespace dbms {
-class SQLDatabase;
-} // namespace dbms
-} // namespace utils
-
-namespace policy {
-
-class SQLPTRepresentation : public virtual PTRepresentation {
- public:
- SQLPTRepresentation();
- ~SQLPTRepresentation();
- virtual void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result);
-
- virtual bool IsPTPreloaded();
- virtual int IgnitionCyclesBeforeExchange();
- virtual int KilometersBeforeExchange(int current);
- virtual bool SetCountersPassedForSuccessfulUpdate(int kilometers,
- int days_after_epoch);
- virtual int DaysBeforeExchange(int current);
- virtual void IncrementIgnitionCycles();
- virtual void ResetIgnitionCycles();
- virtual int TimeoutResponse();
- virtual bool SecondsBetweenRetries(std::vector<int>* seconds);
- virtual bool RefreshDB();
- virtual const VehicleInfo GetVehicleInfo() const;
-
- 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);
- InitResult Init(const PolicySettings* settings);
- 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 = NULL,
- StringArray* app_hmi_types = NULL);
- bool GetFunctionalGroupings(policy_table::FunctionalGroupings& groups);
-
-#ifdef BUILD_TESTS
- uint32_t open_counter() {
- return open_counter_;
- }
-#endif // BUILD_TESTS
- protected:
- virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
- virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
- virtual bool GatherUsageAndErrorCounts(
- policy_table::UsageAndErrorCounts* counts) const;
- virtual void GatherDeviceData(policy_table::DeviceData* data) const;
- virtual bool GatherFunctionalGroupings(
- policy_table::FunctionalGroupings* groups) const;
- virtual bool GatherConsumerFriendlyMessages(
- policy_table::ConsumerFriendlyMessages* messages) 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;
-
- virtual bool SaveApplicationCustomData(const std::string& app_id,
- bool is_revoked,
- bool is_default,
- bool is_predata);
-
- virtual bool SaveModuleMeta(const policy_table::ModuleMeta& meta);
- virtual bool SaveModuleConfig(const policy_table::ModuleConfig& config);
- virtual bool SaveUsageAndErrorCounts(
- const policy_table::UsageAndErrorCounts& counts);
- virtual bool SaveDeviceData(const policy_table::DeviceData& devices);
- virtual bool SaveFunctionalGroupings(
- const policy_table::FunctionalGroupings& groups);
- virtual bool SaveConsumerFriendlyMessages(
- const policy_table::ConsumerFriendlyMessages& messages);
- 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,
- const policy_table::MessageString& strings);
-
- bool SaveAppGroup(const std::string& app_id,
- const policy_table::Strings& app_groups);
- bool SaveNickname(const std::string& app_id,
- 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;
- void SaveUpdateRequired(bool value);
-
- bool IsApplicationRepresented(const std::string& app_id) const;
- bool CopyApplication(const std::string& source,
- const std::string& destination);
-
- bool IsApplicationRevoked(const std::string& app_id) const;
- virtual bool IsDefaultPolicy(const std::string& app_id) const;
- virtual bool IsPredataPolicy(const std::string& app_id) const;
- virtual bool SetDefaultPolicy(const std::string& app_id);
- virtual void SetPreloaded(bool value);
-
- virtual bool SetVINValue(const std::string& value);
-
- virtual utils::dbms::SQLDatabase* db() const;
- virtual bool SetIsDefault(const std::string& app_id, bool is_default) const;
-
- void RemoveDB() const OVERRIDE;
- virtual bool IsDBVersionActual() const OVERRIDE;
- virtual bool UpdateDBVersion() const OVERRIDE;
-
- private:
- static const std::string kDatabaseName;
- utils::dbms::SQLDatabase* db_;
-
-#ifdef BUILD_TESTS
- uint32_t open_counter_;
-#endif // BUILD_TESTS
-
- /**
- * @brief Calculates DB version from current schema
- * @return version
- */
- const int32_t GetDBVersion() const;
- bool SaveRpcs(int64_t group_id, const policy_table::Rpc& rpcs);
- bool SaveServiceEndpoints(const policy_table::ServiceEndpoints& endpoints);
- bool SaveSecondsBetweenRetries(
- const policy_table::SecondsBetweenRetries& seconds);
- bool SaveNumberOfNotificationsPerMinute(
- const policy_table::NumberOfNotificationsPerMinute& notifications);
- bool SaveMessageType(const std::string& type);
- bool SaveLanguage(const std::string& code);
-
- bool is_in_memory;
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
diff --git a/src/components/policy/include/policy/sql_wrapper.h b/src/components/policy/include/policy/sql_wrapper.h
deleted file mode 100644
index d6639f6635..0000000000
--- a/src/components/policy/include/policy/sql_wrapper.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_SQL_WRAPPER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_WRAPPER_H_
-
-#if __QNX__
-#include "qdb_wrapper/sql_database.h"
-#include "qdb_wrapper/sql_query.h"
-#else // __QNX__
-#include "sqlite_wrapper/sql_database.h"
-#include "sqlite_wrapper/sql_query.h"
-#endif // __QNX__
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_SQL_WRAPPER_H_
diff --git a/src/components/policy/include/policy/update_status_manager.h b/src/components/policy/include/policy/update_status_manager.h
deleted file mode 100644
index b4f52a8b03..0000000000
--- a/src/components/policy/include/policy/update_status_manager.h
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef SRC_COMPONENTS_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H
-
-#include "policy/policy_types.h"
-#include "utils/lock.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
-#include "utils/conditional_variable.h"
-#include "utils/lock.h"
-#include "utils/logger.h"
-#include "utils/macro.h"
-
-namespace policy {
-
-class PolicyListener;
-
-class UpdateStatusManager {
- public:
- /**
- * @brief Constructor
- */
- UpdateStatusManager();
-
- ~UpdateStatusManager();
-
- /**
- * @brief Sets listener pointer
- * @param listener Pointer to policy listener implementation
- */
- void set_listener(PolicyListener* listener);
-
- /**
- * @brief Update status hanlder for PTS sending out
- * @param update_timeout Timeout for waiting of incoming PTU
- */
- void OnUpdateSentOut(uint32_t update_timeout);
-
- /**
- * @brief Update status handler for PTU waiting timeout
- */
- void OnUpdateTimeoutOccurs();
-
- /**
- * @brief Update status handler for valid PTU receiving
- */
- void OnValidUpdateReceived();
-
- /**
- * @brief Update status handler for wrong PTU receiving
- */
- void OnWrongUpdateReceived();
-
- /**
- * @brief Update status handler for reset PT to default state
- * @param is_update_required Update necessity flag
- */
- void OnResetDefaultPT(bool is_update_required);
-
- /**
- * @brief Update status handler for restarting retry sequence
- */
- void OnResetRetrySequence();
-
- /**
- * @brief Update status handler on new application registering
- */
- void OnNewApplicationAdded();
-
- /**
- * @brief Update status handler for policy initialization
- * @param is_update_required Update necessity flag
- */
- void OnPolicyInit(bool is_update_required);
-
- /**
- * @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.
- */
- 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();
-
-#ifdef BUILD_TESTS
- PolicyTableStatus GetLastUpdateStatus() const {
- return GetUpdateStatus();
- }
-#endif // BUILD_TESTS
-
- private:
- /*
- * @brief Sets flag for update progress
- *
- * @param value
- */
- void set_exchange_in_progress(bool value);
-
- /*
- * @brief Sets flag for pending update
- *
- * @param value
- */
- void set_exchange_pending(bool value);
-
- /*
- * @brief Sets flag for update necessity
- *
- * @param value
- */
- void set_update_required(bool value);
-
- /**
- * @brief Check update status and notify HMI on changes
- */
- 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 {
- 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_;
- };
-
- UpdateThreadDelegate* update_status_thread_delegate_;
- threads::Thread* thread_;
-};
-}
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H
diff --git a/src/components/policy/include/policy/update_status_manager_interface.h b/src/components/policy/include/policy/update_status_manager_interface.h
deleted file mode 100644
index 4c74910791..0000000000
--- a/src/components/policy/include/policy/update_status_manager_interface.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
-#define SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
-
-#include "utils/shared_ptr.h"
-#include "policy/policy_types.h"
-
-namespace policy {
-
-class PolicyListener;
-
-class UpdateStatusManagerInterface {
- public:
- virtual ~UpdateStatusManagerInterface() {}
- /**
- * @brief Sets listener pointer
- * @param listener Pointer to policy listener implementation
- */
- virtual void set_listener(PolicyListener* listener) = 0;
-
- /**
- * @brief Update status hanlder for PTS sending out
- * @param update_timeout Timeout for waiting of incoming PTU
- */
- virtual void OnUpdateSentOut(uint32_t update_timeout) = 0;
-
- /**
- * @brief Update status handler for PTU waiting timeout
- */
- virtual void OnUpdateTimeoutOccurs() = 0;
-
- /**
- * @brief Update status handler for valid PTU receiving
- */
- virtual void OnValidUpdateReceived() = 0;
-
- /**
- * @brief Update status handler for wrong PTU receiving
- */
- virtual void OnWrongUpdateReceived() = 0;
-
- /**
- * @brief Update status handler for reset PT to default state
- * @param is_update_required Update necessity flag
- */
- virtual void OnResetDefaultPT(bool is_update_required) = 0;
-
- /**
- * @brief Update status handler for restarting retry sequence
- */
- virtual void OnResetRetrySequence() = 0;
-
- /**
- * @brief Update status handler on new application registering
- */
- virtual void OnNewApplicationAdded() = 0;
-
- /**
- * @brief Update status handler for policy initialization
- * @param is_update_required Update necessity flag
- */
- virtual void OnPolicyInit(bool is_update_required) = 0;
-
- /**
- * @brief Returns current policy update status
- * @return
- */
- virtual PolicyTableStatus GetUpdateStatus() = 0;
-};
-
-typedef utils::SharedPtr<UpdateStatusManagerInterface>
- UpdateStatusManagerInterfaceSPtr;
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
diff --git a/src/components/policy/include/policy/usage_statistics/app_stopwatch.h b/src/components/policy/include/policy/usage_statistics/app_stopwatch.h
deleted file mode 100644
index 0f9ce35459..0000000000
--- a/src/components/policy/include/policy/usage_statistics/app_stopwatch.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
-
-#include "policy/usage_statistics/statistics_manager.h"
-
-namespace usage_statistics {
-
-class AppStopwatch {
- public:
- virtual ~AppStopwatch() {}
- virtual void Start(AppStopwatchId stopwatch_type) = 0;
- virtual void Switch(AppStopwatchId stopwatch_type) = 0;
- virtual void WriteTime() = 0;
-};
-
-} // namespace usage_statistics
-
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
diff --git a/src/components/policy/include/policy/usage_statistics/counter.h b/src/components/policy/include/policy/usage_statistics/counter.h
deleted file mode 100644
index 6f50013bcd..0000000000
--- a/src/components/policy/include/policy/usage_statistics/counter.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_USAGE_STATISTICS_COUNTER_H
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H
-
-#include <ctime>
-#include "policy/usage_statistics/statistics_manager.h"
-#include "policy/usage_statistics/app_stopwatch.h"
-#include "utils/shared_ptr.h"
-#include "utils/timer.h"
-#include "utils/macro.h"
-
-namespace usage_statistics {
-
-using timer::Timer;
-
-class GlobalCounter {
- public:
- GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
- GlobalCounterId counter_type);
- void operator++() const;
-
- private:
- GlobalCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
-};
-
-class AppCounter {
- public:
- AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
- const std::string& app_id,
- AppCounterId counter_type);
- void operator++() const;
-
- private:
- std::string app_id_;
- AppCounterId counter_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
-};
-
-class AppInfo {
- public:
- AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
- const std::string& app_id,
- AppInfoId info_type);
- void Update(const std::string& new_info) const;
-
- private:
- std::string app_id_;
- AppInfoId info_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
-};
-
-class AppStopwatchImpl : public AppStopwatch {
- public:
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
- const std::string& app_id);
- AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
- const std::string& app_id,
- std::uint32_t timeout);
- void Start(AppStopwatchId stopwatch_type) OVERRIDE;
- void Switch(AppStopwatchId stopwatch_type) OVERRIDE;
- void WriteTime() OVERRIDE;
-
- private:
- // Fields
- std::string app_id_;
- AppStopwatchId stopwatch_type_;
- utils::SharedPtr<StatisticsManager> statistics_manager_;
- timer::Timer timer_;
- const std::uint32_t time_out_;
- DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
-};
-
-} // namespace usage_statistics
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H
diff --git a/src/components/policy/include/policy/user_consent_manager.h b/src/components/policy/include/policy/user_consent_manager.h
deleted file mode 100644
index 55c6239a6c..0000000000
--- a/src/components/policy/include/policy/user_consent_manager.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_USER_CONSENT_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
-
-namespace policy {
-class UserConsentManager {
- public:
- UserConsentManager() {}
- ~UserConsentManager() {}
-};
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
diff --git a/src/components/policy/policy_external/.gitignore b/src/components/policy/policy_external/.gitignore
new file mode 100644
index 0000000000..d67909069a
--- /dev/null
+++ b/src/components/policy/policy_external/.gitignore
@@ -0,0 +1,79 @@
+*.a
+*.so
+*.cmake
+!cmake/
+bin
+build
+CMakeFiles
+*-prefix
+Makefile
+CMakeCache.txt
+CMakeLists.txt.user
+install_manifest.txt
+*.o
+*.lo
+.libs
+*.la
+*.kdev4
+*.*~
+.project
+.cproject
+*.pyc
+*.swp
+
+# logs
+*.log
+
+# binaries
+src/appMain/hmi_link
+src/appMain/smartDeviceLinkCore
+test/components/application_manager/policies_manager/test_policies_table
+test/components/application_manager/test_formatters_commands
+test/components/dbus/test_DBusAdapter
+test/components/dbus/test_DBusSchema
+test/components/protocol_handler/test_ProtocolHandler
+test/components/request_watchdog/test_RequestWatchdog
+test/components/smart_objects/SchemaItem/test_SmartObject_AlwaysFalseSchemaItemTest
+test/components/smart_objects/SchemaItem/test_SmartObject_AlwaysTrueSchemaItemTest
+test/components/smart_objects/SchemaItem/test_SmartObject_ArraySchemaItemTest
+test/components/smart_objects/SchemaItem/test_SmartObject_BoolSchemaItemTest
+test/components/smart_objects/SchemaItem/test_SmartObject_EnumSchemaItemTest
+test/components/smart_objects/SchemaItem/test_SmartObject_NumberSchemaItemTest
+test/components/smart_objects/SchemaItem/test_SmartObject_ObjectSchemaItemTest
+test/components/smart_objects/SchemaItem/test_SmartObject_StringSchemaItemTest
+test/components/smart_objects/test_SmartObject_ConvertionTimeTest
+test/components/smart_objects/test_SmartObject_DraftTest
+test/components/smart_objects/test_SmartObject_InvalidTest
+test/components/smart_objects/test_SmartObject_StressTest
+test/components/smart_objects/test_SmartObject_UnitTest
+test/components/smart_objects/test_TSharedPtrTest
+test/components/transport_manager/test_DnssdServiceDiscovery
+test/components/transport_manager/test_TcpTransportAdapter
+test/components/transport_manager/test_TransportManagerTest
+test/components/utils/test_Utils
+test/test_suit
+
+# libraries
+
+# install folders
+
+# ctags-generated
+tags
+
+# Qt
+moc_*.cpp
+*.pro.user
+*.qmlproject.user
+*_automoc.cpp
+
+# generated files
+
+# Mac OS Specific
+.DS_Store
+# Android specific
+*.iml
+*.orig
+.idea
+.gradle
+local.properties
+mobile/android/FordSnadbox
diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt
new file mode 100644
index 0000000000..8d04f20470
--- /dev/null
+++ b/src/components/policy/policy_external/CMakeLists.txt
@@ -0,0 +1,125 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+# --- Policy
+set(target Policy)
+set(install_destination bin)
+set(copy_destination ${CMAKE_BINARY_DIR}/src/appMain)
+set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+
+include_directories (
+ include
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/config_profile/include
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${JSONCPP_INCLUDE_DIRECTORY}
+)
+
+set(SOURCES
+ ${POLICY_PATH}/src/policy_manager_impl.cc
+ ${POLICY_PATH}/src/policy_helper.cc
+ ${POLICY_PATH}/src/policy_table.cc
+ ${POLICY_PATH}/src/sql_pt_queries.cc
+ ${POLICY_PATH}/src/sql_pt_representation.cc
+ ${POLICY_PATH}/src/update_status_manager.cc
+ ${POLICY_PATH}/src/status.cc
+ ${POLICY_PATH}/src/cache_manager.cc
+ ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
+)
+
+if (REMOTE_CONTROL)
+ list(APPEND SOURCES ${POLICY_PATH}/src/access_remote_impl.cc)
+endif()
+
+list(APPEND SOURCES
+ ${POLICY_PATH}/src/sql_pt_ext_queries.cc
+ ${POLICY_PATH}/src/sql_pt_ext_representation.cc
+)
+
+set(LIBRARIES ConfigProfile policy_struct dbms jsoncpp Utils)
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ # --- QDB Wrapper
+ include_directories (${COMPONENTS_DIR}/utils/include/utils)
+else ()
+ # --- SQLite Wrapper
+ include_directories (${COMPONENTS_DIR}/utils/include/utils)
+ list(APPEND LIBRARIES sqlite3)
+endif ()
+
+add_library(${target} SHARED ${SOURCES})
+target_link_libraries(${target} ${LIBRARIES} )
+
+if (ENABLE_LOG)
+ target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+add_custom_target(copy_library_${target} ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
+ ${copy_destination}
+ DEPENDS ${target}
+ COMMENT "Copying library ${library_name}")
+
+install(TARGETS ${target}
+ DESTINATION ${install_destination}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+# --- Table struct
+set(struct_target policy_struct)
+
+set(TABLE_STRUCT_SOURCES
+ ${POLICY_PATH}/src/policy_table/enums.cc
+ ${POLICY_PATH}/src/policy_table/types.cc
+ ${POLICY_PATH}/src/policy_table/validation.cc
+)
+
+add_library(${struct_target} ${TABLE_STRUCT_SOURCES})
+target_link_libraries(${struct_target} Utils)
+
+# --- Usage statistics
+set(USAGE_STATISTICS_SOURCES
+ ./src/usage_statistics/counter.cc
+)
+
+add_library(UsageStatistics ${USAGE_STATISTICS_SOURCES})
+target_link_libraries(UsageStatistics Utils)
+
+#======================= Unit-Test section =======================
+if (BUILD_TESTS)
+ add_subdirectory(test)
+endif()
+#=================================================================
diff --git a/src/components/policy/Readme.txt b/src/components/policy/policy_external/Readme.txt
index 370fab238a..370fab238a 100644
--- a/src/components/policy/Readme.txt
+++ b/src/components/policy/policy_external/Readme.txt
diff --git a/src/components/policy/doc/doxygen/components/AppMgr/index.txt b/src/components/policy/policy_external/doc/doxygen/components/AppMgr/index.txt
index 17584b09e1..17584b09e1 100644
--- a/src/components/policy/doc/doxygen/components/AppMgr/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/AppMgr/index.txt
diff --git a/src/components/policy/doc/doxygen/components/HMI/index.txt b/src/components/policy/policy_external/doc/doxygen/components/HMI/index.txt
index 361763118d..361763118d 100644
--- a/src/components/policy/doc/doxygen/components/HMI/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/HMI/index.txt
diff --git a/src/components/policy/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
index 9854b88d5f..9854b88d5f 100644
--- a/src/components/policy/doc/doxygen/components/JSONHandler/Formatters/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/Formatters/index.txt
diff --git a/src/components/policy/doc/doxygen/components/JSONHandler/index.txt b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/index.txt
index a65c8ddc7d..a65c8ddc7d 100644
--- a/src/components/policy/doc/doxygen/components/JSONHandler/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/JSONHandler/index.txt
diff --git a/src/components/policy/doc/doxygen/components/ProtocolHandler/index.txt b/src/components/policy/policy_external/doc/doxygen/components/ProtocolHandler/index.txt
index c5b5ceb79c..c5b5ceb79c 100644
--- a/src/components/policy/doc/doxygen/components/ProtocolHandler/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/ProtocolHandler/index.txt
diff --git a/src/components/HMI/IVSU/PROPRIETARY_REQUEST~ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart
index e69de29bb2..e69de29bb2 100644
--- a/src/components/HMI/IVSU/PROPRIETARY_REQUEST~
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
new file mode 100644
index 0000000000..6505ae6f43
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/Value representation.txt
@@ -0,0 +1,25 @@
+/*! \page components_smartobjects_types_repr Type value representation methods for SmartObjects
+
+As alternative to the type casts NsSmartDeviceLink::NsSmartObjects::CSmartObject class defines set of usable methods that allow to represent object values as desired type. Use of these methods may change code style and readability but functionally it completely similar to the type casts of Smart Objects.
+
+Example:
+
+<pre>
+NsSmartDeviceLink::NsSmartObjects::CSmartObject obj;
+
+obj[0] = 1;
+
+obj[1] = true;
+
+obj[2] = 'a';
+
+obj[3] = 3.14;
+
+int i = obj[0].asInt();
+
+char c = obj[1].asChar();
+
+double d = obj[2].asDouble();
+</pre>
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/index.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/index.txt
new file mode 100644
index 0000000000..61ca201507
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Types/index.txt
@@ -0,0 +1,9 @@
+/*! \page components_smartobjects_types Smart Objects Types
+
+Current implementation of Smart Objects contains definitions that allow working with every Smart Object
+as variable of one of the basic types: bool, int, long, double, char, string (both as char* and std::string), array and map.
+
+There are two different ways to work with type values in SmartObjects:
+ - \subpage components_smartobjects_types_cast "Type cast for SmartObjects"
+ - \subpage components_smartobjects_types_repr "Type value representation methods for SmartObjects"
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
new file mode 100644
index 0000000000..2e611f74b9
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Schema Structure.txt
@@ -0,0 +1,101 @@
+/*! \page components_smartobjects_validation_items Schema structure: Schema Items
+
+In order to create new Schema (new object of class NsSmartDeviceLink::NsSmartObjects::CSmartSchema) client first must define all required Schema Items. Actually every Schema is a tree of respective Schema Items. Each node and leaf of that tree defines structural rules for some Smart Object data structure.
+
+Schema Items are represented as class hierarchy. The base class for all schema items is a NsSmartDeviceLink::NsSmartObjects::ISchemaItem class. This base class defines generic validation interface for Schema Items.
+
+To define special elements with always successful or always failing validation there are two special Schema Items: NsSmartDeviceLink::NsSmartObjects::CAlwaysTrueSchemaItem and NsSmartDeviceLink::NsSmartObjects::CAlwaysFalseSchemaItem.
+
+NsSmartDeviceLink::NsSmartObjects::CBoolSchemaItem is used for boolean values and has no parameters (only verifies that respective Smart Object is really has boolean value).
+
+NsSmartDeviceLink::NsSmartObjects::TNumberSchemaItem is template Schema Item that can be used for both integer and floating point values. In addition to the regular type verification it is possible to set min and max value range (these values are optional).
+
+NsSmartDeviceLink::NsSmartObjects::TEnumSchemaItem is used to verify any custom client-defined enum.
+
+NsSmartDeviceLink::NsSmartObjects::CStringSchemaItem is used to verify a string values. As optional parameter max length of the string could be set.
+
+NsSmartDeviceLink::NsSmartObjects::CArraySchemaItem provides validation for array. Can be used to verify special type and array size.
+
+NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem used in case when Schema Item includes another Schema Item. Actually this is only way to create tree node of new Schema. All other Schema Items will be used only to become leafs of validation tree.
+
+After creation of all required Schema Items (which is actually bind in the tree) it is possible to create Schema.
+Schema can be initialized not only by raw root Schema Item, but also by special abstraction called Member (defined by NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem::SMember class). So every root item (NsSmartDeviceLink::NsSmartObjects::CObjectSchemaItem) firstly should be wrapped as Member. This wrapping process also allows to set "is mandatory" status for every Member.
+
+ and pass root Schema Item as initial parameter to the new Schema.
+
+Currently Schemas are generated by the InterfaceGenerator. For supported ALRPC.v1/.v2 Schema has following structure:
+
+<pre>
+
+ROOT
+ |
+ -- PARAMS
+ | |
+ | -- FUNCTION_ID
+ | |
+ | -- MESSAGE_TYPE
+ | |
+ | -- CORRELATION_ID
+ | |
+ | -- PROTOCOL_VERSION
+ | |
+ | -- PROTOCOL_TYPE
+ |
+ -- MSG_PARAMS
+ |
+ -- OBJECT
+ |
+ -- (Actually contains function-specific leaf item)
+ ...
+</pre>
+
+Example:
+
+<pre>
+
+// Function parameter success.
+//
+// true, if successful
+// false, if failed
+TSharedPtr<ISchemaItem> success_SchemaItem = CBoolSchemaItem::create(TSchemaItemParameter<bool>());
+
+// Function parameter resultCode.
+//
+// See Result
+TSharedPtr<ISchemaItem> resultCode_SchemaItem = TEnumSchemaItem<Result::eType>::create(resultCode_allowedEnumSubsetValues, TSchemaItemParameter<Result::eType>());
+
+// Function parameter info.
+//
+// Provides additional human readable info regarding the result.
+TSharedPtr<ISchemaItem> info_SchemaItem = CStringSchemaItem::create(TSchemaItemParameter<size_t>(1000), TSchemaItemParameter<std::string>());
+
+schemaMembersMap["success"] = CObjectSchemaItem::SMember(success_SchemaItem, true);
+
+schemaMembersMap["resultCode"] = CObjectSchemaItem::SMember(resultCode_SchemaItem, true);
+
+schemaMembersMap["info"] = CObjectSchemaItem::SMember(info_SchemaItem, false);
+
+std::map<std::string, CObjectSchemaItem::SMember> paramsMembersMap;
+
+paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_FUNCTION_ID] = CObjectSchemaItem::SMember(TEnumSchemaItem<FunctionID::eType>::create(FunctionIDItems), true);
+
+paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_MESSAGE_TYPE] = CObjectSchemaItem::SMember(TEnumSchemaItem<messageType::eType>::create(MessageTypeItems), true);
+
+paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_CORRELATION_ID] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+
+paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_VERSION] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(1, 2), true);
+
+paramsMembersMap[NsSmartDeviceLink::NsJSONHandler::strings::S_PROTOCOL_TYPE] = CObjectSchemaItem::SMember(TNumberSchemaItem<int>::create(), true);
+
+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);
+
+
+CSmartSchema(CObjectSchemaItem::create(rootMembersMap));
+
+</pre>
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
new file mode 100644
index 0000000000..a02f0be4bd
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/Validation.txt
@@ -0,0 +1,9 @@
+/*! \page components_smartobjects_validation_use Using Schema for validation
+
+The main purpose of Schema is validation of existing Smart Object. This process includes type and value validation. The client can use results of validation to determine if given Smart Object is valid or not. Validation of specific Smart Object can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::validate method. Internally Schema triggers respective validate method of every Schema Item in order to perform validation.
+
+Another feature of Schema is capability to be applied to the Smart Object. Applying means that Schema tries to modify object to "normalize" data. Currently this "normalization" effects on string representation of enums. Applying of the Schema can be triggered by using NsSmartDeviceLink::NsSmartObjects::CSmartSchema::applySchema method. Internally Schema triggers respective apply method of every Schema Item and at the moment only enum Schema Items try to covert string representation to enum values.
+
+To "unapply" modifications done by apply feature Schema has NsSmartDeviceLink::NsSmartObjects::CSmartSchema::unapplySchema method. It can be used to make string representations of enums.
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/index.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/index.txt
new file mode 100644
index 0000000000..d425791873
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Smart Objects Validation/index.txt
@@ -0,0 +1,10 @@
+/*! \page components_smartobjects_validation Smart Objects validation
+
+The mechanism of Smart Objects validation includes special Schema. This Schema is similar to the regular XML schema. In other words Schema defines structural description of desired object. After that definition is done Schema can be applied to the object in order to make validation.
+
+Every Schema is constructed from objects called SchemaItems. Every SchemaItem defines type and restriction of specific data structure.
+
+For more details please review:
+ - \subpage components_smartobjects_validation_items "Schema structure: Schema Items"
+ - \subpage components_smartobjects_validation_use "Using Schema for validation"
+*/
diff --git a/src/components/HMI/images/media/bcs-item_bgL_pressed.png b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Use
index e69de29bb2..e69de29bb2 100644
--- a/src/components/HMI/images/media/bcs-item_bgL_pressed.png
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Use
diff --git a/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Use of Smart Objects/index.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Use of Smart Objects/index.txt
new file mode 100644
index 0000000000..d270436890
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/Use of Smart Objects/index.txt
@@ -0,0 +1,6 @@
+/*! \page components_smartobjects_usage Use Smart Objects
+
+There are lots of useful applications for the Smart Objects. They allow building complex dynamic data
+structures in runtime and can be used to store and provide almost any data. For example any array can contain an item which is other array and so on.
+
+*/
diff --git a/src/components/policy/doc/doxygen/components/SmartObjects/index.txt b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/index.txt
index 3844e1ab69..3844e1ab69 100644
--- a/src/components/policy/doc/doxygen/components/SmartObjects/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/SmartObjects/index.txt
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
new file mode 100644
index 0000000000..2ba273e9d4
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/ConnectionManagement.txt
@@ -0,0 +1,11 @@
+/** @page components_transportmanager_client_connection_management Connection Management
+ *
+ * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * in order to receive notifications.
+ * To connect remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::connectDevice(). It will initiate connections to all
+ * applications running on remove device. For TCP device this call has no effect as TCP connections are initiated by remote devices.
+ * Client will be notified about each connected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationConnected().
+ * To disconnect all applications running on remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::disconnectDevice().
+ * Client will be notified about each disconnected application with NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onApplicationDisconnected().
+ */
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
new file mode 100644
index 0000000000..98dd7426be
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DataTransfer.txt
@@ -0,0 +1,11 @@
+/** @page components_transportmanager_client_data_transfer Data Transfer
+ *
+ * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener
+ * interface and add itself as a data listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDataListener()
+ * in order to receive notifications.
+ * To send frame to remote device client must use NsSmartDeviceLink::NsTransportManager::ITransportManager::sendFrame() poviding connection handle,
+ * frame data, data size and user data. User data is an integer that is assigned to a frame and will be sent back to client when sending of frame
+ * will be completed. Client may use this data to identify frame when send result will be reported. When sending of frame is completed
+ * client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameSendCompleted(). When frame is received from a remote
+ * device client is notified via NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener::onFrameReceived().
+ */
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
new file mode 100644
index 0000000000..eb5f3e477e
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/DeviceManagement.txt
@@ -0,0 +1,14 @@
+/** @page components_transportmanager_client_device_management Device Management
+ *
+ * As all requests to TransportManager are asynchronous, client must implement NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener
+ * interface and add itself as a device listener with NsSmartDeviceLink::NsTransportManager::ITransportManager::addDeviceListener()
+ * in order to receive notifications.
+ * Client of TransportManager may use NsSmartDeviceLink::NsTransportManager::ITransportManager::scanForNewDevices()
+ * to initiate device scan on all device adapters that support this feature. In order to get list of available
+ * devices client must override NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener::onDeviceListUpdated().
+ * Each device adapter will perform scan independently from other device adapters and device list might be updated
+ * several times (after each adapter that supports scanning finishes scanning operation). Device list might also be
+ * updated without device scan request, e.g. if new client connects via TCP this device will be added to device list
+ * and update notification will be sent to client. In any of these cases client will be provided with the full
+ * device list from all device adapters in every notification.
+ */
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
new file mode 100644
index 0000000000..8916dbeb55
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Client Specification/index.txt
@@ -0,0 +1,18 @@
+/*! \page components_transportmanager_client Transport Manager Client Specification
+
+This chapter describes details of correct use of Transport Manager on the client side. In other words this chapter can be called "How to create effective and safe client of Transport Manager".
+Transport Manager defines set of asynchronous requests (means that operations are non-blocking in the calling thread) and provides two different interfaces to monitor asynchronous responses and notifications about data update.
+
+Clients of Transport Manager should use NsSmartDeviceLink::NsTransportManager::ITransportManager interface to initiate any request to the component.
+Also Transport Manager provides two different interfaces:
+
+1) NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener. Client can implement this interface if it needs information about data frame send/receive.
+
+2) NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener. Client can implement this interface if it needs information about updates of devices available for communication and current client applications status.
+
+For more information about typical use of Transport Manager please read the following topics:
+ - \subpage components_transportmanager_client_device_management "Device Management"
+ - \subpage components_transportmanager_client_connection_management "Connection Management"
+ - \subpage components_transportmanager_client_data_transfer "Data Transfer"
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
new file mode 100644
index 0000000000..970aeffd83
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/BluetoothAdapter.txt
@@ -0,0 +1,19 @@
+/** @page components_transportmanager_internal_design_transport_adapters_bluetooth_adapter Bluetooth Adapter
+ *
+ * Bluetooth adapter handles communication with external devices via bluetooth. It is implemented in
+ * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter.
+ *
+ * @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_discovery Device discovery
+ *
+ * When requested by a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::scanForNewDevices() bluetooth adapter
+ * searches for bluetooth devices. For each found device it runs SDP query for service with SmartDeviceLink UUID
+ * (936DA01F-9ABD-4D9D-80C7-02AF85C822A8). Devices that support this service are added to bluetooth adapter device list.
+ * Bluetooth device scans are performed only when explicitly requested.
+ *
+ * @section components_transportmanager_internal_design_transport_adapters_bluetooth_adapter_connecting_devices Connecting devices
+ *
+ * NsSmartDeviceLink::NsTransportManager::CBluetoothAdapter::createConnectionsListForDevice() runs SDP query for specified device
+ * and fills connection list with connections to all RFCOMM channels on remote device where SmartDeviceLink service has been discovered.
+ *
+ * @see @ref components_transportmanager_internal_design_transport_adapters_common_connecting_devices
+ */
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
new file mode 100644
index 0000000000..d81b70dfe8
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/TCPAdapter.txt
@@ -0,0 +1,20 @@
+/** @page components_transportmanager_internal_design_transport_adapters_tcp_adapter TCP Adapter
+ *
+ * TCP adapter handles communication with remote devices via TCP/IP socket. It is implemented in
+ * NsSmartDeviceLink::NsTransportManager::CTCPAdapter.
+ *
+ * @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_listen Listening for connections
+ *
+ * TCP adapter creates listening TCP socket (TCP port is specified in NsSmartDeviceLink::NsTransportManager::CTCPAdapter::cTCPAdapterPort)
+ * and listens for incoming connections. Devices are identified by their IP address.
+ *
+ * @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_accept Accepting connection
+ *
+ * When TCP adapter accepts connection it checks if there is a device with IP address matching with IP address of accepted connection.
+ * If there is no such device, then this device is added and device list is updated.
+ *
+ * @section components_transportmanager_internal_design_transport_adapters_tcp_adapter_disconnecting Disconnecting
+ *
+ * When socket gets disconnected TCP adapter checks if there is another opened connection for IP address of disconnected application.
+ * If it was the last application from this IP address then device with this IP address is removed and devices list is updated.
+ */
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
new file mode 100644
index 0000000000..3a5d0f0e91
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Device Adapters/index.txt
@@ -0,0 +1,89 @@
+/** @page components_transportmanager_internal_design_transport_adapters Device Adapters
+ *
+ * TransportManager communicates with actual devices via device adapters.
+ *
+ * @section components_transportmanager_internal_design_transport_adapters_common Common logic
+ *
+ * Logic common to all device adapters is implemented in class NsSmartDeviceLink::NsTransportManager::CTransportAdapter.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_devices_map Devices map
+ *
+ * Devices map is a map of device handle to internal device structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SDevice.
+ * Devices map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevices. Any access to this map must be performed
+ * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDevicesMutex locked.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_connections_map Connections map
+ *
+ * Connections map is a map of connection handle to internal connection structure NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection.
+ * Connections map is stored in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnections. Any access to this map must be performed
+ * with NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mConnectionsMutex locked.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_main_thread Device adapter main thread
+ *
+ * Device adapter main thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::run().
+ * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mainThread()
+ * and implement its specific main thread logic there.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_connection_thread Device adapter connection thread
+ *
+ * Device adapter connection thread is started in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection().
+ * Specific device adapter must implement virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectionThread()
+ * and implement its specific connection thread logic there. When connection is established and socket file descriptor is set
+ * in NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mConnectionSocket specific device adapter may call
+ * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() to handle all communication through this socket
+ * until connection is terminated.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_threads_termination Termination of device adapter threads
+ *
+ * Specific device adapter implementation must call in its destructor NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForThreadsTermination()
+ * to wait for termination of all threads (main thread and connection threads). Device adapter threads must be terminated before specific
+ * device adapter class is destructed, so it can't be called in the destructor of base class and must be called explicitly from the inherited
+ * class's destructor.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_device_scan Requesting scan for new devices
+ *
+ * Device scan is requested by setting flag NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequested
+ * and signaling conditional variable NsSmartDeviceLink::NsTransportManager::CTransportAdapter::mDeviceScanRequestedCond, which may be monitored
+ * by specific device adapter if it supports device scanning. Specific device adaptere may call for this purpose
+ * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::waitForDeviceScanRequest() which will wait on this conditional variable
+ * until it's signaled or specified timeout expires.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_connecting_devices Connecting devices
+ *
+ * Device connection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::connectDevice().
+ * This method calls virtual function NsSmartDeviceLink::NsTransportManager::CTransportAdapter::createConnectionsListForDevice()
+ * which may be implemented by specific device adapter to create a list of connections that must be established for the device.
+ * For each connection created by device adapter it calls NsSmartDeviceLink::NsTransportManager::CTransportAdapter::startConnection()
+ * which adds connection to connections map and starts connection thread.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_disconnecting_devices Disconnecting devices
+ *
+ * Device disconnection is initiated with a call to NsSmartDeviceLink::NsTransportManager::CTransportAdapter::disconnectDevice().
+ * This method finds all connections in connections map that corresponds to specified device and calls
+ * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::stopConnection() for each of them.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_handling_communication Handling communication
+ *
+ * All frames requested to be sent via NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() are stored in
+ * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mFramesToSend. Pipe
+ * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mNotificationPipeFds is used by
+ * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() to notify connection thread that data is available
+ * to be sent. NsSmartDeviceLink::NsTransportManager::CTransportAdapter::sendFrame() writes one byte to the write end of this pipe.
+ * NsSmartDeviceLink::NsTransportManager::CTransportAdapter::handleCommunication() uses poll() to wait for
+ * incoming data using connection socket file descriptor and outgoing data using file descriptor of the read end of this pipe.
+ * When either of them become available for reading or some error occurs (e.g. socket gets disconnected) connection thread
+ * wakes up and handles this event. Notification pipe is also used to notify connection thread that connection has to be
+ * terminated using NsSmartDeviceLink::NsTransportManager::CTransportAdapter::SConnection::mTerminateFlag.
+ *
+ * @subsection components_transportmanager_internal_design_transport_adapters_common_update_client_device_list Updating client device list.
+ *
+ * Specific device adapter may call NsSmartDeviceLink::NsTransportManager::CTransportAdapter::updateClientDeviceList() when its internal
+ * knowledge about available devices is updated to notify device adapter client (TransportManager) about this update.
+ *
+ * @section components_transportmanager_internal_design_transport_adapters_common_specific Specific device adapters
+ *
+ * Current TransportManager implementation contains following device adapters:
+ *
+ * - @subpage components_transportmanager_internal_design_transport_adapters_bluetooth_adapter "Bluetooth Adapter"
+ * - @subpage components_transportmanager_internal_design_transport_adapters_tcp_adapter "TCP Adapter"
+ */
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Interaction.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Interaction.txt
new file mode 100644
index 0000000000..655d0a1290
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/Interaction.txt
@@ -0,0 +1,7 @@
+/*! \page components_transportmanager_internal_design_interaction Sub-Components Interaction
+
+Internally Transport Manager is a root component for Device Adapters. After running Transport Manager creates Device Adapters and runs them too.
+
+During system life cycle all messages from Device Adapter are translated via Transport Manager to the clients. In other direction – all requests from clients are re-directed to respective Device Adapters by the Transport Manager.
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
new file mode 100644
index 0000000000..6c35f0962f
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/MultiThreading.txt
@@ -0,0 +1,9 @@
+/*! \page components_transportmanager_internal_design_multithreading Multi-Threading in Component
+
+Internally Transport Manager uses different threads for different operations. This design solution was used to provide efficient asynchronous communication with clients and underlying Device Adapters.
+
+Transport Manager uses one thread to operate with all device-related callbacks. In other word all callbacks declared in NsSmartDeviceLink::NsTransportManager::ITransportManagerDeviceListener will be called from that thread.
+
+For every active connection one service thread will be created. This thread will be used for all connection-related callbacks. Therefore every implementation of NsSmartDeviceLink::NsTransportManager::ITransportManagerDataListener will be called in separated thread that allows client to support multiple connection simultaneously.
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
new file mode 100644
index 0000000000..c96fd46a22
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/TrasportManager.txt
@@ -0,0 +1,15 @@
+/*! \page components_transportmanager_internal_design_trasport_manager Trasport Manager Implementation
+
+Actually Transport Manager component is implemented as classical manager component. It manages connections and abstract devices and provides unified information for the clients.
+
+Connection-related information encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SConnectionInfo. Transport Manager manages these structures to store information about every active connection.
+
+Frame processing encapsulated in structure NsSmartDeviceLink::NsTransportManager::CTransportManager::SFrameDataForConnection. Transport Manager manages these structures to store information related to data for specific connection.
+
+Callback information between transport manager threads passed in form of special structures:
+NsSmartDeviceLink::NsTransportManager::CTransportManager::SDeviceListenerCallback.
+NsSmartDeviceLink::NsTransportManager::CTransportManager::SDataListenerCallback.
+
+Client calls to TM guarded by separate mutex. This allows use component from different threads without any risk.
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/index.txt
new file mode 100644
index 0000000000..b29ec48dd1
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Internal Design/index.txt
@@ -0,0 +1,15 @@
+/*! \page components_transportmanager_internal_design Component Internal Design
+
+This chapter is focused on Transport Manager internal design and describes internal sub-components and use of multi-threading.
+
+Information regarding sub-components is described in following topics:
+ - \subpage components_transportmanager_internal_design_transport_adapters "Device Adapters"
+ - \subpage components_transportmanager_internal_design_trasport_manager "Trasport Manager Implementation"
+
+Detailed description of sub-components interaction is described here:
+ - \subpage components_transportmanager_internal_design_interaction "Sub-Components Interaction"
+
+More information about internal usage of multi-threading id described here:
+ - \subpage components_transportmanager_internal_design_multithreading "Multi-Threading in Component"
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase1.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase1.txt
new file mode 100644
index 0000000000..4af46e4320
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase1.txt
@@ -0,0 +1,74 @@
+/*! \page components_transportmanager_use_cases_1 Scenario with 1 device and 1 application
+
+<h3>Preconditions:</h3>
+<table>
+ <tr>
+ <th>Steps</th>
+ <th>Actions</th>
+ <th>Expected result</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>The Device is connected to SmartDeviceLink Core VIA Bluetooth or Wi-Fi</td>
+ <td>
+ <p>For BT: Devices are paired</p>
+ <p>For Wi-Fi: Devices are in the same network</p>
+ </td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Make sure that correct device is connected to SmartDeviceLink core</td>
+ <td>IP-address of connected device is relevant</td>
+ </tr>
+</table>
+
+<h3>Testcase:</h3>
+<table>
+ <tr>
+ <th>Steps</th>
+ <th>Actions</th>
+ <th>Expected result</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Start SmartDeviceLink application on the Devices</td>
+ <td>SmartDeviceLink application is up and ready</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Initiate a Device search in HMI</td>
+ <td>HMI displays the list of found devices/applications</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Connect to desired device\application</td>
+ <td>Application is marked as connected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Send alert message from SmartDeviceLink application</td>
+ <td>Alert is displayed on HMI</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>Disconnect device from SmartDeviceLink core</td>
+ <td>Application is marked as disconnected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>Try to send alert from disconnected device</td>
+ <td>Alert shouldn’t be delivered and displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td><strong>Repeat steps 1-4 with using another connection method (BT of Wi-Fi)</strong></td>
+ <td>Expected results should be the same</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td><h3>Stress:</h3>Send big amount of alert messages in a short period of time</td>
+ <td>All alert messages are processed correctly</td>
+ </tr>
+</table>
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase2.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase2.txt
new file mode 100644
index 0000000000..de1d6baae0
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase2.txt
@@ -0,0 +1,96 @@
+/*! \page components_transportmanager_use_cases_2 Scenario with 2 or more devices with 1 application onboard
+
+<h3>Preconditions:</h3>
+<table>
+ <tr>
+ <th>Steps</th>
+ <th>Actions</th>
+ <th>Expected result</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Device-1 is connected to Core via Bluetooth</td>
+ <td>Devices are paired</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Device-2 is connected to SmartDeviceLink Core via Wi-Fi</td>
+ <td>Devices are in the same network</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Make sure that correct devices are connected to SmartDeviceLink core</td>
+ <td>IP-address of connected devices are relevant</td>
+ </tr>
+</table>
+
+<h3>Testcase:</h3>
+<table>
+ <tr>
+ <th>Steps</th>
+ <th>Actions</th>
+ <th>Expected result</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Start SmartDeviceLink application on the Devices</td>
+ <td>SmartDeviceLink application is up and ready</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Initiate a Device search in HMI</td>
+ <td>HMI displays the list of found devices/applications</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Connect to application-1 on 1-st device</td>
+ <td>Application is marked as connected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Connect to application on 2-nd device</td>
+ <td>Application is marked as connected/notification is displayed in HMI. Both applications on device-1 and device-2 are marked as connected</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>Send alert message from SmartDeviceLink application-1</td>
+ <td>Alert is displayed on HMI</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>Send alert message from SmartDeviceLink application-2</td>
+ <td>Alert is displayed on HMI</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Send alert messages from both application simultaneously</td>
+ <td>Both alerts are displayed on HMI/Alerts are showed consequently</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>Disconnect device-2 from SmartDeviceLink core</td>
+ <td>Application is marked as disconnected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>9</td>
+ <td>Try to send alert messages from both application simultaneously</td>
+ <td>Alert is delivered only from device-1</td>
+ </tr>
+ <tr>
+ <td>10</td>
+ <td>Disconnect device-1 from SmartDeviceLink core</td>
+ <td>Application is marked as disconnected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>11</td>
+ <td><strong>Repeat steps 1-9 with more devices or use same connection method (BT of Wi-Fi)</strong></td>
+ <td>Expected results should be the same</td>
+ </tr>
+ <tr>
+ <td>12</td>
+ <td><h3>Stress:</h3>Send big amount of alert messages in a short period of time from all devices</td>
+ <td>All alert messages are processed correctly</td>
+ </tr>
+</table>
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase3.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase3.txt
new file mode 100644
index 0000000000..f11faadfdc
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/UseCase3.txt
@@ -0,0 +1,131 @@
+/*! \page components_transportmanager_use_cases_3 Scenario with 2 or more devices with 2 or more applications onboard
+
+<h3>Preconditions:</h3>
+<table>
+ <tr>
+ <th>Steps</th>
+ <th>Actions</th>
+ <th>Expected result</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Device-1 is connected to Core via Bluetooth</td>
+ <td>Devices are paired</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Device-2 is connected to SmartDeviceLink Core via Wi-Fi</td>
+ <td>Devices are in the same network</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Make sure that correct devices are connected to SmartDeviceLink core</td>
+ <td>IP-address of connected devices are relevant</td>
+ </tr>
+</table>
+
+<h3>Testcase:</h3>
+<table>
+ <tr>
+ <th>Steps</th>
+ <th>Actions</th>
+ <th>Expected result</th>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>Start SmartDeviceLink application on the Devices</td>
+ <td>SmartDeviceLink application is up and ready</td>
+ </tr>
+ <tr>
+ <td>2</td>
+ <td>Initiate a Device search in HMI</td>
+ <td>HMI displays the list of found devices/applications</td>
+ </tr>
+ <tr>
+ <td>3</td>
+ <td>Connect to application-1 on 1-st device</td>
+ <td>Application is marked as connected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>Send alert message from SmartDeviceLink application-1 on device-1</td>
+ <td>Alert is displayed on HMI</td>
+ </tr>
+ <tr>
+ <td>5</td>
+ <td>Connect to application-2 on 1-st device</td>
+ <td>Application is marked as connected/notification is displayed in HMI Both applications are marked as connected</td>
+ </tr>
+ <tr>
+ <td>6</td>
+ <td>Send alert message from SmartDeviceLink application-2 on device-1</td>
+ <td>Alert is displayed on HMI</td>
+ </tr>
+ <tr>
+ <td>7</td>
+ <td>Send alert messages from application-1 and application-2 on device-1 simultaneously</td>
+ <td>Both alerts are displayed on HMI/Alerts are showed consequently</td>
+ </tr>
+ <tr>
+ <td>8</td>
+ <td>Connect to application-1 on 2-st device</td>
+ <td>Application is marked as connected/notification is displayed in HMI. All 3 applications are marked as connected</td>
+ </tr>
+ <tr>
+ <td>9</td>
+ <td>Send alert messages from application-1 on device-1 and device-2 simultaneously</td>
+ <td>Both alerts are displayed on HMI/Alerts are showed consequently</td>
+ </tr>
+ <tr>
+ <td>10</td>
+ <td>Send alert message from SmartDeviceLink application-1 on device-2</td>
+ <td>Alert is displayed on HMI</td>
+ </tr>
+ <tr>
+ <td>11</td>
+ <td>Connect to application on 2-nd device</td>
+ <td>Application is marked as connected/notification is displayed in HMI. All 4 applications are marked as connected</td>
+ </tr>
+ <tr>
+ <td>12</td>
+ <td>Send alert message from SmartDeviceLink application-2 on device-2</td>
+ <td>Alert is displayed on HMI</td>
+ </tr>
+ <tr>
+ <td>13</td>
+ <td>Send alert messages from application-1 and application-2 on device-2 simultaneously</td>
+ <td>Both alerts are displayed on HMI/Alerts are showed consequently</td>
+ </tr>
+ <tr>
+ <td>14</td>
+ <td>Send alert messages from application-2 on device-1 and device-2 simultaneously</td>
+ <td>Both alerts are displayed on HMI/Alerts are showed consequently</td>
+ </tr>
+ <tr>
+ <td>15</td>
+ <td>Send alert messages from all application simultaneously</td>
+ <td>Both alerts are displayed on HMI/Alerts are showed consequently</td>
+ </tr>
+ <tr>
+ <td>16</td>
+ <td>Disconnect device-1 from SmartDeviceLink core</td>
+ <td>Applications are marked as disconnected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>17</td>
+ <td>Disconnect device-2 from SmartDeviceLink core</td>
+ <td>All applications are marked as disconnected/notification is displayed in HMI</td>
+ </tr>
+ <tr>
+ <td>18</td>
+ <td><strong>Repeat steps 1-15 with more devices and more applications or use same connection method (BT of Wi-Fi)</strong></td>
+ <td>Expected results should be the same</td>
+ </tr>
+ <tr>
+ <td>19</td>
+ <td><h3>Stress:</h3>Send big amount of alert messages in a short period of time from all devices</td>
+ <td>All alert messages are processed correctly</td>
+ </tr>
+</table>
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/index.txt
new file mode 100644
index 0000000000..c929a16a88
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/Use Cases/index.txt
@@ -0,0 +1,11 @@
+/*! \page components_transportmanager_use_cases High-Level Use Cases to Test Component
+
+This page contains set of high-level use-cases which can be used for testing of Transport Manager functionallity.
+
+In described scenarious term “Device” means any device which is able to run SmartDeviceLink Applications and capable to connect via BT or
+Wi-Fi.
+
+- \subpage components_transportmanager_use_cases_1 Simple scenario for smoke tests of trasprot level.
+- \subpage components_transportmanager_use_cases_2 Many devices verification for transport level operations.
+- \subpage components_transportmanager_use_cases_3 Complex verification of correct transport level operations.
+*/
diff --git a/src/components/policy/doc/doxygen/components/TransportManager/index.txt b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/index.txt
index 73252c751c..73252c751c 100644
--- a/src/components/policy/doc/doxygen/components/TransportManager/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/TransportManager/index.txt
diff --git a/src/components/policy/doc/doxygen/components/index.txt b/src/components/policy/policy_external/doc/doxygen/components/index.txt
index 186de88af0..186de88af0 100644
--- a/src/components/policy/doc/doxygen/components/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/components/index.txt
diff --git a/src/components/policy/doc/doxygen/info.txt b/src/components/policy/policy_external/doc/doxygen/info.txt
index e8afe55c12..e8afe55c12 100644
--- a/src/components/policy/doc/doxygen/info.txt
+++ b/src/components/policy/policy_external/doc/doxygen/info.txt
diff --git a/src/components/policy/doc/doxygen/mainpage.txt b/src/components/policy/policy_external/doc/doxygen/mainpage.txt
index 5cd05e2606..5cd05e2606 100644
--- a/src/components/policy/doc/doxygen/mainpage.txt
+++ b/src/components/policy/policy_external/doc/doxygen/mainpage.txt
diff --git a/src/components/policy/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt
index 4cf9e84d99..4cf9e84d99 100644
--- a/src/components/policy/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt
+++ b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt
diff --git a/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/CMake Integration.txt b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/CMake Integration.txt
new file mode 100644
index 0000000000..b4fb0b3df5
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/CMake Integration.txt
@@ -0,0 +1,13 @@
+/*! \page tools_interfacegenerator_cmakeintegration Integration with CMake
+
+In order to organize usable build process that allows to create generated code at every workstation in accordance with local setting and ensure that code re-generated after any modification in source XML or InterfaceGenerator itself was designed custom CMake rule "GenerateInterface".
+
+This rule takes 3 arguments - name of source XML file, desired namespace for generated code and name of parser to use (name of parser is required because supported XML formats are indistinguishable and client must explicitly specify desired parser type).
+
+Example:
+
+<pre>
+GenerateInterface("test_v4_protocol_v2_0_revP.xml" "Gen::test::components::JSONHandler" "alrpcv2")
+</pre>
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/How To Use.txt b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/How To Use.txt
new file mode 100644
index 0000000000..0f9e340bc5
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/How To Use.txt
@@ -0,0 +1,31 @@
+/*! \page tools_interfacegenerator_usage How to use InterfaceGenerator
+
+To run InterfaceGenerator the Python 2.7 interpreter should be installed. As input InterfaceGenerator requires full path to the source XML file, namespace to generate result code in, full path to the output directory where result source code C++ will be created and optionally explicit specification of parser type.
+
+Example1 (Run Generator.py to display help):
+
+<pre>
+$ python Generator.py -h
+
+usage: Generator.py [-h] --parser-type {alrpcv1,alrpcv2}
+ source-xml namespace output-dir
+
+SmartSchema interface generator
+
+positional arguments:
+ source-xml
+ namespace
+ output-dir
+
+optional arguments:
+ -h, --help show this help message and exit
+ --parser-type {alrpcv1,alrpcv2}
+</pre>
+
+Example2 (Run Generator.py to generate some code)
+
+<pre>
+python Generator.py /home/user1/xml/alrpc1.xml App::Gen:: /home/user1/gen --parser-type=alrpcv2
+</pre>
+
+*/
diff --git a/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/Use of Output.txt b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/Use of Output.txt
new file mode 100644
index 0000000000..b486fd7e37
--- /dev/null
+++ b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/Use of Output.txt
@@ -0,0 +1,11 @@
+/*! \page tools_interfacegenerator_output Use of InterfaceGenerator output
+
+As a result InterfaceGenerator produces one .cpp and one .hpp file in the output directory. Those files contain one C++ class which named in accordance with input XML file name. Class is declared and implemented in specified namespace. Also all enums form source XML file have automatically generated declarations within specified namespace.
+
+Generated class is inherited form predefined base template class CSmartFactory. Actually this inherited class defines specific set of Smart Object schema's initialization methods which are set to the base class member and can be used by the clients.
+
+Also generated code contains string mapping for enums that is used to convert string representation or enums to integer values and vice versa.
+
+Result source code should be compilable but this is not guaranteed if source XML file contains identifier names that are not correct C++ identifiers.
+
+*/
diff --git a/src/components/policy/doc/doxygen/tools/InterfaceGenerator/index.txt b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/index.txt
index 21b437f6b7..21b437f6b7 100644
--- a/src/components/policy/doc/doxygen/tools/InterfaceGenerator/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/tools/InterfaceGenerator/index.txt
diff --git a/src/components/policy/doc/doxygen/tools/index.txt b/src/components/policy/policy_external/doc/doxygen/tools/index.txt
index 4befa33e8d..4befa33e8d 100644
--- a/src/components/policy/doc/doxygen/tools/index.txt
+++ b/src/components/policy/policy_external/doc/doxygen/tools/index.txt
diff --git a/src/components/policy/policy_external/doc/grc/conf.smartDeviceLinkCore b/src/components/policy/policy_external/doc/grc/conf.smartDeviceLinkCore
new file mode 100644
index 0000000000..a026407723
--- /dev/null
+++ b/src/components/policy/policy_external/doc/grc/conf.smartDeviceLinkCore
@@ -0,0 +1,33 @@
+# source filename
+regexp=\w+\.(?:cpp|h)
+colours=yellow
+===
+regexp=^(ERROR|FATAL)
+colours=red on_yellow
+===
+regexp=^WARN
+colours=red
+===
+regexp=^INFO
+colours=blue
+===
+regexp=^TRACE
+colours=magenta
+===
+# component
+regexp=(?<=\])\[[^]]+\]
+colours=cyan
+===
+# something invalid
+regexp=(?i)invalid
+colours=red
+===
+# RPC message start
+regexp=^\{$
+colours=bold
+count=block
+===
+# RPC message end
+regexp=^\}$
+colours=bold
+count=unblock \ No newline at end of file
diff --git a/src/components/policy/doc/grc/grc.conf b/src/components/policy/policy_external/doc/grc/grc.conf
index dfd3d4cbef..dfd3d4cbef 100644
--- a/src/components/policy/doc/grc/grc.conf
+++ b/src/components/policy/policy_external/doc/grc/grc.conf
diff --git a/src/components/policy/policy_external/doc/install.txt b/src/components/policy/policy_external/doc/install.txt
new file mode 100644
index 0000000000..c870856e97
--- /dev/null
+++ b/src/components/policy/policy_external/doc/install.txt
@@ -0,0 +1,91 @@
+* Introduction
+ ================
+ smartDeviceLinkCore is an application which manages the transport, connection and communication between a head unit and mobile device.
+
+* OS and Hardware
+ =========
+ Ubuntu 12.04.01 LTS 32-bit OS on the PC with USB-dongle
+ Application has been tested using 2 types of USB-dongle:
+ D-Link DBT-122
+ STLab B-121mini
+
+* External components
+ ===================
+ For build application we need:
+ libbluetooth3, the BlueZ library
+ libbluetooth-dev, the development files to link to the BluetZ library.
+ Install libraries:
+ sudo apt-get install libbluetooth3
+ sudo apt-get install libbluetooth-dev
+
+ We are using cmake to create build configurations.
+ Install cmake:
+ sudo apt-get install cmake
+
+ Also, make sure the g++ compiler is installed:
+ sudo apt-get install g++
+
+ To start web-based HMI we need web-browser with web-socket RFC6455 support.
+ For example Google Chromium. Install it using:
+ sudo apt-get install chromium-browser
+
+ To run InterfaceGenerator some python libraries are required and must be
+ installed with following command:
+ sudo pip install -r tools/InterfaceGenerator/requirements.txt
+
+ For logging Apache log4cxx library is used. Install required packages with the following command:
+ sudo apt-get install liblog4cxx10 liblog4cxx10-dev
+
+ For installing pulseaudio development files which neededfor audio management fetures run:
+ sudo apt-get install libpulse-dev
+
+ For installing gstreamer development files which needed for audio management fetures:
+ First add gstreamer repositories to your apt source list (/etc/apt/sources.list):
+ deb http://ppa.launchpad.net/gstreamer-developers/ppa/ubuntu <distributive codename> main
+ deb-src http://ppa.launchpad.net/gstreamer-developers/ppa/ubuntu <distributive codename> main
+ use code name relevant to the Ubuntu version which you use instead of <distributive codename>.
+ Run:
+ sudo apt-get update
+ and:
+ sudo apt-get install gstreamer1.0*
+
+* Build application
+ =================
+ We support "out of sources" concept for build from R3.0.0
+ It means all generated by build tools files will be stored in separate folder.
+ Temporary build of application requires two steps.
+ 1. Enter src/thirdPartyLibs/logger
+ build logger:
+
+ 1. Create directory outside of SmartDeviceLink project directory.
+ For example "build" folder in the same folder with SmartDeviceLink git repo folder which has a name "git_repo":
+ You will have folders structure like this:
+ /home/projects/smart_device_link
+ |--build
+ |--git_repo
+ |--doc
+ |--src
+ |--test
+ |--DoxyFile
+ \--CMakeLists.txt
+ Enter this folder:
+ cd build
+
+ 2. Create build configuration using cmake:
+ 2.1 For Debug configuration
+ cmake ../git_repo
+ 2.2 For Release configuration, run:
+ cmake -DCMAKE_BUILD_TYPE=Release ../git_repo
+ 2.3 For Debug configuration with tests, run:
+ cmake -DBUILD_TESTS=On ../git_repo
+
+ 3. Make project:
+ make
+
+ Ready to use release application will be in build/src/appMain/smartDeviceLinkCore
+
+ 4. If You built configuration with tests (see 2.3 above), then You can run all project tests and see overall result with:
+ make test
+
+ 5. For creating the doxygen documentation run:
+ make doxygen \ No newline at end of file
diff --git a/src/components/policy/doc/qnx_build.txt b/src/components/policy/policy_external/doc/qnx_build.txt
index 4f67d6eed3..4f67d6eed3 100644
--- a/src/components/policy/doc/qnx_build.txt
+++ b/src/components/policy/policy_external/doc/qnx_build.txt
diff --git a/src/components/policy/policy_external/doc/readme.txt b/src/components/policy/policy_external/doc/readme.txt
new file mode 100644
index 0000000000..66087df057
--- /dev/null
+++ b/src/components/policy/policy_external/doc/readme.txt
@@ -0,0 +1,65 @@
+* Introduction
+ ================
+ smartDeviceCore is an application which manages the transport, connection and communication between a head unit and mobile device.
+
+* OS and Hardware
+ =========
+ Ubuntu 12.04.1 LTS 32-bit OS on the PC with USB-dongle
+ Application has been tested using 2 types of USB-dongle:
+ D-Link DBT-122
+ STLab B-121mini
+
+ * External components
+ ===================
+ For start application we need:
+ libbluetooth3, the BlueZ library
+ Install library:
+ sudo apt-get install libbluetooth3
+ To start web-based HMI we need web-browser with web-socket RFC6455 support.
+ 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 set path to hmi in config file
+ For example:
+ LinkToWebHMI = ${path_to_HMI_repository}/index.html
+
+* Running application
+ ====================
+ Plug USB-dongle in.
+ Switch Bluetooth on a mobile device ON and make the device discoverable.
+ Pair mobile device with PC using Ubuntu tools.
+ Device should contain SmartDeviceLink compatible application installed.
+ Start application with command:
+ ./smartDeviceLinkCore
+ Application starts to search devices and starts HMI in cromium-browser.
+ In case HMI has not been started please start web-based HMI manually in browser opening src/components/HMI/index.html.
+ SmartDeviceLinkCore is searching Bluetooth devices with a correspondibg service.
+ Go to info menu in HMI and press App button.
+ Press change Devices button.
+ Select the device from a list.
+ Application opens all available ports on devices and starts communication.
+ Returning to the App menu all applications will be shown in a list.
+
+* Colorized logs
+ ==============
+ You can have colorized log output of smartDeviceLinkCore's messages in the terminal with the help of grc:
+
+ 1. Make sure grc is installed:
+ sudo apt-get install grc
+
+ 2. Copy the config files from the grc/ directory into ~/.grc/ directory:
+ mkdir ~/.grc
+ cp grc/* ~/.grc/
+
+ 3. Add an alias to your shell's config (usually, ~/.bashrc or ~/.zshrc):
+ alias grca='grc -es --colour=auto'
+
+ Either restart the shell session or source the edited file:
+ source ~/.bashrc
+ or
+ source ~/.zshrc
+
+ 4. Start the smartDeviceLink core with the following command:
+ grca ./smartDeviceLinkCore
+
+ 5. PROFIT \ No newline at end of file
diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h
new file mode 100644
index 0000000000..fd185af075
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/access_remote.h
@@ -0,0 +1,139 @@
+/*
+ * 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_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
+
+#include <vector>
+#include <ostream>
+#include <string>
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace policy {
+
+enum TypeAccess { kDisallowed, kAllowed };
+inline std::ostream& operator<<(std::ostream& output, TypeAccess x) {
+ output << "Access: ";
+ switch (x) {
+ case kDisallowed:
+ output << "DISALLOWED";
+ break;
+ case kAllowed:
+ output << "ALLOWED";
+ break;
+ default:
+ output << "Error: Unknown type";
+ }
+ return output;
+}
+
+struct ApplicationOnDevice {
+ PTString dev_id;
+ PTString app_id;
+};
+inline bool operator<(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id);
+}
+inline bool operator==(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id == y.dev_id && x.app_id == y.app_id;
+}
+inline std::ostream& operator<<(std::ostream& output,
+ const ApplicationOnDevice& who) {
+ output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")";
+ return output;
+}
+
+typedef std::vector<PTString> RemoteControlParams;
+
+class AccessRemote {
+ public:
+ virtual ~AccessRemote() {}
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ virtual bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const = 0;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ virtual void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ virtual const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ virtual bool IsAppRemoteControl(const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) = 0;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h
new file mode 100644
index 0000000000..0fa53b0237
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h
@@ -0,0 +1,174 @@
+/*
+ * 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_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+
+#include <map>
+#include "policy/policy_table/types.h"
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "policy/access_remote.h"
+#include "policy/cache_manager.h"
+
+using policy_table::FunctionalGroupings;
+
+namespace policy {
+
+class AccessRemoteImpl : public AccessRemote {
+ public:
+ AccessRemoteImpl();
+ explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const OVERRIDE;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) OVERRIDE;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ bool IsAppRemoteControl(const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) OVERRIDE;
+
+ private:
+ inline void set_enabled(bool value);
+ inline bool country_consent() const;
+ /**
+ * @brief HmiTypes get list of hmi types for application
+ * @param who application on specific device
+ * @return list of hmi types
+ */
+ const policy_table::AppHMITypes& HmiTypes(const ApplicationOnDevice& who);
+
+ /**
+ * @brief GetGroupsIds get list of groups for application
+ * @param device_id device id
+ * @param app_id application id
+ * @param grops_ids output parameter for group ids storing
+ */
+ void GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& grops_ids);
+
+ /**
+ * @brief IsAllowed check if modulename and rpc is allowed for application
+ * @param modules list of access modules
+ * @param module_name module name to check
+ * @param rpc_name rpc name to check
+ * @param input list of rpc parameters
+ * @return true if allowed otherwise return false
+ */
+ bool IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief CompareParameters check if app parameters allowed
+ * @param parameters list of allowed parameters
+ * @param input list of parameters to check
+ * @return true if allowed otherwise return false
+ */
+ bool CompareParameters(const policy_table::Strings& parameters,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief cache_ contains pointer to cache manager instance
+ */
+ utils::SharedPtr<CacheManager> cache_;
+
+ /**
+ * @brief hmi_types_ contains list of default HMI types for applications
+ */
+ typedef std::map<ApplicationOnDevice, policy_table::AppHMITypes> HMIList;
+ HMIList hmi_types_;
+
+#ifdef BUILD_TESTS
+ FRIEND_TEST(AccessRemoteImplTest, KeyMapTest);
+ FRIEND_TEST(AccessRemoteImplTest, Allow);
+ FRIEND_TEST(AccessRemoteImplTest, Deny);
+ FRIEND_TEST(AccessRemoteImplTest, ChangeAccess);
+ FRIEND_TEST(AccessRemoteImplTest, ResetBySubject);
+ FRIEND_TEST(AccessRemoteImplTest, ResetByObject);
+ FRIEND_TEST(AccessRemoteImplTest, CheckAllowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckDisallowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckManual);
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, SetDefaultHmiTypes);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
new file mode 100644
index 0000000000..bda456c90a
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -0,0 +1,943 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_H_
+
+#include <map>
+
+#include "utils/shared_ptr.h"
+#include "policy/pt_representation.h"
+#include "policy/pt_ext_representation.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/cache_manager_interface.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+
+namespace policy {
+class PolicySettings;
+
+class CacheManager : public CacheManagerInterface {
+ public:
+ CacheManager();
+ explicit CacheManager(bool in_memory);
+ ~CacheManager();
+
+ /**
+ * @brief GetConsentsPriority provides priority for group consents
+ * i.e. which consents take priority for group - user consent or external
+ * consent based on timestamps
+ * @param device_id Device id
+ * @param application_id Application id
+ * @return Container with group consents priorities
+ */
+ ConsentPriorityType GetConsentsPriority(
+ const std::string& device_id, const std::string& application_id) const;
+
+ const policy_table::Strings& GetGroups(const PTString& app_id);
+
+ /**
+ * @brief Checks if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @return CheckPermissionResult containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result);
+
+ /**
+ * @brief Returns true if Policy Table was not updated yet
+ * from preloaded pt file.
+ */
+ virtual bool IsPTPreloaded();
+
+ /**
+ * Gets number of ignition cycles before next update policy table
+ * @return number of ignition cycles
+ */
+ virtual int IgnitionCyclesBeforeExchange();
+
+ /**
+ * Gets value in kilometers before next update policy table
+ * @param current value in kilometers from the odometers
+ * @return value in kilometers
+ */
+ virtual int KilometersBeforeExchange(int current);
+
+ /**
+ * @brief Sets counter value that passed for recieved successful PT UPdate
+ */
+ virtual bool SetCountersPassedForSuccessfulUpdate(Counters counter,
+ int value);
+
+ /**
+ * Gets value in days before next update policy table
+ * @param current value in days after epoch
+ * @return value in days
+ */
+ virtual int DaysBeforeExchange(uint16_t current);
+
+ /**
+ * @brief Increments number of ignition cycles since last exchange by 1
+ */
+ virtual void IncrementIgnitionCycles();
+
+ /**
+ * @brief Resets number of ignition cycles since last exchange to 0
+ */
+ virtual void ResetIgnitionCycles();
+
+ /**
+ * @brief Returns timeout to wait for a response of PT update
+ * @return value in seconds
+ */
+ virtual int TimeoutResponse();
+
+ /**
+ * @brief Returns number of seconds between each try of sending PTS
+ * @param seconds Return value: array of 5 elements
+ * @return bool Success of operation
+ */
+ virtual bool SecondsBetweenRetries(std::vector<int>& seconds);
+
+ /**
+ * @brief Gets information about vehicle
+ */
+ virtual const VehicleInfo GetVehicleInfo() const;
+
+ /**
+ * @brief Allows to update 'vin' field in module_meta table.
+ *
+ * @param new 'vin' value.
+ *
+ * @return true in case when data has been successfully updated,
+ * false otherwise.
+ */
+ bool SetVINValue(const std::string& value);
+
+ /**
+ * @brief Gets message text for displaying/pronouncing for user
+ * dependent on language and context.
+ * @param msg_codes Context of message (Driver distraction, Grant permission
+ * etc)
+ * @param language Requested language of the message
+ * @param active_hmi_language Last language has been received
+ * via UI.GetLanguage (used as first fallback language)
+ * @return Array of appropriate messages parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language,
+ const std::string& active_hmi_language);
+
+ /**
+ * @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 Gets list of URL to send PTS to
+ * @param service_type If URLs for specific service are preset,
+ * return them otherwise default URLs.
+ */
+ virtual void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points);
+
+ virtual void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points);
+
+ /**
+ * @brief Gets allowed number of notifications
+ * depending on application priority.
+ * @param priority Priority of application
+ */
+ virtual rpc::policy_table_interface_base::NumberOfNotificationsType
+ GetNotificationsNumber(const std::string& priority);
+
+ /**
+ * @brief Gets priority for given application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string& priority) const OVERRIDE;
+
+ /**
+ * @brief Initialized Policy Table (load)
+ * @return bool Success of operation
+ */
+ bool Init(const std::string& file_name, const PolicySettings* settings);
+
+ /**
+ * @brief Gets snapshot of Policy Table
+ * including app_policies, functional_groups,
+ * device_info, statistics, excluding user messages
+ * @return Generated structure for obtaining Json string.
+ */
+ virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+
+ /**
+ * Applies policy table to the current table
+ * @param update_pt policy table
+ * @return true if successfully
+ */
+ 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);
+
+ /**
+ * @brief AppHasHMIType checks whether app has been registered with certain
+ *HMI type.
+ *
+ * @return true in case app contains certain HMI type, false otherwise.
+ */
+ virtual bool AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const;
+
+ /**
+ * Gets flag updateRequired
+ * @return true if update is required
+ */
+ bool UpdateRequired() const;
+
+ /**
+ * @brief Saves flag updateRequired
+ * @param status update status if true then update required.
+ */
+ void SaveUpdateRequired(bool status);
+
+ /**
+ * @brief GetInitialAppData Retrieves data from app_policies
+ * about app on its registration
+ * @param app_id id of registered app.
+ * All outputs are filled in only if not null
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types app_types Section on HMI where app can
+ * appear (Navigation, Phone etc)
+ * @return true in case initial application data was obtained successfuly.
+ */
+ bool GetInitialAppData(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types);
+
+ /**
+ * Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const;
+
+ /**
+ * @brief Gets functional groupings from DB
+ * @param groups Known functional groupings
+ * @return true, if succeeded, otherwise - false
+ */
+ bool GetFunctionalGroupings(policy_table::FunctionalGroupings& groups);
+
+ /**
+ * Checks if the application is represented in policy table
+ * @param app_id application id
+ * @return true if application is represented in policy table
+ */
+ bool IsApplicationRepresented(const std::string& app_id) const;
+
+ /**
+ * Checks if the application has default policy
+ * @param app_id application id
+ * @return true if application has default policy
+ */
+ bool IsDefaultPolicy(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief SetIsDefault Sets is_default flag for application
+ * @param app_id app specific application
+ * @return true in case opperation was done successfully.
+ */
+ bool SetIsDefault(const std::string& app_id);
+
+ /**
+ * @brief SetIsPredata Sets is_predata flag for application
+ * @param app_id app specific application
+ * @return true in case opperation was done successfully.
+ */
+ bool SetIsPredata(const std::string& app_id);
+
+ /**
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
+ bool IsPredataPolicy(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * Sets default policy for application
+ * @param app_id application id
+ * @return true if success
+ */
+ bool SetDefaultPolicy(const std::string& app_id);
+
+ /**
+ * @brief Is application allowed to send notifications while in
+ * Backgound or limited mode.
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Is application allowed to move foreground at will?
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ bool CanAppStealFocus(const std::string& app_id) const;
+
+ /**
+ * @brief Gets default_hmi for given application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value was
+ * not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHMI(const std::string& app_id, std::string& default_hmi) const;
+
+ /**
+ * Gets HMI types from specific policy
+ * @param app_id ID application
+ * @return list of HMI types
+ */
+ const policy_table::AppHMITypes* GetHMITypes(const std::string& app_id);
+
+ /**
+ * @brief Allows to generate hash from the specified string.
+ * The djb2 algorithm uses for hash generation.
+ * @param str_to_hash - the string from which hash should be generated.
+ * @return integer hash for the specified string.
+ */
+ static int32_t GenerateHash(const std::string& str_to_hash);
+
+ /**
+ * @brief Resets user consent for device data and applications permissions
+ * @return
+ */
+ bool ResetUserConsent();
+
+ /**
+ * @brief Gets user permissions for device data usage
+ * @param device_id Generated or obtained id of device
+ * @param consented_groups Groups consented by user
+ * @param disallowed_groups Groups not consented by user
+ * @return true, if query was successfull, otherwise - false
+ */
+ bool GetUserPermissionsForDevice(const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups) const;
+
+ /**
+ * @brief Gets list of groups permissions from policy table
+ * @param device_id Unique device id, which hosts specific application
+ * @param policy_app_id Unique application id
+ * @param group_types Group list sorted by permission status
+ * @return true, if query was successfull, otherwise - false
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types);
+
+ /**
+ * @brief Gets device groups and preconsented groups from policies section
+ * @param groups List of groups to be consented for device usage
+ * @param preconsented_groups List of preconsented groups for device usage
+ * @return true, if query was successful, otherwise - false
+ */
+ bool GetDeviceGroupsFromPolicies(
+ rpc::policy_table_interface_base::Strings& groups,
+ rpc::policy_table_interface_base::Strings& preconsented_groups) const;
+
+ /**
+ * @brief Adds information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @param connection_type device connection type
+ * @return bool Success of operation
+ */
+ bool AddDevice(const std::string& device_id,
+ const std::string& connection_type);
+
+ /**
+ * @brief Records information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @return bool Success of operation
+ */
+ bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware = "",
+ const std::string& firmware = "",
+ const std::string& os = "",
+ const std::string& os_version = "",
+ const std::string& carrier = "",
+ const uint32_t number_of_ports = 0,
+ const std::string& connection_type = "");
+
+ /**
+ * @brief Sets user consent for particular mobile device,
+ * i.e. to use device for exchanging of Policy Table.
+ * @return bool Success of operation
+ */
+ bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups = StringArray(),
+ const StringArray& disallowed_groups = StringArray());
+
+ /**
+ * @brief Checks if particular mobile device has user consent in cache
+ * @return bool Suceess, if has, otherwise - false
+ */
+ bool IsDeviceConsentCached(const std::string& device_id) const;
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ */
+
+ /**
+ * @brief Gets user consent for particular mobile device
+ * @return actual consent for device
+ */
+ DeviceConsent GetDeviceConsent(const std::string& device_id) const OVERRIDE;
+
+ /**
+ * @brief Sets user consent for particular mobile device
+ */
+ void SetDeviceConsent(const std::string& device_id,
+ const bool is_allowed) OVERRIDE;
+
+ bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed);
+
+ /**
+ * @brief Set user consent on functional groups
+ * @param permissions User consent on functional group
+ * @param out_app_permissions_changed Indicates whether the permissions were
+ * changed
+ * @return true, if operation succedeed, otherwise - false
+ */
+ bool SetUserPermissionsForApp(const PermissionConsent& permissions,
+ bool* out_app_permissions_changed);
+
+ /**
+ * @brief Records information about head unit system to PT
+ * @return bool Success of operation
+ */
+ bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language);
+
+ /**
+ * @brief Checks, if specific head unit is present in PT
+ * @return boot Suceess, if present, otherwise - false
+ */
+ bool IsMetaInfoPresent() const;
+
+ /**
+ * @brief Set current system language
+ * @param language System language
+ * @return true, if succedeed, otherwise - false
+ */
+ bool SetSystemLanguage(const std::string& language);
+
+ /**
+ * Increments global counter
+ * @param type type of counter
+ */
+ void Increment(usage_statistics::GlobalCounterId type);
+
+ /**
+ * Increments counter of application
+ * @param app_id id application
+ * @param type type of counter
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type);
+
+ /**
+ * Sets value of application information
+ * @param app_id id application
+ * @param type type of information
+ * @param value value of information
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value);
+
+ /**
+ * Adds value to stopwatch of application
+ * @param app_id id application
+ * @param type type of stopwatch
+ * @param seconds value for adding in seconds
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int seconds);
+
+ /**
+ * @brief CountUnconsentedGroups allows to obtain the count of unconsented
+ * groups for specific application.
+ * @param policy_app_id application id.
+ * @param device_id device id.
+ * @return the count of unconsented groups
+ */
+ int CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id);
+
+ /**
+ * @brief Gets functional group names and user_consent_prompts, if any
+ * @param Array to be filled with group ids, names and functional prompts
+ * @return true, if succeeded, otherwise - false
+ */
+ bool GetFunctionalGroupNames(FunctionalGroupNames& names);
+
+ /**
+ * @brief GetAllAppGroups allows to obtain all groups for certain application.
+ * @param app_id specific application id.
+ * @param all_group_ids parameter to fill.
+ */
+ void GetAllAppGroups(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids);
+ /**
+ * @brief GetPreConsentedGroups allows to obtain all pre-consented groups for
+ * specific application.
+ * @param app_id specific application id.
+ * @param preconsented_groups parameter to fill.
+ */
+ void GetPreConsentedGroups(const std::string& app_id,
+ FunctionalGroupIDs& preconsented_groups);
+ /**
+ * @brief GetConsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param app_id application id.
+ * @param allowed_groups list of allowed groups
+ * @param disallowed_groups list of disallowed groups
+ */
+ void GetConsentedGroups(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups);
+
+ /**
+ * @brief GetUnconsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param policy_app_id application id.
+ * @param unconsented_groups list of unconsented groups.
+ */
+ void GetUnconsentedGroups(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups);
+
+ void RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name);
+
+ /**
+ * @brief Set app policy to pre_DataConsented policy
+ * @param app_id Policy ID of application to be changed
+ * @return true, if succeeded, otherwise - false
+ */
+ bool SetPredataPolicy(const std::string& app_id);
+
+ /**
+ * @brief Removes unpaired devices
+ * @return true if success
+ */
+ bool CleanupUnpairedDevices();
+
+ /**
+ * Sets flag of unpaired device
+ * @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, bool unpaired = true);
+
+ /**
+ * Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name);
+
+ /**
+ * @brief LoadFromBackup allows to load policy into the cache from backup.
+ * @return true in case operation was successful.
+ */
+ bool LoadFromBackup();
+
+ /**
+ * @brief LoadFromFile allows to load policy cache from preloaded table.
+ * @param file_name preloaded
+ * @param table object which will be filled during file parsing.
+ * @return true in case file was successfuly loaded, false otherwise.
+ */
+ bool LoadFromFile(const std::string& file_name, policy_table::Table& table);
+
+ /**
+ * @brief Backup allows to save cache onto hard drive.
+ */
+ void Backup();
+
+ /**
+ * Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const;
+
+ /**
+ * @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;
+
+ virtual const MetaInfo GetMetaInfo() const OVERRIDE;
+
+ /**
+ * @brief GetCertificate allows to obtain certificate in order to
+ * make secure connection
+ *
+ * @return The certificate in PKCS#7.
+ */
+ virtual std::string GetCertificate() const OVERRIDE;
+
+ virtual void SetDecryptedCertificate(const std::string& certificate) OVERRIDE;
+
+ bool SetExternalConsentStatus(const ExternalConsentStatus& status) OVERRIDE;
+ ExternalConsentStatus GetExternalConsentStatus() OVERRIDE;
+ ExternalConsentStatus GetExternalConsentEntities() OVERRIDE;
+
+ /**
+ * @brief Creates collection of ExternalConsent items known by current
+ * functional
+ * groupings and appropiate section
+ * (disallowed_by_external_consent_entities_on/off) where
+ * is item is being holded. If item is not found it's not included into
+ * collection
+ * @param status Current status containing collection of ExternalConsent items
+ * @return Collection of ExternalConsent items mapped to list of groups with
+ * section
+ * marker where the item is found
+ */
+ GroupsByExternalConsentStatus GetGroupsWithSameEntities(
+ const ExternalConsentStatus& status) OVERRIDE;
+
+ /**
+ * @brief Gets collection of links device-to-application from device_data
+ * section of policy table if there any application records present, i.e. if
+ * any specific user consent is present
+ * @return Collection of device-to-application links
+ */
+ std::map<std::string, std::string> GetKnownLinksFromPT() OVERRIDE;
+
+ /**
+ * @brief Sets groups permissions affected by customer connectivity settings
+ * entities status, i.e. groups assigned to particular application on
+ * particular device which have same entities as current ExternalConsent status
+ * @param permissions Groups permissions which result current ExternalConsent
+ * status
+ */
+ void SetExternalConsentForApp(const PermissionConsent& permissions) OVERRIDE;
+
+#ifdef BUILD_TESTS
+ utils::SharedPtr<policy_table::Table> GetPT() const {
+ return pt_;
+ }
+#endif
+
+ const PolicySettings& get_settings() const;
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
+ private:
+ std::string currentDateTime();
+ struct AppHMITypeToString {
+ std::string operator()(rpc::Enum<policy_table::AppHMIType> value) {
+ return std::string(policy_table::EnumToJsonString(value));
+ }
+ };
+
+ void GetGroupNameByHashID(const int32_t group_id, std::string& group_name);
+ void FillDeviceSpecificData();
+ long ConvertSecondsToMinute(int seconds);
+
+ /**
+ * @brief Checks snapshot initialization and initializes to default values, if
+ * necessary
+ */
+ void CheckSnapshotInitialization();
+
+ void PersistData();
+
+ /**
+ * @brief Resets all calculated permissions in cache
+ */
+ void ResetCalculatedPermissions();
+
+ /**
+ * @brief Resets all calculated permissions for specified device in cache
+ */
+ void ResetCalculatedPermissionsForDevice(const std::string& device_id);
+
+ /**
+ * @brief Transform to lower case all non default application names in
+ * applications policies section
+ * @param pt polict rable for update
+ */
+ void MakeLowerCaseAppNames(policy_table::Table& pt) const;
+
+ 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:
+ utils::SharedPtr<policy_table::Table> pt_;
+ utils::SharedPtr<policy_table::Table> snapshot_;
+ utils::SharedPtr<PTRepresentation> backup_;
+ utils::SharedPtr<PTExtRepresentation> ex_backup_;
+ bool update_required;
+ typedef std::set<std::string> UnpairedDevices;
+ UnpairedDevices is_unpaired_;
+
+ mutable sync_primitives::Lock cache_lock_;
+ sync_primitives::Lock unpaired_lock_;
+
+ typedef std::map<std::string, Permissions> AppCalculatedPermissions;
+ typedef std::map<std::string, AppCalculatedPermissions> CalculatedPermissions;
+ typedef std::map<std::string, DeviceConsent> CachedDevicePermissions;
+ CalculatedPermissions calculated_permissions_;
+ CachedDevicePermissions cached_device_permissions_;
+ mutable sync_primitives::Lock cached_device_permissions_lock_;
+ sync_primitives::Lock calculated_permissions_lock_;
+
+ /**
+ * @brief MergePreloadPT allows to load policy table from certain JSON file,
+ * and then decide if merge is needed. The merge is needed in case when
+ *preload
+ * JSON date is different than current database.
+ *
+ * @param file_name the preloaded policy table JSON file.
+ * @return false in case of invalid preloaded_pt
+ */
+ bool MergePreloadPT(const std::string& file_name);
+
+ bool GetPermissionsList(StringArray& perm_list) const;
+
+ /**
+ * @brief Gets user consent from cache for particular mobile device
+ * @return actual consent for device
+ */
+ DeviceConsent GetCachedDeviceConsent(
+ const std::string& device_id) const OVERRIDE;
+
+ /**
+ * @brief Checks if specified device has specified consent
+ * @return True if consent for device is set, otherwise - false
+ */
+ bool HasDeviceSpecifiedConsent(const std::string& device_id,
+ const bool is_allowed) const OVERRIDE;
+
+ /**
+ * @brief Saves user consent to cache for particular mobile device
+ */
+ void SaveDeviceConsentToCache(const std::string& device_id,
+ const bool is_allowed);
+
+ /**
+ * @brief MergeMC allows to merge ModuleConfig section by definite rules.
+ *
+ * The rules are:
+ * 1. Add new fields (known to PoliciesManager) & sub-sections if such are
+ * present in the updated Preloaded PT
+ * 2. "vehicle_make", “model”, “year” – leave the fields & values as they were
+ * in the database
+ * 3. For all other fields – overwrite the values with the new ones from
+ *preloaded PT.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database.
+ */
+ void MergeMC(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ /**
+ * @brief MergeFG allows to merge FunctionalGroupings sections by definite
+ *rules.
+ *
+ * The rules are:
+ * 1. If functional_group_name exists in both database (LocalPT) and updated
+ * PreloadedPT -> PoliciesManager must overwrite it (that is, replace such
+ * functional_group_name in the database by the one from Pre-PT).
+ * 2. If functional_group_name exists in updated PreloadedPT and does not
+ * exist in database (LocalPT), PoliciesManager must add such group to the
+ *database.
+ * 3. If functional_group_name does not exist in updated PreloadedPT and
+ * exists in the database (LocalPT), PoliciesManager must leave such group in
+ * the database without changes.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database.
+ */
+ void MergeFG(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ /**
+ * @brief MergeAP Allows to merge ApplicationPolicies section by definite
+ *relues.
+ * The rules are:
+ * 1. Leave “<appID>” sub-sections as they were in the database (fields &
+ *their values).
+ * 2. Over-write "default", "device", "pre_DataConsent" subsections.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database.
+ */
+ void MergeAP(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ /**
+ * @brief MergeCFM allows to merge ConsumerFriendlyMessages section by
+ *definite rules.
+ *
+ * The rules are:
+ * 1. If friendly_message_name exists in both database (LocalPT) and updated
+ * Preloaded PT -> PoliciesManager must overwrite it.
+ * 2. If friendly_message_name exists in updated Preloaded PT and does not
+ * exist in database (LocalPT), PoliciesManager must add such
+ * friendly_message_name to the database (LocalPT).
+ * 3. If friendly_message_name does not exist in updated Preloaded PT and
+ * exists in the database (LocalPT), PoliciesManager must leave such
+ * friendly_message_name in the database without changes.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database
+ */
+ void MergeCFM(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ void InitBackupThread();
+
+ /**
+ * @brief Processes the PTU process by distinguishing the policy type.
+ * For the RequestType" array of "<default>" or "<pre_DataConsent>"
+ * rules are applied as described in APPLINK-14698
+ * @param initial_policy_iter Iterator to application policy to use for update
+ */
+ void ProcessUpdate(const policy_table::ApplicationPolicies::const_iterator
+ initial_policy_iter);
+
+ /**
+ * @brief ConsentsSame checks whether external consents contain
+ * same groups+consent combinations as permission groups
+ * @param external_consent_groups External consents
+ * @param permissions Permissions
+ * @return true if all values from permissions have been found in external
+ * consents container
+ */
+ bool ConsentsSame(const policy_table::ConsentGroups& external_consent_groups,
+ const PermissionConsent& permissions) const;
+
+ 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_;
+ const PolicySettings* settings_;
+
+ friend class AccessRemoteImpl;
+
+#ifdef BUILD_TESTS
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_H_
diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
new file mode 100644
index 0000000000..b9e9f73646
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
@@ -0,0 +1,805 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
+
+#include <string>
+#include <vector>
+
+#include "policy/policy_table/types.h"
+#include "policy/pt_representation.h"
+#include "utils/shared_ptr.h"
+#include "policy/usage_statistics/counter.h"
+#include "policy/policy_types.h"
+#include "policy/policy_settings.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace policy {
+
+class CacheManagerInterface {
+ public:
+ virtual ~CacheManagerInterface() {}
+
+ /**
+ * @brief GetConsentsPriority provides priorities for group consents
+ * i.e. which consents take priority for group - user consent or external
+ * consent based on timestamps
+ * @param device_id Device id
+ * @param application_id Application id
+ * @return Container with group consents priorities
+ */
+ virtual ConsentPriorityType GetConsentsPriority(
+ const std::string& device_id,
+ const std::string& application_id) const = 0;
+
+ virtual const policy_table::Strings& GetGroups(const PTString& app_id) = 0;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @return CheckPermissionResult containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) = 0;
+
+ /**
+ * @brief Returns true if Policy Table was not updated yet
+ * from preloaded pt file.
+ */
+ virtual bool IsPTPreloaded() = 0;
+
+ /**
+ * Gets number of ignition cycles before next update policy table
+ * @return number of ignition cycles
+ */
+ virtual int IgnitionCyclesBeforeExchange() = 0;
+
+ /**
+ * Gets value in kilometers before next update policy table
+ * @param current value in kilometers from the odometers
+ * @return value in kilometers
+ */
+ virtual int KilometersBeforeExchange(int current) = 0;
+
+ /**
+ * @brief Sets counter value that passed for recieved successful PT UPdate
+ */
+ virtual bool SetCountersPassedForSuccessfulUpdate(Counters counter,
+ int value) = 0;
+
+ /**
+ * Gets value in days before next update policy table
+ * @param current value in days after epoch
+ * @return value in days
+ */
+ virtual int DaysBeforeExchange(uint16_t current) = 0;
+
+ /**
+ * @brief Increment number of ignition cycles since last exchange by 1
+ */
+ virtual void IncrementIgnitionCycles() = 0;
+
+ /**
+ * @brief Reset number of ignition cycles since last exchange to 0
+ */
+ virtual void ResetIgnitionCycles() = 0;
+
+ /**
+ * @brief Returns timeout to wait for a response of PT update
+ * @return value in seconds
+ */
+ virtual int TimeoutResponse() = 0;
+
+ /**
+ * @brief Returns number of seconds between each try of sending PTS
+ * @param seconds Return value: array of 5 elements
+ * @return bool Success of operation
+ */
+ virtual bool SecondsBetweenRetries(std::vector<int>& seconds) = 0;
+
+ /**
+ * @brief Get information about vehicle
+ */
+ virtual const VehicleInfo GetVehicleInfo() const = 0;
+
+ /**
+ * @brief Allows to update 'vin' field in module_meta table.
+ *
+ * @param new 'vin' value.
+ *
+ * @return true in case when data has been successfully updated,
+ * false otherwise.
+ */
+ virtual bool SetVINValue(const std::string& value) = 0;
+
+ /**
+ * @brief Get message text for displaying/pronouncing for user
+ * dependent on language and context.
+ * @param msg_codes Context of message (Driver distraction, Grant permission
+ * etc)
+ * @param language Language of the message
+ * @return Array of appropriate messages parameters
+ */
+ virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language,
+ const std::string& active_hmi_language) = 0;
+
+ /**
+ * @brief Get list of URL to send PTS to
+ * @param service_type If URLs for specific service are preset,
+ * return them otherwise default URLs.
+ */
+ virtual void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) = 0;
+
+ virtual void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_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
+ * depending on application priority.
+ * @param priority Priority of application
+ */
+ virtual policy_table::NumberOfNotificationsType GetNotificationsNumber(
+ const std::string& priority) = 0;
+
+ /**
+ * @brief Get priority for given application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string& priority) const = 0;
+
+ /**
+ * @brief Initialized Policy Table (load)
+ * @return bool Success of operation
+ */
+ virtual bool Init(const std::string& file_name,
+ const PolicySettings* settings) = 0;
+
+ /**
+ * @brief Get snapshot of Policy Table
+ * including app_policies, functional_groups,
+ * device_info, statistics, excluding user messages
+ * @return Generated structure for obtaining Json string.
+ */
+ virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+
+ /**
+ * Applies policy table to the current table
+ * @param update_pt policy table
+ * @return true if successfully
+ */
+ 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;
+
+ /**
+ * @brief AppHasHMIType checks whether app has been registered with certain
+ *HMI type.
+ *
+ * @return true in case app contains certain HMI type, false otherwise.
+ */
+ virtual bool AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const = 0;
+
+ /**
+ * Gets flag updateRequired
+ * @return true if update is required
+ */
+ virtual bool UpdateRequired() const = 0;
+
+ /**
+ * @brief Saves flag updateRequired
+ * @param status update status if true then update required.
+ */
+ virtual void SaveUpdateRequired(bool status) = 0;
+
+ /**
+ * @brief GetInitialAppData Retrieves data from app_policies
+ * about app on its registration
+ * @param app_id id of registered app.
+ * All outputs are filled in only if not null
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types app_types Section on HMI where app can
+ * appear (Navigation, Phone etc)
+ * @return true in case initial application data was obtained successfuly.
+ */
+ virtual bool GetInitialAppData(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types) = 0;
+
+ /**
+ * Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get functional groupings from DB
+ * @param groups Known functional groupings
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) = 0;
+
+ /**
+ * Checks if the application is represented in policy table
+ * @param app_id application id
+ * @return true if application is represented in policy table
+ */
+ virtual bool IsApplicationRepresented(const std::string& app_id) const = 0;
+
+ /**
+ * Checks if the application has default policy
+ * @param app_id application id
+ * @return true if application has default policy
+ */
+ virtual bool IsDefaultPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * @brief SetIsDefault Sets is_default flag for application
+ * @param app_id app specific application
+ * @return true in case opperation was done successfully.
+ */
+ virtual bool SetIsDefault(const std::string& app_id) = 0;
+
+ /**
+ * @brief SetIsPredata Sets is_predata flag for application
+ * @param app_id app specific application
+ * @return true in case opperation was done successfully.
+ */
+ virtual bool SetIsPredata(const std::string& app_id) = 0;
+
+ /**
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
+ virtual bool IsPredataPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * Sets default policy for application
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual bool SetDefaultPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief Is application allowed to send notifications while in
+ * Backgound or limited mode.
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Is application allowed to move foreground at will?
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get default_hmi for given application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value was
+ * not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetDefaultHMI(const std::string& app_id,
+ std::string& default_hmi) const = 0;
+
+ /**
+ * Gets HMI types from specific policy
+ * @param app_id ID application
+ * @return list of HMI types
+ */
+ virtual const policy_table::AppHMITypes* GetHMITypes(
+ const std::string& app_id) = 0;
+
+ /**
+ * @brief Resets user consent for device data and applications permissions
+ * @return
+ */
+ virtual bool ResetUserConsent() = 0;
+
+ /**
+ * @brief Gets user permissions for device data usage
+ * @param device_id Generated or obtained id of device
+ * @param consented_groups Groups consented by user
+ * @param disallowed_groups Groups not consented by user
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetUserPermissionsForDevice(
+ const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups) const = 0;
+
+ /**
+ * @brief Checks if particular mobile device has user consent in cache
+ * @return bool Suceess, if has, otherwise - false
+ */
+ virtual bool IsDeviceConsentCached(const std::string& device_id) const = 0;
+
+ /**
+ * @brief Gets permissions list for device data usage
+ * @param device_id Generated or obtained id of device
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetPermissionsList(StringArray& perm_list) const = 0;
+
+ /**
+ * @brief Checks if specified device has specified consent
+ * @return True if consent for device is set, otherwise - false
+ */
+ virtual bool HasDeviceSpecifiedConsent(const std::string& device_id,
+ const bool is_allowed) const = 0;
+
+ /**
+ * @brief Gets user consent for particular mobile device
+ * @return actual consent for device
+ */
+ virtual DeviceConsent GetDeviceConsent(
+ const std::string& device_id) const = 0;
+
+ /**
+ * @brief Sets user consent for particular mobile device
+ */
+ virtual void SetDeviceConsent(const std::string& device_id,
+ const bool is_allowed) = 0;
+
+ /**
+ * @brief Gets list of groups permissions from policy table
+ * @param device_id Unique device id, which hosts specific application
+ * @param policy_app_id Unique application id
+ * @param group_types Group list sorted by permission status
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief Gets device groups and preconsented groups from policies section
+ * @param groups List of groups to be consented for device usage
+ * @param preconsented_groups List of preconsented groups for device usage
+ * @return true, if query was successful, otherwise - false
+ */
+ virtual bool GetDeviceGroupsFromPolicies(
+ rpc::policy_table_interface_base::Strings& groups,
+ rpc::policy_table_interface_base::Strings& preconsented_groups) const = 0;
+
+ /**
+ * @brief Adds information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @param connection_type device connection type
+ * @return bool Success of operation
+ */
+ virtual bool AddDevice(const std::string& device_id,
+ const std::string& connection_type) = 0;
+
+ /**
+ * @brief Records information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @return bool Success of operation
+ */
+ virtual bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type) = 0;
+
+ /**
+ * @brief Sets user consent for particular mobile device,
+ * i.e. to use device for exchanging of Policy Table.
+ * @return bool Success of operation
+ */
+ virtual bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups,
+ const StringArray& disallowed_groups) = 0;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ */
+ virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed) = 0;
+
+ /**
+ * @brief Set user consent on functional groups
+ * @param permissions User consent on functional group
+ * @param out_app_permissions_changed Indicates whether the permissions were
+ * changed
+ * @return true, if operation succedeed, otherwise - false
+ */
+ virtual bool SetUserPermissionsForApp(const PermissionConsent& permissions,
+ bool* out_app_permissions_changed) = 0;
+
+ /**
+ * @brief Records information about head unit system to PT
+ * @return bool Success of operation
+ */
+ virtual bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Checks, if specific head unit is present in PT
+ * @return boot Suceess, if present, otherwise - false
+ */
+ virtual bool IsMetaInfoPresent() const = 0;
+
+ /**
+ * @brief Set current system language
+ * @param language System language
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool SetSystemLanguage(const std::string& language) = 0;
+
+ /**
+ * Increments global counter
+ * @param type type of counter
+ */
+ virtual void Increment(usage_statistics::GlobalCounterId type) = 0;
+
+ /**
+ * Increments counter of application
+ * @param app_id id application
+ * @param type type of counter
+ */
+ virtual void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) = 0;
+
+ /**
+ * Sets value of application information
+ * @param app_id id application
+ * @param type type of information
+ * @param value value of information
+ */
+ virtual void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) = 0;
+
+ /**
+ * Adds value to stopwatch of application
+ * @param app_id id application
+ * @param type type of stopwatch
+ * @param seconds value for adding in seconds
+ */
+ virtual void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int seconds) = 0;
+
+ /**
+ * @brief CountUnconsentedGroups allows to obtain the count of unconsented
+ * groups for specific application.
+ * @param policy_app_id application id.
+ * @param device_id device id.
+ * @param the count of unconsented groups
+ */
+ virtual int CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id) = 0;
+
+ /**
+ * @brief Gets user consent from cache for particular mobile device
+ * @return actual consent for device
+ */
+ virtual DeviceConsent GetCachedDeviceConsent(
+ const std::string& device_id) const = 0;
+
+ /**
+ * @brief Saves user consent to cache for particular mobile device
+ */
+ virtual void SaveDeviceConsentToCache(const std::string& device_id,
+ const bool is_allowed) = 0;
+
+ /**
+ * @brief Gets functional group names and user_consent_prompts, if any
+ * @param Array to be filled with group ids, names and functional prompts
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool GetFunctionalGroupNames(FunctionalGroupNames& names) = 0;
+
+ /**
+ * @brief GetAllAppGroups allows to obtain all groups for certain application.
+ * @param app_id specific application id.
+ * @param all_group_ids parameter to fill.
+ */
+ virtual void GetAllAppGroups(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids) = 0;
+
+ /**
+ * @brief GetPreConsentedGroups allows to obtain all pre-consented groups for
+ * specific application.
+ * @param app_id specific application id.
+ * @param preconsented_groups parameter to fill.
+ */
+ virtual void GetPreConsentedGroups(
+ const std::string& app_id, FunctionalGroupIDs& preconsented_groups) = 0;
+
+ /**
+ * @brief GetConsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param app_id application id.
+ * @param allowed_groups list of allowed groups
+ * @param disallowed_groups list of disallowed groups
+ */
+ virtual void GetConsentedGroups(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups) = 0;
+
+ /**
+ * @brief GetUnconsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param policy_app_id application id.
+ * @param unconsented_groups list of unconsented groups.
+ */
+ virtual void GetUnconsentedGroups(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups) = 0;
+
+ virtual void RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name) = 0;
+
+ /**
+ * @brief Set app policy to pre_DataConsented policy
+ * @param app_id Policy ID of application to be changed
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool SetPredataPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief Removes unpaired devices
+ * @return true if success
+ */
+ virtual bool CleanupUnpairedDevices() = 0;
+
+ /**
+ * Sets flag of unpaired device
+ * @param device_id Unique device id
+ * @param unpaired True, if should be marked as unpaired, otherwise - false
+ * @return true if success
+ */
+ virtual bool SetUnpairedDevice(const std::string& device_id,
+ bool unpaired = true) = 0;
+
+ /**
+ * Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ virtual bool ResetPT(const std::string& file_name) = 0;
+
+ /**
+ * @brief LoadFromBackup allows to load policy into the cache from backup.
+ * @return true in case operation was successful.
+ */
+ virtual bool LoadFromBackup() = 0;
+
+ /**
+ * @brief LoadFromFile allows to load policy cache from preloaded table.
+ * @param file_name preloaded
+ * @param table object which will be filled during file parsing.
+ * @return true in case file was successfuly loaded, false otherwise.
+ */
+ virtual bool LoadFromFile(const std::string& file_name,
+ policy_table::Table& table) = 0;
+
+ /**
+ * @brief Backup allows to save cache onto hard drive.
+ */
+ virtual void Backup() = 0;
+
+ /**
+ * Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Resets all calculated permissions in cache
+ */
+ virtual void ResetCalculatedPermissions() = 0;
+
+ /**
+ * @brief Resets all calculated permissions for specified device in cache
+ */
+ virtual void ResetCalculatedPermissionsForDevice(
+ const std::string& device_id) = 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;
+
+ /**
+ * @brief Gets meta information
+ * @return meta information
+ */
+ virtual const MetaInfo GetMetaInfo() const = 0;
+
+ /**
+ * @brief GetCertificate allows to obtain certificate in order to
+ * make secure connection
+ *
+ * @return The certificate in PKCS#7.
+ */
+ virtual std::string GetCertificate() const = 0;
+
+ /**
+ * @brief Sets decrypted certificate in policy table
+ * @param certificate content of certificate
+ */
+ virtual void SetDecryptedCertificate(const std::string& certificate) = 0;
+
+ /**
+ * @brief Saves customer connectivity settings status
+ * @param status external consent status
+ * @return true if succeeded, otherwise - false
+ */
+ virtual bool SetExternalConsentStatus(
+ const ExternalConsentStatus& status) = 0;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return external consent status
+ */
+ virtual ExternalConsentStatus GetExternalConsentStatus() = 0;
+
+ /**
+ * @brief Creates externalConsentStatus data structure from policy table
+ section "externalConsentStatus"
+ * @return ExternalConsentStatus data structure
+ */
+ virtual ExternalConsentStatus GetExternalConsentEntities() = 0;
+
+ /**
+ * @brief Creates collection of ExternalConsent items known by current
+ * functional
+ * groupings and appropiate section
+ * (disallowed_by_external_consent_entities_on/off) where
+ * is item is being holded
+ * @param status Current status containing collection of ExternalConsent items
+ * @return Collection of ExternalConsent items mapped to list of groups with
+ * section
+ * marker where the item is found
+ */
+ virtual GroupsByExternalConsentStatus GetGroupsWithSameEntities(
+ const ExternalConsentStatus& status) = 0;
+
+ /**
+ * @brief Gets collection of links device-to-application from device_data
+ * section of policy table if there any application records present, i.e. if
+ * any specific user consent is present
+ * @return Collection of device-to-application links
+ */
+ virtual std::map<std::string, std::string> GetKnownLinksFromPT() = 0;
+
+ /**
+ * @brief Sets groups permissions affected by customer connectivity settings
+ * entities status, i.e. groups assigned to particular application on
+ * particular device which have same entities as current ExternalConsent status
+ * @param permissions Groups permissions which result current ExternalConsent
+ * status
+ */
+ virtual void SetExternalConsentForApp(
+ const PermissionConsent& permissions) = 0;
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+
+#ifdef BUILD_TESTS
+ /**
+ * @brief GetPT allows to obtain SharedPtr to PT.
+ * Used ONLY in Unit tests
+ * @return SharedPTR to PT
+ *
+ */
+ virtual utils::SharedPtr<policy_table::Table> GetPT() const = 0;
+#endif
+};
+
+typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h
new file mode 100644
index 0000000000..6945f45b45
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_helper.h
@@ -0,0 +1,346 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_
+
+#include "policy/policy_table/functions.h"
+#include "utils/shared_ptr.h"
+#include "policy/policy_types.h"
+
+namespace policy {
+class PolicyManagerImpl;
+
+const std::string kAllowedKey = "allowed";
+const std::string kUserDisallowedKey = "userDisallowed";
+const std::string kUndefinedKey = "undefined";
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+typedef policy_table::Strings::const_iterator StringsConstItr;
+typedef policy_table::ApplicationPolicies::const_iterator AppPoliciesConstItr;
+typedef policy_table::HmiLevels::const_iterator HMILevelsConstItr;
+typedef policy_table::Parameters::const_iterator ParametersConstItr;
+typedef policy_table::Rpc::const_iterator RpcConstItr;
+typedef policy_table::FunctionalGroupings::const_iterator FuncGroupConstItr;
+
+typedef policy_table::ApplicationPolicies::value_type AppPoliciesValueType;
+typedef policy_table::Rpc::value_type RpcValueType;
+typedef policy_table::Strings::value_type StringsValueType;
+
+/*
+ * @brief Helper struct to compare functional group names
+ */
+struct CompareGroupName {
+ explicit CompareGroupName(const StringsValueType& group_name);
+ bool operator()(const StringsValueType& group_name_to_compare) const;
+
+ private:
+ const StringsValueType& group_name_;
+};
+
+/*
+ * @brief Used for compare of policies parameters mapped with specific
+ * application ids
+ */
+bool operator!=(const policy_table::ApplicationParams& first,
+ const policy_table::ApplicationParams& second);
+
+/**
+ * @brief Helper struct for checking changes of application policies, which
+ * come with update along with current data snapshot
+ * @param pm Pointer to PolicyManager instance
+ * @param update Shared pointer to policy table update received
+ * @param snapshot Shared pointer to current policy table copy
+ * @param out_results Collection of check result
+ */
+struct CheckAppPolicy {
+ CheckAppPolicy(PolicyManagerImpl* pm,
+ const utils::SharedPtr<policy_table::Table> update,
+ const utils::SharedPtr<policy_table::Table> snapshot,
+ CheckAppPolicyResults& out_results);
+
+ bool operator()(const AppPoliciesValueType& app_policy);
+
+ private:
+ /**
+ * @brief Sets pending values to be notified to the system (depends on HMI
+ * level of application) with SDL.ActivateApp or OnAppPermissionsChanged
+ * notification
+ * @param app_policy Reference to updated application policy
+ * @param result Result of check of updated policy
+ */
+ void SetPendingPermissions(const AppPoliciesValueType& app_policy,
+ PermissionsCheckResult result) const;
+ /**
+ * @brief Analyzes updated application policy whether any changes received. If
+ * yes - provides appropriate result code
+ * @param app_policy Reference to updated application policy
+ * @return Result code according to changes in updated policy
+ */
+ PermissionsCheckResult CheckPermissionsChanges(
+ const AppPoliciesValueType& app_policy) const;
+ /**
+ * @brief Checks whether updated policy has groups revoked, i.e. absent in
+ * compare to current one
+ * @param app_policy Reference to updated policy
+ * @param revoked_groups List of revoked groups if any
+ * @return True if there are revoked groups, otherwise - false
+ */
+ bool HasRevokedGroups(const AppPoliciesValueType& app_policy,
+ policy_table::Strings* revoked_groups = NULL) const;
+ /**
+ * @brief Checks whether updated application policy has new group in compare
+ * to current one
+ * @param app_policy Reference to updated application policy
+ * @param new_groups List of new groups if any
+ * @return True if new groups found, otherwise - false
+ */
+ bool HasNewGroups(const AppPoliciesValueType& app_policy,
+ policy_table::Strings* new_groups = NULL) const;
+ /**
+ * @brief Checks whether updated policy has groups which require user consent
+ * @param app_policy Reference to updated application policy
+ * @return True if has groups requiring user consents, otherwise - false
+ */
+ bool HasConsentNeededGroups(const AppPoliciesValueType& app_policy) const;
+ /**
+ * @brief Gets revoked groups parameters from current policies
+ * @param app_policy Reference to updated application policy
+ * @return List of revoked groups with their parameters
+ */
+ std::vector<FunctionalGroupPermission> GetRevokedGroups(
+ const AppPoliciesValueType& app_policy) const;
+ /**
+ * @brief Removes consents for revoked groups of application
+ * @param app_policy Reference to updated application policy
+ * @param revoked_groups List of revoked groups with parameters to remove
+ * consents if any exists
+ */
+ void RemoveRevokedConsents(
+ const AppPoliciesValueType& app_policy,
+ const std::vector<FunctionalGroupPermission>& revoked_groups) const;
+ /**
+ * @brief Checks whether application is present in current policy table,
+ * since update can be processed only for application known by policy while
+ * it sent update request
+ * @param application_id Application id
+ * @return True if application is known, otherwise - false
+ */
+ bool IsKnownAppication(const std::string& application_id) const;
+ /**
+ * @brief Checks whether application is revoked by backend, i.e. has 'null'
+ * for policies parameters
+ * @param app_policy Reference to updated application policy
+ * @return True if application is revoked, otherwise - false
+ */
+ bool IsAppRevoked(const AppPoliciesValueType& app_policy) const;
+ /**
+ * @brief Checks whether there such application is registered and has correct
+ * nickname
+ * @param app_policy Reference to updated application policy
+ * @return True if there is nickname mismatch, otherwise - false
+ */
+ bool NicknamesMatch(const AppPoliciesValueType& app_policy) const;
+ /**
+ * @brief Adds result of check of current application policy with updated one
+ * @param app_id Application id
+ * @param result Result value
+ */
+ void AddResult(const std::string& app_id, PermissionsCheckResult result);
+ /**
+ * @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& app_id,
+ const std::string& group_name) const;
+ /**
+ * @brief Checks whether RequestTypes of application have been changed by
+ * udpated
+ * @param app_policy Reference to updated application policy
+ * @return True if changed, otherwise - false
+ */
+ bool IsRequestTypeChanged(const AppPoliciesValueType& app_policy) const;
+
+ private:
+ PolicyManagerImpl* pm_;
+ const utils::SharedPtr<policy_table::Table> update_;
+ const utils::SharedPtr<policy_table::Table> snapshot_;
+ CheckAppPolicyResults& out_results_;
+};
+
+/**
+ * @brief Helper struct for filling actions to be done for processed application
+ * using CheckAppPolicyResults data as a source
+ */
+struct FillActionsForAppPolicies {
+ FillActionsForAppPolicies(
+ ApplicationsPoliciesActions& actions,
+ const policy_table::ApplicationPolicies& app_policies)
+ : actions_(actions), app_policies_(app_policies) {}
+
+ void operator()(const policy::CheckAppPolicyResults::value_type& value);
+
+ private:
+ ApplicationsPoliciesActions& actions_;
+ const policy_table::ApplicationPolicies& app_policies_;
+};
+
+/*
+ * @brief Fill permissions data with merged rpc permissions for hmi levels and
+ * parameters
+ */
+struct FillNotificationData {
+ /**
+ * @brief Constructor
+ * @param data Output structure with filled data
+ * @param group_state Consent of the group processed by instance
+ * @param undefined_group_consent Defines how to treat 'undefined' consent
+ * @param does_require_user_consent Specifies whether processed group requires
+ * user consent
+ */
+ FillNotificationData(Permissions& data,
+ GroupConsent group_state,
+ GroupConsent undefined_group_consent,
+ bool does_require_user_consent);
+ bool operator()(const RpcValueType& rpc);
+ void UpdateHMILevels(const policy_table::HmiLevels& in_hmi,
+ HMIPermissions& out_hmi);
+ void UpdateParameters(const policy_table::Parameters& in_parameters,
+ ParameterPermissions& out_parameter);
+
+ private:
+ void ExcludeSame(RpcPermissions& rpc);
+ void ExcludeSameHMILevels(std::set<HMILevel>& source,
+ const std::set<HMILevel>& target);
+ void ExcludeSameParameters(std::set<Parameter>& source,
+ const std::set<Parameter>& target);
+ void InitRpcKeys(const std::string& rpc_name);
+ bool RpcParametersEmpty(RpcPermissions& rpc);
+ bool IsSectionEmpty(ParameterPermissions& permissions,
+ const std::string& section);
+ std::string current_key_;
+ Permissions& data_;
+ const bool does_require_user_consent_;
+};
+
+/*
+ * @brief Checks for functional group presence and pass it to helper struct,
+ * which fills permissions data according to group consent
+ */
+struct ProcessFunctionalGroup {
+ ProcessFunctionalGroup(
+ const policy_table::FunctionalGroupings& fg,
+ const std::vector<FunctionalGroupPermission>& group_permissions,
+ Permissions& data,
+ GroupConsent undefined_group_consent = GroupConsent::kGroupDisallowed);
+ bool operator()(const StringsValueType& group_name);
+
+ private:
+ GroupConsent GetGroupState(const std::string& group_name);
+ const policy_table::FunctionalGroupings& fg_;
+ const std::vector<FunctionalGroupPermission>& group_permissions_;
+ Permissions& data_;
+ GroupConsent undefined_group_consent_;
+};
+
+struct FunctionalGroupInserter {
+ FunctionalGroupInserter(const policy_table::Strings& preconsented_groups,
+ PermissionsList& list);
+ void operator()(const StringsValueType& group_name);
+
+ private:
+ PermissionsList& list_;
+ const policy_table::Strings& preconsented_;
+};
+
+/**
+ * @brief Fills FunctionalGroupPermissions with provided params
+ * @param ids Functional group ids from DB
+ * @param names Group names and user_consent_prompt
+ * @param state User consent for group
+ * @param permissions Struct to be filled with provided params
+ */
+void FillFunctionalGroupPermissions(
+ FunctionalGroupIDs& ids,
+ FunctionalGroupNames& names,
+ GroupConsent state,
+ std::vector<FunctionalGroupPermission>& permissions);
+
+/**
+ * @brief Checks, if application is predefined, e.g. "default", i.e. which is
+ * must be present in policy table
+ * @param app Application struct
+ * @return true, if app is predefined, otherwise - false
+ */
+bool IsPredefinedApp(const AppPoliciesValueType& app);
+
+/**
+ * @brief Excludes same values
+ * @param from Source, which should be checked
+ * @param what Target, which should be excluded from source
+ * @return Values without excluded
+ */
+FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
+ const FunctionalGroupIDs& what);
+
+/**
+ * @brief Merges all values without same values
+ * @param first First source of values
+ * @param second Second source of values
+ * @return Merged values w/o same values
+ */
+FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second);
+
+/**
+ * @brief Finds same values
+ * @param first First source of values
+ * @param second Second source of values
+ * @return Same values set, if any found
+ */
+FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second);
+
+/**
+ * @brief Unwrap application policies from predefined values to specific policy
+ * values, i.e. if application has "default", it will be assigned default
+ * policies
+ * @param app_policies Application policies to unwrap
+ * @return true, if succeded, otherwise - false
+ */
+bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies);
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
new file mode 100644
index 0000000000..97a2e60055
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h
@@ -0,0 +1,1087 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
+
+#include <list>
+#include "utils/shared_ptr.h"
+#include "utils/lock.h"
+#include "policy/policy_manager.h"
+#include "policy/policy_table.h"
+#include "policy/cache_manager_interface.h"
+#include "policy/update_status_manager.h"
+#include "policy/policy_table/functions.h"
+#include "policy/usage_statistics/statistics_manager.h"
+
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
+#endif // SDL_REMOTE_CONTROL
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace policy {
+struct CheckAppPolicy;
+
+class PolicyManagerImpl : public PolicyManager {
+ public:
+ PolicyManagerImpl();
+ explicit PolicyManagerImpl(bool in_memory);
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ void set_listener(PolicyListener* listener) OVERRIDE;
+
+ /**
+ * @brief listener get current policy listener instance
+ * @return current policy listener
+ */
+ PolicyListener* listener() const {
+ return listener_;
+ }
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) OVERRIDE;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) OVERRIDE;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name) OVERRIDE;
+
+ /**
+ * @brief Gets last URL for sending PTS to from PT itself
+ * @param service_type Service specifies user of URL
+ * @return last URL or empty string if endpoint entry is empty
+ */
+ std::string GetUpdateUrl(int service_type) OVERRIDE;
+
+ /**
+ * @brief Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @param out_end_points output vector of urls
+ */
+ void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+ void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+
+ /**
+ * @brief PTU is needed, for this PTS has to be formed and sent.
+ */
+ void RequestPTUpdate() OVERRIDE;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ bool ResetUserConsent() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ void KmsChanged(int kilometers) OVERRIDE;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ void IncrementIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchange() OVERRIDE;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchangeAtUserRequest() OVERRIDE;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ std::string GetPolicyTableStatus() const OVERRIDE;
+
+ /**
+ * @brief Resets retry sequence
+ */
+ void ResetRetrySequence() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ int NextRetryTimeout() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeMSec() OVERRIDE;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ const std::vector<int> RetrySequenceDelaysSeconds() OVERRIDE;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ void OnExceededTimeout() OVERRIDE;
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ * @return url which point to the resourse where lock screen icon could be
+ *obtained.
+ */
+ std::string GetLockScreenIconUrl() const OVERRIDE;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ void OnUpdateStarted() OVERRIDE;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ void PTUpdatedAt(Counters counter, int value) OVERRIDE;
+
+ /**
+ * @brief Refresh data about retry sequence from policy table
+ */
+ virtual void RefreshRetrySequence();
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ DeviceConsent GetUserConsentForDevice(
+ const std::string& device_id) const OVERRIDE;
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetUserConsentForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ void SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) OVERRIDE;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ const bool is_device_allowed) OVERRIDE;
+
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) OVERRIDE;
+
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ void AddDevice(const std::string& device_id,
+ const std::string& connection_type) OVERRIDE;
+
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) OVERRIDE;
+
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ * @param mode notification mode
+ */
+ void SetUserConsentForApp(const PermissionConsent& permissions,
+ const NotificationMode mode) OVERRIDE;
+
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const OVERRIDE;
+
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const OVERRIDE;
+
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @param active_hmi_language Currently active language
+ * @return Array of structs with appropriate message parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ const std::vector<std::string>& message_code,
+ const std::string& language,
+ const std::string& active_hmi_language) OVERRIDE;
+
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetPermissionsForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ void SetSystemLanguage(const std::string& language) OVERRIDE;
+
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) OVERRIDE;
+
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ void OnSystemReady() OVERRIDE;
+
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
+
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ void SetVINValue(const std::string& value) OVERRIDE;
+
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) OVERRIDE;
+
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ void RemovePendingPermissionChanges(const std::string& app_id) OVERRIDE;
+
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ bool CleanupUnpairedDevices() OVERRIDE;
+
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ bool CanAppStealFocus(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ void MarkUnpairedDevice(const std::string& device_id) OVERRIDE;
+
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
+ StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) OVERRIDE;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+
+ /**
+ * @brief Sends notification about application HMI level changed
+ * @param who application information structure
+ */
+ void SendHMILevelChanged(const ApplicationOnDevice& who);
+
+ /**
+ * @brief Sends notification if application permissions were changed
+ * @param application_id Unique id of application
+ */
+ void OnPrimaryGroupsChanged(const std::string& application_id);
+#endif // SDL_REMOTE_CONTROL
+
+ /**
+ * @brief Removes consent for application functional group
+ * @param application_id Unique id of application
+ * @param group_name application functional group name
+ */
+ virtual void RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name);
+
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ void SaveUpdateStatusRequired(bool is_update_needed) OVERRIDE;
+
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Setter for cache_manager instance
+ * @param cache_manager pointer to new cache_manager instance
+ */
+ void set_cache_manager(CacheManagerInterface* cache_manager);
+
+ /**
+ * @brief Handler on applications search started
+ */
+ void OnAppsSearchStarted() OVERRIDE;
+
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
+
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ const VehicleInfo GetVehicleInfo() const OVERRIDE;
+
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
+ /**
+ * @brief Gets meta information
+ * @return meta information
+ */
+ const MetaInfo GetMetaInfo() const OVERRIDE;
+
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ std::string RetrieveCertificate() const OVERRIDE;
+
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ bool HasCertificate() const OVERRIDE;
+
+ /**
+ * @brief Sets decrypted certificate in policy table
+ * @param certificate content of certificate
+ */
+ void SetDecryptedCertificate(const std::string& certificate) OVERRIDE;
+
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
+ const PolicySettings& get_settings() const OVERRIDE;
+
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
+ AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+
+ /**
+ * @brief Checks if there is existing URL in the EndpointUrls vector with
+ * index saved in the policy manager and if not, it moves to the next
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
+ AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const OVERRIDE;
+
+ /**
+ * @brief Checks, if SDL needs to update it's policy table section
+ "external_consent_status"
+ * @param ExternalConsent status
+ * @return true if such check is needed, false - if not.
+ */
+ bool IsNeedToUpdateExternalConsentStatus(
+ const ExternalConsentStatus& status) const OVERRIDE;
+
+ /**
+ * @brief Saves customer connectivity settings status
+ * @param status ExternalConsent status
+ * @return true if succeeded, otherwise - false
+ */
+ bool SetExternalConsentStatus(const ExternalConsentStatus& status) OVERRIDE;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return ExternalConsent status
+ */
+ ExternalConsentStatus GetExternalConsentStatus() OVERRIDE;
+
+#ifdef BUILD_TESTS
+ /**
+ * @brief Getter for cache_manager instance
+ * @return cache_manager instance
+ */
+ inline CacheManagerInterfaceSPtr GetCache() {
+ return cache_;
+ }
+
+ /**
+ * @brief Setter for send_on_update_sent_out and wrong_ptu_update_received
+ * @param send_on_update_sent_out new value of this flag
+ * @param wrong_ptu_update_received new value of this flag
+ */
+ inline void SetSendOnUpdateFlags(const bool send_on_update_sent_out,
+ const bool wrong_ptu_update_received) {
+ send_on_update_sent_out_ = send_on_update_sent_out;
+ wrong_ptu_update_received_ = wrong_ptu_update_received;
+ }
+#endif // BUILD_TESTS
+
+ // Interface StatisticsManager (begin)
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) OVERRIDE;
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) OVERRIDE;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) OVERRIDE;
+ // Interface StatisticsManager (end)
+
+ protected:
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
+ virtual utils::SharedPtr<policy_table::Table> Parse(
+ const BinaryMessage& pt_content);
+
+ private:
+ /**
+ * @brief Checks if PT update should be started and schedules it if needed
+ */
+ void CheckTriggers();
+
+ /**
+ * @brief Compares current applications policies to the updated one and
+ * returns apporopriate result codes per application, which that are being
+ * processed by sending notification to applications registered and to the
+ * system
+ * @param update Shared pointer to policy table udpate
+ * @param snapshot Shared pointer to current copy of policy table
+ * @return Collection per-application results
+ */
+ CheckAppPolicyResults CheckPermissionsChanges(
+ const utils::SharedPtr<policy_table::Table> update,
+ const utils::SharedPtr<policy_table::Table> snapshot);
+
+ /**
+ * @brief Processes results from policy table update analysis done by
+ * CheckPermissionsChanges() by filling ApplicationsPoliciesActions struct
+ * with actions which should be done for every application and passes them to
+ * ProcessActionsForAppPolicies()
+ * @param results Collection of per-application results
+ * @param app_policies Reference to updated application policies section as
+ * a data source for generating notifications data
+ */
+ void ProcessAppPolicyCheckResults(
+ const CheckAppPolicyResults& results,
+ const policy_table::ApplicationPolicies& app_policies);
+
+ /**
+ * @brief Processes actions filled in ProcessAppPolicyCheckResults() for every
+ * application by sending OnPermissionChange and OnAppPermissionChanged
+ * notifications and by checking consent where it needed
+ * @param actions Reference to map with actions to be done or not for every
+ * application
+ * @param app_policies Reference to updated application policies section as
+ * a data source for generating notifications data
+ */
+ void ProcessActionsForAppPolicies(
+ const ApplicationsPoliciesActions& actions,
+ const policy_table::ApplicationPolicies& app_policies);
+
+ /**
+ * @brief Fill structure to be sent with OnPermissionsChanged notification
+ *
+ * @param Policy table struct, which contains rpc functional groups data
+ * @param List of rpc functional group names, which should be checked
+ * @param group_permission User permissions for functional groups
+ * @param Notification struct to be filled and sent
+ */
+ void PrepareNotificationData(
+ const policy_table::FunctionalGroupings& groups,
+ const policy_table::Strings& group_names,
+ const std::vector<FunctionalGroupPermission>& group_permission,
+ Permissions& notification_data);
+
+ /**
+ * @brief Validate PermissionConsent structure according to currently
+ * assigned groups
+ * @param permissions PermissionConsent structure that should be validated.
+ * @return PermissonConsent struct, which contains no foreign groups
+ */
+ PermissionConsent EnsureCorrectPermissionConsent(
+ const PermissionConsent& permissions_to_check);
+
+ /**
+ * @brief Allows to process case when added application is not present in
+ * policy db.
+ * @param policy application id.
+ * @param cuuren consent for application's device.
+ */
+ void AddNewApplication(const std::string& application_id,
+ DeviceConsent device_consent);
+
+ /**
+ * @brief Allows to process case when added application is already
+ * in policy db.
+ * @param policy application id.
+ * @param cuuren consent for application's device.
+ */
+ void PromoteExistedApplication(const std::string& application_id,
+ DeviceConsent device_consent);
+
+ /**
+ * @brief Check if certain application already in policy db.
+ * @param policy application id.
+ * @return true if application presents false otherwise.
+ */
+ 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);
+
+ /**
+ * @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.
+ */
+ void StartPTExchange() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded days
+ * @return true if exceeded
+ */
+ bool ExceededDays() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ bool ExceededIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Checks is specified policy table valid
+ * @param policy_table pointer to policy table to check
+ * @param type policy table type
+ * @return true if policy table valid, otherwise false
+ */
+ bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
+ policy_table::PolicyTableType type) const;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of RPC param/HMI permissions
+ */
+ void GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data);
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+
+ /**
+ * @brief Notify application about its permissions changes by preparing and
+ * sending OnPermissionsChanged notification
+ * @param policy_app_id Application id to send notification to
+ * @param app_group_permissons Current permissions for groups assigned to
+ * application
+ */
+ void NotifyPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& app_group_permissions);
+
+ /**
+ * @brief Processes updated ExternalConsent status received via
+ * OnAppPermissionConsent
+ * notification by updating user consents and ExternalConsent consents for
+ * registered and
+ * known before by policy table (must have any user consent records)
+ * @param groups_by_status Collection of ExternalConsent entities with their
+ * statuses
+ * @param processing_policy Defines whether consents timestamps must be
+ * considered or external consents take over
+ */
+ void ProcessExternalConsentStatusUpdate(
+ const GroupsByExternalConsentStatus& groups_by_status,
+ const ConsentProcessingPolicy processing_policy);
+
+ /**
+ * @brief Processes ExternalConsent status for application registered
+ * afterward, so its
+ * user consents (if any) and ExternalConsent consents (if any) will be
+ * updated
+ * appropiately to current ExternalConsent status stored by policy table
+ * @param application_id Application id
+ * @param processing_policy Defines whether consents timestamps must be
+ * considered or external consents take over
+ */
+ void ProcessExternalConsentStatusForApp(
+ const std::string& application_id,
+ const ConsentProcessingPolicy processing_policy);
+ /**
+ * @brief Directly updates user consent and ExternalConsent consents (if any)
+ * for
+ * application if it has assigned any of group from allowed or disallowed
+ * lists
+ * @param device_id Device id which is linked to application id
+ * @param application_id Application id
+ * @param allowed_groups List of group names allowed by current
+ * ExternalConsent status
+ * @param disallowed_groups List of group names disallwed by current
+ * ExternalConsent status
+ * @param processing_policy Defines whether consents timestamps have to be
+ * considered or external consents take over
+ */
+ void UpdateAppConsentWithExternalConsent(
+ const std::string& device_id,
+ const std::string& application_id,
+ const GroupsNames& allowed_groups,
+ const GroupsNames& disallowed_groups,
+ const ConsentProcessingPolicy processing_policy);
+
+ typedef policy_table::ApplicationPolicies::value_type AppPoliciesValueType;
+
+ /**
+ * @brief Notifies system by sending OnAppPermissionChanged notification
+ * @param app_policy Reference to application policy
+ */
+ void NotifySystem(const AppPoliciesValueType& app_policy) const;
+
+ /**
+ * @brief Sends OnPermissionChange notification to application if its
+ * currently registered
+ * @param app_policy Reference to application policy
+ */
+ void SendPermissionsToApp(const AppPoliciesValueType& app_policy);
+
+ /**
+ * @brief Gets groups names from collection of groups permissions
+ * @param app_group_permissions Collection of groups permissions
+ * @return Collection of group names
+ */
+ policy_table::Strings GetGroupsNames(
+ const std::vector<FunctionalGroupPermission>& app_group_permissions)
+ const;
+
+ /**
+ * @brief Calculates consents for groups based on mapped ExternalConsent
+ * entities statuses
+ * and groups containers where entities have been found
+ * @param groups_by_external_consent ExternalConsent entities mapped to
+ * functional groups names and
+ * their containters where this entity has been found
+ * @param out_allowed_groups List of groups allowed by ExternalConsent status
+ * @param out_disallowed_groups List of groups disallowed by ExternalConsent
+ * status
+ */
+ void CalculateGroupsConsentFromExternalConsent(
+ const GroupsByExternalConsentStatus& groups_by_external_consent,
+ GroupsNames& out_allowed_groups,
+ GroupsNames& out_disallowed_groups) const;
+
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
+ PolicyListener* listener_;
+
+ /**
+ * @brief UpdateStatusManager instance for controlling PT status
+ */
+ UpdateStatusManager update_status_manager_;
+
+ /**
+ * @brief pointer to CacheManagerInterface instance for getting policy data
+ */
+ CacheManagerInterfaceSPtr cache_;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief pointer to AccessRemote instance for working with RC applications
+ */
+ utils::SharedPtr<AccessRemote> access_remote_;
+#endif
+
+ /**
+ * @brief lock guard for protecting applications list access
+ */
+ sync_primitives::Lock apps_registration_lock_;
+
+ /**
+ * @brief lock guard for protecting application permissions access
+ */
+ sync_primitives::Lock app_permissions_diff_lock_;
+
+ /**
+ * @brief Collection of parameters to be reported to the system with
+ * SDL.ActivateApp response or OnAppPermissionsChanged notification
+ * Being set during policy table update processing
+ */
+ typedef std::map<std::string, AppPermissions> PendingPermissions;
+ PendingPermissions app_permissions_diff_;
+
+ /**
+ * @brief Timeout to wait response with UpdatePT
+ */
+ uint32_t retry_sequence_timeout_;
+
+ /**
+ * @brief Seconds between retries to update PT
+ */
+ std::vector<int> retry_sequence_seconds_;
+
+ /**
+ * @brief Current index trying of retry sequence
+ */
+ uint32_t retry_sequence_index_;
+
+ /**
+ * @brief Lock for guarding retry sequence
+ */
+ sync_primitives::Lock retry_sequence_lock_;
+
+ /**
+ * @brief Device id, which is used during PTU handling for specific
+ * application
+ */
+ mutable std::string last_device_id_;
+
+ /**
+ * @brief Flag for checking first ignition cycle
+ */
+ bool ignition_check;
+
+ /**
+ * @brief Pointer to current policy settings structure
+ */
+ const PolicySettings* settings_;
+ friend struct CheckAppPolicy;
+
+ /**
+ * @brief Pair of app index and url index from Endpoints vector
+ * that contains all application URLs
+ */
+ RetrySequenceURL retry_sequence_url_;
+ friend struct ProccessAppGroups;
+
+ /**
+ * @brief Flag for notifying that invalid PTU was received
+ */
+ bool wrong_ptu_update_received_;
+
+ /**
+ * @brief Flag for notifying that PTU was started
+ */
+ bool send_on_update_sent_out_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU should be triggered
+ */
+ bool trigger_ptu_;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h
new file mode 100644
index 0000000000..ecbd56c2e4
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_table.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
+
+#include "utils/shared_ptr.h"
+#include "policy/pt_representation.h"
+#include "policy/pt_ext_representation.h"
+
+namespace policy {
+
+class PolicyTable {
+ public:
+ PolicyTable();
+ explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ virtual ~PolicyTable();
+
+ /**
+ * @brief Returns current implementation of
+ * actual class storing policy table.
+ * @return PTRepresentation* Policy Table Content Handler
+ */
+ utils::SharedPtr<PTRepresentation> pt_data() const {
+ return pt_data_;
+ }
+
+ private:
+ utils::SharedPtr<PTRepresentation> pt_data_;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h
new file mode 100644
index 0000000000..4f8ae5c98d
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_ENUMS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_ENUMS_H_
+
+#include <string>
+
+namespace rpc {
+namespace policy_table_interface_base {
+
+enum Priority {
+ P_EMERGENCY,
+ P_NAVIGATION,
+ P_VOICECOM,
+ P_COMMUNICATION,
+ P_NORMAL,
+ P_NONE,
+};
+
+bool IsValidEnum(Priority val);
+const char* EnumToJsonString(Priority val);
+bool EnumFromJsonString(const std::string& literal, Priority* result);
+
+enum HmiLevel {
+ HL_BACKGROUND,
+ HL_FULL,
+ HL_LIMITED,
+ HL_NONE,
+};
+bool IsValidEnum(HmiLevel val);
+const char* EnumToJsonString(HmiLevel val);
+bool EnumFromJsonString(const std::string& literal, HmiLevel* result);
+
+enum Parameter {
+ P_GPS,
+ P_SPEED,
+ P_ENGINETORQUE,
+ P_EXTERNALTEMPERATURE,
+ P_FUELLEVEL,
+ P_FUELLEVEL_STATE,
+ P_HEADLAMPSTATUS,
+ P_INSTANTFUELCONSUMPTION,
+ P_ODOMETER,
+ P_TIREPRESSURE,
+ P_WIPERSTATUS,
+ P_VIN,
+ P_ACCPEDALPOSITION,
+ P_BELTSTATUS,
+ P_DRIVERBRAKING,
+ P_PRNDL,
+ P_RPM,
+ P_STEERINGWHEELANGLE,
+ P_MYKEY,
+ P_AIRBAGSTATUS,
+ P_BODYINFORMATION,
+ P_CLUSTERMODESTATUS,
+ P_DEVICESTATUS,
+ P_EMERGENCYEVENT,
+ P_ECALLINFO,
+ P_ABS_STATE,
+ P_TURN_SIGNAL,
+ P_FUEL_RANGE,
+ P_TIRE_PRESSURE_VALUE,
+ P_TPMS,
+ P_LONGTITUDE_DEGREES,
+ P_LATITUDE_DEGREES,
+ P_LOCATION_NAME,
+ P_LOCATION_DESCRIPTION,
+ P_ADDRESS_LINES,
+ P_PHONE_NUMBER,
+ P_LOCATION_IMAGE,
+ P_DELIVERY_MODE,
+ P_TIMESTAMP,
+ P_ADDRESS,
+ P_EMPTY // Added to allow empty parameters handling
+};
+
+bool IsValidEnum(Parameter val);
+const char* EnumToJsonString(Parameter val);
+bool EnumFromJsonString(const std::string& literal, Parameter* result);
+
+enum AppHMIType {
+ AHT_DEFAULT,
+ AHT_COMMUNICATION,
+ AHT_MEDIA,
+ AHT_MESSAGING,
+ AHT_NAVIGATION,
+ AHT_INFORMATION,
+ AHT_SOCIAL,
+ AHT_BACKGROUND_PROCESS,
+ AHT_TESTING,
+ AHT_SYSTEM,
+ AHT_PROJECTION,
+ AHT_REMOTE_CONTROL,
+};
+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);
+
+enum Input {
+ I_GUI,
+ I_VUI,
+};
+bool IsValidEnum(Input val);
+const char* EnumToJsonString(Input val);
+bool EnumFromJsonString(const std::string& literal, Input* result);
+
+enum ModuleType {
+ MT_CLIMATE,
+ MT_RADIO,
+};
+bool IsValidEnum(ModuleType val);
+const char* EnumToJsonString(ModuleType val);
+bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+
+extern const std::string kDefaultApp;
+extern const std::string kPreDataConsentApp;
+extern const std::string kDeviceApp;
+
+} // namespace policy_table_interface_base
+} // namespace rpc
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_ENUMS_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_table/functions.h b/src/components/policy/policy_external/include/policy/policy_table/functions.h
new file mode 100644
index 0000000000..07d4a42a25
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_table/functions.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_FUNCTIONS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_FUNCTIONS_H_
+
+#include "policy/policy_table/enums.h"
+#include "policy/policy_table/types.h"
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_FUNCTIONS_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h
new file mode 100644
index 0000000000..53f5a35b99
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_table/types.h
@@ -0,0 +1,595 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_TYPES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_TYPES_H_
+
+#include <climits>
+#include "utils/macro.h"
+
+#include "policy/policy_table/enums.h"
+#include "rpc_base/rpc_message.h"
+
+namespace Json {
+class Value;
+} // namespace Json
+namespace rpc {
+namespace policy_table_interface_base {
+struct AppLevel;
+struct ApplicationParams;
+struct ConsentRecords;
+struct DeviceParams;
+struct MessageLanguages;
+struct MessageString;
+struct RpcParameters;
+struct Rpcs;
+} // namespace policy_table_interface_base
+} // namespace rpc
+
+namespace rpc {
+namespace policy_table_interface_base {
+
+// According to HMI API
+#define ODO_MAX 17000000
+
+typedef Array<String<1, 255>, 0, 255> Strings;
+
+typedef Array<Enum<AppHMIType>, 0, 255> AppHMITypes;
+
+typedef Array<Enum<HmiLevel>, 0, 4> HmiLevels;
+
+typedef Array<Enum<Parameter>, 0, 100> Parameters;
+
+typedef Map<RpcParameters, 0, UINT_MAX> Rpc;
+
+typedef Array<String<10, 255>, 1, 3> URL;
+
+typedef Map<URL, 1, 255> URLList;
+
+typedef Map<URLList, 1, 255> ServiceEndpoints;
+
+typedef uint8_t NumberOfNotificationsType;
+typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 6>
+ NumberOfNotificationsPerMinute;
+
+typedef Array<Integer<uint16_t, 1, 1000>, 0, 5> SecondsBetweenRetries;
+
+typedef Map<MessageString, 0, 600> Languages;
+
+typedef Map<MessageLanguages, 0, 255> Messages;
+
+typedef Map<AppLevel, 0, 255> AppLevels;
+
+typedef Map<Boolean, 0, 255> ConsentGroups;
+
+typedef Map<ConsentRecords, 0, 1000> UserConsentRecords;
+
+typedef Map<Stringifyable<Nullable<ApplicationParams> >, 1, 1000>
+ ApplicationPolicies;
+
+typedef Map<Rpcs, 1, 255> FunctionalGroupings;
+
+typedef Map<DeviceParams, 0, 255> DeviceData;
+
+typedef Array<Enum<RequestType>, 0, 255> RequestsTypeArray;
+
+#ifdef SDL_REMOTE_CONTROL
+typedef Map<Strings, 0, 255> RemoteRpcs;
+typedef Map<RemoteRpcs, 0, 255> AccessModules;
+typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
+#endif // SDL_REMOTE_CONTROL
+
+typedef AppHMIType AppHmiType;
+typedef std::vector<AppHMIType> AppHmiTypes;
+
+struct RequestTypes : public RequestsTypeArray {
+ RequestTypes();
+ explicit RequestTypes(Json::Value* value);
+ explicit RequestTypes(const Json::Value* value);
+
+ void CleanUp();
+
+ bool is_valid() const OVERRIDE;
+ bool is_omitted() const;
+ bool is_empty() const;
+ bool is_cleaned_up() const;
+
+ private:
+ bool is_cleaned_up_;
+};
+
+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;
+ Optional<RequestTypes> RequestType;
+ Optional<Integer<uint16_t, 0, 65225> > memory_kb;
+ Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
+#ifdef SDL_REMOTE_CONTROL
+ mutable Optional<ModuleTypes> moduleType;
+#endif // SDL_REMOTE_CONTROL
+
+ public:
+ ApplicationParams();
+ 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;
+ 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;
+#ifdef SDL_REMOTE_CONTROL
+ bool ValidateModuleTypes() const;
+#endif // SDL_REMOTE_CONTROL
+};
+
+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;
+ Optional<Parameters> parameters;
+
+ public:
+ RpcParameters();
+ explicit RpcParameters(const HmiLevels& hmi_levels);
+ ~RpcParameters();
+ explicit RpcParameters(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 ExternalConsentEntity : CompositeType {
+ public:
+ typedef Integer<int32_t, 0, 128> EntityInt;
+ EntityInt entity_type;
+ EntityInt entity_id;
+
+ public:
+ ExternalConsentEntity();
+ explicit ExternalConsentEntity(const Json::Value* value__);
+ ExternalConsentEntity(const int32_t type, const int32_t id);
+ Json::Value ToJsonValue() const;
+ bool operator==(const ExternalConsentEntity& rhs) const;
+ bool is_valid() const;
+ bool is_initialized() const;
+ void ReportErrors(rpc::ValidationReport* report__) const;
+ void SetPolicyTableType(PolicyTableType pt_type) OVERRIDE;
+};
+
+typedef Array<ExternalConsentEntity, 0, 100>
+ DisallowedByExternalConsentEntities;
+
+struct Rpcs : CompositeType {
+ public:
+ Optional<String<1, 255> > user_consent_prompt;
+ Nullable<Rpc> rpcs;
+ Optional<DisallowedByExternalConsentEntities>
+ disallowed_by_external_consent_entities_on;
+ Optional<DisallowedByExternalConsentEntities>
+ disallowed_by_external_consent_entities_off;
+
+ public:
+ Rpcs();
+ explicit Rpcs(const Rpc& rpcs);
+ ~Rpcs();
+ explicit Rpcs(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 ModuleConfig : CompositeType {
+ public:
+ Integer<uint8_t, 0, 255> exchange_after_x_ignition_cycles;
+ Integer<int64_t, 0, 4294967296ll> exchange_after_x_kilometers;
+ Integer<uint8_t, 0, 255> exchange_after_x_days;
+ Integer<uint16_t, 0, 65535> timeout_after_x_seconds;
+ SecondsBetweenRetries seconds_between_retries;
+ ServiceEndpoints endpoints;
+ NumberOfNotificationsPerMinute notifications_per_minute_by_priority;
+ Optional<String<0, 100> > vehicle_make;
+ Optional<String<0, 100> > vehicle_model;
+ Optional<String<0, 4> > vehicle_year;
+ Optional<String<0, 10> > preloaded_date;
+ Optional<String<0, 65535> > certificate;
+ Optional<Boolean> preloaded_pt;
+
+ 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);
+ ~ModuleConfig();
+ explicit ModuleConfig(const Json::Value* value__);
+ void SafeCopyFrom(const ModuleConfig& from);
+ 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 MessageString : CompositeType {
+ public:
+ Optional<String<1, 65535> > line1;
+ Optional<String<1, 65535> > line2;
+ Optional<String<1, 65535> > tts;
+ Optional<String<1, 65535> > label;
+ Optional<String<1, 65535> > textBody;
+
+ public:
+ MessageString();
+ ~MessageString();
+ explicit MessageString(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 MessageLanguages : CompositeType {
+ public:
+ Languages languages;
+
+ public:
+ MessageLanguages();
+ explicit MessageLanguages(const Languages& languages);
+ ~MessageLanguages();
+ explicit MessageLanguages(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;
+ static const std::string default_language_;
+};
+
+struct ConsumerFriendlyMessages : CompositeType {
+ public:
+ String<1, 100> version;
+ Optional<Messages> messages;
+
+ public:
+ ConsumerFriendlyMessages();
+ explicit ConsumerFriendlyMessages(const std::string& version);
+ ~ConsumerFriendlyMessages();
+ explicit ConsumerFriendlyMessages(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 ModuleMeta : CompositeType {
+ public:
+ Optional<String<0, 250> > ccpu_version;
+ Optional<String<0, 250> > language;
+ Optional<String<0, 250> > wers_country_code;
+ Optional<Integer<uint32_t, 0, ODO_MAX> > pt_exchanged_at_odometer_x;
+ Optional<Integer<uint16_t, 0, 65535> > pt_exchanged_x_days_after_epoch;
+ Optional<Integer<uint16_t, 0, 65535> > ignition_cycles_since_last_exchange;
+ Optional<String<0, 250> > vin;
+
+ public:
+ ModuleMeta();
+ ~ModuleMeta();
+ explicit ModuleMeta(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 AppLevel : CompositeType {
+ public:
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_full;
+ String<1, 10> app_registration_language_gui;
+ String<0, 10> app_registration_language_vui;
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_limited;
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_background;
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_none;
+ Integer<uint16_t, 0, 65535> count_of_user_selections;
+ Integer<uint16_t, 0, 65535> count_of_rejections_sync_out_of_memory;
+ Integer<uint16_t, 0, 65535> count_of_rejections_nickname_mismatch;
+ Integer<uint16_t, 0, 65535> count_of_rejections_duplicate_name;
+ Integer<uint16_t, 0, 65535> count_of_rejected_rpc_calls;
+ Integer<uint16_t, 0, 65535> count_of_rpcs_sent_in_hmi_none;
+ Integer<uint16_t, 0, 65535> count_of_removals_for_bad_behavior;
+ Integer<uint16_t, 0, 65535> count_of_tls_errors;
+ Integer<uint16_t, 0, 65535> count_of_run_attempts_while_revoked;
+
+ public:
+ AppLevel();
+ AppLevel(uint16_t minutes_in_hmi_full,
+ const std::string& app_registration_language_gui,
+ const std::string& app_registration_language_vui,
+ uint16_t minutes_in_hmi_limited,
+ uint16_t minutes_in_hmi_background,
+ uint16_t minutes_in_hmi_none,
+ uint16_t count_of_user_selections,
+ uint16_t count_of_rejections_sync_out_of_memory,
+ uint16_t count_of_rejections_nickname_mismatch,
+ uint16_t count_of_rejections_duplicate_name,
+ uint16_t count_of_rejected_rpc_calls,
+ uint16_t count_of_rpcs_sent_in_hmi_none,
+ uint16_t count_of_removals_for_bad_behavior,
+ uint16_t count_of_tls_errors,
+ uint16_t count_of_run_attempts_while_revoked);
+ ~AppLevel();
+ explicit AppLevel(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 UsageAndErrorCounts : CompositeType {
+ public:
+ Optional<Integer<uint16_t, 0, 65535> > count_of_iap_buffer_full;
+ Optional<Integer<uint16_t, 0, 65535> > count_sync_out_of_memory;
+ Optional<Integer<uint16_t, 0, 65535> > count_of_sync_reboots;
+ Optional<AppLevels> app_level;
+
+ public:
+ UsageAndErrorCounts();
+ ~UsageAndErrorCounts();
+ explicit UsageAndErrorCounts(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 ConsentRecords : CompositeType {
+ public:
+ Optional<ConsentGroups> consent_groups;
+ Optional<ConsentGroups> external_consent_status_groups;
+ Optional<Enum<Input> > input;
+ Optional<String<1, 255> > time_stamp;
+ int64_t consent_last_updated;
+ int64_t ext_consent_last_updated;
+
+ public:
+ ConsentRecords();
+ ~ConsentRecords();
+ explicit ConsentRecords(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 DeviceParams : CompositeType {
+ public:
+ Optional<String<0, 255> > hardware;
+ Optional<Nullable<String<0, 255> > > firmware_rev;
+ Optional<String<0, 255> > os;
+ Optional<String<0, 255> > os_version;
+ Optional<Nullable<String<0, 255> > > carrier;
+ Optional<UserConsentRecords> user_consent_records;
+ Optional<Integer<uint8_t, 0, 255> > max_number_rfcom_ports;
+ Optional<String<0, 255> > connection_type;
+
+ public:
+ DeviceParams();
+ ~DeviceParams();
+ explicit DeviceParams(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 PolicyTable : CompositeType {
+ public:
+ ApplicationPoliciesSection app_policies_section;
+ FunctionalGroupings functional_groupings;
+ Optional<ConsumerFriendlyMessages> consumer_friendly_messages;
+ ModuleConfig module_config;
+ Optional<ModuleMeta> module_meta;
+ Optional<UsageAndErrorCounts> usage_and_error_counts;
+ Optional<DeviceData> device_data;
+
+ public:
+ PolicyTable();
+ 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;
+ 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 Table : CompositeType {
+ public:
+ PolicyTable policy_table;
+
+ public:
+ Table();
+ explicit Table(const PolicyTable& policy_table);
+ ~Table();
+ explicit Table(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;
+};
+} // namespace policy_table_interface_base
+} // namespace rpc
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_POLICY_TABLE_TYPES_H_
diff --git a/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
new file mode 100644
index 0000000000..91518f8f6e
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_table_interface_ext.xml
@@ -0,0 +1,284 @@
+<?xml version="1.0" standalone="no"?>
+<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
+
+<interface name="policy table interface base" version="0.0"
+ date="2014-01-23">
+
+ <!-- Common parameters start -->
+ <enum name="Priority">
+ <element name="EMERGENCY" />
+ <element name="NAVIGATION" />
+ <element name="VOICECOM" />
+ <element name="COMMUNICATION" />
+ <element name="NORMAL" />
+ <element name="NONE" />
+ </enum>
+
+ <enum name="HmiLevel">
+ <element name="BACKGROUND" />
+ <element name="FULL" />
+ <element name="LIMITED" />
+ <element name="NONE" />
+ </enum>
+
+ <enum name="Parameter">
+ <element name="gps" />
+ <element name="speed" />
+ <element name="engineTorque" />
+ <element name="externalTemperature" />
+ <element name="fuelLevel" />
+ <element name="fuelLevel_State" />
+ <element name="headLampStatus" />
+ <element name="instantFuelConsumption" />
+ <element name="odometer" />
+ <element name="tirePressure" />
+ <element name="wiperStatus" />
+ <element name="vin" />
+ <element name="accPedalPosition" />
+ <element name="beltStatus" />
+ <element name="driverBraking" />
+ <element name="prndl" />
+ <element name="rpm" />
+ <element name="steeringWheelAngle" />
+ <element name="myKey" />
+ <element name="airbagStatus" />
+ <element name="bodyInformation" />
+ <element name="clusterModeStatus" />
+ <element name="deviceStatus" />
+ <element name="emergencyEvent" />
+ <element name="eCallInfo" />
+ <element name="abs_State" />
+ <element name="turnSignal" />
+ <element name="fuelRange" />
+ <element name="tirePressureValue" />
+ <element name="tpms" />
+ </enum>
+
+ <enum name="AppHMIType">
+ <element name="DEFAULT" />
+ <element name="COMMUNICATION" />
+ <element name="MEDIA" />
+ <element name="MESSAGING" />
+ <element name="NAVIGATION" />
+ <element name="INFORMATION" />
+ <element name="SOCIAL" />
+ <element name="BACKGROUND_PROCESS" />
+ <element name="TESTING" />
+ <element name="SYSTEM" />
+ </enum>
+ <!-- Common parameters end -->
+
+ <!-- app_policies section start -->
+
+ <typedef name="Strings" type="String" maxlength="255" array="true"
+ maxsize="255" />
+
+ <typedef name="AppHMITypes" type="AppHMIType" array="true"
+ maxsize="255" />
+
+ <struct name="ApplicationParams">
+ <param name="groups" type="Strings" />
+ <param name="nicknames" type="Strings" mandatory="false" />
+ <param name="preconsented_groups" type="Strings" mandatory="false" />
+ <param name="AppHMIType" type="AppHMITypes" mandatory="false" />
+ <param name="priority" type="Priority" />
+ <param name="default_hmi" type="HmiLevel" />
+ <param name="keep_context" type="Boolean" />
+ <param name="steal_focus" type="Boolean" />
+ <param name="memory_kb" type="Integer" minvalue="1" maxvalue="65225" mandatory="false"/>
+ <param name="watchdog_timer_ms" type="Integer" minvalue="1"
+ maxvalue="65225" mandatory="false"/>
+ <param name="certificate" type="String" minlength="0" maxlength="255"
+ mandatory="false" />
+ </struct>
+
+ <typedef name="HmiLevels" type="HmiLevel" array="true"
+ maxsize="4" />
+ <typedef name="Parameters" type="Parameter" array="true"
+ maxsize="24" />
+
+ <struct name="RpcParameters">
+ <!-- maxsizes are equal to number of currently known elements of
+ given type -->
+ <param name="hmi_levels" type="HmiLevels" />
+ <param name="parameters" type="Parameters" mandatory="false" />
+ </struct>
+
+ <!-- maxsizes are equal to number of currently known elements of given
+ type -->
+ <typedef name="Rpc" type="RpcParameters" map="true" maxsize="50" null_values_allowed="true" />
+
+ <struct name="Rpcs">
+ <param name="user_consent_prompt" type="String" minlegth="1"
+ maxlength="255" mandatory="false"/>
+ <param name="rpcs" type="Rpc" null_values_allowed="true"/>
+ </struct>
+ <!-- app_policies section end -->
+
+ <!-- module_config section start -->
+ <!-- minlenght="10" since minimum expected is "http://a.b" -->
+ <typedef name="URL" type="String" minlength="10" maxlength="255"
+ array="true" minsize="1" maxsize="255" />
+
+ <typedef name="URLList" type="URL" map="true" minsize="1"
+ maxsize="255" />
+
+ <!-- max number of services is limited to 255 according to protocol specification -->
+ <typedef name="ServiceEndpoints" type="URLList" map="true"
+ minsize="1" maxsize="255" />
+
+ <typedef name="NumberOfNotificationsPerMinute" type="Integer"
+ map="true" maxsize="6" minvalue="0" maxvalue="255" />
+
+ <typedef name="SecondsBetweenRetries" type="Integer" array="true"
+ maxsize="10" minvalue="1" maxvalue="1000" />
+
+ <struct name="ModuleConfig">
+ <param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
+ <param name="preloaded_pt" type="Boolean" mandatory="false" />
+ <param name="exchange_after_x_ignition_cycles" type="Integer"
+ maxvalue="255" />
+ <param name="exchange_after_x_kilometers" type="Integer"
+ maxvalue="4294967296" />
+ <param name="exchange_after_x_days" type="Integer"
+ maxvalue="255" />
+ <param name="timeout_after_x_seconds" type="Integer"
+ maxvalue="65535" />
+ <param name="seconds_between_retries" type="SecondsBetweenRetries" />
+ <param name="endpoints" type="ServiceEndpoints" />
+ <param name="notifications_per_minute_by_priority" type="NumberOfNotificationsPerMinute" />
+ <param name="vehicle_make" type="String" maxlength="100"
+ mandatory="false" />
+ <param name="vehicle_model" type="String" maxlength="100"
+ mandatory="false" />
+ <param name="vehicle_year" type="String" minlength="4" maxlength="4"
+ mandatory="false" />
+ </struct>
+ <!-- module_config section end -->
+
+ <!-- consumer_friendly_messages section start -->
+ <struct name="MessageString">
+ <param name="line1" type="String" maxlength="255"
+ mandatory="false" />
+ <param name="line2" type="String" maxlength="255"
+ mandatory="false" />
+ <param name="tts" type="String" maxlength="65535" mandatory="false" />
+ <param name="label" type="String" maxlength="255"
+ mandatory="false" />
+ <param name="textBody" type="String" maxlength="500"
+ mandatory="false" />
+ </struct>
+
+ <typedef name="Languages" map="true" type="MessageString"
+ maxsize="500" mandatory="false" />
+
+ <struct name="MessageLanguages">
+ <param name="languages" type="Languages" />
+ </struct>
+
+ <typedef name="Messages" map="true" type="MessageLanguages"
+ maxsize="255" />
+
+ <struct name="ConsumerFriendlyMessages">
+ <param name="version" type="String" maxlength="100" />
+ <param name="messages" type="Messages" mandatory="false" />
+ </struct>
+ <!-- consumer_friendly_messages section end -->
+
+ <!-- module_meta section start -->
+ <struct name="ModuleMeta">
+ <param name="ccpu_version" type="String" maxlength="250" mandatory="false"/>
+ <param name="language" type="String" maxlength="250" mandatory="false"/>
+ <param name="wers_country_code" type="String" maxlength="250" mandatory="false"/>
+ <param name="pt_exchanged_at_odometer_x" type="Integer" minvalue="0" maxvalue="65535" mandatory="false"/>
+ <param name="pt_exchanged_x_days_after_epoch" type="Integer" minvalue="0" maxvalue="65535" mandatory="false"/>
+ <param name="ignition_cycles_since_last_exchange" type="Integer" minvalue="0" maxvalue="65535" mandatory="false"/>
+ <param name="vin" type="String" maxlength="250" mandatory="false"/>
+ </struct>
+ <!-- module_meta section end -->
+
+ <!-- usage_and_error_counts section start -->
+ <struct name="AppLevel">
+ <param name="minutes_in_hmi_full" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="app_registration_language_gui" type="String" minlength="1" maxlength="10" />
+ <param name="app_registration_language_vui" type="String" minlength="1" maxlength="10" />
+ <param name="count_of_rfcom_limit_reached" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="minutes_in_hmi_limited" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="minutes_in_hmi_background" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="minutes_in_hmi_none" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_user_selections" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_rejections_sync_out_of_memory" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_rejections_nickname_mismatch" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_rejections_duplicate_name" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_rejected_rpc_calls" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_rpcs_sent_in_hmi_none" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_removals_for_bad_behavior" type="Integer" minvalue="0" maxvalue="65535" />
+ <param name="count_of_run_attempts_while_revoked" type="Integer" minvalue="0" maxvalue="65535" />
+ </struct>
+
+ <typedef name="AppLevels" type="AppLevel" map="true"
+ maxsize="255" />
+
+ <struct name="UsageAndErrorCounts">
+ <param name="count_of_iap_buffer_full" type="Integer" minvalue="0" maxvalue="65535" mandatory="false" />
+ <param name="count_sync_out_of_memory" type="Integer" minvalue="0" maxvalue="65535" mandatory="false" />
+ <param name="count_of_sync_reboots" type="Integer" minvalue="0" maxvalue="65535" mandatory="false" />
+ <param name="app_level" type="AppLevels" mandatory="false" />
+ </struct>
+ <!-- usage_and_error_counts section end -->
+
+ <!-- device_data section start -->
+ <enum name="Input" scope="internal">
+ <element name="GUI" />
+ <element name="VUI" />
+ </enum>
+
+ <typedef name="ConsentGroups" scope="internal" type="Boolean" map="true" maxsize="255" mandatory="false"/>
+
+ <struct name="ConsentRecords" scope="internal">
+ <param name="consent_groups" type="ConsentGroups" mandatory="false"/>
+ <param name="input" type="Input" mandatory="false" />
+ <param name="time_stamp" type="String" maxlength="255" mandatory="false" />
+ </struct>
+
+ <typedef name="UserConsentRecords" scope="internal" map="true" type="ConsentRecords" minsize="0" maxsize="1000"/>
+
+ <struct name="DeviceParams" scope="internal">
+ <param name="hardware" type="String" maxlength="255" mandatory="false"/>
+ <param name="firmware_rev" type="String" maxlength="255" nullable="true" mandatory="false"/>
+ <param name="os" type="String" maxlength="255" mandatory="false"/>
+ <param name="os_version" type="String" maxlength="255" mandatory="false"/>
+ <param name="carrier" type="String" maxlength="255" nullable="true" mandatory="false"/>
+ <param name="user_consent_records" type="UserConsentRecords" mandatory="false"/>
+ <param name="max_number_rfcom_ports" type="Integer" maxvalue="255" mandatory="false"/>
+ </struct>
+ <!-- device_data section end -->
+
+ <!-- policy_table section start -->
+ <typedef name="ApplicationPolicies" map="true" type="ApplicationParams"
+ null_values_allowed="true" minsize="1" maxsize="1000" />
+
+ <typedef name="FunctionalGroupings" map="true" type="Rpcs"
+ minsize="1" maxsize="255" />
+
+ <typedef name="DeviceData" map="true" type="DeviceParams"
+ maxsize="255" />
+
+ <struct name="PolicyTable">
+ <!-- maxsize for app_policies can be changed, if necessary -->
+ <param name="app_policies" type="ApplicationPolicies" />
+ <param name="functional_groupings" type="FunctionalGroupings" />
+ <param name="consumer_friendly_messages" type="ConsumerFriendlyMessages" />
+ <param name="module_config" type="ModuleConfig" />
+ <param name="module_meta" type="ModuleMeta" mandatory="false"/>
+ <param name="usage_and_error_counts" type="UsageAndErrorCounts" mandatory="false" />
+ <param name="device_data" type="DeviceData" mandatory="false" />
+ </struct>
+ <!-- policy_table section end -->
+
+ <!-- Root element -->
+ <struct name="Table">
+ <param name="policy_table" type="PolicyTable" />
+ </struct>
+
+</interface>
diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h
new file mode 100644
index 0000000000..f57919b6f7
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/policy_types.h
@@ -0,0 +1,529 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
+
+#include <algorithm>
+#include <string>
+#include <vector>
+#include <map>
+#include <set>
+#include <utility>
+#include "utils/shared_ptr.h"
+#include "utils/helpers.h"
+namespace policy {
+
+// TODO(PV): specify errors
+enum PolicyErrorEnum {};
+
+const std::string kDefaultDeviceMacAddress = "00:00:00:00:00:00";
+const std::string kDefaultDeviceName = "MyDevice";
+const std::string kDefaultDeviceConnectionType = "UNKNOWN";
+
+/**
+ * @brief Constants for special ids in application policies section of
+ * policy table
+ */
+const std::string kPreDataConsentId = "pre_DataConsent";
+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 {
+ StatusUpToDate = 0,
+ StatusUpdatePending,
+ StatusUpdateRequired,
+ StatusUnknown
+};
+
+// Code generator uses String class name, so this typedef was renamed to PTSring
+typedef std::string PTString;
+typedef std::vector<uint8_t> BinaryMessage;
+typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
+
+typedef std::string HMILevel;
+typedef std::string Parameter;
+typedef std::string RpcName;
+typedef std::set<std::string> RPCParams;
+
+typedef std::map<std::string, std::set<policy::HMILevel> > HMIPermissions;
+struct ParameterPermissions
+ : std::map<std::string, std::set<policy::Parameter> > {
+ ParameterPermissions()
+ : any_parameter_allowed(false)
+ , any_parameter_disallowed_by_user(false)
+ , any_parameter_disallowed_by_policy(false) {}
+ bool any_parameter_allowed;
+ bool any_parameter_disallowed_by_user;
+ bool any_parameter_disallowed_by_policy;
+};
+
+struct RpcPermissions {
+ HMIPermissions hmi_permissions;
+ ParameterPermissions parameter_permissions;
+};
+
+typedef std::map<RpcName, RpcPermissions> Permissions;
+
+/**
+ * @brief Typedef for use with AllowApp request/notification
+ */
+typedef std::vector<std::string> PermissionsList;
+
+/**
+ * @brief Typedef for getting initial application data, e.g. nickname list
+ */
+typedef std::vector<std::string> StringArray;
+
+enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed };
+
+/**
+ * @struct Stores result of check:
+ * if HMI Level was allowed for RPC to work in
+ * and list of parameters allowed for RPC if specified in PT.
+ */
+struct CheckPermissionResult {
+ CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {}
+
+ PermitResult hmi_level_permitted;
+ RPCParams list_of_allowed_params;
+ RPCParams list_of_disallowed_params;
+ RPCParams list_of_undefined_params;
+
+ bool HasParameter(const PTString& parameter) {
+ const bool is_allowed =
+ helpers::in_range(list_of_allowed_params, parameter);
+ const bool is_disallowed =
+ helpers::in_range(list_of_disallowed_params, parameter);
+ const bool is_undefined =
+ helpers::in_range(list_of_undefined_params, parameter);
+
+ return is_allowed || is_disallowed || is_undefined;
+ }
+
+ bool DisallowedInclude(const RPCParams& parameters) {
+ if (parameters.empty()) {
+ return false;
+ }
+ return std::includes(list_of_disallowed_params.begin(),
+ list_of_disallowed_params.end(),
+ parameters.begin(),
+ parameters.end());
+ }
+
+ bool IsAnyAllowed(const RPCParams& parameters) {
+ if (parameters.empty()) {
+ return true;
+ }
+ return list_of_allowed_params.end() !=
+ std::find_first_of(list_of_allowed_params.begin(),
+ list_of_allowed_params.end(),
+ parameters.begin(),
+ parameters.end());
+ }
+};
+
+/**
+ @struct Holds Url string and optional policy app id.
+ */
+struct EndpointData {
+ explicit EndpointData(const std::string& url_string = "")
+ : app_id("default") {
+ if (false == url_string.empty()) {
+ url.push_back(url_string);
+ }
+ }
+ std::vector<std::string> url;
+ std::string app_id;
+};
+
+typedef std::vector<EndpointData> EndpointUrls;
+
+/**
+ * @brief Struct contains device data to be used for dialogs, generation of IDs
+ */
+struct DeviceParams {
+ DeviceParams()
+ : device_name(kDefaultDeviceName)
+ , device_mac_address(kDefaultDeviceMacAddress)
+ , device_connection_type(kDefaultDeviceConnectionType)
+ , device_handle(0) {}
+
+ std::string device_name;
+ std::string device_mac_address;
+ std::string device_connection_type;
+ uint32_t device_handle;
+};
+
+/**
+ * @brief User consent for device data usage
+ */
+enum DeviceConsent {
+ kDeviceAllowed = 0,
+ kDeviceDisallowed,
+ kDeviceHasNoConsent
+};
+
+/**
+ * @brief Struct contains parameters, which can be received during application
+ * registration and should be stored in policy table
+ */
+struct DeviceInfo {
+ DeviceInfo() : max_number_rfcom_ports(0) {}
+
+ std::string hardware;
+ std::string firmware_rev;
+ std::string os;
+ std::string os_ver;
+ 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;
+ static const std::string bluetooth("BLUETOOTH");
+ static const std::string wifi("WIFI");
+ if (Compare<std::string, EQ, ONE>(deviceType, bluetooth, wifi)) {
+ connection_type.assign("BTMAC");
+ }
+ }
+};
+
+/**
+ * @brief User consent for functional group
+ */
+enum GroupConsent { kGroupAllowed = 0, kGroupDisallowed, kGroupUndefined };
+
+/**
+ * @brief Contains user permission for RPC functional group with specific name
+ * and id from DB
+ */
+struct FunctionalGroupPermission {
+ FunctionalGroupPermission() : group_id(0), state(kGroupUndefined) {}
+
+ bool operator==(const FunctionalGroupPermission& rhs) {
+ if (this->group_id == rhs.group_id &&
+ this->group_alias == rhs.group_alias &&
+ this->group_name == rhs.group_name) {
+ return true;
+ }
+ return false;
+ }
+
+ std::string group_alias;
+ std::string group_name;
+ int32_t group_id;
+ GroupConsent state;
+};
+
+/**
+ * @brief Stores data to be sent to HMI on application permissions change
+ */
+struct AppPermissions {
+ AppPermissions(const std::string& app_id)
+ : application_id(app_id)
+ , isAppPermissionsRevoked(false)
+ , appRevoked(false)
+ , appPermissionsConsentNeeded(false)
+ , appUnauthorized(false)
+ , requestTypeChanged(false) {}
+
+ std::string application_id;
+ bool isAppPermissionsRevoked;
+ std::vector<policy::FunctionalGroupPermission> appRevokedPermissions;
+ bool appRevoked;
+ bool appPermissionsConsentNeeded;
+ bool appUnauthorized;
+ bool isSDLAllowed;
+ std::string priority;
+ DeviceParams deviceInfo;
+ bool requestTypeChanged;
+ std::vector<std::string> requestType;
+};
+
+/**
+ * @brief Contains parameters for user-defined consent for appication
+ * functional groups on given device
+ */
+struct PermissionConsent {
+ std::string device_id;
+ std::string policy_app_id;
+ std::vector<FunctionalGroupPermission> group_permissions;
+ std::string consent_source;
+};
+
+/**
+ * @brief Contain data for GetUserFriendyMessage response
+ */
+struct UserFriendlyMessage {
+ std::string message_code;
+ std::string tts;
+ std::string label;
+ std::string line1;
+ std::string line2;
+ std::string text_body;
+};
+
+/**
+ * @brief Types of functional groups in policy table
+ */
+enum GroupType {
+ kTypeDefault = 0, // groups assigned to 'default' permissions section
+ kTypeAllowed, // groups allowed by user for specific application
+ kTypeDisallowed, // groups disallowed by user for specific application
+ kTypeUnconsented, // groups disallowed by default but consent may be changed
+ // by user
+ kTypePreconsented, // groups allowed for specific application without
+ // user consent by default (could be changed by user)
+ kTypeGeneral, // groups assigned to specific application
+ kTypePreDataConsented, // groups assigned to 'pre_DataConsent' permissions
+ // section
+ kTypeDevice // groups assigned to 'device' permissions section
+};
+
+/**
+ * @brief Array of functional group id from DB
+ */
+typedef std::vector<int32_t> FunctionalGroupIDs;
+
+/**
+ * @brief Array of functional group ids sorted by types
+ */
+typedef std::map<GroupType, FunctionalGroupIDs> FunctionalIdType;
+
+/**
+ * @brief Array of functional group ids binded to user_consent_prompt (e.g.
+ * VehicleData) and group name (e.g. VehicleData-4)
+ */
+typedef std::map<uint32_t, std::pair<std::string, std::string> >
+ FunctionalGroupNames;
+
+/**
+ * @brief Array of device ids, which are an identifiers in policy table
+ */
+typedef std::vector<std::string> DeviceIds;
+
+/**
+ * @brief Counters that calculated on receiving of succesful update
+ */
+enum Counters { KILOMETERS, DAYS_AFTER_EPOCH };
+
+/**
+ * @struct Vehicle information
+ */
+struct VehicleInfo {
+ std::string vehicle_make;
+ std::string vehicle_model;
+ std::string vehicle_year;
+};
+
+/**
+ * @brief The MetaInfo information
+ */
+struct MetaInfo {
+ std::string ccpu_version;
+ std::string wers_country_code;
+ std::string language;
+};
+
+/**
+ * @brief The index of the application, the index of its URL
+ * and the policy application id from the Endpoints vector
+ * that will be sent on the next OnSystemRequest retry sequence
+ */
+struct RetrySequenceURL {
+ uint32_t app_idx_;
+ uint32_t url_idx_;
+ std::string policy_app_id_;
+ RetrySequenceURL(uint32_t app, uint32_t url, const std::string& app_id)
+ : app_idx_(app), url_idx_(url), policy_app_id_(app_id) {}
+ RetrySequenceURL() : app_idx_(0), url_idx_(0) {}
+};
+
+/**
+ * @brief Index of the application, index of its URL
+ * from the Endpoints vector
+ */
+typedef std::pair<uint32_t, uint32_t> AppIdURL;
+
+enum EntityStatus { kStatusOn, kStatusOff };
+
+enum ReturnValue { kZero, kNonZero };
+
+/**
+ * @brief The ExternalConsentStatusItem struct represents customer connectivity
+ * settings
+ * item
+ */
+struct ExternalConsentStatusItem {
+ ExternalConsentStatusItem(const uint32_t type,
+ const uint32_t id,
+ const EntityStatus status)
+ : entity_type_(type), entity_id_(id), status_(status) {}
+
+ ExternalConsentStatusItem()
+ : entity_type_(0), entity_id_(0), status_(kStatusOff) {}
+
+ ExternalConsentStatusItem operator=(const ExternalConsentStatusItem& rhs) {
+ this->entity_id_ = rhs.entity_id_;
+ this->entity_type_ = rhs.entity_type_;
+ this->status_ = rhs.status_;
+ return *this; // calls copy constructor
+ }
+
+ bool operator==(const ExternalConsentStatusItem& rhs) const {
+ return (entity_type_ == rhs.entity_type_) && (entity_id_ == rhs.entity_id_);
+ }
+
+ bool operator<(const ExternalConsentStatusItem& rhs) const {
+ return (entity_type_ < rhs.entity_type_) || (entity_id_ < rhs.entity_id_);
+ }
+
+ uint32_t entity_type_;
+ uint32_t entity_id_;
+ EntityStatus status_;
+};
+
+struct ExternalConsentStatusItemSorter {
+ bool operator()(const ExternalConsentStatusItem& lhs,
+ const ExternalConsentStatusItem& rhs) const {
+ return (lhs.entity_type_ < rhs.entity_type_) ||
+ (lhs.entity_id_ < rhs.entity_id_);
+ }
+};
+
+/**
+ * @brief The ApplicationPolicyActions struct contains actions which should be
+ * done for some application
+ */
+struct ApplicationPolicyActions {
+ ApplicationPolicyActions()
+ : is_notify_system(false)
+ , is_send_permissions_to_app(false)
+ , is_consent_needed(false) {}
+
+ bool is_notify_system;
+ bool is_send_permissions_to_app;
+ bool is_consent_needed;
+};
+
+/**
+ * @brief ApplicationsPoliciesActions map of actions to be done for every
+ * application
+ */
+typedef std::map<std::string, ApplicationPolicyActions>
+ ApplicationsPoliciesActions;
+
+/**
+ * @brief Customer connectivity settings status
+ */
+typedef std::set<ExternalConsentStatusItem, ExternalConsentStatusItemSorter>
+ ExternalConsentStatus;
+
+/**
+ * @brief GroupsByExternalConsentStatus represents list of group names, which
+ * has mapped ExternalConsent item (entity type + entity id) in their
+ * disallowed_by_external_consent_ containers. Boolean value represents
+ * whether ExternalConsent item has been found in
+ * disallowed_by_external_consent_ON or in disallowed_by_external_consent_OFF
+ * container
+ */
+typedef std::map<ExternalConsentStatusItem,
+ std::vector<std::pair<std::string, bool> > >
+ GroupsByExternalConsentStatus;
+
+/**
+ * @brief GroupsNames represents groups names from policy table -> functional
+ * groupings groups container
+ */
+typedef std::set<std::string> GroupsNames;
+
+typedef std::string ApplicationId;
+typedef std::string DeviceId;
+
+/**
+ * @brief Link of device to application
+ */
+typedef std::pair<policy::DeviceId, policy::ApplicationId> Link;
+
+/**
+ * @brief Collection of links
+ */
+typedef std::set<Link> ApplicationsLinks;
+
+/**
+ * @brief Represents possible result codes for policy table update check
+ */
+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
+};
+
+/**
+ * @brief Per application collection of results done by checking policy table
+ * update
+ */
+typedef std::set<std::pair<std::string, PermissionsCheckResult> >
+ CheckAppPolicyResults;
+
+/**
+ * @brief The ConsentPriorityType enum defined types of priority for group
+ * consents i.e. done by user or by external consents
+ */
+enum ConsentPriorityType { kUserConsentPrio, kExternalConsentPrio };
+
+/**
+ * @brief The ConsentProcessingPolicy enum defines policy for existing consents
+ * update i.e. based on user/external consents timestamps or overriden by
+ * external consents
+ */
+enum ConsentProcessingPolicy { kTimestampBased, kExternalConsentBased };
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
diff --git a/src/components/policy/policy_external/include/policy/pt_ext_representation.h b/src/components/policy/policy_external/include/policy/pt_ext_representation.h
new file mode 100644
index 0000000000..0aa284b707
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/pt_ext_representation.h
@@ -0,0 +1,347 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
+
+#include "policy/pt_representation.h"
+
+namespace policy {
+
+enum StatisticsType {
+ S_NONE = 0,
+ S_IAP_BUFFER_FULL,
+ S_SYNC_OUT_OF_MEMORY,
+ S_SYNC_REBOOTS,
+ S_MINS_HMI_FULL,
+ S_MINS_HMI_LIMITED,
+ S_MINS_HMI_BACKGROUND,
+ S_MINS_HMI_NONE,
+ S_RFCOM_LIMIT_REACHED,
+ S_USER_SELECTIONS,
+ S_REJECTIONS_SYNC_OUT_OF_MEMORY,
+ S_REJECTIONS_NICKNAME_MISMATCH,
+ S_REJECTIONS_DUPLICATE_NAME,
+ S_REJECTED_RPC_CALLS,
+ S_RPCS_IN_HMI_NONE,
+ S_REMOVALS_MISBEHAVED,
+ S_RUN_ATTEMPTS_WHILE_REVOKED
+};
+
+enum LanguageType { L_NONE = 0, L_GUI, L_VUI };
+
+class PTExtRepresentation : public virtual PTRepresentation {
+ public:
+ virtual ~PTExtRepresentation() {}
+
+ /**
+ * @brief Is application allowed to send notifications while in
+ * Backgound or limited mode.
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppKeepContext(const std::string& app_id) = 0;
+
+ /**
+ * @brief Is application allowed to move foreground at will?
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppStealFocus(const std::string& app_id) = 0;
+
+ /**
+ * @brief Get default_hmi for given application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value was
+ * not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetDefaultHMI(const std::string& policy_app_id,
+ std::string* default_hmi) = 0;
+
+ /**
+ * @brief Reset user consent for device data and applications permissions
+ * @return
+ */
+ virtual bool ResetUserConsent() = 0;
+
+ /**
+ * @brief Reset user consent for device data
+ * @return
+ */
+ virtual bool ResetDeviceConsents() = 0;
+
+ /**
+ * @brief Reset user consent for applications permissions
+ * @return
+ */
+ virtual bool ResetAppConsents() = 0;
+
+ /**
+ * @brief Get user permissions for device data usage
+ * @param device_id Generated or obtained id of device
+ * @param consented_groups Groups consented by user
+ * @param disallowed_groups Groups not consented by user
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetUserPermissionsForDevice(
+ const std::string& device_id,
+ StringArray* consented_groups = NULL,
+ StringArray* disallowed_groups = NULL) = 0;
+
+ /**
+ * @brief Gets list of groups permissions from policy table
+ * @param device_id Unique device id, which hosts specific application
+ * @param policy_app_id Unique application id
+ * @param group_types Group list sorted by permission status
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalIdType* group_types) = 0;
+
+ /**
+ * @brief Get device groups and preconsented groups from policies section
+ * @param groups List of groups to be consented for device usage
+ * @param preconsented_groups List of preconsented groups for device usage
+ * @return true, if query was successful, otherwise - false
+ */
+ virtual bool GetDeviceGroupsFromPolicies(
+ policy_table::Strings* groups = NULL,
+ policy_table::Strings* preconsented_groups = NULL) = 0;
+
+ /**
+ * @brief Record information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @return bool Success of operation
+ */
+ virtual bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware = "",
+ const std::string& firmware = "",
+ const std::string& os = "",
+ const std::string& os_version = "",
+ const std::string& carrier = "",
+ const uint32_t number_of_ports = 0,
+ const std::string& connection_type = "") = 0;
+
+ /**
+ * @brief Sets user consent for particular mobile device,
+ * i.e. to use device for exchanging of Policy Table.
+ * @return bool Success of operation
+ */
+ virtual bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups = StringArray(),
+ const StringArray& disallowed_gropus = StringArray()) = 0;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ */
+ virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed) = 0;
+
+ /**
+ * @brief Set user consent on functional groups
+ * @param permissions User consent on functional group
+ * @return true, if operation succedeed, otherwise - false
+ */
+ virtual bool SetUserPermissionsForApp(
+ const PermissionConsent& permissions) = 0;
+
+ /**
+ * @brief Counter for statistics information: adds 1 to existing number.
+ * @param type Type of statistics (errors, mins in mode etc)
+ * @return bool Success of operation
+ */
+ virtual bool IncreaseStatisticsData(StatisticsType type) = 0;
+
+ /**
+ * @brief Records information about what language
+ * application tried to register with.
+ * @param app_id Id of application
+ * @param type - language for UI/VR
+ * @param language Language
+ * @return bool Success of operation
+ */
+ virtual bool SetAppRegistrationLanguage(const std::string& app_id,
+ LanguageType type,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Records information about head unit system to PT
+ * @return bool Success of operation
+ */
+ virtual bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Checks, if specific head unit is present in PT
+ * @return boot Suceess, if present, otherwise - false
+ */
+ virtual bool IsMetaInfoPresent() = 0;
+
+ /**
+ * @brief Kms pass since last successfull PT update
+ */
+ virtual int GetKmFromSuccessfulExchange() = 0;
+
+ /**
+ * @brief Days pass since last successfull PT update
+ */
+ virtual int GetDayFromScsExchange() = 0;
+
+ /**
+ * @brief Ignition cycles pass since last successfull PT update
+ */
+ virtual int GetIgnitionsFromScsExchange() = 0;
+
+ /**
+ * @brief Set current system language
+ * @param language System language
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool SetSystemLanguage(const std::string& language) = 0;
+
+ /**
+ * Increments global counter
+ * @param type type of counter
+ */
+ virtual void Increment(const std::string& type) const = 0;
+
+ /**
+ * Increments counter of application
+ * @param app_id id application
+ * @param type type of counter
+ */
+ virtual void Increment(const std::string& app_id,
+ const std::string& type) const = 0;
+
+ /**
+ * Sets value of application information
+ * @param app_id id application
+ * @param type type of information
+ * @param value value of information
+ */
+ virtual void Set(const std::string& app_id,
+ const std::string& type,
+ const std::string& value) const = 0;
+
+ /**
+ * Adds value to stopwatch of application
+ * @param app_id id application
+ * @param type type of stopwatch
+ * @param seconds value for adding in seconds
+ */
+ virtual void Add(const std::string& app_id,
+ const std::string& type,
+ int seconds) const = 0;
+
+ virtual bool CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id,
+ int* result) const = 0;
+
+ /**
+ * @brief Gets functional group names and user_consent_prompts, if any
+ * @param Array to be filled with group ids, names and functional prompts
+ * @return true, if succeeded, otherwise - false
+ */
+ // TODO(AOleynik): Possibly, we can get rid of this method. Check this.
+ virtual bool GetFunctionalGroupNames(policy::FunctionalGroupNames& names) = 0;
+
+ /**
+ * @brief Set app policy to pre_DataConsented policy
+ * @param app_id Policy ID of application to be changed
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool SetPredataPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief Updates application policy to either pre_DataConsented or not
+ * @param app_id Policy Id of application to be checked
+ * @param is_pre_data True of False to setting app policy to be
+ * pre_DataConsented
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool SetIsPredata(const std::string& app_id, bool is_pre_data) = 0;
+
+ /**
+ * @brief Removes unpaired devices
+ * @return true if success
+ */
+ virtual bool CleanupUnpairedDevices(const DeviceIds& device_ids) const = 0;
+
+ /**
+ * Sets flag of unpaired device
+ * @param device_id Unique device id
+ * @param unpaired True, if unpaired, otherwise - false
+ * @return true if success
+ */
+ virtual bool SetUnpairedDevice(const std::string& device_id,
+ bool unpaired) const = 0;
+
+ /**
+ * Gets list of unpaired devices
+ * @param device_ids output list
+ * @return true if success
+ */
+ virtual bool UnpairedDevicesList(DeviceIds* device_ids) const = 0;
+
+ /**
+ * @brief Remove application consent for particular group
+ * @param policy_app_id Unique application id
+ * @param functional_group_name Functional group name, which consents should
+ * be removed
+ * @return true, in case of success, otherwise - false
+ */
+ virtual bool RemoveAppConsentForGroup(
+ const std::string& policy_app_id,
+ const std::string& functional_group_name) const = 0;
+
+ /**
+ * @brief Saves external user consent settings status
+ * @param status external consent status
+ * @return true if succeeded, otherwise - false
+ */
+ virtual bool SaveExternalConsentStatus(
+ const ExternalConsentStatus& status) const = 0;
+
+ /**
+ * @brief Gets customer connectivity settings status
+ * @return external consent status
+ */
+ virtual ExternalConsentStatus GetExternalConsentStatus() const = 0;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_external/include/policy/pt_representation.h b/src/components/policy/policy_external/include/policy/pt_representation.h
new file mode 100644
index 0000000000..66a9218771
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/pt_representation.h
@@ -0,0 +1,328 @@
+/*
+ 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_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_REPRESENTATION_H_
+
+#include <vector>
+#include <string>
+#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_settings.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace policy {
+
+enum InitResult { NONE = 0, EXISTS, SUCCESS, FAIL };
+
+class PTRepresentation {
+ public:
+ virtual ~PTRepresentation() {}
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @params CheckPermissionResult containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) = 0;
+
+ /**
+ * @brief Returns true if Policy Table was not updated yet
+ * from preloaded pt file.
+ */
+ virtual bool IsPTPreloaded() = 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 Re-creates schema in DB, drops all data
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool RefreshDB() = 0;
+ /**
+ * Gets number of ignition cycles before next update policy table
+ * @return number of ignition cycles
+ */
+ virtual int IgnitionCyclesBeforeExchange() = 0;
+
+ /**
+ * Gets value in kilometers before next update policy table
+ * @param current value in kilometers from the odometers
+ * @return value in kilometers
+ */
+ virtual int KilometersBeforeExchange(int current) = 0;
+
+ /**
+ * @brief Sets kilometers and days after epoch, that passed for recieved
+ * successful PT UPdate
+ */
+ virtual bool SetCountersPassedForSuccessfulUpdate(int kilometers,
+ int days_after_epoch) = 0;
+
+ /**
+ * Gets value in days before next update policy table
+ * @param current value in days after epoch
+ * @return value in days
+ */
+ virtual int DaysBeforeExchange(uint16_t current) = 0;
+
+ /**
+ * @brief Increment number of ignition cycles since last exchange by 1
+ */
+ virtual void IncrementIgnitionCycles() = 0;
+
+ /**
+ * @brief Reset number of ignition cycles since last exchange to 0
+ */
+ virtual void ResetIgnitionCycles() = 0;
+
+ /**
+ * @brief Returns timeout to wait for a response of PT update
+ * @return value in seconds
+ */
+ virtual int TimeoutResponse() = 0;
+
+ /**
+ * @brief Returns number of seconds between each try of sending PTS
+ * @param seconds Return value: array of 5 elements
+ * @return bool Success of operation
+ */
+ virtual bool SecondsBetweenRetries(std::vector<int>* seconds) = 0;
+
+ /**
+ * @brief Get information about vehicle
+ */
+ virtual const VehicleInfo GetVehicleInfo() const = 0;
+
+ /**
+ * @brief Allows to update 'vin' field in module_meta table.
+ *
+ * @param new 'vin' value.
+ *
+ * @return true in case when data has been successfully updated,
+ * false otherwise.
+ */
+ virtual bool SetVINValue(const std::string& value) = 0;
+
+ /**
+ * @brief Get message text for displaying/pronouncing for user
+ * dependent on language and context.
+ * @param msg_codes Context of message (Driver distraction, Grant permission
+ * etc)
+ * @param language Language of the message
+ * @return Array of appropriate messages parameters
+ */
+ virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Get list of URL to send PTS to
+ * @param service_type If URLs for specific service are preset,
+ * return them otherwise default URLs.
+ */
+ virtual EndpointUrls GetUpdateUrls(int service_type) = 0;
+
+ /**
+ * @brief Get allowed number of notifications
+ * depending on application priority.
+ * @param priority Priority of application
+ */
+ virtual int GetNotificationsNumber(const std::string& priority) = 0;
+
+ /**
+ * @brief Get priority for given application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) = 0;
+
+ /**
+ * @brief Initialized Policy Table (load)
+ * @return bool Success of operation
+ */
+ virtual InitResult Init(const PolicySettings* settings) = 0;
+
+ /**
+ * @brief Close policy table
+ * @return bool Success of operation
+ */
+ virtual bool Close() = 0;
+
+ /**
+ * @brief Removes policy table content.
+ * @return bool Success of operation
+ */
+ virtual bool Clear() = 0;
+
+ /**
+ * Drops policy table (schema and content)
+ * @return true if successfully
+ */
+ virtual bool Drop() = 0;
+
+ /**
+ * @brief Get snapshot of Policy Table
+ * including app_policies, functional_groups,
+ * device_info, statistics, excluding user messages
+ * @return Generated structure for obtaining Json string.
+ */
+ virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+
+ virtual bool Save(const policy_table::Table& table) = 0;
+
+ /**
+ * Gets flag updateRequired
+ * @return true if update is required
+ */
+ virtual bool UpdateRequired() const = 0;
+
+ /**
+ * Saves flag updateRequired
+ */
+ virtual void SaveUpdateRequired(bool value) = 0;
+
+ /*
+ Retrieves data from app_policies about app on its registration:
+ app_id - id of registered app; all outputs are filled in only if not null
+ output: nicknames Synonyms for application
+ output: app_types Section on HMI where app can appear (Navigation, Phone etc)
+ */
+ virtual bool GetInitialAppData(const std::string& app_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_types = NULL) = 0;
+
+ /**
+ * Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get functional groupings from DB
+ * @param groups Known functional groupings
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) = 0;
+
+ /**
+ * Checks if the application is represented in policy table
+ * @param app_id application id
+ * @return true if application is represented in policy table
+ */
+ virtual bool IsApplicationRepresented(const std::string& app_id) const = 0;
+
+ /**
+ * Checks if the application has default policy
+ * @param app_id application id
+ * @return true if application has default policy
+ */
+ virtual bool IsDefaultPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
+ virtual bool IsPredataPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * Sets default policy for application
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual bool SetDefaultPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief SaveApplicationCustomData allows to save specific data to database.
+ * This data is only for internal use.
+ * @param app_id the application id for which the data will be saved.
+ * @param is_revoked parameter to save.
+ * @param is_default parameter to save.
+ * @param is_predata parameter to save.
+ */
+ virtual bool SaveApplicationCustomData(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata) = 0;
+
+ virtual void WriteDb() = 0;
+
+ /**
+ * @brief RemoveDB allows to remove the database.
+ * It will either remove or do nothing in case file not exists or any other
+ * troubles are happens during this operation.
+ */
+ virtual void RemoveDB() const = 0;
+
+ /**
+ * @brief Checks if DB version is actual to current schema
+ * @return true if actual, otherwise - false
+ */
+ virtual bool IsDBVersionActual() const = 0;
+
+ /**
+ * @brief Updates DB version according to current schema
+ * @return true if success, otherwise - false
+ */
+ virtual bool UpdateDBVersion() const = 0;
+
+ protected:
+ const PolicySettings& get_settings() const {
+ DCHECK(settings_);
+ return *settings_;
+ }
+ const PolicySettings* settings_;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_PT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_ext_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_ext_queries.h
new file mode 100644
index 0000000000..b8f85ec7b1
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/sql_pt_ext_queries.h
@@ -0,0 +1,104 @@
+/*
+ Copyright (c) 2013, " Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, " with or without
+ modification, " are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, " this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, "
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
+ CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
+
+#include <string>
+
+namespace policy {
+namespace sql_pt_ext {
+
+extern const std::string kSelectKeepContext;
+extern const std::string kSelectStealFocus;
+extern const std::string kResetDeviceConsents;
+extern const std::string kResetAppConsents;
+extern const std::string kCountDeviceConsentGroup;
+extern const std::string kCountDevice;
+extern const std::string kSelectDeviceConsentedGroup;
+extern const std::string kUpdateDeviceConsentedGroup;
+extern const std::string kUpdateDevice;
+extern const std::string kInsertDeviceConsentedGroup;
+extern const std::string kInsertDevice;
+extern const std::string kSelectDeviceData;
+extern const std::string kSelectConsentGroup;
+extern const std::string kSelectExternalConsentStatusGroup;
+extern const std::string kInsertPreconsentedGroups;
+extern const std::string kSelectPreconsentedGroups;
+extern const std::string kDeletePreconsentedGroups;
+extern const std::string kSelectUsageAndErrorCount;
+extern const std::string kSelectAppLevels;
+extern const std::string kUpdateGlobalCounters;
+extern const std::string kInsertDeviceData;
+extern const std::string kDeleteDeviceData;
+extern const std::string kInsertConsentGroups;
+extern const std::string kInsertExternalConsentStatusGroups;
+extern const std::string kCountUnconsentedGroups;
+extern const std::string kSelectModuleMeta;
+extern const std::string kUpdateMetaParams;
+extern const std::string kUpdateModuleMetaVinParam;
+extern const std::string kSaveModuleMeta;
+extern const std::string kSelectMetaParams;
+extern const std::string kCountAppLevel;
+extern const std::string kUpdateGroupPermissions;
+extern const std::string kSelectDefaultHmi;
+extern const std::string kInsertApplication;
+extern const std::string kSelectFriendlyMsg;
+extern const std::string kCollectFriendlyMsg;
+extern const std::string kSelectAppGroupsId;
+extern const std::string kSelectConsentedGroupsId;
+extern const std::string kCountAppConsents;
+extern const std::string kSelectPreconsentedGroupsId;
+extern const std::string kSelectFunctionalGroupNames;
+extern const std::string kSelectAppPolicies;
+extern const std::string kUpdateMetaLanguage;
+extern const std::string kDeleteDeviceConsent;
+extern const std::string kDeleteAppGroupConsent;
+extern const std::string kSelectGroupId;
+extern const std::string kSelectApplicationIsPreData;
+extern const std::string kUpdateIsPredata;
+extern const std::string kHasAppPreloadedGroups;
+extern const std::string kUpdateUnpairedDevice;
+extern const std::string kSelectUnpairedDevices;
+extern const std::string kHasMsgLanguageCode;
+extern const std::string kDeletePreconsentedGroupsByApplicationId;
+extern const std::string kDeleteAppConsent;
+extern const std::string kSelectExternalConsentStatus;
+extern const std::string kInsertExternalConsentStatus;
+extern const std::string kDeleteExternalConsentEntities;
+extern const std::string kInsertExternalConsentEntity;
+extern const std::string kSelectExternalConsentEntity;
+
+} // namespace sql_pt_ext
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h
new file mode 100644
index 0000000000..bd2097cfe3
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/sql_pt_ext_representation.h
@@ -0,0 +1,218 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
+
+#include <string>
+#include "policy/sql_pt_representation.h"
+#include "policy/pt_ext_representation.h"
+
+namespace policy {
+
+class SQLPTExtRepresentation : public SQLPTRepresentation,
+ public PTExtRepresentation {
+ public:
+ SQLPTExtRepresentation();
+ explicit SQLPTExtRepresentation(bool in_memory);
+ bool CanAppKeepContext(const std::string& app_id);
+ bool CanAppStealFocus(const std::string& app_id);
+ bool GetDefaultHMI(const std::string& policy_app_id,
+ std::string* default_hmi);
+ bool ResetUserConsent();
+ bool ResetDeviceConsents();
+ bool ResetAppConsents();
+ bool GetUserPermissionsForDevice(const std::string& device_id,
+ StringArray* consented_groups = NULL,
+ StringArray* disallowed_groups = NULL);
+
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalIdType* group_types);
+
+ bool GetDeviceGroupsFromPolicies(
+ policy_table::Strings* groups = NULL,
+ policy_table::Strings* preconsented_groups = NULL);
+ bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware = "",
+ const std::string& firmware = "",
+ const std::string& os = "",
+ const std::string& os_version = "",
+ const std::string& carrier = "",
+ const uint32_t number_of_ports = 0,
+ const std::string& connection_type = "");
+ bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups = StringArray(),
+ const StringArray& disallowed_groups = StringArray());
+
+ bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed);
+
+ bool SetUserPermissionsForApp(const PermissionConsent& permissions);
+
+ std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language);
+
+ bool IncreaseStatisticsData(StatisticsType type) {
+ return true;
+ }
+ bool SetAppRegistrationLanguage(const std::string& app_id,
+ LanguageType type,
+ const std::string& language) {
+ return true;
+ }
+
+ bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language);
+
+ bool IsMetaInfoPresent();
+
+ bool SetSystemLanguage(const std::string& language);
+
+ int GetKmFromSuccessfulExchange() {
+ return true;
+ }
+ int GetDayFromScsExchange() {
+ return true;
+ }
+ int GetIgnitionsFromScsExchange() {
+ return true;
+ }
+
+ bool GetFunctionalGroupNames(FunctionalGroupNames& names);
+ bool CleanupUnpairedDevices(const DeviceIds& device_ids) const;
+
+ void Increment(const std::string& type) const;
+ void Increment(const std::string& app_id, const std::string& type) const;
+ void Set(const std::string& app_id,
+ const std::string& type,
+ const std::string& value) const;
+ void Add(const std::string& app_id,
+ const std::string& type,
+ int seconds) const;
+ bool SetDefaultPolicy(const std::string& app_id);
+ bool SetPredataPolicy(const std::string& app_id);
+ bool SetIsPredata(const std::string& app_id, bool is_pre_data);
+ bool IsPredataPolicy(const std::string& app_id) const;
+ bool SetUnpairedDevice(const std::string& device_id, bool unpaired) const;
+ bool UnpairedDevicesList(DeviceIds* device_ids) const;
+ bool RemoveAppConsentForGroup(const std::string& policy_app_id,
+ const std::string& functional_group_name) const;
+
+ virtual bool SetVINValue(const std::string& value);
+ bool SaveExternalConsentStatus(const ExternalConsentStatus& status) const;
+ ExternalConsentStatus GetExternalConsentStatus() const;
+
+ private:
+ enum ExternalConsentEntitiesType {
+ kExternalConsentEntitiesTypeOn,
+ kExternalConsentEntitiesTypeOff
+ };
+ void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
+ void GatherPreconsentedGroup(const std::string& app_id,
+ policy_table::Strings* groups) const;
+ bool GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const;
+ bool GatherAppLevels(policy_table::AppLevels* apps) const;
+ void GatherDeviceData(policy_table::DeviceData* data) const;
+ void GatherConsentGroup(const std::string& device_id,
+ policy_table::UserConsentRecords* records) const;
+ bool GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const;
+ bool SaveDeviceData(const policy_table::DeviceData& devices);
+ bool GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) const;
+ bool SaveConsentGroup(const std::string& device_id,
+ const policy_table::UserConsentRecords& records);
+ bool SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies);
+ bool SaveSpecificAppPolicy(
+ const policy_table::ApplicationPolicies::value_type& app);
+ bool SaveDevicePolicy(const policy_table::DevicePolicy& device);
+ bool SavePreconsentedGroup(const std::string& app_id,
+ const policy_table::Strings& groups);
+ bool SaveMessageString(const std::string& type,
+ const std::string& lang,
+ const policy_table::MessageString& strings);
+
+ virtual bool SaveUsageAndErrorCounts(
+ const policy_table::UsageAndErrorCounts& counts);
+
+ virtual bool SaveModuleMeta(const policy_table::ModuleMeta& meta);
+
+ bool SaveAppCounters(const policy_table::AppLevels& app_levels);
+
+ bool SaveGlobalCounters(const policy_table::UsageAndErrorCounts& counts);
+
+ bool IsExistAppLevel(const std::string& app_id) const;
+
+ bool GetAllAppGroups(const std::string& policy_app_id,
+ FunctionalGroupIDs& all_groups);
+
+ bool GetConsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups);
+
+ bool GetPreconsentedGroups(const std::string& policy_app_id,
+ FunctionalGroupIDs& preconsented_groups);
+
+ void FillFunctionalGroupPermissions(
+ FunctionalGroupIDs& ids,
+ FunctionalGroupNames& names,
+ GroupConsent state,
+ std::vector<FunctionalGroupPermission>& permissions);
+ bool CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id,
+ int* result) const;
+
+ /**
+ * @brief Checks, if there is message present with requested language in PT
+ * @param message Message name
+ * @param language Required message language
+ * @return True, if message with requested language is present, otherwise -
+ * false
+ */
+ bool IsMsgLanguagePresent(const std::string& message,
+ const std::string& language);
+
+ bool SaveExternalConsentEntities(
+ const int64_t group_id,
+ const policy_table::DisallowedByExternalConsentEntities& entities,
+ ExternalConsentEntitiesType type) const;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
new file mode 100644
index 0000000000..a69df20cfc
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
@@ -0,0 +1,136 @@
+/*
+ Copyright (c) 2013, " Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, " with or without
+ modification, " are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, " this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, "
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
+ CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_QUERIES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_QUERIES_H_
+
+#include <string>
+
+namespace policy {
+namespace sql_pt {
+
+extern const std::string kSelectPriority;
+extern const std::string kCreateSchema;
+extern const std::string kDropSchema;
+extern const std::string kDeleteData;
+extern const std::string kCheckPgNumber;
+extern const std::string kCheckDBIntegrity;
+extern const std::string kSelectRpc;
+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;
+extern const std::string kSelectNotificationsPerPriority;
+extern const std::string kSelectAppLevels;
+extern const std::string kSelectDeviceData;
+extern const std::string kSelectFunctionalGroups;
+extern const std::string kSelectAllRpcs;
+extern const std::string kSelectExternalConsentEntities;
+extern const std::string kSelectUserMsgsVersion;
+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;
+extern const std::string kSelectDays;
+extern const std::string kSelectTimeoutResponse;
+extern const std::string kInsertFunctionalGroup;
+extern const std::string kInsertRpc;
+extern const std::string kInsertRpcWithParameter;
+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;
+extern const std::string kUpdateVersion;
+extern const std::string kUpdateModuleConfig;
+extern const std::string kInsertEndpoint;
+extern const std::string kInsertSecondsBetweenRetry;
+extern const std::string kInsertNotificationsByPriority;
+extern const std::string kInsertDeviceData;
+extern const std::string kInsertAppLevel;
+extern const std::string kDeleteSecondsBetweenRetries;
+extern const std::string kDeleteEndpoint;
+extern const std::string kDeleteAppLevel;
+extern const std::string kDeleteMessageString;
+extern const std::string kDeleteFunctionalGroup;
+extern const std::string kDeleteRpc;
+extern const std::string kDeleteExternalConsentEntities;
+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;
+extern const std::string kUpdateFlagUpdateRequired;
+extern const std::string kSelectFlagUpdateRequired;
+extern const std::string kUpdateCountersSuccessfulUpdate;
+extern const std::string kSelectApplicationRevoked;
+extern const std::string kUpdateApplicationCustomData;
+extern const std::string kSelectApplicationRepresented;
+extern const std::string kSelectApplicationIsDefault;
+extern const std::string kUpdateIsDefault;
+extern const std::string kInsertInitData;
+extern const std::string kDeleteAppGroupByApplicationId;
+extern const std::string kInsertApplicationFull;
+extern const std::string kDeletePreconsentedGroupsByApplicationId;
+extern const std::string kSelectApplicationFull;
+extern const std::string kUpdatePreloaded;
+extern const std::string kUpdateRemoteControlDenied;
+extern const std::string kSelectRemoteControlDenied;
+extern const std::string kCollectFriendlyMsg;
+extern const std::string kSelectModuleTypes;
+extern const std::string kInsertModuleType;
+extern const std::string kInsertAccessModule;
+extern const std::string kSelectAccessModules;
+extern const std::string kDeleteAccessModules;
+extern const std::string kInsertRemoteRpc;
+extern const std::string kSelectRemoteRpcs;
+extern const std::string kDeleteRemoteRpc;
+extern const std::string kDeleteModuleTypes;
+extern const std::string kDeleteAllDevices;
+extern const std::string kSelectDBVersion;
+extern const std::string kUpdateDBVersion;
+} // namespace sql_pt
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_QUERIES_H_
diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
new file mode 100644
index 0000000000..54dfb9f0b7
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h
@@ -0,0 +1,228 @@
+/*
+ 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_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
+
+#include <string>
+#include <vector>
+#include "policy/pt_representation.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace utils {
+namespace dbms {
+class SQLDatabase;
+} // namespace dbms
+} // namespace utils
+
+namespace policy {
+
+class SQLPTRepresentation : public virtual PTRepresentation {
+ public:
+ SQLPTRepresentation();
+ explicit SQLPTRepresentation(bool in_memory);
+ ~SQLPTRepresentation();
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result);
+
+ virtual bool IsPTPreloaded();
+ virtual int IgnitionCyclesBeforeExchange();
+ virtual int KilometersBeforeExchange(int current);
+ virtual bool SetCountersPassedForSuccessfulUpdate(int kilometers,
+ int days_after_epoch);
+ virtual int DaysBeforeExchange(uint16_t current);
+ virtual void IncrementIgnitionCycles();
+ virtual void ResetIgnitionCycles();
+ virtual int TimeoutResponse();
+ virtual bool SecondsBetweenRetries(std::vector<int>* seconds);
+ virtual bool RefreshDB();
+ virtual const VehicleInfo GetVehicleInfo() const;
+
+ virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language);
+
+ virtual EndpointUrls GetUpdateUrls(int service_type);
+
+ virtual int GetNotificationsNumber(const std::string& priority);
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string* priority);
+ InitResult Init(const PolicySettings* settings);
+ 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 = NULL,
+ StringArray* app_hmi_types = NULL);
+ bool GetFunctionalGroupings(policy_table::FunctionalGroupings& groups);
+
+#ifdef BUILD_TESTS
+ uint32_t open_counter() {
+ return open_counter_;
+ }
+#endif // BUILD_TESTS
+ protected:
+#ifdef SDL_REMOTE_CONTROL
+ enum TypeAccess { kAllowed, kManual };
+ bool GatherModuleType(const std::string& app_id,
+ policy_table::ModuleTypes* module_types) const;
+ bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const;
+ bool GatherAccessModule(TypeAccess access,
+ policy_table::AccessModules* modules) const;
+ bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const;
+ bool SaveModuleType(const std::string& app_id,
+ const policy_table::ModuleTypes& types);
+ bool SaveRemoteControlDenied(const std::string& app_id, bool deny);
+
+ bool SaveAccessModule(TypeAccess access,
+ const policy_table::AccessModules& modules);
+ bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
+#endif // SDL_REMOTE_CONTROL
+
+ virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
+ virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
+ virtual bool GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const;
+ virtual void GatherDeviceData(policy_table::DeviceData* data) const;
+ virtual bool GatherFunctionalGroupings(
+ policy_table::FunctionalGroupings* groups) const;
+ virtual bool GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) 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;
+
+ virtual bool SaveApplicationCustomData(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata);
+
+ virtual bool SaveModuleMeta(const policy_table::ModuleMeta& meta);
+ virtual bool SaveModuleConfig(const policy_table::ModuleConfig& config);
+ virtual bool SaveUsageAndErrorCounts(
+ const policy_table::UsageAndErrorCounts& counts);
+ virtual bool SaveDeviceData(const policy_table::DeviceData& devices);
+ virtual bool SaveFunctionalGroupings(
+ const policy_table::FunctionalGroupings& groups);
+ virtual bool SaveConsumerFriendlyMessages(
+ const policy_table::ConsumerFriendlyMessages& messages);
+ 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,
+ const policy_table::MessageString& strings);
+
+ bool SaveAppGroup(const std::string& app_id,
+ const policy_table::Strings& app_groups);
+ bool SaveNickname(const std::string& app_id,
+ 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:
+ virtual std::string GetLockScreenIconUrl() const;
+ bool UpdateRequired() const;
+ void SaveUpdateRequired(bool value);
+
+ bool IsApplicationRepresented(const std::string& app_id) const;
+ bool CopyApplication(const std::string& source,
+ const std::string& destination);
+
+ bool IsApplicationRevoked(const std::string& app_id) const;
+ virtual bool IsDefaultPolicy(const std::string& app_id) const;
+ virtual bool IsPredataPolicy(const std::string& app_id) const;
+ virtual bool SetDefaultPolicy(const std::string& app_id);
+ virtual void SetPreloaded(bool value);
+
+ virtual bool SetVINValue(const std::string& value);
+
+ virtual utils::dbms::SQLDatabase* db() const;
+ virtual bool SetIsDefault(const std::string& app_id, bool is_default) const;
+
+ void RemoveDB() const OVERRIDE;
+ virtual bool IsDBVersionActual() const OVERRIDE;
+ virtual bool UpdateDBVersion() const OVERRIDE;
+
+ private:
+ utils::dbms::SQLDatabase* db_;
+
+#ifdef BUILD_TESTS
+ uint32_t open_counter_;
+#endif // BUILD_TESTS
+ enum ExternalConsentEntitiesType {
+ kExternalConsentEntitiesTypeOn,
+ kExternalConsentEntitiesTypeOff
+ };
+ /**
+ * @brief Calculates DB version from current schema
+ * @return version
+ */
+ const int32_t GetDBVersion() const;
+ bool SaveRpcs(int64_t group_id, const policy_table::Rpc& rpcs);
+ bool SaveServiceEndpoints(const policy_table::ServiceEndpoints& endpoints);
+ bool SaveSecondsBetweenRetries(
+ const policy_table::SecondsBetweenRetries& seconds);
+ bool SaveNumberOfNotificationsPerMinute(
+ const policy_table::NumberOfNotificationsPerMinute& notifications);
+ bool SaveMessageType(const std::string& type);
+ bool SaveLanguage(const std::string& code);
+
+ bool is_in_memory;
+ bool SaveExternalConsentEntities(
+ const int64_t group_id,
+ const policy_table::DisallowedByExternalConsentEntities& entities,
+ ExternalConsentEntitiesType type) const;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_external/include/policy/sql_wrapper.h b/src/components/policy/policy_external/include/policy/sql_wrapper.h
new file mode 100644
index 0000000000..87fe1404a7
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/sql_wrapper.h
@@ -0,0 +1,45 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_WRAPPER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_WRAPPER_H_
+
+#if __QNX__
+#include "utils/qdb_wrapper/sql_database_impl.h"
+#include "utils/qdb_wrapper/sql_query.h"
+#else // __QNX__
+// TODO it can be error root cause AHrytsesevich
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
+#endif // __QNX__
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_SQL_WRAPPER_H_
diff --git a/src/components/policy/policy_external/include/policy/status.h b/src/components/policy/policy_external/include/policy/status.h
new file mode 100644
index 0000000000..18789ecf99
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/status.h
@@ -0,0 +1,196 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
+
+#include <string>
+#include "policy/policy_types.h"
+#include "utils/macro.h"
+
+namespace policy {
+
+/**
+ * @brief The UpdateEvent enum defines system events which can change update
+ * status
+ */
+enum UpdateEvent {
+ kOnNewAppRegistered,
+ kOnValidUpdateReceived,
+ kOnWrongUpdateReceived,
+ kOnUpdateSentOut,
+ kOnUpdateTimeout,
+ kOnResetPolicyTableRequireUpdate,
+ kOnResetPolicyTableNoUpdate,
+ kScheduleUpdate,
+ kScheduleManualUpdate,
+ kOnResetRetrySequence,
+ kNoEvent
+};
+
+const std::string kUpToDate = "UP_TO_DATE";
+const std::string kUpdateNeeded = "UPDATE_NEEDED";
+const std::string kUpdating = "UPDATING";
+
+class UpdateStatusManager;
+
+/**
+ * @brief The Status class defines base implementation of update status
+ */
+class Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ Status(const std::string& string_status,
+ const policy::PolicyTableStatus enum_status);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~Status();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ virtual void ProcessEvent(UpdateStatusManager* manager,
+ UpdateEvent event) = 0;
+
+ /**
+ * @brief Return current status as string value
+ * @return Status as string
+ */
+ const std::string get_status_string() const;
+
+ /**
+ * @brief Return status as enum value
+ * @return Status as enum value
+ */
+ PolicyTableStatus get_status() const;
+
+ /**
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
+ virtual bool IsUpdateRequired() const;
+
+ /**
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
+ virtual bool IsUpdatePending() const;
+
+ private:
+ const std::string string_status_;
+ const PolicyTableStatus enum_status_;
+};
+
+/**
+ * @brief The UpToDateStatus class represents 'up-to-date' status
+ */
+class UpToDateStatus : public Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpToDateStatus();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE;
+};
+
+/**
+ * @brief The UpdateNeededStatus class represents 'update needed' status
+ */
+class UpdateNeededStatus : public Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpdateNeededStatus();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE;
+
+ /**
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
+ bool IsUpdateRequired() const OVERRIDE;
+};
+
+/**
+ * @brief The UpdatingStatus class represents 'updating' status
+ */
+class UpdatingStatus : public Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpdatingStatus();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ void ProcessEvent(UpdateStatusManager* manager, UpdateEvent event) OVERRIDE;
+
+ /**
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
+ bool IsUpdateRequired() const OVERRIDE;
+
+ /**
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
+ bool IsUpdatePending() const OVERRIDE;
+};
+}
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h
new file mode 100644
index 0000000000..b663610a5b
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/update_status_manager.h
@@ -0,0 +1,240 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
+
+#include "policy/policy_types.h"
+#include "utils/lock.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
+#include "policy/status.h"
+
+namespace policy {
+
+class PolicyListener;
+
+class UpdateStatusManager {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpdateStatusManager();
+
+ ~UpdateStatusManager();
+
+ /**
+ * @brief Process event by current status implementations
+ * @param event Event
+ */
+ void ProcessEvent(UpdateEvent event);
+
+ /**
+ * @brief Set next status during event processing
+ * @param status Status shared pointer
+ */
+ void SetNextStatus(utils::SharedPtr<Status> status);
+
+ /**
+ * @brief Set postponed status (will be set after next status) during event
+ * processing
+ * @param status Status shared pointer
+ */
+ void SetPostponedStatus(utils::SharedPtr<Status> status);
+
+ /**
+ * @brief Sets listener pointer
+ * @param listener Pointer to policy listener implementation
+ */
+ void set_listener(PolicyListener* listener);
+
+ /**
+ * @brief Update status hanlder for PTS sending out
+ * @param update_timeout Timeout for waiting of incoming PTU
+ */
+ void OnUpdateSentOut(uint32_t update_timeout);
+
+ /**
+ * @brief Update status handler for PTU waiting timeout
+ */
+ void OnUpdateTimeoutOccurs();
+
+ /**
+ * @brief Update status handler for valid PTU receiving
+ */
+ void OnValidUpdateReceived();
+
+ /**
+ * @brief Update status handler for wrong PTU receiving
+ */
+ void OnWrongUpdateReceived();
+
+ /**
+ * @brief Update status handler for reset PT to default state
+ * @param is_update_required Update necessity flag
+ */
+ void OnResetDefaultPT(bool is_update_required);
+
+ /**
+ * @brief Update status handler for restarting retry sequence
+ */
+ void OnResetRetrySequence();
+
+ /**
+ * @brief Update status handler on new application registering
+ */
+ void OnNewApplicationAdded(const DeviceConsent consent);
+
+ /**
+ * @brief Update status handler for policy initialization
+ * @param is_update_required Update necessity flag
+ */
+ void OnPolicyInit(bool is_update_required);
+
+ /**
+ * @brief In case application from non-consented device has been registered
+ * before and and no updated happened then triggers status change
+ */
+ void OnDeviceConsented();
+
+ /**
+ * @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.
+ */
+ bool IsUpdatePending() const;
+
+ /**
+ * @brief ScheduleUpdate allows to schedule next update.
+ * It will change state to Update_Needed, that's is.
+ */
+ void ScheduleUpdate();
+
+ /**
+ * @brief ScheduleUpdate allows to schedule next update.
+ * It will change state to Update_Needed, that's is
+ * and will not send any notifications about updating to HMI
+ */
+ void ScheduleManualUpdate();
+
+ /**
+ * @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();
+
+#ifdef BUILD_TESTS
+ PolicyTableStatus GetLastUpdateStatus() const {
+ return current_status_->get_status();
+ }
+#endif // BUILD_TESTS
+
+ private:
+ /**
+ * @brief Does statuses transitions after event handling and notifies the
+ * system
+ */
+ void DoTransition();
+
+ private:
+ PolicyListener* listener_;
+
+ /**
+ * @brief Current update status
+ */
+ utils::SharedPtr<Status> current_status_;
+
+ /**
+ * @brief Next status after current to be set
+ */
+ utils::SharedPtr<Status> next_status_;
+
+ /**
+ * @brief Status to be set after 'next' status
+ */
+ utils::SharedPtr<Status> postponed_status_;
+ sync_primitives::Lock status_lock_;
+
+ UpdateEvent last_processed_event_;
+ bool apps_search_in_progress_;
+ bool app_registered_from_non_consented_device_;
+ sync_primitives::Lock apps_search_in_progress_lock_;
+
+ class UpdateThreadDelegate : public threads::ThreadDelegate {
+ 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_;
+ };
+
+ UpdateThreadDelegate* update_status_thread_delegate_;
+ threads::Thread* thread_;
+};
+}
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
diff --git a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
new file mode 100644
index 0000000000..adaef0eb28
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h
@@ -0,0 +1,108 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
+
+#include <ctime>
+#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/usage_statistics/app_stopwatch.h"
+#include "utils/shared_ptr.h"
+#include "utils/timer.h"
+#include "utils/macro.h"
+
+namespace usage_statistics {
+
+using timer::Timer;
+
+class GlobalCounter {
+ public:
+ GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounterId counter_type);
+ void operator++() const;
+
+ private:
+ GlobalCounterId counter_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+};
+
+class AppCounter {
+ public:
+ AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ AppCounterId counter_type);
+ void operator++() const;
+
+ private:
+ std::string app_id_;
+ AppCounterId counter_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+};
+
+class AppInfo {
+ public:
+ AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ AppInfoId info_type);
+ void Update(const std::string& new_info) const;
+
+ private:
+ std::string app_id_;
+ AppInfoId info_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+};
+
+class AppStopwatchImpl : public AppStopwatch {
+ public:
+ AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id);
+ AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ std::uint32_t timeout);
+ ~AppStopwatchImpl();
+ void Start(AppStopwatchId stopwatch_type) OVERRIDE;
+ void Switch(AppStopwatchId stopwatch_type) OVERRIDE;
+ void WriteTime() OVERRIDE;
+
+ private:
+ // Fields
+ std::string app_id_;
+ AppStopwatchId stopwatch_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+ timer::Timer timer_;
+ const std::uint32_t time_out_;
+ DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
+};
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
diff --git a/src/components/policy/policy_external/include/policy/user_consent_manager.h b/src/components/policy/policy_external/include/policy/user_consent_manager.h
new file mode 100644
index 0000000000..0f242738b6
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/user_consent_manager.h
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
+
+namespace policy {
+class UserConsentManager {
+ public:
+ UserConsentManager() {}
+ ~UserConsentManager() {}
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
diff --git a/src/components/policy/specification.txt b/src/components/policy/policy_external/specification.txt
index b00a2932e0..b00a2932e0 100644
--- a/src/components/policy/specification.txt
+++ b/src/components/policy/policy_external/specification.txt
diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc
new file mode 100644
index 0000000000..d042d8c402
--- /dev/null
+++ b/src/components/policy/policy_external/src/access_remote_impl.cc
@@ -0,0 +1,261 @@
+/*
+ * 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 "policy/access_remote_impl.h"
+
+#include <algorithm>
+#include <iterator>
+#include "policy/cache_manager.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl")
+
+using policy_table::DeviceData;
+using policy_table::FunctionalGroupings;
+using rpc::policy_table_interface_base::EnumFromJsonString;
+
+namespace policy {
+
+struct ToHMIType {
+ policy_table::AppHMITypes::value_type operator()(int item) const {
+ policy_table::AppHMIType type = static_cast<policy_table::AppHMIType>(item);
+ if (!IsValidEnum(type)) {
+ LOG4CXX_WARN(logger_, "HMI type isn't known " << item);
+ type = policy_table::AHT_DEFAULT;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "HMI type: " << item << " - " << EnumToJsonString(type));
+ return policy_table::AppHMITypes::value_type(type);
+ }
+};
+
+struct Contained {
+ private:
+ const policy_table::Strings& params_;
+
+ public:
+ explicit Contained(const policy_table::Strings& params) : params_(params) {}
+ bool operator()(const RemoteControlParams::value_type& item) const {
+ return std::find_if(params_.begin(), params_.end(), CompareString(item)) !=
+ params_.end();
+ }
+ struct CompareString {
+ private:
+ const RemoteControlParams::value_type& value_;
+
+ public:
+ explicit CompareString(const RemoteControlParams::value_type& value)
+ : value_(value) {}
+ bool operator()(const policy_table::Strings::value_type& item) const {
+ return value_ == static_cast<std::string>(item);
+ }
+ };
+};
+
+struct ToModuleType {
+ std::string operator()(policy_table::ModuleTypes::value_type item) const {
+ policy_table::ModuleType type = static_cast<policy_table::ModuleType>(item);
+ return EnumToJsonString(type);
+ }
+};
+
+AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
+
+AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+ : cache_(cache) {}
+
+bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!cache_->IsApplicationRepresented(app_id)) {
+ return false;
+ }
+
+ const policy_table::ApplicationParams& app =
+ cache_->pt_->policy_table.app_policies_section.apps[app_id];
+ if (!app.moduleType.is_initialized()) {
+ return false;
+ }
+
+ const policy_table::ModuleTypes& modules = *app.moduleType;
+ if (modules.empty()) {
+ return true;
+ }
+
+ return std::find(modules.begin(), modules.end(), module) != modules.end();
+}
+
+bool AccessRemoteImpl::IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::AccessModules::const_iterator i = modules.find(module_name);
+ if (i == modules.end()) {
+ LOG4CXX_DEBUG(logger_, "Module " << module_name << " wasn't found");
+ return false;
+ }
+
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ if (rpcs.empty()) {
+ return true;
+ }
+ policy_table::RemoteRpcs::const_iterator j = rpcs.find(rpc_name);
+ if (j != rpcs.end()) {
+ const policy_table::Strings& parameters = j->second;
+ return CompareParameters(parameters, input);
+ }
+ LOG4CXX_DEBUG(logger_, "RPC " << rpc_name << " wasn't found");
+ return false;
+}
+
+bool AccessRemoteImpl::CompareParameters(
+ const policy_table::Strings& parameters, RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (parameters.empty()) {
+ return true;
+ }
+
+ if (input->empty()) {
+ LOG4CXX_DEBUG(logger_, "Input is empty");
+ return false;
+ }
+
+ input->erase(
+ std::remove_if(input->begin(), input->end(), Contained(parameters)),
+ input->end());
+ return input->empty();
+}
+
+void AccessRemoteImpl::SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ HMIList::mapped_type types;
+ std::transform(hmi_types.begin(),
+ hmi_types.end(),
+ std::back_inserter(types),
+ ToHMIType());
+ hmi_types_[who] = types;
+}
+
+const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(who.app_id)) {
+ return hmi_types_[who];
+ } else {
+ return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id]
+ .AppHMIType;
+ }
+}
+
+const policy_table::Strings& AccessRemoteImpl::GetGroups(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetGroups(who.app_id);
+}
+
+bool AccessRemoteImpl::IsAppRemoteControl(const ApplicationOnDevice& who) {
+ const policy_table::AppHMITypes& hmi_types = HmiTypes(who);
+ return std::find(hmi_types.begin(),
+ hmi_types.end(),
+ policy_table::AHT_REMOTE_CONTROL) != hmi_types.end();
+}
+
+bool AccessRemoteImpl::GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GetGroupsIds(device_id, app_id, group_types[kTypeGeneral]);
+ GetGroupsIds(device_id, kDefaultId, group_types[kTypeDefault]);
+ GetGroupsIds(
+ device_id, kPreDataConsentId, group_types[kTypePreDataConsented]);
+
+ cache_->GetPreConsentedGroups(app_id, group_types[kTypePreconsented]);
+
+ cache_->GetConsentedGroups(device_id,
+ app_id,
+ group_types[kTypeAllowed],
+ group_types[kTypeDisallowed]);
+
+ cache_->GetUnconsentedGroups(
+ device_id, app_id, group_types[kTypeUnconsented]);
+
+ cache_->GetAllAppGroups(kDeviceId, group_types[kTypeDevice]);
+ return true;
+}
+
+std::ostream& operator<<(std::ostream& output,
+ const FunctionalGroupIDs& types) {
+ std::copy(types.begin(),
+ types.end(),
+ std::ostream_iterator<FunctionalGroupIDs::value_type>(output, " "));
+ return output;
+}
+
+extern std::ostream& operator<<(std::ostream& output,
+ const policy_table::Strings& groups);
+
+void AccessRemoteImpl::GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& groups_ids) {
+ ApplicationOnDevice who = {device_id, app_id};
+ const policy_table::Strings& groups = GetGroups(who);
+ LOG4CXX_DEBUG(logger_, "Groups Names: " << groups);
+ groups_ids.resize(groups.size());
+ std::transform(groups.begin(),
+ groups.end(),
+ groups_ids.begin(),
+ &CacheManager::GenerateHash);
+ LOG4CXX_DEBUG(logger_, "Groups Ids: " << groups_ids);
+}
+
+bool AccessRemoteImpl::GetModuleTypes(const std::string& application_id,
+ std::vector<std::string>* modules) {
+ DCHECK(modules);
+ policy_table::ApplicationPolicies& apps =
+ cache_->pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator i = apps.find(application_id);
+ if (i == apps.end()) {
+ return false;
+ }
+ rpc::Optional<policy_table::ModuleTypes> moduleTypes = i->second.moduleType;
+ if (!moduleTypes.is_initialized()) {
+ return false;
+ }
+ std::transform(moduleTypes->begin(),
+ moduleTypes->end(),
+ std::back_inserter(*modules),
+ ToModuleType());
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc
new file mode 100644
index 0000000000..5aa39cb2f4
--- /dev/null
+++ b/src/components/policy/policy_external/src/cache_manager.cc
@@ -0,0 +1,2764 @@
+/*
+ * 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"
+
+#include <algorithm>
+#include <functional>
+#include <ctime>
+#include <cmath>
+#include <utility>
+#include <string>
+#include <vector>
+
+#include "utils/file_system.h"
+#include "json/reader.h"
+#include "json/features.h"
+#include "json/writer.h"
+#include "utils/logger.h"
+#include "utils/date_time.h"
+#include "utils/gen_hash.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/enums.h"
+#include "policy/policy_helper.h"
+#include "policy/sql_pt_ext_representation.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace {
+
+/**
+ * @brief Looks for ExternalConsent entity in the list of entities
+ * @param entities ExternalConsent entities list
+ * @param entity Entity to look for
+ * @return True if found in the list, otherwise - false
+ */
+bool IsEntityExists(
+ const policy_table::DisallowedByExternalConsentEntities& entities,
+ const policy_table::ExternalConsentEntity& entity) {
+ const policy_table::DisallowedByExternalConsentEntities::const_iterator
+ it_entity = std::find(entities.begin(), entities.end(), entity);
+
+ return entities.end() != it_entity;
+}
+
+/**
+ * @brief Looks for ExternalConsent entity in
+ * disallowed_by_external_consent_entities_on/off sections
+ * of each functional group
+ */
+struct GroupByEntityFinder
+ : public std::unary_function<
+ void,
+ const policy_table::FunctionalGroupings::value_type&> {
+ GroupByEntityFinder(
+ const policy::ExternalConsentStatusItem& external_consent_item,
+ policy::GroupsByExternalConsentStatus& out_groups_by_external_consent)
+ : external_consent_item_(external_consent_item)
+ , out_groups_by_external_consent_(out_groups_by_external_consent) {}
+
+ void operator()(
+ const policy_table::FunctionalGroupings::value_type& group) const {
+ if (!group.second.user_consent_prompt.is_initialized()) {
+ return;
+ }
+
+ policy_table::ExternalConsentEntity entity(
+ external_consent_item_.entity_type_, external_consent_item_.entity_id_);
+ const std::string group_name = group.first;
+
+ if (IsEntityExists(*group.second.disallowed_by_external_consent_entities_on,
+ entity)) {
+ const bool disallowed_by_external_consent_entities_on_marker = true;
+ out_groups_by_external_consent_[external_consent_item_].push_back(
+ std::make_pair(group_name,
+ disallowed_by_external_consent_entities_on_marker));
+ }
+
+ if (IsEntityExists(
+ *group.second.disallowed_by_external_consent_entities_off,
+ entity)) {
+ const bool disallowed_by_external_consent_entities_off_marker = false;
+ out_groups_by_external_consent_[external_consent_item_].push_back(
+ std::make_pair(group_name,
+ disallowed_by_external_consent_entities_off_marker));
+ }
+ }
+
+ private:
+ const policy::ExternalConsentStatusItem& external_consent_item_;
+ policy::GroupsByExternalConsentStatus& out_groups_by_external_consent_;
+};
+
+/**
+ * @brief Maps ExternalConsent status item to the list of functional groups
+ * names specifying
+ * container where item is found. If item is not found it won't be added.
+ */
+struct GroupByExternalConsentItemFinder
+ : public std::unary_function<
+ void,
+ const policy::ExternalConsentStatus::value_type&> {
+ GroupByExternalConsentItemFinder(
+ const policy_table::FunctionalGroupings& groups,
+ policy::GroupsByExternalConsentStatus& out_groups_by_external_consent)
+ : groups_(groups), out_groups_by_css_(out_groups_by_external_consent) {}
+
+ void operator()(const policy::ExternalConsentStatus::value_type&
+ external_consent_item) const {
+ GroupByEntityFinder group_finder(external_consent_item, out_groups_by_css_);
+ std::for_each(groups_.begin(), groups_.end(), group_finder);
+ }
+
+ private:
+ const policy_table::FunctionalGroupings& groups_;
+ policy::GroupsByExternalConsentStatus& out_groups_by_css_;
+};
+
+/**
+ * @brief Template for getting 'first' of std::pair to use with standard
+ * algorithm below
+ */
+template <typename T1, typename T2>
+const T1& pair_first(const std::pair<T1, T2>& item) {
+ return item.first;
+}
+
+/**
+ * @brief Collects known links device-to-application form
+ * device_data/user_consent_records is any record is present
+ */
+struct LinkCollector
+ : public std::unary_function<void,
+ const policy_table::DeviceData::value_type&> {
+ typedef std::vector<policy_table::UserConsentRecords::key_type>
+ ApplicationsIds;
+
+ LinkCollector(std::map<std::string, std::string>& links) : links_(links) {}
+
+ void operator()(const policy_table::DeviceData::value_type& value) {
+ using namespace policy_table;
+
+ device_id_ = value.first;
+
+ ApplicationsIds applications_ids;
+ std::transform(value.second.user_consent_records->begin(),
+ value.second.user_consent_records->end(),
+ std::back_inserter(applications_ids),
+ &pair_first<UserConsentRecords::key_type,
+ UserConsentRecords::mapped_type>);
+
+ std::for_each(applications_ids.begin(),
+ applications_ids.end(),
+ std::bind1st(std::mem_fun(&LinkCollector::FillLinks), this));
+ }
+
+ private:
+ void FillLinks(const ApplicationsIds::value_type app_id) const {
+ links_.insert(std::make_pair(device_id_, app_id));
+ }
+
+ std::string device_id_;
+ std::map<std::string, std::string>& links_;
+};
+
+/**
+ * @brief Returns group consent record constructed from input group permissions
+ */
+struct ExternalConsentConsentGroupAppender
+ : public std::unary_function<policy_table::ConsentGroups,
+ const policy::FunctionalGroupPermission&> {
+ policy_table::ConsentGroups::value_type operator()(
+ const policy::FunctionalGroupPermission& value) const {
+ return std::make_pair(value.group_name,
+ rpc::Boolean(value.state == policy::kGroupAllowed));
+ }
+};
+
+} // namespace
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+#define CACHE_MANAGER_CHECK(return_value) \
+ { \
+ if (!pt_) { \
+ LOG4CXX_WARN(logger_, "The cache manager is not initialized"); \
+ return return_value; \
+ } \
+ }
+
+#define CACHE_MANAGER_CHECK_VOID() \
+ { \
+ if (!pt_) { \
+ LOG4CXX_WARN(logger_, "The cache manager is not initialized"); \
+ return; \
+ } \
+ }
+
+struct LanguageFinder {
+ explicit 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_;
+};
+
+policy_table::MessageString FindLanguage(
+ const policy_table::MessageLanguages& msg_languages,
+ const std::string& lang) {
+ LanguageFinder finder(lang);
+ policy_table::Languages::const_iterator it = std::find_if(
+ msg_languages.languages.begin(), msg_languages.languages.end(), finder);
+ return (msg_languages.languages.end() == it) ? policy_table::MessageString()
+ : it->second;
+}
+
+CacheManager::CacheManager()
+ : CacheManagerInterface()
+ , pt_(new policy_table::Table)
+ , backup_(new SQLPTExtRepresentation())
+ , update_required(false)
+ , cache_lock_(true) {
+ InitBackupThread();
+}
+
+CacheManager::CacheManager(bool in_memory)
+ : CacheManagerInterface()
+ , pt_(new policy_table::Table)
+ , backup_(new SQLPTExtRepresentation(in_memory))
+ , update_required(false)
+ , cache_lock_(true) {
+ InitBackupThread();
+}
+
+CacheManager::~CacheManager() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(backuper_locker_);
+ backup_thread_->join();
+ delete backup_thread_->delegate();
+ threads::DeleteThread(backup_thread_);
+}
+
+ConsentPriorityType CacheManager::GetConsentsPriority(
+ const std::string& device_id, const std::string& application_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ConsentPriorityType prio_type = ConsentPriorityType::kExternalConsentPrio;
+ CACHE_MANAGER_CHECK(prio_type);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::DeviceData::const_iterator dev_params_iter =
+ pt_->policy_table.device_data->find(device_id);
+
+ if (pt_->policy_table.device_data->end() == dev_params_iter) {
+ LOG4CXX_DEBUG(logger_, "Device id " << device_id << " not found.");
+ return prio_type;
+ }
+
+ const policy_table::DeviceParams& dev_par = (*dev_params_iter).second;
+
+ policy_table::UserConsentRecords::const_iterator app_consent_record =
+ dev_par.user_consent_records->find(application_id);
+
+ if (dev_par.user_consent_records->end() == app_consent_record) {
+ LOG4CXX_DEBUG(logger_,
+ "Application id " << application_id << " not found.");
+ return prio_type;
+ }
+
+ const policy_table::ConsentRecords& record = app_consent_record->second;
+
+ return record.consent_last_updated > record.ext_consent_last_updated
+ ? ConsentPriorityType::kUserConsentPrio
+ : ConsentPriorityType::kExternalConsentPrio;
+}
+
+const policy_table::Strings& CacheManager::GetGroups(const PTString& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return pt_->policy_table.app_policies_section.apps[app_id].groups;
+}
+
+bool CacheManager::CanAppKeepContext(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ bool result = false;
+ if (kDeviceId == app_id) {
+ result = pt_->policy_table.app_policies_section.device.keep_context;
+ } else if (IsApplicationRepresented(app_id)) {
+ result = pt_->policy_table.app_policies_section.apps[app_id].keep_context;
+ }
+ return result;
+}
+
+uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ uint32_t result = 0;
+ if (!IsApplicationRepresented(app_id)) {
+ return result;
+ }
+
+ const policy_table::ApplicationPolicies::mapped_type& app =
+ pt_->policy_table.app_policies_section.apps[app_id];
+ if (app.heart_beat_timeout_ms.is_initialized()) {
+ result = *(app.heart_beat_timeout_ms);
+ }
+
+ return result;
+}
+
+const policy_table::AppHMITypes* CacheManager::GetHMITypes(
+ const std::string& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::ApplicationPolicies& apps =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id);
+ if (i != apps.end()) {
+ const policy_table::AppHMITypes& app_hmi_types = *i->second.AppHMIType;
+ if (app_hmi_types.is_initialized()) {
+ return &app_hmi_types;
+ }
+ }
+ return NULL;
+}
+
+int32_t CacheManager::GenerateHash(const std::string& str_to_hash) {
+ uint32_t hash = 5381U;
+ std::string::const_iterator it = str_to_hash.begin();
+ std::string::const_iterator it_end = str_to_hash.end();
+
+ for (; it != it_end; ++it) {
+ hash = ((hash << 5) + hash) + (*it);
+ }
+
+ // Reset sign bit in case it has been set.
+ // This is needed to avoid overflow for signed int.
+ const int32_t result = hash & 0x7FFFFFFF;
+ return result;
+}
+
+bool CacheManager::CanAppStealFocus(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ bool result = false;
+ if (kDeviceId == app_id) {
+ result = pt_->policy_table.app_policies_section.device.steal_focus;
+ } else if (IsApplicationRepresented(app_id)) {
+ result = pt_->policy_table.app_policies_section.apps[app_id].steal_focus;
+ }
+ return result;
+}
+
+bool CacheManager::GetDefaultHMI(const std::string& app_id,
+ std::string& default_hmi) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ bool result = false;
+ default_hmi.clear();
+ if (kDeviceId == app_id) {
+ default_hmi = EnumToJsonString(
+ pt_->policy_table.app_policies_section.device.default_hmi);
+ } else if (IsApplicationRepresented(app_id)) {
+ default_hmi = EnumToJsonString(
+ pt_->policy_table.app_policies_section.apps[app_id].default_hmi);
+ }
+ result = !default_hmi.empty();
+
+ return result;
+}
+
+bool CacheManager::ResetUserConsent() {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
+ policy_table::DeviceData::iterator iter =
+ pt_->policy_table.device_data->begin();
+ policy_table::DeviceData::iterator iter_end =
+ pt_->policy_table.device_data->end();
+
+ for (; iter != iter_end; ++iter) {
+ iter->second.user_consent_records->clear();
+ }
+ Backup();
+ return true;
+}
+
+bool CacheManager::GetUserPermissionsForDevice(
+ const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::DeviceData& device_data = *pt_->policy_table.device_data;
+ if (device_data.end() == device_data.find(device_id)) {
+ LOG4CXX_ERROR(logger_,
+ "Device with " << device_id << "was not found in PT");
+ return false;
+ }
+ const policy_table::DeviceParams& params = device_data[device_id];
+ const policy_table::UserConsentRecords& ucr = *(params.user_consent_records);
+ policy_table::UserConsentRecords::const_iterator iter = ucr.begin();
+ policy_table::UserConsentRecords::const_iterator iter_end = ucr.end();
+
+ for (; iter != iter_end; ++iter) {
+ policy_table::ConsentGroups::const_iterator con_iter;
+ policy_table::ConsentGroups::const_iterator con_iter_end;
+
+ con_iter = (*iter).second.consent_groups->begin();
+ con_iter_end = (*iter).second.consent_groups->end();
+ for (; con_iter != con_iter_end; ++con_iter) {
+ if (true == (*con_iter).second) {
+ consented_groups.push_back((*con_iter).first);
+ } else {
+ disallowed_groups.push_back((*con_iter).first);
+ }
+ }
+ }
+ return true;
+}
+
+void CacheManager::GetAllAppGroups(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ 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>((utils::Djb2HashFromString(*iter)));
+ all_group_ids.push_back(group_id);
+ }
+
+ return;
+ }
+
+ policy_table::ApplicationPolicies::const_iterator app_params_iter =
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+
+ 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 =
+ (*app_params_iter).second.groups.end();
+
+ for (; iter != iter_end; ++iter) {
+ const uint32_t group_id =
+ static_cast<uint32_t>((utils::Djb2HashFromString(*iter)));
+ all_group_ids.push_back(group_id);
+ }
+ }
+}
+
+void CacheManager::GetPreConsentedGroups(
+ const std::string& app_id, FunctionalGroupIDs& preconsented_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (kDeviceId == app_id) {
+ policy_table::DevicePolicy& device =
+ pt_->policy_table.app_policies_section.device;
+
+ policy_table::Strings::const_iterator iter =
+ device.preconsented_groups->begin();
+ policy_table::Strings::const_iterator iter_end =
+ device.preconsented_groups->end();
+
+ for (; iter != iter_end; ++iter) {
+ const uint32_t group_id =
+ static_cast<uint32_t>((utils::Djb2HashFromString(*iter)));
+ preconsented_groups.push_back(group_id);
+ }
+
+ return;
+ }
+
+ policy_table::ApplicationPolicies::const_iterator app_param_iter =
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() != app_param_iter) {
+ policy_table::Strings::const_iterator iter =
+ (*app_param_iter).second.preconsented_groups->begin();
+ policy_table::Strings::const_iterator iter_end =
+ (*app_param_iter).second.preconsented_groups->end();
+ for (; iter != iter_end; ++iter) {
+ const int32_t group_id = utils::Djb2HashFromString(*iter);
+
+ preconsented_groups.push_back(group_id);
+ }
+ }
+}
+
+void CacheManager::GetConsentedGroups(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::DeviceData::iterator dev_params_iter =
+ pt_->policy_table.device_data->find(device_id);
+
+ if (pt_->policy_table.device_data->end() != dev_params_iter) {
+ const policy_table::DeviceParams& dev_par = (*dev_params_iter).second;
+
+ policy_table::UserConsentRecords::const_iterator iter =
+ dev_par.user_consent_records->find(app_id);
+
+ if (dev_par.user_consent_records->end() != iter) {
+ policy_table::ConsentGroups::const_iterator consent_iter =
+ (*iter).second.consent_groups->begin();
+ policy_table::ConsentGroups::const_iterator consent_iter_end =
+ (*iter).second.consent_groups->end();
+
+ for (; consent_iter != consent_iter_end; ++consent_iter) {
+ const int32_t group_id =
+ utils::Djb2HashFromString((*consent_iter).first);
+
+ if (true == (*consent_iter).second) {
+ allowed_groups.push_back(group_id);
+ } else {
+ disallowed_groups.push_back(group_id);
+ }
+ }
+ }
+ }
+}
+
+void CacheManager::GetUnconsentedGroups(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+
+ if (!IsApplicationRepresented(policy_app_id)) {
+ LOG4CXX_WARN(logger_,
+ "The application with app_id: " << policy_app_id
+ << " is not represented");
+ return;
+ }
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::Strings::iterator iter_groups;
+ policy_table::Strings::iterator iter_groups_end;
+ if (kDeviceId == policy_app_id) {
+ iter_groups = pt_->policy_table.app_policies_section.device.groups.begin();
+ iter_groups_end =
+ pt_->policy_table.app_policies_section.device.groups.end();
+ } else {
+ iter_groups = pt_->policy_table.app_policies_section.apps[policy_app_id]
+ .groups.begin();
+ iter_groups_end =
+ pt_->policy_table.app_policies_section.apps[policy_app_id].groups.end();
+ }
+
+ for (; iter_groups != iter_groups_end; ++iter_groups) {
+ // Try to find app-specific group in common groups list;
+ policy_table::FunctionalGroupings::const_iterator func_groups =
+ pt_->policy_table.functional_groupings.find(*iter_groups);
+ if (pt_->policy_table.functional_groupings.end() != func_groups) {
+ // Check if groups have user consents field.
+ if (func_groups->second.user_consent_prompt.is_initialized()) {
+ // Try to find certain group among already consented groups.
+ policy_table::DeviceData::const_iterator device_iter =
+ pt_->policy_table.device_data->find(device_id);
+ if (pt_->policy_table.device_data->end() != device_iter) {
+ policy_table::UserConsentRecords::const_iterator ucr_iter =
+ device_iter->second.user_consent_records->find(policy_app_id);
+ if (device_iter->second.user_consent_records->end() != ucr_iter) {
+ if ((*ucr_iter).second.consent_groups->end() ==
+ (*ucr_iter).second.consent_groups->find(*iter_groups)) {
+ unconsented_groups.push_back(
+ utils::Djb2HashFromString(*iter_groups));
+ }
+ } else {
+ unconsented_groups.push_back(
+ utils::Djb2HashFromString(*iter_groups));
+ }
+ }
+ }
+ }
+ }
+}
+
+void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::DeviceData::iterator device_iter =
+ pt_->policy_table.device_data->begin();
+ policy_table::DeviceData::iterator device_iter_end =
+ pt_->policy_table.device_data->end();
+
+ policy_table::UserConsentRecords::iterator ucr_iter;
+ for (; device_iter != device_iter_end; ++device_iter) {
+ ucr_iter = device_iter->second.user_consent_records->find(app_id);
+ if (device_iter->second.user_consent_records->end() != ucr_iter) {
+ ucr_iter->second.consent_groups->erase(group_name);
+ }
+ }
+}
+
+using rpc::policy_table_interface_base::RequestTypes;
+using rpc::policy_table_interface_base::RequestType;
+
+void CacheManager::ProcessUpdate(
+ const policy_table::ApplicationPolicies::const_iterator
+ initial_policy_iter) {
+ using namespace policy;
+ const RequestTypes& new_request_types =
+ *(initial_policy_iter->second.RequestType);
+
+ const std::string& app_id = initial_policy_iter->first;
+ bool update_request_types = true;
+
+ if (app_id == kDefaultId || app_id == kPreDataConsentId) {
+ if (new_request_types.is_omitted()) {
+ LOG4CXX_INFO(logger_,
+ "Application " << app_id
+ << " has omitted RequestTypes."
+ " Previous values will be kept.");
+ update_request_types = false;
+ } else if (new_request_types.empty()) {
+ if (new_request_types.is_cleaned_up()) {
+ LOG4CXX_INFO(logger_,
+ "Application " << app_id
+ << " has cleaned up all values."
+ " Previous values will be kept.");
+ update_request_types = false;
+ } else {
+ LOG4CXX_INFO(logger_,
+ "Application " << app_id
+ << " has empty RequestTypes."
+ " Any parameter will be allowed.");
+ }
+ }
+ }
+
+ sync_primitives::AutoLock lock(cache_lock_);
+ const RequestTypes merged_pt_request_types =
+ update_request_types
+ ? new_request_types
+ : *(pt_->policy_table.app_policies_section.apps[app_id].RequestType);
+
+ pt_->policy_table.app_policies_section.apps[app_id] =
+ initial_policy_iter->second;
+ *(pt_->policy_table.app_policies_section.apps[app_id].RequestType) =
+ merged_pt_request_types;
+}
+
+bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
+ 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_section.apps.begin();
+ policy_table::ApplicationPolicies::const_iterator iter_end =
+ update_pt.policy_table.app_policies_section.apps.end();
+
+ for (; iter != iter_end; ++iter) {
+ if (iter->second.is_null()) {
+ pt_->policy_table.app_policies_section.apps[iter->first] =
+ policy_table::ApplicationParams();
+ 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 {
+ ProcessUpdate(iter);
+ }
+ }
+
+ pt_->policy_table.app_policies_section.device =
+ update_pt.policy_table.app_policies_section.device;
+
+ pt_->policy_table.module_config.SafeCopyFrom(
+ update_pt.policy_table.module_config);
+
+ pt_->policy_table.consumer_friendly_messages.assign_if_valid(
+ update_pt.policy_table.consumer_friendly_messages);
+
+ ResetCalculatedPermissions();
+ Backup();
+
+ if (*pt_->policy_table.module_config.preloaded_pt && update_pt.is_valid()) {
+ *pt_->policy_table.module_config.preloaded_pt = false;
+ }
+
+ return true;
+}
+
+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_);
+ 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();
+ }
+ 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;
+ }
+ }
+}
+
+bool CacheManager::AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(application_id);
+
+ if (policy_iter == policies.end()) {
+ return false;
+ }
+
+ if (policy_iter->second.AppHMIType.is_initialized()) {
+ return helpers::in_range(*(policy_iter->second.AppHMIType),
+ rpc::Enum<policy_table::AppHMIType>(hmi_type));
+ }
+
+ return false;
+}
+
+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);
+ // ISO_8601 format is expected, e.g. “2000-01-01T12:18:53Z”
+ strftime(buf, sizeof(buf), "%Y-%m-%dT%XZ", &tstruct);
+ return buf;
+}
+
+bool CacheManager::GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GetAllAppGroups(app_id, group_types[kTypeGeneral]);
+ GetAllAppGroups(kDefaultId, group_types[kTypeDefault]);
+ GetAllAppGroups(kPreDataConsentId, group_types[kTypePreDataConsented]);
+ GetPreConsentedGroups(app_id, group_types[kTypePreconsented]);
+
+ GetConsentedGroups(device_id,
+ app_id,
+ group_types[kTypeAllowed],
+ group_types[kTypeDisallowed]);
+
+ GetUnconsentedGroups(device_id, app_id, group_types[kTypeUnconsented]);
+
+ GetAllAppGroups(kDeviceId, group_types[kTypeDevice]);
+ return true;
+}
+
+bool CacheManager::GetDeviceGroupsFromPolicies(
+ policy_table::Strings& groups,
+ policy_table::Strings& preconsented_groups) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ groups = pt_->policy_table.app_policies_section.device.groups;
+ preconsented_groups =
+ *(pt_->policy_table.app_policies_section.device).preconsented_groups;
+ return true;
+}
+
+bool CacheManager::IsDeviceConsentCached(const std::string& device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cached_device_permissions_lock_);
+ CachedDevicePermissions::const_iterator cached_dev_consent_iter;
+ cached_dev_consent_iter = cached_device_permissions_.find(device_id);
+ return cached_dev_consent_iter != cached_device_permissions_.end();
+}
+
+DeviceConsent CacheManager::GetCachedDeviceConsent(
+ const std::string& device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(cached_device_permissions_lock_);
+ DeviceConsent result = kDeviceHasNoConsent;
+ CACHE_MANAGER_CHECK(result);
+ CachedDevicePermissions::const_iterator cached_dev_consent_iter;
+ cached_dev_consent_iter = cached_device_permissions_.find(device_id);
+ if (cached_dev_consent_iter != cached_device_permissions_.end()) {
+ return cached_dev_consent_iter->second;
+ }
+ return result;
+}
+
+void CacheManager::SaveDeviceConsentToCache(const std::string& device_id,
+ const bool is_allowed) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock lock(cached_device_permissions_lock_);
+ DeviceConsent result = is_allowed ? kDeviceAllowed : kDeviceDisallowed;
+ cached_device_permissions_[device_id] = result;
+}
+
+bool CacheManager::GetPermissionsList(StringArray& perm_list) const {
+ // Get device permission groups from app_policies section, which hadn't been
+ // preconsented
+ policy_table::Strings groups;
+ policy_table::Strings preconsented_groups;
+ if (!GetDeviceGroupsFromPolicies(groups, preconsented_groups)) {
+ LOG4CXX_WARN(logger_, "Can't get device groups from policies.");
+ return false;
+ }
+
+ std::for_each(groups.begin(),
+ groups.end(),
+ FunctionalGroupInserter(preconsented_groups, perm_list));
+ return true;
+}
+
+bool CacheManager::HasDeviceSpecifiedConsent(const std::string& device_id,
+ const bool is_allowed) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device :" << device_id);
+ const DeviceConsent current_consent = GetDeviceConsent(device_id);
+ const bool is_current_device_allowed =
+ DeviceConsent::kDeviceAllowed == current_consent ? true : false;
+
+ if (DeviceConsent::kDeviceHasNoConsent == current_consent ||
+ is_current_device_allowed != is_allowed) {
+ return false;
+ }
+ const std::string consent = is_allowed ? "allowed" : "disallowed";
+ LOG4CXX_INFO(logger_,
+ "DeviceGetDeviceGroupsFromPolicies is already " << consent
+ << ".");
+ return true;
+}
+
+void CacheManager::SetDeviceConsent(const std::string& device_id,
+ const bool is_allowed) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ if (HasDeviceSpecifiedConsent(device_id, is_allowed)) {
+ return;
+ }
+ ResetCalculatedPermissionsForDevice(device_id);
+ // Remove unpaired mark, if device re-paired and re-consented again
+ if (is_allowed) {
+ SetUnpairedDevice(device_id, false);
+ }
+
+ StringArray list_of_permissions;
+ if (!GetPermissionsList(list_of_permissions) || list_of_permissions.empty()) {
+ LOG4CXX_WARN(logger_, "List of permissions can't be received or empty");
+ return;
+ }
+
+ StringArray consented_groups;
+ StringArray disallowed_groups;
+
+ // Supposed only one group for device date consent
+ if (is_allowed) {
+ consented_groups = list_of_permissions;
+ } else {
+ disallowed_groups = list_of_permissions;
+ }
+
+ if (!SetUserPermissionsForDevice(
+ device_id, consented_groups, disallowed_groups)) {
+ LOG4CXX_WARN(logger_, "Can't set user consent for device");
+ return;
+ }
+ SaveDeviceConsentToCache(device_id, is_allowed);
+}
+
+DeviceConsent CacheManager::GetDeviceConsent(
+ const std::string& device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(kDeviceHasNoConsent);
+ if (IsDeviceConsentCached(device_id)) {
+ return GetCachedDeviceConsent(device_id);
+ }
+ StringArray list_of_permissions;
+ if (!GetPermissionsList(list_of_permissions)) {
+ return kDeviceDisallowed;
+ }
+
+ // Check device permission groups for user consent in device_data
+ // section
+ if (list_of_permissions.empty()) {
+ return kDeviceAllowed;
+ }
+ StringArray consented_groups;
+ StringArray disallowed_groups;
+ if (!GetUserPermissionsForDevice(
+ device_id, consented_groups, disallowed_groups)) {
+ return kDeviceDisallowed;
+ }
+
+ if (consented_groups.empty() && disallowed_groups.empty()) {
+ return kDeviceHasNoConsent;
+ }
+
+ std::sort(list_of_permissions.begin(), list_of_permissions.end());
+ std::sort(consented_groups.begin(), consented_groups.end());
+
+ StringArray to_be_consented_by_user;
+ std::set_difference(list_of_permissions.begin(),
+ list_of_permissions.end(),
+ consented_groups.begin(),
+ consented_groups.end(),
+ std::back_inserter(to_be_consented_by_user));
+ if (to_be_consented_by_user.empty()) {
+ return kDeviceAllowed;
+ }
+ return kDeviceDisallowed;
+}
+
+bool CacheManager::AddDevice(const std::string& device_id,
+ const std::string& connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ CACHE_MANAGER_CHECK(false);
+ policy_table::DeviceParams& params =
+ (*(pt_->policy_table.device_data))[device_id];
+ *params.connection_type = connection_type;
+
+ // We have to set preloaded flag as false in policy table on adding new
+ // information (SDLAQ-CRS-2365). It can happens only after device addition.
+ *pt_->policy_table.module_config.preloaded_pt = false;
+
+ Backup();
+ return true;
+}
+
+bool CacheManager::SetDeviceData(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ CACHE_MANAGER_CHECK(false);
+
+ if (pt_->policy_table.device_data->end() ==
+ pt_->policy_table.device_data->find(device_id)) {
+ LOG4CXX_ERROR(logger_, "Unable to find mobile device: " << device_id);
+ return false;
+ }
+
+ policy_table::DeviceParams& params =
+ (*(pt_->policy_table.device_data))[device_id];
+ *params.hardware = hardware;
+ *params.firmware_rev = firmware;
+ *params.os = os;
+ *params.os_version = os_version;
+ *params.carrier = carrier;
+ *params.max_number_rfcom_ports = number_of_ports;
+ *params.connection_type = connection_type;
+
+ Backup();
+ return true;
+}
+
+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_);
+ CACHE_MANAGER_CHECK(false);
+ policy_table::DeviceParams& params =
+ (*pt_->policy_table.device_data)[device_id];
+ policy_table::UserConsentRecords& ucr = *(params.user_consent_records);
+
+ StringArray::const_iterator consent_iter_end = consented_groups.end();
+ StringArray::const_iterator consent_iter = consented_groups.begin();
+ StringArray::const_iterator un_consent_iter_end = disallowed_groups.end();
+ StringArray::const_iterator un_consent_iter = disallowed_groups.begin();
+
+ for (; consent_iter != consent_iter_end; ++consent_iter) {
+ (*ucr[kDeviceId].consent_groups)[*consent_iter] = true;
+ }
+
+ for (; un_consent_iter != un_consent_iter_end; ++un_consent_iter) {
+ (*ucr[kDeviceId].consent_groups)[*un_consent_iter] = false;
+ }
+
+ policy_table::UserConsentRecords::iterator ucr_iter = ucr.begin();
+ policy_table::UserConsentRecords::iterator ucr_iter_end = ucr.end();
+ // TODO(AGaliuzov): Get this info from external data
+ for (; ucr_iter != ucr_iter_end; ++ucr_iter) {
+ *ucr_iter->second.input = policy_table::Input::I_GUI;
+ *ucr_iter->second.time_stamp = currentDateTime();
+ }
+ Backup();
+ return true;
+}
+
+bool CacheManager::ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ bool result = true;
+ if (is_device_allowed) {
+ // If app has pre_DataConsented groups it should be 'promoted' to default
+ if (IsPredataPolicy(app_id)) {
+ result = SetDefaultPolicy(app_id);
+ }
+ } else {
+ SetIsPredata(app_id);
+ }
+ Backup();
+ return result;
+}
+
+void CacheManager::GetGroupNameByHashID(const int32_t group_id,
+ std::string& group_name) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::FunctionalGroupings::const_iterator fg_iter =
+ pt_->policy_table.functional_groupings.begin();
+ policy_table::FunctionalGroupings::const_iterator fg_iter_end =
+ pt_->policy_table.functional_groupings.end();
+
+ for (; fg_iter != fg_iter_end; ++fg_iter) {
+ const int32_t id = utils::Djb2HashFromString((*fg_iter).first);
+ if (group_id == id) {
+ group_name = (*fg_iter).first;
+ }
+ }
+}
+
+bool CacheManager::SetUserPermissionsForApp(
+ const PermissionConsent& permissions, bool* out_app_permissions_changed) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ CACHE_MANAGER_CHECK(false);
+ std::vector<FunctionalGroupPermission>::const_iterator iter =
+ permissions.group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator iter_end =
+ permissions.group_permissions.end();
+ *out_app_permissions_changed = false;
+
+ std::string group_name;
+ for (; iter != iter_end; ++iter) {
+ if (policy::kGroupUndefined != (*iter).state) {
+ policy_table::DeviceParams& params =
+ (*pt_->policy_table.device_data)[permissions.device_id];
+ rpc::policy_table_interface_base::ConsentRecords& ucr =
+ (*params.user_consent_records)[permissions.policy_app_id];
+
+ GetGroupNameByHashID((*iter).group_id, group_name);
+
+ policy_table::ConsentGroups::const_iterator it_group =
+ ucr.consent_groups->find(group_name);
+
+ const bool is_allowed = (*iter).state == policy::kGroupAllowed;
+ if (ucr.consent_groups->end() == it_group ||
+ it_group->second != is_allowed) {
+ *out_app_permissions_changed = true;
+
+ const TimevalStruct tm = date_time::DateTime::getCurrentTime();
+ int64_t current_time_msec = date_time::DateTime::getmSecs(tm);
+ ucr.consent_last_updated = current_time_msec;
+ LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
+ }
+
+ (*ucr.consent_groups)[group_name] = is_allowed;
+ *ucr.input = policy_table::Input::I_GUI;
+ *ucr.time_stamp = currentDateTime();
+ }
+ }
+ Backup();
+ return true;
+}
+
+bool CacheManager::UpdateRequired() const {
+ return update_required;
+}
+
+void CacheManager::SaveUpdateRequired(bool status) {
+ update_required = status;
+ Backup();
+}
+
+bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (!IsApplicationRepresented(app_id)) {
+ return false;
+ }
+ const bool is_revoked =
+ pt_->policy_table.app_policies_section.apps[app_id].is_null();
+ return is_revoked;
+}
+
+void CacheManager::CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ if (!IsApplicationRepresented(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_section.apps[app_id].groups.begin();
+
+ policy_table::Strings::const_iterator app_groups_iter_end =
+ pt_->policy_table.app_policies_section.apps[app_id].groups.end();
+
+ policy_table::FunctionalGroupings::const_iterator concrete_group;
+
+ for (; app_groups_iter != app_groups_iter_end; ++app_groups_iter) {
+ concrete_group =
+ pt_->policy_table.functional_groupings.find(*app_groups_iter);
+ if (pt_->policy_table.functional_groupings.end() != concrete_group) {
+ const policy_table::Rpcs& rpcs = concrete_group->second;
+
+ policy_table::Rpc::const_iterator rpc_iter = rpcs.rpcs.find(rpc);
+ if (rpcs.rpcs.end() != rpc_iter) {
+ policy_table::RpcParameters rpc_param = rpc_iter->second;
+
+ policy_table::HmiLevel hmi_level_e;
+ policy_table::EnumFromJsonString(hmi_level, &hmi_level_e);
+
+ policy_table::HmiLevels::const_iterator hmi_iter =
+ std::find(rpc_param.hmi_levels.begin(),
+ rpc_param.hmi_levels.end(),
+ hmi_level_e);
+
+ if (rpc_param.hmi_levels.end() != hmi_iter) {
+ result.hmi_level_permitted = PermitResult::kRpcAllowed;
+
+ policy_table::Parameters::const_iterator params_iter =
+ rpc_param.parameters->begin();
+ policy_table::Parameters::const_iterator params_iter_end =
+ rpc_param.parameters->end();
+
+ for (; params_iter != params_iter_end; ++params_iter) {
+ result.list_of_allowed_params.insert(
+ policy_table::EnumToJsonString(*params_iter));
+ }
+ }
+ }
+ }
+ }
+}
+
+bool CacheManager::IsPTPreloaded() {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return *pt_->policy_table.module_config.preloaded_pt;
+}
+
+int CacheManager::IgnitionCyclesBeforeExchange() {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ 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:" << static_cast<int>(limit));
+ uint8_t current = 0;
+
+ const int last_exch = static_cast<int>(
+ *pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
+ current = std::max(last_exch, 0);
+ LOG4CXX_DEBUG(
+ logger_,
+ "IgnitionCyclesBeforeExchange current:" << static_cast<int>(current));
+
+ return std::max(limit - current, 0);
+}
+
+int CacheManager::KilometersBeforeExchange(int current) {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const int limit =
+ std::max(static_cast<int>(
+ pt_->policy_table.module_config.exchange_after_x_kilometers),
+ 0);
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange limit:" << limit);
+ int last = 0;
+
+ const int odo_val = static_cast<int>(
+ *pt_->policy_table.module_meta->pt_exchanged_at_odometer_x);
+ last = std::max(odo_val, 0);
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange last:" << last);
+
+ const int actual = std::max((current - last), 0);
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange actual:" << actual);
+ return std::max(limit - actual, 0);
+}
+
+bool CacheManager::SetCountersPassedForSuccessfulUpdate(
+ policy::Counters counter, int value) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ switch (counter) {
+ case KILOMETERS:
+ *pt_->policy_table.module_meta->pt_exchanged_at_odometer_x = value;
+ LOG4CXX_DEBUG(logger_,
+ "SetCountersPassedForSuccessfulUpdate km:" << value);
+ break;
+ case DAYS_AFTER_EPOCH:
+ *pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch = value;
+ LOG4CXX_DEBUG(
+ logger_,
+ "SetCountersPassedForSuccessfulUpdate days after epoch:" << value);
+ break;
+ default:
+ LOG4CXX_ERROR(logger_,
+ "Unknown counter was requested to set: " << counter);
+ return false;
+ }
+
+ Backup();
+ return true;
+}
+
+int CacheManager::DaysBeforeExchange(uint16_t current) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ const rpc::Optional<rpc::Integer<uint16_t, 0, 65535> >& days_after_epoch =
+ (pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch);
+
+ if (!days_after_epoch->is_initialized()) {
+ return -1;
+ }
+
+ const uint8_t limit = pt_->policy_table.module_config.exchange_after_x_days;
+ LOG4CXX_DEBUG(logger_,
+ "Exchange after: " << static_cast<int>(limit) << " days");
+
+ LOG4CXX_DEBUG(logger_, "Epoch since last update: " << *days_after_epoch);
+
+ const uint16_t actual =
+ std::max(static_cast<uint16_t>(current - *days_after_epoch), uint16_t(0));
+ LOG4CXX_DEBUG(logger_, "The days since last update: " << actual);
+
+ return std::max(limit - actual, 0);
+}
+
+void CacheManager::IncrementIgnitionCycles() {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const int ign_val = static_cast<int>(
+ *pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
+ (*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) =
+ ign_val + 1;
+ LOG4CXX_DEBUG(logger_, "IncrementIgnitionCycles ignitions:" << ign_val);
+ Backup();
+}
+
+void CacheManager::ResetIgnitionCycles() {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ (*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) = 0;
+ Backup();
+}
+
+int CacheManager::TimeoutResponse() {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return pt_->policy_table.module_config.timeout_after_x_seconds *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter =
+ pt_->policy_table.module_config.seconds_between_retries.begin();
+ rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter_end =
+ pt_->policy_table.module_config.seconds_between_retries.end();
+
+ const std::size_t size =
+ pt_->policy_table.module_config.seconds_between_retries.size();
+ seconds.reserve(size);
+ for (; iter != iter_end; ++iter) {
+ seconds.push_back(*iter);
+ }
+ return true;
+}
+
+const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
+ CACHE_MANAGER_CHECK(VehicleInfo());
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
+ VehicleInfo vehicle_info;
+ vehicle_info.vehicle_make = *module_config.vehicle_make;
+ vehicle_info.vehicle_model = *module_config.vehicle_model;
+ vehicle_info.vehicle_year = *module_config.vehicle_year;
+ LOG4CXX_DEBUG(
+ logger_,
+ "Vehicle info (make, model, year):" << vehicle_info.vehicle_make << ","
+ << vehicle_info.vehicle_model << ","
+ << vehicle_info.vehicle_year);
+ return vehicle_info;
+}
+
+std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language,
+ const std::string& active_hmi_language) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<UserFriendlyMessage> result;
+ CACHE_MANAGER_CHECK(result);
+
+ std::vector<std::string>::const_iterator it = msg_codes.begin();
+ std::vector<std::string>::const_iterator it_end = msg_codes.end();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ for (; it != it_end; ++it) {
+ policy_table::MessageLanguages msg_languages =
+ (*pt_->policy_table.consumer_friendly_messages->messages)[*it];
+
+ // If message has no records with required language, fallback language
+ // should be used instead.
+ policy_table::MessageString message_string =
+ FindLanguage(msg_languages, language);
+
+ if (!message_string.is_valid()) {
+ LOG4CXX_WARN(logger_,
+ "Language "
+ << language
+ << " haven't been found for message code: " << *it);
+ policy_table::MessageString active_hmi_language_message_string =
+ FindLanguage(msg_languages, active_hmi_language);
+ if (!active_hmi_language_message_string.is_valid()) {
+ LOG4CXX_WARN(logger_,
+ "Active hmi language "
+ << active_hmi_language
+ << " haven't been found for message code: " << *it);
+
+ policy_table::MessageString fallback_message_string =
+ FindLanguage(msg_languages, "en-us");
+ if (!fallback_message_string.is_valid()) {
+ LOG4CXX_ERROR(logger_,
+ "No fallback language found for message code: " << *it);
+ continue;
+ }
+ message_string = fallback_message_string;
+ }
+ message_string = active_hmi_language_message_string;
+ }
+
+ UserFriendlyMessage msg;
+ msg.message_code = *it;
+ msg.tts = *message_string.tts;
+ msg.label = *message_string.label;
+ msg.line1 = *message_string.line1;
+ msg.line2 = *message_string.line2;
+ msg.text_body = *message_string.textBody;
+
+ result.push_back(msg);
+ }
+ return result;
+}
+
+void CacheManager::GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) {
+ std::stringstream service_type_stream;
+ service_type_stream << (service_type <= 9 ? "0x0" : "0x") << service_type;
+
+ const std::string service_type_str = service_type_stream.str();
+ GetUpdateUrls(service_type_str, out_end_points);
+}
+
+void CacheManager::GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+
+ LOG4CXX_DEBUG(logger_, "Search service value is: " << service_type);
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ServiceEndpoints::const_iterator iter =
+ pt_->policy_table.module_config.endpoints.find(service_type);
+
+ if (pt_->policy_table.module_config.endpoints.end() != iter) {
+ policy_table::URLList::const_iterator url_list_iter =
+ (*iter).second.begin();
+ policy_table::URLList::const_iterator url_list_iter_end =
+ (*iter).second.end();
+ for (; url_list_iter != url_list_iter_end; ++url_list_iter) {
+ EndpointData data;
+ data.app_id = (*url_list_iter).first;
+ std::copy((*url_list_iter).second.begin(),
+ (*url_list_iter).second.end(),
+ std::back_inserter(data.url));
+
+ out_end_points.push_back(data);
+ }
+ }
+}
+
+std::string CacheManager::GetLockScreenIconUrl() const {
+ if (backup_) {
+ return backup_->GetLockScreenIconUrl();
+ }
+ return std::string("");
+}
+
+rpc::policy_table_interface_base::NumberOfNotificationsType
+CacheManager::GetNotificationsNumber(const std::string& priority) {
+ CACHE_MANAGER_CHECK(0);
+ typedef rpc::policy_table_interface_base::NumberOfNotificationsPerMinute NNPM;
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const NNPM& nnpm =
+ pt_->policy_table.module_config.notifications_per_minute_by_priority;
+
+ NNPM::const_iterator priority_iter = nnpm.find(priority);
+
+ const uint32_t result =
+ (nnpm.end() != priority_iter ? (*priority_iter).second : 0);
+ return result;
+}
+
+bool CacheManager::GetPriority(const std::string& policy_app_id,
+ std::string& priority) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ 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_section.apps;
+
+ 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);
+ }
+
+ return app_id_exists;
+}
+
+void CacheManager::CheckSnapshotInitialization() {
+ CACHE_MANAGER_CHECK_VOID();
+ if (!snapshot_) {
+ LOG4CXX_ERROR(logger_, "Snapshot pointer is not initialized");
+ return;
+ }
+
+ *(snapshot_->policy_table.module_config.preloaded_pt) = false;
+
+ // SDL must not send certificate in snapshot
+ snapshot_->policy_table.module_config.certificate =
+ rpc::Optional<rpc::String<0, 65535> >();
+
+ snapshot_->policy_table.consumer_friendly_messages->messages =
+ rpc::Optional<policy_table::Messages>();
+
+ rpc::Optional<policy_table::ModuleMeta>& module_meta =
+ snapshot_->policy_table.module_meta;
+ if (!module_meta->pt_exchanged_at_odometer_x->is_initialized()) {
+ *(module_meta->pt_exchanged_at_odometer_x) = 0;
+ }
+ if (!module_meta->ignition_cycles_since_last_exchange->is_initialized()) {
+ *(module_meta->ignition_cycles_since_last_exchange) = 0;
+ }
+
+ if (!module_meta->pt_exchanged_x_days_after_epoch->is_initialized()) {
+ *(module_meta->pt_exchanged_x_days_after_epoch) = 0;
+ }
+
+ rpc::Optional<policy_table::UsageAndErrorCounts>& usage_and_error_counts =
+ snapshot_->policy_table.usage_and_error_counts;
+ if (!usage_and_error_counts->count_of_iap_buffer_full->is_initialized()) {
+ *(usage_and_error_counts->count_of_iap_buffer_full) = 0;
+ }
+
+ if (!usage_and_error_counts->count_of_sync_reboots->is_initialized()) {
+ *(usage_and_error_counts->count_of_sync_reboots) = 0;
+ }
+
+ if (!usage_and_error_counts->count_sync_out_of_memory->is_initialized()) {
+ *(usage_and_error_counts->count_sync_out_of_memory) = 0;
+ }
+
+ if (usage_and_error_counts->app_level->is_initialized()) {
+ policy_table::AppLevels::iterator it =
+ usage_and_error_counts->app_level->begin();
+ policy_table::AppLevels::const_iterator it_end =
+ usage_and_error_counts->app_level->end();
+ for (; it != it_end; ++it) {
+ if (!(*it).second.minutes_in_hmi_full.is_initialized()) {
+ (*it).second.minutes_in_hmi_full = 0;
+ }
+
+ if (!(*it).second.app_registration_language_gui.is_initialized()) {
+ (*it).second.app_registration_language_gui = "unknown";
+ }
+
+ if (!(*it).second.app_registration_language_vui.is_initialized()) {
+ (*it).second.app_registration_language_vui = "unknown";
+ }
+
+ if (!(*it).second.minutes_in_hmi_limited.is_initialized()) {
+ (*it).second.minutes_in_hmi_limited = 0;
+ }
+
+ if (!(*it).second.minutes_in_hmi_background.is_initialized()) {
+ (*it).second.minutes_in_hmi_background = 0;
+ }
+
+ if (!(*it).second.minutes_in_hmi_none.is_initialized()) {
+ (*it).second.minutes_in_hmi_none = 0;
+ }
+
+ if (!(*it).second.count_of_user_selections.is_initialized()) {
+ (*it).second.count_of_user_selections = 0;
+ }
+
+ if (!(*it)
+ .second.count_of_rejections_sync_out_of_memory
+ .is_initialized()) {
+ (*it).second.count_of_rejections_sync_out_of_memory = 0;
+ }
+
+ if (!(*it)
+ .second.count_of_rejections_nickname_mismatch.is_initialized()) {
+ (*it).second.count_of_rejections_nickname_mismatch = 0;
+ }
+
+ if (!(*it).second.count_of_rejections_duplicate_name.is_initialized()) {
+ (*it).second.count_of_rejections_duplicate_name = 0;
+ }
+
+ if (!(*it).second.count_of_rejected_rpc_calls.is_initialized()) {
+ (*it).second.count_of_rejected_rpc_calls = 0;
+ }
+
+ if (!(*it).second.count_of_rpcs_sent_in_hmi_none.is_initialized()) {
+ (*it).second.count_of_rpcs_sent_in_hmi_none = 0;
+ }
+
+ if (!(*it).second.count_of_removals_for_bad_behavior.is_initialized()) {
+ (*it).second.count_of_removals_for_bad_behavior = 0;
+ }
+
+ if (!(*it).second.count_of_tls_errors.is_initialized()) {
+ (*it).second.count_of_tls_errors = 0;
+ }
+
+ if (!(*it).second.count_of_run_attempts_while_revoked.is_initialized()) {
+ (*it).second.count_of_run_attempts_while_revoked = 0;
+ }
+ }
+ }
+}
+
+void CacheManager::PersistData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (backup_.valid()) {
+ if (pt_.valid()) {
+ // Comma expression is used to hold the lock only during the constructor
+ // call
+ policy_table::Table copy_pt(
+ (sync_primitives::AutoLock(cache_lock_), *pt_));
+ 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;
+
+ for (; app_policy_iter != app_policy_iter_end; ++app_policy_iter) {
+ const std::string app_id = (*app_policy_iter).first;
+
+ if (IsApplicationRepresented(app_id)) {
+ is_revoked =
+ copy_pt.policy_table.app_policies_section.apps[app_id].is_null();
+ }
+
+ const bool kIsDefaultPolicy =
+ IsApplicationRepresented(app_id) &&
+ policy::kDefaultId ==
+ copy_pt.policy_table.app_policies_section.apps[app_id]
+ .get_string();
+
+ // TODO(AOleynik): Remove this field from DB
+ const bool kIsPredataPolicy =
+ IsApplicationRepresented(app_id) &&
+ policy::kPreDataConsentId ==
+ copy_pt.policy_table.app_policies_section.apps[app_id]
+ .get_string();
+
+ backup_->SaveApplicationCustomData(
+ app_id, is_revoked, kIsDefaultPolicy, kIsPredataPolicy);
+ is_revoked = false;
+ }
+
+ // In case of extended policy the meta info should be backuped as well.
+ if (ex_backup_.valid()) {
+ ex_backup_->SetMetaInfo(
+ *(*copy_pt.policy_table.module_meta).ccpu_version,
+ *(*copy_pt.policy_table.module_meta).wers_country_code,
+ *(*copy_pt.policy_table.module_meta).language);
+ ex_backup_->SetVINValue(*(*copy_pt.policy_table.module_meta).vin);
+
+ // Save unpaired flag for devices
+ policy_table::DeviceData::const_iterator it_device =
+ copy_pt.policy_table.device_data->begin();
+ policy_table::DeviceData::const_iterator it_end_device =
+ copy_pt.policy_table.device_data->end();
+
+#ifdef ENABLE_LOG
+ policy_table::DeviceData& device_data =
+ *copy_pt.policy_table.device_data;
+ LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size());
+#endif // ENABLE_LOG
+ for (; it_device != it_end_device; ++it_device) {
+ if (is_unpaired_.end() != is_unpaired_.find(it_device->first)) {
+ ex_backup_->SetUnpairedDevice(it_device->first, true);
+ } else {
+ ex_backup_->SetUnpairedDevice(it_device->first, false);
+ }
+ }
+ LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size());
+ }
+ backup_->WriteDb();
+ }
+ }
+}
+
+void CacheManager::ResetCalculatedPermissions() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(calculated_permissions_lock_);
+ calculated_permissions_.clear();
+}
+
+void CacheManager::ResetCalculatedPermissionsForDevice(
+ const std::string& device_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(calculated_permissions_lock_);
+ calculated_permissions_.erase(device_id);
+}
+
+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;
+}
+
+utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+ CACHE_MANAGER_CHECK(snapshot_);
+ snapshot_ = new policy_table::Table();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ snapshot_->policy_table = pt_->policy_table;
+
+ snapshot_->SetPolicyTableType(policy_table::PT_SNAPSHOT);
+
+ CheckSnapshotInitialization();
+ return snapshot_;
+}
+
+bool CacheManager::GetInitialAppData(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+
+ 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(app_hmi_types),
+ AppHMITypeToString());
+ }
+ return true;
+}
+
+bool CacheManager::GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::FunctionalGroupings& f_groupings =
+ pt_->policy_table.functional_groupings;
+
+ groups.insert(f_groupings.begin(), f_groupings.end());
+ return true;
+}
+
+int CacheManager::CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ LOG4CXX_DEBUG(logger_, "Application id: " << policy_app_id);
+ int result = 0;
+ if (kDeviceId != policy_app_id && !IsApplicationRepresented(policy_app_id)) {
+ return 0;
+ } else if (IsDefaultPolicy(policy_app_id)) {
+ return 0;
+ } else if (IsPredataPolicy(policy_app_id)) {
+ return 0;
+ }
+
+ sync_primitives::AutoLock lock(cache_lock_);
+ policy_table::FunctionalGroupings::const_iterator groups_iter_end =
+ pt_->policy_table.functional_groupings.end();
+
+ policy_table::ApplicationPoliciesSection& app_policies_section =
+ pt_->policy_table.app_policies_section;
+
+ policy_table::Strings::iterator app_groups;
+ policy_table::Strings::iterator app_groups_end = app_groups;
+ policy_table::Strings::iterator app_pre_groups;
+ policy_table::Strings::iterator app_pre_groups_end = app_pre_groups;
+
+ if (kDeviceId == policy_app_id) {
+ app_groups = app_policies_section.device.groups.begin();
+
+ app_groups_end = app_policies_section.device.groups.end();
+
+ app_pre_groups = app_policies_section.device.preconsented_groups->begin();
+
+ app_pre_groups_end = app_policies_section.device.preconsented_groups->end();
+ } else {
+ app_groups = app_policies_section.apps[policy_app_id].groups.begin();
+
+ app_groups_end = app_policies_section.apps[policy_app_id].groups.end();
+
+ app_pre_groups =
+ app_policies_section.apps[policy_app_id].preconsented_groups->begin();
+
+ app_pre_groups_end =
+ app_policies_section.apps[policy_app_id].preconsented_groups->end();
+ }
+
+ policy_table::Strings groups_to_be_consented;
+ policy_table::FunctionalGroupings::iterator current_groups_iter;
+ for (; app_groups != app_groups_end; ++app_groups) {
+ current_groups_iter =
+ pt_->policy_table.functional_groupings.find(*app_groups);
+
+ if (groups_iter_end != current_groups_iter) {
+ if (current_groups_iter->second.user_consent_prompt.is_initialized()) {
+ // Check if groups which requires user consent prompt
+ // not included in "preconsented_groups" section
+ if (app_pre_groups_end ==
+ std::find(app_pre_groups, app_pre_groups_end, *app_groups)) {
+ groups_to_be_consented.push_back(*app_groups);
+ }
+ }
+ }
+ }
+
+ if (groups_to_be_consented.empty()) {
+ return 0;
+ }
+
+ // If there is no device record, all groups with consents should be consented
+ if (pt_->policy_table.device_data->end() ==
+ pt_->policy_table.device_data->find(device_id)) {
+ return groups_to_be_consented.size();
+ }
+
+ policy_table::DeviceParams& params =
+ (*pt_->policy_table.device_data)[device_id];
+
+ policy_table::UserConsentRecords& ucr = *(params.user_consent_records);
+
+ // If there is no application record, all groups with consents should be
+ // consented
+ if (ucr.end() == ucr.find(policy_app_id)) {
+ return groups_to_be_consented.size();
+ }
+
+ policy_table::ConsentRecords& cgr = ucr[policy_app_id];
+
+ policy_table::Strings::const_iterator to_consent_it =
+ groups_to_be_consented.begin();
+
+ for (; to_consent_it != groups_to_be_consented.end(); ++to_consent_it) {
+ policy_table::ConsentGroups::const_iterator already_consented_iter =
+ cgr.consent_groups->find(*to_consent_it);
+ if (already_consented_iter == cgr.consent_groups->end()) {
+ ++result;
+ }
+ }
+
+ return result;
+}
+
+bool CacheManager::SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ *pt_->policy_table.module_meta->ccpu_version = ccpu_version;
+ *pt_->policy_table.module_meta->wers_country_code = wers_country_code;
+ *pt_->policy_table.module_meta->language = language;
+
+ // 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;
+}
+
+bool CacheManager::IsMetaInfoPresent() const {
+ CACHE_MANAGER_CHECK(false);
+ bool result = true;
+ sync_primitives::AutoLock lock(cache_lock_);
+ result = NULL != pt_->policy_table.module_meta->ccpu_version &&
+ NULL != pt_->policy_table.module_meta->wers_country_code &&
+ NULL != pt_->policy_table.module_meta->language;
+ return result;
+}
+
+bool CacheManager::SetSystemLanguage(const std::string& language) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
+ *pt_->policy_table.module_meta->language = language;
+ Backup();
+ return true;
+}
+
+bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames& names) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
+ pt_->policy_table.functional_groupings.begin();
+ rpc::policy_table_interface_base::FunctionalGroupings::iterator iter_end =
+ pt_->policy_table.functional_groupings.end();
+
+ for (; iter != iter_end; ++iter) {
+ const int32_t id = utils::Djb2HashFromString((*iter).first);
+ std::pair<std::string, std::string> value =
+ std::make_pair(*(*iter).second.user_consent_prompt, (*iter).first);
+
+ names.insert(
+ std::pair<uint32_t, std::pair<std::string, std::string> >(id, value));
+ }
+ return true;
+}
+
+bool CacheManager::CleanupUnpairedDevices() {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
+ sync_primitives::AutoLock lock_unpaired(unpaired_lock_);
+ UnpairedDevices::iterator iter = is_unpaired_.begin();
+ UnpairedDevices::const_iterator iter_end = is_unpaired_.end();
+ LOG4CXX_DEBUG(logger_, "Is_unpaired size is: " << is_unpaired_.size());
+ for (; iter != iter_end; ++iter) {
+ // Delete device
+ if (!pt_->policy_table.device_data.is_initialized()) {
+ LOG4CXX_ERROR(logger_, "Device_data section is not initialized.");
+ return false;
+ }
+ policy_table::DeviceData& device_data = *pt_->policy_table.device_data;
+ policy_table::DeviceData::iterator it_device = device_data.find(*iter);
+ if (device_data.end() == it_device) {
+ LOG4CXX_INFO(logger_,
+ "No device id "
+ << *iter << " had been found in device_data section.");
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size());
+ device_data.erase(it_device);
+ LOG4CXX_INFO(logger_,
+ "Device id " << *iter
+ << " had been deleted from device_data section.");
+ LOG4CXX_DEBUG(logger_, "Device_data size is: " << device_data.size());
+ }
+ is_unpaired_.clear();
+ Backup();
+ return true;
+}
+
+void CacheManager::Increment(usage_statistics::GlobalCounterId type) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock lock(cache_lock_);
+ switch (type) {
+ case usage_statistics::IAP_BUFFER_FULL:
+ ++(*pt_->policy_table.usage_and_error_counts->count_of_iap_buffer_full);
+ break;
+ case usage_statistics::SYNC_OUT_OF_MEMORY:
+ ++(*pt_->policy_table.usage_and_error_counts->count_sync_out_of_memory);
+ break;
+ case usage_statistics::SYNC_REBOOTS:
+ ++(*pt_->policy_table.usage_and_error_counts->count_of_sync_reboots);
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Type global counter is unknown");
+ return;
+ }
+ Backup();
+}
+
+void CacheManager::Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock lock(cache_lock_);
+ switch (type) {
+ case usage_statistics::USER_SELECTIONS:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_user_selections;
+ break;
+ case usage_statistics::REJECTIONS_SYNC_OUT_OF_MEMORY:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejections_sync_out_of_memory;
+ break;
+ case usage_statistics::REJECTIONS_NICKNAME_MISMATCH:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejections_nickname_mismatch;
+ break;
+ case usage_statistics::REJECTIONS_DUPLICATE_NAME:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejections_duplicate_name;
+ break;
+ case usage_statistics::REJECTED_RPC_CALLS:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejected_rpc_calls;
+ break;
+ case usage_statistics::RPCS_IN_HMI_NONE:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rpcs_sent_in_hmi_none;
+ break;
+ case usage_statistics::REMOVALS_MISBEHAVED:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_removals_for_bad_behavior;
+ break;
+ case usage_statistics::RUN_ATTEMPTS_WHILE_REVOKED:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_run_attempts_while_revoked;
+ break;
+ case usage_statistics::COUNT_OF_TLS_ERRORS:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_tls_errors;
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Type app counter is unknown");
+ return;
+ }
+ Backup();
+}
+
+void CacheManager::Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock lock(cache_lock_);
+ switch (type) {
+ case usage_statistics::LANGUAGE_GUI:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .app_registration_language_gui = value;
+ break;
+ case usage_statistics::LANGUAGE_VUI:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .app_registration_language_vui = value;
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Type app info is unknown");
+ return;
+ }
+ Backup();
+}
+
+void CacheManager::Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int seconds) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock lock(cache_lock_);
+ const int minutes = ConvertSecondsToMinute(seconds);
+ switch (type) {
+ case usage_statistics::SECONDS_HMI_FULL:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_full += minutes;
+ break;
+ case usage_statistics::SECONDS_HMI_LIMITED:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_limited += minutes;
+ break;
+ case usage_statistics::SECONDS_HMI_BACKGROUND:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_background += minutes;
+ break;
+ case usage_statistics::SECONDS_HMI_NONE:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_none += minutes;
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Type app stopwatch is unknown");
+ return;
+ }
+ Backup();
+}
+
+long CacheManager::ConvertSecondsToMinute(int seconds) {
+ const float seconds_in_minute = 60.0;
+ return std::round(seconds / seconds_in_minute);
+}
+
+bool CacheManager::SetDefaultPolicy(const std::string& app_id) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
+ auto& apps = pt_->policy_table.app_policies_section.apps;
+
+ DCHECK_OR_RETURN(IsApplicationRepresented(kDefaultId), false);
+
+ apps[app_id] = apps[kDefaultId];
+ apps[app_id].set_to_string(kDefaultId);
+ Backup();
+ return true;
+}
+
+bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const bool result =
+ IsApplicationRepresented(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) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (IsApplicationRepresented(app_id)) {
+ pt_->policy_table.app_policies_section.apps[app_id].set_to_string(
+ kDefaultId);
+ }
+ return true;
+}
+
+bool policy::CacheManager::SetIsPredata(const std::string& app_id) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
+ if (IsApplicationRepresented(app_id)) {
+ pt_->policy_table.app_policies_section.apps[app_id].set_to_string(
+ kPreDataConsentId);
+ }
+
+ return true;
+}
+
+bool CacheManager::SetPredataPolicy(const std::string& app_id) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator iter =
+ pt_->policy_table.app_policies_section.apps.find(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;
+ }
+
+ pt_->policy_table.app_policies_section.apps[app_id] =
+ pt_->policy_table.app_policies_section.apps[kPreDataConsentId];
+
+ pt_->policy_table.app_policies_section.apps[app_id].set_to_string(
+ kPreDataConsentId);
+
+ Backup();
+ return true;
+}
+
+bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (!IsApplicationRepresented(app_id)) {
+ return false;
+ }
+ return kPreDataConsentId ==
+ pt_->policy_table.app_policies_section.apps[app_id].get_string();
+}
+
+bool CacheManager::SetUnpairedDevice(const std::string& device_id,
+ bool unpaired) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ 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;
+ }
+
+ 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 result;
+}
+
+bool CacheManager::SetVINValue(const std::string& value) {
+ CACHE_MANAGER_CHECK(false);
+ {
+ sync_primitives::AutoLock lock(cache_lock_);
+ *pt_->policy_table.module_meta->vin = value;
+ }
+ Backup();
+ return true;
+}
+
+bool CacheManager::IsApplicationRepresented(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator 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,
+ const PolicySettings* settings) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ settings_ = settings;
+ InitResult init_result = backup_->Init(settings);
+ ex_backup_ = utils::SharedPtr<PTRepresentation>::dynamic_pointer_cast<
+ PTExtRepresentation>(backup_);
+
+ bool result = true;
+ switch (init_result) {
+ case InitResult::EXISTS: {
+ LOG4CXX_INFO(logger_, "Policy Table exists, was loaded correctly.");
+ result = LoadFromBackup();
+ if (result) {
+ if (!backup_->IsDBVersionActual()) {
+ if (!backup_->RefreshDB()) {
+ return false;
+ }
+ backup_->UpdateDBVersion();
+ Backup();
+ }
+ if (!MergePreloadPT(file_name)) {
+ result = false;
+ }
+ }
+ } break;
+ case InitResult::SUCCESS: {
+ LOG4CXX_INFO(logger_, "Policy Table was inited successfully");
+ result = LoadFromFile(file_name, *pt_);
+ utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
+
+ result &= snapshot->is_valid();
+ LOG4CXX_DEBUG(logger_,
+ "Check if snapshot valid: " << std::boolalpha << result);
+
+ if (result) {
+ backup_->UpdateDBVersion();
+ Backup();
+ *pt_->policy_table.module_config.preloaded_pt = true;
+ } else {
+ rpc::ValidationReport report("policy_table");
+ snapshot->ReportErrors(&report);
+ ex_backup_->RemoveDB();
+ }
+ } break;
+ default: {
+ result = false;
+ LOG4CXX_ERROR(logger_, "Failed to init policy table.");
+ } break;
+ }
+
+ return result;
+}
+
+void CacheManager::FillDeviceSpecificData() {
+ DeviceIds unpaired_ids;
+ ex_backup_->UnpairedDevicesList(&unpaired_ids);
+ sync_primitives::AutoLock lock(unpaired_lock_);
+ is_unpaired_.clear();
+ for (DeviceIds::const_iterator ids_iter = unpaired_ids.begin();
+ ids_iter != unpaired_ids.end();
+ ++ids_iter) {
+ is_unpaired_.insert(*ids_iter);
+ }
+}
+
+void CacheManager::MakeLowerCaseAppNames(policy_table::Table& pt) const {
+ policy_table::ApplicationPolicies& apps =
+ pt.policy_table.app_policies_section.apps;
+ for (policy_table::ApplicationPolicies::iterator iter = apps.begin();
+ iter != apps.end();) {
+ std::string key = iter->first;
+ if (key == kDefaultId || key == kPreDataConsentId || key == kDeviceId) {
+ ++iter;
+ continue;
+ }
+
+ std::transform(key.begin(), key.end(), key.begin(), ::tolower);
+ if (key.compare(iter->first) != 0) {
+ std::swap(apps[key], iter->second);
+ iter = apps.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
+}
+
+bool CacheManager::LoadFromBackup() {
+ sync_primitives::AutoLock lock(cache_lock_);
+ pt_ = backup_->GenerateSnapshot();
+ update_required = backup_->UpdateRequired();
+
+ FillDeviceSpecificData();
+
+ return true;
+}
+
+bool CacheManager::LoadFromFile(const std::string& file_name,
+ policy_table::Table& table) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Loading policy table from file " << file_name);
+ BinaryMessage json_string;
+ if (!file_system::ReadBinaryFile(file_name, json_string)) {
+ LOG4CXX_FATAL(logger_, "Failed to read policy table source file.");
+ return false;
+ }
+
+ Json::Value value;
+ Json::Reader reader(Json::Features::strictMode());
+ std::string json(json_string.begin(), json_string.end());
+ if (!reader.parse(json.c_str(), value)) {
+ LOG4CXX_FATAL(
+ logger_,
+ "Preloaded PT is corrupted: " << reader.getFormattedErrorMessages());
+ return false;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Start verification of policy table loaded from file.");
+
+ sync_primitives::AutoLock locker(cache_lock_);
+ table = policy_table::Table(&value);
+
+#ifdef ENABLE_LOG
+ Json::StyledWriter s_writer;
+ LOG4CXX_DEBUG(
+ logger_,
+ "Policy table content loaded:" << s_writer.write(table.ToJsonValue()));
+#endif // ENABLE_LOG
+
+ MakeLowerCaseAppNames(table);
+
+ if (!table.is_valid()) {
+ rpc::ValidationReport report("policy_table");
+ table.ReportErrors(&report);
+ LOG4CXX_FATAL(logger_,
+ "Parsed table is not valid " << rpc::PrettyFormat(report));
+ return false;
+ }
+ return true;
+}
+
+bool CacheManager::ResetPT(const std::string& file_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ is_unpaired_.clear();
+ if (!backup_->RefreshDB()) {
+ LOG4CXX_ERROR(logger_, "Can't re-create policy database. Reset failed.");
+ return false;
+ }
+ sync_primitives::AutoLock lock(cache_lock_);
+ pt_.reset(new policy_table::Table());
+ const bool result = LoadFromFile(file_name, *pt_);
+ if (result) {
+ Backup();
+ *pt_->policy_table.module_config.preloaded_pt = true;
+ }
+ 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();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (kDeviceId == policy_app_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Request types not applicable for app_id " << kDeviceId);
+ return;
+ }
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == policy_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request types for app_id " << policy_app_id);
+ return;
+ }
+ if (policy_iter->second.RequestType.is_initialized()) {
+ policy_table::RequestTypes::iterator it_request_type =
+ policy_iter->second.RequestType->begin();
+ for (; it_request_type != policy_iter->second.RequestType->end();
+ ++it_request_type) {
+ request_types.push_back(EnumToJsonString(*it_request_type));
+ }
+ }
+ return;
+}
+
+const MetaInfo CacheManager::GetMetaInfo() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ MetaInfo meta_info;
+ meta_info.ccpu_version = *pt_->policy_table.module_meta->ccpu_version;
+ meta_info.wers_country_code =
+ *pt_->policy_table.module_meta->wers_country_code;
+ meta_info.language = *pt_->policy_table.module_meta->language;
+ return meta_info;
+}
+
+std::string CacheManager::GetCertificate() const {
+ CACHE_MANAGER_CHECK(std::string(""));
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (pt_->policy_table.module_config.certificate.is_initialized()) {
+ return *pt_->policy_table.module_config.certificate;
+ }
+ return std::string("");
+}
+
+void CacheManager::SetDecryptedCertificate(const std::string& certificate) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ *pt_->policy_table.module_config.certificate = certificate;
+ Backup();
+}
+
+bool CacheManager::SetExternalConsentStatus(
+ const ExternalConsentStatus& status) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (status.empty()) {
+ LOG4CXX_INFO(logger_, "No ExternalConsent status update.");
+ return false;
+ }
+
+ return ex_backup_->SaveExternalConsentStatus(status);
+}
+
+ExternalConsentStatus CacheManager::GetExternalConsentStatus() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return ex_backup_->GetExternalConsentStatus();
+}
+
+ExternalConsentStatus CacheManager::GetExternalConsentEntities() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ ExternalConsentStatus items;
+ for (policy_table::FunctionalGroupings::const_iterator it =
+ pt_->policy_table.functional_groupings.begin();
+ it != pt_->policy_table.functional_groupings.end();
+ ++it) {
+ policy_table::DisallowedByExternalConsentEntities::const_iterator it_1 =
+ (*it->second.disallowed_by_external_consent_entities_on).begin();
+ for (;
+ it_1 != (*it->second.disallowed_by_external_consent_entities_on).end();
+ ++it_1) {
+ items.insert(ExternalConsentStatusItem(
+ it_1->entity_type, it_1->entity_id, EntityStatus::kStatusOn));
+ }
+ policy_table::DisallowedByExternalConsentEntities::const_iterator it_2 =
+ (*it->second.disallowed_by_external_consent_entities_off).begin();
+ for (; it_2 !=
+ (*it->second.disallowed_by_external_consent_entities_off).end();
+ ++it_2) {
+ items.insert(ExternalConsentStatusItem(
+ it_2->entity_type, it_2->entity_id, EntityStatus::kStatusOff));
+ }
+ }
+ return items;
+}
+
+GroupsByExternalConsentStatus CacheManager::GetGroupsWithSameEntities(
+ const ExternalConsentStatus& status) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(policy::GroupsByExternalConsentStatus());
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ GroupsByExternalConsentStatus groups_by_external_consent;
+
+ GroupByExternalConsentItemFinder groups_by_external_consent_finder(
+ pt_->policy_table.functional_groupings, groups_by_external_consent);
+ std::for_each(
+ status.begin(), status.end(), groups_by_external_consent_finder);
+
+ return groups_by_external_consent;
+}
+
+std::map<std::string, std::string> CacheManager::GetKnownLinksFromPT() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK((std::map<std::string, std::string>()));
+ std::map<std::string, std::string> links;
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ LinkCollector collector(links);
+ std::for_each(pt_->policy_table.device_data->begin(),
+ pt_->policy_table.device_data->end(),
+ collector);
+
+ return links;
+}
+
+bool CacheManager::ConsentsSame(
+ const policy_table::ConsentGroups& external_consent_groups,
+ const PermissionConsent& permissions) const {
+ const std::vector<FunctionalGroupPermission>& group_permissions =
+ permissions.group_permissions;
+
+ std::vector<FunctionalGroupPermission>::const_iterator it_gp =
+ group_permissions.begin();
+
+ for (; group_permissions.end() != it_gp; ++it_gp) {
+ const policy_table::ConsentGroups::value_type value = std::make_pair(
+ it_gp->group_name, rpc::Boolean(it_gp->state == kGroupAllowed));
+
+ const bool is_found = external_consent_groups.end() !=
+ std::find(external_consent_groups.begin(),
+ external_consent_groups.end(),
+ value);
+
+ if (!is_found) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void CacheManager::SetExternalConsentForApp(
+ const PermissionConsent& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ConsentGroups& external_consent_groups =
+ *(*(*pt_->policy_table.device_data)[permissions.device_id]
+ .user_consent_records)[permissions.policy_app_id]
+ .external_consent_status_groups;
+
+ if (ConsentsSame(external_consent_groups, permissions)) {
+ LOG4CXX_DEBUG(logger_, "External consents already have same values.");
+ return;
+ }
+
+ external_consent_groups.clear();
+
+ ExternalConsentConsentGroupAppender appender;
+ std::transform(
+ permissions.group_permissions.begin(),
+ permissions.group_permissions.end(),
+ std::inserter(external_consent_groups, external_consent_groups.begin()),
+ appender);
+
+ policy_table::ConsentRecords& app_consent_records =
+ (*(*pt_->policy_table.device_data)[permissions.device_id]
+ .user_consent_records)[permissions.policy_app_id];
+
+ const TimevalStruct tm = date_time::DateTime::getCurrentTime();
+ int64_t current_time_msec = date_time::DateTime::getmSecs(tm);
+ app_consent_records.ext_consent_last_updated = current_time_msec;
+ LOG4CXX_DEBUG(logger_, "Updating consents time " << current_time_msec);
+
+ Backup();
+}
+
+bool CacheManager::MergePreloadPT(const std::string& file_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::Table table;
+ if (!LoadFromFile(file_name, table)) {
+ LOG4CXX_DEBUG(logger_, "Unable to load preloaded PT.");
+ return false;
+ }
+
+ sync_primitives::AutoLock lock(cache_lock_);
+ policy_table::PolicyTable& current = pt_->policy_table;
+ policy_table::PolicyTable& new_table = table.policy_table;
+ const std::string date_current = *current.module_config.preloaded_date;
+ const std::string date_new = *new_table.module_config.preloaded_date;
+ if (date_current != date_new) {
+ MergeMC(new_table, current);
+ MergeFG(new_table, current);
+ MergeAP(new_table, current);
+ MergeCFM(new_table, current);
+ Backup();
+ }
+ return true;
+}
+
+void CacheManager::MergeMC(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::ModuleConfig copy(pt.module_config);
+
+ pt.module_config = new_pt.module_config;
+ pt.module_config.vehicle_make = copy.vehicle_make;
+ pt.module_config.vehicle_year = copy.vehicle_year;
+ pt.module_config.vehicle_model = copy.vehicle_model;
+}
+
+void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::FunctionalGroupings::const_iterator it =
+ new_pt.functional_groupings.begin();
+
+ for (; it != new_pt.functional_groupings.end(); ++it) {
+ LOG4CXX_DEBUG(logger_, "Merge functional group: " << it->first);
+ pt.functional_groupings[it->first] = it->second;
+ }
+}
+
+void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>(
+ new_pt).app_policies_section.device;
+
+ pt.app_policies_section.apps[kDefaultId] =
+ const_cast<policy_table::PolicyTable&>(new_pt)
+ .app_policies_section.apps[kDefaultId];
+
+ pt.app_policies_section.apps[kPreDataConsentId] =
+ const_cast<policy_table::PolicyTable&>(new_pt)
+ .app_policies_section.apps[kPreDataConsentId];
+}
+
+void CacheManager::MergeCFM(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (new_pt.consumer_friendly_messages.is_initialized()) {
+ if (!pt.consumer_friendly_messages.is_initialized()) {
+ pt.consumer_friendly_messages = new_pt.consumer_friendly_messages;
+ } else {
+ policy_table::Messages::const_iterator it =
+ new_pt.consumer_friendly_messages->messages->begin();
+
+ pt.consumer_friendly_messages->version =
+ new_pt.consumer_friendly_messages->version;
+ for (; it != new_pt.consumer_friendly_messages->messages->end(); ++it) {
+ LOG4CXX_DEBUG(logger_, "Merge CFM: " << it->first);
+ if (!(pt.consumer_friendly_messages->messages.is_initialized())) {
+ LOG4CXX_DEBUG(logger_, "CFM not initialized.");
+ }
+ (*pt.consumer_friendly_messages->messages)[it->first] = it->second;
+ }
+ }
+ }
+}
+
+void CacheManager::InitBackupThread() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ backuper_ = new BackgroundBackuper(this);
+ backup_thread_ = threads::CreateThread("Backup thread", backuper_);
+ backup_thread_->start();
+}
+
+const PolicySettings& CacheManager::get_settings() const {
+ DCHECK(settings_);
+
+ return *settings_;
+}
+
+void CacheManager::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ auto device_data = *(pt_->policy_table.device_data);
+
+ auto from = pt_->policy_table.device_data->find(device_id_from);
+ DCHECK_OR_RETURN_VOID(from != device_data.end());
+
+ auto to = pt_->policy_table.device_data->find(device_id_to);
+ DCHECK_OR_RETURN_VOID(to != device_data.end());
+
+ auto& consents_from = *(from->second.user_consent_records);
+ auto& consents_to = *(to->second.user_consent_records);
+
+ LOG4CXX_DEBUG(logger_,
+ "Merging user consents from device: "
+ << device_id_from << " to device: " << device_id_to);
+ for (auto f = consents_from.begin(); f != consents_from.end(); ++f) {
+ const auto app_id = f->first;
+ LOG4CXX_DEBUG(logger_, "Updating permissions for key: " << app_id);
+ consents_to[app_id] = f->second;
+ }
+}
+
+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_) {
+ {
+ sync_primitives::AutoUnlock need_backup_lock(need_backup_lock_);
+ InternalBackup();
+ }
+ 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/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc
new file mode 100644
index 0000000000..5425777833
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -0,0 +1,904 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <sstream>
+#include <string.h>
+#include "utils/logger.h"
+#include "utils/custom_string.h"
+#include "policy/policy_helper.h"
+#include "policy/policy_manager_impl.h"
+
+namespace policy {
+
+namespace custom_str = utils::custom_string;
+
+namespace {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+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 {
+ explicit CheckGroupName(const policy::StringsValueType& value)
+ : value_(value) {}
+
+ bool operator()(const FunctionalGroupNames::value_type& value) const {
+ 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) {}
+
+bool CompareGroupName::operator()(
+ const StringsValueType& group_name_to_compare) const {
+ const std::string gn_ = group_name_;
+ const std::string gn_compare = group_name_to_compare;
+ return !(strcasecmp(gn_.c_str(), gn_compare.c_str()));
+}
+
+bool operator!=(const policy_table::ApplicationParams& first,
+ const policy_table::ApplicationParams& second) {
+ if (first.groups.size() != second.groups.size()) {
+ return true;
+ }
+ StringsConstItr it_first = first.groups.begin();
+ StringsConstItr it_first_end = first.groups.end();
+ StringsConstItr it_second = second.groups.begin();
+ StringsConstItr it_second_end = second.groups.end();
+ for (; it_first != it_first_end; ++it_first) {
+ CompareGroupName gp(*it_first);
+ StringsConstItr it = std::find_if(it_second, it_second_end, gp);
+ if (it_first_end == it) {
+ return true;
+ }
+ }
+ return false;
+}
+
+CheckAppPolicy::CheckAppPolicy(
+ PolicyManagerImpl* pm,
+ const utils::SharedPtr<policy_table::Table> update,
+ const utils::SharedPtr<policy_table::Table> snapshot,
+ CheckAppPolicyResults& out_results)
+ : pm_(pm)
+ , update_(update)
+ , snapshot_(snapshot)
+ , out_results_(out_results) {}
+
+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);
+
+ 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);
+
+ 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 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);
+
+ if (new_groups) {
+ *new_groups = new_group_list;
+ }
+
+ 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;
+ }
+
+ 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;
+ }
+ }
+
+ return false;
+}
+
+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>();
+ }
+
+ 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 revoked_groups_permissions;
+}
+
+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_section.apps;
+
+ return !(current_policies.end() == current_policies.find(application_id));
+}
+
+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 AppPoliciesValueType& app_policy) const {
+ const std::string& app_id = app_policy.first;
+ const custom_str::CustomString app_name = pm_->listener()->GetAppName(app_id);
+ if (!app_name.empty() && app_policy.second.nicknames &&
+ !app_policy.second.nicknames->empty()) {
+ for (policy_table::Strings::const_iterator it =
+ app_policy.second.nicknames->begin();
+ app_policy.second.nicknames->end() != it;
+ ++it) {
+ std::string temp = *it;
+ if (app_name.CompareIgnoreCase(temp.c_str())) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
+void CheckAppPolicy::AddResult(const std::string& app_id,
+ PermissionsCheckResult result) {
+ out_results_.insert(std::make_pair(app_id, result));
+}
+
+bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
+ const std::string app_id = app_policy.first;
+
+ if (!IsKnownAppication(app_id)) {
+ LOG4CXX_WARN(logger_,
+ "Application:" << app_id << " is not present in snapshot.");
+ return true;
+ }
+
+ if (!IsPredefinedApp(app_policy) && IsAppRevoked(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_APP_REVOKED);
+ AddResult(app_id, RESULT_APP_REVOKED);
+ return true;
+ }
+
+ if (!IsPredefinedApp(app_policy) && !NicknamesMatch(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_NICKNAME_MISMATCH);
+ AddResult(app_id, RESULT_NICKNAME_MISMATCH);
+ return true;
+ }
+
+ PermissionsCheckResult result = CheckPermissionsChanges(app_policy);
+
+ if (!IsPredefinedApp(app_policy) && IsRequestTypeChanged(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_REQUEST_TYPE_CHANGED);
+ AddResult(app_id, RESULT_REQUEST_TYPE_CHANGED);
+ }
+
+ if (RESULT_NO_CHANGES == result) {
+ LOG4CXX_INFO(logger_,
+ "Permissions for application:" << app_id
+ << " wasn't changed.");
+ AddResult(app_id, result);
+ return true;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "Permissions for application:" << app_id
+ << " have been changed.");
+
+ if (!IsPredefinedApp(app_policy)) {
+ SetPendingPermissions(app_policy, result);
+ AddResult(app_id, result);
+ }
+
+ return true;
+}
+
+void policy::CheckAppPolicy::SetPendingPermissions(
+ const AppPoliciesValueType& app_policy,
+ PermissionsCheckResult result) const {
+ using namespace rpc::policy_table_interface_base;
+ const std::string app_id = app_policy.first;
+ AppPermissions permissions_diff(app_id);
+
+ const std::string priority =
+ policy_table::EnumToJsonString(app_policy.second.priority);
+ const std::string current_prio = EnumToJsonString(
+ snapshot_->policy_table.app_policies_section.apps[app_id].priority);
+
+ bool need_send_priority = (current_prio != priority);
+
+ switch (result) {
+ case RESULT_APP_REVOKED:
+ need_send_priority = false;
+ permissions_diff.appRevoked = true;
+ break;
+ case RESULT_NICKNAME_MISMATCH:
+ need_send_priority = false;
+ permissions_diff.appUnauthorized = true;
+ break;
+ case RESULT_PERMISSIONS_REVOKED:
+ permissions_diff.priority = priority;
+ permissions_diff.isAppPermissionsRevoked = true;
+ permissions_diff.appRevokedPermissions = GetRevokedGroups(app_policy);
+ RemoveRevokedConsents(app_policy, permissions_diff.appRevokedPermissions);
+ break;
+ case RESULT_CONSENT_NEEDED:
+ permissions_diff.priority = priority;
+ permissions_diff.appPermissionsConsentNeeded = true;
+ break;
+ case RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED:
+ permissions_diff.priority = priority;
+ 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.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;
+ }
+
+ if (need_send_priority) {
+ permissions_diff.priority = priority;
+ }
+
+ pm_->app_permissions_diff_lock_.Acquire();
+ pm_->app_permissions_diff_.insert(std::make_pair(app_id, permissions_diff));
+ pm_->app_permissions_diff_lock_.Release();
+}
+
+PermissionsCheckResult CheckAppPolicy::CheckPermissionsChanges(
+ 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;
+ }
+
+ bool is_preconsented = false;
+ policy_table::Strings::value_type str(group_name);
+ policy_table::Strings::iterator pre_begin =
+ update_->policy_table.app_policies_section.apps[app_id]
+ .preconsented_groups->begin();
+ policy_table::Strings::iterator pre_end =
+ update_->policy_table.app_policies_section.apps[app_id]
+ .preconsented_groups->end();
+
+ policy_table::Strings::iterator it2 = std::find(pre_begin, pre_end, str);
+
+ is_preconsented = pre_end != it2;
+
+ 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();
+}
+
+void FillActionsForAppPolicies::operator()(
+ const policy::CheckAppPolicyResults::value_type& value) {
+ const std::string app_id = value.first;
+ const policy_table::ApplicationPolicies::const_iterator app_policy =
+ app_policies_.find(app_id);
+
+ if (app_policies_.end() == app_policy) {
+ return;
+ }
+
+ if (IsPredefinedApp(*app_policy)) {
+ return;
+ }
+
+ switch (value.second) {
+ case RESULT_APP_REVOKED:
+ case RESULT_NICKNAME_MISMATCH:
+ actions_[app_id].is_notify_system = true;
+ return;
+ case RESULT_CONSENT_NEEDED:
+ case RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED:
+ actions_[app_id].is_consent_needed = true;
+ break;
+ case RESULT_CONSENT_NOT_REQIURED:
+ case RESULT_PERMISSIONS_REVOKED:
+ case RESULT_REQUEST_TYPE_CHANGED:
+ break;
+ case RESULT_NO_CHANGES:
+ default:
+ return;
+ }
+ actions_[app_id].is_notify_system = true;
+ actions_[app_id].is_send_permissions_to_app = true;
+}
+
+FillNotificationData::FillNotificationData(Permissions& data,
+ GroupConsent group_state,
+ GroupConsent undefined_group_consent,
+ bool does_require_user_consent)
+ : data_(data), does_require_user_consent_(does_require_user_consent) {
+ switch (group_state) {
+ case kGroupAllowed:
+ current_key_ = kAllowedKey;
+ break;
+ case kGroupUndefined:
+ if (kGroupUndefined == undefined_group_consent) {
+ current_key_ = kUndefinedKey;
+ break;
+ }
+ current_key_ = kGroupAllowed == undefined_group_consent
+ ? kAllowedKey
+ : kUserDisallowedKey;
+ break;
+ default:
+ current_key_ = kUserDisallowedKey;
+ break;
+ }
+}
+
+bool FillNotificationData::operator()(const RpcValueType& rpc) {
+ Permissions::iterator it = data_.find(rpc.first);
+ // If rpc is present already - update its permissions
+ if (data_.end() != it) {
+ UpdateHMILevels(rpc.second.hmi_levels, (*it).second.hmi_permissions);
+ UpdateParameters(*rpc.second.parameters,
+ (*it).second.parameter_permissions);
+ ExcludeSame(it->second);
+ } else {
+ // Init mandatory keys, since they should be present irrespectively of
+ // values presence
+ InitRpcKeys(rpc.first);
+ // If rpc is not present - add its permissions
+ UpdateHMILevels(rpc.second.hmi_levels, data_[rpc.first].hmi_permissions);
+ UpdateParameters(*rpc.second.parameters,
+ data_[rpc.first].parameter_permissions);
+ }
+ return true;
+}
+
+void FillNotificationData::UpdateHMILevels(
+ const policy_table::HmiLevels& in_hmi, HMIPermissions& out_hmi) {
+ HMILevelsConstItr it_hmi_levels = in_hmi.begin();
+ HMILevelsConstItr it_hmi_levels_end = in_hmi.end();
+
+ for (; it_hmi_levels != it_hmi_levels_end; ++it_hmi_levels) {
+ out_hmi[current_key_].insert(
+ policy_table::EnumToJsonString(*it_hmi_levels));
+ }
+}
+
+void FillNotificationData::UpdateParameters(
+ const policy_table::Parameters& in_parameters,
+ ParameterPermissions& out_parameter) {
+ ParametersConstItr it_parameters = in_parameters.begin();
+ ParametersConstItr it_parameters_end = in_parameters.end();
+
+ // Due to APPLINK-24201 SDL must consider cases when 'parameters' section is
+ // not present for RPC or present, but is empty.
+
+ // If 'parameters' section is like: 'parameters' : []
+ if (in_parameters.is_initialized() && in_parameters.empty()) {
+ if (!does_require_user_consent_) {
+ out_parameter.any_parameter_disallowed_by_policy = true;
+ }
+ if (does_require_user_consent_ && kAllowedKey == current_key_) {
+ out_parameter.any_parameter_disallowed_by_user = true;
+ }
+ }
+
+ // If 'parameters' section is omitted
+ if (!in_parameters.is_initialized()) {
+ if (!does_require_user_consent_) {
+ out_parameter.any_parameter_allowed = true;
+ }
+ if (does_require_user_consent_ && kAllowedKey == current_key_) {
+ out_parameter.any_parameter_allowed = true;
+ }
+ }
+
+ for (; it_parameters != it_parameters_end; ++it_parameters) {
+ out_parameter[current_key_].insert(
+ policy_table::EnumToJsonString(*it_parameters));
+ }
+}
+
+void FillNotificationData::ExcludeSame(RpcPermissions& rpc) {
+ HMIPermissions::const_iterator it_hmi_allowed =
+ rpc.hmi_permissions.find(kAllowedKey);
+ HMIPermissions::const_iterator it_hmi_undefined =
+ rpc.hmi_permissions.find(kUndefinedKey);
+ HMIPermissions::const_iterator it_hmi_user_disallowed =
+ rpc.hmi_permissions.find(kUserDisallowedKey);
+
+ // There is different logic of processing RPCs with and w/o 'parameters'
+ if (RpcParametersEmpty(rpc)) {
+ // First, remove disallowed from other types
+ if (rpc.hmi_permissions.end() != it_hmi_user_disallowed) {
+ if (rpc.hmi_permissions.end() != it_hmi_allowed) {
+ ExcludeSameHMILevels(rpc.hmi_permissions[kAllowedKey],
+ rpc.hmi_permissions[kUserDisallowedKey]);
+ }
+ if (rpc.hmi_permissions.end() != it_hmi_undefined) {
+ ExcludeSameHMILevels(rpc.hmi_permissions[kUndefinedKey],
+ rpc.hmi_permissions[kUserDisallowedKey]);
+ }
+ }
+
+ // Then, remove undefined from allowed
+ if (rpc.hmi_permissions.end() != it_hmi_undefined) {
+ if (rpc.hmi_permissions.end() != it_hmi_allowed) {
+ ExcludeSameHMILevels(rpc.hmi_permissions[kAllowedKey],
+ rpc.hmi_permissions[kUndefinedKey]);
+ }
+ }
+
+ return;
+ }
+
+ ParameterPermissions::const_iterator it_parameter_allowed =
+ rpc.parameter_permissions.find(kAllowedKey);
+ ParameterPermissions::const_iterator it_parameter_undefined =
+ rpc.parameter_permissions.find(kUndefinedKey);
+ ParameterPermissions::const_iterator it_parameter_user_disallowed =
+ rpc.parameter_permissions.find(kUserDisallowedKey);
+
+ // First, removing allowed HMI levels from other types, permissions will be
+ // dependent on parameters instead of HMI levels since w/o parameters RPC
+ // won't passed to HMI
+ if (rpc.hmi_permissions.end() != it_hmi_allowed) {
+ if (rpc.hmi_permissions.end() != it_hmi_user_disallowed) {
+ ExcludeSameHMILevels(rpc.hmi_permissions[kUserDisallowedKey],
+ rpc.hmi_permissions[kAllowedKey]);
+ }
+ if (rpc.hmi_permissions.end() != it_hmi_undefined) {
+ ExcludeSameHMILevels(rpc.hmi_permissions[kUndefinedKey],
+ rpc.hmi_permissions[kAllowedKey]);
+ }
+ }
+
+ // Removing disallowed parameters from allowed and undefined (by user consent)
+ if (rpc.parameter_permissions.end() != it_parameter_user_disallowed) {
+ if (rpc.parameter_permissions.end() != it_parameter_allowed) {
+ ExcludeSameParameters(rpc.parameter_permissions[kAllowedKey],
+ rpc.parameter_permissions[kUserDisallowedKey]);
+ }
+ if (rpc.parameter_permissions.end() != it_parameter_undefined) {
+ ExcludeSameParameters(rpc.parameter_permissions[kUndefinedKey],
+ rpc.parameter_permissions[kUserDisallowedKey]);
+ }
+ }
+
+ // Removing undefined (by user consent) parameters from allowed
+ if (rpc.parameter_permissions.end() != it_parameter_undefined) {
+ if (rpc.parameter_permissions.end() != it_parameter_allowed) {
+ ExcludeSameParameters(rpc.parameter_permissions[kAllowedKey],
+ rpc.parameter_permissions[kUndefinedKey]);
+ }
+ }
+}
+
+void FillNotificationData::ExcludeSameHMILevels(
+ std::set<HMILevel>& source, const std::set<HMILevel>& target) {
+ std::set<HMILevel> diff_hmi;
+
+ std::set_difference(source.begin(),
+ source.end(),
+ target.begin(),
+ target.end(),
+ std::inserter(diff_hmi, diff_hmi.begin()));
+
+ source = diff_hmi;
+}
+
+void FillNotificationData::ExcludeSameParameters(
+ std::set<Parameter>& source, const std::set<Parameter>& target) {
+ std::set<Parameter> diff_parameter;
+
+ std::set_difference(source.begin(),
+ source.end(),
+ target.begin(),
+ target.end(),
+ std::inserter(diff_parameter, diff_parameter.begin()));
+
+ source = diff_parameter;
+}
+
+void FillNotificationData::InitRpcKeys(const std::string& rpc_name) {
+ data_[rpc_name].hmi_permissions[kAllowedKey];
+ data_[rpc_name].hmi_permissions[kUserDisallowedKey];
+ data_[rpc_name].parameter_permissions[kAllowedKey];
+ data_[rpc_name].parameter_permissions[kUserDisallowedKey];
+}
+
+bool FillNotificationData::RpcParametersEmpty(RpcPermissions& rpc) {
+ const bool no_allowed_parameters =
+ IsSectionEmpty(rpc.parameter_permissions, kAllowedKey);
+ const bool no_user_disallowed_parameters =
+ IsSectionEmpty(rpc.parameter_permissions, kUserDisallowedKey);
+ const bool no_undefined_parameters =
+ IsSectionEmpty(rpc.parameter_permissions, kUndefinedKey);
+
+ return no_allowed_parameters && no_undefined_parameters &&
+ no_user_disallowed_parameters;
+}
+
+bool FillNotificationData::IsSectionEmpty(ParameterPermissions& permissions,
+ const std::string& section) {
+ ParameterPermissions::const_iterator it_section = permissions.find(section);
+ ParameterPermissions::const_iterator end = permissions.end();
+ if (end != it_section) {
+ return permissions[section].empty();
+ }
+ return true;
+}
+
+ProcessFunctionalGroup::ProcessFunctionalGroup(
+ const policy_table::FunctionalGroupings& fg,
+ const std::vector<FunctionalGroupPermission>& group_permissions,
+ Permissions& data,
+ GroupConsent undefined_group_consent)
+ : fg_(fg)
+ , group_permissions_(group_permissions)
+ , data_(data)
+ , undefined_group_consent_(undefined_group_consent) {}
+
+bool ProcessFunctionalGroup::operator()(const StringsValueType& group_name) {
+ const std::string group_name_str = group_name;
+ FuncGroupConstItr it = fg_.find(group_name_str);
+ const bool does_require_user_consent =
+ it->second.user_consent_prompt.is_initialized();
+
+ if (fg_.end() != it) {
+ const policy_table::Rpc& rpcs = (*it).second.rpcs;
+ FillNotificationData filler(data_,
+ GetGroupState(group_name_str),
+ undefined_group_consent_,
+ does_require_user_consent);
+ std::for_each(rpcs.begin(), rpcs.end(), filler);
+ }
+ return true;
+}
+
+GroupConsent ProcessFunctionalGroup::GetGroupState(
+ const std::string& group_name) {
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ group_permissions_.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ group_permissions_.end();
+ for (; it != it_end; ++it) {
+ if (group_name == (*it).group_name) {
+ return (*it).state;
+ }
+ }
+ return kGroupUndefined;
+}
+
+FunctionalGroupInserter::FunctionalGroupInserter(
+ const policy_table::Strings& preconsented_groups, PermissionsList& list)
+ : list_(list), preconsented_(preconsented_groups) {}
+
+void FunctionalGroupInserter::operator()(const StringsValueType& group_name) {
+ CompareGroupName name(group_name);
+ if (std::find_if(preconsented_.begin(), preconsented_.end(), name) ==
+ preconsented_.end()) {
+ list_.push_back(group_name);
+ }
+}
+
+void FillFunctionalGroupPermissions(
+ FunctionalGroupIDs& ids,
+ FunctionalGroupNames& names,
+ GroupConsent state,
+ std::vector<FunctionalGroupPermission>& permissions) {
+ LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
+ FunctionalGroupIDs::const_iterator it = ids.begin();
+ FunctionalGroupIDs::const_iterator it_end = ids.end();
+ for (; it != it_end; ++it) {
+ FunctionalGroupPermission current_group;
+ current_group.group_id = *it;
+ current_group.group_alias = names[*it].first;
+ current_group.group_name = names[*it].second;
+ current_group.state = state;
+ permissions.push_back(current_group);
+ }
+}
+
+bool IsPredefinedApp(const AppPoliciesValueType& app) {
+ return app.first == kDefaultId || app.first == kPreDataConsentId ||
+ app.first == kDeviceId;
+}
+
+FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
+ const FunctionalGroupIDs& what) {
+ LOG4CXX_INFO(logger_, "Exclude same groups");
+ FunctionalGroupIDs from_copy(from);
+ FunctionalGroupIDs what_copy(what);
+
+ std::sort(from_copy.begin(), from_copy.end());
+ std::sort(what_copy.begin(), what_copy.end());
+
+ FunctionalGroupIDs no_same;
+ std::set_difference(from_copy.begin(),
+ from_copy.end(),
+ what_copy.begin(),
+ what_copy.end(),
+ std::back_inserter(no_same));
+
+ no_same.resize(std::distance(no_same.begin(),
+ std::unique(no_same.begin(), no_same.end())));
+
+ return no_same;
+}
+
+FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second) {
+ LOG4CXX_INFO(logger_, "Merge groups");
+ FunctionalGroupIDs first_copy(first);
+ FunctionalGroupIDs second_copy(second);
+
+ std::sort(first_copy.begin(), first_copy.end());
+ std::sort(second_copy.begin(), second_copy.end());
+
+ FunctionalGroupIDs merged;
+ std::set_union(first_copy.begin(),
+ first_copy.end(),
+ second_copy.begin(),
+ second_copy.end(),
+ std::back_inserter(merged));
+
+ merged.resize(
+ std::distance(merged.begin(), std::unique(merged.begin(), merged.end())));
+
+ return merged;
+}
+
+FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second) {
+ LOG4CXX_INFO(logger_, "Find same groups");
+ FunctionalGroupIDs first_copy(first);
+ FunctionalGroupIDs second_copy(second);
+
+ std::sort(first_copy.begin(), first_copy.end());
+ std::sort(second_copy.begin(), second_copy.end());
+
+ FunctionalGroupIDs same;
+ std::set_intersection(first_copy.begin(),
+ first_copy.end(),
+ second_copy.begin(),
+ second_copy.end(),
+ std::back_inserter(same));
+
+ same.resize(
+ std::distance(same.begin(), std::unique(same.begin(), same.end())));
+
+ return same;
+}
+
+bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) {
+ policy_table::ApplicationPolicies::iterator it_default =
+ app_policies.find(kDefaultId);
+ if (app_policies.end() == it_default) {
+ LOG4CXX_ERROR(logger_, "No default application policy found in PTU.");
+ return false;
+ }
+
+ policy_table::ApplicationPolicies::iterator it = app_policies.begin();
+ for (; app_policies.end() != it; ++it) {
+ // Set default policies for app, if there is record like "123":"default"
+ if (kDefaultId.compare((*it).second.get_string()) == 0) {
+ (*it).second = (*it_default).second;
+ it->second.set_to_string(kDefaultId);
+ }
+ }
+
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
new file mode 100644
index 0000000000..806b7e13ba
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -0,0 +1,2038 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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/policy_manager_impl.h"
+
+#include <algorithm>
+#include <set>
+#include <queue>
+#include <iterator>
+#include <limits>
+#include <vector>
+#include <functional>
+#include "json/reader.h"
+#include "json/writer.h"
+#include "policy/policy_table.h"
+#include "policy/pt_representation.h"
+#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"
+#include "utils/make_shared.h"
+
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
+#endif // SDL_REMOTE_CONTROL
+
+policy::PolicyManager* CreateManager() {
+ return new policy::PolicyManagerImpl();
+}
+void DeleteManager(policy::PolicyManager* pm) {
+ delete pm;
+}
+namespace {
+
+/**
+ * @brief Extracts group name from group permission structure
+ */
+struct GroupNamesAppender
+ : public std::unary_function<void,
+ const policy::FunctionalGroupPermission&> {
+ GroupNamesAppender(policy_table::Strings& names) : names_(names) {}
+
+ void operator()(const policy::FunctionalGroupPermission& value) {
+ names_.push_back(value.group_name);
+ }
+
+ private:
+ policy_table::Strings& names_;
+};
+
+/**
+ * @brief Updates permission state of input group permission value in case
+ * group name is found within allowed or disallowed groups lists considering
+ * current priorities of consents
+ * Also collects matched groups names to separate collection for futher
+ * processing
+ */
+struct ConsentsUpdater
+ : public std::unary_function<void, policy::FunctionalGroupPermission&> {
+ ConsentsUpdater(const policy::GroupsNames& allowed,
+ const policy::GroupsNames& disallowed,
+ std::vector<policy::FunctionalGroupPermission>&
+ out_external_consent_matches,
+ const policy::ConsentPriorityType prio)
+ : allowed_(allowed)
+ , disallowed_(disallowed)
+ , out_external_consent_matches_(out_external_consent_matches)
+ , prio_(prio) {}
+
+ void operator()(policy::FunctionalGroupPermission& value) {
+ if (helpers::in_range(disallowed_, value.group_name)) {
+ policy::FunctionalGroupPermission external_consent = value;
+ external_consent.state = policy::kGroupDisallowed;
+ out_external_consent_matches_.push_back(external_consent);
+
+ if (IsAllowedToChangedUserConsent(value.state)) {
+ value.state = policy::kGroupDisallowed;
+ }
+ return;
+ }
+
+ if (helpers::in_range(allowed_, value.group_name)) {
+ policy::FunctionalGroupPermission external_consent = value;
+ external_consent.state = policy::kGroupAllowed;
+ out_external_consent_matches_.push_back(external_consent);
+
+ if (IsAllowedToChangedUserConsent(value.state)) {
+ value.state = policy::kGroupAllowed;
+ }
+ }
+ }
+
+ private:
+ bool IsAllowedToChangedUserConsent(
+ policy::GroupConsent current_consent) const {
+ if (policy::GroupConsent::kGroupUndefined == current_consent) {
+ return true;
+ }
+
+ return policy::ConsentPriorityType::kUserConsentPrio != prio_;
+ }
+
+ const policy::GroupsNames& allowed_;
+ const policy::GroupsNames& disallowed_;
+ std::vector<policy::FunctionalGroupPermission>& out_external_consent_matches_;
+ const policy::ConsentPriorityType prio_;
+};
+
+/**
+ * @brief Checks whether ExternalConsent entity status is the same as name of
+ * group
+ * container where entity has been found in. In case of match group is added to
+ * 'disallowed' list, otherwise - to 'allowed' one.
+ * E.g. if entity has "ON" status and is found in
+ * 'disallowed_by_external_consent_entities_on' it will be added to
+ * 'disallowed'. If it has
+ * been found in 'disallowed_by_external_consent_entities_off' than group is
+ * added to
+ * 'allowed' list.
+ */
+struct GroupChecker
+ : std::unary_function<
+ void,
+ policy::GroupsByExternalConsentStatus::mapped_type::value_type> {
+ GroupChecker(const policy::EntityStatus entity_status,
+ policy::GroupsNames& out_allowed,
+ policy::GroupsNames& out_disallowed)
+ : entity_status_(entity_status)
+ , out_allowed_(out_allowed)
+ , out_disallowed_(out_disallowed) {}
+
+ void operator()(
+ const policy::GroupsByExternalConsentStatus::mapped_type::value_type
+ value) {
+ using namespace policy;
+
+ const std::string group_name = value.first;
+
+ if ((value.second && (kStatusOn == entity_status_)) ||
+ (!value.second && (kStatusOff == entity_status_))) {
+ out_disallowed_.insert(group_name);
+ } else {
+ out_allowed_.insert(group_name);
+ }
+ }
+
+ private:
+ const policy::EntityStatus entity_status_;
+ policy::GroupsNames& out_allowed_;
+ policy::GroupsNames& out_disallowed_;
+};
+
+/**
+ * @brief Sorts groups for 'allowed' and 'disallowed' by ExternalConsent
+ * entities statuses.
+ * Wraps GroupChecker logic.
+ */
+struct GroupSorter
+ : std::unary_function<
+ void,
+ const policy::GroupsByExternalConsentStatus::value_type&> {
+ GroupSorter(policy::GroupsNames& out_allowed,
+ policy::GroupsNames& out_disallowed)
+ : out_allowed_(out_allowed), out_disallowed_(out_disallowed) {}
+
+ void operator()(
+ const policy::GroupsByExternalConsentStatus::value_type& value) {
+ GroupChecker checker(value.first.status_, out_allowed_, out_disallowed_);
+ std::for_each(value.second.begin(), value.second.end(), checker);
+ }
+
+ private:
+ policy::GroupsNames& out_allowed_;
+ policy::GroupsNames& out_disallowed_;
+};
+
+} // namespace
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+PolicyManagerImpl::PolicyManagerImpl()
+ : PolicyManager()
+ , listener_(NULL)
+ , cache_(new CacheManager)
+#ifdef SDL_REMOTE_CONTROL
+ , access_remote_(new AccessRemoteImpl(
+ CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
+#endif // SDL_REMOTE_CONTROL
+ , retry_sequence_timeout_(60)
+ , retry_sequence_index_(0)
+ , ignition_check(true)
+ , retry_sequence_url_(0, 0, "") {
+}
+
+PolicyManagerImpl::PolicyManagerImpl(bool in_memory)
+ : PolicyManager()
+ , listener_(NULL)
+ , cache_(new CacheManager(in_memory))
+#ifdef SDL_REMOTE_CONTROL
+ , access_remote_(new AccessRemoteImpl(
+ CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
+#endif // SDL_REMOTE_CONTROL
+ , retry_sequence_timeout_(60)
+ , retry_sequence_index_(0)
+ , ignition_check(true)
+ , retry_sequence_url_(0, 0, "")
+ , wrong_ptu_update_received_(false)
+ , send_on_update_sent_out_(false)
+ , trigger_ptu_(false) {
+}
+
+void PolicyManagerImpl::set_listener(PolicyListener* listener) {
+ listener_ = listener;
+ update_status_manager_.set_listener(listener);
+}
+
+utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
+ const BinaryMessage& pt_content) {
+ std::string json(pt_content.begin(), pt_content.end());
+ Json::Value value;
+ Json::Reader reader;
+ if (reader.parse(json.c_str(), value)) {
+ return new policy_table::Table(&value);
+ } else {
+ return utils::SharedPtr<policy_table::Table>();
+ }
+}
+
+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_days
+ << "\nIgnition cycles exceeded: " << std::boolalpha
+ << exceed_ignition_cycles);
+
+ if (exceed_ignition_cycles || exceed_days) {
+ update_status_manager_.ScheduleUpdate();
+ }
+}
+
+std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
+ return cache_->GetLockScreenIconUrl();
+}
+
+bool PolicyManagerImpl::LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) {
+ LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
+
+ // Parse message into table struct
+ utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
+ if (!pt_update) {
+ LOG4CXX_WARN(logger_, "Parsed table pointer is NULL.");
+ update_status_manager_.OnWrongUpdateReceived();
+ return false;
+ }
+
+ file_system::DeleteFile(file);
+
+ if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
+ wrong_ptu_update_received_ = true;
+ update_status_manager_.OnWrongUpdateReceived();
+ return false;
+ }
+
+ update_status_manager_.OnValidUpdateReceived();
+ cache_->SaveUpdateRequired(false);
+
+ {
+ sync_primitives::AutoLock lock(apps_registration_lock_);
+
+ // Get current DB data, since it could be updated during awaiting of PTU
+ utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ cache_->GenerateSnapshot();
+ if (!policy_table_snapshot) {
+ LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
+ return false;
+ }
+
+ // 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.
+ CheckAppPolicyResults results =
+ 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;
+ }
+
+ ExternalConsentStatus status = cache_->GetExternalConsentStatus();
+ GroupsByExternalConsentStatus groups_by_status =
+ cache_->GetGroupsWithSameEntities(status);
+
+ ProcessExternalConsentStatusUpdate(
+ groups_by_status, ConsentProcessingPolicy::kExternalConsentBased);
+
+ ProcessAppPolicyCheckResults(
+ results, pt_update->policy_table.app_policies_section.apps);
+
+ listener_->OnCertificateUpdated(
+ *(pt_update->policy_table.module_config.certificate));
+
+ 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_, "app_hmi_types empty");
+ }
+ }
+
+ // 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;
+}
+
+CheckAppPolicyResults PolicyManagerImpl::CheckPermissionsChanges(
+ const utils::SharedPtr<policy_table::Table> pt_update,
+ const utils::SharedPtr<policy_table::Table> snapshot) {
+ LOG4CXX_INFO(logger_, "Checking incoming permissions.");
+
+ // 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);
+
+ CheckAppPolicyResults out_results;
+ 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, out_results));
+
+ return out_results;
+}
+
+void PolicyManagerImpl::ProcessAppPolicyCheckResults(
+ const CheckAppPolicyResults& results,
+ const policy_table::ApplicationPolicies& app_policies) {
+ ApplicationsPoliciesActions actions_for_apps_policies;
+ FillActionsForAppPolicies filler(actions_for_apps_policies, app_policies);
+
+ std::for_each(results.begin(), results.end(), filler);
+
+ ProcessActionsForAppPolicies(actions_for_apps_policies, app_policies);
+}
+
+void PolicyManagerImpl::ProcessActionsForAppPolicies(
+ const ApplicationsPoliciesActions& actions,
+ const policy_table::ApplicationPolicies& app_policies) {
+ ApplicationsPoliciesActions::const_iterator it_actions = actions.begin();
+ for (; it_actions != actions.end(); ++it_actions) {
+ policy_table::ApplicationPolicies::const_iterator app_policy =
+ app_policies.find(it_actions->first);
+ if (app_policies.end() == app_policy) {
+ continue;
+ }
+
+ if (it_actions->second.is_consent_needed) {
+ // Post-check after ExternalConsent consent changes
+ const std::string& policy_app_id = app_policy->first;
+ if (!IsConsentNeeded(policy_app_id)) {
+ sync_primitives::AutoLock lock(app_permissions_diff_lock_);
+
+ PendingPermissions::iterator app_id_diff =
+ app_permissions_diff_.find(policy_app_id);
+
+ if (app_permissions_diff_.end() != app_id_diff) {
+ app_id_diff->second.appPermissionsConsentNeeded = false;
+ }
+ }
+ }
+ if (it_actions->second.is_notify_system) {
+ NotifySystem(*app_policy);
+ }
+ if (it_actions->second.is_send_permissions_to_app) {
+ SendPermissionsToApp(*app_policy);
+ }
+ }
+}
+
+void PolicyManagerImpl::PrepareNotificationData(
+ const policy_table::FunctionalGroupings& groups,
+ const policy_table::Strings& group_names,
+ const std::vector<FunctionalGroupPermission>& group_permission,
+ Permissions& notification_data) {
+ LOG4CXX_INFO(logger_, "Preparing data for notification.");
+ ProcessFunctionalGroup processor(groups, group_permission, notification_data);
+ std::for_each(group_names.begin(), group_names.end(), processor);
+}
+
+std::string PolicyManagerImpl::GetUpdateUrl(int service_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ EndpointUrls urls;
+ GetUpdateUrls(service_type, urls);
+
+ std::string url;
+ if (!urls.empty()) {
+ static uint32_t index = 0;
+
+ if (index >= urls.size()) {
+ index = 0;
+ }
+ url = urls[index].url.empty() ? "" : urls[index].url[0];
+
+ ++index;
+ } else {
+ LOG4CXX_ERROR(logger_, "The endpoint entry is empty");
+ }
+ return url;
+}
+
+void PolicyManagerImpl::GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->GetUpdateUrls(service_type, out_end_points);
+}
+void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->GetUpdateUrls(service_type, out_end_points);
+}
+
+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;
+ }
+
+ if (IsPTValid(policy_table_snapshot, policy_table::PT_SNAPSHOT)) {
+ Json::Value value = policy_table_snapshot->ToJsonValue();
+ Json::FastWriter writer;
+ std::string message_string = writer.write(value);
+
+ LOG4CXX_DEBUG(logger_, "Snapshot contents is : " << message_string);
+
+ BinaryMessage update(message_string.begin(), message_string.end());
+
+ listener_->OnSnapshotCreated(
+ update, RetrySequenceDelaysSeconds(), TimeoutExchangeMSec());
+ } else {
+ LOG4CXX_ERROR(logger_, "Invalid Policy table snapshot - PTUpdate failed");
+ }
+}
+
+void PolicyManagerImpl::StartPTExchange() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (ignition_check) {
+ CheckTriggers();
+ ignition_check = false;
+ }
+
+ if (update_status_manager_.IsAppsSearchInProgress() &&
+ update_status_manager_.IsUpdateRequired()) {
+ LOG4CXX_INFO(logger_,
+ "Starting exchange skipped, since applications "
+ "search is in progress.");
+ return;
+ }
+
+ if (update_status_manager_.IsUpdatePending()) {
+ if (trigger_ptu_) {
+ update_status_manager_.ScheduleUpdate();
+ }
+ LOG4CXX_INFO(logger_,
+ "Starting exchange skipped, since another exchange "
+ "is in progress.");
+ return;
+ }
+ LOG4CXX_INFO(logger_, "Policy want to call RequestPTUpdate");
+ if (listener_ && listener_->CanUpdate()) {
+ LOG4CXX_INFO(logger_, "Listener CanUpdate");
+ if (update_status_manager_.IsUpdateRequired()) {
+ LOG4CXX_INFO(logger_, "IsUpdateRequired");
+ RequestPTUpdate();
+ }
+ }
+}
+
+void PolicyManagerImpl::OnAppsSearchStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_manager_.OnAppsSearchStarted();
+}
+
+void PolicyManagerImpl::OnAppsSearchCompleted(const bool trigger_ptu) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_manager_.OnAppsSearchCompleted();
+
+ trigger_ptu_ = trigger_ptu;
+
+ 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;
+ if (kDeviceDisallowed ==
+ cache_->GetDeviceConsent(GetCurrentDeviceId(policy_app_id))) {
+ cache_->GetAppRequestTypes(kPreDataConsentId, request_types);
+ } else {
+ cache_->GetAppRequestTypes(policy_app_id, request_types);
+ }
+ return request_types;
+}
+
+const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
+ return cache_->GetVehicleInfo();
+}
+
+void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) {
+ LOG4CXX_INFO(logger_,
+ "CheckPermissions for " << app_id << " and rpc " << rpc
+ << " for " << hmi_level << " level.");
+
+ const std::string device_id = GetCurrentDeviceId(app_id);
+
+ Permissions rpc_permissions;
+
+ // Check, if there are calculated permission present in cache
+ if (!cache_->IsPermissionsCalculated(device_id, app_id, rpc_permissions)) {
+ LOG4CXX_DEBUG(logger_,
+ "IsPermissionsCalculated for device: "
+ << device_id << " and app: " << app_id
+ << " returns false");
+ // Get actual application group permission according to user consents
+ std::vector<FunctionalGroupPermission> app_group_permissions;
+ GetPermissionsForApp(device_id, app_id, app_group_permissions);
+
+ // Fill struct with known groups RPCs
+ policy_table::FunctionalGroupings functional_groupings;
+ cache_->GetFunctionalGroupings(functional_groupings);
+
+#ifdef SDL_REMOTE_CONTROL
+ ApplicationOnDevice who = {device_id, app_id};
+ const policy_table::Strings app_groups = access_remote_->GetGroups(who);
+#else // SDL_REMOTE_CONTROL
+ const policy_table::Strings app_groups =
+ GetGroupsNames(app_group_permissions);
+#endif // SDL_REMOTE_CONTROL
+
+ // Undefined groups (without user consent) disallowed by default, since
+ // OnPermissionsChange notification has no "undefined" section
+ // For RPC permission checking undefinded group will be treated as separate
+ // type
+ ProcessFunctionalGroup processor(functional_groupings,
+ app_group_permissions,
+ rpc_permissions,
+ GroupConsent::kGroupUndefined);
+ std::for_each(app_groups.begin(), app_groups.end(), processor);
+
+ cache_->AddCalculatedPermissions(device_id, app_id, rpc_permissions);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "IsPermissionsCalculated for device: "
+ << device_id << " and app: " << app_id
+ << " returns true");
+ }
+
+ const bool known_rpc = rpc_permissions.end() != rpc_permissions.find(rpc);
+ LOG4CXX_INFO(logger_, "Is known rpc " << known_rpc);
+ if (!known_rpc) {
+ // RPC not found in list == disallowed by backend
+ result.hmi_level_permitted = kRpcDisallowed;
+ return;
+ }
+
+ // Check HMI level
+ if (rpc_permissions[rpc].hmi_permissions[kAllowedKey].end() !=
+ rpc_permissions[rpc].hmi_permissions[kAllowedKey].find(hmi_level)) {
+ // RPC found in allowed == allowed by backend and user
+ result.hmi_level_permitted = kRpcAllowed;
+ } else if (rpc_permissions[rpc].hmi_permissions[kUndefinedKey].end() !=
+ rpc_permissions[rpc].hmi_permissions[kUndefinedKey].find(
+ hmi_level)) {
+ // RPC found in undefined == allowed by backend, but not consented yet by
+ // user
+ result.hmi_level_permitted = kRpcDisallowed;
+ } else if (rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].end() !=
+ rpc_permissions[rpc].hmi_permissions[kUserDisallowedKey].find(
+ hmi_level)) {
+ // RPC found in allowed == allowed by backend, but disallowed by user
+ result.hmi_level_permitted = kRpcUserDisallowed;
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "HMI level " << hmi_level << " wasn't found "
+ << " for rpc " << rpc << " and appID "
+ << app_id);
+ return;
+ }
+
+ if (kRpcAllowed != result.hmi_level_permitted) {
+ LOG4CXX_DEBUG(logger_, "RPC is not allowed. Stop parameters processing.");
+ result.list_of_allowed_params =
+ rpc_permissions[rpc].parameter_permissions[kAllowedKey];
+
+ result.list_of_disallowed_params =
+ rpc_permissions[rpc].parameter_permissions[kUserDisallowedKey];
+
+ result.list_of_undefined_params =
+ rpc_permissions[rpc].parameter_permissions[kUndefinedKey];
+ return;
+ }
+
+ // Considered that items disallowed by user take priority over system (policy)
+ // permissions, so that flag is processed first
+ if (rpc_permissions[rpc]
+ .parameter_permissions.any_parameter_disallowed_by_user) {
+ LOG4CXX_DEBUG(logger_, "All parameters are disallowed by user.");
+ result.list_of_disallowed_params = rpc_params;
+ result.hmi_level_permitted = kRpcUserDisallowed;
+ return;
+ }
+
+ if (rpc_permissions[rpc]
+ .parameter_permissions.any_parameter_disallowed_by_policy) {
+ LOG4CXX_DEBUG(logger_, "All parameters are disallowed by policy.");
+ result.list_of_undefined_params = rpc_params;
+ result.hmi_level_permitted = kRpcDisallowed;
+ return;
+ }
+
+ if (rpc_permissions[rpc].parameter_permissions.any_parameter_allowed) {
+ LOG4CXX_DEBUG(logger_, "All parameters are allowed.");
+ result.list_of_allowed_params = rpc_params;
+ return;
+ }
+
+ result.list_of_allowed_params =
+ rpc_permissions[rpc].parameter_permissions[kAllowedKey];
+
+ result.list_of_disallowed_params =
+ rpc_permissions[rpc].parameter_permissions[kUserDisallowedKey];
+
+ result.list_of_undefined_params =
+ rpc_permissions[rpc].parameter_permissions[kUndefinedKey];
+
+ // In case of some parameters of RPC are missing in current policy table
+ // they will be considered as disallowed by policy itself, not by user.
+ // Undefined parameters contain parameters present in policy table, but which
+ // have not been allowed or disallowed explicitly by user, so missing params
+ // are being added to undefined.
+ RPCParams::const_iterator parameter = rpc_params.begin();
+ RPCParams::const_iterator end = rpc_params.end();
+ for (; end != parameter; ++parameter) {
+ if (!result.HasParameter(*parameter)) {
+ LOG4CXX_DEBUG(logger_,
+ "Parameter " << *parameter << " is unknown."
+ " Adding to undefined list.");
+ result.list_of_undefined_params.insert(*parameter);
+ }
+ }
+
+ if (result.DisallowedInclude(rpc_params)) {
+ LOG4CXX_DEBUG(logger_, "All parameters are disallowed.");
+ result.hmi_level_permitted = kRpcUserDisallowed;
+ } else if (!result.IsAnyAllowed(rpc_params)) {
+ LOG4CXX_DEBUG(logger_, "There are no parameters allowed.");
+ result.hmi_level_permitted = kRpcDisallowed;
+ }
+
+ if (cache_->IsApplicationRevoked(app_id)) {
+ // SDL must be able to notify mobile side with its status after app has
+ // been revoked by backend
+ if ("OnHMIStatus" == rpc && "NONE" == hmi_level) {
+ result.hmi_level_permitted = kRpcAllowed;
+ } else {
+ result.hmi_level_permitted = kRpcDisallowed;
+ }
+ return;
+ }
+}
+
+bool PolicyManagerImpl::ResetUserConsent() {
+ return cache_->ResetUserConsent();
+}
+
+policy_table::Strings PolicyManagerImpl::GetGroupsNames(
+ const std::vector<FunctionalGroupPermission>& app_group_permissions) const {
+ policy_table::Strings app_groups;
+ GroupNamesAppender appender(app_groups);
+ std::for_each(
+ app_group_permissions.begin(), app_group_permissions.end(), appender);
+
+ return app_groups;
+}
+
+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 "
+ "'" << application_id << "'");
+ return;
+ }
+
+ std::vector<FunctionalGroupPermission> app_group_permissions;
+ GetPermissionsForApp(device_id, application_id, app_group_permissions);
+
+ policy_table::FunctionalGroupings functional_groupings;
+ cache_->GetFunctionalGroupings(functional_groupings);
+
+ policy_table::Strings app_groups = GetGroupsNames(app_group_permissions);
+
+ Permissions notification_data;
+ PrepareNotificationData(functional_groupings,
+ app_groups,
+ app_group_permissions,
+ notification_data);
+
+ LOG4CXX_INFO(logger_,
+ "Send notification for application_id:" << application_id);
+
+#ifdef SDL_REMOTE_CONTROL
+ const ApplicationOnDevice who = {device_id, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+ return;
+ }
+#endif // SDL_REMOTE_CONTROL
+
+ std::string default_hmi;
+ GetDefaultHmi(application_id, &default_hmi);
+
+ listener()->OnPermissionsUpdated(
+ application_id, notification_data, default_hmi);
+}
+
+bool PolicyManagerImpl::CleanupUnpairedDevices() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->CleanupUnpairedDevices();
+}
+
+DeviceConsent PolicyManagerImpl::GetUserConsentForDevice(
+ const std::string& device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetDeviceConsent(device_id);
+}
+
+void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device :" << device_id);
+ cache_->SetDeviceConsent(device_id, is_allowed);
+ if (listener_) {
+ listener_->OnDeviceConsentChanged(device_id, is_allowed);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Event listener is not initialized. "
+ "Can't call OnDeviceConsentChanged");
+ }
+ if (is_allowed) {
+ update_status_manager_.OnDeviceConsented();
+ }
+ StartPTExchange();
+}
+
+bool PolicyManagerImpl::ReactOnUserDevConsentForApp(
+ const std::string& app_id, const bool is_device_allowed) {
+ std::vector<std::string> current_request_types = GetAppRequestTypes(app_id);
+ std::string current_priority, new_priority;
+ GetPriority(app_id, &current_priority);
+
+ bool result = cache_->ReactOnUserDevConsentForApp(app_id, is_device_allowed);
+
+ std::vector<std::string> new_request_types = GetAppRequestTypes(app_id);
+ GetPriority(app_id, &new_priority);
+ std::sort(current_request_types.begin(), current_request_types.end());
+ std::sort(new_request_types.begin(), new_request_types.end());
+
+ std::vector<std::string> diff;
+ std::set_symmetric_difference(current_request_types.begin(),
+ current_request_types.end(),
+ new_request_types.begin(),
+ new_request_types.end(),
+ std::back_inserter(diff));
+
+ AppPermissions permissions(app_id);
+
+ if (!diff.empty()) {
+ permissions.requestType = new_request_types;
+ permissions.requestTypeChanged = true;
+ }
+
+ if ((!current_priority.empty()) && (!new_priority.empty()) &&
+ (current_priority != new_priority)) {
+ permissions.priority = new_priority;
+ }
+
+ if (permissions.requestTypeChanged || (!permissions.priority.empty())) {
+ listener_->SendOnAppPermissionsChanged(permissions, app_id);
+ }
+ return result;
+}
+
+bool PolicyManagerImpl::GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames,
+ StringArray* app_hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const bool result = nicknames && app_hmi_types;
+ if (result) {
+ cache_->GetInitialAppData(application_id, *nicknames, *app_hmi_types);
+ }
+ return result;
+}
+
+void PolicyManagerImpl::AddDevice(const std::string& device_id,
+ const std::string& connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device: " << device_id);
+ if (!cache_->AddDevice(device_id, connection_type)) {
+ LOG4CXX_WARN(logger_, "Can't add device.");
+ }
+}
+
+void PolicyManagerImpl::SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device :" << device_id);
+ if (!cache_->SetDeviceData(device_id,
+ device_info.hardware,
+ device_info.firmware_rev,
+ device_info.os,
+ device_info.os_ver,
+ device_info.carrier,
+ device_info.max_number_rfcom_ports,
+ device_info.connection_type)) {
+ LOG4CXX_WARN(logger_, "Can't set device data.");
+ }
+}
+
+PermissionConsent PolicyManagerImpl::EnsureCorrectPermissionConsent(
+ const PermissionConsent& permissions_to_check) {
+ std::vector<FunctionalGroupPermission> current_user_consents;
+ GetUserConsentForApp(permissions_to_check.device_id,
+ permissions_to_check.policy_app_id,
+ current_user_consents);
+
+ PermissionConsent permissions_to_set;
+ permissions_to_set.device_id = permissions_to_check.device_id;
+ permissions_to_set.policy_app_id = permissions_to_check.policy_app_id;
+ permissions_to_set.consent_source = permissions_to_check.consent_source;
+
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ permissions_to_check.group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ permissions_to_check.group_permissions.end();
+
+ for (; it != it_end; ++it) {
+ std::vector<FunctionalGroupPermission>::const_iterator it_curr =
+ current_user_consents.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_curr_end =
+ current_user_consents.end();
+
+ for (; it_curr != it_curr_end; ++it_curr) {
+ if (it->group_alias == it_curr->group_alias &&
+ it->group_id == it_curr->group_id) {
+ permissions_to_set.group_permissions.push_back(*it);
+ }
+ }
+ }
+
+ return permissions_to_set;
+}
+
+void PolicyManagerImpl::CheckPendingPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(app_permissions_diff_lock_);
+ PendingPermissions::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::NotifyPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& app_group_permissions) {
+ // Get current functional groups from DB with RPC permissions
+ policy_table::FunctionalGroupings functional_groups;
+ cache_->GetFunctionalGroupings(functional_groups);
+
+ // Get list of groups assigned to application
+ policy_table::Strings app_groups = GetGroupsNames(app_group_permissions);
+
+ // Fill notification data according to group permissions
+ Permissions notification_data;
+ PrepareNotificationData(
+ functional_groups, app_groups, app_group_permissions, notification_data);
+
+ listener()->OnPermissionsUpdated(policy_app_id, notification_data);
+}
+
+void PolicyManagerImpl::SetUserConsentForApp(
+ const PermissionConsent& permissions, const NotificationMode mode) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (permissions.group_permissions.empty()) {
+ LOG4CXX_DEBUG(logger_, "Permissions list is empty, skipping update.");
+ return;
+ }
+
+ cache_->ResetCalculatedPermissions();
+ PermissionConsent verified_permissions =
+ EnsureCorrectPermissionConsent(permissions);
+
+ bool app_permissions_changed = false;
+ if (!cache_->SetUserPermissionsForApp(verified_permissions,
+ &app_permissions_changed)) {
+ LOG4CXX_WARN(logger_, "Can't set user permissions for application.");
+ return;
+ }
+
+ if (kSilentMode == mode) {
+ LOG4CXX_WARN(logger_,
+ "Silent mode is enabled. Application won't be informed.");
+ return;
+ }
+
+ if (!app_permissions_changed) {
+ LOG4CXX_WARN(logger_,
+ "Application already has same consents. "
+ "Notificaton won't be sent.");
+ return;
+ }
+
+ std::vector<FunctionalGroupPermission> updated_app_group_permissons;
+ GetPermissionsForApp(verified_permissions.device_id,
+ verified_permissions.policy_app_id,
+ updated_app_group_permissons);
+
+ CheckPendingPermissionsChanges(verified_permissions.policy_app_id,
+ updated_app_group_permissons);
+
+ NotifyPermissionsChanges(verified_permissions.policy_app_id,
+ updated_app_group_permissons);
+}
+
+bool PolicyManagerImpl::GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string device_id = GetCurrentDeviceId(policy_app_id);
+ DeviceConsent device_consent = GetUserConsentForDevice(device_id);
+ const std::string app_id = policy::kDeviceAllowed != device_consent
+ ? kPreDataConsentId
+ : policy_app_id;
+ return cache_->GetDefaultHMI(app_id, *default_hmi);
+}
+
+bool PolicyManagerImpl::GetPriority(const std::string& policy_app_id,
+ std::string* priority) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!priority) {
+ LOG4CXX_WARN(logger_, "Input priority parameter is null.");
+ return false;
+ }
+
+ return cache_->GetPriority(policy_app_id, *priority);
+}
+
+std::vector<UserFriendlyMessage> PolicyManagerImpl::GetUserFriendlyMessages(
+ const std::vector<std::string>& message_code,
+ const std::string& language,
+ const std::string& active_hmi_language) {
+ return cache_->GetUserFriendlyMsg(
+ message_code, language, active_hmi_language);
+}
+
+void PolicyManagerImpl::GetUserConsentForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ FunctionalIdType group_types;
+ if (!cache_->GetPermissionsForApp(device_id, policy_app_id, group_types)) {
+ LOG4CXX_WARN(logger_,
+ "Can't get user permissions for app " << policy_app_id);
+ return;
+ }
+
+ // Functional groups w/o alias ("user_consent_prompt") considered as
+ // automatically allowed and it could not be changed by user
+ FunctionalGroupNames group_names;
+ if (!cache_->GetFunctionalGroupNames(group_names)) {
+ LOG4CXX_WARN(logger_, "Can't get functional group names");
+ return;
+ }
+
+ FunctionalGroupNames::const_iterator it = group_names.begin();
+ FunctionalGroupNames::const_iterator it_end = group_names.end();
+ FunctionalGroupIDs auto_allowed_groups;
+ for (; it != it_end; ++it) {
+ if (it->second.first.empty()) {
+ auto_allowed_groups.push_back(it->first);
+ }
+ }
+
+ FunctionalGroupIDs all_groups = group_types[kTypeGeneral];
+ FunctionalGroupIDs preconsented_groups = group_types[kTypePreconsented];
+ FunctionalGroupIDs consent_allowed_groups = group_types[kTypeAllowed];
+ FunctionalGroupIDs consent_disallowed_groups = group_types[kTypeDisallowed];
+ FunctionalGroupIDs default_groups = group_types[kTypeDefault];
+ FunctionalGroupIDs predataconsented_groups =
+ group_types[kTypePreDataConsented];
+ FunctionalGroupIDs device_groups = group_types[kTypeDevice];
+
+ // Sorting groups by consent
+ FunctionalGroupIDs preconsented_wo_auto =
+ ExcludeSame(preconsented_groups, auto_allowed_groups);
+
+ FunctionalGroupIDs preconsented_wo_disallowed_auto =
+ ExcludeSame(preconsented_wo_auto, consent_disallowed_groups);
+
+ FunctionalGroupIDs allowed_groups =
+ Merge(consent_allowed_groups, preconsented_wo_disallowed_auto);
+
+ FunctionalGroupIDs merged_stage_1 =
+ Merge(default_groups, predataconsented_groups);
+
+ FunctionalGroupIDs merged_stage_2 = Merge(merged_stage_1, device_groups);
+
+ FunctionalGroupIDs merged_stage_3 =
+ Merge(merged_stage_2, auto_allowed_groups);
+
+ FunctionalGroupIDs excluded_stage_1 = ExcludeSame(all_groups, merged_stage_3);
+
+ FunctionalGroupIDs excluded_stage_2 =
+ ExcludeSame(excluded_stage_1, consent_disallowed_groups);
+
+ FunctionalGroupIDs undefined_consent =
+ ExcludeSame(excluded_stage_2, allowed_groups);
+
+ // Fill result
+ FillFunctionalGroupPermissions(
+ undefined_consent, group_names, kGroupUndefined, permissions);
+ FillFunctionalGroupPermissions(
+ allowed_groups, group_names, kGroupAllowed, permissions);
+ FillFunctionalGroupPermissions(
+ consent_disallowed_groups, group_names, kGroupDisallowed, permissions);
+}
+
+void PolicyManagerImpl::GetPermissionsForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string app_id_to_check = policy_app_id;
+
+ if (!cache_->IsApplicationRepresented(policy_app_id)) {
+ LOG4CXX_WARN(logger_,
+ "Application with id " << policy_app_id
+ << " is not found within known apps.");
+ return;
+ }
+
+ bool allowed_by_default = false;
+ if (cache_->IsDefaultPolicy(policy_app_id)) {
+ app_id_to_check = kDefaultId;
+ allowed_by_default = true;
+ } else if (cache_->IsPredataPolicy(policy_app_id) ||
+ policy::kDeviceDisallowed == GetUserConsentForDevice(device_id)) {
+ app_id_to_check = kPreDataConsentId;
+ allowed_by_default = true;
+ }
+
+ FunctionalIdType group_types;
+
+#ifdef SDL_REMOTE_CONTROL
+ allowed_by_default = false;
+ const bool ret = access_remote_->GetPermissionsForApp(
+ device_id, app_id_to_check, group_types);
+#else
+ const bool ret =
+ cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
+#endif // REMOTE_CONTROL
+
+ if (!ret) {
+ LOG4CXX_WARN(logger_,
+ "Can't get user permissions for app " << policy_app_id);
+ return;
+ }
+
+ // Functional groups w/o alias ("user_consent_prompt") considered as
+ // automatically allowed and it could not be changed by user
+ FunctionalGroupNames group_names;
+ if (!cache_->GetFunctionalGroupNames(group_names)) {
+ LOG4CXX_WARN(logger_, "Can't get functional group names");
+ return;
+ }
+
+ // 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 allowed groups");
+ GroupType type =
+ (kDefaultId == app_id_to_check ? kTypeDefault : kTypePreDataConsented);
+
+ FillFunctionalGroupPermissions(
+ group_types[type], group_names, kGroupAllowed, permissions);
+ } else {
+ // The code bellow allows to process application which
+ // has specific permissions(not default and pre_DataConsent).
+
+ // All groups for specific application
+ FunctionalGroupIDs all_groups = group_types[kTypeGeneral];
+
+ // Groups assigned by the user for specific application
+ FunctionalGroupIDs allowed_groups = group_types[kTypeAllowed];
+
+ // Groups disallowed by the user for specific application
+ FunctionalGroupIDs common_disallowed = group_types[kTypeDisallowed];
+
+ // Groups that allowed by default but can be changed by the user
+ FunctionalGroupIDs preconsented_groups = group_types[kTypePreconsented];
+
+ // Groups which has user consent promt but there is no any consnets now.
+ FunctionalGroupIDs unconsented_groups = group_types[kTypeUnconsented];
+
+ // Pull common groups from allowed and preconsented parts.
+ FunctionalGroupIDs allowed_preconsented =
+ Merge(allowed_groups, preconsented_groups);
+
+ // Get all groups that we suppose are allowed.
+ FunctionalGroupIDs all_allowed = Merge(allowed_preconsented, all_groups);
+
+ // In case when same groups exists in disallowed and allowed tables,
+ // disallowed one have priority over allowed. So we have to remove
+ // all disallowed groups from allowed table.
+ FunctionalGroupIDs common_allowed =
+ ExcludeSame(all_allowed, common_disallowed);
+ FunctionalGroupIDs consent_disallowed =
+ ExcludeSame(unconsented_groups, preconsented_groups);
+
+ // Disallowed groups are contain all directly disallowed,
+ // plus unconsented minus preconsented.
+ FunctionalGroupIDs all_disallowed =
+ Merge(common_disallowed, consent_disallowed);
+
+ // Fill result
+ FillFunctionalGroupPermissions(
+ consent_disallowed, group_names, kGroupUndefined, permissions);
+ FillFunctionalGroupPermissions(
+ common_allowed, group_names, kGroupAllowed, permissions);
+ FillFunctionalGroupPermissions(
+ all_disallowed, group_names, kGroupDisallowed, permissions);
+ }
+ return;
+}
+
+std::string& PolicyManagerImpl::GetCurrentDeviceId(
+ const std::string& policy_app_id) const {
+ LOG4CXX_INFO(logger_, "GetDeviceInfo");
+ last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
+ return last_device_id_;
+}
+
+void PolicyManagerImpl::SetSystemLanguage(const std::string& language) {
+ cache_->SetSystemLanguage(language);
+}
+
+void PolicyManagerImpl::SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->SetMetaInfo(ccpu_version, wers_country_code, language);
+}
+
+void PolicyManagerImpl::OnSystemReady() {
+ // Update policy table for the first time with system information
+ if (!cache_->IsMetaInfoPresent()) {
+ listener()->OnSystemInfoUpdateRequired();
+ }
+}
+
+uint32_t PolicyManagerImpl::GetNotificationsNumber(
+ const std::string& priority) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetNotificationsNumber(priority);
+}
+
+bool PolicyManagerImpl::ExceededIgnitionCycles() {
+ return 0 == cache_->IgnitionCyclesBeforeExchange();
+}
+
+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;
+}
+
+const PolicySettings& PolicyManagerImpl::get_settings() const {
+ DCHECK(settings_);
+ return *settings_;
+}
+
+void PolicyManagerImpl::UpdateAppConsentWithExternalConsent(
+ const std::string& device_id,
+ const std::string& application_id,
+ const GroupsNames& allowed_groups,
+ const GroupsNames& disallowed_groups,
+ const ConsentProcessingPolicy processing_policy) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (allowed_groups.empty() && disallowed_groups.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "Allowed and disallowed groups are empty, skipping update by "
+ "external user consent.");
+ return;
+ }
+
+ std::vector<FunctionalGroupPermission> current_permissions;
+ GetUserConsentForApp(device_id, application_id, current_permissions);
+
+ ConsentPriorityType prio = ConsentPriorityType::kExternalConsentPrio;
+ if (ConsentProcessingPolicy::kTimestampBased == processing_policy) {
+ prio = cache_->GetConsentsPriority(device_id, application_id);
+ }
+
+ std::vector<FunctionalGroupPermission> external_consent_groups_matches;
+ ConsentsUpdater updater(
+ allowed_groups, disallowed_groups, external_consent_groups_matches, prio);
+ std::for_each(
+ current_permissions.begin(), current_permissions.end(), updater);
+
+ const std::string source = "GUI";
+
+ PermissionConsent updated_user_permissions;
+ updated_user_permissions.group_permissions = current_permissions;
+ updated_user_permissions.device_id = device_id;
+ updated_user_permissions.policy_app_id = application_id;
+ updated_user_permissions.consent_source = source;
+
+ // Need to check to which app to send notification since maybe app registered
+ // from different device
+ SetUserConsentForApp(updated_user_permissions,
+ PolicyManager::kNotifyApplicationMode);
+
+ PermissionConsent updated_external_consent_permissions;
+ updated_external_consent_permissions.group_permissions =
+ external_consent_groups_matches;
+ updated_external_consent_permissions.device_id = device_id;
+ updated_external_consent_permissions.policy_app_id = application_id;
+ updated_user_permissions.consent_source = source;
+
+ cache_->SetExternalConsentForApp(updated_external_consent_permissions);
+}
+
+void PolicyManagerImpl::NotifySystem(
+ const PolicyManagerImpl::AppPoliciesValueType& app_policy) const {
+ listener()->OnPendingPermissionChange(app_policy.first);
+}
+
+void PolicyManagerImpl::SendPermissionsToApp(
+ const PolicyManagerImpl::AppPoliciesValueType& app_policy) {
+ const std::string app_id = app_policy.first;
+
+ const std::string device_id = GetCurrentDeviceId(app_id);
+ if (device_id.empty()) {
+ LOG4CXX_WARN(logger_,
+ "Couldn't find device info for application id: " << app_id);
+ return;
+ }
+ std::vector<FunctionalGroupPermission> group_permissons;
+ GetPermissionsForApp(device_id, app_id, group_permissons);
+
+ Permissions notification_data;
+
+ // Need to get rid of this call
+ utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ cache_->GenerateSnapshot();
+
+ PrepareNotificationData(
+ policy_table_snapshot->policy_table.functional_groupings,
+ app_policy.second.groups,
+ group_permissons,
+ notification_data);
+
+ LOG4CXX_INFO(logger_, "Send notification for application_id: " << app_id);
+ listener()->OnPermissionsUpdated(
+ app_id,
+ notification_data,
+ policy_table::EnumToJsonString(app_policy.second.default_hmi));
+}
+
+void PolicyManagerImpl::ProcessExternalConsentStatusUpdate(
+ const GroupsByExternalConsentStatus& groups_by_status,
+ const ConsentProcessingPolicy processing_policy) {
+ GroupsNames allowed_groups;
+ GroupsNames disallowed_groups;
+ CalculateGroupsConsentFromExternalConsent(
+ groups_by_status, allowed_groups, disallowed_groups);
+
+ std::map<std::string, std::string> known_links =
+ cache_->GetKnownLinksFromPT();
+ std::map<std::string, std::string> registered_links;
+ listener_->GetRegisteredLinks(registered_links);
+
+ std::map<std::string, std::string> all_known;
+ std::merge(known_links.begin(),
+ known_links.end(),
+ registered_links.begin(),
+ registered_links.end(),
+ std::inserter(all_known, all_known.begin()));
+
+ std::map<std::string, std::string>::const_iterator it_links =
+ all_known.begin();
+ for (; all_known.end() != it_links; ++it_links) {
+ UpdateAppConsentWithExternalConsent(it_links->first,
+ it_links->second,
+ allowed_groups,
+ disallowed_groups,
+ processing_policy);
+ }
+}
+
+bool ConsentStatusComparatorFunc(const ExternalConsentStatusItem& i1,
+ const ExternalConsentStatusItem& i2) {
+ return (i1.entity_id_ < i2.entity_id_) ||
+ (i1.entity_type_ < i2.entity_type_) || (i1.status_ < i2.status_);
+}
+
+bool PolicyManagerImpl::IsNeedToUpdateExternalConsentStatus(
+ const ExternalConsentStatus& new_status) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ typedef std::vector<ExternalConsentStatusItem> ItemV;
+ const ExternalConsentStatus existing_status =
+ cache_->GetExternalConsentEntities();
+
+ ItemV new_status_v(new_status.begin(), new_status.end());
+ ItemV existing_status_v(existing_status.begin(), existing_status.end());
+
+ ItemV difference_v;
+ difference_v.resize(new_status_v.size() + existing_status_v.size());
+
+ ItemV::iterator ci = difference_v.begin();
+ ci = std::set_difference(new_status_v.begin(),
+ new_status_v.end(),
+ existing_status_v.begin(),
+ existing_status_v.end(),
+ difference_v.begin(),
+ ConsentStatusComparatorFunc);
+ difference_v.resize(ci - difference_v.begin());
+
+ return !difference_v.empty();
+}
+
+bool PolicyManagerImpl::SetExternalConsentStatus(
+ const ExternalConsentStatus& status) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (status.empty()) {
+ LOG4CXX_INFO(logger_, "External consent status is empty, skipping update.");
+ return false;
+ }
+
+ if (!cache_->SetExternalConsentStatus(status)) {
+ LOG4CXX_WARN(logger_, "Can't set external user consent status.");
+ return false;
+ }
+
+ GroupsByExternalConsentStatus groups_by_status =
+ cache_->GetGroupsWithSameEntities(status);
+ ProcessExternalConsentStatusUpdate(
+ groups_by_status, ConsentProcessingPolicy::kExternalConsentBased);
+
+ return true;
+}
+
+ExternalConsentStatus PolicyManagerImpl::GetExternalConsentStatus() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetExternalConsentStatus();
+}
+
+void PolicyManagerImpl::CalculateGroupsConsentFromExternalConsent(
+ const GroupsByExternalConsentStatus& groups_by_external_consent,
+ GroupsNames& out_allowed_groups,
+ GroupsNames& out_disallowed_groups) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GroupSorter sorter(out_allowed_groups, out_disallowed_groups);
+ std::for_each(groups_by_external_consent.begin(),
+ groups_by_external_consent.end(),
+ sorter);
+
+ GroupsNames filtered_allowed_groups;
+ std::set_difference(
+ out_allowed_groups.begin(),
+ out_allowed_groups.end(),
+ out_disallowed_groups.begin(),
+ out_disallowed_groups.end(),
+ std::inserter(filtered_allowed_groups, filtered_allowed_groups.begin()));
+
+ out_allowed_groups = filtered_allowed_groups;
+}
+
+bool PolicyManagerImpl::ExceededDays() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const int kSecondsInDay = 60 * 60 * 24;
+ const int days = current_time.tv_sec / kSecondsInDay;
+
+ DCHECK(std::numeric_limits<uint16_t>::max() >= days);
+
+ if (std::numeric_limits<uint16_t>::max() <= days) {
+ LOG4CXX_WARN(logger_, "The days since epoch exceeds maximum value.");
+ return false;
+ }
+ return 0 == cache_->DaysBeforeExchange(static_cast<uint16_t>(days));
+}
+
+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.");
+ update_status_manager_.ScheduleUpdate();
+ StartPTExchange();
+ PTUpdatedAt(KILOMETERS, kilometers);
+ }
+}
+
+void PolicyManagerImpl::IncrementIgnitionCycles() {
+ cache_->IncrementIgnitionCycles();
+}
+
+std::string PolicyManagerImpl::ForcePTExchange() {
+ update_status_manager_.ScheduleUpdate();
+ StartPTExchange();
+ return update_status_manager_.StringifiedUpdateStatus();
+}
+
+std::string PolicyManagerImpl::ForcePTExchangeAtUserRequest() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_manager_.ScheduleManualUpdate();
+ StartPTExchange();
+ return update_status_manager_.StringifiedUpdateStatus();
+}
+
+std::string PolicyManagerImpl::GetPolicyTableStatus() const {
+ return update_status_manager_.StringifiedUpdateStatus();
+}
+
+int PolicyManagerImpl::NextRetryTimeout() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ LOG4CXX_DEBUG(logger_, "Index: " << retry_sequence_index_);
+ int next = 0;
+ if (!retry_sequence_seconds_.empty() &&
+ retry_sequence_index_ < retry_sequence_seconds_.size()) {
+ next = retry_sequence_seconds_[retry_sequence_index_];
+ ++retry_sequence_index_;
+ }
+ return next;
+}
+
+void PolicyManagerImpl::RefreshRetrySequence() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ retry_sequence_timeout_ = cache_->TimeoutResponse();
+ retry_sequence_seconds_.clear();
+ cache_->SecondsBetweenRetries(retry_sequence_seconds_);
+}
+
+void PolicyManagerImpl::ResetRetrySequence() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ retry_sequence_index_ = 0;
+ update_status_manager_.OnResetRetrySequence();
+}
+
+uint32_t PolicyManagerImpl::TimeoutExchangeMSec() {
+ return retry_sequence_timeout_;
+}
+
+const std::vector<int> PolicyManagerImpl::RetrySequenceDelaysSeconds() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ return retry_sequence_seconds_;
+}
+
+void PolicyManagerImpl::OnExceededTimeout() {
+ update_status_manager_.OnUpdateTimeoutOccurs();
+}
+
+void PolicyManagerImpl::OnUpdateStarted() {
+ uint32_t update_timeout = TimeoutExchangeMSec();
+ LOG4CXX_DEBUG(logger_,
+ "Update timeout will be set to (milisec): " << update_timeout);
+ send_on_update_sent_out_ =
+ !wrong_ptu_update_received_ && !update_status_manager_.IsUpdatePending();
+
+ if (send_on_update_sent_out_) {
+ update_status_manager_.OnUpdateSentOut(update_timeout);
+ }
+ cache_->SaveUpdateRequired(true);
+}
+
+void PolicyManagerImpl::PTUpdatedAt(Counters counter, int value) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->SetCountersPassedForSuccessfulUpdate(counter, value);
+ cache_->ResetIgnitionCycles();
+}
+
+void PolicyManagerImpl::Increment(usage_statistics::GlobalCounterId type) {
+ LOG4CXX_INFO(logger_, "Increment without app id");
+ cache_->Increment(type);
+}
+
+void PolicyManagerImpl::Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) {
+ LOG4CXX_DEBUG(logger_, "Increment " << app_id << " AppCounter: " << type);
+ cache_->Increment(app_id, type);
+}
+
+void PolicyManagerImpl::Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) {
+ LOG4CXX_INFO(logger_, "Set " << app_id);
+ cache_->Set(app_id, type, value);
+}
+
+void PolicyManagerImpl::Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) {
+ LOG4CXX_INFO(logger_, "Add " << app_id);
+ cache_->Add(app_id, type, timespan_seconds);
+}
+
+bool PolicyManagerImpl::IsApplicationRevoked(const std::string& app_id) const {
+ return cache_->IsApplicationRevoked(app_id);
+}
+
+bool PolicyManagerImpl::IsConsentNeeded(const std::string& app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string device_id = GetCurrentDeviceId(app_id);
+ int count = cache_->CountUnconsentedGroups(app_id, device_id);
+ LOG4CXX_DEBUG(logger_, "There are: " << count << " unconsented groups.");
+ return count != 0;
+}
+
+void PolicyManagerImpl::SetVINValue(const std::string& value) {
+ cache_->SetVINValue(value);
+}
+
+AppPermissions PolicyManagerImpl::GetAppPermissionsChanges(
+ const std::string& policy_app_id) {
+ PendingPermissions::iterator app_id_diff =
+ app_permissions_diff_.find(policy_app_id);
+
+ AppPermissions permissions(policy_app_id);
+
+ if (app_permissions_diff_.end() != app_id_diff) {
+ permissions = app_id_diff->second;
+ } else {
+ permissions.appPermissionsConsentNeeded = IsConsentNeeded(policy_app_id);
+ permissions.appRevoked = IsApplicationRevoked(policy_app_id);
+ GetPriority(permissions.application_id, &permissions.priority);
+ }
+ return permissions;
+}
+
+void PolicyManagerImpl::RemovePendingPermissionChanges(
+ const std::string& app_id) {
+ app_permissions_diff_.erase(app_id);
+}
+
+bool PolicyManagerImpl::CanAppKeepContext(const std::string& app_id) const {
+ return cache_->CanAppKeepContext(app_id);
+}
+
+bool PolicyManagerImpl::CanAppStealFocus(const std::string& app_id) const {
+ return cache_->CanAppStealFocus(app_id);
+}
+
+void PolicyManagerImpl::MarkUnpairedDevice(const std::string& device_id) {
+ if (!cache_->SetUnpairedDevice(device_id)) {
+ LOG4CXX_DEBUG(logger_, "Could not set unpaired flag for " << device_id);
+ return;
+ }
+ SetUserConsentForDevice(device_id, false);
+}
+
+void PolicyManagerImpl::OnAppRegisteredOnMobile(
+ const std::string& application_id) {
+ StartPTExchange();
+ SendNotificationOnPermissionsUpdated(application_id);
+}
+
+void PolicyManagerImpl::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->OnDeviceSwitching(device_id_from, device_id_to);
+}
+
+const MetaInfo PolicyManagerImpl::GetMetaInfo() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetMetaInfo();
+}
+
+std::string PolicyManagerImpl::RetrieveCertificate() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetCertificate();
+}
+
+bool PolicyManagerImpl::HasCertificate() const {
+ return !cache_->GetCertificate().empty();
+}
+
+void PolicyManagerImpl::SetDecryptedCertificate(
+ const std::string& certificate) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->SetDecryptedCertificate(certificate);
+}
+
+AppIdURL PolicyManagerImpl::GetNextUpdateUrl(const EndpointUrls& urls) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const AppIdURL next_app_url = RetrySequenceUrl(retry_sequence_url_, urls);
+
+ retry_sequence_url_.url_idx_ = next_app_url.second + 1;
+ retry_sequence_url_.app_idx_ = next_app_url.first;
+ retry_sequence_url_.policy_app_id_ = urls[next_app_url.first].app_id;
+
+ return next_app_url;
+}
+
+AppIdURL PolicyManagerImpl::RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const {
+ uint32_t url_idx = rs.url_idx_;
+ uint32_t app_idx = rs.app_idx_;
+ const std::string& app_id = rs.policy_app_id_;
+
+ if (urls.size() <= app_idx) {
+ // Index of current application doesn't exist any more due to app(s)
+ // unregistration
+ url_idx = 0;
+ app_idx = 0;
+ } else if (urls[app_idx].app_id != app_id) {
+ // Index of current application points to another one due to app(s)
+ // registration/unregistration
+ url_idx = 0;
+ } else if (url_idx >= urls[app_idx].url.size()) {
+ // Index of current application is OK, but all of its URL are sent,
+ // move to the next application
+ url_idx = 0;
+ if (++app_idx >= urls.size()) {
+ app_idx = 0;
+ }
+ }
+ const AppIdURL next_app_url = std::make_pair(app_idx, url_idx);
+
+ return next_app_url;
+}
+
+/**
+ * @brief The CallStatusChange class notify update manager aboun new application
+ */
+class CallStatusChange : public utils::Callable {
+ public:
+ CallStatusChange(UpdateStatusManager& upd_manager,
+ const DeviceConsent& device_consent)
+ : upd_manager_(upd_manager), device_consent_(device_consent) {}
+
+ // Callable interface
+ void operator()() const {
+ upd_manager_.OnNewApplicationAdded(device_consent_);
+ }
+
+ private:
+ UpdateStatusManager& upd_manager_;
+ const DeviceConsent device_consent_;
+};
+
+StatusNotifier PolicyManagerImpl::AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ DeviceConsent device_consent = GetUserConsentForDevice(device_id);
+ sync_primitives::AutoLock lock(apps_registration_lock_);
+ if (IsNewApplication(application_id)) {
+ AddNewApplication(application_id, device_consent);
+ return utils::MakeShared<CallStatusChange>(update_status_manager_,
+ device_consent);
+ } else {
+ PromoteExistedApplication(application_id, device_consent);
+ if (helpers::in_range(hmi_types, policy_table::AHT_NAVIGATION) &&
+ !HasCertificate()) {
+ LOG4CXX_DEBUG(logger_, "Certificate does not exist, scheduling update.");
+ update_status_manager_.ScheduleUpdate();
+ }
+ return utils::MakeShared<utils::CallNothing>();
+ }
+}
+
+void PolicyManagerImpl::RemoveAppConsentForGroup(
+ const std::string& app_id, const std::string& group_name) {
+ cache_->RemoveAppConsentForGroup(app_id, group_name);
+}
+
+bool PolicyManagerImpl::IsPredataPolicy(
+ const std::string& policy_app_id) const {
+ LOG4CXX_INFO(logger_, "IsPredataApp");
+ return cache_->IsPredataPolicy(policy_app_id);
+}
+
+void PolicyManagerImpl::ProcessExternalConsentStatusForApp(
+ const std::string& application_id,
+ const ConsentProcessingPolicy processing_policy) {
+ ExternalConsentStatus status = cache_->GetExternalConsentStatus();
+ GroupsByExternalConsentStatus groups_by_status =
+ cache_->GetGroupsWithSameEntities(status);
+
+ GroupsNames allowed_groups;
+ GroupsNames disallowed_groups;
+ CalculateGroupsConsentFromExternalConsent(
+ groups_by_status, allowed_groups, disallowed_groups);
+
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ UpdateAppConsentWithExternalConsent(device_id,
+ application_id,
+ allowed_groups,
+ disallowed_groups,
+ processing_policy);
+}
+
+void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
+ DeviceConsent device_consent) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (kDeviceHasNoConsent == device_consent ||
+ kDeviceDisallowed == device_consent) {
+ LOG4CXX_INFO(logger_,
+ "Setting "
+ << policy::kPreDataConsentId
+ << " permissions for application id: " << application_id);
+ cache_->SetPredataPolicy(application_id);
+ } else {
+ LOG4CXX_INFO(logger_,
+ "Setting "
+ << policy::kDefaultId
+ << " permissions for application id: " << application_id);
+ cache_->SetDefaultPolicy(application_id);
+ }
+
+ ProcessExternalConsentStatusForApp(
+ application_id, ConsentProcessingPolicy::kExternalConsentBased);
+}
+
+void PolicyManagerImpl::PromoteExistedApplication(
+ const std::string& application_id, DeviceConsent 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)) {
+ cache_->SetDefaultPolicy(application_id);
+ }
+ ProcessExternalConsentStatusForApp(application_id,
+ ConsentProcessingPolicy::kTimestampBased);
+}
+
+bool PolicyManagerImpl::IsNewApplication(
+ const std::string& application_id) const {
+ return false == cache_->IsApplicationRepresented(application_id);
+}
+
+bool PolicyManagerImpl::ResetPT(const std::string& file_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->ResetCalculatedPermissions();
+ const bool result = cache_->ResetPT(file_name);
+ if (result) {
+ RefreshRetrySequence();
+ }
+ return result;
+}
+
+bool PolicyManagerImpl::CheckAppStorageFolder() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string app_storage_folder = get_settings().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,
+ const PolicySettings* settings) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ settings_ = settings;
+ if (!CheckAppStorageFolder()) {
+ LOG4CXX_ERROR(logger_, "Can not read/write into AppStorageFolder");
+ return false;
+ }
+ const bool ret = cache_->Init(file_name, settings);
+ if (ret) {
+ RefreshRetrySequence();
+ update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
+ }
+ return ret;
+}
+
+uint32_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;
+}
+
+std::ostream& operator<<(std::ostream& output,
+ const policy_table::Strings& groups) {
+ for (policy_table::Strings::const_iterator i = groups.begin();
+ i != groups.end();
+ ++i) {
+ output << static_cast<std::string>(*i) << " ";
+ }
+ return output;
+}
+
+#ifdef SDL_REMOTE_CONTROL
+void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ ApplicationOnDevice who = {device_id, application_id};
+ access_remote_->SetDefaultHmiTypes(who, hmi_types);
+}
+
+struct HMITypeToInt {
+ int operator()(const policy_table::AppHMITypes::value_type item) {
+ return policy_table::AppHMIType(item);
+ }
+};
+
+bool PolicyManagerImpl::GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(application_id)) {
+ return false;
+ }
+ const policy_table::AppHMITypes* hmi_types =
+ cache_->GetHMITypes(application_id);
+ if (hmi_types) {
+ std::transform(hmi_types->begin(),
+ hmi_types->end(),
+ std::back_inserter(*app_types),
+ HMITypeToInt());
+ }
+ return hmi_types;
+}
+
+bool PolicyManagerImpl::CheckModule(const PTString& app_id,
+ const PTString& module) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::ModuleType module_type;
+ return EnumFromJsonString(module, &module_type) &&
+ access_remote_->CheckModuleType(app_id, module_type);
+}
+
+void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
+ std::string default_hmi("NONE");
+ if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Couldn't get default HMI level for application "
+ << who.app_id);
+ }
+}
+
+void PolicyManagerImpl::GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(data);
+ std::vector<FunctionalGroupPermission> app_group_permissions;
+ GetPermissionsForApp(device_id, application_id, app_group_permissions);
+
+ policy_table::FunctionalGroupings functional_groupings;
+ cache_->GetFunctionalGroupings(functional_groupings);
+
+ policy_table::Strings app_groups;
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ app_group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ app_group_permissions.end();
+ for (; it != it_end; ++it) {
+ app_groups.push_back((*it).group_name);
+ }
+
+ PrepareNotificationData(
+ functional_groupings, app_groups, app_group_permissions, *data);
+}
+
+void PolicyManagerImpl::SendAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) {
+ Permissions notification_data;
+ GetPermissions(device_id, application_id, &notification_data);
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+}
+
+void PolicyManagerImpl::OnPrimaryGroupsChanged(
+ const std::string& application_id) {
+ const std::vector<std::string> devices =
+ listener()->GetDevicesIds(application_id);
+ for (std::vector<std::string>::const_iterator i = devices.begin();
+ i != devices.end();
+ ++i) {
+ const ApplicationOnDevice who = {*i, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ SendAppPermissionsChanged(who.dev_id, who.app_id);
+ }
+ }
+}
+
+bool PolicyManagerImpl::GetModuleTypes(
+ const std::string& application_id,
+ std::vector<std::string>* modules) const {
+ return access_remote_->GetModuleTypes(application_id, modules);
+}
+
+void PolicyManagerImpl::set_access_remote(
+ utils::SharedPtr<AccessRemote> access_remote) {
+ access_remote_ = access_remote;
+}
+#endif // SDL_REMOTE_CONTROL
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/policy_table.cc b/src/components/policy/policy_external/src/policy_table.cc
new file mode 100644
index 0000000000..7a63fac50d
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_table.cc
@@ -0,0 +1,52 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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/policy_table.h"
+
+#include "policy/sql_pt_ext_representation.h"
+
+#include "utils/logger.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+PolicyTable::PolicyTable() : pt_data_(new SQLPTExtRepresentation()) {}
+
+PolicyTable::PolicyTable(utils::SharedPtr<PTRepresentation> pt_data)
+ : pt_data_(pt_data) {}
+
+PolicyTable::~PolicyTable() {
+ LOG4CXX_INFO(logger_, "Destroying policy table.");
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc
new file mode 100644
index 0000000000..168ff86b27
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_table/enums.cc
@@ -0,0 +1,771 @@
+#include "policy/policy_table/enums.h"
+
+namespace rpc {
+namespace policy_table_interface_base {
+bool IsValidEnum(Priority val) {
+ switch (val) {
+ case P_EMERGENCY:
+ return true;
+ case P_NAVIGATION:
+ return true;
+ case P_VOICECOM:
+ return true;
+ case P_COMMUNICATION:
+ return true;
+ case P_NORMAL:
+ return true;
+ case P_NONE:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(Priority val) {
+ switch (val) {
+ case P_EMERGENCY:
+ return "EMERGENCY";
+ case P_NAVIGATION:
+ return "NAVIGATION";
+ case P_VOICECOM:
+ return "VOICECOM";
+ case P_COMMUNICATION:
+ return "COMMUNICATION";
+ case P_NORMAL:
+ return "NORMAL";
+ case P_NONE:
+ return "NONE";
+ default:
+ return "";
+ }
+}
+bool EnumFromJsonString(const std::string& literal, Priority* result) {
+ if ("EMERGENCY" == literal) {
+ *result = P_EMERGENCY;
+ return true;
+ } else if ("NAVIGATION" == literal) {
+ *result = P_NAVIGATION;
+ return true;
+ } else if ("VOICECOM" == literal) {
+ *result = P_VOICECOM;
+ return true;
+ } else if ("COMMUNICATION" == literal) {
+ *result = P_COMMUNICATION;
+ return true;
+ } else if ("NORMAL" == literal) {
+ *result = P_NORMAL;
+ return true;
+ } else if ("NONE" == literal) {
+ *result = P_NONE;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool IsValidEnum(HmiLevel val) {
+ switch (val) {
+ case HL_BACKGROUND:
+ return true;
+ case HL_FULL:
+ return true;
+ case HL_LIMITED:
+ return true;
+ case HL_NONE:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(HmiLevel val) {
+ switch (val) {
+ case HL_BACKGROUND:
+ return "BACKGROUND";
+ case HL_FULL:
+ return "FULL";
+ case HL_LIMITED:
+ return "LIMITED";
+ case HL_NONE:
+ return "NONE";
+ default:
+ return "";
+ }
+}
+bool EnumFromJsonString(const std::string& literal, HmiLevel* result) {
+ if ("BACKGROUND" == literal) {
+ *result = HL_BACKGROUND;
+ return true;
+ } else if ("FULL" == literal) {
+ *result = HL_FULL;
+ return true;
+ } else if ("LIMITED" == literal) {
+ *result = HL_LIMITED;
+ return true;
+ } else if ("NONE" == literal) {
+ *result = HL_NONE;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool IsValidEnum(Parameter val) {
+ switch (val) {
+ case P_GPS:
+ return true;
+ case P_SPEED:
+ return true;
+ case P_ENGINETORQUE:
+ return true;
+ case P_EXTERNALTEMPERATURE:
+ return true;
+ case P_FUELLEVEL:
+ return true;
+ case P_FUELLEVEL_STATE:
+ return true;
+ case P_HEADLAMPSTATUS:
+ return true;
+ case P_INSTANTFUELCONSUMPTION:
+ return true;
+ case P_ODOMETER:
+ return true;
+ case P_TIREPRESSURE:
+ return true;
+ case P_WIPERSTATUS:
+ return true;
+ case P_VIN:
+ return true;
+ case P_ACCPEDALPOSITION:
+ return true;
+ case P_BELTSTATUS:
+ return true;
+ case P_DRIVERBRAKING:
+ return true;
+ case P_PRNDL:
+ return true;
+ case P_RPM:
+ return true;
+ case P_STEERINGWHEELANGLE:
+ return true;
+ case P_MYKEY:
+ return true;
+ case P_AIRBAGSTATUS:
+ return true;
+ case P_BODYINFORMATION:
+ return true;
+ case P_CLUSTERMODESTATUS:
+ return true;
+ case P_DEVICESTATUS:
+ return true;
+ case P_EMERGENCYEVENT:
+ return true;
+ case P_ECALLINFO:
+ return true;
+ case P_ABS_STATE:
+ return true;
+ case P_TURN_SIGNAL:
+ return true;
+ case P_FUEL_RANGE:
+ return true;
+ case P_TIRE_PRESSURE_VALUE:
+ return true;
+ case P_TPMS:
+ return true;
+ case P_LONGTITUDE_DEGREES:
+ return true;
+ case P_LATITUDE_DEGREES:
+ return true;
+ case P_LOCATION_NAME:
+ return true;
+ case P_LOCATION_DESCRIPTION:
+ return true;
+ case P_ADDRESS_LINES:
+ return true;
+ case P_PHONE_NUMBER:
+ return true;
+ case P_LOCATION_IMAGE:
+ return true;
+ case P_DELIVERY_MODE:
+ return true;
+ case P_TIMESTAMP:
+ return true;
+ case P_ADDRESS:
+ return true;
+ case P_EMPTY:
+ return true;
+ default:
+ return false;
+ }
+}
+
+const char* EnumToJsonString(Parameter val) {
+ switch (val) {
+ case P_GPS:
+ return "gps";
+ case P_SPEED:
+ return "speed";
+ case P_ENGINETORQUE:
+ return "engineTorque";
+ case P_EXTERNALTEMPERATURE:
+ return "externalTemperature";
+ case P_FUELLEVEL:
+ return "fuelLevel";
+ case P_FUELLEVEL_STATE:
+ return "fuelLevel_State";
+ case P_HEADLAMPSTATUS:
+ return "headLampStatus";
+ case P_INSTANTFUELCONSUMPTION:
+ return "instantFuelConsumption";
+ case P_ODOMETER:
+ return "odometer";
+ case P_TIREPRESSURE:
+ return "tirePressure";
+ case P_WIPERSTATUS:
+ return "wiperStatus";
+ case P_VIN:
+ return "vin";
+ case P_ACCPEDALPOSITION:
+ return "accPedalPosition";
+ case P_BELTSTATUS:
+ return "beltStatus";
+ case P_DRIVERBRAKING:
+ return "driverBraking";
+ case P_PRNDL:
+ return "prndl";
+ case P_RPM:
+ return "rpm";
+ case P_STEERINGWHEELANGLE:
+ return "steeringWheelAngle";
+ case P_MYKEY:
+ return "myKey";
+ case P_AIRBAGSTATUS:
+ return "airbagStatus";
+ case P_BODYINFORMATION:
+ return "bodyInformation";
+ case P_CLUSTERMODESTATUS:
+ return "clusterModeStatus";
+ case P_DEVICESTATUS:
+ return "deviceStatus";
+ case P_EMERGENCYEVENT:
+ return "emergencyEvent";
+ case P_ECALLINFO:
+ return "eCallInfo";
+ case P_ABS_STATE:
+ return "abs_State";
+ case P_TURN_SIGNAL:
+ return "turnSignal";
+ case P_FUEL_RANGE:
+ return "fuelRange";
+ case P_TIRE_PRESSURE_VALUE:
+ return "tirePressureValue";
+ case P_TPMS:
+ return "tpms";
+ case P_LONGTITUDE_DEGREES:
+ return "longitudeDegrees";
+ case P_LATITUDE_DEGREES:
+ return "latitudeDegrees";
+ case P_LOCATION_NAME:
+ return "locationName";
+ case P_LOCATION_DESCRIPTION:
+ return "locationDescription";
+ case P_ADDRESS_LINES:
+ return "addressLines";
+ case P_PHONE_NUMBER:
+ return "phoneNumber";
+ case P_LOCATION_IMAGE:
+ return "locationImage";
+ case P_DELIVERY_MODE:
+ return "deliveryMode";
+ case P_TIMESTAMP:
+ return "timeStamp";
+ case P_ADDRESS:
+ return "address";
+ case P_EMPTY:
+ return "EMPTY";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, Parameter* result) {
+ if ("gps" == literal) {
+ *result = P_GPS;
+ return true;
+ } else if ("speed" == literal) {
+ *result = P_SPEED;
+ return true;
+ } else if ("engineTorque" == literal) {
+ *result = P_ENGINETORQUE;
+ return true;
+ } else if ("externalTemperature" == literal) {
+ *result = P_EXTERNALTEMPERATURE;
+ return true;
+ } else if ("fuelLevel" == literal) {
+ *result = P_FUELLEVEL;
+ return true;
+ } else if ("fuelLevel_State" == literal) {
+ *result = P_FUELLEVEL_STATE;
+ return true;
+ } else if ("headLampStatus" == literal) {
+ *result = P_HEADLAMPSTATUS;
+ return true;
+ } else if ("instantFuelConsumption" == literal) {
+ *result = P_INSTANTFUELCONSUMPTION;
+ return true;
+ } else if ("odometer" == literal) {
+ *result = P_ODOMETER;
+ return true;
+ } else if ("tirePressure" == literal) {
+ *result = P_TIREPRESSURE;
+ return true;
+ } else if ("wiperStatus" == literal) {
+ *result = P_WIPERSTATUS;
+ return true;
+ } else if ("vin" == literal) {
+ *result = P_VIN;
+ return true;
+ } else if ("accPedalPosition" == literal) {
+ *result = P_ACCPEDALPOSITION;
+ return true;
+ } else if ("beltStatus" == literal) {
+ *result = P_BELTSTATUS;
+ return true;
+ } else if ("driverBraking" == literal) {
+ *result = P_DRIVERBRAKING;
+ return true;
+ } else if ("prndl" == literal) {
+ *result = P_PRNDL;
+ return true;
+ } else if ("rpm" == literal) {
+ *result = P_RPM;
+ return true;
+ } else if ("steeringWheelAngle" == literal) {
+ *result = P_STEERINGWHEELANGLE;
+ return true;
+ } else if ("myKey" == literal) {
+ *result = P_MYKEY;
+ return true;
+ } else if ("airbagStatus" == literal) {
+ *result = P_AIRBAGSTATUS;
+ return true;
+ } else if ("bodyInformation" == literal) {
+ *result = P_BODYINFORMATION;
+ return true;
+ } else if ("clusterModeStatus" == literal) {
+ *result = P_CLUSTERMODESTATUS;
+ return true;
+ } else if ("deviceStatus" == literal) {
+ *result = P_DEVICESTATUS;
+ return true;
+ } else if ("emergencyEvent" == literal) {
+ *result = P_EMERGENCYEVENT;
+ return true;
+ } else if ("eCallInfo" == literal) {
+ *result = P_ECALLINFO;
+ return true;
+ } else if ("abs_State" == literal) {
+ *result = P_ABS_STATE;
+ return true;
+ } else if ("turnSignal" == literal) {
+ *result = P_TURN_SIGNAL;
+ return true;
+ } else if ("fuelRange" == literal) {
+ *result = P_FUEL_RANGE;
+ return true;
+ } else if ("tirePressureValue" == literal) {
+ *result = P_TIRE_PRESSURE_VALUE;
+ return true;
+ } else if ("tpms" == literal) {
+ *result = P_TPMS;
+ return true;
+ } else if ("longitudeDegrees" == literal) {
+ *result = P_LONGTITUDE_DEGREES;
+ return true;
+ } else if ("latitudeDegrees" == literal) {
+ *result = P_LATITUDE_DEGREES;
+ return true;
+ } else if ("locationName" == literal) {
+ *result = P_LOCATION_NAME;
+ return true;
+ } else if ("locationDescription" == literal) {
+ *result = P_LOCATION_DESCRIPTION;
+ return true;
+ } else if ("addressLines" == literal) {
+ *result = P_ADDRESS_LINES;
+ return true;
+ } else if ("phoneNumber" == literal) {
+ *result = P_PHONE_NUMBER;
+ return true;
+ } else if ("locationImage" == literal) {
+ *result = P_LOCATION_IMAGE;
+ return true;
+ } else if ("deliveryMode" == literal) {
+ *result = P_DELIVERY_MODE;
+ return true;
+ } else if ("timeStamp" == literal) {
+ *result = P_TIMESTAMP;
+ return true;
+ } else if ("address" == literal) {
+ *result = P_ADDRESS;
+ return true;
+ } else if ("EMPTY" == literal) {
+ *result = P_EMPTY;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool IsValidEnum(AppHMIType val) {
+ switch (val) {
+ case AHT_DEFAULT:
+ return true;
+ case AHT_COMMUNICATION:
+ return true;
+ case AHT_MEDIA:
+ return true;
+ case AHT_MESSAGING:
+ return true;
+ case AHT_NAVIGATION:
+ return true;
+ case AHT_INFORMATION:
+ return true;
+ case AHT_SOCIAL:
+ return true;
+ case AHT_BACKGROUND_PROCESS:
+ return true;
+ case AHT_TESTING:
+ return true;
+ case AHT_SYSTEM:
+ return true;
+ case AHT_PROJECTION:
+ return true;
+ case AHT_REMOTE_CONTROL:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(AppHMIType val) {
+ switch (val) {
+ case AHT_DEFAULT:
+ return "DEFAULT";
+ case AHT_COMMUNICATION:
+ return "COMMUNICATION";
+ case AHT_MEDIA:
+ return "MEDIA";
+ case AHT_MESSAGING:
+ return "MESSAGING";
+ case AHT_NAVIGATION:
+ return "NAVIGATION";
+ case AHT_INFORMATION:
+ return "INFORMATION";
+ case AHT_SOCIAL:
+ return "SOCIAL";
+ case AHT_BACKGROUND_PROCESS:
+ return "BACKGROUND_PROCESS";
+ case AHT_TESTING:
+ return "TESTING";
+ case AHT_SYSTEM:
+ return "SYSTEM";
+ case AHT_PROJECTION:
+ return "PROJECTION";
+ case AHT_REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
+ default:
+ return "";
+ }
+}
+bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
+ if ("DEFAULT" == literal) {
+ *result = AHT_DEFAULT;
+ return true;
+ } else if ("COMMUNICATION" == literal) {
+ *result = AHT_COMMUNICATION;
+ return true;
+ } else if ("MEDIA" == literal) {
+ *result = AHT_MEDIA;
+ return true;
+ } else if ("MESSAGING" == literal) {
+ *result = AHT_MESSAGING;
+ return true;
+ } else if ("NAVIGATION" == literal) {
+ *result = AHT_NAVIGATION;
+ return true;
+ } else if ("INFORMATION" == literal) {
+ *result = AHT_INFORMATION;
+ return true;
+ } else if ("SOCIAL" == literal) {
+ *result = AHT_SOCIAL;
+ return true;
+ } else if ("BACKGROUND_PROCESS" == literal) {
+ *result = AHT_BACKGROUND_PROCESS;
+ return true;
+ } else if ("TESTING" == literal) {
+ *result = AHT_TESTING;
+ return true;
+ } else if ("SYSTEM" == literal) {
+ *result = AHT_SYSTEM;
+ return true;
+ } else if ("PROJECTION" == literal) {
+ *result = AHT_PROJECTION;
+ return true;
+ } else if ("REMOTE_CONTROL" == literal) {
+ *result = AHT_REMOTE_CONTROL;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool IsValidEnum(Input val) {
+ switch (val) {
+ case I_GUI:
+ return true;
+ case I_VUI:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(Input val) {
+ switch (val) {
+ case I_GUI:
+ return "GUI";
+ case I_VUI:
+ return "VUI";
+ default:
+ return "";
+ }
+}
+bool EnumFromJsonString(const std::string& literal, Input* result) {
+ if ("GUI" == literal) {
+ *result = I_GUI;
+ return true;
+ } else if ("VUI" == literal) {
+ *result = I_VUI;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+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;
+ }
+}
+
+#ifdef SDL_REMOTE_CONTROL
+bool IsValidEnum(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return true;
+ case MT_RADIO:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return "CLIMATE";
+ case MT_RADIO:
+ return "RADIO";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
+ if ("CLIMATE" == literal) {
+ *result = MT_CLIMATE;
+ return true;
+ } else if ("RADIO" == literal) {
+ *result = MT_RADIO;
+ return true;
+ } else {
+ return false;
+ }
+}
+#endif // SDL_REMOTE_CONTROL
+
+const std::string kDefaultApp = "default";
+const std::string kPreDataConsentApp = "pre_DataConsent";
+const std::string kDeviceApp = "device";
+
+} // namespace policy_table_interface_base
+} // namespace rpc
diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc
new file mode 100644
index 0000000000..da83626448
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_table/types.cc
@@ -0,0 +1,2161 @@
+#include <algorithm>
+#include "policy/policy_table/types.h"
+#include "rpc_base/rpc_base_json_inl.h"
+
+namespace rpc {
+namespace policy_table_interface_base {
+
+std::string PolicyTableTypeToString(const PolicyTableType pt_type) {
+ switch (pt_type) {
+ case PT_PRELOADED: {
+ return "PT_PRELOADED";
+ }
+ case PT_UPDATE: {
+ return "PT_UPDATE";
+ }
+ case PT_SNAPSHOT: {
+ return "PT_SNAPSHOT";
+ }
+ default: { return "INVALID_PT_TYPE"; }
+ }
+}
+
+// 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() : PolicyBase() {}
+
+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__)
+ : PolicyBase(value__)
+ , nicknames(impl::ValueMember(value__, "nicknames"))
+ , AppHMIType(impl::ValueMember(value__, "AppHMIType"))
+ , RequestType(impl::ValueMember(value__, "RequestType"))
+ , memory_kb(impl::ValueMember(value__, "memory_kb"), 0)
+ , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms"))
+#ifdef SDL_REMOTE_CONTROL
+ , moduleType(impl::ValueMember(value__, "moduleType"))
+#endif // SDL_REMOTE_CONTROL
+{
+}
+
+Json::Value ApplicationParams::ToJsonValue() const {
+ Json::Value result__(PolicyBase::ToJsonValue());
+ impl::WriteJsonField("nicknames", nicknames, &result__);
+ impl::WriteJsonField("AppHMIType", AppHMIType, &result__);
+ impl::WriteJsonField("RequestType", RequestType, &result__);
+ impl::WriteJsonField("memory_kb", memory_kb, &result__);
+ impl::WriteJsonField(
+ "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
+#ifdef SDL_REMOTE_CONTROL
+ impl::WriteJsonField("moduleType", moduleType, &result__);
+#endif // SDL_REMOTE_CONTROL
+ return result__;
+}
+
+bool ApplicationParams::is_valid() const {
+ // RequestType is not validated since there is high-level validation logic,
+ // which takes into account information not available here.
+ if (!PolicyBase::is_valid()) {
+ return false;
+ }
+ if (!nicknames.is_valid()) {
+ return false;
+ }
+ if (!AppHMIType.is_valid()) {
+ return false;
+ }
+ if (!memory_kb.is_valid()) {
+ return false;
+ }
+ if (!heart_beat_timeout_ms.is_valid()) {
+ return false;
+ }
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
+ return Validate();
+}
+
+bool ApplicationParams::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ApplicationParams::struct_empty() const {
+ if (!PolicyBase::is_initialized()) {
+ return false;
+ }
+ if (nicknames.is_initialized()) {
+ return false;
+ }
+ if (AppHMIType.is_initialized()) {
+ return false;
+ }
+ if (RequestType.is_initialized()) {
+ return false;
+ }
+ if (memory_kb.is_initialized()) {
+ return false;
+ }
+ if (heart_beat_timeout_ms.is_initialized()) {
+ return false;
+ }
+#ifdef SDL_REMOTE_CONTROL
+ if (moduleType.is_initialized()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
+ return true;
+}
+
+void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!groups.is_valid()) {
+ groups.ReportErrors(&report__->ReportSubobject("groups"));
+ }
+ 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"));
+ }
+ if (!heart_beat_timeout_ms.is_valid()) {
+ heart_beat_timeout_ms.ReportErrors(
+ &report__->ReportSubobject("heart_beat_timeout_ms"));
+ }
+
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
+ }
+#endif // SDL_REMOTE_CONTROL
+}
+
+void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
+ PolicyBase::SetPolicyTableType(pt_type);
+ AppHMIType.SetPolicyTableType(pt_type);
+ RequestType.SetPolicyTableType(pt_type);
+ memory_kb.SetPolicyTableType(pt_type);
+ heart_beat_timeout_ms.SetPolicyTableType(pt_type);
+#ifdef SDL_REMOTE_CONTROL
+ moduleType.SetPolicyTableType(pt_type);
+#endif // SDL_REMOTE_CONTROL
+}
+
+// RpcParameters methods
+RpcParameters::RpcParameters() : CompositeType(kUninitialized) {}
+
+RpcParameters::RpcParameters(const HmiLevels& hmi_levels)
+ : CompositeType(kUninitialized), hmi_levels(hmi_levels) {}
+
+RpcParameters::~RpcParameters() {}
+
+RpcParameters::RpcParameters(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , hmi_levels(impl::ValueMember(value__, "hmi_levels"))
+ , parameters(impl::ValueMember(value__, "parameters")) {}
+
+Json::Value RpcParameters::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("hmi_levels", hmi_levels, &result__);
+ impl::WriteJsonField("parameters", parameters, &result__);
+ return result__;
+}
+
+bool RpcParameters::is_valid() const {
+ if (!hmi_levels.is_valid()) {
+ return false;
+ }
+ if (!parameters.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool RpcParameters::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool RpcParameters::struct_empty() const {
+ if (hmi_levels.is_initialized()) {
+ return false;
+ }
+ if (parameters.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void RpcParameters::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!hmi_levels.is_valid()) {
+ hmi_levels.ReportErrors(&report__->ReportSubobject("hmi_levels"));
+ }
+ if (!parameters.is_valid()) {
+ parameters.ReportErrors(&report__->ReportSubobject("parameters"));
+ }
+}
+
+void RpcParameters::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ hmi_levels.SetPolicyTableType(pt_type);
+ parameters.SetPolicyTableType(pt_type);
+}
+
+// Rpcs methods
+Rpcs::Rpcs() : CompositeType(kUninitialized) {}
+
+Rpcs::Rpcs(const Rpc& rpcs) : CompositeType(kUninitialized), rpcs(rpcs) {}
+
+Rpcs::~Rpcs() {}
+
+Rpcs::Rpcs(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , user_consent_prompt(impl::ValueMember(value__, "user_consent_prompt"))
+ , rpcs(impl::ValueMember(value__, "rpcs"))
+ , disallowed_by_external_consent_entities_on(impl::ValueMember(
+ value__, "disallowed_by_external_consent_entities_on"))
+ , disallowed_by_external_consent_entities_off(impl::ValueMember(
+ value__, "disallowed_by_external_consent_entities_off")) {}
+
+Json::Value Rpcs::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("user_consent_prompt", user_consent_prompt, &result__);
+ impl::WriteJsonField("rpcs", rpcs, &result__);
+ impl::WriteJsonField("disallowed_by_external_consent_entities_on",
+ disallowed_by_external_consent_entities_on,
+ &result__);
+ impl::WriteJsonField("disallowed_by_external_consent_entities_off",
+ disallowed_by_external_consent_entities_off,
+ &result__);
+ return result__;
+}
+
+bool Rpcs::is_valid() const {
+ if (!user_consent_prompt.is_valid()) {
+ return false;
+ }
+ if (!rpcs.is_valid()) {
+ return false;
+ }
+ if (!disallowed_by_external_consent_entities_on.is_valid()) {
+ return false;
+ }
+ if (!disallowed_by_external_consent_entities_off.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool Rpcs::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool Rpcs::struct_empty() const {
+ if (user_consent_prompt.is_initialized()) {
+ return false;
+ }
+ if (rpcs.is_initialized()) {
+ return false;
+ }
+ if (disallowed_by_external_consent_entities_on.is_initialized()) {
+ return false;
+ }
+ if (disallowed_by_external_consent_entities_off.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void Rpcs::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!user_consent_prompt.is_valid()) {
+ user_consent_prompt.ReportErrors(
+ &report__->ReportSubobject("user_consent_prompt"));
+ }
+ if (!rpcs.is_valid()) {
+ rpcs.ReportErrors(&report__->ReportSubobject("rpcs"));
+ }
+ if (!disallowed_by_external_consent_entities_on.is_valid()) {
+ disallowed_by_external_consent_entities_on.ReportErrors(
+ &report__->ReportSubobject(
+ "disallowed_by_external_consent_entities_on"));
+ }
+ if (!disallowed_by_external_consent_entities_off.is_valid()) {
+ disallowed_by_external_consent_entities_off.ReportErrors(
+ &report__->ReportSubobject(
+ "disallowed_by_external_consent_entities_off"));
+ }
+}
+
+void Rpcs::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ user_consent_prompt.SetPolicyTableType(pt_type);
+ rpcs.SetPolicyTableType(pt_type);
+ disallowed_by_external_consent_entities_off.SetPolicyTableType(pt_type);
+ disallowed_by_external_consent_entities_on.SetPolicyTableType(pt_type);
+}
+
+// ModuleConfig methods
+ModuleConfig::ModuleConfig() : CompositeType(kUninitialized) {}
+
+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)
+ : CompositeType(kUninitialized)
+ , exchange_after_x_ignition_cycles(exchange_after_x_ignition_cycles)
+ , exchange_after_x_kilometers(exchange_after_x_kilometers)
+ , exchange_after_x_days(exchange_after_x_days)
+ , timeout_after_x_seconds(timeout_after_x_seconds)
+ , seconds_between_retries(seconds_between_retries)
+ , endpoints(endpoints)
+ , notifications_per_minute_by_priority(
+ notifications_per_minute_by_priority) {}
+
+ModuleConfig::~ModuleConfig() {}
+
+ModuleConfig::ModuleConfig(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , exchange_after_x_ignition_cycles(
+ impl::ValueMember(value__, "exchange_after_x_ignition_cycles"))
+ , exchange_after_x_kilometers(
+ impl::ValueMember(value__, "exchange_after_x_kilometers"))
+ , exchange_after_x_days(impl::ValueMember(value__, "exchange_after_x_days"))
+ , timeout_after_x_seconds(
+ impl::ValueMember(value__, "timeout_after_x_seconds"))
+ , seconds_between_retries(
+ impl::ValueMember(value__, "seconds_between_retries"))
+ , endpoints(impl::ValueMember(value__, "endpoints"))
+ , notifications_per_minute_by_priority(
+ impl::ValueMember(value__, "notifications_per_minute_by_priority"))
+ , vehicle_make(impl::ValueMember(value__, "vehicle_make"))
+ , vehicle_model(impl::ValueMember(value__, "vehicle_model"))
+ , vehicle_year(impl::ValueMember(value__, "vehicle_year"))
+ , preloaded_date(impl::ValueMember(value__, "preloaded_date"))
+ , certificate(impl::ValueMember(value__, "certificate"))
+ , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) {}
+
+void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
+ exchange_after_x_days = from.exchange_after_x_days;
+ exchange_after_x_kilometers = from.exchange_after_x_kilometers;
+ exchange_after_x_days = from.exchange_after_x_days;
+ exchange_after_x_ignition_cycles = from.exchange_after_x_ignition_cycles;
+ timeout_after_x_seconds = from.timeout_after_x_seconds;
+ seconds_between_retries = from.seconds_between_retries;
+ endpoints = from.endpoints;
+ notifications_per_minute_by_priority =
+ from.notifications_per_minute_by_priority;
+
+ certificate.assign_if_valid(from.certificate);
+ vehicle_make.assign_if_valid(from.vehicle_make);
+ vehicle_model.assign_if_valid(from.vehicle_model);
+ vehicle_year.assign_if_valid(from.vehicle_year);
+}
+
+Json::Value ModuleConfig::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("certificate", certificate, &result__);
+ impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField("exchange_after_x_ignition_cycles",
+ exchange_after_x_ignition_cycles,
+ &result__);
+ impl::WriteJsonField(
+ "exchange_after_x_kilometers", exchange_after_x_kilometers, &result__);
+ impl::WriteJsonField(
+ "exchange_after_x_days", exchange_after_x_days, &result__);
+ impl::WriteJsonField(
+ "timeout_after_x_seconds", timeout_after_x_seconds, &result__);
+ impl::WriteJsonField(
+ "seconds_between_retries", seconds_between_retries, &result__);
+ impl::WriteJsonField("endpoints", endpoints, &result__);
+ impl::WriteJsonField("notifications_per_minute_by_priority",
+ notifications_per_minute_by_priority,
+ &result__);
+ impl::WriteJsonField("vehicle_make", vehicle_make, &result__);
+ impl::WriteJsonField("vehicle_model", vehicle_model, &result__);
+ impl::WriteJsonField("vehicle_year", vehicle_year, &result__);
+ impl::WriteJsonField("certificate", certificate, &result__);
+ impl::WriteJsonField("preloaded_date", preloaded_date, &result__);
+ return result__;
+}
+
+bool ModuleConfig::is_valid() const {
+ if (!certificate.is_valid()) {
+ return false;
+ }
+ if (!preloaded_pt.is_valid()) {
+ return false;
+ }
+ if (!exchange_after_x_ignition_cycles.is_valid()) {
+ return false;
+ }
+ if (!exchange_after_x_kilometers.is_valid()) {
+ return false;
+ }
+ if (!exchange_after_x_days.is_valid()) {
+ return false;
+ }
+ if (!timeout_after_x_seconds.is_valid()) {
+ return false;
+ }
+ if (!seconds_between_retries.is_valid()) {
+ return false;
+ }
+ if (!endpoints.is_valid()) {
+ return false;
+ }
+ if (!notifications_per_minute_by_priority.is_valid()) {
+ return false;
+ }
+ if (!vehicle_make.is_valid()) {
+ return false;
+ }
+ if (!vehicle_model.is_valid()) {
+ return false;
+ }
+ if (!vehicle_year.is_valid()) {
+ return false;
+ }
+ if (!certificate.is_valid()) {
+ return false;
+ }
+ if (!preloaded_date.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool ModuleConfig::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ModuleConfig::struct_empty() const {
+ if (certificate.is_initialized()) {
+ return false;
+ }
+ if (preloaded_pt.is_initialized()) {
+ return false;
+ }
+
+ if (exchange_after_x_ignition_cycles.is_initialized()) {
+ return false;
+ }
+ if (exchange_after_x_kilometers.is_initialized()) {
+ return false;
+ }
+
+ if (exchange_after_x_days.is_initialized()) {
+ return false;
+ }
+ if (timeout_after_x_seconds.is_initialized()) {
+ return false;
+ }
+
+ if (seconds_between_retries.is_initialized()) {
+ return false;
+ }
+ if (endpoints.is_initialized()) {
+ return false;
+ }
+
+ if (notifications_per_minute_by_priority.is_initialized()) {
+ return false;
+ }
+ if (vehicle_make.is_initialized()) {
+ return false;
+ }
+
+ if (vehicle_model.is_initialized()) {
+ return false;
+ }
+ if (vehicle_year.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!certificate.is_valid()) {
+ certificate.ReportErrors(&report__->ReportSubobject("certificate"));
+ }
+ if (!preloaded_pt.is_valid()) {
+ preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
+ }
+ if (!exchange_after_x_ignition_cycles.is_valid()) {
+ exchange_after_x_ignition_cycles.ReportErrors(
+ &report__->ReportSubobject("exchange_after_x_ignition_cycles"));
+ }
+ if (!exchange_after_x_kilometers.is_valid()) {
+ exchange_after_x_kilometers.ReportErrors(
+ &report__->ReportSubobject("exchange_after_x_kilometers"));
+ }
+ if (!exchange_after_x_days.is_valid()) {
+ exchange_after_x_days.ReportErrors(
+ &report__->ReportSubobject("exchange_after_x_days"));
+ }
+ if (!timeout_after_x_seconds.is_valid()) {
+ timeout_after_x_seconds.ReportErrors(
+ &report__->ReportSubobject("timeout_after_x_seconds"));
+ }
+ if (!seconds_between_retries.is_valid()) {
+ seconds_between_retries.ReportErrors(
+ &report__->ReportSubobject("seconds_between_retries"));
+ }
+ if (!endpoints.is_valid()) {
+ endpoints.ReportErrors(&report__->ReportSubobject("endpoints"));
+ }
+ if (!notifications_per_minute_by_priority.is_valid()) {
+ notifications_per_minute_by_priority.ReportErrors(
+ &report__->ReportSubobject("notifications_per_minute_by_priority"));
+ }
+ if (!vehicle_make.is_valid()) {
+ vehicle_make.ReportErrors(&report__->ReportSubobject("vehicle_make"));
+ }
+ if (!vehicle_model.is_valid()) {
+ vehicle_model.ReportErrors(&report__->ReportSubobject("vehicle_model"));
+ }
+ if (!vehicle_year.is_valid()) {
+ vehicle_year.ReportErrors(&report__->ReportSubobject("vehicle_year"));
+ }
+ const std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+
+ rpc::ValidationReport* omitted_field_report = NULL;
+ switch (GetPolicyTableType()) {
+ case PT_PRELOADED: {
+ if (vehicle_make.is_initialized()) {
+ omitted_field_report = &report__->ReportSubobject("vehicle_make");
+ omitted_field_report->set_validation_info(validation_info);
+ }
+ if (vehicle_year.is_initialized()) {
+ omitted_field_report = &report__->ReportSubobject("vehicle_year");
+ omitted_field_report->set_validation_info(validation_info);
+ }
+ if (vehicle_model.is_initialized()) {
+ omitted_field_report = &report__->ReportSubobject("vehicle_model");
+ omitted_field_report->set_validation_info(validation_info);
+ }
+ break;
+ }
+ case PT_UPDATE: {
+ if (preloaded_pt.is_initialized()) {
+ omitted_field_report = &report__->ReportSubobject("preloaded_pt");
+ omitted_field_report->set_validation_info(validation_info);
+ }
+ if (preloaded_date.is_initialized()) {
+ rpc::ValidationReport& preloaded_pt_omitted_field_report =
+ report__->ReportSubobject("preloaded_date");
+ preloaded_pt_omitted_field_report.set_validation_info(validation_info);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ certificate.SetPolicyTableType(pt_type);
+ preloaded_pt.SetPolicyTableType(pt_type);
+ exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
+ exchange_after_x_kilometers.SetPolicyTableType(pt_type);
+ exchange_after_x_days.SetPolicyTableType(pt_type);
+ timeout_after_x_seconds.SetPolicyTableType(pt_type);
+ seconds_between_retries.SetPolicyTableType(pt_type);
+ endpoints.SetPolicyTableType(pt_type);
+ notifications_per_minute_by_priority.SetPolicyTableType(pt_type);
+ vehicle_make.SetPolicyTableType(pt_type);
+ vehicle_model.SetPolicyTableType(pt_type);
+ vehicle_year.SetPolicyTableType(pt_type);
+}
+
+// MessageString methods
+MessageString::MessageString() : CompositeType(kUninitialized) {}
+
+MessageString::~MessageString() {}
+
+MessageString::MessageString(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , line1(impl::ValueMember(value__, "line1"))
+ , line2(impl::ValueMember(value__, "line2"))
+ , tts(impl::ValueMember(value__, "tts"))
+ , label(impl::ValueMember(value__, "label"))
+ , textBody(impl::ValueMember(value__, "textBody")) {}
+
+Json::Value MessageString::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("line1", line1, &result__);
+ impl::WriteJsonField("line2", line2, &result__);
+ impl::WriteJsonField("tts", tts, &result__);
+ impl::WriteJsonField("label", label, &result__);
+ impl::WriteJsonField("textBody", textBody, &result__);
+ return result__;
+}
+
+bool MessageString::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ if (!line1.is_valid()) {
+ return false;
+ }
+ if (!line2.is_valid()) {
+ return false;
+ }
+ if (!tts.is_valid()) {
+ return false;
+ }
+ if (!label.is_valid()) {
+ return false;
+ }
+ if (!textBody.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool MessageString::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool MessageString::struct_empty() const {
+ if (line1.is_initialized()) {
+ return false;
+ }
+ if (line2.is_initialized()) {
+ return false;
+ }
+
+ if (tts.is_initialized()) {
+ return false;
+ }
+ if (label.is_initialized()) {
+ return false;
+ }
+
+ if (textBody.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void MessageString::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!line1.is_valid()) {
+ line1.ReportErrors(&report__->ReportSubobject("line1"));
+ }
+ if (!line2.is_valid()) {
+ line2.ReportErrors(&report__->ReportSubobject("line2"));
+ }
+ if (!tts.is_valid()) {
+ tts.ReportErrors(&report__->ReportSubobject("tts"));
+ }
+ if (!label.is_valid()) {
+ label.ReportErrors(&report__->ReportSubobject("label"));
+ }
+ if (!textBody.is_valid()) {
+ textBody.ReportErrors(&report__->ReportSubobject("textBody"));
+ }
+}
+
+void MessageString::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ line1.SetPolicyTableType(pt_type);
+ line2.SetPolicyTableType(pt_type);
+ tts.SetPolicyTableType(pt_type);
+ label.SetPolicyTableType(pt_type);
+ textBody.SetPolicyTableType(pt_type);
+}
+
+// MessageLanguages methods
+const std::string MessageLanguages::default_language_("en-us");
+
+MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {}
+
+MessageLanguages::MessageLanguages(const Languages& languages)
+ : CompositeType(kUninitialized), languages(languages) {}
+
+MessageLanguages::~MessageLanguages() {}
+
+MessageLanguages::MessageLanguages(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , languages(impl::ValueMember(value__, "languages")) {}
+
+Json::Value MessageLanguages::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("languages", languages, &result__);
+ return result__;
+}
+
+bool MessageLanguages::is_valid() const {
+ if (!languages.is_valid()) {
+ return false;
+ }
+ // Each RPC must have message in english
+ if (languages.end() == languages.find(default_language_)) {
+ return false;
+ }
+ return Validate();
+}
+
+bool MessageLanguages::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool MessageLanguages::struct_empty() const {
+ if (languages.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void MessageLanguages::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (PT_SNAPSHOT == GetPolicyTableType()) {
+ if (languages.is_initialized()) {
+ std::string validation_info =
+ omitted_validation_info +
+ PolicyTableTypeToString(GetPolicyTableType());
+ report__->ReportSubobject("languages")
+ .set_validation_info(validation_info);
+ }
+ }
+ if (!languages.is_valid()) {
+ languages.ReportErrors(&report__->ReportSubobject("languages"));
+ }
+ if (languages.end() == languages.find(default_language_)) {
+ report__->set_validation_info(
+ "this message does not support the default language '" +
+ default_language_ + "'");
+ }
+}
+
+void MessageLanguages::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ languages.SetPolicyTableType(pt_type);
+}
+
+// ConsumerFriendlyMessages methods
+ConsumerFriendlyMessages::ConsumerFriendlyMessages()
+ : CompositeType(kUninitialized) {}
+
+ConsumerFriendlyMessages::ConsumerFriendlyMessages(const std::string& version)
+ : CompositeType(kUninitialized), version(version) {}
+
+ConsumerFriendlyMessages::~ConsumerFriendlyMessages() {}
+
+ConsumerFriendlyMessages::ConsumerFriendlyMessages(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , version(impl::ValueMember(value__, "version"))
+ , messages(impl::ValueMember(value__, "messages")) {}
+
+Json::Value ConsumerFriendlyMessages::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("version", version, &result__);
+ // According to requirements, it is not necessary to provide this to PTS
+ // impl::WriteJsonField("messages", messages, &result__);
+ return result__;
+}
+
+bool ConsumerFriendlyMessages::is_valid() const {
+ if (!version.is_valid()) {
+ return false;
+ }
+ if (!messages.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool ConsumerFriendlyMessages::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ConsumerFriendlyMessages::struct_empty() const {
+ if (version.is_initialized()) {
+ return false;
+ }
+ if (messages.is_initialized()) {
+ return false;
+ }
+
+ return true;
+}
+
+void ConsumerFriendlyMessages::ReportErrors(
+ rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!version.is_valid()) {
+ version.ReportErrors(&report__->ReportSubobject("version"));
+ }
+ if (PT_SNAPSHOT == GetPolicyTableType()) {
+ if (messages.is_initialized()) {
+ std::string validation_info =
+ omitted_validation_info +
+ PolicyTableTypeToString(GetPolicyTableType());
+ report__->ReportSubobject("messages")
+ .set_validation_info(validation_info);
+ }
+ }
+ if (!messages.is_valid()) {
+ messages.ReportErrors(&report__->ReportSubobject("messages"));
+ }
+}
+
+void ConsumerFriendlyMessages::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ version.SetPolicyTableType(pt_type);
+ messages.SetPolicyTableType(pt_type);
+}
+
+// ModuleMeta methods
+ModuleMeta::ModuleMeta() : CompositeType(kUninitialized) {}
+
+ModuleMeta::~ModuleMeta() {}
+
+ModuleMeta::ModuleMeta(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , ccpu_version(impl::ValueMember(value__, "ccpu_version"))
+ , language(impl::ValueMember(value__, "language"))
+ , wers_country_code(impl::ValueMember(value__, "wers_country_code"))
+ , pt_exchanged_at_odometer_x(
+ impl::ValueMember(value__, "pt_exchanged_at_odometer_x"))
+ , pt_exchanged_x_days_after_epoch(
+ impl::ValueMember(value__, "pt_exchanged_x_days_after_epoch"))
+ , ignition_cycles_since_last_exchange(
+ impl::ValueMember(value__, "ignition_cycles_since_last_exchange"))
+ , vin(impl::ValueMember(value__, "vin")) {}
+
+Json::Value ModuleMeta::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("ccpu_version", ccpu_version, &result__);
+ impl::WriteJsonField("language", language, &result__);
+ impl::WriteJsonField("wers_country_code", wers_country_code, &result__);
+ impl::WriteJsonField(
+ "pt_exchanged_at_odometer_x", pt_exchanged_at_odometer_x, &result__);
+ impl::WriteJsonField("pt_exchanged_x_days_after_epoch",
+ pt_exchanged_x_days_after_epoch,
+ &result__);
+ impl::WriteJsonField("ignition_cycles_since_last_exchange",
+ ignition_cycles_since_last_exchange,
+ &result__);
+ impl::WriteJsonField("vin", vin, &result__);
+ return result__;
+}
+
+bool ModuleMeta::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ if (!ccpu_version.is_valid()) {
+ return false;
+ }
+ if (!language.is_valid()) {
+ return false;
+ }
+ if (!wers_country_code.is_valid()) {
+ return false;
+ }
+ if (!pt_exchanged_at_odometer_x.is_valid()) {
+ return false;
+ }
+ if (!pt_exchanged_x_days_after_epoch.is_valid()) {
+ return false;
+ }
+ if (!ignition_cycles_since_last_exchange.is_valid()) {
+ return false;
+ }
+ if (!vin.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool ModuleMeta::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ModuleMeta::struct_empty() const {
+ if (ccpu_version.is_initialized()) {
+ return false;
+ }
+ if (language.is_initialized()) {
+ return false;
+ }
+
+ if (wers_country_code.is_initialized()) {
+ return false;
+ }
+ if (pt_exchanged_at_odometer_x.is_initialized()) {
+ return false;
+ }
+
+ if (pt_exchanged_x_days_after_epoch.is_initialized()) {
+ return false;
+ }
+ if (ignition_cycles_since_last_exchange.is_initialized()) {
+ return false;
+ }
+
+ if (vin.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void ModuleMeta::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!ccpu_version.is_valid()) {
+ ccpu_version.ReportErrors(&report__->ReportSubobject("ccpu_version"));
+ }
+ if (!language.is_valid()) {
+ language.ReportErrors(&report__->ReportSubobject("language"));
+ }
+ if (!wers_country_code.is_valid()) {
+ wers_country_code.ReportErrors(
+ &report__->ReportSubobject("wers_country_code"));
+ }
+ if (!pt_exchanged_at_odometer_x.is_valid()) {
+ pt_exchanged_at_odometer_x.ReportErrors(
+ &report__->ReportSubobject("pt_exchanged_at_odometer_x"));
+ }
+ if (!pt_exchanged_x_days_after_epoch.is_valid()) {
+ pt_exchanged_x_days_after_epoch.ReportErrors(
+ &report__->ReportSubobject("pt_exchanged_x_days_after_epoch"));
+ }
+ if (!ignition_cycles_since_last_exchange.is_valid()) {
+ ignition_cycles_since_last_exchange.ReportErrors(
+ &report__->ReportSubobject("ignition_cycles_since_last_exchange"));
+ }
+ if (!vin.is_valid()) {
+ vin.ReportErrors(&report__->ReportSubobject("vin"));
+ }
+ if (GetPolicyTableType() == PT_UPDATE ||
+ GetPolicyTableType() == PT_PRELOADED) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+ report__->set_validation_info(validation_info.c_str());
+ }
+}
+
+void ModuleMeta::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ ccpu_version.SetPolicyTableType(pt_type);
+ language.SetPolicyTableType(pt_type);
+ wers_country_code.SetPolicyTableType(pt_type);
+ pt_exchanged_at_odometer_x.SetPolicyTableType(pt_type);
+ pt_exchanged_x_days_after_epoch.SetPolicyTableType(pt_type);
+ ignition_cycles_since_last_exchange.SetPolicyTableType(pt_type);
+ vin.SetPolicyTableType(pt_type);
+}
+
+// AppLevel methods
+AppLevel::AppLevel() : CompositeType(kUninitialized) {}
+
+AppLevel::AppLevel(uint16_t minutes_in_hmi_full,
+ const std::string& app_registration_language_gui,
+ const std::string& app_registration_language_vui,
+ uint16_t minutes_in_hmi_limited,
+ uint16_t minutes_in_hmi_background,
+ uint16_t minutes_in_hmi_none,
+ uint16_t count_of_user_selections,
+ uint16_t count_of_rejections_sync_out_of_memory,
+ uint16_t count_of_rejections_nickname_mismatch,
+ uint16_t count_of_rejections_duplicate_name,
+ uint16_t count_of_rejected_rpc_calls,
+ uint16_t count_of_rpcs_sent_in_hmi_none,
+ uint16_t count_of_removals_for_bad_behavior,
+ uint16_t count_of_tls_errors,
+ uint16_t count_of_run_attempts_while_revoked)
+ : CompositeType(kUninitialized)
+ , minutes_in_hmi_full(minutes_in_hmi_full)
+ , app_registration_language_gui(app_registration_language_gui)
+ , app_registration_language_vui(app_registration_language_vui)
+ , minutes_in_hmi_limited(minutes_in_hmi_limited)
+ , minutes_in_hmi_background(minutes_in_hmi_background)
+ , minutes_in_hmi_none(minutes_in_hmi_none)
+ , count_of_user_selections(count_of_user_selections)
+ , count_of_rejections_sync_out_of_memory(
+ count_of_rejections_sync_out_of_memory)
+ , count_of_rejections_nickname_mismatch(
+ count_of_rejections_nickname_mismatch)
+ , count_of_rejections_duplicate_name(count_of_rejections_duplicate_name)
+ , count_of_rejected_rpc_calls(count_of_rejected_rpc_calls)
+ , count_of_rpcs_sent_in_hmi_none(count_of_rpcs_sent_in_hmi_none)
+ , count_of_removals_for_bad_behavior(count_of_removals_for_bad_behavior)
+ , count_of_tls_errors(count_of_tls_errors)
+ , count_of_run_attempts_while_revoked(count_of_run_attempts_while_revoked) {
+}
+
+AppLevel::~AppLevel() {}
+
+AppLevel::AppLevel(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , minutes_in_hmi_full(impl::ValueMember(value__, "minutes_in_hmi_full"))
+ , app_registration_language_gui(
+ impl::ValueMember(value__, "app_registration_language_gui"))
+ , app_registration_language_vui(
+ impl::ValueMember(value__, "app_registration_language_vui"))
+ , minutes_in_hmi_limited(
+ impl::ValueMember(value__, "minutes_in_hmi_limited"))
+ , minutes_in_hmi_background(
+ impl::ValueMember(value__, "minutes_in_hmi_background"))
+ , minutes_in_hmi_none(impl::ValueMember(value__, "minutes_in_hmi_none"))
+ , count_of_user_selections(
+ impl::ValueMember(value__, "count_of_user_selections"))
+ , count_of_rejections_sync_out_of_memory(
+ impl::ValueMember(value__, "count_of_rejections_sync_out_of_memory"))
+ , count_of_rejections_nickname_mismatch(
+ impl::ValueMember(value__, "count_of_rejections_nickname_mismatch"))
+ , count_of_rejections_duplicate_name(
+ impl::ValueMember(value__, "count_of_rejections_duplicate_name"))
+ , count_of_rejected_rpc_calls(
+ impl::ValueMember(value__, "count_of_rejected_rpc_calls"))
+ , count_of_rpcs_sent_in_hmi_none(
+ impl::ValueMember(value__, "count_of_rpcs_sent_in_hmi_none"))
+ , count_of_removals_for_bad_behavior(
+ impl::ValueMember(value__, "count_of_removals_for_bad_behavior"))
+ , count_of_tls_errors(impl::ValueMember(value__, "count_of_tls_errors"))
+ , count_of_run_attempts_while_revoked(
+ impl::ValueMember(value__, "count_of_run_attempts_while_revoked")) {}
+
+Json::Value AppLevel::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("minutes_in_hmi_full", minutes_in_hmi_full, &result__);
+ impl::WriteJsonField("app_registration_language_gui",
+ app_registration_language_gui,
+ &result__);
+ impl::WriteJsonField("app_registration_language_vui",
+ app_registration_language_vui,
+ &result__);
+ impl::WriteJsonField(
+ "minutes_in_hmi_limited", minutes_in_hmi_limited, &result__);
+ impl::WriteJsonField(
+ "minutes_in_hmi_background", minutes_in_hmi_background, &result__);
+ impl::WriteJsonField("minutes_in_hmi_none", minutes_in_hmi_none, &result__);
+ impl::WriteJsonField(
+ "count_of_user_selections", count_of_user_selections, &result__);
+ impl::WriteJsonField("count_of_rejections_sync_out_of_memory",
+ count_of_rejections_sync_out_of_memory,
+ &result__);
+ impl::WriteJsonField("count_of_rejections_nickname_mismatch",
+ count_of_rejections_nickname_mismatch,
+ &result__);
+ impl::WriteJsonField("count_of_rejections_duplicate_name",
+ count_of_rejections_duplicate_name,
+ &result__);
+ impl::WriteJsonField(
+ "count_of_rejected_rpc_calls", count_of_rejected_rpc_calls, &result__);
+ impl::WriteJsonField("count_of_rpcs_sent_in_hmi_none",
+ count_of_rpcs_sent_in_hmi_none,
+ &result__);
+ impl::WriteJsonField("count_of_removals_for_bad_behavior",
+ count_of_removals_for_bad_behavior,
+ &result__);
+ impl::WriteJsonField("count_of_TLS_errors", count_of_tls_errors, &result__);
+ impl::WriteJsonField("count_of_run_attempts_while_revoked",
+ count_of_run_attempts_while_revoked,
+ &result__);
+ return result__;
+}
+
+bool AppLevel::is_valid() const {
+ if (!minutes_in_hmi_full.is_valid()) {
+ return false;
+ }
+ if (!app_registration_language_gui.is_valid()) {
+ return false;
+ }
+ if (!app_registration_language_vui.is_valid()) {
+ return false;
+ }
+ if (!minutes_in_hmi_limited.is_valid()) {
+ return false;
+ }
+ if (!minutes_in_hmi_background.is_valid()) {
+ return false;
+ }
+ if (!minutes_in_hmi_none.is_valid()) {
+ return false;
+ }
+ if (!count_of_user_selections.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejections_sync_out_of_memory.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejections_nickname_mismatch.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejections_duplicate_name.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejected_rpc_calls.is_valid()) {
+ return false;
+ }
+ if (!count_of_rpcs_sent_in_hmi_none.is_valid()) {
+ return false;
+ }
+ if (!count_of_removals_for_bad_behavior.is_valid()) {
+ return false;
+ }
+ if (!count_of_tls_errors.is_valid()) {
+ return false;
+ }
+ if (!count_of_run_attempts_while_revoked.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool AppLevel::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool AppLevel::struct_empty() const {
+ if (minutes_in_hmi_full.is_initialized()) {
+ return false;
+ }
+ if (app_registration_language_gui.is_initialized()) {
+ return false;
+ }
+
+ if (app_registration_language_vui.is_initialized()) {
+ return false;
+ }
+
+ if (minutes_in_hmi_limited.is_initialized()) {
+ return false;
+ }
+ if (minutes_in_hmi_background.is_initialized()) {
+ return false;
+ }
+
+ if (minutes_in_hmi_none.is_initialized()) {
+ return false;
+ }
+ if (count_of_user_selections.is_initialized()) {
+ return false;
+ }
+
+ if (count_of_rejections_sync_out_of_memory.is_initialized()) {
+ return false;
+ }
+ if (count_of_rejections_nickname_mismatch.is_initialized()) {
+ return false;
+ }
+
+ if (count_of_rejections_duplicate_name.is_initialized()) {
+ return false;
+ }
+ if (count_of_rejected_rpc_calls.is_initialized()) {
+ return false;
+ }
+
+ if (count_of_rpcs_sent_in_hmi_none.is_initialized()) {
+ return false;
+ }
+ if (count_of_removals_for_bad_behavior.is_initialized()) {
+ return false;
+ }
+ if (count_of_tls_errors.is_initialized()) {
+ return false;
+ }
+ if (count_of_run_attempts_while_revoked.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void AppLevel::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!minutes_in_hmi_full.is_valid()) {
+ minutes_in_hmi_full.ReportErrors(
+ &report__->ReportSubobject("minutes_in_hmi_full"));
+ }
+ if (!app_registration_language_gui.is_valid()) {
+ app_registration_language_gui.ReportErrors(
+ &report__->ReportSubobject("app_registration_language_gui"));
+ }
+ if (!app_registration_language_vui.is_valid()) {
+ app_registration_language_vui.ReportErrors(
+ &report__->ReportSubobject("app_registration_language_vui"));
+ }
+ if (!minutes_in_hmi_limited.is_valid()) {
+ minutes_in_hmi_limited.ReportErrors(
+ &report__->ReportSubobject("minutes_in_hmi_limited"));
+ }
+ if (!minutes_in_hmi_background.is_valid()) {
+ minutes_in_hmi_background.ReportErrors(
+ &report__->ReportSubobject("minutes_in_hmi_background"));
+ }
+ if (!minutes_in_hmi_none.is_valid()) {
+ minutes_in_hmi_none.ReportErrors(
+ &report__->ReportSubobject("minutes_in_hmi_none"));
+ }
+ if (!count_of_user_selections.is_valid()) {
+ count_of_user_selections.ReportErrors(
+ &report__->ReportSubobject("count_of_user_selections"));
+ }
+ if (!count_of_rejections_sync_out_of_memory.is_valid()) {
+ count_of_rejections_sync_out_of_memory.ReportErrors(
+ &report__->ReportSubobject("count_of_rejections_sync_out_of_memory"));
+ }
+ if (!count_of_rejections_nickname_mismatch.is_valid()) {
+ count_of_rejections_nickname_mismatch.ReportErrors(
+ &report__->ReportSubobject("count_of_rejections_nickname_mismatch"));
+ }
+ if (!count_of_rejections_duplicate_name.is_valid()) {
+ count_of_rejections_duplicate_name.ReportErrors(
+ &report__->ReportSubobject("count_of_rejections_duplicate_name"));
+ }
+ if (!count_of_rejected_rpc_calls.is_valid()) {
+ count_of_rejected_rpc_calls.ReportErrors(
+ &report__->ReportSubobject("count_of_rejected_rpc_calls"));
+ }
+ if (!count_of_rpcs_sent_in_hmi_none.is_valid()) {
+ count_of_rpcs_sent_in_hmi_none.ReportErrors(
+ &report__->ReportSubobject("count_of_rpcs_sent_in_hmi_none"));
+ }
+ if (!count_of_removals_for_bad_behavior.is_valid()) {
+ count_of_removals_for_bad_behavior.ReportErrors(
+ &report__->ReportSubobject("count_of_removals_for_bad_behavior"));
+ }
+ if (!count_of_run_attempts_while_revoked.is_valid()) {
+ count_of_run_attempts_while_revoked.ReportErrors(
+ &report__->ReportSubobject("count_of_run_attempts_while_revoked"));
+ }
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+ report__->set_validation_info(validation_info);
+ }
+}
+
+void AppLevel::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ app_registration_language_gui.SetPolicyTableType(pt_type);
+ app_registration_language_vui.SetPolicyTableType(pt_type);
+ minutes_in_hmi_limited.SetPolicyTableType(pt_type);
+ minutes_in_hmi_full.SetPolicyTableType(pt_type);
+ minutes_in_hmi_background.SetPolicyTableType(pt_type);
+ minutes_in_hmi_none.SetPolicyTableType(pt_type);
+ count_of_user_selections.SetPolicyTableType(pt_type);
+ count_of_rejections_sync_out_of_memory.SetPolicyTableType(pt_type);
+ count_of_rejections_nickname_mismatch.SetPolicyTableType(pt_type);
+ count_of_rejections_duplicate_name.SetPolicyTableType(pt_type);
+ count_of_rejected_rpc_calls.SetPolicyTableType(pt_type);
+ count_of_rpcs_sent_in_hmi_none.SetPolicyTableType(pt_type);
+ count_of_removals_for_bad_behavior.SetPolicyTableType(pt_type);
+ count_of_run_attempts_while_revoked.SetPolicyTableType(pt_type);
+}
+
+// UsageAndErrorCounts methods
+UsageAndErrorCounts::UsageAndErrorCounts() : CompositeType(kUninitialized) {}
+
+UsageAndErrorCounts::~UsageAndErrorCounts() {}
+
+UsageAndErrorCounts::UsageAndErrorCounts(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , count_of_iap_buffer_full(
+ impl::ValueMember(value__, "count_of_iap_buffer_full"))
+ , count_sync_out_of_memory(
+ impl::ValueMember(value__, "count_sync_out_of_memory"))
+ , count_of_sync_reboots(impl::ValueMember(value__, "count_of_sync_reboots"))
+ , app_level(impl::ValueMember(value__, "app_level")) {}
+
+Json::Value UsageAndErrorCounts::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField(
+ "count_of_iap_buffer_full", count_of_iap_buffer_full, &result__);
+ impl::WriteJsonField(
+ "count_sync_out_of_memory", count_sync_out_of_memory, &result__);
+ impl::WriteJsonField(
+ "count_of_sync_reboots", count_of_sync_reboots, &result__);
+ impl::WriteJsonField("app_level", app_level, &result__);
+ return result__;
+}
+
+bool UsageAndErrorCounts::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ if (!count_of_iap_buffer_full.is_valid()) {
+ return false;
+ }
+ if (!count_sync_out_of_memory.is_valid()) {
+ return false;
+ }
+ if (!count_of_sync_reboots.is_valid()) {
+ return false;
+ }
+ if (!app_level.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool UsageAndErrorCounts::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool UsageAndErrorCounts::struct_empty() const {
+ if (count_of_iap_buffer_full.is_initialized()) {
+ return false;
+ }
+ if (count_sync_out_of_memory.is_initialized()) {
+ return false;
+ }
+
+ if (count_of_sync_reboots.is_initialized()) {
+ return false;
+ }
+ if (app_level.is_initialized()) {
+ return false;
+ }
+
+ return true;
+}
+
+void UsageAndErrorCounts::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+ report__->set_validation_info(validation_info);
+ }
+ if (!count_of_iap_buffer_full.is_valid()) {
+ count_of_iap_buffer_full.ReportErrors(
+ &report__->ReportSubobject("count_of_iap_buffer_full"));
+ }
+ if (!count_sync_out_of_memory.is_valid()) {
+ count_sync_out_of_memory.ReportErrors(
+ &report__->ReportSubobject("count_sync_out_of_memory"));
+ }
+ if (!count_of_sync_reboots.is_valid()) {
+ count_of_sync_reboots.ReportErrors(
+ &report__->ReportSubobject("count_of_sync_reboots"));
+ }
+ if (!app_level.is_valid()) {
+ app_level.ReportErrors(&report__->ReportSubobject("app_level"));
+ }
+}
+
+void UsageAndErrorCounts::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ count_of_iap_buffer_full.SetPolicyTableType(pt_type);
+ count_sync_out_of_memory.SetPolicyTableType(pt_type);
+ count_of_sync_reboots.SetPolicyTableType(pt_type);
+ app_level.SetPolicyTableType(pt_type);
+}
+
+// ConsentRecords methods
+ConsentRecords::ConsentRecords()
+ : CompositeType(kUninitialized)
+ , consent_last_updated(0)
+ , ext_consent_last_updated(0) {}
+
+ConsentRecords::~ConsentRecords() {}
+
+ConsentRecords::ConsentRecords(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , consent_groups(impl::ValueMember(value__, "consent_groups"))
+ , external_consent_status_groups(
+ impl::ValueMember(value__, "external_consent_status_groups"))
+ , input(impl::ValueMember(value__, "input"))
+ , time_stamp(impl::ValueMember(value__, "time_stamp"))
+ , consent_last_updated(0)
+ , ext_consent_last_updated(0) {}
+
+Json::Value ConsentRecords::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("consent_groups", consent_groups, &result__);
+ impl::WriteJsonField("external_consent_status_groups",
+ external_consent_status_groups,
+ &result__);
+ impl::WriteJsonField("input", input, &result__);
+ impl::WriteJsonField("time_stamp", time_stamp, &result__);
+ return result__;
+}
+
+bool ConsentRecords::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kUninitialized && Validate();
+ }
+ if (!consent_groups.is_valid()) {
+ return false;
+ }
+ if (!external_consent_status_groups.is_valid()) {
+ return false;
+ }
+ if (!input.is_valid()) {
+ return false;
+ }
+ if (!time_stamp.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool ConsentRecords::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ConsentRecords::struct_empty() const {
+ if (consent_groups.is_initialized()) {
+ return false;
+ }
+
+ if (external_consent_status_groups.is_initialized()) {
+ return false;
+ }
+ if (input.is_initialized()) {
+ return false;
+ }
+
+ if (time_stamp.is_initialized()) {
+ return false;
+ }
+
+ return true;
+}
+
+void ConsentRecords::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!consent_groups.is_valid()) {
+ consent_groups.ReportErrors(&report__->ReportSubobject("consent_groups"));
+ }
+ if (!external_consent_status_groups.is_valid()) {
+ external_consent_status_groups.ReportErrors(
+ &report__->ReportSubobject("external_consent_status_groups"));
+ }
+ if (!input.is_valid()) {
+ input.ReportErrors(&report__->ReportSubobject("input"));
+ }
+ if (!time_stamp.is_valid()) {
+ time_stamp.ReportErrors(&report__->ReportSubobject("time_stamp"));
+ }
+}
+
+void ConsentRecords::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ consent_groups.SetPolicyTableType(pt_type);
+ external_consent_status_groups.SetPolicyTableType(pt_type);
+ input.SetPolicyTableType(pt_type);
+ time_stamp.SetPolicyTableType(pt_type);
+}
+
+// DeviceParams methods
+DeviceParams::DeviceParams() : CompositeType(kUninitialized) {}
+
+DeviceParams::~DeviceParams() {}
+
+DeviceParams::DeviceParams(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , hardware(impl::ValueMember(value__, "hardware"))
+ , firmware_rev(impl::ValueMember(value__, "firmware_rev"))
+ , os(impl::ValueMember(value__, "os"))
+ , os_version(impl::ValueMember(value__, "os_version"))
+ , carrier(impl::ValueMember(value__, "carrier"))
+ , user_consent_records(impl::ValueMember(value__, "user_consent_records"))
+ , max_number_rfcom_ports(
+ impl::ValueMember(value__, "max_number_rfcom_ports"))
+ , connection_type(impl::ValueMember(value__, "connection_type")) {}
+
+Json::Value DeviceParams::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("hardware", hardware, &result__);
+ impl::WriteJsonField("firmware_rev", firmware_rev, &result__);
+ impl::WriteJsonField("os", os, &result__);
+ impl::WriteJsonField("os_version", os_version, &result__);
+ impl::WriteJsonField("carrier", carrier, &result__);
+ impl::WriteJsonField("user_consent_records", user_consent_records, &result__);
+ impl::WriteJsonField(
+ "max_number_rfcom_ports", max_number_rfcom_ports, &result__);
+ impl::WriteJsonField("connection_type", connection_type, &result__);
+ return result__;
+}
+
+bool DeviceParams::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ if (!hardware.is_valid()) {
+ return false;
+ }
+ if (!firmware_rev.is_valid()) {
+ return false;
+ }
+ if (!os.is_valid()) {
+ return false;
+ }
+ if (!os_version.is_valid()) {
+ return false;
+ }
+ if (!carrier.is_valid()) {
+ return false;
+ }
+ if (!user_consent_records.is_valid()) {
+ return false;
+ }
+ if (!max_number_rfcom_ports.is_valid()) {
+ return false;
+ }
+ if (!connection_type.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool DeviceParams::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool DeviceParams::struct_empty() const {
+ if (hardware.is_initialized()) {
+ return false;
+ }
+ if (firmware_rev.is_initialized()) {
+ return false;
+ }
+
+ if (os.is_initialized()) {
+ return false;
+ }
+ if (os_version.is_initialized()) {
+ return false;
+ }
+
+ if (carrier.is_initialized()) {
+ return false;
+ }
+ if (user_consent_records.is_initialized()) {
+ return false;
+ }
+
+ if (max_number_rfcom_ports.is_initialized()) {
+ return false;
+ }
+
+ if (connection_type.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void DeviceParams::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!hardware.is_valid()) {
+ hardware.ReportErrors(&report__->ReportSubobject("hardware"));
+ }
+ if (!firmware_rev.is_valid()) {
+ firmware_rev.ReportErrors(&report__->ReportSubobject("firmware_rev"));
+ }
+ if (!os.is_valid()) {
+ os.ReportErrors(&report__->ReportSubobject("os"));
+ }
+ if (!os_version.is_valid()) {
+ os_version.ReportErrors(&report__->ReportSubobject("os_version"));
+ }
+ if (!carrier.is_valid()) {
+ carrier.ReportErrors(&report__->ReportSubobject("carrier"));
+ }
+ if (!user_consent_records.is_valid()) {
+ user_consent_records.ReportErrors(
+ &report__->ReportSubobject("user_consent_records"));
+ }
+ if (!max_number_rfcom_ports.is_valid()) {
+ max_number_rfcom_ports.ReportErrors(
+ &report__->ReportSubobject("max_number_rfcom_ports"));
+ }
+ if (!connection_type.is_valid()) {
+ connection_type.ReportErrors(&report__->ReportSubobject("connection_type"));
+ }
+}
+
+void DeviceParams::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ hardware.SetPolicyTableType(pt_type);
+ firmware_rev.SetPolicyTableType(pt_type);
+ os.SetPolicyTableType(pt_type);
+ os_version.SetPolicyTableType(pt_type);
+ carrier.SetPolicyTableType(pt_type);
+ user_consent_records.SetPolicyTableType(pt_type);
+ max_number_rfcom_ports.SetPolicyTableType(pt_type);
+ connection_type.SetPolicyTableType(pt_type);
+}
+
+// PolicyTable methods
+PolicyTable::PolicyTable() : CompositeType(kUninitialized) {}
+
+PolicyTable::PolicyTable(
+ const ApplicationPoliciesSection& app_policies_section,
+ const FunctionalGroupings& functional_groupings,
+ const ConsumerFriendlyMessages& consumer_friendly_messages,
+ const ModuleConfig& module_config)
+ : CompositeType(kUninitialized)
+ , app_policies_section(app_policies_section)
+ , functional_groupings(functional_groupings)
+ , consumer_friendly_messages(consumer_friendly_messages)
+ , module_config(module_config) {}
+
+PolicyTable::~PolicyTable() {}
+
+PolicyTable::PolicyTable(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , 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"))
+ , module_meta(impl::ValueMember(value__, "module_meta"))
+ , usage_and_error_counts(
+ impl::ValueMember(value__, "usage_and_error_counts"))
+ , device_data(impl::ValueMember(value__, "device_data")) {}
+
+Json::Value PolicyTable::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ 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__);
+ impl::WriteJsonField("module_meta", module_meta, &result__);
+ impl::WriteJsonField(
+ "usage_and_error_counts", usage_and_error_counts, &result__);
+ impl::WriteJsonField("device_data", device_data, &result__);
+ return result__;
+}
+
+bool PolicyTable::is_valid() const {
+ if (!app_policies_section.is_valid()) {
+ return false;
+ }
+ if (!functional_groupings.is_valid()) {
+ return false;
+ }
+ if (!consumer_friendly_messages.is_valid()) {
+ return false;
+ }
+ if (!module_config.is_valid()) {
+ return false;
+ }
+ if (!module_meta.is_valid()) {
+ return false;
+ }
+ if (!usage_and_error_counts.is_valid()) {
+ return false;
+ }
+ if (!device_data.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool PolicyTable::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool PolicyTable::struct_empty() const {
+ if (app_policies_section.is_initialized()) {
+ return false;
+ }
+ if (functional_groupings.is_initialized()) {
+ return false;
+ }
+
+ if (consumer_friendly_messages.is_initialized()) {
+ return false;
+ }
+ if (module_config.is_initialized()) {
+ return false;
+ }
+
+ if (module_meta.is_initialized()) {
+ return false;
+ }
+ if (usage_and_error_counts.is_initialized()) {
+ return false;
+ }
+
+ if (device_data.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void PolicyTable::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+
+ if (device_data.is_initialized()) {
+ report__->ReportSubobject("device_data")
+ .set_validation_info(validation_info);
+ }
+ }
+ 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"));
+ }
+ if (!consumer_friendly_messages.is_valid()) {
+ consumer_friendly_messages.ReportErrors(
+ &report__->ReportSubobject("consumer_friendly_messages"));
+ }
+ if (!module_config.is_valid()) {
+ module_config.ReportErrors(&report__->ReportSubobject("module_config"));
+ }
+ if (!module_meta.is_valid()) {
+ module_meta.ReportErrors(&report__->ReportSubobject("module_meta"));
+ }
+ if (!usage_and_error_counts.is_valid()) {
+ usage_and_error_counts.ReportErrors(
+ &report__->ReportSubobject("usage_and_error_counts"));
+ }
+ if (!device_data.is_valid()) {
+ device_data.ReportErrors(&report__->ReportSubobject("device_data"));
+ }
+}
+
+void PolicyTable::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::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);
+ module_meta.SetPolicyTableType(pt_type);
+ usage_and_error_counts.SetPolicyTableType(pt_type);
+ device_data.SetPolicyTableType(pt_type);
+}
+
+// Table methods
+Table::Table() : CompositeType(kUninitialized) {}
+
+Table::Table(const PolicyTable& policy_table)
+ : CompositeType(kUninitialized), policy_table(policy_table) {}
+
+Table::~Table() {}
+
+Table::Table(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , policy_table(impl::ValueMember(value__, "policy_table")) {}
+
+Json::Value Table::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("policy_table", policy_table, &result__);
+ return result__;
+}
+
+bool Table::is_valid() const {
+ if (!policy_table.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool Table::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool Table::struct_empty() const {
+ if (policy_table.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void Table::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!policy_table.is_valid()) {
+ policy_table.ReportErrors(&report__->ReportSubobject("policy_table"));
+ }
+}
+
+void Table::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ policy_table.SetPolicyTableType(pt_type);
+}
+
+RequestTypes::RequestTypes() : RequestsTypeArray(), is_cleaned_up_(false) {}
+
+RequestTypes::RequestTypes(Json::Value* value)
+ : RequestsTypeArray(value), is_cleaned_up_(false) {}
+
+RequestTypes::RequestTypes(const Json::Value* value)
+ : RequestsTypeArray(value), is_cleaned_up_(false) {}
+
+void RequestTypes::CleanUp() {
+ if (!this->size()) {
+ return;
+ }
+ this->erase(
+ std::remove_if(
+ this->begin(),
+ this->end(),
+ std::not1(std::mem_fun_ref(&RequestTypes::value_type::is_valid))),
+ this->end());
+
+ is_cleaned_up_ = !this->size();
+}
+
+bool RequestTypes::is_valid() const {
+ // Array size must be within allowed range
+ if (!Range<size_t>(0, 255).Includes(this->size())) {
+ return false;
+ }
+ RequestTypes::const_iterator it = std::find_if(
+ this->begin(),
+ this->end(),
+ std::not1(std::mem_fun_ref(&RequestTypes::value_type::is_valid)));
+ if (this->end() != it) {
+ return false;
+ }
+ return true;
+}
+
+bool RequestTypes::is_omitted() const {
+ return this->empty() && !this->is_initialized();
+}
+
+bool RequestTypes::is_empty() const {
+ return this->empty() && this->is_initialized();
+}
+
+bool RequestTypes::is_cleaned_up() const {
+ return is_cleaned_up_;
+}
+
+ExternalConsentEntity::ExternalConsentEntity()
+ : CompositeType(kUninitialized)
+ , entity_type(INT32_MAX)
+ , entity_id(INT32_MAX) {}
+
+ExternalConsentEntity::ExternalConsentEntity(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , entity_type(impl::ValueMember(value__, "entityType"))
+ , entity_id(impl::ValueMember(value__, "entityID")) {}
+
+ExternalConsentEntity::ExternalConsentEntity(const int32_t type,
+ const int32_t id)
+ : CompositeType(kInitialized), entity_type(type), entity_id(id) {}
+
+Json::Value ExternalConsentEntity::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("entityType", entity_type, &result__);
+ impl::WriteJsonField("entityID", entity_id, &result__);
+ return result__;
+}
+
+bool ExternalConsentEntity::operator==(const ExternalConsentEntity& rhs) const {
+ return rhs.entity_id == this->entity_id &&
+ rhs.entity_type == this->entity_type;
+}
+
+bool ExternalConsentEntity::is_valid() const {
+ if (!is_initialized()) {
+ return false;
+ }
+ if (!entity_type.is_valid()) {
+ return false;
+ }
+ if (!entity_id.is_valid()) {
+ return false;
+ }
+ return true;
+}
+
+bool ExternalConsentEntity::is_initialized() const {
+ return kInitialized == initialization_state__;
+}
+
+void ExternalConsentEntity::ReportErrors(ValidationReport* report__) const {
+ if (!entity_type.is_valid()) {
+ entity_type.ReportErrors(&report__->ReportSubobject("entityType"));
+ }
+ if (!entity_id.is_valid()) {
+ entity_id.ReportErrors(&report__->ReportSubobject("entityID"));
+ }
+}
+
+void ExternalConsentEntity::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ entity_type.SetPolicyTableType(pt_type);
+ entity_id.SetPolicyTableType(pt_type);
+}
+
+} // namespace policy_table_interface_base
+} // namespace rpc
diff --git a/src/components/policy/policy_external/src/policy_table/validation.cc b/src/components/policy/policy_external/src/policy_table/validation.cc
new file mode 100644
index 0000000000..48a8578855
--- /dev/null
+++ b/src/components/policy/policy_external/src/policy_table/validation.cc
@@ -0,0 +1,307 @@
+#include <iostream>
+#include <algorithm>
+#include "policy/policy_table/types.h"
+#include "utils/logger.h"
+#include "utils/helpers.h"
+
+namespace {
+bool IsPredefinedApplication(const std::string& app_id) {
+ using namespace rpc::policy_table_interface_base;
+ return kPreDataConsentApp == app_id || kDefaultApp == app_id;
+}
+}
+
+namespace rpc {
+namespace policy_table_interface_base {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+bool VerifyPredefinedApp(ApplicationPolicies::value_type& app_policies) {
+ const std::string& app_id = app_policies.first;
+ if (!IsPredefinedApplication(app_id)) {
+ return true;
+ }
+
+ RequestTypes& predefined_request_types = *app_policies.second.RequestType;
+
+ if (!predefined_request_types.is_valid()) {
+ LOG4CXX_WARN(logger_,
+ app_id << " policy invalid RequestTypes will be cleaned.");
+ predefined_request_types.CleanUp();
+ if (PT_PRELOADED == app_policies.second.GetPolicyTableType() &&
+ predefined_request_types.is_cleaned_up()) {
+ LOG4CXX_ERROR(
+ logger_,
+ app_id << " policy RequestTypes is empty after clean-up. Exiting.");
+ return false;
+ }
+
+ LOG4CXX_WARN(logger_, app_id << " request types have cleaned up.");
+ }
+ return true;
+}
+
+bool PolicyBase::Validate() const {
+ // Check for empty "groups" sub-sections
+ if (groups.empty()) {
+ return false;
+ }
+ 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 (!VerifyPredefinedApp(*it_default_policy)) {
+ return false;
+ }
+
+ if (!VerifyPredefinedApp(*it_pre_data_policy)) {
+ return false;
+ }
+
+ ApplicationPolicies::iterator iter = apps.begin();
+ ApplicationPolicies::iterator end_iter = apps.end();
+
+ while (iter != end_iter) {
+ const std::string app_id = iter->first;
+ if (IsPredefinedApplication(app_id)) {
+ ++iter;
+ continue;
+ }
+
+ RequestTypes& app_request_types = *iter->second.RequestType;
+
+ if (app_request_types.is_omitted()) {
+ LOG4CXX_WARN(logger_,
+ "RequestTypes omitted for "
+ << app_id << " Will be replaced with default.");
+ app_request_types = *apps[kDefaultApp].RequestType;
+ ++iter;
+ continue;
+ }
+
+ if (!app_request_types.is_valid()) {
+ LOG4CXX_WARN(logger_,
+ "Invalid RequestTypes for " << app_id
+ << " Will be cleaned up.");
+ app_request_types.CleanUp();
+ if (app_request_types.is_cleaned_up()) {
+ if (PT_PRELOADED == pt_type) {
+ LOG4CXX_ERROR(logger_,
+ "RequestTypes empty after clean-up for "
+ << app_id << " Exiting.");
+ return false;
+ }
+
+ LOG4CXX_WARN(logger_,
+ "RequestTypes empty after clean-up for "
+ << app_id << " Will be replaced with default.");
+
+ app_request_types = *apps[kDefaultApp].RequestType;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Clean up for " << app_id << " is done.");
+
+ ++iter;
+ continue;
+ }
+
+ if (app_request_types.is_empty()) {
+ LOG4CXX_WARN(logger_, "RequestTypes is empty for " << app_id);
+ }
+
+ ++iter;
+ }
+
+ return true;
+}
+
+#ifdef SDL_REMOTE_CONTROL
+bool ApplicationParams::ValidateModuleTypes() const {
+ // moduleType is optional so see Optional<T>::is_valid()
+ bool is_initialized = moduleType->is_initialized();
+ if (!is_initialized) {
+ // valid if not initialized
+ return true;
+ }
+ bool is_valid = moduleType->is_valid();
+ if (is_valid) {
+ return true;
+ }
+
+ struct IsInvalid {
+ bool operator()(Enum<ModuleType> item) const {
+ return !item.is_valid();
+ }
+ };
+ // cut invalid items
+ moduleType->erase(
+ std::remove_if(moduleType->begin(), moduleType->end(), IsInvalid()),
+ moduleType->end());
+ bool empty = moduleType->empty();
+ if (empty) {
+ // set non initialized value
+ ModuleTypes non_initialized;
+ moduleType = Optional<ModuleTypes>(non_initialized);
+ }
+ return true;
+}
+#endif // SDL_REMOTE_CONTROL
+
+bool ApplicationParams::Validate() const {
+ if (is_initialized()) {
+ if (preconsented_groups.is_initialized()) {
+ const Strings& all = groups;
+ const Strings& preconsented = *preconsented_groups;
+ if (preconsented.size() > all.size()) {
+ return false;
+ }
+ }
+ }
+#ifdef SDL_REMOTE_CONTROL
+ return ValidateModuleTypes();
+#else // SDL_REMOTE_CONTROL
+ return true;
+#endif // SDL_REMOTE_CONTROL
+}
+
+bool RpcParameters::Validate() const {
+ return true;
+}
+bool Rpcs::Validate() const {
+ return true;
+}
+bool ModuleConfig::Validate() const {
+ switch (GetPolicyTableType()) {
+ case PT_PRELOADED: {
+ if (helpers::Compare<bool, helpers::EQ, helpers::ONE>(
+ true,
+ vehicle_make.is_initialized(),
+ vehicle_year.is_initialized(),
+ vehicle_model.is_initialized())) {
+ return false;
+ }
+ break;
+ }
+ case PT_UPDATE: {
+ if (preloaded_pt->is_initialized()) {
+ return false;
+ }
+ if (preloaded_date->is_initialized()) {
+ return false;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ for (ServiceEndpoints::const_iterator it_endpoints = endpoints.begin();
+ it_endpoints != endpoints.end();
+ ++it_endpoints) {
+ const URLList& endpoint_list = it_endpoints->second;
+ if (endpoint_list.end() == endpoint_list.find(kDefaultApp)) {
+ LOG4CXX_ERROR(logger_,
+ "Endpoint " << it_endpoints->first
+ << "does not contain default group");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool MessageString::Validate() const {
+ return true;
+}
+bool MessageLanguages::Validate() const {
+ if (PT_SNAPSHOT == GetPolicyTableType()) {
+ return false;
+ }
+ return true;
+}
+bool ConsumerFriendlyMessages::Validate() const {
+ return true;
+}
+bool ModuleMeta::Validate() const {
+ if (GetPolicyTableType() == PT_UPDATE ||
+ GetPolicyTableType() == PT_PRELOADED) {
+ return false;
+ }
+ return true;
+}
+bool AppLevel::Validate() const {
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ return false;
+ }
+ return true;
+}
+bool UsageAndErrorCounts::Validate() const {
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ return false;
+ }
+ return true;
+}
+bool ConsentRecords::Validate() const {
+ if (PT_SNAPSHOT != GetPolicyTableType()) {
+ return !external_consent_status_groups->is_initialized();
+ }
+
+ return true;
+}
+bool DeviceParams::Validate() const {
+ return true;
+}
+bool PolicyTable::Validate() const {
+ PolicyTableType policy_table_type = GetPolicyTableType();
+
+ if (PT_PRELOADED == policy_table_type || PT_UPDATE == policy_table_type) {
+ if (device_data.is_initialized()) {
+ return false;
+ }
+ }
+
+ if (PT_PRELOADED == policy_table_type || PT_SNAPSHOT == policy_table_type) {
+ // Check upper bound of each "groups" sub section in the app policies
+ const FunctionalGroupings::size_type functional_groupings_count =
+ functional_groupings.size();
+ for (ApplicationPolicies::const_iterator app_policiies_it =
+ app_policies_section.apps.begin();
+ app_policies_section.apps.end() != app_policiies_it;
+ ++app_policiies_it) {
+ if (app_policiies_it->second.groups.size() > functional_groupings_count) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool Table::Validate() const {
+ return true;
+}
+} // namespace policy_table_interface_base
+} // namespace rpc
diff --git a/src/components/policy/policy_external/src/sql_pt_ext_queries.cc b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
new file mode 100644
index 0000000000..afb1180692
--- /dev/null
+++ b/src/components/policy/policy_external/src/sql_pt_ext_queries.cc
@@ -0,0 +1,299 @@
+/*
+ Copyright (c) 2013, " Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, " with or without
+ modification, " are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, " this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, "
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
+ CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "policy/sql_pt_ext_queries.h"
+
+namespace policy {
+namespace sql_pt_ext {
+
+const std::string kSelectKeepContext =
+ "SELECT `keep_context` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kSelectStealFocus =
+ "SELECT `steal_focus` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kSelectDefaultHmi =
+ "SELECT `default_hmi` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kResetDeviceConsents = "DELETE FROM `device_consent_group`";
+
+const std::string kResetAppConsents = "DELETE FROM `consent_group`";
+
+const std::string kCountDeviceConsentGroup =
+ "SELECT COUNT (`device_id`) "
+ "FROM `device_consent_group` WHERE `device_id` = ?";
+
+const std::string kCountDevice =
+ "SELECT COUNT (`id`) "
+ "FROM `device` WHERE `id` = ?";
+
+const std::string kSelectDeviceConsentedGroup =
+ "SELECT * FROM `device_consent_group` WHERE `device_id` = ?";
+
+const std::string kUpdateDeviceConsentedGroup =
+ "UPDATE `device_consent_group` SET `is_consented` = ?, `input` = ? WHERE "
+ "(`device_id` = ? AND `functional_group_id` = ?)";
+
+const std::string kUpdateDevice =
+ "UPDATE `device` SET `hardware` = ?, `firmware_rev` = ?, `os` = ?, "
+ "`os_version` = ?, `carrier` = ?, `max_number_rfcom_ports` = ?, "
+ " `connection_type` = ? WHERE `id` = ? ";
+
+const std::string kInsertDeviceConsentedGroup =
+ "INSERT OR REPLACE INTO `device_consent_group` "
+ "(`device_id`, `functional_group_id`, `is_consented`, `input`, "
+ "`time_stamp`) "
+ "VALUES (?,?,?,?,?)";
+
+const std::string kInsertDevice =
+ "INSERT OR IGNORE INTO `device` "
+ "(`id`, `hardware`, `firmware_rev`, `os`, `os_version`, `carrier`,"
+ "`max_number_rfcom_ports`, `connection_type`) "
+ "VALUES (?,?,?,?,?,?,?,?)";
+
+const std::string kSelectDeviceData = "SELECT * FROM `device`";
+
+const std::string kSelectConsentGroup =
+ "SELECT * FROM `consent_group` WHERE `device_id` = ? ";
+
+const std::string kSelectExternalConsentStatusGroup =
+ "SELECT * FROM `external_consent_status_group` WHERE `device_id` = ? ";
+
+const std::string kInsertPreconsentedGroups =
+ "INSERT INTO `preconsented_group` (`application_id`, `functional_group_id`)"
+ " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
+
+const std::string kSelectPreconsentedGroups =
+ "SELECT `f`.`name` FROM `preconsented_group` AS `p`"
+ " LEFT JOIN `functional_group` AS `f` "
+ " ON (`f`.`id` = `p`.`functional_group_id`)"
+ " WHERE `p`.`application_id` = ?";
+
+const std::string kDeletePreconsentedGroups =
+ "DELETE FROM `preconsented_group`";
+
+const std::string kSelectUsageAndErrorCount =
+ "SELECT `count_of_iap_buffer_full`, `count_sync_out_of_memory`, "
+ " `count_of_sync_reboots` "
+ "FROM `usage_and_error_count` LIMIT 1";
+
+const std::string kSelectAppLevels =
+ "SELECT `application_id`, `minutes_in_hmi_full`, `minutes_in_hmi_limited`, "
+ " `minutes_in_hmi_background`, `minutes_in_hmi_none`, "
+ " `count_of_user_selections`, "
+ " `count_of_rejections_sync_out_of_memory`, "
+ " `count_of_rejections_nickname_mismatch`, "
+ " `count_of_rejections_duplicate_name`, "
+ " `count_of_rejected_rpcs_calls`, "
+ " `count_of_rpcs_sent_in_hmi_none`, "
+ " `count_of_removals_for_bad_behavior`, "
+ " `count_of_run_attempts_while_revoked`, "
+ " `app_registration_language_gui`, "
+ " `app_registration_language_vui`, "
+ " `count_of_tls_errors` "
+ "FROM `app_level`";
+
+const std::string kUpdateGlobalCounters =
+ "UPDATE `usage_and_error_count` SET "
+ "`count_of_iap_buffer_full` = ?, "
+ "`count_sync_out_of_memory` = ?, "
+ "`count_of_sync_reboots` = ? ";
+
+const std::string kInsertDeviceData =
+ "INSERT OR IGNORE INTO `device` "
+ "(`id`, `hardware`, `firmware_rev`, `os`, `os_version`, `carrier`, "
+ "`max_number_rfcom_ports`,`connection_type`) VALUES (?,?,?,?,?,?,?,?) ";
+
+const std::string kInsertConsentGroups =
+ "INSERT OR REPLACE INTO `consent_group` "
+ "(`device_id`, `application_id`, `functional_group_id`, `is_consented`, "
+ "`input`, `time_stamp`, `last_updated`) "
+ "VALUES (?,?,?,?,?,?,?)";
+
+const std::string kInsertExternalConsentStatusGroups =
+ "INSERT OR REPLACE INTO `external_consent_status_group` "
+ "(`device_id`, `application_id`, `functional_group_id`, `is_consented`, "
+ "`input`, `time_stamp`, `last_updated`) "
+ "VALUES (?,?,?,?,?,?,?)";
+
+const std::string kDeleteAppGroupConsent =
+ "DELETE FROM `consent_group` WHERE "
+ "`application_id` = ? AND `functional_group_id` = ? ";
+
+const std::string kSelectGroupId =
+ "SELECT `id` FROM `functional_group` WHERE `name` = ? ";
+
+const std::string kCountUnconsentedGroups =
+ "SELECT COUNT(`a`.`functional_group_id`) FROM `app_group` AS `a` "
+ " WHERE `a`.`application_id` = ? AND NOT EXISTS "
+ " (SELECT NULL FROM `preconsented_group` AS `p` WHERE "
+ " (`p`.`functional_group_id` = `a`.`functional_group_id` AND "
+ " `p`.`application_id` = `a`.`application_id`)) "
+ " AND NOT EXISTS (SELECT NULL FROM `consent_group` AS `c` "
+ " WHERE (`c`.`application_id` = `a`.`application_id` "
+ " AND `c`.`functional_group_id` = `a`.`functional_group_id` "
+ " AND `c`.`device_id` = ?)) AND NOT EXISTS "
+ " (SELECT NULL FROM `app_group` AS `def` WHERE "
+ " (`def`.`application_id` = ? OR "
+ " `def`.`application_id` = ?) "
+ " AND `def`.`functional_group_id` = `a`.`functional_group_id`)"
+ " AND NOT EXISTS (SELECT NULL FROM `functional_group` AS `f` "
+ " WHERE (`a`.`functional_group_id` = `f`.`id`"
+ " AND`f`.`user_consent_prompt` IS NULL))";
+
+const std::string kSelectModuleMeta = "SELECT* FROM `module_meta`";
+
+const std::string kUpdateMetaParams =
+ "UPDATE `module_meta` SET "
+ "`ccpu_version` = ?, `wers_country_code` = ?, `language` = ? ";
+
+const std::string kUpdateModuleMetaVinParam =
+ "UPDATE `module_meta` SET `vin` = ? ";
+
+const std::string kSaveModuleMeta =
+ "UPDATE `module_meta` SET `ccpu_version` = ?, `language` = ?,"
+ "`wers_country_code` = ?, `pt_exchanged_at_odometer_x` = ?,"
+ "`pt_exchanged_x_days_after_epoch` = ?,"
+ "`ignition_cycles_since_last_exchange` = ?, `vin` = ?";
+
+const std::string kSelectMetaParams =
+ "SELECT `ccpu_version`, "
+ "`wers_country_code`, `language` from `module_meta`";
+
+const std::string kUpdateMetaLanguage =
+ "UPDATE `module_meta` SET `language` = ? ";
+
+const std::string kCountAppLevel =
+ "SELECT COUNT(`application_id`) FROM `app_level`"
+ " WHERE `application_id` = ? ";
+
+const std::string kUpdateGroupPermissions =
+ "UPDATE `consent_group` "
+ "SET `is_consented` = ?, `input` = ? "
+ "WHERE(`application_id` = ? AND `functional_group_id` = ? AND `device_id` "
+ "= ?) ";
+
+const std::string kInsertApplication =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, `steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( ?, ?, ?, ?, ?, ?, ?, ?) ";
+
+const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
+
+const std::string kSelectFriendlyMsg =
+ "SELECT `tts`, `label`, `line1`, `line2`, `textBody` FROM `message` "
+ "WHERE `message_type_name` = ? AND `language_code` = ? LIMIT 1";
+
+const std::string kSelectAppGroupsId =
+ "SELECT `functional_group_id` "
+ "FROM `app_group` WHERE `application_id` = ? ";
+
+const std::string kSelectConsentedGroupsId =
+ "SELECT `functional_group_id`, `is_consented` "
+ "FROM `consent_group` WHERE(`application_id` = ? AND `device_id` = ?) ";
+
+const std::string kCountAppConsents =
+ "SELECT COUNT(*) from `consent_group`"
+ "WHERE(`device_id` = ? AND `application_id` = ? AND "
+ "`functional_group_id` = ?) ";
+
+const std::string kSelectPreconsentedGroupsId =
+ "SELECT `functional_group_id` "
+ "FROM `preconsented_group` WHERE `application_id` = ? ";
+
+const std::string kSelectAppPolicies =
+ "SELECT `id`, `priority_value`, `default_hmi`, `keep_context`, "
+ "`steal_focus`, "
+ " `memory_kb`, `heart_beat_timeout_ms` FROM `application`";
+
+const std::string kSelectFunctionalGroupNames =
+ "SELECT `id`, `user_consent_prompt`, `name`"
+ " FROM `functional_group`";
+
+const std::string kDeleteDeviceConsent =
+ "DELETE FROM `device_consent_group` "
+ "WHERE `device_id` = ? ";
+
+const std::string kDeleteAppConsent =
+ "DELETE FROM `consent_group` "
+ "WHERE `device_id` = ? ";
+
+const std::string kSelectApplicationIsPreData =
+ "SELECT `is_predata` FROM `application` WHERE `id` = ? ";
+
+const std::string kUpdateIsPredata =
+ "UPDATE `application` SET `is_predata` = ? WHERE `id` = ? ";
+
+const std::string kHasAppPreloadedGroups =
+ "SELECT COUNT(`a1`.`functional_group_id`) FROM `app_group` "
+ " AS `a1` JOIN `app_group` AS `a2` "
+ " ON `a1`.`functional_group_id` = `a2`.`functional_group_id` "
+ " WHERE `a1`.`application_id` = ? AND `a2`.`application_id` = ? ";
+
+const std::string kUpdateUnpairedDevice =
+ "UPDATE `device` SET `unpaired` = ? WHERE `id` = ? ";
+
+const std::string kSelectUnpairedDevices =
+ "SELECT `id` FROM `device` WHERE `unpaired` = 1";
+
+const std::string kHasMsgLanguageCode =
+ "SELECT COUNT (`id`) FROM message "
+ "WHERE `message_type_name` = ? AND `language_code` = ? ";
+
+const std::string kDeletePreconsentedGroupsByApplicationId =
+ "DELETE FROM `preconsented_group` WHERE `application_id` = ?";
+
+const std::string kSelectExternalConsentStatus =
+ "SELECT `entity_type`, `entity_id`, `on_off` from "
+ "`_internal_external_consent_status`";
+
+const std::string kInsertExternalConsentStatus =
+ "INSERT OR REPLACE INTO `_internal_external_consent_status` "
+ "(`id`,`entity_type`, "
+ "`entity_id`, `on_off`) VALUES ((SELECT `id` from "
+ "`_internal_external_consent_status` "
+ "WHERE `entity_type` = ? AND `entity_id` = ?), ?, ?, ?)";
+
+const std::string kDeleteExternalConsentEntities =
+ "DELETE FROM `external_consent_entities`";
+
+const std::string kInsertExternalConsentEntity =
+ "INSERT INTO `external_consent_entities` (`group_id`, `entity_type`, "
+ "`entity_id`, `on_off`) "
+ " VALUES (?, ?, ?, ?)";
+
+const std::string kSelectExternalConsentEntity =
+ "SELECT `group_id`, `entity_type`, `entity_id`, `on_off` from "
+ "`external_consent_entities`";
+
+} // namespace sql_pt_ext
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/sql_pt_ext_representation.cc b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
new file mode 100644
index 0000000000..f58a7f0b82
--- /dev/null
+++ b/src/components/policy/policy_external/src/sql_pt_ext_representation.cc
@@ -0,0 +1,1937 @@
+/*
+ Copyright (c) 2015, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <algorithm>
+#include <utility>
+#include "utils/logger.h"
+#include "policy/sql_pt_ext_representation.h"
+#include "policy/sql_wrapper.h"
+#include "policy/sql_pt_queries.h"
+#include "policy/sql_pt_ext_queries.h"
+#include "policy/policy_helper.h"
+#include "policy/cache_manager.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+SQLPTExtRepresentation::SQLPTExtRepresentation() {}
+SQLPTExtRepresentation::SQLPTExtRepresentation(bool in_memory)
+ : SQLPTRepresentation(in_memory) {}
+
+bool SQLPTExtRepresentation::CanAppKeepContext(const std::string& app_id) {
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt_ext::kSelectKeepContext)) {
+ query.Bind(0, app_id);
+ if (query.Exec()) {
+ return query.GetBoolean(0);
+ }
+ }
+ return false;
+}
+
+bool SQLPTExtRepresentation::CanAppStealFocus(const std::string& app_id) {
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt_ext::kSelectStealFocus)) {
+ query.Bind(0, app_id);
+ if (query.Exec()) {
+ return query.GetBoolean(0);
+ }
+ }
+ return false;
+}
+
+bool SQLPTExtRepresentation::ResetUserConsent() {
+ return ResetDeviceConsents() && ResetAppConsents();
+}
+
+bool SQLPTExtRepresentation::ResetDeviceConsents() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kResetDeviceConsents)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete statement from device_consents.");
+ return false;
+ }
+ return query.Exec();
+}
+
+bool SQLPTExtRepresentation::ResetAppConsents() {
+ return utils::dbms::SQLQuery(db()).Exec(sql_pt_ext::kResetAppConsents);
+}
+
+bool SQLPTExtRepresentation::GetUserPermissionsForDevice(
+ const std::string& device_id,
+ StringArray* consented_groups,
+ StringArray* disallowed_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectDeviceConsentedGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from device consented groups");
+ return false;
+ }
+ query.Bind(0, device_id);
+ while (query.Next()) {
+ if (query.GetBoolean(2)) {
+ if (!consented_groups) {
+ continue;
+ }
+ consented_groups->push_back(query.GetString(1));
+ } else {
+ if (!disallowed_groups) {
+ continue;
+ }
+ disallowed_groups->push_back(query.GetString(1));
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::GetPermissionsForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalIdType* group_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!group_types) {
+ LOG4CXX_WARN(logger_, "Input parameter for group types is null.");
+ return false;
+ }
+ // Get all app groups for specified device and application
+ FunctionalGroupIDs all_groups;
+ if (!GetAllAppGroups(policy_app_id, all_groups)) {
+ return false;
+ }
+ // Get preconsented group
+ FunctionalGroupIDs preconsented_groups;
+ if (!GetPreconsentedGroups(policy_app_id, preconsented_groups)) {
+ return false;
+ }
+ // Get consented (allowed/disallowed) groups
+ FunctionalGroupIDs allowed_groups;
+ FunctionalGroupIDs disallowed_groups;
+ if (!GetConsentedGroups(
+ policy_app_id, device_id, allowed_groups, disallowed_groups)) {
+ return false;
+ }
+ // Get all default groups
+ FunctionalGroupIDs default_groups;
+ if (!GetAllAppGroups(kDefaultId, default_groups)) {
+ return false;
+ }
+
+ // Get all pre_DataConsent groups
+ FunctionalGroupIDs predataconsented_groups;
+ if (!GetAllAppGroups(kPreDataConsentId, predataconsented_groups)) {
+ return false;
+ }
+
+ // Get all device groups
+ FunctionalGroupIDs device_groups;
+ if (!GetAllAppGroups(kDeviceId, device_groups)) {
+ return false;
+ }
+
+ (*group_types)[kTypeDefault] = default_groups;
+ (*group_types)[kTypeAllowed] = allowed_groups;
+ (*group_types)[kTypeDisallowed] = disallowed_groups;
+ (*group_types)[kTypePreconsented] = preconsented_groups;
+ (*group_types)[kTypeGeneral] = all_groups;
+ (*group_types)[kTypePreDataConsented] = predataconsented_groups;
+ (*group_types)[kTypeDevice] = device_groups;
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::GetDeviceGroupsFromPolicies(
+ policy_table::Strings* groups, policy_table::Strings* preconsented_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (groups) {
+ GatherAppGroup(kDeviceId, groups);
+ }
+ if (preconsented_groups) {
+ GatherPreconsentedGroup(kDeviceId, preconsented_groups);
+ }
+ return true;
+}
+
+bool SQLPTExtRepresentation::SetDeviceData(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery count_query(db());
+ if (!count_query.Prepare(sql_pt_ext::kCountDevice)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for count of device.");
+ return false;
+ }
+
+ count_query.Bind(0, device_id);
+
+ if (!count_query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect count of device.");
+ return false;
+ }
+
+ bool update = count_query.GetInteger(0);
+
+ // Update old value
+ if (update) {
+ utils::dbms::SQLQuery update_query(db());
+ if (!update_query.Prepare(sql_pt_ext::kUpdateDevice)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for udpate device.");
+ return false;
+ }
+
+ update_query.Bind(0, hardware);
+ update_query.Bind(1, firmware);
+ update_query.Bind(2, os);
+ update_query.Bind(3, os_version);
+ update_query.Bind(4, carrier);
+ update_query.Bind(5, static_cast<int>(number_of_ports));
+ update_query.Bind(6, device_id);
+ update_query.Bind(7, connection_type);
+
+ if (!update_query.Exec() || !update_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect update for device.");
+ return false;
+ }
+
+ return true;
+ }
+
+ // Insert new data
+ utils::dbms::SQLQuery insert_query(db());
+ if (!insert_query.Prepare(sql_pt_ext::kInsertDevice)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for device.");
+ return false;
+ }
+
+ insert_query.Bind(0, device_id);
+ insert_query.Bind(1, hardware);
+ insert_query.Bind(2, firmware);
+ insert_query.Bind(3, os);
+ insert_query.Bind(4, os_version);
+ insert_query.Bind(5, carrier);
+ insert_query.Bind(6, static_cast<int>(number_of_ports));
+ insert_query.Bind(7, connection_type);
+
+ if (!insert_query.Exec() || !insert_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert to device.");
+ return false;
+ }
+
+ SetPreloaded(false);
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups,
+ const StringArray& disallowed_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery count_query(db());
+ if (!count_query.Prepare(sql_pt_ext::kCountDeviceConsentGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect count of device consented groups");
+ return false;
+ }
+
+ count_query.Bind(0, device_id);
+
+ if (!count_query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed count of device consented groups");
+ return false;
+ }
+
+ bool update = count_query.GetInteger(0);
+
+ // TODO(AOleynik): Split to several methods?
+ utils::dbms::SQLQuery query(db());
+ // Update old values
+ if (update) {
+ if (!query.Prepare(sql_pt_ext::kUpdateDeviceConsentedGroup)) {
+ LOG4CXX_WARN(
+ logger_,
+ "Incorrect statement for updating consented groups on device");
+ return false;
+ }
+
+ StringArray::const_iterator it_consented_groups = consented_groups.begin();
+ StringArray::const_iterator it_consented_groups_end =
+ consented_groups.end();
+ for (; it_consented_groups != it_consented_groups_end;
+ ++it_consented_groups) {
+ query.Bind(0, true);
+ query.Bind(1, std::string("GUI"));
+ query.Bind(2, device_id);
+ query.Bind(3, *it_consented_groups);
+ // TODO(AOleynik): Get this info from external data
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Failed update of device allowed consented groups.");
+ return false;
+ }
+ }
+
+ StringArray::const_iterator it_disallowed_groups =
+ disallowed_groups.begin();
+ StringArray::const_iterator it_disallowed_groups_end =
+ disallowed_groups.end();
+ for (; it_disallowed_groups != it_disallowed_groups_end;
+ ++it_disallowed_groups) {
+ query.Bind(0, false);
+ query.Bind(1);
+ query.Bind(2, device_id);
+ query.Bind(3, *it_disallowed_groups);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Failed update of device disallowed consented groups.");
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ // Insert new values
+ if (!query.Prepare(sql_pt_ext::kInsertDeviceConsentedGroup)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect statement of inserting to device consented groups");
+ return false;
+ }
+
+ StringArray::const_iterator it_consented_groups = consented_groups.begin();
+ StringArray::const_iterator it_consented_groups_end = consented_groups.end();
+ for (; it_consented_groups != it_consented_groups_end;
+ ++it_consented_groups) {
+ query.Bind(0, device_id);
+ query.Bind(1, *it_consented_groups);
+ query.Bind(2, true);
+ // TODO(AOleynik): Get this info from external data
+ query.Bind(3, std::string("GUI"));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Failed insert to device allowed consented groups.");
+ return false;
+ }
+ }
+
+ StringArray::const_iterator it_disallowed_groups = disallowed_groups.begin();
+ StringArray::const_iterator it_disallowed_groups_end =
+ disallowed_groups.end();
+ for (; it_disallowed_groups != it_disallowed_groups_end;
+ ++it_disallowed_groups) {
+ query.Bind(0, device_id);
+ query.Bind(1, *it_disallowed_groups);
+ query.Bind(2, false);
+ query.Bind(3);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Failed insert to device disallowed consented groups.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::ReactOnUserDevConsentForApp(
+ const std::string& app_id, bool is_device_allowed) {
+ bool result = true;
+ if (is_device_allowed) {
+ // If app has pre_DataConsented groups it should be 'promoted' to default
+ // If app has only pre_DataConsented flag it should be only set to false and
+ // all groups get restored automatically
+ if (IsPredataPolicy(app_id)) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kHasAppPreloadedGroups)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect statement for has app preloaded groups");
+ return false;
+ }
+ query.Bind(0, app_id);
+ query.Bind(1, kPreDataConsentId);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select for app has predataconsted groups");
+ return false;
+ }
+ if (query.GetInteger(0) > 0) {
+ result = result && SetDefaultPolicy(app_id);
+ } else {
+ result = result && SetIsPredata(app_id, false);
+ }
+ }
+ } else {
+ // If app has default groups change them to pre_DataConsented
+ // If app has 'normal' groups leave them as is and set
+ // pre_DataConsented flag to true.
+ if (IsDefaultPolicy(app_id)) {
+ result = result && SetPredataPolicy(app_id);
+ } else {
+ result = result && SetIsPredata(app_id, true);
+ }
+ }
+ return result;
+}
+
+bool SQLPTExtRepresentation::SetUserPermissionsForApp(
+ const PermissionConsent& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // TODO(AOleynik): Handle situation, when no application was specified, i.e.
+ // general permissions were set
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ permissions.group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ permissions.group_permissions.end();
+
+ utils::dbms::SQLQuery query(db());
+ for (; it != it_end; ++it) {
+ utils::dbms::SQLQuery counter(db());
+ if (!counter.Prepare(sql_pt_ext::kCountAppConsents)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for consent group count.");
+ return false;
+ }
+
+ counter.Bind(0, permissions.device_id);
+ counter.Bind(1, permissions.policy_app_id);
+ counter.Bind(2, static_cast<int>((*it).group_id));
+ if (!counter.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrent count on consent groups.");
+ return false;
+ }
+
+ bool update_required = counter.GetInteger(0);
+
+ // Update already present consent record
+ if (update_required) {
+ if (!query.Prepare(sql_pt_ext::kUpdateGroupPermissions)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for update consent groups.");
+ return false;
+ }
+
+ // Skip consent saving, if user didn't choose any state
+ if (policy::kGroupUndefined == (*it).state) {
+ continue;
+ }
+ query.Bind(0, (*it).state == kGroupAllowed ? 1 : 0);
+ query.Bind(1, permissions.consent_source);
+ query.Bind(2, permissions.policy_app_id);
+ query.Bind(3, static_cast<int>((*it).group_id));
+ query.Bind(4, permissions.device_id);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect update on user defined permissions "
+ "for app groups.");
+ return false;
+ }
+ continue;
+ }
+
+ // Insert new consent record
+ if (!query.Prepare(sql_pt_ext::kInsertConsentGroups)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect statement for update app group permissions.");
+ return false;
+ }
+
+ // Skip consent saving, if user didn't choose any state
+ if (policy::kGroupUndefined == (*it).state) {
+ continue;
+ }
+ query.Bind(0, permissions.device_id);
+ query.Bind(1, permissions.policy_app_id);
+ query.Bind(2, static_cast<int>((*it).group_id));
+ query.Bind(3, (*it).state == kGroupAllowed ? 1 : 0);
+ query.Bind(4, permissions.consent_source);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert to user defined permissions "
+ "for app groups.");
+ return false;
+ }
+ continue;
+ }
+ return true;
+}
+
+std::vector<UserFriendlyMessage> SQLPTExtRepresentation::GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language) {
+ utils::dbms::SQLQuery query(db());
+ std::vector<UserFriendlyMessage> result;
+ if (!query.Prepare(sql_pt_ext::kSelectFriendlyMsg)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages.");
+ return result;
+ }
+
+ const std::string fallback_language = "en-us";
+ std::vector<std::string>::const_iterator it = msg_codes.begin();
+ std::vector<std::string>::const_iterator it_end = msg_codes.end();
+ for (; it != it_end; ++it) {
+ std::string msg_language = language;
+ // If message has no records with required language, fallback language
+ // should be used instead.
+ if (!IsMsgLanguagePresent((*it), language)) {
+ msg_language = fallback_language;
+ }
+ query.Bind(0, *it);
+ query.Bind(1, msg_language);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect select from friendly messages.");
+ return result;
+ }
+
+ UserFriendlyMessage msg;
+
+ msg.message_code = *it;
+ msg.tts = query.GetString(0);
+ msg.label = query.GetString(1);
+ msg.line1 = query.GetString(2);
+ msg.line2 = query.GetString(3);
+ msg.text_body = query.GetString(4);
+
+ result.push_back(msg);
+
+ if (!query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Failed reset statement for selecting friendly "
+ "messages.");
+ return result;
+ }
+ }
+
+ return result;
+}
+
+bool SQLPTExtRepresentation::GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) const {
+ if (NULL == messages) {
+ LOG4CXX_ERROR(logger_, "NULL pointer has been passed to fill");
+ return false;
+ }
+
+ if (!SQLPTRepresentation::GatherConsumerFriendlyMessages(messages)) {
+ return false;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ bool result = query.Prepare(sql_pt_ext::kCollectFriendlyMsg);
+
+ if (result) {
+ while (query.Next()) {
+ UserFriendlyMessage msg;
+
+ msg.tts = query.GetString(1);
+ msg.label = query.GetString(2);
+ msg.line1 = query.GetString(3);
+ msg.line2 = query.GetString(4);
+ msg.text_body = query.GetString(5);
+ msg.message_code = query.GetString(7);
+
+ std::string language = query.GetString(6);
+ if (!msg.tts.empty()) {
+ *(*messages->messages)[msg.message_code].languages[language].tts =
+ msg.tts;
+ }
+ if (!msg.label.empty()) {
+ *(*messages->messages)[msg.message_code].languages[language].label =
+ msg.label;
+ }
+ if (!msg.line1.empty()) {
+ *(*messages->messages)[msg.message_code].languages[language].line1 =
+ msg.line1;
+ }
+ if (!msg.line2.empty()) {
+ *(*messages->messages)[msg.message_code].languages[language].line2 =
+ msg.line2;
+ }
+ if (!msg.text_body.empty()) {
+ *(*messages->messages)[msg.message_code].languages[language].textBody =
+ msg.text_body;
+ }
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages.");
+ }
+ return result;
+}
+
+bool SQLPTExtRepresentation::SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kUpdateMetaParams)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for insert to module meta.");
+ return false;
+ }
+
+ query.Bind(0, ccpu_version);
+ query.Bind(1, wers_country_code);
+ query.Bind(2, language);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert to module meta.");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTExtRepresentation::IsMetaInfoPresent() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectMetaParams)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for selecting meta info.");
+ return false;
+ }
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect select from module meta.");
+ return false;
+ }
+
+ return !query.IsNull(0) && !query.IsNull(1) && !query.IsNull(2);
+}
+
+bool SQLPTExtRepresentation::SetSystemLanguage(const std::string& language) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kUpdateMetaLanguage)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for update meta language.");
+ return false;
+ }
+
+ query.Bind(0, language);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update for meta language.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies) {
+ LOG4CXX_INFO(logger_, "SaveApplicationPolicies ext");
+ utils::dbms::SQLQuery query_delete(db());
+ if (!query_delete.Exec(sql_pt::kDeleteAppGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery query_delete_preconsented(db());
+ if (!query_delete_preconsented.Exec(sql_pt_ext::kDeletePreconsentedGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from preconsented_group.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from application.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteRequestType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request type.");
+ return false;
+ }
+
+ // First, all predefined apps (e.g. default, pre_DataConsent) should be saved,
+ // otherwise another app with the predefined permissions can get incorrect
+ // permissions
+ policy_table::ApplicationPolicies::const_iterator it_default =
+ policies.apps.find(kDefaultId);
+ if (policies.apps.end() != it_default) {
+ if (!SaveSpecificAppPolicy(*it_default)) {
+ return false;
+ }
+ }
+ policy_table::ApplicationPolicies::const_iterator it_pre_data_consent =
+ policies.apps.find(kPreDataConsentId);
+ if (policies.apps.end() != it_pre_data_consent) {
+ if (!SaveSpecificAppPolicy(*it_pre_data_consent)) {
+ return false;
+ }
+ }
+
+ if (!SaveDevicePolicy(policies.device)) {
+ return false;
+ }
+
+ policy_table::ApplicationPolicies::const_iterator it;
+ for (it = policies.apps.begin(); it != policies.apps.end(); ++it) {
+ // Skip saving of predefined app, since they should be saved before
+ if (IsPredefinedApp(*it)) {
+ continue;
+ }
+ if (!SaveSpecificAppPolicy(*it)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::SaveSpecificAppPolicy(
+ const policy_table::ApplicationPolicies::value_type& app) {
+ if (app.second.is_string()) {
+ if (kDefaultId.compare(app.second.get_string()) == 0) {
+ if (!SetDefaultPolicy(app.first)) {
+ return false;
+ }
+ if (!SaveRequestType(app.first, *app.second.RequestType)) {
+ return false;
+ }
+ } else if (kPreDataConsentId.compare(app.second.get_string()) == 0) {
+ if (!SetPredataPolicy(app.first)) {
+ return false;
+ }
+ if (!SaveRequestType(app.first, *app.second.RequestType)) {
+ return false;
+ }
+ }
+
+ // Stop saving other params, since predefined permissions already set
+ return true;
+ }
+
+ SetIsDefault(app.first, false);
+ SetIsPredata(app.first, false);
+
+ utils::dbms::SQLQuery app_query(db());
+ if (!app_query.Prepare(sql_pt_ext::kInsertApplication)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
+ return false;
+ }
+
+ app_query.Bind(0, app.first);
+ app_query.Bind(1, app.second.keep_context);
+ app_query.Bind(2, app.second.steal_focus);
+ app_query.Bind(
+ 3, std::string(policy_table::EnumToJsonString(app.second.default_hmi)));
+ app_query.Bind(
+ 4, std::string(policy_table::EnumToJsonString(app.second.priority)));
+ app_query.Bind(5, app.second.is_null());
+ app_query.Bind(6, *app.second.memory_kb);
+ app_query.Bind(7, static_cast<int64_t>(*app.second.heart_beat_timeout_ms));
+
+ if (!app_query.Exec() || !app_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into application.");
+ return false;
+ }
+
+ if (!SaveAppGroup(app.first, app.second.groups)) {
+ return false;
+ }
+ if (!SaveNickname(app.first, *app.second.nicknames)) {
+ return false;
+ }
+ if (!SaveAppType(app.first, *app.second.AppHMIType)) {
+ return false;
+ }
+ if (!SavePreconsentedGroup(app.first, *app.second.preconsented_groups)) {
+ return false;
+ }
+
+ if (!SaveRequestType(app.first, *app.second.RequestType)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool policy::SQLPTExtRepresentation::SaveDevicePolicy(
+ const policy_table::DevicePolicy& device) {
+ utils::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);
+
+ if (!app_query.Exec() || !app_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into application.");
+ return false;
+ }
+
+ if (!SaveAppGroup(kDeviceId, device.groups)) {
+ return false;
+ }
+ if (!SavePreconsentedGroup(kDeviceId, *device.preconsented_groups)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const {
+ LOG4CXX_INFO(logger_, "Gather applications policies");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectAppPolicies)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app_policies");
+ return false;
+ }
+
+ while (query.Next()) {
+ rpc::Nullable<policy_table::ApplicationParams> params;
+ const std::string& app_id = query.GetString(0);
+ if (IsApplicationRevoked(app_id)) {
+ params.set_to_null();
+ (*policies).apps[app_id] = params;
+ continue;
+ }
+ if (IsDefaultPolicy(app_id)) {
+ (*policies).apps[app_id].set_to_string(kDefaultId);
+ }
+ if (IsPredataPolicy(app_id)) {
+ (*policies).apps[app_id].set_to_string(kPreDataConsentId);
+ }
+ if (kDeviceId == app_id) {
+ policy_table::DevicePolicy device_policy;
+ policy_table::Priority priority;
+ policy_table::EnumFromJsonString(query.GetString(1), &priority);
+ device_policy.priority = priority;
+ policy_table::HmiLevel hmi;
+ policy_table::EnumFromJsonString(query.GetString(2), &hmi);
+ device_policy.default_hmi = hmi;
+ device_policy.keep_context = query.GetBoolean(3);
+ device_policy.steal_focus = query.GetBoolean(4);
+ if (!GatherAppGroup(app_id, &device_policy.groups)) {
+ return false;
+ }
+ GatherPreconsentedGroup(app_id, &*device_policy.preconsented_groups);
+ (*policies).device = device_policy;
+ continue;
+ }
+ policy_table::Priority priority;
+ policy_table::EnumFromJsonString(query.GetString(1), &priority);
+ params.priority = priority;
+ policy_table::HmiLevel hmi;
+ policy_table::EnumFromJsonString(query.GetString(2), &hmi);
+ params.default_hmi = hmi;
+ params.keep_context = query.GetBoolean(3);
+ params.steal_focus = query.GetBoolean(4);
+ *params.memory_kb = query.GetInteger(5);
+ *params.heart_beat_timeout_ms = query.GetUInteger(6);
+
+ if (!GatherAppGroup(app_id, &params.groups)) {
+ return false;
+ }
+ if (!GatherNickName(app_id, &*params.nicknames)) {
+ return false;
+ }
+ if (!GatherAppType(app_id, &*params.AppHMIType)) {
+ return false;
+ }
+ if (!GatherRequestType(app_id, &*params.RequestType)) {
+ return false;
+ }
+ GatherPreconsentedGroup(app_id, &*params.preconsented_groups);
+ (*policies).apps[app_id] = params;
+ }
+ return true;
+}
+
+void SQLPTExtRepresentation::GatherPreconsentedGroup(
+ const std::string& app_id, policy_table::Strings* groups) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectPreconsentedGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from preconsented group");
+ return;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ groups->push_back(query.GetString(0));
+ }
+}
+
+bool SQLPTExtRepresentation::GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const {
+ LOG4CXX_INFO(logger_, "Gather Usage and Error Counts.");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectUsageAndErrorCount) || !query.Exec()) {
+ LOG4CXX_INFO(logger_, "Failed select from user_and_error_count");
+ return false;
+ }
+
+ *counts->count_of_iap_buffer_full = query.GetInteger(0);
+ *counts->count_sync_out_of_memory = query.GetInteger(1);
+ *counts->count_of_sync_reboots = query.GetInteger(2);
+
+ return GatherAppLevels(&*counts->app_level);
+}
+
+bool SQLPTExtRepresentation::GatherAppLevels(
+ policy_table::AppLevels* apps) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectAppLevels)) {
+ LOG4CXX_INFO(logger_,
+ "Failed select from app_level. SQLError = "
+ << query.LastError().text());
+ return false;
+ }
+ while (query.Next()) {
+ policy_table::AppLevel level;
+ // value of time fields database is seconds
+ level.minutes_in_hmi_full = query.GetInteger(1);
+ level.minutes_in_hmi_limited = query.GetInteger(2);
+ level.minutes_in_hmi_background = query.GetInteger(3);
+ level.minutes_in_hmi_none = query.GetInteger(4);
+ level.count_of_user_selections = query.GetInteger(5);
+ level.count_of_rejections_sync_out_of_memory = query.GetInteger(6);
+ level.count_of_rejections_nickname_mismatch = query.GetInteger(7);
+ level.count_of_rejections_duplicate_name = query.GetInteger(8);
+ level.count_of_rejected_rpc_calls = query.GetInteger(9);
+ level.count_of_rpcs_sent_in_hmi_none = query.GetInteger(10);
+ level.count_of_removals_for_bad_behavior = query.GetInteger(11);
+ level.count_of_run_attempts_while_revoked = query.GetInteger(12);
+ level.app_registration_language_gui = query.GetString(13);
+ level.app_registration_language_vui = query.GetString(14);
+ level.count_of_tls_errors = query.GetInteger(15);
+ (*apps)[query.GetString(0)] = level;
+ }
+
+ return true;
+}
+
+void SQLPTExtRepresentation::GatherDeviceData(
+ policy_table::DeviceData* data) const {
+ LOG4CXX_INFO(logger_, "Gather device data.");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectDeviceData)) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement for device data.");
+ return;
+ }
+ data->mark_initialized();
+ while (query.Next()) {
+ policy_table::DeviceParams* specific_device = &(*data)[query.GetString(0)];
+ *specific_device->hardware = query.GetString(1);
+ *specific_device->firmware_rev = query.GetString(2);
+ *specific_device->os = query.GetString(3);
+ *specific_device->os_version = query.GetString(4);
+ *specific_device->carrier = query.GetString(5);
+ *specific_device->max_number_rfcom_ports = query.GetInteger(6);
+
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ GatherConsentGroup(query.GetString(0),
+ &(*specific_device->user_consent_records));
+ }
+}
+
+void SQLPTExtRepresentation::GatherConsentGroup(
+ const std::string& device_id,
+ policy_table::UserConsentRecords* records) const {
+ LOG4CXX_INFO(logger_, "Gather consent records.");
+ utils::dbms::SQLQuery query(db());
+ // Fill data for device
+ if (!query.Prepare(sql_pt_ext::kSelectDeviceConsentedGroup)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select statement for device consented groups.");
+ return;
+ }
+
+ query.Bind(0, device_id);
+
+ // Fill device_data -> user_consent_records -> "device"
+ while (query.Next()) {
+ policy_table::ConsentRecords* device_consent_records =
+ &(*records)[kDeviceId];
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ policy_table::ConsentGroups& consent_groups =
+ *device_consent_records->consent_groups;
+ consent_groups[query.GetString(1)] = query.GetBoolean(2);
+ policy_table::Input input;
+ policy_table::EnumFromJsonString(query.GetString(3), &input);
+ *device_consent_records->input = input;
+ *device_consent_records->time_stamp = query.GetString(4);
+ }
+
+ if (!query.Reset()) {
+ return;
+ }
+
+ // Fill data for applications
+ if (!query.Prepare(sql_pt_ext::kSelectConsentGroup)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select statement for app consented groups.");
+ return;
+ }
+
+ query.Bind(0, device_id);
+
+ // Fill device_data -> user_consent_records -> <app_id>
+ while (query.Next()) {
+ policy_table::ConsentRecords* app_consent_records =
+ &(*records)[query.GetString(1)];
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ policy_table::ConsentGroups& consent_groups =
+ *app_consent_records->consent_groups;
+
+ consent_groups[query.GetString(2)] = query.GetBoolean(3);
+ policy_table::Input input;
+ policy_table::EnumFromJsonString(query.GetString(4), &input);
+ *app_consent_records->input = input;
+ *app_consent_records->time_stamp = query.GetString(5);
+ app_consent_records->consent_last_updated = query.GetInteger(6);
+ }
+ if (!query.Reset()) {
+ return;
+ }
+
+ // Fill data for ExternalConsent consents
+ if (!query.Prepare(sql_pt_ext::kSelectExternalConsentStatusGroup)) {
+ LOG4CXX_WARN(
+ logger_,
+ "Incorrect select statement for ExternalConsent consented groups.");
+ return;
+ }
+
+ query.Bind(0, device_id);
+
+ // Fill device_data -> user_consent_records -> <app_id> ->
+ // external_consent_status_groups
+ while (query.Next()) {
+ policy_table::ConsentRecords* app_consent_records =
+ &(*records)[query.GetString(1)];
+ policy_table::ConsentGroups& external_consent_status_groups =
+ *app_consent_records->external_consent_status_groups;
+ external_consent_status_groups[query.GetString(2)] = query.GetBoolean(3);
+ policy_table::Input input;
+ policy_table::EnumFromJsonString(query.GetString(4), &input);
+ app_consent_records->ext_consent_last_updated = query.GetInteger(6);
+ }
+}
+
+bool SQLPTExtRepresentation::SaveDeviceData(
+ const policy_table::DeviceData& devices) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery drop_device_query(db());
+ const std::string drop_device = "DELETE FROM `device`";
+ if (!drop_device_query.Exec(drop_device)) {
+ LOG4CXX_WARN(logger_, "Could not clear device table.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery drop_device_consents_query(db());
+ const std::string drop_device_consents = "DELETE FROM `device_consent_group`";
+ if (!drop_device_consents_query.Exec(drop_device_consents)) {
+ LOG4CXX_WARN(logger_, "Could not clear device consents.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery drop_user_consents_query(db());
+ const std::string drop_user_consents = "DELETE FROM `consent_group`";
+ if (!drop_user_consents_query.Exec(drop_user_consents)) {
+ LOG4CXX_WARN(logger_, "Could not clear user consents.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kInsertDeviceData)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for device data.");
+ return false;
+ }
+
+ policy_table::DeviceData::const_iterator it = devices.begin();
+ policy_table::DeviceData::const_iterator it_end = devices.end();
+ for (; it != it_end; ++it) {
+ query.Bind(0, it->first);
+ query.Bind(1, *(it->second.hardware));
+ query.Bind(2, *(it->second.firmware_rev));
+ query.Bind(3, *(it->second.os));
+ query.Bind(4, *(it->second.os_version));
+ query.Bind(5, *(it->second.carrier));
+ query.Bind(6, *(it->second.max_number_rfcom_ports));
+ query.Bind(7, *(it->second.connection_type));
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into device data.");
+ return false;
+ }
+
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ if (!SaveConsentGroup(it->first, *it->second.user_consent_records)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::SaveConsentGroup(
+ const std::string& device_id,
+ const policy_table::UserConsentRecords& records) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+
+ policy_table::UserConsentRecords::const_iterator it = records.begin();
+ policy_table::UserConsentRecords::const_iterator it_end = records.end();
+ for (; it != it_end; ++it) {
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ policy_table::ConsentGroups::const_iterator it_groups =
+ it->second.consent_groups->begin();
+ policy_table::ConsentGroups::const_iterator it_groups_end =
+ it->second.consent_groups->end();
+ for (; it_groups != it_groups_end; ++it_groups) {
+ if (kDeviceId == it->first) {
+ if (!query.Prepare(sql_pt_ext::kInsertDeviceConsentedGroup)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for device consent group.");
+ return false;
+ }
+ query.Bind(0, device_id);
+ query.Bind(1, it_groups->first);
+ query.Bind(2, it_groups->second);
+ query.Bind(
+ 3,
+ std::string(policy_table::EnumToJsonString(*(it->second.input))));
+ query.Bind(4, std::string(*(it->second.time_stamp)));
+ LOG4CXX_INFO(logger_,
+ "Device:"
+ << "time stamp "
+ << std::string(*(it->second.time_stamp)) << " group "
+ << it_groups->first << " consent "
+ << it_groups->second);
+ } else {
+ if (!query.Prepare(sql_pt_ext::kInsertConsentGroups)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for consent group.");
+ return false;
+ }
+ query.Bind(0, device_id);
+ query.Bind(1, it->first);
+ query.Bind(2, it_groups->first);
+ query.Bind(3, it_groups->second);
+ query.Bind(
+ 4,
+ std::string(policy_table::EnumToJsonString(*(it->second.input))));
+ query.Bind(5, std::string(*(it->second.time_stamp)));
+ query.Bind(6, (it->second.consent_last_updated));
+ LOG4CXX_INFO(logger_,
+ "Device:"
+ << "time stamp "
+ << std::string(*(it->second.time_stamp)) << " group "
+ << it_groups->first << " consent "
+ << it_groups->second);
+ }
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into consent group.");
+ return false;
+ }
+ }
+
+ policy_table::ConsentGroups::const_iterator it_external_consent_consent =
+ it->second.external_consent_status_groups->begin();
+ policy_table::ConsentGroups::const_iterator end_external_consent_consent =
+ it->second.external_consent_status_groups->end();
+
+ for (; end_external_consent_consent != it_external_consent_consent;
+ ++it_external_consent_consent) {
+ if (!query.Prepare(sql_pt_ext::kInsertExternalConsentStatusGroups)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for external consent group.");
+ return false;
+ }
+ query.Bind(0, device_id);
+ query.Bind(1, it->first);
+ query.Bind(2, it_external_consent_consent->first);
+ query.Bind(3, it_external_consent_consent->second);
+ query.Bind(
+ 4, std::string(policy_table::EnumToJsonString(*(it->second.input))));
+ query.Bind(5, std::string(*(it->second.time_stamp)));
+ query.Bind(6, (it->second.ext_consent_last_updated));
+ LOG4CXX_INFO(logger_,
+ "Device:"
+ << "time stamp " << std::string(*(it->second.time_stamp))
+ << " group " << it_external_consent_consent->first
+ << " consent " << it_external_consent_consent->second);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into external consent group.");
+ return false;
+ }
+ } // external_consent_consent_group
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::SavePreconsentedGroup(
+ const std::string& app_id, const policy_table::Strings& groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kInsertPreconsentedGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for preconsented groups");
+ return false;
+ }
+
+ policy_table::Strings::const_iterator it;
+ for (it = groups.begin(); it != groups.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into preconsented groups.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void SQLPTExtRepresentation::GatherModuleMeta(
+ policy_table::ModuleMeta* meta) const {
+ LOG4CXX_INFO(logger_, "Gather Module Meta Info");
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt_ext::kSelectModuleMeta) && query.Next()) {
+ *meta->ccpu_version = query.GetString(0);
+ *meta->language = query.GetString(1);
+ *meta->wers_country_code = query.GetString(2);
+ *meta->pt_exchanged_at_odometer_x = query.GetInteger(3);
+ *meta->pt_exchanged_x_days_after_epoch = query.GetInteger(4);
+ *meta->ignition_cycles_since_last_exchange = query.GetInteger(5);
+ *meta->vin = query.GetString(6);
+ }
+}
+
+void SQLPTExtRepresentation::Increment(const std::string& type) const {
+ utils::dbms::SQLQuery query(db());
+ std::string update_counter =
+ "UPDATE `usage_and_error_count` SET `" + type + "` = `" + type + "` + 1";
+ if (!query.Exec(update_counter)) {
+ LOG4CXX_INFO(logger_, "Failed updating global counter");
+ }
+}
+
+bool SQLPTExtRepresentation::IsExistAppLevel(const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kCountAppLevel)) {
+ LOG4CXX_INFO(logger_, "Incorrect statement of count app_level");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Failed count app_level");
+ return false;
+ }
+ return query.GetInteger(0) > 0;
+}
+
+bool SQLPTExtRepresentation::GetAllAppGroups(const std::string& policy_app_id,
+ FunctionalGroupIDs& all_groups) {
+ LOG4CXX_INFO(logger_, "GetAllAppGroups for '" << policy_app_id << "'");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectAppGroupsId)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for select app groups id.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+
+ while (query.Next()) {
+ all_groups.push_back(query.GetInteger(0));
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::GetConsentedGroups(
+ const std::string& policy_app_id,
+ const std::string& device_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectConsentedGroupsId)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for select consent groups id.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+ query.Bind(1, device_id);
+
+ while (query.Next()) {
+ if (query.GetBoolean(1)) {
+ allowed_groups.push_back(query.GetInteger(0));
+ } else {
+ disallowed_groups.push_back(query.GetInteger(0));
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::GetPreconsentedGroups(
+ const std::string& policy_app_id, FunctionalGroupIDs& preconsented_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectPreconsentedGroupsId)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect statement for select preconsented groups id.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+
+ while (query.Next()) {
+ preconsented_groups.push_back(query.GetInteger(0));
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::GetFunctionalGroupNames(
+ FunctionalGroupNames& names) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectFunctionalGroupNames)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect statement for select functional groups names.");
+ return false;
+ }
+
+ while (query.Next()) {
+ // Some of functional grous doesn't have filled user_consent_prompt
+ if (query.IsNull(1)) {
+ names[query.GetInteger(0)] =
+ std::make_pair<std::string, std::string>("", query.GetString(2));
+ } else {
+ names[query.GetInteger(0)] = std::make_pair<std::string, std::string>(
+ query.GetString(1), query.GetString(2));
+ }
+ }
+
+ return true;
+}
+
+void SQLPTExtRepresentation::FillFunctionalGroupPermissions(
+ FunctionalGroupIDs& ids,
+ FunctionalGroupNames& names,
+ GroupConsent state,
+ std::vector<FunctionalGroupPermission>& permissions) {
+ FunctionalGroupIDs::const_iterator it = ids.begin();
+ FunctionalGroupIDs::const_iterator it_end = ids.end();
+ for (; it != it_end; ++it) {
+ FunctionalGroupPermission current_group;
+ current_group.group_id = *it;
+ current_group.group_alias = names[*it].first;
+ current_group.group_name = names[*it].second;
+ current_group.state = state;
+ permissions.push_back(current_group);
+ }
+}
+
+void SQLPTExtRepresentation::Increment(const std::string& app_id,
+ const std::string& type) const {
+ utils::dbms::SQLQuery query(db());
+ std::string sql_counter;
+ if (IsExistAppLevel(app_id)) {
+ // update
+ sql_counter = "UPDATE `app_level` SET `" + type + "` = `" + type +
+ "` + 1 WHERE `application_id` = ?";
+ } else {
+ // insert
+ sql_counter = "INSERT INTO `app_level` (`application_id`, `" + type +
+ "`) "
+ "VALUES (?, 1)";
+ }
+ if (!query.Prepare(sql_counter)) {
+ LOG4CXX_INFO(logger_, "Incorrect statement of update app counter");
+ return;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Failed updating app counter");
+ }
+}
+
+void SQLPTExtRepresentation::Set(const std::string& app_id,
+ const std::string& type,
+ const std::string& value) const {
+ utils::dbms::SQLQuery query(db());
+ std::string sql_info;
+ if (IsExistAppLevel(app_id)) {
+ // update
+ sql_info = "UPDATE `app_level` SET `" + type +
+ "` = ? "
+ "WHERE `application_id` = ?";
+ } else {
+ // insert
+ sql_info = "INSERT INTO `app_level` (`" + type +
+ "`, `application_id`) "
+ "VALUES (?, ?)";
+ }
+ if (!query.Prepare(sql_info)) {
+ LOG4CXX_INFO(logger_, "Incorrect statement of update app info");
+ return;
+ }
+ query.Bind(0, value);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Failed updating app info");
+ }
+}
+
+void SQLPTExtRepresentation::Add(const std::string& app_id,
+ const std::string& type,
+ int seconds) const {
+ utils::dbms::SQLQuery query(db());
+ std::string sql_stopwatch;
+ if (IsExistAppLevel(app_id)) {
+ // update
+ sql_stopwatch = "UPDATE `app_level` SET `" + type + "` = `" + type +
+ "` + ? WHERE `application_id` = ?";
+ } else {
+ // insert
+ sql_stopwatch = "INSERT INTO `app_level` (`" + type +
+ "`, `application_id`) "
+ "VALUES (?, ?)";
+ }
+ if (!query.Prepare(sql_stopwatch)) {
+ LOG4CXX_INFO(logger_, "Incorrect statement of update app stopwatch");
+ return;
+ }
+ query.Bind(0, seconds);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Failed updating app stopwatch");
+ }
+}
+
+bool SQLPTExtRepresentation::GetDefaultHMI(const std::string& policy_app_id,
+ std::string* default_hmi) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectDefaultHmi)) {
+ LOG4CXX_INFO(logger_, "Incorrect statement for default hmi.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Error during default hmi getting.");
+ return false;
+ }
+
+ if (query.IsNull(0)) {
+ default_hmi->clear();
+ return true;
+ }
+
+ default_hmi->assign(query.GetString(0));
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::CountUnconsentedGroups(
+ const std::string& policy_app_id,
+ const std::string& device_id,
+ int* result) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kCountUnconsentedGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect select for unconsented groups.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+ query.Bind(1, device_id);
+ query.Bind(2, kDefaultId);
+ query.Bind(3, kPreDataConsentId);
+
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Error during executing unconsented groups.");
+ return false;
+ }
+ *result = query.GetInteger(0);
+ return true;
+}
+
+bool SQLPTExtRepresentation::IsMsgLanguagePresent(const std::string& message,
+ const std::string& language) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kHasMsgLanguageCode)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for message language check.");
+ return false;
+ }
+
+ query.Bind(0, message);
+ query.Bind(1, language);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to check message language code.");
+ return false;
+ }
+
+ return query.GetInteger(0) != 0;
+}
+
+bool SQLPTExtRepresentation::SaveMessageString(
+ const std::string& type,
+ const std::string& lang,
+ const policy_table::MessageString& strings) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertMessageString)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for message.");
+ return false;
+ }
+
+ if (strings.tts.is_initialized()) {
+ query.Bind(0, *strings.tts);
+ }
+ if (strings.label.is_initialized()) {
+ query.Bind(1, *strings.label);
+ }
+ if (strings.line1.is_initialized()) {
+ query.Bind(2, *strings.line1);
+ }
+ if (strings.line2.is_initialized()) {
+ query.Bind(3, *strings.line2);
+ }
+ query.Bind(4, lang);
+ query.Bind(5, type);
+ if (strings.textBody.is_initialized()) {
+ query.Bind(6, *strings.textBody);
+ }
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into message.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::SaveUsageAndErrorCounts(
+ const policy_table::UsageAndErrorCounts& counts) {
+ return SaveAppCounters(*counts.app_level) && SaveGlobalCounters(counts);
+}
+
+bool SQLPTExtRepresentation::SaveModuleMeta(
+ const policy_table::ModuleMeta& meta) {
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(sql_pt_ext::kSaveModuleMeta)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for module_meta.");
+ return false;
+ }
+ const int64_t odometer = *(meta.pt_exchanged_at_odometer_x);
+
+ query.Bind(0, *(meta.ccpu_version));
+ query.Bind(1, *(meta.language));
+ query.Bind(2, *(meta.wers_country_code));
+ query.Bind(3, odometer);
+ query.Bind(4, *(meta.pt_exchanged_x_days_after_epoch));
+ query.Bind(5, *(meta.ignition_cycles_since_last_exchange));
+ query.Bind(6, *(meta.vin));
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update for module_meta.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::SaveAppCounters(
+ const rpc::policy_table_interface_base::AppLevels& app_levels) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteAppLevel)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from app level.");
+ return false;
+ }
+ if (!query.Prepare(sql_pt::kInsertAppLevel)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app level.");
+ return false;
+ }
+
+ policy_table::AppLevels::const_iterator it;
+ for (it = app_levels.begin(); it != app_levels.end(); ++it) {
+ query.Bind(0, it->first);
+ query.Bind(1, it->second.minutes_in_hmi_full);
+ query.Bind(2, it->second.minutes_in_hmi_limited);
+ query.Bind(3, it->second.minutes_in_hmi_background);
+ query.Bind(4, it->second.minutes_in_hmi_none);
+ query.Bind(5, it->second.count_of_user_selections);
+ query.Bind(6, it->second.count_of_rejections_sync_out_of_memory);
+ query.Bind(7, it->second.count_of_rejections_nickname_mismatch);
+ query.Bind(8, it->second.count_of_rejections_duplicate_name);
+ query.Bind(9, it->second.count_of_rejected_rpc_calls);
+ query.Bind(10, it->second.count_of_rpcs_sent_in_hmi_none);
+ query.Bind(11, it->second.count_of_removals_for_bad_behavior);
+ query.Bind(12, it->second.count_of_run_attempts_while_revoked);
+ query.Bind(13, it->second.app_registration_language_gui);
+ query.Bind(14, it->second.app_registration_language_vui);
+ query.Bind(15, it->second.count_of_tls_errors);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into app level.");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool SQLPTExtRepresentation::SaveGlobalCounters(
+ const rpc::policy_table_interface_base::UsageAndErrorCounts& counts) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kUpdateGlobalCounters)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for global counters.");
+ return false;
+ }
+
+ query.Bind(0, *counts.count_of_iap_buffer_full);
+ query.Bind(1, *counts.count_sync_out_of_memory);
+ query.Bind(2, *counts.count_of_sync_reboots);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into global counters.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTExtRepresentation::CleanupUnpairedDevices(
+ const DeviceIds& device_ids) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery delete_device_query(db());
+ if (!delete_device_query.Prepare(sql_pt::kDeleteDevice)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for device delete.");
+ return true;
+ }
+
+ utils::dbms::SQLQuery delete_device_consent_query(db());
+ if (!delete_device_consent_query.Prepare(sql_pt_ext::kDeleteDeviceConsent)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for delete device consent.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery delete_app_consent_query(db());
+ if (!delete_app_consent_query.Prepare(sql_pt_ext::kDeleteAppConsent)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement for delete app consent.");
+ return false;
+ }
+
+ DeviceIds::const_iterator it = device_ids.begin();
+ DeviceIds::const_iterator it_end = device_ids.end();
+ for (; it != it_end; ++it) {
+ delete_device_query.Bind(0, (*it));
+ if (!delete_device_query.Exec() || !delete_device_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Failed to delete from device");
+ return false;
+ }
+
+ delete_device_consent_query.Bind(0, (*it));
+ if (!delete_device_consent_query.Exec() ||
+ !delete_device_consent_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Failed to delete from device consent.");
+ return false;
+ }
+
+ delete_app_consent_query.Bind(0, (*it));
+ if (!delete_app_consent_query.Exec() || !delete_app_consent_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Failed to delete from app consent.");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool SQLPTExtRepresentation::SetDefaultPolicy(const std::string& app_id) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kDeleteAppGroupByApplicationId)) {
+ LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt_ext::kDeletePreconsentedGroupsByApplicationId)) {
+ LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
+ return false;
+ }
+
+ if (!CopyApplication(kDefaultId, app_id)) {
+ return false;
+ }
+
+ SetPreloaded(false);
+
+ policy_table::Strings default_groups;
+ policy_table::Strings default_preconsented_groups;
+ GatherAppGroup(kDefaultId, &default_groups);
+ GatherPreconsentedGroup(kDefaultId, &default_preconsented_groups);
+ if (SaveAppGroup(app_id, default_groups) &&
+ SavePreconsentedGroup(app_id, default_preconsented_groups)) {
+ return SetIsDefault(app_id, true) && SetIsPredata(app_id, false);
+ }
+
+ return false;
+}
+
+bool SQLPTExtRepresentation::SetPredataPolicy(const std::string& app_id) {
+ LOG4CXX_INFO(logger_,
+ "SQLPTExtRepresentation::SetPredataPolicy for " << app_id);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kDeleteAppGroupByApplicationId)) {
+ LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt_ext::kDeletePreconsentedGroupsByApplicationId)) {
+ LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
+ return false;
+ }
+
+ if (!CopyApplication(kPreDataConsentId, app_id)) {
+ return false;
+ }
+
+ SetPreloaded(false);
+
+ policy_table::Strings predataconsent_groups;
+ policy_table::Strings predataconsent_preconsented_groups;
+ GatherAppGroup(kPreDataConsentId, &predataconsent_groups);
+ GatherPreconsentedGroup(kPreDataConsentId, &predataconsent_groups);
+ if (SaveAppGroup(app_id, predataconsent_groups) &&
+ SavePreconsentedGroup(app_id, predataconsent_groups)) {
+ return SetIsDefault(app_id, false) && SetIsPredata(app_id, true);
+ }
+ return false;
+}
+
+bool SQLPTExtRepresentation::IsPredataPolicy(const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectApplicationIsPreData)) {
+ LOG4CXX_WARN(logger_, "Incorrect select application is pre_dataConsented");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed select application is pre_dataConsented");
+ return false;
+ }
+ return query.IsNull(0) ? false : query.GetBoolean(0);
+}
+
+bool SQLPTExtRepresentation::SetIsPredata(const std::string& app_id,
+ bool is_pre_data) {
+ LOG4CXX_TRACE(logger_, "Set flag is_predata of application");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kUpdateIsPredata)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for updating is_predata");
+ return false;
+ }
+
+ query.Bind(0, is_pre_data);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update is_predata");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTExtRepresentation::SetUnpairedDevice(const std::string& device_id,
+ bool unpaired) const {
+ LOG4CXX_TRACE(logger_, "Set unpaired device: " << device_id);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kUpdateUnpairedDevice)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for updating unpaired device");
+ return false;
+ }
+
+ query.Bind(0, unpaired);
+ query.Bind(1, device_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update unpaired device");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTExtRepresentation::UnpairedDevicesList(DeviceIds* device_ids) const {
+ LOG4CXX_TRACE(logger_, "Get list of unpaired devices");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectUnpairedDevices)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for selecting unpaired devices");
+ return false;
+ }
+
+ while (query.Next()) {
+ device_ids->push_back(query.GetString(0));
+ }
+ return true;
+}
+
+bool SQLPTExtRepresentation::SetVINValue(const std::string& value) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kUpdateModuleMetaVinParam)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for updating module_meta params");
+ return false;
+ }
+
+ query.Bind(0, value);
+ const bool result = query.Exec();
+
+ if (!result) {
+ LOG4CXX_WARN(logger_, "Failed update module_meta");
+ }
+ return result;
+}
+
+bool SQLPTExtRepresentation::SaveExternalConsentStatus(
+ const ExternalConsentStatus& status) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kInsertExternalConsentStatus)) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect statement for saving external consent status.");
+ return false;
+ }
+
+ ExternalConsentStatus::const_iterator it = status.begin();
+ ExternalConsentStatus::const_iterator end = status.end();
+ for (; end != it; ++it) {
+ query.Bind(0, static_cast<int>(it->entity_type_));
+ query.Bind(1, static_cast<int>(it->entity_id_));
+ // Due to query structure need to provide that twice
+ query.Bind(2, static_cast<int>(it->entity_type_));
+ query.Bind(3, static_cast<int>(it->entity_id_));
+ query.Bind(4,
+ policy::kStatusOn == it->status_ ? std::string("ON")
+ : std::string("OFF"));
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_ERROR(logger_, "Error during ExternalConsent status saving.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+ExternalConsentStatus SQLPTExtRepresentation::GetExternalConsentStatus() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kSelectExternalConsentStatus)) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect statement for selecting external consent status.");
+ return ExternalConsentStatus();
+ }
+
+ ExternalConsentStatus status;
+ while (query.Next()) {
+ const policy::EntityStatus on_off =
+ query.GetString(2) == "ON" ? policy::kStatusOn : policy::kStatusOff;
+ ExternalConsentStatusItem item(static_cast<uint32_t>(query.GetInteger(0)),
+ static_cast<uint32_t>(query.GetInteger(1)),
+ on_off);
+ status.insert(item);
+ }
+
+ return status;
+}
+
+bool SQLPTExtRepresentation::RemoveAppConsentForGroup(
+ const std::string& policy_app_id,
+ const std::string& functional_group_name) const {
+ utils::dbms::SQLQuery query_group_id(db());
+ if (!query_group_id.Prepare(sql_pt_ext::kSelectGroupId)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for select group name.");
+ return false;
+ }
+
+ query_group_id.Bind(0, functional_group_name);
+
+ if (!query_group_id.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to select group id.");
+ return false;
+ }
+
+ const int id = query_group_id.GetInteger(0);
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kDeleteAppGroupConsent)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for remove app consent.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+ query.Bind(1, id);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to remove app consent.");
+ return false;
+ }
+
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc
new file mode 100644
index 0000000000..4afce16885
--- /dev/null
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -0,0 +1,848 @@
+/*
+ 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 "policy/sql_pt_queries.h"
+
+namespace policy {
+namespace sql_pt {
+
+const std::string kSelectPriority =
+ "SELECT `priority_value` FROM `application` WHERE `id` = ? LIMIT 1";
+const std::string kCreateSchema =
+ "BEGIN; "
+ "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 "
+ "); "
+ "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 "
+ "); "
+ "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), "
+ " `preloaded_date` VARCHAR (10), "
+ " `certificate` VARCHAR (45) "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `functional_group`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `user_consent_prompt` TEXT, "
+ " `name` VARCHAR(100) NOT NULL "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `external_consent_entities`( "
+ " `group_id` INTEGER NOT NULL, "
+ " `entity_type` INTEGER NOT NULL, "
+ " `entity_id` INTEGER NOT NULL, "
+ " `on_off` TEXT NOT NULL, "
+ " CONSTRAINT `fk_external_consent_entities_group_id` "
+ " FOREIGN KEY(`group_id`) "
+ " REFERENCES `functional_group`(`id`) "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `priority`( "
+ " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `hmi_level`( "
+ " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `notifications_by_priority`( "
+ " `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `value` INTEGER NOT NULL, "
+ " 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 "
+ "); "
+ "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 COLLATE NOCASE, "
+ " `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, "
+ " `remote_control_denied` BOOLEAN NOT NULL DEFAULT 0, "
+ " 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 COLLATE NOCASE, "
+ " `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` COLLATE NOCASE); "
+ "CREATE TABLE IF NOT EXISTS `preconsented_group`( "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " `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` COLLATE NOCASE); "
+ "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` VARCHAR(45), "
+ " 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 COLLATE NOCASE, "
+ " `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, "
+ " `count_of_tls_errors` 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` COLLATE NOCASE); "
+ "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 COLLATE NOCASE, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " 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` COLLATE NOCASE); "
+ "CREATE TABLE IF NOT EXISTS `app_type`( "
+ " `name` VARCHAR(50) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`name`,`application_id`), "
+ " CONSTRAINT `fk_app_type_application1` "
+ " 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 COLLATE NOCASE, "
+ " 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` COLLATE NOCASE); "
+ "CREATE TABLE IF NOT EXISTS `consent_group`( "
+ " `device_id` VARCHAR(100) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " `functional_group_id` INTEGER NOT NULL, "
+ " `is_consented` BOOL NOT NULL, "
+ " `input` VARCHAR(45), "
+ " `time_stamp` VARCHAR(45), "
+ " `last_updated` INTEGER, "
+ " 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 TABLE IF NOT EXISTS `external_consent_status_group`( "
+ " `device_id` VARCHAR(100) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " `functional_group_id` INTEGER NOT NULL, "
+ " `is_consented` BOOL NOT NULL, "
+ " `input` VARCHAR(45), "
+ " `time_stamp` VARCHAR(45), "
+ " `last_updated` INTEGER, "
+ " PRIMARY KEY(`application_id`,`functional_group_id`,`device_id`), "
+ " CONSTRAINT `fk_external_consent_status_group_device1` "
+ " FOREIGN KEY(`device_id`) "
+ " REFERENCES `device`(`id`), "
+ " CONSTRAINT `fk_external_consent_status_group_application1` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`), "
+ " CONSTRAINT `fk_external_consent_status_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 COLLATE NOCASE, "
+ " 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` COLLATE NOCASE); "
+ "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`) "
+ "); "
+
+ /* access_module */
+ "CREATE TABLE `access_module`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(45) NOT NULL, "
+ " `user_consent_needed` INTEGER NOT NULL "
+ "); "
+
+ /* remote_rpc */
+ "CREATE TABLE `remote_rpc`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(255) NOT NULL, "
+ " `parameter` VARCHAR(45), "
+ " `module_id` INTEGER NOT NULL, "
+ "CONSTRAINT `fk_remote_rpc_1` "
+ " FOREIGN KEY(`module_id`) "
+ " REFERENCES `access_module`(`id`) "
+ "); "
+ "CREATE INDEX `remote_rpc.fk_remote_rpc_1_idx` ON "
+ "`remote_rpc`(`module_id`); "
+
+ /* module type */
+ "CREATE TABLE IF NOT EXISTS `module_type`( "
+ " `name` VARCHAR(50) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`name`,`application_id`), "
+ " CONSTRAINT `fk_module_type_application1` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
+ "CREATE INDEX IF NOT EXISTS `module_type.fk_module_type_application1_idx` "
+ " ON `module_type`(`application_id` COLLATE NOCASE); "
+
+ "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`);"
+ "CREATE TABLE IF NOT EXISTS `_internal_data`( "
+ " `db_version_hash` INTEGER "
+ " ); "
+ "CREATE TABLE IF NOT EXISTS `_internal_external_consent_status`( "
+ " `id` INTEGER PRIMARY KEY AUTOINCREMENT, "
+ " `entity_type` INTEGER NOT NULL, "
+ " `entity_id` INTEGER NOT NULL, "
+ " `on_off` TEXT NOT NULL "
+ " ); "
+ "COMMIT;";
+
+const std::string kInsertInitData =
+ "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); "
+ "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); "
+ "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, 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'); "
+ "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('COMMUNICATION'); "
+ "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NORMAL'); "
+ "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NONE'); "
+ "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'); "
+ "INSERT OR IGNORE INTO `version` (`number`) VALUES('0'); "
+ "INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
+ "";
+
+const std::string kDeleteModuleTypes = "DELETE FROM `module_type`";
+
+const std::string kDeleteAllDevices = "DELETE FROM `device`;";
+
+const std::string kSelectRemoteControlDenied =
+ "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kUpdateRemoteControlDenied =
+ "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?";
+
+const std::string kDeleteAccessModules = "DELETE FROM `access_module`";
+
+const std::string kDeleteRemoteRpc = "DELETE FROM `remote_rpc`";
+
+const std::string kInsertAccessModule =
+ "INSERT INTO `access_module` (`name`, `user_consent_needed`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectAccessModules =
+ "SELECT `id`, `name` FROM `access_module` "
+ " WHERE `user_consent_needed` = ?";
+
+const std::string kInsertRemoteRpc =
+ "INSERT INTO `remote_rpc` (`module_id`, `name`, `parameter`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectRemoteRpcs =
+ "SELECT `name`, `parameter` FROM `remote_rpc` "
+ " WHERE `module_id` = ?";
+
+const std::string kInsertModuleType =
+ "INSERT OR IGNORE INTO `module_type` (`application_id`, `name`) VALUES (?, "
+ "?)";
+
+const std::string kSelectModuleTypes =
+ "SELECT DISTINCT `name` FROM `module_type` WHERE `application_id` = ?";
+
+const std::string kDropSchema =
+ "BEGIN; "
+ "DROP INDEX IF EXISTS `module_type.fk_module_type_application1_idx`; "
+ "DROP TABLE IF EXISTS `module_type`; "
+ "DROP INDEX IF EXISTS `message.fk_messages_languages1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`message.fk_message_consumer_friendly_messages1_idx`; "
+ "DROP TABLE IF EXISTS `message`; "
+ "DROP INDEX IF EXISTS `endpoint.fk_endpoint_application1_idx`; "
+ "DROP TABLE IF EXISTS `endpoint`; "
+ "DROP INDEX IF EXISTS `consent_group.fk_consent_group_device1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`consent_group.fk_consent_group_functional_group1_idx`; "
+ "DROP TABLE IF EXISTS `consent_group`; "
+ "DROP TABLE IF EXISTS `external_consent_status_group`; "
+ "DROP TABLE IF EXISTS `external_consent_entities`; "
+ "DROP INDEX IF EXISTS `app_type.fk_app_type_application1_idx`; "
+ "DROP TABLE IF EXISTS `app_type`; "
+ "DROP TABLE IF EXISTS `request_type`; "
+ "DROP INDEX IF EXISTS `nickname.fk_nickname_application1_idx`; "
+ "DROP TABLE IF EXISTS `nickname`; "
+ "DROP INDEX IF EXISTS `app_level.fk_app_level_language2_idx`; "
+ "DROP INDEX IF EXISTS `app_level.fk_app_level_language1_idx`; "
+ "DROP INDEX IF EXISTS `app_level.fk_app_levels_application1_idx`; "
+ "DROP TABLE IF EXISTS `app_level`; "
+ "DROP INDEX IF EXISTS "
+ "`device_consent_group.fk_device_has_functional_group_device1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`device_consent_group.fk_device_has_functional_group_functional_group1_"
+ "idx`; "
+ "DROP TABLE IF EXISTS `device_consent_group`; "
+ "DROP TABLE IF EXISTS `seconds_between_retry`; "
+ "DROP INDEX IF EXISTS "
+ "`preconsented_group.fk_application_has_functional_group_application2_idx`;"
+ " "
+ "DROP INDEX IF EXISTS "
+ "`preconsented_group.fk_application_has_functional_group_functional_group2_"
+ "idx`; "
+ "DROP TABLE IF EXISTS `preconsented_group`; "
+ "DROP TABLE IF EXISTS `access_module`; "
+ "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`app_group.fk_application_has_functional_group_application1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`app_group.fk_application_has_functional_group_functional_group1_idx`; "
+ "DROP TABLE IF EXISTS `app_group`; "
+ "DROP INDEX IF EXISTS `application.fk_application_priorities1_idx`; "
+ "DROP INDEX IF EXISTS `application.fk_application_hmi_level1_idx`; "
+ "DROP TABLE IF EXISTS `application`; "
+ "DROP INDEX IF EXISTS `rpc.select_rpc_name_hmi_level`; "
+ "DROP INDEX IF EXISTS `rpc.fk_rpc_functional_group1_idx`; "
+ "DROP INDEX IF EXISTS `rpc.fk_rpc_hmi_level1_idx`; "
+ "DROP TABLE IF EXISTS `rpc`; "
+ "DROP TABLE IF EXISTS `version`; "
+ "DROP TABLE IF EXISTS `message_type`; "
+ "DROP TABLE IF EXISTS `language`; "
+ "DROP INDEX IF EXISTS "
+ "`notifications_by_priority.fk_notifications_by_priority_priority1_idx`; "
+ "DROP TABLE IF EXISTS `notifications_by_priority`; "
+ "DROP TABLE IF EXISTS `hmi_level`; "
+ "DROP TABLE IF EXISTS `priority`; "
+ "DROP TABLE IF EXISTS `functional_group`; "
+ "DROP TABLE IF EXISTS `module_config`; "
+ "DROP TABLE IF EXISTS `remote_rpc`; "
+ "DROP INDEX IF EXISTS `remote_rpc.fk_remote_rpc_1_idx`; "
+ "DROP TABLE IF EXISTS `module_meta`; "
+ "DROP TABLE IF EXISTS `usage_and_error_count`; "
+ "DROP TABLE IF EXISTS `device`; "
+ "DROP TABLE IF EXISTS `_internal_data`; "
+ "DROP TABLE IF EXISTS `_internal_external_consent_status`; "
+ "COMMIT; "
+ "VACUUM;";
+
+const std::string kDeleteData =
+ "BEGIN; "
+ "DELETE FROM `message`; "
+ "DELETE FROM `module_type`; "
+ "DELETE FROM `endpoint`; "
+ "DELETE FROM `consent_group`; "
+ "DELETE FROM `external_consent_status_group`; "
+ "DELETE FROM `external_consent_entities`; "
+ "DELETE FROM `app_type`; "
+ "DELETE FROM `nickname`; "
+ "DELETE FROM `app_level`; "
+ "DELETE FROM `device_consent_group`; "
+ "DELETE FROM `seconds_between_retry`; "
+ "DELETE FROM `preconsented_group`; "
+ "DELETE FROM `app_group`; "
+ "DELETE FROM `application`; "
+ "DELETE FROM `rpc`; "
+ "DELETE FROM `access_module`; "
+ "DELETE FROM `version`; "
+ "DELETE FROM `message_type`; "
+ "DELETE FROM `language`; "
+ "DELETE FROM `notifications_by_priority`; "
+ "DELETE FROM `hmi_level`; "
+ "DELETE FROM `priority`; "
+ "DELETE FROM `functional_group`; "
+ "DELETE FROM `module_config`; "
+ "DELETE FROM `module_meta`; "
+ "DELETE FROM `remote_rpc`; "
+ "DELETE FROM `usage_and_error_count`; "
+ "DELETE FROM `device`; "
+ "DELETE FROM `request_type`; "
+ "COMMIT; "
+ "VACUUM;";
+
+const std::string kCheckDBIntegrity = "PRAGMA integrity_check";
+
+const std::string kCheckPgNumber = "PRAGMA page_count";
+
+const std::string kSelectRpc =
+ "SELECT DISTINCT `rpc`.`parameter` FROM `rpc` "
+ " JOIN `app_group` AS `g` ON (`g`.`functional_group_id` = "
+ "`rpc`.`functional_group_id` "
+ " AND (`g`.`application_id` = ?)) "
+ "WHERE `rpc`.`hmi_level_value` = ? AND `rpc`.`name` = ?";
+
+const std::string kSelectPreloaded =
+ "SELECT `preloaded_pt` FROM `module_config` "
+ "WHERE `preloaded_pt` = 1 LIMIT 1";
+
+const std::string kUpdatePreloaded =
+ "UPDATE `module_config` SET `preloaded_pt` = ?";
+
+const std::string kIsFirstRun = "SELECT `is_first_run` FROM `module_config` ";
+
+const std::string kSetNotFirstRun =
+ "UPDATE `module_config` SET `is_first_run`= 0 ";
+
+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 (?, ?, ?)";
+
+const std::string kInsertRpc =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
+ " VALUES (?, ?, ?)";
+
+const std::string kInsertExternalConsentEntity =
+ "INSERT INTO `external_consent_entities` (`group_id`, `entity_type`, "
+ "`entity_id`, `on_off`) "
+ " VALUES (?, ?, ?, ?)";
+
+const std::string kInsertRpcWithParameter =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `parameter`, "
+ "`functional_group_id`) "
+ " VALUES (?, ?, ?, ?)";
+
+const std::string kInsertApplication =
+ "INSERT OR IGNORE INTO `application` (`id`, `priority_value`, "
+ "`is_revoked`, `memory_kb`,"
+ " `heart_beat_timeout_ms`) VALUES (?,?,?,?,?)";
+
+const std::string kInsertAppGroup =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`)"
+ " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
+
+const std::string kInsertNickname =
+ "INSERT OR IGNORE INTO `nickname` (`application_id`, `name`) VALUES (?, ?)";
+
+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 =
+ "INSERT OR IGNORE INTO `message_type` (`name`) VALUES (?)";
+
+const std::string kInsertLanguage =
+ "INSERT OR IGNORE INTO `language` (`code`) VALUES (?)";
+
+const std::string kInsertMessageString =
+ "INSERT INTO `message` (`tts`, `label`, `line1`, `line2`, `language_code`, "
+ " `message_type_name`, `textBody`) VALUES (?, ?, ?, ?, ?, ?, ?)";
+
+const std::string kUpdateModuleConfig =
+ "UPDATE `module_config` SET `preloaded_pt` = ?, "
+ " `exchange_after_x_ignition_cycles` = ?,"
+ " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, "
+ " `timeout_after_x_seconds` = ?, `vehicle_make` = ?, "
+ " `vehicle_model` = ?, `vehicle_year` = ?, `preloaded_date` = ?, "
+ " `certificate` = ? ";
+
+const std::string kInsertEndpoint =
+ "INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
+ " VALUES (?, ?, ?)";
+
+const std::string kInsertSecondsBetweenRetry =
+ "INSERT INTO `seconds_between_retry` (`index`, `value`) VALUES (?, ?)";
+
+const std::string kInsertNotificationsByPriority =
+ "INSERT OR REPLACE INTO `notifications_by_priority` (`priority_value`, "
+ "`value`) "
+ " VALUES (?, ?)";
+
+const std::string kInsertDeviceData =
+ "INSERT OR IGNORE INTO `device` (`id`) VALUES (?)";
+
+const std::string kInsertAppLevel =
+ "INSERT INTO `app_level` (`application_id`, `minutes_in_hmi_full`,"
+ "`minutes_in_hmi_limited` ,`minutes_in_hmi_background`,"
+ "`minutes_in_hmi_none`,`count_of_user_selections`,"
+ "`count_of_rejections_sync_out_of_memory`,"
+ "`count_of_rejections_nickname_mismatch`,"
+ "`count_of_rejections_duplicate_name`,`count_of_rejected_rpcs_calls`,"
+ "`count_of_rpcs_sent_in_hmi_none`,`count_of_removals_for_bad_behavior`,"
+ "`count_of_run_attempts_while_revoked`,`app_registration_language_gui`,"
+ "`app_registration_language_vui`, `count_of_tls_errors`) "
+ "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
+
+const std::string kDeleteSecondsBetweenRetries =
+ "DELETE FROM `seconds_between_retry`";
+
+const std::string kDeleteEndpoint = "DELETE FROM `endpoint`";
+
+const std::string kDeleteAppLevel = "DELETE FROM `app_level`";
+
+const std::string kDeleteMessageString = "DELETE FROM `message`";
+
+const std::string kDeleteFunctionalGroup = "DELETE FROM `functional_group`";
+
+const std::string kDeleteRpc = "DELETE FROM `rpc`";
+
+const std::string kDeleteExternalConsentEntities =
+ "DELETE FROM `external_consent_entities`";
+
+const std::string kDeleteAppGroup = "DELETE FROM `app_group`";
+
+const std::string kSelectModuleConfig =
+ "SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, "
+ " `exchange_after_x_kilometers`, `exchange_after_x_days`, "
+ " `timeout_after_x_seconds`, `vehicle_make`,"
+ " `vehicle_model`, `vehicle_year`, `preloaded_date`, `certificate` "
+ " FROM `module_config`";
+
+const std::string kSelectEndpoints =
+ "SELECT `url`, `service`, `application_id` FROM `endpoint` ";
+
+const std::string kSelectNotificationsPerMin =
+ "SELECT `priority_value`, `value` FROM notifications_by_priority";
+
+const std::string kSelectNotificationsPerPriority =
+ "SELECT `value` FROM notifications_by_priority WHERE `priority_value` = ? ";
+
+const std::string kSelectAppLevels = "SELECT `application_id` FROM `app_level`";
+
+const std::string kSelectDeviceData = "SELECT * FROM `device`";
+
+const std::string kSelectFunctionalGroups =
+ "SELECT `id`,`name`, `user_consent_prompt` "
+ "FROM `functional_group`";
+
+const std::string kSelectAllRpcs =
+ "SELECT `name`, `hmi_level_value`, `parameter` "
+ "FROM `rpc` WHERE `functional_group_id` = ? ";
+
+const std::string kSelectExternalConsentEntities =
+ "SELECT `entity_type`, `entity_id`, `on_off` "
+ "FROM `external_consent_entities` WHERE `group_id` = ? ";
+
+const std::string kSelectUserMsgsVersion =
+ "SELECT DISTINCT `number` FROM `version`";
+
+const std::string kSelectAppPolicies =
+ "SELECT `id`, `priority_value`, `memory_kb`, "
+ " `heart_beat_timeout_ms` FROM `application`";
+
+const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
+
+const std::string kSelectAppGroups =
+ "SELECT `f`.`name` FROM `app_group` AS `a`"
+ " LEFT JOIN `functional_group` AS `f` "
+ " ON (`f`.`id` = `a`.`functional_group_id`)"
+ " WHERE `a`.`application_id` = ?";
+
+const std::string kSelectNicknames =
+ "SELECT DISTINCT `name` FROM `nickname` "
+ "WHERE `application_id` = ?";
+
+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`";
+
+const std::string kSelectIgnitionCycles =
+ "SELECT `c`.`exchange_after_x_ignition_cycles`, "
+ " `m`.`ignition_cycles_since_last_exchange` "
+ " FROM `module_config` AS `c`, `module_meta` AS `m` "
+ "LIMIT 1";
+
+const std::string kSelectKilometers =
+ "SELECT `c`.`exchange_after_x_kilometers`, "
+ " `m`.`pt_exchanged_at_odometer_x` "
+ " FROM `module_config` AS `c`, `module_meta` AS `m` "
+ "LIMIT 1";
+
+const std::string kSelectDays =
+ "SELECT `c`.`exchange_after_x_days`, "
+ " `m`.`pt_exchanged_x_days_after_epoch` "
+ " FROM `module_config` AS `c`, `module_meta` AS `m` "
+ "LIMIT 1";
+
+const std::string kIncrementIgnitionCycles =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 1 + "
+ " `ignition_cycles_since_last_exchange`";
+
+const std::string kResetIgnitionCycles =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 0";
+
+const std::string kSelectTimeoutResponse =
+ "SELECT `timeout_after_x_seconds` FROM `module_config` LIMIT 1";
+
+const std::string kUpdateFlagUpdateRequired =
+ "UPDATE `module_meta` SET `flag_update_required` = ?";
+
+const std::string kSelectFlagUpdateRequired =
+ "SELECT `flag_update_required` FROM `module_meta` LIMIT 1";
+
+const std::string kUpdateCountersSuccessfulUpdate =
+ "UPDATE `module_meta` SET `pt_exchanged_at_odometer_x` = ?,"
+ "`pt_exchanged_x_days_after_epoch` = ?";
+
+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` = ?";
+
+const std::string kUpdateApplicationCustomData =
+ "UPDATE `application` SET `is_revoked` = ?, `is_default` = ?,"
+ "`is_predata` = ? WHERE `id` = ?";
+
+const std::string kSelectApplicationRepresented =
+ "SELECT COUNT(`id`) FROM `application` WHERE `id` = ?";
+
+const std::string kSelectApplicationIsDefault =
+ "SELECT `is_default` FROM `application` WHERE `id` = ?";
+
+const std::string kUpdateIsDefault =
+ "UPDATE `application` SET `is_default` = ? WHERE `id` = ?";
+
+const std::string kDeleteDevice = "DELETE FROM `device` WHERE `id` = ?";
+
+const std::string kDeleteAppGroupByApplicationId =
+ "DELETE FROM `app_group` WHERE `application_id` = ?";
+
+const std::string kInsertApplicationFull =
+ "INSERT OR IGNORE INTO `application` (`id`, `keep_context`, `steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, "
+ " `memory_kb`, `heart_beat_timeout_ms`) "
+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+
+const std::string kSelectApplicationFull =
+ "SELECT `keep_context`, `steal_focus`, `default_hmi`, `priority_value`, "
+ " `is_revoked`, `is_default`, `is_predata`, `memory_kb`,"
+ " `heart_beat_timeout_ms` FROM `application` WHERE `id` = ?";
+
+const std::string kSelectDBVersion =
+ "SELECT `db_version_hash` from `_internal_data`";
+
+const std::string kUpdateDBVersion =
+ "UPDATE `_internal_data` SET `db_version_hash` = ? ";
+
+} // namespace sql_pt
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc
new file mode 100644
index 0000000000..f9cc5e5ed5
--- /dev/null
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -0,0 +1,2099 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <stdlib.h>
+#include <stdint.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "utils/logger.h"
+#include "utils/date_time.h"
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/file_system.h"
+#include "utils/gen_hash.h"
+#include "policy/sql_pt_representation.h"
+#include "policy/sql_wrapper.h"
+#include "policy/sql_pt_ext_queries.h"
+#include "policy/sql_pt_queries.h"
+#include "policy/policy_helper.h"
+#include "policy/cache_manager.h"
+#include "config_profile/profile.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+namespace dbms = utils::dbms;
+
+namespace {
+template <typename T, typename K>
+void InsertUnique(K value, T* array) {
+ uint32_t i = 0;
+ for (; i < array->size() && array->at(i) != value; ++i) {
+ continue;
+ }
+ if (array->size() == i) {
+ array->push_back(value);
+ }
+}
+
+#ifdef CUSTOMER_PASA
+const char* kDatabaseName = "policy.db";
+#else // CUSTOMER_PASA
+const char* kDatabaseName = "policy";
+#endif // CUSTOMER_PASA
+
+const std::string kExternalConsentEntitiesTypeStringOn = "ON";
+const std::string kExternalConsentEntitiesTypeStringOff = "OFF";
+
+} // namespace
+
+SQLPTRepresentation::SQLPTRepresentation()
+ : db_(new utils::dbms::SQLDatabase(kDatabaseName)) {
+ is_in_memory = false;
+}
+
+SQLPTRepresentation::SQLPTRepresentation(bool in_memory) {
+ is_in_memory = in_memory;
+#ifdef __QNX__
+ db_ = new utils::dbms::SQLDatabase(kDatabaseName);
+#else // __QNX__
+ if (in_memory) {
+ db_ = new utils::dbms::SQLDatabase();
+ } else {
+ db_ = new utils::dbms::SQLDatabase(kDatabaseName);
+ }
+#endif // __QNX__
+}
+
+SQLPTRepresentation::~SQLPTRepresentation() {
+ db_->Close();
+ delete db_;
+}
+
+std::string SQLPTRepresentation::GetLockScreenIconUrl() const {
+ utils::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;
+}
+
+void SQLPTRepresentation::CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) {
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(sql_pt::kSelectRpc)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select statement from rpcs"
+ << query.LastError().text());
+ return;
+ }
+ query.Bind(0, app_id);
+ query.Bind(1, hmi_level);
+ query.Bind(2, rpc);
+
+ bool ret = query.Next();
+ result.hmi_level_permitted = ret ? kRpcAllowed : kRpcDisallowed;
+ LOG4CXX_INFO(logger_,
+ "Level is " << (result.hmi_level_permitted == kRpcAllowed
+ ? "permitted"
+ : "not permitted"));
+ std::string parameter;
+ while (ret) {
+ if (!query.IsNull(0)) {
+ parameter = query.GetString(0);
+ result.list_of_allowed_params.insert(parameter);
+ }
+ ret = query.Next();
+ }
+}
+
+bool SQLPTRepresentation::IsPTPreloaded() {
+ utils::dbms::SQLQuery query(db());
+ return query.Prepare(sql_pt::kSelectPreloaded) && query.Next();
+}
+
+int SQLPTRepresentation::IgnitionCyclesBeforeExchange() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectIgnitionCycles) || !query.Exec()) {
+ LOG4CXX_WARN(logger_, "Can not select ignition cycles");
+ return 0;
+ }
+ int limit = query.GetInteger(0);
+ int current = query.GetInteger(1);
+
+ if (limit < 0 || current < 0 || current > limit) {
+ return 0;
+ }
+
+ return limit - current;
+}
+
+int SQLPTRepresentation::KilometersBeforeExchange(int current) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectKilometers) || !query.Exec()) {
+ LOG4CXX_WARN(logger_, "Can not select kilometers");
+ return 0;
+ }
+ int limit = query.GetInteger(0);
+ int last = query.GetInteger(1);
+
+ if (limit < 0 || last < 0 || current < 0 || current < last ||
+ limit < (current - last)) {
+ return 0;
+ }
+
+ return limit - (current - last);
+}
+
+bool SQLPTRepresentation::SetCountersPassedForSuccessfulUpdate(
+ int kilometers, int days_after_epoch) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateCountersSuccessfulUpdate)) {
+ LOG4CXX_WARN(logger_,
+ "Wrong update query for counters on successful update.");
+ return false;
+ }
+ query.Bind(0, kilometers);
+ query.Bind(1, days_after_epoch);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to update counters on successful update.");
+ return false;
+ }
+ return true;
+}
+
+int SQLPTRepresentation::DaysBeforeExchange(uint16_t current) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectDays) || !query.Exec()) {
+ LOG4CXX_WARN(logger_, "Can not select days");
+ return 0;
+ }
+ int limit = query.GetInteger(0);
+ int last = query.GetInteger(1);
+
+ if (0 == last) {
+ return limit;
+ }
+
+ if (limit < 0 || last < 0 || current < last || limit < (current - last)) {
+ return 0;
+ }
+
+ return limit - (current - last);
+}
+
+int SQLPTRepresentation::TimeoutResponse() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
+ LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
+ const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return defaultTimeout;
+ }
+ return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectSecondsBetweenRetries)) {
+ LOG4CXX_INFO(logger_,
+ "Incorrect select statement from seconds between retries");
+ return false;
+ }
+ while (query.Next()) {
+ seconds->push_back(query.GetInteger(0));
+ }
+ return true;
+}
+
+std::vector<UserFriendlyMessage> SQLPTRepresentation::GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language) {
+ std::vector<UserFriendlyMessage> result;
+ 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) {
+ UserFriendlyMessage msg;
+ msg.message_code = *it;
+ result.push_back(msg);
+ }
+ return result;
+}
+
+EndpointUrls SQLPTRepresentation::GetUpdateUrls(int service_type) {
+ LOG4CXX_INFO(logger_,
+ "SQLPTRepresentation::GetUpdateUrls for " << service_type);
+ utils::dbms::SQLQuery query(db());
+ EndpointUrls ret;
+ if (query.Prepare(sql_pt::kSelectEndpoint)) {
+ query.Bind(0, service_type);
+ while (query.Next()) {
+ EndpointData data;
+
+ data.url.push_back(query.GetString(0));
+ if (!query.IsNull(1)) {
+ data.app_id = query.GetString(1);
+ }
+ ret.push_back(data);
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Invalid select endpoints statement.");
+ }
+ return ret;
+}
+
+int SQLPTRepresentation::GetNotificationsNumber(const std::string& priority) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectNotificationsPerPriority)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select statement for priority "
+ "notification number.");
+ return 0;
+ }
+ query.Bind(0, priority);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect select from notifications by priority.");
+ return 0;
+ }
+
+ if (!query.IsNull(0)) {
+ return query.GetInteger(0);
+ }
+
+ return 0;
+}
+
+bool SQLPTRepresentation::GetPriority(const std::string& policy_app_id,
+ std::string* priority) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (NULL == priority) {
+ LOG4CXX_WARN(logger_, "Input priority parameter is null.");
+ return false;
+ }
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectPriority)) {
+ LOG4CXX_INFO(logger_, "Incorrect statement for priority.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Error during select priority.");
+ return false;
+ }
+
+ if (query.IsNull(0)) {
+ priority->clear();
+ return true;
+ }
+
+ priority->assign(query.GetString(0));
+
+ return true;
+}
+
+InitResult SQLPTRepresentation::Init(const PolicySettings* settings) {
+ settings_ = settings;
+ LOG4CXX_AUTO_TRACE(logger_);
+#ifdef BUILD_TESTS
+ open_counter_ = 0;
+#endif // BUILD_TESTS
+#ifndef __QNX__
+ if (!is_in_memory) {
+ const std::string& path = get_settings().app_storage_folder();
+ if (!path.empty()) {
+ db_->set_path(path + "/");
+ }
+ }
+#endif // __QNX__
+ if (!db_->Open()) {
+ LOG4CXX_ERROR(logger_, "Failed opening database.");
+ LOG4CXX_INFO(logger_, "Starting opening retries.");
+ const uint16_t attempts = get_settings().attempts_to_open_policy_db();
+ LOG4CXX_DEBUG(logger_, "Total attempts number is: " << attempts);
+ bool is_opened = false;
+ const uint16_t open_attempt_timeout_ms =
+ get_settings().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);
+#ifdef BUILD_TESTS
+ ++open_counter_;
+#endif // BUILD_TESTS
+ 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__
+ utils::dbms::SQLQuery check_pages(db());
+ if (!check_pages.Prepare(sql_pt::kCheckPgNumber) || !check_pages.Next()) {
+ LOG4CXX_WARN(logger_, "Incorrect pragma for page counting.");
+ } else {
+ if (0 < check_pages.GetInteger(0)) {
+ utils::dbms::SQLQuery db_check(db());
+ if (!db_check.Prepare(sql_pt::kCheckDBIntegrity)) {
+ LOG4CXX_WARN(logger_, "Incorrect pragma for integrity check.");
+ } else {
+ while (db_check.Next()) {
+ if (db_check.GetString(0).compare("ok") == 0) {
+ utils::dbms::SQLQuery check_first_run(db());
+ if (check_first_run.Prepare(sql_pt::kIsFirstRun) &&
+ check_first_run.Next()) {
+ LOG4CXX_INFO(logger_,
+ "Selecting is first run "
+ << check_first_run.GetBoolean(0));
+ if (check_first_run.GetBoolean(0)) {
+ utils::dbms::SQLQuery set_not_first_run(db());
+ set_not_first_run.Exec(sql_pt::kSetNotFirstRun);
+ return InitResult::SUCCESS;
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Incorrect select is first run");
+ }
+ return InitResult::EXISTS;
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "Existing policy table representation is invlaid.");
+ // TODO(PV): add handle
+ return InitResult::FAIL;
+ }
+ }
+ }
+ }
+ }
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kCreateSchema)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed creating schema of database: " << query.LastError().text());
+ return InitResult::FAIL;
+ }
+ if (!query.Exec(sql_pt::kInsertInitData)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed insert init data to database: " << query.LastError().text());
+ return InitResult::FAIL;
+ }
+ return InitResult::SUCCESS;
+}
+
+bool SQLPTRepresentation::Close() {
+ db_->Close();
+ return db_->LastError().number() == utils::dbms::OK;
+}
+
+const VehicleInfo SQLPTRepresentation::GetVehicleInfo() const {
+ policy_table::ModuleConfig module_config;
+ GatherModuleConfig(&module_config);
+ VehicleInfo vehicle_info;
+ vehicle_info.vehicle_make = *module_config.vehicle_make;
+ vehicle_info.vehicle_model = *module_config.vehicle_model;
+ vehicle_info.vehicle_year = *module_config.vehicle_year;
+ return vehicle_info;
+}
+
+bool SQLPTRepresentation::Drop() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDropSchema)) {
+ LOG4CXX_WARN(logger_,
+ "Failed dropping database: " << query.LastError().text());
+ return false;
+ }
+ return true;
+}
+
+void SQLPTRepresentation::WriteDb() {
+ db_->Backup();
+}
+
+bool SQLPTRepresentation::Clear() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteData)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed clearing 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;
+}
+
+bool SQLPTRepresentation::RefreshDB() {
+ utils::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_AUTO_TRACE(logger_);
+ utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ GatherModuleMeta(&*table->policy_table.module_meta);
+ GatherModuleConfig(&table->policy_table.module_config);
+ GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
+ GatherDeviceData(&*table->policy_table.device_data);
+ GatherFunctionalGroupings(&table->policy_table.functional_groupings);
+ GatherConsumerFriendlyMessages(
+ &*table->policy_table.consumer_friendly_messages);
+ GatherApplicationPoliciesSection(&table->policy_table.app_policies_section);
+ return table;
+}
+
+void SQLPTRepresentation::GatherModuleMeta(
+ policy_table::ModuleMeta* meta) const {
+ LOG4CXX_INFO(logger_, "Gather Module Meta Info");
+ meta->mark_initialized();
+ // Section Module Meta is empty for SDL specific
+}
+
+void SQLPTRepresentation::GatherModuleConfig(
+ policy_table::ModuleConfig* config) const {
+ LOG4CXX_INFO(logger_, "Gather Configuration Info");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectModuleConfig) || !query.Next()) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement for module config");
+ } else {
+ *config->preloaded_pt = query.GetBoolean(0);
+ config->exchange_after_x_ignition_cycles = query.GetInteger(1);
+ config->exchange_after_x_kilometers = query.GetInteger(2);
+ config->exchange_after_x_days = query.GetInteger(3);
+ config->timeout_after_x_seconds = query.GetInteger(4);
+ *config->vehicle_make = query.GetString(5);
+ *config->vehicle_model = query.GetString(6);
+ *config->vehicle_year = query.GetString(7);
+ *config->preloaded_date = query.GetString(8);
+ *config->certificate = query.GetString(9);
+ }
+
+ utils::dbms::SQLQuery endpoints(db());
+ if (!endpoints.Prepare(sql_pt::kSelectEndpoints)) {
+ 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)].push_back(
+ endpoints.GetString(0));
+ }
+ }
+
+ utils::dbms::SQLQuery notifications(db());
+ if (!notifications.Prepare(sql_pt::kSelectNotificationsPerMin)) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement for notifications");
+ } else {
+ while (notifications.Next()) {
+ config->notifications_per_minute_by_priority[notifications.GetString(0)] =
+ notifications.GetInteger(1);
+ }
+ }
+ utils::dbms::SQLQuery seconds(db());
+ if (!seconds.Prepare(sql_pt::kSelectSecondsBetweenRetries)) {
+ LOG4CXX_INFO(logger_,
+ "Incorrect select statement from seconds between retries");
+ } else {
+ while (seconds.Next()) {
+ config->seconds_between_retries.push_back(seconds.GetInteger(0));
+ }
+ }
+}
+
+bool SQLPTRepresentation::GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const {
+ LOG4CXX_INFO(logger_, "Gather Usage and Error Counts.");
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt::kSelectAppLevels)) {
+ policy_table::AppLevel app_level_empty;
+ app_level_empty.mark_initialized();
+ while (query.Next()) {
+ (*counts->app_level)[query.GetString(0)] = app_level_empty;
+ }
+ }
+ return true;
+}
+
+void SQLPTRepresentation::GatherDeviceData(
+ policy_table::DeviceData* data) const {
+ LOG4CXX_INFO(logger_, "Gather device data.");
+ data->mark_initialized();
+
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt::kSelectDeviceData)) {
+ policy_table::DeviceParams device_data_empty;
+ device_data_empty.mark_initialized();
+ while (query.Next()) {
+ (*data)[query.GetString(0)] = device_data_empty;
+ }
+ }
+}
+
+bool SQLPTRepresentation::GatherFunctionalGroupings(
+ policy_table::FunctionalGroupings* groups) const {
+ LOG4CXX_INFO(logger_, "Gather Functional Groupings info");
+ utils::dbms::SQLQuery func_group(db());
+ if (!func_group.Prepare(sql_pt::kSelectFunctionalGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from functional_groupings");
+ return false;
+ }
+
+ utils::dbms::SQLQuery rpcs(db());
+ if (!rpcs.Prepare(sql_pt::kSelectAllRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select all from rpc");
+ return false;
+ }
+
+ utils::dbms::SQLQuery external_consent_entities(db());
+ if (!external_consent_entities.Prepare(
+ sql_pt::kSelectExternalConsentEntities)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select statement for 'external_consent_entities'.");
+ return false;
+ }
+
+ while (func_group.Next()) {
+ policy_table::Rpcs rpcs_tbl;
+
+ if (!func_group.IsNull(2)) {
+ *rpcs_tbl.user_consent_prompt = func_group.GetString(2);
+ }
+
+ const int group_id = func_group.GetInteger(0);
+
+ rpcs.Bind(0, group_id);
+
+ while (rpcs.Next()) {
+ if (!rpcs.IsNull(1)) {
+ policy_table::HmiLevel level;
+ if (policy_table::EnumFromJsonString(rpcs.GetString(1), &level)) {
+ InsertUnique(level, &rpcs_tbl.rpcs[rpcs.GetString(0)].hmi_levels);
+ }
+ }
+ if (!rpcs.IsNull(2)) {
+ policy_table::Parameter param;
+ if (policy_table::EnumFromJsonString(rpcs.GetString(2), &param)) {
+ // EMPTY is a special mark to specify that 'parameters' section is
+ // present, but has no parameters. It is not valid parameter value.
+ if (policy_table::P_EMPTY == param) {
+ (*rpcs_tbl.rpcs[rpcs.GetString(0)].parameters).mark_initialized();
+ continue;
+ }
+ InsertUnique(param, &(*rpcs_tbl.rpcs[rpcs.GetString(0)].parameters));
+ }
+ }
+ }
+
+ rpcs.Reset();
+
+ if (!rpcs_tbl.rpcs.is_initialized()) {
+ rpcs_tbl.rpcs.set_to_null();
+ }
+
+ // Collecting entities for disallowed_by_external_consent_entities_on/off
+ external_consent_entities.Bind(0, group_id);
+ while (external_consent_entities.Next()) {
+ policy_table::ExternalConsentEntity external_consent_entity(
+ external_consent_entities.GetInteger(0),
+ external_consent_entities.GetInteger(1));
+
+ policy_table::DisallowedByExternalConsentEntities&
+ external_consent_entities_container =
+ kExternalConsentEntitiesTypeStringOn ==
+ external_consent_entities.GetString(2)
+ ? *rpcs_tbl.disallowed_by_external_consent_entities_on
+ : *rpcs_tbl.disallowed_by_external_consent_entities_off;
+
+ external_consent_entities_container.push_back(external_consent_entity);
+ }
+ external_consent_entities.Reset();
+ (*groups)[func_group.GetString(1)] = rpcs_tbl;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) const {
+ LOG4CXX_INFO(logger_, "Gather Consumer Friendly Messages");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectUserMsgsVersion) || !query.Next()) {
+ LOG4CXX_WARN(logger_, "Incorrect select from consumer_friendly_messages");
+ return false;
+ }
+
+ messages->version = query.GetString(0);
+
+ if (query.Prepare(sql_pt::kCollectFriendlyMsg)) {
+ while (query.Next()) {
+ UserFriendlyMessage msg;
+ msg.message_code = query.GetString(7);
+ std::string language = query.GetString(6);
+
+ (*messages->messages)[msg.message_code].languages[language];
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages.");
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const {
+ LOG4CXX_INFO(logger_, "Gather applications policies");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAppPolicies)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app_policies");
+ return false;
+ }
+
+ while (query.Next()) {
+ rpc::Nullable<policy_table::ApplicationParams> params;
+ const std::string& app_id = query.GetString(0);
+ if (IsApplicationRevoked(app_id)) {
+ params.set_to_null();
+ (*policies).apps[app_id] = params;
+ continue;
+ }
+ if (IsDefaultPolicy(app_id)) {
+ (*policies).apps[app_id].set_to_string(kDefaultId);
+ }
+ if (IsPredataPolicy(app_id)) {
+ (*policies).apps[app_id].set_to_string(kPreDataConsentId);
+ }
+ if (kDeviceId == app_id) {
+ // 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);
+ params.priority = priority;
+
+ *params.memory_kb = query.GetInteger(2);
+ *params.heart_beat_timeout_ms = query.GetUInteger(3);
+
+ if (!GatherAppGroup(app_id, &params.groups)) {
+ return false;
+ }
+
+#ifdef SDL_REMOTE_CONTROL
+ bool denied = false;
+ if (!GatherRemoteControlDenied(app_id, &denied)) {
+ return false;
+ }
+ if (!denied) {
+ if (!GatherModuleType(app_id, &*params.moduleType)) {
+ return false;
+ }
+ }
+#endif // SDL_REMOTE_CONTROL
+
+ if (!GatherNickName(app_id, &*params.nicknames)) {
+ return false;
+ }
+ if (!GatherAppType(app_id, &*params.AppHMIType)) {
+ return false;
+ }
+ if (!GatherRequestType(app_id, &*params.RequestType)) {
+ return false;
+ }
+
+ (*policies).apps[app_id] = params;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::Save(const policy_table::Table& table) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ db_->BeginTransaction();
+ if (!SaveFunctionalGroupings(table.policy_table.functional_groupings)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveApplicationPoliciesSection(
+ table.policy_table.app_policies_section)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveModuleConfig(table.policy_table.module_config)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveConsumerFriendlyMessages(
+ *table.policy_table.consumer_friendly_messages)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+
+ if (!SaveDeviceData(*table.policy_table.device_data)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveUsageAndErrorCounts(*table.policy_table.usage_and_error_counts)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveModuleMeta(*table.policy_table.module_meta)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ db_->CommitTransaction();
+ return true;
+}
+
+bool SQLPTRepresentation::SaveFunctionalGroupings(
+ const policy_table::FunctionalGroupings& groups) {
+ utils::dbms::SQLQuery query_delete(db());
+ if (!query_delete.Exec(sql_pt::kDeleteRpc)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from rpc.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteExternalConsentEntities)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from external consent entities.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteFunctionalGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from seconds between retries.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt::kInsertFunctionalGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for functional groups");
+ return false;
+ }
+
+ policy_table::FunctionalGroupings::const_iterator groups_it;
+
+ for (groups_it = groups.begin(); groups_it != groups.end(); ++groups_it) {
+ // Since we uses this id in other tables, we have to be sure
+ // that id for certain group will be same in case when
+ // we drop records from the table and add them again.
+ // That's why we use hash as a primary key insted of
+ // simple auto incremental index.
+ const long int id = abs(utils::Djb2HashFromString(groups_it->first));
+ // SQLite's Bind doesn support 'long' type
+ // So we need to explicitly cast it to int64_t
+ // to avoid ambiguity.
+ query.Bind(0, static_cast<int64_t>(id));
+ query.Bind(1, groups_it->first);
+ groups_it->second.user_consent_prompt.is_initialized()
+ ? query.Bind(2, *(groups_it->second.user_consent_prompt))
+ : query.Bind(2);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into functional groups");
+ return false;
+ }
+
+ const int64_t last_group_id = query.LastInsertId();
+
+ if (!SaveRpcs(last_group_id, groups_it->second.rpcs)) {
+ return false;
+ }
+
+ if (!SaveExternalConsentEntities(
+ last_group_id,
+ *groups_it->second.disallowed_by_external_consent_entities_on,
+ kExternalConsentEntitiesTypeOn)) {
+ return false;
+ }
+
+ if (!SaveExternalConsentEntities(
+ last_group_id,
+ *groups_it->second.disallowed_by_external_consent_entities_off,
+ kExternalConsentEntitiesTypeOff)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
+ const policy_table::Rpc& rpcs) {
+ utils::dbms::SQLQuery query(db());
+ utils::dbms::SQLQuery query_parameter(db());
+ if (!query.Prepare(sql_pt::kInsertRpc) ||
+ !query_parameter.Prepare(sql_pt::kInsertRpcWithParameter)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for rpc");
+ return false;
+ }
+
+ policy_table::Rpc::const_iterator it;
+ for (it = rpcs.begin(); it != rpcs.end(); ++it) {
+ const policy_table::HmiLevels& hmi_levels = it->second.hmi_levels;
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ const policy_table::Parameters& parameters = *it->second.parameters;
+ policy_table::HmiLevels::const_iterator hmi_it;
+ policy_table::Parameters::const_iterator ps_it;
+ for (hmi_it = hmi_levels.begin(); hmi_it != hmi_levels.end(); ++hmi_it) {
+ if (!parameters.empty()) {
+ 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)));
+ query_parameter.Bind(
+ 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");
+ return false;
+ }
+ }
+ } else if (parameters.is_initialized()) {
+ query_parameter.Bind(0, it->first);
+ query_parameter.Bind(
+ 1, std::string(policy_table::EnumToJsonString(*hmi_it)));
+ query_parameter.Bind(
+ 2,
+ std::string(policy_table::EnumToJsonString(policy_table::P_EMPTY)));
+ query_parameter.Bind(3, group_id);
+ if (!query_parameter.Exec() || !query_parameter.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into rpc with parameter");
+ return false;
+ }
+ } else {
+ query.Bind(0, it->first);
+ query.Bind(1, std::string(policy_table::EnumToJsonString(*hmi_it)));
+ query.Bind(2, group_id);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into rpc");
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies) {
+ utils::dbms::SQLQuery query_delete(db());
+ if (!query_delete.Exec(sql_pt::kDeleteAppGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from application.");
+ return false;
+ }
+
+ if (!query_delete.Exec(sql_pt::kDeleteRequestType)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from request type.");
+ return false;
+ }
+
+ // 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 =
+ 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 =
+ policies.apps.find(kPreDataConsentId);
+ if (policies.apps.end() != it_pre_data_consented) {
+ if (!SaveSpecificAppPolicy(*it_pre_data_consented)) {
+ return false;
+ }
+ }
+
+ if (!SaveDevicePolicy(policies.device)) {
+ return false;
+ }
+
+ policy_table::ApplicationPolicies::const_iterator it;
+ for (it = policies.apps.begin(); it != policies.apps.end(); ++it) {
+ // Skip saving of predefined app, since they should be saved before
+ if (IsPredefinedApp(*it)) {
+ continue;
+ }
+ if (!SaveSpecificAppPolicy(*it)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveSpecificAppPolicy(
+ const policy_table::ApplicationPolicies::value_type& app) {
+ utils::dbms::SQLQuery app_query(db());
+ if (!app_query.Prepare(sql_pt::kInsertApplication)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement into application (device).");
+ return false;
+ }
+
+ app_query.Bind(0, app.first);
+ app_query.Bind(
+ 1, std::string(policy_table::EnumToJsonString(app.second.priority)));
+ app_query.Bind(2, app.second.is_null());
+ app_query.Bind(3, *app.second.memory_kb);
+ app_query.Bind(4, static_cast<int64_t>(*app.second.heart_beat_timeout_ms));
+
+ if (!app_query.Exec() || !app_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into application.");
+ return false;
+ }
+
+ if (app.second.is_string()) {
+ if (kDefaultId.compare(app.second.get_string()) == 0) {
+ if (!SetDefaultPolicy(app.first)) {
+ return false;
+ }
+ // Stop saving other params, since predefined permissions already set
+ return true;
+ }
+ }
+
+ if (!SaveAppGroup(app.first, app.second.groups)) {
+ return false;
+ }
+
+#ifdef SDL_REMOTE_CONTROL
+
+ bool denied = !app.second.moduleType->is_initialized();
+ if (!SaveRemoteControlDenied(app.first, denied) ||
+ !SaveModuleType(app.first, *app.second.moduleType)) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
+
+ if (!SaveNickname(app.first, *app.second.nicknames)) {
+ return false;
+ }
+ 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) {
+ utils::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;
+}
+
+bool SQLPTRepresentation::SaveAppGroup(
+ const std::string& app_id, const policy_table::Strings& app_groups) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAppGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app group");
+ return false;
+ }
+ LOG4CXX_INFO(logger_, "SaveAppGroup");
+ policy_table::Strings::const_iterator it;
+ for (it = app_groups.begin(); it != app_groups.end(); ++it) {
+ std::string ssss = *it;
+ LOG4CXX_INFO(logger_, "Group: " << ssss);
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert into app group."
+ << query.LastError().text());
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveNickname(const std::string& app_id,
+ const policy_table::Strings& nicknames) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertNickname)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for nickname");
+ return false;
+ }
+
+ policy_table::Strings::const_iterator it;
+ for (it = nicknames.begin(); it != nicknames.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into nickname.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveAppType(const std::string& app_id,
+ const policy_table::AppHMITypes& types) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAppType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app type");
+ return false;
+ }
+
+ policy_table::AppHMITypes::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 app type.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRequestType(
+ const std::string& app_id, const policy_table::RequestTypes& types) {
+ utils::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;
+}
+
+bool SQLPTRepresentation::SaveModuleConfig(
+ const policy_table::ModuleConfig& config) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateModuleConfig)) {
+ LOG4CXX_WARN(logger_, "Incorrect update statement for module config");
+ return 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);
+ query.Bind(4, config.timeout_after_x_seconds);
+ config.vehicle_make.is_initialized() ? query.Bind(5, *(config.vehicle_make))
+ : query.Bind(5);
+ config.vehicle_model.is_initialized() ? query.Bind(6, *(config.vehicle_model))
+ : query.Bind(6);
+ config.vehicle_year.is_initialized() ? query.Bind(7, *(config.vehicle_year))
+ : query.Bind(7);
+ config.preloaded_date.is_initialized()
+ ? query.Bind(8, *(config.preloaded_date))
+ : query.Bind(8);
+ config.certificate.is_initialized() ? query.Bind(9, *(config.certificate))
+ : query.Bind(9);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update module config");
+ return false;
+ }
+
+ if (!SaveSecondsBetweenRetries(config.seconds_between_retries)) {
+ return false;
+ }
+
+ if (!SaveNumberOfNotificationsPerMinute(
+ config.notifications_per_minute_by_priority)) {
+ return false;
+ }
+
+ if (!SaveServiceEndpoints(config.endpoints)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveServiceEndpoints(
+ const policy_table::ServiceEndpoints& endpoints) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteEndpoint)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from endpoint.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt::kInsertEndpoint)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for endpoint");
+ return false;
+ }
+
+ policy_table::ServiceEndpoints::const_iterator it;
+ for (it = endpoints.begin(); it != endpoints.end(); ++it) {
+ const policy_table::URLList& apps = it->second;
+ policy_table::URLList::const_iterator app_it;
+ for (app_it = apps.begin(); app_it != apps.end(); ++app_it) {
+ 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(1, *url_it);
+ query.Bind(2, app_it->first);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into endpoint");
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveConsumerFriendlyMessages(
+ const policy_table::ConsumerFriendlyMessages& messages) {
+ 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
+ // the policy table. So it won't be changed/updated
+ if (!messages.messages.is_initialized()) {
+ LOG4CXX_INFO(logger_, "ConsumerFriendlyMessages messages list is empty");
+ return true;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ bool delete_query_exec_result = true;
+ if (!messages.messages->empty()) {
+ delete_query_exec_result = query.Exec(sql_pt::kDeleteMessageString);
+ }
+
+ if (!delete_query_exec_result) {
+ LOG4CXX_WARN(logger_, "Failed to delete messages from DB.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt::kUpdateVersion)) {
+ LOG4CXX_WARN(logger_, "Invalid update messages version statement.");
+ return false;
+ }
+
+ query.Bind(0, messages.version);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to update messages version number in DB.");
+ return false;
+ }
+
+ policy_table::Messages::const_iterator it;
+ for (it = messages.messages->begin(); it != messages.messages->end(); ++it) {
+ if (!SaveMessageType(it->first)) {
+ return false;
+ }
+ const policy_table::Languages& langs = it->second.languages;
+ policy_table::Languages::const_iterator lang_it;
+ for (lang_it = langs.begin(); lang_it != langs.end(); ++lang_it) {
+ if (!SaveLanguage(lang_it->first)) {
+ return false;
+ }
+ if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveMessageType(const std::string& type) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertMessageType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for message type.");
+ return false;
+ }
+
+ query.Bind(0, type);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into message type.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveLanguage(const std::string& code) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertLanguage)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for language.");
+ return false;
+ }
+
+ query.Bind(0, code);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into language.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveMessageString(
+ const std::string& type,
+ const std::string& lang,
+ const policy_table::MessageString& strings) {
+ // Section is empty for SDL specific
+ return true;
+}
+
+bool SQLPTRepresentation::SaveSecondsBetweenRetries(
+ const policy_table::SecondsBetweenRetries& seconds) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteSecondsBetweenRetries)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from seconds between retries.");
+ return false;
+ }
+ if (!query.Prepare(sql_pt::kInsertSecondsBetweenRetry)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for seconds between retries.");
+ return false;
+ }
+
+ for (uint32_t i = 0; i < seconds.size(); ++i) {
+ query.Bind(0, static_cast<int>(i));
+ query.Bind(1, seconds[i]);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into seconds between retries.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveNumberOfNotificationsPerMinute(
+ const policy_table::NumberOfNotificationsPerMinute& notifications) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertNotificationsByPriority)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for notifications by priority.");
+ return false;
+ }
+
+ policy_table::NumberOfNotificationsPerMinute::const_iterator it;
+ for (it = notifications.begin(); it != notifications.end(); ++it) {
+ query.Bind(0, it->first);
+ query.Bind(1, it->second);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into notifications by priority.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveDeviceData(
+ const policy_table::DeviceData& devices) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertDeviceData)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for device data.");
+ return false;
+ }
+
+ policy_table::DeviceData::const_iterator it;
+ for (it = devices.begin(); it != devices.end(); ++it) {
+ query.Bind(0, it->first);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into device data.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveUsageAndErrorCounts(
+ const policy_table::UsageAndErrorCounts& counts) {
+ const_cast<policy_table::UsageAndErrorCounts&>(counts).mark_initialized();
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteAppLevel)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from app level.");
+ return false;
+ }
+ if (!query.Prepare(sql_pt::kInsertAppLevel)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app level.");
+ return false;
+ }
+
+ policy_table::AppLevels::const_iterator it;
+ 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()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into app level.");
+ return false;
+ }
+ }
+ return true;
+}
+
+void SQLPTRepresentation::IncrementIgnitionCycles() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kIncrementIgnitionCycles)) {
+ LOG4CXX_WARN(logger_, "Failed incrementing ignition cycles");
+ }
+}
+
+void SQLPTRepresentation::ResetIgnitionCycles() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kResetIgnitionCycles)) {
+ LOG4CXX_WARN(logger_, "Failed to reset ignition cycles number.");
+ }
+}
+
+bool SQLPTRepresentation::UpdateRequired() const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectFlagUpdateRequired) || !query.Exec()) {
+ LOG4CXX_WARN(logger_,
+ "Failed select update required flag from module meta");
+ return false;
+ }
+ return query.GetBoolean(0);
+}
+
+void SQLPTRepresentation::SaveUpdateRequired(bool value) {
+ utils::dbms::SQLQuery query(db());
+ // TODO(AOleynik): Quick fix, will be reworked
+ if (!query.Prepare(/*sql_pt::kUpdateFlagUpdateRequired*/
+ "UPDATE `module_meta` SET `flag_update_required` = ?")) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect update into module meta (update_required): "
+ << strerror(errno));
+ return;
+ }
+ query.Bind(0, value);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update module meta (update_required)");
+ }
+}
+
+bool SQLPTRepresentation::GetInitialAppData(const std::string& app_id,
+ StringArray* nicknames,
+ StringArray* app_types) {
+ LOG4CXX_INFO(logger_, "Getting initial application data.");
+ utils::dbms::SQLQuery app_names(db());
+ if (!app_names.Prepare(sql_pt::kSelectNicknames)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app nicknames");
+ return false;
+ }
+ utils::dbms::SQLQuery app_hmi_types(db());
+ if (!app_hmi_types.Prepare(sql_pt::kSelectAppTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+ dbms::SQLQuery module_types(db());
+ if (!module_types.Prepare(sql_pt::kSelectModuleTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from module types");
+ return false;
+ }
+
+ app_names.Bind(0, app_id);
+ while (app_names.Next()) {
+ nicknames->push_back(app_names.GetString(0));
+ }
+ app_names.Reset();
+ app_hmi_types.Bind(0, app_id);
+ while (app_hmi_types.Next()) {
+ app_types->push_back(app_hmi_types.GetString(0));
+ }
+ app_hmi_types.Reset();
+ module_types.Bind(0, app_id);
+ while (module_types.Next()) {
+ app_types->push_back(module_types.GetString(0));
+ }
+ module_types.Reset();
+
+ return true;
+}
+
+bool SQLPTRepresentation::GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return GatherFunctionalGroupings(&groups);
+}
+
+bool SQLPTRepresentation::GatherAppType(
+ const std::string& app_id, policy_table::AppHMITypes* app_types) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAppTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ policy_table::AppHMIType type;
+ if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
+ return false;
+ }
+ app_types->push_back(type);
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherRequestType(
+ const std::string& app_id,
+ policy_table::RequestTypes* request_types) const {
+ utils::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 {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectNicknames)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app nicknames");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ nicknames->push_back(query.GetString(0));
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherAppGroup(
+ const std::string& app_id, policy_table::Strings* app_groups) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAppGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app groups");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ app_groups->push_back(query.GetString(0));
+ }
+ return true;
+}
+
+#ifdef SDL_REMOTE_CONTROL
+
+bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
+ bool* denied) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect select remote control flag");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (query.Next()) {
+ *denied = query.GetBoolean(0);
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherModuleType(
+ const std::string& app_id, policy_table::ModuleTypes* app_types) const {
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectModuleTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ policy_table::ModuleType type;
+ if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
+ return false;
+ }
+ app_types->push_back(type);
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id,
+ bool deny) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny);
+ query.Bind(0, deny);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update remote control flag.");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveModuleType(
+ const std::string& app_id, const policy_table::ModuleTypes& types) {
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertModuleType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for module type");
+ return false;
+ }
+
+ policy_table::ModuleTypes::const_iterator it;
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveAccessModule(
+ TypeAccess access, const policy_table::AccessModules& modules) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAccessModule)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for access module");
+ return false;
+ }
+
+ policy_table::AccessModules::const_iterator i;
+ for (i = modules.begin(); i != modules.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ query.Bind(0, name);
+ query.Bind(1, access);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into access module.");
+ return false;
+ }
+ int id = query.LastInsertId();
+ if (!query.Reset()) {
+ LOG4CXX_WARN(logger_, "Couldn't reset query access module.");
+ return false;
+ }
+ if (!SaveRemoteRpc(id, rpcs)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherAccessModule(
+ TypeAccess access, policy_table::AccessModules* modules) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAccessModules)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from access module");
+ return false;
+ }
+
+ query.Bind(0, access);
+ while (query.Next()) {
+ int id = query.GetInteger(0);
+ std::string name = query.GetString(1);
+ policy_table::RemoteRpcs rpcs;
+ if (!GatherRemoteRpc(id, &rpcs)) {
+ return false;
+ }
+ modules->insert(std::make_pair(name, rpcs));
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteRpc(int module_id,
+ const policy_table::RemoteRpcs& rpcs) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRemoteRpc)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for remote rpc");
+ return false;
+ }
+ policy_table::RemoteRpcs::const_iterator i;
+ for (i = rpcs.begin(); i != rpcs.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::Strings& params = i->second;
+ policy_table::Strings::const_iterator j;
+ if (params.empty()) {
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ } else {
+ for (j = params.begin(); j != params.end(); ++j) {
+ const std::string& param = *j;
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2, param);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherRemoteRpc(
+ int module_id, policy_table::RemoteRpcs* rpcs) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from remote rpc");
+ return false;
+ }
+
+ query.Bind(0, module_id);
+ while (query.Next()) {
+ std::string name = query.GetString(0);
+ if (!query.IsNull(1)) {
+ std::string parameter = query.GetString(1);
+ (*rpcs)[name].push_back(parameter);
+ } else {
+ rpcs->insert(std::make_pair(name, policy_table::Strings()));
+ }
+ }
+ return true;
+}
+#endif // SDL_REMOTE_CONTROL
+
+bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateApplicationCustomData)) {
+ LOG4CXX_WARN(logger_, "Incorrect update in application");
+ return false;
+ }
+
+ query.Bind(0, is_revoked);
+ query.Bind(1, is_default);
+ query.Bind(2, is_predata);
+ query.Bind(3, app_id);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update in application");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::IsApplicationRevoked(
+ const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectApplicationRevoked)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from is_revoked of application");
+ }
+
+ query.Bind(0, app_id);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed select is_revoked of application");
+ return false;
+ }
+ return query.IsNull(0) ? false : query.GetBoolean(0);
+}
+bool SQLPTRepresentation::IsApplicationRepresented(
+ const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectApplicationRepresented)) {
+ LOG4CXX_WARN(logger_, "Incorrect select application by id");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed select application by id");
+ return false;
+ }
+ return query.GetInteger(0) != 0;
+}
+
+bool SQLPTRepresentation::IsDefaultPolicy(const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectApplicationIsDefault)) {
+ LOG4CXX_WARN(logger_, "Incorrect select application by id");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed select application by id");
+ return false;
+ }
+ return query.IsNull(0) ? false : query.GetBoolean(0);
+}
+
+bool SQLPTRepresentation::IsPredataPolicy(const std::string& app_id) const {
+ return false;
+}
+
+bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kDeleteAppGroupByApplicationId)) {
+ LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
+ return false;
+ }
+
+ if (!CopyApplication(kDefaultId, app_id)) {
+ return false;
+ }
+
+ SetPreloaded(false);
+
+ policy_table::RequestTypes request_types;
+ if (!GatherRequestType(kDefaultId, &request_types) ||
+ !SaveRequestType(app_id, request_types)) {
+ return false;
+ }
+ policy_table::AppHMITypes app_types;
+ if (!GatherAppType(kDefaultId, &app_types) ||
+ !SaveAppType(app_id, app_types)) {
+ return false;
+ }
+
+ policy_table::Strings default_groups;
+ bool ret = (GatherAppGroup(kDefaultId, &default_groups) &&
+ SaveAppGroup(app_id, default_groups));
+ if (ret) {
+ return SetIsDefault(app_id, true);
+ }
+ return false;
+}
+
+bool SQLPTRepresentation::SetIsDefault(const std::string& app_id,
+ bool is_default) const {
+ LOG4CXX_TRACE(logger_, "Set flag is_default of application");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateIsDefault)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for updating is_default");
+ return false;
+ }
+
+ query.Bind(0, is_default);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update is_default");
+ return false;
+ }
+ return true;
+}
+
+void SQLPTRepresentation::RemoveDB() const {
+ file_system::DeleteFile(db_->get_path());
+}
+
+bool SQLPTRepresentation::IsDBVersionActual() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectDBVersion) || !query.Exec()) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to get DB version: " << query.LastError().text());
+ return false;
+ }
+
+ const int32_t saved_db_version = query.GetInteger(0);
+ const int32_t current_db_version = GetDBVersion();
+ LOG4CXX_DEBUG(logger_,
+ "Saved DB version is: " << saved_db_version
+ << ". Current DB vesion is: "
+ << current_db_version);
+
+ return current_db_version == saved_db_version;
+}
+
+bool SQLPTRepresentation::UpdateDBVersion() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateDBVersion)) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect DB version query: " << query.LastError().text());
+ return false;
+ }
+
+ const int32_t db_version = GetDBVersion();
+ LOG4CXX_DEBUG(logger_, "DB version will be updated to: " << db_version);
+ query.Bind(0, db_version);
+
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_,
+ "DB version getting failed: " << query.LastError().text());
+ return false;
+ }
+
+ return true;
+}
+
+const int32_t SQLPTRepresentation::GetDBVersion() const {
+ return utils::Djb2HashFromString(sql_pt::kCreateSchema);
+}
+
+utils::dbms::SQLDatabase* SQLPTRepresentation::db() const {
+#ifdef __QNX__
+ utils::dbms::SQLDatabase* db = new utils::dbms::SQLDatabase(kDatabaseName);
+ db->Open();
+ return db;
+#else
+ return db_;
+#endif // __QNX__
+}
+
+bool SQLPTRepresentation::CopyApplication(const std::string& source,
+ const std::string& destination) {
+ utils::dbms::SQLQuery source_app(db());
+ if (!source_app.Prepare(sql_pt::kSelectApplicationFull)) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement from application.");
+ return false;
+ }
+ source_app.Bind(0, source);
+ if (!source_app.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed selecting from application.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertApplicationFull)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
+ return false;
+ }
+ query.Bind(0, destination);
+ source_app.IsNull(0) ? query.Bind(1)
+ : query.Bind(1, source_app.GetBoolean(0));
+ source_app.IsNull(1) ? query.Bind(2)
+ : query.Bind(2, source_app.GetBoolean(1));
+ source_app.IsNull(2) ? query.Bind(3) : query.Bind(3, source_app.GetString(2));
+ source_app.IsNull(3) ? query.Bind(4) : query.Bind(4, source_app.GetString(3));
+ source_app.IsNull(4) ? query.Bind(5)
+ : query.Bind(5, source_app.GetBoolean(4));
+ source_app.IsNull(5) ? query.Bind(6)
+ : query.Bind(6, source_app.GetBoolean(5));
+ source_app.IsNull(6) ? query.Bind(7)
+ : query.Bind(7, source_app.GetBoolean(6));
+ query.Bind(8, source_app.GetInteger(7));
+ query.Bind(9, source_app.GetInteger(8));
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed inserting into application.");
+ return false;
+ }
+ return true;
+}
+
+void SQLPTRepresentation::SetPreloaded(bool value) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdatePreloaded)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement of updating preloaded.");
+ return;
+ }
+
+ query.Bind(0, value);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed updating preloaded.");
+ return;
+ }
+}
+
+bool SQLPTRepresentation::SetVINValue(const std::string& value) {
+ return true;
+}
+
+bool SQLPTRepresentation::SaveExternalConsentEntities(
+ const int64_t group_id,
+ const policy_table::DisallowedByExternalConsentEntities& entities,
+ ExternalConsentEntitiesType type) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt_ext::kInsertExternalConsentEntity)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for external consent entities.");
+ return false;
+ }
+
+ const std::string external_consent_entity_type =
+ kExternalConsentEntitiesTypeOn == type
+ ? kExternalConsentEntitiesTypeStringOn
+ : kExternalConsentEntitiesTypeStringOff;
+
+ policy_table::DisallowedByExternalConsentEntities::const_iterator it_entity =
+ entities.begin();
+ for (; entities.end() != it_entity; ++it_entity) {
+ query.Bind(0, group_id);
+ query.Bind(1, it_entity->entity_type);
+ query.Bind(2, it_entity->entity_id);
+ query.Bind(3, external_consent_entity_type);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_ERROR(logger_,
+ "Can't insert '" << external_consent_entity_type
+ << "' external consent entity.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/status.cc b/src/components/policy/policy_external/src/status.cc
new file mode 100644
index 0000000000..31fc7f110b
--- /dev/null
+++ b/src/components/policy/policy_external/src/status.cc
@@ -0,0 +1,139 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "policy/status.h"
+#include "policy/update_status_manager.h"
+#include "utils/make_shared.h"
+
+policy::UpToDateStatus::UpToDateStatus()
+ : Status(kUpToDate, policy::PolicyTableStatus::StatusUpToDate) {}
+
+void policy::UpToDateStatus::ProcessEvent(UpdateStatusManager* manager,
+ policy::UpdateEvent event) {
+ switch (event) {
+ case kOnNewAppRegistered:
+ case kOnResetPolicyTableRequireUpdate:
+ case kScheduleUpdate:
+ case kScheduleManualUpdate:
+ case kOnResetRetrySequence:
+ manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ default:
+ break;
+ }
+}
+
+policy::UpdateNeededStatus::UpdateNeededStatus()
+ : Status(kUpdateNeeded, policy::PolicyTableStatus::StatusUpdateRequired) {}
+
+void policy::UpdateNeededStatus::ProcessEvent(
+ policy::UpdateStatusManager* manager, policy::UpdateEvent event) {
+ switch (event) {
+ case kOnUpdateSentOut:
+ manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ break;
+ case kOnResetPolicyTableRequireUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kOnResetPolicyTableNoUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ break;
+ default:
+ break;
+ }
+}
+
+bool policy::UpdateNeededStatus::IsUpdateRequired() const {
+ return true;
+}
+
+policy::UpdatingStatus::UpdatingStatus()
+ : Status(kUpdating, policy::PolicyTableStatus::StatusUpdatePending) {}
+
+void policy::UpdatingStatus::ProcessEvent(policy::UpdateStatusManager* manager,
+ policy::UpdateEvent event) {
+ switch (event) {
+ case kOnValidUpdateReceived:
+ case kOnResetPolicyTableNoUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ break;
+ case kOnNewAppRegistered:
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kOnWrongUpdateReceived:
+ case kOnUpdateTimeout:
+ manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kOnResetPolicyTableRequireUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kScheduleUpdate:
+ case kScheduleManualUpdate:
+ case kOnResetRetrySequence:
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ default:
+ break;
+ }
+}
+
+bool policy::UpdatingStatus::IsUpdatePending() const {
+ return true;
+}
+
+bool policy::UpdatingStatus::IsUpdateRequired() const {
+ return true;
+}
+
+policy::Status::Status(const std::string& string_status,
+ const policy::PolicyTableStatus enum_status)
+ : string_status_(string_status), enum_status_(enum_status) {}
+
+policy::Status::~Status() {}
+
+const std::string policy::Status::get_status_string() const {
+ return string_status_;
+}
+
+policy::PolicyTableStatus policy::Status::get_status() const {
+ return enum_status_;
+}
+
+bool policy::Status::IsUpdateRequired() const {
+ return false;
+}
+
+bool policy::Status::IsUpdatePending() const {
+ return false;
+}
diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc
new file mode 100644
index 0000000000..087db1149b
--- /dev/null
+++ b/src/components/policy/policy_external/src/update_status_manager.cc
@@ -0,0 +1,262 @@
+/*
+ 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/update_status_manager.h"
+#include "policy/policy_listener.h"
+#include "utils/logger.h"
+#include "utils/make_shared.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+UpdateStatusManager::UpdateStatusManager()
+ : listener_(NULL)
+ , current_status_(utils::MakeShared<UpToDateStatus>())
+ , last_processed_event_(kNoEvent)
+ , apps_search_in_progress_(false)
+ , app_registered_from_non_consented_device_(true) {
+ update_status_thread_delegate_ = new UpdateThreadDelegate(this);
+ thread_ = threads::CreateThread("UpdateStatusThread",
+ update_status_thread_delegate_);
+ thread_->start();
+}
+
+UpdateStatusManager::~UpdateStatusManager() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(update_status_thread_delegate_);
+ DCHECK(thread_);
+ thread_->join();
+ delete update_status_thread_delegate_;
+ threads::DeleteThread(thread_);
+}
+
+void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
+ sync_primitives::AutoLock lock(status_lock_);
+ current_status_->ProcessEvent(this, event);
+ last_processed_event_ = event;
+ DoTransition();
+}
+
+void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+ next_status_ = status;
+}
+
+void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+ postponed_status_ = status;
+}
+
+void UpdateStatusManager::set_listener(PolicyListener* listener) {
+ listener_ = listener;
+}
+
+void UpdateStatusManager::OnUpdateSentOut(uint32_t update_timeout) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(update_status_thread_delegate_);
+ update_status_thread_delegate_->updateTimeOut(update_timeout);
+ ProcessEvent(kOnUpdateSentOut);
+}
+
+void UpdateStatusManager::OnUpdateTimeoutOccurs() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessEvent(kOnUpdateTimeout);
+ DCHECK(update_status_thread_delegate_);
+ update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
+}
+
+void UpdateStatusManager::OnValidUpdateReceived() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
+ ProcessEvent(kOnValidUpdateReceived);
+}
+
+void UpdateStatusManager::OnWrongUpdateReceived() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
+ ProcessEvent(kOnWrongUpdateReceived);
+}
+
+void UpdateStatusManager::OnResetDefaultPT(bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ ProcessEvent(kOnResetPolicyTableRequireUpdate);
+ return;
+ }
+ ProcessEvent(kOnResetPolicyTableNoUpdate);
+}
+
+void UpdateStatusManager::OnResetRetrySequence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessEvent(kOnResetRetrySequence);
+}
+
+void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (kDeviceAllowed != consent) {
+ app_registered_from_non_consented_device_ = true;
+ return;
+ }
+ app_registered_from_non_consented_device_ = false;
+ ProcessEvent(kOnNewAppRegistered);
+}
+
+void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ current_status_.reset(new UpToDateStatus());
+ ProcessEvent(kScheduleUpdate);
+ }
+}
+
+void UpdateStatusManager::OnDeviceConsented() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (app_registered_from_non_consented_device_) {
+ ProcessEvent(kOnNewAppRegistered);
+ }
+}
+
+bool UpdateStatusManager::IsUpdateRequired() const {
+ return current_status_->IsUpdateRequired();
+}
+
+bool UpdateStatusManager::IsUpdatePending() const {
+ return current_status_->IsUpdatePending();
+}
+
+void UpdateStatusManager::ScheduleUpdate() {
+ ProcessEvent(kScheduleUpdate);
+}
+
+void UpdateStatusManager::ScheduleManualUpdate() {
+ ProcessEvent(kScheduleManualUpdate);
+}
+
+std::string UpdateStatusManager::StringifiedUpdateStatus() const {
+ return current_status_->get_status_string();
+}
+
+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::DoTransition() {
+ DCHECK_OR_RETURN_VOID(listener_);
+ if (!next_status_) {
+ return;
+ }
+
+ current_status_ = next_status_;
+ next_status_.reset();
+
+ if (last_processed_event_ != kScheduleManualUpdate) {
+ listener_->OnUpdateStatusChanged(current_status_->get_status_string());
+ }
+
+ if (!postponed_status_) {
+ return;
+ }
+
+ current_status_ = postponed_status_;
+ if (last_processed_event_ != kScheduleManualUpdate) {
+ listener_->OnUpdateStatusChanged(current_status_->get_status_string());
+ }
+ postponed_status_.reset();
+}
+
+UpdateStatusManager::UpdateThreadDelegate::UpdateThreadDelegate(
+ UpdateStatusManager* update_status_manager)
+ : timeout_(0)
+ , stop_flag_(false)
+ , state_lock_(true)
+ , update_status_manager_(update_status_manager) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Create UpdateThreadDelegate");
+}
+
+UpdateStatusManager::UpdateThreadDelegate::~UpdateThreadDelegate() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Delete UpdateThreadDelegate");
+}
+
+void UpdateStatusManager::UpdateThreadDelegate::threadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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 until timeout will be set,
+ // or UpdateStatusManager will be deleted
+ termination_condition_.Wait(auto_lock);
+ }
+ }
+}
+
+void UpdateStatusManager::UpdateThreadDelegate::exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ stop_flag_ = true;
+ LOG4CXX_DEBUG(logger_, "before notify");
+ termination_condition_.NotifyOne();
+}
+
+void UpdateStatusManager::UpdateThreadDelegate::updateTimeOut(
+ const uint32_t timeout_ms) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ timeout_ = timeout_ms;
+ termination_condition_.NotifyOne();
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc
new file mode 100644
index 0000000000..661ea29704
--- /dev/null
+++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc
@@ -0,0 +1,126 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_
+
+#include <cassert>
+#include "policy/usage_statistics/counter.h"
+#include "utils/date_time.h"
+#include "utils/make_shared.h"
+#include "utils/timer_task_impl.h"
+
+namespace usage_statistics {
+
+GlobalCounter::GlobalCounter(
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ GlobalCounterId counter_type)
+ : counter_type_(counter_type), statistics_manager_(statistics_manager) {}
+
+void GlobalCounter::operator++() const {
+ if (statistics_manager_) {
+ statistics_manager_->Increment(counter_type_);
+ }
+}
+
+AppCounter::AppCounter(
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ AppCounterId counter_type)
+ : app_id_(app_id)
+ , counter_type_(counter_type)
+ , statistics_manager_(statistics_manager) {}
+
+void AppCounter::operator++() const {
+ if (statistics_manager_) {
+ statistics_manager_->Increment(app_id_, counter_type_);
+ }
+}
+
+AppInfo::AppInfo(
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ AppInfoId info_type)
+ : app_id_(app_id)
+ , info_type_(info_type)
+ , statistics_manager_(statistics_manager) {}
+
+void AppInfo::Update(const std::string& new_info) const {
+ if (statistics_manager_) {
+ statistics_manager_->Set(app_id_, info_type_, new_info);
+ }
+}
+
+AppStopwatchImpl::AppStopwatchImpl(
+ utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager,
+ const std::string& app_id)
+ : app_id_(app_id)
+ , stopwatch_type_(SECONDS_HMI_NONE)
+ , statistics_manager_(statistics_manager)
+ , timer_("HMI levels timer",
+ new timer::TimerTaskImpl<AppStopwatchImpl>(
+ this, &AppStopwatchImpl::WriteTime))
+ , time_out_(60) {}
+
+AppStopwatchImpl::AppStopwatchImpl(
+ utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ uint32_t timeout)
+ : app_id_(app_id)
+ , stopwatch_type_(SECONDS_HMI_NONE)
+ , statistics_manager_(statistics_manager)
+ , timer_("HMI levels timer",
+ new timer::TimerTaskImpl<AppStopwatchImpl>(
+ this, &AppStopwatchImpl::WriteTime))
+ , time_out_(timeout) {}
+
+AppStopwatchImpl::~AppStopwatchImpl() {}
+
+void AppStopwatchImpl::Start(AppStopwatchId stopwatch_type) {
+ stopwatch_type_ = stopwatch_type;
+ timer_.Start(time_out_ * date_time::DateTime::MILLISECONDS_IN_SECOND,
+ timer::kPeriodic);
+}
+
+void AppStopwatchImpl::Switch(AppStopwatchId stopwatch_type) {
+ Start(stopwatch_type);
+}
+
+void AppStopwatchImpl::WriteTime() {
+ if (statistics_manager_) {
+ statistics_manager_->Add(app_id_, stopwatch_type_, time_out_);
+ }
+}
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_POLICY_INCLUDE_POLICY_STATISTICS_MANAGER_H_
diff --git a/src/components/policy/policy_external/test/CMakeLists.txt b/src/components/policy/policy_external/test/CMakeLists.txt
new file mode 100644
index 0000000000..a455d43b91
--- /dev/null
+++ b/src/components/policy/policy_external/test/CMakeLists.txt
@@ -0,0 +1,69 @@
+# 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
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${POLICY_PATH}/include
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/utils/include/
+ ${POLICY_MOCK_INCLUDE_PATH}
+)
+
+set(testLibraries
+ gmock
+ Utils
+ Policy
+ UsageStatistics
+ ConfigProfile
+)
+
+file (GLOB POLICY_TEST_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/policy_manager_impl_test_base.cc
+ *.cc)
+
+# Unbuildable
+list (REMOVE_ITEM POLICY_TEST_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/policy_manager_impl_stress_test.cc)
+
+if (REMOTE_CONTROL)
+ list (APPEND testSources
+ access_remote_impl_test.cc
+ )
+endif ()
+
+create_test("policy_test" "${POLICY_TEST_SOURCES}" "${testLibraries}")
+
+#Additional test files (json)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/json)
+file(GLOB JSON_TEST_FILES json/*.json)
+file(COPY ${JSON_TEST_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/json)
diff --git a/src/components/policy/policy_external/test/counter_test.cc b/src/components/policy/policy_external/test/counter_test.cc
new file mode 100644
index 0000000000..90f247de31
--- /dev/null
+++ b/src/components/policy/policy_external/test/counter_test.cc
@@ -0,0 +1,183 @@
+/* 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 "policy/usage_statistics/mock_statistics_manager.h"
+#include "policy/usage_statistics/counter.h"
+
+using ::testing::StrictMock;
+using ::testing::InSequence;
+
+namespace test {
+namespace components {
+namespace usage_statistics_test {
+
+using namespace usage_statistics;
+
+TEST(
+ StatisticsManagerIncrementMethod1Arg,
+ GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ GlobalCounter reboots_counter(msm, SYNC_REBOOTS);
+
+ // Assert
+ EXPECT_CALL(*msm, Increment(SYNC_REBOOTS));
+
+ // Act
+ ++reboots_counter;
+}
+
+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(
+ StatisticsManagerIncrementMethod2Args,
+ AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
+
+ // Assert
+ EXPECT_CALL(*msm, Increment("HelloApp", USER_SELECTIONS));
+
+ // Act
+ ++user_selections_counter;
+}
+
+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(StatisticsManagerSetMethod,
+ AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
+
+ // Assert
+ EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "Klingon"));
+
+ // Act
+ gui_language_info.Update("Klingon");
+}
+
+TEST(StatisticsManagerSetMethod,
+ AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
+
+ // 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(StatisticsManagerAddMethod,
+ AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ const std::uint32_t time_out = 1;
+ AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
+
+ hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, time_out));
+
+ // Act
+ hmi_full_stopwatch.WriteTime();
+}
+
+TEST(StatisticsManagerAddMethod,
+ AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
+ hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
+
+ hmi_full_stopwatch.Switch(SECONDS_HMI_FULL);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 60));
+
+ // Act
+ hmi_full_stopwatch.WriteTime();
+}
+
+TEST(
+ StatisticsManagerAddMethod,
+ AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ const std::uint32_t time_out = 1;
+ AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
+
+ // Act
+ hmi_full_stopwatch.Start(SECONDS_HMI_NONE);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_NONE, time_out));
+ // Act
+ hmi_full_stopwatch.WriteTime();
+
+ hmi_full_stopwatch.Switch(SECONDS_HMI_BACKGROUND);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_BACKGROUND, time_out));
+ // Act
+ hmi_full_stopwatch.WriteTime();
+}
+} // namespace usage_statistics
+} // components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/generated_code_test.cc b/src/components/policy/policy_external/test/generated_code_test.cc
new file mode 100644
index 0000000000..15d14e3e3b
--- /dev/null
+++ b/src/components/policy/policy_external/test/generated_code_test.cc
@@ -0,0 +1,228 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <fstream>
+
+#include "gtest/gtest.h"
+
+#include "json/reader.h"
+#include "json/value.h"
+#include "policy/policy_table/enums.h"
+#include "policy/policy_table/types.h"
+#include "rpc_base/gtest_support.h"
+#include "rpc_base/rpc_base.h"
+
+using rpc::Integer;
+using rpc::policy_table_interface_base::Table;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+TEST(PolicyGeneratedCodeTest, TestValidPTPreloadJsonIsValid) {
+ std::ifstream json_file("json/sdl_preloaded_pt.json");
+ ASSERT_TRUE(json_file.is_open());
+ Json::Value valid_table;
+ Json::Reader reader;
+ ASSERT_TRUE(reader.parse(json_file, valid_table));
+ Table table(&valid_table);
+ table.SetPolicyTableType(rpc::policy_table_interface_base::PT_PRELOADED);
+ ASSERT_RPCTYPE_VALID(table);
+}
+
+TEST(PolicyGeneratedCodeTest, TestValidPTUpdateJsonIsValid) {
+ std::ifstream json_file("json/valid_sdl_pt_update.json");
+ ASSERT_TRUE(json_file.is_open());
+ Json::Value valid_table;
+ Json::Reader reader;
+ ASSERT_TRUE(reader.parse(json_file, valid_table));
+ Table table(&valid_table);
+ table.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ ASSERT_RPCTYPE_VALID(table);
+}
+
+TEST(PolicyGeneratedCodeTest, IntegerLimitsTest) {
+ const int32_t min_value = -5;
+ const int32_t max_value = 5;
+
+ Integer<int32_t, min_value, max_value> value;
+ EXPECT_FALSE(value.is_valid());
+
+ value = min_value;
+ EXPECT_TRUE(value.is_valid());
+
+ value = max_value;
+ EXPECT_TRUE(value.is_valid());
+
+ value = min_value + max_value;
+ EXPECT_TRUE(value.is_valid());
+
+ value = min_value - 1;
+ EXPECT_FALSE(value.is_valid());
+
+ value = max_value + 1;
+ EXPECT_FALSE(value.is_valid());
+}
+
+TEST(PolicyGeneratedCodeTest, IntegerConstructionAndAssignmentTest) {
+ const int32_t min_value = -5;
+ const int32_t max_value = 5;
+
+ const Json::Value json_null = Json::Value(Json::nullValue);
+ Integer<int32_t, min_value, max_value> value_from_json_null(&json_null);
+ EXPECT_FALSE(value_from_json_null.is_valid());
+
+ const Json::Value json_string = Json::Value("string");
+ Integer<int32_t, min_value, max_value> value_from_json_string(&json_string);
+ EXPECT_FALSE(value_from_json_string.is_valid());
+
+ const Json::Value json_float = Json::Value(10.5);
+ Integer<int32_t, min_value, max_value> value_from_json_float(&json_float);
+ EXPECT_FALSE(value_from_json_float.is_valid());
+
+ const Json::Value json_int_in_range = Json::Value(4);
+ Integer<int32_t, min_value, max_value> value_from_json_int_in_range(
+ &json_int_in_range);
+ EXPECT_TRUE(value_from_json_int_in_range.is_valid());
+
+ const Json::Value json_int_out_of_range = Json::Value(9);
+ Integer<int32_t, min_value, max_value> value_from_json_int_out_of_range(
+ &json_int_out_of_range);
+ EXPECT_FALSE(value_from_json_int_out_of_range.is_valid());
+
+ const Json::Value json_zero = Json::Value(0);
+ Integer<int32_t, min_value, max_value> value_from_json_zero(&json_zero);
+ EXPECT_TRUE(value_from_json_zero.is_valid());
+
+ Integer<int32_t, min_value, max_value> invalid_value(&json_string);
+ EXPECT_FALSE(invalid_value.is_valid());
+ Integer<int32_t, min_value, max_value> reassigned_value = invalid_value;
+ EXPECT_FALSE(reassigned_value.is_valid());
+
+ Integer<int32_t, min_value, max_value> another_invalid_value(&json_string);
+ EXPECT_FALSE(another_invalid_value.is_valid());
+ Integer<int32_t, min_value, max_value> valid_value(0);
+ EXPECT_TRUE(valid_value.is_valid());
+ valid_value = another_invalid_value;
+ EXPECT_FALSE(valid_value.is_valid());
+}
+
+TEST(PolicyGeneratedCodeTest, TestConsentsGroup_Validation) {
+ using namespace rpc::policy_table_interface_base;
+ // Need to validate CCS consents container wrapped with Optional for case w/o
+ // specific values assigned since it is of generic 'Map' type which requires
+ // to be empty + initialized in order to be valid
+ // Also Map type does not have specific validation on PT type
+
+ rpc::Optional<ConsentGroups> consent_groups;
+
+ EXPECT_TRUE(consent_groups.is_valid());
+
+ consent_groups->insert(
+ std::make_pair(std::string("Group1"), rpc::Boolean(true)));
+
+ EXPECT_TRUE(consent_groups.is_valid());
+
+ // Adds more than container maximum size
+ for (size_t number = 0; number < 256; ++number) {
+ std::stringstream name;
+ name << "Group" << number;
+ consent_groups->insert(std::make_pair(name.str(), rpc::Boolean(true)));
+ }
+
+ EXPECT_FALSE(consent_groups.is_valid());
+}
+
+TEST(PolicyGeneratedCodeTest,
+ TestConsentRecords_ExternalConsents_PT_Validation) {
+ using namespace rpc::policy_table_interface_base;
+ ConsentRecords consent_records;
+
+ // PT_SNAPSHOT does not care of consents since their type is 'optional'
+ // PT_UPDATE and PT_SNAPSHOT have consents as 'omitted' so they must be absent
+ consent_records.SetPolicyTableType(PT_UPDATE);
+ EXPECT_TRUE(consent_records.is_valid());
+
+ consent_records.SetPolicyTableType(PT_PRELOADED);
+ EXPECT_TRUE(consent_records.is_valid());
+
+ consent_records.SetPolicyTableType(PT_SNAPSHOT);
+ EXPECT_TRUE(consent_records.is_valid());
+
+ consent_records.external_consent_status_groups->insert(
+ std::make_pair(std::string("Group1"), true));
+
+ consent_records.external_consent_status_groups->insert(
+ std::make_pair(std::string("Group2"), false));
+
+ consent_records.SetPolicyTableType(PT_UPDATE);
+ EXPECT_FALSE(consent_records.is_valid());
+
+ consent_records.SetPolicyTableType(PT_PRELOADED);
+ EXPECT_FALSE(consent_records.is_valid());
+
+ consent_records.SetPolicyTableType(PT_SNAPSHOT);
+ EXPECT_TRUE(consent_records.is_valid());
+}
+
+TEST(PolicyGeneratedCodeTest,
+ ExternalConsentEntity_ConstructionValidationTest) {
+ using namespace rpc::policy_table_interface_base;
+
+ ExternalConsentEntity empty_entity;
+ EXPECT_FALSE(empty_entity.is_valid());
+
+ const std::string corrent_entity_type_field = "entityType";
+ const std::string correct_entity_id_field = "entityID";
+
+ Json::Value correct_json_entity;
+ correct_json_entity[corrent_entity_type_field] = 1;
+ correct_json_entity[correct_entity_id_field] = 2;
+
+ ExternalConsentEntity entity_from_correct_json(&correct_json_entity);
+ EXPECT_TRUE(entity_from_correct_json.is_valid());
+
+ const std::string wrong_entity_id_field = "entityId";
+
+ Json::Value wrong_json_entity;
+ wrong_json_entity[corrent_entity_type_field] = 1;
+ wrong_json_entity[wrong_entity_id_field] = 2;
+
+ ExternalConsentEntity entity_from_wrong_json(&wrong_json_entity);
+ EXPECT_FALSE(entity_from_wrong_json.is_valid());
+
+ ExternalConsentEntity entity_from_valid_ints(1, 2);
+ EXPECT_TRUE(entity_from_valid_ints.is_valid());
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/include/policy/driver_dbms.h b/src/components/policy/policy_external/test/include/policy/driver_dbms.h
new file mode 100644
index 0000000000..e438c87b03
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/driver_dbms.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_DRIVER_DBMS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_DRIVER_DBMS_H_
+
+#ifdef __QNX__
+#include <qdb/qdb.h>
+#else // __QNX__
+#include <sqlite3.h>
+#endif // __QNX__
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+#ifdef __QNX__
+class DBMS {
+ public:
+ explicit DBMS(std::string db_name) : db_name_(db_name), conn_(0) {}
+ ~DBMS() {
+ Close();
+ }
+ bool Open() {
+ conn_ = qdb_connect(db_name_.c_str(), 0);
+ return conn_ != NULL;
+ }
+ void Close() {
+ qdb_disconnect(conn_);
+ }
+ bool Exec(const char* query) {
+ return -1 != qdb_statement(conn_, query);
+ }
+ int FetchOneInt(const char* query) {
+ int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
+ qdb_stmt_exec(conn_, stmt, NULL, 0);
+ qdb_result_t* res = qdb_getresult(conn_);
+ void* ret = qdb_cell(res, 0, 0);
+ int value = 0;
+ if (ret) {
+ value = *static_cast<int*>(ret);
+ }
+ qdb_stmt_free(conn_, stmt);
+ return value;
+ }
+ double FetchOneDouble(const char* query) {
+ int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
+ qdb_stmt_exec(conn_, stmt, NULL, 0);
+ qdb_result_t* res = qdb_getresult(conn_);
+ void* ret = qdb_cell(res, 0, 0);
+ double value = 0.0;
+ if (ret) {
+ value = *static_cast<double*>(ret);
+ }
+ qdb_stmt_free(conn_, stmt);
+
+ return value;
+ }
+ std::string FetchOneString(const char* query) {
+ int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
+ qdb_stmt_exec(conn_, stmt, NULL, 0);
+ qdb_result_t* res = qdb_getresult(conn_);
+ void* ret = qdb_cell(res, 0, 0);
+ std::string value = "";
+ if (ret) {
+ value = std::string(static_cast<const char*>(ret));
+ }
+ qdb_stmt_free(conn_, stmt);
+
+ return value;
+ }
+
+ private:
+ std::string db_name_;
+ qdb_hdl_t* conn_;
+};
+
+#else // __QNX__
+class DBMS {
+ public:
+ explicit DBMS(std::string file_name) : file_name_(file_name), conn_(0) {}
+ ~DBMS() {
+ Close();
+ }
+ bool Open() {
+ return SQLITE_OK == sqlite3_open(file_name_.c_str(), &conn_);
+ }
+ void Close() {
+ sqlite3_close(conn_);
+ remove(file_name_.c_str());
+ }
+ bool Exec(const char* query) {
+ return SQLITE_OK == sqlite3_exec(conn_, query, NULL, NULL, NULL);
+ }
+ int FetchOneInt(const char* query) {
+ sqlite3_stmt* statement;
+ sqlite3_prepare(conn_, query, -1, &statement, NULL);
+ sqlite3_step(statement);
+ int value = sqlite3_column_int(statement, 0);
+ sqlite3_finalize(statement);
+ return value;
+ }
+ double FethcOneDouble(const char* query) {
+ sqlite3_stmt* statement;
+ sqlite3_prepare(conn_, query, -1, &statement, NULL);
+ sqlite3_step(statement);
+ double value = sqlite3_column_double(statement, 0);
+ sqlite3_finalize(statement);
+ return value;
+ }
+ std::string FetchOneString(const char* query) {
+ sqlite3_stmt* statement;
+ sqlite3_prepare(conn_, query, -1, &statement, NULL);
+ sqlite3_step(statement);
+ const unsigned char* txt = sqlite3_column_text(statement, 0);
+ std::string value = std::string(reinterpret_cast<const char*>(txt));
+ sqlite3_finalize(statement);
+ return value;
+ }
+
+ private:
+ std::string file_name_;
+ sqlite3* conn_;
+};
+#endif // __QNX__
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_DRIVER_DBMS_H_
diff --git a/src/components/policy/policy_external/test/include/policy/mock_access_remote.h b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h
new file mode 100644
index 0000000000..486c27590d
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_access_remote.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_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+
+#include "gmock/gmock.h"
+#include "policy/access_remote.h"
+
+namespace test {
+namespace components {
+namespace access_remote_test {
+
+class MockAccessRemote : public policy::AccessRemote {
+ public:
+ MOCK_CONST_METHOD3(
+ FindGroup,
+ policy::PTString(const policy::ApplicationOnDevice& who,
+ const policy::PTString& rpc,
+ const policy::RemoteControlParams& params));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const policy::ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD1(
+ GetGroups,
+ const policy_table::Strings&(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string& device_id,
+ const std::string& app_id,
+ policy::FunctionalIdType& group_types));
+ MOCK_CONST_METHOD2(CheckModuleType,
+ bool(const policy::PTString& app_id,
+ policy_table::ModuleType module));
+ MOCK_METHOD1(IsAppRemoteControl,
+ bool(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD2(GetModuleTypes,
+ bool(const std::string& application_id,
+ std::vector<std::string>* modules));
+};
+
+} // namespace access_remote_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h b/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h
new file mode 100644
index 0000000000..397201ce40
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h
@@ -0,0 +1,53 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_
+
+#include "gmock/gmock.h"
+#include "policy/usage_statistics/app_stopwatch.h"
+
+namespace test {
+namespace components {
+namespace usage_statistics_test {
+
+class MockAppStopwatch : public usage_statistics::AppStopwatch {
+ public:
+ MOCK_METHOD1(Start, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD1(Switch, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD0(WriteTime, void());
+};
+
+} // namespace usage_statistics_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_
diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h
new file mode 100644
index 0000000000..3225e79e01
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_pt_ext_representation.h
@@ -0,0 +1,149 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_PT_EXT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_PT_EXT_REPRESENTATION_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/pt_ext_representation.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+#include "mock_pt_representation.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+using namespace ::policy;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+class MockPTExtRepresentation : public MockPTRepresentation,
+ public PTExtRepresentation {
+ public:
+ MOCK_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
+ MOCK_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
+ MOCK_METHOD2(GetDefaultHMI,
+ bool(const std::string& app_id, std::string* default_hmi));
+ MOCK_METHOD0(ResetUserConsent, bool());
+ MOCK_METHOD0(ResetDeviceConsents, bool());
+ MOCK_METHOD0(ResetAppConsents, bool());
+ MOCK_METHOD3(GetUserPermissionsForDevice,
+ bool(const std::string&, StringArray*, StringArray*));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string&,
+ const std::string&,
+ FunctionalIdType* group_types));
+ MOCK_METHOD2(GetDeviceGroupsFromPolicies,
+ bool(policy_table::Strings*, policy_table::Strings*));
+ MOCK_METHOD2(
+ GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
+ const std::string& language));
+ MOCK_METHOD8(SetDeviceData,
+ bool(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type));
+ MOCK_METHOD6(SetDeviceData,
+ bool(const std::string&,
+ const std::string&,
+ const std::string&,
+ const std::string&,
+ const std::string&,
+ const std::string&));
+ MOCK_METHOD2(SetMaxNumberPorts,
+ bool(const std::string& device_id,
+ unsigned int number_of_ports));
+ MOCK_METHOD3(SetUserPermissionsForDevice,
+ bool(const std::string&,
+ const StringArray&,
+ const StringArray&));
+ MOCK_METHOD1(SetUserPermissionsForApp, bool(const PermissionConsent&));
+ MOCK_METHOD1(IncreaseStatisticsData, bool(StatisticsType type));
+ MOCK_METHOD3(SetAppRegistrationLanguage,
+ bool(const std::string& app_id,
+ LanguageType type,
+ const std::string& language));
+ MOCK_METHOD3(SetMetaInfo,
+ bool(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& vin));
+ MOCK_METHOD0(IsMetaInfoPresent, bool());
+ MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
+ MOCK_METHOD0(GetKmFromSuccessfulExchange, int());
+ MOCK_METHOD0(GetDayFromScsExchange, int());
+ MOCK_METHOD0(GetIgnitionsFromScsExchange, int());
+ MOCK_CONST_METHOD1(Increment, void(const std::string& type));
+ MOCK_CONST_METHOD2(Increment,
+ void(const std::string& app_id, const std::string& type));
+ MOCK_CONST_METHOD3(Set,
+ void(const std::string& app_id,
+ const std::string& type,
+ const std::string& value));
+ MOCK_CONST_METHOD3(Add,
+ void(const std::string& app_id,
+ const std::string& type,
+ int seconds));
+ MOCK_CONST_METHOD3(CountUnconsentedGroups,
+ bool(const std::string& app_id,
+ const std::string& device_id,
+ int* count));
+ MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
+ MOCK_CONST_METHOD1(CleanupUnpairedDevices, bool(const DeviceIds& device_ids));
+ MOCK_METHOD2(ReactOnUserDevConsentForApp,
+ bool(const std::string& app_id, bool is_device_allowed));
+ MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id));
+ MOCK_METHOD2(SetIsPredata, bool(const std::string& app_id, bool is_predata));
+ MOCK_CONST_METHOD2(SetUnpairedDevice,
+ bool(const std::string& device_id, bool unpaired));
+ MOCK_CONST_METHOD1(UnpairedDevicesList, bool(DeviceIds* device_ids));
+ MOCK_CONST_METHOD2(RemoveAppConsentForGroup,
+ bool(const std::string& policy_app_id,
+ const std::string& functional_group));
+ MOCK_CONST_METHOD1(SaveExternalConsentStatus,
+ bool(const ExternalConsentStatus&));
+ MOCK_CONST_METHOD0(GetExternalConsentStatus, ExternalConsentStatus());
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
new file mode 100644
index 0000000000..995c63ed20
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h
@@ -0,0 +1,109 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_PT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_PT_REPRESENTATION_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/pt_representation.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+class MockPTRepresentation : virtual public ::policy::PTRepresentation {
+ public:
+ MOCK_METHOD4(CheckPermissions,
+ void(const ::policy::PTString& app_id,
+ const ::policy::PTString& hmi_level,
+ const ::policy::PTString& rpc,
+ ::policy::CheckPermissionResult& result));
+ MOCK_METHOD0(IsPTPreloaded, bool());
+ MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
+ MOCK_METHOD1(KilometersBeforeExchange, int(int current));
+ MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
+ bool(int kilometers, int days_after_epoch));
+ MOCK_METHOD1(DaysBeforeExchange, int(uint16_t current));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+ MOCK_METHOD0(ResetIgnitionCycles, void());
+ MOCK_METHOD0(TimeoutResponse, int());
+ MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>* seconds));
+ MOCK_METHOD2(GetPriority,
+ bool(const std::string& app_id, std::string* priority));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const ::policy::VehicleInfo());
+ MOCK_METHOD1(SetVINValue, bool(const std::string& value));
+ MOCK_METHOD2(GetUserFriendlyMsg,
+ std::vector< ::policy::UserFriendlyMessage>(
+ const std::vector<std::string>& msg_code,
+ const std::string& language));
+ MOCK_METHOD2(GetUpdateUrls, void(int service_type, ::policy::EndpointUrls&));
+ MOCK_METHOD1(GetNotificationsNumber, int(const std::string& priority));
+ MOCK_METHOD0(Init, ::policy::InitResult());
+ MOCK_METHOD0(Close, bool());
+ MOCK_METHOD0(Clear, bool());
+ MOCK_METHOD0(Drop, bool());
+ MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD1(Save, bool(const policy_table::Table& table));
+ MOCK_CONST_METHOD0(UpdateRequired, bool());
+ MOCK_METHOD1(SaveUpdateRequired, void(bool value));
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string& app_id,
+ ::policy::StringArray* nicknames,
+ ::policy::StringArray* app_types));
+
+ MOCK_METHOD4(SaveApplicationCustomData,
+ bool(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata));
+
+ MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD1(GetFunctionalGroupings,
+ bool(policy_table::FunctionalGroupings& groups));
+ MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id));
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_PT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
new file mode 100644
index 0000000000..a1c808d23a
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_update_status_manager.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_UPDATE_STATUS_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_UPDATE_STATUS_MANAGER_H_
+
+#include "gmock/gmock.h"
+
+#include "policy/update_status_manager.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+class MockUpdateStatusManager : public ::policy::UpdateStatusManager {
+ public:
+ MOCK_METHOD1(set_listener, void(PolicyListener* listener));
+ MOCK_METHOD1(OnUpdateSentOut, void(uint32_t update_timeout));
+ MOCK_METHOD0(OnUpdateTimeoutOccurs, void());
+ MOCK_METHOD0(OnValidUpdateReceived, void());
+ MOCK_METHOD0(OnWrongUpdateReceived, void());
+ MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required));
+ MOCK_METHOD0(OnResetRetrySequence, void());
+ MOCK_METHOD1(OnNewApplicationAdded, void(const DeviceConsent));
+ MOCK_METHOD1(OnPolicyInit, void(bool is_update_required));
+ MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus());
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_UPDATE_STATUS_MANAGER_H_
diff --git a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
new file mode 100644
index 0000000000..e753751308
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h
@@ -0,0 +1,306 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_POLICY_MANAGER_IMPL_TEST_BASE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_POLICY_MANAGER_IMPL_TEST_BASE_H_
+
+#include <string>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+#include "policy/policy_manager_impl.h"
+
+#include "policy/mock_cache_manager.h"
+#include "policy/mock_update_status_manager.h"
+#include "policy/mock_policy_listener.h"
+#include "policy/mock_policy_settings.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using ::testing::NiceMock;
+using ::policy::PolicyManagerImpl;
+
+typedef std::multimap<std::string, policy_table::Rpcs&>
+ UserConsentPromptToRpcsConnections;
+
+typedef utils::SharedPtr<policy_table::Table> PolicyTableSPtr;
+
+namespace {
+const std::string kSdlPreloadedPtJson = "json/sdl_preloaded_pt.json";
+const std::string kSdlPreloadedPtJson2 = "json/sdl_preloaded_pt1.json";
+const std::string kFilePtUpdateJson = "json/file_pt_update.json";
+const std::string kHmiLevelFull = "FULL";
+const std::string kHmiLevelLimited = "LIMITED";
+const std::string kHmiLevelBackground = "BACKGROUND";
+const std::string kHmiLevelNone = "None";
+
+const std::string kPtuJson = "json/PTU.json";
+const std::string kPtu2Json = "json/PTU2.json";
+const std::string kPtu3Json = "json/PTU3.json";
+const std::string kValidSdlPtUpdateJson = "json/valid_sdl_pt_update.json";
+const std::string kPtuRequestTypeJson = "json/ptu_requestType.json";
+const std::string kPtu2RequestTypeJson = "json/ptu2_requestType.json";
+const std::string kDummyUpdateFileName = "DummyName";
+} // namespace
+
+struct StringsForUpdate {
+ std::string new_field_value_;
+ std::string new_field_name_;
+ std::string new_date_;
+};
+
+char GenRandomChar(char range_from, char range_to);
+struct StringsForUpdate CreateNewRandomData(StringsForUpdate& str);
+void CheckIsParamInList(const ::policy::RPCParams& list,
+ const std::string& parameter);
+Json::Value createPTforLoad();
+void InsertRpcParametersInList(::policy::RPCParams& input_params);
+policy_table::AppHmiTypes HmiTypes(const policy_table::AppHMIType hmi_type);
+
+template <typename T>
+void SortAndCheckEquality(std::vector<T> first, std::vector<T> second) {
+ ASSERT_EQ(first.size(), second.size());
+ std::sort(first.begin(), first.end());
+ std::sort(second.begin(), second.end());
+
+ EXPECT_TRUE(std::equal(first.begin(), first.end(), second.begin()));
+}
+
+template <typename T>
+std::string NumberToString(T Number) {
+ std::ostringstream ss;
+ ss << Number;
+ return ss.str();
+}
+
+class PolicyManagerImplTest : public ::testing::Test {
+ public:
+ PolicyManagerImplTest();
+
+ protected:
+ const std::string unpaired_device_id_;
+
+ PolicyManagerImpl* policy_manager_;
+ MockCacheManagerInterface* cache_manager_;
+ MockUpdateStatusManager update_manager_;
+ NiceMock<MockPolicyListener> listener_;
+
+ void SetUp() OVERRIDE;
+
+ void TearDown() OVERRIDE;
+
+ ::testing::AssertionResult IsValid(const policy_table::Table& table);
+};
+
+class PolicyManagerImplTest2 : public ::testing::Test {
+ public:
+ PolicyManagerImplTest2();
+
+ protected:
+ const std::string app_id_1_;
+ const std::string app_id_2_;
+ const std::string app_id_3_;
+ const std::string device_id_1_;
+ const std::string device_id_2_;
+ const std::string application_id_;
+ const std::string app_storage_folder_;
+ const std::string preloaded_pt_filename_;
+ const bool in_memory_;
+
+ PolicyManagerImpl* policy_manager_;
+ NiceMock<MockPolicyListener> listener_;
+ ::policy::StringArray hmi_level_;
+ ::policy::StringArray pt_request_types_;
+ size_t ptu_request_types_size_;
+ uint32_t index_;
+ Json::Value ptu_request_types_;
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+
+ void SetUp() OVERRIDE;
+
+ ::policy::StringArray JsonToVectorString(
+ const Json::Value& PTU_request_types);
+
+ const Json::Value GetPTU(const std::string& file_name);
+
+ void CreateLocalPT(const std::string& file_name);
+
+ void AddRTtoPT(const std::string& update_file_name,
+ const std::string& section_name,
+ const uint32_t rt_number,
+ const uint32_t invalid_rt_number);
+
+ void AddRTtoAppSectionPT(const std::string& update_file_name,
+ const std::string& section_name,
+ const uint32_t rt_number,
+ const uint32_t invalid_rt_number);
+
+ std::vector<policy_table::RequestType> PushRequestTypesToContainer(
+ const ::policy::StringArray& temp_result);
+
+ void CheckResultForValidRT();
+
+ void CheckResultForInvalidRT();
+
+ void FillMultimapFromFunctionalGroupings(
+ UserConsentPromptToRpcsConnections& input_multimap,
+ policy_table::FunctionalGroupings& fg_table);
+
+ void GetFunctionalGroupingsFromManager(
+ policy_table::FunctionalGroupings& input_functional_groupings);
+
+ void TearDown() OVERRIDE;
+
+ void ResetOutputList(::policy::CheckPermissionResult& output);
+ // To avoid duplicate test with different json files
+ void CheckPermissions_AllParamsAllowed_CheckRpcsInDiffLvls(
+ const std::string& update_file);
+
+ // To avoid duplicates in tests
+ void CheckRpcPermissions(const std::string& rpc_name,
+ const PermitResult& expected_permission);
+
+ void CheckRpcPermissions(const std::string& app_id,
+ const std::string& rpc_name,
+ const policy::PermitResult& out_expected_permission);
+
+ // To avoid duplicate arrange of test
+ void AddSetDeviceData();
+
+ // Load Json File and set it as PTU
+ void LoadPTUFromJsonFile(const std::string& update_file);
+
+ void EmulatePTAppRevoked(const std::string& ptu_name);
+
+ utils::SharedPtr<policy_table::Table> PreconditionForBasicValidateSnapshot();
+
+ template <typename ParentType, typename Value>
+ bool IsKeyExisted(const ParentType& parent, const Value& value) const {
+ return parent.end() != std::find(parent.begin(), parent.end(), value);
+ }
+
+ template <typename ParentType>
+ bool IsKeyExisted(const ParentType& parent, const std::string& value) const {
+ return parent.end() != parent.find(value);
+ }
+
+ template <typename ParentType, typename KeyType>
+ const KeyType& GetKeyData(const ParentType& parent,
+ const std::string& key_name) const {
+ DCHECK(IsKeyExisted<ParentType>(parent, key_name));
+ return parent.find(key_name)->second;
+ }
+
+ bool CheckPolicyTimeStamp(const std::string& str) const;
+};
+
+class PolicyManagerImplTest_RequestTypes : public ::testing::Test {
+ public:
+ PolicyManagerImplTest_RequestTypes();
+
+ protected:
+ const ::policy::StringArray kJsonFiles;
+ const std::string kAppId;
+ const std::string kDefaultAppId;
+ const std::string app_storage_folder_;
+ const std::string preloaded_pt_filename_;
+
+ utils::SharedPtr<PolicyManagerImpl> policy_manager_impl_sptr_;
+ NiceMock<MockPolicyListener> listener_;
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+
+ void SetUp() OVERRIDE;
+
+ const Json::Value GetPTU(const std::string& file_name);
+
+ void RefreshPT(const std::string& preloaded_pt_file,
+ const std::string& update_pt_file);
+
+ PolicyTableSPtr GetPolicyTableSnapshot();
+
+ policy_table::RequestTypes GetRequestTypesForApplication(
+ const std::string& app_id);
+
+ void CompareAppRequestTypesWithDefault(const std::string& app_id,
+ const std::string& ptu_file);
+
+ policy_table::RequestTypes CreateDefaultAppPTURequestValues();
+
+ policy_table::RequestTypes CreateDefaultAppDatabaseRequestValues();
+
+ policy_table::RequestTypes CreatePreDataConsentAppPTURequestValues();
+
+ void CompareRequestTypesContainers(
+ const policy_table::RequestTypes& expected_data,
+ const policy_table::RequestTypes& received_data);
+
+ void TearDown() OVERRIDE;
+};
+
+class PolicyManagerImplTest_ExternalConsent : public PolicyManagerImplTest2 {
+ public:
+ PolicyManagerImplTest_ExternalConsent()
+ : PolicyManagerImplTest2()
+ , group_name_1_("Group1")
+ , group_name_2_("Group2")
+ , group_name_3_("Group3") {}
+
+ protected:
+ void PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
+
+ void PreconditionExternalConsentPreparePTWithAppPolicy();
+
+ policy_table::Table PreparePTWithGroupsHavingExternalConsent();
+
+ std::string PreparePTUWithNewGroup(const uint32_t type,
+ const uint32_t id,
+ const std::string& group_name);
+
+ const uint32_t type_1_ = 0;
+ const uint32_t id_1_ = 1;
+ const uint32_t type_2_ = 2;
+ const uint32_t id_2_ = 3;
+ const uint32_t type_3_ = 4;
+ const uint32_t id_3_ = 5;
+
+ const std::string group_name_1_;
+ const std::string group_name_2_;
+ const std::string group_name_3_;
+};
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_POLICY_MANAGER_IMPL_TEST_BASE_H_
diff --git a/src/components/policy/policy_external/test/json/PTU.json b/src/components/policy/policy_external/test/json/PTU.json
new file mode 100644
index 0000000000..7316c7539d
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU.json
@@ -0,0 +1,2153 @@
+{
+ "policy_table": {
+ "module_config": {
+ "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": {
+ "1234": "default",
+ "default": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "Base-4"
+ ],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "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"
+ ],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ }
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU2.json b/src/components/policy/policy_external/test/json/PTU2.json
new file mode 100644
index 0000000000..c1a6bccb68
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU2.json
@@ -0,0 +1,2152 @@
+{
+ "policy_table": {
+ "module_config": {
+ "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": {
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "BaseBeforeDataConsent"
+ ],
+ "RequestType": []
+ },
+ "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/policy_external/test/json/PTU3.json b/src/components/policy/policy_external/test/json/PTU3.json
new file mode 100644
index 0000000000..56939a789a
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU3.json
@@ -0,0 +1,2154 @@
+{
+ "policy_table": {
+ "module_config": {
+ "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": {
+ "1234": "default",
+ "default": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "Base-4"
+ ],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "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"
+ ],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY",
+ "INVALID_REQUEST_TYPE"
+ ]
+ }
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app.json b/src/components/policy/policy_external/test/json/PTU_default_app.json
new file mode 100644
index 0000000000..833d46316a
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_default_app.json
@@ -0,0 +1,319 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY",
+ "LOCK_SCREEN_ICON_URL"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "FILE_RESUME",
+ "AUTH_REQUEST",
+ "AUTH_CHALLENGE",
+ "AUTH_ACK"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
new file mode 100644
index 0000000000..1e5b1c46a4
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_app_invalid_values_RequestType_array.json
@@ -0,0 +1,317 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "IVSU",
+ "BREAK_STUFF"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "FILE_RESUME",
+ "AUTH_REQUEST",
+ "AUTH_CHALLENGE",
+ "AUTH_ACK"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
new file mode 100644
index 0000000000..76365ee4bb
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_empty_RequestType_array.json
@@ -0,0 +1,314 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "FILE_RESUME",
+ "AUTH_REQUEST",
+ "AUTH_CHALLENGE",
+ "AUTH_ACK"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
new file mode 100644
index 0000000000..b380fa2de5
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_omitted_RequestType_array.json
@@ -0,0 +1,313 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "FILE_RESUME",
+ "AUTH_REQUEST",
+ "AUTH_CHALLENGE",
+ "AUTH_ACK"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
new file mode 100644
index 0000000000..b8793b6cdc
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_default_app_one_invalid_value_RequestType_array.json
@@ -0,0 +1,320 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "IVSU",
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY",
+ "LOCK_SCREEN_ICON_URL"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "FILE_RESUME",
+ "AUTH_REQUEST",
+ "AUTH_CHALLENGE",
+ "AUTH_ACK"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_functional_grouping.json b/src/components/policy/policy_external/test/json/PTU_functional_grouping.json
new file mode 100644
index 0000000000..5a8837c0bc
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_functional_grouping.json
@@ -0,0 +1,11 @@
+"Added-Group-1": {
+ "rpcs": {
+ "AddedFunction1": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ } \ No newline at end of file
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
new file mode 100644
index 0000000000..833d46316a
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app.json
@@ -0,0 +1,319 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY",
+ "LOCK_SCREEN_ICON_URL"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "FILE_RESUME",
+ "AUTH_REQUEST",
+ "AUTH_CHALLENGE",
+ "AUTH_ACK"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
new file mode 100644
index 0000000000..8a183b45d5
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_empty_RequestType_array.json
@@ -0,0 +1,314 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY",
+ "LOCK_SCREEN_ICON_URL"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
new file mode 100644
index 0000000000..6ffc42c3e4
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_invalid_values_RequestType_array.json
@@ -0,0 +1,315 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "IVSU",
+ "BREAK_STUFF"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "IVSU",
+ "BREAK_STUFF"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
new file mode 100644
index 0000000000..24d0871d18
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_omitted_RequestType_array.json
@@ -0,0 +1,307 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
new file mode 100644
index 0000000000..b674913268
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_pre_data_consent_app_one_invalid_value_RequestType_array.json
@@ -0,0 +1,320 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY",
+ "LOCK_SCREEN_ICON_URL"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "IVSU",
+ "FILE_RESUME",
+ "AUTH_REQUEST",
+ "AUTH_CHALLENGE",
+ "AUTH_ACK"
+ ]
+ }
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
new file mode 100644
index 0000000000..7e0836a805
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_with_empty_requestType_array.json
@@ -0,0 +1,1727 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "HTTP",
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
new file mode 100644
index 0000000000..a056c3ce9c
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_with_invalid_requestType_between_correct.json
@@ -0,0 +1,1730 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "HTTP",
+ "IVSU",
+ "LAUNCH_APP",
+ "PROPRIETARY" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "HTTP",
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
new file mode 100644
index 0000000000..c7e0a727fe
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_with_one_invalid_requestType.json
@@ -0,0 +1,1727 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000,
+ "RequestType" : [ "IVSU" ]
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "HTTP",
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
new file mode 100644
index 0000000000..a96ef74bd1
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/PTU_without_requestType_field.json
@@ -0,0 +1,1726 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester", "tester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false,
+ "RequestType": [
+ "HTTP",
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "heart_beat_timeout_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
new file mode 100644
index 0000000000..4c1bf19005
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_reqestType_between_valid.json
@@ -0,0 +1,1944 @@
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "preloaded_date": "2015-02-12",
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 30,
+ "timeout_after_x_seconds": 70,
+ "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"],
+ "RequestType": [
+ "QUERY_APPS",
+ "IVSU",
+ "PROPRIETARY"
+ ]
+ },
+ "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"],
+ "RequestType": ["HTTP"]
+ }
+ }
+ }
+ }
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
new file mode 100644
index 0000000000..02801cc976
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_invalid_default_requestType.json
@@ -0,0 +1,1942 @@
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "preloaded_date": "2015-02-12",
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 30,
+ "timeout_after_x_seconds": 70,
+ "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"],
+ "RequestType": [
+ "IVSU"
+ ]
+ },
+ "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"],
+ "RequestType": ["HTTP"]
+ }
+ }
+ }
+ }
diff --git a/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
new file mode 100644
index 0000000000..a9abeea5a2
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/preloadedPT_with_several_invalid_default_requestTypes.json
@@ -0,0 +1,1943 @@
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "preloaded_date": "2015-02-12",
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 30,
+ "timeout_after_x_seconds": 70,
+ "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"],
+ "RequestType": [
+ "IVSU1",
+ "IVSU2"
+ ]
+ },
+ "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"],
+ "RequestType": ["HTTP"]
+ }
+ }
+ }
+ }
diff --git a/src/components/policy/policy_external/test/json/ptu2_requestType.json b/src/components/policy/policy_external/test/json/ptu2_requestType.json
new file mode 100644
index 0000000000..899e58a68d
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/ptu2_requestType.json
@@ -0,0 +1,2615 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "preloaded_date": "2015-12-02",
+ "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"
+ ]
+ },
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ }
+ },
+ "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": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
+ },
+ "OnButtonPress": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
+ },
+ "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": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
+ },
+ "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"
+ ]
+ }
+ }
+ },
+ "PropriataryData-2": {
+ "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"
+ ]
+ }
+ }
+ },
+ "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"
+ ]
+ }
+ }
+ },
+ "Base-6": {
+ "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": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnDriverDistraction": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnEncodedSyncPData": {
+ "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"
+ ]
+ },
+ "OnSyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnTBTClientState": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "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"
+ ]
+ },
+ "Show": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "Slider": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ },
+ "Speak": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "SubscribeButton": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "SyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "UnsubscribeButton": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "OnKeyboardInputOnlyGroup": {
+ "rpcs": {
+ "OnKeyboardInput": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ }
+ }
+ },
+ "OnTouchEventOnlyGroup": {
+ "rpcs": {
+ "OnTouchEvent": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ }
+ }
+ },
+ "DiagnosticMessageOnly": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "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"
+ ]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetGlobalProperties": {
+ "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"
+ ]
+ }
+ }
+ },
+ "SendLocation": {
+ "rpcs": {
+ "SendLocation": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "BackgroundAPT": {
+ "rpcs": {
+ "EndAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ }
+ }
+ }
+ },
+ "consumer_friendly_messages": {
+ "version": "001.001.021",
+ "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)?",
+ "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. \n\nSi 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. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
+ },
+ "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",
+ "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\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.\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."
+ },
+ "es-mx": {
+ "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. \n\nLas 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. \n\nPresione 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\n\r\nVeuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
+ }
+ }
+ },
+ "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.",
+ "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",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "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",
+ "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"
+ },
+ "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.",
+ "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, 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",
+ "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."
+ },
+ "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": "EMERGENCY",
+ "default_hmi": "LIMITED",
+ "groups": [
+ "Base-4"
+ ],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "device": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "DataConsent-2"
+ ],
+ "preconsented_groups": [
+ "BaseBeforeDataConsent"
+ ]
+ },
+ "pre_DataConsent": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "BaseBeforeDataConsent"
+ ],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "584421907": {
+ "keep_context" : false,
+ "steal_focus" : false,
+ "priority"
+ : "NONE",
+ "default_hmi"
+ : "NONE",
+ "groups" :
+ ["BaseBeforeDataConsent"],
+ "RequestType" :[
+ "TRAFFIC_MESSAGE_CHANNEL",
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ }
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/ptu_requestType.json b/src/components/policy/policy_external/test/json/ptu_requestType.json
new file mode 100644
index 0000000000..a1f085ac74
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/ptu_requestType.json
@@ -0,0 +1,2605 @@
+{
+ "policy_table": {
+ "module_config": {
+ "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"
+ ]
+ },
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ }
+ },
+ "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": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
+ },
+ "OnButtonPress": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
+ },
+ "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": [
+ "FULL",
+ "LIMITED",
+ "BACKGROUND"
+ ]
+ },
+ "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"
+ ]
+ }
+ }
+ },
+ "PropriataryData-2": {
+ "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"
+ ]
+ }
+ }
+ },
+ "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"
+ ]
+ }
+ }
+ },
+ "Base-6": {
+ "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": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnDriverDistraction": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "OnEncodedSyncPData": {
+ "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"
+ ]
+ },
+ "OnSyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "OnTBTClientState": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "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"
+ ]
+ },
+ "Show": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "Slider": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ },
+ "Speak": {
+ "hmi_levels": [
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "SubscribeButton": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ },
+ "SyncPData": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "UnregisterAppInterface": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "UnsubscribeButton": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "OnKeyboardInputOnlyGroup": {
+ "rpcs": {
+ "OnKeyboardInput": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ }
+ }
+ },
+ "OnTouchEventOnlyGroup": {
+ "rpcs": {
+ "OnTouchEvent": {
+ "hmi_levels": [
+ "FULL"
+ ]
+ }
+ }
+ },
+ "DiagnosticMessageOnly": {
+ "rpcs": {
+ "DiagnosticMessage": {
+ "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"
+ ]
+ },
+ "ResetGlobalProperties": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED",
+ "NONE"
+ ]
+ },
+ "SetGlobalProperties": {
+ "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"
+ ]
+ }
+ }
+ },
+ "SendLocation": {
+ "rpcs": {
+ "SendLocation": {
+ "hmi_levels": [
+ "BACKGROUND",
+ "FULL",
+ "LIMITED"
+ ]
+ }
+ }
+ },
+ "BackgroundAPT": {
+ "rpcs": {
+ "EndAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ },
+ "OnAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ },
+ "PerformAudioPassThru": {
+ "hmi_levels": [
+ "BACKGROUND"
+ ]
+ }
+ }
+ }
+ },
+ "consumer_friendly_messages": {
+ "version": "001.001.021",
+ "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)?",
+ "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. \n\nSi 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. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles."
+ },
+ "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",
+ "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\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.\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."
+ },
+ "es-mx": {
+ "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. \n\nLas 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. \n\nPresione 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\n\r\nVeuillez appuyer sur Oui pour autoriser ou sur Non pour refuser."
+ }
+ }
+ },
+ "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.",
+ "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",
+ "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "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",
+ "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"
+ },
+ "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.",
+ "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, 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",
+ "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."
+ },
+ "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": {
+ "584421907": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "BaseBeforeDataConsent"
+ ],
+ "RequestType": [
+ "PROPRIETARY"
+ ]
+ },
+ "default": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NONE",
+ "default_hmi": "NONE",
+ "groups": [
+ "Base-4"
+ ],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "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"
+ ],
+ "RequestType": [
+ "PROPRIETARY"
+ ]
+ }
+ }
+ }
+}
diff --git a/src/components/policy/test/sdl_preloaded_pt.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
index d6f34c12fc..d6f34c12fc 100644
--- a/src/components/policy/test/sdl_preloaded_pt.json
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt.json
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
new file mode 100644
index 0000000000..78c5f873d9
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt1.json
@@ -0,0 +1,2413 @@
+
+{
+ "policy_table" :
+ {
+ "app_policies" :
+ {
+ "default" :
+ {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "device" :
+ {
+ "default_hmi" : "NONE",
+ "groups" : [ "DataConsent-2" ],
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" :
+ {
+ "default_hmi" : "BACKGROUND",
+ "groups" : [ "BaseBeforeDataConsent" ],
+ "keep_context" : false,
+ "priority" : "EMERGENCY",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" :
+ {
+ "messages" :
+ {
+ "AppPermissions" :
+ {
+ "languages" :
+ {
+ "de-de" :
+ {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" :
+ {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" :
+ {
+ "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.",
+ "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."
+ },
+ "en-ie" :
+ {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" :
+ {
+ "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.",
+ "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."
+ },
+ "es-en" :
+ {
+ "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.",
+ "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."
+ },
+ "es-es" :
+ {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-ca" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-fr" :
+ {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" :
+ {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" :
+ {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" :
+ {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" :
+ {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" :
+ {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" :
+ {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" :
+ {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" :
+ {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" :
+ {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" :
+ {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" :
+ {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" :
+ {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" :
+ {
+ "line1" : "not authorized",
+ "textBody" : "This version of %appName% is not authorized and will not work with SYNC.",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" :
+ {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" :
+ {
+ "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%.",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" :
+ {
+ "line1" : "no autorizada",
+ "textBody" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" :
+ {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" :
+ {
+ "line1" : "no autorizada",
+ "textBody" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" :
+ {
+ "line1" : "non autorisée",
+ "textBody" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" :
+ {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" :
+ {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" :
+ {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" :
+ {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" :
+ {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" :
+ {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" :
+ {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" :
+ {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" :
+ {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" :
+ {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" :
+ {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" :
+ {
+ "languages" :
+ {
+ "de-de" :
+ {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" :
+ {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" :
+ {
+ "line1" : "not supported",
+ "textBody" : "This version of %appName% is not supported by SYNC.",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" :
+ {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" :
+ {
+ "line1" : "Not Supported",
+ "textBody" : "Your version of %appName% is not supported by SYNC.",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" :
+ {
+ "line1" : "no compatible",
+ "textBody" : "Esta versión de %appName% no es compatible con SYNC.",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" :
+ {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" :
+ {
+ "line1" : "no compatible",
+ "textBody" : "Esta versión de %appName% no es compatible con SYNC.",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" :
+ {
+ "line1" : "incompatible",
+ "textBody" : "Cette version de %appName% n’est pas prise en charge par SYNC.",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" :
+ {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" :
+ {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" :
+ {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" :
+ {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" :
+ {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" :
+ {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" :
+ {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" :
+ {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" :
+ {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" :
+ {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" :
+ {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "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" :
+ {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" :
+ {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" :
+ {
+ "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.",
+ "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."
+ },
+ "en-ie" :
+ {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" :
+ {
+ "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.",
+ "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."
+ },
+ "es-en" :
+ {
+ "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.",
+ "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."
+ },
+ "es-es" :
+ {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-ca" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-fr" :
+ {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" :
+ {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" :
+ {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" :
+ {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" :
+ {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" :
+ {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" :
+ {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" :
+ {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" :
+ {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" :
+ {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" :
+ {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" :
+ {
+ "languages" :
+ {
+ "de-de" :
+ {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" :
+ {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" :
+ {
+ "label" : "Driving characteristics",
+ "textBody" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" :
+ {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" :
+ {
+ "label" : "Driving Characteristics",
+ "textBody" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM.",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status, Gear Position, RPM."
+ },
+ "es-en" :
+ {
+ "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.",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" :
+ {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-ca" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-fr" :
+ {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" :
+ {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" :
+ {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" :
+ {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" :
+ {
+ "label" : "Características de condução",
+ "line1" : "Caract. Condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" :
+ {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" :
+ {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" :
+ {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" :
+ {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" :
+ {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" :
+ {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" :
+ {
+ "languages" :
+ {
+ "de-de" :
+ {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" :
+ {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" :
+ {
+ "label" : "GPS and speed",
+ "textBody" : "An app can access vehicle GPS and speed.",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" :
+ {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" :
+ {
+ "label" : "GPS and Speed",
+ "textBody" : "An app can access vehicle GPS and speed.",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" :
+ {
+ "label" : "GPS y velocidad",
+ "textBody" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" :
+ {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" :
+ {
+ "label" : "GPS y velocidad",
+ "textBody" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" :
+ {
+ "label" : "GPS et Vitesse",
+ "textBody" : "Une application peut accéder au GPS et à la vitesse du véhicule.",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" :
+ {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" :
+ {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" :
+ {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" :
+ {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" :
+ {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" :
+ {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" :
+ {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" :
+ {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" :
+ {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" :
+ {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" :
+ {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" :
+ {
+ "languages" :
+ {
+ "de-de" :
+ {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" :
+ {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" :
+ {
+ "label" : "Push notifications",
+ "textBody" : "An app can send notifications when running in the background.",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" :
+ {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" :
+ {
+ "label" : "Push Notifications",
+ "textBody" : "An app can send notifications when running in the background.",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" :
+ {
+ "label" : "Notificaciones tipo Push",
+ "textBody" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" :
+ {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" :
+ {
+ "label" : "Notificaciones tipo Push",
+ "textBody" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" :
+ {
+ "label" : "Notifications Instantanées",
+ "textBody" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" :
+ {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" :
+ {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" :
+ {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" :
+ {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" :
+ {
+ "label" : "Notificações Push",
+ "line1" : "Notificações",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" :
+ {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" :
+ {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" :
+ {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" :
+ {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" :
+ {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" :
+ {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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" :
+ {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" :
+ {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" :
+ {
+ "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.",
+ "tts" : "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" :
+ {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" :
+ {
+ "label" : "Vehicle Information",
+ "textBody" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure.",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Odometer, VIN, External Temperature, Tire Pressure."
+ },
+ "es-en" :
+ {
+ "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.",
+ "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."
+ },
+ "es-es" :
+ {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-ca" :
+ {
+ "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.",
+ "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."
+ },
+ "fr-fr" :
+ {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" :
+ {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" :
+ {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" :
+ {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" :
+ {
+ "label" : "Informações sobre o veículo",
+ "line1" : "Inform. Veículo",
+ "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."
+ },
+ "pt-pt" :
+ {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" :
+ {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" :
+ {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" :
+ {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" :
+ {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" :
+ {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.023"
+ },
+ "functional_groupings" :
+ {
+ "BackgroundAPT" :
+ {
+ "rpcs" :
+ {
+ "EndAudioPassThru" :
+ {
+ "hmi_levels" : [ "BACKGROUND" ]
+ },
+ "OnAudioPassThru" :
+ {
+ "hmi_levels" : [ "BACKGROUND" ]
+ },
+ "PerformAudioPassThru" :
+ {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ }
+ },
+ "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" ]
+ },
+ "OnHMIStatus" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnHashChange" :
+ {
+ "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" ]
+ }
+ }
+ },
+ "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" ]
+ },
+ "OnHMIStatus" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnHashChange" :
+ {
+ "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" ]
+ }
+ }
+ },
+ "DataConsent-2" :
+ {
+ "rpcs" : null,
+ "user_consent_prompt" : "DataConsent"
+ },
+ "DiagnosticMessageOnly" :
+ {
+ "rpcs" :
+ {
+ "DiagnosticMessage" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DialNumberOnly" :
+ {
+ "rpcs" :
+ {
+ "DialNumber" :
+ {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" :
+ {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "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" ]
+ }
+ }
+ },
+ "Location-1" :
+ {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" :
+ {
+ "rpcs" :
+ {
+ "AlertManeuver" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" :
+ {
+ "rpcs" :
+ {
+ "Alert" :
+ {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "Notifications-45" :
+ {
+ "rpcs" :
+ {
+ "MWTAA" :
+ {
+ "hmi_levels" : [ "LIMITED" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications-45"
+ },
+ "Notifications-73" :
+ {
+ "rpcs" :
+ {
+ "STEHV" :
+ {
+ "hmi_levels" : [ "FULL" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications-73"
+ },
+ "OnKeyboardInputOnlyGroup" :
+ {
+ "rpcs" :
+ {
+ "OnKeyboardInput" :
+ {
+ "hmi_levels" : [ "FULL" ]
+ }
+ }
+ },
+ "OnTouchEventOnlyGroup" :
+ {
+ "rpcs" :
+ {
+ "OnTouchEvent" :
+ {
+ "hmi_levels" : [ "FULL" ]
+ }
+ }
+ },
+ "PropriataryData-1" :
+ {
+ "rpcs" :
+ {
+ "DiagnosticMessage" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "PropriataryData-2" :
+ {
+ "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" ]
+ }
+ }
+ },
+ "SendLocation" :
+ {
+ "rpcs" :
+ {
+ "SendLocation" :
+ {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "SendLocationOnly" :
+ {
+ "rpcs" :
+ {
+ "SendLocation" :
+ {
+ "hmi_levels" : [ "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" :
+ {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ }
+ },
+ "module_config" :
+ {
+ "endpoints" :
+ {
+ "0x04" :
+ {
+ "default" : [ "http://ivsu.software.ford.com/api/getsoftwareupdates" ]
+ },
+ "0x07" :
+ {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 20,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" :
+ {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOM" : 20
+ },
+ "preloaded_date" : "2012-12-15",
+ "preloaded_pt" : true,
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
new file mode 100644
index 0000000000..49f9a1da3a
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_preloaded_pt_send_location.json
@@ -0,0 +1,2321 @@
+{
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ]
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/components/policy/test/sdl_pt_first_update.json b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
index e6817da0d3..e6817da0d3 100644
--- a/src/components/policy/test/sdl_pt_first_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_first_update.json
diff --git a/src/components/policy/test/sdl_pt_second_update.json b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
index d5f5f480f3..d5f5f480f3 100644
--- a/src/components/policy/test/sdl_pt_second_update.json
+++ b/src/components/policy/policy_external/test/json/sdl_pt_second_update.json
diff --git a/src/components/policy/policy_external/test/json/sdl_pt_update.json b/src/components/policy/policy_external/test/json/sdl_pt_update.json
new file mode 100644
index 0000000000..5047d832dd
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_pt_update.json
@@ -0,0 +1,1728 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "watchdog_timer_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "Notifications2" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "FULL" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
new file mode 100644
index 0000000000..18b0a09040
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_have_params.json
@@ -0,0 +1,2340 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ],
+ "parameters": [
+ "longitudeDegrees",
+ "latitudeDegrees",
+ "locationDescription",
+ "phoneNumber"
+ ]
+ }
+ }
+ },
+ "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"
+ ],
+ "parameters": [
+ "locationName",
+ "locationImage",
+ "deliveryMode"
+ ]
+ }
+ }
+ }
+ },
+ "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"
+ ]
+ },
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NORMAL",
+ "default_hmi": "FULL",
+ "groups": [
+ "SendLocation", "SendLocationOnly"
+ ]
+ },
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
new file mode 100644
index 0000000000..3530c01388
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1.json
@@ -0,0 +1,2342 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ],
+ "parameters": [
+ "longitudeDegrees",
+ "latitudeDegrees",
+ "locationName",
+ "locationDescription",
+ "addressLines",
+ "phoneNumber",
+ "locationImage",
+ "deliveryMode",
+ "timeStamp",
+ "address"
+ ]
+ }
+ }
+ },
+ "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"
+ ],
+ "parameters": []
+ }
+ }
+ }
+ },
+ "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"
+ ]
+ },
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NORMAL",
+ "default_hmi": "FULL",
+ "groups": [
+ "SendLocation", "SendLocationOnly"
+ ]
+ },
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
new file mode 100644
index 0000000000..e169aea24a
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json
@@ -0,0 +1,2330 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ],
+ "parameters": []
+ }
+ }
+ }
+ },
+ "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"
+ ]
+ },
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NORMAL",
+ "default_hmi": "FULL",
+ "groups": [
+ "SendLocation", "SendLocationOnly"
+ ]
+ },
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
new file mode 100644
index 0000000000..df45a0be61
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location.json
@@ -0,0 +1,2329 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ]
+ },
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NORMAL",
+ "default_hmi": "FULL",
+ "groups": [
+ "SendLocation"
+ ]
+ },
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
new file mode 100644
index 0000000000..c471d6ec97
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_all_params.json
@@ -0,0 +1,2341 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ],
+ "parameters": [
+ "longitudeDegrees",
+ "latitudeDegrees",
+ "locationName",
+ "locationDescription",
+ "addressLines",
+ "phoneNumber",
+ "locationImage",
+ "deliveryMode",
+ "timeStamp",
+ "address"
+ ]
+ }
+ }
+ },
+ "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"
+ ]
+ },
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NORMAL",
+ "default_hmi": "FULL",
+ "groups": [
+ "SendLocation"
+ ]
+ },
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
new file mode 100644
index 0000000000..29781d211c
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_no_params.json
@@ -0,0 +1,2330 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ],
+ "parameters": []
+ }
+ }
+ },
+ "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"
+ ]
+ },
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NORMAL",
+ "default_hmi": "FULL",
+ "groups": [
+ "SendLocation"
+ ]
+ },
+ }
+ }
+}
diff --git a/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
new file mode 100644
index 0000000000..91be06a561
--- /dev/null
+++ b/src/components/policy/policy_external/test/json/sdl_update_pt_send_location_some_params.json
@@ -0,0 +1,2335 @@
+{
+ "policy_table" : {
+ "module_config": {
+ "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": {
+ "0x04": {
+ "default": [
+ "http://ivsu.software.ford.com/api/getsoftwareupdates"
+ ]
+ },
+ "0x07": {
+ "default": [
+ "http://policies.telematics.ford.com/api/policies"
+ ]
+ }
+ },
+ "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"
+ ],
+ "parameters": [
+ "longitudeDegrees",
+ "latitudeDegrees",
+ "locationDescription",
+ "phoneNumber"
+ ]
+ }
+ }
+ },
+ "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"
+ ]
+ },
+ "1234": {
+ "keep_context": false,
+ "steal_focus": false,
+ "priority": "NORMAL",
+ "default_hmi": "FULL",
+ "groups": [
+ "SendLocation"
+ ]
+ },
+ }
+ }
+}
diff --git a/src/components/policy/test/valid_sdl_pt_update.json b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
index 56c728f104..56c728f104 100644
--- a/src/components/policy/test/valid_sdl_pt_update.json
+++ b/src/components/policy/policy_external/test/json/valid_sdl_pt_update.json
diff --git a/src/components/policy/test/log4cxx.properties b/src/components/policy/policy_external/test/log4cxx.properties
index 1c09444986..1c09444986 100644
--- a/src/components/policy/test/log4cxx.properties
+++ b/src/components/policy/policy_external/test/log4cxx.properties
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
new file mode 100644
index 0000000000..da0cd913b6
--- /dev/null
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -0,0 +1,1719 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <fstream>
+#include <string>
+#include <vector>
+#include <stdint.h>
+
+#include "gtest/gtest.h"
+
+#include "policy/policy_manager_impl_test_base.h"
+#include "policy/policy_table/types.h"
+
+#include "utils/date_time.h"
+#include "utils/gen_hash.h"
+#include "json/reader.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::ReturnRef;
+
+TEST_F(PolicyManagerImplTest,
+ DISABLED_TiggerPTUForNaviAppInCaseNoCertificateExistsInPolicyTable) {
+ EXPECT_CALL(*cache_manager_, GetDeviceConsent(_))
+ .WillOnce(Return(kDeviceAllowed));
+ const uint32_t type = 0;
+ const uint32_t id = 1;
+ const EntityStatus status = kStatusOn;
+ ExternalConsentStatusItem item(type, id, status);
+
+ ExternalConsentStatus external_consent_status;
+ external_consent_status.insert(item);
+
+ GroupsByExternalConsentStatus group;
+ group[item].push_back(std::make_pair<std::string, bool>("group_name", true));
+
+ EXPECT_CALL(*cache_manager_, GetExternalConsentStatus())
+ .WillOnce(Return(external_consent_status));
+
+ EXPECT_CALL(*cache_manager_,
+ GetGroupsWithSameEntities(external_consent_status))
+ .WillOnce(Return(group));
+
+ EXPECT_CALL(*cache_manager_, ResetCalculatedPermissions());
+
+ EXPECT_CALL(*cache_manager_, GetPermissionsForApp(_, _, _))
+ .WillOnce(Return(true))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*cache_manager_, GetFunctionalGroupNames(_))
+ .WillOnce(Return(true))
+ .WillOnce(Return(true));
+
+ EXPECT_CALL(*cache_manager_, SetUserPermissionsForApp(_, _))
+ .WillOnce(Return(false));
+
+ EXPECT_CALL(*cache_manager_, SetExternalConsentForApp(_));
+
+ EXPECT_CALL(*cache_manager_, IsPredataPolicy(_)).WillOnce(Return(false));
+ EXPECT_CALL(*cache_manager_, IsApplicationRepresented(_))
+ .WillOnce(Return(true));
+ EXPECT_EQ(policy_manager_->GetPolicyTableStatus(), "UP_TO_DATE");
+ policy_manager_->AddApplication(kDefaultId,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_EQ(policy_manager_->GetPolicyTableStatus(), "UP_TO_DATE");
+}
+
+TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+
+ Json::Value table = createPTforLoad();
+ policy_manager_->ForcePTExchange();
+ policy_manager_->OnUpdateStarted();
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ // Act
+ std::string json = table.toStyledString();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(_));
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+
+ std::string priority = "emergency";
+ uint32_t notif_number = policy_manager_->GetNotificationsNumber(priority);
+ EXPECT_EQ(1u, notif_number);
+
+ priority = "navigation";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
+ EXPECT_EQ(2u, notif_number);
+
+ priority = "emergency";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
+ EXPECT_EQ(1u, notif_number);
+
+ priority = "VOICECOMM";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
+ EXPECT_EQ(3u, notif_number);
+
+ priority = "normal";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
+ EXPECT_EQ(5u, notif_number);
+
+ priority = "none";
+ notif_number = policy_manager_->GetNotificationsNumber(priority);
+ EXPECT_EQ(6u, notif_number);
+}
+
+TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ std::ifstream ifile(kValidSdlPtUpdateJson);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open()) {
+ if (reader.parse(ifile, root, true)) {
+ root["policy_table"]["app_policies"][app_id_1_] = Json::nullValue;
+ json = root.toStyledString();
+ }
+ }
+ ifile.close();
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ ASSERT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+ CheckRpcPermissions(
+ app_id_1_, "UnregisterAppInterface", ::policy::kRpcDisallowed);
+ EXPECT_TRUE(policy_manager_->IsApplicationRevoked(app_id_1_));
+}
+
+// Related to manual test APPLINK-18792
+TEST_F(PolicyManagerImplTest2, AppRevokedOne_AppRegistered) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ EmulatePTAppRevoked(kPtu2Json);
+
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Registration is allowed
+ CheckRpcPermissions("RegisterAppInterface", ::policy::kRpcAllowed);
+}
+
+// Related to manual test APPLINK-18794
+TEST_F(PolicyManagerImplTest2, AppRevokedOne_AppRegistered_HMIDefault) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ EmulatePTAppRevoked(kPtu2Json);
+
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ std::string default_hmi;
+ // Default HMI level is NONE
+ EXPECT_TRUE(policy_manager_->GetDefaultHmi(application_id_, &default_hmi));
+ EXPECT_EQ("NONE", default_hmi);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_SetRevokedAppID_ExpectRPCDisallowed) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ cache->AddDevice(device_id_1_, "Bluetooth");
+ cache->SetDeviceData(device_id_1_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+ // Add app from consented device. App will be assigned with default policies
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check before action
+ policy_table::RpcParameters rpc_parameters;
+ rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
+
+ policy_table::Rpc rpc;
+ rpc["Alert"] = rpc_parameters;
+
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+
+ policy_manager_->CheckPermissions(
+ app_id_1_, kHmiLevelFull, "Alert", input_params, output);
+
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+ // Act
+ std::ifstream ifile(kValidSdlPtUpdateJson);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ EXPECT_TRUE(ifile.is_open());
+ EXPECT_TRUE(reader.parse(ifile, root, true));
+ root["policy_table"]["app_policies"][app_id_1_] = Json::nullValue;
+ json = root.toStyledString();
+ ifile.close();
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ ASSERT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(cache->IsPTPreloaded());
+
+ policy_manager_->CheckPermissions(
+ app_id_1_, kHmiLevelFull, "Alert", input_params, output);
+ // Check RPC is disallowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_SetAppIDwithPolicies_ExpectRPCAllowed) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+
+ ASSERT_TRUE(cache->SetDeviceData(device_id_1_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+ // Add app from consented device. App will be assigned with default policies
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_MEDIA));
+ // Emulate PTU with new policies for app added above
+ std::ifstream ifile(kValidSdlPtUpdateJson);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ // Add AppID with policies
+ root["policy_table"]["app_policies"][application_id_] =
+ Json::Value(Json::objectValue);
+ root["policy_table"]["app_policies"][application_id_]["memory_kb"] =
+ Json::Value(50);
+ root["policy_table"]["app_policies"][application_id_]
+ ["heart_beat_timeout_ms"] = Json::Value(100);
+ root["policy_table"]["app_policies"][application_id_]["AppHMIType"] =
+ Json::Value(Json::arrayValue);
+ root["policy_table"]["app_policies"][application_id_]["AppHMIType"][0] =
+ Json::Value("MEDIA");
+ root["policy_table"]["app_policies"][application_id_]["groups"] =
+ Json::Value(Json::arrayValue);
+ root["policy_table"]["app_policies"][application_id_]["groups"][0] =
+ Json::Value("Base-4");
+ root["policy_table"]["app_policies"][application_id_]["priority"] =
+ Json::Value("EMERGENCY");
+ root["policy_table"]["app_policies"][application_id_]["default_hmi"] =
+ Json::Value("FULL");
+ root["policy_table"]["app_policies"][application_id_]["keep_context"] =
+ Json::Value(true);
+ root["policy_table"]["app_policies"][application_id_]["steal_focus"] =
+ Json::Value(true);
+ root["policy_table"]["app_policies"][application_id_]["certificate"] =
+ Json::Value("sign");
+ json = root.toStyledString();
+ }
+ ifile.close();
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ // Load Json to cache
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(cache->IsPTPreloaded());
+
+ policy_table::RpcParameters rpc_parameters;
+ rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
+
+ policy_table::Rpc rpc;
+ rpc["Alert"] = rpc_parameters;
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .WillOnce(Return(device_id_1_));
+ cache->AddDevice(device_id_1_, "Bluetooth");
+ cache->SetDeviceData(device_id_1_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "Alert", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of parameters empty
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_NoParametersInPT_CheckRpcsInDifferentLevels) {
+ // Arrange
+ AddSetDeviceData();
+ LoadPTUFromJsonFile("json/sdl_update_pt_send_location.json");
+
+ // Will be called each time permissions are checked
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .Times(4)
+ .WillRepeatedly(Return(device_id_1_));
+
+ // Check RPC in each level
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ // Rpc in FULL level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in LIMITED level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+
+ ResetOutputList(output);
+
+ // Rpc in BACKGROUND level
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+
+ ResetOutputList(output);
+
+ // Rpc in NONE level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ // Check RPC is disallowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ // Check list of parameters is empty
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ CheckPermissions_ParamsNotAllowedInPT_AddAppWithAllParams_CheckRpcsInDiffLvls) {
+ // Arrange
+ AddSetDeviceData();
+ // File have empty parameters, so they are forbidden
+ LoadPTUFromJsonFile("json/sdl_update_pt_send_location_no_params.json");
+
+ // Will be called each time permissions are checked
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .Times(4)
+ .WillRepeatedly(Return(device_id_1_));
+
+ // Check RPC in each level
+ ::policy::RPCParams input_params;
+ InsertRpcParametersInList(input_params);
+
+ ::policy::CheckPermissionResult output;
+ // Rpc in FULL level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+
+ // Group which has RPC does not require user consent, so its auto-allowed for
+ // user. Since RPC 'parameters' section is present, but empty, that means
+ // 'every parameter is disallowed' in case some parameter(s) will be passed
+ // it will be considered as disallowed by policy (assumption, will be
+ // clarified).
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+
+ // Check list of allowed parameters is empty
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ ResetOutputList(output);
+
+ // Rpc in LIMITED level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+
+ // Check list of allowed parameters is empty
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+
+ ResetOutputList(output);
+
+ // Rpc in BACKGROUND level
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+
+ // Check list of allowed parameters is empty
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in NONE level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+
+ // Check lists of parameters are empty
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_SomeParamsAllowedInPT_CheckRpcsInDiffLvls) {
+ // Arrange
+ AddSetDeviceData();
+
+ // File have some parameters, so only "longitudeDegrees", "latitudeDegrees",
+ //"locationDescription", "phoneNumber" are allowed
+ LoadPTUFromJsonFile("json/sdl_update_pt_send_location_some_params.json");
+
+ // Will be called each time permissions are checked
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .Times(4)
+ .WillRepeatedly(Return(device_id_1_));
+
+ // Check RPC in each level
+ ::policy::RPCParams input_params;
+ InsertRpcParametersInList(input_params);
+
+ ::policy::CheckPermissionResult output;
+ // Rpc in FULL level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+
+ // Check list of allowed parameters is not empty
+ ASSERT_FALSE(output.list_of_allowed_params.empty());
+ // Check parameters that should be allowed
+ CheckIsParamInList(output.list_of_allowed_params, "longitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "latitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "locationDescription");
+ CheckIsParamInList(output.list_of_allowed_params, "phoneNumber");
+
+ // Parameters that are missing in application assigned groups are considered
+ // as disallowed by policy, i.e. w/o defined user consent, so they are put to
+ // undefined container.
+ ASSERT_FALSE(output.list_of_undefined_params.empty());
+ CheckIsParamInList(output.list_of_undefined_params, "locationName");
+ CheckIsParamInList(output.list_of_undefined_params, "addressLines");
+ CheckIsParamInList(output.list_of_undefined_params, "locationImage");
+ CheckIsParamInList(output.list_of_undefined_params, "deliveryMode");
+ CheckIsParamInList(output.list_of_undefined_params, "timeStamp");
+ CheckIsParamInList(output.list_of_undefined_params, "address");
+
+ // Reset output
+ output.hmi_level_permitted = ::policy::kRpcDisallowed;
+ output.list_of_allowed_params.clear();
+ output.list_of_undefined_params.clear();
+
+ // Rpc in LIMITED level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+
+ // Check list of allowed parameters is not empty
+ ASSERT_FALSE(output.list_of_allowed_params.empty());
+ // Check parameters that should be allowed
+ CheckIsParamInList(output.list_of_allowed_params, "longitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "latitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "locationDescription");
+ CheckIsParamInList(output.list_of_allowed_params, "phoneNumber");
+
+ ASSERT_FALSE(output.list_of_undefined_params.empty());
+ EXPECT_EQ(6u, output.list_of_undefined_params.size());
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in BACKGROUND level
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+
+ // Check parameters that should be allowed
+ ASSERT_FALSE(output.list_of_allowed_params.empty());
+ CheckIsParamInList(output.list_of_allowed_params, "longitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "latitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "locationDescription");
+ CheckIsParamInList(output.list_of_allowed_params, "phoneNumber");
+
+ EXPECT_FALSE(output.list_of_undefined_params.empty());
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in NONE level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ // Check RPC is disallowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ // Check lists of parameters are empty
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest2, GetUpdateUrl) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ GetPTU(kValidSdlPtUpdateJson);
+ // Check expectations
+ const std::string update_url(
+ "http://policies.telematics.ford.com/api/policies");
+ EXPECT_EQ(update_url, policy_manager_->GetUpdateUrl(7));
+ EXPECT_EQ("", policy_manager_->GetUpdateUrl(4));
+}
+
+// Related to manual test APPLINK-18789
+TEST_F(PolicyManagerImplTest2, GetCorrectStatus_PTUSuccessful) {
+ // Precondition
+ CreateLocalPT(preloaded_pt_filename_);
+ // Check
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+
+ // Adding changes PT status
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Before load PT we should send notification about start updating
+ policy_manager_->OnUpdateStarted();
+ // Update
+ GetPTU(kPtu3Json);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_NoParamsInPT_AddAppWithAllParams_CheckRpcsInDiffLvls) {
+ // File does not have parameters, so they all are permitted
+ CheckPermissions_AllParamsAllowed_CheckRpcsInDiffLvls(
+ "json/sdl_update_pt_send_location.json");
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_AllParamsAllowedInPT_CheckRpcsInDiffLvls) {
+ // File has permissions for all params
+ CheckPermissions_AllParamsAllowed_CheckRpcsInDiffLvls(
+ "json/sdl_update_pt_send_location_all_params.json");
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_DiffParamsAllowedInGroups_CheckRpcsInDiffLvls) {
+ // Arrange
+ AddSetDeviceData();
+ // Load Json to cache
+ // File have 2 functional groups: SendLocation and SendLocationOnly.
+ // They have different parameters.
+ // Allowed both groups of parameters
+ LoadPTUFromJsonFile("json/sdl_update_pt_2_groups_have_params.json");
+
+ // Will be called each time permissions are checked
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .Times(4)
+ .WillRepeatedly(Return(device_id_1_));
+
+ // Check RPC in each level
+ ::policy::RPCParams input_params;
+ InsertRpcParametersInList(input_params);
+
+ ::policy::CheckPermissionResult output;
+ // Rpc in FULL level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of allowed parameters is not empty
+ EXPECT_FALSE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(7u, output.list_of_allowed_params.size());
+ // Check parameters that should be allowed
+ CheckIsParamInList(output.list_of_allowed_params, "longitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "latitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "locationDescription");
+ CheckIsParamInList(output.list_of_allowed_params, "phoneNumber");
+ CheckIsParamInList(output.list_of_allowed_params, "locationName");
+ CheckIsParamInList(output.list_of_allowed_params, "locationImage");
+ CheckIsParamInList(output.list_of_allowed_params, "deliveryMode");
+
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ ResetOutputList(output);
+
+ // Rpc in LIMITED level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of allowed parameters is not empty
+ EXPECT_FALSE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(7u, output.list_of_allowed_params.size());
+ // Check parameters that should be allowed
+ CheckIsParamInList(output.list_of_allowed_params, "longitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "latitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "locationDescription");
+ CheckIsParamInList(output.list_of_allowed_params, "phoneNumber");
+ CheckIsParamInList(output.list_of_allowed_params, "locationName");
+ CheckIsParamInList(output.list_of_allowed_params, "locationImage");
+ CheckIsParamInList(output.list_of_allowed_params, "deliveryMode");
+
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ ResetOutputList(output);
+
+ // Rpc in BACKGROUND level
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of allowed parameters is not empty
+ EXPECT_FALSE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(7u, output.list_of_allowed_params.size());
+ // Check parameters that should be allowed
+ CheckIsParamInList(output.list_of_allowed_params, "longitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "latitudeDegrees");
+ CheckIsParamInList(output.list_of_allowed_params, "locationDescription");
+ CheckIsParamInList(output.list_of_allowed_params, "phoneNumber");
+ CheckIsParamInList(output.list_of_allowed_params, "locationName");
+ CheckIsParamInList(output.list_of_allowed_params, "locationImage");
+ CheckIsParamInList(output.list_of_allowed_params, "deliveryMode");
+
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in NONE level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ // Check RPC is disallowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ // Check lists of parameters are empty
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_ParamsAllowedInOneGroup_CheckRpcsInDiffLvls) {
+ // Load Json to cache
+ // File have 2 functional groups: SendLocation and SendLocationOnly.
+ // They have different parameters. One has dissalowed all params, other -
+ // allowed.
+
+ // Arrange
+ CreateLocalPT("json/sdl_preloaded_pt_send_location.json");
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ ASSERT_TRUE(cache->SetDeviceData(device_id_1_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ // Add app from consented device. App will be assigned with default policies
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ std::ifstream ifile("json/sdl_update_pt_2_groups_no_params_in1.json");
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open()) {
+ reader.parse(ifile, root, true);
+ }
+ json = root.toStyledString();
+ ifile.close();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(cache->IsPTPreloaded());
+
+ // Will be called each time permissions are checked
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .Times(4)
+ .WillRepeatedly(Return(device_id_1_));
+
+ // Check RPC in each level
+ ::policy::RPCParams input_params;
+ InsertRpcParametersInList(input_params);
+
+ ::policy::CheckPermissionResult output;
+ // Rpc in FULL level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ ResetOutputList(output);
+
+ // Rpc in LIMITED level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ ResetOutputList(output);
+
+ // Rpc in BACKGROUND level
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in NONE level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_ParamOmmittedInOneGroup_CheckRpcsInDiffLvls) {
+ // Load Json to cache
+ // File have 2 functional groups: SendLocation and SendLocationOnly.
+ // They have different parameters. One has dissalowed all params, other -
+ // omitted.
+
+ // Arrange
+ CreateLocalPT("json/sdl_preloaded_pt_send_location.json");
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ ASSERT_TRUE(cache->SetDeviceData(device_id_1_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ // Add app from consented device. App will be assigned with default policies
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ std::ifstream ifile(
+ "json/sdl_update_pt_2_groups_no_params_in1_omitted_in2.json");
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open()) {
+ reader.parse(ifile, root, true);
+ }
+ json = root.toStyledString();
+ ifile.close();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(cache->IsPTPreloaded());
+
+ // Will be called each time permissions are checked
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .Times(4)
+ .WillRepeatedly(Return(device_id_1_));
+
+ // Check RPC in each level
+ ::policy::RPCParams input_params;
+ InsertRpcParametersInList(input_params);
+
+ ::policy::CheckPermissionResult output;
+ // Rpc in FULL level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ ResetOutputList(output);
+
+ // Rpc in LIMITED level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ ResetOutputList(output);
+
+ // Rpc in BACKGROUND level
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_undefined_params.size());
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in NONE level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest, LoadPT_SetInvalidUpdatePT_PTIsNotLoaded) {
+ // Arrange
+ policy_manager_->ForcePTExchange();
+ policy_manager_->OnUpdateStarted();
+ Json::Value table(Json::objectValue);
+
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+
+ // Assert update is invalid
+ ASSERT_FALSE(IsValid(update));
+
+ // Act
+ std::string json = table.toStyledString();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+
+ // Assert
+ EXPECT_CALL(*cache_manager_, GenerateSnapshot()).Times(0);
+ EXPECT_CALL(*cache_manager_, ApplyUpdate(_)).Times(0);
+ EXPECT_CALL(listener_, GetAppName(_)).Times(0);
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(_)).Times(1);
+ EXPECT_CALL(*cache_manager_, SaveUpdateRequired(false)).Times(0);
+ EXPECT_CALL(*cache_manager_, TimeoutResponse()).Times(0);
+ EXPECT_CALL(*cache_manager_, SecondsBetweenRetries(_)).Times(0);
+ EXPECT_FALSE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_CALL(*cache_manager_, IsPTPreloaded());
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ AddApplication_AddExistingApplicationFromDeviceWithoutConsent_ExpectNoUpdateRequired) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ GetPTU(kValidSdlPtUpdateJson);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Try to add existing app
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check no update required
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+}
+
+uint32_t GetCurrentDaysCount() {
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const uint32_t kSecondsInDay = 60 * 60 * 24;
+ return current_time.tv_sec / kSecondsInDay;
+}
+
+TEST_F(PolicyManagerImplTest2,
+ PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ const uint32_t days = GetCurrentDaysCount();
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+
+ GetPTU(kValidSdlPtUpdateJson);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ ::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
+ // Set PT was updated 10 days ago (limit is 30 days for now)
+ // So no limit exceeded
+ policy_manager_->PTUpdatedAt(counter, days - 10);
+ policy_manager_->OnAppRegisteredOnMobile(app_id_2_);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ PTUpdatedAt_DaysExceedLimit_ExpectUpdateRequired) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ const uint32_t days = GetCurrentDaysCount();
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ GetPTU(kValidSdlPtUpdateJson);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ ::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
+ // Set PT was updated 50 days ago (limit is 30 days for now)
+ policy_manager_->PTUpdatedAt(counter, days - 50);
+ policy_manager_->OnAppRegisteredOnMobile(app_id_2_);
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ OnIgnitionCyclesExceeded_SetExceededIgnitionCycles_ExpectUpdateScheduled) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ const uint32_t days = GetCurrentDaysCount();
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ GetPTU(kValidSdlPtUpdateJson);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Try to add existing app
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ ::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
+ // Set PT was updated 10 days ago (limit is 30 days for now)
+ // So no limit exceeded
+ policy_manager_->PTUpdatedAt(counter, days - 10);
+ int ign_cycles =
+ (policy_manager_->GetCache())->IgnitionCyclesBeforeExchange();
+ // Set ignition cycles to value = 99 (limit is 100 which initiates auto
+ // PTExchange)
+ for (int i = 0; i < ign_cycles; ++i) {
+ policy_manager_->IncrementIgnitionCycles();
+ }
+ policy_manager_->OnAppRegisteredOnMobile(app_id_2_);
+ // Check update required
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetUserConsentForApp_SetUserConsentForApp_ExpectReceivedConsentCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ ::policy::StringArray consented_groups;
+ ::policy::StringArray disallowed_groups;
+ consented_groups.push_back(std::string("Notifications"));
+ consented_groups.push_back(std::string("Notifications"));
+ (policy_manager_->GetCache())
+ ->SetUserPermissionsForDevice(
+ device_id_2_, consented_groups, disallowed_groups);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ GetPTU(kValidSdlPtUpdateJson);
+
+ ::policy::PermissionConsent perm_consent;
+ perm_consent.device_id = device_id_2_;
+ perm_consent.policy_app_id = app_id_2_;
+ perm_consent.consent_source = "VR";
+
+ ::policy::FunctionalGroupPermission group1_perm;
+ group1_perm.group_alias = "Notifications";
+ group1_perm.group_name = "Notifications";
+ group1_perm.group_id = ::utils::Djb2HashFromString("Notifications");
+ group1_perm.state = ::policy::GroupConsent::kGroupAllowed;
+
+ std::vector< ::policy::FunctionalGroupPermission> groups_permissions;
+ groups_permissions.push_back(group1_perm);
+ perm_consent.group_permissions = groups_permissions;
+
+ policy_manager_->SetUserConsentForApp(perm_consent,
+ policy::PolicyManager::kSilentMode);
+ policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
+ std::vector< ::policy::FunctionalGroupPermission>::iterator it;
+ policy_manager_->GetUserConsentForApp(
+ device_id_2_, app_id_2_, actual_groups_permissions);
+ uint32_t index = 0;
+ for (; index < actual_groups_permissions.size(); ++index) {
+ if (actual_groups_permissions[index].group_id == group1_perm.group_id) {
+ break;
+ }
+ }
+ // Check
+ EXPECT_EQ(group1_perm.group_alias,
+ actual_groups_permissions[index].group_alias);
+ EXPECT_EQ(group1_perm.group_name,
+ actual_groups_permissions[index].group_name);
+ EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
+ EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppKeepContext_SetPoliciesForAppUpdated_ExpectAppCanKeepContext) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ GetPTU(kValidSdlPtUpdateJson);
+ // Check keep context in updated policies for app
+ EXPECT_TRUE(policy_manager_->CanAppKeepContext(app_id_2_));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppStealFocus_SetPoliciesForAppUpdated_ExpectAppCanStealFocus) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ GetPTU(kValidSdlPtUpdateJson);
+ // Check keep context in updated policies for app
+ EXPECT_TRUE(policy_manager_->CanAppKeepContext(app_id_2_));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetVehicleInfo_SetVehicleInfo_ExpectReceivedInfoCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ GetPTU(kValidSdlPtUpdateJson);
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+ policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
+ ::policy::VehicleInfo vehicle_info = policy_manager_->GetVehicleInfo();
+
+ EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_make),
+ vehicle_info.vehicle_make);
+ EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_model),
+ vehicle_info.vehicle_model);
+ EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_year),
+ vehicle_info.vehicle_year);
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ GetPermissionsForApp_SetUserConsentForApp_ExpectReceivedPermissionsCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ ::policy::StringArray consented_groups;
+ ::policy::StringArray disallowed_groups;
+ consented_groups.push_back(std::string("Notifications"));
+ (policy_manager_->GetCache())
+ ->SetUserPermissionsForDevice(
+ device_id_2_, consented_groups, disallowed_groups);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ GetPTU(kValidSdlPtUpdateJson);
+ ::policy::PermissionConsent perm_consent;
+ perm_consent.device_id = device_id_2_;
+ perm_consent.policy_app_id = app_id_2_;
+ perm_consent.consent_source = "VR";
+
+ ::policy::FunctionalGroupPermission group1_perm;
+ group1_perm.group_alias = "Notifications";
+ group1_perm.group_name = "Notifications";
+ group1_perm.group_id = ::utils::Djb2HashFromString("Notifications");
+ group1_perm.state = ::policy::GroupConsent::kGroupAllowed;
+
+ std::vector< ::policy::FunctionalGroupPermission> groups_permissions;
+ groups_permissions.push_back(group1_perm);
+ perm_consent.group_permissions = groups_permissions;
+
+ policy_manager_->SetUserConsentForApp(perm_consent,
+ policy::PolicyManager::kSilentMode);
+ policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
+ std::vector< ::policy::FunctionalGroupPermission>::iterator it;
+ policy_manager_->GetPermissionsForApp(
+ device_id_2_, app_id_2_, actual_groups_permissions);
+ uint32_t index = 0;
+ for (; index < actual_groups_permissions.size(); ++index) {
+ if (actual_groups_permissions[index].group_id == group1_perm.group_id) {
+ break;
+ }
+ }
+ // Check
+ EXPECT_EQ(group1_perm.group_alias,
+ actual_groups_permissions[index].group_alias);
+ EXPECT_EQ(group1_perm.group_name,
+ actual_groups_permissions[index].group_name);
+ EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
+ EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ GetAppRequestTypes_AddApp_UpdateAppPolicies_ExpectReceivedRequestTypesCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+
+ policy_manager_->AddApplication(app_id_3_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ ::policy::StringArray app_requests =
+ policy_manager_->GetAppRequestTypes(app_id_3_);
+ EXPECT_EQ(1u, app_requests.size());
+
+ Json::Value root = GetPTU(kPtuRequestTypeJson);
+ Json::Value request_Types = Json::Value(Json::arrayValue);
+ request_Types =
+ root["policy_table"]["app_policies"][app_id_3_]["RequestType"];
+ app_requests = policy_manager_->GetAppRequestTypes(app_id_3_);
+ EXPECT_EQ(request_Types.size(), app_requests.size());
+ // Check nicknames match
+ for (uint32_t i = 0; i < request_Types.size(); ++i) {
+ EXPECT_EQ(request_Types[i], app_requests[i]);
+ }
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+ ::policy_table::PolicyTableType type1 =
+ ::policy_table::PolicyTableType::PT_PRELOADED;
+ pt->SetPolicyTableType(type1);
+ if (!pt->is_valid()) {
+ std::cout << "\nPolicy table is not valid."
+ << "\n";
+ rpc::ValidationReport report("policy_table");
+ pt->ReportErrors(&report);
+ }
+ // Add new app
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ uint32_t result = policy_manager_->HeartBeatTimeout(app_id_2_);
+ // By default hertbeat timeout is 0
+ EXPECT_EQ(0u, result);
+ Json::Value root = GetPTU(kValidSdlPtUpdateJson);
+
+ ::policy_table::PolicyTableType type2 =
+ ::policy_table::PolicyTableType::PT_UPDATE;
+ pt->SetPolicyTableType(type2);
+ if (!pt->is_valid()) {
+ std::cout << "\nPolicy table is not valid."
+ << "\n";
+ rpc::ValidationReport report("policy_table");
+ pt->ReportErrors(&report);
+ }
+
+ Json::Value heart_beat_timeout = Json::Value(Json::uintValue);
+ heart_beat_timeout =
+ root["policy_table"]["app_policies"][app_id_2_]["heart_beat_timeout_ms"];
+ result = policy_manager_->HeartBeatTimeout(app_id_2_);
+ EXPECT_EQ(heart_beat_timeout.asUInt(), result);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ RemoveAppConsentForGroup_SetUserConsentForApp_ExpectAppConsentDeleted) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ ::policy::StringArray consented_groups;
+ ::policy::StringArray disallowed_groups;
+ consented_groups.push_back(std::string("Notifications"));
+ (policy_manager_->GetCache())
+ ->SetUserPermissionsForDevice(
+ device_id_2_, consented_groups, disallowed_groups);
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ GetPTU(kValidSdlPtUpdateJson);
+
+ ::policy::PermissionConsent perm_consent;
+ perm_consent.device_id = device_id_2_;
+ perm_consent.policy_app_id = app_id_2_;
+ perm_consent.consent_source = "VR";
+
+ ::policy::FunctionalGroupPermission group1_perm;
+ group1_perm.group_alias = "Notifications";
+ group1_perm.group_name = "Notifications";
+ group1_perm.group_id = ::utils::Djb2HashFromString("Notifications");
+ group1_perm.state = ::policy::GroupConsent::kGroupAllowed;
+
+ std::vector< ::policy::FunctionalGroupPermission> groups_permissions;
+ groups_permissions.push_back(group1_perm);
+ perm_consent.group_permissions = groups_permissions;
+
+ policy_manager_->SetUserConsentForApp(perm_consent,
+ policy::PolicyManager::kSilentMode);
+ policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+ std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
+ std::vector< ::policy::FunctionalGroupPermission>::iterator it;
+ policy_manager_->GetPermissionsForApp(
+ device_id_2_, app_id_2_, actual_groups_permissions);
+ uint32_t index = 0;
+ for (; index < actual_groups_permissions.size(); ++index) {
+ if (actual_groups_permissions[index].group_id == group1_perm.group_id) {
+ break;
+ }
+ }
+ // Check
+ EXPECT_EQ(group1_perm.group_alias,
+ actual_groups_permissions[index].group_alias);
+ EXPECT_EQ(group1_perm.group_name,
+ actual_groups_permissions[index].group_name);
+ EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
+ EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+ uint32_t ucr_size = 0;
+ ::policy_table::DeviceData& device_data = *pt->policy_table.device_data;
+ ::policy_table::DeviceData::const_iterator dev_data_iter =
+ device_data.find(device_id_2_);
+ if (dev_data_iter != device_data.end()) {
+ const ::policy_table::DeviceParams& dev_params = dev_data_iter->second;
+ const ::policy_table::UserConsentRecords& ucr =
+ *(dev_params.user_consent_records);
+ ucr_size = ucr.size();
+ ASSERT_GT(ucr_size, 0u);
+ ::policy_table::UserConsentRecords::const_iterator ucr_iter =
+ ucr.find(app_id_2_);
+ if (ucr_iter != ucr.end()) {
+ EXPECT_TRUE((*(ucr_iter->second.consent_groups)).find("Notifications") !=
+ (*(ucr_iter->second.consent_groups)).end());
+ policy_manager_->RemoveAppConsentForGroup(app_id_2_, "Notifications");
+ EXPECT_TRUE((*(ucr_iter->second.consent_groups)).find("Notifications") ==
+ (*(ucr_iter->second.consent_groups)).end());
+ }
+ }
+}
+
+TEST_F(PolicyManagerImplTest2,
+ SingleInvalidRequestTypeInPTU_ExpectReplaceWithDefaultValues) {
+ // Arrange
+ const std::string section_name = app_id_2_;
+
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+
+ // Setting device consent to 'true' in order to have defult application
+ // permissions, request type etc.
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+
+ // Add app
+ policy_manager_->AddApplication(section_name,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_CALL(listener_, OnPendingPermissionChange(section_name));
+
+ // PTU has single invalid RequestTypes, which must be dropped and replaced
+ // with default RT
+ GetPTU("json/PTU_with_one_invalid_requestType.json");
+
+ // Get RequestTypes from <app_id> section of app policies after PT update
+ ::policy::StringArray app_request_types_after =
+ policy_manager_->GetAppRequestTypes(section_name);
+
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(kDefaultId))
+ .WillOnce(Return(device_id_1_));
+ ::policy::StringArray default_request_types_after =
+ policy_manager_->GetAppRequestTypes(kDefaultId);
+
+ // Check sizes of Request types of PT and PTU
+ EXPECT_EQ(4u, app_request_types_after.size());
+
+ ::policy::AppPermissions permissions =
+ policy_manager_->GetAppPermissionsChanges(section_name);
+ EXPECT_TRUE(permissions.requestTypeChanged);
+
+ policy_table::RequestType temp_res1;
+ std::vector<policy_table::RequestType> result1;
+ for (uint32_t i = 0; i < app_request_types_after.size(); ++i) {
+ if (::rpc::policy_table_interface_base::EnumFromJsonString(
+ app_request_types_after[i], &temp_res1)) {
+ result1.push_back(temp_res1);
+ }
+ }
+ policy_table::RequestType temp_res2;
+ std::vector<policy_table::RequestType> result2;
+ for (size_t i = 0; i < default_request_types_after.size(); ++i) {
+ if (::rpc::policy_table_interface_base::EnumFromJsonString(
+ default_request_types_after[i], &temp_res2)) {
+ result2.push_back(temp_res2);
+ }
+ }
+ ASSERT_EQ(result1.size(), result2.size());
+ std::sort(result1.begin(), result1.end());
+ std::sort(result2.begin(), result2.end());
+ // Checks
+ EXPECT_TRUE(std::equal(result1.begin(), result1.end(), result2.begin()));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ InitPT_LoadPT_ExpectIncrementedCountOfSamePrompts) {
+ // Initializing policy_table
+ CreateLocalPT(preloaded_pt_filename_);
+
+ policy_table::FunctionalGroupings functional_groupings;
+ GetFunctionalGroupingsFromManager(functional_groupings);
+
+ UserConsentPromptToRpcsConnections initial_functional_groupings_map;
+ UserConsentPromptToRpcsConnections updated_functional_groupings_map;
+ // Filling initial map
+ FillMultimapFromFunctionalGroupings(initial_functional_groupings_map,
+ functional_groupings);
+
+ // Updating policy_table
+ GetPTU("json/sdl_pt_update.json");
+ policy_table::FunctionalGroupings updated_functional_groupings;
+ GetFunctionalGroupingsFromManager(updated_functional_groupings);
+ // Filling updated map
+ FillMultimapFromFunctionalGroupings(updated_functional_groupings_map,
+ updated_functional_groupings);
+
+ // Comparing two multimaps
+ // (EXPECT increment count of functionalgroups
+ // under key : user_consent_prompt)
+ uint32_t count_before_update =
+ initial_functional_groupings_map.count("Notifications");
+ uint32_t count_after_update =
+ updated_functional_groupings_map.count("Notifications");
+ EXPECT_EQ(1u, count_before_update);
+ EXPECT_EQ(2u, count_after_update);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ LoadPT_UpdatePT_ChangingCountsOfDifferentUserConsentPrompts) {
+ // Initializing policy_table
+ CreateLocalPT(preloaded_pt_filename_);
+
+ // First update of policy table
+ GetPTU("json/sdl_pt_first_update.json");
+ // Geting functional groupings first time
+ policy_table::FunctionalGroupings first_functional_groupings;
+ GetFunctionalGroupingsFromManager(first_functional_groupings);
+ // Filling map first time
+ UserConsentPromptToRpcsConnections first_update_functional_groupings_map;
+ FillMultimapFromFunctionalGroupings(first_update_functional_groupings_map,
+ first_functional_groupings);
+
+ // Second update of policy table
+ GetPTU("json/sdl_pt_second_update.json");
+ // Geting functional groupings second time
+ policy_table::FunctionalGroupings second_functional_groupings;
+ GetFunctionalGroupingsFromManager(second_functional_groupings);
+ // Filling map second time
+ UserConsentPromptToRpcsConnections second_update_functional_groupings_map;
+ FillMultimapFromFunctionalGroupings(second_update_functional_groupings_map,
+ second_functional_groupings);
+
+ // Getting counts before second update
+ uint32_t first_count_of_old_user_consent_prompt =
+ first_update_functional_groupings_map.count("Old_Notifications");
+ uint32_t first_count_of_new_user_consent_prompt =
+ first_update_functional_groupings_map.count("New_Notifications");
+
+ // Getting counts after second update
+ uint32_t second_count_of_old_user_consent_prompt =
+ second_update_functional_groupings_map.count("Old_Notifications");
+ uint32_t second_count_of_new_user_consent_prompt =
+ second_update_functional_groupings_map.count("New_Notifications");
+
+ // Expect decrement count of old user_consent_prormpt
+ EXPECT_GT(first_count_of_old_user_consent_prompt,
+ second_count_of_old_user_consent_prompt);
+ // Expect increment count of new user_consent_prormpt
+ EXPECT_LT(first_count_of_new_user_consent_prompt,
+ second_count_of_new_user_consent_prompt);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTWithOneInvalidRequestTypeValue_RequestTypeValueEQToDefault) {
+ // Logic in another function
+ CompareAppRequestTypesWithDefault(kAppId, kJsonFiles[0]);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_InvalidRequestTypeBetweenCorectValuesInPTU_EraseInvalidValue) {
+ // Refresh policy table with invalid RequestType in application
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[1]);
+ // Correct of Request Types
+ policy_table::RequestTypes correct_types;
+ correct_types.push_back(policy_table::RequestType::RT_HTTP);
+ correct_types.push_back(policy_table::RequestType::RT_LAUNCH_APP);
+ correct_types.push_back(policy_table::RequestType::RT_PROPRIETARY);
+ // Get <app_id> Request Types
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(kAppId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(
+ PolicyManagerImplTest_RequestTypes,
+ LoadPT_AppInUpdateFileHaventRequestTypeField_RequestTypeValueEQToDefault) {
+ // Logic in another function
+ CompareAppRequestTypesWithDefault(kAppId, kJsonFiles[2]);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_RequestTypeArrayHaveNoOneValues_AvalibleAllRequestTypes) {
+ // Refresh policy table with invalid RequestType in application
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[3]);
+
+ // Get <app_id> Request Types
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(kAppId);
+
+ // Expect
+ const size_t correct_size = 0;
+ const size_t received_size = received_types.size();
+ EXPECT_EQ(correct_size, received_size);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ InitPT_DefaultRequestTypeHaveOneInvalidValue_False) {
+ // PT have only invalid value in app_policies::default::RequestType
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(app_storage_folder_));
+ ASSERT_FALSE(
+ policy_manager_impl_sptr_->InitPT(kJsonFiles[4], &policy_settings_));
+ // Invalid table data with pt_preloaded=true
+ EXPECT_TRUE(policy_manager_impl_sptr_->GetCache()->IsPTPreloaded());
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ InitPT_DefaultRequestTypeHaveSeveralInvalidValues_False) {
+ // PT have several only invalid values in app_policies::default::RequestType
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(app_storage_folder_));
+ ASSERT_FALSE(
+ policy_manager_impl_sptr_->InitPT(kJsonFiles[5], &policy_settings_));
+ // Invalid table data with pt_preloaded=true
+ EXPECT_TRUE(policy_manager_impl_sptr_->GetCache()->IsPTPreloaded());
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ InitPT_DefaultRequestTypeHaveInvalidValueBetweenCorrect_True) {
+ // PT have ["QUERY_APPS", "IVSU", "PROPRIETARY"]
+ // In app_policies::default::RequestType
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(app_storage_folder_));
+ ASSERT_TRUE(
+ policy_manager_impl_sptr_->InitPT(kJsonFiles[6], &policy_settings_));
+ EXPECT_TRUE(policy_manager_impl_sptr_->GetCache()->IsPTPreloaded());
+
+ // Correct of Request Types
+ policy_table::RequestTypes correct_types;
+ correct_types.push_back(policy_table::RequestType::RT_QUERY_APPS);
+ correct_types.push_back(policy_table::RequestType::RT_PROPRIETARY);
+
+ // Get default Request Types
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(kDefaultAppId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTDefaultApp_RequestTypeValueEQToUpdate) {
+ // Base values of Request Types
+ policy_table::RequestTypes correct_types = CreateDefaultAppPTURequestValues();
+
+ // Load valid values for RequestType
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[7]);
+
+ // Get Request Types for "<default>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kDefaultId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(
+ PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTDefaultAppInvalidRequestTypeValues_RequestTypeValueEQToDatabase) {
+ // Base values of Request Types
+ policy_table::RequestTypes correct_types =
+ CreateDefaultAppDatabaseRequestValues();
+
+ // Load RequestType with invalid values
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[8]);
+
+ // Get Request Types for "<default>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kDefaultId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTDefaultAppEmptyRequestTypeValues_RequestTypeValueEmpty) {
+ // Load RequestType with empty values
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[9]);
+
+ // Get Request Types for "<default>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kDefaultId);
+
+ // Expect
+ const size_t received_size = received_types.size();
+ EXPECT_EQ(0u, received_size);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTDefaultAppOmittedRequestType_RequestTypeValueEQToDatabase) {
+ // Base values of Request Types
+ policy_table::RequestTypes correct_types =
+ CreateDefaultAppDatabaseRequestValues();
+
+ // Load omitted RequestType values
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[10]);
+
+ // Get Request Types for "<default>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kDefaultId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(
+ PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTDefaultAppOneInvalidRequestTypeValue_RequestTypeValueEQValidPT) {
+ // Update values of Request Types
+ policy_table::RequestTypes correct_types = CreateDefaultAppPTURequestValues();
+
+ // Load RequestType with one invalid value
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[11]);
+
+ // Get Request Types for "<default>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kDefaultId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTPreDataConsentApp_RequestTypeValueEQToUpdate) {
+ // Update values of Request Types
+ policy_table::RequestTypes correct_types =
+ CreatePreDataConsentAppPTURequestValues();
+
+ // Load valid values for RequestType
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[12]);
+
+ // Get Request Types for "<pre_DataConsent>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kPreDataConsentId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(
+ PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTPreDataConsentAppInvalidRequestTypeValues_RequestTypeValueEQToDatabase) {
+ // Update values of Request Types
+ policy_table::RequestTypes correct_types;
+ correct_types.push_back(policy_table::RequestType::RT_HTTP);
+
+ // Load RequestType with invalid values
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[13]);
+
+ // Get Request Types for "<pre_DataConsent>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kPreDataConsentId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTPreDataConsentAppEmptyRequestTypeValues_RequestTypeValueEmpty) {
+ // Load RequestType with empty values
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[14]);
+
+ // Get Request Types for "<pre_DataConsent>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kPreDataConsentId);
+
+ // Expect
+ const size_t received_size = received_types.size();
+ EXPECT_EQ(0u, received_size);
+}
+
+TEST_F(
+ PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTPreDataConsentAppOmittedRequestType_RequestTypeValueEQToDatabase) {
+ // Base values of Request Types
+ policy_table::RequestTypes correct_types;
+ correct_types.push_back(policy_table::RequestType::RT_HTTP);
+
+ // Load omitted RequestType values
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[15]);
+
+ // Get Request Types for "<pre_DataConsent>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kPreDataConsentId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+TEST_F(
+ PolicyManagerImplTest_RequestTypes,
+ LoadPT_PTPreDataConsentAppOneInvalidRequestTypeValue_RequestTypeValueEQValidPT) {
+ // Update values of Request Types
+ policy_table::RequestTypes correct_types =
+ CreatePreDataConsentAppPTURequestValues();
+
+ // Load RequestType with one invalid value
+ RefreshPT(preloaded_pt_filename_, kJsonFiles[16]);
+
+ // Get Request Types for "<pre_DataConsent>"
+ policy_table::RequestTypes received_types =
+ GetRequestTypesForApplication(policy::kPreDataConsentId);
+
+ CompareRequestTypesContainers(correct_types, received_types);
+}
+
+} // namespace policy
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
new file mode 100644
index 0000000000..e666ac82de
--- /dev/null
+++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc
@@ -0,0 +1,338 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <fstream>
+
+#include "gtest/gtest.h"
+
+#include "policy/policy_manager_impl_test_base.h"
+
+#include "json/json.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using ::testing::Return;
+
+TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
+ // Arrange necessary pre-conditions
+ StringsForUpdate new_data;
+ new_data.new_field_name_ = "Notifications-";
+ CreateNewRandomData(new_data);
+ // Create Initial LocalPT from preloadedPT
+ CreateLocalPT(preloaded_pt_filename_);
+ // Update preloadedPT
+ std::ifstream ifile(preloaded_pt_filename_);
+ Json::Reader reader;
+ Json::Value root(Json::objectValue);
+
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ root["policy_table"]["module_config"]["preloaded_date"] =
+ new_data.new_date_;
+ Json::Value val(Json::objectValue);
+ Json::Value val2(Json::arrayValue);
+ val2[0] = hmi_level_[index_];
+ val[new_data.new_field_value_]["hmi_levels"] = val2;
+ root["policy_table"]["functional_groupings"][new_data
+ .new_field_name_]["rpcs"] =
+ val;
+ root["policy_table"]["functional_groupings"][new_data.new_field_name_]
+ ["user_consent_prompt"] = new_data.new_field_name_;
+ }
+ ifile.close();
+
+ Json::StyledStreamWriter writer;
+ std::ofstream ofile(preloaded_pt_filename_);
+ writer.write(ofile, root);
+ ofile.flush();
+ ofile.close();
+
+ // Make PolicyManager to update LocalPT
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ EXPECT_TRUE(
+ policy_manager_->InitPT(preloaded_pt_filename_, &policy_settings_));
+ EXPECT_TRUE(cache->IsPTPreloaded());
+
+ // Arrange
+ utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ // Get FunctionalGroupings
+ policy_table::FunctionalGroupings& fc =
+ table->policy_table.functional_groupings;
+ // Get RPCs for new added field in functional_group
+ policy_table::Rpcs& rpcs = fc[new_data.new_field_name_];
+ // Get user consent prompt
+ const std::string& ucp = *(rpcs.user_consent_prompt);
+ // Get Rpcs
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ // Get RPC's parameters
+ policy_table::RpcParameters& rpc_param = rpc[new_data.new_field_value_];
+
+ // Check preloaded date
+ EXPECT_EQ(static_cast<std::string>(
+ *(table->policy_table.module_config.preloaded_date)),
+ new_data.new_date_);
+ // Check if new field exists in Local PT
+ EXPECT_TRUE(fc.find(new_data.new_field_name_) != fc.end());
+ // Check if user_consent_propmp is correct
+ EXPECT_EQ(new_data.new_field_name_, ucp);
+ // Check if new RPC exists
+ EXPECT_TRUE(rpc.find(new_data.new_field_value_) != rpc.end());
+ // Check HMI level of new RPC
+ EXPECT_EQ(index_, static_cast<uint32_t>(rpc_param.hmi_levels[0]));
+ // Check if new field matches field added to preloaded PT
+ EXPECT_EQ(std::string((*(fc.find(new_data.new_field_name_))).first),
+ new_data.new_field_name_);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ SetSystemLanguage_ExpectSystemLanguageSetSuccessfully) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->SetSystemLanguage("it-it");
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+ ::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
+ EXPECT_EQ("it-it", static_cast<std::string>(*(ModuleMeta.language)));
+}
+
+TEST_F(PolicyManagerImplTest2, SetVINValue_ExpectVINSetSuccessfully) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ std::string vin_code("1FAPP6242VH100001");
+ policy_manager_->SetVINValue(vin_code);
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+ ::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
+ EXPECT_EQ(vin_code, static_cast<std::string>(*(ModuleMeta.vin)));
+}
+
+TEST_F(PolicyManagerImplTest2, SetSystemInfo_ExpectSystemInfoSetSuccessfully) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->SetSystemInfo("4.1.3.B_EB355B", "WAEGB", "ru-ru");
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ utils::SharedPtr<policy_table::Table> pt = cache->GetPT();
+ ::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta);
+ EXPECT_EQ("ru-ru", static_cast<std::string>(*(ModuleMeta.language)));
+ EXPECT_EQ("4.1.3.B_EB355B",
+ static_cast<std::string>(*(ModuleMeta.ccpu_version)));
+ EXPECT_EQ("WAEGB", static_cast<std::string>(*(ModuleMeta.wers_country_code)));
+ EXPECT_FALSE(cache->IsPTPreloaded());
+}
+
+TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ // Add first device
+ ::policy::DeviceInfo dev_info1;
+ dev_info1.hardware = "hardware IPX";
+ dev_info1.firmware_rev = "v.8.0.1";
+ dev_info1.os = "Android";
+ dev_info1.os_ver = "4.4.2";
+ dev_info1.carrier = "Life";
+ dev_info1.max_number_rfcom_ports = 2;
+ dev_info1.connection_type = "Bluetooth";
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ policy_manager_->SetDeviceInfo(device_id_1_, dev_info1);
+
+ // Add second device
+ ::policy::DeviceInfo dev_info2;
+ dev_info2.hardware = "hardware SPX";
+ dev_info2.firmware_rev = "v.6.0.1";
+ dev_info2.os = "Android";
+ dev_info2.os_ver = "4.1.1";
+ dev_info2.carrier = "MTS";
+ dev_info2.max_number_rfcom_ports = 2;
+ dev_info2.connection_type = "Bluetooth";
+ policy_manager_->AddDevice("ZZZ123456789YYY", "Bluetooth");
+ policy_manager_->SetDeviceInfo("ZZZ123456789YYY", dev_info2);
+
+ // Add third device
+ ::policy::DeviceInfo dev_info3;
+ dev_info3.hardware = "hardware DNPX";
+ dev_info3.firmware_rev = "v.4.0.1";
+ dev_info3.os = "Android";
+ dev_info3.os_ver = "5.0.1 Lollipop";
+ dev_info3.carrier = "Kyivstar";
+ dev_info3.max_number_rfcom_ports = 2;
+ dev_info3.connection_type = "Bluetooth";
+ policy_manager_->AddDevice("AAA123456789RRR", "Bluetooth");
+ policy_manager_->SetDeviceInfo("AAA123456789RRR", dev_info3);
+
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+ // Try to find first device in PT
+ policy_table::DeviceData::const_iterator iter =
+ (*(pt->policy_table.device_data)).find(device_id_1_);
+ // Check first device successfully added to PT
+ ASSERT_TRUE(iter != (*(pt->policy_table.device_data)).end());
+
+ // Try to find second device in PT
+ iter = (*(pt->policy_table.device_data)).find("ZZZ123456789YYY");
+ // Check second device successfully added to PT
+ ASSERT_TRUE(iter != (*(pt->policy_table.device_data)).end());
+
+ // Try to find third device in PT
+ iter = (*(pt->policy_table.device_data)).find("AAA123456789RRR");
+ // Check third device successfully added to PT
+ ASSERT_TRUE(iter != (*(pt->policy_table.device_data)).end());
+
+ policy_manager_->MarkUnpairedDevice(device_id_1_);
+ policy_manager_->MarkUnpairedDevice("ZZZ123456789YYY");
+ policy_manager_->MarkUnpairedDevice("AAA123456789RRR");
+ policy_manager_->CleanupUnpairedDevices();
+
+ // Try to find first device in PT
+ iter = (*(pt->policy_table.device_data)).find(device_id_1_);
+ // Check first device successfully deleted from PT
+ ASSERT_TRUE(iter == (*(pt->policy_table.device_data)).end());
+
+ // Try to find second device in PT
+ iter = (*(pt->policy_table.device_data)).find("ZZZ123456789YYY");
+ // Check second device successfully deleted from PT
+ ASSERT_TRUE(iter == (*(pt->policy_table.device_data)).end());
+
+ // Try to find third device in PT
+ iter = (*(pt->policy_table.device_data)).find("AAA123456789RRR");
+ // Check third device successfully deleted from PT
+ ASSERT_TRUE(iter == (*(pt->policy_table.device_data)).end());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ AddValidRequestTypesToPT_default_Section_ExpectRTAdded) {
+ // Arrange
+ AddRTtoPT(kPtuJson, policy::kDefaultId, 1u, 0);
+ CheckResultForValidRT();
+}
+
+TEST_F(PolicyManagerImplTest2,
+ AddValidRequestTypeToPT_preDataConsentSection_ExpectRTAdded) {
+ // Arrange
+ AddRTtoPT(kPtuJson, policy::kPreDataConsentId, 1u, 0u);
+ CheckResultForValidRT();
+}
+
+TEST_F(PolicyManagerImplTest2,
+ AddInvalidRequestTypeToPT_defaultSection_ExpectIgnored) {
+ // Arrange
+ AddRTtoPT(kPtu3Json, policy::kDefaultId, 1u, 0u);
+ CheckResultForInvalidRT();
+}
+
+TEST_F(PolicyManagerImplTest2,
+ AddInvalidRequestTypeToPT_pre_DataConsentSection_ExpectIgnored) {
+ // Arrange
+ AddRTtoPT(kPtu3Json, policy::kPreDataConsentId, 1u, 1u);
+ CheckResultForInvalidRT();
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ AddValidRequestTypeToPT_GetNewAppWithSpecificPoliciesViaPTU_ExpectRTAdded) {
+ const std::string& app_id = application_id_;
+
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ // Add app
+ policy_manager_->AddApplication(app_id, HmiTypes(policy_table::AHT_DEFAULT));
+ // Check app gets RequestTypes from pre_DataConsent of app_policies
+ // section
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(app_id);
+
+ // Only single item as in pre_DataConsent in preloaded PT
+ EXPECT_EQ(1u, pt_request_types_.size());
+ EXPECT_CALL(listener_, OnPendingPermissionChange(app_id)).Times(1);
+
+ // PTU has RequestTypes as [] - means 'all allowed'
+ Json::Value root = GetPTU("json/PTU2.json");
+
+ // Setting device consent to 'true' in order to have appropriate application
+ // permissions, request type etc.
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .WillRepeatedly(Return(device_id_1_));
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+
+ // Get App Request Types from PTU
+ ptu_request_types_ =
+ root["policy_table"]["app_policies"][app_id]["RequestType"];
+ ptu_request_types_size_ = ptu_request_types_.size();
+
+ pt_request_types_.clear();
+ // Get RequestTypes from <app_id> section of app policies after PT update
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(app_id);
+
+ // Check sizes of Request types of PT and PTU
+ ASSERT_EQ(ptu_request_types_size_, pt_request_types_.size());
+
+ ::policy::AppPermissions permissions =
+ policy_manager_->GetAppPermissionsChanges(app_id);
+ EXPECT_TRUE(permissions.requestTypeChanged);
+
+ ::policy::StringArray result;
+ for (uint32_t i = 0; i < ptu_request_types_size_; ++i) {
+ result.push_back(ptu_request_types_[i].asString());
+ }
+ std::sort(pt_request_types_.begin(), pt_request_types_.end());
+ std::sort(result.begin(), result.end());
+ // Checks
+ ASSERT_EQ(pt_request_types_.size(), result.size());
+ EXPECT_TRUE(std::equal(
+ pt_request_types_.begin(), pt_request_types_.end(), result.begin()));
+}
+
+TEST_F(PolicyManagerImplTest2, AddDevice_RegisterDevice_TRUE) {
+ const std::string connection_type = "Bluetooth";
+
+ const bool result =
+ (policy_manager_->GetCache())->AddDevice(device_id_1_, connection_type);
+ // Get Policy table
+ const utils::SharedPtr<policy_table::Table> policy_table =
+ policy_manager_->GetCache()->GetPT();
+ // Get preloaded_pt flag from Policy table
+ const bool is_preloaded_pt =
+ *policy_table->policy_table.module_config.preloaded_pt;
+ // Get connection_type from policy_table
+ const policy_table::DeviceParams& params =
+ (*policy_table->policy_table.device_data)[device_id_1_];
+ const std::string expected_connection_type = *params.connection_type;
+
+ // Expect
+ EXPECT_EQ(connection_type, expected_connection_type);
+ // After adding device preloaded_pt must be false
+ EXPECT_FALSE(is_preloaded_pt);
+ EXPECT_TRUE(result);
+}
+
+} // namespace policy
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc
new file mode 100644
index 0000000000..2f1cc5a9d3
--- /dev/null
+++ b/src/components/policy/policy_external/test/policy_manager_impl_stress_test.cc
@@ -0,0 +1,293 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include <fstream>
+#include "mock_policy_listener.h"
+#include "policy/policy_manager_impl.h"
+
+using ::testing::_;
+using ::policy::PolicyManagerImpl;
+using ::policy::BinaryMessage;
+using ::policy::MockPolicyListener;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+class PolicyManagerImplStressTest : public ::testing::Test {
+ protected:
+ static const std::string kNameFile;
+ 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;
+ static MockPolicyListener* mock_listener;
+
+ static void SetUpTestCase();
+ static void TearDownTestCase();
+ static void CreateTable(std::ofstream& ofs);
+ static void CreateGroups(std::ofstream& ofs);
+ static void CreateFuncs(std::ofstream& ofs);
+ static void CreateApps(std::ofstream& ofs);
+ static void CreateAppGroups(std::ofstream& ofs);
+};
+
+const std::string PolicyManagerImplStressTest::kNameFile =
+ "sdl_preloaded_pt.json";
+PolicyManagerImpl* PolicyManagerImplStressTest::manager = 0;
+MockPolicyListener* PolicyManagerImplStressTest::mock_listener = 0;
+
+void PolicyManagerImplStressTest::SetUpTestCase() {
+ std::ofstream ofs;
+ ofs.open(kNameFile.c_str(), std::ofstream::out);
+ CreateTable(ofs);
+ ofs.close();
+
+ manager = new PolicyManagerImpl();
+ mock_listener = new MockPolicyListener();
+ manager->set_listener(mock_listener);
+
+ ASSERT_TRUE(manager->InitPT(kNameFile));
+}
+
+void PolicyManagerImplStressTest::TearDownTestCase() {
+ delete manager;
+ delete mock_listener;
+ remove(kNameFile.c_str());
+#ifndef __QNX__
+ remove("policy.sqlite");
+#endif // __QNX__
+}
+
+void PolicyManagerImplStressTest::CreateGroups(std::ofstream& ofs) {
+ std::stringstream ss;
+ std::string number;
+ for (int i = 0; i < kNumberGroups - 1; ++i) {
+ ss << i << std::endl;
+ ss >> number;
+ ofs << "\"Group-" << number << "\":{\n \t\"rpcs\":{\n";
+ CreateFuncs(ofs);
+ ofs << "} },\n";
+ }
+ ss << kNumberGroups - 1 << std::endl;
+ ss >> number;
+ ofs << "\"Group-" << number << "\":{\n \t\"rpcs\":{\n";
+ CreateFuncs(ofs);
+ ofs << "} }\n";
+}
+
+void PolicyManagerImplStressTest::CreateFuncs(std::ofstream& ofs) {
+ std::string func =
+ "{\n"
+ "\t\t\"hmi_levels\":["
+ "\"BACKGROUND\","
+ "\"FULL\","
+ "\"LIMITED\""
+ "]"
+ "}";
+
+ std::stringstream ss;
+ std::string number;
+ for (int i = 0; i < kNumberFuncs - 1; ++i) {
+ ss << i << std::endl;
+ ss >> number;
+ ofs << "\t\"Func-" << number << "\":" << func << ",\n";
+ }
+ ss << kNumberFuncs - 1 << std::endl;
+ ss >> number;
+ ofs << "\t\"Func-" << number << "\":" + func;
+}
+
+void PolicyManagerImplStressTest::CreateApps(std::ofstream& ofs) {
+ ofs << "\"default\":{\n";
+ ofs << "\"keep_context\": true,\n"
+ "\"steal_focus\": true,\n"
+ "\"priority\": \"NORMAL\",\n"
+ "\"default_hmi\": \"FULL\",\n";
+ ofs << "\"groups\":["
+ "\"Group-1\""
+ "]"
+ "},\n";
+
+ std::stringstream ss;
+ std::string number;
+ for (int i = 0; i < kNumberApps - 1; ++i) {
+ ss << i << std::endl;
+ ss >> number;
+ 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 << "\" : {";
+ ofs << "\n\"keep_context\": true,\n"
+ "\"steal_focus\": true,\n"
+ "\"priority\": \"NORMAL\",\n"
+ "\"default_hmi\": \"FULL\",\n";
+
+ ofs << "\"groups\": ";
+ CreateAppGroups(ofs);
+ ofs << "}\n";
+}
+
+void PolicyManagerImplStressTest::CreateAppGroups(std::ofstream& ofs) {
+ ofs << "[";
+
+ std::stringstream ss;
+ std::string number;
+ std::set<int> app_groups;
+ for (int i = 0; i < kNumberAppGroups; ++i) {
+ app_groups.insert(rand() % kNumberGroups);
+ }
+
+ std::set<int>::const_iterator i = app_groups.begin();
+ ss << *i << std::endl;
+ ss >> number;
+ ofs << "\"Group-" << number << "\"";
+ ++i;
+ for (; i != app_groups.end(); ++i) {
+ ss << *i << std::endl;
+ ss >> number;
+ ofs << ",\"Group-" << number << "\"";
+ }
+ ofs << "]\n";
+}
+
+void PolicyManagerImplStressTest::CreateTable(std::ofstream& ofs) {
+ ofs << "{"
+ "\"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\""
+ "]\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\":{\n"
+ "\t\"version\":\"001.001.001\",\n"
+ "\t\"messages\":{} },\n"
+ "\"functional_groupings\":{\n";
+
+ CreateGroups(ofs);
+
+ ofs << "}, \"app_policies\":{";
+
+ CreateApps(ofs);
+
+ ofs << "} } }";
+}
+
+TEST_F(PolicyManagerImplStressTest,
+ OneCheck_AppAndFunctuionExisting_RpcAllowed) {
+ EXPECT_CALL(*mock_listener, OnCurrentDeviceIdUpdateRequired(_));
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ manager->CheckPermissions("2", "FULL", "Func-1", input_params, output);
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+}
+
+TEST_F(PolicyManagerImplStressTest, NoApp_AppDoesNotExisted_RpcDissallowed) {
+ EXPECT_CALL(*mock_listener, OnCurrentDeviceIdUpdateRequired(_));
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ manager->CheckPermissions("150", "FULL", "Func-88", input_params, output);
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+}
+
+TEST_F(PolicyManagerImplStressTest, NoFunc_FuncDoesNotExisted_RpcDissallowed) {
+ EXPECT_CALL(*mock_listener, OnCurrentDeviceIdUpdateRequired(_)).Times(1);
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ manager->CheckPermissions("2", "FULL", "Func-400", input_params, output);
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+}
+
+TEST_F(PolicyManagerImplStressTest, NoHmi_HMIInLevelNone_RpcDissallowed) {
+ EXPECT_CALL(*mock_listener, OnCurrentDeviceIdUpdateRequired(_));
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ manager->CheckPermissions("2", "NONE", "Func-88", input_params, output);
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+}
+
+TEST_F(PolicyManagerImplStressTest,
+ FewChecks_CheckSeveralFunctions_RpcAllowed) {
+ EXPECT_CALL(*mock_listener, OnCurrentDeviceIdUpdateRequired(_))
+ .Times(kNumberFuncs);
+ const int kNumberOfCheckings = kNumberFuncs; // 100;
+ std::stringstream ss;
+ int app, func;
+ std::string app_number, func_number;
+ for (int i = 0; i < kNumberOfCheckings; ++i) {
+ app = rand() % kNumberApps;
+ func = rand() % kNumberFuncs;
+ ss << app << std::endl;
+ ss >> app_number;
+ ss << func << std::endl;
+ ss >> func_number;
+
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ manager->CheckPermissions(
+ app_number, "FULL", "Func-" + func_number, input_params, output);
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ }
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
new file mode 100644
index 0000000000..f4e922e647
--- /dev/null
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc
@@ -0,0 +1,1127 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <fstream>
+
+#include "json/reader.h"
+#include "gtest/gtest.h"
+#include <utility>
+
+#include "policy/policy_manager_impl_test_base.h"
+#include "utils/make_shared.h"
+#include "utils/shared_ptr.h"
+
+using ::testing::_;
+using ::testing::Return;
+using ::testing::SetArgReferee;
+using ::testing::AtLeast;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+TEST_F(
+ PolicyManagerImplTest,
+ RefreshRetrySequence_SetSecondsBetweenRetries_ExpectRetryTimeoutSequenceWithSameSeconds) {
+ // Arrange
+ std::vector<int> seconds;
+ seconds.push_back(50);
+ seconds.push_back(100);
+ seconds.push_back(200);
+
+ // Assert
+ EXPECT_CALL(*cache_manager_, TimeoutResponse()).WillOnce(Return(60));
+ EXPECT_CALL(*cache_manager_, SecondsBetweenRetries(_))
+ .WillOnce(DoAll(SetArgReferee<0>(seconds), Return(true)));
+
+ // Act
+ policy_manager_->RefreshRetrySequence();
+
+ // Assert
+ EXPECT_EQ(50, policy_manager_->NextRetryTimeout());
+ EXPECT_EQ(100, policy_manager_->NextRetryTimeout());
+ EXPECT_EQ(200, policy_manager_->NextRetryTimeout());
+ EXPECT_EQ(0, policy_manager_->NextRetryTimeout());
+}
+
+TEST_F(PolicyManagerImplTest, GetNotificationsNumber) {
+ std::string priority = "EMERGENCY";
+ uint32_t notif_number = 100;
+ EXPECT_CALL(*cache_manager_, GetNotificationsNumber(priority))
+ .WillOnce(Return(notif_number));
+
+ EXPECT_EQ(notif_number, policy_manager_->GetNotificationsNumber(priority));
+}
+
+TEST_F(PolicyManagerImplTest, IncrementGlobalCounter) {
+ // Assert
+ EXPECT_CALL(*cache_manager_, Increment(usage_statistics::SYNC_REBOOTS));
+ policy_manager_->Increment(usage_statistics::SYNC_REBOOTS);
+}
+
+TEST_F(PolicyManagerImplTest, IncrementAppCounter) {
+ // Assert
+ EXPECT_CALL(*cache_manager_,
+ Increment("12345", usage_statistics::USER_SELECTIONS));
+ policy_manager_->Increment("12345", usage_statistics::USER_SELECTIONS);
+}
+
+TEST_F(PolicyManagerImplTest, SetAppInfo) {
+ // Assert
+ EXPECT_CALL(*cache_manager_,
+ Set("12345", usage_statistics::LANGUAGE_GUI, "de-de"));
+ policy_manager_->Set("12345", usage_statistics::LANGUAGE_GUI, "de-de");
+}
+
+TEST_F(PolicyManagerImplTest, AddAppStopwatch) {
+ // Assert
+ EXPECT_CALL(*cache_manager_,
+ Add("12345", usage_statistics::SECONDS_HMI_FULL, 30));
+ policy_manager_->Add("12345", usage_statistics::SECONDS_HMI_FULL, 30);
+}
+
+TEST_F(PolicyManagerImplTest, ResetPT) {
+ EXPECT_CALL(*cache_manager_, ResetPT("filename"))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*cache_manager_, IsPTPreloaded())
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*cache_manager_, ResetCalculatedPermissions()).Times(AtLeast(1));
+ EXPECT_CALL(*cache_manager_, TimeoutResponse());
+ EXPECT_CALL(*cache_manager_, SecondsBetweenRetries(_));
+
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ EXPECT_TRUE(policy_manager_->ResetPT("filename"));
+ EXPECT_TRUE(cache->IsPTPreloaded());
+ EXPECT_FALSE(policy_manager_->ResetPT("filename"));
+ EXPECT_FALSE(cache->IsPTPreloaded());
+}
+
+TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
+ // Arrange
+ EXPECT_CALL(*cache_manager_, DaysBeforeExchange(_))
+ .WillOnce(Return(kNonZero));
+ policy_manager_->ForcePTExchange();
+ policy_manager_->SetSendOnUpdateFlags(true, false);
+ policy_manager_->OnUpdateStarted();
+ Json::Value table = createPTforLoad();
+
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+
+ // Assert
+ ASSERT_TRUE(IsValid(update));
+
+ EXPECT_CALL(*cache_manager_, GetHMIAppTypeAfterUpdate(_)).Times(AtLeast(1));
+
+ // 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);
+ // Assert
+ EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(snapshot));
+ EXPECT_CALL(*cache_manager_, ApplyUpdate(_)).WillOnce(Return(true));
+ EXPECT_CALL(listener_, GetAppName("1234"))
+ .WillOnce(Return(custom_str::CustomString("")));
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(_));
+ EXPECT_CALL(*cache_manager_, SaveUpdateRequired(false));
+ EXPECT_CALL(*cache_manager_, TimeoutResponse());
+ EXPECT_CALL(*cache_manager_, SecondsBetweenRetries(_));
+
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_CALL(*cache_manager_, IsPTPreloaded());
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ KmsChanged_SetExceededKms_ExpectCorrectSchedule) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ::policy::Counters counter = ::policy::Counters::KILOMETERS;
+ policy_manager_->PTUpdatedAt(counter, 50000);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Set kms changed but not exceed limit
+ policy_manager_->KmsChanged(51500);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Set kms changed and exceed limit
+ policy_manager_->KmsChanged(52500);
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2, ForcePTExchange_ExpectUpdateNeeded) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+ // Force OT Exchange
+ policy_manager_->ForcePTExchange();
+ // Check update required
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2, OnSystemReady) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ // Check
+ EXPECT_CALL(listener_, OnSystemInfoUpdateRequired());
+ policy_manager_->OnSystemReady();
+}
+
+TEST_F(PolicyManagerImplTest2, ResetRetrySequence) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->ResetRetrySequence();
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
+ policy_manager_->SetSendOnUpdateFlags(false, false);
+ policy_manager_->OnUpdateStarted();
+ EXPECT_EQ("UPDATING", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
+ // Arrange
+ std::ifstream ifile(preloaded_pt_filename_);
+ Json::Reader reader;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ Json::Value seconds_between_retries = Json::Value(Json::arrayValue);
+ seconds_between_retries =
+ root["policy_table"]["module_config"]["seconds_between_retries"];
+ uint32_t size = seconds_between_retries.size();
+ CreateLocalPT(preloaded_pt_filename_);
+ for (uint32_t i = 0; i < size; ++i) {
+ EXPECT_EQ(seconds_between_retries[i],
+ policy_manager_->NextRetryTimeout());
+ }
+ }
+}
+
+TEST_F(PolicyManagerImplTest2, TimeOutExchange) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ // Check value taken from PT
+ EXPECT_EQ(70000u, policy_manager_->TimeoutExchangeMSec());
+}
+
+TEST_F(PolicyManagerImplTest,
+ RequestPTUpdate_SetPT_GeneratedSnapshotAndPTUpdate) {
+ Json::Value table = createPTforLoad();
+ utils::SharedPtr<policy_table::Table> p_table =
+ utils::MakeShared<policy_table::Table>(&table);
+ ASSERT_TRUE(p_table);
+ p_table->SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ EXPECT_TRUE(IsValid(*p_table));
+
+ EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _));
+ EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(p_table));
+
+ policy_manager_->RequestPTUpdate();
+}
+
+TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) {
+ utils::SharedPtr<policy_table::Table> p_table =
+ utils::MakeShared<policy_table::Table>();
+ ASSERT_TRUE(p_table);
+ EXPECT_FALSE(IsValid(*p_table));
+
+ EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
+ EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(p_table));
+
+ policy_manager_->RequestPTUpdate();
+}
+
+TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidSnapshot_PTUpdateFail) {
+ utils::SharedPtr<policy_table::Table> p_table;
+ EXPECT_FALSE(p_table);
+
+ EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0);
+ EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(p_table));
+
+ policy_manager_->RequestPTUpdate();
+}
+
+TEST_F(PolicyManagerImplTest, ResetUserConsent_ResetOnlyOnce) {
+ EXPECT_CALL(*cache_manager_, ResetUserConsent())
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+
+ EXPECT_TRUE(policy_manager_->ResetUserConsent());
+ EXPECT_FALSE(policy_manager_->ResetUserConsent());
+}
+
+TEST_F(PolicyManagerImplTest2, GetPolicyTableStatus_ExpectUpToDate) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ // Check
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest,
+ SetUpdateStarted_GetPolicyTableStatus_Expect_Updating) {
+ // Arrange
+ policy_manager_->ForcePTExchange();
+ EXPECT_CALL(*cache_manager_, SaveUpdateRequired(true));
+ policy_manager_->OnUpdateStarted();
+ // Check
+ EXPECT_EQ("UPDATING", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ RetrySequenceDelaysSeconds_Expect_CorrectValues) {
+ // Arrange
+ std::ifstream ifile(preloaded_pt_filename_);
+ Json::Reader reader;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ Json::Value seconds_between_retries = Json::Value(Json::arrayValue);
+ seconds_between_retries =
+ root["policy_table"]["module_config"]["seconds_between_retries"];
+ uint32_t size = seconds_between_retries.size();
+ CreateLocalPT(preloaded_pt_filename_);
+ std::vector<int> delaySecs = policy_manager_->RetrySequenceDelaysSeconds();
+ // Check
+ ASSERT_EQ(size, delaySecs.size());
+ for (uint32_t i = 0; i < size; ++i) {
+ EXPECT_EQ(seconds_between_retries[i], delaySecs[i]);
+ }
+ }
+}
+
+TEST_F(PolicyManagerImplTest2,
+ OnExceededTimeout_GetPolicyTableStatus_ExpectUpdateNeeded) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->ForcePTExchange();
+ policy_manager_->OnExceededTimeout();
+ // Check
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest, MarkUnpairedDevice) {
+ // Assert
+ EXPECT_CALL(*cache_manager_, SetUnpairedDevice(unpaired_device_id_, true))
+ .WillOnce(Return(true));
+ EXPECT_CALL(*cache_manager_, SetDeviceConsent(unpaired_device_id_, false));
+ EXPECT_CALL(*cache_manager_,
+ HasDeviceSpecifiedConsent(unpaired_device_id_, false))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*cache_manager_, IgnitionCyclesBeforeExchange());
+ EXPECT_CALL(*cache_manager_, DaysBeforeExchange(_));
+ // Act
+ policy_manager_->MarkUnpairedDevice(unpaired_device_id_);
+}
+
+TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
+ // Arrange
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_)).Times(1);
+ EXPECT_EQ("", policy_manager_->GetCurrentDeviceId(app_id_2_));
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusWhileAppExists_ExpectUserConsentsUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
+
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ // Checking groups consents before setting ExternalConsent status
+ const policy_table::DeviceData::const_iterator device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != device_data);
+
+ const UserConsentRecords::const_iterator updated_consent_records =
+ device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(device_data->second.user_consent_records->end() !=
+ updated_consent_records);
+
+ const ConsentGroups::const_iterator group_1 =
+ updated_consent_records->second.consent_groups->find(group_name_1_);
+ EXPECT_TRUE(updated_consent_records->second.consent_groups->end() != group_1);
+
+ EXPECT_EQ(Boolean(true), group_1->second);
+
+ const ConsentGroups::const_iterator group_2 =
+ updated_consent_records->second.consent_groups->find(group_name_2_);
+
+ EXPECT_TRUE(updated_consent_records->second.consent_groups->end() != group_2);
+
+ EXPECT_EQ(Boolean(false), group_2->second);
+
+ const ConsentGroups::const_iterator group_3 =
+ updated_consent_records->second.consent_groups->find(group_name_3_);
+
+ EXPECT_FALSE(updated_consent_records->second.consent_groups->end() !=
+ group_3);
+
+ // Act - setting new ExternalConsent status
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ // Checking groups consent after setting ExternalConsent status
+ EXPECT_EQ(Boolean(false), group_1->second);
+ EXPECT_EQ(Boolean(true), group_2->second);
+
+ // Check, that no consent has been added for third groups
+ const ConsentGroups::const_iterator updated_group_3 =
+ updated_consent_records->second.consent_groups->find(group_name_3_);
+
+ EXPECT_FALSE(updated_consent_records->second.consent_groups->end() !=
+ updated_group_3);
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusWhileAppExists_ExpectExternalConsentUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
+
+ // Act
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ // Checking ExternalConsent consents before setting new ExternalConsent status
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(updated_device_data->second.user_consent_records->end() !=
+ updated_consent_records);
+
+ EXPECT_TRUE(
+ updated_consent_records->second.external_consent_status_groups->empty());
+
+ // Act - setting new ExternalConsent status
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ const ConsentGroups& external_consent_statuss =
+ *updated_consent_records->second.external_consent_status_groups;
+
+ const ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_statuss.size());
+
+ const ConsentGroups::const_iterator updated_group_1 =
+ external_consent_statuss.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_1);
+
+ const ConsentGroups::const_iterator updated_group_2 =
+ external_consent_statuss.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_2);
+
+ EXPECT_EQ(Boolean(false), updated_group_1->second);
+ EXPECT_EQ(Boolean(true), updated_group_2->second);
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusNewAppAddedAfterward_ExpectExternalConsentUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppPolicy();
+
+ // Act
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_FALSE(pt->policy_table.device_data->end() != updated_device_data);
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Check ExternalConsent consents for application
+ updated_device_data = pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ const ConsentGroups& external_consent_statuss =
+ *updated_consent_records->second.external_consent_status_groups;
+
+ ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ app_parameters = pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_statuss.size());
+
+ ConsentGroups::const_iterator updated_group_1 =
+ external_consent_statuss.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_1);
+
+ ConsentGroups::const_iterator updated_group_2 =
+ external_consent_statuss.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_2);
+
+ EXPECT_EQ(Boolean(false), updated_group_1->second);
+ EXPECT_EQ(Boolean(true), updated_group_2->second);
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusNewAppAddedAfterward_ExpectUserConsentsUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppPolicy();
+
+ // Act
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_FALSE(pt->policy_table.device_data->end() != updated_device_data);
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ updated_device_data = pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(updated_device_data->second.user_consent_records->end() !=
+ updated_consent_records);
+
+ const ConsentGroups& external_consent_statuss =
+ *updated_consent_records->second.consent_groups;
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_statuss.size());
+
+ ConsentGroups::const_iterator updated_group_1 =
+ external_consent_statuss.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_1);
+
+ ConsentGroups::const_iterator updated_group_2 =
+ external_consent_statuss.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_2);
+
+ EXPECT_EQ(Boolean(false), updated_group_1->second);
+ EXPECT_EQ(Boolean(true), updated_group_2->second);
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusNewAppPromotedAfterward_ExpectUserConsentsUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ CreateLocalPT(preloaded_pt_filename_);
+ Table t = PreparePTWithGroupsHavingExternalConsent();
+
+ EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillOnce(Return(device_id_1_)) // registered
+ .WillOnce(Return("")) // not registered
+ .WillRepeatedly(Return(device_id_1_)); // again registered
+
+ // First register w/o app having groups to consent
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Act
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_FALSE(pt->policy_table.device_data->end() != updated_device_data);
+
+ ApplicationParams app_params;
+ app_params.groups.push_back(group_name_1_);
+ app_params.groups.push_back(group_name_2_);
+
+ t.policy_table.app_policies_section.apps.insert(
+ std::make_pair(app_id_1_, app_params));
+
+ // Adding application groups to consent, will be pending untill next
+ // registration
+ EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
+
+ // Second time register w/ app having groups to consent
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ updated_device_data = pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(updated_device_data->second.user_consent_records->end() !=
+ updated_consent_records);
+
+ const ConsentGroups& external_consent_statuss =
+ *updated_consent_records->second.consent_groups;
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_statuss.size());
+
+ ConsentGroups::const_iterator updated_group_1 =
+ external_consent_statuss.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_1);
+
+ ConsentGroups::const_iterator updated_group_2 =
+ external_consent_statuss.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_2);
+
+ EXPECT_EQ(Boolean(false), updated_group_1->second);
+ EXPECT_EQ(Boolean(true), updated_group_2->second);
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusNewAppPromotedAfterward_ExpectExternalConsentUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ CreateLocalPT(preloaded_pt_filename_);
+ Table t = PreparePTWithGroupsHavingExternalConsent();
+
+ EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillOnce(Return(device_id_1_)) // registered
+ .WillOnce(Return("")) // not registered
+ .WillRepeatedly(Return(device_id_1_)); // registered again
+
+ // First register w/o app having groups to consent
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Act
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_FALSE(pt->policy_table.device_data->end() != updated_device_data);
+
+ ApplicationParams app_params;
+ app_params.groups.push_back(group_name_1_);
+ app_params.groups.push_back(group_name_2_);
+
+ t.policy_table.app_policies_section.apps.insert(
+ std::make_pair(app_id_1_, app_params));
+
+ // Adding application groups to consent, will be pending i.e. not consented
+ // yet, untill next registration
+ EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
+
+ // Second time register w/ app having groups to consent
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Check ExternalConsent consents for application
+ updated_device_data = pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ const ConsentGroups& external_consent_statuss =
+ *updated_consent_records->second.external_consent_status_groups;
+
+ ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ app_parameters = pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_statuss.size());
+
+ ConsentGroups::const_iterator updated_group_1 =
+ external_consent_statuss.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_1);
+
+ ConsentGroups::const_iterator updated_group_2 =
+ external_consent_statuss.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != updated_group_2);
+
+ EXPECT_EQ(Boolean(false), updated_group_1->second);
+ EXPECT_EQ(Boolean(true), updated_group_2->second);
+}
+
+TEST_F(PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_PTUWithNewGroups_ExpectExternalConsentUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
+
+ const uint32_t type_4 = 6u;
+ const uint32_t id_4 = 7u;
+ const std::string group_name_4 = "NewGroup";
+
+ // ExternalConsent status has new group, which is not yet assigned to any
+ // application
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_4, id_4, kStatusOn));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ // Check ExternalConsent consents for application
+ policy_table::DeviceData::const_iterator initial_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != initial_device_data);
+
+ UserConsentRecords::const_iterator initial_consent_records =
+ initial_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(initial_device_data->second.user_consent_records->end() !=
+ initial_consent_records);
+
+ const ConsentGroups& external_consent_statuss =
+ *initial_consent_records->second.external_consent_status_groups;
+
+ ConsentGroups::const_iterator group_1 =
+ external_consent_statuss.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != group_1);
+
+ ConsentGroups::const_iterator group_2 =
+ external_consent_statuss.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_statuss.end() != group_2);
+
+ ConsentGroups::const_iterator group_4 =
+ external_consent_statuss.find(group_name_4);
+
+ EXPECT_FALSE(external_consent_statuss.end() != group_4);
+
+ // Consents for known groups have been done
+ EXPECT_EQ(Boolean(false), group_1->second);
+ EXPECT_EQ(Boolean(true), group_2->second);
+
+ ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ app_parameters = pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_statuss.size());
+
+ const std::string ptu_json =
+ PreparePTUWithNewGroup(type_4, id_4, group_name_4);
+
+ const BinaryMessage msg(ptu_json.begin(), ptu_json.end());
+
+ ON_CALL(listener_, GetRegisteredLinks(_)).WillByDefault(Return());
+
+ EXPECT_CALL(listener_, OnCertificateUpdated(_));
+
+ EXPECT_TRUE(policy_manager_->LoadPT("DummyFileName", msg));
+
+ pt = policy_manager_->GetCache()->GetPT();
+
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(updated_device_data->second.user_consent_records->end() !=
+ updated_consent_records);
+
+ const ConsentGroups& updated_external_consent_statuss =
+ *updated_consent_records->second.external_consent_status_groups;
+
+ group_1 = updated_external_consent_statuss.find(group_name_1_);
+
+ EXPECT_TRUE(updated_external_consent_statuss.end() != group_1);
+
+ group_2 = updated_external_consent_statuss.find(group_name_2_);
+
+ EXPECT_TRUE(updated_external_consent_statuss.end() != group_2);
+
+ group_4 = updated_external_consent_statuss.find(group_name_4);
+
+ EXPECT_TRUE(updated_external_consent_statuss.end() != group_4);
+
+ EXPECT_EQ(Boolean(false), group_1->second);
+ EXPECT_EQ(Boolean(true), group_2->second);
+ EXPECT_EQ(Boolean(false), group_4->second);
+
+ app_parameters = pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_statuss.size());
+}
+
+TEST_F(PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_PTUWithNewGroups_ExpectUserConsentsUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
+
+ const uint32_t type_4 = 6u;
+ const uint32_t id_4 = 7u;
+ const std::string group_name_4 = "NewGroup";
+
+ ExternalConsentStatus status;
+ status.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status.insert(ExternalConsentStatusItem(type_4, id_4, kStatusOn));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ // Check ExternalConsent consents for application
+ policy_table::DeviceData::const_iterator initial_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != initial_device_data);
+
+ UserConsentRecords::const_iterator initial_consent_records =
+ initial_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(initial_device_data->second.user_consent_records->end() !=
+ initial_consent_records);
+
+ const ConsentGroups& user_consents =
+ *initial_consent_records->second.consent_groups;
+
+ ConsentGroups::const_iterator group_1 = user_consents.find(group_name_1_);
+
+ EXPECT_TRUE(user_consents.end() != group_1);
+
+ ConsentGroups::const_iterator group_2 = user_consents.find(group_name_2_);
+
+ EXPECT_TRUE(user_consents.end() != group_2);
+
+ ConsentGroups::const_iterator group_4 = user_consents.find(group_name_4);
+
+ EXPECT_FALSE(user_consents.end() != group_4);
+
+ EXPECT_EQ(Boolean(false), group_1->second);
+ EXPECT_EQ(Boolean(true), group_2->second);
+
+ ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ app_parameters = pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(), user_consents.size());
+
+ const std::string ptu_json =
+ PreparePTUWithNewGroup(type_4, id_4, group_name_4);
+
+ const BinaryMessage msg(ptu_json.begin(), ptu_json.end());
+
+ ON_CALL(listener_, GetRegisteredLinks(_)).WillByDefault(Return());
+
+ EXPECT_CALL(listener_, OnCertificateUpdated(_));
+
+ EXPECT_TRUE(policy_manager_->LoadPT("DummyFileName", msg));
+
+ pt = policy_manager_->GetCache()->GetPT();
+
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(updated_device_data->second.user_consent_records->end() !=
+ updated_consent_records);
+
+ const ConsentGroups& updated_user_consents =
+ *updated_consent_records->second.consent_groups;
+
+ group_1 = updated_user_consents.find(group_name_1_);
+
+ EXPECT_TRUE(updated_user_consents.end() != group_1);
+
+ group_2 = updated_user_consents.find(group_name_2_);
+
+ EXPECT_TRUE(updated_user_consents.end() != group_2);
+
+ group_4 = updated_user_consents.find(group_name_4);
+
+ EXPECT_TRUE(updated_user_consents.end() != group_4);
+
+ EXPECT_EQ(Boolean(false), group_1->second);
+ EXPECT_EQ(Boolean(true), group_2->second);
+ EXPECT_EQ(Boolean(false), group_4->second);
+
+ app_parameters = pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(), user_consents.size());
+}
+
+TEST_F(
+ PolicyManagerImplTest_ExternalConsent,
+ ExternalConsent_SetExternalConsentStatusTurnOnThanOff_ExpectExternalConsentUpdateForApp) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ PreconditionExternalConsentPreparePTWithAppGroupsAndConsents();
+
+ // Act
+ utils::SharedPtr<policy_table::Table> pt =
+ policy_manager_->GetCache()->GetPT();
+
+ // Checking ExternalConsent consents before setting new ExternalConsent status
+ policy_table::DeviceData::const_iterator updated_device_data =
+ pt->policy_table.device_data->find(device_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.device_data->end() != updated_device_data);
+
+ UserConsentRecords::const_iterator updated_consent_records =
+ updated_device_data->second.user_consent_records->find(app_id_1_);
+
+ EXPECT_TRUE(updated_device_data->second.user_consent_records->end() !=
+ updated_consent_records);
+
+ EXPECT_TRUE(
+ updated_consent_records->second.external_consent_status_groups->empty());
+
+ // Act - setting new ExternalConsent status
+ ExternalConsentStatus status_on;
+ status_on.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOn));
+ status_on.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOn));
+ status_on.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOn));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _));
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status_on));
+
+ // Checking ExternalConsent consents after setting new ExternalConsent status
+ const ConsentGroups& external_consent_status =
+ *updated_consent_records->second.external_consent_status_groups;
+
+ ApplicationPolicies::const_iterator app_parameters =
+ pt->policy_table.app_policies_section.apps.find(app_id_1_);
+
+ EXPECT_TRUE(pt->policy_table.app_policies_section.apps.end() !=
+ app_parameters);
+
+ EXPECT_EQ(app_parameters->second.groups.size(),
+ external_consent_status.size());
+
+ ConsentGroups::const_iterator updated_group_1 =
+ external_consent_status.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_status.end() != updated_group_1);
+
+ ConsentGroups::const_iterator updated_group_2 =
+ external_consent_status.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_status.end() != updated_group_2);
+
+ EXPECT_EQ(Boolean(false), updated_group_1->second);
+ EXPECT_EQ(Boolean(true), updated_group_2->second);
+
+ // Switching ExternalConsent status off
+ ExternalConsentStatus status_off;
+ status_off.insert(ExternalConsentStatusItem(type_1_, id_1_, kStatusOff));
+ status_off.insert(ExternalConsentStatusItem(type_2_, id_2_, kStatusOff));
+ status_off.insert(ExternalConsentStatusItem(type_3_, id_3_, kStatusOff));
+
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_1_, _)).Times(1);
+
+ EXPECT_TRUE(policy_manager_->SetExternalConsentStatus(status_off));
+
+ updated_group_1 = external_consent_status.find(group_name_1_);
+
+ EXPECT_TRUE(external_consent_status.end() != updated_group_1);
+
+ updated_group_2 = external_consent_status.find(group_name_2_);
+
+ EXPECT_TRUE(external_consent_status.end() != updated_group_2);
+
+ EXPECT_EQ(Boolean(true), updated_group_1->second);
+ EXPECT_EQ(Boolean(false), updated_group_2->second);
+}
+
+} // namespace policy
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
new file mode 100644
index 0000000000..0608799535
--- /dev/null
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -0,0 +1,919 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include <fstream>
+#include <stdint.h>
+#include <vector>
+
+#include "policy/policy_manager_impl_test_base.h"
+
+#include "utils/file_system.h"
+#include "utils/make_shared.h"
+#include "utils/gen_hash.h"
+#include "json/reader.h"
+
+#include "policy/mock_pt_ext_representation.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::ContainerEq;
+using ::testing::_;
+
+// Help functions
+char GenRandomChar(char range_from, char range_to) {
+ if (range_from > range_to) {
+ std::swap(range_from, range_to);
+ }
+ const int range_size = range_to - range_from;
+ return rand() % range_size + range_from;
+}
+
+struct StringsForUpdate CreateNewRandomData(StringsForUpdate& str) {
+ // Generate random date
+ srand(time(NULL));
+ unsigned int day = 1 + rand() % 31; // Day from 1 - 31
+ unsigned int month = 1 + rand() % 12; // Month from 1 - 12
+ unsigned int year = 1985 + rand() % 31; // Year from 1985 - 2015
+
+ // Convert date to string
+ str.new_date_ = NumberToString(year) + '-' + NumberToString(month) + '-' +
+ NumberToString(day);
+
+ // Create new field
+ unsigned int number = 1 + rand() % 100; // Number from 1 - 100
+ str.new_field_name_ += NumberToString(number);
+
+ for (unsigned int i = 0; i < 5; ++i) {
+ str.new_field_value_ += GenRandomChar('A', 'Z');
+ }
+ return str;
+}
+
+void CheckIsParamInList(const ::policy::RPCParams& list,
+ const std::string& parameter) {
+ EXPECT_TRUE(std::find(list.begin(), list.end(), parameter) != list.end())
+ << "Parameter not exists: " << parameter;
+}
+
+Json::Value createPTforLoad() {
+ const std::string load_table(
+ "{"
+ "\"policy_table\": {"
+ "\"module_config\": {"
+ "\"exchange_after_x_ignition_cycles\": 10,"
+ "\"exchange_after_x_kilometers\": 100,"
+ "\"exchange_after_x_days\": 5,"
+ "\"timeout_after_x_seconds\": 500,"
+ "\"seconds_between_retries\": [10, 20, 30],"
+ "\"endpoints\": {"
+ "\"0x00\": {"
+ "\"default\": [\"http://ford.com/cloud/default\"]"
+ "}"
+ "},"
+ "\"notifications_per_minute_by_priority\": {"
+ "\"emergency\": 1,"
+ "\"navigation\": 2,"
+ "\"VOICECOMM\": 3,"
+ "\"communication\": 4,"
+ "\"normal\": 5,"
+ "\"none\": 6"
+ "},"
+ "\"vehicle_make\" : \"MakeT\","
+ "\"vehicle_model\" : \"ModelT\","
+ "\"vehicle_year\": \"2014\""
+ "},"
+ "\"app_policies\": {"
+ "\"default\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "}, "
+ "\"pre_DataConsent\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "}, "
+ "\"device\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "},"
+ "\"1234\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "}"
+ "},"
+ "\"consumer_friendly_messages\": {"
+ "\"version\": \"1.2\""
+ "},"
+ "\"functional_groupings\": {"
+ "\"default\": {"
+ "\"rpcs\": {"
+ "\"Update\": {"
+ "\"hmi_levels\": [\"FULL\"],"
+ "\"parameters\" : [\"speed\"]"
+ "}"
+ "}"
+ "}"
+ "}"
+ "}"
+ "}");
+
+ Json::Value table(Json::objectValue);
+ Json::Reader reader;
+ EXPECT_TRUE(reader.parse(load_table, table));
+ return table;
+}
+
+void InsertRpcParametersInList(::policy::RPCParams& input_params) {
+ input_params.insert("longitudeDegrees");
+ input_params.insert("latitudeDegrees");
+ input_params.insert("locationName");
+ input_params.insert("locationDescription");
+ input_params.insert("addressLines");
+ input_params.insert("phoneNumber");
+ input_params.insert("locationImage");
+ input_params.insert("deliveryMode");
+ input_params.insert("timeStamp");
+ input_params.insert("address");
+}
+
+policy_table::AppHmiTypes HmiTypes(const policy_table::AppHMIType hmi_type) {
+ policy_table::AppHmiTypes hmi_types;
+ hmi_types.push_back(hmi_type);
+ return hmi_types;
+}
+
+// PolicyManagerImplTest class methods
+PolicyManagerImplTest::PolicyManagerImplTest()
+ : unpaired_device_id_("08-00-27-CE-76-FE")
+ , policy_manager_(NULL)
+ , cache_manager_(NULL) {}
+
+void PolicyManagerImplTest::SetUp() {
+ policy_manager_ = new PolicyManagerImpl();
+ cache_manager_ = new MockCacheManagerInterface();
+ policy_manager_->set_cache_manager(cache_manager_);
+ policy_manager_->set_listener(&listener_);
+
+ ON_CALL(*cache_manager_, GetExternalConsentStatus())
+ .WillByDefault(Return(ExternalConsentStatus()));
+ ON_CALL(*cache_manager_, GetGroupsWithSameEntities(_))
+ .WillByDefault(Return(GroupsByExternalConsentStatus()));
+ ON_CALL(*cache_manager_, GetKnownLinksFromPT())
+ .WillByDefault(Return(std::map<std::string, std::string>()));
+ ON_CALL(listener_, GetRegisteredLinks(_)).WillByDefault(Return());
+}
+
+void PolicyManagerImplTest::TearDown() {
+ delete policy_manager_;
+}
+
+::testing::AssertionResult PolicyManagerImplTest::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);
+ }
+}
+
+// PolicyManagerImplTest2 class methods
+PolicyManagerImplTest2::PolicyManagerImplTest2()
+ : app_id_1_("123456789")
+ , app_id_2_("1766825573")
+ , app_id_3_("584421907")
+ , device_id_1_("XXX123456789ZZZ")
+ , device_id_2_("08-00-27-CE-76-FE")
+ , application_id_("1234")
+ , app_storage_folder_("storage_PolicyManagerImplTest2")
+ , preloaded_pt_filename_(kSdlPreloadedPtJson)
+ , in_memory_(true)
+ , policy_manager_(NULL)
+ , ptu_request_types_size_(0u)
+ , index_(0u)
+ , ptu_request_types_(Json::arrayValue) {}
+
+void PolicyManagerImplTest2::SetUp() {
+ ON_CALL(listener_, GetRegisteredLinks(_)).WillByDefault(Return());
+
+ file_system::CreateDirectory(app_storage_folder_);
+
+ policy_manager_ = new PolicyManagerImpl(in_memory_);
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(app_storage_folder_));
+ policy_manager_->set_listener(&listener_);
+ const char* levels[] = {"BACKGROUND", "FULL", "LIMITED", "NONE"};
+ hmi_level_.assign(levels, levels + sizeof(levels) / sizeof(levels[0]));
+ srand(time(NULL));
+ index_ = rand() % 3;
+}
+
+::policy::StringArray PolicyManagerImplTest2::JsonToVectorString(
+ const Json::Value& PTU_request_types) {
+ ::policy::StringArray result;
+ for (uint32_t i = 0; i < PTU_request_types.size(); ++i) {
+ result.push_back(PTU_request_types[i].asString());
+ }
+ return result;
+}
+
+const Json::Value PolicyManagerImplTest2::GetPTU(const std::string& file_name) {
+ // Get PTU
+ std::ifstream ifile(file_name);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ json = root.toStyledString();
+ }
+ ifile.close();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ // Load Json to cache
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+ return root;
+}
+
+void PolicyManagerImplTest2::CreateLocalPT(const std::string& file_name) {
+ file_system::remove_directory_content(app_storage_folder_);
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(app_storage_folder_));
+ ASSERT_TRUE(policy_manager_->InitPT(file_name, &policy_settings_));
+ EXPECT_TRUE(policy_manager_->GetCache()->IsPTPreloaded());
+}
+
+void PolicyManagerImplTest2::AddRTtoPT(const std::string& update_file_name,
+ const std::string& section_name,
+ const uint32_t rt_number,
+ const uint32_t invalid_rt_number) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ // Get RequestTypes from section of preloaded_pt app_policies
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ EXPECT_EQ(rt_number, pt_request_types_.size());
+ Json::Value root = GetPTU(update_file_name);
+ // Get Request Types from JSON (PTU)
+ ptu_request_types_ =
+ root["policy_table"]["app_policies"][section_name]["RequestType"];
+ ptu_request_types_size_ = ptu_request_types_.size();
+ pt_request_types_.clear();
+ // Get RequestTypes from section of PT app policies after update
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ // Check number of RT in PTU and PT now are equal
+ ASSERT_EQ(ptu_request_types_size_ - invalid_rt_number,
+ pt_request_types_.size());
+}
+
+void PolicyManagerImplTest2::AddRTtoAppSectionPT(
+ const std::string& update_file_name,
+ const std::string& section_name,
+ const uint32_t rt_number,
+ const uint32_t invalid_rt_number) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ // Add app
+ policy_manager_->AddApplication(section_name,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check app gets RequestTypes from pre_DataConsent of app_policies
+ // section
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ EXPECT_EQ(rt_number, pt_request_types_.size());
+ EXPECT_CALL(listener_, OnPendingPermissionChange(section_name)).Times(1);
+ Json::Value root = GetPTU(update_file_name);
+
+ // Get App Request Types from PTU
+ ptu_request_types_ =
+ root["policy_table"]["app_policies"][section_name]["RequestType"];
+ ptu_request_types_size_ = ptu_request_types_.size();
+
+ pt_request_types_.clear();
+ // Get RequestTypes from <app_id> section of app policies after PT update
+ pt_request_types_ = policy_manager_->GetAppRequestTypes(section_name);
+ // Check sizes of Request types of PT and PTU
+ ASSERT_EQ(ptu_request_types_size_ - invalid_rt_number,
+ pt_request_types_.size());
+
+ ::policy::AppPermissions permissions =
+ policy_manager_->GetAppPermissionsChanges(section_name);
+ EXPECT_TRUE(permissions.requestTypeChanged);
+}
+
+std::vector<policy_table::RequestType>
+PolicyManagerImplTest2::PushRequestTypesToContainer(
+ const ::policy::StringArray& temp_result) {
+ policy_table::RequestType filtered_result;
+ std::vector<policy_table::RequestType> final_result;
+ for (size_t i = 0; i < temp_result.size(); ++i) {
+ if (policy_table::EnumFromJsonString(temp_result[i], &filtered_result)) {
+ final_result.push_back(filtered_result);
+ }
+ }
+ return final_result;
+}
+
+void PolicyManagerImplTest2::CheckResultForValidRT() {
+ // Convert Json Array to ::policy::StringArray
+ const ::policy::StringArray& result = JsonToVectorString(ptu_request_types_);
+ // Checks
+ SortAndCheckEquality(pt_request_types_, result);
+}
+
+void PolicyManagerImplTest2::CheckResultForInvalidRT() {
+ // Convert Json Array to ::policy::StringArray
+ const ::policy::StringArray& temp_result =
+ JsonToVectorString(ptu_request_types_);
+ const std::vector<policy_table::RequestType>& result1 =
+ PushRequestTypesToContainer(temp_result);
+ const std::vector<policy_table::RequestType>& result2 =
+ PushRequestTypesToContainer(pt_request_types_);
+ // Checks
+ SortAndCheckEquality(result1, result2);
+}
+
+void PolicyManagerImplTest2::FillMultimapFromFunctionalGroupings(
+ UserConsentPromptToRpcsConnections& input_multimap,
+ policy_table::FunctionalGroupings& fg_table) {
+ policy_table::FunctionalGroupings::iterator fg_itter = fg_table.begin();
+ const policy_table::FunctionalGroupings::iterator fg_itter_end =
+ fg_table.end();
+ for (; fg_itter != fg_itter_end; ++fg_itter) {
+ // RPCS getting
+ policy_table::Rpcs& rpcs_ref = fg_itter->second;
+ // User_consent_prompt getting
+ rpc::Optional<rpc::String<1, 255> >& optional_ref =
+ rpcs_ref.user_consent_prompt;
+ rpc::String<1, 255>& ucp_string = *optional_ref;
+ const std::string& ucp_std_string =
+ static_cast<const std::string&>(ucp_string);
+ // Multimap inserting
+ input_multimap.insert(
+ std::pair<std::string, policy_table::Rpcs&>(ucp_std_string, rpcs_ref));
+ }
+}
+
+void PolicyManagerImplTest2::GetFunctionalGroupingsFromManager(
+ policy_table::FunctionalGroupings& input_functional_groupings) {
+ // Get cache
+ ::policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ // Get table_snapshot
+ utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ // Set functional groupings from policy table
+ input_functional_groupings = table->policy_table.functional_groupings;
+}
+
+void PolicyManagerImplTest2::TearDown() {
+ delete policy_manager_;
+ file_system::RemoveDirectory(app_storage_folder_, true);
+}
+
+void PolicyManagerImplTest2::ResetOutputList(
+ ::policy::CheckPermissionResult& output) {
+ // Reset output
+ output.hmi_level_permitted = ::policy::kRpcDisallowed;
+ output.list_of_allowed_params.clear();
+ output.list_of_disallowed_params.clear();
+ output.list_of_undefined_params.clear();
+}
+// To avoid duplicate test with different json files
+void PolicyManagerImplTest2::
+ CheckPermissions_AllParamsAllowed_CheckRpcsInDiffLvls(
+ const std::string& update_file) {
+ // Arrange
+ CreateLocalPT("json/sdl_preloaded_pt_send_location.json");
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache();
+ ASSERT_TRUE(cache->SetDeviceData(device_id_1_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ // Add app from consented device. App will be assigned with default policies
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Expect all parameters are allowed
+ std::ifstream ifile(update_file);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open()) {
+ reader.parse(ifile, root, true);
+ }
+ json = root.toStyledString();
+ ifile.close();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(cache->IsPTPreloaded());
+
+ // Will be called each time permissions are checked
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(application_id_))
+ .Times(4)
+ .WillRepeatedly(Return(device_id_1_));
+
+ // Check RPC in each level
+ ::policy::RPCParams input_params;
+ InsertRpcParametersInList(input_params);
+
+ ::policy::CheckPermissionResult output;
+ // Rpc in FULL level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of allowed parameters is not empty
+ EXPECT_FALSE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ ResetOutputList(output);
+
+ // Rpc in LIMITED level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelLimited, "SendLocation", input_params, output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of allowed parameters is not empty
+ EXPECT_FALSE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ ResetOutputList(output);
+
+ // Rpc in BACKGROUND level
+ policy_manager_->CheckPermissions(application_id_,
+ kHmiLevelBackground,
+ "SendLocation",
+ input_params,
+ output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of allowed parameters is not empty
+ EXPECT_FALSE(output.list_of_allowed_params.empty());
+ EXPECT_EQ(10u, output.list_of_allowed_params.size());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ // Reset output
+ ResetOutputList(output);
+
+ // Rpc in NONE level
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelNone, "SendLocation", input_params, output);
+ // Check RPC is disallowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ // Check lists of parameters are empty
+ EXPECT_TRUE(output.list_of_allowed_params.empty());
+ EXPECT_TRUE(output.list_of_disallowed_params.empty());
+ EXPECT_TRUE(output.list_of_undefined_params.empty());
+}
+
+void PolicyManagerImplTest2::CheckRpcPermissions(
+ const std::string& rpc_name, const PermitResult& expected_permission) {
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ policy_manager_->CheckPermissions(
+ application_id_, kHmiLevelFull, rpc_name, input_params, output);
+ EXPECT_EQ(expected_permission, output.hmi_level_permitted);
+}
+
+void PolicyManagerImplTest2::CheckRpcPermissions(
+ const std::string& app_id,
+ const std::string& rpc_name,
+ const policy::PermitResult& out_expected_permission) {
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+ policy_manager_->CheckPermissions(
+ app_id, kHmiLevelFull, rpc_name, input_params, output);
+ EXPECT_EQ(out_expected_permission, output.hmi_level_permitted);
+}
+
+void PolicyManagerImplTest2::EmulatePTAppRevoked(const std::string& ptu_name) {
+ std::ifstream ifile(ptu_name);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ // Emulate application is revoked
+ root["policy_table"]["app_policies"]["1234"]["is_revoked"] = 1;
+ json = root.toStyledString();
+ }
+ ifile.close();
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ ASSERT_TRUE(policy_manager_->LoadPT(kDummyUpdateFileName, msg));
+}
+
+// To avoid duplicate arrange of test
+void PolicyManagerImplTest2::AddSetDeviceData() {
+ CreateLocalPT("json/sdl_preloaded_pt_send_location.json");
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_1_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ // Add app from consented device. App will be assigned with default policies
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ (policy_manager_->GetCache())->AddDevice(device_id_1_, "Bluetooth");
+}
+
+// Load Json File and set it as PTU
+void PolicyManagerImplTest2::LoadPTUFromJsonFile(
+ const std::string& update_file) {
+ // Load Json to cache
+ std::ifstream ifile(update_file);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open()) {
+ reader.parse(ifile, root, true);
+ }
+ json = root.toStyledString();
+ ifile.close();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ EXPECT_TRUE(policy_manager_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_->GetCache()->IsPTPreloaded());
+}
+
+// PolicyManagerImplTest_RequestTypes class methods
+PolicyManagerImplTest_RequestTypes::PolicyManagerImplTest_RequestTypes()
+ : kJsonFiles{"json/PTU_with_one_invalid_requestType.json",
+ "json/PTU_with_invalid_requestType_between_correct.json",
+ "json/PTU_without_requestType_field.json",
+ "json/PTU_with_empty_requestType_array.json",
+ "json/preloadedPT_with_invalid_default_requestType.json",
+ "json/preloadedPT_with_several_invalid_default_requestTypes."
+ "json",
+ "json/"
+ "preloadedPT_with_invalid_default_reqestType_between_valid."
+ "json",
+ "json/PTU_default_app.json",
+ "json/"
+ "PTU_default_app_app_invalid_values_RequestType_array.json",
+ "json/PTU_default_app_empty_RequestType_array.json",
+ "json/PTU_default_app_omitted_RequestType_array.json",
+ "json/"
+ "PTU_default_app_one_invalid_value_RequestType_array.json",
+ "json/PTU_pre_data_consent_app.json",
+ "json/"
+ "PTU_pre_data_consent_app_invalid_values_RequestType_array."
+ "json",
+ "json/PTU_pre_data_consent_app_empty_RequestType_array.json",
+ "json/"
+ "PTU_pre_data_consent_app_omitted_RequestType_array.json",
+ "json/"
+ "PTU_pre_data_consent_app_one_invalid_value_RequestType_"
+ "array."
+ "json"}
+ , kAppId("1766825573")
+ , kDefaultAppId(policy::kDefaultId)
+ , app_storage_folder_("storage3")
+ , preloaded_pt_filename_(kSdlPreloadedPtJson) {}
+
+void PolicyManagerImplTest_RequestTypes::SetUp() {
+ ON_CALL(listener_, GetRegisteredLinks(_)).WillByDefault(Return());
+
+ file_system::CreateDirectory(app_storage_folder_);
+ const bool in_memory = true;
+ policy_manager_impl_sptr_ = utils::MakeShared<PolicyManagerImpl>(in_memory);
+ policy_manager_impl_sptr_->set_listener(&listener_);
+}
+
+const Json::Value PolicyManagerImplTest_RequestTypes::GetPTU(
+ const std::string& file_name) {
+ // Get PTU
+ std::ifstream ifile(file_name);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ json = root.toStyledString();
+ }
+ ifile.close();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ // Load Json to cache
+ EXPECT_TRUE(policy_manager_impl_sptr_->LoadPT(kFilePtUpdateJson, msg));
+ EXPECT_FALSE(policy_manager_impl_sptr_->GetCache()->IsPTPreloaded());
+ return root;
+}
+
+void PolicyManagerImplTest_RequestTypes::RefreshPT(
+ const std::string& preloaded_pt_file, const std::string& update_pt_file) {
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(app_storage_folder_));
+ ASSERT_TRUE(
+ policy_manager_impl_sptr_->InitPT(preloaded_pt_file, &policy_settings_))
+ << "can`t load preloaded file";
+ EXPECT_TRUE(policy_manager_impl_sptr_->GetCache()->IsPTPreloaded());
+ GetPTU(update_pt_file);
+}
+
+PolicyTableSPtr PolicyManagerImplTest_RequestTypes::GetPolicyTableSnapshot() {
+ // Get cache
+ ::policy::CacheManagerInterfaceSPtr cache =
+ policy_manager_impl_sptr_->GetCache();
+ // Get and return table_snapshot
+ return cache->GenerateSnapshot();
+}
+
+policy_table::RequestTypes
+PolicyManagerImplTest_RequestTypes::GetRequestTypesForApplication(
+ const std::string& app_id) {
+ // Get table_snapshot
+ PolicyTableSPtr table = GetPolicyTableSnapshot();
+ // Get request types
+ policy_table::PolicyTable& pt = table->policy_table;
+ policy_table::ApplicationPolicies& app_policies =
+ pt.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator app_iter =
+ app_policies.find(app_id);
+
+ return *(app_iter->second.RequestType);
+}
+
+void PolicyManagerImplTest_RequestTypes::CompareAppRequestTypesWithDefault(
+ const std::string& app_id, const std::string& ptu_file) {
+ // Refresh policy table with invalid RequestType in application
+ RefreshPT(preloaded_pt_filename_, ptu_file);
+
+ // Get <app_id> RequestType array
+ policy_table::RequestTypes app_request_types =
+ GetRequestTypesForApplication(app_id);
+ // Get "default" RequestType array
+ policy_table::RequestTypes default_request_types =
+ GetRequestTypesForApplication(policy::kDefaultId);
+
+ // Expect
+ const size_t app_requests_size = app_request_types.size();
+ const size_t default_requests_size = default_request_types.size();
+ ASSERT_EQ(default_requests_size, app_requests_size);
+ EXPECT_THAT(default_request_types, ContainerEq(app_request_types));
+}
+
+policy_table::RequestTypes
+PolicyManagerImplTest_RequestTypes::CreateDefaultAppPTURequestValues() {
+ policy_table::RequestTypes request_types;
+ request_types.push_back(policy_table::RequestType::RT_QUERY_APPS);
+ request_types.push_back(policy_table::RequestType::RT_LAUNCH_APP);
+ request_types.push_back(policy_table::RequestType::RT_PROPRIETARY);
+ request_types.push_back(policy_table::RequestType::RT_LOCK_SCREEN_ICON_URL);
+ return request_types;
+}
+
+policy_table::RequestTypes
+PolicyManagerImplTest_RequestTypes::CreateDefaultAppDatabaseRequestValues() {
+ policy_table::RequestTypes request_types;
+ request_types.push_back(policy_table::RequestType::RT_QUERY_APPS);
+ request_types.push_back(policy_table::RequestType::RT_LAUNCH_APP);
+ request_types.push_back(policy_table::RequestType::RT_PROPRIETARY);
+ return request_types;
+}
+
+policy_table::RequestTypes
+PolicyManagerImplTest_RequestTypes::CreatePreDataConsentAppPTURequestValues() {
+ policy_table::RequestTypes request_types;
+ request_types.push_back(policy_table::RequestType::RT_FILE_RESUME);
+ request_types.push_back(policy_table::RequestType::RT_AUTH_REQUEST);
+ request_types.push_back(policy_table::RequestType::RT_AUTH_CHALLENGE);
+ request_types.push_back(policy_table::RequestType::RT_AUTH_ACK);
+ return request_types;
+}
+
+void PolicyManagerImplTest_RequestTypes::CompareRequestTypesContainers(
+ const policy_table::RequestTypes& expected_data,
+ const policy_table::RequestTypes& received_data) {
+ const size_t received_size = received_data.size();
+ const size_t expected_size = expected_data.size();
+ ASSERT_EQ(expected_size, received_size);
+ EXPECT_THAT(expected_data, ContainerEq(received_data));
+}
+
+void PolicyManagerImplTest_RequestTypes::TearDown() {
+ file_system::RemoveDirectory(app_storage_folder_, true);
+}
+
+void PolicyManagerImplTest_ExternalConsent::
+ PreconditionExternalConsentPreparePTWithAppGroupsAndConsents() {
+ using namespace policy_table;
+ using namespace rpc;
+
+ CreateLocalPT(preloaded_pt_filename_);
+ Table t = PreparePTWithGroupsHavingExternalConsent();
+
+ ApplicationParams app_params;
+ app_params.groups.push_back(group_name_1_);
+ app_params.groups.push_back(group_name_2_);
+
+ t.policy_table.app_policies_section.apps.insert(
+ std::make_pair(app_id_1_, app_params));
+
+ EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
+
+ // User allows first group and disallows second group. Third is kept
+ // untouched.
+ PermissionConsent permissions;
+ permissions.device_id = device_id_1_;
+ permissions.policy_app_id = app_id_1_;
+
+ FunctionalGroupPermission group_permissions_1;
+ group_permissions_1.group_name = group_name_1_;
+ group_permissions_1.group_alias = group_name_1_;
+ group_permissions_1.group_id = utils::Djb2HashFromString(group_name_1_);
+ group_permissions_1.state = kGroupAllowed;
+
+ FunctionalGroupPermission group_permissions_2;
+ group_permissions_2.group_name = group_name_2_;
+ group_permissions_2.group_alias = group_name_2_;
+ group_permissions_2.group_id = utils::Djb2HashFromString(group_name_2_);
+ group_permissions_2.state = kGroupDisallowed;
+
+ permissions.group_permissions.push_back(group_permissions_1);
+ permissions.group_permissions.push_back(group_permissions_2);
+
+ policy_manager_->SetUserConsentForApp(permissions,
+ policy::PolicyManager::kSilentMode);
+}
+
+void PolicyManagerImplTest_ExternalConsent::
+ PreconditionExternalConsentPreparePTWithAppPolicy() {
+ using namespace policy_table;
+ using namespace rpc;
+
+ // PT has 3 functional groups with some entities in
+ // disallowed_by_external_consent_entities_on/off. Groups consents can be
+ // changed.
+ CreateLocalPT(preloaded_pt_filename_);
+ Table t = PreparePTWithGroupsHavingExternalConsent();
+
+ ApplicationParams app_params;
+ app_params.groups.push_back(group_name_1_);
+ app_params.groups.push_back(group_name_2_);
+
+ t.policy_table.app_policies_section.apps.insert(
+ std::make_pair(app_id_1_, app_params));
+
+ EXPECT_TRUE(policy_manager_->GetCache()->ApplyUpdate(t));
+}
+
+rpc::policy_table_interface_base::Table PolicyManagerImplTest_ExternalConsent::
+ PreparePTWithGroupsHavingExternalConsent() {
+ using namespace policy_table;
+ using namespace rpc;
+
+ // PT has 3 functional groups with some entities in
+ // disallowed_by_external_consent_entities_on/off. Groups consents can be
+ // changed.
+
+ ExternalConsentEntity entity_1(type_1_, id_1_);
+ ExternalConsentEntity entity_2(type_2_, id_2_);
+ ExternalConsentEntity entity_3(type_3_, id_3_);
+
+ Rpcs rpcs_1;
+ rpcs_1.disallowed_by_external_consent_entities_on->push_back(entity_1);
+ *rpcs_1.user_consent_prompt = group_name_1_;
+ rpcs_1.rpcs.set_to_null();
+
+ Rpcs rpcs_2;
+ rpcs_2.disallowed_by_external_consent_entities_off->push_back(entity_2);
+ *rpcs_2.user_consent_prompt = group_name_2_;
+ rpcs_2.rpcs.set_to_null();
+
+ Rpcs rpcs_3;
+ rpcs_3.disallowed_by_external_consent_entities_on->push_back(entity_3);
+ *rpcs_3.user_consent_prompt = group_name_3_;
+ rpcs_3.rpcs.set_to_null();
+
+ Table t;
+ t.policy_table.functional_groupings.insert(
+ std::make_pair(group_name_1_, rpcs_1));
+ t.policy_table.functional_groupings.insert(
+ std::make_pair(group_name_2_, rpcs_2));
+ t.policy_table.functional_groupings.insert(
+ std::make_pair(group_name_3_, rpcs_3));
+
+ return t;
+}
+
+std::string PolicyManagerImplTest_ExternalConsent::PreparePTUWithNewGroup(
+ const uint32_t type, const uint32_t id, const std::string& group_name) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ std::ifstream ifile(preloaded_pt_filename_);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ Table t = PreparePTWithGroupsHavingExternalConsent();
+
+ ExternalConsentEntity entity_4(type, id);
+
+ Rpcs rpcs_4;
+ rpcs_4.disallowed_by_external_consent_entities_on->push_back(entity_4);
+ *rpcs_4.user_consent_prompt = group_name;
+ rpcs_4.rpcs.set_to_null();
+
+ t.policy_table.functional_groupings.insert(
+ std::make_pair(group_name, rpcs_4));
+
+ ApplicationParams app_params;
+ app_params.groups.push_back(group_name_1_);
+ app_params.groups.push_back(group_name_2_);
+ app_params.groups.push_back(group_name);
+ app_params.keep_context = Boolean(true);
+ app_params.steal_focus = Boolean(true);
+ app_params.default_hmi = HL_FULL;
+ app_params.priority = P_EMERGENCY;
+
+ t.policy_table.app_policies_section.apps.insert(
+ std::make_pair(app_id_1_, app_params));
+
+ const Json::Value overriden_table = t.ToJsonValue();
+
+ const std::string policy_table_key = "policy_table";
+ const std::string functional_groupings_key = "functional_groupings";
+ const std::string app_policies_key = "app_policies";
+
+ root[policy_table_key][functional_groupings_key] =
+ overriden_table[policy_table_key][functional_groupings_key];
+
+ root[policy_table_key][app_policies_key][app_id_1_] =
+ overriden_table[policy_table_key][app_policies_key][app_id_1_];
+
+ root[policy_table_key]["module_config"].removeMember("preloaded_pt");
+ root[policy_table_key]["module_config"].removeMember("preloaded_date");
+
+ json = root.toStyledString();
+ }
+ ifile.close();
+
+ return json;
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
new file mode 100644
index 0000000000..2f2162494f
--- /dev/null
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -0,0 +1,675 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+
+#include "policy/policy_manager_impl_test_base.h"
+#include "utils/date_time.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using ::testing::_;
+using ::testing::Return;
+
+// Tests that use device without Consent
+TEST_F(
+ PolicyManagerImplTest2,
+ AddApplication_AddNewApplicationFromDeviceWithConsent_ExpectUpdateRequired) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+
+ policy_manager_->SetUserConsentForDevice(device_id_1_, true);
+
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ EXPECT_EQ("UPDATE_NEEDED", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ AddApplication_AddNewApplicationFromDeviceWithoutConsent_ExpectUpToDate) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+
+ // To set UP_TO_DATE before registration
+ GetPTU(kValidSdlPtUpdateJson);
+
+ const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const int kSecondsInDay = 60 * 60 * 24;
+ const int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+
+ policy_manager_->PTUpdatedAt(DAYS_AFTER_EPOCH, days_after_epoch);
+ policy_manager_->PTUpdatedAt(KILOMETERS, 1000);
+
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_1_))
+ .WillRepeatedly(Return(device_id_1_));
+
+ policy_manager_->SetUserConsentForDevice(device_id_1_, false);
+
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ EXPECT_EQ("UP_TO_DATE", policy_manager_->GetPolicyTableStatus());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithoutConsent_ExpectPreDataConsent) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ ASSERT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
+ policy_manager_->ReactOnUserDevConsentForApp(app_id_1_, false);
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
+}
+
+// Related to manual test APPLINK-18768
+TEST_F(PolicyManagerImplTest2,
+ CheckPreDataConsent_AppRegistered_ExpectReceivedRpcPermissionCorrect) {
+ // Arrange
+ CreateLocalPT(kSdlPreloadedPtJson2);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ policy_manager_->AddApplication(application_id_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+
+ // Expect RPCs from pre_dataConsent group are allowed
+ // Next checks are equal to BaseBeforeDataConsent_APIs.xml checks from task
+ CheckRpcPermissions("ListFiles", ::policy::kRpcAllowed);
+ CheckRpcPermissions("PutFile", ::policy::kRpcAllowed);
+ CheckRpcPermissions("SetAppIcon", ::policy::kRpcAllowed);
+ CheckRpcPermissions("SetGlobalProperties", ::policy::kRpcAllowed);
+ CheckRpcPermissions("ResetGlobalProperties", ::policy::kRpcAllowed);
+ CheckRpcPermissions("SetDisplayLayout", ::policy::kRpcAllowed);
+ CheckRpcPermissions("ListFiles", ::policy::kRpcAllowed);
+ CheckRpcPermissions("DeleteFile", ::policy::kRpcAllowed);
+
+ // Next checks are equal to NonBaseBeforeDataConsent_APIs.xml checks from task
+ CheckRpcPermissions("AddSubMenu", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("AddCommand", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("DeleteCommand", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("DeleteSubMenu", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("CreateInteractionChoiceSet", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("PerformInteraction", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("DeleteInteractionChoiceSet", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("Alert", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("Show", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("Speak", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("SetMediaClockTimer", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("SubscribeButton", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("UnsubscribeButton", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("PerformAudioPassThru", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("EndAudioPassThru", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("SubscribeVehicleData", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("UnsubscribeVehicleData", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("GetVehicleData", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("ReadDID", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("GetDTCs", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("ScrollableMessage", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("Slider", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("ShowConstantTBT", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("AlertManeuver", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("UpdateTurnList", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("SendLocation", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("GenericRequest", ::policy::kRpcDisallowed);
+ CheckRpcPermissions("DialNumber", ::policy::kRpcDisallowed);
+}
+
+// Related to manual tests APPLINK-18763, APPLINK-18764
+TEST_F(PolicyManagerImplTest2, CheckPreDataConsent_GetDefaultHmiLevel_NONE) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ std::string default_hmi;
+ // Default HMI level is NONE
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ EXPECT_EQ("NONE", default_hmi);
+
+ // Default priority level is NONE
+ std::string priority1;
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority1));
+ EXPECT_EQ("NONE", priority1);
+}
+
+// Related to manual tests APPLINK-18763, APPLINK-18764
+TEST_F(PolicyManagerImplTest2,
+ CheckPreDataConsent_GetDefaultHmiLevel_BACKGROUNG) {
+ // Arrange
+ CreateLocalPT(kSdlPreloadedPtJson2);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ std::string default_hmi;
+ // Default HMI level is BACKGROUND
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ EXPECT_EQ("BACKGROUND", default_hmi);
+ // Default priority level is EMERGENCY
+ std::string priority1;
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority1));
+ EXPECT_EQ("EMERGENCY", priority1);
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithConsent_ExpectDefault) {
+ // Arrange
+ // RequestTypes for default & preDataConsent are different
+ CreateLocalPT("json/ptu_requestType.json");
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ ASSERT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
+ policy_manager_->ReactOnUserDevConsentForApp(app_id_1_, true);
+ EXPECT_FALSE(policy_manager_->IsPredataPolicy(app_id_1_));
+ // Expect app_id_1_ has default policy
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_1_));
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithConsent_ExpectPreDataConsent) {
+ // Arrange
+ // RequestTypes for default & preDataConsent are the same
+ CreateLocalPT(kPtu2RequestTypeJson);
+ policy_manager_->AddApplication(app_id_1_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ ASSERT_TRUE(policy_manager_->IsPredataPolicy(app_id_1_));
+ EXPECT_CALL(listener_, OnPendingPermissionChange(app_id_1_)).Times(0);
+ policy_manager_->ReactOnUserDevConsentForApp(app_id_1_, true);
+ EXPECT_FALSE(policy_manager_->IsPredataPolicy(app_id_1_));
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_1_));
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ GetUserConsentForDevice_SetDeviceWithoutConcent_ExpectReceivedConsentCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceHasNoConsent, consent);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetUserConsentForDevice_SetDeviceAllowed_ExpectReceivedConsentCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ GetUserConsentForDevice_SetDeviceDisallowed_ExpectReceivedConsentCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ policy_manager_->SetUserConsentForDevice(device_id_2_, false);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceDisallowed, consent);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetDefaultHmi_SetDeviceDisallowed_ExpectReceivedHmiCorrect) {
+ // Arrange
+ CreateLocalPT(kPtu2RequestTypeJson);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ policy_manager_->SetUserConsentForDevice(device_id_2_, false);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceDisallowed, consent);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ std::string default_hmi;
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi);
+ EXPECT_EQ("NONE", default_hmi);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetDefaultHmi_SetDeviceAllowed_ExpectReceivedHmiCorrect) {
+ // Arrange
+ CreateLocalPT(kPtu2RequestTypeJson);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
+ std::string default_hmi1;
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi1);
+ EXPECT_EQ("NONE", default_hmi1);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
+ std::string default_hmi2;
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
+ EXPECT_EQ("LIMITED", default_hmi2);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetDefaultPriority_SetDeviceAllowed_ExpectReceivedPriorityCorrect) {
+ // Arrange
+ CreateLocalPT(kPtu2RequestTypeJson);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
+ std::string priority1;
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority1));
+ EXPECT_EQ("NONE", priority1);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
+ std::string priority2;
+ EXPECT_TRUE(policy_manager_->GetPriority(app_id_2_, &priority2));
+ EXPECT_EQ("EMERGENCY", priority2);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetUserFirendlyMessages_ExpectReceivedCorrectMessages) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ::policy::StringArray message_code;
+ message_code.push_back("SettingEnableUpdates");
+ message_code.push_back("AppPermissions");
+ const std::string language = "en-us";
+ const std::string active_hmi_language = language;
+ std::vector< ::policy::UserFriendlyMessage> result =
+ policy_manager_->GetUserFriendlyMessages(
+ message_code, language, active_hmi_language);
+ uint32_t size = result.size();
+ EXPECT_GT(size, 0u);
+ std::vector< ::policy::UserFriendlyMessage>::iterator result_iter;
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+
+ policy_table::ConsumerFriendlyMessages& consumer_friendly_messages =
+ *(pt->policy_table.consumer_friendly_messages);
+ policy_table::Messages& Messages = *(consumer_friendly_messages.messages);
+
+ policy_table::Messages::const_iterator messages_iter = Messages.begin();
+ // Loop until end of messages
+ for (; messages_iter != Messages.end(); ++messages_iter) {
+ if (messages_iter->first == "AppPermissions") {
+ for (result_iter = result.begin(); result_iter != result.end();
+ ++result_iter) {
+ if (result_iter->message_code == "AppPermissions") {
+ const policy_table::MessageLanguages& MessageLanguages =
+ messages_iter->second;
+ const policy_table::Languages& Languages = MessageLanguages.languages;
+ policy_table::Languages::const_iterator languages_iter =
+ Languages.find("en-us");
+ // If necessary language found
+ if (languages_iter != Languages.end()) {
+ const policy_table::MessageString& MessageString =
+ languages_iter->second;
+ EXPECT_EQ(static_cast<std::string>(*(MessageString.line1)),
+ result_iter->line1);
+ EXPECT_EQ(static_cast<std::string>(*(MessageString.line2)),
+ result_iter->line2);
+ EXPECT_EQ(static_cast<std::string>(*(MessageString.tts)),
+ result_iter->tts);
+ EXPECT_EQ(static_cast<std::string>(*(MessageString.label)),
+ result_iter->label);
+ EXPECT_EQ(static_cast<std::string>(*(MessageString.textBody)),
+ result_iter->text_body);
+ }
+ }
+ }
+ } else if (messages_iter->first == "SettingEnableUpdates") {
+ for (result_iter = result.begin(); result_iter != result.end();
+ ++result_iter) {
+ if (result_iter->message_code == "SettingEnableUpdates") {
+ const policy_table::MessageLanguages& MessageLanguages =
+ messages_iter->second;
+ const policy_table::Languages& Languages = MessageLanguages.languages;
+ policy_table::Languages::const_iterator languages_iter =
+ Languages.find("en-us");
+ // If necessary language found
+ if (languages_iter != Languages.end()) {
+ const policy_table::MessageString& MessageString2 =
+ languages_iter->second;
+ EXPECT_EQ(static_cast<std::string>(*(MessageString2.line1)),
+ result_iter->line1);
+ }
+ }
+ }
+ }
+ }
+}
+
+TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) {
+ // Arrange
+ ::policy::DeviceInfo dev_info;
+ utils::SharedPtr<policy_table::Table> pt =
+ (policy_manager_->GetCache())->GetPT();
+ dev_info.hardware = "hardware IPX";
+ dev_info.firmware_rev = "v.8.0.1";
+ dev_info.os = "Android";
+ dev_info.os_ver = "4.4.2";
+ dev_info.carrier = "Life";
+ dev_info.max_number_rfcom_ports = 2;
+ dev_info.connection_type = "Bluetooth";
+ policy_manager_->AddDevice(device_id_1_, "Bluetooth");
+ policy_manager_->SetDeviceInfo(device_id_1_, dev_info);
+ // Find device in PT
+ policy_table::DeviceData::const_iterator iter =
+ (*(pt->policy_table.device_data)).find(device_id_1_);
+ // Checks
+ ASSERT_TRUE(iter != (*(pt->policy_table.device_data)).end());
+ EXPECT_EQ(static_cast<std::string>(*(*iter).second.hardware),
+ dev_info.hardware);
+ EXPECT_EQ(static_cast<std::string>(*(*iter).second.firmware_rev),
+ dev_info.firmware_rev);
+ EXPECT_EQ(static_cast<std::string>(*(*iter).second.os), dev_info.os);
+ EXPECT_EQ(static_cast<std::string>(*(*iter).second.os_version),
+ dev_info.os_ver);
+ EXPECT_EQ(static_cast<std::string>(*(*iter).second.carrier),
+ dev_info.carrier);
+ EXPECT_EQ(static_cast<std::string>(*(*iter).second.connection_type),
+ dev_info.connection_type);
+ EXPECT_EQ(static_cast<uint8_t>(*(*iter).second.max_number_rfcom_ports),
+ dev_info.max_number_rfcom_ports);
+}
+
+TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ ::policy::StringArray app_nicknames;
+ ::policy::StringArray app_hmi_types;
+ policy_manager_->GetInitialAppData(app_id_2_, &app_nicknames, &app_hmi_types);
+ // Expect Empty nicknames and AppHmiTypes
+ EXPECT_EQ(0u, app_nicknames.size());
+ EXPECT_EQ(0u, app_hmi_types.size());
+
+ Json::Value root = GetPTU(kValidSdlPtUpdateJson);
+
+ Json::Value appHmiTypes = Json::Value(Json::arrayValue);
+ appHmiTypes = root["policy_table"]["app_policies"][app_id_2_]["AppHMIType"];
+ const uint32_t appHmiType_size = appHmiTypes.size();
+
+ Json::Value appNicknames = Json::Value(Json::arrayValue);
+ appNicknames = root["policy_table"]["app_policies"][app_id_2_]["nicknames"];
+ const uint32_t appNicknames_size = appNicknames.size();
+
+ ::policy::StringArray app_nicknames1;
+ ::policy::StringArray app_hmi_types1;
+ policy_manager_->GetInitialAppData(
+ app_id_2_, &app_nicknames1, &app_hmi_types1);
+ const uint32_t nick_names_size = app_nicknames1.size();
+ const uint32_t app_hmi_types_size = app_hmi_types1.size();
+ ASSERT_EQ(appHmiType_size, app_hmi_types_size);
+ ASSERT_EQ(appNicknames_size, nick_names_size);
+ ASSERT_GT(nick_names_size, 0u);
+ ASSERT_GT(app_hmi_types_size, 0u);
+ // Check nicknames match
+ for (uint32_t i = 0; i < nick_names_size; ++i) {
+ EXPECT_EQ(app_nicknames1[i], appNicknames[i].asString());
+ }
+ // Check AppHmiTypes match
+ for (uint32_t i = 0; i < app_hmi_types_size; ++i) {
+ EXPECT_EQ(app_hmi_types1[i], appHmiTypes[i].asString());
+ }
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ CanAppKeepContext_AddAppFromUnconsentedDevice_ExpectAppCannotKeepContext) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
+ // Check keep context in preData policy
+ EXPECT_FALSE(policy_manager_->CanAppKeepContext(app_id_2_));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppKeepContext_AddAppFromConsentedDevice_ExpectAppCannotKeepContext) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
+ // Check keep context in default policy
+ EXPECT_FALSE(policy_manager_->CanAppKeepContext(app_id_2_));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppStealFocus_AddAppFromUnconsentedDevice_ExpectAppCannotStealFocus) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
+ // Check keep context in preData policy
+ EXPECT_FALSE(policy_manager_->CanAppStealFocus(app_id_2_));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppStealFocus_AddAppFromConsentedDevice_ExpectAppCannotStealFocus) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
+ // Check keep context in default policy
+ EXPECT_FALSE(policy_manager_->CanAppStealFocus(app_id_2_));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ IsPredataPolicy_SetAppWIthPredataPolicy_ExpectPredataPolicy) {
+ // Arrange
+ CreateLocalPT(preloaded_pt_filename_);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ SendNotificationOnPermissionsUpdated_SetDeviceAllowed_ExpectNotificationSent) {
+ // Arrange
+ CreateLocalPT(kPtu2RequestTypeJson);
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_TRUE(policy_manager_->IsPredataPolicy(app_id_2_));
+ std::string default_hmi1;
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi1);
+ EXPECT_EQ("NONE", default_hmi1);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillOnce(Return(""));
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_2_, _, default_hmi1))
+ .Times(0);
+ policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+
+ ASSERT_TRUE(
+ (policy_manager_->GetCache())->AddDevice(device_id_2_, "Bluetooth"));
+ ASSERT_TRUE((policy_manager_->GetCache())
+ ->SetDeviceData(device_id_2_,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ policy_manager_->SetUserConsentForDevice(device_id_2_, true);
+ ::policy::DeviceConsent consent =
+ policy_manager_->GetUserConsentForDevice(device_id_2_);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener_, OnCurrentDeviceIdUpdateRequired(app_id_2_))
+ .WillRepeatedly(Return(device_id_2_));
+ policy_manager_->AddApplication(app_id_2_,
+ HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((policy_manager_->GetCache())->IsDefaultPolicy(app_id_2_));
+ std::string default_hmi2;
+ policy_manager_->GetDefaultHmi(app_id_2_, &default_hmi2);
+ EXPECT_EQ("LIMITED", default_hmi2);
+ EXPECT_CALL(listener_, OnPermissionsUpdated(app_id_2_, _, default_hmi2));
+ policy_manager_->SendNotificationOnPermissionsUpdated(app_id_2_);
+}
+
+} // namespace policy
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/shared_library_test.cc b/src/components/policy/policy_external/test/shared_library_test.cc
new file mode 100644
index 0000000000..b7183a9085
--- /dev/null
+++ b/src/components/policy/policy_external/test/shared_library_test.cc
@@ -0,0 +1,76 @@
+/* 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 <dlfcn.h>
+
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+::testing::AssertionResult IsError(void* error) {
+ if (error) {
+ return ::testing::AssertionSuccess() << static_cast<const char*>(error);
+ } else {
+ return ::testing::AssertionFailure() << error;
+ }
+}
+
+TEST(SharedLibraryTest,
+ FullTest_OpenLibrarySetSymbolCloseLibrary_ExpectActsWithoutErrors) {
+ // Arrange
+ const std::string kLib = "../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()));
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
new file mode 100644
index 0000000000..92525c646d
--- /dev/null
+++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc
@@ -0,0 +1,1718 @@
+/* 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 <algorithm>
+#include <utility>
+#include <string>
+#include <iterator>
+#include <iostream>
+#include "gtest/gtest.h"
+#include "policy/sql_pt_ext_representation.h"
+#include "utils/gen_hash.h"
+#include "utils/file_system.h"
+#include "sqlite_wrapper/sql_query.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+#include "policy/mock_policy_settings.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+using namespace ::policy;
+namespace policy_table = rpc::policy_table_interface_base;
+using std::string;
+using std::map;
+using std::pair;
+using std::vector;
+using testing::ReturnRef;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+class SQLPTExtRepresentationTest : public ::testing::Test {
+ public:
+ // Collection of pairs of group alias and corresponding group name
+ typedef vector<pair<string, string> > GroupsAliasNameCollection;
+
+ SQLPTExtRepresentationTest() : reps_(NULL) {}
+
+ protected:
+ SQLPTExtRepresentation* reps_;
+ policy_handler_test::MockPolicySettings policy_settings_;
+ static const string kDatabaseName;
+ PermissionConsent perm_consent;
+ FunctionalGroupPermission group1_perm;
+ FunctionalGroupPermission group2_perm;
+ utils::dbms::SQLQuery* query_wrapper_;
+ static const bool in_memory_;
+ const std::string kAppStorageFolder = "storage_SQLPTExtRepresentationTest";
+
+ void SetUp() OVERRIDE {
+ file_system::DeleteFile(kDatabaseName);
+ reps_ = new SQLPTExtRepresentation(in_memory_);
+ ASSERT_TRUE(reps_ != NULL);
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ ASSERT_EQ(SUCCESS, reps_->Init(&policy_settings_));
+ query_wrapper_ = new utils::dbms::SQLQuery(reps_->db());
+ ASSERT_TRUE(query_wrapper_ != NULL);
+ }
+
+ void TearDown() OVERRIDE {
+ delete query_wrapper_;
+ EXPECT_TRUE(reps_->Drop());
+ EXPECT_TRUE(reps_->Close());
+ delete reps_;
+ }
+
+ void FillGroupPermission(
+ vector<FunctionalGroupPermission>& groups_permissions,
+ FunctionalGroupPermission group,
+ const GroupsAliasNameCollection& groups_names,
+ GroupConsent state) {
+ GroupsAliasNameCollection::const_iterator groups_names_it =
+ groups_names.begin();
+ while (groups_names_it != groups_names.end()) {
+ group.group_alias = groups_names_it->first;
+ group.group_name = groups_names_it->second;
+ group.group_id = ::utils::Djb2HashFromString(groups_names_it->second);
+ group.state = state;
+ groups_permissions.push_back(group);
+ ++groups_names_it;
+ }
+ }
+
+ void FillPermissionStruct(
+ const string& dev_id,
+ const string& app_id,
+ const string& consent_source,
+ const GroupsAliasNameCollection& allowed_groups_names,
+ const GroupsAliasNameCollection& disallowed_groups_names) {
+ // Arrange
+ vector<FunctionalGroupPermission> groups_permissions;
+ perm_consent.device_id = dev_id;
+ perm_consent.policy_app_id = app_id;
+ perm_consent.consent_source = consent_source;
+ // Fill groups
+ FillGroupPermission(groups_permissions,
+ group1_perm,
+ allowed_groups_names,
+ GroupConsent::kGroupAllowed);
+ FillGroupPermission(groups_permissions,
+ group2_perm,
+ disallowed_groups_names,
+ GroupConsent::kGroupDisallowed);
+ perm_consent.group_permissions = groups_permissions;
+ }
+
+ bool Check(const GroupsAliasNameCollection& groups_names,
+ const vector<int32_t>& group_Ids) {
+ vector<int32_t>::const_iterator group_Ids_it = group_Ids.begin();
+ GroupsAliasNameCollection::const_iterator group_alias_name_it =
+ groups_names.begin();
+
+ EXPECT_EQ(groups_names.size(), group_Ids.size());
+ while (group_Ids_it != group_Ids.end()) {
+ while (group_alias_name_it != groups_names.end()) {
+ if (group_Ids.end() != std::find(group_Ids.begin(),
+ group_Ids.end(),
+ ::utils::Djb2HashFromString(
+ group_alias_name_it->second))) {
+ return true;
+ }
+ ++group_alias_name_it;
+ }
+ ++group_Ids_it;
+ }
+ return false;
+ }
+
+ bool CheckGroupTypesExist(
+ const FunctionalIdType& group_types,
+ const GroupsAliasNameCollection& allowed_groups_names,
+ const GroupsAliasNameCollection& disallowed_groups_names) {
+ bool result = true;
+ map<GroupType, FunctionalGroupIDs>::const_iterator functional_id_type_it1 =
+ group_types.find(GroupType::kTypeAllowed);
+ map<GroupType, FunctionalGroupIDs>::const_iterator functional_id_type_it2 =
+ group_types.find(GroupType::kTypeDisallowed);
+
+ if (functional_id_type_it1 == group_types.end() ||
+ functional_id_type_it2 == group_types.end()) {
+ return false;
+ }
+
+ const std::vector<int32_t>& allowedGroupIDs =
+ functional_id_type_it1->second;
+ const std::vector<int32_t>& disallowedGroupIDs =
+ functional_id_type_it2->second;
+ if (0u == allowedGroupIDs.size() && 0u == disallowedGroupIDs.size()) {
+ result = false;
+ } else if (0u != allowedGroupIDs.size() &&
+ 0u == disallowedGroupIDs.size()) {
+ result = Check(allowed_groups_names, allowedGroupIDs);
+ } else if (0u != disallowedGroupIDs.size() &&
+ 0u == allowedGroupIDs.size()) {
+ result = Check(disallowed_groups_names, disallowedGroupIDs);
+ } else if (0u != allowedGroupIDs.size() &&
+ 0u != disallowedGroupIDs.size()) {
+ result = Check(allowed_groups_names, allowedGroupIDs) &&
+ Check(disallowed_groups_names, disallowedGroupIDs);
+ } else {
+ result = false;
+ }
+ return result;
+ }
+ // Attempt of simplifying policy table checks, hides internal stuff, add
+ // basic checks for data existence before getting of data
+ // For usage example see SaveUserConsentRecords_ExpectedSaved,
+ // SaveFunctionalGroupings_ExpectedSaved tests
+ template <typename ParentType, typename KeyType>
+ bool IsExist(const ParentType& parent) const;
+
+ template <typename ParentType, typename Value>
+ bool IsKeyExist(const ParentType& parent, const Value& value) const {
+ return parent.end() != std::find(parent.begin(), parent.end(), value);
+ }
+
+ template <typename ParentType>
+ bool IsKeyExist(const ParentType& parent, const std::string& value) const {
+ return parent.end() != parent.find(value);
+ }
+
+ template <typename ParentType, typename KeyType>
+ const KeyType& GetData(const ParentType& parent) const {
+ EXPECT_TRUE((IsExist<ParentType, KeyType>(parent)));
+ return GetDataInternal<ParentType, KeyType>(parent);
+ }
+
+ template <typename ParentType, typename KeyType>
+ const KeyType& GetKeyData(const ParentType& parent,
+ const std::string& key_name) const {
+ EXPECT_TRUE((IsKeyExist<ParentType>(parent, key_name)));
+ return GetKeyDataInternal<ParentType, KeyType>(parent, key_name);
+ }
+
+ private:
+ template <typename ParentType, typename KeyType>
+ const KeyType& GetDataInternal(const ParentType& parent) const;
+
+ template <typename ParentType, typename KeyType>
+ const KeyType& GetKeyDataInternal(const ParentType& parent,
+ const std::string& key_name) const {
+ return parent.find(key_name)->second;
+ }
+};
+
+// Specializations for 'policy_table' section
+
+template <>
+bool SQLPTExtRepresentationTest::IsExist<policy_table::Table,
+ policy_table::DeviceData>(
+ const policy_table::Table& table) const {
+ return table.policy_table.device_data.is_initialized();
+}
+
+template <>
+bool SQLPTExtRepresentationTest::IsExist<policy_table::Table,
+ policy_table::FunctionalGroupings>(
+ const policy_table::Table& table) const {
+ return table.policy_table.functional_groupings.is_initialized();
+}
+
+template <>
+const policy_table::DeviceData& SQLPTExtRepresentationTest::GetDataInternal(
+ const policy_table::Table& table) const {
+ return *table.policy_table.device_data;
+}
+
+template <>
+const policy_table::FunctionalGroupings&
+SQLPTExtRepresentationTest::GetDataInternal(
+ const policy_table::Table& table) const {
+ return table.policy_table.functional_groupings;
+}
+
+const string SQLPTExtRepresentationTest::kDatabaseName = ":memory:";
+const bool SQLPTExtRepresentationTest::in_memory_ = 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);
+ }
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ DISABLED_GenerateSnapshot_SetPolicyTable_SnapshotIsPresent) {
+ // TODO(AKutsan): APPLINK-31526 Test requires initial preloaded pt for
+ // preloaded date reading
+ // Arrange
+ Json::Value table(Json::objectValue);
+ 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_date"] = Json::Value("");
+ 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");
+ 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"]["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"]["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(50);
+ app_policies["pre_DataConsent"]["heart_beat_timeout_ms"] = Json::Value(100);
+ 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"]["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(50);
+ app_policies["1234"]["heart_beat_timeout_ms"] = Json::Value(100);
+ 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"]["keep_context"] = Json::Value(true);
+ app_policies["1234"]["steal_focus"] = Json::Value(true);
+ 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"]["default_hmi"] = Json::Value("FULL");
+ app_policies["device"]["keep_context"] = Json::Value(true);
+ app_policies["device"]["steal_focus"] = Json::Value(true);
+
+ 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);
+
+ policy_table["module_meta"] = Json::Value(Json::objectValue);
+ policy_table["usage_and_error_counts"] = Json::Value(Json::objectValue);
+ policy_table["device_data"] = Json::Value(Json::objectValue);
+ policy_table["module_config"]["preloaded_pt"] = Json::Value(false);
+
+ Json::Value& module_meta = policy_table["module_meta"];
+ module_meta["ccpu_version"] = Json::Value("");
+ module_meta["language"] = Json::Value("");
+ module_meta["wers_country_code"] = Json::Value("");
+ module_meta["pt_exchanged_at_odometer_x"] = Json::Value(0);
+ module_meta["pt_exchanged_x_days_after_epoch"] = Json::Value(0);
+ module_meta["ignition_cycles_since_last_exchange"] = Json::Value(0);
+ module_meta["vin"] = Json::Value("");
+
+ Json::Value& usage_and_error_counts = policy_table["usage_and_error_counts"];
+ usage_and_error_counts["count_of_iap_buffer_full"] = Json::Value(0);
+ usage_and_error_counts["count_sync_out_of_memory"] = Json::Value(0);
+ usage_and_error_counts["count_of_sync_reboots"] = Json::Value(0);
+
+ policy_table::Table expected(&table);
+
+ // Assert
+ EXPECT_EQ(expected.ToJsonValue().toStyledString(),
+ snapshot->ToJsonValue().toStyledString());
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ CanAppKeepContext_InsertKeepContext_ExpectValuesThatSetInKeepContextParams) {
+ // Arrange
+ const std::string query_delete = "DELETE FROM `application`; ";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ const std::string query_insert_12345 =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `keep_context`) VALUES ('12345', 5, 10, 1)";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345));
+ EXPECT_FALSE(reps_->CanAppKeepContext("0"));
+ EXPECT_TRUE(reps_->CanAppKeepContext("12345"));
+ // Act
+ const std::string query_insert_123 =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `keep_context`) VALUES ('123', 10, 7, 0)";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_123));
+ EXPECT_FALSE(reps_->CanAppKeepContext("123"));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ CanAppStealFocus_SetStealFocus_ExpectValuesThatSetInStealFocusParam) {
+ // Arrange
+ const std::string query_delete = "DELETE FROM `application`; ";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ const std::string query_insert_12345 =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('12345', 5, 10, 1)";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345));
+ EXPECT_TRUE(reps_->CanAppStealFocus("12345"));
+ EXPECT_FALSE(reps_->CanAppStealFocus("0"));
+ // Act
+ const std::string query_insert_123 =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `steal_focus`) VALUES ('123', 10, 7, 0)";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_123));
+ EXPECT_FALSE(reps_->CanAppStealFocus("123"));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ GetDefaultHMI_SetHMI_ExpectValuesThatSetInHMIParam) {
+ // Arrange
+ const std::string query_delete = "DELETE FROM `application`; ";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ const std::string query_insert_12345 =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `default_hmi`) VALUES ('12345', 5, 10, "
+ "'NONE')";
+ std::string result;
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345));
+ EXPECT_TRUE(reps_->GetDefaultHMI("12345", &result));
+ EXPECT_EQ("NONE", result);
+ const std::string query_insert_123 =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `default_hmi`) VALUES ('123', 5, 10, "
+ "'LIMITED')";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_123));
+ EXPECT_TRUE(reps_->GetDefaultHMI("123", &result));
+ EXPECT_EQ("LIMITED", result);
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ GetUserPermissionsForDevice_SetPermissions_ExpectValuesThatSetInParams) {
+ // Arrange
+ StringArray allowed_groups;
+ StringArray disallowed_groups;
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ EXPECT_EQ(0u, allowed_groups.size());
+ EXPECT_EQ(0u, disallowed_groups.size());
+
+ const std::string query_delete = "DELETE FROM `device_consent_group`; ";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ const std::string query_insert_DataConsent =
+ "INSERT INTO `device_consent_group` (`device_id`, "
+ "`functional_group_id`,'is_consented', `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', 'DataConsent-2', 1,'GUI', '2014-01-01T00:00:52Z')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_DataConsent));
+ const std::string query_insert_Navigation =
+ "INSERT INTO `device_consent_group` (`device_id`, "
+ "`functional_group_id`,'is_consented', `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', 'Navigation-1', 0,'GUI', '2015-01-01T00:00:52Z')";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Navigation));
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ EXPECT_EQ(1u, allowed_groups.size());
+ EXPECT_EQ(1u, disallowed_groups.size());
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ SetUserPermissionsForDevice_SetPermissions_ExpectValuesThatSetInParams) {
+ // Arrange
+ StringArray allowed_groups;
+ StringArray disallowed_groups;
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ EXPECT_EQ(0u, allowed_groups.size());
+ EXPECT_EQ(0u, disallowed_groups.size());
+ allowed_groups.push_back("DataConsent-2");
+ disallowed_groups.push_back("Navigation-1");
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
+ "XXX12345ZZZ", allowed_groups, disallowed_groups));
+
+ allowed_groups.clear();
+ disallowed_groups.clear();
+ // Act
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ // Checks
+ EXPECT_EQ(1u, allowed_groups.size());
+ EXPECT_EQ(1u, disallowed_groups.size());
+ EXPECT_TRUE(std::find(allowed_groups.begin(),
+ allowed_groups.end(),
+ "DataConsent-2") != allowed_groups.end());
+ EXPECT_TRUE(std::find(disallowed_groups.begin(),
+ disallowed_groups.end(),
+ "Navigation-1") != disallowed_groups.end());
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ ResetDeviceConsents_SetConsentThenReset_ExpectValuesReset) {
+ // Arrange
+ StringArray allowed_groups;
+ StringArray disallowed_groups;
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ EXPECT_EQ(0u, allowed_groups.size());
+ EXPECT_EQ(0u, disallowed_groups.size());
+ allowed_groups.push_back("DataConsent-2");
+ disallowed_groups.push_back("Navigation-1");
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
+ "XXX12345ZZZ", allowed_groups, disallowed_groups));
+
+ allowed_groups.clear();
+ disallowed_groups.clear();
+ // Act
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ // Checks
+ EXPECT_EQ(1u, allowed_groups.size());
+ EXPECT_EQ(1u, disallowed_groups.size());
+ EXPECT_TRUE(std::find(allowed_groups.begin(),
+ allowed_groups.end(),
+ "DataConsent-2") != allowed_groups.end());
+ EXPECT_TRUE(std::find(disallowed_groups.begin(),
+ disallowed_groups.end(),
+ "Navigation-1") != disallowed_groups.end());
+ allowed_groups.clear();
+ disallowed_groups.clear();
+ // Act
+ reps_->ResetDeviceConsents();
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ // Checks
+ EXPECT_EQ(0u, allowed_groups.size());
+ EXPECT_EQ(0u, disallowed_groups.size());
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ GetPermissionsForApp_SetPermissions_ExpectValuesThatSetInParams) {
+ // Arrange
+ const std::string query_insert_input_0 =
+ "INSERT INTO `consent_group` (`device_id`, 'application_id' , "
+ "`functional_group_id`, 'is_consented', `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', '12345', 414812216, 1,'GUI', "
+ "'2014-01-01T00:00:52Z')";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_input_0));
+ const std::string query_insert_input_1 =
+ "INSERT INTO `consent_group` (`device_id`, 'application_id' , "
+ "`functional_group_id`, 'is_consented', `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', '12345', 686787169, 0,'GUI', "
+ "'2014-01-01T00:00:52Z')";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_input_1));
+ GroupsAliasNameCollection allowed_groups;
+ allowed_groups.push_back(std::make_pair("DataConsent", "DataConsent-2"));
+
+ GroupsAliasNameCollection disallowed_groups;
+ disallowed_groups.push_back(std::make_pair("", "Base-4"));
+ FillPermissionStruct("", "", "", allowed_groups, disallowed_groups);
+ FunctionalIdType group_types;
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ EXPECT_TRUE(
+ CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ SetUserPermissionsForApp_SetPermissions_ExpectValuesThatSetInParams) {
+ // Arrange
+ GroupsAliasNameCollection allowed_groups;
+ allowed_groups.push_back(std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection disallowed_groups;
+ disallowed_groups.push_back(std::make_pair("DataConsent", "DataConsent-2"));
+ FillPermissionStruct(
+ "XXX12345ZZZ", "12345", "VR", allowed_groups, disallowed_groups);
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+
+ FunctionalIdType group_types;
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ EXPECT_TRUE(
+ CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ ResetAppConsents_SetPermissionsThenReset_ExpectValuesReset) {
+ // Arrange
+ GroupsAliasNameCollection allowed_groups;
+ allowed_groups.push_back(std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection disallowed_groups;
+ disallowed_groups.push_back(std::make_pair("DataConsent", "DataConsent-2"));
+ FillPermissionStruct(
+ "XXX12345ZZZ", "12345", "VR", allowed_groups, disallowed_groups);
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+
+ FunctionalIdType group_types;
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ EXPECT_TRUE(
+ CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
+
+ reps_->ResetAppConsents();
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ EXPECT_FALSE(
+ CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ ResetUserConsent_SetConsentThenReset_ExpectValuesReset) {
+ // Arrange
+ GroupsAliasNameCollection perm_allowed_groups;
+ perm_allowed_groups.push_back(
+ std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection perm_disallowed_groups;
+ perm_disallowed_groups.push_back(
+ std::make_pair("DataConsent", "DataConsent-2"));
+ FillPermissionStruct("XXX12345ZZZ",
+ "12345",
+ "VR",
+ perm_allowed_groups,
+ perm_disallowed_groups);
+ // Set permissions for app
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+
+ FunctionalIdType group_types;
+ ASSERT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ EXPECT_TRUE(CheckGroupTypesExist(
+ group_types, perm_allowed_groups, perm_disallowed_groups));
+
+ StringArray allowed_groups;
+ StringArray disallowed_groups;
+ allowed_groups.push_back("DataConsent-2");
+ disallowed_groups.push_back("Navigation-1");
+ // Set permissions for device
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
+ "XXX12345ZZZ", allowed_groups, disallowed_groups));
+
+ allowed_groups.clear();
+ disallowed_groups.clear();
+ // Act
+ reps_->ResetUserConsent();
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ // Checks
+ EXPECT_EQ(0u, allowed_groups.size());
+ EXPECT_EQ(0u, disallowed_groups.size());
+ EXPECT_TRUE(
+ reps_->GetPermissionsForApp("XXX12345ZZZ", "12345", &group_types));
+ EXPECT_FALSE(CheckGroupTypesExist(
+ group_types, perm_allowed_groups, perm_disallowed_groups));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ GetDeviceGroupsFromPolicies_SetGroups_ExpectValuesThatSetInParams) {
+ // Arrange
+ const std::string query_insert_app_group_1 =
+ "INSERT INTO `app_group` (`application_id`, 'functional_group_id') "
+ "VALUES ('device', '414812216')";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_group_1));
+
+ const std::string query_insert_DataConsent =
+ "INSERT INTO `functional_group` (`id`, 'user_consent_prompt', 'name') "
+ "VALUES ('414812216', 'DataConsent', 'DataConsent-2')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_DataConsent));
+
+ const std::string query_insert_app_group_2 =
+ "INSERT INTO `app_group` (`application_id`, 'functional_group_id') "
+ "VALUES ('device', 1809526495)";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_group_2));
+
+ const std::string query_insert_Notifications =
+ "INSERT INTO `functional_group` (`id`, 'user_consent_prompt', 'name') "
+ "VALUES (1809526495, 'Notifications', 'Notifications')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Notifications));
+
+ const std::string query_insert_preconsented_group =
+ "INSERT INTO `preconsented_group` (`application_id`, "
+ "`functional_group_id`) "
+ "VALUES ('device', 686787169)";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_preconsented_group));
+
+ const std::string query_insert_Base =
+ "INSERT INTO `functional_group` (`id`, 'user_consent_prompt', 'name') "
+ "VALUES (686787169, '', 'Base-4')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Base));
+
+ policy_table::Strings groups;
+ policy_table::Strings preconsented_groups;
+
+ EXPECT_TRUE(
+ reps_->GetDeviceGroupsFromPolicies(&groups, &preconsented_groups));
+ EXPECT_EQ(2u, groups.size());
+ EXPECT_EQ(1u, preconsented_groups.size());
+
+ const uint32_t min_size = 1u;
+ const uint32_t max_size = 255u;
+
+ rpc::String<min_size, max_size> temp1("DataConsent-2");
+ rpc::String<min_size, max_size> temp2("Notifications");
+ rpc::String<min_size, max_size> temp3("Base-4");
+
+ EXPECT_NE(groups.end(), std::find(groups.begin(), groups.end(), temp1));
+ EXPECT_NE(groups.end(), std::find(groups.begin(), groups.end(), temp2));
+ EXPECT_NE(
+ preconsented_groups.end(),
+ std::find(preconsented_groups.begin(), preconsented_groups.end(), temp3));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ SetDeviceData_SetDeviceData_ExpectValuesThatSetInParams) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ reps_->SetDeviceData("08-00-27-CE-76-FE",
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+ const std::string query_select_hardware =
+ "SELECT `hardware` FROM `device` WHERE `id` = '08-00-27-CE-76-FE'";
+ const std::string query_select_firmware_rev =
+ "SELECT `firmware_rev` FROM `device` WHERE `id` = '08-00-27-CE-76-FE'";
+ const std::string query_select_os =
+ "SELECT `os` FROM `device` WHERE `id` = '08-00-27-CE-76-FE'";
+ const std::string query_select_os_version =
+ "SELECT `os_version` FROM `device` WHERE `id` = '08-00-27-CE-76-FE'";
+ const std::string query_select_carrier =
+ "SELECT `carrier` FROM `device` WHERE `id` = '08-00-27-CE-76-FE'";
+ const std::string query_select_max_rfports_number =
+ "SELECT `max_number_rfcom_ports` FROM `device` WHERE `id` = "
+ "'08-00-27-CE-76-FE'";
+ const std::string query_select_connection_type =
+ "SELECT `connection_type` FROM `device` WHERE `id` = '08-00-27-CE-76-FE'";
+
+ // Checks
+ query.Prepare(query_select_hardware);
+ query.Next();
+ EXPECT_EQ(string("hardware IPX"), query.GetString(0));
+
+ query.Prepare(query_select_firmware_rev);
+ query.Next();
+ EXPECT_EQ("v.8.0.1", query.GetString(0));
+
+ query.Prepare(query_select_os);
+ query.Next();
+ EXPECT_EQ("Android", query.GetString(0));
+
+ query.Prepare(query_select_os_version);
+ query.Next();
+ EXPECT_EQ("4.4.2", query.GetString(0));
+
+ query.Prepare(query_select_carrier);
+ query.Next();
+ EXPECT_EQ("Life", query.GetString(0));
+
+ query.Prepare(query_select_max_rfports_number);
+ query.Next();
+ EXPECT_EQ(2, query.GetInteger(0));
+
+ query.Prepare(query_select_connection_type);
+ query.Next();
+ EXPECT_EQ("Bluetooth", query.GetString(0));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ ReactOnUserDevConsentForApp_SetDeviceAllowedAppHasPreDataConsent_ExpectAppHasDefaultPolicies) {
+ // Arrange
+ const std::string query_insert_device =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`) "
+ "VALUES ('device', '414812216')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_device));
+
+ const std::string query_insert_default =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`) "
+ "VALUES ('default', '686787169')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_default));
+
+ const std::string query_insert_pre_DataConsent =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`) "
+ "VALUES ('pre_DataConsent', '129372391')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_pre_DataConsent));
+
+ const std::string query_insert_1234 =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`) "
+ "VALUES ('1234', '129372391')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_1234));
+
+ const std::string query_insert_preconsented_group =
+ "INSERT INTO `preconsented_group` (`application_id`, "
+ "`functional_group_id`) "
+ "VALUES ('1234', '129372391')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_preconsented_group));
+
+ const std::string query_insert_functional_group =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (129372391, '', 'pre_DataConsent')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_functional_group));
+
+ const std::string query_insert_application =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `is_predata`, `keep_context`) VALUES ('1234', "
+ "5, 10, 1, 0)";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_application));
+
+ EXPECT_TRUE(reps_->IsPredataPolicy("1234"));
+ reps_->ReactOnUserDevConsentForApp("1234", true);
+ EXPECT_TRUE(reps_->IsDefaultPolicy("1234"));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ ReactOnUserDevConsentForApp_SetDeviceAllowedAppHasSpecificPoliciesThenSetPredata_ExpectAppGroupsRestored) {
+ // Arrange
+ const std::string query_insert_device_consent_group =
+ "INSERT INTO `device_consent_group` (`device_id`, "
+ "`functional_group_id`,'is_consented', `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', 'Location-1', 1,'GUI', '2015-01-01T00:00:52Z')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_device_consent_group));
+
+ const std::string query_insert_consent_group_1 =
+ "INSERT INTO `consent_group` (`device_id`, 'application_id' , "
+ "`functional_group_id`, `is_consented`, `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', '1234', 156072572, 1,'GUI', "
+ "'2014-01-01T00:00:52Z')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_consent_group_1));
+
+ const std::string query_insert_consent_group_2 =
+ "INSERT INTO `consent_group` (`device_id`, 'application_id' , "
+ "`functional_group_id`, `is_consented`, `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', '1234', 1809526495, 1,'GUI', "
+ "'2014-01-01T00:00:52Z')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_consent_group_2));
+
+ const std::string query_insert_pre_DataConsent =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (129372391, '', 'pre_DataConsent')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_pre_DataConsent));
+
+ const std::string query_insert_Notifications =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (1809526495, 'Notifications', 'Notifications')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Notifications));
+
+ const std::string query_insert_Location =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (156072572, 'Location', 'Location-1')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Location));
+
+ // Add to app_group
+ const std::string query_insert_app_group_1 =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`) "
+ "VALUES ('1234', '1809526495')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_group_1));
+
+ const std::string query_insert_app_group_2 =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`) "
+ "VALUES ('1234', '156072572')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_group_2));
+ // Add to pre_consented groups
+ const std::string query_insert_preconsented_group =
+ "INSERT INTO `preconsented_group` (`application_id`, "
+ "`functional_group_id`) "
+ "VALUES ('1234', '129372391')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_preconsented_group));
+
+ const std::string query_insert_application =
+ "INSERT INTO `application` (`id`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `is_predata`, `keep_context`) VALUES ('1234', "
+ "5, 10, 0, 0)";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_application));
+ FunctionalIdType group_types;
+ ASSERT_TRUE(reps_->GetPermissionsForApp("XXX12345ZZZ", "1234", &group_types));
+ EXPECT_FALSE(reps_->IsPredataPolicy("1234"));
+ EXPECT_FALSE(reps_->IsDefaultPolicy("1234"));
+ std::map<GroupType, FunctionalGroupIDs>::iterator it1 =
+ group_types.find(GroupType::kTypeAllowed);
+ EXPECT_TRUE(group_types.end() != it1);
+ EXPECT_EQ(2u, it1->second.size());
+ std::vector<int32_t>::iterator it2 =
+ std::find(it1->second.begin(), it1->second.end(), 156072572);
+ ASSERT_TRUE(it2 != it1->second.end());
+ it2 = std::find(it1->second.begin(), it1->second.end(), 1809526495);
+ ASSERT_TRUE(it2 != it1->second.end());
+ reps_->SetIsPredata("1234", true);
+ EXPECT_TRUE(reps_->IsPredataPolicy("1234"));
+ reps_->ReactOnUserDevConsentForApp("1234", true);
+ group_types.clear();
+ ASSERT_TRUE(reps_->GetPermissionsForApp("XXX12345ZZZ", "1234", &group_types));
+ EXPECT_FALSE(reps_->IsPredataPolicy("1234"));
+ EXPECT_FALSE(reps_->IsDefaultPolicy("1234"));
+ it1 = group_types.find(GroupType::kTypeAllowed);
+ EXPECT_TRUE(group_types.end() != it1);
+ EXPECT_EQ(2u, it1->second.size());
+ it2 = std::find(it1->second.begin(), it1->second.end(), 156072572);
+ ASSERT_TRUE(it2 != it1->second.end());
+ it2 = std::find(it1->second.begin(), it1->second.end(), 1809526495);
+ ASSERT_TRUE(it2 != it1->second.end());
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ GetUserFriendlyMsg_SetMsg_ExpectReceivedMsgSetInParams) {
+ // Arrange
+ const std::string query_insert_message =
+ "INSERT INTO `message` (`tts`, `label`,`line1`, `line2`, `textBody`, "
+ "`language_code`, `message_type_name`) VALUES ('test tts message', "
+ "'GPS and speed', 'test', 'test1', 'test3', 'en-en', 'AppPermissions')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_message));
+ const std::string query_insert_message_type =
+ "INSERT INTO `message_type` (`name`) VALUES ('AppPermissions')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_message_type));
+ std::vector<string> msg_code;
+ msg_code.push_back("AppPermissions");
+ // Act
+ std::vector<UserFriendlyMessage> result =
+ reps_->GetUserFriendlyMsg(msg_code, string("en-en"));
+ // Checks
+ ASSERT_EQ(1u, result.size());
+ EXPECT_EQ(result[0].message_code, "AppPermissions");
+ EXPECT_EQ(result[0].tts, "test tts message");
+ EXPECT_EQ(result[0].label, "GPS and speed");
+ EXPECT_EQ(result[0].line1, "test");
+ EXPECT_EQ(result[0].line2, "test1");
+ EXPECT_EQ(result[0].text_body, "test3");
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ IncrementGlobalCounter_IncrementThreeTimes_ExpectCountEqual3) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ const std::string query_update =
+ "UPDATE `usage_and_error_count` SET"
+ " `count_of_sync_reboots` = 0";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_update));
+
+ // Act
+ reps_->Increment("count_of_sync_reboots");
+ reps_->Increment("count_of_sync_reboots");
+ reps_->Increment("count_of_sync_reboots");
+
+ const std::string query_select =
+ "SELECT `count_of_sync_reboots` FROM `usage_and_error_count`";
+ // Assert
+ query.Prepare(query_select);
+ query.Next();
+ EXPECT_EQ(3, query.GetInteger(0));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ IncrementAppCounter_IncrementCountOfUserSelections3Times_ExpectCountEqual3) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ const std::string query_delete =
+ "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->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 std::string query_select =
+ "SELECT `count_of_user_selections` FROM `app_level`"
+ " WHERE `application_id` = '12345'";
+
+ // Assert
+ query.Prepare(query_select);
+ query.Next();
+ EXPECT_EQ(3, query.GetInteger(0));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ AppInfo_SetLanguageRuInGUIAndEnInVUI_ExpectRuInGUIAndEnInVUI) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ const std::string query_delete =
+ "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ reps_->Set("12345", "app_registration_language_gui", "ru-ru");
+ reps_->Set("12345", "app_registration_language_vui", "en-en");
+
+ const std::string query_select_gui =
+ "SELECT `app_registration_language_gui`"
+ " FROM `app_level` WHERE `application_id` = '12345'";
+
+ const std::string query_select_vui =
+ "SELECT `app_registration_language_vui`"
+ " FROM `app_level` WHERE `application_id` = '12345'";
+
+ // Assert
+ query.Prepare(query_select_gui);
+ query.Next();
+ EXPECT_EQ("ru-ru", query.GetString(0));
+
+ query.Prepare(query_select_vui);
+ query.Next();
+ EXPECT_EQ("en-en", query.GetString(0));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ AddAppStopwatch_Set10And60MinutesForStopwatch_Expect70Minutes) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ const std::string query_delete =
+ "DELETE FROM `app_level` WHERE `application_id` = '12345'";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ reps_->Add("12345", "minutes_in_hmi_full", 10);
+ reps_->Add("12345", "minutes_in_hmi_full", 60);
+
+ const std::string query_select =
+ "SELECT `minutes_in_hmi_full` FROM `app_level`"
+ " WHERE `application_id` = '12345'";
+
+ // Assert
+ query.Prepare(query_select);
+ query.Next();
+ EXPECT_EQ(70, query.GetInteger(0));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ SetUnpairedDevice_SetUnpairedDeviceId12345_ExpectUnpairedDeviceIdEquals12345) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ const std::string query_delete = "DELETE FROM `device`";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ const std::string query_insert =
+ "INSERT INTO `device` (`id`) VALUES('12345')";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert));
+ ASSERT_TRUE(reps_->SetUnpairedDevice("12345", true));
+ // Act
+ const std::string query_select =
+ "SELECT `id` FROM `device` WHERE `unpaired` = 1";
+ // Assert
+ query.Prepare(query_select);
+ query.Next();
+ EXPECT_EQ("12345", query.GetString(0));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ UnpairedDevicesList_SetUnpairedDevicesWithId12345AndId54321_Expect2UnpairedDevices) {
+ // Arrange
+ const std::string query_delete = "DELETE FROM `device`";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ // Act
+ const std::string query_insert_12345 =
+ "INSERT INTO `device` (`id`, `unpaired`)"
+ " VALUES('12345', 1)";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_12345));
+ // Act
+ const std::string query_insert_54321 =
+ "INSERT INTO `device` (`id`, `unpaired`) VALUES('54321', 1)";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_54321));
+ // 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"));
+ EXPECT_NE(output.end(), std::find(output.begin(), output.end(), "54321"));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ SetMetaInfo_SetMetaInfo_ExpectValuesSetInParams) {
+ // Arrange
+ ASSERT_TRUE(reps_->SetMetaInfo("4.1.3.B_EB355B", "WAEGB", "ru-ru"));
+ utils::dbms::SQLQuery query(reps_->db());
+ const std::string query_select_ccpu =
+ "SELECT `ccpu_version` FROM `module_meta`";
+ const std::string query_select_wers_country_code =
+ "SELECT `wers_country_code` FROM `module_meta`";
+ const std::string query_select_language =
+ "SELECT `language` FROM `module_meta`";
+
+ // Assert
+ query.Prepare(query_select_ccpu);
+ query.Next();
+ EXPECT_EQ("4.1.3.B_EB355B", query.GetString(0));
+ query.Prepare(query_select_wers_country_code);
+ query.Next();
+ EXPECT_EQ("WAEGB", query.GetString(0));
+ query.Prepare(query_select_language);
+ query.Next();
+ EXPECT_EQ("ru-ru", query.GetString(0));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ IsMetaInfoPresent_SetMetaInfo_ExpectMetaInfoPresent) {
+ // Arrange
+ const std::string query_insert_meta_info =
+ "UPDATE `module_meta` SET `ccpu_version` = '4.1.3.B_EB355B', "
+ "`wers_country_code` = 'WAEGB', `language` = 'ru-ru' ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_meta_info));
+ EXPECT_TRUE(reps_->IsMetaInfoPresent());
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ SetSystemLanguage_SetSystemLanguage_ExpectValueSetInParams) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ ASSERT_TRUE(reps_->SetSystemLanguage("ru-ru"));
+ const std::string query_select_language =
+ "SELECT `language` FROM `module_meta`";
+ // Assert
+ query.Prepare(query_select_language);
+ query.Next();
+ EXPECT_EQ("ru-ru", query.GetString(0));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ GetFunctionalGroupNames_SetGroupsManuallyThenGetGroupNames_ExpectAllGroupsReceived) {
+ // Arrange
+ const std::string query_insert_pre_DataConsent =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (129372391, '', 'pre_DataConsent')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_pre_DataConsent));
+
+ const std::string query_insert_Notifications =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (1809526495, 'Notifications', 'Notifications')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Notifications));
+
+ const std::string query_insert_Location =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (156072572, 'Location', 'Location-1')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Location));
+
+ std::map<uint32_t, std::pair<std::string, std::string> > FunctionalGroupNames;
+ std::map<uint32_t, std::pair<std::string, std::string> >::iterator it;
+ reps_->GetFunctionalGroupNames(FunctionalGroupNames);
+ EXPECT_EQ(3u, FunctionalGroupNames.size());
+ ASSERT_TRUE(FunctionalGroupNames.end() !=
+ (it = FunctionalGroupNames.find(129372391)));
+ EXPECT_EQ("", it->second.first);
+ EXPECT_EQ("pre_DataConsent", it->second.second);
+
+ ASSERT_TRUE(FunctionalGroupNames.end() !=
+ (it = FunctionalGroupNames.find(156072572)));
+ EXPECT_EQ("Location", it->second.first);
+ EXPECT_EQ("Location-1", it->second.second);
+
+ ASSERT_TRUE(FunctionalGroupNames.end() !=
+ (it = FunctionalGroupNames.find(1809526495)));
+ EXPECT_EQ("Notifications", it->second.first);
+ EXPECT_EQ("Notifications", it->second.second);
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ RemoveAppConsentForGroup_SetAppConsentThenRemove_ExpectAppConsentForGroupRemoved) {
+ // Arrange
+ const std::string query_insert_pre_DataConsent =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (129372391, '', 'pre_DataConsent')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_pre_DataConsent));
+
+ const std::string query_insert_Notifications =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (1809526495, 'Notifications', 'Notifications')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Notifications));
+
+ const std::string query_insert_Location =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (156072572, 'Location', 'Location-1')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_Location));
+
+ const std::string query_insert_consent_group_1 =
+ "INSERT INTO `consent_group` (`device_id`, 'application_id' , "
+ "`functional_group_id`, `is_consented`, `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', '1234', 1809526495, 1,'GUI', "
+ "'2014-01-01T00:00:52Z')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_consent_group_1));
+
+ const std::string query_insert_consent_group_2 =
+ "INSERT INTO `consent_group` (`device_id`, 'application_id' , "
+ "`functional_group_id`, `is_consented`, `input`, `time_stamp`) VALUES "
+ "('XXX12345ZZZ', '1234', 156072572, 1,'GUI', "
+ "'2015-01-01T00:00:52Z')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_consent_group_2));
+
+ GroupsAliasNameCollection allowed_groups;
+ allowed_groups.push_back(std::make_pair("Location", "Location-1"));
+ allowed_groups.push_back(std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection disallowed_groups;
+
+ FillPermissionStruct(
+ "XXX12345ZZZ", "1234", "VR", allowed_groups, disallowed_groups);
+ FunctionalIdType group_types;
+ ASSERT_TRUE(reps_->GetPermissionsForApp("XXX12345ZZZ", "1234", &group_types));
+ EXPECT_TRUE(
+ CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
+ group_types.clear();
+ reps_->RemoveAppConsentForGroup("1234", "Notifications");
+ ASSERT_TRUE(reps_->GetPermissionsForApp("XXX12345ZZZ", "1234", &group_types));
+ allowed_groups.pop_back();
+ EXPECT_TRUE(
+ CheckGroupTypesExist(group_types, allowed_groups, disallowed_groups));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ CleanUnpaireDevices_SetDevicesThenCleanup_ExpectDevicesDeleted) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps_->db());
+ reps_->SetDeviceData("XXX12345ZZZ",
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+
+ StringArray allowed_groups;
+ StringArray disallowed_groups;
+ EXPECT_TRUE(reps_->GetUserPermissionsForDevice(
+ "XXX12345ZZZ", &allowed_groups, &disallowed_groups));
+ EXPECT_EQ(0u, allowed_groups.size());
+ EXPECT_EQ(0u, disallowed_groups.size());
+ allowed_groups.push_back("DataConsent-2");
+ disallowed_groups.push_back("Navigation-1");
+ EXPECT_TRUE(reps_->SetUserPermissionsForDevice(
+ "XXX12345ZZZ", allowed_groups, disallowed_groups));
+
+ GroupsAliasNameCollection perm_allowed_groups;
+ perm_allowed_groups.push_back(
+ std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection perm_disallowed_groups;
+ perm_disallowed_groups.push_back(std::make_pair("Location", "Location-1"));
+ FillPermissionStruct("XXX12345ZZZ",
+ "12345",
+ "VR",
+ perm_allowed_groups,
+ perm_disallowed_groups);
+
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+
+ const std::string query_select_device =
+ "SELECT COUNT(*) FROM `device` WHERE `id` = 'XXX12345ZZZ'";
+ const std::string query_select_device_consent =
+ "SELECT COUNT(*) FROM `device_consent_group` WHERE `device_id` = "
+ "'XXX12345ZZZ'";
+ const std::string query_select_consent_group =
+ "SELECT COUNT(*) FROM `consent_group` WHERE `device_id` = 'XXX12345ZZZ'";
+
+ query.Prepare(query_select_device);
+ query.Next();
+ EXPECT_EQ(1, query.GetInteger(0));
+
+ query.Prepare(query_select_device_consent);
+ query.Next();
+ EXPECT_EQ(2, query.GetInteger(0));
+
+ query.Prepare(query_select_consent_group);
+ query.Next();
+ EXPECT_EQ(2, query.GetInteger(0));
+
+ EXPECT_TRUE(reps_->SetUnpairedDevice("XXX12345ZZZ", true));
+
+ std::vector<std::string> DeviceIds;
+ DeviceIds.push_back("XXX12345ZZZ");
+ EXPECT_TRUE(reps_->CleanupUnpairedDevices(DeviceIds));
+
+ // Assert
+ query.Prepare(query_select_device);
+ query.Next();
+ EXPECT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_device_consent);
+ query.Next();
+ EXPECT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_consent_group);
+ query.Next();
+ EXPECT_EQ(0, query.GetInteger(0));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ SetDefaultPolicy_SetPredataThenChangeToDefaultPolicy_ExpectDefaultPolicySet) {
+ // Arrange
+ const std::string query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, "
+ "0, 64, 10) ";
+
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
+ GroupsAliasNameCollection allowed_groups;
+ allowed_groups.push_back(std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection disallowed_groups;
+ disallowed_groups.push_back(std::make_pair("DataConsent", "DataConsent-2"));
+ FillPermissionStruct(
+ "XXX12345ZZZ", "12345", "VR", allowed_groups, disallowed_groups);
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+ // Act
+ ASSERT_TRUE(reps_->SetIsPredata("12345", true));
+ // Check
+ EXPECT_TRUE(reps_->IsPredataPolicy("12345"));
+ // Act
+ EXPECT_TRUE(reps_->SetDefaultPolicy("12345"));
+ // Check
+ EXPECT_TRUE(reps_->IsDefaultPolicy("12345"));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ SetIsPreData_SetSpecificPoliciesThenSetIsPredata_ExpectPreDataSet) {
+ // Arrange
+ const std::string query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, "
+ "0, 64, 10) ";
+
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
+ GroupsAliasNameCollection allowed_groups;
+ allowed_groups.push_back(std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection disallowed_groups;
+ disallowed_groups.push_back(std::make_pair("DataConsent", "DataConsent-2"));
+ FillPermissionStruct(
+ "XXX12345ZZZ", "12345", "VR", allowed_groups, disallowed_groups);
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+ EXPECT_FALSE(reps_->IsPredataPolicy("12345"));
+ // Act
+ ASSERT_TRUE(reps_->SetIsPredata("12345", false));
+ // Check
+ EXPECT_FALSE(reps_->IsPredataPolicy("12345"));
+ // Act
+ ASSERT_TRUE(reps_->SetIsPredata("12345", true));
+ // Check
+ EXPECT_TRUE(reps_->IsPredataPolicy("12345"));
+}
+
+TEST_F(
+ SQLPTExtRepresentationTest,
+ SetPreDataPolicy_SetSpecificPoliciesThenSetPredataPolicy_ExpectPreDataPolicySet) {
+ // Arrange
+ const std::string query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, "
+ "0, 64, 10) ";
+
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
+ GroupsAliasNameCollection allowed_groups;
+ allowed_groups.push_back(std::make_pair("Notifications", "Notifications"));
+
+ GroupsAliasNameCollection disallowed_groups;
+ disallowed_groups.push_back(std::make_pair("DataConsent", "DataConsent-2"));
+ FillPermissionStruct(
+ "XXX12345ZZZ", "12345", "VR", allowed_groups, disallowed_groups);
+ EXPECT_TRUE(reps_->SetUserPermissionsForApp(perm_consent));
+ EXPECT_FALSE(reps_->IsPredataPolicy("12345"));
+ // Act
+ ASSERT_TRUE(reps_->SetPredataPolicy("12345"));
+ // Check
+ EXPECT_TRUE(reps_->IsPredataPolicy("12345"));
+}
+
+TEST_F(SQLPTExtRepresentationTest,
+ IsPreDataPolicy_SetPredataPolicy_ExpectPreDataPolicySet) {
+ // Arrange
+ const std::string query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, 0, "
+ "1, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
+ // Check
+ EXPECT_TRUE(reps_->IsPredataPolicy("12345"));
+}
+
+TEST_F(SQLPTExtRepresentationTest, SaveUserConsentRecords_ExpectedSaved) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ const std::string device_id = "test_device_id";
+ const std::string app_id = "test_app_id";
+ const std::string external_consent_group = "ExternalConsentGroup";
+ const std::string consent_group = "ConsentGroup";
+ const std::string time_stamp = "2016-08-29T17:12:07Z";
+ const Input input = Input::I_GUI;
+
+ Table original_table;
+ UserConsentRecords& user_consent_records =
+ *(*original_table.policy_table.device_data)[device_id]
+ .user_consent_records;
+
+ UserConsentRecords::mapped_type& app_records = user_consent_records[app_id];
+
+ app_records.external_consent_status_groups->insert(
+ std::make_pair(external_consent_group, Boolean(true)));
+
+ app_records.consent_groups->insert(
+ std::make_pair(consent_group, Boolean(true)));
+
+ *app_records.input = input;
+ *app_records.time_stamp = time_stamp;
+
+ // Act
+ EXPECT_TRUE(reps_->Save(original_table));
+ utils::SharedPtr<Table> loaded_table = reps_->GenerateSnapshot();
+
+ // GetData/GetKeyData methods do internal existence check - no need to do it
+ // separately. In case of data is missing expectations will be violated.
+ DeviceData device_data = GetData<Table, DeviceData>(*loaded_table);
+
+ policy_table::DeviceParams device_parameters =
+ GetKeyData<DeviceData, policy_table::DeviceParams>(device_data,
+ device_id);
+
+ ConsentRecords consents = GetKeyData<UserConsentRecords, ConsentRecords>(
+ *device_parameters.user_consent_records, app_id);
+
+ EXPECT_TRUE(
+ (IsKeyExist<ConsentGroups>(*consents.consent_groups, consent_group)));
+ EXPECT_TRUE((IsKeyExist<ConsentGroups>(
+ *consents.external_consent_status_groups, external_consent_group)));
+ EXPECT_EQ((String<1, 255>(time_stamp)), *consents.time_stamp);
+ EXPECT_EQ(input, *consents.input);
+}
+
+TEST_F(SQLPTExtRepresentationTest, SaveFunctionalGroupings_ExpectedSaved) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ const std::string group_name = "GroupName";
+ const std::string another_group_name = "AnotherGroup";
+ const std::string rpc_name = "RpcName";
+ const std::string user_consent_prompt = "TestConsentPrompt";
+ const std::string another_user_consent_prompt = "AnotherTestConsentPrompt";
+ ExternalConsentEntity off_entity_1(0, 0);
+ ExternalConsentEntity off_entity_2(0, 1);
+ ExternalConsentEntity on_entity_1(1, 0);
+ ExternalConsentEntity on_entity_2(1, 1);
+
+ const HmiLevel test_level_1 = HL_FULL;
+ const HmiLevel test_level_2 = HL_LIMITED;
+ const policy_table::Parameter test_parameter_1 = P_GPS;
+ const policy_table::Parameter test_parameter_2 = P_SPEED;
+
+ Rpcs rpcs;
+
+ rpcs.disallowed_by_external_consent_entities_off->push_back(off_entity_1);
+ rpcs.disallowed_by_external_consent_entities_off->push_back(off_entity_2);
+
+ rpcs.disallowed_by_external_consent_entities_on->push_back(on_entity_1);
+ rpcs.disallowed_by_external_consent_entities_on->push_back(on_entity_2);
+
+ *rpcs.user_consent_prompt = user_consent_prompt;
+
+ RpcParameters parameters;
+ parameters.hmi_levels.push_back(test_level_1);
+ parameters.hmi_levels.push_back(test_level_2);
+ parameters.parameters->push_back(test_parameter_1);
+ parameters.parameters->push_back(test_parameter_2);
+ rpcs.rpcs.insert(std::make_pair(rpc_name, parameters));
+
+ Table original_table;
+ FunctionalGroupings& groupings =
+ original_table.policy_table.functional_groupings;
+ groupings.insert(std::make_pair(group_name, rpcs));
+
+ ExternalConsentEntity off_entity_3(3, 4);
+ ExternalConsentEntity on_entity_3(5, 6);
+
+ Rpcs another_rpcs;
+
+ another_rpcs.disallowed_by_external_consent_entities_off->push_back(
+ off_entity_3);
+ another_rpcs.disallowed_by_external_consent_entities_on->push_back(
+ on_entity_3);
+ *another_rpcs.user_consent_prompt = another_user_consent_prompt;
+
+ const HmiLevel test_level_3 = HL_BACKGROUND;
+ const policy_table::Parameter test_parameter_3 = P_BELTSTATUS;
+
+ RpcParameters another_parameters;
+ another_parameters.hmi_levels.push_back(test_level_3);
+ another_parameters.parameters->push_back(test_parameter_3);
+ another_rpcs.rpcs.insert(std::make_pair(rpc_name, another_parameters));
+
+ groupings.insert(std::make_pair(another_group_name, another_rpcs));
+
+ // Act
+ EXPECT_TRUE(reps_->Save(original_table));
+ utils::SharedPtr<Table> loaded_table = reps_->GenerateSnapshot();
+
+ FunctionalGroupings loaded_groupings =
+ GetData<Table, FunctionalGroupings>(*loaded_table);
+
+ Rpcs loaded_rpcs =
+ GetKeyData<FunctionalGroupings, Rpcs>(loaded_groupings, group_name);
+
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *loaded_rpcs.disallowed_by_external_consent_entities_off, off_entity_1)));
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *loaded_rpcs.disallowed_by_external_consent_entities_off, off_entity_2)));
+
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *loaded_rpcs.disallowed_by_external_consent_entities_on, on_entity_1)));
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *loaded_rpcs.disallowed_by_external_consent_entities_on, on_entity_2)));
+
+ RpcParameters loaded_parameters =
+ GetKeyData<Rpc, RpcParameters>(loaded_rpcs.rpcs, rpc_name);
+
+ EXPECT_TRUE(
+ (IsKeyExist<HmiLevels>(loaded_parameters.hmi_levels, test_level_1)));
+ EXPECT_TRUE(
+ (IsKeyExist<HmiLevels>(loaded_parameters.hmi_levels, test_level_2)));
+
+ EXPECT_TRUE((
+ IsKeyExist<Parameters>(*loaded_parameters.parameters, test_parameter_1)));
+ EXPECT_TRUE((
+ IsKeyExist<Parameters>(*loaded_parameters.parameters, test_parameter_2)));
+
+ Rpcs another_loaded_rpcs = GetKeyData<FunctionalGroupings, Rpcs>(
+ loaded_groupings, another_group_name);
+
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *another_loaded_rpcs.disallowed_by_external_consent_entities_off,
+ off_entity_3)));
+
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *another_loaded_rpcs.disallowed_by_external_consent_entities_on,
+ on_entity_3)));
+
+ RpcParameters another_loaded_parameters =
+ GetKeyData<Rpc, RpcParameters>(another_loaded_rpcs.rpcs, rpc_name);
+
+ EXPECT_TRUE((IsKeyExist<HmiLevels>(another_loaded_parameters.hmi_levels,
+ test_level_3)));
+
+ EXPECT_TRUE((IsKeyExist<Parameters>(*another_loaded_parameters.parameters,
+ test_parameter_3)));
+}
+
+TEST_F(SQLPTExtRepresentationTest, JsonContentsExternalConsent_ExpectParsed) {
+ using namespace policy_table;
+ using namespace rpc;
+
+ const std::string group_name = "GroupName";
+ const int32_t entity_on_type = 1;
+ const int32_t entity_on_id = 2;
+ const int32_t entity_off_type = 3;
+ const int32_t entity_off_id = 4;
+
+ Json::Value json_table(Json::objectValue);
+ json_table["policy_table"] = Json::Value(Json::objectValue);
+
+ Json::Value& policy_table = json_table["policy_table"];
+ policy_table["functional_groupings"] = Json::Value(Json::objectValue);
+
+ Json::Value& functional_groupings = policy_table["functional_groupings"];
+ functional_groupings[group_name] = Json::Value(Json::objectValue);
+ functional_groupings[group_name]["rpcs"];
+
+ Json::Value entity_on = Json::Value(Json::objectValue);
+ entity_on["entityType"] = entity_on_type;
+ entity_on["entityID"] = entity_on_id;
+
+ functional_groupings[group_name]["disallowed_by_external_consent_entities_on"]
+ [0] = entity_on;
+
+ Json::Value entity_off = Json::Value(Json::objectValue);
+ entity_off["entityType"] = entity_off_type;
+ entity_off["entityID"] = entity_off_id;
+ functional_groupings[group_name]
+ ["disallowed_by_external_consent_entities_off"][0] =
+ entity_off;
+
+ policy_table::Table parsed_table(&json_table);
+
+ FunctionalGroupings loaded_groupings =
+ GetData<Table, FunctionalGroupings>(parsed_table);
+
+ Rpcs loaded_rpcs =
+ GetKeyData<FunctionalGroupings, Rpcs>(loaded_groupings, group_name);
+
+ ExternalConsentEntity off_entity_1(entity_off_type, entity_off_id);
+ ExternalConsentEntity on_entity_1(entity_on_type, entity_on_id);
+
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *loaded_rpcs.disallowed_by_external_consent_entities_off, off_entity_1)));
+
+ EXPECT_TRUE((IsKeyExist<DisallowedByExternalConsentEntities>(
+ *loaded_rpcs.disallowed_by_external_consent_entities_on, on_entity_1)));
+}
+
+TEST_F(SQLPTExtRepresentationTest, SaveExternalConsentStatus_ExpectSaved) {
+ ExternalConsentStatusItem item_1(0, 0, kStatusOn);
+ ExternalConsentStatusItem item_2(1, 1, kStatusOff);
+ ExternalConsentStatus in_status;
+ in_status.insert(item_1);
+ in_status.insert(item_2);
+
+ EXPECT_TRUE(reps_->SaveExternalConsentStatus(in_status));
+
+ ExternalConsentStatus out_status = reps_->GetExternalConsentStatus();
+ EXPECT_TRUE(in_status.size() == out_status.size());
+
+ EXPECT_TRUE(out_status.end() !=
+ find(out_status.begin(), out_status.end(), item_1));
+ EXPECT_TRUE(out_status.end() !=
+ find(out_status.begin(), out_status.end(), item_2));
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
new file mode 100644
index 0000000000..a657a01145
--- /dev/null
+++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc
@@ -0,0 +1,1856 @@
+/* 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 <string>
+#include <algorithm>
+#include <fstream>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <memory>
+
+#include "gtest/gtest.h"
+#include "policy/sql_pt_representation.h"
+#include "utils/file_system.h"
+#include "utils/system.h"
+#include "policy/sql_wrapper.h"
+#include "policy/policy_types.h"
+#include "json/writer.h"
+#include "json/reader.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_table/enums.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/mock_policy_settings.h"
+#include "utils/shared_ptr.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+using policy::SQLPTRepresentation;
+using policy::CheckPermissionResult;
+using policy::UserFriendlyMessage;
+using policy::EndpointUrls;
+using policy::VehicleInfo;
+
+using testing::ReturnRef;
+using testing::Return;
+using testing::NiceMock;
+using testing::Mock;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+namespace {
+const int32_t kPolicyTablesNumber = 27;
+}
+
+class SQLPTRepresentationTest : public SQLPTRepresentation,
+ public ::testing::Test {
+ public:
+ static const bool in_memory_;
+
+ protected:
+ static SQLPTRepresentation* reps;
+ static const std::string kDatabaseName;
+ static utils::dbms::SQLQuery* query_wrapper_;
+ // Gtest can show message that this object doesn't destroyed
+ static std::auto_ptr<policy_handler_test::MockPolicySettings>
+ policy_settings_;
+
+ static void SetUpTestCase() {
+ const std::string kAppStorageFolder = "storage_SQLPTRepresentationTest";
+ reps = new SQLPTRepresentation(in_memory_);
+ ASSERT_TRUE(reps != NULL);
+ policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>(
+ new policy_handler_test::MockPolicySettings());
+ ON_CALL(*policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ EXPECT_EQ(::policy::SUCCESS, reps->Init(policy_settings_.get()));
+ query_wrapper_ = new utils::dbms::SQLQuery(reps->db());
+ ASSERT_TRUE(query_wrapper_ != NULL);
+ }
+
+ void TearDown() OVERRIDE {
+ EXPECT_TRUE(reps->Clear());
+ }
+
+ static void TearDownTestCase() {
+ delete query_wrapper_;
+ EXPECT_TRUE(reps->Drop());
+ EXPECT_TRUE(reps->Close());
+ reps->RemoveDB();
+ delete reps;
+ policy_settings_.reset();
+ }
+
+ virtual utils::dbms::SQLDatabase* db() const {
+ return reps->db();
+ }
+
+ void GatherModuleMeta(policy_table::ModuleMeta* meta) const {
+ ::SQLPTRepresentation::GatherModuleMeta(meta);
+ }
+
+ void GatherModuleConfig(policy_table::ModuleConfig* config) const {
+ ::SQLPTRepresentation::GatherModuleConfig(config);
+ }
+
+ bool GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const {
+ return ::SQLPTRepresentation::GatherUsageAndErrorCounts(counts);
+ }
+
+ bool GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const {
+ return ::SQLPTRepresentation::GatherApplicationPoliciesSection(policies);
+ }
+ virtual void GatherDeviceData(policy_table::DeviceData* data) const {
+ ::SQLPTRepresentation::GatherDeviceData(data);
+ }
+
+ virtual bool GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) const {
+ return ::SQLPTRepresentation::GatherConsumerFriendlyMessages(messages);
+ }
+
+ bool GatherAppGroup(const std::string& app_id,
+ policy_table::Strings* app_groups) const {
+ return ::SQLPTRepresentation::GatherAppGroup(app_id, app_groups);
+ }
+
+ bool GatherAppType(const std::string& app_id,
+ policy_table::AppHMITypes* app_types) const {
+ return ::SQLPTRepresentation::GatherAppType(app_id, app_types);
+ }
+
+ bool GatherRequestType(const std::string& app_id,
+ policy_table::RequestTypes* request_types) const {
+ return ::SQLPTRepresentation::GatherRequestType(app_id, request_types);
+ }
+
+ bool GatherNickName(const std::string& app_id,
+ policy_table::Strings* nicknames) const {
+ return ::SQLPTRepresentation::GatherNickName(app_id, nicknames);
+ }
+
+ void CheckAppPoliciesSection(
+ policy_table::ApplicationPoliciesSection& policies,
+ uint16_t apps_size,
+ policy_table::Priority prio,
+ const std::string& section,
+ uint16_t memory_kb,
+ uint32_t heart_beat_timeout_ms,
+ policy_table::Strings& groups) const {
+ if (section != "device") {
+ policy_table::ApplicationPolicies& apps = policies.apps;
+ EXPECT_EQ(apps_size, apps.size());
+ policy_table::ApplicationPolicies::iterator apps_iter =
+ apps.find(section);
+ ASSERT_TRUE(apps.end() != apps_iter);
+ policy_table::Strings& temp_groups = apps_iter->second.groups;
+ StringsCompare(groups, temp_groups);
+ EXPECT_EQ(0u, (*(apps_iter->second.nicknames)).size());
+ EXPECT_EQ(prio, apps_iter->second.priority);
+ EXPECT_EQ(0u, (*(apps_iter->second.AppHMIType)).size());
+ EXPECT_EQ(memory_kb, (*(apps_iter->second.memory_kb)));
+ EXPECT_EQ(heart_beat_timeout_ms,
+ (*(apps_iter->second.heart_beat_timeout_ms)));
+ } else {
+ policy_table::DevicePolicy& device = policies.device;
+ EXPECT_EQ(prio, device.priority);
+ }
+ }
+
+ void StringsCompare(policy_table::Strings& groups1,
+ policy_table::Strings& groups2) const {
+ EXPECT_EQ(groups1.size(), groups2.size());
+ std::sort(groups1.begin(), groups1.end());
+ std::sort(groups2.begin(), groups2.end());
+ EXPECT_TRUE(groups1 == groups2);
+ }
+
+ void CheckAppGroups(const std::string& app_id,
+ policy_table::Strings& groups) {
+ policy_table::Strings app_groups;
+ GatherAppGroup(app_id, &app_groups);
+ StringsCompare(groups, app_groups);
+ }
+
+ void PolicyTableUpdatePrepare(Json::Value& table) {
+ PolicyTableUpdatePrepareNoParameters(table);
+
+ table["policy_table"]["functional_groupings"]["default"]["rpcs"]["Update"]
+ ["parameters"] = Json::Value(Json::arrayValue);
+ table["policy_table"]["functional_groupings"]["default"]["rpcs"]["Update"]
+ ["parameters"][0] = Json::Value("speed");
+ }
+
+ void PolicyTableUpdatePrepareEmptyParameters(Json::Value& table) {
+ PolicyTableUpdatePrepareNoParameters(table);
+
+ // Parameters are empty
+ table["policy_table"]["functional_groupings"]["default"]["rpcs"]["Update"]
+ ["parameters"] = Json::Value(Json::arrayValue);
+ }
+
+ void PolicyTableUpdatePrepareNoParameters(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_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");
+ // No parameters
+
+ 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);
+ }
+ }
+};
+
+SQLPTRepresentation* SQLPTRepresentationTest::reps = 0;
+utils::dbms::SQLQuery* SQLPTRepresentationTest::query_wrapper_ = 0;
+const std::string SQLPTRepresentationTest::kDatabaseName = ":memory:";
+const bool SQLPTRepresentationTest::in_memory_ = true;
+std::auto_ptr<policy_handler_test::MockPolicySettings>
+ SQLPTRepresentationTest::policy_settings_;
+
+class SQLPTRepresentationTest2 : public ::testing::Test {
+ protected:
+ SQLPTRepresentation* reps;
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ virtual void SetUp() OVERRIDE {
+ file_system::CreateDirectory(kAppStorageFolder);
+ chmod(kAppStorageFolder.c_str(), 00000);
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, open_attempt_timeout_ms())
+ .WillByDefault(Return(kOpenAttemptTimeoutMs));
+ ON_CALL(policy_settings_, attempts_to_open_policy_db())
+ .WillByDefault(Return(kAttemptsToOpenPolicyDB));
+ reps = new SQLPTRepresentation;
+ ASSERT_TRUE(reps != NULL);
+ }
+
+ virtual void TearDown() OVERRIDE {
+ file_system::RemoveDirectory(kAppStorageFolder, true);
+ delete reps;
+ }
+ const std::string kAppStorageFolder = "storage123";
+ const uint16_t kOpenAttemptTimeoutMs = 70u;
+ const uint16_t kAttemptsToOpenPolicyDB = 2u;
+};
+
+TEST_F(SQLPTRepresentationTest2,
+ CheckActualAttemptsToOpenDB_ExpectCorrectNumber) {
+ EXPECT_EQ(::policy::FAIL, reps->Init(&policy_settings_));
+ // Check Actual attempts number made to try to open DB
+ EXPECT_EQ(kAttemptsToOpenPolicyDB, reps->open_counter());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ RefreshDB_DropExistedPTThenRefreshDB_ExpectTablesWithInitialData) {
+ // Check
+ utils::dbms::SQLQuery query(reps->db());
+ const std::string query_select =
+ "SELECT COUNT(*) FROM sqlite_master WHERE `type` = 'table'";
+ // In normally created PT there are more than 0 tables
+ query.Prepare(query_select);
+ query.Next();
+ ASSERT_GT(query.GetInteger(0), 0);
+ query.Finalize();
+
+ ASSERT_TRUE(reps->Drop());
+ query.Prepare(query_select);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+ query.Finalize();
+
+ ASSERT_TRUE(reps->RefreshDB());
+ // Check PT structure destroyed and tables number is 0
+ query.Prepare(query_select);
+ query.Next();
+
+ const int policy_tables_number = 32;
+ ASSERT_EQ(policy_tables_number, query.GetInteger(0));
+
+ const std::string query_select_count_of_iap_buffer_full =
+ "SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`";
+ const std::string query_select_count_sync_out_of_memory =
+ "SELECT `count_sync_out_of_memory` FROM `usage_and_error_count`";
+ const std::string query_select_count_of_sync_reboots =
+ "SELECT `count_of_sync_reboots` FROM `usage_and_error_count`";
+ const std::string query_select_pt_exchanged_at_odometer_x =
+ "SELECT `pt_exchanged_at_odometer_x` FROM `module_meta`";
+ const std::string query_select_pt_exchanged_x_days_after_epoch =
+ "SELECT `pt_exchanged_x_days_after_epoch` FROM `module_meta`";
+ const std::string query_select_flag_update_required =
+ "SELECT `flag_update_required` FROM `module_meta`";
+ const std::string query_select_ignition_cycles_since_last_exchange =
+ "SELECT `ignition_cycles_since_last_exchange` FROM `module_meta`";
+ const std::string query_select_preloaded_pt =
+ "SELECT `preloaded_pt` FROM `module_config`";
+ const std::string query_select_is_first_run =
+ "SELECT `is_first_run` FROM `module_config`";
+ const std::string query_select_exchange_after_x_ignition_cycles =
+ "SELECT `exchange_after_x_ignition_cycles` FROM `module_config`";
+ const std::string query_select_exchange_after_x_kilometers =
+ "SELECT `exchange_after_x_kilometers` FROM `module_config`";
+ const std::string query_select_exchange_after_x_days =
+ "SELECT `exchange_after_x_days` FROM `module_config`";
+ const std::string query_select_timeout_after_x_seconds =
+ "SELECT `timeout_after_x_seconds` FROM `module_config`";
+ const std::string query_select_priorities =
+ "SELECT COUNT(`value`) FROM `priority`";
+ const std::string query_select_hmi_levels =
+ "SELECT COUNT(`value`) FROM `hmi_level`";
+ const std::string query_select_version = "SELECT `number` FROM `version`";
+
+ query.Prepare(query_select_count_of_iap_buffer_full);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_count_sync_out_of_memory);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_count_of_sync_reboots);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_pt_exchanged_at_odometer_x);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_pt_exchanged_x_days_after_epoch);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_ignition_cycles_since_last_exchange);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_flag_update_required);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_preloaded_pt);
+ query.Next();
+ ASSERT_EQ(1, query.GetInteger(0));
+
+ query.Prepare(query_select_is_first_run);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_exchange_after_x_ignition_cycles);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_exchange_after_x_kilometers);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_exchange_after_x_days);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_timeout_after_x_seconds);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_priorities);
+ query.Next();
+ ASSERT_EQ(6, query.GetInteger(0));
+
+ query.Prepare(query_select_hmi_levels);
+ query.Next();
+ ASSERT_EQ(4, query.GetInteger(0));
+
+ query.Prepare(query_select_version);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ CheckPermissionsAllowed_SetValuesInAppGroupRpcFunctionalGroup_GetEqualParamsInCheckPermissionResult) {
+ // Arrange
+ const std::string 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);";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->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_TRUE(ret.list_of_allowed_params.end() !=
+ ret.list_of_allowed_params.find("gps"));
+ EXPECT_TRUE(ret.list_of_allowed_params.end() !=
+ ret.list_of_allowed_params.find("speed"));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ CheckPermissionsAllowedWithoutParameters_SetLimitedPermissions_ExpectEmptyListOfAllowedParams) {
+ // Arrange
+ const std::string 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);";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->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,
+ CheckPermissionsDisallowedWithoutParameters_DeletedAppGroupAndSetFULLLevel_ExpectHmiLevelIsDissalowed) {
+ // Arrange
+ const std::string query = "DELETE FROM `app_group`";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->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,
+ PTPReloaded_UpdateModuleConfig_ReturnIsPTPreloadedTRUE) {
+ // Arrange
+ const std::string query = "UPDATE `module_config` SET `preloaded_pt` = 1";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query));
+ EXPECT_TRUE(reps->IsPTPreloaded());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ GetUpdateUrls_DeleteAndInsertEndpoints_ExpectUpdateUrls) {
+ // Arrange
+ const std::string query_delete = "DELETE FROM `endpoint`; ";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+
+ // Act
+ EndpointUrls ret = reps->GetUpdateUrls(7);
+
+ // Assert
+ EXPECT_TRUE(ret.empty());
+
+ // Act
+ const std::string 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);";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->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,
+ IgnitionCyclesBeforeExchange_WithParametersOfQueryEqualZero) {
+ // Arrange
+ const std::string query_zeros =
+ "UPDATE `module_meta` SET "
+ " `ignition_cycles_since_last_exchange` = 0; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 0";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_zeros));
+ EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+
+ // Act
+ reps->IncrementIgnitionCycles();
+
+ // Assert
+ EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IgnitionCyclesBeforeExchange_WithParametersOfQueryAreLessLimit) {
+ // Arrange
+ const std::string query_less_limit =
+ "UPDATE `module_meta` SET "
+ " `ignition_cycles_since_last_exchange` = 5; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->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 std::string query_limit =
+ "UPDATE `module_meta` SET "
+ " `ignition_cycles_since_last_exchange` = 9; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_limit));
+ EXPECT_EQ(1, reps->IgnitionCyclesBeforeExchange());
+ // Act
+ reps->IncrementIgnitionCycles();
+ // Assert
+ EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IgnitionCyclesBeforeExchange_WithMoreLimitCountOfParametersOfQuery) {
+ // Arrange
+ const std::string query_more_limit =
+ "UPDATE `module_meta` SET "
+ " `ignition_cycles_since_last_exchange` = 12; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 10";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_more_limit));
+ // Chceck
+ EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IgnitionCyclesBeforeExchange_WithNegativeLimitOfParametersOfQuery) {
+ // Arrange
+ const std::string query_negative_limit =
+ "UPDATE `module_meta` SET "
+ " `ignition_cycles_since_last_exchange` = 3; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = -1";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_negative_limit));
+ // Check
+ EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ IgnitionCyclesBeforeExchange_WithNegativeLimitOfCurrentParameterOfQuery) {
+ // Arrange
+ const std::string query_negative_current =
+ "UPDATE `module_meta` SET "
+ " `ignition_cycles_since_last_exchange` = -1; "
+ " UPDATE `module_config` SET `exchange_after_x_ignition_cycles` = 2";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_negative_current));
+ // Check
+ EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ KilometersBeforeExchange_WithParametersOfQueryEqualZero) {
+ // Arrange
+ const std::string query_zeros =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_at_odometer_x` = 0; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = 0";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_zeros));
+ // Checks
+ 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 std::string query_negative_limit =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_at_odometer_x` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = -10";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_negative_limit));
+ // Checks
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(0));
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ KilometersBeforeExchange_QueryWithNegativeCurrentLimit) {
+ // Arrange
+ const std::string query_negative_last =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_at_odometer_x` = -10; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = 20";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_negative_last));
+ // Checks
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(0));
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ KilometersBeforeExchange_QueryWithLimitParameters) {
+ // Arrange
+ const std::string query_limit =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_at_odometer_x` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_kilometers` = 100";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_limit));
+ // Checks
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(120));
+ EXPECT_EQ(60, reps->KilometersBeforeExchange(50));
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(5));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ DaysBeforeExchange_WithParametersOfQueryEqualZero) {
+ // Arrange
+ const std::string query_zeros =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_x_days_after_epoch` = 0; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = 0";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_zeros));
+ // Checks
+ 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 std::string query_negative_limit =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_x_days_after_epoch` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = -10";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_negative_limit));
+ // Checks
+ EXPECT_EQ(0, reps->DaysBeforeExchange(0));
+ EXPECT_EQ(0, reps->DaysBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ DaysBeforeExchange_QueryWithNegativeCurrentLimit) {
+ // Arrange
+ const std::string query_negative_last =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_x_days_after_epoch` = -10; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = 20";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_negative_last));
+ // Checks
+ EXPECT_EQ(0, reps->DaysBeforeExchange(0));
+ EXPECT_EQ(0, reps->DaysBeforeExchange(10));
+}
+
+TEST_F(SQLPTRepresentationTest, DaysBeforeExchange_QueryWithLimitParameters) {
+ // Arrange
+ const std::string query_limit =
+ "UPDATE `module_meta` SET "
+ " `pt_exchanged_x_days_after_epoch` = 10; "
+ " UPDATE `module_config` SET `exchange_after_x_days` = 100";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_limit));
+ // Checks
+ EXPECT_EQ(0, reps->DaysBeforeExchange(120));
+ EXPECT_EQ(60, reps->DaysBeforeExchange(50));
+ EXPECT_EQ(0, reps->DaysBeforeExchange(5));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ SecondsBetweenRetries_DeletedAndInsertedSecondsBetweenRetry_ExpectCountOfSecondsEqualInserted) {
+ // Arrange
+ std::vector<int> seconds;
+ const std::string query_delete = "DELETE FROM `seconds_between_retry`; ";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_delete));
+ ASSERT_TRUE(reps->SecondsBetweenRetries(&seconds));
+ EXPECT_EQ(0u, seconds.size());
+
+ // Arrange
+ const std::string query_insert =
+ "INSERT INTO `seconds_between_retry` (`index`, `value`) "
+ " VALUES (0, 10); "
+ "INSERT INTO `seconds_between_retry` (`index`, `value`) "
+ " VALUES (1, 20); ";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert));
+ ASSERT_TRUE(reps->SecondsBetweenRetries(&seconds));
+ // Checks
+ ASSERT_EQ(2u, seconds.size());
+ EXPECT_EQ(10, seconds[0]);
+ EXPECT_EQ(20, seconds[1]);
+}
+
+TEST_F(SQLPTRepresentationTest, TimeoutResponse_Set60Seconds_GetEqualTimeout) {
+ // Arrange
+ const std::string query =
+ "UPDATE `module_config` SET `timeout_after_x_seconds` = 60";
+
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query));
+ // Check
+ EXPECT_EQ(60000, reps->TimeoutResponse());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsPTPreloaded_SetPTPreloadedThenCheck_ExpectCorrectValue) {
+ // Arrange
+ const std::string query_insert =
+ "UPDATE `module_config` SET `preloaded_pt` = 1";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert));
+ // Check
+ ASSERT_TRUE(reps->IsPTPreloaded());
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ SetCountersPassedForSuccessfulUpdate_SetCounters_ExpectValueChangedInPT) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps->db());
+ const std::string query_select_odometer =
+ "SELECT `pt_exchanged_at_odometer_x` FROM`module_meta`";
+ const std::string query_select_days_after_epoch =
+ "SELECT `pt_exchanged_x_days_after_epoch` FROM`module_meta`";
+ query.Prepare(query_select_odometer);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ query.Prepare(query_select_days_after_epoch);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+
+ // Act
+ ASSERT_TRUE(reps->SetCountersPassedForSuccessfulUpdate(100, 10000));
+ query.Prepare(query_select_odometer);
+ query.Next();
+ ASSERT_EQ(100, query.GetInteger(0));
+
+ query.Prepare(query_select_days_after_epoch);
+ query.Next();
+ ASSERT_EQ(10000, query.GetInteger(0));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ IncrementIgnitionCycles_SetIgnitionCyclesValueThenIncrement_ExpectValueIncrementedInPT) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps->db());
+ const std::string query_insert =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 54";
+ const std::string query_select =
+ "SELECT `ignition_cycles_since_last_exchange`FROM `module_meta`";
+ ASSERT_TRUE(query.Exec(query_insert));
+ // Act
+ reps->IncrementIgnitionCycles();
+ // Check
+ query.Prepare(query_select);
+ query.Next();
+ ASSERT_EQ(55, query.GetInteger(0));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ ResetIgnitionCycles_SetIgnitionCyclesValueThenReset_ExpectZeroValueInPT) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps->db());
+ const std::string query_insert =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 55";
+ const std::string query_select =
+ "SELECT `ignition_cycles_since_last_exchange` FROM `module_meta`";
+ ASSERT_TRUE(query.Exec(query_insert));
+ // Act
+ reps->ResetIgnitionCycles();
+ // Check
+ query.Prepare(query_select);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ GetVehicleInfo_ManuallySetVehcleInfoThenCallGetVehicleInfo_ExpectValuesReceived) {
+ // Check
+ const std::string query_insert_module_config =
+ "UPDATE `module_config` SET `preloaded_pt` = 1, "
+ " `exchange_after_x_ignition_cycles` = 50,"
+ " `exchange_after_x_kilometers` = 2000, `exchange_after_x_days` = 30,"
+ " `timeout_after_x_seconds` = 5, `vehicle_make` = 'FORD', "
+ " `vehicle_model` = 'MUSTANG', `vehicle_year` = '2003', "
+ "`preloaded_date` = '25.04.2015'";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_module_config));
+ VehicleInfo info = reps->GetVehicleInfo();
+
+ ASSERT_EQ("FORD", info.vehicle_make);
+ ASSERT_EQ("MUSTANG", info.vehicle_model);
+ ASSERT_EQ("2003", info.vehicle_year);
+}
+
+TEST_F(SQLPTRepresentationTest,
+ GetUserFriendlyMsg_SetMsg_ExpectReceivedMsgSetInParams) {
+ // Arrange
+
+ const std::string query_insert_language_code =
+ "INSERT INTO `message` (`language_code`, `message_type_name`) VALUES "
+ "('en-en', 'AppPermissions')";
+
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_language_code));
+ const std::string query_insert_name =
+ "INSERT INTO `message_type` (`name`) VALUES ('AppPermissions')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_name));
+ std::vector<std::string> msg_code;
+ msg_code.push_back("AppPermissions");
+ // Act
+ std::vector<UserFriendlyMessage> result =
+ reps->GetUserFriendlyMsg(msg_code, std::string("en-en"));
+ // Checks
+ ASSERT_EQ(1u, result.size());
+ EXPECT_EQ(result[0].message_code, "AppPermissions");
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ GetNotificationNumber_SetNotificationsPriorities_ExpectReceivedValuesCorrect) {
+ // Arrange
+ const std::string query_insert =
+ "INSERT INTO `notifications_by_priority` (`priority_value`, `value`) "
+ "VALUES ('NAVIGATION', 15) , "
+ "('COMMUNICATION', 6), ('EMERGENCY', 60), ('NONE', 0), ('NORMAL', 4), "
+ "('VOICECOMMUNICATION', 20)";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert));
+ EXPECT_EQ(6, reps->GetNotificationsNumber("COMMUNICATION"));
+ EXPECT_EQ(60, reps->GetNotificationsNumber("EMERGENCY"));
+ EXPECT_EQ(15, reps->GetNotificationsNumber("NAVIGATION"));
+ EXPECT_EQ(0, reps->GetNotificationsNumber("NONE"));
+ EXPECT_EQ(4, reps->GetNotificationsNumber("NORMAL"));
+ EXPECT_EQ(20, reps->GetNotificationsNumber("VOICECOMMUNICATION"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ GetPriority_SetAppsPrioritiesThenGet_ExpectReceivedValuesCorrect) {
+ // Arrange
+ const std::string query_insert_app_default =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default));
+
+ const std::string query_insert_app_pre_DataConsent =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', "
+ "'NONE', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_pre_DataConsent));
+
+ const std::string query_insert_app_device =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
+ "'COMMUNICATION', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device));
+
+ const std::string query_insert_app_12345 =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345));
+
+ std::string priority;
+ // Checks
+ EXPECT_TRUE(reps->GetPriority("default", &priority));
+ EXPECT_EQ("NONE", priority);
+ EXPECT_TRUE(reps->GetPriority("pre_DataConsent", &priority));
+ EXPECT_EQ("NONE", priority);
+ EXPECT_TRUE(reps->GetPriority("device", &priority));
+ EXPECT_EQ("COMMUNICATION", priority);
+ EXPECT_TRUE(reps->GetPriority("12345", &priority));
+ EXPECT_EQ("EMERGENCY", priority);
+}
+
+namespace {
+const std::string kAppStorageFolder = "storage";
+}
+TEST(SQLPTRepresentationTest3, Init_InitNewDataBase_ExpectResultSuccess) {
+ // Arrange
+ const bool in_memory_ = true;
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ SQLPTRepresentation reps(in_memory_);
+ // Checks
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ EXPECT_EQ(::policy::SUCCESS, reps.Init(&policy_settings_));
+ EXPECT_EQ(::policy::EXISTS, reps.Init(&policy_settings_));
+ reps.RemoveDB();
+}
+
+TEST(SQLPTRepresentationTest3,
+ Init_TryInitNotExistingDataBase_ExpectResultFail) {
+ // Arrange
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ const std::string not_existing_path = "/not/existing/path";
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(not_existing_path));
+ SQLPTRepresentation reps;
+ // Check
+ EXPECT_EQ(::policy::FAIL, reps.Init(&policy_settings_));
+}
+
+TEST(SQLPTRepresentationTest3,
+ Close_InitNewDataBaseThenClose_ExpectResultSuccess) {
+ // Arrange
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ const bool in_memory_ = true;
+ SQLPTRepresentation reps(in_memory_);
+ EXPECT_EQ(::policy::SUCCESS, reps.Init(&policy_settings_));
+ EXPECT_TRUE(reps.Close());
+ utils::dbms::SQLError error(utils::dbms::Error::OK);
+ // Checks
+ EXPECT_EQ(error.number(), (reps.db()->LastError().number()));
+ reps.RemoveDB();
+}
+
+TEST_F(SQLPTRepresentationTest,
+ Clear_InitNewDataBaseThenClear_ExpectResultSuccess) {
+ // Arrange
+ const std::string query_insert_app_default =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default));
+
+ const std::string query_insert_app_pre_DataConsent =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', "
+ "'NONE', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_pre_DataConsent));
+
+ const std::string query_insert_app_device =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
+ "'COMMUNICATION', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device));
+
+ const std::string query_insert_app_12345 =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345));
+
+ const std::string query_insert =
+ "INSERT INTO `notifications_by_priority` (`priority_value`, `value`) "
+ "VALUES ('NAVIGATION', 15) , "
+ "('COMMUNICATION', 6), ('EMERGENCY', 60), ('NONE', 0), ('NORMAL', 4), "
+ "('VOICECOMMUNICATION', 20)";
+
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert));
+ EXPECT_TRUE(reps->Clear());
+ utils::dbms::SQLError error(utils::dbms::Error::OK);
+ EXPECT_EQ(error.number(), (reps->db()->LastError().number()));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ GetInitialAppData_SetData_ExpectCorrectValuesReceived) {
+ // Arrange
+ const std::string query_insert_nickname =
+ "INSERT INTO `nickname` (`application_id`, `name`)"
+ "VALUES ('1111', 'first_app') , "
+ "('2222', 'second_app'), ('3333', 'third_app')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_nickname));
+
+ const std::string query_insert_app_type =
+ "INSERT INTO `app_type` (`application_id`, `name`)"
+ "VALUES ('1111', 'NAVIGATION') , "
+ "('1111', 'MEDIA'), ('3333', 'COMMUNICATION')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_type));
+ ::policy::StringArray nicknames;
+ ::policy::StringArray app_types;
+ ASSERT_TRUE(reps->GetInitialAppData("1111", &nicknames, &app_types));
+ EXPECT_EQ(1u, nicknames.size());
+ EXPECT_TRUE(nicknames.end() !=
+ std::find(nicknames.begin(), nicknames.end(), "first_app"));
+ EXPECT_EQ(2u, app_types.size());
+ EXPECT_TRUE(app_types.end() !=
+ std::find(app_types.begin(), app_types.end(), "NAVIGATION"));
+ EXPECT_TRUE(app_types.end() !=
+ std::find(app_types.begin(), app_types.end(), "MEDIA"));
+ nicknames.clear();
+ app_types.clear();
+ ASSERT_TRUE(reps->GetInitialAppData("2222", &nicknames, &app_types));
+ EXPECT_EQ(1u, nicknames.size());
+ EXPECT_TRUE(nicknames.end() !=
+ std::find(nicknames.begin(), nicknames.end(), "second_app"));
+ EXPECT_EQ(0u, app_types.size());
+ nicknames.clear();
+ app_types.clear();
+ ASSERT_TRUE(reps->GetInitialAppData("3333", &nicknames, &app_types));
+ EXPECT_EQ(1u, nicknames.size());
+ EXPECT_TRUE(nicknames.end() !=
+ std::find(nicknames.begin(), nicknames.end(), "third_app"));
+ EXPECT_EQ(1u, app_types.size());
+ EXPECT_TRUE(app_types.end() !=
+ std::find(app_types.begin(), app_types.end(), "COMMUNICATION"));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ GetFunctionalGroupings_SetFunctionalGroupings_ExpectCorrectValuesReceived) {
+ // Arrange
+ const std::string query_insert_functional_group =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (73072936, null, 'SendLocation'), (1533011474, null, "
+ "'OnKeyboardInputOnlyGroup')";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_functional_group));
+
+ const std::string query_insert_SendLocation =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
+ "VALUES ('SendLocation', 'BACKGROUND', 73072936), ('SendLocation', "
+ "'FULL', 73072936), ('SendLocation', 'LIMITED', 73072936)";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_SendLocation));
+
+ const std::string query_insert_OnKeyboardInput =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
+ "VALUES ('OnKeyboardInput', 'FULL', 1533011474)";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_OnKeyboardInput));
+
+ policy_table::FunctionalGroupings func_groups;
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ EXPECT_EQ(2u, func_groups.size());
+ policy_table::FunctionalGroupings::iterator func_groups_it =
+ func_groups.find("SendLocation");
+ EXPECT_TRUE(func_groups.end() != func_groups_it);
+ policy_table::Rpcs& rpcs = func_groups_it->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ EXPECT_EQ(1u, rpc.size());
+ policy_table::Rpc::const_iterator rpc_it = rpc.find("SendLocation");
+ EXPECT_TRUE(rpc.end() != rpc_it);
+ const policy_table::HmiLevels& hmi_levels1 = rpc_it->second.hmi_levels;
+ EXPECT_EQ(3u, hmi_levels1.size());
+ EXPECT_TRUE(hmi_levels1.end() !=
+ std::find(hmi_levels1.begin(),
+ hmi_levels1.end(),
+ policy_table::HmiLevel::HL_BACKGROUND));
+ EXPECT_TRUE(hmi_levels1.end() !=
+ std::find(hmi_levels1.begin(),
+ hmi_levels1.end(),
+ policy_table::HmiLevel::HL_LIMITED));
+ EXPECT_TRUE(hmi_levels1.end() != std::find(hmi_levels1.begin(),
+ hmi_levels1.end(),
+ policy_table::HmiLevel::HL_FULL));
+
+ func_groups_it = func_groups.find("OnKeyboardInputOnlyGroup");
+ EXPECT_TRUE(func_groups.end() != func_groups_it);
+ policy_table::Rpcs& rpcs2 = func_groups_it->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs2.user_consent_prompt));
+ policy_table::Rpc& rpc2 = rpcs2.rpcs;
+ EXPECT_EQ(1u, rpc2.size());
+ rpc_it = rpc2.find("OnKeyboardInput");
+ EXPECT_TRUE(rpc2.end() != rpc_it);
+ const policy_table::HmiLevels& hmi_levels2 = rpc_it->second.hmi_levels;
+ EXPECT_EQ(1u, hmi_levels2.size());
+ EXPECT_TRUE(hmi_levels2.end() != std::find(hmi_levels2.begin(),
+ hmi_levels2.end(),
+ policy_table::HmiLevel::HL_FULL));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ UpdateRequired_SetUpdateNotRequiredFlagThenCheck_ExpectUpdateNotRequired) {
+ // Arrange
+ EXPECT_FALSE(reps->UpdateRequired());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ UpdateRequired_SetUpdateRequiredFlagThenCheck_ExpectUpdateRequired) {
+ // Arrange
+ const std::string query_insert =
+ "UPDATE `module_meta` SET `flag_update_required` = 1";
+ // Assert
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert));
+ // Check
+ EXPECT_TRUE(reps->UpdateRequired());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SaveUpdateRequired_SaveUpdateRequired_ExpectCorrectValues) {
+ // Arrange
+ reps->SaveUpdateRequired(true);
+ // Check
+ EXPECT_TRUE(reps->UpdateRequired());
+ // Act
+ reps->SaveUpdateRequired(false);
+ // Check
+ EXPECT_FALSE(reps->UpdateRequired());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsApplicationRepresented_Check_ExpectCorrectResult) {
+ // Arrange
+ const std::string query_insert_app_default =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default));
+
+ const std::string query_insert_app_device =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
+ "'COMMUNICATION', 0, 0, 0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_device));
+
+ const std::string query_insert_app_12345 =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345));
+ // Checks
+ EXPECT_TRUE(reps->IsApplicationRepresented("default"));
+ EXPECT_TRUE(reps->IsApplicationRepresented("device"));
+ EXPECT_TRUE(reps->IsApplicationRepresented("12345"));
+ EXPECT_FALSE(reps->IsApplicationRepresented("1234"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsApplicationRevoked_CheckApps_ExpectCorrectResult) {
+ // Arrange
+ const std::string query_insert_app_7777 =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '7777', 0, 0, 'NONE', 'NONE', 1, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_7777));
+
+ const std::string query_insert_app_12345 =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_12345));
+ // Checks
+ EXPECT_TRUE(reps->IsApplicationRevoked("7777"));
+ EXPECT_FALSE(reps->IsApplicationRevoked("12345"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ CopyApplication_CopyApplication_ExpectAppCopiedSuccesfully) {
+ // Arrange
+ const std::string query_insert_app_default =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "1, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default));
+
+ const std::string query_insert_app_123 =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '123', 1, 0, 'FULL', "
+ "'COMMUNICATION', 1, 1, 0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_123));
+ EXPECT_FALSE(reps->IsApplicationRepresented("7777"));
+ EXPECT_FALSE(reps->IsApplicationRepresented("9999"));
+ // Act
+ EXPECT_TRUE(reps->CopyApplication("default", "7777"));
+ EXPECT_TRUE(reps->CopyApplication("123", "9999"));
+ // Checks
+ EXPECT_TRUE(reps->IsApplicationRepresented("7777"));
+ EXPECT_TRUE(reps->IsApplicationRepresented("9999"));
+ EXPECT_FALSE(reps->IsApplicationRevoked("7777"));
+ EXPECT_TRUE(reps->IsApplicationRevoked("9999"));
+ EXPECT_TRUE(reps->IsDefaultPolicy("7777"));
+ std::string priority1;
+ std::string priority2;
+ EXPECT_TRUE(reps->GetPriority("default", &priority1));
+ EXPECT_TRUE(reps->GetPriority("7777", &priority2));
+ EXPECT_EQ(priority1, priority2);
+ EXPECT_TRUE(reps->GetPriority("123", &priority1));
+ EXPECT_TRUE(reps->GetPriority("9999", &priority2));
+ EXPECT_EQ(priority1, priority2);
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsDefaultPolicy_SetAppPreDataThenCheck_ExpectNotDefaultPolicySet) {
+ // Arrange
+ const std::string query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "1, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
+ // Check
+ EXPECT_FALSE(reps->IsDefaultPolicy("12345"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsDefaultPolicy_SetAppDefaultThenCheck_ExpectNotDefaultPolicySet) {
+ // Arrange
+ const std::string query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
+ "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
+ "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 1, 0, 64, 10) ";
+
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
+ // Check
+ EXPECT_TRUE(reps->IsDefaultPolicy("1234567"));
+}
+
+TEST_F(SQLPTRepresentationTest, Drop_DropExistedPT_ExpectZeroTables) {
+ // Check
+ utils::dbms::SQLQuery query(reps->db());
+ const std::string query_select =
+ "SELECT COUNT(*) FROM `sqlite_master` WHERE `type` = 'table'";
+ // In normally created PT there are more than 0 tables
+
+ ASSERT_TRUE(query_wrapper_->Exec(query_select));
+ query.Prepare(query_select);
+ query.Next();
+ ASSERT_GT(query.GetInteger(0), 0);
+ query.Finalize();
+
+ // Destroy schema
+ ASSERT_TRUE(reps->Drop());
+
+ // Check PT structure destroyed and tables number is 0
+ query.Prepare(query_select);
+ query.Next();
+ ASSERT_EQ(0, query.GetInteger(0));
+ query.Finalize();
+
+ // Restore schema
+ ASSERT_TRUE(reps->RefreshDB());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SetDefaultPolicy_SetDefaultPolicyThenCheck_ExpectDefaultPolicySet) {
+ // Arrange
+ const std::string query_insert_app_default =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_default));
+
+ const std::string query_insert_app_1234567 =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
+ "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
+ "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app_1234567));
+ EXPECT_FALSE(reps->IsDefaultPolicy("1234567"));
+ // Act
+ ASSERT_TRUE(reps->SetDefaultPolicy("1234567"));
+ // Check
+ EXPECT_TRUE(reps->IsDefaultPolicy("1234567"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SetPreloaded_SetPreloaded_ExpectPTSetToPreloaded) {
+ // Arrange
+ const std::string query_insert =
+ "UPDATE `module_config` SET `preloaded_pt` = 0";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert));
+ // Check
+ ASSERT_FALSE(reps->IsPTPreloaded());
+ // Act
+ reps->SetPreloaded(true);
+ // Check
+ ASSERT_TRUE(reps->IsPTPreloaded());
+ // Act
+ reps->SetPreloaded(false);
+ // Check
+ ASSERT_FALSE(reps->IsPTPreloaded());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SetIsDefault_SetIsDefault_ExpectDefaultFlagSet) {
+ // Arrange
+ utils::dbms::SQLQuery query(reps->db());
+ const std::string query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
+ "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
+ "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10) ";
+ ASSERT_TRUE(query_wrapper_->Exec(query_insert_app));
+ const std::string query_select =
+ "SELECT `is_default` FROM `application`WHERE`id`= '1234567' ";
+
+ query.Prepare(query_select);
+ query.Next();
+ EXPECT_EQ(0, query.GetInteger(0));
+ query.Finalize();
+ // Act
+ EXPECT_TRUE(reps->SetIsDefault("1234567", true));
+
+ // Check
+ query.Prepare(query_select);
+ query.Next();
+ EXPECT_EQ(1, query.GetInteger(0));
+ query.Finalize();
+ // Act
+ EXPECT_TRUE(reps->SetIsDefault("1234567", false));
+
+ // Check
+ query.Prepare(query_select);
+ query.Next();
+ EXPECT_EQ(0, query.GetInteger(0));
+}
+
+TEST(SQLPTRepresentationTest3, RemoveDB_RemoveDB_ExpectFileDeleted) {
+ // Arrange
+ const bool in_memory_ = true;
+ policy_handler_test::MockPolicySettings policy_settings_;
+ SQLPTRepresentation reps(in_memory_);
+ EXPECT_EQ(::policy::SUCCESS, reps.Init(&policy_settings_));
+ EXPECT_EQ(::policy::EXISTS, reps.Init(&policy_settings_));
+ std::string path = (reps.db())->get_path();
+ // Act
+ reps.RemoveDB();
+ // Check
+ EXPECT_FALSE(file_system::FileExists(path));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ DISABLED_GenerateSnapshot_SetPolicyTable_SnapshotIsPresent) {
+ // TODO(AKutsan):APPLINK-31526 Test requires initial preloaded pt for
+ // preloaded date reading
+ // Arrange
+ Json::Value table(Json::objectValue);
+ 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);
+ // 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);
+ table["policy_table"]["module_config"]["preloaded_pt"] = Json::Value(false);
+ policy_table::Table expected(&table);
+ Json::StyledWriter writer;
+ // Checks
+ EXPECT_EQ(writer.write(expected.ToJsonValue()),
+ writer.write(snapshot->ToJsonValue()));
+ std::cout << writer.write(snapshot->ToJsonValue()) << std::endl;
+ EXPECT_EQ(expected.ToJsonValue().toStyledString(),
+ snapshot->ToJsonValue().toStyledString());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ DISABLED_Save_SetPolicyTableThenSave_ExpectSavedToPT) {
+ // TODO(AKutsan): APPLINK-31526 Test requires initial preloaded pt for
+ // preloaded date reading
+ // Arrange
+ Json::Value table(Json::objectValue);
+ PolicyTableUpdatePrepare(table);
+
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ // Checks PT before Save
+ policy_table::FunctionalGroupings func_groups;
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Check functional groupings section
+ EXPECT_EQ(0u, func_groups.size());
+
+ policy_table::ApplicationPoliciesSection policies;
+ GatherApplicationPoliciesSection(&policies);
+ // Check ApplicationPoliciesSection
+ EXPECT_EQ(0u, policies.apps.size());
+ EXPECT_EQ(0u, (policies.device.preconsented_groups)->size());
+ EXPECT_EQ(0u, policies.device.groups.size());
+ EXPECT_EQ(policy_table::Priority::P_EMERGENCY, policies.device.priority);
+ EXPECT_EQ(policy_table::HmiLevel::HL_BACKGROUND, policies.device.default_hmi);
+ EXPECT_FALSE(policies.device.keep_context);
+ EXPECT_FALSE(policies.device.steal_focus);
+
+ policy_table::ModuleConfig config;
+ GatherModuleConfig(&config);
+ // Check Module config section
+ EXPECT_TRUE(*config.preloaded_pt);
+ EXPECT_EQ(0, config.exchange_after_x_ignition_cycles);
+ EXPECT_EQ(0, config.exchange_after_x_kilometers);
+ EXPECT_EQ(0, config.exchange_after_x_days);
+ EXPECT_EQ(0, config.timeout_after_x_seconds);
+ EXPECT_EQ("", static_cast<std::string>(*config.vehicle_make));
+ EXPECT_EQ("", static_cast<std::string>(*config.vehicle_model));
+ EXPECT_EQ("", static_cast<std::string>(*config.vehicle_year));
+ EXPECT_EQ("", static_cast<std::string>(*config.preloaded_date));
+ EXPECT_EQ("", static_cast<std::string>(*config.certificate));
+ EXPECT_EQ(0u, config.seconds_between_retries.size());
+ EXPECT_EQ(0u, config.endpoints.size());
+ EXPECT_EQ(0u, config.notifications_per_minute_by_priority.size());
+
+ policy_table::ConsumerFriendlyMessages messages;
+ GatherConsumerFriendlyMessages(&messages);
+ EXPECT_EQ("0", static_cast<std::string>(messages.version));
+ policy_table::DeviceData devices;
+ GatherDeviceData(&devices);
+ EXPECT_EQ(0u, devices.size());
+ policy_table::UsageAndErrorCounts counts;
+ GatherUsageAndErrorCounts(&counts);
+ EXPECT_EQ(0u, counts.app_level->size());
+ ASSERT_TRUE(IsValid(update));
+ // Act
+ ASSERT_TRUE(reps->Save(update));
+
+ // Check Functional Groupings
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Checks
+ EXPECT_EQ(1u, func_groups.size());
+ policy_table::FunctionalGroupings::iterator func_groups_iter =
+ func_groups.find("default");
+ ASSERT_TRUE(func_groups.end() != func_groups_iter);
+ policy_table::Rpcs& rpcs = func_groups_iter->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ EXPECT_EQ(1u, rpc.size());
+ policy_table::Rpc::const_iterator rpc_iter = rpc.find("Update");
+ EXPECT_TRUE(rpc.end() != rpc_iter);
+ const policy_table::HmiLevels& hmi_levels = rpc_iter->second.hmi_levels;
+ EXPECT_EQ(1u, hmi_levels.size());
+ EXPECT_TRUE(hmi_levels.end() != std::find(hmi_levels.begin(),
+ hmi_levels.end(),
+ policy_table::HmiLevel::HL_FULL));
+
+ const ::policy_table::Parameters& parameters = *(rpc_iter->second.parameters);
+ EXPECT_EQ(1u, parameters.size());
+ EXPECT_TRUE(parameters.end() != std::find(parameters.begin(),
+ parameters.end(),
+ policy_table::Parameter::P_SPEED));
+ // Check Application Policies Section
+ GatherApplicationPoliciesSection(&policies);
+ const uint32_t apps_size = 3u;
+
+ rpc::String<1ul, 255ul> str("default");
+ policy_table::Strings groups;
+ groups.push_back(str);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "1234",
+ 150u,
+ 200u,
+ groups);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "default",
+ 50u,
+ 100u,
+ groups);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "pre_DataConsent",
+ 40u,
+ 90u,
+ groups);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "device",
+ 0u,
+ 0u,
+ groups);
+ EXPECT_EQ(0u, (policies.device.preconsented_groups)->size());
+ EXPECT_EQ(0u, policies.device.groups.size());
+ EXPECT_EQ(policy_table::HmiLevel::HL_BACKGROUND, policies.device.default_hmi);
+ EXPECT_FALSE(policies.device.keep_context);
+ EXPECT_FALSE(policies.device.steal_focus);
+
+ CheckAppGroups("1234", groups);
+ CheckAppGroups("default", groups);
+ CheckAppGroups("pre_DataConsent", groups);
+ CheckAppGroups("device", groups);
+
+ GatherModuleConfig(&config);
+ // Check Module Config section
+ ASSERT_FALSE(*config.preloaded_pt);
+ ASSERT_EQ("my_cert", static_cast<std::string>(*config.certificate));
+ ASSERT_EQ("25-04-2015", static_cast<std::string>(*config.preloaded_date));
+ ASSERT_EQ("2014", static_cast<std::string>(*config.vehicle_year));
+ ASSERT_EQ("ModelT", static_cast<std::string>(*config.vehicle_model));
+ ASSERT_EQ("MakeT", static_cast<std::string>(*config.vehicle_make));
+ ASSERT_EQ(10, config.exchange_after_x_ignition_cycles);
+ ASSERT_EQ(100, config.exchange_after_x_kilometers);
+ ASSERT_EQ(5, config.exchange_after_x_days);
+ ASSERT_EQ(500, config.timeout_after_x_seconds);
+ ASSERT_EQ(3u, config.seconds_between_retries.size());
+ ASSERT_EQ(10, config.seconds_between_retries[0]);
+ ASSERT_EQ(20, config.seconds_between_retries[1]);
+ ASSERT_EQ(30, config.seconds_between_retries[2]);
+ ASSERT_EQ(6u, config.notifications_per_minute_by_priority.size());
+ ASSERT_EQ(1, config.notifications_per_minute_by_priority["emergency"]);
+ ASSERT_EQ(2, config.notifications_per_minute_by_priority["navigation"]);
+ ASSERT_EQ(3, config.notifications_per_minute_by_priority["VOICECOMM"]);
+ ASSERT_EQ(4, config.notifications_per_minute_by_priority["communication"]);
+ ASSERT_EQ(5, config.notifications_per_minute_by_priority["normal"]);
+ ASSERT_EQ(6, config.notifications_per_minute_by_priority["none"]);
+ EXPECT_EQ(1u, config.endpoints.size());
+ policy_table::ServiceEndpoints& service_endpoints = config.endpoints;
+ EXPECT_EQ("0x00", service_endpoints.begin()->first);
+ policy_table::URLList& url_list = service_endpoints.begin()->second;
+ EXPECT_EQ("default", url_list.begin()->first);
+ policy_table::URL& url = url_list.begin()->second;
+ EXPECT_EQ("http://ford.com/cloud/default", static_cast<std::string>(url[0]));
+ GatherConsumerFriendlyMessages(&messages);
+ EXPECT_EQ("1.2", static_cast<std::string>(messages.version));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ Save_SavePolicyTable_EmptyParameters_ParametersEMPTY) {
+ // Arrange
+ Json::Value table(Json::objectValue);
+ PolicyTableUpdatePrepareEmptyParameters(table);
+
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ // Checks PT before Save
+ policy_table::FunctionalGroupings func_groups;
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Check functional groupings section
+ EXPECT_EQ(0u, func_groups.size());
+
+ // Act
+ ASSERT_TRUE(reps->Save(update));
+
+ // Check Functional Groupings
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Checks
+ EXPECT_EQ(1u, func_groups.size());
+ policy_table::FunctionalGroupings::iterator func_groups_iter =
+ func_groups.find("default");
+ ASSERT_TRUE(func_groups.end() != func_groups_iter);
+ policy_table::Rpcs& rpcs = func_groups_iter->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ EXPECT_EQ(1u, rpc.size());
+ policy_table::Rpc::const_iterator rpc_iter = rpc.find("Update");
+ EXPECT_TRUE(rpc.end() != rpc_iter);
+ // Check parameters
+ const ::policy_table::Parameters& parameters = *(rpc_iter->second.parameters);
+ // 'parameters' : [] - represented as initialized, but empty
+ // missing 'parameters' - represented as non-initialized and empty
+ EXPECT_TRUE(parameters.is_initialized());
+ EXPECT_TRUE(parameters.empty());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ Save_SavePolicyTable_NoParameters_NoParametersSaved) {
+ // Arrange
+ Json::Value table(Json::objectValue);
+ PolicyTableUpdatePrepareNoParameters(table);
+
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ // Checks PT before Save
+ policy_table::FunctionalGroupings func_groups;
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Check functional groupings section
+ EXPECT_EQ(0u, func_groups.size());
+
+ // Act
+ ASSERT_TRUE(reps->Save(update));
+
+ // Check Functional Groupings
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Checks
+ EXPECT_EQ(1u, func_groups.size());
+ policy_table::FunctionalGroupings::iterator func_groups_iter =
+ func_groups.find("default");
+ ASSERT_TRUE(func_groups.end() != func_groups_iter);
+ policy_table::Rpcs& rpcs = func_groups_iter->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ EXPECT_EQ(1u, rpc.size());
+ policy_table::Rpc::const_iterator rpc_iter = rpc.find("Update");
+ EXPECT_TRUE(rpc.end() != rpc_iter);
+ // Check parameters
+ const ::policy_table::Parameters& parameters = *(rpc_iter->second.parameters);
+ EXPECT_EQ(0u, parameters.size());
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc
new file mode 100644
index 0000000000..5546984ff4
--- /dev/null
+++ b/src/components/policy/policy_external/test/update_status_manager_test.cc
@@ -0,0 +1,339 @@
+/*
+ * 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 "policy/mock_policy_listener.h"
+#include "policy/policy_manager_impl.h"
+#include "policy/update_status_manager.h"
+#include "utils/make_shared.h"
+#include "utils/conditional_variable.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using namespace ::policy;
+using ::testing::_;
+using ::testing::Return;
+using testing::NiceMock;
+
+class UpdateStatusManagerTest : public ::testing::Test {
+ protected:
+ utils::SharedPtr<UpdateStatusManager> manager_;
+ PolicyTableStatus status_;
+ const uint32_t k_timeout_;
+ NiceMock<MockPolicyListener> listener_;
+ const std::string up_to_date_status_;
+ const std::string update_needed_status_;
+ const std::string updating_status_;
+
+ public:
+ UpdateStatusManagerTest()
+ : manager_(utils::MakeShared<UpdateStatusManager>())
+ , k_timeout_(1000)
+ , listener_()
+ , up_to_date_status_("UP_TO_DATE")
+ , update_needed_status_("UPDATE_NEEDED")
+ , updating_status_("UPDATING") {}
+
+ void SetUp() OVERRIDE {
+ manager_->set_listener(&listener_);
+ ON_CALL(listener_, OnUpdateStatusChanged(_)).WillByDefault(Return());
+ }
+
+ void TearDown() OVERRIDE {}
+};
+
+namespace {
+/**
+ * @brief The WaitAsync class
+ * can wait for a certain amount of function calls from different
+ * threads, or a timeout expires.
+ */
+class WaitAsync {
+ public:
+ WaitAsync(const uint32_t count, const uint32_t timeout)
+ : count_(count), timeout_(timeout) {}
+
+ void Notify() {
+ count_--;
+ cond_var_.NotifyOne();
+ }
+
+ bool Wait(sync_primitives::AutoLock& auto_lock) {
+ while (count_ > 0) {
+ sync_primitives::ConditionalVariable::WaitStatus wait_status =
+ cond_var_.WaitFor(auto_lock, timeout_);
+ if (wait_status == sync_primitives::ConditionalVariable::kTimeout) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private:
+ int count_;
+ const uint32_t timeout_;
+ sync_primitives::ConditionalVariable cond_var_;
+};
+}
+
+ACTION_P(NotifyAsync, waiter) {
+ waiter->Notify();
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnUpdateSentOut_WaitForTimeoutExpired_ExpectStatusUpdateNeeded) {
+ // Arrange
+ sync_primitives::Lock lock;
+ sync_primitives::AutoLock auto_lock(lock);
+ const uint32_t count = 3u;
+ const uint32_t timeout = 2u * k_timeout_;
+ WaitAsync waiter(count, timeout);
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(_))
+ .WillRepeatedly(NotifyAsync(&waiter));
+ manager_->ScheduleUpdate();
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ EXPECT_TRUE(waiter.Wait(auto_lock));
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpdateRequired, status_);
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnUpdateTimeOutOccurs_ExpectStatusUpdateNeeded) {
+ // Arrange
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpToDate, status_);
+ manager_->ScheduleUpdate();
+ manager_->OnUpdateTimeoutOccurs();
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpdateRequired, status_);
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnValidUpdateReceived_SetValidUpdateReceived_ExpectStatusUpToDate) {
+ // Arrange
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(update_needed_status_));
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(updating_status_));
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(up_to_date_status_));
+ manager_->OnValidUpdateReceived();
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpToDate, status_);
+}
+
+TEST_F(
+ UpdateStatusManagerTest,
+ SheduledUpdate_OnValidUpdateReceived_ExpectStatusUpToDateThanUpdateNeeded) {
+ using ::testing::InSequence;
+ // Arrange
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(update_needed_status_));
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(updating_status_));
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ manager_->ScheduleUpdate();
+
+ InSequence s;
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(up_to_date_status_));
+ EXPECT_CALL(listener_, OnUpdateStatusChanged(update_needed_status_));
+
+ manager_->OnValidUpdateReceived();
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpdateRequired, status_);
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnWrongUpdateReceived_SetWrongUpdateReceived_ExpectStatusUpdateNeeded) {
+ // Arrange
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ manager_->OnWrongUpdateReceived();
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpdateRequired, status_);
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnResetDefaulPT_ResetPTtoDefaultState_ExpectPTinDefaultState) {
+ // Arrange
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ // Reset PT to default state with flag update required
+ manager_->OnResetDefaultPT(true);
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpdateRequired, status_);
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnResetDefaulPT2_ResetPTtoDefaultState_ExpectPTinDefaultState) {
+ // Arrange
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ // Reset PT to default state with flag update not needed
+ manager_->OnResetDefaultPT(false);
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpToDate, status_);
+}
+
+TEST_F(UpdateStatusManagerTest, OnResetRetrySequence_ExpectStatusUpToDate) {
+ // Arrange
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ manager_->OnResetRetrySequence();
+ status_ = manager_->GetLastUpdateStatus();
+ // Check
+ EXPECT_EQ(StatusUpdatePending, status_);
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnNewApplicationAdded_ExpectStatusUpdateNeeded) {
+ // Arrange
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ manager_->OnNewApplicationAdded(kDeviceAllowed);
+ status_ = manager_->GetLastUpdateStatus();
+ // Checks
+ EXPECT_EQ(StatusUpdatePending, status_);
+ EXPECT_TRUE(manager_->IsUpdatePending());
+ EXPECT_TRUE(manager_->IsUpdateRequired());
+}
+
+TEST_F(UpdateStatusManagerTest, ScheduleUpdate_ExpectStatusUpdateNeeded) {
+ // Arrange
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ manager_->OnUpdateSentOut(k_timeout_);
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpdatePending, status_);
+ manager_->OnValidUpdateReceived();
+ status_ = manager_->GetLastUpdateStatus();
+ EXPECT_EQ(StatusUpToDate, status_);
+ EXPECT_FALSE(manager_->IsUpdatePending());
+ EXPECT_FALSE(manager_->IsUpdateRequired());
+ manager_->ScheduleUpdate();
+ status_ = manager_->GetLastUpdateStatus();
+ // Checks
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ EXPECT_FALSE(manager_->IsUpdatePending());
+ EXPECT_TRUE(manager_->IsUpdateRequired());
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnPolicyInit_SetUpdateRequired_ExpectStatusUpdateNeeded) {
+ // Arrange
+ manager_->OnPolicyInit(true);
+ status_ = manager_->GetLastUpdateStatus();
+ // Checks
+ EXPECT_EQ(StatusUpdateRequired, status_);
+ EXPECT_FALSE(manager_->IsUpdatePending());
+ EXPECT_TRUE(manager_->IsUpdateRequired());
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnPolicyInit_SetUpdateNotRequired_ExpectStatusUpToDate) {
+ // Arrange
+ manager_->OnPolicyInit(false);
+ status_ = manager_->GetLastUpdateStatus();
+ // Checks
+ EXPECT_EQ(StatusUpToDate, status_);
+ EXPECT_FALSE(manager_->IsUpdatePending());
+ EXPECT_FALSE(manager_->IsUpdateRequired());
+}
+
+TEST_F(UpdateStatusManagerTest,
+ StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) {
+ // Arrange
+ manager_->OnPolicyInit(false);
+ // Check
+ EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus());
+ manager_->OnPolicyInit(true);
+ // Check
+ EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus());
+ manager_->OnUpdateSentOut(k_timeout_);
+ // Check
+ EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus());
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) {
+ // Arrange
+ manager_->OnAppsSearchStarted();
+ // Check
+ EXPECT_TRUE(manager_->IsAppsSearchInProgress());
+ // Arrange
+ manager_->OnAppsSearchCompleted();
+ // Check
+ EXPECT_FALSE(manager_->IsAppsSearchInProgress());
+}
+
+} // namespace policy
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt
new file mode 100644
index 0000000000..c7b9c068b9
--- /dev/null
+++ b/src/components/policy/policy_regular/CMakeLists.txt
@@ -0,0 +1,125 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories (
+ ${POLICY_PATH}/include
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/config_profile/include
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+)
+
+set(POLICY_TABLE_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/policy/policy_table
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/policy_table
+)
+collect_sources(POLICY_TABLE_SOURCES "${POLICY_TABLE_PATHS}")
+add_library(policy_struct ${POLICY_TABLE_SOURCES})
+target_link_libraries(policy_struct Utils)
+
+set(USAGE_STATISTICS_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/policy/usage_statistics
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/usage_statistics
+)
+collect_sources(USAGE_STATISTICS_SOURCES "${USAGE_STATISTICS_PATHS}")
+add_library(UsageStatistics ${USAGE_STATISTICS_SOURCES})
+target_link_libraries(UsageStatistics Utils)
+
+set(EXCLUDE_PATHS
+ ${POLICY_TABLE_PATHS}
+ ${USAGE_STATISTICS_PATHS}
+ sql_pt_ext_queries.cc
+ sql_pt_ext_representation.cc
+)
+
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+ ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
+)
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
+
+if (NOT REMOTE_CONTROL)
+ list(REMOVE_ITEM SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/access_remote_impl.cc)
+endif()
+
+set(LIBRARIES
+ ConfigProfile
+ policy_struct
+ dbms
+ jsoncpp
+ Utils
+)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ # --- QDB Wrapper
+ include_directories (${COMPONENTS_DIR}/utils/include/utils)
+else ()
+ # --- SQLite Wrapper
+ include_directories (${COMPONENTS_DIR}/utils/include/utils)
+ list(APPEND LIBRARIES sqlite3)
+endif ()
+
+add_library(Policy SHARED ${SOURCES})
+target_link_libraries(Policy ${LIBRARIES})
+
+if(ENABLE_LOG)
+ target_link_libraries(Policy log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+set(LIBRARY_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}Policy${CMAKE_SHARED_LIBRARY_SUFFIX})
+set(TARGET_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME})
+set(INSTALL_DESTINATION bin)
+set(COPY_DESTINATION ${CMAKE_BINARY_DIR}/src/appMain)
+
+add_custom_target(copy_policy_library ALL
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${TARGET_LOCATION}
+ ${COPY_DESTINATION}/${LIBRARY_NAME}
+ DEPENDS Policy
+ COMMENT "Copying library ${LIBRARY_NAME}"
+)
+
+install(TARGETS Policy
+ DESTINATION ${INSTALL_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/policy/policy_regular/Readme.txt b/src/components/policy/policy_regular/Readme.txt
new file mode 100644
index 0000000000..370fab238a
--- /dev/null
+++ b/src/components/policy/policy_regular/Readme.txt
@@ -0,0 +1,3 @@
+To use SQLite and SQLite wrapper need to install libsqlite3-0 and libsqlite3-dev packages.
+To use QDB and QDB wrapper on QNX need to install SDP QNX 6.5.0 and run qdb server.
+To start qdb server need use script qdbserver.sh from directory qdb_wrapper.
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/AppMgr/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/AppMgr/index.txt
new file mode 100644
index 0000000000..17584b09e1
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/AppMgr/index.txt
@@ -0,0 +1,5 @@
+/*! \page components_appmgr App Manager
+
+Here will be information about App Manager component
+
+*/ \ No newline at end of file
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/HMI/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/HMI/index.txt
new file mode 100644
index 0000000000..361763118d
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/HMI/index.txt
@@ -0,0 +1,5 @@
+/*! \page components_hmi HMI
+
+Here will be information about HMI component
+
+*/ \ No newline at end of file
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
new file mode 100644
index 0000000000..9854b88d5f
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/Formatters/index.txt
@@ -0,0 +1,9 @@
+/*! \page components_jsonhandler_formatters Smart Objects Formatters
+
+In order to create JSON string representation from Smart Object or create Smart Object data structure from JSON string representation JSON Handler component has special classes called formatters.
+
+The interface of formatter is quite simple and defined by NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class. Actually it has two methods - NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::objToJsonValue to convert JSON string to object and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase::jsonValueToObj to create JSON string from object.
+
+Current implementation has two different implementations of NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonBase class: NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv1 for ALRPC.v1 and NsSmartDeviceLink::NsJSONHandler::Formatters::CFormatterJsonALRPCv2 for ALRPC.v2. These implementations handle specifics of each format.
+
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/index.txt
new file mode 100644
index 0000000000..a65c8ddc7d
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/JSONHandler/index.txt
@@ -0,0 +1,8 @@
+/*! \page components_jsonhandler JSON Handler
+
+Here will be information about JSON Handler component
+
+Detailed information:
+ - \subpage components_jsonhandler_formatters "Smart Objects Formatters"
+
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/ProtocolHandler/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/ProtocolHandler/index.txt
new file mode 100644
index 0000000000..c5b5ceb79c
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/ProtocolHandler/index.txt
@@ -0,0 +1,5 @@
+/*! \page components_protocolhandler Protocol Handler
+
+Here will be information about Protocol Handler component
+
+*/ \ No newline at end of file
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/SmartObjects/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/SmartObjects/index.txt
new file mode 100644
index 0000000000..3844e1ab69
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/SmartObjects/index.txt
@@ -0,0 +1,11 @@
+/*! \page components_smartobjects Smart Objects
+
+Smart Object is building block for a custom dynamic data structures with virtually unlimited complexity. Client code can use Smart Objects to create containers for simple basic types such as bools, ints, doubles, chars, strings end enums as well as arrays and maps.
+
+Smart Objects solution also includes validation/normalization mechanism of schemas witch is similar to the XML schemas. This feature allows client to validate any data structure.
+
+More detailed information is described in following chapters:
+ - \subpage components_smartobjects_types "Smart Objects Types"
+ - \subpage components_smartobjects_usage "Use of Smart Objects"
+ - \subpage components_smartobjects_validation "Smart Objects validation"
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/TransportManager/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/TransportManager/index.txt
new file mode 100644
index 0000000000..73252c751c
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/TransportManager/index.txt
@@ -0,0 +1,9 @@
+/*! \page components_transportmanager Transport Manager
+
+Transport Manager is a component of SmartDeviceLink application which is designed to provide transparent access to transport layer for other components. Current implementation provides unified access to connections via Bluetooth and TCP. Also this component allows run automatic device discovery and provides information about found devices which is able to connect to SmartDeviceLink.
+
+More detailed information is described in following chapters:
+ - \subpage components_transportmanager_client "Transport Manager Client Specification"
+ - \subpage components_transportmanager_internal_design "Component Internal Design"
+ - \subpage components_transportmanager_use_cases "High-Level Use Cases to Test Component"
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/components/index.txt b/src/components/policy/policy_regular/doc/doxygen/components/index.txt
new file mode 100644
index 0000000000..186de88af0
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/components/index.txt
@@ -0,0 +1,10 @@
+/*! \page components Components
+
+Project contain following components:
+ - \subpage components_transportmanager "Transport Manager"
+ - \subpage components_protocolhandler "Protocol Handler"
+ - \subpage components_jsonhandler "JSON Handler"
+ - \subpage components_smartobjects "Smart Objects"
+ - \subpage components_appmgr "App Manager"
+ - \subpage components_hmi "HMI"
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/info.txt b/src/components/policy/policy_regular/doc/doxygen/info.txt
new file mode 100644
index 0000000000..e8afe55c12
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/info.txt
@@ -0,0 +1,5 @@
+/*! \page info Project information
+
+Here will be general information about project
+
+*/ \ No newline at end of file
diff --git a/src/components/policy/policy_regular/doc/doxygen/mainpage.txt b/src/components/policy/policy_regular/doc/doxygen/mainpage.txt
new file mode 100644
index 0000000000..5cd05e2606
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/mainpage.txt
@@ -0,0 +1,9 @@
+/*! \mainpage Project SmartDeviceLink
+
+This is the entry point to the documentation about project.
+
+This manual is divided in the following sections:
+- \subpage info "General project information"
+- \subpage components "Project components"
+- \subpage tools "Project specific tools"
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt b/src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt
new file mode 100644
index 0000000000..4cf9e84d99
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/Arhitecture.txt
@@ -0,0 +1,5 @@
+/*! \page tools_interfacegenerator_architecture InterfaceGenerator architecture
+
+InterfaceGenerator is designed as flexible and easily expendable tool that allows to implement both new parsers and generators independently. The core idea of InterfaceGenerator that it has middle-ware product - abstract model of interface that should be generated. This middle layer allows to separate collection of parsers from generators. Also it is possible to add any new validation / normalization component between them. So at the moment the root script creates actual parser and that parser produces model of interface (set of Python classes objects). After that interface model is passed to the desired generator and generator creates result source code files.
+
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/index.txt b/src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/index.txt
new file mode 100644
index 0000000000..21b437f6b7
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/tools/InterfaceGenerator/index.txt
@@ -0,0 +1,12 @@
+/*! \page tools_interfacegenerator InterfaceGenerator
+
+InterfaceGenerator is a special code generation tool that allows creating of C++ source code to work with interface described as XML file.
+InterfaceGenerator is a bundle of Python scripts. Root script is a Generator.py. This script should be used by the client to run generator.
+Currently InterfaceGenerator supports generation form ALRPC v.1 and ALRPC v.2 XML formats.
+
+For more details please review:
+ - \subpage tools_interfacegenerator_usage "How to use InterfaceGenerator"
+ - \subpage tools_interfacegenerator_output "Use of InterfaceGenerator output"
+ - \subpage tools_interfacegenerator_architecture "InterfaceGenerator architecture"
+ - \subpage tools_interfacegenerator_cmakeintegration "Integration with CMake"
+*/
diff --git a/src/components/policy/policy_regular/doc/doxygen/tools/index.txt b/src/components/policy/policy_regular/doc/doxygen/tools/index.txt
new file mode 100644
index 0000000000..4befa33e8d
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/doxygen/tools/index.txt
@@ -0,0 +1,5 @@
+/*! \page tools Tools
+
+Project uses following special tools:
+ - \subpage tools_interfacegenerator "InterfaceGenerator"
+*/
diff --git a/src/components/policy/policy_regular/doc/grc/conf.smartDeviceLinkCore b/src/components/policy/policy_regular/doc/grc/conf.smartDeviceLinkCore
new file mode 100644
index 0000000000..a026407723
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/grc/conf.smartDeviceLinkCore
@@ -0,0 +1,33 @@
+# source filename
+regexp=\w+\.(?:cpp|h)
+colours=yellow
+===
+regexp=^(ERROR|FATAL)
+colours=red on_yellow
+===
+regexp=^WARN
+colours=red
+===
+regexp=^INFO
+colours=blue
+===
+regexp=^TRACE
+colours=magenta
+===
+# component
+regexp=(?<=\])\[[^]]+\]
+colours=cyan
+===
+# something invalid
+regexp=(?i)invalid
+colours=red
+===
+# RPC message start
+regexp=^\{$
+colours=bold
+count=block
+===
+# RPC message end
+regexp=^\}$
+colours=bold
+count=unblock \ No newline at end of file
diff --git a/src/components/policy/policy_regular/doc/grc/grc.conf b/src/components/policy/policy_regular/doc/grc/grc.conf
new file mode 100644
index 0000000000..dfd3d4cbef
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/grc/grc.conf
@@ -0,0 +1,3 @@
+# smartDeviceCore command
+(^|[/\w\.]+/)smartDeviceLinkCore\s?
+conf.smartDeviceLinkCore
diff --git a/src/components/policy/policy_regular/doc/install.txt b/src/components/policy/policy_regular/doc/install.txt
new file mode 100644
index 0000000000..c870856e97
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/install.txt
@@ -0,0 +1,91 @@
+* Introduction
+ ================
+ smartDeviceLinkCore is an application which manages the transport, connection and communication between a head unit and mobile device.
+
+* OS and Hardware
+ =========
+ Ubuntu 12.04.01 LTS 32-bit OS on the PC with USB-dongle
+ Application has been tested using 2 types of USB-dongle:
+ D-Link DBT-122
+ STLab B-121mini
+
+* External components
+ ===================
+ For build application we need:
+ libbluetooth3, the BlueZ library
+ libbluetooth-dev, the development files to link to the BluetZ library.
+ Install libraries:
+ sudo apt-get install libbluetooth3
+ sudo apt-get install libbluetooth-dev
+
+ We are using cmake to create build configurations.
+ Install cmake:
+ sudo apt-get install cmake
+
+ Also, make sure the g++ compiler is installed:
+ sudo apt-get install g++
+
+ To start web-based HMI we need web-browser with web-socket RFC6455 support.
+ For example Google Chromium. Install it using:
+ sudo apt-get install chromium-browser
+
+ To run InterfaceGenerator some python libraries are required and must be
+ installed with following command:
+ sudo pip install -r tools/InterfaceGenerator/requirements.txt
+
+ For logging Apache log4cxx library is used. Install required packages with the following command:
+ sudo apt-get install liblog4cxx10 liblog4cxx10-dev
+
+ For installing pulseaudio development files which neededfor audio management fetures run:
+ sudo apt-get install libpulse-dev
+
+ For installing gstreamer development files which needed for audio management fetures:
+ First add gstreamer repositories to your apt source list (/etc/apt/sources.list):
+ deb http://ppa.launchpad.net/gstreamer-developers/ppa/ubuntu <distributive codename> main
+ deb-src http://ppa.launchpad.net/gstreamer-developers/ppa/ubuntu <distributive codename> main
+ use code name relevant to the Ubuntu version which you use instead of <distributive codename>.
+ Run:
+ sudo apt-get update
+ and:
+ sudo apt-get install gstreamer1.0*
+
+* Build application
+ =================
+ We support "out of sources" concept for build from R3.0.0
+ It means all generated by build tools files will be stored in separate folder.
+ Temporary build of application requires two steps.
+ 1. Enter src/thirdPartyLibs/logger
+ build logger:
+
+ 1. Create directory outside of SmartDeviceLink project directory.
+ For example "build" folder in the same folder with SmartDeviceLink git repo folder which has a name "git_repo":
+ You will have folders structure like this:
+ /home/projects/smart_device_link
+ |--build
+ |--git_repo
+ |--doc
+ |--src
+ |--test
+ |--DoxyFile
+ \--CMakeLists.txt
+ Enter this folder:
+ cd build
+
+ 2. Create build configuration using cmake:
+ 2.1 For Debug configuration
+ cmake ../git_repo
+ 2.2 For Release configuration, run:
+ cmake -DCMAKE_BUILD_TYPE=Release ../git_repo
+ 2.3 For Debug configuration with tests, run:
+ cmake -DBUILD_TESTS=On ../git_repo
+
+ 3. Make project:
+ make
+
+ Ready to use release application will be in build/src/appMain/smartDeviceLinkCore
+
+ 4. If You built configuration with tests (see 2.3 above), then You can run all project tests and see overall result with:
+ make test
+
+ 5. For creating the doxygen documentation run:
+ make doxygen \ No newline at end of file
diff --git a/src/components/policy/policy_regular/doc/qnx_build.txt b/src/components/policy/policy_regular/doc/qnx_build.txt
new file mode 100644
index 0000000000..4f67d6eed3
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/qnx_build.txt
@@ -0,0 +1,28 @@
+Building the project
+cmake -DCMAKE_TOOLCHAIN_FILE=../applink/qnx_6.5.0_linux_x86.cmake ../applink
+or for Momentics project:
+cmake -DCMAKE_TOOLCHAIN_FILE=../applink/qnx_6.5.0_linux_x86.cmake -G "Eclipse CDT4 - Unix Makefiles" ../applink
+
+Building with support D-Bus and Qt 4.8
+Install D-Bus (see https://adc.luxoft.com/confluence/x/0AHJDw)
+Install Qt 4.8 (see https://adc.luxoft.com/confluence/x/UwfJDw)
+cmake -DHMI2=ON -DCMAKE_TOOLCHAIN_FILE=../applink/qnx_6.5.0_linux_x86.cmake ../applink
+or for Momentics project:
+cmake -DHMI2=ON -DCMAKE_TOOLCHAIN_FILE=../applink/qnx_6.5.0_linux_x86.cmake -G "Eclipse CDT4 - Unix Makefiles" ../applink
+
+make
+make install
+
+Running project:
+Change server IP in configuration file to QNX target IP.
+Copy directory bin to QNX target.
+You can copy it using scp. Example:
+scp -r user_name@linux_pc_ip:/full_path/to/dir .
+
+For Web HMI set target IP in ini file and change target IP in src/components/HMI/ffw/RPCClient.js
+! Currently we don't have any configuration file for HMI.
+
+Execute smartDeviceLinkCore on QNX qtarget.
+Execute HMI on Linux PC (only Web HMI).
+
+Have fun!
diff --git a/src/components/policy/policy_regular/doc/readme.txt b/src/components/policy/policy_regular/doc/readme.txt
new file mode 100644
index 0000000000..66087df057
--- /dev/null
+++ b/src/components/policy/policy_regular/doc/readme.txt
@@ -0,0 +1,65 @@
+* Introduction
+ ================
+ smartDeviceCore is an application which manages the transport, connection and communication between a head unit and mobile device.
+
+* OS and Hardware
+ =========
+ Ubuntu 12.04.1 LTS 32-bit OS on the PC with USB-dongle
+ Application has been tested using 2 types of USB-dongle:
+ D-Link DBT-122
+ STLab B-121mini
+
+ * External components
+ ===================
+ For start application we need:
+ libbluetooth3, the BlueZ library
+ Install library:
+ sudo apt-get install libbluetooth3
+ To start web-based HMI we need web-browser with web-socket RFC6455 support.
+ 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 set path to hmi in config file
+ For example:
+ LinkToWebHMI = ${path_to_HMI_repository}/index.html
+
+* Running application
+ ====================
+ Plug USB-dongle in.
+ Switch Bluetooth on a mobile device ON and make the device discoverable.
+ Pair mobile device with PC using Ubuntu tools.
+ Device should contain SmartDeviceLink compatible application installed.
+ Start application with command:
+ ./smartDeviceLinkCore
+ Application starts to search devices and starts HMI in cromium-browser.
+ In case HMI has not been started please start web-based HMI manually in browser opening src/components/HMI/index.html.
+ SmartDeviceLinkCore is searching Bluetooth devices with a correspondibg service.
+ Go to info menu in HMI and press App button.
+ Press change Devices button.
+ Select the device from a list.
+ Application opens all available ports on devices and starts communication.
+ Returning to the App menu all applications will be shown in a list.
+
+* Colorized logs
+ ==============
+ You can have colorized log output of smartDeviceLinkCore's messages in the terminal with the help of grc:
+
+ 1. Make sure grc is installed:
+ sudo apt-get install grc
+
+ 2. Copy the config files from the grc/ directory into ~/.grc/ directory:
+ mkdir ~/.grc
+ cp grc/* ~/.grc/
+
+ 3. Add an alias to your shell's config (usually, ~/.bashrc or ~/.zshrc):
+ alias grca='grc -es --colour=auto'
+
+ Either restart the shell session or source the edited file:
+ source ~/.bashrc
+ or
+ source ~/.zshrc
+
+ 4. Start the smartDeviceLink core with the following command:
+ grca ./smartDeviceLinkCore
+
+ 5. PROFIT \ No newline at end of file
diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h
new file mode 100644
index 0000000000..c4de9b7e1f
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/access_remote.h
@@ -0,0 +1,122 @@
+/*
+ * 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_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
+
+#include <vector>
+#include <ostream>
+#include <string>
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace policy {
+struct ApplicationOnDevice {
+ PTString dev_id;
+ PTString app_id;
+};
+inline bool operator<(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id);
+}
+inline bool operator==(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id == y.dev_id && x.app_id == y.app_id;
+}
+inline std::ostream& operator<<(std::ostream& output,
+ const ApplicationOnDevice& who) {
+ output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")";
+ return output;
+}
+
+typedef std::vector<PTString> RemoteControlParams;
+
+class AccessRemote {
+ public:
+ virtual ~AccessRemote() {}
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ virtual bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const = 0;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ virtual void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ virtual const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ virtual bool IsAppRemoteControl(const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) = 0;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
new file mode 100644
index 0000000000..933690dc49
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
@@ -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.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+
+#include <map>
+#include "policy/policy_table/types.h"
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "policy/access_remote.h"
+#include "policy/cache_manager.h"
+
+using policy_table::FunctionalGroupings;
+
+namespace policy {
+
+class AccessRemoteImpl : public AccessRemote {
+ public:
+ AccessRemoteImpl();
+ explicit AccessRemoteImpl(utils::SharedPtr<CacheManager> cache);
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const OVERRIDE;
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) OVERRIDE;
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) OVERRIDE;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ bool IsAppRemoteControl(const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) OVERRIDE;
+
+ private:
+ /**
+ * @brief HmiTypes get list of hmi types for application
+ * @param who application on specific device
+ * @return list of hmi types
+ */
+ const policy_table::AppHMITypes& HmiTypes(const ApplicationOnDevice& who);
+
+ /**
+ * @brief GetGroupsIds get list of groups for application
+ * @param device_id device id
+ * @param app_id application id
+ * @param grops_ids output parameter for group ids storing
+ */
+ void GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& grops_ids);
+
+ /**
+ * @brief IsAllowed check if modulename and rpc is allowed for application
+ * @param modules list of access modules
+ * @param module_name module name to check
+ * @param rpc_name rpc name to check
+ * @param input list of rpc parameters
+ * @return true if allowed otherwise return false
+ */
+ bool IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const;
+ /**
+ * @brief CompareParameters check if app parameters allowed
+ * @param parameters list of allowed parameters
+ * @param input list of parameters to check
+ * @return true if allowed otherwise return false
+ */
+ bool CompareParameters(const policy_table::Strings& parameters,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief cache_ contains pointer to cache manager instance
+ */
+ utils::SharedPtr<CacheManager> cache_;
+
+ /**
+ * @brief hmi_types_ contains list of default HMI types for applications
+ */
+ typedef std::map<ApplicationOnDevice, policy_table::AppHMITypes> HMIList;
+ HMIList hmi_types_;
+
+#ifdef BUILD_TESTS
+ FRIEND_TEST(AccessRemoteImplTest, KeyMapTest);
+ FRIEND_TEST(AccessRemoteImplTest, Allow);
+ FRIEND_TEST(AccessRemoteImplTest, Deny);
+ FRIEND_TEST(AccessRemoteImplTest, ChangeAccess);
+ FRIEND_TEST(AccessRemoteImplTest, ResetBySubject);
+ FRIEND_TEST(AccessRemoteImplTest, ResetByObject);
+ FRIEND_TEST(AccessRemoteImplTest, CheckAllowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckDisallowed);
+ FRIEND_TEST(AccessRemoteImplTest, CheckManual);
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, SetDefaultHmiTypes);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h
new file mode 100644
index 0000000000..8c0acd44d2
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/cache_manager.h
@@ -0,0 +1,800 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_CACHE_MANAGER_H_
+
+#include <map>
+
+#include "utils/shared_ptr.h"
+#include "policy/pt_representation.h"
+#include "policy/pt_ext_representation.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/cache_manager_interface.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+#include "utils/lock.h"
+#include "utils/conditional_variable.h"
+#include "policy/policy_types.h"
+
+namespace policy {
+class PolicySettings;
+
+class CacheManager : public CacheManagerInterface {
+ public:
+ CacheManager();
+ ~CacheManager();
+
+ const policy_table::Strings& GetGroups(const PTString& app_id);
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @return CheckPermissionResult containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ virtual void CheckPermissions(const policy_table::Strings& groups,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result);
+
+ /**
+ * @brief Returns true if Policy Table was not updated yet
+ * from preloaded pt file.
+ */
+ virtual bool IsPTPreloaded();
+
+ /**
+ * Gets number of ignition cycles before next update policy table
+ * @return number of ignition cycles
+ */
+ virtual int IgnitionCyclesBeforeExchange();
+
+ /**
+ * Gets value in kilometers before next update policy table
+ * @param current value in kilometers from the odometers
+ * @return value in kilometers
+ */
+ virtual int KilometersBeforeExchange(int current);
+
+ /**
+ * @brief Sets counter value that passed for recieved successful PT UPdate
+ */
+ virtual bool SetCountersPassedForSuccessfulUpdate(Counters counter,
+ int value);
+
+ /**
+ * Gets value in days before next update policy table
+ * @param current value in days after epoch
+ * @return value in days
+ */
+ virtual int DaysBeforeExchange(int current);
+
+ /**
+ * @brief Increment number of ignition cycles since last exchange by 1
+ */
+ virtual void IncrementIgnitionCycles();
+
+ /**
+ * @brief Reset number of ignition cycles since last exchange to 0
+ */
+ virtual void ResetIgnitionCycles();
+
+ /**
+ * @brief Returns timeout to wait for a response of PT update
+ * @return value in msec
+ */
+ virtual int TimeoutResponse();
+
+ /**
+ * @brief Returns number of seconds between each try of sending PTS
+ * @param seconds Return value: array of 5 elements
+ * @return bool Success of operation
+ */
+ virtual bool SecondsBetweenRetries(std::vector<int>& seconds);
+
+ /**
+ * @brief Get information about vehicle
+ */
+ virtual const VehicleInfo GetVehicleInfo() const;
+
+ /**
+ * @brief Allows to update 'vin' field in module_meta table.
+ *
+ * @param new 'vin' value.
+ *
+ * @return true in case when data has been successfully updated,
+ * false otherwise.
+ */
+ bool SetVINValue(const std::string& value);
+
+ /**
+ * @brief Get message text for displaying/pronouncing for user
+ * dependent on language and context.
+ * @param msg_codes Context of message (Driver distraction, Grant permission
+ * etc)
+ * @param language Language of the message
+ * @return Array of appropriate messages parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language);
+
+ /**
+ * @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 void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points);
+
+ virtual void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_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
+ * depending on application priority.
+ * @param priority Priority of application
+ */
+ virtual rpc::policy_table_interface_base::NumberOfNotificationsType
+ GetNotificationsNumber(const std::string& priority);
+
+ /**
+ * @brief Get priority for given application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string& priority) const OVERRIDE;
+
+ /**
+ * @brief Initialized Policy Table (load)
+ * @return bool Success of operation
+ */
+ bool Init(const std::string& file_name, const PolicySettings* settings);
+
+ /**
+ * @brief Get snapshot of Policy Table
+ * including app_policies, functional_groups,
+ * device_info, statistics, excluding user messages
+ * @return Generated structure for obtaining Json string.
+ */
+ virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+
+ /**
+ * Applies policy table to the current table
+ * @param update_pt policy table
+ * @return true if successfully
+ */
+ 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);
+
+ /**
+ * @brief AppHasHMIType checks whether app has been registered with certain
+ *HMI type.
+ *
+ * @return true in case app contains certain HMI type, false otherwise.
+ */
+ virtual bool AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const OVERRIDE;
+
+ /**
+ * Gets flag updateRequired
+ * @return true if update is required
+ */
+ bool UpdateRequired() const;
+
+ /**
+ * @brief Saves flag updateRequired
+ * @param status update status if true then update required.
+ */
+ void SaveUpdateRequired(bool status);
+
+ /**
+ * @brief GetInitialAppData Retrieves data from app_policies
+ * about app on its registration
+ * @param app_id id of registered app.
+ * All outputs are filled in only if not null
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types app_types Section on HMI where app can
+ * appear (Navigation, Phone etc)
+ * @return true in case initial application data was obtained successfuly.
+ */
+ bool GetInitialAppData(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types);
+
+ /**
+ * Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const;
+
+ /**
+ * @brief Get functional groupings from DB
+ * @param groups Known functional groupings
+ * @return true, if succeeded, otherwise - false
+ */
+ bool GetFunctionalGroupings(policy_table::FunctionalGroupings& groups);
+
+ /**
+ * Checks if the application is represented in policy table
+ * @param app_id application id
+ * @return true if application is represented in policy table
+ */
+ bool IsApplicationRepresented(const std::string& app_id) const;
+
+ /**
+ * Checks if the application has default policy
+ * @param app_id application id
+ * @return true if application has default policy
+ */
+ bool IsDefaultPolicy(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief SetIsDefault Sets is_default flag for application
+ * @param app_id app specific application
+ * @return true in case opperation was done successfully.
+ */
+ bool SetIsDefault(const std::string& app_id);
+
+ /**
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
+ bool IsPredataPolicy(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * Sets default policy for application
+ * @param app_id application id
+ * @return true if success
+ */
+ bool SetDefaultPolicy(const std::string& app_id);
+
+ /**
+ * @brief Is application allowed to send notifications while in
+ * Backgound or limited mode.
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Is application allowed to move foreground at will?
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ bool CanAppStealFocus(const std::string& app_id) const;
+
+ /**
+ * @brief Gets default_hmi for given application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value was
+ * not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHMI(const std::string& app_id, std::string& default_hmi) const;
+
+ /**
+ * Gets HMI types from specific policy
+ * @param app_id ID application
+ * @return list of HMI types
+ */
+ const policy_table::AppHMITypes* GetHMITypes(const std::string& app_id);
+
+ /**
+ * @brief Reset user consent for device data and applications permissions
+ * @return
+ */
+ bool ResetUserConsent();
+
+ /**
+ * @brief Get user permissions for device data usage
+ * @param device_id Generated or obtained id of device
+ * @param consented_groups Groups consented by user
+ * @param disallowed_groups Groups not consented by user
+ * @return true, if query was successfull, otherwise - false
+ */
+ bool GetUserPermissionsForDevice(const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups) const;
+
+ /**
+ * @brief Gets list of groups permissions from policy table
+ * @param device_id Unique device id, which hosts specific application
+ * @param policy_app_id Unique application id
+ * @param group_types Group list sorted by permission status
+ * @return true, if query was successfull, otherwise - false
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types);
+
+ /**
+ * @brief Get device groups and preconsented groups from policies section
+ * @param groups List of groups to be consented for device usage
+ * @param preconsented_groups List of preconsented groups for device usage
+ * @return true, if query was successful, otherwise - false
+ */
+ bool GetDeviceGroupsFromPolicies(
+ rpc::policy_table_interface_base::Strings& groups,
+ rpc::policy_table_interface_base::Strings& preconsented_groups) const;
+
+ /**
+ * @brief Add's information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @param connection_type device connection type
+ * @return bool Success of operation
+ */
+ bool AddDevice(const std::string& device_id,
+ const std::string& connection_type);
+
+ /**
+ * @brief Record information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @return bool Success of operation
+ */
+ bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware = "",
+ const std::string& firmware = "",
+ const std::string& os = "",
+ const std::string& os_version = "",
+ const std::string& carrier = "",
+ const uint32_t number_of_ports = 0,
+ const std::string& connection_type = "");
+
+ /**
+ * @brief Sets user consent for particular mobile device,
+ * i.e. to use device for exchanging of Policy Table.
+ * @return bool Success of operation
+ */
+ bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups = StringArray(),
+ const StringArray& disallowed_groups = StringArray());
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ */
+ bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed);
+
+ /**
+ * @brief Set user consent on functional groups
+ * @param permissions User consent on functional group
+ * @return true, if operation succedeed, otherwise - false
+ */
+ bool SetUserPermissionsForApp(const PermissionConsent& permissions);
+
+ /**
+ * @brief Records information about head unit system to PT
+ * @return bool Success of operation
+ */
+ bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language);
+
+ /**
+ * @brief Checks, if specific head unit is present in PT
+ * @return boot Suceess, if present, otherwise - false
+ */
+ bool IsMetaInfoPresent() const;
+
+ /**
+ * @brief Set current system language
+ * @param language System language
+ * @return true, if succedeed, otherwise - false
+ */
+ bool SetSystemLanguage(const std::string& language);
+
+ /**
+ * Increments global counter
+ * @param type type of counter
+ */
+ void Increment(usage_statistics::GlobalCounterId type);
+
+ /**
+ * Increments counter of application
+ * @param app_id id application
+ * @param type type of counter
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type);
+
+ /**
+ * Sets value of application information
+ * @param app_id id application
+ * @param type type of information
+ * @param value value of information
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value);
+
+ /**
+ * Adds value to stopwatch of application
+ * @param app_id id application
+ * @param type type of stopwatch
+ * @param seconds value for adding in seconds
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int seconds);
+
+ /**
+ * @brief CountUnconsentedGroups allows to obtain the count of unconsented
+ * groups for specific application.
+ * @param policy_app_id application id.
+ * @param device_id device id.
+ * @return the count of unconsented groups
+ */
+ int CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id);
+
+ /**
+ * @brief Gets functional group names and user_consent_prompts, if any
+ * @param Array to be filled with group ids, names and functional prompts
+ * @return true, if succeeded, otherwise - false
+ */
+ bool GetFunctionalGroupNames(FunctionalGroupNames& names);
+
+ /**
+ * @brief GetAllAppGroups allows to obtain all groups for certain application.
+ * @param app_id specific application id.
+ * @param all_group_ids parameter to fill.
+ */
+ void GetAllAppGroups(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids);
+ /**
+ * @brief GetPreConsentedGroups allows to obtain all pre-consented groups for
+ * specific application.
+ * @param app_id specific application id.
+ * @param preconsented_groups parameter to fill.
+ */
+ void GetPreConsentedGroups(const std::string& app_id,
+ FunctionalGroupIDs& preconsented_groups);
+ /**
+ * @brief GetConsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param app_id application id.
+ * @param allowed_groups list of allowed groups
+ * @param disallowed_groups list of disallowed groups
+ */
+ void GetConsentedGroups(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups);
+
+ /**
+ * @brief GetUnconsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param policy_app_id application id.
+ * @param unconsented_groups list of unconsented groups.
+ */
+ void GetUnconsentedGroups(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups);
+
+ void RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name);
+
+ /**
+ * @brief Set app policy to pre_DataConsented policy
+ * @param app_id Policy ID of application to be changed
+ * @return true, if succeeded, otherwise - false
+ */
+ bool SetPredataPolicy(const std::string& app_id);
+
+ /**
+ * @brief Removes unpaired devices
+ * @return true if success
+ */
+ bool CleanupUnpairedDevices();
+
+ /**
+ * Sets flag of unpaired device
+ * @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, bool unpaired = true);
+
+ /**
+ * Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name);
+
+ /**
+ * @brief LoadFromBackup allows to load policy into the cache from backup.
+ * @return true in case operation was successful.
+ */
+ bool LoadFromBackup();
+
+ /**
+ * @brief LoadFromFile allows to load policy cache from preloaded table.
+ * @param file_name preloaded
+ * @return
+ */
+ bool LoadFromFile(const std::string& file_name, policy_table::Table& table);
+
+ /**
+ * @brief Backup allows to save cache onto hard drive.
+ */
+ void Backup();
+
+ /**
+ * Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const;
+
+ /**
+ * @brief Allows to generate hash from the specified string.
+ * The djb2 algorithm uses for hash generation.
+ * @param str_to_hash - the string from which hash should be generated.
+ * @return integer hash for the specified string.
+ */
+ 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;
+
+ /**
+ * @brief GetCertificate allows to obtain certificate in order to
+ * make secure connection
+ *
+ * @return The certificate in PKCS#7.
+ */
+ virtual std::string GetCertificate() const OVERRIDE;
+
+ /**
+ * @brief MergePreloadPT allows to load policy table from certain JSON file,
+ * and then decide if merge is needed. The merge is needed in case when
+ * preload
+ * JSON date is different than current database.
+ *
+ * @param file_name the preloaded policy table JSON file.
+ * @return false in case of invalid preloaded_pt
+ */
+ bool MergePreloadPT(const std::string& file_name);
+
+ /**
+ * @brief MergeMC allows to merge ModuleConfig section by definite rules.
+ *
+ * The rules are:
+ * 1. Add new fields (known to PoliciesManager) & sub-sections if such are
+ * present in the updated Preloaded PT
+ * 2. "vehicle_make", “model”, “year” – leave the fields & values as they were
+ * in the database
+ * 3. For all other fields – overwrite the values with the new ones from
+ *preloaded PT.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database.
+ */
+ void MergeMC(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ /**
+ * @brief MergeFG allows to merge FunctionalGroupings sections by definite
+ *rules.
+ *
+ * The rules are:
+ * 1. If functional_group_name exists in both database (LocalPT) and updated
+ * PreloadedPT -> PoliciesManager must overwrite it (that is, replace such
+ * functional_group_name in the database by the one from Pre-PT).
+ * 2. If functional_group_name exists in updated PreloadedPT and does not
+ * exist in database (LocalPT), PoliciesManager must add such group to the
+ *database.
+ * 3. If functional_group_name does not exist in updated PreloadedPT and
+ * exists in the database (LocalPT), PoliciesManager must leave such group in
+ * the database without changes.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database.
+ */
+ void MergeFG(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ /**
+ * @brief MergeAP Allows to merge ApplicationPolicies section by definite
+ *relues.
+ * The rules are:
+ * 1. Leave “<appID>” sub-sections as they were in the database (fields &
+ *their values).
+ * 2. Over-write "default", "device", "pre_DataConsent" subsections.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database.
+ */
+ void MergeAP(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ /**
+ * @brief MergeCFM allows to merge ConsumerFriendlyMessages section by
+ *definite rules.
+ *
+ * The rules are:
+ * 1. If friendly_message_name exists in both database (LocalPT) and updated
+ * Preloaded PT -> PoliciesManager must overwrite it.
+ * 2. If friendly_message_name exists in updated Preloaded PT and does not
+ * exist in database (LocalPT), PoliciesManager must add such
+ * friendly_message_name to the database (LocalPT).
+ * 3. If friendly_message_name does not exist in updated Preloaded PT and
+ * exists in the database (LocalPT), PoliciesManager must leave such
+ * friendly_message_name in the database without changes.
+ *
+ * @param new_pt the policy table loaded from updated preload JSON file.
+ *
+ * @param pt the exists database
+ */
+ void MergeCFM(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt);
+
+ const PolicySettings& get_settings() const;
+
+ utils::SharedPtr<policy_table::Table> pt() const {
+ return pt_;
+ }
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
+ private:
+ std::string currentDateTime();
+ struct AppHMITypeToString {
+ std::string operator()(rpc::Enum<policy_table::AppHMIType> value) {
+ return std::string(policy_table::EnumToJsonString(value));
+ }
+ };
+
+ void GetGroupNameByHashID(const int32_t group_id, std::string& group_name);
+ void FillDeviceSpecificData();
+ bool AppExists(const std::string& app_id) const;
+ long ConvertSecondsToMinute(int seconds);
+
+ /**
+ * @brief Checks snapshot initialization and initializes to default values, if
+ * necessary
+ */
+ void CheckSnapshotInitialization();
+
+ void PersistData();
+
+ /**
+ * @brief Transform to lower case all non default application names in
+ * applications policies section
+ * @param pt polict rable for update
+ */
+ void MakeLowerCaseAppNames(policy_table::Table& pt) const;
+
+ 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:
+ utils::SharedPtr<policy_table::Table> pt_;
+ utils::SharedPtr<policy_table::Table> snapshot_;
+ utils::SharedPtr<PTRepresentation> backup_;
+ bool update_required;
+ typedef std::set<std::string> UnpairedDevices;
+ UnpairedDevices is_unpaired_;
+
+ mutable 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_;
+ const PolicySettings* settings_;
+
+#ifdef BUILD_TESTS
+ friend class AccessRemoteImpl;
+ FRIEND_TEST(AccessRemoteImplTest, CheckModuleType);
+ FRIEND_TEST(AccessRemoteImplTest, EnableDisable);
+ FRIEND_TEST(AccessRemoteImplTest, GetGroups);
+#endif // BUILD_TESTS
+};
+} // namespace policy
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_CACHE_MANAGER_H_
diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
new file mode 100644
index 0000000000..9f7c7318db
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h
@@ -0,0 +1,659 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_CACHE_MANAGER_INTERFACE_H_
+
+#include <string>
+#include <vector>
+
+#include "utils/shared_ptr.h"
+#include "policy/usage_statistics/counter.h"
+#include "policy/policy_types.h"
+#include "policy/policy_settings.h"
+#include "policy/policy_table/types.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace policy {
+
+class CacheManagerInterface {
+ public:
+ virtual ~CacheManagerInterface() {}
+
+ virtual const policy_table::Strings& GetGroups(const PTString& app_id) = 0;
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @return CheckPermissionResult containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ virtual void CheckPermissions(const policy_table::Strings& groups,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) = 0;
+
+ /**
+ * @brief Returns true if Policy Table was not updated yet
+ * from preloaded pt file.
+ */
+ virtual bool IsPTPreloaded() = 0;
+
+ /**
+ * Gets number of ignition cycles before next update policy table
+ * @return number of ignition cycles
+ */
+ virtual int IgnitionCyclesBeforeExchange() = 0;
+
+ /**
+ * Gets value in kilometers before next update policy table
+ * @param current value in kilometers from the odometers
+ * @return value in kilometers
+ */
+ virtual int KilometersBeforeExchange(int current) = 0;
+
+ /**
+ * @brief Sets counter value that passed for recieved successful PT UPdate
+ */
+ virtual bool SetCountersPassedForSuccessfulUpdate(Counters counter,
+ int value) = 0;
+
+ /**
+ * Gets value in days before next update policy table
+ * @param current value in days after epoch
+ * @return value in days
+ */
+ virtual int DaysBeforeExchange(int current) = 0;
+
+ /**
+ * @brief Increment number of ignition cycles since last exchange by 1
+ */
+ virtual void IncrementIgnitionCycles() = 0;
+
+ /**
+ * @brief Reset number of ignition cycles since last exchange to 0
+ */
+ virtual void ResetIgnitionCycles() = 0;
+
+ /**
+ * @brief Returns timeout to wait for a response of PT update
+ * @return value in seconds
+ */
+ virtual int TimeoutResponse() = 0;
+
+ /**
+ * @brief Returns number of seconds between each try of sending PTS
+ * @param seconds Return value: array of 5 elements
+ * @return bool Success of operation
+ */
+ virtual bool SecondsBetweenRetries(std::vector<int>& seconds) = 0;
+
+ /**
+ * @brief Get information about vehicle
+ */
+ virtual const VehicleInfo GetVehicleInfo() const = 0;
+
+ /**
+ * @brief Allows to update 'vin' field in module_meta table.
+ *
+ * @param new 'vin' value.
+ *
+ * @return true in case when data has been successfully updated,
+ * false otherwise.
+ */
+ virtual bool SetVINValue(const std::string& value) = 0;
+
+ /**
+ * @brief Get message text for displaying/pronouncing for user
+ * dependent on language and context.
+ * @param msg_codes Context of message (Driver distraction, Grant permission
+ * etc)
+ * @param language Language of the message
+ * @return Array of appropriate messages parameters
+ */
+ virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language) = 0;
+
+ /**
+ * @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 void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) = 0;
+ virtual void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_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
+ * depending on application priority.
+ * @param priority Priority of application
+ */
+ virtual policy_table::NumberOfNotificationsType GetNotificationsNumber(
+ const std::string& priority) = 0;
+
+ /**
+ * @brief Get priority for given application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string& priority) const = 0;
+
+ /**
+ * @brief Initialized Policy Table (load)
+ * @return bool Success of operation
+ */
+ virtual bool Init(const std::string& file_name,
+ const PolicySettings* settings) = 0;
+
+ /**
+ * @brief Get snapshot of Policy Table
+ * including app_policies, functional_groups,
+ * device_info, statistics, excluding user messages
+ * @return Generated structure for obtaining Json string.
+ */
+ virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() = 0;
+
+ /**
+ * Applies policy table to the current table
+ * @param update_pt policy table
+ * @return true if successfully
+ */
+ 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;
+
+ /**
+ * @brief AppHasHMIType checks whether app has been registered with certain
+ *HMI type.
+ *
+ * @return true in case app contains certain HMI type, false otherwise.
+ */
+ virtual bool AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const = 0;
+
+ /**
+ * Gets flag updateRequired
+ * @return true if update is required
+ */
+ virtual bool UpdateRequired() const = 0;
+
+ /**
+ * @brief Saves flag updateRequired
+ * @param status update status if true then update required.
+ */
+ virtual void SaveUpdateRequired(bool status) = 0;
+
+ /**
+ * @brief GetInitialAppData Retrieves data from app_policies
+ * about app on its registration
+ * @param app_id id of registered app.
+ * All outputs are filled in only if not null
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types app_types Section on HMI where app can
+ * appear (Navigation, Phone etc)
+ * @return true in case initial application data was obtained successfuly.
+ */
+ virtual bool GetInitialAppData(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types) = 0;
+
+ /**
+ * Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get functional groupings from DB
+ * @param groups Known functional groupings
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) = 0;
+
+ /**
+ * Checks if the application is represented in policy table
+ * @param app_id application id
+ * @return true if application is represented in policy table
+ */
+ virtual bool IsApplicationRepresented(const std::string& app_id) const = 0;
+
+ /**
+ * Checks if the application has default policy
+ * @param app_id application id
+ * @return true if application has default policy
+ */
+ virtual bool IsDefaultPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * @brief SetIsDefault Sets is_default flag for application
+ * @param app_id app specific application
+ * @return true in case opperation was done successfully.
+ */
+ virtual bool SetIsDefault(const std::string& app_id) = 0;
+
+ /**
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
+ virtual bool IsPredataPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * Sets default policy for application
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual bool SetDefaultPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief Is application allowed to send notifications while in
+ * Backgound or limited mode.
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Is application allowed to move foreground at will?
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get default_hmi for given application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value was
+ * not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetDefaultHMI(const std::string& app_id,
+ std::string& default_hmi) const = 0;
+
+ /**
+ * Gets HMI types from specific policy
+ * @param app_id ID application
+ * @return list of HMI types
+ */
+ virtual const policy_table::AppHMITypes* GetHMITypes(
+ const std::string& app_id) = 0;
+
+ /**
+ * @brief Reset user consent for device data and applications permissions
+ * @return
+ */
+ virtual bool ResetUserConsent() = 0;
+
+ /**
+ * @brief Get user permissions for device data usage
+ * @param device_id Generated or obtained id of device
+ * @param consented_groups Groups consented by user
+ * @param disallowed_groups Groups not consented by user
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetUserPermissionsForDevice(
+ const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups) const = 0;
+
+ /**
+ * @brief Gets list of groups permissions from policy table
+ * @param device_id Unique device id, which hosts specific application
+ * @param policy_app_id Unique application id
+ * @param group_types Group list sorted by permission status
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief Get device groups and preconsented groups from policies section
+ * @param groups List of groups to be consented for device usage
+ * @param preconsented_groups List of preconsented groups for device usage
+ * @return true, if query was successful, otherwise - false
+ */
+ virtual bool GetDeviceGroupsFromPolicies(
+ rpc::policy_table_interface_base::Strings& groups,
+ rpc::policy_table_interface_base::Strings& preconsented_groups) const = 0;
+
+ /**
+ * @brief Add's information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @param connection_type device connection type
+ * @return bool Success of operation
+ */
+ virtual bool AddDevice(const std::string& device_id,
+ const std::string& connection_type) = 0;
+
+ /**
+ * @brief Record information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @return bool Success of operation
+ */
+ virtual bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type) = 0;
+
+ /**
+ * @brief Sets user consent for particular mobile device,
+ * i.e. to use device for exchanging of Policy Table.
+ * @return bool Success of operation
+ */
+ virtual bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups,
+ const StringArray& disallowed_groups) = 0;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ */
+ virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed) = 0;
+
+ /**
+ * @brief Set user consent on functional groups
+ * @param permissions User consent on functional group
+ * @return true, if operation succedeed, otherwise - false
+ */
+ virtual bool SetUserPermissionsForApp(
+ const PermissionConsent& permissions) = 0;
+
+ /**
+ * @brief Records information about head unit system to PT
+ * @return bool Success of operation
+ */
+ virtual bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Checks, if specific head unit is present in PT
+ * @return boot Suceess, if present, otherwise - false
+ */
+ virtual bool IsMetaInfoPresent() const = 0;
+
+ /**
+ * @brief Set current system language
+ * @param language System language
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool SetSystemLanguage(const std::string& language) = 0;
+
+ /**
+ * Increments global counter
+ * @param type type of counter
+ */
+ virtual void Increment(usage_statistics::GlobalCounterId type) = 0;
+
+ /**
+ * Increments counter of application
+ * @param app_id id application
+ * @param type type of counter
+ */
+ virtual void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) = 0;
+
+ /**
+ * Sets value of application information
+ * @param app_id id application
+ * @param type type of information
+ * @param value value of information
+ */
+ virtual void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) = 0;
+
+ /**
+ * Adds value to stopwatch of application
+ * @param app_id id application
+ * @param type type of stopwatch
+ * @param seconds value for adding in seconds
+ */
+ virtual void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int seconds) = 0;
+
+ /**
+ * @brief CountUnconsentedGroups allows to obtain the count of unconsented
+ * groups for specific application.
+ * @param policy_app_id application id.
+ * @param device_id device id.
+ * @param the count of unconsented groups
+ */
+ 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
+ * @param Array to be filled with group ids, names and functional prompts
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool GetFunctionalGroupNames(FunctionalGroupNames& names) = 0;
+
+ /**
+ * @brief GetAllAppGroups allows to obtain all groups for certain application.
+ * @param app_id specific application id.
+ * @param all_group_ids parameter to fill.
+ */
+ virtual void GetAllAppGroups(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids) = 0;
+ /**
+ * @brief GetPreConsentedGroups allows to obtain all pre-consented groups for
+ * specific application.
+ * @param app_id specific application id.
+ * @param preconsented_groups parameter to fill.
+ */
+ virtual void GetPreConsentedGroups(
+ const std::string& app_id, FunctionalGroupIDs& preconsented_groups) = 0;
+ /**
+ * @brief GetConsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param app_id application id.
+ * @param allowed_groups list of allowed groups
+ * @param disallowed_groups list of disallowed groups
+ */
+ virtual void GetConsentedGroups(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups) = 0;
+
+ /**
+ * @brief GetUnconsentedGroups allows to obtain list of allowed and disallowed
+ * groups for specific application on certain device.
+ * @param device_id certain device
+ * @param policy_app_id application id.
+ * @param unconsented_groups list of unconsented groups.
+ */
+ virtual void GetUnconsentedGroups(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups) = 0;
+
+ virtual void RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name) = 0;
+
+ /**
+ * @brief Set app policy to pre_DataConsented policy
+ * @param app_id Policy ID of application to be changed
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool SetPredataPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief Removes unpaired devices
+ * @return true if success
+ */
+ virtual bool CleanupUnpairedDevices() = 0;
+
+ /**
+ * Sets flag of unpaired device
+ * @param device_id Unique device id
+ * @param unpaired True, if should be marked as unpaired, otherwise - false
+ * @return true if success
+ */
+ virtual bool SetUnpairedDevice(const std::string& device_id,
+ bool unpaired = true) = 0;
+
+ /**
+ * Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ virtual bool ResetPT(const std::string& file_name) = 0;
+
+ /**
+ * @brief LoadFromBackup allows to load policy into the cache from backup.
+ * @return true in case operation was successful.
+ */
+ virtual bool LoadFromBackup() = 0;
+
+ /**
+ * @brief LoadFromFile allows to load policy cache from preloaded table.
+ * @param file_name preloaded
+ * @param table object which will be filled during file parsing.
+ * @return true in case file was successfuly loaded, false otherwise.
+ */
+ virtual bool LoadFromFile(const std::string& file_name,
+ policy_table::Table& table) = 0;
+
+ /**
+ * @brief Backup allows to save cache onto hard drive.
+ */
+ virtual void Backup() = 0;
+
+ /**
+ * Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ virtual uint32_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;
+
+ /**
+ * @brief GetCertificate allows to obtain certificate in order to
+ * make secure connection
+ *
+ * @return The certificate in PKCS#7.
+ */
+ virtual std::string GetCertificate() const = 0;
+
+ /**
+ * @brief pt allows to obtain SharedPtr to PT.
+ * Used ONLY in Unit tests
+ * @return SharedPTR to PT
+ *
+ */
+ virtual utils::SharedPtr<policy_table::Table> pt() const = 0;
+
+ /**
+ * @brief OnDeviceSwitching Processes existing policy permissions for devices
+ * switching transport
+ * @param device_id_from Device ID original
+ * @param device_id_to Device ID new
+ */
+ virtual void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) = 0;
+};
+
+typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR__POLICY_CACHE_MANAGER_INTERFACE_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h
new file mode 100644
index 0000000000..8a60801dd4
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_helper.h
@@ -0,0 +1,249 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
+
+#include "policy/policy_table/functions.h"
+#include "utils/shared_ptr.h"
+#include "policy/policy_types.h"
+
+namespace policy {
+class PolicyManagerImpl;
+
+const std::string kAllowedKey = "allowed";
+const std::string kUserDisallowedKey = "userDisallowed";
+const std::string kUndefinedKey = "undefined";
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+typedef policy_table::Strings::const_iterator StringsConstItr;
+typedef policy_table::ApplicationPolicies::const_iterator AppPoliciesConstItr;
+typedef policy_table::HmiLevels::const_iterator HMILevelsConstItr;
+typedef policy_table::Parameters::const_iterator ParametersConstItr;
+typedef policy_table::FunctionalGroupings::const_iterator FuncGroupConstItr;
+
+typedef policy_table::ApplicationPolicies::value_type AppPoliciesValueType;
+typedef policy_table::Rpc::value_type RpcValueType;
+typedef policy_table::Strings::value_type StringsValueType;
+
+/*
+ * @brief Helper struct to compare functional group names
+ */
+struct CompareGroupName {
+ explicit CompareGroupName(const StringsValueType& group_name);
+ bool operator()(const StringsValueType& group_name_to_compare) const;
+
+ private:
+ const StringsValueType& group_name_;
+};
+
+/*
+ * @brief Used for compare of policies parameters mapped with specific
+ * application ids
+ */
+bool operator!=(const policy_table::ApplicationParams& first,
+ const policy_table::ApplicationParams& second);
+
+/*
+ * @brief Helper struct for checking changes of application policies, which
+ * come with update along with current data snapshot
+ * In case of policies changed for some application, current data will be
+ * updated and notification will be sent to application
+ */
+struct CheckAppPolicy {
+ CheckAppPolicy(PolicyManagerImpl* pm,
+ const utils::SharedPtr<policy_table::Table> update,
+ const utils::SharedPtr<policy_table::Table> snapshot);
+ 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 std::string& app_id,
+ const policy_table::Strings& groups) 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& 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_;
+};
+
+/*
+ * @brief Fill permissions data with merged rpc permissions for hmi levels and
+ * parameters
+ */
+struct FillNotificationData {
+ FillNotificationData(Permissions& data,
+ GroupConsent group_state,
+ GroupConsent undefined_group_consent);
+ bool operator()(const RpcValueType& rpc);
+ void UpdateHMILevels(const policy_table::HmiLevels& in_hmi,
+ std::set<HMILevel>& out_hmi);
+ void UpdateParameters(const policy_table::Parameters& in_parameters,
+ std::set<Parameter>& out_parameter);
+
+ private:
+ void ExcludeSame();
+ void ExcludeSameHMILevels(std::set<HMILevel>& source,
+ const std::set<HMILevel>& target);
+ void ExcludeSameParameters(std::set<Parameter>& source,
+ const std::set<Parameter>& target);
+ void InitRpcKeys(const std::string& rpc_name);
+ std::string current_key_;
+ Permissions& data_;
+};
+
+/*
+ * @brief Checks for functional group presence and pass it to helper struct,
+ * which fills permissions data according to group consent
+ */
+struct ProcessFunctionalGroup {
+ ProcessFunctionalGroup(
+ const policy_table::FunctionalGroupings& fg,
+ const std::vector<FunctionalGroupPermission>& group_permissions,
+ Permissions& data,
+ GroupConsent undefined_group_consent = GroupConsent::kGroupDisallowed);
+ bool operator()(const StringsValueType& group_name);
+
+ private:
+ GroupConsent GetGroupState(const std::string& group_name);
+ const policy_table::FunctionalGroupings& fg_;
+ const std::vector<FunctionalGroupPermission>& group_permissions_;
+ Permissions& data_;
+ GroupConsent undefined_group_consent_;
+};
+
+struct FunctionalGroupInserter {
+ FunctionalGroupInserter(const policy_table::Strings& preconsented_groups,
+ PermissionsList& list);
+ void operator()(const StringsValueType& group_name);
+
+ private:
+ PermissionsList& list_;
+ const policy_table::Strings& preconsented_;
+};
+
+/**
+ * @brief Fills FunctionalGroupPermissions with provided params
+ * @param ids Functional group ids from DB
+ * @param names Group names and user_consent_prompt
+ * @param state User consent for group
+ * @param permissions Struct to be filled with provided params
+ */
+void FillFunctionalGroupPermissions(
+ FunctionalGroupIDs& ids,
+ FunctionalGroupNames& names,
+ GroupConsent state,
+ std::vector<FunctionalGroupPermission>& permissions);
+
+/**
+ * @brief Checks, if application is predefined, e.g. "default", i.e. which is
+ * must be present in policy table
+ * @param app Application struct
+ * @return true, if app is predefined, otherwise - false
+ */
+bool IsPredefinedApp(const AppPoliciesValueType& app);
+
+/**
+ * @brief Excludes same values
+ * @param from Source, which should be checked
+ * @param what Target, which should be excluded from source
+ * @return Values without excluded
+ */
+FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
+ const FunctionalGroupIDs& what);
+
+/**
+ * @brief Merges all values without same values
+ * @param first First source of values
+ * @param second Second source of values
+ * @return Merged values w/o same values
+ */
+FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second);
+
+/**
+ * @brief Finds same values
+ * @param first First source of values
+ * @param second Second source of values
+ * @return Same values set, if any found
+ */
+FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second);
+
+/**
+ * @brief Unwrap application policies from predefined values to specific policy
+ * values, i.e. if application has "default", it will be assigned default
+ * policies
+ * @param app_policies Application policies to unwrap
+ * @return true, if succeded, otherwise - false
+ */
+bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies);
+}
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
new file mode 100644
index 0000000000..941db1a67f
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h
@@ -0,0 +1,939 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
+
+#include <string>
+#include <list>
+#include <cstdint>
+
+#include "utils/shared_ptr.h"
+#include "utils/lock.h"
+#include "policy/policy_manager.h"
+#include "policy/policy_table.h"
+#include "policy/cache_manager_interface.h"
+#include "policy/update_status_manager.h"
+#include "policy/policy_table/functions.h"
+#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/policy_helper.h"
+#include "utils/timer.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
+#endif // SDL_REMOTE_CONTROL
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace policy {
+struct CheckAppPolicy;
+
+class PolicyManagerImpl : public PolicyManager {
+ public:
+ PolicyManagerImpl();
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ void set_listener(PolicyListener* listener) OVERRIDE;
+
+ /**
+ * @brief listener get current policy listener instance
+ * @return current policy listener
+ */
+ PolicyListener* listener() const {
+ return listener_;
+ }
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) OVERRIDE;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) OVERRIDE;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name) OVERRIDE;
+
+ /**
+ * @brief Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @param out_end_points output vector of urls
+ */
+ void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+ void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ * @return url which point to the resourse where lock screen icon could be
+ *obtained.
+ */
+ std::string GetLockScreenIconUrl() const OVERRIDE;
+
+ /**
+ * @brief PTU is needed, for this PTS has to be formed and sent.
+ */
+ bool RequestPTUpdate() OVERRIDE;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param device_id Id of device of application
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed and list of
+ * allowed params.
+ */
+ void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ bool ResetUserConsent() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ void KmsChanged(int kilometers) OVERRIDE;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ void IncrementIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchange() OVERRIDE;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchangeAtUserRequest() OVERRIDE;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ std::string GetPolicyTableStatus() const OVERRIDE;
+
+ /**
+ * @brief Resets retry sequence
+ */
+ void ResetRetrySequence();
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ uint32_t NextRetryTimeout() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeMSec() OVERRIDE;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ const std::vector<int> RetrySequenceDelaysSeconds() OVERRIDE;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ void OnExceededTimeout() OVERRIDE;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ void OnUpdateStarted() OVERRIDE;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ void PTUpdatedAt(Counters counter, int value) OVERRIDE;
+
+ /**
+ * @brief Refresh data about retry sequence from policy table
+ */
+ virtual void RefreshRetrySequence();
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ DeviceConsent GetUserConsentForDevice(
+ const std::string& device_id) const OVERRIDE;
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetUserConsentForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ void SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) OVERRIDE;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ bool ReactOnUserDevConsentForApp(const std::string app_id,
+ const bool is_device_allowed) OVERRIDE;
+
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) OVERRIDE;
+
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ void AddDevice(const std::string& device_id,
+ const std::string& connection_type) OVERRIDE;
+
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) OVERRIDE;
+
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ */
+ void SetUserConsentForApp(const PermissionConsent& permissions) OVERRIDE;
+
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const OVERRIDE;
+
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const OVERRIDE;
+
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @return Array of structs with appropriate message parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ const std::vector<std::string>& message_code,
+ const std::string& language) OVERRIDE;
+
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetPermissionsForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ void SetSystemLanguage(const std::string& language) OVERRIDE;
+
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) OVERRIDE;
+
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ void OnSystemReady() OVERRIDE;
+
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
+
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ void SetVINValue(const std::string& value) OVERRIDE;
+
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) OVERRIDE;
+
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ void RemovePendingPermissionChanges(const std::string& app_id) OVERRIDE;
+
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ bool CleanupUnpairedDevices() OVERRIDE;
+
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ bool CanAppStealFocus(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ void MarkUnpairedDevice(const std::string& device_id) OVERRIDE;
+
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
+ StatusNotifier AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief Gets HMI types
+ * @param application_id ID application
+ * @param app_types list to save HMI types
+ * @return true if policy has specific policy for this application
+ */
+ bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) OVERRIDE;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+
+ /**
+ * @brief Sends notification about application HMI level changed
+ * @param who application information structure
+ */
+ void SendHMILevelChanged(const ApplicationOnDevice& who);
+
+ /**
+ * @brief Sends notification if application permissions were changed
+ * @param application_id Unique id of application
+ */
+ void OnPrimaryGroupsChanged(const std::string& application_id);
+#endif // SDL_REMOTE_CONTROL
+
+ /**
+ * @brief Removes consent for application functional group
+ * @param application_id Unique id of application
+ * @param group_name application functional group name
+ */
+ virtual void RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name);
+
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ void SaveUpdateStatusRequired(bool is_update_needed) OVERRIDE;
+
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Setter for cache_manager instance
+ * @param cache_manager pointer to new cache_manager instance
+ */
+ void set_cache_manager(CacheManagerInterface* cache_manager);
+
+ /**
+ * @brief Handler on applications search started
+ */
+ void OnAppsSearchStarted() OVERRIDE;
+
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
+
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ const VehicleInfo GetVehicleInfo() const OVERRIDE;
+
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
+
+ void OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) OVERRIDE;
+
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ std::string RetrieveCertificate() const OVERRIDE;
+
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ bool HasCertificate() const OVERRIDE;
+
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
+ AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+
+ /**
+ * @brief Checks if there is existing URL in the EndpointUrls vector with
+ * index saved in the policy manager and if not, it moves to the next
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
+ AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const OVERRIDE;
+
+#ifdef BUILD_TESTS
+ /**
+ * @brief Getter for cache_manager instance
+ * @return cache_manager instance
+ */
+ inline CacheManagerInterfaceSPtr GetCache() {
+ return cache_;
+ }
+
+ /**
+ * @brief Setter for send_on_update_sent_out
+ * @param send_on_update_sent_out new value of this flag
+ */
+ inline void SetSendOnUpdateSentOut(const bool send_on_update_sent_out) {
+ send_on_update_sent_out_ = send_on_update_sent_out;
+ }
+#endif // BUILD_TESTS
+
+ // Interface StatisticsManager (begin)
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) OVERRIDE;
+
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) OVERRIDE;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) OVERRIDE;
+ // Interface StatisticsManager (end)
+
+ protected:
+#ifdef USE_HMI_PTU_DECRYPTION
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
+ virtual utils::SharedPtr<policy_table::Table> Parse(
+ const BinaryMessage& pt_content);
+#else
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
+ virtual utils::SharedPtr<policy_table::Table> ParseArray(
+ const BinaryMessage& pt_content);
+#endif
+
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
+ const PolicySettings& get_settings() const OVERRIDE;
+
+ private:
+ /**
+ * @brief Checks if PT update should be started and schedules it if needed
+ */
+ void CheckTriggers();
+
+ /**
+ * @brief Compares current applications policies to the updated one and
+ * returns apporopriate result codes per application, which that are being
+ * processed by sending notification to applications registered and to the
+ * system
+ * @param update Shared pointer to policy table udpate
+ * @param snapshot Shared pointer to current copy of policy table
+ * @return Collection per-application results
+ */
+ void CheckPermissionsChanges(
+ const utils::SharedPtr<policy_table::Table> update,
+ const utils::SharedPtr<policy_table::Table> snapshot);
+
+ /**
+ * @brief Fill structure to be sent with OnPermissionsChanged notification
+ *
+ * @param Policy table struct, which contains rpc functional groups data
+ * @param List of rpc functional group names, which should be checked
+ * @param group_permission User permissions for functional groups
+ * @param Notification struct to be filled and sent
+ */
+ void PrepareNotificationData(
+ const policy_table::FunctionalGroupings& groups,
+ const policy_table::Strings& group_names,
+ const std::vector<FunctionalGroupPermission>& group_permission,
+ Permissions& notification_data);
+
+ /**
+ * @brief Validate PermissionConsent structure according to currently
+ * assigned groups
+ * @param permissions PermissionConsent structure that should be validated.
+ * @return PermissonConsent struct, which contains no foreign groups
+ */
+ PermissionConsent EnsureCorrectPermissionConsent(
+ const PermissionConsent& permissions_to_check);
+
+ /**
+ * @brief Allows to process case when added application is not present in
+ * policy db.
+ * @param policy application id.
+ * @param cuuren consent for application's device.
+ */
+ void AddNewApplication(const std::string& application_id,
+ DeviceConsent device_consent);
+
+ /**
+ * @brief Allows to process case when added application is already
+ * in policy db.
+ * @param policy application id.
+ * @param cuuren consent for application's device.
+ */
+ void PromoteExistedApplication(const std::string& application_id,
+ DeviceConsent device_consent);
+
+ /**
+ * @brief Check if certain application already in policy db.
+ * @param policy application id.
+ * @return true if application presents false otherwise.
+ */
+ 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);
+
+ /**
+ * @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.
+ */
+ void StartPTExchange() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded days
+ * @return true if exceeded
+ */
+ bool ExceededDays() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ bool ExceededIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Checks is specified policy table valid
+ * @param policy_table pointer to policy table to check
+ * @param type policy table type
+ * @return true if policy table valid, otherwise false
+ */
+ bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
+ policy_table::PolicyTableType type) const;
+
+ /**
+ * @brief Starts new retry sequence
+ */
+ void RetrySequence();
+
+ private:
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of RPC param/HMI permissions
+ */
+ void GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data);
+
+ /**
+ * @brief Checks if module for application is present in policy table
+ * @param app_id id of application
+ * @param module type
+ * @return true if module is present, otherwise - false
+ */
+ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE;
+
+ /**
+ * @brief Send OnPermissionsChange notification to mobile app
+ * when it's permissions are changed.
+ * @param device_id Device on which app is running
+ * @param application_id ID of app whose permissions are changed
+ */
+ void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
+ PolicyListener* listener_;
+
+ /**
+ * @brief UpdateStatusManager instance for controlling PT status
+ */
+ UpdateStatusManager update_status_manager_;
+
+ /**
+ * @brief pointer to CacheManagerInterface instance for getting policy data
+ */
+ CacheManagerInterfaceSPtr cache_;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief pointer to AccessRemote instance for working with RC applications
+ */
+ utils::SharedPtr<AccessRemote> access_remote_;
+#endif
+
+ /**
+ * @brief lock guard for protecting applications list access
+ */
+ sync_primitives::Lock apps_registration_lock_;
+
+ /**
+ * @brief lock guard for protecting application permissions access
+ */
+ sync_primitives::Lock app_permissions_diff_lock_;
+
+ /**
+ * @brief Collection of parameters to be reported to the system with
+ * SDL.ActivateApp response or OnAppPermissionsChanged notification
+ * Being set during policy table update processing
+ */
+ typedef std::map<std::string, AppPermissions> PendingPermissions;
+ PendingPermissions app_permissions_diff_;
+
+ /**
+ * @brief Timeout to wait response with UpdatePT
+ */
+ uint32_t retry_sequence_timeout_;
+
+ /**
+ * @brief Seconds between retries to update PT
+ */
+ std::vector<int> retry_sequence_seconds_;
+
+ /**
+ * @brief Current index trying of retry sequence
+ */
+ uint32_t retry_sequence_index_;
+
+ /**
+ * @brief Lock for guarding retry sequence
+ */
+ sync_primitives::Lock retry_sequence_lock_;
+
+ /**
+ * @brief Timer to retry UpdatePT
+ */
+ timer::Timer timer_retry_sequence_;
+
+ /**
+ * @brief Device id, which is used during PTU handling for specific
+ * application
+ */
+ mutable std::string last_device_id_;
+
+ /**
+ * @brief Flag for checking first ignition cycle
+ */
+ bool ignition_check;
+
+ /**
+ * @brief Pointer to current policy settings structure
+ */
+ const PolicySettings* settings_;
+ friend struct CheckAppPolicy;
+ friend struct ProccessAppGroups;
+
+ /**
+ * @brief Pair of app index and url index from Endpoints vector
+ * that contains all application URLs
+ */
+ RetrySequenceURL retry_sequence_url_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU was received
+ */
+ bool wrong_ptu_update_received_;
+
+ /**
+ * @brief Flag for notifying that PTU was started
+ */
+ bool send_on_update_sent_out_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU should be triggered
+ */
+ bool trigger_ptu_;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_table.h b/src/components/policy/policy_regular/include/policy/policy_table.h
new file mode 100644
index 0000000000..afee8a34e4
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_table.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_
+
+#include "utils/shared_ptr.h"
+#include "policy/pt_representation.h"
+#include "policy/pt_ext_representation.h"
+
+namespace policy {
+
+class PolicyTable {
+ public:
+ PolicyTable();
+ explicit PolicyTable(utils::SharedPtr<PTRepresentation> pt_data);
+ virtual ~PolicyTable();
+
+ /**
+ * @brief Returns current implementation of
+ * actual class storing policy table.
+ * @return PTRepresentation* Policy Table Content Handler
+ */
+ utils::SharedPtr<PTRepresentation> pt_data() const {
+ return pt_data_;
+ }
+
+ private:
+ utils::SharedPtr<PTRepresentation> pt_data_;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
new file mode 100644
index 0000000000..4eb35d2aa4
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_ENUMS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_ENUMS_H_
+
+#include <string>
+
+namespace rpc {
+namespace policy_table_interface_base {
+
+enum Priority {
+ P_EMERGENCY,
+ P_NAVIGATION,
+ P_VOICECOM,
+ P_COMMUNICATION,
+ P_NORMAL,
+ P_NONE,
+};
+
+bool IsValidEnum(Priority val);
+const char* EnumToJsonString(Priority val);
+bool EnumFromJsonString(const std::string& literal, Priority* result);
+
+enum HmiLevel {
+ HL_BACKGROUND,
+ HL_FULL,
+ HL_LIMITED,
+ HL_NONE,
+};
+bool IsValidEnum(HmiLevel val);
+const char* EnumToJsonString(HmiLevel val);
+bool EnumFromJsonString(const std::string& literal, HmiLevel* result);
+
+enum Parameter {
+ P_GPS,
+ P_SPEED,
+ P_ENGINETORQUE,
+ P_EXTERNALTEMPERATURE,
+ P_FUELLEVEL,
+ P_FUELLEVEL_STATE,
+ P_HEADLAMPSTATUS,
+ P_INSTANTFUELCONSUMPTION,
+ P_ODOMETER,
+ P_TIREPRESSURE,
+ P_WIPERSTATUS,
+ P_VIN,
+ P_ACCPEDALPOSITION,
+ P_BELTSTATUS,
+ P_DRIVERBRAKING,
+ P_PRNDL,
+ P_RPM,
+ P_STEERINGWHEELANGLE,
+ P_MYKEY,
+ P_AIRBAGSTATUS,
+ P_BODYINFORMATION,
+ P_CLUSTERMODESTATUS,
+ P_DEVICESTATUS,
+ P_EMERGENCYEVENT,
+ P_ECALLINFO,
+ P_EMPTY // Added to allow empty parameters handling
+};
+
+bool IsValidEnum(Parameter val);
+const char* EnumToJsonString(Parameter val);
+bool EnumFromJsonString(const std::string& literal, Parameter* result);
+
+enum AppHMIType {
+ AHT_DEFAULT,
+ AHT_COMMUNICATION,
+ AHT_MEDIA,
+ AHT_MESSAGING,
+ AHT_NAVIGATION,
+ AHT_INFORMATION,
+ AHT_SOCIAL,
+ AHT_BACKGROUND_PROCESS,
+ AHT_TESTING,
+ AHT_SYSTEM,
+ AHT_PROJECTION,
+ AHT_REMOTE_CONTROL
+};
+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);
+
+enum Input {
+ I_GUI,
+ I_VUI,
+};
+bool IsValidEnum(Input val);
+const char* EnumToJsonString(Input val);
+bool EnumFromJsonString(const std::string& literal, Input* result);
+
+enum ModuleType {
+ MT_CLIMATE,
+ MT_RADIO,
+};
+bool IsValidEnum(ModuleType val);
+const char* EnumToJsonString(ModuleType val);
+bool EnumFromJsonString(const std::string& literal, ModuleType* result);
+
+extern const std::string kDefaultApp;
+extern const std::string kPreDataConsentApp;
+extern const std::string kDeviceApp;
+
+} // namespace policy_table_interface_base
+} // namespace rpc
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_ENUMS_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/functions.h b/src/components/policy/policy_regular/include/policy/policy_table/functions.h
new file mode 100644
index 0000000000..312b56ebef
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_table/functions.h
@@ -0,0 +1,7 @@
+// This file is generated, do not edit
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_FUNCTIONS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_FUNCTIONS_H_
+#include "./enums.h"
+#include "./types.h"
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_FUNCTIONS_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h
new file mode 100644
index 0000000000..61585776f2
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h
@@ -0,0 +1,491 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_TYPES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_TYPES_H_
+
+#include <climits>
+
+#include "policy/policy_table/enums.h"
+#include "rpc_base/rpc_message.h"
+
+namespace Json {
+class Value;
+} // namespace Json
+namespace rpc {
+namespace policy_table_interface_base {
+struct AppLevel;
+struct ApplicationParams;
+struct DeviceParams;
+struct MessageLanguages;
+struct MessageString;
+struct RpcParameters;
+struct Rpcs;
+} // namespace policy_table_interface_base
+} // namespace rpc
+
+namespace rpc {
+namespace policy_table_interface_base {
+
+// According to HMI API
+#define ODO_MAX 17000000
+
+typedef Array<String<1, 255>, 0, 255> Strings;
+
+typedef Array<Enum<AppHMIType>, 0, 255> AppHMITypes;
+
+typedef Array<Enum<HmiLevel>, 0, 4> HmiLevels;
+
+typedef Array<Enum<Parameter>, 0, 24> Parameters;
+
+typedef Map<RpcParameters, 0, UINT_MAX> Rpc;
+
+typedef Array<String<10, 255>, 1, 3> URL;
+
+typedef Map<URL, 1, 255> URLList;
+
+typedef Map<URLList, 1, 255> ServiceEndpoints;
+
+typedef uint8_t NumberOfNotificationsType;
+typedef Map<Integer<NumberOfNotificationsType, 0, 255>, 0, 6>
+ NumberOfNotificationsPerMinute;
+
+typedef Array<Integer<uint16_t, 1, 1000>, 0, 5> SecondsBetweenRetries;
+
+typedef Map<MessageString, 0, 500> Languages;
+
+typedef Map<MessageLanguages, 0, 255> Messages;
+
+typedef Map<AppLevel, 0, 255> AppLevels;
+
+typedef Map<Stringifyable<Nullable<ApplicationParams> >, 1, 1000>
+ ApplicationPolicies;
+
+typedef Map<Rpcs, 1, 255> FunctionalGroupings;
+
+typedef Map<DeviceParams, 0, 255> DeviceData;
+
+typedef Array<Enum<RequestType>, 0, 255> RequestTypes;
+
+#ifdef SDL_REMOTE_CONTROL
+typedef Map<Strings, 0, 255> RemoteRpcs;
+typedef Map<RemoteRpcs, 0, 255> AccessModules;
+typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
+#endif // SDL_REMOTE_CONTROL
+
+typedef AppHMIType AppHmiType;
+typedef std::vector<AppHMIType> AppHmiTypes;
+
+struct PolicyBase : CompositeType {
+ public:
+ Enum<Priority> priority;
+
+ public:
+ PolicyBase();
+ PolicyBase(Priority priority);
+ 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(Priority priority);
+ ~DevicePolicy();
+ explicit DevicePolicy(const Json::Value* value__);
+};
+
+struct ApplicationParams : PolicyBase {
+ public:
+ Strings groups;
+ Optional<Strings> nicknames;
+ Optional<AppHMITypes> AppHMIType;
+ Optional<RequestTypes> RequestType;
+ Optional<Integer<uint16_t, 0, 65225> > memory_kb;
+ Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
+ Optional<String<0, 255> > certificate;
+#ifdef SDL_REMOTE_CONTROL
+ mutable Optional<ModuleTypes> moduleType;
+#endif // SDL_REMOTE_CONTROL
+
+ public:
+ ApplicationParams();
+ ApplicationParams(const Strings& groups, Priority priority);
+ ~ApplicationParams();
+ explicit ApplicationParams(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;
+#ifdef SDL_REMOTE_CONTROL
+ bool ValidateModuleTypes() const;
+#endif // SDL_REMOTE_CONTROL
+};
+
+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;
+ Optional<Parameters> parameters;
+
+ public:
+ RpcParameters();
+ explicit RpcParameters(const HmiLevels& hmi_levels);
+ ~RpcParameters();
+ explicit RpcParameters(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 Rpcs : CompositeType {
+ public:
+ Optional<String<1, 255> > user_consent_prompt;
+ Nullable<Rpc> rpcs;
+
+ public:
+ Rpcs();
+ explicit Rpcs(const Rpc& rpcs);
+ ~Rpcs();
+ explicit Rpcs(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 ModuleConfig : CompositeType {
+ public:
+ Optional<Map<String<0, 100>, 0, 255> > device_certificates;
+ Optional<Boolean> preloaded_pt;
+ Integer<uint8_t, 0, 255> exchange_after_x_ignition_cycles;
+ Integer<int64_t, 0, 4294967296ll> exchange_after_x_kilometers;
+ Integer<uint8_t, 0, 255> exchange_after_x_days;
+ Integer<uint16_t, 0, 65535> timeout_after_x_seconds;
+ SecondsBetweenRetries seconds_between_retries;
+ ServiceEndpoints endpoints;
+ NumberOfNotificationsPerMinute notifications_per_minute_by_priority;
+ Optional<String<1, 100> > vehicle_make;
+ Optional<String<1, 100> > vehicle_model;
+ Optional<String<4, 4> > vehicle_year;
+ Optional<String<0, 10> > preloaded_date;
+ 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);
+ ~ModuleConfig();
+ explicit ModuleConfig(const Json::Value* value__);
+ void SafeCopyFrom(const ModuleConfig& from);
+ 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 MessageString : CompositeType {
+ public:
+ Optional<String<1, 65535> > line1;
+ Optional<String<1, 65535> > line2;
+ Optional<String<1, 65535> > tts;
+ Optional<String<1, 65535> > label;
+ Optional<String<1, 65535> > textBody;
+
+ public:
+ MessageString();
+ ~MessageString();
+ explicit MessageString(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 MessageLanguages : CompositeType {
+ public:
+ Languages languages;
+
+ public:
+ MessageLanguages();
+ explicit MessageLanguages(const Languages& languages);
+ ~MessageLanguages();
+ explicit MessageLanguages(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:
+ static const std::string default_language_;
+ bool Validate() const;
+};
+
+struct ConsumerFriendlyMessages : CompositeType {
+ public:
+ String<1, 100> version;
+ Optional<Messages> messages;
+
+ public:
+ ConsumerFriendlyMessages();
+ explicit ConsumerFriendlyMessages(const std::string& version);
+ ~ConsumerFriendlyMessages();
+ explicit ConsumerFriendlyMessages(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 ModuleMeta : CompositeType {
+ public:
+ Optional<Integer<uint32_t, 0, ODO_MAX> > pt_exchanged_at_odometer_x;
+ Optional<Integer<uint16_t, 0, 65535> > pt_exchanged_x_days_after_epoch;
+ Optional<Integer<uint16_t, 0, 65535> > ignition_cycles_since_last_exchange;
+
+ public:
+ ModuleMeta();
+ ~ModuleMeta();
+ explicit ModuleMeta(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;
+ void SetPolicyTableType(PolicyTableType pt_type);
+
+ private:
+ bool Validate() const;
+};
+
+struct AppLevel : CompositeType {
+ public:
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_full;
+ String<1, 10> app_registration_language_gui;
+ String<0, 10> app_registration_language_vui;
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_limited;
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_background;
+ Integer<uint16_t, 0, 65535> minutes_in_hmi_none;
+ Integer<uint16_t, 0, 65535> count_of_user_selections;
+ Integer<uint16_t, 0, 65535> count_of_rejections_sync_out_of_memory;
+ Integer<uint16_t, 0, 65535> count_of_rejections_nickname_mismatch;
+ Integer<uint16_t, 0, 65535> count_of_rejections_duplicate_name;
+ Integer<uint16_t, 0, 65535> count_of_rejected_rpc_calls;
+ Integer<uint16_t, 0, 65535> count_of_rpcs_sent_in_hmi_none;
+ Integer<uint16_t, 0, 65535> count_of_removals_for_bad_behavior;
+ Integer<uint16_t, 0, 65535> count_of_tls_errors;
+ Integer<uint16_t, 0, 65535> count_of_run_attempts_while_revoked;
+
+ public:
+ AppLevel();
+ AppLevel(uint16_t minutes_in_hmi_full,
+ const std::string& app_registration_language_gui,
+ const std::string& app_registration_language_vui,
+ uint16_t minutes_in_hmi_limited,
+ uint16_t minutes_in_hmi_background,
+ uint16_t minutes_in_hmi_none,
+ uint16_t count_of_user_selections,
+ uint16_t count_of_rejections_sync_out_of_memory,
+ uint16_t count_of_rejections_nickname_mismatch,
+ uint16_t count_of_rejections_duplicate_name,
+ uint16_t count_of_rejected_rpc_calls,
+ uint16_t count_of_rpcs_sent_in_hmi_none,
+ uint16_t count_of_removals_for_bad_behavior,
+ uint16_t count_of_tls_errors,
+ uint16_t count_of_run_attempts_while_revoked);
+ ~AppLevel();
+ explicit AppLevel(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;
+
+ private:
+ bool Validate() const;
+};
+
+struct UsageAndErrorCounts : CompositeType {
+ public:
+ Optional<AppLevels> app_level;
+
+ public:
+ UsageAndErrorCounts();
+ ~UsageAndErrorCounts();
+ explicit UsageAndErrorCounts(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 DeviceParams : CompositeType {
+ public:
+ DeviceParams();
+ ~DeviceParams();
+ explicit DeviceParams(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;
+
+ private:
+ bool Validate() const;
+};
+
+struct PolicyTable : CompositeType {
+ public:
+ ApplicationPoliciesSection app_policies_section;
+ FunctionalGroupings functional_groupings;
+ Optional<ConsumerFriendlyMessages> consumer_friendly_messages;
+ ModuleConfig module_config;
+ Optional<ModuleMeta> module_meta;
+ Optional<UsageAndErrorCounts> usage_and_error_counts;
+ Optional<DeviceData> device_data;
+
+ public:
+ PolicyTable();
+ 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;
+ 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 Table : CompositeType {
+ public:
+ PolicyTable policy_table;
+
+ public:
+ Table();
+ explicit Table(const PolicyTable& policy_table);
+ ~Table();
+ explicit Table(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;
+};
+} // namespace policy_table_interface_base
+} // namespace rpc
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_TYPES_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h
new file mode 100644
index 0000000000..25aa126a03
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/policy_types.h
@@ -0,0 +1,490 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
+
+#include <algorithm>
+#include <string>
+#include <vector>
+#include <map>
+#include <set>
+#include <utility>
+#include "utils/shared_ptr.h"
+#include "utils/helpers.h"
+namespace policy {
+
+// TODO(PV): specify errors
+enum PolicyErrorEnum {};
+
+const std::string kDefaultDeviceMacAddress = "00:00:00:00:00:00";
+const std::string kDefaultDeviceName = "MyDevice";
+const std::string kDefaultDeviceConnectionType = "UNKNOWN";
+
+/**
+ * @brief Constants for special ids in application policies section of
+ * policy table
+ */
+const std::string kPreDataConsentId = "pre_DataConsent";
+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 {
+ StatusUpToDate = 0,
+ StatusUpdatePending,
+ StatusUpdateRequired,
+ StatusUnknown
+};
+
+// Code generator uses String class name, so this typedef was renamed to PTSring
+typedef std::string PTString;
+typedef std::vector<uint8_t> BinaryMessage;
+typedef utils::SharedPtr<BinaryMessage> BinaryMessageSptr;
+
+typedef std::string HMILevel;
+typedef std::string Parameter;
+typedef std::string RpcName;
+typedef std::set<std::string> RPCParams;
+
+typedef std::map<std::string, std::set<policy::HMILevel> > HMIPermissions;
+struct ParameterPermissions
+ : std::map<std::string, std::set<policy::Parameter> > {
+ ParameterPermissions()
+ : any_parameter_allowed(false)
+ , any_parameter_disallowed_by_user(false)
+ , any_parameter_disallowed_by_policy(false) {}
+ bool any_parameter_allowed;
+ bool any_parameter_disallowed_by_user;
+ bool any_parameter_disallowed_by_policy;
+};
+
+struct RpcPermissions {
+ HMIPermissions hmi_permissions;
+ ParameterPermissions parameter_permissions;
+};
+
+typedef std::map<RpcName, RpcPermissions> Permissions;
+
+/**
+ * @brief Typedef for use with AllowApp request/notification
+ */
+typedef std::vector<std::string> PermissionsList;
+
+/**
+ * @brief Typedef for getting initial application data, e.g. nickname list
+ */
+typedef std::vector<std::string> StringArray;
+
+enum PermitResult { kRpcAllowed = 0, kRpcDisallowed, kRpcUserDisallowed };
+
+/**
+ * @struct Stores result of check:
+ * if HMI Level was allowed for RPC to work in
+ * and list of parameters allowed for RPC if specified in PT.
+ */
+struct CheckPermissionResult {
+ CheckPermissionResult() : hmi_level_permitted(kRpcDisallowed) {}
+
+ PermitResult hmi_level_permitted;
+ RPCParams list_of_allowed_params;
+ RPCParams list_of_disallowed_params;
+ RPCParams list_of_undefined_params;
+
+ bool HasParameter(const PTString& parameter) {
+ const bool is_allowed =
+ helpers::in_range(list_of_allowed_params, parameter);
+ const bool is_disallowed =
+ helpers::in_range(list_of_disallowed_params, parameter);
+ const bool is_undefined =
+ helpers::in_range(list_of_undefined_params, parameter);
+
+ return is_allowed || is_disallowed || is_undefined;
+ }
+
+ bool DisallowedInclude(const RPCParams& parameters) {
+ if (parameters.empty()) {
+ return false;
+ }
+ return std::includes(list_of_disallowed_params.begin(),
+ list_of_disallowed_params.end(),
+ parameters.begin(),
+ parameters.end());
+ }
+
+ bool IsAnyAllowed(const RPCParams& parameters) {
+ if (parameters.empty()) {
+ return true;
+ }
+ return list_of_allowed_params.end() !=
+ std::find_first_of(list_of_allowed_params.begin(),
+ list_of_allowed_params.end(),
+ parameters.begin(),
+ parameters.end());
+ }
+};
+
+/**
+ @struct Holds Url string and optional policy app id.
+ */
+struct EndpointData {
+ explicit EndpointData(const std::string& url_string = "")
+ : app_id("default") {
+ if (false == url_string.empty()) {
+ url.push_back(url_string);
+ }
+ }
+ std::vector<std::string> url;
+ std::string app_id;
+};
+
+typedef std::vector<EndpointData> EndpointUrls;
+
+/**
+ * @brief Struct contains device data to be used for dialogs, generation of IDs
+ */
+struct DeviceParams {
+ DeviceParams()
+ : device_name(kDefaultDeviceName)
+ , device_mac_address(kDefaultDeviceMacAddress)
+ , device_connection_type(kDefaultDeviceConnectionType)
+ , device_handle(0) {}
+
+ std::string device_name;
+ std::string device_mac_address;
+ std::string device_connection_type;
+ uint32_t device_handle;
+};
+
+/**
+ * @brief User consent for device data usage
+ */
+enum DeviceConsent {
+ kDeviceAllowed = 0,
+ kDeviceDisallowed,
+ kDeviceHasNoConsent
+};
+
+/**
+ * @brief Struct contains parameters, which can be received during application
+ * registration and should be stored in policy table
+ */
+struct DeviceInfo {
+ DeviceInfo() : max_number_rfcom_ports(0) {}
+
+ std::string hardware;
+ std::string firmware_rev;
+ std::string os;
+ std::string os_ver;
+ 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;
+ static const std::string bluetooth("BLUETOOTH");
+ static const std::string wifi("WIFI");
+ if (Compare<std::string, EQ, ONE>(deviceType, bluetooth, wifi)) {
+ connection_type.assign("BTMAC");
+ }
+ }
+};
+
+/**
+ * @brief User consent for functional group
+ */
+enum GroupConsent { kGroupAllowed = 0, kGroupDisallowed, kGroupUndefined };
+
+/**
+ * @brief Contains user permission for RPC functional group with specific name
+ * and id from DB
+ */
+struct FunctionalGroupPermission {
+ FunctionalGroupPermission() : group_id(0), state(kGroupUndefined) {}
+
+ bool operator==(const FunctionalGroupPermission& rhs) {
+ if (this->group_id == rhs.group_id &&
+ this->group_alias == rhs.group_alias &&
+ this->group_name == rhs.group_name) {
+ return true;
+ }
+ return false;
+ }
+
+ std::string group_alias;
+ std::string group_name;
+ int32_t group_id;
+ GroupConsent state;
+};
+
+/**
+ * @brief Stores data to be sent to HMI on application permissions change
+ */
+struct AppPermissions {
+ AppPermissions(const std::string& app_id)
+ : application_id(app_id)
+ , isAppPermissionsRevoked(false)
+ , appRevoked(false)
+ , appPermissionsConsentNeeded(false)
+ , appUnauthorized(false)
+ , requestTypeChanged(false) {}
+
+ std::string application_id;
+ bool isAppPermissionsRevoked;
+ std::vector<policy::FunctionalGroupPermission> appRevokedPermissions;
+ bool appRevoked;
+ bool appPermissionsConsentNeeded;
+ bool appUnauthorized;
+ bool isSDLAllowed;
+ std::string priority;
+ DeviceParams deviceInfo;
+ bool requestTypeChanged;
+ std::vector<std::string> requestType;
+};
+
+/**
+ * @brief Contains parameters for user-defined consent for appication
+ * functional groups on given device
+ */
+struct PermissionConsent {
+ std::string device_id;
+ std::string policy_app_id;
+ std::vector<FunctionalGroupPermission> group_permissions;
+ std::string consent_source;
+};
+
+/**
+ * @brief Contain data for GetUserFriendyMessage response
+ */
+struct UserFriendlyMessage {
+ std::string message_code;
+ std::string tts;
+ std::string label;
+ std::string line1;
+ std::string line2;
+ std::string text_body;
+};
+
+/**
+ * @brief Types of functional groups in policy table
+ */
+enum GroupType {
+ kTypeDefault = 0, // groups assigned to 'default' permissions section
+ kTypeAllowed, // groups allowed by user for specific application
+ kTypeDisallowed, // groups disallowed by user for specific application
+ kTypeUnconsented, // groups disallowed by default but consent may be changed
+ // by user
+ kTypePreconsented, // groups allowed for specific application without
+ // user consent by default (could be changed by user)
+ kTypeGeneral, // groups assigned to specific application
+ kTypePreDataConsented, // groups assigned to 'pre_DataConsent' permissions
+ // section
+ kTypeDevice // groups assigned to 'device' permissions section
+};
+
+/**
+ * @brief Array of functional group id from DB
+ */
+typedef std::vector<int32_t> FunctionalGroupIDs;
+
+/**
+ * @brief Array of functional group ids sorted by types
+ */
+typedef std::map<GroupType, FunctionalGroupIDs> FunctionalIdType;
+
+/**
+ * @brief Array of functional group ids binded to user_consent_prompt (e.g.
+ * VehicleData) and group name (e.g. VehicleData-4)
+ */
+typedef std::map<uint32_t, std::pair<std::string, std::string> >
+ FunctionalGroupNames;
+
+/**
+ * @brief Array of device ids, which are an identifiers in policy table
+ */
+typedef std::vector<std::string> DeviceIds;
+
+/**
+ * @brief Counters that calculated on receiving of succesful update
+ */
+enum Counters { KILOMETERS, DAYS_AFTER_EPOCH };
+
+/**
+ * @struct Vehicle information
+ */
+struct VehicleInfo {
+ std::string vehicle_make;
+ std::string vehicle_model;
+ std::string vehicle_year;
+};
+
+/**
+ * @brief The MetaInfo information
+ */
+struct MetaInfo {
+ std::string ccpu_version;
+ std::string wers_country_code;
+ std::string language;
+};
+
+/**
+ * @brief The index of the application, the index of its URL
+ * and the policy application id from the Endpoints vector
+ * that will be sent on the next OnSystemRequest retry sequence
+ */
+struct RetrySequenceURL {
+ uint32_t app_idx_;
+ uint32_t url_idx_;
+ std::string policy_app_id_;
+ RetrySequenceURL(uint32_t app, uint32_t url, const std::string& app_id)
+ : app_idx_(app), url_idx_(url), policy_app_id_(app_id) {}
+ RetrySequenceURL() : app_idx_(0), url_idx_(0) {}
+};
+
+/**
+ * @brief Index of the application, index of its URL
+ * from the Endpoints vector
+ */
+typedef std::pair<uint32_t, uint32_t> AppIdURL;
+
+/**
+ * @brief Represents ExternalConsent entity status received from the system
+ */
+enum EntityStatus { kStatusOn, kStatusOff };
+
+/**
+ * @brief The ExternalConsentStatusItem struct represents external user consent
+ * settings item
+ */
+struct ExternalConsentStatusItem {
+ ExternalConsentStatusItem(const uint32_t type,
+ const uint32_t id,
+ const EntityStatus status)
+ : entity_type_(type), entity_id_(id), status_(status) {}
+
+ bool operator==(const ExternalConsentStatusItem& rhs) const {
+ return (entity_type_ == rhs.entity_type_) && (entity_id_ == rhs.entity_id_);
+ }
+
+ bool operator<(const ExternalConsentStatusItem& rhs) const {
+ return (entity_type_ < rhs.entity_type_) || (entity_id_ < rhs.entity_id_);
+ }
+
+ const uint32_t entity_type_;
+ const uint32_t entity_id_;
+ const EntityStatus status_;
+};
+
+struct ExternalConsentStatusItemSorter {
+ bool operator()(const ExternalConsentStatusItem& lhs,
+ const ExternalConsentStatusItem& rhs) const {
+ return (lhs.entity_type_ < rhs.entity_type_) ||
+ (lhs.entity_id_ < rhs.entity_id_);
+ }
+};
+
+/**
+ * @brief Customer connectivity settings status
+ */
+typedef std::set<ExternalConsentStatusItem, ExternalConsentStatusItemSorter>
+ ExternalConsentStatus;
+
+/**
+ * @brief GroupsByExternalConsentStatus represents list of group names, which
+ * has mapped ExternalConsent item (entity type + entity id) in their
+ * disallowed_by_external_consent_ containers. Boolean value represents
+ * whether ExternalConsent item has been found in
+ * disallowed_by_external_consent_ON or in disallowed_by_external_consent_OFF
+ * container
+ */
+typedef std::map<ExternalConsentStatusItem,
+ std::vector<std::pair<std::string, bool> > >
+ GroupsByExternalConsentStatus;
+
+/**
+ * @brief GroupsNames represents groups names from policy table -> functional
+ * groupings groups container
+ */
+typedef std::set<std::string> GroupsNames;
+
+typedef std::string ApplicationId;
+typedef std::string DeviceId;
+
+/**
+ * @brief Link of device to application
+ */
+typedef std::pair<policy::DeviceId, policy::ApplicationId> Link;
+
+/**
+ * @brief Collection of links
+ */
+typedef std::set<Link> ApplicationsLinks;
+
+/**
+ * @brief Represents possible result codes for policy table update check
+ */
+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
+};
+
+/**
+ * @brief Per application collection of results done by checking policy table
+ * update
+ */
+typedef std::set<std::pair<std::string, PermissionsCheckResult> >
+ CheckAppPolicyResults;
+
+/**
+ * @brief Index of the application, index of its URL
+ * from the Endpoints vector
+ */
+typedef std::pair<uint32_t, uint32_t> AppIdURL;
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TYPES_H_
diff --git a/src/components/policy/policy_regular/include/policy/pt_ext_representation.h b/src/components/policy/policy_regular/include/policy/pt_ext_representation.h
new file mode 100644
index 0000000000..f70946d1f5
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/pt_ext_representation.h
@@ -0,0 +1,336 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
+
+#include "policy/pt_representation.h"
+
+namespace policy {
+
+enum StatisticsType {
+ S_NONE = 0,
+ S_IAP_BUFFER_FULL,
+ S_SYNC_OUT_OF_MEMORY,
+ S_SYNC_REBOOTS,
+ S_MINS_HMI_FULL,
+ S_MINS_HMI_LIMITED,
+ S_MINS_HMI_BACKGROUND,
+ S_MINS_HMI_NONE,
+ S_RFCOM_LIMIT_REACHED,
+ S_USER_SELECTIONS,
+ S_REJECTIONS_SYNC_OUT_OF_MEMORY,
+ S_REJECTIONS_NICKNAME_MISMATCH,
+ S_REJECTIONS_DUPLICATE_NAME,
+ S_REJECTED_RPC_CALLS,
+ S_RPCS_IN_HMI_NONE,
+ S_REMOVALS_MISBEHAVED,
+ S_RUN_ATTEMPTS_WHILE_REVOKED
+};
+
+enum LanguageType { L_NONE = 0, L_GUI, L_VUI };
+
+class PTExtRepresentation : public virtual PTRepresentation {
+ public:
+ virtual ~PTExtRepresentation() {}
+
+ /**
+ * @brief Is application allowed to send notifications while in
+ * Backgound or limited mode.
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppKeepContext(const std::string& app_id) = 0;
+
+ /**
+ * @brief Is application allowed to move foreground at will?
+ * @param app_id Application id
+ * @return bool Allowed/disallowed.
+ */
+ virtual bool CanAppStealFocus(const std::string& app_id) = 0;
+
+ /**
+ * @brief Get default_hmi for given application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value was
+ * not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetDefaultHMI(const std::string& policy_app_id,
+ std::string* default_hmi) = 0;
+
+ /**
+ * @brief Reset user consent for device data and applications permissions
+ * @return
+ */
+ virtual bool ResetUserConsent() = 0;
+
+ /**
+ * @brief Reset user consent for device data
+ * @return
+ */
+ virtual bool ResetDeviceConsents() = 0;
+
+ /**
+ * @brief Reset user consent for applications permissions
+ * @return
+ */
+ virtual bool ResetAppConsents() = 0;
+
+ /**
+ * @brief Get user permissions for device data usage
+ * @param device_id Generated or obtained id of device
+ * @param consented_groups Groups consented by user
+ * @param disallowed_groups Groups not consented by user
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetUserPermissionsForDevice(
+ const std::string& device_id,
+ StringArray* consented_groups = NULL,
+ StringArray* disallowed_groups = NULL) = 0;
+
+ /**
+ * @brief Gets list of groups permissions from policy table
+ * @param device_id Unique device id, which hosts specific application
+ * @param policy_app_id Unique application id
+ * @param group_types Group list sorted by permission status
+ * @return true, if query was successfull, otherwise - false
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalIdType* group_types) = 0;
+
+ /**
+ * @brief Get device groups and preconsented groups from policies section
+ * @param groups List of groups to be consented for device usage
+ * @param preconsented_groups List of preconsented groups for device usage
+ * @return true, if query was successful, otherwise - false
+ */
+ virtual bool GetDeviceGroupsFromPolicies(
+ policy_table::Strings* groups = NULL,
+ policy_table::Strings* preconsented_groups = NULL) = 0;
+
+ /**
+ * @brief Record information about mobile device in Policy Table.
+ * @param device_id Generated or obtained id of device
+ * @return bool Success of operation
+ */
+ virtual bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware = "",
+ const std::string& firmware = "",
+ const std::string& os = "",
+ const std::string& os_version = "",
+ const std::string& carrier = "",
+ const uint32_t number_of_ports = 0,
+ const std::string& connection_type = "") = 0;
+
+ /**
+ * @brief Sets user consent for particular mobile device,
+ * i.e. to use device for exchanging of Policy Table.
+ * @return bool Success of operation
+ */
+ virtual bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups = StringArray(),
+ const StringArray& disallowed_gropus = StringArray()) = 0;
+
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ */
+ virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed) = 0;
+
+ /**
+ * @brief Set user consent on functional groups
+ * @param permissions User consent on functional group
+ * @return true, if operation succedeed, otherwise - false
+ */
+ virtual bool SetUserPermissionsForApp(
+ const PermissionConsent& permissions) = 0;
+
+ /**
+ * @brief Counter for statistics information: adds 1 to existing number.
+ * @param type Type of statistics (errors, mins in mode etc)
+ * @return bool Success of operation
+ */
+ virtual bool IncreaseStatisticsData(StatisticsType type) = 0;
+
+ /**
+ * @brief Records information about what language
+ * application tried to register with.
+ * @param app_id Id of application
+ * @param type - language for UI/VR
+ * @param language Language
+ * @return bool Success of operation
+ */
+ virtual bool SetAppRegistrationLanguage(const std::string& app_id,
+ LanguageType type,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Records information about head unit system to PT
+ * @return bool Success of operation
+ */
+ virtual bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Checks, if specific head unit is present in PT
+ * @return boot Suceess, if present, otherwise - false
+ */
+ virtual bool IsMetaInfoPresent() = 0;
+
+ /**
+ * @brief Kms pass since last successfull PT update
+ */
+ virtual int GetKmFromSuccessfulExchange() = 0;
+
+ /**
+ * @brief Days pass since last successfull PT update
+ */
+ virtual int GetDayFromScsExchange() = 0;
+
+ /**
+ * @brief Ignition cycles pass since last successfull PT update
+ */
+ virtual int GetIgnitionsFromScsExchange() = 0;
+
+ /**
+ * @brief Set current system language
+ * @param language System language
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool SetSystemLanguage(const std::string& language) = 0;
+
+ /**
+ * Increments global counter
+ * @param type type of counter
+ */
+ virtual void Increment(const std::string& type) const = 0;
+
+ /**
+ * Increments counter of application
+ * @param app_id id application
+ * @param type type of counter
+ */
+ virtual void Increment(const std::string& app_id,
+ const std::string& type) const = 0;
+
+ /**
+ * Sets value of application information
+ * @param app_id id application
+ * @param type type of information
+ * @param value value of information
+ */
+ virtual void Set(const std::string& app_id,
+ const std::string& type,
+ const std::string& value) const = 0;
+
+ /**
+ * Adds value to stopwatch of application
+ * @param app_id id application
+ * @param type type of stopwatch
+ * @param seconds value for adding in seconds
+ */
+ virtual void Add(const std::string& app_id,
+ const std::string& type,
+ int seconds) const = 0;
+
+ virtual bool CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id,
+ int* result) const = 0;
+
+ /**
+ * @brief Gets functional group names and user_consent_prompts, if any
+ * @param Array to be filled with group ids, names and functional prompts
+ * @return true, if succeeded, otherwise - false
+ */
+ // TODO(AOleynik): Possibly, we can get rid of this method. Check this.
+ virtual bool GetFunctionalGroupNames(policy::FunctionalGroupNames& names) = 0;
+
+ /**
+ * @brief Set app policy to pre_DataConsented policy
+ * @param app_id Policy ID of application to be changed
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool SetPredataPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief Updates application policy to either pre_DataConsented or not
+ * @param app_id Policy Id of application to be checked
+ * @param is_pre_data True of False to setting app policy to be
+ * pre_DataConsented
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool SetIsPredata(const std::string& app_id, bool is_pre_data) = 0;
+
+ /**
+ * @brief Removes unpaired devices
+ * @return true if success
+ */
+ virtual bool CleanupUnpairedDevices(const DeviceIds& device_ids) const = 0;
+
+ /**
+ * Sets flag of unpaired device
+ * @param device_id Unique device id
+ * @param unpaired True, if unpaired, otherwise - false
+ * @return true if success
+ */
+ virtual bool SetUnpairedDevice(const std::string& device_id,
+ bool unpaired) const = 0;
+
+ /**
+ * Gets list of unpaired devices
+ * @param device_ids output list
+ * @return true if success
+ */
+ virtual bool UnpairedDevicesList(DeviceIds* device_ids) const = 0;
+
+ /**
+ * @brief Remove application consent for particular group
+ * @param policy_app_id Unique application id
+ * @param functional_group_name Functional group name, which consents should
+ * be removed
+ * @return true, in case of success, otherwise - false
+ */
+ virtual bool RemoveAppConsentForGroup(
+ const std::string& policy_app_id,
+ const std::string& functional_group_name) const = 0;
+ virtual bool SaveExternalConsentStatus(
+ const ExternalConsentStatus& status) const = 0;
+ virtual ExternalConsentStatus GetExternalConsentStatus() const = 0;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h
new file mode 100644
index 0000000000..08bd6d4923
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/pt_representation.h
@@ -0,0 +1,323 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_
+
+#include <vector>
+#include <string>
+#include "policy/policy_types.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_settings.h"
+
+namespace policy {
+namespace policy_table = rpc::policy_table_interface_base;
+
+enum InitResult { NONE = 0, EXISTS, SUCCESS, FAIL };
+
+class PTRepresentation {
+ public:
+ virtual ~PTRepresentation() {}
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @params CheckPermissionResult containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) = 0;
+
+ /**
+ * @brief Returns true if Policy Table was not updated yet
+ * from preloaded pt file.
+ */
+ virtual bool IsPTPreloaded() = 0;
+
+ virtual bool RefreshDB() = 0;
+ /**
+ * Gets number of ignition cycles before next update policy table
+ * @return number of ignition cycles
+ */
+ virtual int IgnitionCyclesBeforeExchange() = 0;
+
+ /**
+ * Gets value in kilometers before next update policy table
+ * @param current value in kilometers from the odometers
+ * @return value in kilometers
+ */
+ virtual int KilometersBeforeExchange(int current) = 0;
+
+ /**
+ * @brief Sets kilometers and days after epoch, that passed for recieved
+ * successful PT UPdate
+ */
+ virtual bool SetCountersPassedForSuccessfulUpdate(int kilometers,
+ int days_after_epoch) = 0;
+
+ /**
+ * Gets value in days before next update policy table
+ * @param current value in days after epoch
+ * @return value in days
+ */
+ virtual int DaysBeforeExchange(int current) = 0;
+
+ /**
+ * @brief Increment number of ignition cycles since last exchange by 1
+ */
+ virtual void IncrementIgnitionCycles() = 0;
+
+ /**
+ * @brief Reset number of ignition cycles since last exchange to 0
+ */
+ virtual void ResetIgnitionCycles() = 0;
+
+ /**
+ * @brief Returns timeout to wait for a response of PT update
+ * @return value in seconds
+ */
+ virtual int TimeoutResponse() = 0;
+
+ /**
+ * @brief Returns number of seconds between each try of sending PTS
+ * @param seconds Return value: array of 5 elements
+ * @return bool Success of operation
+ */
+ virtual bool SecondsBetweenRetries(std::vector<int>* seconds) = 0;
+
+ /**
+ * @brief Get information about vehicle
+ */
+ virtual const VehicleInfo GetVehicleInfo() const = 0;
+
+ /**
+ * @brief Allows to update 'vin' field in module_meta table.
+ *
+ * @param new 'vin' value.
+ *
+ * @return true in case when data has been successfully updated,
+ * false otherwise.
+ */
+ virtual bool SetVINValue(const std::string& value) = 0;
+
+ /**
+ * @brief Get message text for displaying/pronouncing for user
+ * dependent on language and context.
+ * @param msg_codes Context of message (Driver distraction, Grant permission
+ * etc)
+ * @param language Language of the message
+ * @return Array of appropriate messages parameters
+ */
+ virtual std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes,
+ const std::string& language) = 0;
+
+ /**
+ * @brief Get list of URL to send PTS to
+ * @param service_type If URLs for specific service are preset,
+ * return them otherwise default URLs.
+ */
+ 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
+ */
+ virtual int GetNotificationsNumber(const std::string& priority) = 0;
+
+ /**
+ * @brief Get priority for given application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ virtual bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) = 0;
+
+ /**
+ * @brief Initialized Policy Table (load)
+ * @return bool Success of operation
+ */
+ virtual InitResult Init(const PolicySettings* settings) = 0;
+
+ /**
+ * @brief Close policy table
+ * @return bool Success of operation
+ */
+ virtual bool Close() = 0;
+
+ /**
+ * @brief Removes policy table content.
+ * @return bool Success of operation
+ */
+ virtual bool Clear() = 0;
+
+ /**
+ * Drops policy table (schema and content)
+ * @return true if successfully
+ */
+ virtual bool Drop() = 0;
+
+ /**
+ * @brief Get snapshot of Policy Table
+ * including app_policies, functional_groups,
+ * device_info, statistics, excluding user messages
+ * @return Generated structure for obtaining Json string.
+ */
+ virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot() const = 0;
+
+ virtual bool Save(const policy_table::Table& table) = 0;
+
+ /**
+ * Gets flag updateRequired
+ * @return true if update is required
+ */
+ virtual bool UpdateRequired() const = 0;
+
+ /**
+ * Saves flag updateRequired
+ */
+ virtual void SaveUpdateRequired(bool value) = 0;
+
+ /*
+ Retrieves data from app_policies about app on its registration:
+ app_id - id of registered app; all outputs are filled in only if not null
+ output: nicknames Synonyms for application
+ output: app_types Section on HMI where app can appear (Navigation, Phone etc)
+ */
+ virtual bool GetInitialAppData(const std::string& app_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_types = NULL) = 0;
+
+ /**
+ * Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ virtual bool IsApplicationRevoked(const std::string& app_id) const = 0;
+
+ /**
+ * @brief Get functional groupings from DB
+ * @param groups Known functional groupings
+ * @return true, if succeeded, otherwise - false
+ */
+ virtual bool GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) = 0;
+
+ /**
+ * Checks if the application is represented in policy table
+ * @param app_id application id
+ * @return true if application is represented in policy table
+ */
+ virtual bool IsApplicationRepresented(const std::string& app_id) const = 0;
+
+ /**
+ * Checks if the application has default policy
+ * @param app_id application id
+ * @return true if application has default policy
+ */
+ virtual bool IsDefaultPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * Checks if the application has pre_data policy
+ * @param app_id application id
+ * @return true if application has pre_data policy
+ */
+ virtual bool IsPredataPolicy(const std::string& app_id) const = 0;
+
+ /**
+ * Sets default policy for application
+ * @param app_id application id
+ * @return true if success
+ */
+ virtual bool SetDefaultPolicy(const std::string& app_id) = 0;
+
+ /**
+ * @brief SaveApplicationCustomData allows to save specific data to database.
+ * This data is only for internal use.
+ * @param app_id the application id for which the data will be saved.
+ * @param is_revoked parameter to save.
+ * @param is_default parameter to save.
+ * @param is_predata parameter to save.
+ */
+ virtual bool SaveApplicationCustomData(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata) = 0;
+
+ virtual void WriteDb() = 0;
+
+ /**
+ * @brief RemoveDB allows to remove the database.
+ * It will either remove or do nothing in case file not exists or any other
+ * troubles are happens during this operation.
+ */
+ virtual void RemoveDB() const = 0;
+
+ /**
+ * @brief Checks if DB version is actual to current schema
+ * @return true if actual, otherwise - false
+ */
+ virtual bool IsDBVersionActual() const = 0;
+
+ /**
+ * @brief Updates DB version according to current schema
+ * @return true if success, otherwise - false
+ */
+ virtual bool UpdateDBVersion() const = 0;
+
+ protected:
+ const PolicySettings& get_settings() const {
+ DCHECK(settings_);
+ return *settings_;
+ }
+ const PolicySettings* settings_;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_PT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h
new file mode 100644
index 0000000000..727c0b165d
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_ext_queries.h
@@ -0,0 +1,97 @@
+/*
+ Copyright (c) 2013, " Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, " with or without
+ modification, " are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, " this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, "
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
+ CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
+
+#include <string>
+
+namespace policy {
+namespace sql_pt_ext {
+
+extern const std::string kSelectKeepContext;
+extern const std::string kSelectStealFocus;
+extern const std::string kResetDeviceConsents;
+extern const std::string kResetAppConsents;
+extern const std::string kCountDeviceConsentGroup;
+extern const std::string kCountDevice;
+extern const std::string kSelectDeviceConsentedGroup;
+extern const std::string kUpdateDeviceConsentedGroup;
+extern const std::string kUpdateDevice;
+extern const std::string kInsertDeviceConsentedGroup;
+extern const std::string kInsertDevice;
+extern const std::string kSelectDeviceData;
+extern const std::string kSelectConsentGroup;
+extern const std::string kInsertPreconsentedGroups;
+extern const std::string kSelectPreconsentedGroups;
+extern const std::string kDeletePreconsentedGroups;
+extern const std::string kSelectUsageAndErrorCount;
+extern const std::string kSelectAppLevels;
+extern const std::string kUpdateGlobalCounters;
+extern const std::string kInsertDeviceData;
+extern const std::string kDeleteDeviceData;
+extern const std::string kInsertConsentGroups;
+extern const std::string kCountUnconsentedGroups;
+extern const std::string kSelectModuleMeta;
+extern const std::string kUpdateMetaParams;
+extern const std::string kUpdateModuleMetaVinParam;
+extern const std::string kSaveModuleMeta;
+extern const std::string kSelectMetaParams;
+extern const std::string kCountAppLevel;
+extern const std::string kUpdateGroupPermissions;
+extern const std::string kSelectDefaultHmi;
+extern const std::string kInsertApplication;
+extern const std::string kSelectFriendlyMsg;
+extern const std::string kCollectFriendlyMsg;
+extern const std::string kSelectAppGroupsId;
+extern const std::string kSelectConsentedGroupsId;
+extern const std::string kCountAppConsents;
+extern const std::string kSelectPreconsentedGroupsId;
+extern const std::string kSelectFunctionalGroupNames;
+extern const std::string kSelectAppPolicies;
+extern const std::string kUpdateMetaLanguage;
+extern const std::string kDeleteDeviceConsent;
+extern const std::string kDeleteAppGroupConsent;
+extern const std::string kSelectGroupId;
+extern const std::string kSelectApplicationIsPreData;
+extern const std::string kUpdateIsPredata;
+extern const std::string kHasAppPreloadedGroups;
+extern const std::string kUpdateUnpairedDevice;
+extern const std::string kSelectUnpairedDevices;
+extern const std::string kHasMsgLanguageCode;
+extern const std::string kDeletePreconsentedGroupsByApplicationId;
+extern const std::string kDeleteAppConsent;
+extern const std::string kSelectExternalConsentStatus;
+} // namespace sql_pt_ext
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_QUERIES_H_
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h
new file mode 100644
index 0000000000..0958bad5e1
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_ext_representation.h
@@ -0,0 +1,206 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
+
+#include <string>
+#include "policy/sql_pt_representation.h"
+#include "policy/pt_ext_representation.h"
+
+namespace policy {
+
+class SQLPTExtRepresentation : public SQLPTRepresentation,
+ public PTExtRepresentation {
+ public:
+ bool CanAppKeepContext(const std::string& app_id);
+ bool CanAppStealFocus(const std::string& app_id);
+ bool GetDefaultHMI(const std::string& policy_app_id,
+ std::string* default_hmi);
+ bool ResetUserConsent();
+ bool ResetDeviceConsents();
+ bool ResetAppConsents();
+ bool GetUserPermissionsForDevice(const std::string& device_id,
+ StringArray* consented_groups = NULL,
+ StringArray* disallowed_groups = NULL);
+
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalIdType* group_types);
+
+ bool GetDeviceGroupsFromPolicies(
+ policy_table::Strings* groups = NULL,
+ policy_table::Strings* preconsented_groups = NULL);
+ bool SetDeviceData(const std::string& device_id,
+ const std::string& hardware = "",
+ const std::string& firmware = "",
+ const std::string& os = "",
+ const std::string& os_version = "",
+ const std::string& carrier = "",
+ const uint32_t number_of_ports = 0,
+ const std::string& connection_type = "");
+ bool SetUserPermissionsForDevice(
+ const std::string& device_id,
+ const StringArray& consented_groups = StringArray(),
+ const StringArray& disallowed_groups = StringArray());
+
+ bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed);
+
+ bool SetUserPermissionsForApp(const PermissionConsent& permissions);
+
+ std::vector<UserFriendlyMessage> GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language);
+
+ bool IncreaseStatisticsData(StatisticsType type) {
+ return true;
+ }
+ bool SetAppRegistrationLanguage(const std::string& app_id,
+ LanguageType type,
+ const std::string& language) {
+ return true;
+ }
+
+ bool SetMetaInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language);
+
+ bool IsMetaInfoPresent();
+
+ bool SetSystemLanguage(const std::string& language);
+
+ int GetKmFromSuccessfulExchange() {
+ return true;
+ }
+ int GetDayFromScsExchange() {
+ return true;
+ }
+ int GetIgnitionsFromScsExchange() {
+ return true;
+ }
+
+ bool GetFunctionalGroupNames(FunctionalGroupNames& names);
+ bool CleanupUnpairedDevices(const DeviceIds& device_ids) const;
+
+ void Increment(const std::string& type) const;
+ void Increment(const std::string& app_id, const std::string& type) const;
+ void Set(const std::string& app_id,
+ const std::string& type,
+ const std::string& value) const;
+ void Add(const std::string& app_id,
+ const std::string& type,
+ int seconds) const;
+ bool SetDefaultPolicy(const std::string& app_id);
+ bool SetPredataPolicy(const std::string& app_id);
+ bool SetIsPredata(const std::string& app_id, bool is_pre_data);
+ bool IsPredataPolicy(const std::string& app_id) const;
+ bool SetUnpairedDevice(const std::string& device_id, bool unpaired) const;
+ bool UnpairedDevicesList(DeviceIds* device_ids) const;
+ bool RemoveAppConsentForGroup(const std::string& policy_app_id,
+ const std::string& functional_group_name) const;
+
+ virtual bool SetVINValue(const std::string& value);
+ bool SaveExternalConsentStatus(const ExternalConsentStatus& status) const;
+ ExternalConsentStatus GetExternalConsentStatus() const;
+
+ private:
+ void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
+ void GatherPreconsentedGroup(const std::string& app_id,
+ policy_table::Strings* groups) const;
+ bool GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const;
+ bool GatherAppLevels(policy_table::AppLevels* apps) const;
+ void GatherDeviceData(policy_table::DeviceData* data) const;
+ void GatherConsentGroup(const std::string& device_id,
+ policy_table::UserConsentRecords* records) const;
+ bool GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const;
+ bool SaveDeviceData(const policy_table::DeviceData& devices);
+ bool GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) const;
+ bool SaveConsentGroup(const std::string& device_id,
+ const policy_table::UserConsentRecords& records);
+ bool SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies);
+ bool SaveSpecificAppPolicy(
+ const policy_table::ApplicationPolicies::value_type& app);
+ bool SaveDevicePolicy(const policy_table::DevicePolicy& device);
+ bool SavePreconsentedGroup(const std::string& app_id,
+ const policy_table::Strings& groups);
+ bool SaveMessageString(const std::string& type,
+ const std::string& lang,
+ const policy_table::MessageString& strings);
+
+ virtual bool SaveUsageAndErrorCounts(
+ const policy_table::UsageAndErrorCounts& counts);
+
+ virtual bool SaveModuleMeta(const policy_table::ModuleMeta& meta);
+
+ bool SaveAppCounters(const policy_table::AppLevels& app_levels);
+
+ bool SaveGlobalCounters(const policy_table::UsageAndErrorCounts& counts);
+
+ bool IsExistAppLevel(const std::string& app_id) const;
+
+ bool GetAllAppGroups(const std::string& policy_app_id,
+ FunctionalGroupIDs& all_groups);
+
+ bool GetConsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups);
+
+ bool GetPreconsentedGroups(const std::string& policy_app_id,
+ FunctionalGroupIDs& preconsented_groups);
+
+ void FillFunctionalGroupPermissions(
+ FunctionalGroupIDs& ids,
+ FunctionalGroupNames& names,
+ GroupConsent state,
+ std::vector<FunctionalGroupPermission>& permissions);
+ bool CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id,
+ int* result) const;
+
+ /**
+ * @brief Checks, if there is message present with requested language in PT
+ * @param message Message name
+ * @param language Required message language
+ * @return True, if message with requested language is present, otherwise -
+ * false
+ */
+ bool IsMsgLanguagePresent(const std::string& message,
+ const std::string& language);
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
new file mode 100644
index 0000000000..2ded25e456
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h
@@ -0,0 +1,138 @@
+/*
+ Copyright (c) 2013, " Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, " with or without
+ modification, " are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, " this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, "
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
+ CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_QUERIES_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_QUERIES_H_
+
+#include <string>
+
+namespace policy {
+namespace sql_pt {
+
+extern const std::string kSelectPriority;
+extern const std::string kCreateSchema;
+extern const std::string kDropSchema;
+extern const std::string kDeleteData;
+extern const std::string kCheckPgNumber;
+extern const std::string kCheckDBIntegrity;
+extern const std::string kSelectRpc;
+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;
+extern const std::string kSelectNotificationsPerPriority;
+extern const std::string kSelectAppLevels;
+extern const std::string kSelectDeviceData;
+extern const std::string kSelectFunctionalGroups;
+extern const std::string kSelectAllRpcs;
+extern const std::string kSelectUserMsgsVersion;
+extern const std::string kSelectAppPolicies;
+extern const std::string kCollectFriendlyMsg;
+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;
+extern const std::string kSelectDays;
+extern const std::string kSelectTimeoutResponse;
+extern const std::string kInsertFunctionalGroup;
+extern const std::string kInsertRpc;
+extern const std::string kInsertRpcWithParameter;
+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;
+extern const std::string kUpdateVersion;
+extern const std::string kUpdateModuleConfig;
+extern const std::string kInsertEndpoint;
+extern const std::string kInsertSecondsBetweenRetry;
+extern const std::string kInsertNotificationsByPriority;
+extern const std::string kInsertDeviceData;
+extern const std::string kInsertAppLevel;
+extern const std::string kDeleteSecondsBetweenRetries;
+extern const std::string kDeleteEndpoint;
+extern const std::string kDeleteAppLevel;
+extern const std::string kDeleteMessageString;
+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;
+extern const std::string kUpdateFlagUpdateRequired;
+extern const std::string kSelectFlagUpdateRequired;
+extern const std::string kUpdateCountersSuccessfulUpdate;
+extern const std::string kSelectApplicationRevoked;
+extern const std::string kUpdateApplicationCustomData;
+extern const std::string kSelectApplicationRepresented;
+extern const std::string kSelectApplicationIsDefault;
+extern const std::string kUpdateIsDefault;
+extern const std::string kInsertInitData;
+extern const std::string kDeleteAppGroupByApplicationId;
+extern const std::string kInsertApplicationFull;
+extern const std::string kDeletePreconsentedGroupsByApplicationId;
+extern const std::string kSelectApplicationFull;
+extern const std::string kUpdatePreloaded;
+extern const std::string kUpdateRemoteControlDenied;
+extern const std::string kSelectRemoteControlDenied;
+extern const std::string kCollectFriendlyMsg;
+extern const std::string kSelectModuleTypes;
+extern const std::string kInsertModuleType;
+extern const std::string kInsertAccessModule;
+extern const std::string kSelectAccessModules;
+extern const std::string kDeleteAccessModules;
+extern const std::string kInsertRemoteRpc;
+extern const std::string kSelectRemoteRpcs;
+extern const std::string kDeleteRemoteRpc;
+extern const std::string kDeleteModuleTypes;
+extern const std::string kDeleteAllDevices;
+extern const std::string kSelectDBVersion;
+extern const std::string kUpdateDBVersion;
+extern const std::string kSaveModuleMeta;
+extern const std::string kSelectModuleMeta;
+
+} // namespace sql_pt
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_QUERIES_H_
diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
new file mode 100644
index 0000000000..6b5d6111f1
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h
@@ -0,0 +1,220 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
+
+#include <string>
+#include <vector>
+#include "policy/pt_representation.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace utils {
+namespace dbms {
+class SQLDatabase;
+} // namespace dbms
+} // namespace utils
+
+namespace policy {
+
+class SQLPTRepresentation : public virtual PTRepresentation {
+ public:
+ SQLPTRepresentation();
+ ~SQLPTRepresentation();
+ virtual void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result);
+
+ virtual bool IsPTPreloaded();
+ virtual int IgnitionCyclesBeforeExchange();
+ virtual int KilometersBeforeExchange(int current);
+ virtual bool SetCountersPassedForSuccessfulUpdate(int kilometers,
+ int days_after_epoch);
+ virtual int DaysBeforeExchange(int current);
+ virtual void IncrementIgnitionCycles();
+ virtual void ResetIgnitionCycles();
+ virtual int TimeoutResponse();
+ virtual bool SecondsBetweenRetries(std::vector<int>* seconds);
+ virtual bool RefreshDB();
+ virtual const VehicleInfo GetVehicleInfo() const;
+
+ 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);
+ InitResult Init(const PolicySettings* settings);
+ 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 = NULL,
+ StringArray* app_hmi_types = NULL);
+ bool GetFunctionalGroupings(policy_table::FunctionalGroupings& groups);
+
+#ifdef BUILD_TESTS
+ uint32_t open_counter() {
+ return open_counter_;
+ }
+#endif // BUILD_TESTS
+ protected:
+#ifdef SDL_REMOTE_CONTROL
+ enum TypeAccess { kAllowed, kManual };
+ bool GatherModuleType(const std::string& app_id,
+ policy_table::ModuleTypes* module_types) const;
+ bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const;
+ bool GatherAccessModule(TypeAccess access,
+ policy_table::AccessModules* modules) const;
+ bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const;
+ bool SaveModuleType(const std::string& app_id,
+ const policy_table::ModuleTypes& types);
+ bool SaveRemoteControlDenied(const std::string& app_id, bool deny);
+
+ bool SaveAccessModule(TypeAccess access,
+ const policy_table::AccessModules& modules);
+ bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs);
+#endif // SDL_REMOTE_CONTROL
+
+ virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const;
+ virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const;
+ virtual bool GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const;
+ virtual void GatherDeviceData(policy_table::DeviceData* data) const;
+ virtual bool GatherFunctionalGroupings(
+ policy_table::FunctionalGroupings* groups) const;
+ virtual bool GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) 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;
+
+ virtual bool SaveApplicationCustomData(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata);
+
+ virtual bool SaveModuleMeta(const policy_table::ModuleMeta& meta);
+ virtual bool SaveModuleConfig(const policy_table::ModuleConfig& config);
+ virtual bool SaveUsageAndErrorCounts(
+ const policy_table::UsageAndErrorCounts& counts);
+ virtual bool SaveDeviceData(const policy_table::DeviceData& devices);
+ virtual bool SaveFunctionalGroupings(
+ const policy_table::FunctionalGroupings& groups);
+ virtual bool SaveConsumerFriendlyMessages(
+ const policy_table::ConsumerFriendlyMessages& messages);
+ 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,
+ const policy_table::MessageString& strings);
+
+ bool SaveAppGroup(const std::string& app_id,
+ const policy_table::Strings& app_groups);
+ bool SaveNickname(const std::string& app_id,
+ 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;
+ void SaveUpdateRequired(bool value);
+
+ bool IsApplicationRepresented(const std::string& app_id) const;
+ bool CopyApplication(const std::string& source,
+ const std::string& destination);
+
+ bool IsApplicationRevoked(const std::string& app_id) const;
+ virtual bool IsDefaultPolicy(const std::string& app_id) const;
+ virtual bool IsPredataPolicy(const std::string& app_id) const;
+ virtual bool SetDefaultPolicy(const std::string& app_id);
+ virtual void SetPreloaded(bool value);
+
+ virtual bool SetVINValue(const std::string& value);
+
+ virtual utils::dbms::SQLDatabase* db() const;
+ virtual bool SetIsDefault(const std::string& app_id, bool is_default) const;
+
+ void RemoveDB() const OVERRIDE;
+ virtual bool IsDBVersionActual() const OVERRIDE;
+ virtual bool UpdateDBVersion() const OVERRIDE;
+
+ private:
+ static const std::string kDatabaseName;
+ utils::dbms::SQLDatabase* db_;
+
+#ifdef BUILD_TESTS
+ uint32_t open_counter_;
+#endif // BUILD_TESTS
+
+ /**
+ * @brief Calculates DB version from current schema
+ * @return version
+ */
+ const int32_t GetDBVersion() const;
+ bool SaveRpcs(int64_t group_id, const policy_table::Rpc& rpcs);
+ bool SaveServiceEndpoints(const policy_table::ServiceEndpoints& endpoints);
+ bool SaveSecondsBetweenRetries(
+ const policy_table::SecondsBetweenRetries& seconds);
+ bool SaveNumberOfNotificationsPerMinute(
+ const policy_table::NumberOfNotificationsPerMinute& notifications);
+ bool SaveMessageType(const std::string& type);
+ bool SaveLanguage(const std::string& code);
+
+ bool is_in_memory;
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_PT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/include/policy/sql_wrapper.h b/src/components/policy/policy_regular/include/policy/sql_wrapper.h
new file mode 100644
index 0000000000..69cfad08a7
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/sql_wrapper.h
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_WRAPPER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_WRAPPER_H_
+
+#if __QNX__
+#include "utils/qdb_wrapper/sql_database.h"
+#include "utils/qdb_wrapper/sql_query.h"
+#else // __QNX__
+#include "utils/sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_query.h"
+#endif // __QNX__
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_SQL_WRAPPER_H_
diff --git a/src/components/policy/policy_regular/include/policy/status.h b/src/components/policy/policy_regular/include/policy/status.h
new file mode 100644
index 0000000000..c1ea2de4c1
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/status.h
@@ -0,0 +1,199 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
+
+#include <string>
+#include "policy/policy_types.h"
+#include "utils/macro.h"
+
+namespace policy {
+
+/**
+ * @brief The UpdateEvent enum defines system events which can change update
+ * status
+ */
+enum UpdateEvent {
+ kOnNewAppRegistered,
+ kOnValidUpdateReceived,
+ kOnWrongUpdateReceived,
+ kOnUpdateSentOut,
+ kOnUpdateTimeout,
+ kOnResetPolicyTableRequireUpdate,
+ kOnResetPolicyTableNoUpdate,
+ kScheduleUpdate,
+ kScheduleManualUpdate,
+ kOnResetRetrySequence,
+ kNoEvent
+};
+
+const std::string kUpToDate = "UP_TO_DATE";
+const std::string kUpdateNeeded = "UPDATE_NEEDED";
+const std::string kUpdating = "UPDATING";
+
+class UpdateStatusManagerInterface;
+
+/**
+ * @brief The Status class defines base implementation of update status
+ */
+class Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ Status(const std::string& string_status,
+ const policy::PolicyTableStatus enum_status);
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~Status();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ virtual void ProcessEvent(UpdateStatusManagerInterface* manager,
+ UpdateEvent event) = 0;
+
+ /**
+ * @brief Return current status as string value
+ * @return Status as string
+ */
+ virtual const std::string get_status_string() const;
+
+ /**
+ * @brief Return status as enum value
+ * @return Status as enum value
+ */
+ virtual PolicyTableStatus get_status() const;
+
+ /**
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
+ virtual bool IsUpdateRequired() const;
+
+ /**
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
+ virtual bool IsUpdatePending() const;
+
+ private:
+ const std::string string_status_;
+ const PolicyTableStatus enum_status_;
+};
+
+/**
+ * @brief The UpToDateStatus class represents 'up-to-date' status
+ */
+class UpToDateStatus : public Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpToDateStatus();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ void ProcessEvent(UpdateStatusManagerInterface* manager,
+ UpdateEvent event) OVERRIDE;
+};
+
+/**
+ * @brief The UpdateNeededStatus class represents 'update needed' status
+ */
+class UpdateNeededStatus : public Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpdateNeededStatus();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ void ProcessEvent(UpdateStatusManagerInterface* manager,
+ UpdateEvent event) OVERRIDE;
+
+ /**
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
+ bool IsUpdateRequired() const OVERRIDE;
+};
+
+/**
+ * @brief The UpdatingStatus class represents 'updating' status
+ */
+class UpdatingStatus : public Status {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpdatingStatus();
+
+ /**
+ * @brief Process event by setting next status in case event can affect
+ * current status or ignores the event
+ * @param manager Status manager pointer
+ * @param event Event which needs to be processed
+ */
+ void ProcessEvent(UpdateStatusManagerInterface* manager,
+ UpdateEvent event) OVERRIDE;
+
+ /**
+ * @brief Check whether update is required in terms of status
+ * @return True if update is required, otherwise - false
+ */
+ bool IsUpdateRequired() const OVERRIDE;
+
+ /**
+ * @brief Check whether update is pending in terms of status
+ * @return True if update is pending, otherwise - false
+ */
+ bool IsUpdatePending() const OVERRIDE;
+};
+}
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_STATUS_H_
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h
new file mode 100644
index 0000000000..a68d986d10
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h
@@ -0,0 +1,221 @@
+/*
+ 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_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
+
+#include "policy/update_status_manager_interface.h"
+#include "policy/policy_types.h"
+#include "utils/lock.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+#include "utils/conditional_variable.h"
+#include "utils/lock.h"
+#include "utils/logger.h"
+#include "utils/macro.h"
+
+namespace policy {
+
+class PolicyListener;
+
+class UpdateStatusManager : public UpdateStatusManagerInterface {
+ public:
+ /**
+ * @brief Constructor
+ */
+ UpdateStatusManager();
+
+ ~UpdateStatusManager();
+
+ /**
+ * @brief Process event by current status implementations
+ * @param event Event
+ */
+ void ProcessEvent(UpdateEvent event);
+
+ /**
+ * @brief Set next status during event processing
+ * @param status Status shared pointer
+ */
+ void SetNextStatus(utils::SharedPtr<Status> status);
+
+ /**
+ * @brief Set postponed status (will be set after next status) during event
+ * processing
+ * @param status Status shared pointer
+ */
+ void SetPostponedStatus(utils::SharedPtr<Status> status);
+
+ /**
+ * @brief Sets listener pointer
+ * @param listener Pointer to policy listener implementation
+ */
+ void set_listener(PolicyListener* listener);
+
+ /**
+ * @brief Update status hanlder for PTS sending out
+ */
+ void OnUpdateSentOut();
+
+ /**
+ * @brief Update status handler for PTU waiting timeout
+ */
+ void OnUpdateTimeoutOccurs();
+
+ /**
+ * @brief Update status handler for valid PTU receiving
+ */
+ void OnValidUpdateReceived();
+
+ /**
+ * @brief Update status handler for wrong PTU receiving
+ */
+ void OnWrongUpdateReceived();
+
+ /**
+ * @brief Update status handler for reset PT to default state
+ * @param is_update_required Update necessity flag
+ */
+ void OnResetDefaultPT(bool is_update_required);
+
+ /**
+ * @brief Update status handler for restarting retry sequence
+ */
+ void OnResetRetrySequence();
+
+ /**
+ * @brief Update status handler on new application registering
+ */
+ void OnNewApplicationAdded(const DeviceConsent consent);
+
+ /**
+ * @brief Update status handler for policy initialization
+ * @param is_update_required Update necessity flag
+ */
+ void OnPolicyInit(bool is_update_required);
+
+ /**
+ * @brief In case application from non-consented device has been registered
+ * before and and no updated happened then triggers status change
+ */
+ void OnDeviceConsented();
+
+ /**
+ * @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.
+ */
+ bool IsUpdatePending() const;
+
+ /**
+ * @brief ScheduleUpdate allows to schedule next update.
+ * It will change state to Update_Needed, that's is.
+ */
+ void ScheduleUpdate();
+
+ /**
+ * @brief ScheduleUpdate allows to schedule next update.
+ * It will change state to Update_Needed, that's is
+ * and will not send any notifications about updating to HMI
+ */
+ void ScheduleManualUpdate();
+
+ /**
+ * @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();
+
+#ifdef BUILD_TESTS
+ PolicyTableStatus GetLastUpdateStatus() const {
+ return current_status_->get_status();
+ }
+#endif // BUILD_TESTS
+
+ private:
+ /**
+ * @brief Does statuses transitions after event handling and notifies the
+ * system
+ */
+ void DoTransition();
+
+ private:
+ PolicyListener* listener_;
+
+ /**
+ * @brief Current update status
+ */
+ utils::SharedPtr<Status> current_status_;
+
+ /**
+ * @brief Next status after current to be set
+ */
+ utils::SharedPtr<Status> next_status_;
+
+ /**
+ * @brief Status to be set after 'next' status
+ */
+ utils::SharedPtr<Status> postponed_status_;
+ sync_primitives::Lock status_lock_;
+
+ UpdateEvent last_processed_event_;
+ bool apps_search_in_progress_;
+ bool app_registered_from_non_consented_device_;
+ sync_primitives::Lock apps_search_in_progress_lock_;
+};
+}
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_H_
diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
new file mode 100644
index 0000000000..e118f9974f
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
+
+#include "utils/shared_ptr.h"
+#include "policy/policy_types.h"
+#include "policy/status.h"
+
+namespace policy {
+
+class PolicyListener;
+
+class UpdateStatusManagerInterface {
+ public:
+ virtual ~UpdateStatusManagerInterface() {}
+
+ /**
+ * @brief Process event by current status implementations
+ * @param event Event
+ */
+ virtual void ProcessEvent(UpdateEvent event) = 0;
+
+ /**
+ * @brief Set next status during event processing
+ * @param status Status shared pointer
+ */
+ virtual void SetNextStatus(utils::SharedPtr<Status> status) = 0;
+
+ /**
+ * @brief Set postponed status (will be set after next status) during event
+ * processing
+ * @param status Status shared pointer
+ */
+ virtual void SetPostponedStatus(utils::SharedPtr<Status> status) = 0;
+ /**
+ * @brief Sets listener pointer
+ * @param listener Pointer to policy listener implementation
+ */
+ virtual void set_listener(PolicyListener* listener) = 0;
+
+ /**
+ * @brief Update status hanlder for PTS sending out
+ */
+ virtual void OnUpdateSentOut() = 0;
+
+ /**
+ * @brief Update status handler for PTU waiting timeout
+ */
+ virtual void OnUpdateTimeoutOccurs() = 0;
+
+ /**
+ * @brief Update status handler for valid PTU receiving
+ */
+ virtual void OnValidUpdateReceived() = 0;
+
+ /**
+ * @brief Update status handler for wrong PTU receiving
+ */
+ virtual void OnWrongUpdateReceived() = 0;
+
+ /**
+ * @brief Update status handler for reset PT to default state
+ * @param is_update_required Update necessity flag
+ */
+ virtual void OnResetDefaultPT(bool is_update_required) = 0;
+
+ /**
+ * @brief Update status handler for restarting retry sequence
+ */
+ virtual void OnResetRetrySequence() = 0;
+
+ /**
+ * @brief Update status handler on new application registering
+ */
+ virtual void OnNewApplicationAdded(DeviceConsent device_consent) = 0;
+
+ /**
+ * @brief Update status handler for policy initialization
+ * @param is_update_required Update necessity flag
+ */
+ virtual void OnPolicyInit(bool is_update_required) = 0;
+};
+
+typedef utils::SharedPtr<UpdateStatusManagerInterface>
+ UpdateStatusManagerInterfaceSPtr;
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_
diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
new file mode 100644
index 0000000000..1e263ec9df
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h
@@ -0,0 +1,107 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
+
+#include <ctime>
+#include "policy/usage_statistics/statistics_manager.h"
+#include "policy/usage_statistics/app_stopwatch.h"
+#include "utils/shared_ptr.h"
+#include "utils/timer.h"
+#include "utils/macro.h"
+
+namespace usage_statistics {
+
+using timer::Timer;
+
+class GlobalCounter {
+ public:
+ GlobalCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ GlobalCounterId counter_type);
+ void operator++() const;
+
+ private:
+ GlobalCounterId counter_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+};
+
+class AppCounter {
+ public:
+ AppCounter(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ AppCounterId counter_type);
+ void operator++() const;
+
+ private:
+ std::string app_id_;
+ AppCounterId counter_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+};
+
+class AppInfo {
+ public:
+ AppInfo(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ AppInfoId info_type);
+ void Update(const std::string& new_info) const;
+
+ private:
+ std::string app_id_;
+ AppInfoId info_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+};
+
+class AppStopwatchImpl : public AppStopwatch {
+ public:
+ AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id);
+ AppStopwatchImpl(utils::SharedPtr<StatisticsManager> statistics_manager,
+ const std::string& app_id,
+ std::uint32_t timeout);
+ void Start(AppStopwatchId stopwatch_type) OVERRIDE;
+ void Switch(AppStopwatchId stopwatch_type) OVERRIDE;
+ void WriteTime() OVERRIDE;
+
+ private:
+ // Fields
+ std::string app_id_;
+ AppStopwatchId stopwatch_type_;
+ utils::SharedPtr<StatisticsManager> statistics_manager_;
+ timer::Timer timer_;
+ const std::uint32_t time_out_;
+ DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl);
+};
+
+} // namespace usage_statistics
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_COUNTER_H_
diff --git a/src/components/policy/policy_regular/include/policy/user_consent_manager.h b/src/components/policy/policy_regular/include/policy/user_consent_manager.h
new file mode 100644
index 0000000000..cfb20cb715
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/user_consent_manager.h
@@ -0,0 +1,44 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
+
+namespace policy {
+class UserConsentManager {
+ public:
+ UserConsentManager() {}
+ ~UserConsentManager() {}
+};
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USER_CONSENT_MANAGER_H_
diff --git a/src/components/policy/policy_table_interface_ext.xml b/src/components/policy/policy_regular/policy_table_interface_ext.xml
index 468eec2b0b..468eec2b0b 100644
--- a/src/components/policy/policy_table_interface_ext.xml
+++ b/src/components/policy/policy_regular/policy_table_interface_ext.xml
diff --git a/src/components/policy/policy_regular/specification.txt b/src/components/policy/policy_regular/specification.txt
new file mode 100644
index 0000000000..b00a2932e0
--- /dev/null
+++ b/src/components/policy/policy_regular/specification.txt
@@ -0,0 +1 @@
+https://adc.luxoft.com/confluence/display/APPLINK/Policy+Manager+Specification
diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc
new file mode 100644
index 0000000000..f99b226f2e
--- /dev/null
+++ b/src/components/policy/policy_regular/src/access_remote_impl.cc
@@ -0,0 +1,247 @@
+/*
+ * 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 "policy/access_remote_impl.h"
+
+#include <algorithm>
+#include <iterator>
+#include "policy/cache_manager.h"
+#include "utils/logger.h"
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl")
+
+using policy_table::DeviceData;
+using policy_table::FunctionalGroupings;
+using rpc::policy_table_interface_base::EnumFromJsonString;
+
+namespace policy {
+
+struct ToHMIType {
+ policy_table::AppHMITypes::value_type operator()(int item) const {
+ policy_table::AppHMIType type = static_cast<policy_table::AppHMIType>(item);
+ if (!IsValidEnum(type)) {
+ LOG4CXX_WARN(logger_, "HMI type isn't known " << item);
+ type = policy_table::AHT_DEFAULT;
+ }
+ LOG4CXX_DEBUG(logger_,
+ "HMI type: " << item << " - " << EnumToJsonString(type));
+ return policy_table::AppHMITypes::value_type(type);
+ }
+};
+
+struct Contained {
+ private:
+ const policy_table::Strings& params_;
+
+ public:
+ explicit Contained(const policy_table::Strings& params) : params_(params) {}
+ bool operator()(const RemoteControlParams::value_type& item) const {
+ return std::find_if(params_.begin(), params_.end(), CompareString(item)) !=
+ params_.end();
+ }
+ struct CompareString {
+ private:
+ const RemoteControlParams::value_type& value_;
+
+ public:
+ explicit CompareString(const RemoteControlParams::value_type& value)
+ : value_(value) {}
+ bool operator()(const policy_table::Strings::value_type& item) const {
+ return value_ == static_cast<std::string>(item);
+ }
+ };
+};
+
+struct ToModuleType {
+ std::string operator()(policy_table::ModuleTypes::value_type item) const {
+ policy_table::ModuleType type = static_cast<policy_table::ModuleType>(item);
+ return EnumToJsonString(type);
+ }
+};
+
+AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
+
+AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+ : cache_(cache) {}
+
+bool AccessRemoteImpl::CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!cache_->IsApplicationRepresented(app_id)) {
+ return false;
+ }
+
+ const policy_table::ApplicationParams& app =
+ cache_->pt()->policy_table.app_policies_section.apps[app_id];
+ if (!app.moduleType.is_initialized()) {
+ return false;
+ }
+
+ const policy_table::ModuleTypes& modules = *app.moduleType;
+ if (modules.empty()) {
+ return true;
+ }
+
+ return std::find(modules.begin(), modules.end(), module) != modules.end();
+}
+
+bool AccessRemoteImpl::IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::AccessModules::const_iterator i = modules.find(module_name);
+ if (i == modules.end()) {
+ LOG4CXX_DEBUG(logger_, "Module " << module_name << " wasn't found");
+ return false;
+ }
+
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ if (rpcs.empty()) {
+ return true;
+ }
+ policy_table::RemoteRpcs::const_iterator j = rpcs.find(rpc_name);
+ if (j != rpcs.end()) {
+ const policy_table::Strings& parameters = j->second;
+ return CompareParameters(parameters, input);
+ }
+ LOG4CXX_DEBUG(logger_, "RPC " << rpc_name << " wasn't found");
+ return false;
+}
+
+bool AccessRemoteImpl::CompareParameters(
+ const policy_table::Strings& parameters, RemoteControlParams* input) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (parameters.empty()) {
+ return true;
+ }
+
+ if (input->empty()) {
+ LOG4CXX_DEBUG(logger_, "Input is empty");
+ return false;
+ }
+
+ input->erase(
+ std::remove_if(input->begin(), input->end(), Contained(parameters)),
+ input->end());
+ return input->empty();
+}
+
+void AccessRemoteImpl::SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ HMIList::mapped_type types;
+ std::transform(hmi_types.begin(),
+ hmi_types.end(),
+ std::back_inserter(types),
+ ToHMIType());
+ hmi_types_[who] = types;
+}
+
+const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(who.app_id)) {
+ return hmi_types_[who];
+ } else {
+ return *cache_->pt()
+ ->policy_table.app_policies_section.apps[who.app_id]
+ .AppHMIType;
+ }
+}
+
+const policy_table::Strings& AccessRemoteImpl::GetGroups(
+ const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetGroups(who.app_id);
+}
+
+bool AccessRemoteImpl::IsAppRemoteControl(const ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const policy_table::AppHMITypes& hmi_types = HmiTypes(who);
+ return std::find(hmi_types.begin(),
+ hmi_types.end(),
+ policy_table::AHT_REMOTE_CONTROL) != hmi_types.end();
+}
+
+bool AccessRemoteImpl::GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GetGroupsIds(device_id, app_id, group_types[kTypeGeneral]);
+ GetGroupsIds(device_id, kDefaultId, group_types[kTypeDefault]);
+ GetGroupsIds(
+ device_id, kPreDataConsentId, group_types[kTypePreDataConsented]);
+ return true;
+}
+
+std::ostream& operator<<(std::ostream& output,
+ const FunctionalGroupIDs& types) {
+ std::copy(types.begin(),
+ types.end(),
+ std::ostream_iterator<FunctionalGroupIDs::value_type>(output, " "));
+ return output;
+}
+
+void AccessRemoteImpl::GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& groups_ids) {
+ ApplicationOnDevice who = {device_id, app_id};
+ const policy_table::Strings& groups = GetGroups(who);
+ groups_ids.resize(groups.size());
+ std::transform(groups.begin(),
+ groups.end(),
+ groups_ids.begin(),
+ &CacheManager::GenerateHash);
+ LOG4CXX_DEBUG(logger_, "Groups Ids: " << groups_ids);
+}
+
+bool AccessRemoteImpl::GetModuleTypes(const std::string& application_id,
+ std::vector<std::string>* modules) {
+ DCHECK(modules);
+ policy_table::ApplicationPolicies& apps =
+ cache_->pt()->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::iterator i = apps.find(application_id);
+ if (i == apps.end()) {
+ return false;
+ }
+ rpc::Optional<policy_table::ModuleTypes> moduleTypes = i->second.moduleType;
+ if (!moduleTypes.is_initialized()) {
+ return false;
+ }
+ std::transform(moduleTypes->begin(),
+ moduleTypes->end(),
+ std::back_inserter(*modules),
+ ToModuleType());
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc
new file mode 100644
index 0000000000..6a142374d5
--- /dev/null
+++ b/src/components/policy/policy_regular/src/cache_manager.cc
@@ -0,0 +1,1738 @@
+/*
+ * 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"
+
+#include <algorithm>
+#include <functional>
+#include <ctime>
+#include <cmath>
+#include <sstream>
+
+#include "utils/file_system.h"
+#include "json/reader.h"
+#include "json/features.h"
+#include "json/writer.h"
+#include "utils/logger.h"
+#include "utils/date_time.h"
+#include "utils/gen_hash.h"
+#include "utils/macro.h"
+#include "utils/threads/thread.h"
+#include "utils/threads/thread_delegate.h"
+
+#include "policy/sql_pt_representation.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+#define CACHE_MANAGER_CHECK(return_value) \
+ { \
+ if (!pt_) { \
+ LOG4CXX_WARN(logger_, "The cache manager is not initialized"); \
+ return return_value; \
+ } \
+ }
+
+#define CACHE_MANAGER_CHECK_VOID() \
+ { \
+ if (!pt_) { \
+ LOG4CXX_WARN(logger_, "The cache manager is not initialized"); \
+ return; \
+ } \
+ }
+
+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_;
+};
+
+struct PolicyTableUpdater {
+ PolicyTableUpdater(const policy_table::ApplicationParams& default_params)
+ : default_params_(default_params) {}
+
+ void operator()(policy_table::ApplicationPolicies::value_type& pt_value) {
+ if (policy::kDefaultId == pt_value.second.get_string()) {
+ pt_value.second = default_params_;
+ pt_value.second.set_to_string(policy::kDefaultId);
+ }
+ }
+
+ private:
+ const policy_table::ApplicationParams& default_params_;
+};
+
+CacheManager::CacheManager()
+ : CacheManagerInterface()
+ , pt_(new policy_table::Table)
+ , backup_(new SQLPTRepresentation())
+ , update_required(false)
+ , cache_lock_(true) {
+ 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_);
+}
+
+const policy_table::Strings& CacheManager::GetGroups(const PTString& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return pt_->policy_table.app_policies_section.apps[app_id].groups;
+}
+
+bool CacheManager::CanAppKeepContext(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ bool result = true;
+ return result;
+}
+
+uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ uint32_t result = 0;
+ if (!AppExists(app_id)) {
+ return result;
+ }
+
+ const policy_table::ApplicationPolicies::mapped_type& app =
+ pt_->policy_table.app_policies_section.apps[app_id];
+ if (app.heart_beat_timeout_ms.is_initialized()) {
+ result = *(app.heart_beat_timeout_ms);
+ }
+
+ return result;
+}
+
+const policy_table::AppHMITypes* CacheManager::GetHMITypes(
+ const std::string& app_id) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::ApplicationPolicies& apps =
+ pt_->policy_table.app_policies_section.apps;
+ policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id);
+ if (i != apps.end()) {
+ const policy_table::AppHMITypes& app_hmi_types = *i->second.AppHMIType;
+ if (app_hmi_types.is_initialized()) {
+ return &app_hmi_types;
+ }
+ }
+ return NULL;
+}
+
+bool CacheManager::CanAppStealFocus(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ bool result = true;
+ return result;
+}
+
+bool CacheManager::GetDefaultHMI(const std::string& app_id,
+ std::string& default_hmi) const {
+ CACHE_MANAGER_CHECK(false);
+ default_hmi = "NONE";
+ return true;
+}
+
+bool CacheManager::ResetUserConsent() {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock lock(cache_lock_);
+ return true;
+}
+
+bool CacheManager::GetUserPermissionsForDevice(
+ const std::string& device_id,
+ StringArray& consented_groups,
+ StringArray& disallowed_groups) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ return true;
+}
+
+void CacheManager::GetAllAppGroups(const std::string& app_id,
+ FunctionalGroupIDs& all_group_ids) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+
+ if (kDeviceId == app_id) {
+ LOG4CXX_INFO(logger_, "Devices doesn't have groups");
+ return;
+ }
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator app_params_iter =
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+
+ 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 =
+ (*app_params_iter).second.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);
+ }
+ }
+}
+
+void CacheManager::GetPreConsentedGroups(
+ const std::string& app_id, FunctionalGroupIDs& preconsented_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+}
+
+void CacheManager::GetConsentedGroups(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& allowed_groups,
+ FunctionalGroupIDs& disallowed_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+}
+
+void CacheManager::GetUnconsentedGroups(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ FunctionalGroupIDs& unconsented_groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+}
+
+void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
+ const std::string& group_name) {
+ CACHE_MANAGER_CHECK_VOID();
+}
+
+bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
+ 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_section.apps.begin();
+ policy_table::ApplicationPolicies::const_iterator iter_end =
+ update_pt.policy_table.app_policies_section.apps.end();
+
+ for (; iter != iter_end; ++iter) {
+ if (iter->second.is_null()) {
+ pt_->policy_table.app_policies_section.apps[iter->first] =
+ policy_table::ApplicationParams();
+ 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 {
+ pt_->policy_table.app_policies_section.apps[iter->first] = iter->second;
+ if (kDefaultId == iter->first) {
+ std::for_each(pt_->policy_table.app_policies_section.apps.begin(),
+ pt_->policy_table.app_policies_section.apps.end(),
+ PolicyTableUpdater(iter->second));
+ }
+ }
+ }
+
+ pt_->policy_table.app_policies_section.device =
+ update_pt.policy_table.app_policies_section.device;
+
+ pt_->policy_table.module_config.SafeCopyFrom(
+ update_pt.policy_table.module_config);
+
+ pt_->policy_table.consumer_friendly_messages.assign_if_valid(
+ update_pt.policy_table.consumer_friendly_messages);
+
+ ResetCalculatedPermissions();
+ Backup();
+ return true;
+}
+
+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_);
+ 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();
+ }
+ 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;
+ }
+ }
+}
+
+bool CacheManager::AppHasHMIType(const std::string& application_id,
+ policy_table::AppHMIType hmi_type) const {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::ApplicationPolicies& policies =
+ pt_->policy_table.app_policies_section.apps;
+
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ policies.find(application_id);
+
+ if (policy_iter == policies.end()) {
+ return false;
+ }
+
+ if (policy_iter->second.AppHMIType.is_initialized()) {
+ return helpers::in_range(*(policy_iter->second.AppHMIType),
+ rpc::Enum<policy_table::AppHMIType>(hmi_type));
+ }
+
+ return false;
+}
+
+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);
+ // ISO_8601 format is expected, e.g. “2000-01-01T12:18:53Z”
+ strftime(buf, sizeof(buf), "%Y-%m-%dT%XZ", &tstruct);
+ return buf;
+}
+
+bool CacheManager::GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ GetAllAppGroups(app_id, group_types[kTypeGeneral]);
+ GetAllAppGroups(kDefaultId, group_types[kTypeDefault]);
+ GetAllAppGroups(kPreDataConsentId, group_types[kTypePreDataConsented]);
+ return true;
+}
+
+bool CacheManager::GetDeviceGroupsFromPolicies(
+ policy_table::Strings& groups,
+ policy_table::Strings& preconsented_groups) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ return true;
+}
+
+bool CacheManager::AddDevice(const std::string& device_id,
+ const std::string& connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ CACHE_MANAGER_CHECK(false);
+ policy_table::DeviceParams& params =
+ (*(pt_->policy_table.device_data))[device_id];
+
+ // Open SDL stored just device id in policy
+ UNUSED(params);
+
+ // We have to set preloaded flag as false in policy table on adding new
+ // information (SDLAQ-CRS-2365). It can happens only after device addition.
+ *pt_->policy_table.module_config.preloaded_pt = false;
+
+ Backup();
+ return true;
+}
+
+bool CacheManager::SetDeviceData(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ CACHE_MANAGER_CHECK(false);
+ Backup();
+ return true;
+}
+
+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_);
+ CACHE_MANAGER_CHECK(false);
+ Backup();
+ return true;
+}
+
+bool CacheManager::ReactOnUserDevConsentForApp(const std::string& app_id,
+ bool is_device_allowed) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ bool result = true;
+ Backup();
+ return result;
+}
+
+void CacheManager::GetGroupNameByHashID(const int32_t group_id,
+ std::string& group_name) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::FunctionalGroupings::const_iterator fg_iter =
+ pt_->policy_table.functional_groupings.begin();
+ policy_table::FunctionalGroupings::const_iterator fg_iter_end =
+ pt_->policy_table.functional_groupings.end();
+
+ for (; fg_iter != fg_iter_end; ++fg_iter) {
+ const int32_t id = GenerateHash((*fg_iter).first);
+ if (group_id == id) {
+ group_name = (*fg_iter).first;
+ }
+ }
+}
+
+bool CacheManager::SetUserPermissionsForApp(
+ const PermissionConsent& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ CACHE_MANAGER_CHECK(false);
+ Backup();
+ return true;
+}
+
+bool CacheManager::UpdateRequired() const {
+ return update_required;
+}
+
+void CacheManager::SaveUpdateRequired(bool status) {
+ update_required = status;
+ Backup();
+}
+
+bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ bool is_revoked = false;
+ 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;
+}
+
+void CacheManager::CheckPermissions(const policy_table::Strings& groups,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ policy_table::Strings::const_iterator app_groups_iter = groups.begin();
+ policy_table::Strings::const_iterator app_groups_iter_end = groups.end();
+
+ policy_table::FunctionalGroupings::const_iterator concrete_group;
+
+ for (; app_groups_iter != app_groups_iter_end; ++app_groups_iter) {
+ concrete_group =
+ pt_->policy_table.functional_groupings.find(*app_groups_iter);
+ if (pt_->policy_table.functional_groupings.end() != concrete_group) {
+ const policy_table::Rpcs& rpcs = concrete_group->second;
+
+ policy_table::Rpc::const_iterator rpc_iter = rpcs.rpcs.find(rpc);
+ if (rpcs.rpcs.end() != rpc_iter) {
+ policy_table::RpcParameters rpc_param = rpc_iter->second;
+
+ if (rpc_param.parameters.is_initialized() &&
+ rpc_param.parameters->empty()) {
+ // If "parameters" field exist in PT section of incoming RPC but empty
+ // all params considered as DISALLOWED
+ result.hmi_level_permitted = kRpcDisallowed;
+ return;
+ }
+ policy_table::HmiLevel hmi_level_e;
+ policy_table::EnumFromJsonString(hmi_level, &hmi_level_e);
+
+ policy_table::HmiLevels::const_iterator hmi_iter =
+ std::find(rpc_param.hmi_levels.begin(),
+ rpc_param.hmi_levels.end(),
+ hmi_level_e);
+
+ if (rpc_param.hmi_levels.end() != hmi_iter) {
+ result.hmi_level_permitted = PermitResult::kRpcAllowed;
+
+ policy_table::Parameters::const_iterator params_iter =
+ rpc_param.parameters->begin();
+ policy_table::Parameters::const_iterator params_iter_end =
+ rpc_param.parameters->end();
+
+ for (; params_iter != params_iter_end; ++params_iter) {
+ result.list_of_allowed_params.insert(
+ policy_table::EnumToJsonString(*params_iter));
+ }
+ }
+ }
+ }
+ }
+}
+
+bool CacheManager::IsPTPreloaded() {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return *pt_->policy_table.module_config.preloaded_pt;
+}
+
+int CacheManager::IgnitionCyclesBeforeExchange() {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ 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;
+
+ const int last_exch = static_cast<int>(
+ *pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
+ current = std::max(last_exch, 0);
+ LOG4CXX_DEBUG(
+ logger_,
+ "IgnitionCyclesBeforeExchange current:" << static_cast<int>(current));
+
+ return std::max(limit - current, 0);
+}
+
+int CacheManager::KilometersBeforeExchange(int current) {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const int limit =
+ std::max(static_cast<int>(
+ pt_->policy_table.module_config.exchange_after_x_kilometers),
+ 0);
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange limit:" << limit);
+ int last = 0;
+
+ const int odo_val = static_cast<int>(
+ *pt_->policy_table.module_meta->pt_exchanged_at_odometer_x);
+ last = std::max(odo_val, 0);
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange last:" << last);
+
+ const int actual = std::max((current - last), 0);
+ LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange actual:" << actual);
+ return std::max(limit - actual, 0);
+}
+
+bool CacheManager::SetCountersPassedForSuccessfulUpdate(
+ policy::Counters counter, int value) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ switch (counter) {
+ case KILOMETERS:
+ *pt_->policy_table.module_meta->pt_exchanged_at_odometer_x = value;
+ LOG4CXX_DEBUG(logger_,
+ "SetCountersPassedForSuccessfulUpdate km:" << value);
+ break;
+ case DAYS_AFTER_EPOCH:
+ *pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch = value;
+ LOG4CXX_DEBUG(
+ logger_,
+ "SetCountersPassedForSuccessfulUpdate days after epoch:" << value);
+ break;
+ default:
+ LOG4CXX_ERROR(logger_,
+ "Unknown counter was requested to set: " << counter);
+ return false;
+ }
+
+ Backup();
+ return true;
+}
+
+int CacheManager::DaysBeforeExchange(int current) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ const rpc::Optional<rpc::Integer<uint16_t, 0, 65535> >& days_after_epoch =
+ (pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch);
+
+ if (!days_after_epoch->is_initialized()) {
+ return -1;
+ }
+
+ const uint8_t limit = pt_->policy_table.module_config.exchange_after_x_days;
+ LOG4CXX_DEBUG(logger_,
+ "Exchange after: " << static_cast<int>(limit) << " days");
+
+ LOG4CXX_DEBUG(logger_, "Epoch since last update: " << *days_after_epoch);
+
+ const uint16_t actual =
+ std::max(static_cast<uint16_t>(current - *days_after_epoch), uint16_t(0));
+ LOG4CXX_DEBUG(logger_, "The days since last update: " << actual);
+
+ return std::max(limit - actual, 0);
+}
+
+void CacheManager::IncrementIgnitionCycles() {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const int ign_val = static_cast<int>(
+ *pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
+ (*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) =
+ ign_val + 1;
+ LOG4CXX_DEBUG(logger_, "IncrementIgnitionCycles ignitions:" << ign_val);
+ Backup();
+}
+
+void CacheManager::ResetIgnitionCycles() {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ (*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) = 0;
+ Backup();
+}
+
+int CacheManager::TimeoutResponse() {
+ CACHE_MANAGER_CHECK(0);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ return pt_->policy_table.module_config.timeout_after_x_seconds *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter =
+ pt_->policy_table.module_config.seconds_between_retries.begin();
+ rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter_end =
+ pt_->policy_table.module_config.seconds_between_retries.end();
+
+ const std::size_t size =
+ pt_->policy_table.module_config.seconds_between_retries.size();
+ seconds.reserve(size);
+ for (; iter != iter_end; ++iter) {
+ seconds.push_back(*iter);
+ }
+ return true;
+}
+
+const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
+ CACHE_MANAGER_CHECK(VehicleInfo());
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
+ VehicleInfo vehicle_info;
+ vehicle_info.vehicle_make = *module_config.vehicle_make;
+ vehicle_info.vehicle_model = *module_config.vehicle_model;
+ vehicle_info.vehicle_year = *module_config.vehicle_year;
+ LOG4CXX_DEBUG(
+ logger_,
+ "Vehicle info (make, model, year):" << vehicle_info.vehicle_make << ","
+ << vehicle_info.vehicle_model << ","
+ << vehicle_info.vehicle_year);
+ return vehicle_info;
+}
+
+std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<UserFriendlyMessage> result;
+ CACHE_MANAGER_CHECK(result);
+
+ std::vector<std::string>::const_iterator it = msg_codes.begin();
+ std::vector<std::string>::const_iterator it_end = msg_codes.end();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ 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);
+ }
+ return result;
+}
+
+void CacheManager::GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) {
+ std::stringstream service_type_stream;
+ service_type_stream << (service_type <= 9 ? "0x0" : "0x") << service_type;
+
+ const std::string service_type_str = service_type_stream.str();
+ GetUpdateUrls(service_type_str, out_end_points);
+}
+
+void CacheManager::GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK_VOID();
+
+ LOG4CXX_DEBUG(logger_, "Search service value is: " << service_type);
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ServiceEndpoints::const_iterator iter =
+ pt_->policy_table.module_config.endpoints.find(service_type);
+
+ if (pt_->policy_table.module_config.endpoints.end() != iter) {
+ policy_table::URLList::const_iterator url_list_iter =
+ (*iter).second.begin();
+ policy_table::URLList::const_iterator url_list_iter_end =
+ (*iter).second.end();
+ for (; url_list_iter != url_list_iter_end; ++url_list_iter) {
+ EndpointData data;
+ data.app_id = (*url_list_iter).first;
+ std::copy((*url_list_iter).second.begin(),
+ (*url_list_iter).second.end(),
+ std::back_inserter(data.url));
+
+ out_end_points.push_back(data);
+ }
+ }
+}
+
+std::string CacheManager::GetLockScreenIconUrl() const {
+ if (backup_) {
+ return backup_->GetLockScreenIconUrl();
+ }
+ return std::string("");
+}
+
+rpc::policy_table_interface_base::NumberOfNotificationsType
+CacheManager::GetNotificationsNumber(const std::string& priority) {
+ CACHE_MANAGER_CHECK(0);
+ typedef rpc::policy_table_interface_base::NumberOfNotificationsPerMinute NNPM;
+
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const NNPM& nnpm =
+ pt_->policy_table.module_config.notifications_per_minute_by_priority;
+
+ NNPM::const_iterator priority_iter = nnpm.find(priority);
+
+ const rpc::policy_table_interface_base::NumberOfNotificationsType result =
+ (nnpm.end() != priority_iter ? (*priority_iter).second : 0u);
+ return result;
+}
+
+bool CacheManager::GetPriority(const std::string& policy_app_id,
+ std::string& priority) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ 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_section.apps;
+
+ 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);
+ }
+
+ return app_id_exists;
+}
+
+void CacheManager::CheckSnapshotInitialization() {
+ CACHE_MANAGER_CHECK_VOID();
+ if (!snapshot_) {
+ LOG4CXX_ERROR(logger_, "Snapshot pointer is not initialized");
+ return;
+ }
+
+ *(snapshot_->policy_table.module_config.preloaded_pt) = false;
+
+ // SDL must not send certificate in snapshot
+ snapshot_->policy_table.module_config.certificate =
+ rpc::Optional<rpc::String<0, 65535> >();
+
+ rpc::Optional<policy_table::ModuleMeta>& module_meta =
+ snapshot_->policy_table.module_meta;
+ if (!module_meta->pt_exchanged_at_odometer_x->is_initialized()) {
+ *(module_meta->pt_exchanged_at_odometer_x) = 0;
+ }
+ if (!module_meta->ignition_cycles_since_last_exchange->is_initialized()) {
+ *(module_meta->ignition_cycles_since_last_exchange) = 0;
+ }
+ if (!module_meta->pt_exchanged_x_days_after_epoch->is_initialized()) {
+ *(module_meta->pt_exchanged_x_days_after_epoch) = 0;
+ }
+
+ /* consumer_friendly_messages are required for the snapshot;
+ * consumer_friendly_messages->version is required always, but
+ * consumer_friendly_messages->messages must be omitted in PTS */
+ if (snapshot_->policy_table.consumer_friendly_messages->is_initialized()) {
+ snapshot_->policy_table.consumer_friendly_messages->messages =
+ rpc::Optional<policy_table::Messages>();
+ } else {
+ LOG4CXX_WARN(logger_,
+ "policy_table.consumer_friendly_messages is not initialized");
+ }
+
+ /* policy_table.usage_and_error_counts are required for PTS and
+ * policy_table.usage_and_error_counts->app_level is optional */
+ rpc::Optional<policy_table::UsageAndErrorCounts>& usage_and_error_counts =
+ snapshot_->policy_table.usage_and_error_counts;
+
+ if (usage_and_error_counts->app_level->is_initialized()) {
+ policy_table::AppLevels::iterator it =
+ usage_and_error_counts->app_level->begin();
+ policy_table::AppLevels::const_iterator it_end =
+ usage_and_error_counts->app_level->end();
+ for (; it != it_end; ++it) {
+ if (!(*it).second.minutes_in_hmi_full.is_initialized()) {
+ (*it).second.minutes_in_hmi_full = 0;
+ }
+
+ if (!(*it).second.app_registration_language_gui.is_initialized()) {
+ (*it).second.app_registration_language_gui = "unknown";
+ }
+
+ if (!(*it).second.app_registration_language_vui.is_initialized()) {
+ (*it).second.app_registration_language_vui = "unknown";
+ }
+
+ if (!(*it).second.minutes_in_hmi_limited.is_initialized()) {
+ (*it).second.minutes_in_hmi_limited = 0;
+ }
+
+ if (!(*it).second.minutes_in_hmi_background.is_initialized()) {
+ (*it).second.minutes_in_hmi_background = 0;
+ }
+
+ if (!(*it).second.minutes_in_hmi_none.is_initialized()) {
+ (*it).second.minutes_in_hmi_none = 0;
+ }
+
+ if (!(*it).second.count_of_user_selections.is_initialized()) {
+ (*it).second.count_of_user_selections = 0;
+ }
+
+ if (!(*it)
+ .second.count_of_rejections_sync_out_of_memory
+ .is_initialized()) {
+ (*it).second.count_of_rejections_sync_out_of_memory = 0;
+ }
+
+ if (!(*it)
+ .second.count_of_rejections_nickname_mismatch.is_initialized()) {
+ (*it).second.count_of_rejections_nickname_mismatch = 0;
+ }
+
+ if (!(*it).second.count_of_rejections_duplicate_name.is_initialized()) {
+ (*it).second.count_of_rejections_duplicate_name = 0;
+ }
+
+ if (!(*it).second.count_of_rejected_rpc_calls.is_initialized()) {
+ (*it).second.count_of_rejected_rpc_calls = 0;
+ }
+
+ if (!(*it).second.count_of_rpcs_sent_in_hmi_none.is_initialized()) {
+ (*it).second.count_of_rpcs_sent_in_hmi_none = 0;
+ }
+
+ if (!(*it).second.count_of_removals_for_bad_behavior.is_initialized()) {
+ (*it).second.count_of_removals_for_bad_behavior = 0;
+ }
+
+ if (!(*it).second.count_of_tls_errors.is_initialized()) {
+ (*it).second.count_of_tls_errors = 0;
+ }
+
+ if (!(*it).second.count_of_run_attempts_while_revoked.is_initialized()) {
+ (*it).second.count_of_run_attempts_while_revoked = 0;
+ }
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "app_level is not initialized");
+ }
+}
+
+void CacheManager::PersistData() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (backup_.valid()) {
+ if (pt_.valid()) {
+ // Comma expression is used to hold the lock only during the constructor
+ // call
+ policy_table::Table copy_pt(
+ (sync_primitives::AutoLock(cache_lock_), *pt_));
+
+ 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_AUTO_TRACE(logger_);
+ 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;
+}
+
+utils::SharedPtr<policy_table::Table> CacheManager::GenerateSnapshot() {
+ CACHE_MANAGER_CHECK(snapshot_);
+
+ snapshot_ = new policy_table::Table();
+
+ // Copy all members of policy table except messages in consumer friendly
+ // messages
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ snapshot_->policy_table.app_policies_section =
+ pt_->policy_table.app_policies_section;
+ snapshot_->policy_table.functional_groupings =
+ pt_->policy_table.functional_groupings;
+ snapshot_->policy_table.consumer_friendly_messages->version =
+ pt_->policy_table.consumer_friendly_messages->version;
+ snapshot_->policy_table.consumer_friendly_messages->mark_initialized();
+ snapshot_->policy_table.module_config = pt_->policy_table.module_config;
+ snapshot_->policy_table.module_meta = pt_->policy_table.module_meta;
+ snapshot_->policy_table.usage_and_error_counts =
+ pt_->policy_table.usage_and_error_counts;
+ snapshot_->policy_table.device_data = pt_->policy_table.device_data;
+
+ // Set policy table type to Snapshot
+ snapshot_->SetPolicyTableType(
+ rpc::policy_table_interface_base::PolicyTableType::PT_SNAPSHOT);
+
+ CheckSnapshotInitialization();
+ return snapshot_;
+}
+
+bool CacheManager::GetInitialAppData(const std::string& app_id,
+ StringArray& nicknames,
+ StringArray& app_hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(app_id);
+
+ 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(app_hmi_types),
+ AppHMITypeToString());
+ }
+ return true;
+}
+
+bool CacheManager::GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const policy_table::FunctionalGroupings& f_groupings =
+ pt_->policy_table.functional_groupings;
+
+ groups.insert(f_groupings.begin(), f_groupings.end());
+ return true;
+}
+
+int CacheManager::CountUnconsentedGroups(const std::string& policy_app_id,
+ const std::string& device_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ 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);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+
+ // 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;
+}
+
+bool CacheManager::IsMetaInfoPresent() const {
+ CACHE_MANAGER_CHECK(false);
+ bool result = true;
+ return result;
+}
+
+bool CacheManager::SetSystemLanguage(const std::string& language) {
+ CACHE_MANAGER_CHECK(false);
+ Backup();
+ return true;
+}
+
+bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames& names) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
+ pt_->policy_table.functional_groupings.begin();
+ rpc::policy_table_interface_base::FunctionalGroupings::iterator iter_end =
+ pt_->policy_table.functional_groupings.end();
+
+ for (; iter != iter_end; ++iter) {
+ const int32_t id = GenerateHash((*iter).first);
+ std::pair<std::string, std::string> value =
+ std::make_pair(*(*iter).second.user_consent_prompt, (*iter).first);
+
+ names.insert(
+ std::pair<uint32_t, std::pair<std::string, std::string> >(id, value));
+ }
+ return true;
+}
+
+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();
+ sync_primitives::AutoLock lock(cache_lock_);
+ switch (type) {
+ case usage_statistics::USER_SELECTIONS:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_user_selections;
+ break;
+ case usage_statistics::REJECTIONS_SYNC_OUT_OF_MEMORY:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejections_sync_out_of_memory;
+ break;
+ case usage_statistics::REJECTIONS_NICKNAME_MISMATCH:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejections_nickname_mismatch;
+ break;
+ case usage_statistics::REJECTIONS_DUPLICATE_NAME:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejections_duplicate_name;
+ break;
+ case usage_statistics::REJECTED_RPC_CALLS:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rejected_rpc_calls;
+ break;
+ case usage_statistics::RPCS_IN_HMI_NONE:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_rpcs_sent_in_hmi_none;
+ break;
+ case usage_statistics::REMOVALS_MISBEHAVED:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_removals_for_bad_behavior;
+ break;
+ case usage_statistics::RUN_ATTEMPTS_WHILE_REVOKED:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_run_attempts_while_revoked;
+ break;
+ case usage_statistics::COUNT_OF_TLS_ERRORS:
+ ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .count_of_tls_errors;
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Type app counter is unknown");
+ return;
+ }
+ Backup();
+}
+
+void CacheManager::Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock lock(cache_lock_);
+ switch (type) {
+ case usage_statistics::LANGUAGE_GUI:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .app_registration_language_gui = value;
+ break;
+ case usage_statistics::LANGUAGE_VUI:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .app_registration_language_vui = value;
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Type app info is unknown");
+ return;
+ }
+ Backup();
+}
+
+void CacheManager::Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int seconds) {
+ CACHE_MANAGER_CHECK_VOID();
+ sync_primitives::AutoLock lock(cache_lock_);
+ const int minutes = ConvertSecondsToMinute(seconds);
+ switch (type) {
+ case usage_statistics::SECONDS_HMI_FULL:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_full += minutes;
+ break;
+ case usage_statistics::SECONDS_HMI_LIMITED:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_limited += minutes;
+ break;
+ case usage_statistics::SECONDS_HMI_BACKGROUND:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_background += minutes;
+ break;
+ case usage_statistics::SECONDS_HMI_NONE:
+ (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
+ .minutes_in_hmi_none += minutes;
+ break;
+ default:
+ LOG4CXX_WARN(logger_, "Type app stopwatch is unknown");
+ return;
+ }
+ Backup();
+}
+
+long CacheManager::ConvertSecondsToMinute(int seconds) {
+ const float seconds_in_minute = 60.0;
+ return std::round(seconds / seconds_in_minute);
+}
+
+bool CacheManager::SetDefaultPolicy(const std::string& app_id) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator iter =
+ 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];
+
+ SetIsDefault(app_id);
+ }
+ Backup();
+ return true;
+}
+
+bool CacheManager::IsDefaultPolicy(const std::string& app_id) const {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ const bool result =
+ 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) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator iter =
+ 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;
+}
+
+bool CacheManager::SetPredataPolicy(const std::string& app_id) {
+ CACHE_MANAGER_CHECK(false);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator iter =
+ pt_->policy_table.app_policies_section.apps.find(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;
+ }
+
+ pt_->policy_table.app_policies_section.apps[app_id] =
+ pt_->policy_table.app_policies_section.apps[kPreDataConsentId];
+
+ pt_->policy_table.app_policies_section.apps[app_id].set_to_string(
+ kPreDataConsentId);
+
+ Backup();
+ return true;
+}
+
+bool CacheManager::IsPredataPolicy(const std::string& app_id) const {
+ // TODO(AOleynik): Maybe change for comparison with pre_DataConsent
+ // permissions or check string value from get_string()
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (!IsApplicationRepresented(app_id)) {
+ return false;
+ }
+
+ policy_table::ApplicationPolicies& apps =
+ pt_->policy_table.app_policies_section.apps;
+ const policy_table::ApplicationPolicies::mapped_type& pre_data_app =
+ apps[kPreDataConsentId];
+ const policy_table::ApplicationPolicies::mapped_type& specific_app =
+ apps[app_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 is_marked_as_predata =
+ (kPreDataConsentId == specific_app.get_string());
+
+ return !res.empty() && is_marked_as_predata;
+}
+
+bool CacheManager::SetUnpairedDevice(const std::string& device_id,
+ bool unpaired) {
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ 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;
+ }
+
+ 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 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;
+ }
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::const_iterator 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,
+ const PolicySettings* settings) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ settings_ = settings;
+ InitResult init_result = backup_->Init(settings);
+
+ bool result = true;
+ switch (init_result) {
+ case InitResult::EXISTS: {
+ LOG4CXX_INFO(logger_, "Policy Table exists, was loaded correctly.");
+ result = LoadFromBackup();
+ if (result) {
+ if (!backup_->IsDBVersionActual()) {
+ LOG4CXX_INFO(logger_, "DB version is NOT actual");
+ if (!backup_->RefreshDB()) {
+ LOG4CXX_ERROR(logger_, "RefreshDB() failed");
+ return false;
+ }
+ backup_->UpdateDBVersion();
+ Backup();
+ }
+ if (!MergePreloadPT(file_name)) {
+ result = false;
+ }
+ }
+ } break;
+ case InitResult::SUCCESS: {
+ LOG4CXX_INFO(logger_, "Policy Table was inited successfully");
+
+ result = LoadFromFile(file_name, *pt_);
+
+ utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
+ result &= snapshot->is_valid();
+ LOG4CXX_DEBUG(logger_,
+ "Check if snapshot is valid: " << std::boolalpha << result);
+ if (!result) {
+ rpc::ValidationReport report("policy_table");
+ snapshot->ReportErrors(&report);
+ return result;
+ }
+
+ backup_->UpdateDBVersion();
+ Backup();
+ } break;
+ default: {
+ result = false;
+ LOG4CXX_ERROR(logger_, "Failed to init policy table.");
+ } break;
+ }
+
+ return result;
+}
+
+void CacheManager::FillDeviceSpecificData() {}
+
+bool CacheManager::LoadFromBackup() {
+ sync_primitives::AutoLock lock(cache_lock_);
+ pt_ = backup_->GenerateSnapshot();
+ update_required = backup_->UpdateRequired();
+
+ FillDeviceSpecificData();
+
+ return true;
+}
+
+void CacheManager::MakeLowerCaseAppNames(policy_table::Table& pt) const {
+ policy_table::ApplicationPolicies& apps =
+ pt.policy_table.app_policies_section.apps;
+ for (policy_table::ApplicationPolicies::iterator iter = apps.begin();
+ iter != apps.end();) {
+ std::string key = iter->first;
+ if (key == kDefaultId || key == kPreDataConsentId || key == kDeviceId) {
+ ++iter;
+ continue;
+ }
+
+ std::transform(key.begin(), key.end(), key.begin(), ::tolower);
+ if (key.compare(iter->first) != 0) {
+ std::swap(apps[key], iter->second);
+ iter = apps.erase(iter);
+ } else {
+ ++iter;
+ }
+ }
+}
+
+bool CacheManager::LoadFromFile(const std::string& file_name,
+ policy_table::Table& table) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ BinaryMessage json_string;
+ 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());
+ if (!reader.parse(json.c_str(), value)) {
+ LOG4CXX_FATAL(
+ logger_,
+ "Preloaded PT is corrupted: " << reader.getFormattedErrorMessages());
+ return false;
+ }
+
+ LOG4CXX_TRACE(logger_, "Start create PT");
+ sync_primitives::AutoLock locker(cache_lock_);
+
+ table = policy_table::Table(&value);
+
+ Json::StyledWriter s_writer;
+ LOG4CXX_DEBUG(logger_, "PT out:");
+ LOG4CXX_DEBUG(logger_, s_writer.write(table.ToJsonValue()));
+
+ MakeLowerCaseAppNames(table);
+
+ if (!table.is_valid()) {
+ rpc::ValidationReport report("policy_table");
+ table.ReportErrors(&report);
+ LOG4CXX_FATAL(logger_,
+ "Parsed table is not valid " << rpc::PrettyFormat(report));
+ return false;
+ }
+
+ return true;
+}
+
+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);
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ policy_table::ApplicationPolicies::iterator 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) {
+ uint32_t hash = 5381U;
+ std::string::const_iterator it = str_to_hash.begin();
+ std::string::const_iterator it_end = str_to_hash.end();
+
+ for (; it != it_end; ++it) {
+ hash = ((hash << 5) + hash) + (*it);
+ }
+
+ // Reset sign bit in case it has been set.
+ // This is needed to avoid overflow for signed int.
+ const int32_t result = hash & 0x7FFFFFFF;
+ 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();
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (kDeviceId == policy_app_id) {
+ LOG4CXX_DEBUG(logger_,
+ "Request types not applicable for app_id " << kDeviceId);
+ return;
+ }
+ policy_table::ApplicationPolicies::iterator policy_iter =
+ pt_->policy_table.app_policies_section.apps.find(policy_app_id);
+ if (pt_->policy_table.app_policies_section.apps.end() == policy_iter) {
+ LOG4CXX_DEBUG(logger_,
+ "Can't find request 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;
+}
+
+std::string CacheManager::GetCertificate() const {
+ CACHE_MANAGER_CHECK(std::string(""));
+ sync_primitives::AutoLock auto_lock(cache_lock_);
+ if (pt_->policy_table.module_config.certificate.is_initialized()) {
+ return *pt_->policy_table.module_config.certificate;
+ }
+ return std::string("");
+}
+
+bool CacheManager::MergePreloadPT(const std::string& file_name) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::Table table;
+ if (!LoadFromFile(file_name, table)) {
+ LOG4CXX_DEBUG(logger_, "Unable to load preloaded PT.");
+ return false;
+ }
+
+ sync_primitives::AutoLock lock(cache_lock_);
+ policy_table::PolicyTable& current = pt_->policy_table;
+ policy_table::PolicyTable& new_table = table.policy_table;
+ const std::string date_current = *current.module_config.preloaded_date;
+ const std::string date_new = *new_table.module_config.preloaded_date;
+ if (date_current != date_new) {
+ MergeMC(new_table, current);
+ MergeFG(new_table, current);
+ MergeAP(new_table, current);
+ MergeCFM(new_table, current);
+ Backup();
+ }
+ return true;
+}
+
+void CacheManager::MergeMC(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::ModuleConfig copy(pt.module_config);
+
+ pt.module_config = new_pt.module_config;
+ pt.module_config.vehicle_make = copy.vehicle_make;
+ pt.module_config.vehicle_year = copy.vehicle_year;
+ pt.module_config.vehicle_model = copy.vehicle_model;
+}
+
+void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::FunctionalGroupings::const_iterator it =
+ new_pt.functional_groupings.begin();
+
+ for (; it != new_pt.functional_groupings.end(); ++it) {
+ LOG4CXX_DEBUG(logger_, "Merge functional group: " << it->first);
+ pt.functional_groupings[it->first] = it->second;
+ }
+}
+
+void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>(
+ new_pt).app_policies_section.device;
+
+ pt.app_policies_section.apps[kDefaultId] =
+ const_cast<policy_table::PolicyTable&>(new_pt)
+ .app_policies_section.apps[kDefaultId];
+
+ pt.app_policies_section.apps[kPreDataConsentId] =
+ const_cast<policy_table::PolicyTable&>(new_pt)
+ .app_policies_section.apps[kPreDataConsentId];
+}
+
+void CacheManager::MergeCFM(const policy_table::PolicyTable& new_pt,
+ policy_table::PolicyTable& pt) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (new_pt.consumer_friendly_messages.is_initialized()) {
+ if (!pt.consumer_friendly_messages.is_initialized()) {
+ pt.consumer_friendly_messages = new_pt.consumer_friendly_messages;
+ } else {
+ policy_table::Messages::const_iterator it =
+ new_pt.consumer_friendly_messages->messages->begin();
+
+ pt.consumer_friendly_messages->version =
+ new_pt.consumer_friendly_messages->version;
+ for (; it != new_pt.consumer_friendly_messages->messages->end(); ++it) {
+ LOG4CXX_DEBUG(logger_, "Merge CFM: " << it->first);
+ if (!(pt.consumer_friendly_messages->messages.is_initialized())) {
+ LOG4CXX_DEBUG(logger_, "CFM not initialized.");
+ }
+ (*pt.consumer_friendly_messages->messages)[it->first] = it->second;
+ }
+ }
+ }
+}
+
+const PolicySettings& CacheManager::get_settings() const {
+ DCHECK(settings_);
+
+ return *settings_;
+}
+
+void CacheManager::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_INFO(logger_, "Implementation does not support user consents.");
+}
+
+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_) {
+ {
+ sync_primitives::AutoUnlock unlock(need_backup_lock_);
+ InternalBackup();
+ }
+ 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/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc
new file mode 100644
index 0000000000..782a65f91a
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_helper.cc
@@ -0,0 +1,817 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <sstream>
+#include <string.h>
+#include "utils/logger.h"
+#include "utils/custom_string.h"
+#include "policy/policy_helper.h"
+#include "policy/policy_manager_impl.h"
+
+namespace policy {
+
+namespace custom_str = utils::custom_string;
+
+namespace {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+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) {}
+
+bool CompareGroupName::operator()(
+ const StringsValueType& group_name_to_compare) const {
+ const std::string gn_ = group_name_;
+ const std::string gn_compare = group_name_to_compare;
+ return !(strcasecmp(gn_.c_str(), gn_compare.c_str()));
+}
+
+bool operator!=(const policy_table::ApplicationParams& first,
+ const policy_table::ApplicationParams& second) {
+ if (first.groups.size() != second.groups.size()) {
+ return true;
+ }
+ StringsConstItr it_first = first.groups.begin();
+ StringsConstItr it_first_end = first.groups.end();
+ StringsConstItr it_second = second.groups.begin();
+ StringsConstItr it_second_end = second.groups.end();
+ for (; it_first != it_first_end; ++it_first) {
+ CompareGroupName gp(*it_first);
+ StringsConstItr it = std::find_if(it_second, it_second_end, gp);
+ if (it_first_end == it) {
+ return true;
+ }
+ }
+ return false;
+}
+
+CheckAppPolicy::CheckAppPolicy(
+ PolicyManagerImpl* pm,
+ const utils::SharedPtr<policy_table::Table> update,
+ const utils::SharedPtr<policy_table::Table> snapshot)
+ : pm_(pm), update_(update), snapshot_(snapshot) {}
+
+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);
+
+ 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);
+
+ 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 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);
+
+ if (new_groups) {
+ *new_groups = new_group_list;
+ }
+
+ 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;
+ }
+
+ 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;
+ }
+ }
+
+ return false;
+}
+
+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>();
+ }
+
+ 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 revoked_groups_permissions;
+}
+
+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_section.apps;
+
+ return !(current_policies.end() == current_policies.find(application_id));
+}
+
+void policy::CheckAppPolicy::NotifySystem(
+ const policy::AppPoliciesValueType& app_policy) const {
+ pm_->listener()->OnPendingPermissionChange(app_policy.first);
+}
+
+void CheckAppPolicy::SendPermissionsToApp(
+ const std::string& app_id, const policy_table::Strings& groups) const {
+ 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_id);
+ return;
+ }
+ std::vector<FunctionalGroupPermission> group_permissons;
+ pm_->GetPermissionsForApp(device_id, app_id, group_permissons);
+
+ Permissions notification_data;
+ pm_->PrepareNotificationData(update_->policy_table.functional_groupings,
+ groups,
+ group_permissons,
+ notification_data);
+
+ 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);
+}
+
+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 AppPoliciesValueType& app_policy) const {
+ const std::string& app_id = app_policy.first;
+ const custom_str::CustomString app_name = pm_->listener()->GetAppName(app_id);
+ if (!app_name.empty() && app_policy.second.nicknames &&
+ !app_policy.second.nicknames->empty()) {
+ for (policy_table::Strings::const_iterator it =
+ app_policy.second.nicknames->begin();
+ app_policy.second.nicknames->end() != it;
+ ++it) {
+ std::string temp = *it;
+ if (app_name.CompareIgnoreCase(temp.c_str())) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
+bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
+ const std::string app_id = app_policy.first;
+
+ if (!IsKnownAppication(app_id)) {
+ LOG4CXX_WARN(logger_,
+ "Application:" << app_id << " is not present in snapshot.");
+ return true;
+ }
+
+ if (!IsPredefinedApp(app_policy) && IsAppRevoked(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_APP_REVOKED);
+ NotifySystem(app_policy);
+ return true;
+ }
+
+ if (!IsPredefinedApp(app_policy) && !NicknamesMatch(app_policy)) {
+ SetPendingPermissions(app_policy, RESULT_NICKNAME_MISMATCH);
+ NotifySystem(app_policy);
+ return true;
+ }
+
+ 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;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "Permissions for application:" << app_id
+ << " have been changed.");
+
+ if (IsPredefinedApp(app_policy)) {
+ for (const policy_table::ApplicationPolicies::value_type& app :
+ snapshot_->policy_table.app_policies_section.apps) {
+ if (app_policy.first == app.second.get_string()) {
+ if (RESULT_CONSENT_NOT_REQIURED != result) {
+ SetPendingPermissions(app, result);
+ NotifySystem(app);
+ }
+ SendPermissionsToApp(app.first, app_policy.second.groups);
+ }
+ }
+ return true;
+ }
+
+ 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)) {
+ SendPermissionsToApp(app_policy.first, app_policy.second.groups);
+ }
+ return true;
+}
+
+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;
+ }
+
+ 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,
+ GroupConsent group_state,
+ GroupConsent undefined_group_consent)
+ : data_(data) {
+ switch (group_state) {
+ case kGroupAllowed:
+ current_key_ = kAllowedKey;
+ break;
+ case kGroupUndefined:
+ if (kGroupUndefined == undefined_group_consent) {
+ current_key_ = kUndefinedKey;
+ break;
+ }
+ current_key_ = kGroupAllowed == undefined_group_consent
+ ? kAllowedKey
+ : kUserDisallowedKey;
+ break;
+ default:
+ current_key_ = kUserDisallowedKey;
+ break;
+ }
+}
+
+bool FillNotificationData::operator()(const RpcValueType& rpc) {
+ Permissions::iterator it = data_.find(rpc.first);
+ // If rpc is present already - update its permissions
+ if (data_.end() != it) {
+ UpdateHMILevels(rpc.second.hmi_levels,
+ (*it).second.hmi_permissions[current_key_]);
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ UpdateParameters(*rpc.second.parameters,
+ (*it).second.parameter_permissions[current_key_]);
+ ExcludeSame();
+ } else {
+ // Init mandatory keys, since they should be present irrespectively of
+ // values presence
+ InitRpcKeys(rpc.first);
+ // If rpc is not present - add its permissions
+ UpdateHMILevels(rpc.second.hmi_levels,
+ data_[rpc.first].hmi_permissions[current_key_]);
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ UpdateParameters(*rpc.second.parameters,
+ data_[rpc.first].parameter_permissions[current_key_]);
+ ExcludeSame();
+ }
+ return true;
+}
+
+void FillNotificationData::UpdateHMILevels(
+ const policy_table::HmiLevels& in_hmi, std::set<HMILevel>& out_hmi) {
+ HMILevelsConstItr it_hmi_levels = in_hmi.begin();
+ HMILevelsConstItr it_hmi_levels_end = in_hmi.end();
+
+ for (; it_hmi_levels != it_hmi_levels_end; ++it_hmi_levels) {
+ out_hmi.insert(policy_table::EnumToJsonString(*it_hmi_levels));
+ }
+}
+
+void FillNotificationData::UpdateParameters(
+ const policy_table::Parameters& in_parameters,
+ std::set<Parameter>& out_parameter) {
+ ParametersConstItr it_parameters = in_parameters.begin();
+ ParametersConstItr it_parameters_end = in_parameters.end();
+
+ for (; it_parameters != it_parameters_end; ++it_parameters) {
+ out_parameter.insert(policy_table::EnumToJsonString(*it_parameters));
+ }
+}
+
+void FillNotificationData::ExcludeSame() {
+ Permissions::iterator it = data_.begin();
+ Permissions::const_iterator it_end = data_.end();
+ // Groups
+ for (; it != it_end; ++it) {
+ HMIPermissions& rpc_hmi_permissions = (*it).second.hmi_permissions;
+ HMIPermissions::const_iterator it_hmi_allowed =
+ (*it).second.hmi_permissions.find(kAllowedKey);
+ HMIPermissions::const_iterator it_hmi_undefined =
+ (*it).second.hmi_permissions.find(kUndefinedKey);
+ HMIPermissions::const_iterator it_hmi_user_disallowed =
+ (*it).second.hmi_permissions.find(kUserDisallowedKey);
+
+ ParameterPermissions& rpc_parameter_permissions =
+ (*it).second.parameter_permissions;
+ ParameterPermissions::const_iterator it_parameter_allowed =
+ (*it).second.parameter_permissions.find(kAllowedKey);
+ ParameterPermissions::const_iterator it_parameter_undefined =
+ (*it).second.parameter_permissions.find(kUndefinedKey);
+ ParameterPermissions::const_iterator it_parameter_user_disallowed =
+ (*it).second.parameter_permissions.find(kUserDisallowedKey);
+
+ // First, remove disallowed from other types
+ if (rpc_hmi_permissions.end() != it_hmi_user_disallowed) {
+ if (rpc_hmi_permissions.end() != it_hmi_allowed) {
+ ExcludeSameHMILevels(rpc_hmi_permissions[kAllowedKey],
+ rpc_hmi_permissions[kUserDisallowedKey]);
+ }
+ if (rpc_hmi_permissions.end() != it_hmi_undefined) {
+ ExcludeSameHMILevels(rpc_hmi_permissions[kUndefinedKey],
+ rpc_hmi_permissions[kUserDisallowedKey]);
+ }
+ }
+
+ if (rpc_parameter_permissions.end() != it_parameter_user_disallowed) {
+ if (rpc_parameter_permissions.end() != it_parameter_allowed) {
+ ExcludeSameParameters(rpc_parameter_permissions[kAllowedKey],
+ rpc_parameter_permissions[kUserDisallowedKey]);
+ }
+ if (rpc_parameter_permissions.end() != it_parameter_undefined) {
+ ExcludeSameParameters(rpc_parameter_permissions[kUndefinedKey],
+ rpc_parameter_permissions[kUserDisallowedKey]);
+ }
+ }
+
+ // Then, remove undefined from allowed
+ if (rpc_hmi_permissions.end() != it_hmi_undefined) {
+ if (rpc_hmi_permissions.end() != it_hmi_allowed) {
+ ExcludeSameHMILevels(rpc_hmi_permissions[kAllowedKey],
+ rpc_hmi_permissions[kUndefinedKey]);
+ }
+ }
+
+ if (rpc_parameter_permissions.end() != it_parameter_undefined) {
+ if (rpc_parameter_permissions.end() != it_parameter_allowed) {
+ ExcludeSameParameters(rpc_parameter_permissions[kAllowedKey],
+ rpc_parameter_permissions[kUndefinedKey]);
+ }
+ }
+ }
+}
+
+void FillNotificationData::ExcludeSameHMILevels(
+ std::set<HMILevel>& source, const std::set<HMILevel>& target) {
+ std::set<HMILevel> diff_hmi;
+
+ std::set_difference(source.begin(),
+ source.end(),
+ target.begin(),
+ target.end(),
+ std::inserter(diff_hmi, diff_hmi.begin()));
+
+ source = diff_hmi;
+}
+
+void FillNotificationData::ExcludeSameParameters(
+ std::set<Parameter>& source, const std::set<Parameter>& target) {
+ std::set<Parameter> diff_parameter;
+
+ std::set_difference(source.begin(),
+ source.end(),
+ target.begin(),
+ target.end(),
+ std::inserter(diff_parameter, diff_parameter.begin()));
+
+ source = diff_parameter;
+}
+
+void FillNotificationData::InitRpcKeys(const std::string& rpc_name) {
+ data_[rpc_name].hmi_permissions[kAllowedKey];
+ data_[rpc_name].hmi_permissions[kUserDisallowedKey];
+ data_[rpc_name].parameter_permissions[kAllowedKey];
+ data_[rpc_name].parameter_permissions[kUserDisallowedKey];
+}
+
+ProcessFunctionalGroup::ProcessFunctionalGroup(
+ const policy_table::FunctionalGroupings& fg,
+ const std::vector<FunctionalGroupPermission>& group_permissions,
+ Permissions& data,
+ GroupConsent undefined_group_consent)
+ : fg_(fg)
+ , group_permissions_(group_permissions)
+ , data_(data)
+ , undefined_group_consent_(undefined_group_consent) {}
+
+bool ProcessFunctionalGroup::operator()(const StringsValueType& group_name) {
+ const std::string group_name_str = group_name;
+ FuncGroupConstItr it = fg_.find(group_name_str);
+
+ if (fg_.end() != it) {
+ const policy_table::Rpc& rpcs = (*it).second.rpcs;
+ FillNotificationData filler(
+ data_, GetGroupState(group_name_str), undefined_group_consent_);
+ std::for_each(rpcs.begin(), rpcs.end(), filler);
+ }
+ return true;
+}
+
+GroupConsent ProcessFunctionalGroup::GetGroupState(
+ const std::string& group_name) {
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ group_permissions_.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ group_permissions_.end();
+ for (; it != it_end; ++it) {
+ if (group_name == (*it).group_name) {
+ return (*it).state;
+ }
+ }
+ return kGroupUndefined;
+}
+
+FunctionalGroupInserter::FunctionalGroupInserter(
+ const policy_table::Strings& preconsented_groups, PermissionsList& list)
+ : list_(list), preconsented_(preconsented_groups) {}
+
+void FunctionalGroupInserter::operator()(const StringsValueType& group_name) {
+ CompareGroupName name(group_name);
+ if (std::find_if(preconsented_.begin(), preconsented_.end(), name) ==
+ preconsented_.end()) {
+ list_.push_back(group_name);
+ }
+}
+
+void FillFunctionalGroupPermissions(
+ FunctionalGroupIDs& ids,
+ FunctionalGroupNames& names,
+ GroupConsent state,
+ std::vector<FunctionalGroupPermission>& permissions) {
+ LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
+ FunctionalGroupIDs::const_iterator it = ids.begin();
+ FunctionalGroupIDs::const_iterator it_end = ids.end();
+ for (; it != it_end; ++it) {
+ FunctionalGroupPermission current_group;
+ current_group.group_id = *it;
+ current_group.group_alias = names[*it].first;
+ current_group.group_name = names[*it].second;
+ current_group.state = state;
+ permissions.push_back(current_group);
+ }
+}
+
+bool IsPredefinedApp(const AppPoliciesValueType& app) {
+ return app.first == kDefaultId || app.first == kPreDataConsentId ||
+ app.first == kDeviceId;
+}
+
+FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
+ const FunctionalGroupIDs& what) {
+ LOG4CXX_INFO(logger_, "Exclude same groups");
+ FunctionalGroupIDs from_copy(from);
+ FunctionalGroupIDs what_copy(what);
+
+ std::sort(from_copy.begin(), from_copy.end());
+ std::sort(what_copy.begin(), what_copy.end());
+
+ FunctionalGroupIDs no_same;
+ std::set_difference(from_copy.begin(),
+ from_copy.end(),
+ what_copy.begin(),
+ what_copy.end(),
+ std::back_inserter(no_same));
+
+ no_same.resize(std::distance(no_same.begin(),
+ std::unique(no_same.begin(), no_same.end())));
+
+ return no_same;
+}
+
+FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second) {
+ LOG4CXX_INFO(logger_, "Merge groups");
+ FunctionalGroupIDs first_copy(first);
+ FunctionalGroupIDs second_copy(second);
+
+ std::sort(first_copy.begin(), first_copy.end());
+ std::sort(second_copy.begin(), second_copy.end());
+
+ FunctionalGroupIDs merged;
+ std::set_union(first_copy.begin(),
+ first_copy.end(),
+ second_copy.begin(),
+ second_copy.end(),
+ std::back_inserter(merged));
+
+ merged.resize(
+ std::distance(merged.begin(), std::unique(merged.begin(), merged.end())));
+
+ return merged;
+}
+
+FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
+ const FunctionalGroupIDs& second) {
+ LOG4CXX_INFO(logger_, "Find same groups");
+ FunctionalGroupIDs first_copy(first);
+ FunctionalGroupIDs second_copy(second);
+
+ std::sort(first_copy.begin(), first_copy.end());
+ std::sort(second_copy.begin(), second_copy.end());
+
+ FunctionalGroupIDs same;
+ std::set_intersection(first_copy.begin(),
+ first_copy.end(),
+ second_copy.begin(),
+ second_copy.end(),
+ std::back_inserter(same));
+
+ same.resize(
+ std::distance(same.begin(), std::unique(same.begin(), same.end())));
+
+ return same;
+}
+
+bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) {
+ policy_table::ApplicationPolicies::iterator it = app_policies.begin();
+ policy_table::ApplicationPolicies::iterator it_default =
+ app_policies.find(kDefaultId);
+ for (; app_policies.end() != it; ++it) {
+ // Set default policies for app, if there is record like "123":"default"
+ if (kDefaultId.compare((*it).second.get_string()) == 0) {
+ if (it != app_policies.end()) {
+ (*it).second = (*it_default).second;
+ it->second.set_to_string(kDefaultId);
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "There is no default application policy was "
+ "found in PTU.");
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+}
diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc
new file mode 100644
index 0000000000..055b57d985
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc
@@ -0,0 +1,1279 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "policy/policy_manager_impl.h"
+
+#include <algorithm>
+#include <set>
+#include <queue>
+#include <iterator>
+#include <limits>
+#include "json/reader.h"
+#include "json/writer.h"
+#include "policy/policy_table.h"
+#include "policy/pt_representation.h"
+#include "policy/policy_helper.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+#include "utils/date_time.h"
+#include "utils/make_shared.h"
+#include "policy/cache_manager.h"
+#include "policy/update_status_manager.h"
+#include "config_profile/profile.h"
+#include "utils/timer_task_impl.h"
+#include "utils/make_shared.h"
+
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/access_remote.h"
+#include "policy/access_remote_impl.h"
+#endif // SDL_REMOTE_CONTROL
+
+policy::PolicyManager* CreateManager() {
+ return new policy::PolicyManagerImpl();
+}
+void DeleteManager(policy::PolicyManager* pm) {
+ delete pm;
+}
+
+namespace {
+const uint32_t kDefaultRetryTimeoutInMSec =
+ 60u * date_time::DateTime::MILLISECONDS_IN_SECOND;
+} // namespace
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+PolicyManagerImpl::PolicyManagerImpl()
+ : PolicyManager()
+ , listener_(NULL)
+ , cache_(new CacheManager)
+#ifdef SDL_REMOTE_CONTROL
+ , access_remote_(new AccessRemoteImpl(
+ CacheManagerInterfaceSPtr::static_pointer_cast<CacheManager>(cache_)))
+#endif // SDL_REMOTE_CONTROL
+ , retry_sequence_timeout_(kDefaultRetryTimeoutInMSec)
+ , retry_sequence_index_(0)
+ , timer_retry_sequence_("Retry sequence timer",
+ new timer::TimerTaskImpl<PolicyManagerImpl>(
+ this, &PolicyManagerImpl::RetrySequence))
+ , ignition_check(true)
+ , retry_sequence_url_(0, 0, "")
+ , wrong_ptu_update_received_(false)
+ , send_on_update_sent_out_(false)
+ , trigger_ptu_(false) {
+}
+
+void PolicyManagerImpl::set_listener(PolicyListener* listener) {
+ listener_ = listener;
+ update_status_manager_.set_listener(listener);
+}
+
+#ifdef USE_HMI_PTU_DECRYPTION
+
+utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
+ const BinaryMessage& pt_content) {
+ std::string json(pt_content.begin(), pt_content.end());
+ Json::Value value;
+ Json::Reader reader;
+ if (reader.parse(json.c_str(), value)) {
+ return new policy_table::Table(&value);
+ } 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"];
+ 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_days
+ << "\nIgnition cycles exceeded: " << std::boolalpha
+ << exceed_ignition_cycles);
+
+ if (exceed_ignition_cycles || exceed_days) {
+ update_status_manager_.ScheduleUpdate();
+ }
+}
+
+bool PolicyManagerImpl::LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) {
+ LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
+
+#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();
+ return false;
+ }
+
+ file_system::DeleteFile(file);
+
+ if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
+ wrong_ptu_update_received_ = true;
+ update_status_manager_.OnWrongUpdateReceived();
+ return false;
+ }
+
+ update_status_manager_.OnValidUpdateReceived();
+ cache_->SaveUpdateRequired(false);
+
+ // Update finished, no need retry
+ if (timer_retry_sequence_.is_running()) {
+ LOG4CXX_INFO(logger_, "Stop retry sequence");
+ timer_retry_sequence_.Stop();
+ }
+
+ {
+ sync_primitives::AutoLock lock(apps_registration_lock_);
+
+ // Get current DB data, since it could be updated during awaiting of PTU
+ utils::SharedPtr<policy_table::Table> policy_table_snapshot =
+ cache_->GenerateSnapshot();
+ if (!policy_table_snapshot) {
+ LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
+ return false;
+ }
+
+ // 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;
+ }
+
+ if (pt_update->policy_table.module_config.certificate.is_initialized()) {
+ listener_->OnCertificateUpdated(
+ *(pt_update->policy_table.module_config.certificate));
+ }
+
+ 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_, "app_hmi_types empty" << pt_content.size());
+ }
+ }
+
+ // 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;
+}
+
+void PolicyManagerImpl::CheckPermissionsChanges(
+ const utils::SharedPtr<policy_table::Table> pt_update,
+ const utils::SharedPtr<policy_table::Table> snapshot) {
+ LOG4CXX_INFO(logger_, "Checking incoming permissions.");
+
+ // 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));
+}
+
+void PolicyManagerImpl::PrepareNotificationData(
+ const policy_table::FunctionalGroupings& groups,
+ const policy_table::Strings& group_names,
+ const std::vector<FunctionalGroupPermission>& group_permission,
+ Permissions& notification_data) {
+ LOG4CXX_INFO(logger_, "Preparing data for notification.");
+ ProcessFunctionalGroup processor(groups, group_permission, notification_data);
+ std::for_each(group_names.begin(), group_names.end(), processor);
+}
+
+void PolicyManagerImpl::GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->GetUpdateUrls(service_type, out_end_points);
+}
+void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->GetUpdateUrls(service_type, out_end_points);
+}
+
+bool 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 false;
+ }
+
+ IsPTValid(policy_table_snapshot, policy_table::PT_SNAPSHOT);
+
+ Json::Value value = policy_table_snapshot->ToJsonValue();
+ Json::FastWriter writer;
+ std::string message_string = writer.write(value);
+
+ LOG4CXX_DEBUG(logger_, "Snapshot contents is : " << message_string);
+
+ BinaryMessage update(message_string.begin(), message_string.end());
+
+ listener_->OnSnapshotCreated(update);
+ return true;
+}
+
+std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
+ return cache_->GetLockScreenIconUrl();
+}
+
+void PolicyManagerImpl::StartPTExchange() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const bool update_required = update_status_manager_.IsUpdateRequired();
+
+ if (update_status_manager_.IsAppsSearchInProgress() && update_required) {
+ update_status_manager_.ScheduleUpdate();
+ LOG4CXX_INFO(logger_,
+ "Starting exchange skipped, since applications "
+ "search is in progress.");
+ return;
+ }
+
+ if (update_status_manager_.IsUpdatePending() && update_required) {
+ if (trigger_ptu_)
+ update_status_manager_.ScheduleUpdate();
+ LOG4CXX_INFO(logger_,
+ "Starting exchange skipped, since another exchange "
+ "is in progress.");
+ return;
+ }
+
+ if (listener_ && listener_->CanUpdate()) {
+ if (ignition_check) {
+ CheckTriggers();
+ ignition_check = false;
+ }
+
+ if (update_status_manager_.IsUpdateRequired()) {
+ if (RequestPTUpdate() && !timer_retry_sequence_.is_running()) {
+ // Start retry sequency
+ const uint32_t timeout_msec = NextRetryTimeout();
+
+ if (timeout_msec) {
+ LOG4CXX_DEBUG(logger_,
+ "Start retry sequence timeout = " << timeout_msec);
+ timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic);
+ }
+ }
+ }
+ }
+}
+
+void PolicyManagerImpl::OnAppsSearchStarted() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_manager_.OnAppsSearchStarted();
+}
+
+void PolicyManagerImpl::OnAppsSearchCompleted(const bool trigger_ptu) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ update_status_manager_.OnAppsSearchCompleted();
+
+ trigger_ptu_ = trigger_ptu;
+
+ if (update_status_manager_.IsUpdateRequired()) {
+ StartPTExchange();
+ }
+}
+
+void PolicyManagerImpl::OnAppRegisteredOnMobile(
+ const std::string& application_id) {
+ StartPTExchange();
+ SendNotificationOnPermissionsUpdated(application_id);
+}
+
+void PolicyManagerImpl::OnDeviceSwitching(const std::string& device_id_from,
+ const std::string& device_id_to) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->OnDeviceSwitching(device_id_from, device_id_to);
+}
+
+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;
+}
+
+const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
+ return cache_->GetVehicleInfo();
+}
+
+void PolicyManagerImpl::CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (!cache_->IsApplicationRepresented(app_id)) {
+ LOG4CXX_WARN(logger_, "Application " << app_id << " isn't exist");
+ return;
+ }
+
+ LOG4CXX_INFO(logger_,
+ "CheckPermissions for " << app_id << " and rpc " << rpc
+ << " for " << hmi_level << " level.");
+
+#ifdef SDL_REMOTE_CONTROL
+ ApplicationOnDevice who = {device_id, app_id};
+ const policy_table::Strings& groups = access_remote_->GetGroups(who);
+#else // SDL_REMOTE_CONTROL
+ const policy_table::Strings& groups = cache_->GetGroups(app_id);
+#endif // SDL_REMOTE_CONTROL
+
+ cache_->CheckPermissions(groups, hmi_level, rpc, result);
+ if (cache_->IsApplicationRevoked(app_id)) {
+ // SDL must be able to notify mobile side with its status after app has
+ // been revoked by backend
+ if ("OnHMIStatus" == rpc && "NONE" == hmi_level) {
+ result.hmi_level_permitted = kRpcAllowed;
+ } else {
+ result.hmi_level_permitted = kRpcDisallowed;
+ }
+ }
+}
+
+bool PolicyManagerImpl::ResetUserConsent() {
+ return cache_->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 "
+ "'" << application_id << "'");
+ return;
+ }
+
+ std::vector<FunctionalGroupPermission> app_group_permissions;
+ GetPermissionsForApp(device_id, application_id, app_group_permissions);
+
+ policy_table::FunctionalGroupings functional_groupings;
+ cache_->GetFunctionalGroupings(functional_groupings);
+
+ policy_table::Strings app_groups;
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ app_group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ app_group_permissions.end();
+ for (; it != it_end; ++it) {
+ app_groups.push_back((*it).group_name);
+ }
+
+ Permissions notification_data;
+ PrepareNotificationData(functional_groupings,
+ app_groups,
+ app_group_permissions,
+ notification_data);
+
+ LOG4CXX_INFO(logger_,
+ "Send notification for application_id:" << application_id);
+
+ std::string default_hmi;
+ default_hmi = "NONE";
+
+#ifdef SDL_REMOTE_CONTROL
+ const ApplicationOnDevice who = {device_id, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+ return;
+ }
+#endif // SDL_REMOTE_CONTROL
+
+ listener()->OnPermissionsUpdated(
+ application_id, notification_data, default_hmi);
+}
+
+bool PolicyManagerImpl::CleanupUnpairedDevices() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ // For SDL-specific it doesn't matter
+ return true;
+}
+
+DeviceConsent PolicyManagerImpl::GetUserConsentForDevice(
+ const std::string& device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return kDeviceAllowed;
+}
+
+void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id,
+ bool is_allowed) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device :" << device_id);
+ DeviceConsent current_consent = GetUserConsentForDevice(device_id);
+ bool is_current_device_allowed =
+ DeviceConsent::kDeviceAllowed == current_consent ? true : false;
+ if (DeviceConsent::kDeviceHasNoConsent != current_consent &&
+ is_current_device_allowed == is_allowed) {
+ const std::string consent = is_allowed ? "allowed" : "disallowed";
+ LOG4CXX_INFO(logger_, "Device is already " << consent << ".");
+ return;
+ }
+}
+
+bool PolicyManagerImpl::ReactOnUserDevConsentForApp(const std::string app_id,
+ bool is_device_allowed) {
+ return true;
+}
+
+bool PolicyManagerImpl::GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames,
+ StringArray* app_hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const bool result = nicknames && app_hmi_types;
+ if (result) {
+ cache_->GetInitialAppData(application_id, *nicknames, *app_hmi_types);
+ }
+ return result;
+}
+
+void PolicyManagerImpl::AddDevice(const std::string& device_id,
+ const std::string& connection_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device: " << device_id);
+ if (!cache_->AddDevice(device_id, connection_type)) {
+ LOG4CXX_WARN(logger_, "Can't add device.");
+ }
+}
+
+void PolicyManagerImpl::SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Device :" << device_id);
+}
+
+PermissionConsent PolicyManagerImpl::EnsureCorrectPermissionConsent(
+ const PermissionConsent& permissions_to_check) {
+ std::vector<FunctionalGroupPermission> current_user_consents;
+ GetUserConsentForApp(permissions_to_check.device_id,
+ permissions_to_check.policy_app_id,
+ current_user_consents);
+
+ PermissionConsent permissions_to_set;
+ permissions_to_set.device_id = permissions_to_check.device_id;
+ permissions_to_set.policy_app_id = permissions_to_check.policy_app_id;
+ permissions_to_set.consent_source = permissions_to_check.consent_source;
+
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ permissions_to_check.group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ permissions_to_check.group_permissions.end();
+
+ for (; it != it_end; ++it) {
+ std::vector<FunctionalGroupPermission>::const_iterator it_curr =
+ current_user_consents.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_curr_end =
+ current_user_consents.end();
+
+ for (; it_curr != it_curr_end; ++it_curr) {
+ if (it->group_alias == it_curr->group_alias &&
+ it->group_id == it_curr->group_id) {
+ permissions_to_set.group_permissions.push_back(*it);
+ }
+ }
+ }
+
+ return permissions_to_set;
+}
+
+void PolicyManagerImpl::CheckPendingPermissionsChanges(
+ const std::string& policy_app_id,
+ const std::vector<FunctionalGroupPermission>& current_permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ 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_AUTO_TRACE(logger_);
+}
+
+bool PolicyManagerImpl::GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string device_id = GetCurrentDeviceId(policy_app_id);
+ DeviceConsent device_consent = GetUserConsentForDevice(device_id);
+ const std::string app_id = policy::kDeviceAllowed != device_consent
+ ? kPreDataConsentId
+ : policy_app_id;
+ return cache_->GetDefaultHMI(app_id, *default_hmi);
+}
+
+bool PolicyManagerImpl::GetPriority(const std::string& policy_app_id,
+ std::string* priority) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!priority) {
+ LOG4CXX_WARN(logger_, "Input priority parameter is null.");
+ return false;
+ }
+
+ return cache_->GetPriority(policy_app_id, *priority);
+}
+
+std::vector<UserFriendlyMessage> PolicyManagerImpl::GetUserFriendlyMessages(
+ const std::vector<std::string>& message_code, const std::string& language) {
+ return cache_->GetUserFriendlyMsg(message_code, language);
+}
+
+void PolicyManagerImpl::GetUserConsentForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ FunctionalIdType group_types;
+ if (!cache_->GetPermissionsForApp(device_id, policy_app_id, group_types)) {
+ LOG4CXX_WARN(logger_,
+ "Can't get user permissions for app " << policy_app_id);
+ return;
+ }
+
+ // Functional groups w/o alias ("user_consent_prompt") considered as
+ // automatically allowed and it could not be changed by user
+ FunctionalGroupNames group_names;
+ if (!cache_->GetFunctionalGroupNames(group_names)) {
+ LOG4CXX_WARN(logger_, "Can't get functional group names");
+ return;
+ }
+
+ FunctionalGroupNames::const_iterator it = group_names.begin();
+ FunctionalGroupNames::const_iterator it_end = group_names.end();
+ FunctionalGroupIDs auto_allowed_groups;
+ for (; it != it_end; ++it) {
+ if (it->second.first.empty()) {
+ auto_allowed_groups.push_back(it->first);
+ }
+ }
+
+ // For basic policy
+ FunctionalGroupIDs all_groups = group_types[kTypeGeneral];
+ FunctionalGroupIDs default_groups = group_types[kTypeDefault];
+ FunctionalGroupIDs predataconsented_groups =
+ group_types[kTypePreDataConsented];
+
+ FunctionalGroupIDs allowed_groups;
+ FunctionalGroupIDs no_auto = ExcludeSame(all_groups, auto_allowed_groups);
+
+ if (cache_->IsDefaultPolicy(policy_app_id)) {
+ allowed_groups = ExcludeSame(no_auto, default_groups);
+ } else if (cache_->IsPredataPolicy(policy_app_id)) {
+ allowed_groups = ExcludeSame(no_auto, predataconsented_groups);
+ }
+ FillFunctionalGroupPermissions(
+ allowed_groups, group_names, kGroupAllowed, permissions);
+}
+
+void PolicyManagerImpl::GetPermissionsForApp(
+ const std::string& device_id,
+ const std::string& policy_app_id,
+ std::vector<FunctionalGroupPermission>& permissions) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string app_id_to_check = policy_app_id;
+
+ bool allowed_by_default = false;
+ if (cache_->IsDefaultPolicy(policy_app_id)) {
+ app_id_to_check = kDefaultId;
+ allowed_by_default = true;
+ } else if (cache_->IsPredataPolicy(policy_app_id) ||
+ policy::kDeviceDisallowed == GetUserConsentForDevice(device_id)) {
+ app_id_to_check = kPreDataConsentId;
+ allowed_by_default = true;
+ }
+
+ FunctionalIdType group_types;
+#ifdef SDL_REMOTE_CONTROL
+ allowed_by_default = false;
+ bool ret = access_remote_->GetPermissionsForApp(
+ device_id, policy_app_id, group_types);
+#else
+ bool ret =
+ cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types);
+#endif // REMOTE_CONTROL
+
+ if (!ret) {
+ LOG4CXX_WARN(logger_,
+ "Can't get user permissions for app " << policy_app_id);
+ return;
+ }
+
+ // Functional groups w/o alias ("user_consent_prompt") considered as
+ // automatically allowed and it could not be changed by user
+ FunctionalGroupNames group_names;
+ if (!cache_->GetFunctionalGroupNames(group_names)) {
+ LOG4CXX_WARN(logger_, "Can't get functional group names");
+ return;
+ }
+
+ // 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 allowed groups");
+ GroupType type =
+ (kDefaultId == app_id_to_check ? kTypeDefault : kTypePreDataConsented);
+
+ FillFunctionalGroupPermissions(
+ group_types[type], group_names, kGroupAllowed, permissions);
+ } else {
+ // The code bellow allows to process application which
+ // has specific permissions(not default and pre_DataConsent).
+
+ // All groups for specific application
+ FunctionalGroupIDs all_groups = group_types[kTypeGeneral];
+
+ // In case of GENIVI all groups are allowed
+ FunctionalGroupIDs common_allowed = all_groups;
+ FillFunctionalGroupPermissions(
+ common_allowed, group_names, kGroupAllowed, permissions);
+ }
+ return;
+}
+
+std::string& PolicyManagerImpl::GetCurrentDeviceId(
+ const std::string& policy_app_id) const {
+ LOG4CXX_INFO(logger_, "GetDeviceInfo");
+ last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
+ return last_device_id_;
+}
+
+void PolicyManagerImpl::SetSystemLanguage(const std::string& language) {}
+
+void PolicyManagerImpl::SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) {
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+void PolicyManagerImpl::OnSystemReady() {
+ // Update policy table for the first time with system information
+ if (cache_->IsPTPreloaded()) {
+ listener()->OnSystemInfoUpdateRequired();
+ return;
+ }
+}
+
+uint32_t PolicyManagerImpl::GetNotificationsNumber(
+ const std::string& priority) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetNotificationsNumber(priority);
+}
+
+bool PolicyManagerImpl::ExceededIgnitionCycles() {
+ return 0 == cache_->IgnitionCyclesBeforeExchange();
+}
+
+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;
+}
+
+const PolicySettings& PolicyManagerImpl::get_settings() const {
+ DCHECK(settings_);
+ return *settings_;
+}
+
+bool PolicyManagerImpl::ExceededDays() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const int kSecondsInDay = 60 * 60 * 24;
+ const int days = current_time.tv_sec / kSecondsInDay;
+
+ return 0 == cache_->DaysBeforeExchange(days);
+}
+
+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.");
+ update_status_manager_.ScheduleUpdate();
+ StartPTExchange();
+ }
+}
+
+void PolicyManagerImpl::IncrementIgnitionCycles() {
+ cache_->IncrementIgnitionCycles();
+}
+
+std::string PolicyManagerImpl::ForcePTExchange() {
+ update_status_manager_.ScheduleUpdate();
+ StartPTExchange();
+ return update_status_manager_.StringifiedUpdateStatus();
+}
+
+std::string PolicyManagerImpl::ForcePTExchangeAtUserRequest() {
+ update_status_manager_.ScheduleManualUpdate();
+ StartPTExchange();
+ return update_status_manager_.StringifiedUpdateStatus();
+}
+
+std::string PolicyManagerImpl::GetPolicyTableStatus() const {
+ return update_status_manager_.StringifiedUpdateStatus();
+}
+
+uint32_t PolicyManagerImpl::NextRetryTimeout() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ LOG4CXX_DEBUG(logger_, "Index: " << retry_sequence_index_);
+ uint32_t next = 0u;
+ if (retry_sequence_seconds_.empty() ||
+ retry_sequence_index_ > retry_sequence_seconds_.size()) {
+ return next;
+ }
+
+ if (0 == retry_sequence_index_) {
+ ++retry_sequence_index_;
+ // Return miliseconds
+ return retry_sequence_timeout_;
+ }
+
+ for (uint32_t i = 0u; i < retry_sequence_index_; ++i) {
+ next += retry_sequence_seconds_[i] *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+ next += retry_sequence_timeout_;
+ }
+ ++retry_sequence_index_;
+
+ // Return miliseconds
+ return next;
+}
+
+void PolicyManagerImpl::RefreshRetrySequence() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ retry_sequence_timeout_ = cache_->TimeoutResponse();
+ retry_sequence_seconds_.clear();
+ cache_->SecondsBetweenRetries(retry_sequence_seconds_);
+}
+
+void PolicyManagerImpl::ResetRetrySequence() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ retry_sequence_index_ = 0;
+ update_status_manager_.OnResetRetrySequence();
+}
+
+uint32_t PolicyManagerImpl::TimeoutExchangeMSec() {
+ return retry_sequence_timeout_;
+}
+
+const std::vector<int> PolicyManagerImpl::RetrySequenceDelaysSeconds() {
+ sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
+ return retry_sequence_seconds_;
+}
+
+void PolicyManagerImpl::OnExceededTimeout() {
+ update_status_manager_.OnUpdateTimeoutOccurs();
+}
+
+void PolicyManagerImpl::OnUpdateStarted() {
+ update_status_manager_.OnUpdateSentOut();
+ cache_->SaveUpdateRequired(true);
+}
+
+void PolicyManagerImpl::PTUpdatedAt(Counters counter, int value) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ cache_->SetCountersPassedForSuccessfulUpdate(counter, value);
+ cache_->ResetIgnitionCycles();
+}
+
+void PolicyManagerImpl::Increment(usage_statistics::GlobalCounterId type) {
+ LOG4CXX_INFO(logger_, "Increment without app id");
+ cache_->Increment(type);
+}
+
+void PolicyManagerImpl::Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) {
+ LOG4CXX_DEBUG(logger_, "Increment " << app_id << " AppCounter: " << type);
+ cache_->Increment(app_id, type);
+}
+
+void PolicyManagerImpl::Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) {
+ LOG4CXX_INFO(logger_, "Set " << app_id);
+ cache_->Set(app_id, type, value);
+}
+
+void PolicyManagerImpl::Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) {
+ LOG4CXX_INFO(logger_, "Add " << app_id);
+ cache_->Add(app_id, type, timespan_seconds);
+}
+
+bool PolicyManagerImpl::IsApplicationRevoked(const std::string& app_id) const {
+ return cache_->IsApplicationRevoked(app_id);
+}
+
+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& 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) {
+ permissions = app_id_diff->second;
+ } else {
+ permissions.appPermissionsConsentNeeded = IsConsentNeeded(policy_app_id);
+ permissions.appRevoked = IsApplicationRevoked(policy_app_id);
+ GetPriority(permissions.application_id, &permissions.priority);
+ }
+ return permissions;
+}
+
+void PolicyManagerImpl::RemovePendingPermissionChanges(
+ const std::string& app_id) {
+ app_permissions_diff_.erase(app_id);
+}
+
+bool PolicyManagerImpl::CanAppKeepContext(const std::string& app_id) const {
+ return cache_->CanAppKeepContext(app_id);
+}
+
+bool PolicyManagerImpl::CanAppStealFocus(const std::string& app_id) const {
+ return cache_->CanAppStealFocus(app_id);
+}
+
+void PolicyManagerImpl::MarkUnpairedDevice(const std::string& device_id) {}
+
+std::string PolicyManagerImpl::RetrieveCertificate() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetCertificate();
+}
+
+AppIdURL PolicyManagerImpl::GetNextUpdateUrl(const EndpointUrls& urls) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const AppIdURL next_app_url = RetrySequenceUrl(retry_sequence_url_, urls);
+
+ retry_sequence_url_.url_idx_ = next_app_url.second + 1;
+ retry_sequence_url_.app_idx_ = next_app_url.first;
+ retry_sequence_url_.policy_app_id_ = urls[next_app_url.first].app_id;
+
+ return next_app_url;
+}
+
+AppIdURL PolicyManagerImpl::RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const {
+ uint32_t url_idx = rs.url_idx_;
+ uint32_t app_idx = rs.app_idx_;
+ const std::string& app_id = rs.policy_app_id_;
+
+ if (urls.size() <= app_idx) {
+ // Index of current application doesn't exist any more due to app(s)
+ // unregistration
+ url_idx = 0;
+ app_idx = 0;
+ } else if (urls[app_idx].app_id != app_id) {
+ // Index of current application points to another one due to app(s)
+ // registration/unregistration
+ url_idx = 0;
+ } else if (url_idx >= urls[app_idx].url.size()) {
+ // Index of current application is OK, but all of its URL are sent,
+ // move to the next application
+ url_idx = 0;
+ if (++app_idx >= urls.size()) {
+ app_idx = 0;
+ }
+ }
+ const AppIdURL next_app_url = std::make_pair(app_idx, url_idx);
+
+ return next_app_url;
+}
+
+bool PolicyManagerImpl::HasCertificate() const {
+ return !cache_->GetCertificate().empty();
+}
+
+class CallStatusChange : public utils::Callable {
+ public:
+ CallStatusChange(UpdateStatusManager& upd_manager,
+ const DeviceConsent& device_consent)
+ : upd_manager_(upd_manager), device_consent_(device_consent) {}
+
+ // Callable interface
+ void operator()() const {
+ upd_manager_.OnNewApplicationAdded(device_consent_);
+ }
+
+ private:
+ UpdateStatusManager& upd_manager_;
+ const DeviceConsent device_consent_;
+};
+
+StatusNotifier PolicyManagerImpl::AddApplication(
+ const std::string& application_id,
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ DeviceConsent device_consent = GetUserConsentForDevice(device_id);
+ sync_primitives::AutoLock lock(apps_registration_lock_);
+ if (IsNewApplication(application_id)) {
+ AddNewApplication(application_id, device_consent);
+ return utils::MakeShared<CallStatusChange>(update_status_manager_,
+ device_consent);
+ } else {
+ PromoteExistedApplication(application_id, device_consent);
+ const policy_table::AppHMIType type = policy_table::AHT_NAVIGATION;
+ if (helpers::in_range(hmi_types,
+ (rpc::Enum<policy_table::AppHMIType>)type) &&
+ !HasCertificate()) {
+ LOG4CXX_DEBUG(logger_, "Certificate does not exist, scheduling update.");
+ update_status_manager_.ScheduleUpdate();
+ }
+ return utils::MakeShared<utils::CallNothing>();
+ }
+}
+
+void PolicyManagerImpl::RemoveAppConsentForGroup(
+ const std::string& app_id, const std::string& group_name) {
+ cache_->RemoveAppConsentForGroup(app_id, group_name);
+}
+
+bool PolicyManagerImpl::IsPredataPolicy(
+ const std::string& policy_app_id) const {
+ LOG4CXX_INFO(logger_, "IsPredataApp");
+ return cache_->IsPredataPolicy(policy_app_id);
+}
+
+void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
+ DeviceConsent device_consent) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ cache_->SetDefaultPolicy(application_id);
+}
+
+void PolicyManagerImpl::PromoteExistedApplication(
+ const std::string& application_id, DeviceConsent 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)) {
+ cache_->SetDefaultPolicy(application_id);
+ }
+}
+
+bool PolicyManagerImpl::IsNewApplication(
+ const std::string& application_id) const {
+ return false == cache_->IsApplicationRepresented(application_id);
+}
+
+bool PolicyManagerImpl::ResetPT(const std::string& file_name) {
+ cache_->ResetCalculatedPermissions();
+ const bool result = cache_->ResetPT(file_name);
+ if (result) {
+ RefreshRetrySequence();
+ }
+ return result;
+}
+
+bool PolicyManagerImpl::CheckAppStorageFolder() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string app_storage_folder = get_settings().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,
+ const PolicySettings* settings) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ settings_ = settings;
+ if (!CheckAppStorageFolder()) {
+ LOG4CXX_ERROR(logger_, "Can not read/write into AppStorageFolder");
+ return false;
+ }
+ const bool ret = cache_->Init(file_name, settings);
+ if (ret) {
+ RefreshRetrySequence();
+ update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
+ }
+ return ret;
+}
+
+uint32_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::RetrySequence() {
+ LOG4CXX_INFO(logger_, "Start new retry sequence");
+ update_status_manager_.OnUpdateTimeoutOccurs();
+
+ const uint32_t timeout_msec = NextRetryTimeout();
+ LOG4CXX_DEBUG(logger_, "New retry sequence timeout = " << timeout_msec);
+ if (!timeout_msec) {
+ if (timer_retry_sequence_.is_running()) {
+ timer_retry_sequence_.Stop();
+ }
+ return;
+ }
+
+ RequestPTUpdate();
+ timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic);
+}
+
+#ifdef SDL_REMOTE_CONTROL
+void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ ApplicationOnDevice who = {device_id, application_id};
+ access_remote_->SetDefaultHmiTypes(who, hmi_types);
+}
+
+struct HMITypeToInt {
+ int operator()(const policy_table::AppHMITypes::value_type item) {
+ return policy_table::AppHMIType(item);
+ }
+};
+
+bool PolicyManagerImpl::GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (cache_->IsDefaultPolicy(application_id)) {
+ return false;
+ }
+ const policy_table::AppHMITypes* hmi_types =
+ cache_->GetHMITypes(application_id);
+ if (hmi_types) {
+ std::transform(hmi_types->begin(),
+ hmi_types->end(),
+ std::back_inserter(*app_types),
+ HMITypeToInt());
+ }
+ return hmi_types;
+}
+
+bool PolicyManagerImpl::CheckModule(const PTString& app_id,
+ const PTString& module) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ policy_table::ModuleType module_type;
+ return EnumFromJsonString(module, &module_type) &&
+ access_remote_->CheckModuleType(app_id, module_type);
+}
+
+void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
+ std::string default_hmi("NONE");
+ if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Couldn't get default HMI level for application "
+ << who.app_id);
+ }
+}
+
+void PolicyManagerImpl::GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(data);
+ std::vector<FunctionalGroupPermission> app_group_permissions;
+ GetPermissionsForApp(device_id, application_id, app_group_permissions);
+
+ policy_table::FunctionalGroupings functional_groupings;
+ cache_->GetFunctionalGroupings(functional_groupings);
+
+ policy_table::Strings app_groups;
+ std::vector<FunctionalGroupPermission>::const_iterator it =
+ app_group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::const_iterator it_end =
+ app_group_permissions.end();
+ for (; it != it_end; ++it) {
+ app_groups.push_back((*it).group_name);
+ }
+
+ PrepareNotificationData(
+ functional_groupings, app_groups, app_group_permissions, *data);
+}
+
+void PolicyManagerImpl::SendAppPermissionsChanged(
+ const std::string& device_id, const std::string& application_id) {
+ Permissions notification_data;
+ GetPermissions(device_id, application_id, &notification_data);
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+}
+
+void PolicyManagerImpl::OnPrimaryGroupsChanged(
+ const std::string& application_id) {
+ const std::vector<std::string> devices =
+ listener()->GetDevicesIds(application_id);
+ for (std::vector<std::string>::const_iterator i = devices.begin();
+ i != devices.end();
+ ++i) {
+ const ApplicationOnDevice who = {*i, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ SendAppPermissionsChanged(who.dev_id, who.app_id);
+ }
+ }
+}
+
+bool PolicyManagerImpl::GetModuleTypes(
+ const std::string& application_id,
+ std::vector<std::string>* modules) const {
+ return access_remote_->GetModuleTypes(application_id, modules);
+}
+
+void PolicyManagerImpl::set_access_remote(
+ utils::SharedPtr<AccessRemote> access_remote) {
+ access_remote_ = access_remote;
+}
+#endif // SDL_REMOTE_CONTROL
+
+} // namespace policy
diff --git a/src/components/policy/src/policy_table.cc b/src/components/policy/policy_regular/src/policy_table.cc
index c5c6e3e132..c5c6e3e132 100644
--- a/src/components/policy/src/policy_table.cc
+++ b/src/components/policy/policy_regular/src/policy_table.cc
diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc
new file mode 100644
index 0000000000..34d12420d8
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_table/enums.cc
@@ -0,0 +1,634 @@
+// This file is generated, do not edit
+#include "policy/policy_table/enums.h"
+
+namespace rpc {
+namespace policy_table_interface_base {
+bool IsValidEnum(Priority val) {
+ switch (val) {
+ case P_EMERGENCY:
+ return true;
+ case P_NAVIGATION:
+ return true;
+ case P_VOICECOM:
+ return true;
+ case P_COMMUNICATION:
+ return true;
+ case P_NORMAL:
+ return true;
+ case P_NONE:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(Priority val) {
+ switch (val) {
+ case P_EMERGENCY:
+ return "EMERGENCY";
+ case P_NAVIGATION:
+ return "NAVIGATION";
+ case P_VOICECOM:
+ return "VOICECOM";
+ case P_COMMUNICATION:
+ return "COMMUNICATION";
+ case P_NORMAL:
+ return "NORMAL";
+ case P_NONE:
+ return "NONE";
+ default:
+ return "";
+ }
+}
+bool EnumFromJsonString(const std::string& literal, Priority* result) {
+ if ("EMERGENCY" == literal) {
+ *result = P_EMERGENCY;
+ return true;
+ } else if ("NAVIGATION" == literal) {
+ *result = P_NAVIGATION;
+ return true;
+ } else if ("VOICECOM" == literal) {
+ *result = P_VOICECOM;
+ return true;
+ } else if ("COMMUNICATION" == literal) {
+ *result = P_COMMUNICATION;
+ return true;
+ } else if ("NORMAL" == literal) {
+ *result = P_NORMAL;
+ return true;
+ } else if ("NONE" == literal) {
+ *result = P_NONE;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool IsValidEnum(HmiLevel val) {
+ switch (val) {
+ case HL_BACKGROUND:
+ return true;
+ case HL_FULL:
+ return true;
+ case HL_LIMITED:
+ return true;
+ case HL_NONE:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(HmiLevel val) {
+ switch (val) {
+ case HL_BACKGROUND:
+ return "BACKGROUND";
+ case HL_FULL:
+ return "FULL";
+ case HL_LIMITED:
+ return "LIMITED";
+ case HL_NONE:
+ return "NONE";
+ default:
+ return "";
+ }
+}
+bool EnumFromJsonString(const std::string& literal, HmiLevel* result) {
+ if ("BACKGROUND" == literal) {
+ *result = HL_BACKGROUND;
+ return true;
+ } else if ("FULL" == literal) {
+ *result = HL_FULL;
+ return true;
+ } else if ("LIMITED" == literal) {
+ *result = HL_LIMITED;
+ return true;
+ } else if ("NONE" == literal) {
+ *result = HL_NONE;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool IsValidEnum(Parameter val) {
+ switch (val) {
+ case P_GPS:
+ return true;
+ case P_SPEED:
+ return true;
+ case P_ENGINETORQUE:
+ return true;
+ case P_EXTERNALTEMPERATURE:
+ return true;
+ case P_FUELLEVEL:
+ return true;
+ case P_FUELLEVEL_STATE:
+ return true;
+ case P_HEADLAMPSTATUS:
+ return true;
+ case P_INSTANTFUELCONSUMPTION:
+ return true;
+ case P_ODOMETER:
+ return true;
+ case P_TIREPRESSURE:
+ return true;
+ case P_WIPERSTATUS:
+ return true;
+ case P_VIN:
+ return true;
+ case P_ACCPEDALPOSITION:
+ return true;
+ case P_BELTSTATUS:
+ return true;
+ case P_DRIVERBRAKING:
+ return true;
+ case P_PRNDL:
+ return true;
+ case P_RPM:
+ return true;
+ case P_STEERINGWHEELANGLE:
+ return true;
+ case P_MYKEY:
+ return true;
+ case P_AIRBAGSTATUS:
+ return true;
+ case P_BODYINFORMATION:
+ return true;
+ case P_CLUSTERMODESTATUS:
+ return true;
+ case P_DEVICESTATUS:
+ return true;
+ case P_EMERGENCYEVENT:
+ return true;
+ case P_ECALLINFO:
+ return true;
+ case P_EMPTY:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(Parameter val) {
+ switch (val) {
+ case P_GPS:
+ return "gps";
+ case P_SPEED:
+ return "speed";
+ case P_ENGINETORQUE:
+ return "engineTorque";
+ case P_EXTERNALTEMPERATURE:
+ return "externalTemperature";
+ case P_FUELLEVEL:
+ return "fuelLevel";
+ case P_FUELLEVEL_STATE:
+ return "fuelLevel_State";
+ case P_HEADLAMPSTATUS:
+ return "headLampStatus";
+ case P_INSTANTFUELCONSUMPTION:
+ return "instantFuelConsumption";
+ case P_ODOMETER:
+ return "odometer";
+ case P_TIREPRESSURE:
+ return "tirePressure";
+ case P_WIPERSTATUS:
+ return "wiperStatus";
+ case P_VIN:
+ return "vin";
+ case P_ACCPEDALPOSITION:
+ return "accPedalPosition";
+ case P_BELTSTATUS:
+ return "beltStatus";
+ case P_DRIVERBRAKING:
+ return "driverBraking";
+ case P_PRNDL:
+ return "prndl";
+ case P_RPM:
+ return "rpm";
+ case P_STEERINGWHEELANGLE:
+ return "steeringWheelAngle";
+ case P_MYKEY:
+ return "myKey";
+ case P_AIRBAGSTATUS:
+ return "airbagStatus";
+ case P_BODYINFORMATION:
+ return "bodyInformation";
+ case P_CLUSTERMODESTATUS:
+ return "clusterModeStatus";
+ case P_DEVICESTATUS:
+ return "deviceStatus";
+ case P_EMERGENCYEVENT:
+ return "emergencyEvent";
+ case P_ECALLINFO:
+ return "eCallInfo";
+ case P_EMPTY:
+ return "EMPTY";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, Parameter* result) {
+ if ("gps" == literal) {
+ *result = P_GPS;
+ return true;
+ } else if ("speed" == literal) {
+ *result = P_SPEED;
+ return true;
+ } else if ("engineTorque" == literal) {
+ *result = P_ENGINETORQUE;
+ return true;
+ } else if ("externalTemperature" == literal) {
+ *result = P_EXTERNALTEMPERATURE;
+ return true;
+ } else if ("fuelLevel" == literal) {
+ *result = P_FUELLEVEL;
+ return true;
+ } else if ("fuelLevel_State" == literal) {
+ *result = P_FUELLEVEL_STATE;
+ return true;
+ } else if ("headLampStatus" == literal) {
+ *result = P_HEADLAMPSTATUS;
+ return true;
+ } else if ("instantFuelConsumption" == literal) {
+ *result = P_INSTANTFUELCONSUMPTION;
+ return true;
+ } else if ("odometer" == literal) {
+ *result = P_ODOMETER;
+ return true;
+ } else if ("tirePressure" == literal) {
+ *result = P_TIREPRESSURE;
+ return true;
+ } else if ("wiperStatus" == literal) {
+ *result = P_WIPERSTATUS;
+ return true;
+ } else if ("vin" == literal) {
+ *result = P_VIN;
+ return true;
+ } else if ("accPedalPosition" == literal) {
+ *result = P_ACCPEDALPOSITION;
+ return true;
+ } else if ("beltStatus" == literal) {
+ *result = P_BELTSTATUS;
+ return true;
+ } else if ("driverBraking" == literal) {
+ *result = P_DRIVERBRAKING;
+ return true;
+ } else if ("prndl" == literal) {
+ *result = P_PRNDL;
+ return true;
+ } else if ("rpm" == literal) {
+ *result = P_RPM;
+ return true;
+ } else if ("steeringWheelAngle" == literal) {
+ *result = P_STEERINGWHEELANGLE;
+ return true;
+ } else if ("myKey" == literal) {
+ *result = P_MYKEY;
+ return true;
+ } else if ("airbagStatus" == literal) {
+ *result = P_AIRBAGSTATUS;
+ return true;
+ } else if ("bodyInformation" == literal) {
+ *result = P_BODYINFORMATION;
+ return true;
+ } else if ("clusterModeStatus" == literal) {
+ *result = P_CLUSTERMODESTATUS;
+ return true;
+ } else if ("deviceStatus" == literal) {
+ *result = P_DEVICESTATUS;
+ return true;
+ } else if ("emergencyEvent" == literal) {
+ *result = P_EMERGENCYEVENT;
+ return true;
+ } else if ("eCallInfo" == literal) {
+ *result = P_ECALLINFO;
+ return true;
+ } else if ("EMPTY" == literal) {
+ *result = P_EMPTY;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool IsValidEnum(AppHMIType val) {
+ switch (val) {
+ case AHT_DEFAULT:
+ return true;
+ case AHT_COMMUNICATION:
+ return true;
+ case AHT_MEDIA:
+ return true;
+ case AHT_MESSAGING:
+ return true;
+ case AHT_NAVIGATION:
+ return true;
+ case AHT_INFORMATION:
+ return true;
+ case AHT_SOCIAL:
+ return true;
+ case AHT_BACKGROUND_PROCESS:
+ return true;
+ case AHT_TESTING:
+ return true;
+ case AHT_SYSTEM:
+ return true;
+ case AHT_PROJECTION:
+ return true;
+ case AHT_REMOTE_CONTROL:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(AppHMIType val) {
+ switch (val) {
+ case AHT_DEFAULT:
+ return "DEFAULT";
+ case AHT_COMMUNICATION:
+ return "COMMUNICATION";
+ case AHT_MEDIA:
+ return "MEDIA";
+ case AHT_MESSAGING:
+ return "MESSAGING";
+ case AHT_NAVIGATION:
+ return "NAVIGATION";
+ case AHT_INFORMATION:
+ return "INFORMATION";
+ case AHT_SOCIAL:
+ return "SOCIAL";
+ case AHT_BACKGROUND_PROCESS:
+ return "BACKGROUND_PROCESS";
+ case AHT_TESTING:
+ return "TESTING";
+ case AHT_SYSTEM:
+ return "SYSTEM";
+ case AHT_PROJECTION:
+ return "PROJECTION";
+ case AHT_REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
+ default:
+ return "";
+ }
+}
+bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
+ if ("DEFAULT" == literal) {
+ *result = AHT_DEFAULT;
+ return true;
+ } else if ("COMMUNICATION" == literal) {
+ *result = AHT_COMMUNICATION;
+ return true;
+ } else if ("MEDIA" == literal) {
+ *result = AHT_MEDIA;
+ return true;
+ } else if ("MESSAGING" == literal) {
+ *result = AHT_MESSAGING;
+ return true;
+ } else if ("NAVIGATION" == literal) {
+ *result = AHT_NAVIGATION;
+ return true;
+ } else if ("INFORMATION" == literal) {
+ *result = AHT_INFORMATION;
+ return true;
+ } else if ("SOCIAL" == literal) {
+ *result = AHT_SOCIAL;
+ return true;
+ } else if ("BACKGROUND_PROCESS" == literal) {
+ *result = AHT_BACKGROUND_PROCESS;
+ return true;
+ } else if ("TESTING" == literal) {
+ *result = AHT_TESTING;
+ return true;
+ } else if ("SYSTEM" == literal) {
+ *result = AHT_SYSTEM;
+ return true;
+ } else if ("PROJECTION" == literal) {
+ *result = AHT_PROJECTION;
+ return true;
+ } else if ("REMOTE_CONTROL" == literal) {
+ *result = AHT_REMOTE_CONTROL;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+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;
+ }
+}
+
+#ifdef SDL_REMOTE_CONTROL
+bool IsValidEnum(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return true;
+ case MT_RADIO:
+ return true;
+ default:
+ return false;
+ }
+}
+const char* EnumToJsonString(ModuleType val) {
+ switch (val) {
+ case MT_CLIMATE:
+ return "CLIMATE";
+ case MT_RADIO:
+ return "RADIO";
+ default:
+ return "";
+ }
+}
+
+bool EnumFromJsonString(const std::string& literal, ModuleType* result) {
+ if ("CLIMATE" == literal) {
+ *result = MT_CLIMATE;
+ return true;
+ } else if ("RADIO" == literal) {
+ *result = MT_RADIO;
+ return true;
+ } else {
+ return false;
+ }
+}
+#endif // SDL_REMOTE_CONTROL
+
+const std::string kDefaultApp = "default";
+const std::string kPreDataConsentApp = "pre_DataConsent";
+const std::string kDeviceApp = "device";
+
+} // namespace policy_table_interface_base
+} // namespace rpc
diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc
new file mode 100644
index 0000000000..5f6f85f5dd
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_table/types.cc
@@ -0,0 +1,1510 @@
+// This file is generated, do not edit
+#include "policy/policy_table/types.h"
+#include "rpc_base/rpc_base_json_inl.h"
+
+namespace rpc {
+namespace policy_table_interface_base {
+
+std::string PolicyTableTypeToString(const PolicyTableType pt_type) {
+ switch (pt_type) {
+ case PT_PRELOADED: {
+ return "PT_PRELOADED";
+ }
+ case PT_UPDATE: {
+ return "PT_UPDATE";
+ }
+ case PT_SNAPSHOT: {
+ return "PT_SNAPSHOT";
+ }
+ default: { return "INVALID_PT_TYPE"; }
+ }
+}
+
+// PolicyBase methods
+PolicyBase::PolicyBase() : CompositeType(kUninitialized) {}
+
+PolicyBase::PolicyBase(Priority priority)
+ : CompositeType(kUninitialized), priority(priority) {}
+
+PolicyBase::~PolicyBase() {}
+
+PolicyBase::PolicyBase(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , priority(impl::ValueMember(value__, "priority")) {}
+
+Json::Value PolicyBase::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("priority", priority, &result__);
+ return result__;
+}
+
+bool PolicyBase::is_valid() const {
+ if (!priority.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool PolicyBase::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool PolicyBase::struct_empty() const {
+ if (priority.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void PolicyBase::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!priority.is_valid()) {
+ priority.ReportErrors(&report__->ReportSubobject("priority"));
+ }
+}
+
+void PolicyBase::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ priority.SetPolicyTableType(pt_type);
+}
+
+// DevicePolicy methods
+DevicePolicy::DevicePolicy() : PolicyBase() {}
+
+DevicePolicy::DevicePolicy(Priority priority) : PolicyBase(priority) {}
+
+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() : PolicyBase(), groups() {}
+
+ApplicationParams::ApplicationParams(const Strings& groups, Priority priority)
+ : PolicyBase(priority), groups(groups) {}
+
+ApplicationParams::~ApplicationParams() {}
+
+ApplicationParams::ApplicationParams(const Json::Value* value__)
+ : PolicyBase(value__)
+ , groups(impl::ValueMember(value__, "groups"))
+ , nicknames(impl::ValueMember(value__, "nicknames"))
+ , AppHMIType(impl::ValueMember(value__, "AppHMIType"))
+ , 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"), "not_specified")
+#ifdef SDL_REMOTE_CONTROL
+ , moduleType(impl::ValueMember(value__, "moduleType"))
+#endif // SDL_REMOTE_CONTROL
+{
+}
+
+Json::Value ApplicationParams::ToJsonValue() const {
+ Json::Value result__(PolicyBase::ToJsonValue());
+ impl::WriteJsonField("groups", groups, &result__);
+ impl::WriteJsonField("nicknames", nicknames, &result__);
+ impl::WriteJsonField("AppHMIType", AppHMIType, &result__);
+ impl::WriteJsonField("RequestType", RequestType, &result__);
+ impl::WriteJsonField("memory_kb", memory_kb, &result__);
+ impl::WriteJsonField(
+ "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__);
+#ifdef SDL_REMOTE_CONTROL
+ impl::WriteJsonField("moduleType", moduleType, &result__);
+#endif // SDL_REMOTE_CONTROL
+ return result__;
+}
+
+bool ApplicationParams::is_valid() const {
+ // RequestType is not validated since there is high-level validation logic,
+ // which takes into account information not available here.
+ if (!PolicyBase::is_valid()) {
+ return false;
+ }
+ if (!groups.is_valid()) {
+ return false;
+ }
+ if (!nicknames.is_valid()) {
+ return false;
+ }
+ if (!AppHMIType.is_valid()) {
+ return false;
+ }
+ if (!memory_kb.is_valid()) {
+ return false;
+ }
+ if (!heart_beat_timeout_ms.is_valid()) {
+ return false;
+ }
+ if (!certificate.is_valid()) {
+ return false;
+ }
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
+ return Validate();
+}
+
+bool ApplicationParams::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ApplicationParams::struct_empty() const {
+ if (!PolicyBase::is_initialized()) {
+ return false;
+ }
+ if (groups.is_initialized()) {
+ return false;
+ }
+ if (nicknames.is_initialized()) {
+ return false;
+ }
+ if (AppHMIType.is_initialized()) {
+ return false;
+ }
+ 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;
+ }
+#ifdef SDL_REMOTE_CONTROL
+ if (moduleType.is_initialized()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
+ return true;
+}
+
+void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!groups.is_valid()) {
+ groups.ReportErrors(&report__->ReportSubobject("groups"));
+ }
+ if (!nicknames.is_valid()) {
+ nicknames.ReportErrors(&report__->ReportSubobject("nicknames"));
+ }
+ 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 (!memory_kb.is_valid()) {
+ memory_kb.ReportErrors(&report__->ReportSubobject("memory_kb"));
+ }
+ if (!heart_beat_timeout_ms.is_valid()) {
+ heart_beat_timeout_ms.ReportErrors(
+ &report__->ReportSubobject("heart_beat_timeout_ms"));
+ }
+ if (!certificate.is_valid()) {
+ certificate.ReportErrors(&report__->ReportSubobject("certificate"));
+ }
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
+ }
+#endif // SDL_REMOTE_CONTROL
+}
+
+void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
+ PolicyBase::SetPolicyTableType(pt_type);
+ groups.SetPolicyTableType(pt_type);
+ AppHMIType.SetPolicyTableType(pt_type);
+ RequestType.SetPolicyTableType(pt_type);
+ memory_kb.SetPolicyTableType(pt_type);
+ heart_beat_timeout_ms.SetPolicyTableType(pt_type);
+ certificate.SetPolicyTableType(pt_type);
+#ifdef SDL_REMOTE_CONTROL
+ moduleType.SetPolicyTableType(pt_type);
+#endif // SDL_REMOTE_CONTROL
+}
+
+// RpcParameters methods
+RpcParameters::RpcParameters() : CompositeType(kUninitialized) {}
+
+RpcParameters::RpcParameters(const HmiLevels& hmi_levels)
+ : CompositeType(kUninitialized), hmi_levels(hmi_levels) {}
+
+RpcParameters::~RpcParameters() {}
+
+RpcParameters::RpcParameters(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , hmi_levels(impl::ValueMember(value__, "hmi_levels"))
+ , parameters(impl::ValueMember(value__, "parameters")) {}
+
+Json::Value RpcParameters::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("hmi_levels", hmi_levels, &result__);
+ impl::WriteJsonField("parameters", parameters, &result__);
+ return result__;
+}
+
+bool RpcParameters::is_valid() const {
+ if (!hmi_levels.is_valid()) {
+ return false;
+ }
+ if (!parameters.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool RpcParameters::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool RpcParameters::struct_empty() const {
+ if (hmi_levels.is_initialized()) {
+ return false;
+ }
+ if (parameters.is_initialized()) {
+ return false;
+ }
+
+ return true;
+}
+
+void RpcParameters::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!hmi_levels.is_valid()) {
+ hmi_levels.ReportErrors(&report__->ReportSubobject("hmi_levels"));
+ }
+ if (!parameters.is_valid()) {
+ parameters.ReportErrors(&report__->ReportSubobject("parameters"));
+ }
+}
+
+void RpcParameters::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ hmi_levels.SetPolicyTableType(pt_type);
+ parameters.SetPolicyTableType(pt_type);
+}
+
+// Rpcs methods
+Rpcs::Rpcs() : CompositeType(kUninitialized) {}
+
+Rpcs::Rpcs(const Rpc& rpcs) : CompositeType(kUninitialized), rpcs(rpcs) {}
+
+Rpcs::~Rpcs() {}
+
+Rpcs::Rpcs(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , user_consent_prompt(impl::ValueMember(value__, "user_consent_prompt"))
+ , rpcs(impl::ValueMember(value__, "rpcs")) {}
+
+Json::Value Rpcs::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("user_consent_prompt", user_consent_prompt, &result__);
+ impl::WriteJsonField("rpcs", rpcs, &result__);
+ return result__;
+}
+
+bool Rpcs::is_valid() const {
+ if (!user_consent_prompt.is_valid()) {
+ return false;
+ }
+ if (!rpcs.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool Rpcs::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool Rpcs::struct_empty() const {
+ if (user_consent_prompt.is_initialized()) {
+ return false;
+ }
+ if (rpcs.is_initialized()) {
+ return false;
+ }
+
+ return true;
+}
+
+void Rpcs::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!user_consent_prompt.is_valid()) {
+ user_consent_prompt.ReportErrors(
+ &report__->ReportSubobject("user_consent_prompt"));
+ }
+ if (!rpcs.is_valid()) {
+ rpcs.ReportErrors(&report__->ReportSubobject("rpcs"));
+ }
+}
+
+void Rpcs::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ user_consent_prompt.SetPolicyTableType(pt_type);
+ rpcs.SetPolicyTableType(pt_type);
+}
+
+// ModuleConfig methods
+ModuleConfig::ModuleConfig() : CompositeType(kUninitialized) {}
+
+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)
+ : CompositeType(kUninitialized)
+ , exchange_after_x_ignition_cycles(exchange_after_x_ignition_cycles)
+ , exchange_after_x_kilometers(exchange_after_x_kilometers)
+ , exchange_after_x_days(exchange_after_x_days)
+ , timeout_after_x_seconds(timeout_after_x_seconds)
+ , seconds_between_retries(seconds_between_retries)
+ , endpoints(endpoints)
+ , notifications_per_minute_by_priority(
+ notifications_per_minute_by_priority) {}
+
+ModuleConfig::~ModuleConfig() {}
+
+ModuleConfig::ModuleConfig(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , device_certificates(impl::ValueMember(value__, "device_certificates"))
+ , preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
+ , exchange_after_x_ignition_cycles(
+ impl::ValueMember(value__, "exchange_after_x_ignition_cycles"))
+ , exchange_after_x_kilometers(
+ impl::ValueMember(value__, "exchange_after_x_kilometers"))
+ , exchange_after_x_days(impl::ValueMember(value__, "exchange_after_x_days"))
+ , timeout_after_x_seconds(
+ impl::ValueMember(value__, "timeout_after_x_seconds"))
+ , seconds_between_retries(
+ impl::ValueMember(value__, "seconds_between_retries"))
+ , endpoints(impl::ValueMember(value__, "endpoints"))
+ , notifications_per_minute_by_priority(
+ impl::ValueMember(value__, "notifications_per_minute_by_priority"))
+ , vehicle_make(impl::ValueMember(value__, "vehicle_make"))
+ , vehicle_model(impl::ValueMember(value__, "vehicle_model"))
+ , vehicle_year(impl::ValueMember(value__, "vehicle_year"))
+ , preloaded_date(impl::ValueMember(value__, "preloaded_date"))
+ , certificate(impl::ValueMember(value__, "certificate")) {}
+
+void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
+ // device_certificates = from.device_certificates; // According to the
+ // requirements this is optional.
+ exchange_after_x_ignition_cycles = from.exchange_after_x_ignition_cycles;
+ exchange_after_x_kilometers = from.exchange_after_x_kilometers;
+ exchange_after_x_days = from.exchange_after_x_days;
+ timeout_after_x_seconds = from.timeout_after_x_seconds;
+ seconds_between_retries = from.seconds_between_retries;
+ endpoints = from.endpoints;
+ notifications_per_minute_by_priority =
+ from.notifications_per_minute_by_priority;
+
+ vehicle_make.assign_if_valid(from.vehicle_make);
+ vehicle_model.assign_if_valid(from.vehicle_model);
+ vehicle_year.assign_if_valid(from.vehicle_year);
+ certificate.assign_if_valid(from.certificate);
+}
+
+Json::Value ModuleConfig::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
+ impl::WriteJsonField("exchange_after_x_ignition_cycles",
+ exchange_after_x_ignition_cycles,
+ &result__);
+ impl::WriteJsonField(
+ "exchange_after_x_kilometers", exchange_after_x_kilometers, &result__);
+ impl::WriteJsonField(
+ "exchange_after_x_days", exchange_after_x_days, &result__);
+ impl::WriteJsonField(
+ "timeout_after_x_seconds", timeout_after_x_seconds, &result__);
+ impl::WriteJsonField(
+ "seconds_between_retries", seconds_between_retries, &result__);
+ impl::WriteJsonField("endpoints", endpoints, &result__);
+ impl::WriteJsonField("notifications_per_minute_by_priority",
+ notifications_per_minute_by_priority,
+ &result__);
+ impl::WriteJsonField("vehicle_make", vehicle_make, &result__);
+ impl::WriteJsonField("vehicle_model", vehicle_model, &result__);
+ impl::WriteJsonField("vehicle_year", vehicle_year, &result__);
+ impl::WriteJsonField("certificate", certificate, &result__);
+ impl::WriteJsonField("preloaded_date", preloaded_date, &result__);
+ return result__;
+}
+
+bool ModuleConfig::is_valid() const {
+ if (!preloaded_pt.is_valid()) {
+ return false;
+ }
+ if (!exchange_after_x_ignition_cycles.is_valid()) {
+ return false;
+ }
+ if (!exchange_after_x_kilometers.is_valid()) {
+ return false;
+ }
+ if (!exchange_after_x_days.is_valid()) {
+ return false;
+ }
+ if (!timeout_after_x_seconds.is_valid()) {
+ return false;
+ }
+ if (!seconds_between_retries.is_valid()) {
+ return false;
+ }
+ if (!endpoints.is_valid()) {
+ return false;
+ }
+ if (!notifications_per_minute_by_priority.is_valid()) {
+ return false;
+ }
+ if (!vehicle_make.is_valid()) {
+ return false;
+ }
+ if (!vehicle_model.is_valid()) {
+ return false;
+ }
+ if (!vehicle_year.is_valid()) {
+ return false;
+ }
+ if (!certificate.is_valid()) {
+ return false;
+ }
+ if (!preloaded_date.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool ModuleConfig::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ModuleConfig::struct_empty() const {
+ if (preloaded_pt.is_initialized()) {
+ return false;
+ }
+
+ if (exchange_after_x_ignition_cycles.is_initialized()) {
+ return false;
+ }
+ if (exchange_after_x_kilometers.is_initialized()) {
+ return false;
+ }
+
+ if (exchange_after_x_days.is_initialized()) {
+ return false;
+ }
+ if (timeout_after_x_seconds.is_initialized()) {
+ return false;
+ }
+
+ if (seconds_between_retries.is_initialized()) {
+ return false;
+ }
+ if (endpoints.is_initialized()) {
+ return false;
+ }
+
+ if (notifications_per_minute_by_priority.is_initialized()) {
+ return false;
+ }
+ if (vehicle_make.is_initialized()) {
+ return false;
+ }
+
+ if (vehicle_model.is_initialized()) {
+ return false;
+ }
+ if (vehicle_year.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!device_certificates.is_valid()) {
+ device_certificates.ReportErrors(
+ &report__->ReportSubobject("device_certificates"));
+ }
+ if (!preloaded_pt.is_valid()) {
+ preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
+ }
+ if (!exchange_after_x_ignition_cycles.is_valid()) {
+ exchange_after_x_ignition_cycles.ReportErrors(
+ &report__->ReportSubobject("exchange_after_x_ignition_cycles"));
+ }
+ if (!exchange_after_x_kilometers.is_valid()) {
+ exchange_after_x_kilometers.ReportErrors(
+ &report__->ReportSubobject("exchange_after_x_kilometers"));
+ }
+ if (!exchange_after_x_days.is_valid()) {
+ exchange_after_x_days.ReportErrors(
+ &report__->ReportSubobject("exchange_after_x_days"));
+ }
+ if (!timeout_after_x_seconds.is_valid()) {
+ timeout_after_x_seconds.ReportErrors(
+ &report__->ReportSubobject("timeout_after_x_seconds"));
+ }
+ if (!seconds_between_retries.is_valid()) {
+ seconds_between_retries.ReportErrors(
+ &report__->ReportSubobject("seconds_between_retries"));
+ }
+ if (!endpoints.is_valid()) {
+ endpoints.ReportErrors(&report__->ReportSubobject("endpoints"));
+ }
+ if (!notifications_per_minute_by_priority.is_valid()) {
+ notifications_per_minute_by_priority.ReportErrors(
+ &report__->ReportSubobject("notifications_per_minute_by_priority"));
+ }
+ if (!vehicle_make.is_valid()) {
+ vehicle_make.ReportErrors(&report__->ReportSubobject("vehicle_make"));
+ }
+ if (!vehicle_model.is_valid()) {
+ vehicle_model.ReportErrors(&report__->ReportSubobject("vehicle_model"));
+ }
+ if (!vehicle_year.is_valid()) {
+ vehicle_year.ReportErrors(&report__->ReportSubobject("vehicle_year"));
+ }
+ if (PT_PRELOADED == GetPolicyTableType()) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+ rpc::ValidationReport* omitted_field_report;
+ if (vehicle_make.is_initialized()) {
+ omitted_field_report = &report__->ReportSubobject("vehicle_make");
+ omitted_field_report->set_validation_info(validation_info);
+ }
+ if (vehicle_year.is_initialized()) {
+ omitted_field_report = &report__->ReportSubobject("vehicle_year");
+ omitted_field_report->set_validation_info(validation_info);
+ }
+ if (vehicle_model.is_initialized()) {
+ omitted_field_report = &report__->ReportSubobject("vehicle_model");
+ omitted_field_report->set_validation_info(validation_info);
+ }
+ }
+}
+
+void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ preloaded_pt.SetPolicyTableType(pt_type);
+ exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
+ exchange_after_x_kilometers.SetPolicyTableType(pt_type);
+ exchange_after_x_days.SetPolicyTableType(pt_type);
+ timeout_after_x_seconds.SetPolicyTableType(pt_type);
+ seconds_between_retries.SetPolicyTableType(pt_type);
+ endpoints.SetPolicyTableType(pt_type);
+ notifications_per_minute_by_priority.SetPolicyTableType(pt_type);
+ vehicle_make.SetPolicyTableType(pt_type);
+ vehicle_model.SetPolicyTableType(pt_type);
+ vehicle_year.SetPolicyTableType(pt_type);
+}
+
+// MessageString methods
+MessageString::MessageString() : CompositeType(kUninitialized) {}
+
+MessageString::~MessageString() {}
+
+MessageString::MessageString(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , line1(impl::ValueMember(value__, "line1"))
+ , line2(impl::ValueMember(value__, "line2"))
+ , tts(impl::ValueMember(value__, "tts"))
+ , label(impl::ValueMember(value__, "label"))
+ , textBody(impl::ValueMember(value__, "textBody")) {}
+
+Json::Value MessageString::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("line1", line1, &result__);
+ impl::WriteJsonField("line2", line2, &result__);
+ impl::WriteJsonField("tts", tts, &result__);
+ impl::WriteJsonField("label", label, &result__);
+ impl::WriteJsonField("textBody", textBody, &result__);
+ return result__;
+}
+
+bool MessageString::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ if (!line1.is_valid()) {
+ return false;
+ }
+ if (!line2.is_valid()) {
+ return false;
+ }
+ if (!tts.is_valid()) {
+ return false;
+ }
+ if (!label.is_valid()) {
+ return false;
+ }
+ if (!textBody.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool MessageString::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool MessageString::struct_empty() const {
+ if (line1.is_initialized()) {
+ return false;
+ }
+ if (line2.is_initialized()) {
+ return false;
+ }
+
+ if (tts.is_initialized()) {
+ return false;
+ }
+ if (label.is_initialized()) {
+ return false;
+ }
+
+ if (textBody.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void MessageString::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!line1.is_valid()) {
+ line1.ReportErrors(&report__->ReportSubobject("line1"));
+ }
+ if (!line2.is_valid()) {
+ line2.ReportErrors(&report__->ReportSubobject("line2"));
+ }
+ if (!tts.is_valid()) {
+ tts.ReportErrors(&report__->ReportSubobject("tts"));
+ }
+ if (!label.is_valid()) {
+ label.ReportErrors(&report__->ReportSubobject("label"));
+ }
+ if (!textBody.is_valid()) {
+ textBody.ReportErrors(&report__->ReportSubobject("textBody"));
+ }
+}
+
+void MessageString::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ line1.SetPolicyTableType(pt_type);
+ line2.SetPolicyTableType(pt_type);
+ tts.SetPolicyTableType(pt_type);
+ label.SetPolicyTableType(pt_type);
+ textBody.SetPolicyTableType(pt_type);
+}
+
+// MessageLanguages methods
+const std::string MessageLanguages::default_language_("en-us");
+
+MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {}
+
+MessageLanguages::MessageLanguages(const Languages& languages)
+ : CompositeType(kUninitialized), languages(languages) {}
+
+MessageLanguages::~MessageLanguages() {}
+
+MessageLanguages::MessageLanguages(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , languages(impl::ValueMember(value__, "languages")) {}
+
+Json::Value MessageLanguages::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("languages", languages, &result__);
+ return result__;
+}
+
+bool MessageLanguages::is_valid() const {
+ if (!languages.is_valid()) {
+ return false;
+ }
+ // Each RPC must have message in english
+ if (languages.end() == languages.find(default_language_)) {
+ return false;
+ }
+ return Validate();
+}
+
+bool MessageLanguages::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool MessageLanguages::struct_empty() const {
+ if (languages.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void MessageLanguages::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (PT_SNAPSHOT == GetPolicyTableType()) {
+ if (languages.is_initialized()) {
+ std::string validation_info =
+ omitted_validation_info +
+ PolicyTableTypeToString(GetPolicyTableType());
+ report__->ReportSubobject("languages")
+ .set_validation_info(validation_info);
+ }
+ }
+ if (!languages.is_valid()) {
+ languages.ReportErrors(&report__->ReportSubobject("languages"));
+ }
+ if (languages.end() == languages.find(default_language_)) {
+ report__->set_validation_info(
+ "this message does not support the default language '" +
+ default_language_ + "'");
+ }
+}
+
+void MessageLanguages::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ languages.SetPolicyTableType(pt_type);
+}
+
+// ConsumerFriendlyMessages methods
+ConsumerFriendlyMessages::ConsumerFriendlyMessages()
+ : CompositeType(kUninitialized) {}
+
+ConsumerFriendlyMessages::ConsumerFriendlyMessages(const std::string& version)
+ : CompositeType(kUninitialized), version(version) {}
+
+ConsumerFriendlyMessages::~ConsumerFriendlyMessages() {}
+
+ConsumerFriendlyMessages::ConsumerFriendlyMessages(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , version(impl::ValueMember(value__, "version"))
+ , messages(impl::ValueMember(value__, "messages")) {}
+
+Json::Value ConsumerFriendlyMessages::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("version", version, &result__);
+ impl::WriteJsonField("messages", messages, &result__);
+ return result__;
+}
+
+bool ConsumerFriendlyMessages::is_valid() const {
+ if (!version.is_valid()) {
+ return false;
+ }
+ if (!messages.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool ConsumerFriendlyMessages::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ConsumerFriendlyMessages::struct_empty() const {
+ if (version.is_initialized()) {
+ return false;
+ }
+ if (messages.is_initialized()) {
+ return false;
+ }
+
+ return true;
+}
+
+void ConsumerFriendlyMessages::ReportErrors(
+ rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!version.is_valid()) {
+ version.ReportErrors(&report__->ReportSubobject("version"));
+ }
+ if (PT_SNAPSHOT == GetPolicyTableType()) {
+ if (messages.is_initialized()) {
+ std::string validation_info =
+ omitted_validation_info +
+ PolicyTableTypeToString(GetPolicyTableType());
+ report__->ReportSubobject("messages")
+ .set_validation_info(validation_info);
+ }
+ }
+ if (!messages.is_valid()) {
+ messages.ReportErrors(&report__->ReportSubobject("messages"));
+ }
+}
+
+void ConsumerFriendlyMessages::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ version.SetPolicyTableType(pt_type);
+ messages.SetPolicyTableType(pt_type);
+}
+
+// ModuleMeta methods
+ModuleMeta::ModuleMeta() : CompositeType(kUninitialized) {}
+
+ModuleMeta::~ModuleMeta() {}
+
+ModuleMeta::ModuleMeta(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , pt_exchanged_at_odometer_x(
+ impl::ValueMember(value__, "pt_exchanged_at_odometer_x"))
+ , pt_exchanged_x_days_after_epoch(
+ impl::ValueMember(value__, "pt_exchanged_x_days_after_epoch"))
+ , ignition_cycles_since_last_exchange(
+ impl::ValueMember(value__, "ignition_cycles_since_last_exchange")) {}
+
+Json::Value ModuleMeta::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField(
+ "pt_exchanged_at_odometer_x", pt_exchanged_at_odometer_x, &result__);
+ impl::WriteJsonField("pt_exchanged_x_days_after_epoch",
+ pt_exchanged_x_days_after_epoch,
+ &result__);
+ impl::WriteJsonField("ignition_cycles_since_last_exchange",
+ ignition_cycles_since_last_exchange,
+ &result__);
+ return result__;
+}
+
+bool ModuleMeta::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ if (!pt_exchanged_at_odometer_x.is_valid()) {
+ return false;
+ }
+ if (!pt_exchanged_x_days_after_epoch.is_valid()) {
+ return false;
+ }
+ if (!ignition_cycles_since_last_exchange.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool ModuleMeta::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool ModuleMeta::struct_empty() const {
+ if (pt_exchanged_at_odometer_x.is_initialized()) {
+ return false;
+ }
+
+ if (pt_exchanged_x_days_after_epoch.is_initialized()) {
+ return false;
+ }
+ if (ignition_cycles_since_last_exchange.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void ModuleMeta::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!pt_exchanged_at_odometer_x.is_valid()) {
+ pt_exchanged_at_odometer_x.ReportErrors(
+ &report__->ReportSubobject("pt_exchanged_at_odometer_x"));
+ }
+ if (!pt_exchanged_x_days_after_epoch.is_valid()) {
+ pt_exchanged_x_days_after_epoch.ReportErrors(
+ &report__->ReportSubobject("pt_exchanged_x_days_after_epoch"));
+ }
+ if (!ignition_cycles_since_last_exchange.is_valid()) {
+ ignition_cycles_since_last_exchange.ReportErrors(
+ &report__->ReportSubobject("ignition_cycles_since_last_exchange"));
+ }
+}
+
+void ModuleMeta::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ pt_exchanged_at_odometer_x.SetPolicyTableType(pt_type);
+ pt_exchanged_x_days_after_epoch.SetPolicyTableType(pt_type);
+ ignition_cycles_since_last_exchange.SetPolicyTableType(pt_type);
+}
+
+// AppLevel methods
+AppLevel::AppLevel() : CompositeType(kUninitialized) {}
+
+AppLevel::AppLevel(uint16_t minutes_in_hmi_full,
+ const std::string& app_registration_language_gui,
+ const std::string& app_registration_language_vui,
+ uint16_t minutes_in_hmi_limited,
+ uint16_t minutes_in_hmi_background,
+ uint16_t minutes_in_hmi_none,
+ uint16_t count_of_user_selections,
+ uint16_t count_of_rejections_sync_out_of_memory,
+ uint16_t count_of_rejections_nickname_mismatch,
+ uint16_t count_of_rejections_duplicate_name,
+ uint16_t count_of_rejected_rpc_calls,
+ uint16_t count_of_rpcs_sent_in_hmi_none,
+ uint16_t count_of_removals_for_bad_behavior,
+ uint16_t count_of_tls_errors,
+ uint16_t count_of_run_attempts_while_revoked)
+ : CompositeType(kUninitialized)
+ , minutes_in_hmi_full(minutes_in_hmi_full)
+ , app_registration_language_gui(app_registration_language_gui)
+ , app_registration_language_vui(app_registration_language_vui)
+ , minutes_in_hmi_limited(minutes_in_hmi_limited)
+ , minutes_in_hmi_background(minutes_in_hmi_background)
+ , minutes_in_hmi_none(minutes_in_hmi_none)
+ , count_of_user_selections(count_of_user_selections)
+ , count_of_rejections_sync_out_of_memory(
+ count_of_rejections_sync_out_of_memory)
+ , count_of_rejections_nickname_mismatch(
+ count_of_rejections_nickname_mismatch)
+ , count_of_rejections_duplicate_name(count_of_rejections_duplicate_name)
+ , count_of_rejected_rpc_calls(count_of_rejected_rpc_calls)
+ , count_of_rpcs_sent_in_hmi_none(count_of_rpcs_sent_in_hmi_none)
+ , count_of_removals_for_bad_behavior(count_of_removals_for_bad_behavior)
+ , count_of_tls_errors(count_of_tls_errors)
+ , count_of_run_attempts_while_revoked(count_of_run_attempts_while_revoked) {
+}
+
+AppLevel::~AppLevel() {}
+
+AppLevel::AppLevel(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , minutes_in_hmi_full(impl::ValueMember(value__, "minutes_in_hmi_full"))
+ , app_registration_language_gui(
+ impl::ValueMember(value__, "app_registration_language_gui"))
+ , app_registration_language_vui(
+ impl::ValueMember(value__, "app_registration_language_vui"))
+ , minutes_in_hmi_limited(
+ impl::ValueMember(value__, "minutes_in_hmi_limited"))
+ , minutes_in_hmi_background(
+ impl::ValueMember(value__, "minutes_in_hmi_background"))
+ , minutes_in_hmi_none(impl::ValueMember(value__, "minutes_in_hmi_none"))
+ , count_of_user_selections(
+ impl::ValueMember(value__, "count_of_user_selections"))
+ , count_of_rejections_sync_out_of_memory(
+ impl::ValueMember(value__, "count_of_rejections_sync_out_of_memory"))
+ , count_of_rejections_nickname_mismatch(
+ impl::ValueMember(value__, "count_of_rejections_nickname_mismatch"))
+ , count_of_rejections_duplicate_name(
+ impl::ValueMember(value__, "count_of_rejections_duplicate_name"))
+ , count_of_rejected_rpc_calls(
+ impl::ValueMember(value__, "count_of_rejected_rpc_calls"))
+ , count_of_rpcs_sent_in_hmi_none(
+ impl::ValueMember(value__, "count_of_rpcs_sent_in_hmi_none"))
+ , count_of_removals_for_bad_behavior(
+ impl::ValueMember(value__, "count_of_removals_for_bad_behavior"))
+ , count_of_tls_errors(impl::ValueMember(value__, "count_of_tls_errors"))
+ , count_of_run_attempts_while_revoked(
+ impl::ValueMember(value__, "count_of_run_attempts_while_revoked")) {}
+
+Json::Value AppLevel::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("count_of_TLS_errors", count_of_tls_errors, &result__);
+ return result__;
+}
+
+bool AppLevel::is_valid() const {
+ if (!minutes_in_hmi_full.is_valid()) {
+ return false;
+ }
+ if (!app_registration_language_gui.is_valid()) {
+ return false;
+ }
+ if (!app_registration_language_vui.is_valid()) {
+ return false;
+ }
+ if (!minutes_in_hmi_limited.is_valid()) {
+ return false;
+ }
+ if (!minutes_in_hmi_background.is_valid()) {
+ return false;
+ }
+ if (!minutes_in_hmi_none.is_valid()) {
+ return false;
+ }
+ if (!count_of_user_selections.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejections_sync_out_of_memory.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejections_nickname_mismatch.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejections_duplicate_name.is_valid()) {
+ return false;
+ }
+ if (!count_of_rejected_rpc_calls.is_valid()) {
+ return false;
+ }
+ if (!count_of_rpcs_sent_in_hmi_none.is_valid()) {
+ return false;
+ }
+ if (!count_of_removals_for_bad_behavior.is_valid()) {
+ return false;
+ }
+ if (!count_of_tls_errors.is_valid()) {
+ return false;
+ }
+ if (!count_of_run_attempts_while_revoked.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool AppLevel::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool AppLevel::struct_empty() const {
+ if (minutes_in_hmi_full.is_initialized()) {
+ return false;
+ }
+ if (app_registration_language_gui.is_initialized()) {
+ return false;
+ }
+
+ if (app_registration_language_vui.is_initialized()) {
+ return false;
+ }
+
+ if (minutes_in_hmi_limited.is_initialized()) {
+ return false;
+ }
+ if (minutes_in_hmi_background.is_initialized()) {
+ return false;
+ }
+
+ if (minutes_in_hmi_none.is_initialized()) {
+ return false;
+ }
+ if (count_of_user_selections.is_initialized()) {
+ return false;
+ }
+
+ if (count_of_rejections_sync_out_of_memory.is_initialized()) {
+ return false;
+ }
+ if (count_of_rejections_nickname_mismatch.is_initialized()) {
+ return false;
+ }
+
+ if (count_of_rejections_duplicate_name.is_initialized()) {
+ return false;
+ }
+ if (count_of_rejected_rpc_calls.is_initialized()) {
+ return false;
+ }
+
+ if (count_of_rpcs_sent_in_hmi_none.is_initialized()) {
+ return false;
+ }
+ if (count_of_removals_for_bad_behavior.is_initialized()) {
+ return false;
+ }
+ if (count_of_tls_errors.is_initialized()) {
+ return false;
+ }
+ if (count_of_run_attempts_while_revoked.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void AppLevel::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+ report__->set_validation_info(validation_info);
+ }
+}
+
+// UsageAndErrorCounts methods
+UsageAndErrorCounts::UsageAndErrorCounts() : CompositeType(kUninitialized) {}
+
+UsageAndErrorCounts::~UsageAndErrorCounts() {}
+UsageAndErrorCounts::UsageAndErrorCounts(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , app_level(impl::ValueMember(value__, "app_level")) {}
+Json::Value UsageAndErrorCounts::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("app_level", app_level, &result__);
+ return result__;
+}
+
+bool UsageAndErrorCounts::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ if (!app_level.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool UsageAndErrorCounts::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool UsageAndErrorCounts::struct_empty() const {
+ if (app_level.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void UsageAndErrorCounts::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+ report__->set_validation_info(validation_info);
+ }
+ if (!app_level.is_valid()) {
+ app_level.ReportErrors(&report__->ReportSubobject("app_level"));
+ }
+}
+
+void UsageAndErrorCounts::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ app_level.SetPolicyTableType(pt_type);
+}
+
+// DeviceParams methods
+DeviceParams::DeviceParams() : CompositeType(kUninitialized) {}
+
+DeviceParams::~DeviceParams() {}
+
+DeviceParams::DeviceParams(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject)) {}
+
+Json::Value DeviceParams::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ return result__;
+}
+
+bool DeviceParams::is_valid() const {
+ if (struct_empty()) {
+ return initialization_state__ == kInitialized && Validate();
+ }
+ return Validate();
+}
+
+bool DeviceParams::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool DeviceParams::struct_empty() const {
+ return true;
+}
+
+void DeviceParams::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+}
+
+// PolicyTable methods
+PolicyTable::PolicyTable() : CompositeType(kUninitialized) {}
+
+PolicyTable::PolicyTable(
+ const ApplicationPoliciesSection& app_policies_section,
+ const FunctionalGroupings& functional_groupings,
+ const ConsumerFriendlyMessages& consumer_friendly_messages,
+ const ModuleConfig& module_config)
+ : CompositeType(kUninitialized)
+ , app_policies_section(app_policies_section)
+ , functional_groupings(functional_groupings)
+ , consumer_friendly_messages(consumer_friendly_messages)
+ , module_config(module_config) {}
+
+PolicyTable::~PolicyTable() {}
+
+PolicyTable::PolicyTable(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , 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"))
+ , module_meta(impl::ValueMember(value__, "module_meta"))
+ , usage_and_error_counts(
+ impl::ValueMember(value__, "usage_and_error_counts"))
+ , device_data(impl::ValueMember(value__, "device_data")) {}
+
+Json::Value PolicyTable::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ 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__);
+ impl::WriteJsonField("module_meta", module_meta, &result__);
+ impl::WriteJsonField(
+ "usage_and_error_counts", usage_and_error_counts, &result__);
+ impl::WriteJsonField("device_data", device_data, &result__);
+ return result__;
+}
+
+bool PolicyTable::is_valid() const {
+ if (!app_policies_section.is_valid()) {
+ return false;
+ }
+ if (!functional_groupings.is_valid()) {
+ return false;
+ }
+ if (!consumer_friendly_messages.is_valid()) {
+ return false;
+ }
+ if (!module_config.is_valid()) {
+ return false;
+ }
+ if (!module_meta.is_valid()) {
+ return false;
+ }
+ if (!usage_and_error_counts.is_valid()) {
+ return false;
+ }
+ if (!device_data.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool PolicyTable::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool PolicyTable::struct_empty() const {
+ if (app_policies_section.is_initialized()) {
+ return false;
+ }
+ if (functional_groupings.is_initialized()) {
+ return false;
+ }
+
+ if (consumer_friendly_messages.is_initialized()) {
+ return false;
+ }
+ if (module_config.is_initialized()) {
+ return false;
+ }
+
+ if (module_meta.is_initialized()) {
+ return false;
+ }
+ if (usage_and_error_counts.is_initialized()) {
+ return false;
+ }
+
+ if (device_data.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void PolicyTable::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ std::string validation_info =
+ omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType());
+
+ if (device_data.is_initialized()) {
+ report__->ReportSubobject("device_data")
+ .set_validation_info(validation_info);
+ }
+ }
+ 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"));
+ }
+ if (!consumer_friendly_messages.is_valid()) {
+ consumer_friendly_messages.ReportErrors(
+ &report__->ReportSubobject("consumer_friendly_messages"));
+ }
+ if (!module_config.is_valid()) {
+ module_config.ReportErrors(&report__->ReportSubobject("module_config"));
+ }
+ if (!module_meta.is_valid()) {
+ module_meta.ReportErrors(&report__->ReportSubobject("module_meta"));
+ }
+ if (!usage_and_error_counts.is_valid()) {
+ usage_and_error_counts.ReportErrors(
+ &report__->ReportSubobject("usage_and_error_counts"));
+ }
+ if (!device_data.is_valid()) {
+ device_data.ReportErrors(&report__->ReportSubobject("device_data"));
+ }
+}
+
+void PolicyTable::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::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);
+ module_meta.SetPolicyTableType(pt_type);
+ usage_and_error_counts.SetPolicyTableType(pt_type);
+ device_data.SetPolicyTableType(pt_type);
+}
+
+// Table methods
+Table::Table() : CompositeType(kUninitialized) {}
+
+Table::Table(const PolicyTable& policy_table)
+ : CompositeType(kUninitialized), policy_table(policy_table) {}
+
+Table::~Table() {}
+
+Table::Table(const Json::Value* value__)
+ : CompositeType(InitHelper(value__, &Json::Value::isObject))
+ , policy_table(impl::ValueMember(value__, "policy_table")) {}
+
+Json::Value Table::ToJsonValue() const {
+ Json::Value result__(Json::objectValue);
+ impl::WriteJsonField("policy_table", policy_table, &result__);
+ return result__;
+}
+
+bool Table::is_valid() const {
+ if (!policy_table.is_valid()) {
+ return false;
+ }
+ return Validate();
+}
+
+bool Table::is_initialized() const {
+ return (initialization_state__ != kUninitialized) || (!struct_empty());
+}
+
+bool Table::struct_empty() const {
+ if (policy_table.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+void Table::ReportErrors(rpc::ValidationReport* report__) const {
+ if (struct_empty()) {
+ rpc::CompositeType::ReportErrors(report__);
+ }
+ if (!policy_table.is_valid()) {
+ policy_table.ReportErrors(&report__->ReportSubobject("policy_table"));
+ }
+}
+
+void Table::SetPolicyTableType(PolicyTableType pt_type) {
+ CompositeType::SetPolicyTableType(pt_type);
+ policy_table.SetPolicyTableType(pt_type);
+}
+
+} // namespace policy_table_interface_base
+} // namespace rpc
diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc
new file mode 100644
index 0000000000..10b8e4bf7c
--- /dev/null
+++ b/src/components/policy/policy_regular/src/policy_table/validation.cc
@@ -0,0 +1,267 @@
+#include <algorithm>
+#include "policy/policy_table/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_, "Policy")
+
+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_omitted = !app_params.RequestType.is_initialized();
+ bool is_request_type_valid = app_params.RequestType.is_valid();
+ bool is_request_type_empty = app_params.RequestType->empty();
+
+ 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_omitted) {
+ LOG4CXX_WARN(logger_,
+ "App policy RequestTypes omitted."
+ " 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;
+}
+
+#ifdef SDL_REMOTE_CONTROL
+bool ApplicationParams::ValidateModuleTypes() const {
+ // moduleType is optional so see Optional<T>::is_valid()
+ bool is_initialized = moduleType->is_initialized();
+ if (!is_initialized) {
+ // valid if not initialized
+ return true;
+ }
+ bool is_valid = moduleType->is_valid();
+ if (is_valid) {
+ return true;
+ }
+
+ struct IsInvalid {
+ bool operator()(Enum<ModuleType> item) const {
+ return !item.is_valid();
+ }
+ };
+ // cut invalid items
+ moduleType->erase(
+ std::remove_if(moduleType->begin(), moduleType->end(), IsInvalid()),
+ moduleType->end());
+ bool empty = moduleType->empty();
+ if (empty) {
+ // set non initialized value
+ ModuleTypes non_initialized;
+ moduleType = Optional<ModuleTypes>(non_initialized);
+ }
+ return true;
+}
+
+bool ApplicationParams::Validate() const {
+ return ValidateModuleTypes();
+}
+#else // SDL_REMOTE_CONTROL
+bool ApplicationParams::Validate() const {
+ return true;
+}
+#endif // SDL_REMOTE_CONTROL
+
+bool RpcParameters::Validate() const {
+ return true;
+}
+bool Rpcs::Validate() const {
+ return true;
+}
+
+bool ModuleConfig::Validate() const {
+ if (PT_PRELOADED == GetPolicyTableType()) {
+ if (vehicle_make.is_initialized()) {
+ return false;
+ }
+ if (vehicle_year.is_initialized()) {
+ return false;
+ }
+ if (vehicle_model.is_initialized()) {
+ return false;
+ }
+ }
+
+ for (ServiceEndpoints::const_iterator it_endpoints = endpoints.begin();
+ it_endpoints != endpoints.end();
+ ++it_endpoints) {
+ const URLList& endpoint_list = it_endpoints->second;
+ if (endpoint_list.end() == endpoint_list.find(kDefaultApp)) {
+ LOG4CXX_ERROR(logger_,
+ "Endpoint " << it_endpoints->first
+ << "does not contain default group");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool MessageString::Validate() const {
+ return true;
+}
+
+bool MessageLanguages::Validate() const {
+ if (PT_SNAPSHOT == GetPolicyTableType()) {
+ return false;
+ }
+ return true;
+}
+
+bool ConsumerFriendlyMessages::Validate() const {
+ /* According to requirements consumer_friendly_messages are optional for PTU
+ and required for PTP and PTS. So, they are allowed always */
+ if (PT_SNAPSHOT == GetPolicyTableType() && messages.is_initialized()) {
+ return false;
+ }
+ return true;
+}
+
+bool ModuleMeta::Validate() const {
+ return true;
+}
+
+bool AppLevel::Validate() const {
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ return false;
+ }
+ return true;
+}
+
+bool UsageAndErrorCounts::Validate() const {
+ if (PT_PRELOADED == GetPolicyTableType() ||
+ PT_UPDATE == GetPolicyTableType()) {
+ return false;
+ }
+ return true;
+}
+
+bool DeviceParams::Validate() const {
+ return true;
+}
+
+bool PolicyTable::Validate() const {
+ const PolicyTableType policy_table_type = GetPolicyTableType();
+
+ if (PT_PRELOADED == policy_table_type || PT_UPDATE == policy_table_type) {
+ if (device_data.is_initialized()) {
+ return false;
+ }
+ }
+
+ if (PT_PRELOADED == policy_table_type || PT_SNAPSHOT == policy_table_type) {
+ // Check upper bound of each "groups" sub section in the app policies
+ const FunctionalGroupings::size_type functional_groupings_count =
+ functional_groupings.size();
+ for (ApplicationPolicies::const_iterator app_policiies_it =
+ app_policies_section.apps.begin();
+ app_policies_section.apps.end() != app_policiies_it;
+ ++app_policiies_it) {
+ if (app_policiies_it->second.groups.size() > functional_groupings_count) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool Table::Validate() const {
+ return true;
+}
+
+} // namespace policy_table_interface_base
+} // namespace rpc
diff --git a/src/components/policy/src/sql_pt_ext_queries.cc b/src/components/policy/policy_regular/src/sql_pt_ext_queries.cc
index 3fde462a32..3fde462a32 100644
--- a/src/components/policy/src/sql_pt_ext_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_ext_queries.cc
diff --git a/src/components/policy/src/sql_pt_ext_representation.cc b/src/components/policy/policy_regular/src/sql_pt_ext_representation.cc
index c64efaaede..c64efaaede 100644
--- a/src/components/policy/src/sql_pt_ext_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_ext_representation.cc
diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc
new file mode 100644
index 0000000000..ef4ef49273
--- /dev/null
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -0,0 +1,792 @@
+/*
+ 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 "policy/sql_pt_queries.h"
+
+namespace policy {
+namespace sql_pt {
+
+const std::string kSelectPriority =
+ "SELECT `priority_value` FROM `application` WHERE `id` = ? LIMIT 1";
+const std::string kCreateSchema =
+ "BEGIN; "
+ "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 "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `module_meta`( "
+ " `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, "
+ " `flag_update_required` BOOL NOT NULL "
+ "); "
+ "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, "
+ " `certificate` TEXT, "
+ " `vehicle_make` VARCHAR(45), "
+ " `vehicle_model` VARCHAR(45), "
+ " `vehicle_year` VARCHAR(4) "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `functional_group`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `user_consent_prompt` TEXT, "
+ " `name` VARCHAR(100) NOT NULL "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `priority`( "
+ " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `hmi_level`( "
+ " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
+ "); "
+ "CREATE TABLE IF NOT EXISTS `notifications_by_priority`( "
+ " `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL, "
+ " `value` INTEGER NOT NULL, "
+ " 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 "
+ "); "
+ "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 COLLATE NOCASE, "
+ " `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), "
+ " `remote_control_denied` BOOLEAN NOT NULL DEFAULT 0, "
+ " 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 COLLATE NOCASE, "
+ " `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` COLLATE NOCASE); "
+ "CREATE TABLE IF NOT EXISTS `preconsented_group`( "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " `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` COLLATE NOCASE); "
+ "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` VARCHAR(45), "
+ " 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 COLLATE NOCASE, "
+ " `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, "
+ " `count_of_tls_errors` 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` COLLATE NOCASE); "
+ "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 COLLATE NOCASE, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " 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` COLLATE NOCASE); "
+ "CREATE TABLE IF NOT EXISTS `app_type`( "
+ " `name` VARCHAR(50) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " PRIMARY KEY(`name`,`application_id`), "
+ " CONSTRAINT `fk_app_type_application1` "
+ " 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 COLLATE NOCASE, "
+ " 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` COLLATE NOCASE); "
+ "CREATE TABLE IF NOT EXISTS `consent_group`( "
+ " `device_id` VARCHAR(100) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE, "
+ " `functional_group_id` INTEGER NOT NULL, "
+ " `is_consented` BOOL NOT NULL, "
+ " `input` VARCHAR(45), "
+ " `time_stamp` VARCHAR(45), "
+ " 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 COLLATE NOCASE, "
+ " 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` COLLATE NOCASE); "
+ "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`) "
+ "); "
+
+ /* access_module */
+ "CREATE TABLE `access_module`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(45) NOT NULL, "
+ " `user_consent_needed` INTEGER NOT NULL "
+ "); "
+
+ /* remote_rpc */
+ "CREATE TABLE `remote_rpc`( "
+ " `id` INTEGER PRIMARY KEY NOT NULL, "
+ " `name` VARCHAR(255) NOT NULL, "
+ " `parameter` VARCHAR(45), "
+ " `module_id` INTEGER NOT NULL, "
+ "CONSTRAINT `fk_remote_rpc_1` "
+ " FOREIGN KEY(`module_id`) "
+ " REFERENCES `access_module`(`id`) "
+ "); "
+ "CREATE INDEX `remote_rpc.fk_remote_rpc_1_idx` ON "
+ "`remote_rpc`(`module_id`); "
+
+ /* module type */
+ "CREATE TABLE IF NOT EXISTS `module_type`( "
+ " `name` VARCHAR(50) NOT NULL, "
+ " `application_id` VARCHAR(45) NOT NULL, "
+ " PRIMARY KEY(`name`,`application_id`), "
+ " CONSTRAINT `fk_module_type_application1` "
+ " FOREIGN KEY(`application_id`) "
+ " REFERENCES `application`(`id`) "
+ "); "
+ "CREATE INDEX IF NOT EXISTS `module_type.fk_module_type_application1_idx` "
+ " ON `module_type`(`application_id`); "
+
+ "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`);"
+ "CREATE TABLE IF NOT EXISTS `_internal_data`( "
+ " `db_version_hash` INTEGER "
+ " ); "
+ "COMMIT;";
+
+const std::string kInsertInitData =
+ "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); "
+ "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); "
+ "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, 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'); "
+ "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('COMMUNICATION'); "
+ "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NORMAL'); "
+ "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NONE'); "
+ "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'); "
+ "INSERT OR IGNORE INTO `version` (`number`) VALUES('0'); "
+ "INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
+ "";
+
+const std::string kDeleteModuleTypes = "DELETE FROM `module_type`";
+
+const std::string kDeleteAllDevices = "DELETE FROM `device`;";
+
+const std::string kSelectRemoteControlDenied =
+ "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1";
+
+const std::string kUpdateRemoteControlDenied =
+ "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?";
+
+const std::string kDeleteAccessModules = "DELETE FROM `access_module`";
+
+const std::string kDeleteRemoteRpc = "DELETE FROM `remote_rpc`";
+
+const std::string kInsertAccessModule =
+ "INSERT INTO `access_module` (`name`, `user_consent_needed`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectAccessModules =
+ "SELECT `id`, `name` FROM `access_module` "
+ " WHERE `user_consent_needed` = ?";
+
+const std::string kInsertRemoteRpc =
+ "INSERT INTO `remote_rpc` (`module_id`, `name`, `parameter`) "
+ " VALUES(?, ?, ?)";
+
+const std::string kSelectRemoteRpcs =
+ "SELECT `name`, `parameter` FROM `remote_rpc` "
+ " WHERE `module_id` = ?";
+
+const std::string kInsertModuleType =
+ "INSERT OR IGNORE INTO `module_type` (`application_id`, `name`) VALUES (?, "
+ "?)";
+
+const std::string kSelectModuleTypes =
+ "SELECT DISTINCT `name` FROM `module_type` WHERE `application_id` = ?";
+
+const std::string kDropSchema =
+ "BEGIN; "
+ "DROP INDEX IF EXISTS `module_type.fk_module_type_application1_idx`; "
+ "DROP TABLE IF EXISTS `module_type`; "
+ "DROP INDEX IF EXISTS `message.fk_messages_languages1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`message.fk_message_consumer_friendly_messages1_idx`; "
+ "DROP TABLE IF EXISTS `message`; "
+ "DROP INDEX IF EXISTS `endpoint.fk_endpoint_application1_idx`; "
+ "DROP TABLE IF EXISTS `endpoint`; "
+ "DROP INDEX IF EXISTS `consent_group.fk_consent_group_device1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`consent_group.fk_consent_group_functional_group1_idx`; "
+ "DROP TABLE IF EXISTS `consent_group`; "
+ "DROP INDEX IF EXISTS `app_type.fk_app_type_application1_idx`; "
+ "DROP TABLE IF EXISTS `app_type`; "
+ "DROP INDEX IF EXISTS `nickname.fk_nickname_application1_idx`; "
+ "DROP TABLE IF EXISTS `nickname`; "
+ "DROP INDEX IF EXISTS `app_level.fk_app_level_language2_idx`; "
+ "DROP INDEX IF EXISTS `app_level.fk_app_level_language1_idx`; "
+ "DROP INDEX IF EXISTS `app_level.fk_app_levels_application1_idx`; "
+ "DROP TABLE IF EXISTS `app_level`; "
+ "DROP INDEX IF EXISTS "
+ "`device_consent_group.fk_device_has_functional_group_device1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`device_consent_group.fk_device_has_functional_group_functional_group1_"
+ "idx`; "
+ "DROP TABLE IF EXISTS `device_consent_group`; "
+ "DROP TABLE IF EXISTS `seconds_between_retry`; "
+ "DROP INDEX IF EXISTS "
+ "`preconsented_group.fk_application_has_functional_group_application2_idx`;"
+ " "
+ "DROP INDEX IF EXISTS "
+ "`preconsented_group.fk_application_has_functional_group_functional_group2_"
+ "idx`; "
+ "DROP TABLE IF EXISTS `preconsented_group`; "
+ "DROP TABLE IF EXISTS `access_module`; "
+ "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`app_group.fk_application_has_functional_group_application1_idx`; "
+ "DROP INDEX IF EXISTS "
+ "`app_group.fk_application_has_functional_group_functional_group1_idx`; "
+ "DROP TABLE IF EXISTS `app_group`; "
+ "DROP INDEX IF EXISTS `application.fk_application_priorities1_idx`; "
+ "DROP INDEX IF EXISTS `application.fk_application_hmi_level1_idx`; "
+ "DROP TABLE IF EXISTS `application`; "
+ "DROP INDEX IF EXISTS `rpc.select_rpc_name_hmi_level`; "
+ "DROP INDEX IF EXISTS `rpc.fk_rpc_functional_group1_idx`; "
+ "DROP INDEX IF EXISTS `rpc.fk_rpc_hmi_level1_idx`; "
+ "DROP TABLE IF EXISTS `rpc`; "
+ "DROP TABLE IF EXISTS `version`; "
+ "DROP TABLE IF EXISTS `message_type`; "
+ "DROP TABLE IF EXISTS `language`; "
+ "DROP INDEX IF EXISTS "
+ "`notifications_by_priority.fk_notifications_by_priority_priority1_idx`; "
+ "DROP TABLE IF EXISTS `notifications_by_priority`; "
+ "DROP TABLE IF EXISTS `hmi_level`; "
+ "DROP TABLE IF EXISTS `priority`; "
+ "DROP TABLE IF EXISTS `functional_group`; "
+ "DROP TABLE IF EXISTS `module_config`; "
+ "DROP TABLE IF EXISTS `remote_rpc`; "
+ "DROP INDEX IF EXISTS `remote_rpc.fk_remote_rpc_1_idx`; "
+ "DROP TABLE IF EXISTS `module_meta`; "
+ "DROP TABLE IF EXISTS `usage_and_error_count`; "
+ "DROP TABLE IF EXISTS `device`; "
+ "DROP TABLE IF EXISTS `_internal_data`; "
+ "COMMIT; "
+ "VACUUM;";
+
+const std::string kDeleteData =
+ "BEGIN; "
+ "DELETE FROM `message`; "
+ "DELETE FROM `module_type`; "
+ "DELETE FROM `endpoint`; "
+ "DELETE FROM `consent_group`; "
+ "DELETE FROM `app_type`; "
+ "DELETE FROM `nickname`; "
+ "DELETE FROM `app_level`; "
+ "DELETE FROM `device_consent_group`; "
+ "DELETE FROM `seconds_between_retry`; "
+ "DELETE FROM `preconsented_group`; "
+ "DELETE FROM `app_group`; "
+ "DELETE FROM `application`; "
+ "DELETE FROM `rpc`; "
+ "DELETE FROM `access_module`; "
+ "DELETE FROM `version`; "
+ "DELETE FROM `message_type`; "
+ "DELETE FROM `language`; "
+ "DELETE FROM `notifications_by_priority`; "
+ "DELETE FROM `hmi_level`; "
+ "DELETE FROM `priority`; "
+ "DELETE FROM `functional_group`; "
+ "DELETE FROM `module_config`; "
+ "DELETE FROM `module_meta`; "
+ "DELETE FROM `remote_rpc`; "
+ "DELETE FROM `usage_and_error_count`; "
+ "DELETE FROM `device`; "
+ "COMMIT; "
+ "VACUUM;";
+
+const std::string kCheckDBIntegrity = "PRAGMA integrity_check";
+
+const std::string kCheckPgNumber = "PRAGMA page_count";
+
+const std::string kSelectRpc =
+ "SELECT DISTINCT `rpc`.`parameter` FROM `rpc` "
+ " JOIN `app_group` AS `g` ON (`g`.`functional_group_id` = "
+ "`rpc`.`functional_group_id` "
+ " AND (`g`.`application_id` = ?)) "
+ "WHERE `rpc`.`hmi_level_value` = ? AND `rpc`.`name` = ?";
+
+const std::string kSelectPreloaded =
+ "SELECT `preloaded_pt` FROM `module_config` "
+ "WHERE `preloaded_pt` = 1 LIMIT 1";
+
+const std::string kUpdatePreloaded =
+ "UPDATE `module_config` SET `preloaded_pt` = ?";
+
+const std::string kIsFirstRun = "SELECT `is_first_run` FROM `module_config` ";
+
+const std::string kSetNotFirstRun =
+ "UPDATE `module_config` SET `is_first_run`= 0 ";
+
+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 (?, ?, ?)";
+
+const std::string kInsertRpc =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
+ " VALUES (?, ?, ?)";
+
+const std::string kInsertRpcWithParameter =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `parameter`, "
+ "`functional_group_id`) "
+ " VALUES (?, ?, ?, ?)";
+
+const std::string kInsertApplication =
+ "INSERT OR IGNORE INTO `application` (`id`, `priority_value`, "
+ "`is_revoked`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `certificate`) VALUES (?,?,?,?,?,?)";
+
+const std::string kInsertAppGroup =
+ "INSERT INTO `app_group` (`application_id`, `functional_group_id`)"
+ " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
+
+const std::string kInsertNickname =
+ "INSERT OR IGNORE INTO `nickname` (`application_id`, `name`) VALUES (?, ?)";
+
+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 =
+ "INSERT OR IGNORE INTO `message_type` (`name`) VALUES (?)";
+
+const std::string kInsertLanguage =
+ "INSERT OR IGNORE INTO `language` (`code`) VALUES (?)";
+
+const std::string kInsertMessageString =
+ "INSERT INTO `message` (`language_code`, `message_type_name`) "
+ "VALUES (?, ?)";
+
+const std::string kUpdateModuleConfig =
+ "UPDATE `module_config` SET `preloaded_pt` = ?, "
+ " `exchange_after_x_ignition_cycles` = ?,"
+ " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, "
+ " `timeout_after_x_seconds` = ?, `certificate` = ?, `vehicle_make` = ?, "
+ " `vehicle_model` = ?, `vehicle_year` = ? ";
+
+const std::string kInsertEndpoint =
+ "INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
+ " VALUES (?, ?, ?)";
+
+const std::string kInsertSecondsBetweenRetry =
+ "INSERT INTO `seconds_between_retry` (`index`, `value`) VALUES (?, ?)";
+
+const std::string kInsertNotificationsByPriority =
+ "INSERT OR REPLACE INTO `notifications_by_priority` (`priority_value`, "
+ "`value`) "
+ " VALUES (?, ?)";
+
+const std::string kInsertDeviceData =
+ "INSERT OR IGNORE INTO `device` (`id`) VALUES (?)";
+
+const std::string kInsertAppLevel =
+ "INSERT INTO `app_level` (`application_id`, `count_of_tls_errors`) "
+ "VALUES(?,?)";
+
+const std::string kDeleteSecondsBetweenRetries =
+ "DELETE FROM `seconds_between_retry`";
+
+const std::string kDeleteEndpoint = "DELETE FROM `endpoint`";
+
+const std::string kDeleteAppLevel = "DELETE FROM `app_level`";
+
+const std::string kDeleteMessageString = "DELETE FROM `message`";
+
+const std::string kDeleteFunctionalGroup = "DELETE FROM `functional_group`";
+
+const std::string kDeleteRpc = "DELETE FROM `rpc`";
+
+const std::string kDeleteAppGroup = "DELETE FROM `app_group`";
+
+const std::string kSelectModuleConfig =
+ "SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, "
+ " `exchange_after_x_kilometers`, `exchange_after_x_days`, "
+ " `timeout_after_x_seconds`, `certificate`, `vehicle_make`,"
+ " `vehicle_model`, `vehicle_year` "
+ " FROM `module_config`";
+
+const std::string kSelectEndpoints =
+ "SELECT `url`, `service`, `application_id` FROM `endpoint` ";
+
+const std::string kSelectNotificationsPerMin =
+ "SELECT `priority_value`, `value` FROM notifications_by_priority";
+
+const std::string kSelectNotificationsPerPriority =
+ "SELECT `value` FROM notifications_by_priority WHERE `priority_value` = ? ";
+
+const std::string kSelectAppLevels =
+ "SELECT `application_id`, `count_of_tls_errors` "
+ "FROM `app_level`";
+
+const std::string kSelectDeviceData = "SELECT * FROM `device`";
+
+const std::string kSelectFunctionalGroups =
+ "SELECT `id`,`name`, `user_consent_prompt` "
+ "FROM `functional_group`";
+
+const std::string kSelectAllRpcs =
+ "SELECT `name`, `hmi_level_value`, `parameter` "
+ "FROM `rpc` WHERE `functional_group_id` = ? ";
+
+const std::string kSelectUserMsgsVersion =
+ "SELECT DISTINCT `number` FROM `version`";
+
+const std::string kSelectAppPolicies =
+ "SELECT `id`, `priority_value`, `memory_kb`, "
+ " `heart_beat_timeout_ms`, `certificate` FROM `application`";
+
+const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
+
+const std::string kSelectAppGroups =
+ "SELECT `f`.`name` FROM `app_group` AS `a`"
+ " LEFT JOIN `functional_group` AS `f` "
+ " ON (`f`.`id` = `a`.`functional_group_id`)"
+ " WHERE `a`.`application_id` = ?";
+
+const std::string kSelectNicknames =
+ "SELECT DISTINCT `name` FROM `nickname` "
+ "WHERE `application_id` = ?";
+
+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`";
+
+const std::string kSelectIgnitionCycles =
+ "SELECT `c`.`exchange_after_x_ignition_cycles`, "
+ " `m`.`ignition_cycles_since_last_exchange` "
+ " FROM `module_config` AS `c`, `module_meta` AS `m` "
+ "LIMIT 1";
+
+const std::string kSelectKilometers =
+ "SELECT `c`.`exchange_after_x_kilometers`, "
+ " `m`.`pt_exchanged_at_odometer_x` "
+ " FROM `module_config` AS `c`, `module_meta` AS `m` "
+ "LIMIT 1";
+
+const std::string kSelectDays =
+ "SELECT `c`.`exchange_after_x_days`, "
+ " `m`.`pt_exchanged_x_days_after_epoch` "
+ " FROM `module_config` AS `c`, `module_meta` AS `m` "
+ "LIMIT 1";
+
+const std::string kIncrementIgnitionCycles =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 1 + "
+ " `ignition_cycles_since_last_exchange`";
+
+const std::string kResetIgnitionCycles =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 0";
+
+const std::string kSelectTimeoutResponse =
+ "SELECT `timeout_after_x_seconds` FROM `module_config` LIMIT 1";
+
+const std::string kUpdateFlagUpdateRequired =
+ "UPDATE `module_meta` SET `flag_update_required` = ?";
+
+const std::string kSelectFlagUpdateRequired =
+ "SELECT `flag_update_required` FROM `module_meta` LIMIT 1";
+
+const std::string kUpdateCountersSuccessfulUpdate =
+ "UPDATE `module_meta` SET `pt_exchanged_at_odometer_x` = ?,"
+ "`pt_exchanged_x_days_after_epoch` = ?";
+
+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` = ?";
+
+const std::string kUpdateApplicationCustomData =
+ "UPDATE `application` SET `is_revoked` = ?, `is_default` = ?,"
+ "`is_predata` = ? WHERE `id` = ?";
+
+const std::string kSelectApplicationRepresented =
+ "SELECT COUNT(`id`) FROM `application` WHERE `id` = ?";
+
+const std::string kSelectApplicationIsDefault =
+ "SELECT `is_default` FROM `application` WHERE `id` = ?";
+
+const std::string kUpdateIsDefault =
+ "UPDATE `application` SET `is_default` = ? WHERE `id` = ?";
+
+const std::string kDeleteDevice = "DELETE FROM `device` WHERE `id` = ?";
+
+const std::string kDeleteAppGroupByApplicationId =
+ "DELETE FROM `app_group` WHERE `application_id` = ?";
+
+const std::string kInsertApplicationFull =
+ "INSERT OR IGNORE INTO `application` (`id`, `keep_context`, `steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, "
+ " `memory_kb`, `heart_beat_timeout_ms`, `certificate`) "
+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+
+const std::string kSelectApplicationFull =
+ "SELECT `keep_context`, `steal_focus`, `default_hmi`, `priority_value`, "
+ " `is_revoked`, `is_default`, `is_predata`, `memory_kb`,"
+ " `heart_beat_timeout_ms`, `certificate` FROM `application` WHERE `id` = "
+ "?";
+
+const std::string kSelectDBVersion =
+ "SELECT `db_version_hash` from `_internal_data`";
+
+const std::string kUpdateDBVersion =
+ "UPDATE `_internal_data` SET `db_version_hash` = ? ";
+
+const std::string kSaveModuleMeta =
+ "UPDATE `module_meta` SET "
+ "`pt_exchanged_at_odometer_x` = ?, "
+ "`pt_exchanged_x_days_after_epoch` = ?, "
+ "`ignition_cycles_since_last_exchange` = ? ";
+
+const std::string kSelectModuleMeta = "SELECT* FROM `module_meta`";
+
+} // namespace sql_pt
+} // namespace policy
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
new file mode 100644
index 0000000000..9840a08b26
--- /dev/null
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -0,0 +1,2007 @@
+/*
+ Copyright (c) 2013, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <stdlib.h>
+#include <stdint.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "utils/logger.h"
+#include "utils/date_time.h"
+#include "utils/file_system.h"
+#include "utils/gen_hash.h"
+#include "policy/sql_pt_representation.h"
+#include "policy/sql_wrapper.h"
+#include "policy/sql_pt_queries.h"
+#include "policy/policy_helper.h"
+#include "policy/cache_manager.h"
+#include "config_profile/profile.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+namespace {
+template <typename T, typename K>
+void InsertUnique(K value, T* array) {
+ uint32_t i = 0;
+ for (; i < array->size() && array->at(i) != value; ++i) {
+ continue;
+ }
+ if (array->size() == i) {
+ array->push_back(value);
+ }
+}
+} // namespace
+
+const std::string SQLPTRepresentation::kDatabaseName = "policy";
+
+SQLPTRepresentation::SQLPTRepresentation()
+ : db_(new utils::dbms::SQLDatabase(kDatabaseName)) {}
+
+SQLPTRepresentation::~SQLPTRepresentation() {
+ db_->Close();
+ delete db_;
+}
+
+void SQLPTRepresentation::CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result) {
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(sql_pt::kSelectRpc)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select statement from rpcs"
+ << query.LastError().text());
+ return;
+ }
+ query.Bind(0, app_id);
+ query.Bind(1, hmi_level);
+ query.Bind(2, rpc);
+
+ bool ret = query.Next();
+ result.hmi_level_permitted = ret ? kRpcAllowed : kRpcDisallowed;
+ LOG4CXX_INFO(logger_,
+ "Level is " << (result.hmi_level_permitted == kRpcAllowed
+ ? "permitted"
+ : "not permitted"));
+ std::string parameter;
+ while (ret) {
+ if (!query.IsNull(0)) {
+ parameter = query.GetString(0);
+ result.list_of_allowed_params.insert(parameter);
+ }
+ ret = query.Next();
+ }
+}
+
+bool SQLPTRepresentation::IsPTPreloaded() {
+ utils::dbms::SQLQuery query(db());
+ return query.Prepare(sql_pt::kSelectPreloaded) && query.Next();
+}
+
+int SQLPTRepresentation::IgnitionCyclesBeforeExchange() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectIgnitionCycles) || !query.Exec()) {
+ LOG4CXX_WARN(logger_, "Can not select ignition cycles");
+ return 0;
+ }
+ int limit = query.GetInteger(0);
+ int current = query.GetInteger(1);
+
+ if (limit < 0 || current < 0 || current > limit) {
+ return 0;
+ }
+
+ return limit - current;
+}
+
+int SQLPTRepresentation::KilometersBeforeExchange(int current) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectKilometers) || !query.Exec()) {
+ LOG4CXX_WARN(logger_, "Can not select kilometers");
+ return 0;
+ }
+ int limit = query.GetInteger(0);
+ int last = query.GetInteger(1);
+
+ if (limit < 0 || last < 0 || current < 0 || current < last ||
+ limit < (current - last)) {
+ return 0;
+ }
+
+ return limit - (current - last);
+}
+
+bool SQLPTRepresentation::SetCountersPassedForSuccessfulUpdate(
+ int kilometers, int days_after_epoch) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateCountersSuccessfulUpdate)) {
+ LOG4CXX_WARN(logger_,
+ "Wrong update query for counters on successful update.");
+ return false;
+ }
+ query.Bind(0, kilometers);
+ query.Bind(1, days_after_epoch);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to update counters on successful update.");
+ return false;
+ }
+ return true;
+}
+
+int SQLPTRepresentation::DaysBeforeExchange(int current) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectDays) || !query.Exec()) {
+ LOG4CXX_WARN(logger_, "Can not select days");
+ return 0;
+ }
+ int limit = query.GetInteger(0);
+ int last = query.GetInteger(1);
+
+ if (0 == last) {
+ return limit;
+ }
+
+ if (limit < 0 || last < 0 || current < 0 || current < last ||
+ limit < (current - last)) {
+ return 0;
+ }
+
+ return limit - (current - last);
+}
+
+int SQLPTRepresentation::TimeoutResponse() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
+ LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
+ const int defaultTimeout = 30 * date_time::DateTime::MILLISECONDS_IN_SECOND;
+ return defaultTimeout;
+ }
+ return query.GetInteger(0) * date_time::DateTime::MILLISECONDS_IN_SECOND;
+}
+
+bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectSecondsBetweenRetries)) {
+ LOG4CXX_INFO(logger_,
+ "Incorrect select statement from seconds between retries");
+ return false;
+ }
+ while (query.Next()) {
+ seconds->push_back(query.GetInteger(0));
+ }
+ return true;
+}
+
+std::vector<UserFriendlyMessage> SQLPTRepresentation::GetUserFriendlyMsg(
+ const std::vector<std::string>& msg_codes, const std::string& language) {
+ std::vector<UserFriendlyMessage> result;
+ 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) {
+ UserFriendlyMessage msg;
+ msg.message_code = *it;
+ result.push_back(msg);
+ }
+ return result;
+}
+
+EndpointUrls SQLPTRepresentation::GetUpdateUrls(int service_type) {
+ LOG4CXX_INFO(logger_,
+ "SQLPTRepresentation::GetUpdateUrls for " << service_type);
+ utils::dbms::SQLQuery query(db());
+ EndpointUrls ret;
+ if (query.Prepare(sql_pt::kSelectEndpoint)) {
+ query.Bind(0, service_type);
+ while (query.Next()) {
+ EndpointData data;
+
+ data.url.push_back(query.GetString(0));
+ if (!query.IsNull(1)) {
+ data.app_id = query.GetString(1);
+ }
+ ret.push_back(data);
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Invalid select endpoints statement.");
+ }
+ return ret;
+}
+
+std::string SQLPTRepresentation::GetLockScreenIconUrl() const {
+ utils::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_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectNotificationsPerPriority)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect select statement for priority "
+ "notification number.");
+ return 0;
+ }
+ query.Bind(0, priority);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect select from notifications by priority.");
+ return 0;
+ }
+
+ if (!query.IsNull(0)) {
+ return query.GetInteger(0);
+ }
+
+ return 0;
+}
+
+bool SQLPTRepresentation::GetPriority(const std::string& policy_app_id,
+ std::string* priority) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (NULL == priority) {
+ LOG4CXX_WARN(logger_, "Input priority parameter is null.");
+ return false;
+ }
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectPriority)) {
+ LOG4CXX_INFO(logger_, "Incorrect statement for priority.");
+ return false;
+ }
+
+ query.Bind(0, policy_app_id);
+
+ if (!query.Exec()) {
+ LOG4CXX_INFO(logger_, "Error during select priority.");
+ return false;
+ }
+
+ if (query.IsNull(0)) {
+ priority->clear();
+ return true;
+ }
+
+ priority->assign(query.GetString(0));
+
+ return true;
+}
+
+InitResult SQLPTRepresentation::Init(const PolicySettings* settings) {
+ settings_ = settings;
+ LOG4CXX_AUTO_TRACE(logger_);
+#ifdef BUILD_TESTS
+ open_counter_ = 0;
+#endif // BUILD_TESTS
+ std::string path = get_settings().app_storage_folder();
+ if (!path.empty()) {
+ db_->set_path(path + "/");
+ }
+ if (!db_->Open()) {
+ LOG4CXX_ERROR(logger_, "Failed opening database.");
+ LOG4CXX_INFO(logger_, "Starting opening retries.");
+ const uint16_t attempts = get_settings().attempts_to_open_policy_db();
+ LOG4CXX_DEBUG(logger_, "Total attempts number is: " << attempts);
+ bool is_opened = false;
+ const uint16_t open_attempt_timeout_ms =
+ get_settings().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);
+#ifdef BUILD_TESTS
+ ++open_counter_;
+#endif // BUILD_TESTS
+ 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__
+ utils::dbms::SQLQuery check_pages(db());
+ if (!check_pages.Prepare(sql_pt::kCheckPgNumber) || !check_pages.Next()) {
+ LOG4CXX_WARN(logger_, "Incorrect pragma for page counting.");
+ } else {
+ if (0 < check_pages.GetInteger(0)) {
+ utils::dbms::SQLQuery db_check(db());
+ if (!db_check.Prepare(sql_pt::kCheckDBIntegrity)) {
+ LOG4CXX_WARN(logger_, "Incorrect pragma for integrity check.");
+ } else {
+ while (db_check.Next()) {
+ if (db_check.GetString(0).compare("ok") == 0) {
+ utils::dbms::SQLQuery check_first_run(db());
+ if (check_first_run.Prepare(sql_pt::kIsFirstRun) &&
+ check_first_run.Next()) {
+ LOG4CXX_INFO(logger_,
+ "Selecting is first run "
+ << check_first_run.GetBoolean(0));
+ if (check_first_run.GetBoolean(0)) {
+ utils::dbms::SQLQuery set_not_first_run(db());
+ set_not_first_run.Exec(sql_pt::kSetNotFirstRun);
+ return InitResult::SUCCESS;
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Incorrect select is first run");
+ }
+ return InitResult::EXISTS;
+ } else {
+ LOG4CXX_ERROR(logger_,
+ "Existing policy table representation is invlaid.");
+ // TODO(PV): add handle
+ return InitResult::FAIL;
+ }
+ }
+ }
+ }
+ }
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kCreateSchema)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed creating schema of database: " << query.LastError().text());
+ return InitResult::FAIL;
+ }
+ if (!query.Exec(sql_pt::kInsertInitData)) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Failed insert init data to database: " << query.LastError().text());
+ return InitResult::FAIL;
+ }
+ return InitResult::SUCCESS;
+}
+
+bool SQLPTRepresentation::Close() {
+ db_->Close();
+ return db_->LastError().number() == utils::dbms::OK;
+}
+
+const VehicleInfo SQLPTRepresentation::GetVehicleInfo() const {
+ policy_table::ModuleConfig module_config;
+ GatherModuleConfig(&module_config);
+ VehicleInfo vehicle_info;
+ vehicle_info.vehicle_make = *module_config.vehicle_make;
+ vehicle_info.vehicle_model = *module_config.vehicle_model;
+ vehicle_info.vehicle_year = *module_config.vehicle_year;
+ return vehicle_info;
+}
+
+bool SQLPTRepresentation::Drop() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDropSchema)) {
+ LOG4CXX_WARN(logger_,
+ "Failed dropping database: " << query.LastError().text());
+ return false;
+ }
+ return true;
+}
+
+void SQLPTRepresentation::WriteDb() {
+ db_->Backup();
+}
+
+bool SQLPTRepresentation::Clear() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteData)) {
+ LOG4CXX_ERROR(logger_,
+ "Failed clearing 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;
+}
+
+bool SQLPTRepresentation::RefreshDB() {
+ utils::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_AUTO_TRACE(logger_);
+ utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
+ GatherModuleMeta(&*table->policy_table.module_meta);
+ GatherModuleConfig(&table->policy_table.module_config);
+ GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
+ GatherDeviceData(&*table->policy_table.device_data);
+ GatherFunctionalGroupings(&table->policy_table.functional_groupings);
+ GatherConsumerFriendlyMessages(
+ &*table->policy_table.consumer_friendly_messages);
+ GatherApplicationPoliciesSection(&table->policy_table.app_policies_section);
+ return table;
+}
+
+void SQLPTRepresentation::GatherModuleMeta(
+ policy_table::ModuleMeta* meta) const {
+ LOG4CXX_INFO(logger_, "Gather Module Meta Info");
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt::kSelectModuleMeta) && query.Next()) {
+ *meta->pt_exchanged_at_odometer_x = query.GetInteger(0);
+ *meta->pt_exchanged_x_days_after_epoch = query.GetInteger(1);
+ *meta->ignition_cycles_since_last_exchange = query.GetInteger(2);
+ }
+}
+
+void SQLPTRepresentation::GatherModuleConfig(
+ policy_table::ModuleConfig* config) const {
+ LOG4CXX_INFO(logger_, "Gather Configuration Info");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectModuleConfig) || !query.Next()) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement for module config");
+ } else {
+ *config->preloaded_pt = query.GetBoolean(0);
+ config->exchange_after_x_ignition_cycles = query.GetInteger(1);
+ config->exchange_after_x_kilometers = query.GetInteger(2);
+ config->exchange_after_x_days = query.GetInteger(3);
+ config->timeout_after_x_seconds = query.GetInteger(4);
+ *config->certificate = query.GetString(5);
+ *config->vehicle_make = query.GetString(6);
+ *config->vehicle_model = query.GetString(7);
+ *config->vehicle_year = query.GetString(8);
+ *config->preloaded_date = query.GetString(9);
+ }
+
+ utils::dbms::SQLQuery endpoints(db());
+ if (!endpoints.Prepare(sql_pt::kSelectEndpoints)) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints");
+ } else {
+ while (endpoints.Next()) {
+ const std::string& url = endpoints.GetString(0);
+ const std::string& service = endpoints.GetString(1);
+ const std::string& app_id = endpoints.GetString(2);
+ config->endpoints[service][app_id].push_back(url);
+ }
+ }
+
+ utils::dbms::SQLQuery notifications(db());
+ if (!notifications.Prepare(sql_pt::kSelectNotificationsPerMin)) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement for notifications");
+ } else {
+ while (notifications.Next()) {
+ config->notifications_per_minute_by_priority[notifications.GetString(0)] =
+ notifications.GetInteger(1);
+ }
+ }
+ utils::dbms::SQLQuery seconds(db());
+ if (!seconds.Prepare(sql_pt::kSelectSecondsBetweenRetries)) {
+ LOG4CXX_INFO(logger_,
+ "Incorrect select statement from seconds between retries");
+ } else {
+ while (seconds.Next()) {
+ config->seconds_between_retries.push_back(seconds.GetInteger(0));
+ }
+ }
+}
+
+bool SQLPTRepresentation::GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const {
+ LOG4CXX_INFO(logger_, "Gather Usage and Error Counts.");
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt::kSelectAppLevels)) {
+ policy_table::AppLevel app_level;
+ app_level.mark_initialized();
+ while (query.Next()) {
+ app_level.count_of_tls_errors = query.GetInteger(1);
+ const std::string app_id = query.GetString(0);
+ (*counts->app_level)[app_id] = app_level;
+ }
+ return true;
+ }
+ return false;
+}
+
+void SQLPTRepresentation::GatherDeviceData(
+ policy_table::DeviceData* data) const {
+ LOG4CXX_INFO(logger_, "Gather device data.");
+ data->mark_initialized();
+
+ utils::dbms::SQLQuery query(db());
+ if (query.Prepare(sql_pt::kSelectDeviceData)) {
+ policy_table::DeviceParams device_data;
+ device_data.mark_initialized();
+ while (query.Next()) {
+ const std::string device_id = query.GetString(0);
+ (*data)[device_id] = device_data;
+ }
+ }
+}
+
+bool SQLPTRepresentation::GatherFunctionalGroupings(
+ policy_table::FunctionalGroupings* groups) const {
+ LOG4CXX_INFO(logger_, "Gather Functional Groupings info");
+ utils::dbms::SQLQuery functional_group(db());
+ if (!functional_group.Prepare(sql_pt::kSelectFunctionalGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from functional_groupings");
+ return false;
+ }
+ utils::dbms::SQLQuery rpcs(db());
+ if (!rpcs.Prepare(sql_pt::kSelectAllRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select all from rpc");
+ return false;
+ }
+
+ while (functional_group.Next()) {
+ policy_table::Rpcs rpcs_structure;
+
+ if (!functional_group.IsNull(2)) {
+ *rpcs_structure.user_consent_prompt = functional_group.GetString(2);
+ }
+
+ const int group_id = functional_group.GetInteger(0);
+
+ // Collecting RPCs with their HMI levels and parameters (if any)
+ rpcs.Bind(0, group_id);
+ while (rpcs.Next()) {
+ if (!rpcs.IsNull(1)) {
+ policy_table::HmiLevel level;
+ if (policy_table::EnumFromJsonString(rpcs.GetString(1), &level)) {
+ InsertUnique(level,
+ &rpcs_structure.rpcs[rpcs.GetString(0)].hmi_levels);
+ }
+ }
+ if (!rpcs.IsNull(2)) {
+ policy_table::Parameter param;
+ if (EnumFromJsonString(rpcs.GetString(2), &param)) {
+ // EMPTY is a special mark to specify that 'parameters' section is
+ // present, but has no parameters. It is not valid parameter value.
+ if (policy_table::P_EMPTY == param) {
+ (*rpcs_structure.rpcs[rpcs.GetString(0)].parameters)
+ .mark_initialized();
+ continue;
+ }
+ InsertUnique(param,
+ &(*rpcs_structure.rpcs[rpcs.GetString(0)].parameters));
+ }
+ }
+ }
+
+ rpcs.Reset();
+
+ if (!rpcs_structure.rpcs.is_initialized()) {
+ rpcs_structure.rpcs.set_to_null();
+ }
+ policy_table::Rpcs& group_rpcs_structure =
+ (*groups)[functional_group.GetString(1)];
+ group_rpcs_structure = rpcs_structure;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) const {
+ LOG4CXX_INFO(logger_, "Gather Consumer Friendly Messages");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectUserMsgsVersion) || !query.Next()) {
+ LOG4CXX_WARN(logger_, "Incorrect select from consumer_friendly_messages");
+ return false;
+ }
+
+ messages->version = query.GetString(0);
+
+ if (query.Prepare(sql_pt::kCollectFriendlyMsg)) {
+ while (query.Next()) {
+ UserFriendlyMessage msg;
+ msg.message_code = query.GetString(7);
+ std::string language = query.GetString(6);
+
+ (*messages->messages)[msg.message_code].languages[language];
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages.");
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const {
+ LOG4CXX_INFO(logger_, "Gather applications policies");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAppPolicies)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app_policies");
+ return false;
+ }
+
+ while (query.Next()) {
+ rpc::Nullable<policy_table::ApplicationParams> params;
+ const std::string& app_id = query.GetString(0);
+ if (IsApplicationRevoked(app_id)) {
+ params.set_to_null();
+ (*policies).apps[app_id] = params;
+ continue;
+ }
+ if (IsDefaultPolicy(app_id)) {
+ (*policies).apps[app_id].set_to_string(kDefaultId);
+ }
+ if (IsPredataPolicy(app_id)) {
+ (*policies).apps[app_id].set_to_string(kPreDataConsentId);
+ }
+ if (kDeviceId == app_id) {
+ // 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);
+ params.priority = priority;
+
+ *params.memory_kb = query.GetInteger(2);
+
+ *params.heart_beat_timeout_ms = query.GetUInteger(3);
+ if (!query.IsNull(3)) {
+ *params.certificate = query.GetString(4);
+ }
+ if (!GatherAppGroup(app_id, &params.groups)) {
+ return false;
+ }
+#ifdef SDL_REMOTE_CONTROL
+ bool denied = false;
+ if (!GatherRemoteControlDenied(app_id, &denied)) {
+ return false;
+ }
+ if (!denied) {
+ if (!GatherModuleType(app_id, &*params.moduleType)) {
+ return false;
+ }
+ }
+#endif // SDL_REMOTE_CONTROL
+ if (!GatherNickName(app_id, &*params.nicknames)) {
+ return false;
+ }
+ if (!GatherAppType(app_id, &*params.AppHMIType)) {
+ return false;
+ }
+ if (!GatherRequestType(app_id, &*params.RequestType)) {
+ return false;
+ }
+
+ (*policies).apps[app_id] = params;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::Save(const policy_table::Table& table) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ db_->BeginTransaction();
+ if (!SaveFunctionalGroupings(table.policy_table.functional_groupings)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveApplicationPoliciesSection(
+ table.policy_table.app_policies_section)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveModuleConfig(table.policy_table.module_config)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveConsumerFriendlyMessages(
+ *table.policy_table.consumer_friendly_messages)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+
+ if (!SaveDeviceData(*table.policy_table.device_data)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveUsageAndErrorCounts(*table.policy_table.usage_and_error_counts)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ if (!SaveModuleMeta(*table.policy_table.module_meta)) {
+ db_->RollbackTransaction();
+ return false;
+ }
+ db_->CommitTransaction();
+ return true;
+}
+
+bool SQLPTRepresentation::SaveFunctionalGroupings(
+ const policy_table::FunctionalGroupings& groups) {
+ utils::dbms::SQLQuery query_delete(db());
+ if (!query_delete.Exec(sql_pt::kDeleteRpc)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from rpc.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteFunctionalGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from seconds between retries.");
+ return false;
+ }
+ if (!query.Prepare(sql_pt::kInsertFunctionalGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for functional groups");
+ return false;
+ }
+
+ policy_table::FunctionalGroupings::const_iterator it;
+
+ for (it = groups.begin(); it != groups.end(); ++it) {
+ // Since we uses this id in other tables, we have to be sure
+ // that id for certain group will be same in case when
+ // we drop records from the table and add them again.
+ // That's why we use hash as a primary key insted of
+ // simple auto incremental index.
+ const long int id = abs(CacheManager::GenerateHash(it->first));
+ // SQLite's Bind doesn support 'long' type
+ // So we need to explicitly cast it to int64_t
+ // to avoid ambiguity.
+ query.Bind(0, static_cast<int64_t>(id));
+ query.Bind(1, it->first);
+ it->second.user_consent_prompt.is_initialized()
+ ? query.Bind(2, *(it->second.user_consent_prompt))
+ : query.Bind(2);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into functional groups");
+ return false;
+ }
+
+ if (!SaveRpcs(query.LastInsertId(), it->second.rpcs)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
+ const policy_table::Rpc& rpcs) {
+ utils::dbms::SQLQuery query(db());
+ utils::dbms::SQLQuery query_parameter(db());
+ if (!query.Prepare(sql_pt::kInsertRpc) ||
+ !query_parameter.Prepare(sql_pt::kInsertRpcWithParameter)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for rpc");
+ return false;
+ }
+
+ policy_table::Rpc::const_iterator it;
+ for (it = rpcs.begin(); it != rpcs.end(); ++it) {
+ const policy_table::HmiLevels& hmi_levels = it->second.hmi_levels;
+ // TODO(IKozyrenko): Check logic if optional container is missing
+ const policy_table::Parameters& parameters = *it->second.parameters;
+ policy_table::HmiLevels::const_iterator hmi_it;
+ policy_table::Parameters::const_iterator ps_it;
+ for (hmi_it = hmi_levels.begin(); hmi_it != hmi_levels.end(); ++hmi_it) {
+ if (!parameters.empty()) {
+ 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)));
+ query_parameter.Bind(
+ 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");
+ return false;
+ }
+ }
+ } else if (parameters.is_initialized()) {
+ query_parameter.Bind(0, it->first);
+ query_parameter.Bind(
+ 1, std::string(policy_table::EnumToJsonString(*hmi_it)));
+ query_parameter.Bind(
+ 2,
+ std::string(policy_table::EnumToJsonString(policy_table::P_EMPTY)));
+ query_parameter.Bind(3, group_id);
+ if (!query_parameter.Exec() || !query_parameter.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into rpc with parameter");
+ return false;
+ }
+ } else {
+ query.Bind(0, it->first);
+ query.Bind(1, std::string(policy_table::EnumToJsonString(*hmi_it)));
+ query.Bind(2, group_id);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into rpc");
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveApplicationPoliciesSection(
+ const policy_table::ApplicationPoliciesSection& policies) {
+ utils::dbms::SQLQuery query_delete(db());
+ if (!query_delete.Exec(sql_pt::kDeleteAppGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
+ return false;
+ }
+#ifdef SDL_REMOTE_CONTROL
+ if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from module_type.");
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
+ if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from application.");
+ return false;
+ }
+
+ 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 =
+ 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 =
+ policies.apps.find(kPreDataConsentId);
+ if (policies.apps.end() != it_pre_data_consented) {
+ if (!SaveSpecificAppPolicy(*it_pre_data_consented)) {
+ return false;
+ }
+ }
+
+ if (!SaveDevicePolicy(policies.device)) {
+ return false;
+ }
+
+ policy_table::ApplicationPolicies::const_iterator it;
+ for (it = policies.apps.begin(); it != policies.apps.end(); ++it) {
+ // Skip saving of predefined app, since they should be saved before
+ if (IsPredefinedApp(*it)) {
+ continue;
+ }
+ if (!SaveSpecificAppPolicy(*it)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveSpecificAppPolicy(
+ const policy_table::ApplicationPolicies::value_type& app) {
+ utils::dbms::SQLQuery app_query(db());
+ if (!app_query.Prepare(sql_pt::kInsertApplication)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement into application (device).");
+ return false;
+ }
+
+ app_query.Bind(0, app.first);
+ app_query.Bind(
+ 1, std::string(policy_table::EnumToJsonString(app.second.priority)));
+ app_query.Bind(2, app.second.is_null());
+ app_query.Bind(3, *app.second.memory_kb);
+ app_query.Bind(4, static_cast<int64_t>(*app.second.heart_beat_timeout_ms));
+ app.second.certificate.is_initialized()
+ ? app_query.Bind(5, *app.second.certificate)
+ : app_query.Bind(5);
+ if (!app_query.Exec() || !app_query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into application.");
+ return false;
+ }
+
+ if (app.second.is_string()) {
+ if (kDefaultId.compare(app.second.get_string()) == 0) {
+ if (!SetDefaultPolicy(app.first)) {
+ return false;
+ }
+ // Stop saving other params, since predefined permissions already set
+ return true;
+ }
+ }
+
+ if (!SaveAppGroup(app.first, app.second.groups)) {
+ return false;
+ }
+#ifdef SDL_REMOTE_CONTROL
+ bool denied = !app.second.moduleType->is_initialized();
+ if (!SaveRemoteControlDenied(app.first, denied) ||
+ !SaveModuleType(app.first, *app.second.moduleType)) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
+ if (!SaveNickname(app.first, *app.second.nicknames)) {
+ return false;
+ }
+ 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) {
+ utils::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;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveAppGroup(
+ const std::string& app_id, const policy_table::Strings& app_groups) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAppGroup)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app group");
+ return false;
+ }
+ LOG4CXX_INFO(logger_, "SaveAppGroup");
+ policy_table::Strings::const_iterator it;
+ for (it = app_groups.begin(); it != app_groups.end(); ++it) {
+ std::string ssss = *it;
+ LOG4CXX_INFO(logger_, "Group: " << ssss);
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert into app group."
+ << query.LastError().text());
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveNickname(const std::string& app_id,
+ const policy_table::Strings& nicknames) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertNickname)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for nickname");
+ return false;
+ }
+
+ policy_table::Strings::const_iterator it;
+ for (it = nicknames.begin(); it != nicknames.end(); ++it) {
+ query.Bind(0, app_id);
+ query.Bind(1, *it);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into nickname.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveAppType(const std::string& app_id,
+ const policy_table::AppHMITypes& types) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAppType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app type");
+ return false;
+ }
+
+ policy_table::AppHMITypes::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 app type.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRequestType(
+ const std::string& app_id, const policy_table::RequestTypes& types) {
+ utils::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) {
+ utils::dbms::SQLQuery query(db());
+
+ if (!query.Prepare(sql_pt::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, odometer);
+ query.Bind(1, *(meta.pt_exchanged_x_days_after_epoch));
+ query.Bind(2, *(meta.ignition_cycles_since_last_exchange));
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update for module_meta.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveModuleConfig(
+ const policy_table::ModuleConfig& config) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateModuleConfig)) {
+ LOG4CXX_WARN(logger_, "Incorrect update statement for module config");
+ return 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);
+ query.Bind(4, config.timeout_after_x_seconds);
+ query.Bind(5, (*config.certificate));
+ config.vehicle_make.is_initialized() ? query.Bind(6, *(config.vehicle_make))
+ : query.Bind(6);
+ config.vehicle_model.is_initialized() ? query.Bind(7, *(config.vehicle_model))
+ : query.Bind(7);
+ config.vehicle_year.is_initialized() ? query.Bind(8, *(config.vehicle_year))
+ : query.Bind(8);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update module config");
+ return false;
+ }
+
+ if (!SaveSecondsBetweenRetries(config.seconds_between_retries)) {
+ return false;
+ }
+
+ if (!SaveNumberOfNotificationsPerMinute(
+ config.notifications_per_minute_by_priority)) {
+ return false;
+ }
+
+ if (!SaveServiceEndpoints(config.endpoints)) {
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveServiceEndpoints(
+ const policy_table::ServiceEndpoints& endpoints) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteEndpoint)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from endpoint.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt::kInsertEndpoint)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for endpoint");
+ return false;
+ }
+
+ policy_table::ServiceEndpoints::const_iterator it;
+ for (it = endpoints.begin(); it != endpoints.end(); ++it) {
+ const policy_table::URLList& apps = it->second;
+ policy_table::URLList::const_iterator app_it;
+ for (app_it = apps.begin(); app_it != apps.end(); ++app_it) {
+ 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) {
+ query.Bind(0, it->first);
+ query.Bind(1, *url_it);
+ query.Bind(2, app_it->first);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into endpoint");
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveConsumerFriendlyMessages(
+ const policy_table::ConsumerFriendlyMessages& messages) {
+ 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
+ // the policy table. So it won't be changed/updated
+ if (!messages.messages.is_initialized()) {
+ LOG4CXX_INFO(logger_, "ConsumerFriendlyMessages messages list is empty");
+ return true;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ bool delete_query_exec_result = true;
+ if (!messages.messages->empty()) {
+ delete_query_exec_result = query.Exec(sql_pt::kDeleteMessageString);
+ }
+
+ if (!delete_query_exec_result) {
+ LOG4CXX_WARN(logger_, "Failed to delete messages from DB.");
+ return false;
+ }
+
+ if (!query.Prepare(sql_pt::kUpdateVersion)) {
+ LOG4CXX_WARN(logger_, "Invalid update messages version statement.");
+ return false;
+ }
+
+ query.Bind(0, messages.version);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed to update messages version number in DB.");
+ return false;
+ }
+
+ policy_table::Messages::const_iterator it;
+ for (it = messages.messages->begin(); it != messages.messages->end(); ++it) {
+ if (!SaveMessageType(it->first)) {
+ return false;
+ }
+ const policy_table::Languages& langs = it->second.languages;
+ policy_table::Languages::const_iterator lang_it;
+ for (lang_it = langs.begin(); lang_it != langs.end(); ++lang_it) {
+ if (!SaveLanguage(lang_it->first)) {
+ return false;
+ }
+ if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveMessageType(const std::string& type) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertMessageType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for message type.");
+ return false;
+ }
+
+ query.Bind(0, type);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into message type.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveLanguage(const std::string& code) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertLanguage)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for language.");
+ return false;
+ }
+
+ query.Bind(0, code);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into language.");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveMessageString(
+ const std::string& type,
+ const std::string& lang,
+ const policy_table::MessageString& strings) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertMessageString)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for message.");
+ return false;
+ }
+
+ query.Bind(0, lang);
+ query.Bind(1, type);
+
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into message.");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveSecondsBetweenRetries(
+ const policy_table::SecondsBetweenRetries& seconds) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteSecondsBetweenRetries)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from seconds between retries.");
+ return false;
+ }
+ if (!query.Prepare(sql_pt::kInsertSecondsBetweenRetry)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for seconds between retries.");
+ return false;
+ }
+
+ for (uint32_t i = 0; i < seconds.size(); ++i) {
+ query.Bind(0, static_cast<int>(i));
+ query.Bind(1, seconds[i]);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into seconds between retries.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveNumberOfNotificationsPerMinute(
+ const policy_table::NumberOfNotificationsPerMinute& notifications) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertNotificationsByPriority)) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect insert statement for notifications by priority.");
+ return false;
+ }
+
+ policy_table::NumberOfNotificationsPerMinute::const_iterator it;
+ for (it = notifications.begin(); it != notifications.end(); ++it) {
+ query.Bind(0, it->first);
+ query.Bind(1, it->second);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into notifications by priority.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveDeviceData(
+ const policy_table::DeviceData& devices) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertDeviceData)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for device data.");
+ return false;
+ }
+
+ policy_table::DeviceData::const_iterator it;
+ for (it = devices.begin(); it != devices.end(); ++it) {
+ query.Bind(0, it->first);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into device data.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveUsageAndErrorCounts(
+ const policy_table::UsageAndErrorCounts& counts) {
+ const_cast<policy_table::UsageAndErrorCounts&>(counts).mark_initialized();
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kDeleteAppLevel)) {
+ LOG4CXX_WARN(logger_, "Incorrect delete from app level.");
+ return false;
+ }
+ if (!query.Prepare(sql_pt::kInsertAppLevel)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for app level.");
+ return false;
+ }
+
+ policy_table::AppLevels::const_iterator it;
+ 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);
+ query.Bind(1, it->second.count_of_tls_errors);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into app level.");
+ return false;
+ }
+ }
+ return true;
+}
+
+void SQLPTRepresentation::IncrementIgnitionCycles() {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kIncrementIgnitionCycles)) {
+ LOG4CXX_WARN(logger_, "Failed incrementing ignition cycles");
+ }
+}
+
+void SQLPTRepresentation::ResetIgnitionCycles() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Exec(sql_pt::kResetIgnitionCycles)) {
+ LOG4CXX_WARN(logger_, "Failed to reset ignition cycles number.");
+ }
+}
+
+bool SQLPTRepresentation::UpdateRequired() const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectFlagUpdateRequired) || !query.Exec()) {
+ LOG4CXX_WARN(logger_,
+ "Failed select update required flag from module meta");
+ return false;
+ }
+ return query.GetBoolean(0);
+}
+
+void SQLPTRepresentation::SaveUpdateRequired(bool value) {
+ utils::dbms::SQLQuery query(db());
+ // TODO(AOleynik): Quick fix, will be reworked
+ if (!query.Prepare(/*sql_pt::kUpdateFlagUpdateRequired*/
+ "UPDATE `module_meta` SET `flag_update_required` = ?")) {
+ LOG4CXX_WARN(logger_,
+ "Incorrect update into module meta (update_required): "
+ << strerror(errno));
+ return;
+ }
+ query.Bind(0, value);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update module meta (update_required)");
+ }
+}
+
+bool SQLPTRepresentation::GetInitialAppData(const std::string& app_id,
+ StringArray* nicknames,
+ StringArray* app_types) {
+ LOG4CXX_INFO(logger_, "Getting initial application data.");
+ utils::dbms::SQLQuery app_names(db());
+ if (!app_names.Prepare(sql_pt::kSelectNicknames)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app nicknames");
+ return false;
+ }
+ utils::dbms::SQLQuery app_hmi_types(db());
+ if (!app_hmi_types.Prepare(sql_pt::kSelectAppTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+ app_names.Bind(0, app_id);
+ while (app_names.Next()) {
+ nicknames->push_back(app_names.GetString(0));
+ }
+ app_names.Reset();
+ app_hmi_types.Bind(0, app_id);
+ while (app_hmi_types.Next()) {
+ app_types->push_back(app_hmi_types.GetString(0));
+ }
+ app_hmi_types.Reset();
+ return true;
+}
+
+bool SQLPTRepresentation::GetFunctionalGroupings(
+ policy_table::FunctionalGroupings& groups) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return GatherFunctionalGroupings(&groups);
+}
+
+bool SQLPTRepresentation::GatherAppType(
+ const std::string& app_id, policy_table::AppHMITypes* app_types) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAppTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ policy_table::AppHMIType type;
+ if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
+ return false;
+ }
+ app_types->push_back(type);
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherRequestType(
+ const std::string& app_id,
+ policy_table::RequestTypes* request_types) const {
+ utils::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 {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectNicknames)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app nicknames");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ nicknames->push_back(query.GetString(0));
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherAppGroup(
+ const std::string& app_id, policy_table::Strings* app_groups) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAppGroups)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app groups");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ app_groups->push_back(query.GetString(0));
+ }
+ return true;
+}
+
+#ifdef SDL_REMOTE_CONTROL
+
+bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
+ bool* denied) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect select remote control flag");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (query.Next()) {
+ *denied = query.GetBoolean(0);
+ } else {
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherModuleType(
+ const std::string& app_id, policy_table::ModuleTypes* app_types) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectModuleTypes)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from app types");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ while (query.Next()) {
+ policy_table::ModuleType type;
+ if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
+ return false;
+ }
+ app_types->push_back(type);
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id,
+ bool deny) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) {
+ LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag");
+ return false;
+ }
+ LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny);
+ query.Bind(0, deny);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect update remote control flag.");
+ return false;
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveModuleType(
+ const std::string& app_id, const policy_table::ModuleTypes& types) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertModuleType)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for module type");
+ return false;
+ }
+
+ policy_table::ModuleTypes::const_iterator it;
+ for (it = types.begin(); it != types.end(); ++it) {
+ query.Bind(0, app_id);
+ std::string module(policy_table::EnumToJsonString(*it));
+ query.Bind(1, module);
+ LOG4CXX_DEBUG(logger_,
+ "Module(app: " << app_id << ", type: " << module << ")");
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into module type.");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::SaveAccessModule(
+ TypeAccess access, const policy_table::AccessModules& modules) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertAccessModule)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for access module");
+ return false;
+ }
+
+ policy_table::AccessModules::const_iterator i;
+ for (i = modules.begin(); i != modules.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::RemoteRpcs& rpcs = i->second;
+ query.Bind(0, name);
+ query.Bind(1, access);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into access module.");
+ return false;
+ }
+ int id = query.LastInsertId();
+ if (!query.Reset()) {
+ LOG4CXX_WARN(logger_, "Couldn't reset query access module.");
+ return false;
+ }
+ if (!SaveRemoteRpc(id, rpcs)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherAccessModule(
+ TypeAccess access, policy_table::AccessModules* modules) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectAccessModules)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from access module");
+ return false;
+ }
+
+ query.Bind(0, access);
+ while (query.Next()) {
+ int id = query.GetInteger(0);
+ std::string name = query.GetString(1);
+ policy_table::RemoteRpcs rpcs;
+ if (!GatherRemoteRpc(id, &rpcs)) {
+ return false;
+ }
+ modules->insert(std::make_pair(name, rpcs));
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::SaveRemoteRpc(int module_id,
+ const policy_table::RemoteRpcs& rpcs) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertRemoteRpc)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement for remote rpc");
+ return false;
+ }
+ policy_table::RemoteRpcs::const_iterator i;
+ for (i = rpcs.begin(); i != rpcs.end(); ++i) {
+ const std::string& name = i->first;
+ const policy_table::Strings& params = i->second;
+ policy_table::Strings::const_iterator j;
+ if (params.empty()) {
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ } else {
+ for (j = params.begin(); j != params.end(); ++j) {
+ const std::string& param = *j;
+ query.Bind(0, module_id);
+ query.Bind(1, name);
+ query.Bind(2, param);
+ if (!query.Exec() || !query.Reset()) {
+ LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc.");
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+}
+
+bool SQLPTRepresentation::GatherRemoteRpc(
+ int module_id, policy_table::RemoteRpcs* rpcs) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectRemoteRpcs)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from remote rpc");
+ return false;
+ }
+
+ query.Bind(0, module_id);
+ while (query.Next()) {
+ std::string name = query.GetString(0);
+ if (!query.IsNull(1)) {
+ std::string parameter = query.GetString(1);
+ (*rpcs)[name].push_back(parameter);
+ } else {
+ rpcs->insert(std::make_pair(name, policy_table::Strings()));
+ }
+ }
+ return true;
+}
+#endif // SDL_REMOTE_CONTROL
+
+bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateApplicationCustomData)) {
+ LOG4CXX_WARN(logger_, "Incorrect update in application");
+ return false;
+ }
+
+ query.Bind(0, is_revoked);
+ query.Bind(1, is_default);
+ query.Bind(2, is_predata);
+ query.Bind(3, app_id);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update in application");
+ return false;
+ }
+
+ return true;
+}
+
+bool SQLPTRepresentation::IsApplicationRevoked(
+ const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectApplicationRevoked)) {
+ LOG4CXX_WARN(logger_, "Incorrect select from is_revoked of application");
+ }
+
+ query.Bind(0, app_id);
+
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed select is_revoked of application");
+ return false;
+ }
+ return query.IsNull(0) ? false : query.GetBoolean(0);
+}
+bool SQLPTRepresentation::IsApplicationRepresented(
+ const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectApplicationRepresented)) {
+ LOG4CXX_WARN(logger_, "Incorrect select application by id");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed select application by id");
+ return false;
+ }
+ return query.GetInteger(0) != 0;
+}
+
+bool SQLPTRepresentation::IsDefaultPolicy(const std::string& app_id) const {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectApplicationIsDefault)) {
+ LOG4CXX_WARN(logger_, "Incorrect select application by id");
+ return false;
+ }
+
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed select application by id");
+ return false;
+ }
+ return query.IsNull(0) ? false : query.GetBoolean(0);
+}
+
+bool SQLPTRepresentation::IsPredataPolicy(const std::string& app_id) const {
+ return false;
+}
+
+bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kDeleteAppGroupByApplicationId)) {
+ LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
+ return false;
+ }
+ query.Bind(0, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
+ return false;
+ }
+
+ if (!CopyApplication(kDefaultId, app_id)) {
+ return false;
+ }
+
+ SetPreloaded(false);
+
+ policy_table::Strings default_groups;
+ if (!GatherAppGroup(kDefaultId, &default_groups) ||
+ !SaveAppGroup(app_id, default_groups)) {
+ return false;
+ }
+ policy_table::RequestTypes request_types;
+ if (!GatherRequestType(kDefaultId, &request_types) ||
+ !SaveRequestType(app_id, request_types)) {
+ return false;
+ }
+ policy_table::AppHMITypes app_types;
+ if (!GatherAppType(kDefaultId, &app_types) ||
+ !SaveAppType(app_id, app_types)) {
+ return false;
+ }
+
+ return SetIsDefault(app_id, true);
+}
+
+bool SQLPTRepresentation::SetIsDefault(const std::string& app_id,
+ bool is_default) const {
+ LOG4CXX_TRACE(logger_, "Set flag is_default of application");
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateIsDefault)) {
+ LOG4CXX_WARN(logger_, "Incorect statement for updating is_default");
+ return false;
+ }
+
+ query.Bind(0, is_default);
+ query.Bind(1, app_id);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed update is_default");
+ return false;
+ }
+ return true;
+}
+
+void SQLPTRepresentation::RemoveDB() const {
+ file_system::DeleteFile(db_->get_path());
+}
+
+bool SQLPTRepresentation::IsDBVersionActual() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kSelectDBVersion) || !query.Exec()) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to get DB version: " << query.LastError().text());
+ return false;
+ }
+
+ const int32_t saved_db_version = query.GetInteger(0);
+ const int32_t current_db_version = GetDBVersion();
+ LOG4CXX_DEBUG(logger_,
+ "Saved DB version is: " << saved_db_version
+ << ". Current DB vesion is: "
+ << current_db_version);
+
+ return current_db_version == saved_db_version;
+}
+
+bool SQLPTRepresentation::UpdateDBVersion() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdateDBVersion)) {
+ LOG4CXX_ERROR(logger_,
+ "Incorrect DB version query: " << query.LastError().text());
+ return false;
+ }
+
+ const int32_t db_version = GetDBVersion();
+ LOG4CXX_DEBUG(logger_, "DB version will be updated to: " << db_version);
+ query.Bind(0, db_version);
+
+ if (!query.Exec()) {
+ LOG4CXX_ERROR(logger_,
+ "DB version getting failed: " << query.LastError().text());
+ return false;
+ }
+
+ return true;
+}
+
+const int32_t SQLPTRepresentation::GetDBVersion() const {
+ return utils::Djb2HashFromString(sql_pt::kCreateSchema);
+}
+
+utils::dbms::SQLDatabase* SQLPTRepresentation::db() const {
+#ifdef __QNX__
+ utils::dbms::SQLDatabase* db = new utils::dbms::SQLDatabase(kDatabaseName);
+ db->Open();
+ return db;
+#else
+ return db_;
+#endif
+}
+
+bool SQLPTRepresentation::CopyApplication(const std::string& source,
+ const std::string& destination) {
+ utils::dbms::SQLQuery source_app(db());
+ if (!source_app.Prepare(sql_pt::kSelectApplicationFull)) {
+ LOG4CXX_WARN(logger_, "Incorrect select statement from application.");
+ return false;
+ }
+ source_app.Bind(0, source);
+ if (!source_app.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed selecting from application.");
+ return false;
+ }
+
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kInsertApplicationFull)) {
+ LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
+ return false;
+ }
+ query.Bind(0, destination);
+ source_app.IsNull(0) ? query.Bind(1)
+ : query.Bind(1, source_app.GetBoolean(0));
+ source_app.IsNull(1) ? query.Bind(2)
+ : query.Bind(2, source_app.GetBoolean(1));
+ source_app.IsNull(2) ? query.Bind(3) : query.Bind(3, source_app.GetString(2));
+ source_app.IsNull(3) ? query.Bind(4) : query.Bind(4, source_app.GetString(3));
+ source_app.IsNull(4) ? query.Bind(5)
+ : query.Bind(5, source_app.GetBoolean(4));
+ source_app.IsNull(5) ? query.Bind(6)
+ : query.Bind(6, source_app.GetBoolean(5));
+ source_app.IsNull(6) ? query.Bind(7)
+ : query.Bind(7, source_app.GetBoolean(6));
+ query.Bind(8, source_app.GetInteger(7));
+ query.Bind(9, source_app.GetInteger(8));
+ source_app.IsNull(9) ? query.Bind(10)
+ : query.Bind(10, source_app.GetString(9));
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed inserting into application.");
+ return false;
+ }
+ return true;
+}
+
+void SQLPTRepresentation::SetPreloaded(bool value) {
+ utils::dbms::SQLQuery query(db());
+ if (!query.Prepare(sql_pt::kUpdatePreloaded)) {
+ LOG4CXX_WARN(logger_, "Incorrect statement of updating preloaded.");
+ return;
+ }
+
+ query.Bind(0, value);
+ if (!query.Exec()) {
+ LOG4CXX_WARN(logger_, "Failed updating preloaded.");
+ return;
+ }
+}
+
+bool SQLPTRepresentation::SetVINValue(const std::string& value) {
+ return true;
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_regular/src/status.cc b/src/components/policy/policy_regular/src/status.cc
new file mode 100644
index 0000000000..8d65c606d0
--- /dev/null
+++ b/src/components/policy/policy_regular/src/status.cc
@@ -0,0 +1,141 @@
+/*
+ Copyright (c) 2016, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "policy/status.h"
+#include "policy/update_status_manager_interface.h"
+#include "utils/make_shared.h"
+
+policy::UpToDateStatus::UpToDateStatus()
+ : Status("UP_TO_DATE", policy::PolicyTableStatus::StatusUpToDate) {}
+
+void policy::UpToDateStatus::ProcessEvent(UpdateStatusManagerInterface* manager,
+ policy::UpdateEvent event) {
+ switch (event) {
+ case kOnNewAppRegistered:
+ case kOnResetPolicyTableRequireUpdate:
+ case kScheduleUpdate:
+ case kOnResetRetrySequence:
+ manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ default:
+ break;
+ }
+}
+
+policy::UpdateNeededStatus::UpdateNeededStatus()
+ : Status("UPDATE_NEEDED", policy::PolicyTableStatus::StatusUpdateRequired) {
+}
+
+void policy::UpdateNeededStatus::ProcessEvent(
+ policy::UpdateStatusManagerInterface* manager, policy::UpdateEvent event) {
+ switch (event) {
+ case kOnUpdateSentOut:
+ manager->SetNextStatus(utils::MakeShared<UpdatingStatus>());
+ break;
+ case kOnResetPolicyTableRequireUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kOnResetPolicyTableNoUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ break;
+ case kOnNewAppRegistered:
+ manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ default:
+ break;
+ }
+}
+
+bool policy::UpdateNeededStatus::IsUpdateRequired() const {
+ return true;
+}
+
+policy::UpdatingStatus::UpdatingStatus()
+ : Status("UPDATING", policy::PolicyTableStatus::StatusUpdatePending) {}
+
+void policy::UpdatingStatus::ProcessEvent(
+ policy::UpdateStatusManagerInterface* manager, policy::UpdateEvent event) {
+ switch (event) {
+ case kOnValidUpdateReceived:
+ case kOnResetPolicyTableNoUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ break;
+ case kOnNewAppRegistered:
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kOnWrongUpdateReceived:
+ case kOnUpdateTimeout:
+ manager->SetNextStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kOnResetPolicyTableRequireUpdate:
+ manager->SetNextStatus(utils::MakeShared<UpToDateStatus>());
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ case kScheduleUpdate:
+ case kOnResetRetrySequence:
+ manager->SetPostponedStatus(utils::MakeShared<UpdateNeededStatus>());
+ break;
+ default:
+ break;
+ }
+}
+
+bool policy::UpdatingStatus::IsUpdatePending() const {
+ return true;
+}
+
+bool policy::UpdatingStatus::IsUpdateRequired() const {
+ return true;
+}
+
+policy::Status::Status(const std::string& string_status,
+ const policy::PolicyTableStatus enum_status)
+ : string_status_(string_status), enum_status_(enum_status) {}
+
+policy::Status::~Status() {}
+
+const std::string policy::Status::get_status_string() const {
+ return string_status_;
+}
+
+policy::PolicyTableStatus policy::Status::get_status() const {
+ return enum_status_;
+}
+
+bool policy::Status::IsUpdateRequired() const {
+ return false;
+}
+
+bool policy::Status::IsUpdatePending() const {
+ return false;
+}
diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc
new file mode 100644
index 0000000000..941113c753
--- /dev/null
+++ b/src/components/policy/policy_regular/src/update_status_manager.cc
@@ -0,0 +1,190 @@
+/*
+ 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/update_status_manager.h"
+#include "policy/policy_listener.h"
+#include "utils/logger.h"
+#include "utils/make_shared.h"
+
+namespace policy {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
+
+UpdateStatusManager::UpdateStatusManager()
+ : listener_(NULL)
+ , current_status_(utils::MakeShared<UpToDateStatus>())
+ , last_processed_event_(kNoEvent)
+ , apps_search_in_progress_(false)
+ , app_registered_from_non_consented_device_(true) {}
+
+UpdateStatusManager::~UpdateStatusManager() {}
+
+void UpdateStatusManager::ProcessEvent(UpdateEvent event) {
+ sync_primitives::AutoLock lock(status_lock_);
+ current_status_->ProcessEvent(this, event);
+ last_processed_event_ = event;
+ DoTransition();
+}
+
+void UpdateStatusManager::SetNextStatus(utils::SharedPtr<Status> status) {
+ next_status_ = status;
+}
+
+void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr<Status> status) {
+ postponed_status_ = status;
+}
+
+void UpdateStatusManager::set_listener(PolicyListener* listener) {
+ listener_ = listener;
+}
+
+void UpdateStatusManager::OnUpdateSentOut() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessEvent(kOnUpdateSentOut);
+}
+
+void UpdateStatusManager::OnUpdateTimeoutOccurs() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessEvent(kOnUpdateTimeout);
+}
+
+void UpdateStatusManager::OnValidUpdateReceived() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessEvent(kOnValidUpdateReceived);
+}
+
+void UpdateStatusManager::OnWrongUpdateReceived() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessEvent(kOnWrongUpdateReceived);
+}
+
+void UpdateStatusManager::OnResetDefaultPT(bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ ProcessEvent(kOnResetPolicyTableRequireUpdate);
+ return;
+ }
+ ProcessEvent(kOnResetPolicyTableNoUpdate);
+}
+
+void UpdateStatusManager::OnResetRetrySequence() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ ProcessEvent(kOnResetRetrySequence);
+}
+
+void UpdateStatusManager::OnNewApplicationAdded(const DeviceConsent consent) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (kDeviceAllowed != consent) {
+ app_registered_from_non_consented_device_ = true;
+ return;
+ }
+ app_registered_from_non_consented_device_ = false;
+ ProcessEvent(kOnNewAppRegistered);
+}
+
+void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (is_update_required) {
+ current_status_.reset(new UpToDateStatus());
+ ProcessEvent(kScheduleUpdate);
+ }
+}
+
+void UpdateStatusManager::OnDeviceConsented() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (app_registered_from_non_consented_device_) {
+ ProcessEvent(kOnNewAppRegistered);
+ }
+}
+
+bool UpdateStatusManager::IsUpdateRequired() const {
+ return current_status_->IsUpdateRequired();
+}
+
+bool UpdateStatusManager::IsUpdatePending() const {
+ return current_status_->IsUpdatePending();
+}
+
+void UpdateStatusManager::ScheduleUpdate() {
+ ProcessEvent(kScheduleUpdate);
+}
+
+void UpdateStatusManager::ScheduleManualUpdate() {
+ ProcessEvent(kScheduleManualUpdate);
+}
+
+std::string UpdateStatusManager::StringifiedUpdateStatus() const {
+ return current_status_->get_status_string();
+}
+
+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::DoTransition() {
+ DCHECK_OR_RETURN_VOID(listener_);
+ if (!next_status_) {
+ return;
+ }
+
+ current_status_ = next_status_;
+ next_status_.reset();
+ LOG4CXX_DEBUG(logger_, "last_processed_event_ = " << last_processed_event_);
+ if (last_processed_event_ != kScheduleManualUpdate) {
+ listener_->OnUpdateStatusChanged(current_status_->get_status_string());
+ }
+ if (!postponed_status_) {
+ return;
+ }
+
+ current_status_ = postponed_status_;
+ if (last_processed_event_ != kScheduleManualUpdate) {
+ listener_->OnUpdateStatusChanged(current_status_->get_status_string());
+ }
+ postponed_status_.reset();
+}
+
+} // namespace policy
diff --git a/src/components/policy/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
index 60e34a929d..60e34a929d 100644
--- a/src/components/policy/src/usage_statistics/counter.cc
+++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc
diff --git a/src/components/policy/policy_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt
new file mode 100644
index 0000000000..62ff691f83
--- /dev/null
+++ b/src/components/policy/policy_regular/test/CMakeLists.txt
@@ -0,0 +1,77 @@
+# Copyright (c) 2016, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ include
+ ${COMPONENTS_DIR}
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${POLICY_PATH}/include
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${COMPONENTS_DIR}/config_profile/include
+ ${COMPONENTS_DIR}/utils/include/
+ ${COMPONENTS_DIR}/include/test/policy/policy_regular/
+ ${POLICY_PATH}/test/include/
+ ${POLICY_MOCK_INCLUDE_PATH}/
+)
+
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+if (NOT REMOTE_CONTROL)
+ list (REMOVE_ITEM SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/access_remote_impl_test.cc
+ )
+endif ()
+
+set(LIBRARIES
+ gmock
+ Utils
+ Policy
+ UsageStatistics
+)
+
+create_test(policy_test "${SOURCES}" "${LIBRARIES}")
+
+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 PTU.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY PTU2.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY PTU3.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY PTU4.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY ptu_requestType.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY ptu2_requestType.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink2.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY smartDeviceLink3.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY sdl_pt_first_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY sdl_pt_second_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+file(COPY sdl_pt_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/components/policy/policy_regular/test/PTU.json b/src/components/policy/policy_regular/test/PTU.json
new file mode 100644
index 0000000000..6d663e9a0c
--- /dev/null
+++ b/src/components/policy/policy_regular/test/PTU.json
@@ -0,0 +1,1948 @@
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "preloaded_date": "2015-12-08",
+ "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"],
+ "RequestType": [
+ "HTTP",
+ "FILE_RESUME"
+ ]
+ },
+ "1234": "default",
+ "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"],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ }
+ }
+ }
+ } \ No newline at end of file
diff --git a/src/components/policy/test/PTU2.json b/src/components/policy/policy_regular/test/PTU2.json
index 4062e94516..4062e94516 100644
--- a/src/components/policy/test/PTU2.json
+++ b/src/components/policy/policy_regular/test/PTU2.json
diff --git a/src/components/policy/policy_regular/test/PTU3.json b/src/components/policy/policy_regular/test/PTU3.json
new file mode 100644
index 0000000000..78596189da
--- /dev/null
+++ b/src/components/policy/policy_regular/test/PTU3.json
@@ -0,0 +1,1950 @@
+ },
+ "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": {
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "preloaded_date": "2015-12-08",
+ "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"]
+ "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"],
+ "RequestType": [
+ "HTTP",
+ "FILE_RESUMED",
+ "INVALID_REQUEST_TYPE"
+ ]
+ },
+ "1234": "default",
+ "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"],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY",
+ "INVALID_REQUEST_TYPE"
+ ]
+ }
+ }
+ }
+ } \ No newline at end of file
diff --git a/src/components/policy/test/PTU4.json b/src/components/policy/policy_regular/test/PTU4.json
index ab4c2f8927..ab4c2f8927 100644
--- a/src/components/policy/test/PTU4.json
+++ b/src/components/policy/policy_regular/test/PTU4.json
diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
new file mode 100644
index 0000000000..d086144d86
--- /dev/null
+++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
@@ -0,0 +1,95 @@
+/*
+ * 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 "policy/access_remote_impl.h"
+
+namespace policy {
+
+TEST(AccessRemoteImplTest, CheckModuleType) {
+ AccessRemoteImpl access_remote;
+ access_remote.cache_->pt_ = new policy_table::Table();
+
+ // No application
+ EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+
+ // No modules
+ policy_table::ApplicationPolicies& apps =
+ access_remote.cache_->pt_->policy_table.app_policies_section.apps;
+ apps["1234"];
+ EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+
+ // Empty modules
+ policy_table::ModuleTypes& modules = *apps["1234"].moduleType;
+ modules.mark_initialized();
+ EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+ EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE));
+
+ // Specific modules
+ modules.push_back(policy_table::MT_RADIO);
+ EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO));
+ EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE));
+}
+
+TEST(AccessRemoteImplTest, SetDefaultHmiTypes) {
+ AccessRemoteImpl access_remote;
+
+ std::vector<int> hmi_expected;
+ hmi_expected.push_back(2);
+ hmi_expected.push_back(6);
+ ApplicationOnDevice who = {"dev1", "1234"};
+ access_remote.SetDefaultHmiTypes(who, hmi_expected);
+
+ EXPECT_NE(access_remote.hmi_types_.end(), access_remote.hmi_types_.find(who));
+ policy_table::AppHMITypes& hmi_output = access_remote.hmi_types_[who];
+ EXPECT_EQ(2u, hmi_output.size());
+ EXPECT_EQ(policy_table::AHT_MEDIA, hmi_output[0]);
+ EXPECT_EQ(policy_table::AHT_SOCIAL, hmi_output[1]);
+}
+
+TEST(AccessRemoteImplTest, GetGroups) {
+ AccessRemoteImpl access_remote;
+ ApplicationOnDevice who = {"dev1", "1234"};
+ access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL);
+
+ access_remote.cache_->pt_ = new policy_table::Table();
+ policy_table::ApplicationPolicies& apps =
+ access_remote.cache_->pt_->policy_table.app_policies_section.apps;
+ apps["1234"].groups.push_back("group_default");
+ apps["1234"].AppHMIType->push_back(policy_table::AHT_MEDIA);
+
+ // Default groups
+ const policy_table::Strings& groups1 = access_remote.GetGroups(who);
+ EXPECT_EQ(std::string("group_default"), std::string(groups1[0]));
+}
+
+} // namespace policy
diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc
new file mode 100644
index 0000000000..2c0ab73c0b
--- /dev/null
+++ b/src/components/policy/policy_regular/test/counter_test.cc
@@ -0,0 +1,194 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gmock/gmock.h"
+
+#include "policy/usage_statistics/mock_statistics_manager.h"
+#include "policy/usage_statistics/counter.h"
+
+using ::testing::StrictMock;
+using ::testing::InSequence;
+
+namespace test {
+namespace components {
+namespace usage_statistics_test {
+
+using namespace usage_statistics;
+
+// 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);
+
+ // Assert
+ EXPECT_CALL(*msm, Increment(SYNC_REBOOTS));
+
+ // Act
+ ++reboots_counter;
+}
+
+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(
+ StatisticsManagerIncrementMethod2Args,
+ AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
+
+ // Assert
+ EXPECT_CALL(*msm, Increment("HelloApp", USER_SELECTIONS));
+
+ // Act
+ ++user_selections_counter;
+}
+
+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(StatisticsManagerSetMethod,
+ AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
+
+ // Assert
+ EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "Klingon"));
+
+ // Act
+ gui_language_info.Update("Klingon");
+}
+
+TEST(StatisticsManagerSetMethod,
+ AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
+
+ // 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(StatisticsManagerAddMethod,
+ AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ const std::uint32_t time_out = 1;
+ AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
+
+ hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, time_out));
+
+ // Act
+ hmi_full_stopwatch.WriteTime();
+}
+
+// Tests disabled due to uncorrect behavior of timer.
+// Will be undisabled after fix.
+TEST(StatisticsManagerAddMethod,
+ DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
+ hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
+
+ hmi_full_stopwatch.Switch(SECONDS_HMI_FULL);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 60));
+
+ // Act
+ hmi_full_stopwatch.WriteTime();
+}
+
+TEST(
+ StatisticsManagerAddMethod,
+ DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
+ // Arrange
+ MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
+ const std::uint32_t time_out = 1;
+ AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
+
+ // Act
+ hmi_full_stopwatch.Start(SECONDS_HMI_NONE);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_NONE, time_out));
+ // Act
+ hmi_full_stopwatch.WriteTime();
+
+ hmi_full_stopwatch.Switch(SECONDS_HMI_BACKGROUND);
+ // Assert
+ EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_BACKGROUND, time_out));
+ // Act
+ hmi_full_stopwatch.WriteTime();
+}
+
+} // namespace usage_statistics_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_regular/test/generated_code_test.cc b/src/components/policy/policy_regular/test/generated_code_test.cc
new file mode 100644
index 0000000000..671103bf51
--- /dev/null
+++ b/src/components/policy/policy_regular/test/generated_code_test.cc
@@ -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.
+ */
+
+#include <fstream>
+
+#include "gtest/gtest.h"
+
+#include "json/reader.h"
+#include "json/value.h"
+#include "policy/policy_table/enums.h"
+#include "policy/policy_table/types.h"
+#include "rpc_base/gtest_support.h"
+
+using rpc::policy_table_interface_base::Table;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+TEST(PolicyGeneratedCodeTest, TestValidPTPreloadJsonIsValid) {
+ std::ifstream json_file("sdl_preloaded_pt.json");
+ ASSERT_TRUE(json_file.is_open());
+ Json::Value valid_table;
+ Json::Reader reader;
+ ASSERT_TRUE(reader.parse(json_file, valid_table));
+ Table table(&valid_table);
+ table.SetPolicyTableType(rpc::policy_table_interface_base::PT_PRELOADED);
+ ASSERT_RPCTYPE_VALID(table);
+}
+
+TEST(PolicyGeneratedCodeTest, TestValidPTUpdateJsonIsValid) {
+ std::ifstream json_file("valid_sdl_pt_update.json");
+ ASSERT_TRUE(json_file.is_open());
+ Json::Value valid_table;
+ Json::Reader reader;
+ ASSERT_TRUE(reader.parse(json_file, valid_table));
+ Table table(&valid_table);
+ table.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ ASSERT_RPCTYPE_VALID(table);
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/test/include.cmake b/src/components/policy/policy_regular/test/include.cmake
index 0c23af00b0..0c23af00b0 100644
--- a/src/components/policy/test/include.cmake
+++ b/src/components/policy/policy_regular/test/include.cmake
diff --git a/src/components/policy/policy_regular/test/include/policy/driver_dbms.h b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h
new file mode 100644
index 0000000000..78b7add643
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/driver_dbms.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_DRIVER_DBMS_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_DRIVER_DBMS_H_
+
+#ifdef __QNX__
+#include <qdb/qdb.h>
+#else // __QNX__
+#include <sqlite3.h>
+#endif // __QNX__
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+#ifdef __QNX__
+class DBMS {
+ public:
+ explicit DBMS(std::string db_name) : db_name_(db_name), conn_(0) {}
+ ~DBMS() {
+ Close();
+ }
+ bool Open() {
+ conn_ = qdb_connect(db_name_.c_str(), 0);
+ return conn_ != NULL;
+ }
+ void Close() {
+ qdb_disconnect(conn_);
+ }
+ bool Exec(const char* query) {
+ return -1 != qdb_statement(conn_, query);
+ }
+ int FetchOneInt(const char* query) {
+ int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
+ qdb_stmt_exec(conn_, stmt, NULL, 0);
+ qdb_result_t* res = qdb_getresult(conn_);
+ void* ret = qdb_cell(res, 0, 0);
+ int value = 0;
+ if (ret) {
+ value = *static_cast<int*>(ret);
+ }
+ qdb_stmt_free(conn_, stmt);
+ return value;
+ }
+ double FetchOneDouble(const char* query) {
+ int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
+ qdb_stmt_exec(conn_, stmt, NULL, 0);
+ qdb_result_t* res = qdb_getresult(conn_);
+ void* ret = qdb_cell(res, 0, 0);
+ double value = 0.0;
+ if (ret) {
+ value = *static_cast<double*>(ret);
+ }
+ qdb_stmt_free(conn_, stmt);
+
+ return value;
+ }
+ std::string FetchOneString(const char* query) {
+ int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
+ qdb_stmt_exec(conn_, stmt, NULL, 0);
+ qdb_result_t* res = qdb_getresult(conn_);
+ void* ret = qdb_cell(res, 0, 0);
+ std::string value = "";
+ if (ret) {
+ value = std::string(static_cast<const char*>(ret));
+ }
+ qdb_stmt_free(conn_, stmt);
+
+ return value;
+ }
+
+ private:
+ std::string db_name_;
+ qdb_hdl_t* conn_;
+};
+
+#else // __QNX__
+class DBMS {
+ public:
+ explicit DBMS(std::string file_name) : file_name_(file_name), conn_(0) {}
+ ~DBMS() {
+ Close();
+ }
+ bool Open() {
+ return SQLITE_OK == sqlite3_open(file_name_.c_str(), &conn_);
+ }
+ void Close() {
+ sqlite3_close(conn_);
+ remove(file_name_.c_str());
+ }
+ bool Exec(const char* query) {
+ return SQLITE_OK == sqlite3_exec(conn_, query, NULL, NULL, NULL);
+ }
+ int FetchOneInt(const char* query) {
+ sqlite3_stmt* statement;
+ sqlite3_prepare(conn_, query, -1, &statement, NULL);
+ sqlite3_step(statement);
+ int value = sqlite3_column_int(statement, 0);
+ sqlite3_finalize(statement);
+ return value;
+ }
+ double FethcOneDouble(const char* query) {
+ sqlite3_stmt* statement;
+ sqlite3_prepare(conn_, query, -1, &statement, NULL);
+ sqlite3_step(statement);
+ double value = sqlite3_column_double(statement, 0);
+ sqlite3_finalize(statement);
+ return value;
+ }
+ std::string FetchOneString(const char* query) {
+ sqlite3_stmt* statement;
+ sqlite3_prepare(conn_, query, -1, &statement, NULL);
+ sqlite3_step(statement);
+ const unsigned char* txt = sqlite3_column_text(statement, 0);
+ std::string value = std::string(reinterpret_cast<const char*>(txt));
+ sqlite3_finalize(statement);
+ return value;
+ }
+
+ private:
+ std::string file_name_;
+ sqlite3* conn_;
+};
+#endif // __QNX__
+
+} // namespace policy
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_DRIVER_DBMS_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h
new file mode 100644
index 0000000000..0b64ff645e
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.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_POLICY_POLICY_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+
+#include "gmock/gmock.h"
+#include "policy/access_remote.h"
+
+namespace test {
+namespace components {
+namespace access_remote_test {
+
+class MockAccessRemote : public policy::AccessRemote {
+ public:
+ MOCK_CONST_METHOD3(
+ FindGroup,
+ policy::PTString(const policy::ApplicationOnDevice& who,
+ const policy::PTString& rpc,
+ const policy::RemoteControlParams& params));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const policy::ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD1(
+ GetGroups,
+ const policy_table::Strings&(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string& device_id,
+ const std::string& app_id,
+ policy::FunctionalIdType& group_types));
+ MOCK_CONST_METHOD2(CheckModuleType,
+ bool(const policy::PTString& app_id,
+ policy_table::ModuleType module));
+ MOCK_METHOD1(IsAppRemoteControl,
+ bool(const policy::ApplicationOnDevice& who));
+ MOCK_METHOD2(GetModuleTypes,
+ bool(const std::string& application_id,
+ std::vector<std::string>* modules));
+};
+
+} // namespace access_remote_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_app_stopwatch.h b/src/components/policy/policy_regular/test/include/policy/mock_app_stopwatch.h
new file mode 100644
index 0000000000..3cbb878655
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_app_stopwatch.h
@@ -0,0 +1,54 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_APP_STOPWATCH_H_
+
+#include "gmock/gmock.h"
+#include "policy/usage_statistics/app_stopwatch.h"
+#include "policy/usage_statistics/statistics_manager.h"
+
+namespace test {
+namespace components {
+namespace usage_statistics_test {
+
+class MockAppStopwatch : public usage_statistics::AppStopwatch {
+ public:
+ MOCK_METHOD1(Start, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD1(Switch, void(usage_statistics::AppStopwatchId stopwatch_type));
+ MOCK_METHOD0(WriteTime, void());
+};
+
+} // namespace usage_statistics_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_APP_STOPWATCH_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h
new file mode 100644
index 0000000000..34ad6af5a6
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_ext_representation.h
@@ -0,0 +1,139 @@
+/* Copyright (c) 2014, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/pt_ext_representation.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+#include "mock_pt_representation.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace policy {
+class MockPTExtRepresentation : public MockPTRepresentation,
+ public PTExtRepresentation {
+ public:
+ MOCK_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
+ MOCK_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
+ MOCK_METHOD2(GetDefaultHMI,
+ bool(const std::string& app_id, std::string* default_hmi));
+ MOCK_METHOD0(ResetUserConsent, bool());
+ MOCK_METHOD0(ResetDeviceConsents, bool());
+ MOCK_METHOD0(ResetAppConsents, bool());
+ MOCK_METHOD3(GetUserPermissionsForDevice,
+ bool(const std::string&, StringArray*, StringArray*));
+ MOCK_METHOD3(GetPermissionsForApp,
+ bool(const std::string&,
+ const std::string&,
+ FunctionalIdType* group_types));
+ MOCK_METHOD2(GetDeviceGroupsFromPolicies,
+ bool(policy_table::Strings*, policy_table::Strings*));
+ MOCK_METHOD2(
+ GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
+ const std::string& language));
+ MOCK_METHOD8(SetDeviceData,
+ bool(const std::string& device_id,
+ const std::string& hardware,
+ const std::string& firmware,
+ const std::string& os,
+ const std::string& os_version,
+ const std::string& carrier,
+ const uint32_t number_of_ports,
+ const std::string& connection_type));
+ MOCK_METHOD6(SetDeviceData,
+ bool(const std::string&,
+ const std::string&,
+ const std::string&,
+ const std::string&,
+ const std::string&,
+ const std::string&));
+ MOCK_METHOD2(SetMaxNumberPorts,
+ bool(const std::string& device_id,
+ unsigned int number_of_ports));
+ MOCK_METHOD3(SetUserPermissionsForDevice,
+ bool(const std::string&,
+ const StringArray&,
+ const StringArray&));
+ MOCK_METHOD1(SetUserPermissionsForApp, bool(const PermissionConsent&));
+ MOCK_METHOD1(IncreaseStatisticsData, bool(StatisticsType type));
+ MOCK_METHOD3(SetAppRegistrationLanguage,
+ bool(const std::string& app_id,
+ LanguageType type,
+ const std::string& language));
+ MOCK_METHOD3(SetMetaInfo,
+ bool(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& vin));
+ MOCK_METHOD0(IsMetaInfoPresent, bool());
+ MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
+ MOCK_METHOD0(GetKmFromSuccessfulExchange, int());
+ MOCK_METHOD0(GetDayFromScsExchange, int());
+ MOCK_METHOD0(GetIgnitionsFromScsExchange, int());
+ MOCK_CONST_METHOD1(Increment, void(const std::string& type));
+ MOCK_CONST_METHOD2(Increment,
+ void(const std::string& app_id, const std::string& type));
+ MOCK_CONST_METHOD3(Set,
+ void(const std::string& app_id,
+ const std::string& type,
+ const std::string& value));
+ MOCK_CONST_METHOD3(Add,
+ void(const std::string& app_id,
+ const std::string& type,
+ int seconds));
+ MOCK_CONST_METHOD3(CountUnconsentedGroups,
+ bool(const std::string& app_id,
+ const std::string& device_id,
+ int* count));
+ MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
+ MOCK_CONST_METHOD1(CleanupUnpairedDevices, bool(const DeviceIds& device_ids));
+ MOCK_METHOD2(ReactOnUserDevConsentForApp,
+ bool(const std::string& app_id, bool is_device_allowed));
+ MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id));
+ MOCK_METHOD2(SetIsPredata, bool(const std::string& app_id, bool is_predata));
+ MOCK_CONST_METHOD2(SetUnpairedDevice,
+ bool(const std::string& device_id, bool unpaired));
+ MOCK_CONST_METHOD1(UnpairedDevicesList, bool(DeviceIds* device_ids));
+ MOCK_CONST_METHOD2(RemoveAppConsentForGroup,
+ bool(const std::string& policy_app_id,
+ const std::string& functional_group));
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
new file mode 100644
index 0000000000..8a47e7ca97
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h
@@ -0,0 +1,105 @@
+/* Copyright (c) 2013, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_REPRESENTATION_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_REPRESENTATION_H_
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+
+#include "policy/pt_representation.h"
+#include "rpc_base/rpc_base.h"
+#include "policy/policy_table/types.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace policy {
+
+class MockPTRepresentation : virtual public PTRepresentation {
+ public:
+ MOCK_METHOD4(CheckPermissions,
+ void(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ CheckPermissionResult& result));
+ MOCK_METHOD0(IsPTPreloaded, bool());
+ MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
+ MOCK_METHOD1(KilometersBeforeExchange, int(int current));
+ MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
+ bool(int kilometers, int days_after_epoch));
+ MOCK_METHOD1(DaysBeforeExchange, int(int current));
+ MOCK_METHOD0(IncrementIgnitionCycles, void());
+ MOCK_METHOD0(ResetIgnitionCycles, void());
+ MOCK_METHOD0(TimeoutResponse, int());
+ MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>* seconds));
+ MOCK_METHOD2(GetPriority,
+ bool(const std::string& app_id, std::string* priority));
+ MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
+ MOCK_METHOD1(SetVINValue, bool(const std::string& value));
+ MOCK_METHOD2(
+ GetUserFriendlyMsg,
+ std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
+ const std::string& language));
+ MOCK_METHOD2(GetUpdateUrls, void(int service_type, EndpointUrls&));
+ MOCK_METHOD1(GetNotificationsNumber, int(const std::string& priority));
+ MOCK_METHOD0(Init, InitResult());
+ MOCK_METHOD0(Close, bool());
+ MOCK_METHOD0(Clear, bool());
+ MOCK_METHOD0(Drop, bool());
+ MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
+ MOCK_METHOD1(Save, bool(const policy_table::Table& table));
+ MOCK_CONST_METHOD0(UpdateRequired, bool());
+ MOCK_METHOD1(SaveUpdateRequired, void(bool value));
+ MOCK_METHOD3(GetInitialAppData,
+ bool(const std::string& app_id,
+ StringArray* nicknames,
+ StringArray* app_types));
+
+ MOCK_METHOD4(SaveApplicationCustomData,
+ bool(const std::string& app_id,
+ bool is_revoked,
+ bool is_default,
+ bool is_predata));
+
+ MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
+ MOCK_METHOD1(GetFunctionalGroupings,
+ bool(policy_table::FunctionalGroupings& groups));
+ MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id));
+ MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id));
+ MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id));
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_PT_REPRESENTATION_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.h
new file mode 100644
index 0000000000..924284c8cc
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_update_status_manager.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_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_UPDATE_STATUS_MANAGER_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_UPDATE_STATUS_MANAGER_H_
+
+#include "gmock/gmock.h"
+
+#include "policy/update_status_manager.h"
+
+namespace policy {
+
+class MockUpdateStatusManager : public UpdateStatusManager {
+ public:
+ MOCK_METHOD1(set_listener, void(PolicyListener* listener));
+ MOCK_METHOD0(OnUpdateSentOut, void());
+ MOCK_METHOD0(OnUpdateTimeoutOccurs, void());
+ MOCK_METHOD0(OnValidUpdateReceived, void());
+ MOCK_METHOD0(OnWrongUpdateReceived, void());
+ MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required));
+ MOCK_METHOD0(OnResetRetrySequence, void());
+ MOCK_METHOD0(OnNewApplicationAdded, void());
+ MOCK_METHOD1(OnPolicyInit, void(bool is_update_required));
+ MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus());
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_UPDATE_STATUS_MANAGER_H_
diff --git a/src/components/policy/policy_regular/test/log4cxx.properties b/src/components/policy/policy_regular/test/log4cxx.properties
new file mode 100644
index 0000000000..1c09444986
--- /dev/null
+++ b/src/components/policy/policy_regular/test/log4cxx.properties
@@ -0,0 +1,33 @@
+# 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=ERROR
+
+# Log for all SQLPTRepresentation messages
+log4j.appender.SQLPTRepresentationLogFile=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.SQLPTRepresentationLogFile.File=SQLRepresentation.log
+log4j.appender.SQLPTRepresentationLogFile.ImmediateFlush=true
+log4j.appender.SQLPTRepresentationLogFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.SQLPTRepresentationLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}] :%L %M: %m%n
+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
+
+# PolicyManagerImpl logs
+log4j.logger.PolicyManagerImpl=ALL, PolicyManagerImplLogFile
diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
new file mode 100644
index 0000000000..f76e856cd0
--- /dev/null
+++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc
@@ -0,0 +1,1379 @@
+/*
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <vector>
+#include <fstream>
+#include <string>
+#include <ctime>
+
+#include "json/reader.h"
+#include "json/writer.h"
+#include "gtest/gtest.h"
+
+#include "config_profile/profile.h"
+#include "policy/policy_manager_impl.h"
+#include "policy/policy_table/enums.h"
+#include "policy/policy_table/types.h"
+#include "policy/mock_policy_settings.h"
+#include "policy/mock_policy_listener.h"
+#include "policy/mock_cache_manager.h"
+#include "policy/mock_update_status_manager.h"
+
+#include "utils/macro.h"
+#include "utils/file_system.h"
+#include "utils/date_time.h"
+#include "utils/make_shared.h"
+#include "utils/gen_hash.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "policy/mock_access_remote.h"
+#endif // SDL_REMOTE_CONTROL
+using ::testing::ReturnRef;
+using ::testing::DoAll;
+using ::testing::SetArgReferee;
+using ::testing::NiceMock;
+using ::testing::_;
+using ::testing::SetArgReferee;
+using ::testing::AtLeast;
+using ::testing::Return;
+
+using ::policy::PolicyManagerImpl;
+using ::policy::PolicyTable;
+
+namespace test {
+namespace components {
+namespace policy_test {
+namespace policy_table = rpc::policy_table_interface_base;
+
+namespace custom_str = utils::custom_string;
+
+typedef std::multimap<std::string, policy_table::Rpcs&>
+ UserConsentPromptToRpcsConnections;
+
+template <typename T>
+std::string NumberToString(T Number) {
+ std::ostringstream ss;
+ ss << Number;
+ return ss.str();
+}
+
+template <typename T>
+void SortAndCheckEquality(std::vector<T> first, std::vector<T> second) {
+ ASSERT_EQ(first.size(), second.size());
+ std::sort(first.begin(), first.end());
+ std::sort(second.begin(), second.end());
+ // Checks
+ for (uint32_t i = 0; i < first.size(); ++i) {
+ EXPECT_EQ(first[i], second[i]);
+ }
+}
+
+struct StringsForUpdate {
+ std::string new_field_value_;
+ std::string new_field_name_;
+ std::string new_date_;
+};
+
+char GenRandomString(const char* alphanum) {
+ const int stringLength = sizeof(alphanum) - 1;
+ return alphanum[rand() % stringLength];
+}
+
+struct StringsForUpdate CreateNewRandomData(StringsForUpdate& str) {
+ // Generate random date
+ srand(time(NULL));
+ unsigned int day = 1 + rand() % 31; // Day from 1 - 31
+ unsigned int month = 1 + rand() % 12; // Month from 1 - 12
+ unsigned int year = 1985 + rand() % 31; // Year from 1985 - 2015
+
+ // Convert date to string
+ str.new_date_ = NumberToString(year) + '-' + NumberToString(month) + '-' +
+ NumberToString(day);
+
+ // Create new field
+ unsigned int number = 1 + rand() % 100; // Number from 1 - 100
+ str.new_field_name_ += NumberToString(number);
+
+ // Create new field random value
+ const char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ for (unsigned int i = 0; i < 5; ++i) {
+ str.new_field_value_ += GenRandomString(alphanum);
+ }
+ return str;
+}
+
+policy_table::AppHmiTypes HmiTypes(const policy_table::AppHMIType hmi_type) {
+ policy_table::AppHmiTypes hmi_types;
+ hmi_types.push_back(hmi_type);
+ return hmi_types;
+}
+
+class PolicyManagerImplTest : public ::testing::Test {
+ public:
+ PolicyManagerImplTest() : device_id("08-00-27-CE-76-FE") {}
+
+ protected:
+ PolicyManagerImpl* manager;
+ MockCacheManagerInterface* cache_manager;
+ NiceMock<MockPolicyListener> listener;
+ const std::string device_id;
+#ifdef SDL_REMOTE_CONTROL
+ utils::SharedPtr<access_remote_test::MockAccessRemote> access_remote;
+#endif // SDL_REMOTE_CONTROL
+
+ void SetUp() OVERRIDE {
+ manager = new PolicyManagerImpl();
+ manager->set_listener(&listener);
+ cache_manager = new MockCacheManagerInterface();
+ manager->set_cache_manager(cache_manager);
+
+#ifdef SDL_REMOTE_CONTROL
+ access_remote = new access_remote_test::MockAccessRemote();
+ manager->set_access_remote(access_remote);
+#endif // SDL_REMOTE_CONTROL
+ }
+
+ void TearDown() OVERRIDE {
+ delete manager;
+ }
+
+ ::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);
+ }
+ }
+};
+
+class PolicyManagerImplTest2 : public ::testing::Test {
+ public:
+ PolicyManagerImplTest2()
+ : app_id1("123456789")
+ , app_id2("1766825573")
+ , dev_id1("XXX123456789ZZZ")
+ , dev_id2("08-00-27-CE-76-FE")
+ , PTU_request_types(Json::arrayValue) {}
+
+ protected:
+ PolicyManagerImpl* manager;
+ NiceMock<MockPolicyListener> listener;
+ std::vector<std::string> hmi_level;
+ std::vector<std::string> PT_request_types;
+ uint32_t PTU_request_types_size;
+ unsigned int index;
+ const std::string app_id1;
+ const std::string app_id2;
+ const std::string dev_id1;
+ const std::string dev_id2;
+ Json::Value PTU_request_types;
+ NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
+ const std::string kAppStorageFolder = "storage_PolicyManagerImplTest2";
+
+ void SetUp() OVERRIDE {
+ file_system::CreateDirectory(kAppStorageFolder);
+ file_system::DeleteFile("policy.sqlite");
+
+ manager = new PolicyManagerImpl();
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ manager->set_listener(&listener);
+ const char* levels[] = {"BACKGROUND", "FULL", "LIMITED", "NONE"};
+ hmi_level.assign(levels, levels + sizeof(levels) / sizeof(levels[0]));
+ srand(time(NULL));
+ index = rand() % 3;
+ }
+
+ std::vector<std::string> JsonToVectorString(
+ const Json::Value& PTU_request_types) {
+ std::vector<std::string> result;
+ for (uint32_t i = 0; i < PTU_request_types.size(); ++i) {
+ result.push_back(PTU_request_types[i].asString());
+ }
+ return result;
+ }
+
+ const Json::Value GetPTU(std::string file_name) {
+ // Get PTU
+ std::ifstream ifile(file_name);
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ json = root.toStyledString();
+ }
+ ifile.close();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ // Load Json to cache
+ EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+ return root;
+ }
+
+ void CreateLocalPT(const std::string& file_name) {
+ file_system::remove_directory_content(kAppStorageFolder);
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_));
+ }
+
+ void AddRTtoPT(const std::string& update_file_name,
+ const std::string& section_name,
+ const uint32_t rt_number,
+ const uint32_t invalid_rt_number) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ // Get RequestTypes from section of preloaded_pt app_policies
+ PT_request_types = manager->GetAppRequestTypes(section_name);
+ EXPECT_EQ(rt_number, PT_request_types.size());
+ Json::Value root = GetPTU(update_file_name);
+ // Get Request Types from JSON (PTU)
+ PTU_request_types =
+ root["policy_table"]["app_policies"][section_name]["RequestType"];
+ PTU_request_types_size = PTU_request_types.size();
+ PT_request_types.clear();
+ // Get RequestTypes from section of PT app policies after update
+ PT_request_types = manager->GetAppRequestTypes(section_name);
+ // Check number of RT in PTU and PT now are equal
+ ASSERT_EQ(PTU_request_types_size - invalid_rt_number,
+ PT_request_types.size());
+ }
+
+ void AddRTtoAppSectionPT(const std::string& update_file_name,
+ const std::string& section_name,
+ const uint32_t rt_number,
+ const uint32_t invalid_rt_number) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ // Add app
+ manager->AddApplication(section_name, HmiTypes(policy_table::AHT_DEFAULT));
+ // Check app gets RequestTypes from pre_DataConsent of app_policies
+ // section
+ PT_request_types = manager->GetAppRequestTypes(section_name);
+ EXPECT_EQ(rt_number, PT_request_types.size());
+ EXPECT_CALL(listener, OnPendingPermissionChange(section_name)).Times(1);
+ Json::Value root = GetPTU(update_file_name);
+
+ // Get App Request Types from PTU
+ PTU_request_types =
+ root["policy_table"]["app_policies"][section_name]["RequestType"];
+ PTU_request_types_size = PTU_request_types.size();
+
+ PT_request_types.clear();
+ // Get RequestTypes from <app_id> section of app policies after PT update
+ PT_request_types = manager->GetAppRequestTypes(section_name);
+ // Check sizes of Request types of PT and PTU
+ ASSERT_EQ(PTU_request_types_size - invalid_rt_number,
+ PT_request_types.size());
+
+ ::policy::AppPermissions permissions =
+ manager->GetAppPermissionsChanges(section_name);
+ EXPECT_TRUE(permissions.requestTypeChanged);
+ }
+
+ std::vector<policy_table::RequestType> PushRequestTypesToContainer(
+ const std::vector<std::string>& temp_result) {
+ policy_table::RequestType filtered_result;
+ std::vector<policy_table::RequestType> final_result;
+ for (uint32_t i = 0; i < temp_result.size(); ++i) {
+ if (policy_table::EnumFromJsonString(temp_result[i], &filtered_result)) {
+ final_result.push_back(filtered_result);
+ }
+ }
+ return final_result;
+ }
+
+ void CheckResultForValidRT() {
+ // Convert Json Array to std::vector<std::string>
+ const std::vector<std::string>& result =
+ JsonToVectorString(PTU_request_types);
+ // Checks
+ SortAndCheckEquality(PT_request_types, result);
+ }
+
+ void CheckResultForInvalidRT() {
+ // Convert Json Array to std::vector<std::string>
+ const std::vector<std::string>& temp_result =
+ JsonToVectorString(PTU_request_types);
+ std::vector<policy_table::RequestType> result1 =
+ PushRequestTypesToContainer(temp_result);
+ std::vector<policy_table::RequestType> result2 =
+ PushRequestTypesToContainer(PT_request_types);
+ // Checks
+ SortAndCheckEquality(result1, result2);
+ }
+ void FillMultimapFromFunctionalGroupings(
+ UserConsentPromptToRpcsConnections& input_multimap,
+ policy_table::FunctionalGroupings& fg_table) {
+ policy_table::FunctionalGroupings::iterator fg_itter = fg_table.begin();
+ const policy_table::FunctionalGroupings::iterator fg_itter_end =
+ fg_table.end();
+ for (; fg_itter != fg_itter_end; ++fg_itter) {
+ // RPCS getting
+ policy_table::Rpcs& rpcs_ref = fg_itter->second;
+ // User_consent_prompt getting
+ rpc::Optional<rpc::String<1, 255> >& optional_ref =
+ rpcs_ref.user_consent_prompt;
+ rpc::String<1, 255>& ucp_string = *optional_ref;
+ const std::string& ucp_std_string =
+ static_cast<const std::string&>(ucp_string);
+ // Multimap inserting
+ input_multimap.insert(std::pair<std::string, policy_table::Rpcs&>(
+ ucp_std_string, rpcs_ref));
+ }
+ }
+
+ void GetFunctionalGroupingsFromManager(
+ policy_table::FunctionalGroupings& input_functional_groupings) {
+ // Get cache
+ ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
+ // Get table_snapshot
+ utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ // Set functional groupings from policy table
+ input_functional_groupings = table->policy_table.functional_groupings;
+ }
+
+ void TearDown() OVERRIDE {
+ delete manager;
+ file_system::remove_directory_content(kAppStorageFolder);
+ file_system::RemoveDirectory(kAppStorageFolder, true);
+ }
+};
+
+Json::Value CreatePTforLoad() {
+ const std::string load_table(
+ "{"
+ "\"policy_table\": {"
+ "\"module_config\": {"
+ "\"preloaded_pt\": true,"
+ "\"exchange_after_x_ignition_cycles\": 10,"
+ "\"exchange_after_x_kilometers\": 100,"
+ "\"exchange_after_x_days\": 5,"
+ "\"timeout_after_x_seconds\": 500,"
+ "\"seconds_between_retries\": [10, 20, 30],"
+ "\"endpoints\": {"
+ "\"0x00\": {"
+ "\"default\": [\"http://ford.com/cloud/default\"]"
+ "}"
+ "},"
+ "\"notifications_per_minute_by_priority\": {"
+ "\"emergency\": 1,"
+ "\"navigation\": 2,"
+ "\"VOICECOMM\": 3,"
+ "\"communication\": 4,"
+ "\"normal\": 5,"
+ "\"none\": 6"
+ "},"
+ "\"vehicle_make\" : \"MakeT\","
+ "\"vehicle_model\" : \"ModelT\","
+ "\"vehicle_year\": \"2014\""
+ "},"
+ "\"app_policies\": {"
+ "\"default\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "}, "
+ "\"pre_DataConsent\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "}, "
+ "\"device\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "},"
+ "\"1234\": {"
+ "\"memory_kb\": 50,"
+ "\"heart_beat_timeout_ms\": 100,"
+ "\"groups\": [\"default\"],"
+ "\"keep_context\": true,"
+ "\"steal_focus\": true,"
+ "\"priority\": \"EMERGENCY\","
+ "\"default_hmi\": \"FULL\","
+ "\"certificate\": \"sign\""
+ "}"
+ "},"
+ "\"consumer_friendly_messages\": {"
+ "\"version\": \"1.2\""
+ "},"
+ "\"functional_groupings\": {"
+ "\"default\": {"
+ "\"rpcs\": {"
+ "\"Update\": {"
+ "\"hmi_levels\": [\"FULL\"],"
+ "\"parameters\" : [\"speed\"]"
+ "}"
+ "}"
+ "}"
+ "}"
+ "}"
+ "}");
+ Json::Value table(Json::objectValue);
+ Json::Reader reader;
+ EXPECT_TRUE(reader.parse(load_table, table));
+ return table;
+}
+
+TEST_F(PolicyManagerImplTest, GetNotificationsNumber) {
+ const std::string priority = "EMERGENCY";
+ const uint32_t notif_number = 100u;
+ EXPECT_CALL(*cache_manager, GetNotificationsNumber(priority))
+ .WillOnce(Return(notif_number));
+
+ EXPECT_EQ(notif_number, manager->GetNotificationsNumber(priority));
+}
+
+TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
+ // Arrange
+ Json::Value table = CreatePTforLoad();
+ manager->ForcePTExchange();
+ manager->SetSendOnUpdateSentOut(false);
+ manager->OnUpdateStarted();
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ // Act
+ const std::string json = table.toStyledString();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ EXPECT_CALL(listener, OnUpdateStatusChanged(_));
+ EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+
+ std::string priority = "emergency";
+ uint32_t notif_number = manager->GetNotificationsNumber(priority);
+ EXPECT_EQ(1u, notif_number);
+
+ priority = "navigation";
+ notif_number = manager->GetNotificationsNumber(priority);
+ EXPECT_EQ(2u, notif_number);
+
+ priority = "emergency";
+ notif_number = manager->GetNotificationsNumber(priority);
+ EXPECT_EQ(1u, notif_number);
+
+ priority = "VOICECOMM";
+ notif_number = manager->GetNotificationsNumber(priority);
+ EXPECT_EQ(3u, notif_number);
+
+ priority = "normal";
+ notif_number = manager->GetNotificationsNumber(priority);
+ EXPECT_EQ(5u, notif_number);
+
+ priority = "none";
+ notif_number = manager->GetNotificationsNumber(priority);
+ EXPECT_EQ(6u, notif_number);
+}
+
+TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) {
+ // Arrange
+ std::ifstream ifile("sdl_preloaded_pt.json");
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ root["policy_table"]["app_policies"][app_id1] = Json::nullValue;
+ json = root.toStyledString();
+ }
+ ifile.close();
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+ EXPECT_TRUE(manager->IsApplicationRevoked(app_id1));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_SetRevokedAppID_ExpectRPCDisallowed) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ (manager->GetCache())->AddDevice(dev_id1, "Bluetooth");
+ (manager->GetCache())
+ ->SetDeviceData(dev_id1,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id1))
+ .WillRepeatedly(Return(dev_id1));
+ manager->SetUserConsentForDevice(dev_id1, true);
+ // Add app from consented device. App will be assigned with default policies
+ manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ // Check before action
+ policy_table::RpcParameters rpc_parameters;
+ rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
+
+ policy_table::Rpc rpc;
+ rpc["Alert"] = rpc_parameters;
+
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+
+ manager->CheckPermissions(
+ dev_id1, app_id1, std::string("FULL"), "Alert", input_params, output);
+
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+ // Act
+ std::ifstream ifile("sdl_preloaded_pt.json");
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ root["policy_table"]["app_policies"][app_id1] = Json::nullValue;
+ json = root.toStyledString();
+ }
+ ifile.close();
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+
+ manager->CheckPermissions(
+ dev_id1, app_id1, std::string("FULL"), "Alert", input_params, output);
+ // Check RPC is disallowed
+ EXPECT_EQ(::policy::kRpcDisallowed, output.hmi_level_permitted);
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CheckPermissions_SetAppIDwithPolicies_ExpectRPCAllowed) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ manager->AddDevice(dev_id1, "Bluetooth");
+
+ ASSERT_TRUE((manager->GetCache())
+ ->SetDeviceData(dev_id1,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired("1234"))
+ .WillRepeatedly(Return(dev_id1));
+ manager->SetUserConsentForDevice(dev_id1, true);
+ // Add app from consented device. App will be assigned with default policies
+ manager->AddApplication("1234", HmiTypes(policy_table::AHT_MEDIA));
+ // Emulate PTU with new policies for app added above
+ std::ifstream ifile("sdl_preloaded_pt.json");
+ Json::Reader reader;
+ std::string json;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ // Add AppID with policies
+ root["policy_table"]["app_policies"]["1234"] =
+ Json::Value(Json::objectValue);
+ root["policy_table"]["app_policies"]["1234"]["memory_kb"] = Json::Value(50);
+ root["policy_table"]["app_policies"]["1234"]["heart_beat_timeout_ms"] =
+ Json::Value(100);
+ root["policy_table"]["app_policies"]["1234"]["AppHMIType"] =
+ Json::Value(Json::arrayValue);
+ root["policy_table"]["app_policies"]["1234"]["AppHMIType"][0] =
+ Json::Value("MEDIA");
+ root["policy_table"]["app_policies"]["1234"]["groups"] =
+ Json::Value(Json::arrayValue);
+ root["policy_table"]["app_policies"]["1234"]["groups"][0] =
+ Json::Value("Base-4");
+ root["policy_table"]["app_policies"]["1234"]["priority"] =
+ Json::Value("EMERGENCY");
+ root["policy_table"]["app_policies"]["1234"]["default_hmi"] =
+ Json::Value("FULL");
+ root["policy_table"]["app_policies"]["1234"]["keep_context"] =
+ Json::Value(true);
+ root["policy_table"]["app_policies"]["1234"]["steal_focus"] =
+ Json::Value(true);
+ root["policy_table"]["app_policies"]["1234"]["certificate"] =
+ Json::Value("sign");
+ json = root.toStyledString();
+ }
+ ifile.close();
+
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+ // Load Json to cache
+ EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
+
+ policy_table::RpcParameters rpc_parameters;
+ rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
+
+ policy_table::Rpc rpc;
+ rpc["Alert"] = rpc_parameters;
+ ::policy::RPCParams input_params;
+ ::policy::CheckPermissionResult output;
+
+ (manager->GetCache())->AddDevice(dev_id1, "Bluetooth");
+ (manager->GetCache())
+ ->SetDeviceData(dev_id1,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth");
+ manager->CheckPermissions(dev_id1,
+ std::string("1234"),
+ std::string("FULL"),
+ "Alert",
+ input_params,
+ output);
+ // Check RPC is allowed
+ EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
+ // Check list of parameters empty
+ ASSERT_TRUE(output.list_of_allowed_params.empty());
+}
+
+TEST_F(PolicyManagerImplTest, IncrementGlobalCounter) {
+ // Assert
+ EXPECT_CALL(*cache_manager, Increment(usage_statistics::SYNC_REBOOTS));
+ manager->Increment(usage_statistics::SYNC_REBOOTS);
+}
+
+TEST_F(PolicyManagerImplTest, IncrementAppCounter) {
+ // Assert
+ EXPECT_CALL(*cache_manager,
+ Increment("12345", usage_statistics::USER_SELECTIONS));
+ manager->Increment("12345", usage_statistics::USER_SELECTIONS);
+}
+
+TEST_F(PolicyManagerImplTest, SetAppInfo) {
+ // Assert
+ EXPECT_CALL(*cache_manager,
+ Set("12345", usage_statistics::LANGUAGE_GUI, "de-de"));
+ manager->Set("12345", usage_statistics::LANGUAGE_GUI, "de-de");
+}
+
+TEST_F(PolicyManagerImplTest, AddAppStopwatch) {
+ // Assert
+ EXPECT_CALL(*cache_manager,
+ Add("12345", usage_statistics::SECONDS_HMI_FULL, 30));
+ manager->Add("12345", usage_statistics::SECONDS_HMI_FULL, 30);
+}
+
+TEST_F(PolicyManagerImplTest, ResetPT) {
+ EXPECT_CALL(*cache_manager, ResetPT("filename"))
+ .WillOnce(Return(true))
+ .WillOnce(Return(false));
+ EXPECT_CALL(*cache_manager, ResetCalculatedPermissions()).Times(AtLeast(1));
+ EXPECT_CALL(*cache_manager, TimeoutResponse());
+ EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_));
+
+ EXPECT_TRUE(manager->ResetPT("filename"));
+ EXPECT_FALSE(manager->ResetPT("filename"));
+}
+
+TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
+ // Arrange
+ manager->ForcePTExchange();
+ manager->OnUpdateStarted();
+ Json::Value table = CreatePTforLoad();
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+
+ // Assert
+ ASSERT_TRUE(IsValid(update));
+
+ EXPECT_CALL(*cache_manager, GetHMIAppTypeAfterUpdate(_)).Times(AtLeast(1));
+
+ // Act
+ const std::string json = table.toStyledString();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+
+ utils::SharedPtr<policy_table::Table> snapshot =
+ utils::MakeShared<policy_table::Table>(update.policy_table);
+ // Assert
+ EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot));
+ EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true));
+ EXPECT_CALL(listener, GetAppName("1234"))
+ .WillOnce(Return(custom_str::CustomString("")));
+ 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, LoadPT_SetInvalidUpdatePT_PTIsNotLoaded) {
+ // Arrange
+ Json::Value table(Json::objectValue);
+ manager->ForcePTExchange();
+ manager->OnUpdateStarted();
+
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+
+ // Assert update is invalid
+ ASSERT_FALSE(IsValid(update));
+
+ // Act
+ std::string json = table.toStyledString();
+ ::policy::BinaryMessage msg(json.begin(), json.end());
+
+ // Assert
+ EXPECT_CALL(*cache_manager, GenerateSnapshot()).Times(0);
+ EXPECT_CALL(*cache_manager, ApplyUpdate(_)).Times(0);
+ EXPECT_CALL(listener, GetAppName(_)).Times(0);
+ EXPECT_CALL(listener, OnUpdateStatusChanged(_)).Times(1);
+ EXPECT_CALL(*cache_manager, SaveUpdateRequired(false)).Times(0);
+ EXPECT_CALL(*cache_manager, TimeoutResponse()).Times(0);
+ EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_)).Times(0);
+ EXPECT_FALSE(manager->LoadPT("file_pt_update.json", msg));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ KmsChanged_SetExceededKms_ExpectCorrectSchedule) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ ::policy::Counters counter = ::policy::Counters::KILOMETERS;
+ manager->PTUpdatedAt(counter, 50000);
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ // Set kms changed but not exceed limit
+ manager->KmsChanged(51500);
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ // Set kms changed and exceed limit
+ manager->KmsChanged(52500);
+ EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ AddApplication_AddNewApplicationFromDeviceWithoutConsent_ExpectUpdateRequired) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ ::policy::StatusNotifier notifyer =
+ manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ DCHECK(notifyer);
+ (*notifyer)();
+ EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithConsent_ExpectDefault) {
+ // Arrange
+ // RequestTypes for default & preDataConsent are different
+ CreateLocalPT("ptu_requestType.json");
+ manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
+ manager->ReactOnUserDevConsentForApp(app_id1, true);
+ EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
+ EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id1));
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithConsent_ExpectPreDataConsent) {
+ // Arrange
+ // RequestTypes for default & preDataConsent are the same
+ CreateLocalPT("ptu2_requestType.json");
+ manager->AddApplication(app_id1, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
+ EXPECT_CALL(listener, OnPendingPermissionChange(app_id1)).Times(0);
+ manager->ReactOnUserDevConsentForApp(app_id1, true);
+ EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
+ EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id1));
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ AddApplication_AddExistingApplicationFromDeviceWithoutConsent_ExpectNoUpdateRequired) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ GetPTU("valid_sdl_pt_update.json");
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ // Try to add existing app
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ // Check no update required
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ TimevalStruct current_time = date_time::DateTime::getCurrentTime();
+ const int kSecondsInDay = 60 * 60 * 24;
+ int days = current_time.tv_sec / kSecondsInDay;
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+
+ GetPTU("valid_sdl_pt_update.json");
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ ::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
+ // Set PT was updated 10 days ago (limit is 30 days for now)
+ // So no limit exceeded
+ manager->PTUpdatedAt(counter, days - 10);
+ manager->OnAppRegisteredOnMobile(app_id2);
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2, ForcePTExchange_ExpectUpdateNeeded) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+ // Force OT Exchange
+ manager->ForcePTExchange();
+ // Check update required
+ EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2, OnSystemReady) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ // Check
+ EXPECT_CALL(listener, OnSystemInfoUpdateRequired());
+ manager->OnSystemReady();
+}
+
+TEST_F(PolicyManagerImplTest2, ResetRetrySequence) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ manager->ResetRetrySequence();
+ EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
+ manager->SetSendOnUpdateSentOut(false);
+ manager->OnUpdateStarted();
+ EXPECT_EQ("UPDATING", manager->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
+ // Arrange
+ std::ifstream ifile("sdl_preloaded_pt.json");
+ Json::Reader reader;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ Json::Value seconds_between_retries = Json::Value(Json::arrayValue);
+ seconds_between_retries =
+ root["policy_table"]["module_config"]["seconds_between_retries"];
+ CreateLocalPT("sdl_preloaded_pt.json");
+ // Check data
+ uint32_t timeout_after_x_seconds =
+ root["policy_table"]["module_config"]["timeout_after_x_seconds"]
+ .asInt() *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+ const uint32_t first_retry = timeout_after_x_seconds;
+ EXPECT_EQ(first_retry, manager->NextRetryTimeout());
+ uint32_t next_retry = first_retry +
+ seconds_between_retries[0].asInt() *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+ EXPECT_EQ(next_retry, manager->NextRetryTimeout());
+ next_retry = first_retry + next_retry +
+ seconds_between_retries[1].asInt() *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+ EXPECT_EQ(next_retry, manager->NextRetryTimeout());
+ next_retry = first_retry + next_retry +
+ seconds_between_retries[2].asInt() *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+ EXPECT_EQ(next_retry, manager->NextRetryTimeout());
+ next_retry = first_retry + next_retry +
+ seconds_between_retries[3].asInt() *
+ date_time::DateTime::MILLISECONDS_IN_SECOND;
+ EXPECT_EQ(next_retry, manager->NextRetryTimeout());
+ }
+}
+
+TEST_F(PolicyManagerImplTest2, TimeOutExchange) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ // Check value taken from PT
+ EXPECT_EQ(70000u, manager->TimeoutExchangeMSec());
+}
+
+TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
+ // Arrange necessary pre-conditions
+ StringsForUpdate new_data;
+ new_data.new_field_name_ = "Notifications-";
+ CreateNewRandomData(new_data);
+ // Create Initial LocalPT from preloadedPT
+ CreateLocalPT("sdl_preloaded_pt.json");
+ // Update preloadedPT
+ std::ifstream ifile("sdl_preloaded_pt.json");
+ Json::Reader reader;
+ Json::Value root(Json::objectValue);
+
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ root["policy_table"]["module_config"]["preloaded_date"] =
+ new_data.new_date_;
+ Json::Value val(Json::objectValue);
+ Json::Value val2(Json::arrayValue);
+ val2[0] = hmi_level[index];
+ val[new_data.new_field_value_]["hmi_levels"] = val2;
+ root["policy_table"]["functional_groupings"][new_data
+ .new_field_name_]["rpcs"] =
+ val;
+ root["policy_table"]["functional_groupings"][new_data.new_field_name_]
+ ["user_consent_prompt"] = new_data.new_field_name_;
+ }
+ ifile.close();
+
+ Json::StyledStreamWriter writer;
+ std::ofstream ofile("sdl_preloaded_pt.json");
+ writer.write(ofile, root);
+ ofile.flush();
+ ofile.close();
+
+ // Make PolicyManager to update LocalPT
+ EXPECT_TRUE(manager->InitPT("sdl_preloaded_pt.json", &policy_settings_));
+
+ // Arrange
+ ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
+ utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
+ // Get FunctionalGroupings
+ policy_table::FunctionalGroupings& fc =
+ table->policy_table.functional_groupings;
+ // Get RPCs for new added field in functional_group
+ policy_table::Rpcs& rpcs = fc[new_data.new_field_name_];
+ // Get user consent prompt
+ const std::string& ucp = *(rpcs.user_consent_prompt);
+ // Get Rpcs
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ // Get RPC's parameters
+ policy_table::RpcParameters& rpc_param = rpc[new_data.new_field_value_];
+
+ // Check preloaded date
+ EXPECT_EQ(static_cast<std::string>(
+ *(table->policy_table.module_config.preloaded_date)),
+ new_data.new_date_);
+ // Check if new field exists in Local PT
+ EXPECT_TRUE(fc.find(new_data.new_field_name_) != fc.end());
+ // Check if user_consent_propmp is correct
+ EXPECT_EQ(new_data.new_field_name_, ucp);
+ // Check if new RPC exists
+ EXPECT_TRUE(rpc.find(new_data.new_field_value_) != rpc.end());
+ // Check HMI level of new RPC
+ EXPECT_EQ(index, static_cast<uint32_t>(rpc_param.hmi_levels[0]));
+ // Check if new field matches field added to preloaded PT
+ EXPECT_EQ(std::string((*(fc.find(new_data.new_field_name_))).first),
+ new_data.new_field_name_);
+}
+
+TEST_F(PolicyManagerImplTest2, GetPolicyTableStatus_ExpectUpToDate) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ // Check
+ EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ RetrySequenceDelaysSeconds_Expect_CorrectValues) {
+ // Arrange
+ std::ifstream ifile("sdl_preloaded_pt.json");
+ Json::Reader reader;
+ Json::Value root(Json::objectValue);
+ if (ifile.is_open() && reader.parse(ifile, root, true)) {
+ Json::Value seconds_between_retries = Json::Value(Json::arrayValue);
+ seconds_between_retries =
+ root["policy_table"]["module_config"]["seconds_between_retries"];
+ uint32_t size = seconds_between_retries.size();
+ CreateLocalPT("sdl_preloaded_pt.json");
+ std::vector<int> delaySecs = manager->RetrySequenceDelaysSeconds();
+ // Check
+ ASSERT_EQ(size, delaySecs.size());
+ for (uint32_t i = 0; i < size; ++i) {
+ EXPECT_EQ(seconds_between_retries[i], delaySecs[i]);
+ }
+ }
+}
+
+TEST_F(PolicyManagerImplTest2,
+ OnExceededTimeout_GetPolicyTableStatus_ExpectUpdateNeeded) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ manager->ForcePTExchange();
+ manager->OnExceededTimeout();
+ // Check
+ EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetUserConsentForDevice_SetDeviceAllowed_ExpectReceivedConsentCorrect) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
+
+ ASSERT_TRUE((manager->GetCache())
+ ->SetDeviceData(dev_id2,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ manager->SetUserConsentForDevice(dev_id2, true);
+ ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ DISABLED_GetDefaultHmi_SetDeviceAllowed_ExpectReceivedHmiCorrect) {
+ // Arrange
+ CreateLocalPT("ptu2_requestType.json");
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
+ std::string default_hmi1;
+ manager->GetDefaultHmi(app_id2, &default_hmi1);
+ EXPECT_EQ("", default_hmi1);
+ ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
+ ASSERT_TRUE((manager->GetCache())
+ ->SetDeviceData(dev_id2,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ manager->SetUserConsentForDevice(dev_id2, true);
+ ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ .WillRepeatedly(Return(dev_id2));
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
+ std::string default_hmi2;
+ manager->GetDefaultHmi(app_id2, &default_hmi2);
+ EXPECT_EQ("", default_hmi2);
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetDefaultPriority_SetDeviceAllowed_ExpectReceivedPriorityCorrect) {
+ // Arrange
+ CreateLocalPT("ptu2_requestType.json");
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
+ std::string priority1;
+ EXPECT_TRUE(manager->GetPriority(app_id2, &priority1));
+ EXPECT_EQ("EMERGENCY", priority1);
+ ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
+ ASSERT_TRUE((manager->GetCache())
+ ->SetDeviceData(dev_id2,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ manager->SetUserConsentForDevice(dev_id2, true);
+ ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
+ // Check
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ .WillRepeatedly(Return(dev_id2));
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
+ std::string priority2;
+ EXPECT_TRUE(manager->GetPriority(app_id2, &priority2));
+ EXPECT_EQ("EMERGENCY", priority2);
+}
+
+TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ ::policy::StringArray app_nicknames;
+ ::policy::StringArray app_hmi_types;
+ manager->GetInitialAppData(app_id2, &app_nicknames, &app_hmi_types);
+ // Expect Empty nicknames and AppHmiTypes
+ EXPECT_EQ(0u, app_nicknames.size());
+ EXPECT_EQ(0u, app_hmi_types.size());
+
+ Json::Value root = GetPTU("valid_sdl_pt_update.json");
+
+ Json::Value appHmiTypes = Json::Value(Json::arrayValue);
+ appHmiTypes = root["policy_table"]["app_policies"][app_id2]["AppHMIType"];
+ uint32_t appHmiType_size = appHmiTypes.size();
+
+ Json::Value appNicknames = Json::Value(Json::arrayValue);
+ appNicknames = root["policy_table"]["app_policies"][app_id2]["nicknames"];
+ uint32_t appNicknames_size = appNicknames.size();
+
+ ::policy::StringArray app_nicknames1;
+ ::policy::StringArray app_hmi_types1;
+ manager->GetInitialAppData(app_id2, &app_nicknames1, &app_hmi_types1);
+ uint32_t nick_names_size = app_nicknames1.size();
+ uint32_t app_hmi_types_size = app_hmi_types1.size();
+ ASSERT_EQ(appHmiType_size, app_hmi_types_size);
+ ASSERT_EQ(appNicknames_size, nick_names_size);
+ ASSERT_GT(nick_names_size, 0u);
+ ASSERT_GT(app_hmi_types_size, 0u);
+ // Check nicknames match
+ for (uint32_t i = 0; i < nick_names_size; ++i) {
+ EXPECT_EQ(app_nicknames1[i], appNicknames[i].asString());
+ }
+ // Check AppHmiTypes match
+ for (uint32_t i = 0; i < app_hmi_types_size; ++i) {
+ EXPECT_EQ(app_hmi_types1[i], appHmiTypes[i].asString());
+ }
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ CanAppKeepContext_AddAppFromUnconsentedDevice_ExpectAppCannotKeepContext) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ // Check if app has preData policy
+ EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
+ // Check keep context in preData policy
+ EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppKeepContext_AddAppFromConsentedDevice_ExpectAppCannotKeepContext) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ ASSERT_TRUE((manager->GetCache())
+ ->SetDeviceData(dev_id2,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ manager->SetUserConsentForDevice(dev_id2, true);
+ ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ .WillRepeatedly(Return(dev_id2));
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
+ // Check keep context in default policy
+ EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppKeepContext_SetPoliciesForAppUpdated_ExpectAppCanKeepContext) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ GetPTU("valid_sdl_pt_update.json");
+ // Check keep context in updated policies for app
+ EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppStealFocus_AddAppFromConsentedDevice_ExpectAppCannotStealFocus) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ ASSERT_TRUE((manager->GetCache())
+ ->SetDeviceData(dev_id2,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+ manager->SetUserConsentForDevice(dev_id2, true);
+ ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
+ EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ .WillRepeatedly(Return(dev_id2));
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
+ // Check keep context in default policy
+ EXPECT_TRUE(manager->CanAppStealFocus(app_id2));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ CanAppStealFocus_SetPoliciesForAppUpdated_ExpectAppCanStealFocus) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ GetPTU("valid_sdl_pt_update.json");
+ // Check keep context in updated policies for app
+ EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
+}
+
+TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
+ // Arrange
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2)).Times(2);
+ EXPECT_EQ(custom_str::CustomString(""), manager->GetCurrentDeviceId(app_id2));
+ EXPECT_EQ("", manager->GetCurrentDeviceId(app_id2));
+}
+
+TEST_F(PolicyManagerImplTest2,
+ GetVehicleInfo_SetVehicleInfo_ExpectReceivedInfoCorrect) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ GetPTU("valid_sdl_pt_update.json");
+ utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt();
+ policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
+ ::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo();
+
+ EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_make),
+ vehicle_info.vehicle_make);
+ EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_model),
+ vehicle_info.vehicle_model);
+ EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_year),
+ vehicle_info.vehicle_year);
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ GetPermissionsForApp_SetUserConsentForApp_ExpectReceivedPermissionsCorrect) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+
+ ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
+ ASSERT_TRUE((manager->GetCache())
+ ->SetDeviceData(dev_id2,
+ "hardware IPX",
+ "v.8.0.1",
+ "Android",
+ "4.4.2",
+ "Life",
+ 2,
+ "Bluetooth"));
+
+ ::policy::StringArray consented_groups;
+ ::policy::StringArray disallowed_groups;
+ consented_groups.push_back(std::string("Notifications"));
+ (manager->GetCache())
+ ->SetUserPermissionsForDevice(
+ dev_id2, consented_groups, disallowed_groups);
+ manager->SetUserConsentForDevice(dev_id2, true);
+ EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
+ .WillRepeatedly(Return(dev_id2));
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+
+ GetPTU("valid_sdl_pt_update.json");
+ ::policy::PermissionConsent perm_consent;
+ perm_consent.device_id = dev_id2;
+ perm_consent.policy_app_id = app_id2;
+ perm_consent.consent_source = "VR";
+
+ ::policy::FunctionalGroupPermission group1_perm;
+ group1_perm.group_alias = "Notifications";
+ group1_perm.group_name = "Notifications";
+ group1_perm.group_id = ::utils::Djb2HashFromString("Notifications");
+ group1_perm.state = ::policy::GroupConsent::kGroupAllowed;
+
+ std::vector< ::policy::FunctionalGroupPermission> groups_permissions;
+ groups_permissions.push_back(group1_perm);
+ perm_consent.group_permissions = groups_permissions;
+
+ manager->SetUserConsentForApp(perm_consent);
+ manager->SendNotificationOnPermissionsUpdated(app_id2);
+ std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
+ std::vector< ::policy::FunctionalGroupPermission>::iterator it;
+ manager->GetPermissionsForApp(dev_id2, app_id2, actual_groups_permissions);
+ uint32_t index = 0;
+ for (; index < actual_groups_permissions.size(); ++index) {
+ if (actual_groups_permissions[index].group_id == group1_perm.group_id) {
+ break;
+ }
+ }
+ // Check
+ EXPECT_EQ(group1_perm.group_alias,
+ actual_groups_permissions[index].group_alias);
+ EXPECT_EQ(group1_perm.group_name,
+ actual_groups_permissions[index].group_name);
+ EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
+ EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
+}
+
+TEST_F(
+ PolicyManagerImplTest2,
+ HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
+ // Arrange
+ CreateLocalPT("sdl_preloaded_pt.json");
+ utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt();
+ ::policy_table::PolicyTableType type1 =
+ ::policy_table::PolicyTableType::PT_PRELOADED;
+ pt->SetPolicyTableType(type1);
+ if (!pt->is_valid()) {
+ std::cout << "\nPolicy table is not valid."
+ << "\n";
+ rpc::ValidationReport report("policy_table");
+ pt->ReportErrors(&report);
+ }
+ // Add new app
+ manager->AddApplication(app_id2, HmiTypes(policy_table::AHT_DEFAULT));
+ uint32_t result = manager->HeartBeatTimeout(app_id2);
+ // By default hertbeat timeout is 0
+ EXPECT_EQ(0u, result);
+ Json::Value root = GetPTU("valid_sdl_pt_update.json");
+
+ ::policy_table::PolicyTableType type2 =
+ ::policy_table::PolicyTableType::PT_UPDATE;
+ pt->SetPolicyTableType(type2);
+ if (!pt->is_valid()) {
+ std::cout << "\nPolicy table is not valid."
+ << "\n";
+ rpc::ValidationReport report("policy_table");
+ pt->ReportErrors(&report);
+ }
+
+ Json::Value heart_beat_timeout = Json::Value(Json::uintValue);
+ heart_beat_timeout =
+ root["policy_table"]["app_policies"][app_id2]["heart_beat_timeout_ms"];
+ result = manager->HeartBeatTimeout(app_id2);
+ EXPECT_EQ(heart_beat_timeout.asUInt(), result);
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/test/ptu2_requestType.json b/src/components/policy/policy_regular/test/ptu2_requestType.json
index 50364397fd..50364397fd 100644
--- a/src/components/policy/test/ptu2_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu2_requestType.json
diff --git a/src/components/policy/test/ptu_requestType.json b/src/components/policy/policy_regular/test/ptu_requestType.json
index 44bd8356fe..44bd8356fe 100644
--- a/src/components/policy/test/ptu_requestType.json
+++ b/src/components/policy/policy_regular/test/ptu_requestType.json
diff --git a/src/components/policy/policy_regular/test/sdl_preloaded_pt.json b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
new file mode 100644
index 0000000000..d6f34c12fc
--- /dev/null
+++ b/src/components/policy/policy_regular/test/sdl_preloaded_pt.json
@@ -0,0 +1,1944 @@
+ {
+ "policy_table": {
+ "module_config": {
+ "preloaded_pt": true,
+ "preloaded_date": "2015-02-12",
+ "exchange_after_x_ignition_cycles": 100,
+ "exchange_after_x_kilometers": 1800,
+ "exchange_after_x_days": 30,
+ "timeout_after_x_seconds": 70,
+ "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"],
+ "RequestType": [
+ "QUERY_APPS",
+ "LAUNCH_APP",
+ "PROPRIETARY"
+ ]
+ },
+ "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"],
+ "RequestType": ["HTTP"]
+ }
+ }
+ }
+ }
diff --git a/src/components/policy/policy_regular/test/sdl_pt_first_update.json b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
new file mode 100644
index 0000000000..e6817da0d3
--- /dev/null
+++ b/src/components/policy/policy_regular/test/sdl_pt_first_update.json
@@ -0,0 +1,1744 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "watchdog_timer_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "Notifications-2" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "FULL" ]
+ }
+ },
+ "user_consent_prompt" : "Old_Notifications"
+ },
+ "Notifications-3" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "LIMITED" ]
+ }
+ },
+ "user_consent_prompt" : "Old_Notifications"
+ },
+ "Notifications-4" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "NONE" ]
+ }
+ },
+ "user_consent_prompt" : "New_Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_regular/test/sdl_pt_second_update.json b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
new file mode 100644
index 0000000000..d5f5f480f3
--- /dev/null
+++ b/src/components/policy/policy_regular/test/sdl_pt_second_update.json
@@ -0,0 +1,1744 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "watchdog_timer_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "Notifications-2" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "FULL" ]
+ }
+ },
+ "user_consent_prompt" : "Old_Notifications"
+ },
+ "Notifications-3" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "LIMITED" ]
+ }
+ },
+ "user_consent_prompt" : "New_Notifications"
+ },
+ "Notifications-4" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "NONE" ]
+ }
+ },
+ "user_consent_prompt" : "New_Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/test/sdl_pt_update.json b/src/components/policy/policy_regular/test/sdl_pt_update.json
index a332f92382..a332f92382 100644
--- a/src/components/policy/test/sdl_pt_update.json
+++ b/src/components/policy/policy_regular/test/sdl_pt_update.json
diff --git a/src/components/policy/policy_regular/test/shared_library_test.cc b/src/components/policy/policy_regular/test/shared_library_test.cc
new file mode 100644
index 0000000000..b7183a9085
--- /dev/null
+++ b/src/components/policy/policy_regular/test/shared_library_test.cc
@@ -0,0 +1,76 @@
+/* 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 <dlfcn.h>
+
+#include "gtest/gtest.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+::testing::AssertionResult IsError(void* error) {
+ if (error) {
+ return ::testing::AssertionSuccess() << static_cast<const char*>(error);
+ } else {
+ return ::testing::AssertionFailure() << error;
+ }
+}
+
+TEST(SharedLibraryTest,
+ FullTest_OpenLibrarySetSymbolCloseLibrary_ExpectActsWithoutErrors) {
+ // Arrange
+ const std::string kLib = "../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()));
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/test/smartDeviceLink.ini b/src/components/policy/policy_regular/test/smartDeviceLink.ini
index 550630161c..550630161c 100644
--- a/src/components/policy/test/smartDeviceLink.ini
+++ b/src/components/policy/policy_regular/test/smartDeviceLink.ini
diff --git a/src/components/policy/test/smartDeviceLink2.ini b/src/components/policy/policy_regular/test/smartDeviceLink2.ini
index 6aec231dbb..6aec231dbb 100644
--- a/src/components/policy/test/smartDeviceLink2.ini
+++ b/src/components/policy/policy_regular/test/smartDeviceLink2.ini
diff --git a/src/components/policy/test/smartDeviceLink3.ini b/src/components/policy/policy_regular/test/smartDeviceLink3.ini
index d96694313a..d96694313a 100644
--- a/src/components/policy/test/smartDeviceLink3.ini
+++ b/src/components/policy/policy_regular/test/smartDeviceLink3.ini
diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
new file mode 100644
index 0000000000..fd83c82b1a
--- /dev/null
+++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc
@@ -0,0 +1,1706 @@
+/* Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <vector>
+#include <string>
+#include <algorithm>
+#include <fstream>
+#include <memory>
+#include <stdio.h>
+#include <sys/stat.h>
+
+#include "gtest/gtest.h"
+#include "policy/driver_dbms.h"
+#include "policy/sql_pt_representation.h"
+#include "policy/policy_types.h"
+#include "policy/mock_policy_settings.h"
+#include "policy/policy_table/types.h"
+#include "policy/policy_table/enums.h"
+#include "json/writer.h"
+#include "json/reader.h"
+#include "rpc_base/rpc_base.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "utils/file_system.h"
+#include "utils/sqlite_wrapper/sql_database.h"
+
+namespace policy_table = rpc::policy_table_interface_base;
+using policy::SQLPTRepresentation;
+using policy::CheckPermissionResult;
+using policy::UserFriendlyMessage;
+using policy::EndpointUrls;
+using policy::VehicleInfo;
+
+using testing::ReturnRef;
+using testing::Return;
+using testing::NiceMock;
+using testing::Mock;
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using policy_handler_test::MockPolicySettings;
+
+class SQLPTRepresentationTest : public SQLPTRepresentation,
+ public ::testing::Test {
+ protected:
+ DBMS* dbms;
+ SQLPTRepresentation* reps;
+ static const std::string kDatabaseName;
+ static const std::string kAppStorageFolder;
+ // Gtest can show message that this object doesn't destroyed
+ std::auto_ptr<NiceMock<MockPolicySettings> > policy_settings_;
+
+ void SetUp() OVERRIDE {
+ file_system::CreateDirectory(kAppStorageFolder);
+ reps = new SQLPTRepresentation;
+ policy_settings_ = std::auto_ptr<NiceMock<MockPolicySettings> >(
+ new NiceMock<MockPolicySettings>());
+ ON_CALL(*policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ EXPECT_EQ(::policy::SUCCESS, reps->Init(policy_settings_.get()));
+ dbms = new DBMS(kAppStorageFolder + "/" + kDatabaseName);
+ EXPECT_TRUE(dbms->Open());
+ }
+
+ void TearDown() OVERRIDE {
+ EXPECT_TRUE(reps->Clear());
+ EXPECT_TRUE(reps->Drop());
+ EXPECT_TRUE(reps->Close());
+ reps->RemoveDB();
+ delete reps;
+ dbms->Close();
+ file_system::remove_directory_content(kAppStorageFolder);
+ file_system::RemoveDirectory(kAppStorageFolder, true);
+ policy_settings_.reset();
+ }
+
+ virtual utils::dbms::SQLDatabase* db() const {
+ return reps->db();
+ }
+
+ void GatherModuleMeta(policy_table::ModuleMeta* meta) const {
+ ::SQLPTRepresentation::GatherModuleMeta(meta);
+ }
+
+ void GatherModuleConfig(policy_table::ModuleConfig* config) const {
+ ::SQLPTRepresentation::GatherModuleConfig(config);
+ }
+
+ bool GatherUsageAndErrorCounts(
+ policy_table::UsageAndErrorCounts* counts) const {
+ return ::SQLPTRepresentation::GatherUsageAndErrorCounts(counts);
+ }
+
+ bool GatherApplicationPoliciesSection(
+ policy_table::ApplicationPoliciesSection* policies) const {
+ return ::SQLPTRepresentation::GatherApplicationPoliciesSection(policies);
+ }
+ virtual void GatherDeviceData(policy_table::DeviceData* data) const {
+ ::SQLPTRepresentation::GatherDeviceData(data);
+ }
+
+ virtual bool GatherConsumerFriendlyMessages(
+ policy_table::ConsumerFriendlyMessages* messages) const {
+ return ::SQLPTRepresentation::GatherConsumerFriendlyMessages(messages);
+ }
+
+ bool GatherAppGroup(const std::string& app_id,
+ policy_table::Strings* app_groups) const {
+ return ::SQLPTRepresentation::GatherAppGroup(app_id, app_groups);
+ }
+
+ bool GatherAppType(const std::string& app_id,
+ policy_table::AppHMITypes* app_types) const {
+ return ::SQLPTRepresentation::GatherAppType(app_id, app_types);
+ }
+
+ bool GatherRequestType(const std::string& app_id,
+ policy_table::RequestTypes* request_types) const {
+ return ::SQLPTRepresentation::GatherRequestType(app_id, request_types);
+ }
+
+ bool GatherNickName(const std::string& app_id,
+ policy_table::Strings* nicknames) const {
+ return ::SQLPTRepresentation::GatherNickName(app_id, nicknames);
+ }
+
+ void CheckAppPoliciesSection(
+ policy_table::ApplicationPoliciesSection& policies,
+ uint16_t apps_size,
+ policy_table::Priority prio,
+ const std::string& section,
+ uint16_t memory_kb,
+ uint32_t heart_beat_timeout_ms,
+ policy_table::Strings& groups) const {
+ if (section != "device") {
+ policy_table::ApplicationPolicies& apps = policies.apps;
+ EXPECT_EQ(apps_size, apps.size());
+ policy_table::ApplicationPolicies::iterator apps_iter =
+ apps.find(section);
+ ASSERT_TRUE(apps.end() != apps_iter);
+ policy_table::Strings& temp_groups = apps_iter->second.groups;
+ StringsCompare(groups, temp_groups);
+ EXPECT_EQ(0u, (*(apps_iter->second.nicknames)).size());
+ EXPECT_EQ(prio, apps_iter->second.priority);
+ EXPECT_EQ(0u, (*(apps_iter->second.AppHMIType)).size());
+ EXPECT_EQ(memory_kb, (*(apps_iter->second.memory_kb)));
+ EXPECT_EQ(heart_beat_timeout_ms,
+ (*(apps_iter->second.heart_beat_timeout_ms)));
+ } else {
+ policy_table::DevicePolicy& device = policies.device;
+ EXPECT_EQ(prio, device.priority);
+ }
+ }
+
+ void StringsCompare(policy_table::Strings& groups1,
+ policy_table::Strings& groups2) const {
+ EXPECT_EQ(groups1.size(), groups2.size());
+ std::sort(groups1.begin(), groups1.end());
+ std::sort(groups2.begin(), groups2.end());
+ EXPECT_TRUE(groups1 == groups2);
+ }
+
+ void CheckAppGroups(const std::string& app_id,
+ policy_table::Strings& groups) {
+ policy_table::Strings app_groups;
+ GatherAppGroup(app_id, &app_groups);
+ StringsCompare(groups, app_groups);
+ }
+
+ void PolicyTableUpdatePrepare(Json::Value& table) {
+ // Root
+ table["policy_table"] = Json::Value(Json::objectValue);
+
+ // 1st level
+ 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);
+ policy_table["usage_and_error_counts"] = Json::Value(Json::objectValue);
+ policy_table["device_data"] = Json::Value(Json::objectValue);
+
+ // 'module_config' section start
+ Json::Value& module_config = policy_table["module_config"];
+ module_config["preloaded_pt"] = Json::Value(false);
+ module_config["preloaded_date"] = Json::Value("");
+ 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("");
+ module_config["vehicle_model"] = Json::Value("");
+ module_config["vehicle_year"] = Json::Value("");
+ module_config["certificate"] = Json::Value("encrypted_certificate_content");
+ // 'module_config' section end
+
+ // 'functional_groupings' section start
+ 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("some_msg_version");
+ consumer_friendly_messages["messages"] = Json::Value(Json::objectValue);
+ consumer_friendly_messages["messages"]["MSG_CODE"] =
+ Json::Value(Json::objectValue);
+ Json::Value& msg1 = consumer_friendly_messages["messages"]["MSG_CODE"];
+ msg1["languages"] = Json::Value(Json::objectValue);
+ msg1["languages"]["en-us"] = Json::Value(Json::objectValue);
+ // 'functional_groupings' section end
+
+ // 'app_policies' section start
+ 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);
+ // 'app_policies' section end
+
+ Json::Value& usage_and_error_counts =
+ policy_table["usage_and_error_counts"];
+ usage_and_error_counts["app_level"] = Json::Value(Json::objectValue);
+ usage_and_error_counts["app_level"]["some_app_id"] =
+ Json::Value(Json::objectValue);
+ usage_and_error_counts["app_level"]["some_app_id"]["count_of_tls_errors"] =
+ Json::Value(5);
+
+ Json::Value& device_data = policy_table["device_data"];
+ device_data["device_id_hash_1"] = Json::Value(Json::objectValue);
+ device_data["device_id_hash_2"] = Json::Value(Json::objectValue);
+ device_data["device_id_hash_3"] = Json::Value(Json::objectValue);
+ }
+
+ ::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);
+ }
+ }
+};
+
+const std::string SQLPTRepresentationTest::kDatabaseName = "policy.sqlite";
+const std::string SQLPTRepresentationTest::kAppStorageFolder =
+ "storage_SQLPTRepresentationTest";
+
+class SQLPTRepresentationTest2 : public ::testing::Test {
+ protected:
+ SQLPTRepresentationTest2()
+ : kAppStorageFolder("storage123")
+ , kOpenAttemptTimeoutMs(70u)
+ , kAttemptsToOpenPolicyDB(2u) {}
+
+ void SetUp() OVERRIDE {
+ file_system::CreateDirectory(kAppStorageFolder);
+ chmod(kAppStorageFolder.c_str(), 00000);
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ ON_CALL(policy_settings_, open_attempt_timeout_ms())
+ .WillByDefault(Return(kOpenAttemptTimeoutMs));
+ ON_CALL(policy_settings_, attempts_to_open_policy_db())
+ .WillByDefault(Return(kAttemptsToOpenPolicyDB));
+ reps = new SQLPTRepresentation;
+ }
+
+ void TearDown() OVERRIDE {
+ file_system::RemoveDirectory(kAppStorageFolder, true);
+ delete reps;
+ }
+
+ SQLPTRepresentation* reps;
+ NiceMock<MockPolicySettings> policy_settings_;
+ const std::string kAppStorageFolder;
+ const uint16_t kOpenAttemptTimeoutMs;
+ const uint16_t kAttemptsToOpenPolicyDB;
+};
+
+class SQLPTRepresentationTest3 : public ::testing::Test {
+ protected:
+ SQLPTRepresentationTest3() : kAppStorageFolder("storage") {}
+
+ void SetUp() OVERRIDE {
+ file_system::CreateDirectory(kAppStorageFolder);
+ reps = new SQLPTRepresentation;
+ }
+
+ void TearDown() OVERRIDE {
+ file_system::RemoveDirectory(kAppStorageFolder, true);
+ delete reps;
+ }
+
+ SQLPTRepresentation* reps;
+ NiceMock<MockPolicySettings> policy_settings_;
+ const std::string kAppStorageFolder;
+};
+
+// {AKozoriz} : Unknown behavior (must try 8 times, tried 2 and opened)
+TEST_F(SQLPTRepresentationTest2,
+ DISABLED_OpenAttemptTimeOut_ExpectCorrectNumber) {
+ EXPECT_EQ(::policy::FAIL, reps->Init(&policy_settings_));
+ // Check Actual attempts number made to try to open DB
+ EXPECT_EQ(kAttemptsToOpenPolicyDB, reps->open_counter());
+ // Check timeot value correctly read from config file.
+ EXPECT_EQ(700u, kOpenAttemptTimeoutMs);
+}
+
+TEST_F(SQLPTRepresentationTest,
+ RefreshDB_DropExistedPTThenRefreshDB_ExpectTablesWithInitialData) {
+ // Check
+ const char* query_select =
+ "SELECT COUNT(*) FROM sqlite_master WHERE `type` = 'table'";
+ // In normally created PT there are more than 0 tables
+ ASSERT_GT(dbms->FetchOneInt(query_select), 0);
+ ASSERT_TRUE(reps->Drop());
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select));
+ ASSERT_TRUE(reps->RefreshDB());
+ // Check PT structure destroyed and tables number is 0
+ const int32_t total_tables_number = 28;
+ ASSERT_EQ(total_tables_number, dbms->FetchOneInt(query_select));
+ const char* query_select_count_of_iap_buffer_full =
+ "SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`";
+ const char* query_select_count_sync_out_of_memory =
+ "SELECT `count_sync_out_of_memory` FROM `usage_and_error_count`";
+ const char* query_select_count_of_sync_reboots =
+ "SELECT `count_of_sync_reboots` FROM `usage_and_error_count`";
+ const char* query_select_pt_exchanged_at_odometer_x =
+ "SELECT `pt_exchanged_at_odometer_x` FROM `module_meta`";
+ const char* query_select_pt_exchanged_x_days_after_epoch =
+ "SELECT `pt_exchanged_x_days_after_epoch` FROM `module_meta`";
+ const char* query_select_flag_update_required =
+ "SELECT `flag_update_required` FROM `module_meta`";
+ const char* query_select_ignition_cycles_since_last_exchange =
+ "SELECT `ignition_cycles_since_last_exchange` FROM `module_meta`";
+ const char* query_select_preloaded_pt =
+ "SELECT `preloaded_pt` FROM `module_config`";
+ const char* query_select_is_first_run =
+ "SELECT `is_first_run` FROM `module_config`";
+ const char* query_select_exchange_after_x_ignition_cycles =
+ "SELECT `exchange_after_x_ignition_cycles` FROM `module_config`";
+ const char* query_select_exchange_after_x_kilometers =
+ "SELECT `exchange_after_x_kilometers` FROM `module_config`";
+ const char* query_select_exchange_after_x_days =
+ "SELECT `exchange_after_x_days` FROM `module_config`";
+ const char* query_select_timeout_after_x_seconds =
+ "SELECT `timeout_after_x_seconds` FROM `module_config`";
+ const char* query_select_priorities = "SELECT COUNT(`value`) FROM `priority`";
+ const char* query_select_hmi_levels =
+ "SELECT COUNT(`value`) FROM `hmi_level`";
+ const char* query_select_version = "SELECT `number` FROM `version`";
+
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_count_of_iap_buffer_full));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_count_sync_out_of_memory));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_count_of_sync_reboots));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_pt_exchanged_at_odometer_x));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_pt_exchanged_x_days_after_epoch));
+ ASSERT_EQ(
+ 0, dbms->FetchOneInt(query_select_ignition_cycles_since_last_exchange));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_flag_update_required));
+ ASSERT_EQ(1, dbms->FetchOneInt(query_select_preloaded_pt));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_is_first_run));
+ ASSERT_EQ(0,
+ dbms->FetchOneInt(query_select_exchange_after_x_ignition_cycles));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_exchange_after_x_kilometers));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_exchange_after_x_days));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_timeout_after_x_seconds));
+ ASSERT_EQ(6, dbms->FetchOneInt(query_select_priorities));
+ ASSERT_EQ(4, dbms->FetchOneInt(query_select_hmi_levels));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_version));
+}
+
+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);";
+
+ // 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());
+ // TODO (AKutsan) Policy update
+ // EXPECT_EQ("gps", ret.list_of_allowed_params[0]);
+ // EXPECT_EQ("speed", ret.list_of_allowed_params[1]);
+}
+
+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);";
+
+ // 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,
+ 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,
+ 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_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);";
+
+ // 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,
+ 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";
+
+ // 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";
+
+ // 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";
+
+ // 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_more_limit));
+ // Chceck
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_negative_limit));
+ // Check
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_negative_current));
+ // Check
+ EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
+}
+
+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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_zeros));
+ // Checks
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_negative_limit));
+ // Checks
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_negative_last));
+ // Checks
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_limit));
+ // Checks
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(120));
+ EXPECT_EQ(60, reps->KilometersBeforeExchange(50));
+ EXPECT_EQ(0, reps->KilometersBeforeExchange(5));
+}
+
+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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_zeros));
+ // Checks
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_negative_limit));
+ // Checks
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_negative_last));
+ // Checks
+ 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";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_limit));
+ // Checks
+ EXPECT_EQ(0, reps->DaysBeforeExchange(120));
+ EXPECT_EQ(60, reps->DaysBeforeExchange(50));
+ EXPECT_EQ(0, reps->DaysBeforeExchange(5));
+}
+
+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); ";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ ASSERT_TRUE(reps->SecondsBetweenRetries(&seconds));
+ // Checks
+ ASSERT_EQ(2u, seconds.size());
+ EXPECT_EQ(10, seconds[0]);
+ EXPECT_EQ(20, seconds[1]);
+}
+
+TEST_F(SQLPTRepresentationTest, TimeoutResponse_Set60Seconds_GetEqualTimeout) {
+ // Arrange
+ const char* query =
+ "UPDATE `module_config` SET `timeout_after_x_seconds` = 60";
+
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query));
+ // Check
+ EXPECT_EQ(60000, reps->TimeoutResponse());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsPTPreloaded_SetPTPreloadedThenCheck_ExpectCorrectValue) {
+ // Arrange
+ const char* query_insert = "UPDATE `module_config` SET `preloaded_pt` = 1";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ // Check
+ ASSERT_TRUE(reps->IsPTPreloaded());
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ SetCountersPassedForSuccessfulUpdate_SetCounters_ExpectValueChangedInPT) {
+ // Arrange
+ const char* query_select_odometer =
+ "SELECT `pt_exchanged_at_odometer_x` FROM`module_meta`";
+ const char* query_select_days_after_epoch =
+ "SELECT `pt_exchanged_x_days_after_epoch` FROM`module_meta`";
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_odometer));
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select_days_after_epoch));
+ // Act
+ ASSERT_TRUE(reps->SetCountersPassedForSuccessfulUpdate(100, 10000));
+ ASSERT_EQ(100, dbms->FetchOneInt(query_select_odometer));
+ ASSERT_EQ(10000, dbms->FetchOneInt(query_select_days_after_epoch));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ IncrementIgnitionCycles_SetIgnitionCyclesValueThenIncrement_ExpectValueIncrementedInPT) {
+ // Arrange
+ const char* query_insert =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 54";
+ const char* query_select =
+ "SELECT `ignition_cycles_since_last_exchange`FROM `module_meta`";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ // Act
+ reps->IncrementIgnitionCycles();
+ // Check
+ ASSERT_EQ(55, dbms->FetchOneInt(query_select));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ ResetIgnitionCycles_SetIgnitionCyclesValueThenReset_ExpectZeroValueInPT) {
+ // Arrange
+ const char* query_insert =
+ "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 55";
+ const char* query_select =
+ "SELECT `ignition_cycles_since_last_exchange` FROM `module_meta`";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ // Act
+ reps->ResetIgnitionCycles();
+ // Check
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ GetUserFriendlyMsg_SetMsg_ExpectReceivedMsgSetInParams) {
+ // Arrange
+
+ const char* query_insert =
+ "INSERT INTO `message` (`language_code`, `message_type_name`) VALUES "
+ "('en-en', 'AppPermissions')";
+
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ query_insert =
+ "INSERT INTO `message_type` (`name`) VALUES ('AppPermissions')";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ std::vector<std::string> msg_code;
+ msg_code.push_back("AppPermissions");
+ // Act
+ std::vector<UserFriendlyMessage> result =
+ reps->GetUserFriendlyMsg(msg_code, std::string("en-en"));
+ // Checks
+ ASSERT_EQ(1u, result.size());
+ EXPECT_EQ(result[0].message_code, "AppPermissions");
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ GetNotificationNumber_SetNotificationsPriorities_ExpectReceivedValuesCorrect) {
+ // Arrange
+ const char* query_insert =
+ "INSERT INTO `notifications_by_priority` (`priority_value`, `value`) "
+ "VALUES ('NAVIGATION', 15) , "
+ "('COMMUNICATION', 6), ('EMERGENCY', 60), ('NONE', 0), ('NORMAL', 4), "
+ "('VOICECOMMUNICATION', 20)";
+
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ EXPECT_EQ(6, reps->GetNotificationsNumber("COMMUNICATION"));
+ EXPECT_EQ(60, reps->GetNotificationsNumber("EMERGENCY"));
+ EXPECT_EQ(15, reps->GetNotificationsNumber("NAVIGATION"));
+ EXPECT_EQ(0, reps->GetNotificationsNumber("NONE"));
+ EXPECT_EQ(4, reps->GetNotificationsNumber("NORMAL"));
+ EXPECT_EQ(20, reps->GetNotificationsNumber("VOICECOMMUNICATION"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ GetPriority_SetAppsPrioritiesThenGet_ExpectReceivedValuesCorrect) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', "
+ "'NONE', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
+ "'COMMUNICATION', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ std::string priority;
+ // Checks
+ EXPECT_TRUE(reps->GetPriority("default", &priority));
+ EXPECT_EQ("NONE", priority);
+ EXPECT_TRUE(reps->GetPriority("pre_DataConsent", &priority));
+ EXPECT_EQ("NONE", priority);
+ EXPECT_TRUE(reps->GetPriority("device", &priority));
+ EXPECT_EQ("COMMUNICATION", priority);
+ EXPECT_TRUE(reps->GetPriority("12345", &priority));
+ EXPECT_EQ("EMERGENCY", priority);
+}
+
+TEST_F(SQLPTRepresentationTest3, Init_InitNewDataBase_ExpectResultSuccess) {
+ // Arrange
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ // Checks
+ EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_));
+ EXPECT_EQ(::policy::EXISTS, reps->Init(&policy_settings_));
+ reps->RemoveDB();
+}
+
+TEST_F(SQLPTRepresentationTest3,
+ Init_TryInitNotExistingDataBase_ExpectResultFail) {
+ const std::string not_existing_path = "/not/existing/path";
+ // Arrange
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(not_existing_path));
+ // Check
+ EXPECT_EQ(::policy::FAIL, reps->Init(&policy_settings_));
+}
+
+TEST_F(SQLPTRepresentationTest3,
+ Close_InitNewDataBaseThenClose_ExpectResultSuccess) {
+ // Arrange
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_));
+ EXPECT_TRUE(reps->Close());
+ utils::dbms::SQLError error(utils::dbms::Error::OK);
+ // Checks
+ EXPECT_EQ(error.number(), (reps->db()->LastError().number()));
+ reps->RemoveDB();
+}
+
+TEST_F(SQLPTRepresentationTest,
+ Clear_InitNewDataBaseThenClear_ExpectResultSuccess) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', "
+ "'NONE', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
+ "'COMMUNICATION', 0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ const char* query_insert =
+ "INSERT INTO `notifications_by_priority` (`priority_value`, `value`) "
+ "VALUES ('NAVIGATION', 15) , "
+ "('COMMUNICATION', 6), ('EMERGENCY', 60), ('NONE', 0), ('NORMAL', 4), "
+ "('VOICECOMMUNICATION', 20)";
+
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ EXPECT_TRUE(reps->Clear());
+ utils::dbms::SQLError error(utils::dbms::Error::OK);
+ EXPECT_EQ(error.number(), (reps->db()->LastError().number()));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ GetInitialAppData_SetData_ExpectCorrectValuesReceived) {
+ // Arrange
+ const char* query_insert =
+ "INSERT INTO `nickname` (`application_id`, `name`) "
+ "VALUES ('1111', 'first_app') , "
+ "('2222', 'second_app'), ('3333', 'third_app')";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+
+ query_insert =
+ "INSERT INTO `app_type` (`application_id`, `name`)"
+ "VALUES ('1111', 'NAVIGATION') , "
+ "('1111', 'MEDIA'), ('3333', 'COMMUNICATION')";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ ::policy::StringArray nicknames;
+ ::policy::StringArray app_types;
+ ASSERT_TRUE(reps->GetInitialAppData("1111", &nicknames, &app_types));
+ EXPECT_EQ(1u, nicknames.size());
+ EXPECT_TRUE(nicknames.end() !=
+ std::find(nicknames.begin(), nicknames.end(), "first_app"));
+ EXPECT_EQ(2u, app_types.size());
+ EXPECT_TRUE(app_types.end() !=
+ std::find(app_types.begin(), app_types.end(), "NAVIGATION"));
+ EXPECT_TRUE(app_types.end() !=
+ std::find(app_types.begin(), app_types.end(), "MEDIA"));
+ nicknames.clear();
+ app_types.clear();
+ ASSERT_TRUE(reps->GetInitialAppData("2222", &nicknames, &app_types));
+ EXPECT_EQ(1u, nicknames.size());
+ EXPECT_TRUE(nicknames.end() !=
+ std::find(nicknames.begin(), nicknames.end(), "second_app"));
+ EXPECT_EQ(0u, app_types.size());
+ nicknames.clear();
+ app_types.clear();
+ ASSERT_TRUE(reps->GetInitialAppData("3333", &nicknames, &app_types));
+ EXPECT_EQ(1u, nicknames.size());
+ EXPECT_TRUE(nicknames.end() !=
+ std::find(nicknames.begin(), nicknames.end(), "third_app"));
+ EXPECT_EQ(1u, app_types.size());
+ EXPECT_TRUE(app_types.end() !=
+ std::find(app_types.begin(), app_types.end(), "COMMUNICATION"));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ GetFunctionalGroupings_SetFunctionalGroupings_ExpectCorrectValuesReceived) {
+ // Arrange
+ const char* query_insert =
+ "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
+ "VALUES (73072936, null, 'SendLocation'), (1533011474, null, "
+ "'OnKeyboardInputOnlyGroup')";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+
+ query_insert =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
+ "VALUES ('SendLocation', 'BACKGROUND', 73072936), ('SendLocation', "
+ "'FULL', 73072936), ('SendLocation', 'LIMITED', 73072936)";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+
+ query_insert =
+ "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
+ "VALUES ('OnKeyboardInput', 'FULL', 1533011474)";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+
+ policy_table::FunctionalGroupings func_groups;
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ EXPECT_EQ(2u, func_groups.size());
+ policy_table::FunctionalGroupings::iterator func_groups_it =
+ func_groups.find("SendLocation");
+ EXPECT_TRUE(func_groups.end() != func_groups_it);
+ policy_table::Rpcs& rpcs = func_groups_it->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ EXPECT_EQ(1u, rpc.size());
+ policy_table::Rpc::const_iterator rpc_it = rpc.find("SendLocation");
+ EXPECT_TRUE(rpc.end() != rpc_it);
+ const policy_table::HmiLevels& hmi_levels1 = rpc_it->second.hmi_levels;
+ EXPECT_EQ(3u, hmi_levels1.size());
+ EXPECT_TRUE(hmi_levels1.end() !=
+ std::find(hmi_levels1.begin(),
+ hmi_levels1.end(),
+ policy_table::HmiLevel::HL_BACKGROUND));
+ EXPECT_TRUE(hmi_levels1.end() !=
+ std::find(hmi_levels1.begin(),
+ hmi_levels1.end(),
+ policy_table::HmiLevel::HL_LIMITED));
+ EXPECT_TRUE(hmi_levels1.end() != std::find(hmi_levels1.begin(),
+ hmi_levels1.end(),
+ policy_table::HmiLevel::HL_FULL));
+
+ func_groups_it = func_groups.find("OnKeyboardInputOnlyGroup");
+ EXPECT_TRUE(func_groups.end() != func_groups_it);
+ policy_table::Rpcs& rpcs2 = func_groups_it->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs2.user_consent_prompt));
+ policy_table::Rpc& rpc2 = rpcs2.rpcs;
+ EXPECT_EQ(1u, rpc2.size());
+ rpc_it = rpc2.find("OnKeyboardInput");
+ EXPECT_TRUE(rpc2.end() != rpc_it);
+ const policy_table::HmiLevels& hmi_levels2 = rpc_it->second.hmi_levels;
+ EXPECT_EQ(1u, hmi_levels2.size());
+ EXPECT_TRUE(hmi_levels2.end() != std::find(hmi_levels2.begin(),
+ hmi_levels2.end(),
+ policy_table::HmiLevel::HL_FULL));
+}
+
+TEST_F(
+ SQLPTRepresentationTest,
+ UpdateRequired_SetUpdateNotRequiredFlagThenCheck_ExpectUpdateNotRequired) {
+ // Arrange
+ EXPECT_FALSE(reps->UpdateRequired());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ UpdateRequired_SetUpdateRequiredFlagThenCheck_ExpectUpdateRequired) {
+ // Arrange
+ const char* query_insert =
+ "UPDATE `module_meta` SET `flag_update_required` = 1";
+ // Assert
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ // Check
+ EXPECT_TRUE(reps->UpdateRequired());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SaveUpdateRequired_SaveUpdateRequired_ExpectCorrectValues) {
+ // Arrange
+ reps->SaveUpdateRequired(true);
+ // Check
+ EXPECT_TRUE(reps->UpdateRequired());
+ // Act
+ reps->SaveUpdateRequired(false);
+ // Check
+ EXPECT_FALSE(reps->UpdateRequired());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsApplicationRepresented_Check_ExpectCorrectResult) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
+ "'COMMUNICATION', 0, 0, 0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+ // Checks
+ EXPECT_TRUE(reps->IsApplicationRepresented("default"));
+ EXPECT_TRUE(reps->IsApplicationRepresented("device"));
+ EXPECT_TRUE(reps->IsApplicationRepresented("12345"));
+ EXPECT_FALSE(reps->IsApplicationRepresented("1234"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsApplicationRevoked_CheckApps_ExpectCorrectResult) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '7777', 0, 0, 'NONE', 'NONE', 1, "
+ "0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
+ "0, 0, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+ // Checks
+ EXPECT_TRUE(reps->IsApplicationRevoked("7777"));
+ EXPECT_FALSE(reps->IsApplicationRevoked("12345"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ CopyApplication_CopyApplication_ExpectAppCopiedSuccesfully) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
+ "1, "
+ "0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+
+ query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '123', 1, 0, 'FULL', "
+ "'COMMUNICATION', 1, 1, 0, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+ EXPECT_FALSE(reps->IsApplicationRepresented("7777"));
+ EXPECT_FALSE(reps->IsApplicationRepresented("9999"));
+ // Act
+ EXPECT_TRUE(reps->CopyApplication("default", "7777"));
+ EXPECT_TRUE(reps->CopyApplication("123", "9999"));
+ // Checks
+ EXPECT_TRUE(reps->IsApplicationRepresented("7777"));
+ EXPECT_TRUE(reps->IsApplicationRepresented("9999"));
+ EXPECT_FALSE(reps->IsApplicationRevoked("7777"));
+ EXPECT_TRUE(reps->IsApplicationRevoked("9999"));
+ EXPECT_TRUE(reps->IsDefaultPolicy("7777"));
+ std::string priority1;
+ std::string priority2;
+ EXPECT_TRUE(reps->GetPriority("default", &priority1));
+ EXPECT_TRUE(reps->GetPriority("7777", &priority2));
+ EXPECT_EQ(priority1, priority2);
+ EXPECT_TRUE(reps->GetPriority("123", &priority1));
+ EXPECT_TRUE(reps->GetPriority("9999", &priority2));
+ EXPECT_EQ(priority1, priority2);
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsDefaultPolicy_SetAppPreDataThenCheck_ExpectNotDefaultPolicySet) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, "
+ "0, "
+ "1, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+ // Check
+ EXPECT_FALSE(reps->IsDefaultPolicy("12345"));
+}
+
+TEST_F(SQLPTRepresentationTest,
+ IsDefaultPolicy_SetAppDefaultThenCheck_ExpectNotDefaultPolicySet) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
+ "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
+ "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 1, 0, 64, 10) ";
+
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+ // Check
+ EXPECT_TRUE(reps->IsDefaultPolicy("1234567"));
+}
+
+TEST_F(SQLPTRepresentationTest, Drop_DropExistedPT_ExpectZeroTables) {
+ // Check
+ const char* query_select =
+ "SELECT COUNT(*) FROM `sqlite_master` WHERE `type` = 'table'";
+ // In normally created PT there are more than 0 tables
+ ASSERT_TRUE(dbms->Exec(query_select));
+ ASSERT_GT(dbms->FetchOneInt(query_select), 0);
+ // Destroy schema
+ ASSERT_TRUE(reps->Drop());
+ // Check PT structure destroyed and tables number is 0
+ ASSERT_EQ(0, dbms->FetchOneInt(query_select));
+ // Restore schema
+ ASSERT_TRUE(reps->RefreshDB());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SetDefaultPolicy_SetDefaultPolicyThenCheck_ExpectDefaultPolicySet) {
+ // Arrange
+ const std::string kDefaultId = "default";
+ const std::string kAppId = "app_1234567";
+ const std::string kRequestType = "HTTP";
+ const std::string kHmiType = "MEDIA";
+
+ const std::string query_insert_default_app =
+ "INSERT INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, "
+ " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
+ "`is_predata`, `memory_kb`, "
+ " `heart_beat_timeout_ms`) "
+ "VALUES( '" +
+ kDefaultId + "', 0, 0, 'NONE', 'NONE', 0, 0, 0, 64, 10) ";
+
+ ASSERT_TRUE(dbms->Exec(query_insert_default_app.c_str()));
+
+ const std::string query_insert_default_app_request_types =
+ "INSERT INTO `request_type` (`application_id`, `request_type`) "
+ "VALUES ('" +
+ kDefaultId + "', '" + kRequestType + "')";
+
+ ASSERT_TRUE(dbms->Exec(query_insert_default_app_request_types.c_str()));
+
+ const std::string query_insert_default_app_hmi_types =
+ "INSERT INTO `app_type` (`application_id`, `name`) "
+ "VALUES ('" +
+ kDefaultId + "', '" + kHmiType + "')";
+
+ ASSERT_TRUE(dbms->Exec(query_insert_default_app_hmi_types.c_str()));
+
+ const std::string query_insert_new_app =
+ "INSERT INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
+ "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
+ "VALUES('" +
+ kAppId + "', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10)";
+
+ ASSERT_TRUE(dbms->Exec(query_insert_new_app.c_str()));
+
+ EXPECT_FALSE(reps->IsDefaultPolicy(kAppId));
+ // Act
+ ASSERT_TRUE(reps->SetDefaultPolicy(kAppId));
+ // Check
+ EXPECT_TRUE(reps->IsDefaultPolicy(kAppId));
+
+ policy_table::RequestTypes request_types;
+ GatherRequestType(kAppId, &request_types);
+ ASSERT_TRUE(1 == request_types.size());
+ EXPECT_EQ(policy_table::RT_HTTP, *request_types.begin());
+
+ policy_table::AppHMITypes hmi_types;
+ GatherAppType(kAppId, &hmi_types);
+ ASSERT_TRUE(1 == hmi_types.size());
+ EXPECT_EQ(policy_table::AHT_MEDIA, *hmi_types.begin());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SetPreloaded_SetPreloaded_ExpectPTSetToPreloaded) {
+ // Arrange
+ const char* query_insert = "UPDATE `module_config` SET `preloaded_pt` = 0";
+ ASSERT_TRUE(dbms->Exec(query_insert));
+ // Check
+ ASSERT_FALSE(reps->IsPTPreloaded());
+ // Act
+ reps->SetPreloaded(true);
+ // Check
+ ASSERT_TRUE(reps->IsPTPreloaded());
+ // Act
+ reps->SetPreloaded(false);
+ // Check
+ ASSERT_FALSE(reps->IsPTPreloaded());
+}
+
+TEST_F(SQLPTRepresentationTest,
+ SetIsDefault_SetIsDefault_ExpectDefaultFlagSet) {
+ // Arrange
+ const char* query_insert_app =
+ "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
+ "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
+ "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
+ "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10) ";
+ ASSERT_TRUE(dbms->Exec(query_insert_app));
+ const char* query_select =
+ "SELECT `is_default` FROM `application`WHERE`id`= '1234567' ";
+ EXPECT_EQ(0, dbms->FetchOneInt(query_select));
+ // Act
+ EXPECT_TRUE(reps->SetIsDefault("1234567", true));
+ // Check
+ EXPECT_EQ(1, dbms->FetchOneInt(query_select));
+ // Act
+ EXPECT_TRUE(reps->SetIsDefault("1234567", false));
+ // Check
+ EXPECT_EQ(0, dbms->FetchOneInt(query_select));
+}
+
+TEST_F(SQLPTRepresentationTest3, RemoveDB_RemoveDB_ExpectFileDeleted) {
+ // Arrange
+ ON_CALL(policy_settings_, app_storage_folder())
+ .WillByDefault(ReturnRef(kAppStorageFolder));
+ EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_));
+ EXPECT_EQ(::policy::EXISTS, reps->Init(&policy_settings_));
+ std::string path = (reps->db())->get_path();
+ // Act
+ reps->RemoveDB();
+ // Check
+ EXPECT_FALSE(file_system::FileExists(path));
+}
+
+// TODO {AKozoriz} : Snapshot must have module meta section, but test
+// generates snapshot without it.
+TEST_F(SQLPTRepresentationTest,
+ DISABLED_GenerateSnapshot_SetPolicyTable_SnapshotIsPresent) {
+ // Arrange
+ Json::Value table(Json::objectValue);
+ 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);
+ // 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());
+}
+
+TEST_F(SQLPTRepresentationTest, Save_SetPolicyTableThenSave_ExpectSavedToPT) {
+ // Arrange
+ Json::Value table(Json::objectValue);
+ PolicyTableUpdatePrepare(table);
+
+ policy_table::Table update(&table);
+ update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
+ // Checks PT before Save
+ policy_table::FunctionalGroupings func_groups;
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Check functional groupings section
+ EXPECT_EQ(0u, func_groups.size());
+
+ policy_table::ApplicationPoliciesSection policies;
+ GatherApplicationPoliciesSection(&policies);
+ // Check ApplicationPoliciesSection
+ EXPECT_EQ(0u, policies.apps.size());
+ EXPECT_EQ(policy_table::Priority::P_EMERGENCY, policies.device.priority);
+
+ policy_table::ModuleConfig config;
+ GatherModuleConfig(&config);
+ // Check Module config section
+ EXPECT_TRUE(*config.preloaded_pt);
+ EXPECT_EQ(0, config.exchange_after_x_ignition_cycles);
+ EXPECT_EQ(0, config.exchange_after_x_kilometers);
+ EXPECT_EQ(0, config.exchange_after_x_days);
+ EXPECT_EQ(0, config.timeout_after_x_seconds);
+ EXPECT_EQ("", static_cast<std::string>(*config.vehicle_make));
+ EXPECT_EQ("", static_cast<std::string>(*config.vehicle_model));
+ EXPECT_EQ("", static_cast<std::string>(*config.vehicle_year));
+ EXPECT_EQ("", static_cast<std::string>(*config.preloaded_date));
+ EXPECT_EQ("", static_cast<std::string>(*config.certificate));
+ EXPECT_EQ(0u, config.seconds_between_retries.size());
+ EXPECT_EQ(0u, config.endpoints.size());
+ EXPECT_EQ(0u, config.notifications_per_minute_by_priority.size());
+
+ policy_table::ConsumerFriendlyMessages messages;
+ GatherConsumerFriendlyMessages(&messages);
+ EXPECT_EQ("0", static_cast<std::string>(messages.version));
+
+ policy_table::DeviceData devices;
+ GatherDeviceData(&devices);
+ EXPECT_EQ(0u, devices.size());
+
+ policy_table::UsageAndErrorCounts counts;
+ GatherUsageAndErrorCounts(&counts);
+ EXPECT_TRUE(0u == counts.app_level->size());
+
+ // ASSERT_TRUE(IsValid(update));
+ // Act
+ ASSERT_TRUE(reps->Save(update));
+
+ // Check Functional Groupings
+ ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
+ // Checks
+ EXPECT_EQ(1u, func_groups.size());
+ policy_table::FunctionalGroupings::iterator func_groups_iter =
+ func_groups.find("default");
+ ASSERT_TRUE(func_groups.end() != func_groups_iter);
+ policy_table::Rpcs& rpcs = func_groups_iter->second;
+ EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
+ policy_table::Rpc& rpc = rpcs.rpcs;
+ EXPECT_EQ(1u, rpc.size());
+ policy_table::Rpc::const_iterator rpc_iter = rpc.find("Update");
+ EXPECT_TRUE(rpc.end() != rpc_iter);
+ const policy_table::HmiLevels& hmi_levels = rpc_iter->second.hmi_levels;
+ EXPECT_EQ(1u, hmi_levels.size());
+ EXPECT_TRUE(hmi_levels.end() != std::find(hmi_levels.begin(),
+ hmi_levels.end(),
+ policy_table::HmiLevel::HL_FULL));
+
+ const ::policy_table::Parameters& parameters = *(rpc_iter->second.parameters);
+ EXPECT_EQ(1u, parameters.size());
+ EXPECT_TRUE(parameters.end() != std::find(parameters.begin(),
+ parameters.end(),
+ policy_table::Parameter::P_SPEED));
+ // Check Application Policies Section
+ GatherApplicationPoliciesSection(&policies);
+ const uint32_t apps_size = 3u;
+
+ rpc::String<1ul, 255ul> str("default");
+ policy_table::Strings groups;
+ groups.push_back(str);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "1234",
+ 150u,
+ 200u,
+ groups);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "default",
+ 50u,
+ 100u,
+ groups);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "pre_DataConsent",
+ 40u,
+ 90u,
+ groups);
+ CheckAppPoliciesSection(policies,
+ apps_size,
+ policy_table::Priority::P_EMERGENCY,
+ "device",
+ 0u,
+ 0u,
+ groups);
+
+ CheckAppGroups("1234", groups);
+ CheckAppGroups("default", groups);
+ CheckAppGroups("pre_DataConsent", groups);
+
+ GatherModuleConfig(&config);
+ // Check Module Config section
+ ASSERT_FALSE(*config.preloaded_pt);
+ ASSERT_EQ("encrypted_certificate_content",
+ static_cast<std::string>(*config.certificate));
+ ASSERT_EQ("", static_cast<std::string>(*config.preloaded_date));
+ ASSERT_EQ("", static_cast<std::string>(*config.vehicle_year));
+ ASSERT_EQ("", static_cast<std::string>(*config.vehicle_model));
+ ASSERT_EQ("", static_cast<std::string>(*config.vehicle_make));
+ ASSERT_EQ(10, config.exchange_after_x_ignition_cycles);
+ ASSERT_EQ(100, config.exchange_after_x_kilometers);
+ ASSERT_EQ(5, config.exchange_after_x_days);
+ ASSERT_EQ(500, config.timeout_after_x_seconds);
+ ASSERT_EQ(3u, config.seconds_between_retries.size());
+ ASSERT_EQ(10, config.seconds_between_retries[0]);
+ ASSERT_EQ(20, config.seconds_between_retries[1]);
+ ASSERT_EQ(30, config.seconds_between_retries[2]);
+ ASSERT_EQ(6u, config.notifications_per_minute_by_priority.size());
+ ASSERT_EQ(1, config.notifications_per_minute_by_priority["emergency"]);
+ ASSERT_EQ(2, config.notifications_per_minute_by_priority["navigation"]);
+ ASSERT_EQ(3, config.notifications_per_minute_by_priority["VOICECOMM"]);
+ ASSERT_EQ(4, config.notifications_per_minute_by_priority["communication"]);
+ ASSERT_EQ(5, config.notifications_per_minute_by_priority["normal"]);
+ ASSERT_EQ(6, config.notifications_per_minute_by_priority["none"]);
+ EXPECT_EQ(1u, config.endpoints.size());
+ policy_table::ServiceEndpoints& service_endpoints = config.endpoints;
+ EXPECT_EQ("0x00", service_endpoints.begin()->first);
+ policy_table::URLList& url_list = service_endpoints.begin()->second;
+ EXPECT_EQ("default", url_list.begin()->first);
+ policy_table::URL& url = url_list.begin()->second;
+ EXPECT_EQ("http://ford.com/cloud/default", static_cast<std::string>(url[0]));
+
+ GatherConsumerFriendlyMessages(&messages);
+ EXPECT_EQ("some_msg_version", static_cast<std::string>(messages.version));
+ EXPECT_TRUE(0u != messages.messages->size());
+ EXPECT_TRUE(0u != (*messages.messages)["MSG_CODE"].languages.size());
+
+ GatherUsageAndErrorCounts(&counts);
+ EXPECT_FALSE(0u == counts.app_level->size());
+ EXPECT_EQ(5u, (*counts.app_level)["some_app_id"].count_of_tls_errors);
+
+ GatherDeviceData(&devices);
+ EXPECT_EQ(3u, devices.size());
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc
new file mode 100644
index 0000000000..9d0326d0be
--- /dev/null
+++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc
@@ -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.
+ */
+
+#include "gtest/gtest.h"
+#include "policy/mock_policy_listener.h"
+#include "policy/policy_manager_impl.h"
+#include "policy/update_status_manager.h"
+#include "utils/make_shared.h"
+
+namespace test {
+namespace components {
+namespace policy_test {
+
+using namespace ::policy;
+using ::testing::_;
+using ::testing::Return;
+
+class UpdateStatusManagerTest : public ::testing::Test {
+ protected:
+ utils::SharedPtr<UpdateStatusManager> manager_;
+ utils::SharedPtr<MockPolicyListener> listener_;
+
+ public:
+ UpdateStatusManagerTest()
+ : manager_(utils::MakeShared<UpdateStatusManager>())
+ , listener_(utils::MakeShared<MockPolicyListener>()) {}
+
+ void SetUp() OVERRIDE {
+ manager_->set_listener(listener_.get());
+ ON_CALL(*listener_, OnUpdateStatusChanged(_)).WillByDefault(Return());
+ }
+
+ void TearDown() OVERRIDE {}
+};
+
+TEST_F(UpdateStatusManagerTest,
+ StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) {
+ // Arrange
+ manager_->OnPolicyInit(false);
+ // Check
+ EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus());
+ manager_->OnPolicyInit(true);
+ // Check
+ EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus());
+ manager_->OnUpdateSentOut();
+ // Check
+ EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus());
+}
+
+TEST_F(UpdateStatusManagerTest,
+ OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) {
+ // Arrange
+ manager_->OnAppsSearchStarted();
+ // Check
+ EXPECT_TRUE(manager_->IsAppsSearchInProgress());
+ // Arrange
+ manager_->OnAppsSearchCompleted();
+ // Check
+ EXPECT_FALSE(manager_->IsAppsSearchInProgress());
+}
+
+} // namespace policy_test
+} // namespace components
+} // namespace test
diff --git a/src/components/policy/policy_regular/test/valid_sdl_pt_update.json b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
new file mode 100644
index 0000000000..56c728f104
--- /dev/null
+++ b/src/components/policy/policy_regular/test/valid_sdl_pt_update.json
@@ -0,0 +1,1720 @@
+{
+ "policy_table" : {
+ "app_policies" : {
+ "1766825573" : {
+ "AppHMIType" : [ "MEDIA" ],
+ "certificate" : "akdjfhaliuygrglurng",
+ "default_hmi" : "BACKGROUND",
+ "groups" : [
+ "Notifications",
+ "Location-1",
+ "PropriataryData-1",
+ "Navigation-1",
+ "Base-4",
+ "VehicleInfo-3",
+ "DrivingCharacteristics-3",
+ "Emergency-1"
+ ],
+ "keep_context" : true,
+ "memory_kb" : 1000,
+ "nicknames" : [ "SyncProxyTester" ],
+ "priority" : "EMERGENCY",
+ "steal_focus" : true,
+ "heart_beat_timeout_ms": 5000
+ },
+ "default" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "device" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "Base-4" ],
+ "memory_kb" : 1000,
+ "watchdog_timer_ms" : 20000,
+ "keep_context" : false,
+ "priority" : "NONE",
+ "steal_focus" : false
+ },
+ "pre_DataConsent" : {
+ "default_hmi" : "NONE",
+ "groups" : [ "pre_Base-1" ],
+ "keep_context" : false,
+ "memory_kb" : 1000,
+ "priority" : "NONE",
+ "steal_focus" : false
+ }
+ },
+ "consumer_friendly_messages" : {
+ "messages" : {
+ "AppPermissions" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Zugriffsanfrage(n)",
+ "line2" : "erlauben?",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Grant requested",
+ "line2" : "permission(s)?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Grant Requested",
+ "line2" : "Permission(s)?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Conceder permisos",
+ "line2" : "solicitados?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Otorgar permiso(s)",
+ "line2" : "solicitado(s)?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Accorder permission(s)",
+ "line2" : "demandée(s)",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Concedi autorizzaz.",
+ "line2" : "richiesta(e)?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Aangevraagde",
+ "line2" : "permissie(s) verlenen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Udzielić żądanych",
+ "line2" : "pozwoleń?",
+ "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."
+ },
+ "pt-br" : {
+ "line1" : "Conceder permissão",
+ "line2" : "solicitada?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Conceder permiss.",
+ "line2" : "solicitada(s)?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Предост. заправш.",
+ "line2" : "разрешения?",
+ "tts" : "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны."
+ },
+ "sv-se" : {
+ "line1" : "Vill du ge",
+ "line2" : "tillstånd?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "İstenen izinler",
+ "line2" : "verilsin mi?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否允许请求的",
+ "line2" : "权限?",
+ "tts" : "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。"
+ },
+ "zh-tw" : {
+ "line1" : "允許",
+ "line2" : "授權請求?",
+ "tts" : "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。"
+ }
+ }
+ },
+ "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" : {
+ "line1" : "nicht autorisiert",
+ "tts" : "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren."
+ },
+ "en-au" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Authorized",
+ "tts" : "This version of %appName% is not authorized and will not work with SYNC."
+ },
+ "es-en" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No autorizada",
+ "tts" : "Esta versión de %appName% no está autorizada y no funcionará con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no autorizada",
+ "tts" : "Esta versión de %appName% no tiene autorización y no funcionará con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "non autorisée",
+ "tts" : "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC."
+ },
+ "it-it" : {
+ "line1" : "non autorizzata",
+ "tts" : "Questa versione di %appName% non è autorizzata e non funziona con il SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet geautoriseerd",
+ "tts" : "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "brak autoryzacji",
+ "tts" : "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não autorizado",
+ "tts" : "Esta versão do %appName% não tem autorização e não funcionará com o SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não autorizada",
+ "tts" : "Esta versão de %appName% não está autorizada e não funcionará com o SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не авторизировано",
+ "tts" : "Эта версия %appName% не авторизирована и не будет работать с SYNC."
+ },
+ "sv-se" : {
+ "line1" : "är ej godkänd",
+ "tts" : "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC."
+ },
+ "tr-tr" : {
+ "line1" : "için izin yok",
+ "tts" : "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz."
+ },
+ "zh-cn" : {
+ "line1" : "未得到授权",
+ "tts" : "此版本的%appName% 未得到授权,无法在SYNC上使用。"
+ },
+ "zh-tw" : {
+ "line1" : "無授權",
+ "tts" : "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。"
+ }
+ }
+ },
+ "AppUnsupported" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "nicht unterstützt",
+ "tts" : "Diese Version von %appName% wird von SYNC nicht unterstützt."
+ },
+ "en-au" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-gb" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-ie" : {
+ "line1" : "not supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "en-us" : {
+ "line1" : "Not Supported",
+ "tts" : "This version of %appName% is not supported by SYNC."
+ },
+ "es-en" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-es" : {
+ "line1" : "No compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "es-mx" : {
+ "line1" : "no compatible",
+ "tts" : "Esta versión de %appName% no es compatible con SYNC."
+ },
+ "fr-ca" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "fr-fr" : {
+ "line1" : "incompatible",
+ "tts" : "Cette version de %appName% n’est pas prise en charge par SYNC."
+ },
+ "it-it" : {
+ "line1" : "non supportata",
+ "tts" : "Questa versione di %appName% non è supportata dal SYNC."
+ },
+ "nl-nl" : {
+ "line1" : "niet ondersteund",
+ "tts" : "Deze versie van %appName% wordt niet ondersteund door SYNC."
+ },
+ "pl-pl" : {
+ "line1" : "aplikacja nie obsług.",
+ "tts" : "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC."
+ },
+ "pt-br" : {
+ "line1" : "não suportado",
+ "tts" : "Esta versão do %appName% não é suportada pelo SYNC."
+ },
+ "pt-pt" : {
+ "line1" : "não suportada",
+ "tts" : "Esta versão de %appName% não é suportado pelo SYNC."
+ },
+ "ru-ru" : {
+ "line1" : "не поддерживается",
+ "tts" : "Эта версия %appName% не поддерживается SYNC."
+ },
+ "sv-se" : {
+ "line1" : "stöds ej",
+ "tts" : "SYNC har inte stöd för den här versionen av %appName%."
+ },
+ "tr-tr" : {
+ "line1" : "desteklenmiyor",
+ "tts" : "Bu %appName% sürümü SYNC tarafından desteklenmiyor."
+ },
+ "zh-cn" : {
+ "line1" : "不受支持",
+ "tts" : "SYNC不支持此版本的%appName%。"
+ },
+ "zh-tw" : {
+ "line1" : "不支援",
+ "tts" : "SYNC 不支援此版本的%appName% 。"
+ }
+ }
+ },
+ "DataConsent" : {
+ "languages" : {
+ "en-us" : {
+ "line1" : "Enable Mobile Apps",
+ "line2" : "on SYNC? (Uses Data)",
+ "tts" : "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. Please press yes or no, or help for more information. "
+ }
+ }
+ },
+ "DataConsentHelp" : {
+ "languages" : {
+ "en-us" : {
+ "tts" : "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 mobile apps settings menu. See your Owner Guide for more information. "
+ }
+ }
+ },
+ "DisableApps" : {
+ "languages" : {
+ "de-de" : {
+ "line1" : "Auto-Update",
+ "line2" : "und Mobile Apps deaktivieren",
+ "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."
+ },
+ "en-au" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-gb" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-ie" : {
+ "line1" : "Disable auto-updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "en-us" : {
+ "line1" : "Disable Auto-Updates",
+ "line2" : "and Mobile Apps?",
+ "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."
+ },
+ "es-en" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "es-es" : {
+ "line1" : "¿Desact. actual. auto",
+ "line2" : "y apl. móviles?",
+ "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."
+ },
+ "es-mx" : {
+ "line1" : "¿Deshab. actualiz.",
+ "line2" : "autom. y aplic. móv.?",
+ "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."
+ },
+ "fr-ca" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "fr-fr" : {
+ "line1" : "Désactiver màj autom.",
+ "line2" : "et app. mobiles?",
+ "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."
+ },
+ "it-it" : {
+ "line1" : "Disabilitare agg. aut.",
+ "line2" : "e app mobili?",
+ "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."
+ },
+ "nl-nl" : {
+ "line1" : "Auto-updates en mob.",
+ "line2" : "apps uitschakelen?",
+ "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."
+ },
+ "pl-pl" : {
+ "line1" : "Wył. automat. aktual.",
+ "line2" : "i aplikacje mobilne?",
+ "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ć."
+ },
+ "pt-br" : {
+ "line1" : "Desativar atualizações",
+ "line2" : "autom. e aplicativos?",
+ "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."
+ },
+ "pt-pt" : {
+ "line1" : "Desact. actual. autom.",
+ "line2" : "e aplicações móveis?",
+ "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."
+ },
+ "ru-ru" : {
+ "line1" : "Откл. автообновления",
+ "line2" : "и мобил. прилож.?",
+ "tts" : "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены."
+ },
+ "sv-se" : {
+ "line1" : "Avaktiverar autouppdat.",
+ "line2" : "och mobilappar?",
+ "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."
+ },
+ "tr-tr" : {
+ "line1" : "Oto. güncelleme ve",
+ "line2" : "mobil uygul. kapat?",
+ "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."
+ },
+ "zh-cn" : {
+ "line1" : "是否禁用自动更新和",
+ "line2" : "移动应用程序?",
+ "tts" : "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。"
+ },
+ "zh-tw" : {
+ "line1" : "停用自動更新",
+ "line2" : "和行動應用程式?",
+ "tts" : "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。"
+ }
+ }
+ },
+ "DrivingCharacteristics" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Fahreigenschaften",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus."
+ },
+ "en-au" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-gb" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-ie" : {
+ "label" : "Driving characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status."
+ },
+ "en-us" : {
+ "label" : "Driving Characteristics",
+ "tts" : "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status."
+ },
+ "es-en" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "es-es" : {
+ "label" : "Características de conducción",
+ "tts" : "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad."
+ },
+ "es-mx" : {
+ "label" : "Características del manejo",
+ "tts" : "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad."
+ },
+ "fr-ca" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "fr-fr" : {
+ "label" : "Caractéristiques de conduite",
+ "tts" : "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité."
+ },
+ "it-it" : {
+ "label" : "Caratteristiche di guida",
+ "tts" : "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza."
+ },
+ "nl-nl" : {
+ "label" : "Rijkenmerken",
+ "tts" : "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus."
+ },
+ "pl-pl" : {
+ "label" : "Informacje dotyczące stylu jazdy",
+ "tts" : "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa."
+ },
+ "pt-br" : {
+ "label" : "Características de condução",
+ "tts" : "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança."
+ },
+ "pt-pt" : {
+ "label" : "Características de condução",
+ "tts" : "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança."
+ },
+ "ru-ru" : {
+ "label" : "Характеристики движения",
+ "tts" : "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности."
+ },
+ "sv-se" : {
+ "label" : "Köregenskaper",
+ "tts" : "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus."
+ },
+ "tr-tr" : {
+ "label" : "Sürüş karakteristikleri",
+ "tts" : "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu."
+ },
+ "zh-cn" : {
+ "label" : "行驶特性",
+ "tts" : "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态"
+ },
+ "zh-tw" : {
+ "label" : "駕駛特性",
+ "tts" : "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態"
+ }
+ }
+ },
+ "Location" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "GPS und Geschwindigkeit",
+ "tts" : "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs."
+ },
+ "en-au" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-gb" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-ie" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "en-us" : {
+ "label" : "GPS and speed",
+ "tts" : "An app can access vehicle GPS and speed."
+ },
+ "es-en" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "es-es" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Una aplicación puede acceder al GPS y la velocidad del vehículo."
+ },
+ "es-mx" : {
+ "label" : "GPS y velocidad",
+ "tts" : "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo."
+ },
+ "fr-ca" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "fr-fr" : {
+ "label" : "GPS et vitesse",
+ "tts" : "Une application peut accéder au GPS et à la vitesse du véhicule."
+ },
+ "it-it" : {
+ "label" : "GPS e velocità",
+ "tts" : "Un'app può avere accesso a GPS e velocità del veicolo."
+ },
+ "nl-nl" : {
+ "label" : "Gps en snelheid",
+ "tts" : "Een app heeft toegang tot gps en de snelheid van het voertuig."
+ },
+ "pl-pl" : {
+ "label" : "GPS i prędkość",
+ "tts" : "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu."
+ },
+ "pt-br" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Um aplicativo pode acessar o GPS e a velocidade do veículo."
+ },
+ "pt-pt" : {
+ "label" : "GPS e velocidade",
+ "tts" : "Uma aplicação consegue aceder ao GPS e à velocidade do veículo."
+ },
+ "ru-ru" : {
+ "label" : "GPS и скорость",
+ "tts" : "Приложение имеет доступ к GPS и скорости автомобиля."
+ },
+ "sv-se" : {
+ "label" : "GPS och hastighet",
+ "tts" : "Appen kan komma åt fordonets GPS och hastighetsmätare."
+ },
+ "tr-tr" : {
+ "label" : "GPS ve hız",
+ "tts" : "Bu uygulama aracın GPS ve hız bilgilerine erişebilir."
+ },
+ "zh-cn" : {
+ "label" : "GPS 和车速",
+ "tts" : "移动应用程序可以访问车辆 GPS 和车速信息。"
+ },
+ "zh-tw" : {
+ "label" : "GPS和車速",
+ "tts" : "應用程式可存取車輛的GPS和速度。"
+ }
+ }
+ },
+ "Notifications" : {
+ "languages" : {
+ "de-de" : {
+ "label" : "Push-Benachrichtigungen",
+ "tts" : "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden."
+ },
+ "en-au" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-gb" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-ie" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "en-us" : {
+ "label" : "Push notifications",
+ "tts" : "An app can send notifications when running in the background."
+ },
+ "es-en" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "es-es" : {
+ "label" : "Notificaciones push",
+ "tts" : "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano."
+ },
+ "es-mx" : {
+ "label" : "Notificaciones tipo Push",
+ "tts" : "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano."
+ },
+ "fr-ca" : {
+ "label" : "Notifications instantanées",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "fr-fr" : {
+ "label" : "Notifications push",
+ "tts" : "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan."
+ },
+ "it-it" : {
+ "label" : "Notifiche push",
+ "tts" : "Un'app può inviare notifiche se eseguita in background."
+ },
+ "nl-nl" : {
+ "label" : "Push-meldingen",
+ "tts" : "Een app kan meldingen versturen als deze op de achtergrond actief is."
+ },
+ "pl-pl" : {
+ "label" : "Powiadomienia Push",
+ "tts" : "Aplikacja może wysyłać powiadomienia, działając w tle."
+ },
+ "pt-br" : {
+ "label" : "Notificações Push",
+ "tts" : "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano."
+ },
+ "pt-pt" : {
+ "label" : "Notificações push",
+ "tts" : "Uma aplicação consegue enviar notificações quando está activa em segundo plano."
+ },
+ "ru-ru" : {
+ "label" : "Оповещения о пересылке",
+ "tts" : "Если приложение работает в фоновом режиме, оно может отправлять оповещения."
+ },
+ "sv-se" : {
+ "label" : "Push-notiser",
+ "tts" : "Appen kan skicka meddelanden när den körs i bakgrunden."
+ },
+ "tr-tr" : {
+ "label" : "Anlık bildirimleri",
+ "tts" : "Bir uygulama arka planda çalışırken bildirim gönderebilir."
+ },
+ "zh-cn" : {
+ "label" : "推送通知",
+ "tts" : "移动应用程序在后台运行时可推送通知。"
+ },
+ "zh-tw" : {
+ "label" : "傳送通知",
+ "tts" : "車輛行進時,應用程式可在背景中傳送通知。"
+ }
+ }
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Deshab. actual."
+ },
+ "es-es" : {
+ "line1" : "Desact. actual."
+ },
+ "es-mx" : {
+ "line1" : "Deshab. actual."
+ },
+ "fr-ca" : {
+ "line1" : "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."
+ },
+ "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"
+ },
+ "es-en" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "es-es" : {
+ "line1" : "Solicitar actual."
+ },
+ "es-mx" : {
+ "line1" : "Solicit. actualiz."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Update needed"
+ },
+ "en-us" : {
+ "line1" : "Update Needed"
+ },
+ "es-en" : {
+ "line1" : "Actualiz. neces."
+ },
+ "es-es" : {
+ "line1" : "Actu. necesaria"
+ },
+ "es-mx" : {
+ "line1" : "Actualiz. neces."
+ },
+ "fr-ca" : {
+ "line1" : "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..."
+ },
+ "en-ie" : {
+ "line1" : "Updating..."
+ },
+ "en-us" : {
+ "line1" : "Updating..."
+ },
+ "es-en" : {
+ "line1" : "Actualizando..."
+ },
+ "es-es" : {
+ "line1" : "Actualizando..."
+ },
+ "es-mx" : {
+ "line1" : "Actualizando..."
+ },
+ "fr-ca" : {
+ "line1" : "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"
+ },
+ "en-ie" : {
+ "line1" : "Up-to-date"
+ },
+ "en-us" : {
+ "line1" : "Up-To-Date"
+ },
+ "es-en" : {
+ "line1" : "Actualizado"
+ },
+ "es-es" : {
+ "line1" : "Actualizada"
+ },
+ "es-mx" : {
+ "line1" : "Actualizado"
+ },
+ "fr-ca" : {
+ "line1" : "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" : {
+ "label" : "Fahrzeuginformationen",
+ "tts" : "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck."
+ },
+ "en-au" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-gb" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-ie" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure."
+ },
+ "en-us" : {
+ "label" : "Vehicle information",
+ "tts" : "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure."
+ },
+ "es-en" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-es" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "es-mx" : {
+ "label" : "Información del vehículo",
+ "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."
+ },
+ "fr-ca" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "fr-fr" : {
+ "label" : "Renseignements du véhicule",
+ "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."
+ },
+ "it-it" : {
+ "label" : "Informazioni sul veicolo",
+ "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."
+ },
+ "nl-nl" : {
+ "label" : "Voertuiginformatie",
+ "tts" : "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning."
+ },
+ "pl-pl" : {
+ "label" : "Informacje o pojeździe",
+ "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."
+ },
+ "pt-br" : {
+ "label" : "Informações sobre o veículo",
+ "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."
+ },
+ "pt-pt" : {
+ "label" : "Informações do veículo",
+ "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."
+ },
+ "ru-ru" : {
+ "label" : "Информация об автомобиле",
+ "tts" : "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин."
+ },
+ "sv-se" : {
+ "label" : "Fordonsinformation",
+ "tts" : "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck."
+ },
+ "tr-tr" : {
+ "label" : "Araç bilgisi",
+ "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ı."
+ },
+ "zh-cn" : {
+ "label" : "车辆信息",
+ "tts" : "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压."
+ },
+ "zh-tw" : {
+ "label" : "車輛資訊",
+ "tts" : "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓."
+ }
+ }
+ }
+ },
+ "version" : "001.001.015"
+ },
+ "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" : [ "FULL", "LIMITED" ]
+ },
+ "OnDriverDistraction" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "OnEncodedSyncPData" : {
+ "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" ]
+ },
+ "OnSyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnTBTClientState" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "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" ]
+ },
+ "SyncPData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "UnsubscribeButton" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "DrivingCharacteristics-3" : {
+ "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"
+ ]
+ }
+ },
+ "user_consent_prompt" : "DrivingCharacteristics"
+ },
+ "Emergency-1" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "airbagStatus",
+ "bodyInformation",
+ "clusterModeStatus",
+ "deviceStatus",
+ "eCallInfo",
+ "emergencyEvent"
+ ]
+ }
+ }
+ },
+ "Location-1" : {
+ "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" ]
+ }
+ },
+ "user_consent_prompt" : "Location"
+ },
+ "Navigation-1" : {
+ "rpcs" : {
+ "AlertManeuver" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ShowConstantTBT" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UpdateTurnList" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "Notifications" : {
+ "rpcs" : {
+ "Alert" : {
+ "hmi_levels" : [ "BACKGROUND" ]
+ }
+ },
+ "user_consent_prompt" : "Notifications"
+ },
+ "PropriataryData-1" : {
+ "rpcs" : {
+ "DiagnosticMessage" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "GetDTCs" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ReadDID" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ }
+ }
+ },
+ "VehicleInfo-3" : {
+ "rpcs" : {
+ "GetVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "OnVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "vin",
+ "wiperStatus"
+ ]
+ },
+ "SubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ },
+ "UnsubscribeVehicleData" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ],
+ "parameters" : [
+ "engineTorque",
+ "externalTemperature",
+ "fuelLevel",
+ "fuelLevel_State",
+ "headLampStatus",
+ "instantFuelConsumption",
+ "odometer",
+ "tirePressure",
+ "wiperStatus"
+ ]
+ }
+ },
+ "user_consent_prompt" : "VehicleInfo"
+ },
+ "pre_Base-1" : {
+ "rpcs" : {
+ "ChangeRegistration" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "DeleteFile" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "GenericResponse" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "ListFiles" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnAppInterfaceUnregistered" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnLanguageChange" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "OnPermissionsChange" : {
+ "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" ]
+ },
+ "SetAppIcon" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetDisplayLayout" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ },
+ "SetGlobalProperties" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED" ]
+ },
+ "UnregisterAppInterface" : {
+ "hmi_levels" : [ "BACKGROUND", "FULL", "LIMITED", "NONE" ]
+ }
+ }
+ }
+ },
+ "module_config" : {
+ "device_certificates" : {
+ "HUU40DAS7F970UEI17A73JH32L41K32JH4L1K234H3K4" : "aldhfkahfgkafrblgjr"
+ },
+ "endpoints" : {
+ "0x07" : {
+ "default" : [ "http://policies.telematics.ford.com/api/policies" ]
+ }
+ },
+ "exchange_after_x_days" : 30,
+ "exchange_after_x_ignition_cycles" : 100,
+ "exchange_after_x_kilometers" : 1800,
+ "notifications_per_minute_by_priority" : {
+ "COMMUNICATION" : 6,
+ "EMERGENCY" : 60,
+ "NAVIGATION" : 15,
+ "NONE" : 0,
+ "NORMAL" : 4,
+ "VOICECOMM" : 10
+ },
+ "seconds_between_retries" : [ 1, 5, 25, 125, 625 ],
+ "timeout_after_x_seconds" : 60,
+ "vehicle_make" : "Stark Industries",
+ "vehicle_model" : "E-Tron",
+ "vehicle_year" : "1992"
+ }
+ }
+}
diff --git a/src/components/policy/policy_table_interface.xml b/src/components/policy/policy_table_interface.xml
deleted file mode 100644
index 6b671226ae..0000000000
--- a/src/components/policy/policy_table_interface.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="policy table interface base" version="0.0"
- date="2014-01-23">
-
- <!-- Common parameters start -->
- <enum name="Priority">
- <element name="EMERGENCY" />
- <element name="NAVIGATION" />
- <element name="VOICECOM" />
- <element name="COMMUNICATION" />
- <element name="NORMAL" />
- <element name="NONE" />
- </enum>
-
- <enum name="HmiLevel">
- <element name="BACKGROUND" />
- <element name="FULL" />
- <element name="LIMITED" />
- <element name="NONE" />
- </enum>
-
- <enum name="Parameter">
- <element name="gps" />
- <element name="speed" />
- <element name="engineTorque" />
- <element name="externalTemperature" />
- <element name="fuelLevel" />
- <element name="fuelLevel_State" />
- <element name="headLampStatus" />
- <element name="instantFuelConsumption" />
- <element name="odometer" />
- <element name="tirePressure" />
- <element name="wiperStatus" />
- <element name="vin" />
- <element name="accPedalPosition" />
- <element name="beltStatus" />
- <element name="driverBraking" />
- <element name="prndl" />
- <element name="rpm" />
- <element name="steeringWheelAngle" />
- <element name="myKey" />
- <element name="airbagStatus" />
- <element name="bodyInformation" />
- <element name="clusterModeStatus" />
- <element name="deviceStatus" />
- <element name="emergencyEvent" />
- <element name="eCallInfo" />
- </enum>
-
- <enum name="AppHMIType">
- <element name="DEFAULT" />
- <element name="COMMUNICATION" />
- <element name="MEDIA" />
- <element name="MESSAGING" />
- <element name="NAVIGATION" />
- <element name="INFORMATION" />
- <element name="SOCIAL" />
- <element name="BACKGROUND_PROCESS" />
- <element name="TESTING" />
- <element name="SYSTEM" />
- </enum>
- <!-- Common parameters end -->
-
- <!-- app_policies section start -->
-
- <typedef name="Strings" type="String" maxlength="255" array="true"
- maxsize="255" />
-
- <typedef name="AppHMITypes" type="AppHMIType" array="true"
- maxsize="255" />
-
- <struct name="ApplicationParams">
- <param name="groups" type="Strings" />
- <param name="nicknames" type="Strings" mandatory="false" />
- <param name="AppHMIType" type="AppHMITypes" mandatory="false" />
- <param name="memory_kb" type="Integer" minvalue="1" maxvalue="65225" mandatory="false"/>
- <param name="watchdog_timer_ms" type="Integer" minvalue="1"
- maxvalue="65225" mandatory="false"/>
- <param name="certificate" type="String" minlength="0" maxlength="255"
- mandatory="false" />
- </struct>
-
- <typedef name="HmiLevels" type="HmiLevel" array="true"
- maxsize="4" />
- <typedef name="Parameters" type="Parameter" array="true"
- maxsize="24" />
-
- <struct name="RpcParameters">
- <!-- maxsizes are equal to number of currently known elements of
- given type -->
- <param name="hmi_levels" type="HmiLevels" />
- <param name="parameters" type="Parameters" mandatory="false" />
- </struct>
-
- <!-- maxsizes are equal to number of currently known elements of given
- type -->
- <typedef name="Rpc" type="RpcParameters" map="true" maxsize="50" />
-
- <struct name="Rpcs">
- <param name="user_consent_prompt" type="String" minlegth="1"
- maxlength="255" mandatory="false"/>
- <param name="rpcs" type="Rpc" null_values_allowed="true"/>
- </struct>
- <!-- app_policies section end -->
-
- <!-- module_config section start -->
- <!-- minlenght="10" since minimum expected is "http://a.b" -->
- <typedef name="URL" type="String" minlength="10" maxlength="255"
- array="true" minsize="1" maxsize="255" />
-
- <typedef name="URLList" type="URL" map="true" minsize="1"
- maxsize="255" />
-
- <!-- max number of services is limited to 255 according to protocol specification -->
- <typedef name="ServiceEndpoints" type="URLList" map="true"
- minsize="1" maxsize="255" />
-
- <typedef name="NumberOfNotificationsPerMinute" type="Integer"
- map="true" maxsize="6" minvalue="0" maxvalue="255" />
-
- <typedef name="SecondsBetweenRetries" type="Integer" array="true"
- maxsize="10" minvalue="1" maxvalue="1000" />
-
- <struct name="ModuleConfig">
- <param name="device_certificates" type="String" minlength="1" maxlength="100" mandatory="false" map="true" minsize="1" maxsize="255" />
- <param name="preloaded_pt" type="Boolean" mandatory="false" />
- <param name="exchange_after_x_ignition_cycles" type="Integer"
- maxvalue="255" />
- <param name="exchange_after_x_kilometers" type="Integer"
- maxvalue="4294967296" />
- <param name="exchange_after_x_days" type="Integer"
- maxvalue="255" />
- <param name="timeout_after_x_seconds" type="Integer"
- maxvalue="65535" />
- <param name="seconds_between_retries" type="SecondsBetweenRetries" />
- <param name="endpoints" type="ServiceEndpoints" />
- <param name="notifications_per_minute_by_priority" type="NumberOfNotificationsPerMinute" />
- <param name="vehicle_make" type="String" maxlength="100"
- mandatory="false" />
- <param name="vehicle_model" type="String" maxlength="100"
- mandatory="false" />
- <param name="vehicle_year" type="String" minlength="4" maxlength="4"
- mandatory="false" />
- </struct>
- <!-- module_config section end -->
-
- <!-- consumer_friendly_messages section start -->
- <struct name="MessageString">
- <param name="line1" type="String" maxlength="255"
- mandatory="false" />
- <param name="line2" type="String" maxlength="255"
- mandatory="false" />
- <param name="tts" type="String" maxlength="65535" mandatory="false" />
- <param name="label" type="String" maxlength="255"
- mandatory="false" />
- <param name="textBody" type="String" maxlength="500"
- mandatory="false" />
- </struct>
-
- <typedef name="Languages" map="true" type="MessageString"
- maxsize="500" mandatory="false" />
-
- <struct name="MessageLanguages">
- <param name="languages" type="Languages" />
- </struct>
-
- <typedef name="Messages" map="true" type="MessageLanguages"
- maxsize="255" />
-
- <struct name="ConsumerFriendlyMessages">
- <param name="version" type="String" maxlength="100" />
- <param name="messages" type="Messages" mandatory="false" />
- </struct>
- <!-- consumer_friendly_messages section end -->
-
- <!-- module_meta section start -->
- <struct name="ModuleMeta">
- </struct>
- <!-- module_meta section end -->
-
- <!-- usage_and_error_counts section start -->
- <struct name="AppLevel">
- </struct>
-
- <typedef name="AppLevels" type="AppLevel" map="true" maxsize="255" />
-
- <struct name="UsageAndErrorCounts">
- <param name="app_level" type="AppLevels" mandatory="false" />
- </struct>
- <!-- usage_and_error_counts section end -->
-
- <!-- device_data section start -->
- <struct name="DeviceParams">
- </struct>
- <!-- device_data section end -->
-
- <!-- policy_table section start -->
- <typedef name="ApplicationPolicies" map="true" type="ApplicationParams" null_values_allowed="true" minsize="1" maxsize="1000" />
-
- <typedef name="FunctionalGroupings" map="true" type="Rpcs"
- minsize="1" maxsize="255" />
-
- <typedef name="DeviceData" map="true" type="DeviceParams"
- maxsize="255" />
-
- <struct name="PolicyTable">
- <!-- maxsize for app_policies can be changed, if necessary -->
- <param name="app_policies" type="ApplicationPolicies" />
- <param name="functional_groupings" type="FunctionalGroupings" />
- <param name="consumer_friendly_messages" type="ConsumerFriendlyMessages" />
- <param name="module_config" type="ModuleConfig" />
- <param name="module_meta" type="ModuleMeta" mandatory="false"/>
- <param name="usage_and_error_counts" type="UsageAndErrorCounts" mandatory="false" />
- <param name="device_data" type="DeviceData" mandatory="false" />
- </struct>
- <!-- policy_table section end -->
-
- <!-- Root element -->
- <struct name="Table">
- <param name="policy_table" type="PolicyTable" />
- </struct>
-
-</interface>
diff --git a/src/components/policy/src/cache_manager.cc b/src/components/policy/src/cache_manager.cc
deleted file mode 100644
index c0e402c580..0000000000
--- a/src/components/policy/src/cache_manager.cc
+++ /dev/null
@@ -1,1601 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "policy/cache_manager.h"
-
-#include <algorithm>
-#include <functional>
-#include <ctime>
-#include <cmath>
-
-#include "utils/file_system.h"
-#include "json/reader.h"
-#include "json/features.h"
-#include "json/writer.h"
-#include "utils/logger.h"
-#include "utils/gen_hash.h"
-#include "utils/macro.h"
-#include "utils/threads/thread.h"
-#include "utils/threads/thread_delegate.h"
-
-#include "policy/sql_pt_representation.h"
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-namespace policy {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
-
-#define CACHE_MANAGER_CHECK(return_value) \
- { \
- if (!pt_) { \
- LOG4CXX_WARN(logger_, "The cache manager is not initialized"); \
- return return_value; \
- } \
- }
-
-#define CACHE_MANAGER_CHECK_VOID() \
- { \
- if (!pt_) { \
- LOG4CXX_WARN(logger_, "The cache manager is not initialized"); \
- return; \
- } \
- }
-
-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()
- , pt_(new policy_table::Table)
- , backup_(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) const {
- CACHE_MANAGER_CHECK(false);
- bool result = true;
- return result;
-}
-
-uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const {
- CACHE_MANAGER_CHECK(0);
- uint32_t result = 0;
- if (AppExists(app_id)) {
- if (pt_->policy_table.app_policies_section.apps[app_id]
- .heart_beat_timeout_ms.is_initialized()) {
- result = *(pt_->policy_table.app_policies_section.apps[app_id]
- .heart_beat_timeout_ms);
- }
- }
- return result;
-}
-
-bool CacheManager::CanAppStealFocus(const std::string& app_id) const {
- CACHE_MANAGER_CHECK(false);
- bool result = true;
- return result;
-}
-
-bool CacheManager::GetDefaultHMI(const std::string& app_id,
- std::string& default_hmi) const {
- CACHE_MANAGER_CHECK(false);
- bool result = true;
- return result;
-}
-
-bool CacheManager::ResetUserConsent() {
- CACHE_MANAGER_CHECK(false);
- sync_primitives::AutoLock lock(cache_lock_);
- return true;
-}
-
-bool CacheManager::GetUserPermissionsForDevice(
- const std::string& device_id,
- StringArray& consented_groups,
- StringArray& disallowed_groups) const {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK(false);
- return true;
-}
-
-void CacheManager::GetAllAppGroups(const std::string& app_id,
- FunctionalGroupIDs& all_group_ids) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK_VOID();
-
- if (kDeviceId == app_id) {
- LOG4CXX_INFO(logger_, "Devices doesn't have groups");
- return;
- }
-
- policy_table::ApplicationPolicies::const_iterator app_params_iter =
- pt_->policy_table.app_policies_section.apps.find(app_id);
-
- 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 =
- (*app_params_iter).second.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);
- }
- }
-}
-
-void CacheManager::GetPreConsentedGroups(
- const std::string& app_id, FunctionalGroupIDs& preconsented_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK_VOID();
-}
-
-void CacheManager::GetConsentedGroups(const std::string& device_id,
- const std::string& app_id,
- FunctionalGroupIDs& allowed_groups,
- FunctionalGroupIDs& disallowed_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK_VOID();
-}
-
-void CacheManager::GetUnconsentedGroups(
- const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalGroupIDs& unconsented_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK_VOID();
-}
-
-void CacheManager::RemoveAppConsentForGroup(const std::string& app_id,
- const std::string& group_name) {
- CACHE_MANAGER_CHECK_VOID();
-}
-
-bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
- 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_section.apps.begin();
- policy_table::ApplicationPolicies::const_iterator iter_end =
- update_pt.policy_table.app_policies_section.apps.end();
-
- for (; iter != iter_end; ++iter) {
- 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()) {
- policy_table::ApplicationPolicies::const_iterator iter_default =
- update_pt.policy_table.app_policies_section.apps.find(kDefaultId);
- if (update_pt.policy_table.app_policies_section.apps.end() ==
- iter_default) {
- LOG4CXX_ERROR(logger_, "The default section was not found in PTU");
- continue;
- }
- pt_->policy_table.app_policies_section.apps[iter->first] =
- iter_default->second;
- } else {
- pt_->policy_table.app_policies_section.apps[iter->first] = iter->second;
- }
- }
-
- pt_->policy_table.app_policies_section.device =
- update_pt.policy_table.app_policies_section.device;
-
- pt_->policy_table.module_config.SafeCopyFrom(
- update_pt.policy_table.module_config);
-
- pt_->policy_table.consumer_friendly_messages.assign_if_valid(
- update_pt.policy_table.consumer_friendly_messages);
-
- ResetCalculatedPermissions();
- Backup();
- return true;
-}
-
-void CacheManager::GetHMIAppTypeAfterUpdate(
- std::map<std::string, StringArray>& app_hmi_types) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK_VOID();
- 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();
- }
- 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);
- // ISO_8601 format is expected, e.g. “2000-01-01T12:18:53Z”
- strftime(buf, sizeof(buf), "%Y-%m-%dT%XZ", &tstruct);
- return buf;
-}
-
-bool CacheManager::GetPermissionsForApp(const std::string& device_id,
- const std::string& app_id,
- FunctionalIdType& group_types) {
- LOG4CXX_AUTO_TRACE(logger_);
- GetAllAppGroups(app_id, group_types[kTypeGeneral]);
- GetAllAppGroups(kDefaultId, group_types[kTypeDefault]);
- GetAllAppGroups(kPreDataConsentId, group_types[kTypePreDataConsented]);
- return true;
-}
-
-bool CacheManager::GetDeviceGroupsFromPolicies(
- policy_table::Strings& groups,
- policy_table::Strings& preconsented_groups) const {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK(false);
- return true;
-}
-
-bool CacheManager::AddDevice(const std::string& device_id,
- const std::string& connection_type) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- sync_primitives::AutoLock auto_lock(cache_lock_);
- CACHE_MANAGER_CHECK(false);
- policy_table::DeviceParams& params =
- (*(pt_->policy_table.device_data))[device_id];
-
- // Open SDL stored just device id in policy
- UNUSED(params);
-
- // We have to set preloaded flag as false in policy table on adding new
- // information (SDLAQ-CRS-2365). It can happens only after device addition.
- *pt_->policy_table.module_config.preloaded_pt = false;
-
- Backup();
- return true;
-}
-
-bool CacheManager::SetDeviceData(const std::string& device_id,
- const std::string& hardware,
- const std::string& firmware,
- const std::string& os,
- const std::string& os_version,
- const std::string& carrier,
- const uint32_t number_of_ports,
- const std::string& connection_type) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- sync_primitives::AutoLock auto_lock(cache_lock_);
- CACHE_MANAGER_CHECK(false);
- Backup();
- return true;
-}
-
-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_);
- CACHE_MANAGER_CHECK(false);
- Backup();
- return true;
-}
-
-bool CacheManager::ReactOnUserDevConsentForApp(const std::string& app_id,
- bool is_device_allowed) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK(false);
- bool result = true;
- Backup();
- return result;
-}
-
-void CacheManager::GetGroupNameByHashID(const int32_t group_id,
- std::string& group_name) {
- CACHE_MANAGER_CHECK_VOID();
- policy_table::FunctionalGroupings::const_iterator fg_iter =
- pt_->policy_table.functional_groupings.begin();
- policy_table::FunctionalGroupings::const_iterator fg_iter_end =
- pt_->policy_table.functional_groupings.end();
-
- for (; fg_iter != fg_iter_end; ++fg_iter) {
- const int32_t id = GenerateHash((*fg_iter).first);
- if (group_id == id) {
- group_name = (*fg_iter).first;
- }
- }
-}
-
-bool CacheManager::SetUserPermissionsForApp(
- const PermissionConsent& permissions) {
- LOG4CXX_AUTO_TRACE(logger_);
- sync_primitives::AutoLock auto_lock(cache_lock_);
- CACHE_MANAGER_CHECK(false);
- Backup();
- return true;
-}
-
-bool CacheManager::UpdateRequired() const {
- return update_required;
-}
-
-void CacheManager::SaveUpdateRequired(bool status) {
- update_required = status;
- Backup();
-}
-
-bool CacheManager::IsApplicationRevoked(const std::string& app_id) const {
- CACHE_MANAGER_CHECK(false);
- bool is_revoked = false;
- 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;
-}
-
-void CacheManager::CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK_VOID();
-
- 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_section.apps[app_id].groups.begin();
-
- policy_table::Strings::const_iterator app_groups_iter_end =
- pt_->policy_table.app_policies_section.apps[app_id].groups.end();
-
- policy_table::FunctionalGroupings::const_iterator concrete_group;
-
- for (; app_groups_iter != app_groups_iter_end; ++app_groups_iter) {
- concrete_group =
- pt_->policy_table.functional_groupings.find(*app_groups_iter);
- if (pt_->policy_table.functional_groupings.end() != concrete_group) {
- const policy_table::Rpcs& rpcs = concrete_group->second;
-
- policy_table::Rpc::const_iterator rpc_iter = rpcs.rpcs.find(rpc);
- if (rpcs.rpcs.end() != rpc_iter) {
- policy_table::RpcParameters rpc_param = rpc_iter->second;
-
- policy_table::HmiLevel hmi_level_e;
- policy_table::EnumFromJsonString(hmi_level, &hmi_level_e);
-
- policy_table::HmiLevels::const_iterator hmi_iter =
- std::find(rpc_param.hmi_levels.begin(),
- rpc_param.hmi_levels.end(),
- hmi_level_e);
-
- if (rpc_param.hmi_levels.end() != hmi_iter) {
- result.hmi_level_permitted = PermitResult::kRpcAllowed;
-
- policy_table::Parameters::const_iterator params_iter =
- rpc_param.parameters->begin();
- policy_table::Parameters::const_iterator params_iter_end =
- rpc_param.parameters->end();
-
- for (; params_iter != params_iter_end; ++params_iter) {
- result.list_of_allowed_params.push_back(
- policy_table::EnumToJsonString(*params_iter));
- }
- }
- }
- }
- }
-}
-
-bool CacheManager::IsPTPreloaded() {
- CACHE_MANAGER_CHECK(false);
- return *pt_->policy_table.module_config.preloaded_pt;
-}
-
-int CacheManager::IgnitionCyclesBeforeExchange() {
- CACHE_MANAGER_CHECK(0);
- 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;
-
- const int last_exch = static_cast<int>(
- *pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
- current = std::max(last_exch, 0);
- LOG4CXX_DEBUG(
- logger_,
- "IgnitionCyclesBeforeExchange current:" << static_cast<int>(current));
-
- return std::max(limit - current, 0);
-}
-
-int CacheManager::KilometersBeforeExchange(int current) {
- CACHE_MANAGER_CHECK(0);
- const int limit =
- std::max(static_cast<int>(
- pt_->policy_table.module_config.exchange_after_x_kilometers),
- 0);
- LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange limit:" << limit);
- int last = 0;
-
- const int odo_val = static_cast<int>(
- *pt_->policy_table.module_meta->pt_exchanged_at_odometer_x);
- last = std::max(odo_val, 0);
- LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange last:" << last);
-
- const int actual = std::max((current - last), 0);
- LOG4CXX_DEBUG(logger_, "KilometersBeforeExchange actual:" << actual);
- return std::max(limit - actual, 0);
-}
-
-bool CacheManager::SetCountersPassedForSuccessfulUpdate(
- policy::Counters counter, int value) {
- CACHE_MANAGER_CHECK(false);
- switch (counter) {
- case KILOMETERS:
- *pt_->policy_table.module_meta->pt_exchanged_at_odometer_x = value;
- LOG4CXX_DEBUG(logger_,
- "SetCountersPassedForSuccessfulUpdate km:" << value);
- break;
- case DAYS_AFTER_EPOCH:
- *pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch = value;
- LOG4CXX_DEBUG(
- logger_,
- "SetCountersPassedForSuccessfulUpdate days after epoch:" << value);
- break;
- default:
- LOG4CXX_ERROR(logger_,
- "Unknown counter was requested to set: " << counter);
- return false;
- }
-
- Backup();
- return true;
-}
-
-int CacheManager::DaysBeforeExchange(int current) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK(0);
- const uint8_t limit = pt_->policy_table.module_config.exchange_after_x_days;
- LOG4CXX_DEBUG(logger_,
- "Exchange after: " << static_cast<int>(limit) << " days");
-
- const uint16_t days_after_epoch =
- (*pt_->policy_table.module_meta->pt_exchanged_x_days_after_epoch);
- LOG4CXX_DEBUG(logger_, "Epoch since last update: " << days_after_epoch);
-
- const uint16_t actual =
- std::max(static_cast<uint16_t>(current - days_after_epoch), uint16_t(0));
- LOG4CXX_DEBUG(logger_, "The days since last update: " << actual);
-
- return std::max(limit - actual, 0);
-}
-
-void CacheManager::IncrementIgnitionCycles() {
- CACHE_MANAGER_CHECK_VOID();
- const int ign_val = static_cast<int>(
- *pt_->policy_table.module_meta->ignition_cycles_since_last_exchange);
- (*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) =
- ign_val + 1;
- LOG4CXX_DEBUG(logger_, "IncrementIgnitionCycles ignitions:" << ign_val);
- Backup();
-}
-
-void CacheManager::ResetIgnitionCycles() {
- CACHE_MANAGER_CHECK_VOID();
- (*pt_->policy_table.module_meta->ignition_cycles_since_last_exchange) = 0;
- Backup();
-}
-
-int CacheManager::TimeoutResponse() {
- CACHE_MANAGER_CHECK(0);
- return pt_->policy_table.module_config.timeout_after_x_seconds;
-}
-
-bool CacheManager::SecondsBetweenRetries(std::vector<int>& seconds) {
- CACHE_MANAGER_CHECK(false);
- rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter =
- pt_->policy_table.module_config.seconds_between_retries.begin();
- rpc::policy_table_interface_base::SecondsBetweenRetries::iterator iter_end =
- pt_->policy_table.module_config.seconds_between_retries.end();
-
- const std::size_t size =
- pt_->policy_table.module_config.seconds_between_retries.size();
- seconds.reserve(size);
- for (; iter != iter_end; ++iter) {
- seconds.push_back(*iter);
- }
- return true;
-}
-
-const policy::VehicleInfo CacheManager::GetVehicleInfo() const {
- CACHE_MANAGER_CHECK(VehicleInfo());
- policy_table::ModuleConfig& module_config = pt_->policy_table.module_config;
- VehicleInfo vehicle_info;
- vehicle_info.vehicle_make = *module_config.vehicle_make;
- vehicle_info.vehicle_model = *module_config.vehicle_model;
- vehicle_info.vehicle_year = *module_config.vehicle_year;
- LOG4CXX_DEBUG(
- logger_,
- "Vehicle info (make, model, year):" << vehicle_info.vehicle_make << ","
- << vehicle_info.vehicle_model << ","
- << vehicle_info.vehicle_year);
- return vehicle_info;
-}
-
-std::vector<UserFriendlyMessage> CacheManager::GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::vector<UserFriendlyMessage> result;
- CACHE_MANAGER_CHECK(result);
-
- 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);
- }
- return result;
-}
-
-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(search_value);
-
- if (pt_->policy_table.module_config.endpoints.end() != iter) {
- policy_table::URLList::const_iterator url_list_iter =
- (*iter).second.begin();
- policy_table::URLList::const_iterator url_list_iter_end =
- (*iter).second.end();
- for (; url_list_iter != url_list_iter_end; ++url_list_iter) {
- EndpointData data;
- data.app_id = (*url_list_iter).first;
- std::copy((*url_list_iter).second.begin(),
- (*url_list_iter).second.end(),
- std::back_inserter(data.url));
-
- end_points.push_back(data);
- }
- }
-}
-
-std::string CacheManager::GetLockScreenIconUrl() const {
- if (backup_) {
- return backup_->GetLockScreenIconUrl();
- }
- return std::string("");
-}
-
-rpc::policy_table_interface_base::NumberOfNotificationsType
-CacheManager::GetNotificationsNumber(const std::string& priority) {
- CACHE_MANAGER_CHECK(0);
- typedef rpc::policy_table_interface_base::NumberOfNotificationsPerMinute NNPM;
-
- const NNPM& nnpm =
- pt_->policy_table.module_config.notifications_per_minute_by_priority;
-
- NNPM::const_iterator priority_iter = nnpm.find(priority);
-
- const rpc::policy_table_interface_base::NumberOfNotificationsType result =
- (nnpm.end() != priority_iter ? (*priority_iter).second : 0u);
- return result;
-}
-
-bool CacheManager::GetPriority(const std::string& policy_app_id,
- std::string& priority) const {
- 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_section.apps;
-
- 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);
- }
-
- return app_id_exists;
-}
-
-void CacheManager::CheckSnapshotInitialization() {
- CACHE_MANAGER_CHECK_VOID();
- if (!snapshot_) {
- LOG4CXX_ERROR(logger_, "Snapshot pointer is not initialized");
- return;
- }
-
- *(snapshot_->policy_table.module_config.preloaded_pt) = false;
-
- // SDL must not send certificate in snapshot
- snapshot_->policy_table.module_config.certificate =
- rpc::Optional<rpc::String<0, 65535> >();
-
- /* consumer_friendly_messages are required for the snapshot;
- * consumer_friendly_messages->version is required always, but
- * consumer_friendly_messages->messages must be omitted in PTS */
- if (snapshot_->policy_table.consumer_friendly_messages->is_initialized()) {
- snapshot_->policy_table.consumer_friendly_messages->messages =
- rpc::Optional<policy_table::Messages>();
- } else {
- LOG4CXX_WARN(logger_,
- "policy_table.consumer_friendly_messages is not initialized");
- }
-
- /* policy_table.usage_and_error_counts are required for PTS and
- * policy_table.usage_and_error_counts->app_level is optional */
- rpc::Optional<policy_table::UsageAndErrorCounts>& usage_and_error_counts =
- snapshot_->policy_table.usage_and_error_counts;
-
- if (usage_and_error_counts->app_level->is_initialized()) {
- policy_table::AppLevels::iterator it =
- usage_and_error_counts->app_level->begin();
- policy_table::AppLevels::const_iterator it_end =
- usage_and_error_counts->app_level->end();
- for (; it != it_end; ++it) {
- if (!(*it).second.minutes_in_hmi_full.is_initialized()) {
- (*it).second.minutes_in_hmi_full = 0;
- }
-
- if (!(*it).second.app_registration_language_gui.is_initialized()) {
- (*it).second.app_registration_language_gui = "unknown";
- }
-
- if (!(*it).second.app_registration_language_vui.is_initialized()) {
- (*it).second.app_registration_language_vui = "unknown";
- }
-
- if (!(*it).second.minutes_in_hmi_limited.is_initialized()) {
- (*it).second.minutes_in_hmi_limited = 0;
- }
-
- if (!(*it).second.minutes_in_hmi_background.is_initialized()) {
- (*it).second.minutes_in_hmi_background = 0;
- }
-
- if (!(*it).second.minutes_in_hmi_none.is_initialized()) {
- (*it).second.minutes_in_hmi_none = 0;
- }
-
- if (!(*it).second.count_of_user_selections.is_initialized()) {
- (*it).second.count_of_user_selections = 0;
- }
-
- if (!(*it)
- .second.count_of_rejections_sync_out_of_memory
- .is_initialized()) {
- (*it).second.count_of_rejections_sync_out_of_memory = 0;
- }
-
- if (!(*it)
- .second.count_of_rejections_nickname_mismatch.is_initialized()) {
- (*it).second.count_of_rejections_nickname_mismatch = 0;
- }
-
- if (!(*it).second.count_of_rejections_duplicate_name.is_initialized()) {
- (*it).second.count_of_rejections_duplicate_name = 0;
- }
-
- if (!(*it).second.count_of_rejected_rpc_calls.is_initialized()) {
- (*it).second.count_of_rejected_rpc_calls = 0;
- }
-
- if (!(*it).second.count_of_rpcs_sent_in_hmi_none.is_initialized()) {
- (*it).second.count_of_rpcs_sent_in_hmi_none = 0;
- }
-
- if (!(*it).second.count_of_removals_for_bad_behavior.is_initialized()) {
- (*it).second.count_of_removals_for_bad_behavior = 0;
- }
-
- if (!(*it).second.count_of_run_attempts_while_revoked.is_initialized()) {
- (*it).second.count_of_run_attempts_while_revoked = 0;
- }
- }
- } else {
- LOG4CXX_WARN(logger_, "app_level is not initialized");
- }
-}
-
-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_AUTO_TRACE(logger_);
- 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_);
- sync_primitives::AutoLock lock(cache_lock_);
-
- snapshot_ = new policy_table::Table();
-
- // Copy all members of policy table except messages in consumer friendly
- // messages
- snapshot_->policy_table.app_policies_section =
- pt_->policy_table.app_policies_section;
- snapshot_->policy_table.functional_groupings =
- pt_->policy_table.functional_groupings;
- snapshot_->policy_table.consumer_friendly_messages->version =
- pt_->policy_table.consumer_friendly_messages->version;
- snapshot_->policy_table.consumer_friendly_messages->mark_initialized();
- snapshot_->policy_table.module_config = pt_->policy_table.module_config;
- snapshot_->policy_table.module_meta = pt_->policy_table.module_meta;
- snapshot_->policy_table.usage_and_error_counts =
- pt_->policy_table.usage_and_error_counts;
- snapshot_->policy_table.device_data = pt_->policy_table.device_data;
-
- // Set policy table type to Snapshot
- snapshot_->SetPolicyTableType(
- rpc::policy_table_interface_base::PolicyTableType::PT_SNAPSHOT);
-
- CheckSnapshotInitialization();
- return snapshot_;
-}
-
-bool CacheManager::GetInitialAppData(const std::string& app_id,
- StringArray& nicknames,
- StringArray& app_hmi_types) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK(false);
- policy_table::ApplicationPolicies::const_iterator policy_iter =
- pt_->policy_table.app_policies_section.apps.find(app_id);
-
- 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(app_hmi_types),
- AppHMITypeToString());
- }
- return true;
-}
-
-bool CacheManager::GetFunctionalGroupings(
- policy_table::FunctionalGroupings& groups) {
- 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());
- return true;
-}
-
-int CacheManager::CountUnconsentedGroups(const std::string& policy_app_id,
- const std::string& device_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK(false);
- 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;
-}
-
-bool CacheManager::IsMetaInfoPresent() const {
- CACHE_MANAGER_CHECK(false);
- bool result = true;
- return result;
-}
-
-bool CacheManager::SetSystemLanguage(const std::string& language) {
- CACHE_MANAGER_CHECK(false);
- Backup();
- return true;
-}
-
-bool CacheManager::GetFunctionalGroupNames(FunctionalGroupNames& names) {
- LOG4CXX_AUTO_TRACE(logger_);
- CACHE_MANAGER_CHECK(false);
- rpc::policy_table_interface_base::FunctionalGroupings::iterator iter =
- pt_->policy_table.functional_groupings.begin();
- rpc::policy_table_interface_base::FunctionalGroupings::iterator iter_end =
- pt_->policy_table.functional_groupings.end();
-
- for (; iter != iter_end; ++iter) {
- const int32_t id = GenerateHash((*iter).first);
- std::pair<std::string, std::string> value =
- std::make_pair(*(*iter).second.user_consent_prompt, (*iter).first);
-
- names.insert(
- std::pair<uint32_t, std::pair<std::string, std::string> >(id, value));
- }
- return true;
-}
-
-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();
- sync_primitives::AutoLock lock(cache_lock_);
- switch (type) {
- case usage_statistics::USER_SELECTIONS:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_user_selections;
- break;
- case usage_statistics::REJECTIONS_SYNC_OUT_OF_MEMORY:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_rejections_sync_out_of_memory;
- break;
- case usage_statistics::REJECTIONS_NICKNAME_MISMATCH:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_rejections_nickname_mismatch;
- break;
- case usage_statistics::REJECTIONS_DUPLICATE_NAME:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_rejections_duplicate_name;
- break;
- case usage_statistics::REJECTED_RPC_CALLS:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_rejected_rpc_calls;
- break;
- case usage_statistics::RPCS_IN_HMI_NONE:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_rpcs_sent_in_hmi_none;
- break;
- case usage_statistics::REMOVALS_MISBEHAVED:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_removals_for_bad_behavior;
- break;
- case usage_statistics::RUN_ATTEMPTS_WHILE_REVOKED:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_run_attempts_while_revoked;
- break;
- case usage_statistics::COUNT_OF_TLS_ERRORS:
- ++(*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .count_of_tls_errors;
- break;
- default:
- LOG4CXX_WARN(logger_, "Type app counter is unknown");
- return;
- }
- Backup();
-}
-
-void CacheManager::Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value) {
- CACHE_MANAGER_CHECK_VOID();
- sync_primitives::AutoLock lock(cache_lock_);
- switch (type) {
- case usage_statistics::LANGUAGE_GUI:
- (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .app_registration_language_gui = value;
- break;
- case usage_statistics::LANGUAGE_VUI:
- (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .app_registration_language_vui = value;
- break;
- default:
- LOG4CXX_WARN(logger_, "Type app info is unknown");
- return;
- }
- Backup();
-}
-
-void CacheManager::Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int seconds) {
- CACHE_MANAGER_CHECK_VOID();
- sync_primitives::AutoLock lock(cache_lock_);
- const int minutes = ConvertSecondsToMinute(seconds);
- switch (type) {
- case usage_statistics::SECONDS_HMI_FULL:
- (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .minutes_in_hmi_full += minutes;
- break;
- case usage_statistics::SECONDS_HMI_LIMITED:
- (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .minutes_in_hmi_limited += minutes;
- break;
- case usage_statistics::SECONDS_HMI_BACKGROUND:
- (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .minutes_in_hmi_background += minutes;
- break;
- case usage_statistics::SECONDS_HMI_NONE:
- (*pt_->policy_table.usage_and_error_counts->app_level)[app_id]
- .minutes_in_hmi_none += minutes;
- break;
- default:
- LOG4CXX_WARN(logger_, "Type app stopwatch is unknown");
- return;
- }
- Backup();
-}
-
-long CacheManager::ConvertSecondsToMinute(int seconds) {
- const float seconds_in_minute = 60.0;
- return std::round(seconds / seconds_in_minute);
-}
-
-bool CacheManager::SetDefaultPolicy(const std::string& app_id) {
- CACHE_MANAGER_CHECK(false);
- policy_table::ApplicationPolicies::const_iterator iter =
- 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];
-
- 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_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) {
- CACHE_MANAGER_CHECK(false);
- policy_table::ApplicationPolicies::const_iterator iter =
- 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;
-}
-
-bool CacheManager::SetPredataPolicy(const std::string& app_id) {
- CACHE_MANAGER_CHECK(false);
- policy_table::ApplicationPolicies::const_iterator iter =
- pt_->policy_table.app_policies_section.apps.find(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;
- }
-
- pt_->policy_table.app_policies_section.apps[app_id] =
- pt_->policy_table.app_policies_section.apps[kPreDataConsentId];
-
- pt_->policy_table.app_policies_section.apps[app_id].set_to_string(
- kPreDataConsentId);
-
- Backup();
- return true;
-}
-
-bool CacheManager::IsPredataPolicy(const std::string& app_id) {
- // 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];
-
- 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));
-
- bool is_marked_as_predata =
- kPreDataConsentId ==
- pt_->policy_table.app_policies_section.apps[app_id].get_string();
-
- return !res.empty() && is_marked_as_predata;
-}
-
-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;
- }
-
- 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 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_section.apps.find(app_id);
- return pt_->policy_table.app_policies_section.apps.end() != iter;
-}
-
-bool CacheManager::Init(const std::string& file_name,
- const PolicySettings* settings) {
- LOG4CXX_AUTO_TRACE(logger_);
- settings_ = settings;
- InitResult init_result = backup_->Init(settings);
-
- bool result = true;
- switch (init_result) {
- case InitResult::EXISTS: {
- LOG4CXX_INFO(logger_, "Policy Table exists, was loaded correctly.");
- result = LoadFromBackup();
- if (result) {
- if (!backup_->IsDBVersionActual()) {
- LOG4CXX_INFO(logger_, "DB version is NOT actual");
- if (!backup_->RefreshDB()) {
- LOG4CXX_ERROR(logger_, "RefreshDB() failed");
- return false;
- }
- backup_->UpdateDBVersion();
- Backup();
- }
- MergePreloadPT(file_name);
- }
- } break;
- case InitResult::SUCCESS: {
- LOG4CXX_INFO(logger_, "Policy Table was inited successfully");
-
- result = LoadFromFile(file_name, *pt_);
-
- utils::SharedPtr<policy_table::Table> snapshot = GenerateSnapshot();
- result &= snapshot->is_valid();
- LOG4CXX_DEBUG(logger_,
- "Check if snapshot is valid: " << std::boolalpha << result);
- if (!result) {
- rpc::ValidationReport report("policy_table");
- snapshot->ReportErrors(&report);
- return result;
- }
-
- backup_->UpdateDBVersion();
- Backup();
- } break;
- default: {
- result = false;
- LOG4CXX_ERROR(logger_, "Failed to init policy table.");
- } break;
- }
-
- return result;
-}
-
-void CacheManager::FillDeviceSpecificData() {}
-
-bool CacheManager::LoadFromBackup() {
- sync_primitives::AutoLock lock(cache_lock_);
- pt_ = backup_->GenerateSnapshot();
- update_required = backup_->UpdateRequired();
-
- FillDeviceSpecificData();
-
- return true;
-}
-
-bool CacheManager::LoadFromFile(const std::string& file_name,
- policy_table::Table& table) {
- LOG4CXX_AUTO_TRACE(logger_);
- BinaryMessage json_string;
- 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());
- if (!reader.parse(json.c_str(), value)) {
- LOG4CXX_FATAL(
- logger_,
- "Preloaded PT is corrupted: " << reader.getFormattedErrorMessages());
- return false;
- }
-
- LOG4CXX_TRACE(logger_, "Start create PT");
- sync_primitives::AutoLock locker(cache_lock_);
-
- table = policy_table::Table(&value);
-
- Json::StyledWriter s_writer;
- LOG4CXX_DEBUG(logger_, "PT out:");
- LOG4CXX_DEBUG(logger_, s_writer.write(table.ToJsonValue()));
-
- if (!table.is_valid()) {
- rpc::ValidationReport report("policy_table");
- table.ReportErrors(&report);
- LOG4CXX_FATAL(logger_,
- "Parsed table is not valid " << rpc::PrettyFormat(report));
- return false;
- }
- return true;
-}
-
-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_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) {
- uint32_t hash = 5381U;
- std::string::const_iterator it = str_to_hash.begin();
- std::string::const_iterator it_end = str_to_hash.end();
-
- for (; it != it_end; ++it) {
- hash = ((hash << 5) + hash) + (*it);
- }
-
- // Reset sign bit in case it has been set.
- // This is needed to avoid overflow for signed int.
- const int32_t result = hash & 0x7FFFFFFF;
- 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;
-}
-
-std::string CacheManager::GetCertificate() const {
- CACHE_MANAGER_CHECK(std::string(""));
- if (pt_->policy_table.module_config.certificate.is_initialized()) {
- return *pt_->policy_table.module_config.certificate;
- }
- return std::string("");
-}
-
-void CacheManager::MergePreloadPT(const std::string& file_name) {
- LOG4CXX_AUTO_TRACE(logger_);
- policy_table::Table table;
- if (!LoadFromFile(file_name, table)) {
- LOG4CXX_DEBUG(logger_, "Unable to load preloaded PT.");
- return;
- }
-
- sync_primitives::AutoLock lock(cache_lock_);
- policy_table::PolicyTable& current = pt_->policy_table;
- policy_table::PolicyTable& new_table = table.policy_table;
- const std::string date_current = *current.module_config.preloaded_date;
- const std::string date_new = *new_table.module_config.preloaded_date;
- if (date_current != date_new) {
- MergeMC(new_table, current);
- MergeFG(new_table, current);
- MergeAP(new_table, current);
- MergeCFM(new_table, current);
- Backup();
- }
-}
-
-void CacheManager::MergeMC(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt) {
- LOG4CXX_AUTO_TRACE(logger_);
- policy_table::ModuleConfig copy(pt.module_config);
-
- pt.module_config = new_pt.module_config;
- pt.module_config.vehicle_make = copy.vehicle_make;
- pt.module_config.vehicle_year = copy.vehicle_year;
- pt.module_config.vehicle_model = copy.vehicle_model;
-}
-
-void CacheManager::MergeFG(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt) {
- LOG4CXX_AUTO_TRACE(logger_);
- policy_table::FunctionalGroupings::const_iterator it =
- new_pt.functional_groupings.begin();
-
- for (; it != new_pt.functional_groupings.end(); ++it) {
- LOG4CXX_DEBUG(logger_, "Merge functional group: " << it->first);
- pt.functional_groupings[it->first] = it->second;
- }
-}
-
-void CacheManager::MergeAP(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt) {
- LOG4CXX_AUTO_TRACE(logger_);
- pt.app_policies_section.device = const_cast<policy_table::PolicyTable&>(
- new_pt).app_policies_section.device;
-
- pt.app_policies_section.apps[kDefaultId] =
- const_cast<policy_table::PolicyTable&>(new_pt)
- .app_policies_section.apps[kDefaultId];
-
- pt.app_policies_section.apps[kPreDataConsentId] =
- const_cast<policy_table::PolicyTable&>(new_pt)
- .app_policies_section.apps[kPreDataConsentId];
-}
-
-void CacheManager::MergeCFM(const policy_table::PolicyTable& new_pt,
- policy_table::PolicyTable& pt) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (new_pt.consumer_friendly_messages.is_initialized()) {
- if (!pt.consumer_friendly_messages.is_initialized()) {
- pt.consumer_friendly_messages = new_pt.consumer_friendly_messages;
- } else {
- policy_table::Messages::const_iterator it =
- new_pt.consumer_friendly_messages->messages->begin();
-
- pt.consumer_friendly_messages->version =
- new_pt.consumer_friendly_messages->version;
- for (; it != new_pt.consumer_friendly_messages->messages->end(); ++it) {
- LOG4CXX_DEBUG(logger_, "Merge CFM: " << it->first);
- if (!(pt.consumer_friendly_messages->messages.is_initialized())) {
- LOG4CXX_DEBUG(logger_, "CFM not initialized.");
- }
- (*pt.consumer_friendly_messages->messages)[it->first] = it->second;
- }
- }
- }
-}
-
-const PolicySettings& CacheManager::get_settings() const {
- DCHECK(settings_);
-
- return *settings_;
-}
-
-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_helper.cc b/src/components/policy/src/policy_helper.cc
deleted file mode 100644
index b72a041a83..0000000000
--- a/src/components/policy/src/policy_helper.cc
+++ /dev/null
@@ -1,805 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <sstream>
-#include <string.h>
-#include "utils/logger.h"
-#include "utils/custom_string.h"
-#include "policy/policy_helper.h"
-#include "policy/policy_manager_impl.h"
-
-namespace policy {
-
-namespace custom_str = utils::custom_string;
-
-namespace {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
-
-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) {}
-
-bool CompareGroupName::operator()(
- const StringsValueType& group_name_to_compare) const {
- const std::string gn_ = group_name_;
- const std::string gn_compare = group_name_to_compare;
- return !(strcasecmp(gn_.c_str(), gn_compare.c_str()));
-}
-
-bool operator!=(const policy_table::ApplicationParams& first,
- const policy_table::ApplicationParams& second) {
- if (first.groups.size() != second.groups.size()) {
- return true;
- }
- StringsConstItr it_first = first.groups.begin();
- StringsConstItr it_first_end = first.groups.end();
- StringsConstItr it_second = second.groups.begin();
- StringsConstItr it_second_end = second.groups.end();
- for (; it_first != it_first_end; ++it_first) {
- CompareGroupName gp(*it_first);
- StringsConstItr it = std::find_if(it_second, it_second_end, gp);
- if (it_first_end == it) {
- return true;
- }
- }
- return false;
-}
-
-CheckAppPolicy::CheckAppPolicy(
- PolicyManagerImpl* pm,
- const utils::SharedPtr<policy_table::Table> update,
- const utils::SharedPtr<policy_table::Table> snapshot)
- : pm_(pm), update_(update), snapshot_(snapshot) {}
-
-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);
-
- 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);
-
- 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 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);
-
- if (new_groups) {
- *new_groups = new_group_list;
- }
-
- 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;
- }
-
- 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;
- }
- }
-
- return false;
-}
-
-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>();
- }
-
- 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 revoked_groups_permissions;
-}
-
-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_section.apps;
-
- return !(current_policies.end() == current_policies.find(application_id));
-}
-
-void policy::CheckAppPolicy::NotifySystem(
- const policy::AppPoliciesValueType& app_policy) const {
- pm_->listener()->OnPendingPermissionChange(app_policy.first);
-}
-
-void CheckAppPolicy::SendPermissionsToApp(
- const AppPoliciesValueType& app_policy) const {
- const std::string app_id = 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_id);
- return;
- }
- 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);
-
- 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);
-}
-
-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 AppPoliciesValueType& app_policy) const {
- const std::string& app_id = app_policy.first;
- const custom_str::CustomString app_name = pm_->listener()->GetAppName(app_id);
- if (!app_name.empty() && app_policy.second.nicknames &&
- !app_policy.second.nicknames->empty()) {
- for (policy_table::Strings::const_iterator it =
- app_policy.second.nicknames->begin();
- app_policy.second.nicknames->end() != it;
- ++it) {
- std::string temp = *it;
- if (app_name.CompareIgnoreCase(temp.c_str())) {
- return true;
- }
- }
- return false;
- }
- return true;
-}
-
-bool CheckAppPolicy::operator()(const AppPoliciesValueType& app_policy) {
- const std::string app_id = app_policy.first;
-
- if (!IsKnownAppication(app_id)) {
- LOG4CXX_WARN(logger_,
- "Application:" << app_id << " is not present in snapshot.");
- return true;
- }
-
- if (!IsPredefinedApp(app_policy) && IsAppRevoked(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_APP_REVOKED);
- NotifySystem(app_policy);
- return true;
- }
-
- if (!IsPredefinedApp(app_policy) && !NicknamesMatch(app_policy)) {
- SetPendingPermissions(app_policy, RESULT_NICKNAME_MISMATCH);
- NotifySystem(app_policy);
- return true;
- }
-
- 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;
- }
-
- LOG4CXX_INFO(logger_,
- "Permissions for application:" << app_id
- << " have been changed.");
-
- 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)) {
- SendPermissionsToApp(app_policy);
- }
- return true;
-}
-
-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;
- }
-
- 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,
- GroupConsent group_state,
- GroupConsent undefined_group_consent)
- : data_(data) {
- switch (group_state) {
- case kGroupAllowed:
- current_key_ = kAllowedKey;
- break;
- case kGroupUndefined:
- if (kGroupUndefined == undefined_group_consent) {
- current_key_ = kUndefinedKey;
- break;
- }
- current_key_ = kGroupAllowed == undefined_group_consent
- ? kAllowedKey
- : kUserDisallowedKey;
- break;
- default:
- current_key_ = kUserDisallowedKey;
- break;
- }
-}
-
-bool FillNotificationData::operator()(const RpcValueType& rpc) {
- Permissions::iterator it = data_.find(rpc.first);
- // If rpc is present already - update its permissions
- if (data_.end() != it) {
- UpdateHMILevels(rpc.second.hmi_levels,
- (*it).second.hmi_permissions[current_key_]);
- // TODO(IKozyrenko): Check logic if optional container is missing
- UpdateParameters(*rpc.second.parameters,
- (*it).second.parameter_permissions[current_key_]);
- ExcludeSame();
- } else {
- // Init mandatory keys, since they should be present irrespectively of
- // values presence
- InitRpcKeys(rpc.first);
- // If rpc is not present - add its permissions
- UpdateHMILevels(rpc.second.hmi_levels,
- data_[rpc.first].hmi_permissions[current_key_]);
- // TODO(IKozyrenko): Check logic if optional container is missing
- UpdateParameters(*rpc.second.parameters,
- data_[rpc.first].parameter_permissions[current_key_]);
- ExcludeSame();
- }
- return true;
-}
-
-void FillNotificationData::UpdateHMILevels(
- const policy_table::HmiLevels& in_hmi, std::set<HMILevel>& out_hmi) {
- HMILevelsConstItr it_hmi_levels = in_hmi.begin();
- HMILevelsConstItr it_hmi_levels_end = in_hmi.end();
-
- for (; it_hmi_levels != it_hmi_levels_end; ++it_hmi_levels) {
- out_hmi.insert(policy_table::EnumToJsonString(*it_hmi_levels));
- }
-}
-
-void FillNotificationData::UpdateParameters(
- const policy_table::Parameters& in_parameters,
- std::set<Parameter>& out_parameter) {
- ParametersConstItr it_parameters = in_parameters.begin();
- ParametersConstItr it_parameters_end = in_parameters.end();
-
- for (; it_parameters != it_parameters_end; ++it_parameters) {
- out_parameter.insert(policy_table::EnumToJsonString(*it_parameters));
- }
-}
-
-void FillNotificationData::ExcludeSame() {
- Permissions::iterator it = data_.begin();
- Permissions::const_iterator it_end = data_.end();
- // Groups
- for (; it != it_end; ++it) {
- HMIPermissions& rpc_hmi_permissions = (*it).second.hmi_permissions;
- HMIPermissions::const_iterator it_hmi_allowed =
- (*it).second.hmi_permissions.find(kAllowedKey);
- HMIPermissions::const_iterator it_hmi_undefined =
- (*it).second.hmi_permissions.find(kUndefinedKey);
- HMIPermissions::const_iterator it_hmi_user_disallowed =
- (*it).second.hmi_permissions.find(kUserDisallowedKey);
-
- ParameterPermissions& rpc_parameter_permissions =
- (*it).second.parameter_permissions;
- ParameterPermissions::const_iterator it_parameter_allowed =
- (*it).second.parameter_permissions.find(kAllowedKey);
- ParameterPermissions::const_iterator it_parameter_undefined =
- (*it).second.parameter_permissions.find(kUndefinedKey);
- ParameterPermissions::const_iterator it_parameter_user_disallowed =
- (*it).second.parameter_permissions.find(kUserDisallowedKey);
-
- // First, remove disallowed from other types
- if (rpc_hmi_permissions.end() != it_hmi_user_disallowed) {
- if (rpc_hmi_permissions.end() != it_hmi_allowed) {
- ExcludeSameHMILevels(rpc_hmi_permissions[kAllowedKey],
- rpc_hmi_permissions[kUserDisallowedKey]);
- }
- if (rpc_hmi_permissions.end() != it_hmi_undefined) {
- ExcludeSameHMILevels(rpc_hmi_permissions[kUndefinedKey],
- rpc_hmi_permissions[kUserDisallowedKey]);
- }
- }
-
- if (rpc_parameter_permissions.end() != it_parameter_user_disallowed) {
- if (rpc_parameter_permissions.end() != it_parameter_allowed) {
- ExcludeSameParameters(rpc_parameter_permissions[kAllowedKey],
- rpc_parameter_permissions[kUserDisallowedKey]);
- }
- if (rpc_parameter_permissions.end() != it_parameter_undefined) {
- ExcludeSameParameters(rpc_parameter_permissions[kUndefinedKey],
- rpc_parameter_permissions[kUserDisallowedKey]);
- }
- }
-
- // Then, remove undefined from allowed
- if (rpc_hmi_permissions.end() != it_hmi_undefined) {
- if (rpc_hmi_permissions.end() != it_hmi_allowed) {
- ExcludeSameHMILevels(rpc_hmi_permissions[kAllowedKey],
- rpc_hmi_permissions[kUndefinedKey]);
- }
- }
-
- if (rpc_parameter_permissions.end() != it_parameter_undefined) {
- if (rpc_parameter_permissions.end() != it_parameter_allowed) {
- ExcludeSameParameters(rpc_parameter_permissions[kAllowedKey],
- rpc_parameter_permissions[kUndefinedKey]);
- }
- }
- }
-}
-
-void FillNotificationData::ExcludeSameHMILevels(
- std::set<HMILevel>& source, const std::set<HMILevel>& target) {
- std::set<HMILevel> diff_hmi;
-
- std::set_difference(source.begin(),
- source.end(),
- target.begin(),
- target.end(),
- std::inserter(diff_hmi, diff_hmi.begin()));
-
- source = diff_hmi;
-}
-
-void FillNotificationData::ExcludeSameParameters(
- std::set<Parameter>& source, const std::set<Parameter>& target) {
- std::set<Parameter> diff_parameter;
-
- std::set_difference(source.begin(),
- source.end(),
- target.begin(),
- target.end(),
- std::inserter(diff_parameter, diff_parameter.begin()));
-
- source = diff_parameter;
-}
-
-void FillNotificationData::InitRpcKeys(const std::string& rpc_name) {
- data_[rpc_name].hmi_permissions[kAllowedKey];
- data_[rpc_name].hmi_permissions[kUserDisallowedKey];
- data_[rpc_name].parameter_permissions[kAllowedKey];
- data_[rpc_name].parameter_permissions[kUserDisallowedKey];
-}
-
-ProcessFunctionalGroup::ProcessFunctionalGroup(
- const policy_table::FunctionalGroupings& fg,
- const std::vector<FunctionalGroupPermission>& group_permissions,
- Permissions& data,
- GroupConsent undefined_group_consent)
- : fg_(fg)
- , group_permissions_(group_permissions)
- , data_(data)
- , undefined_group_consent_(undefined_group_consent) {}
-
-bool ProcessFunctionalGroup::operator()(const StringsValueType& group_name) {
- const std::string group_name_str = group_name;
- FuncGroupConstItr it = fg_.find(group_name_str);
-
- if (fg_.end() != it) {
- const policy_table::Rpc& rpcs = (*it).second.rpcs;
- FillNotificationData filler(
- data_, GetGroupState(group_name_str), undefined_group_consent_);
- std::for_each(rpcs.begin(), rpcs.end(), filler);
- }
- return true;
-}
-
-GroupConsent ProcessFunctionalGroup::GetGroupState(
- const std::string& group_name) {
- std::vector<FunctionalGroupPermission>::const_iterator it =
- group_permissions_.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_end =
- group_permissions_.end();
- for (; it != it_end; ++it) {
- if (group_name == (*it).group_name) {
- return (*it).state;
- }
- }
- return kGroupUndefined;
-}
-
-FunctionalGroupInserter::FunctionalGroupInserter(
- const policy_table::Strings& preconsented_groups, PermissionsList& list)
- : list_(list), preconsented_(preconsented_groups) {}
-
-void FunctionalGroupInserter::operator()(const StringsValueType& group_name) {
- CompareGroupName name(group_name);
- if (std::find_if(preconsented_.begin(), preconsented_.end(), name) ==
- preconsented_.end()) {
- list_.push_back(group_name);
- }
-}
-
-void FillFunctionalGroupPermissions(
- FunctionalGroupIDs& ids,
- FunctionalGroupNames& names,
- GroupConsent state,
- std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_INFO(logger_, "FillFunctionalGroupPermissions");
- FunctionalGroupIDs::const_iterator it = ids.begin();
- FunctionalGroupIDs::const_iterator it_end = ids.end();
- for (; it != it_end; ++it) {
- FunctionalGroupPermission current_group;
- current_group.group_id = *it;
- current_group.group_alias = names[*it].first;
- current_group.group_name = names[*it].second;
- current_group.state = state;
- permissions.push_back(current_group);
- }
-}
-
-bool IsPredefinedApp(const AppPoliciesValueType& app) {
- return app.first == kDefaultId || app.first == kPreDataConsentId ||
- app.first == kDeviceId;
-}
-
-FunctionalGroupIDs ExcludeSame(const FunctionalGroupIDs& from,
- const FunctionalGroupIDs& what) {
- LOG4CXX_INFO(logger_, "Exclude same groups");
- FunctionalGroupIDs from_copy(from);
- FunctionalGroupIDs what_copy(what);
-
- std::sort(from_copy.begin(), from_copy.end());
- std::sort(what_copy.begin(), what_copy.end());
-
- FunctionalGroupIDs no_same;
- std::set_difference(from_copy.begin(),
- from_copy.end(),
- what_copy.begin(),
- what_copy.end(),
- std::back_inserter(no_same));
-
- no_same.resize(std::distance(no_same.begin(),
- std::unique(no_same.begin(), no_same.end())));
-
- return no_same;
-}
-
-FunctionalGroupIDs Merge(const FunctionalGroupIDs& first,
- const FunctionalGroupIDs& second) {
- LOG4CXX_INFO(logger_, "Merge groups");
- FunctionalGroupIDs first_copy(first);
- FunctionalGroupIDs second_copy(second);
-
- std::sort(first_copy.begin(), first_copy.end());
- std::sort(second_copy.begin(), second_copy.end());
-
- FunctionalGroupIDs merged;
- std::set_union(first_copy.begin(),
- first_copy.end(),
- second_copy.begin(),
- second_copy.end(),
- std::back_inserter(merged));
-
- merged.resize(
- std::distance(merged.begin(), std::unique(merged.begin(), merged.end())));
-
- return merged;
-}
-
-FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
- const FunctionalGroupIDs& second) {
- LOG4CXX_INFO(logger_, "Find same groups");
- FunctionalGroupIDs first_copy(first);
- FunctionalGroupIDs second_copy(second);
-
- std::sort(first_copy.begin(), first_copy.end());
- std::sort(second_copy.begin(), second_copy.end());
-
- FunctionalGroupIDs same;
- std::set_intersection(first_copy.begin(),
- first_copy.end(),
- second_copy.begin(),
- second_copy.end(),
- std::back_inserter(same));
-
- same.resize(
- std::distance(same.begin(), std::unique(same.begin(), same.end())));
-
- return same;
-}
-
-bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) {
- policy_table::ApplicationPolicies::iterator it = app_policies.begin();
- policy_table::ApplicationPolicies::iterator it_default =
- app_policies.find(kDefaultId);
- for (; app_policies.end() != it; ++it) {
- // Set default policies for app, if there is record like "123":"default"
- if (kDefaultId.compare((*it).second.get_string()) == 0) {
- if (it != app_policies.end()) {
- (*it).second = (*it_default).second;
- it->second.set_to_string(kDefaultId);
- } else {
- LOG4CXX_ERROR(logger_,
- "There is no default application policy was "
- "found in PTU.");
- return false;
- }
- }
- }
-
- return true;
-}
-}
diff --git a/src/components/policy/src/policy_manager_impl.cc b/src/components/policy/src/policy_manager_impl.cc
deleted file mode 100644
index fed1a51af1..0000000000
--- a/src/components/policy/src/policy_manager_impl.cc
+++ /dev/null
@@ -1,1014 +0,0 @@
-/*
- Copyright (c) 2016, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include "policy/policy_manager_impl.h"
-
-#include <algorithm>
-#include <set>
-#include <queue>
-#include <iterator>
-#include <limits>
-#include "json/reader.h"
-#include "json/writer.h"
-#include "policy/policy_table.h"
-#include "policy/pt_representation.h"
-#include "policy/policy_helper.h"
-#include "utils/file_system.h"
-#include "utils/logger.h"
-#include "utils/date_time.h"
-#include "utils/make_shared.h"
-#include "policy/cache_manager.h"
-#include "policy/update_status_manager.h"
-#include "config_profile/profile.h"
-#include "utils/timer_task_impl.h"
-
-policy::PolicyManager* CreateManager() {
- return new policy::PolicyManagerImpl();
-}
-void DeleteManager(policy::PolicyManager* pm) {
- delete pm;
-}
-
-namespace {
-const uint32_t kDefaultRetryTimeoutInSec = 60u;
-} // namespace
-
-namespace policy {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
-
-PolicyManagerImpl::PolicyManagerImpl()
- : PolicyManager()
- , listener_(NULL)
- , cache_(new CacheManager)
- , retry_sequence_timeout_(kDefaultRetryTimeoutInSec)
- , retry_sequence_index_(0)
- , timer_retry_sequence_("Retry sequence timer",
- new timer::TimerTaskImpl<PolicyManagerImpl>(
- this, &PolicyManagerImpl::RetrySequence))
- , ignition_check(true) {}
-
-void PolicyManagerImpl::set_listener(PolicyListener* listener) {
- listener_ = listener;
- update_status_manager_.set_listener(listener);
-}
-
-#ifdef USE_HMI_PTU_DECRYPTION
-
-utils::SharedPtr<policy_table::Table> PolicyManagerImpl::Parse(
- const BinaryMessage& pt_content) {
- std::string json(pt_content.begin(), pt_content.end());
- Json::Value value;
- Json::Reader reader;
- if (reader.parse(json.c_str(), value)) {
- return new policy_table::Table(&value);
- } 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"];
- 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_days
- << "\nIgnition cycles exceeded: " << std::boolalpha
- << exceed_ignition_cycles);
-
- if (exceed_ignition_cycles || exceed_days) {
- update_status_manager_.ScheduleUpdate();
- }
-}
-
-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();
- return false;
- }
-
- file_system::DeleteFile(file);
-
- if (!IsPTValid(pt_update, policy_table::PT_UPDATE)) {
- update_status_manager_.OnWrongUpdateReceived();
- return false;
- }
-
- update_status_manager_.OnValidUpdateReceived();
- cache_->SaveUpdateRequired(false);
-
- // Update finished, no need retry
- if (timer_retry_sequence_.is_running()) {
- LOG4CXX_INFO(logger_, "Stop retry sequence");
- timer_retry_sequence_.Stop();
- }
-
- {
- sync_primitives::AutoLock lock(apps_registration_lock_);
-
- // Get current DB data, since it could be updated during awaiting of PTU
- utils::SharedPtr<policy_table::Table> policy_table_snapshot =
- cache_->GenerateSnapshot();
- if (!policy_table_snapshot) {
- LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table");
- return false;
- }
-
- // 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;
- }
-
- if (pt_update->policy_table.module_config.certificate.is_initialized()) {
- listener_->OnCertificateUpdated(
- *(pt_update->policy_table.module_config.certificate));
- }
-
- 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_, "app_hmi_types empty" << pt_content.size());
- }
- }
-
- // 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;
-}
-
-void PolicyManagerImpl::CheckPermissionsChanges(
- const utils::SharedPtr<policy_table::Table> pt_update,
- const utils::SharedPtr<policy_table::Table> snapshot) {
- LOG4CXX_INFO(logger_, "Checking incoming permissions.");
-
- // 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));
-}
-
-void PolicyManagerImpl::PrepareNotificationData(
- const policy_table::FunctionalGroupings& groups,
- const policy_table::Strings& group_names,
- const std::vector<FunctionalGroupPermission>& group_permission,
- Permissions& notification_data) {
- LOG4CXX_INFO(logger_, "Preparing data for notification.");
- ProcessFunctionalGroup processor(groups, group_permission, notification_data);
- std::for_each(group_names.begin(), group_names.end(), processor);
-}
-
-void PolicyManagerImpl::GetServiceUrls(const std::string& service_type,
- EndpointUrls& end_points) {
- LOG4CXX_AUTO_TRACE(logger_);
- cache_->GetServiceUrls(service_type, end_points);
-}
-
-bool 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 false;
- }
-
- IsPTValid(policy_table_snapshot, policy_table::PT_SNAPSHOT);
-
- Json::Value value = policy_table_snapshot->ToJsonValue();
- Json::FastWriter writer;
- std::string message_string = writer.write(value);
-
- LOG4CXX_DEBUG(logger_, "Snapshot contents is : " << message_string);
-
- BinaryMessage update(message_string.begin(), message_string.end());
-
- listener_->OnSnapshotCreated(update);
-
- // 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();
-
- return true;
-}
-
-std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
- return cache_->GetLockScreenIconUrl();
-}
-
-void PolicyManagerImpl::StartPTExchange() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const bool update_required = update_status_manager_.IsUpdateRequired();
-
- if (update_status_manager_.IsAppsSearchInProgress() && update_required) {
- update_status_manager_.ScheduleUpdate();
- LOG4CXX_INFO(logger_,
- "Starting exchange skipped, since applications "
- "search is in progress.");
- return;
- }
-
- if (update_status_manager_.IsUpdatePending() && update_required) {
- update_status_manager_.ScheduleUpdate();
- LOG4CXX_INFO(logger_,
- "Starting exchange skipped, since another exchange "
- "is in progress.");
- return;
- }
-
- if (listener_ && listener_->CanUpdate()) {
- if (ignition_check) {
- CheckTriggers();
- ignition_check = false;
- }
-
- if (update_status_manager_.IsUpdateRequired()) {
- if (RequestPTUpdate() && !timer_retry_sequence_.is_running()) {
- // Start retry sequency
- timer_retry_sequence_.Start(NextRetryTimeout(), timer::kPeriodic);
- }
- }
- }
-}
-
-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();
- }
-}
-
-void PolicyManagerImpl::OnAppRegisteredOnMobile(
- const std::string& application_id) {
- StartPTExchange();
- SendNotificationOnPermissionsUpdated(application_id);
-}
-
-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;
-}
-
-const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const {
- return cache_->GetVehicleInfo();
-}
-
-void PolicyManagerImpl::CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result) {
- LOG4CXX_INFO(logger_,
- "CheckPermissions for " << app_id << " and rpc " << rpc
- << " for " << hmi_level << " level.");
-
- cache_->CheckPermissions(app_id, hmi_level, rpc, result);
-}
-
-bool PolicyManagerImpl::ResetUserConsent() {
- bool result = true;
-
- return result;
-}
-
-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 "
- "'" << application_id << "'");
- return;
- }
-
- std::vector<FunctionalGroupPermission> app_group_permissions;
- GetPermissionsForApp(device_id, application_id, app_group_permissions);
-
- policy_table::FunctionalGroupings functional_groupings;
- cache_->GetFunctionalGroupings(functional_groupings);
-
- policy_table::Strings app_groups;
- std::vector<FunctionalGroupPermission>::const_iterator it =
- app_group_permissions.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_end =
- app_group_permissions.end();
- for (; it != it_end; ++it) {
- app_groups.push_back((*it).group_name);
- }
-
- Permissions notification_data;
- PrepareNotificationData(functional_groupings,
- app_groups,
- app_group_permissions,
- 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_AUTO_TRACE(logger_);
- // For SDL-specific it doesn't matter
- return true;
-}
-
-DeviceConsent PolicyManagerImpl::GetUserConsentForDevice(
- const std::string& device_id) const {
- LOG4CXX_AUTO_TRACE(logger_);
- return kDeviceAllowed;
-}
-
-void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id,
- bool is_allowed) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Device :" << device_id);
- DeviceConsent current_consent = GetUserConsentForDevice(device_id);
- bool is_current_device_allowed =
- DeviceConsent::kDeviceAllowed == current_consent ? true : false;
- if (DeviceConsent::kDeviceHasNoConsent != current_consent &&
- is_current_device_allowed == is_allowed) {
- const std::string consent = is_allowed ? "allowed" : "disallowed";
- LOG4CXX_INFO(logger_, "Device is already " << consent << ".");
- return;
- }
-}
-
-bool PolicyManagerImpl::ReactOnUserDevConsentForApp(const std::string app_id,
- bool is_device_allowed) {
- return true;
-}
-
-bool PolicyManagerImpl::GetInitialAppData(const std::string& application_id,
- StringArray* nicknames,
- StringArray* app_hmi_types) {
- LOG4CXX_AUTO_TRACE(logger_);
- const bool result = nicknames && app_hmi_types;
- if (result) {
- cache_->GetInitialAppData(application_id, *nicknames, *app_hmi_types);
- }
- return result;
-}
-
-void PolicyManagerImpl::AddDevice(const std::string& device_id,
- const std::string& connection_type) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Device: " << device_id);
- if (!cache_->AddDevice(device_id, connection_type)) {
- LOG4CXX_WARN(logger_, "Can't add device.");
- }
-}
-
-void PolicyManagerImpl::SetDeviceInfo(const std::string& device_id,
- const DeviceInfo& device_info) {
- LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "Device :" << device_id);
-}
-
-PermissionConsent PolicyManagerImpl::EnsureCorrectPermissionConsent(
- const PermissionConsent& permissions_to_check) {
- std::vector<FunctionalGroupPermission> current_user_consents;
- GetUserConsentForApp(permissions_to_check.device_id,
- permissions_to_check.policy_app_id,
- current_user_consents);
-
- PermissionConsent permissions_to_set;
- permissions_to_set.device_id = permissions_to_check.device_id;
- permissions_to_set.policy_app_id = permissions_to_check.policy_app_id;
- permissions_to_set.consent_source = permissions_to_check.consent_source;
-
- std::vector<FunctionalGroupPermission>::const_iterator it =
- permissions_to_check.group_permissions.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_end =
- permissions_to_check.group_permissions.end();
-
- for (; it != it_end; ++it) {
- std::vector<FunctionalGroupPermission>::const_iterator it_curr =
- current_user_consents.begin();
- std::vector<FunctionalGroupPermission>::const_iterator it_curr_end =
- current_user_consents.end();
-
- for (; it_curr != it_curr_end; ++it_curr) {
- if (it->group_alias == it_curr->group_alias &&
- it->group_id == it_curr->group_id) {
- permissions_to_set.group_permissions.push_back(*it);
- }
- }
- }
-
- return permissions_to_set;
-}
-
-void PolicyManagerImpl::CheckPendingPermissionsChanges(
- const std::string& policy_app_id,
- const std::vector<FunctionalGroupPermission>& current_permissions) {
- LOG4CXX_AUTO_TRACE(logger_);
- 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_AUTO_TRACE(logger_);
-}
-
-bool PolicyManagerImpl::GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi) const {
- LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(policy_app_id);
- DeviceConsent device_consent = GetUserConsentForDevice(device_id);
- const std::string app_id = policy::kDeviceAllowed != device_consent
- ? kPreDataConsentId
- : policy_app_id;
- return cache_->GetDefaultHMI(app_id, *default_hmi);
-}
-
-bool PolicyManagerImpl::GetPriority(const std::string& policy_app_id,
- std::string* priority) const {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!priority) {
- LOG4CXX_WARN(logger_, "Input priority parameter is null.");
- return false;
- }
-
- return cache_->GetPriority(policy_app_id, *priority);
-}
-
-std::vector<UserFriendlyMessage> PolicyManagerImpl::GetUserFriendlyMessages(
- const std::vector<std::string>& message_code, const std::string& language) {
- return cache_->GetUserFriendlyMsg(message_code, language);
-}
-
-void PolicyManagerImpl::GetUserConsentForApp(
- const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- FunctionalIdType group_types;
- if (!cache_->GetPermissionsForApp(device_id, policy_app_id, group_types)) {
- LOG4CXX_WARN(logger_,
- "Can't get user permissions for app " << policy_app_id);
- return;
- }
-
- // Functional groups w/o alias ("user_consent_prompt") considered as
- // automatically allowed and it could not be changed by user
- FunctionalGroupNames group_names;
- if (!cache_->GetFunctionalGroupNames(group_names)) {
- LOG4CXX_WARN(logger_, "Can't get functional group names");
- return;
- }
-
- FunctionalGroupNames::const_iterator it = group_names.begin();
- FunctionalGroupNames::const_iterator it_end = group_names.end();
- FunctionalGroupIDs auto_allowed_groups;
- for (; it != it_end; ++it) {
- if (it->second.first.empty()) {
- auto_allowed_groups.push_back(it->first);
- }
- }
-
- // For basic policy
- FunctionalGroupIDs all_groups = group_types[kTypeGeneral];
- FunctionalGroupIDs default_groups = group_types[kTypeDefault];
- FunctionalGroupIDs predataconsented_groups =
- group_types[kTypePreDataConsented];
-
- FunctionalGroupIDs allowed_groups;
- FunctionalGroupIDs no_auto = ExcludeSame(all_groups, auto_allowed_groups);
-
- if (cache_->IsDefaultPolicy(policy_app_id)) {
- allowed_groups = ExcludeSame(no_auto, default_groups);
- } else if (cache_->IsPredataPolicy(policy_app_id)) {
- allowed_groups = ExcludeSame(no_auto, predataconsented_groups);
- }
- FillFunctionalGroupPermissions(
- allowed_groups, group_names, kGroupAllowed, permissions);
-}
-
-void PolicyManagerImpl::GetPermissionsForApp(
- const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions) {
- LOG4CXX_AUTO_TRACE(logger_);
- std::string app_id_to_check = policy_app_id;
-
- bool allowed_by_default = false;
- if (cache_->IsDefaultPolicy(policy_app_id)) {
- app_id_to_check = kDefaultId;
- allowed_by_default = true;
- } else if (cache_->IsPredataPolicy(policy_app_id) ||
- policy::kDeviceDisallowed == GetUserConsentForDevice(device_id)) {
- app_id_to_check = kPreDataConsentId;
- allowed_by_default = true;
- }
-
- FunctionalIdType group_types;
- if (!cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types)) {
- LOG4CXX_WARN(logger_,
- "Can't get user permissions for app " << policy_app_id);
- return;
- }
-
- // Functional groups w/o alias ("user_consent_prompt") considered as
- // automatically allowed and it could not be changed by user
- FunctionalGroupNames group_names;
- if (!cache_->GetFunctionalGroupNames(group_names)) {
- LOG4CXX_WARN(logger_, "Can't get functional group names");
- return;
- }
-
- // 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 allowed groups");
- GroupType type =
- (kDefaultId == app_id_to_check ? kTypeDefault : kTypePreDataConsented);
-
- FillFunctionalGroupPermissions(
- group_types[type], group_names, kGroupAllowed, permissions);
- } else {
- // The code bellow allows to process application which
- // has specific permissions(not default and pre_DataConsent).
-
- // All groups for specific application
- FunctionalGroupIDs all_groups = group_types[kTypeGeneral];
-
- // In case of GENIVI all groups are allowed
- FunctionalGroupIDs common_allowed = all_groups;
- FillFunctionalGroupPermissions(
- common_allowed, group_names, kGroupAllowed, permissions);
- }
- return;
-}
-
-std::string& PolicyManagerImpl::GetCurrentDeviceId(
- const std::string& policy_app_id) const {
- LOG4CXX_INFO(logger_, "GetDeviceInfo");
- last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id);
- return last_device_id_;
-}
-
-void PolicyManagerImpl::SetSystemLanguage(const std::string& language) {}
-
-void PolicyManagerImpl::SetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language) {
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-void PolicyManagerImpl::OnSystemReady() {
- // Update policy table for the first time with system information
- if (cache_->IsPTPreloaded()) {
- listener()->OnSystemInfoUpdateRequired();
- return;
- }
-}
-
-uint32_t PolicyManagerImpl::GetNotificationsNumber(
- const std::string& priority) const {
- LOG4CXX_AUTO_TRACE(logger_);
- return cache_->GetNotificationsNumber(priority);
-}
-
-bool PolicyManagerImpl::ExceededIgnitionCycles() {
- return 0 == cache_->IgnitionCyclesBeforeExchange();
-}
-
-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;
-}
-
-const PolicySettings& PolicyManagerImpl::get_settings() const {
- DCHECK(settings_);
- return *settings_;
-}
-
-bool PolicyManagerImpl::ExceededDays() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- const int kSecondsInDay = 60 * 60 * 24;
- const int days = current_time.tv_sec / kSecondsInDay;
-
- return 0 == cache_->DaysBeforeExchange(days);
-}
-
-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.");
- update_status_manager_.ScheduleUpdate();
- StartPTExchange();
- }
-}
-
-void PolicyManagerImpl::IncrementIgnitionCycles() {
- cache_->IncrementIgnitionCycles();
-}
-
-std::string PolicyManagerImpl::ForcePTExchange() {
- update_status_manager_.ScheduleUpdate();
- StartPTExchange();
- return update_status_manager_.StringifiedUpdateStatus();
-}
-
-std::string PolicyManagerImpl::GetPolicyTableStatus() const {
- return update_status_manager_.StringifiedUpdateStatus();
-}
-
-uint32_t PolicyManagerImpl::NextRetryTimeout() {
- sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
- LOG4CXX_DEBUG(logger_, "Index: " << retry_sequence_index_);
- uint32_t next = 0u;
- if (retry_sequence_seconds_.empty() ||
- retry_sequence_index_ >= retry_sequence_seconds_.size()) {
- return next;
- }
-
- ++retry_sequence_index_;
-
- for (uint32_t i = 0u; i < retry_sequence_index_; ++i) {
- next += retry_sequence_seconds_[i];
- // According to requirement APPLINK-18244
- next += retry_sequence_timeout_;
- }
-
- // Return miliseconds
- return next * date_time::DateTime::MILLISECONDS_IN_SECOND;
-}
-
-void PolicyManagerImpl::RefreshRetrySequence() {
- sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
- retry_sequence_timeout_ = cache_->TimeoutResponse();
- retry_sequence_seconds_.clear();
- cache_->SecondsBetweenRetries(retry_sequence_seconds_);
-}
-
-void PolicyManagerImpl::ResetRetrySequence() {
- sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
- retry_sequence_index_ = 0;
- update_status_manager_.OnResetRetrySequence();
-}
-
-int PolicyManagerImpl::TimeoutExchange() {
- return retry_sequence_timeout_;
-}
-
-const std::vector<int> PolicyManagerImpl::RetrySequenceDelaysSeconds() {
- sync_primitives::AutoLock auto_lock(retry_sequence_lock_);
- return retry_sequence_seconds_;
-}
-
-void PolicyManagerImpl::OnExceededTimeout() {
- update_status_manager_.OnUpdateTimeoutOccurs();
-}
-
-void PolicyManagerImpl::OnUpdateStarted() {
- int update_timeout = TimeoutExchange();
- LOG4CXX_DEBUG(logger_,
- "Update timeout will be set to (sec): " << update_timeout);
- update_status_manager_.OnUpdateSentOut(update_timeout);
- cache_->SaveUpdateRequired(true);
-}
-
-void PolicyManagerImpl::PTUpdatedAt(Counters counter, int value) {
- LOG4CXX_AUTO_TRACE(logger_);
- cache_->SetCountersPassedForSuccessfulUpdate(counter, value);
- cache_->ResetIgnitionCycles();
-}
-
-void PolicyManagerImpl::Increment(usage_statistics::GlobalCounterId type) {
- LOG4CXX_INFO(logger_, "Increment without app id");
- cache_->Increment(type);
-}
-
-void PolicyManagerImpl::Increment(const std::string& app_id,
- usage_statistics::AppCounterId type) {
- LOG4CXX_DEBUG(logger_, "Increment " << app_id << " AppCounter: " << type);
- cache_->Increment(app_id, type);
-}
-
-void PolicyManagerImpl::Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value) {
- LOG4CXX_INFO(logger_, "Set " << app_id);
- cache_->Set(app_id, type, value);
-}
-
-void PolicyManagerImpl::Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds) {
- LOG4CXX_INFO(logger_, "Add " << app_id);
- cache_->Add(app_id, type, timespan_seconds);
-}
-
-bool PolicyManagerImpl::IsApplicationRevoked(const std::string& app_id) const {
- return cache_->IsApplicationRevoked(app_id);
-}
-
-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& 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) {
- permissions = app_id_diff->second;
- } else {
- permissions.appPermissionsConsentNeeded = IsConsentNeeded(policy_app_id);
- permissions.appRevoked = IsApplicationRevoked(policy_app_id);
- GetPriority(permissions.application_id, &permissions.priority);
- }
- return permissions;
-}
-
-void PolicyManagerImpl::RemovePendingPermissionChanges(
- const std::string& app_id) {
- app_permissions_diff_.erase(app_id);
-}
-
-bool PolicyManagerImpl::CanAppKeepContext(const std::string& app_id) const {
- return cache_->CanAppKeepContext(app_id);
-}
-
-bool PolicyManagerImpl::CanAppStealFocus(const std::string& app_id) const {
- return cache_->CanAppStealFocus(app_id);
-}
-
-void PolicyManagerImpl::MarkUnpairedDevice(const std::string& device_id) {}
-
-std::string PolicyManagerImpl::RetrieveCertificate() const {
- LOG4CXX_AUTO_TRACE(logger_);
- return cache_->GetCertificate();
-}
-
-void PolicyManagerImpl::AddApplication(const std::string& application_id) {
- LOG4CXX_AUTO_TRACE(logger_);
- const std::string device_id = GetCurrentDeviceId(application_id);
- DeviceConsent device_consent = GetUserConsentForDevice(device_id);
- sync_primitives::AutoLock lock(apps_registration_lock_);
-
- if (IsNewApplication(application_id)) {
- AddNewApplication(application_id, device_consent);
- update_status_manager_.OnNewApplicationAdded();
- } else {
- PromoteExistedApplication(application_id, device_consent);
- }
-}
-
-void PolicyManagerImpl::RemoveAppConsentForGroup(
- const std::string& app_id, const std::string& group_name) {
- cache_->RemoveAppConsentForGroup(app_id, group_name);
-}
-
-bool PolicyManagerImpl::IsPredataPolicy(const std::string& policy_app_id) {
- LOG4CXX_INFO(logger_, "IsPredataApp");
- return cache_->IsPredataPolicy(policy_app_id);
-}
-
-void PolicyManagerImpl::AddNewApplication(const std::string& application_id,
- DeviceConsent device_consent) {
- LOG4CXX_AUTO_TRACE(logger_);
-
- cache_->SetDefaultPolicy(application_id);
-}
-
-void PolicyManagerImpl::PromoteExistedApplication(
- const std::string& application_id, DeviceConsent 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)) {
- cache_->SetDefaultPolicy(application_id);
- }
-}
-
-bool PolicyManagerImpl::IsNewApplication(
- const std::string& application_id) const {
- return false == cache_->IsApplicationRepresented(application_id);
-}
-
-bool PolicyManagerImpl::ResetPT(const std::string& file_name) {
- cache_->ResetCalculatedPermissions();
- const bool result = cache_->ResetPT(file_name);
- if (result) {
- RefreshRetrySequence();
- }
- return result;
-}
-
-bool PolicyManagerImpl::CheckAppStorageFolder() const {
- LOG4CXX_AUTO_TRACE(logger_);
- const std::string app_storage_folder = get_settings().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,
- const PolicySettings* settings) {
- LOG4CXX_AUTO_TRACE(logger_);
- settings_ = settings;
- if (!CheckAppStorageFolder()) {
- LOG4CXX_ERROR(logger_, "Can not read/write into AppStorageFolder");
- return false;
- }
- const bool ret = cache_->Init(file_name, settings);
- if (ret) {
- RefreshRetrySequence();
- update_status_manager_.OnPolicyInit(cache_->UpdateRequired());
- }
- return ret;
-}
-
-uint32_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::RetrySequence() {
- LOG4CXX_INFO(logger_, "Start new retry sequence");
- RequestPTUpdate();
-
- uint32_t timeout = NextRetryTimeout();
-
- if (!timeout && timer_retry_sequence_.is_running()) {
- timer_retry_sequence_.Stop();
- return;
- }
-
- timer_retry_sequence_.Start(timeout, timer::kPeriodic);
-}
-
-} // namespace policy
diff --git a/src/components/policy/src/policy_table/enums.cc b/src/components/policy/src/policy_table/enums.cc
deleted file mode 100644
index 26c7b96b32..0000000000
--- a/src/components/policy/src/policy_table/enums.cc
+++ /dev/null
@@ -1,577 +0,0 @@
-// This file is generated, do not edit
-#include "policy/policy_table/enums.h"
-
-namespace rpc {
-namespace policy_table_interface_base {
-bool IsValidEnum(Priority val) {
- switch (val) {
- case P_EMERGENCY:
- return true;
- case P_NAVIGATION:
- return true;
- case P_VOICECOM:
- return true;
- case P_COMMUNICATION:
- return true;
- case P_NORMAL:
- return true;
- case P_NONE:
- return true;
- default:
- return false;
- }
-}
-const char* EnumToJsonString(Priority val) {
- switch (val) {
- case P_EMERGENCY:
- return "EMERGENCY";
- case P_NAVIGATION:
- return "NAVIGATION";
- case P_VOICECOM:
- return "VOICECOM";
- case P_COMMUNICATION:
- return "COMMUNICATION";
- case P_NORMAL:
- return "NORMAL";
- case P_NONE:
- return "NONE";
- default:
- return "";
- }
-}
-bool EnumFromJsonString(const std::string& literal, Priority* result) {
- if ("EMERGENCY" == literal) {
- *result = P_EMERGENCY;
- return true;
- } else if ("NAVIGATION" == literal) {
- *result = P_NAVIGATION;
- return true;
- } else if ("VOICECOM" == literal) {
- *result = P_VOICECOM;
- return true;
- } else if ("COMMUNICATION" == literal) {
- *result = P_COMMUNICATION;
- return true;
- } else if ("NORMAL" == literal) {
- *result = P_NORMAL;
- return true;
- } else if ("NONE" == literal) {
- *result = P_NONE;
- return true;
- } else {
- return false;
- }
-}
-
-bool IsValidEnum(HmiLevel val) {
- switch (val) {
- case HL_BACKGROUND:
- return true;
- case HL_FULL:
- return true;
- case HL_LIMITED:
- return true;
- case HL_NONE:
- return true;
- default:
- return false;
- }
-}
-const char* EnumToJsonString(HmiLevel val) {
- switch (val) {
- case HL_BACKGROUND:
- return "BACKGROUND";
- case HL_FULL:
- return "FULL";
- case HL_LIMITED:
- return "LIMITED";
- case HL_NONE:
- return "NONE";
- default:
- return "";
- }
-}
-bool EnumFromJsonString(const std::string& literal, HmiLevel* result) {
- if ("BACKGROUND" == literal) {
- *result = HL_BACKGROUND;
- return true;
- } else if ("FULL" == literal) {
- *result = HL_FULL;
- return true;
- } else if ("LIMITED" == literal) {
- *result = HL_LIMITED;
- return true;
- } else if ("NONE" == literal) {
- *result = HL_NONE;
- return true;
- } else {
- return false;
- }
-}
-
-bool IsValidEnum(Parameter val) {
- switch (val) {
- case P_GPS:
- return true;
- case P_SPEED:
- return true;
- case P_ENGINETORQUE:
- return true;
- case P_EXTERNALTEMPERATURE:
- return true;
- case P_FUELLEVEL:
- return true;
- case P_FUELLEVEL_STATE:
- return true;
- case P_HEADLAMPSTATUS:
- return true;
- case P_INSTANTFUELCONSUMPTION:
- return true;
- case P_ODOMETER:
- return true;
- case P_TIREPRESSURE:
- return true;
- case P_WIPERSTATUS:
- return true;
- case P_VIN:
- return true;
- case P_ACCPEDALPOSITION:
- return true;
- case P_BELTSTATUS:
- return true;
- case P_DRIVERBRAKING:
- return true;
- case P_PRNDL:
- return true;
- case P_RPM:
- return true;
- case P_STEERINGWHEELANGLE:
- return true;
- case P_MYKEY:
- return true;
- case P_AIRBAGSTATUS:
- return true;
- case P_BODYINFORMATION:
- return true;
- case P_CLUSTERMODESTATUS:
- return true;
- case P_DEVICESTATUS:
- return true;
- case P_EMERGENCYEVENT:
- return true;
- case P_ECALLINFO:
- return true;
- default:
- return false;
- }
-}
-const char* EnumToJsonString(Parameter val) {
- switch (val) {
- case P_GPS:
- return "gps";
- case P_SPEED:
- return "speed";
- case P_ENGINETORQUE:
- return "engineTorque";
- case P_EXTERNALTEMPERATURE:
- return "externalTemperature";
- case P_FUELLEVEL:
- return "fuelLevel";
- case P_FUELLEVEL_STATE:
- return "fuelLevel_State";
- case P_HEADLAMPSTATUS:
- return "headLampStatus";
- case P_INSTANTFUELCONSUMPTION:
- return "instantFuelConsumption";
- case P_ODOMETER:
- return "odometer";
- case P_TIREPRESSURE:
- return "tirePressure";
- case P_WIPERSTATUS:
- return "wiperStatus";
- case P_VIN:
- return "vin";
- case P_ACCPEDALPOSITION:
- return "accPedalPosition";
- case P_BELTSTATUS:
- return "beltStatus";
- case P_DRIVERBRAKING:
- return "driverBraking";
- case P_PRNDL:
- return "prndl";
- case P_RPM:
- return "rpm";
- case P_STEERINGWHEELANGLE:
- return "steeringWheelAngle";
- case P_MYKEY:
- return "myKey";
- case P_AIRBAGSTATUS:
- return "airbagStatus";
- case P_BODYINFORMATION:
- return "bodyInformation";
- case P_CLUSTERMODESTATUS:
- return "clusterModeStatus";
- case P_DEVICESTATUS:
- return "deviceStatus";
- case P_EMERGENCYEVENT:
- return "emergencyEvent";
- case P_ECALLINFO:
- return "eCallInfo";
- default:
- return "";
- }
-}
-bool EnumFromJsonString(const std::string& literal, Parameter* result) {
- if ("gps" == literal) {
- *result = P_GPS;
- return true;
- } else if ("speed" == literal) {
- *result = P_SPEED;
- return true;
- } else if ("engineTorque" == literal) {
- *result = P_ENGINETORQUE;
- return true;
- } else if ("externalTemperature" == literal) {
- *result = P_EXTERNALTEMPERATURE;
- return true;
- } else if ("fuelLevel" == literal) {
- *result = P_FUELLEVEL;
- return true;
- } else if ("fuelLevel_State" == literal) {
- *result = P_FUELLEVEL_STATE;
- return true;
- } else if ("headLampStatus" == literal) {
- *result = P_HEADLAMPSTATUS;
- return true;
- } else if ("instantFuelConsumption" == literal) {
- *result = P_INSTANTFUELCONSUMPTION;
- return true;
- } else if ("odometer" == literal) {
- *result = P_ODOMETER;
- return true;
- } else if ("tirePressure" == literal) {
- *result = P_TIREPRESSURE;
- return true;
- } else if ("wiperStatus" == literal) {
- *result = P_WIPERSTATUS;
- return true;
- } else if ("vin" == literal) {
- *result = P_VIN;
- return true;
- } else if ("accPedalPosition" == literal) {
- *result = P_ACCPEDALPOSITION;
- return true;
- } else if ("beltStatus" == literal) {
- *result = P_BELTSTATUS;
- return true;
- } else if ("driverBraking" == literal) {
- *result = P_DRIVERBRAKING;
- return true;
- } else if ("prndl" == literal) {
- *result = P_PRNDL;
- return true;
- } else if ("rpm" == literal) {
- *result = P_RPM;
- return true;
- } else if ("steeringWheelAngle" == literal) {
- *result = P_STEERINGWHEELANGLE;
- return true;
- } else if ("myKey" == literal) {
- *result = P_MYKEY;
- return true;
- } else if ("airbagStatus" == literal) {
- *result = P_AIRBAGSTATUS;
- return true;
- } else if ("bodyInformation" == literal) {
- *result = P_BODYINFORMATION;
- return true;
- } else if ("clusterModeStatus" == literal) {
- *result = P_CLUSTERMODESTATUS;
- return true;
- } else if ("deviceStatus" == literal) {
- *result = P_DEVICESTATUS;
- return true;
- } else if ("emergencyEvent" == literal) {
- *result = P_EMERGENCYEVENT;
- return true;
- } else if ("eCallInfo" == literal) {
- *result = P_ECALLINFO;
- return true;
- } else {
- return false;
- }
-}
-
-bool IsValidEnum(AppHMIType val) {
- switch (val) {
- case AHT_DEFAULT:
- return true;
- case AHT_COMMUNICATION:
- return true;
- case AHT_MEDIA:
- return true;
- case AHT_MESSAGING:
- return true;
- case AHT_NAVIGATION:
- return true;
- case AHT_INFORMATION:
- return true;
- case AHT_SOCIAL:
- return true;
- case AHT_BACKGROUND_PROCESS:
- return true;
- case AHT_TESTING:
- return true;
- case AHT_SYSTEM:
- return true;
- default:
- return false;
- }
-}
-const char* EnumToJsonString(AppHMIType val) {
- switch (val) {
- case AHT_DEFAULT:
- return "DEFAULT";
- case AHT_COMMUNICATION:
- return "COMMUNICATION";
- case AHT_MEDIA:
- return "MEDIA";
- case AHT_MESSAGING:
- return "MESSAGING";
- case AHT_NAVIGATION:
- return "NAVIGATION";
- case AHT_INFORMATION:
- return "INFORMATION";
- case AHT_SOCIAL:
- return "SOCIAL";
- case AHT_BACKGROUND_PROCESS:
- return "BACKGROUND_PROCESS";
- case AHT_TESTING:
- return "TESTING";
- case AHT_SYSTEM:
- return "SYSTEM";
- default:
- return "";
- }
-}
-bool EnumFromJsonString(const std::string& literal, AppHMIType* result) {
- if ("DEFAULT" == literal) {
- *result = AHT_DEFAULT;
- return true;
- } else if ("COMMUNICATION" == literal) {
- *result = AHT_COMMUNICATION;
- return true;
- } else if ("MEDIA" == literal) {
- *result = AHT_MEDIA;
- return true;
- } else if ("MESSAGING" == literal) {
- *result = AHT_MESSAGING;
- return true;
- } else if ("NAVIGATION" == literal) {
- *result = AHT_NAVIGATION;
- return true;
- } else if ("INFORMATION" == literal) {
- *result = AHT_INFORMATION;
- return true;
- } else if ("SOCIAL" == literal) {
- *result = AHT_SOCIAL;
- return true;
- } else if ("BACKGROUND_PROCESS" == literal) {
- *result = AHT_BACKGROUND_PROCESS;
- return true;
- } else if ("TESTING" == literal) {
- *result = AHT_TESTING;
- return true;
- } else if ("SYSTEM" == literal) {
- *result = AHT_SYSTEM;
- return true;
- } else {
- return false;
- }
-}
-
-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";
-
-} // namespace policy_table_interface_base
-} // namespace rpc
diff --git a/src/components/policy/src/policy_table/types.cc b/src/components/policy/src/policy_table/types.cc
deleted file mode 100644
index 33779928ad..0000000000
--- a/src/components/policy/src/policy_table/types.cc
+++ /dev/null
@@ -1,1371 +0,0 @@
-// This file is generated, do not edit
-#include "policy/policy_table/types.h"
-#include "rpc_base/rpc_base_json_inl.h"
-
-namespace rpc {
-namespace policy_table_interface_base {
-
-std::string PolicyTableTypeToString(const PolicyTableType pt_type) {
- switch (pt_type) {
- case PT_PRELOADED: {
- return "PT_PRELOADED";
- }
- case PT_UPDATE: {
- return "PT_UPDATE";
- }
- case PT_SNAPSHOT: {
- return "PT_SNAPSHOT";
- }
- default: { return "INVALID_PT_TYPE"; }
- }
-}
-
-// PolicyBase methods
-PolicyBase::PolicyBase() : CompositeType(kUninitialized) {}
-
-PolicyBase::PolicyBase(Priority priority)
- : CompositeType(kUninitialized), priority(priority) {}
-
-PolicyBase::~PolicyBase() {}
-
-PolicyBase::PolicyBase(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , priority(impl::ValueMember(value__, "priority")) {}
-
-Json::Value PolicyBase::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("priority", priority, &result__);
- return result__;
-}
-
-bool PolicyBase::is_valid() const {
- if (!priority.is_valid()) {
- return false;
- }
- return Validate();
-}
-
-bool PolicyBase::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-
-bool PolicyBase::struct_empty() const {
- if (priority.is_initialized()) {
- return false;
- }
- return true;
-}
-
-void PolicyBase::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!priority.is_valid()) {
- priority.ReportErrors(&report__->ReportSubobject("priority"));
- }
-}
-
-void PolicyBase::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- priority.SetPolicyTableType(pt_type);
-}
-
-// DevicePolicy methods
-DevicePolicy::DevicePolicy() : PolicyBase() {}
-
-DevicePolicy::DevicePolicy(Priority priority) : PolicyBase(priority) {}
-
-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() : PolicyBase(), groups() {}
-
-ApplicationParams::ApplicationParams(const Strings& groups, Priority priority)
- : PolicyBase(priority), groups(groups) {}
-
-ApplicationParams::~ApplicationParams() {}
-
-ApplicationParams::ApplicationParams(const Json::Value* value__)
- : PolicyBase(value__)
- , groups(impl::ValueMember(value__, "groups"))
- , nicknames(impl::ValueMember(value__, "nicknames"))
- , AppHMIType(impl::ValueMember(value__, "AppHMIType"))
- , 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"), "not_specified") {}
-
-Json::Value ApplicationParams::ToJsonValue() const {
- Json::Value result__(PolicyBase::ToJsonValue());
- impl::WriteJsonField("groups", groups, &result__);
- impl::WriteJsonField("nicknames", nicknames, &result__);
- impl::WriteJsonField("AppHMIType", AppHMIType, &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 {
- // 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 (!groups.is_valid()) {
- return false;
- }
- if (!nicknames.is_valid()) {
- return false;
- }
- if (!AppHMIType.is_valid()) {
- return false;
- }
- if (!memory_kb.is_valid()) {
- return false;
- }
- if (!heart_beat_timeout_ms.is_valid()) {
- return false;
- }
- if (!certificate.is_valid()) {
- return false;
- }
- return Validate();
-}
-
-bool ApplicationParams::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-
-bool ApplicationParams::struct_empty() const {
- if (!PolicyBase::is_initialized()) {
- return false;
- }
- if (groups.is_initialized()) {
- return false;
- }
- if (nicknames.is_initialized()) {
- return false;
- }
- if (AppHMIType.is_initialized()) {
- return false;
- }
- 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 {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!groups.is_valid()) {
- groups.ReportErrors(&report__->ReportSubobject("groups"));
- }
- if (!nicknames.is_valid()) {
- nicknames.ReportErrors(&report__->ReportSubobject("nicknames"));
- }
- 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 (!memory_kb.is_valid()) {
- memory_kb.ReportErrors(&report__->ReportSubobject("memory_kb"));
- }
- if (!heart_beat_timeout_ms.is_valid()) {
- heart_beat_timeout_ms.ReportErrors(
- &report__->ReportSubobject("heart_beat_timeout_ms"));
- }
- if (!certificate.is_valid()) {
- certificate.ReportErrors(&report__->ReportSubobject("certificate"));
- }
-}
-
-void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
- PolicyBase::SetPolicyTableType(pt_type);
- groups.SetPolicyTableType(pt_type);
- AppHMIType.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) {}
-RpcParameters::RpcParameters(const HmiLevels& hmi_levels)
- : CompositeType(kUninitialized), hmi_levels(hmi_levels) {}
-RpcParameters::~RpcParameters() {}
-RpcParameters::RpcParameters(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , hmi_levels(impl::ValueMember(value__, "hmi_levels"))
- , parameters(impl::ValueMember(value__, "parameters")) {}
-Json::Value RpcParameters::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("hmi_levels", hmi_levels, &result__);
- impl::WriteJsonField("parameters", parameters, &result__);
- return result__;
-}
-bool RpcParameters::is_valid() const {
- if (!hmi_levels.is_valid()) {
- return false;
- }
- if (!parameters.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool RpcParameters::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool RpcParameters::struct_empty() const {
- if (hmi_levels.is_initialized()) {
- return false;
- }
- if (parameters.is_initialized()) {
- return false;
- }
-
- return true;
-}
-void RpcParameters::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!hmi_levels.is_valid()) {
- hmi_levels.ReportErrors(&report__->ReportSubobject("hmi_levels"));
- }
- if (!parameters.is_valid()) {
- parameters.ReportErrors(&report__->ReportSubobject("parameters"));
- }
-}
-
-void RpcParameters::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- hmi_levels.SetPolicyTableType(pt_type);
- parameters.SetPolicyTableType(pt_type);
-}
-
-// Rpcs methods
-Rpcs::Rpcs() : CompositeType(kUninitialized) {}
-Rpcs::Rpcs(const Rpc& rpcs) : CompositeType(kUninitialized), rpcs(rpcs) {}
-Rpcs::~Rpcs() {}
-Rpcs::Rpcs(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , user_consent_prompt(impl::ValueMember(value__, "user_consent_prompt"))
- , rpcs(impl::ValueMember(value__, "rpcs")) {}
-Json::Value Rpcs::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("user_consent_prompt", user_consent_prompt, &result__);
- impl::WriteJsonField("rpcs", rpcs, &result__);
- return result__;
-}
-bool Rpcs::is_valid() const {
- if (!user_consent_prompt.is_valid()) {
- return false;
- }
- if (!rpcs.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool Rpcs::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool Rpcs::struct_empty() const {
- if (user_consent_prompt.is_initialized()) {
- return false;
- }
- if (rpcs.is_initialized()) {
- return false;
- }
-
- return true;
-}
-void Rpcs::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!user_consent_prompt.is_valid()) {
- user_consent_prompt.ReportErrors(
- &report__->ReportSubobject("user_consent_prompt"));
- }
- if (!rpcs.is_valid()) {
- rpcs.ReportErrors(&report__->ReportSubobject("rpcs"));
- }
-}
-
-void Rpcs::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- user_consent_prompt.SetPolicyTableType(pt_type);
- rpcs.SetPolicyTableType(pt_type);
-}
-
-// ModuleConfig methods
-ModuleConfig::ModuleConfig() : CompositeType(kUninitialized) {}
-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)
- : CompositeType(kUninitialized)
- , exchange_after_x_ignition_cycles(exchange_after_x_ignition_cycles)
- , exchange_after_x_kilometers(exchange_after_x_kilometers)
- , exchange_after_x_days(exchange_after_x_days)
- , timeout_after_x_seconds(timeout_after_x_seconds)
- , seconds_between_retries(seconds_between_retries)
- , endpoints(endpoints)
- , notifications_per_minute_by_priority(
- notifications_per_minute_by_priority) {}
-ModuleConfig::~ModuleConfig() {}
-ModuleConfig::ModuleConfig(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , device_certificates(impl::ValueMember(value__, "device_certificates"))
- , preloaded_pt(impl::ValueMember(value__, "preloaded_pt"))
- , exchange_after_x_ignition_cycles(
- impl::ValueMember(value__, "exchange_after_x_ignition_cycles"))
- , exchange_after_x_kilometers(
- impl::ValueMember(value__, "exchange_after_x_kilometers"))
- , exchange_after_x_days(impl::ValueMember(value__, "exchange_after_x_days"))
- , timeout_after_x_seconds(
- impl::ValueMember(value__, "timeout_after_x_seconds"))
- , seconds_between_retries(
- impl::ValueMember(value__, "seconds_between_retries"))
- , endpoints(impl::ValueMember(value__, "endpoints"))
- , notifications_per_minute_by_priority(
- impl::ValueMember(value__, "notifications_per_minute_by_priority"))
- , vehicle_make(impl::ValueMember(value__, "vehicle_make"))
- , vehicle_model(impl::ValueMember(value__, "vehicle_model"))
- , vehicle_year(impl::ValueMember(value__, "vehicle_year"))
- , preloaded_date(impl::ValueMember(value__, "preloaded_date"))
- , certificate(impl::ValueMember(value__, "certificate")) {}
-
-void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) {
- // device_certificates = from.device_certificates; // According to the
- // requirements this is optional.
- exchange_after_x_ignition_cycles = from.exchange_after_x_ignition_cycles;
- exchange_after_x_kilometers = from.exchange_after_x_kilometers;
- exchange_after_x_days = from.exchange_after_x_days;
- timeout_after_x_seconds = from.timeout_after_x_seconds;
- seconds_between_retries = from.seconds_between_retries;
- endpoints = from.endpoints;
- notifications_per_minute_by_priority =
- from.notifications_per_minute_by_priority;
-
- vehicle_make.assign_if_valid(from.vehicle_make);
- vehicle_model.assign_if_valid(from.vehicle_model);
- vehicle_year.assign_if_valid(from.vehicle_year);
- certificate.assign_if_valid(from.certificate);
-}
-
-Json::Value ModuleConfig::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("preloaded_pt", preloaded_pt, &result__);
- impl::WriteJsonField("exchange_after_x_ignition_cycles",
- exchange_after_x_ignition_cycles,
- &result__);
- impl::WriteJsonField(
- "exchange_after_x_kilometers", exchange_after_x_kilometers, &result__);
- impl::WriteJsonField(
- "exchange_after_x_days", exchange_after_x_days, &result__);
- impl::WriteJsonField(
- "timeout_after_x_seconds", timeout_after_x_seconds, &result__);
- impl::WriteJsonField(
- "seconds_between_retries", seconds_between_retries, &result__);
- impl::WriteJsonField("endpoints", endpoints, &result__);
- impl::WriteJsonField("notifications_per_minute_by_priority",
- notifications_per_minute_by_priority,
- &result__);
- impl::WriteJsonField("vehicle_make", vehicle_make, &result__);
- impl::WriteJsonField("vehicle_model", vehicle_model, &result__);
- impl::WriteJsonField("vehicle_year", vehicle_year, &result__);
- impl::WriteJsonField("certificate", certificate, &result__);
- impl::WriteJsonField("preloaded_date", preloaded_date, &result__);
- return result__;
-}
-bool ModuleConfig::is_valid() const {
- if (!preloaded_pt.is_valid()) {
- return false;
- }
- if (!exchange_after_x_ignition_cycles.is_valid()) {
- return false;
- }
- if (!exchange_after_x_kilometers.is_valid()) {
- return false;
- }
- if (!exchange_after_x_days.is_valid()) {
- return false;
- }
- if (!timeout_after_x_seconds.is_valid()) {
- return false;
- }
- if (!seconds_between_retries.is_valid()) {
- return false;
- }
- if (!endpoints.is_valid()) {
- return false;
- }
- if (!notifications_per_minute_by_priority.is_valid()) {
- return false;
- }
- if (!vehicle_make.is_valid()) {
- return false;
- }
- if (!vehicle_model.is_valid()) {
- return false;
- }
- if (!vehicle_year.is_valid()) {
- return false;
- }
- if (!certificate.is_valid()) {
- return false;
- }
- if (!preloaded_date.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool ModuleConfig::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool ModuleConfig::struct_empty() const {
- if (preloaded_pt.is_initialized()) {
- return false;
- }
-
- if (exchange_after_x_ignition_cycles.is_initialized()) {
- return false;
- }
- if (exchange_after_x_kilometers.is_initialized()) {
- return false;
- }
-
- if (exchange_after_x_days.is_initialized()) {
- return false;
- }
- if (timeout_after_x_seconds.is_initialized()) {
- return false;
- }
-
- if (seconds_between_retries.is_initialized()) {
- return false;
- }
- if (endpoints.is_initialized()) {
- return false;
- }
-
- if (notifications_per_minute_by_priority.is_initialized()) {
- return false;
- }
- if (vehicle_make.is_initialized()) {
- return false;
- }
-
- if (vehicle_model.is_initialized()) {
- return false;
- }
- if (vehicle_year.is_initialized()) {
- return false;
- }
-
- return true;
-}
-void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!device_certificates.is_valid()) {
- device_certificates.ReportErrors(
- &report__->ReportSubobject("device_certificates"));
- }
- if (!preloaded_pt.is_valid()) {
- preloaded_pt.ReportErrors(&report__->ReportSubobject("preloaded_pt"));
- }
- if (!exchange_after_x_ignition_cycles.is_valid()) {
- exchange_after_x_ignition_cycles.ReportErrors(
- &report__->ReportSubobject("exchange_after_x_ignition_cycles"));
- }
- if (!exchange_after_x_kilometers.is_valid()) {
- exchange_after_x_kilometers.ReportErrors(
- &report__->ReportSubobject("exchange_after_x_kilometers"));
- }
- if (!exchange_after_x_days.is_valid()) {
- exchange_after_x_days.ReportErrors(
- &report__->ReportSubobject("exchange_after_x_days"));
- }
- if (!timeout_after_x_seconds.is_valid()) {
- timeout_after_x_seconds.ReportErrors(
- &report__->ReportSubobject("timeout_after_x_seconds"));
- }
- if (!seconds_between_retries.is_valid()) {
- seconds_between_retries.ReportErrors(
- &report__->ReportSubobject("seconds_between_retries"));
- }
- if (!endpoints.is_valid()) {
- endpoints.ReportErrors(&report__->ReportSubobject("endpoints"));
- }
- if (!notifications_per_minute_by_priority.is_valid()) {
- notifications_per_minute_by_priority.ReportErrors(
- &report__->ReportSubobject("notifications_per_minute_by_priority"));
- }
- if (!vehicle_make.is_valid()) {
- vehicle_make.ReportErrors(&report__->ReportSubobject("vehicle_make"));
- }
- if (!vehicle_model.is_valid()) {
- vehicle_model.ReportErrors(&report__->ReportSubobject("vehicle_model"));
- }
- if (!vehicle_year.is_valid()) {
- vehicle_year.ReportErrors(&report__->ReportSubobject("vehicle_year"));
- }
- if (PT_PRELOADED == GetPolicyTableType()) {
- std::string validation_info =
- ommited_validation_info + PolicyTableTypeToString(GetPolicyTableType());
- rpc::ValidationReport* ommited_field_report;
- if (vehicle_make.is_initialized()) {
- ommited_field_report = &report__->ReportSubobject("vehicle_make");
- ommited_field_report->set_validation_info(validation_info);
- }
- if (vehicle_year.is_initialized()) {
- ommited_field_report = &report__->ReportSubobject("vehicle_year");
- ommited_field_report->set_validation_info(validation_info);
- }
- if (vehicle_model.is_initialized()) {
- ommited_field_report = &report__->ReportSubobject("vehicle_model");
- ommited_field_report->set_validation_info(validation_info);
- }
- }
-}
-
-void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- preloaded_pt.SetPolicyTableType(pt_type);
- exchange_after_x_ignition_cycles.SetPolicyTableType(pt_type);
- exchange_after_x_kilometers.SetPolicyTableType(pt_type);
- exchange_after_x_days.SetPolicyTableType(pt_type);
- timeout_after_x_seconds.SetPolicyTableType(pt_type);
- seconds_between_retries.SetPolicyTableType(pt_type);
- endpoints.SetPolicyTableType(pt_type);
- notifications_per_minute_by_priority.SetPolicyTableType(pt_type);
- vehicle_make.SetPolicyTableType(pt_type);
- vehicle_model.SetPolicyTableType(pt_type);
- vehicle_year.SetPolicyTableType(pt_type);
-}
-
-// MessageString methods
-MessageString::MessageString() : CompositeType(kUninitialized) {}
-MessageString::~MessageString() {}
-MessageString::MessageString(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , line1(impl::ValueMember(value__, "line1"))
- , line2(impl::ValueMember(value__, "line2"))
- , tts(impl::ValueMember(value__, "tts"))
- , label(impl::ValueMember(value__, "label"))
- , textBody(impl::ValueMember(value__, "textBody")) {}
-Json::Value MessageString::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("line1", line1, &result__);
- impl::WriteJsonField("line2", line2, &result__);
- impl::WriteJsonField("tts", tts, &result__);
- impl::WriteJsonField("label", label, &result__);
- impl::WriteJsonField("textBody", textBody, &result__);
- return result__;
-}
-bool MessageString::is_valid() const {
- if (struct_empty()) {
- return initialization_state__ == kInitialized && Validate();
- }
- if (!line1.is_valid()) {
- return false;
- }
- if (!line2.is_valid()) {
- return false;
- }
- if (!tts.is_valid()) {
- return false;
- }
- if (!label.is_valid()) {
- return false;
- }
- if (!textBody.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool MessageString::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool MessageString::struct_empty() const {
- if (line1.is_initialized()) {
- return false;
- }
- if (line2.is_initialized()) {
- return false;
- }
-
- if (tts.is_initialized()) {
- return false;
- }
- if (label.is_initialized()) {
- return false;
- }
-
- if (textBody.is_initialized()) {
- return false;
- }
- return true;
-}
-void MessageString::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!line1.is_valid()) {
- line1.ReportErrors(&report__->ReportSubobject("line1"));
- }
- if (!line2.is_valid()) {
- line2.ReportErrors(&report__->ReportSubobject("line2"));
- }
- if (!tts.is_valid()) {
- tts.ReportErrors(&report__->ReportSubobject("tts"));
- }
- if (!label.is_valid()) {
- label.ReportErrors(&report__->ReportSubobject("label"));
- }
- if (!textBody.is_valid()) {
- textBody.ReportErrors(&report__->ReportSubobject("textBody"));
- }
-}
-
-void MessageString::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- line1.SetPolicyTableType(pt_type);
- line2.SetPolicyTableType(pt_type);
- tts.SetPolicyTableType(pt_type);
- label.SetPolicyTableType(pt_type);
- textBody.SetPolicyTableType(pt_type);
-}
-
-// MessageLanguages methods
-MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {}
-MessageLanguages::MessageLanguages(const Languages& languages)
- : CompositeType(kUninitialized), languages(languages) {}
-MessageLanguages::~MessageLanguages() {}
-MessageLanguages::MessageLanguages(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , languages(impl::ValueMember(value__, "languages")) {}
-Json::Value MessageLanguages::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("languages", languages, &result__);
- return result__;
-}
-bool MessageLanguages::is_valid() const {
- if (!languages.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool MessageLanguages::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool MessageLanguages::struct_empty() const {
- if (languages.is_initialized()) {
- return false;
- }
- return true;
-}
-
-void MessageLanguages::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (PT_SNAPSHOT == GetPolicyTableType()) {
- if (languages.is_initialized()) {
- std::string validation_info =
- ommited_validation_info +
- PolicyTableTypeToString(GetPolicyTableType());
- report__->ReportSubobject("languages")
- .set_validation_info(validation_info);
- }
- }
- if (!languages.is_valid()) {
- languages.ReportErrors(&report__->ReportSubobject("languages"));
- }
-}
-
-void MessageLanguages::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- languages.SetPolicyTableType(pt_type);
-}
-
-// ConsumerFriendlyMessages methods
-ConsumerFriendlyMessages::ConsumerFriendlyMessages()
- : CompositeType(kUninitialized) {}
-ConsumerFriendlyMessages::ConsumerFriendlyMessages(const std::string& version)
- : CompositeType(kUninitialized), version(version) {}
-ConsumerFriendlyMessages::~ConsumerFriendlyMessages() {}
-ConsumerFriendlyMessages::ConsumerFriendlyMessages(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , version(impl::ValueMember(value__, "version"))
- , messages(impl::ValueMember(value__, "messages")) {}
-Json::Value ConsumerFriendlyMessages::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("version", version, &result__);
- impl::WriteJsonField("messages", messages, &result__);
- return result__;
-}
-bool ConsumerFriendlyMessages::is_valid() const {
- if (!version.is_valid()) {
- return false;
- }
- if (!messages.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool ConsumerFriendlyMessages::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool ConsumerFriendlyMessages::struct_empty() const {
- if (version.is_initialized()) {
- return false;
- }
- if (messages.is_initialized()) {
- return false;
- }
-
- return true;
-}
-void ConsumerFriendlyMessages::ReportErrors(
- rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!version.is_valid()) {
- version.ReportErrors(&report__->ReportSubobject("version"));
- }
- if (PT_SNAPSHOT == GetPolicyTableType()) {
- if (messages.is_initialized()) {
- std::string validation_info =
- ommited_validation_info +
- PolicyTableTypeToString(GetPolicyTableType());
- report__->ReportSubobject("messages")
- .set_validation_info(validation_info);
- }
- }
- if (!messages.is_valid()) {
- messages.ReportErrors(&report__->ReportSubobject("messages"));
- }
-}
-
-void ConsumerFriendlyMessages::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- version.SetPolicyTableType(pt_type);
- messages.SetPolicyTableType(pt_type);
-}
-
-// ModuleMeta methods
-ModuleMeta::ModuleMeta() : CompositeType(kUninitialized) {}
-ModuleMeta::~ModuleMeta() {}
-ModuleMeta::ModuleMeta(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject)) {}
-Json::Value ModuleMeta::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- return result__;
-}
-bool ModuleMeta::is_valid() const {
- if (struct_empty()) {
- return initialization_state__ == kInitialized && Validate();
- }
- return Validate();
-}
-bool ModuleMeta::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool ModuleMeta::struct_empty() const {
- return true;
-}
-void ModuleMeta::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
-}
-
-// AppLevel methods
-AppLevel::AppLevel() : CompositeType(kUninitialized) {}
-
-AppLevel::AppLevel(uint16_t minutes_in_hmi_full,
- const std::string& app_registration_language_gui,
- const std::string& app_registration_language_vui,
- uint16_t minutes_in_hmi_limited,
- uint16_t minutes_in_hmi_background,
- uint16_t minutes_in_hmi_none,
- uint16_t count_of_user_selections,
- uint16_t count_of_rejections_sync_out_of_memory,
- uint16_t count_of_rejections_nickname_mismatch,
- uint16_t count_of_rejections_duplicate_name,
- uint16_t count_of_rejected_rpc_calls,
- uint16_t count_of_rpcs_sent_in_hmi_none,
- uint16_t count_of_removals_for_bad_behavior,
- uint16_t count_of_tls_errors,
- uint16_t count_of_run_attempts_while_revoked)
- : CompositeType(kUninitialized)
- , minutes_in_hmi_full(minutes_in_hmi_full)
- , app_registration_language_gui(app_registration_language_gui)
- , app_registration_language_vui(app_registration_language_vui)
- , minutes_in_hmi_limited(minutes_in_hmi_limited)
- , minutes_in_hmi_background(minutes_in_hmi_background)
- , minutes_in_hmi_none(minutes_in_hmi_none)
- , count_of_user_selections(count_of_user_selections)
- , count_of_rejections_sync_out_of_memory(
- count_of_rejections_sync_out_of_memory)
- , count_of_rejections_nickname_mismatch(
- count_of_rejections_nickname_mismatch)
- , count_of_rejections_duplicate_name(count_of_rejections_duplicate_name)
- , count_of_rejected_rpc_calls(count_of_rejected_rpc_calls)
- , count_of_rpcs_sent_in_hmi_none(count_of_rpcs_sent_in_hmi_none)
- , count_of_removals_for_bad_behavior(count_of_removals_for_bad_behavior)
- , count_of_tls_errors(count_of_tls_errors)
- , count_of_run_attempts_while_revoked(count_of_run_attempts_while_revoked) {
-}
-AppLevel::~AppLevel() {}
-AppLevel::AppLevel(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , minutes_in_hmi_full(impl::ValueMember(value__, "minutes_in_hmi_full"))
- , app_registration_language_gui(
- impl::ValueMember(value__, "app_registration_language_gui"))
- , app_registration_language_vui(
- impl::ValueMember(value__, "app_registration_language_vui"))
- , minutes_in_hmi_limited(
- impl::ValueMember(value__, "minutes_in_hmi_limited"))
- , minutes_in_hmi_background(
- impl::ValueMember(value__, "minutes_in_hmi_background"))
- , minutes_in_hmi_none(impl::ValueMember(value__, "minutes_in_hmi_none"))
- , count_of_user_selections(
- impl::ValueMember(value__, "count_of_user_selections"))
- , count_of_rejections_sync_out_of_memory(
- impl::ValueMember(value__, "count_of_rejections_sync_out_of_memory"))
- , count_of_rejections_nickname_mismatch(
- impl::ValueMember(value__, "count_of_rejections_nickname_mismatch"))
- , count_of_rejections_duplicate_name(
- impl::ValueMember(value__, "count_of_rejections_duplicate_name"))
- , count_of_rejected_rpc_calls(
- impl::ValueMember(value__, "count_of_rejected_rpc_calls"))
- , count_of_rpcs_sent_in_hmi_none(
- impl::ValueMember(value__, "count_of_rpcs_sent_in_hmi_none"))
- , count_of_removals_for_bad_behavior(
- impl::ValueMember(value__, "count_of_removals_for_bad_behavior"))
- , count_of_tls_errors(impl::ValueMember(value__, "count_of_tls_errors"))
- , count_of_run_attempts_while_revoked(
- impl::ValueMember(value__, "count_of_run_attempts_while_revoked")) {}
-Json::Value AppLevel::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("minutes_in_hmi_full", minutes_in_hmi_full, &result__);
- impl::WriteJsonField("app_registration_language_gui",
- app_registration_language_gui,
- &result__);
- impl::WriteJsonField("app_registration_language_vui",
- app_registration_language_vui,
- &result__);
- impl::WriteJsonField(
- "minutes_in_hmi_limited", minutes_in_hmi_limited, &result__);
- impl::WriteJsonField(
- "minutes_in_hmi_background", minutes_in_hmi_background, &result__);
- impl::WriteJsonField("minutes_in_hmi_none", minutes_in_hmi_none, &result__);
- impl::WriteJsonField(
- "count_of_user_selections", count_of_user_selections, &result__);
- impl::WriteJsonField("count_of_rejections_sync_out_of_memory",
- count_of_rejections_sync_out_of_memory,
- &result__);
- impl::WriteJsonField("count_of_rejections_nickname_mismatch",
- count_of_rejections_nickname_mismatch,
- &result__);
- impl::WriteJsonField("count_of_rejections_duplicate_name",
- count_of_rejections_duplicate_name,
- &result__);
- impl::WriteJsonField(
- "count_of_rejected_rpc_calls", count_of_rejected_rpc_calls, &result__);
- impl::WriteJsonField("count_of_rpcs_sent_in_hmi_none",
- count_of_rpcs_sent_in_hmi_none,
- &result__);
- impl::WriteJsonField("count_of_removals_for_bad_behavior",
- count_of_removals_for_bad_behavior,
- &result__);
- impl::WriteJsonField("count_of_tls_errors", count_of_tls_errors, &result__);
- impl::WriteJsonField("count_of_run_attempts_while_revoked",
- count_of_run_attempts_while_revoked,
- &result__);
- return result__;
-}
-bool AppLevel::is_valid() const {
- if (!minutes_in_hmi_full.is_valid()) {
- return false;
- }
- if (!app_registration_language_gui.is_valid()) {
- return false;
- }
- if (!app_registration_language_vui.is_valid()) {
- return false;
- }
- if (!minutes_in_hmi_limited.is_valid()) {
- return false;
- }
- if (!minutes_in_hmi_background.is_valid()) {
- return false;
- }
- if (!minutes_in_hmi_none.is_valid()) {
- return false;
- }
- if (!count_of_user_selections.is_valid()) {
- return false;
- }
- if (!count_of_rejections_sync_out_of_memory.is_valid()) {
- return false;
- }
- if (!count_of_rejections_nickname_mismatch.is_valid()) {
- return false;
- }
- if (!count_of_rejections_duplicate_name.is_valid()) {
- return false;
- }
- if (!count_of_rejected_rpc_calls.is_valid()) {
- return false;
- }
- if (!count_of_rpcs_sent_in_hmi_none.is_valid()) {
- return false;
- }
- if (!count_of_removals_for_bad_behavior.is_valid()) {
- return false;
- }
- if (!count_of_tls_errors.is_valid()) {
- return false;
- }
- if (!count_of_run_attempts_while_revoked.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool AppLevel::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool AppLevel::struct_empty() const {
- if (minutes_in_hmi_full.is_initialized()) {
- return false;
- }
- if (app_registration_language_gui.is_initialized()) {
- return false;
- }
-
- if (app_registration_language_vui.is_initialized()) {
- return false;
- }
-
- if (minutes_in_hmi_limited.is_initialized()) {
- return false;
- }
- if (minutes_in_hmi_background.is_initialized()) {
- return false;
- }
-
- if (minutes_in_hmi_none.is_initialized()) {
- return false;
- }
- if (count_of_user_selections.is_initialized()) {
- return false;
- }
-
- if (count_of_rejections_sync_out_of_memory.is_initialized()) {
- return false;
- }
- if (count_of_rejections_nickname_mismatch.is_initialized()) {
- return false;
- }
-
- if (count_of_rejections_duplicate_name.is_initialized()) {
- return false;
- }
- if (count_of_rejected_rpc_calls.is_initialized()) {
- return false;
- }
-
- if (count_of_rpcs_sent_in_hmi_none.is_initialized()) {
- return false;
- }
- if (count_of_removals_for_bad_behavior.is_initialized()) {
- return false;
- }
- if (count_of_tls_errors.is_initialized()) {
- return false;
- }
- if (count_of_run_attempts_while_revoked.is_initialized()) {
- return false;
- }
- return true;
-}
-void AppLevel::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
- std::string validation_info =
- ommited_validation_info + PolicyTableTypeToString(GetPolicyTableType());
- report__->set_validation_info(validation_info);
- }
-}
-
-// UsageAndErrorCounts methods
-UsageAndErrorCounts::UsageAndErrorCounts() : CompositeType(kUninitialized) {}
-
-UsageAndErrorCounts::~UsageAndErrorCounts() {}
-UsageAndErrorCounts::UsageAndErrorCounts(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , app_level(impl::ValueMember(value__, "app_level")) {}
-Json::Value UsageAndErrorCounts::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("app_level", app_level, &result__);
- return result__;
-}
-bool UsageAndErrorCounts::is_valid() const {
- if (struct_empty()) {
- return initialization_state__ == kInitialized && Validate();
- }
- if (!app_level.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool UsageAndErrorCounts::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool UsageAndErrorCounts::struct_empty() const {
- if (app_level.is_initialized()) {
- return false;
- }
- return true;
-}
-void UsageAndErrorCounts::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
- std::string validation_info =
- ommited_validation_info + PolicyTableTypeToString(GetPolicyTableType());
- report__->set_validation_info(validation_info);
- }
- if (!app_level.is_valid()) {
- app_level.ReportErrors(&report__->ReportSubobject("app_level"));
- }
-}
-
-void UsageAndErrorCounts::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- app_level.SetPolicyTableType(pt_type);
-}
-
-// DeviceParams methods
-DeviceParams::DeviceParams() : CompositeType(kUninitialized) {}
-DeviceParams::~DeviceParams() {}
-DeviceParams::DeviceParams(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject)) {}
-Json::Value DeviceParams::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- return result__;
-}
-bool DeviceParams::is_valid() const {
- if (struct_empty()) {
- return initialization_state__ == kInitialized && Validate();
- }
- return Validate();
-}
-bool DeviceParams::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool DeviceParams::struct_empty() const {
- return true;
-}
-void DeviceParams::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
-}
-
-// PolicyTable methods
-PolicyTable::PolicyTable() : CompositeType(kUninitialized) {}
-PolicyTable::PolicyTable(
- const ApplicationPoliciesSection& app_policies_section,
- const FunctionalGroupings& functional_groupings,
- const ConsumerFriendlyMessages& consumer_friendly_messages,
- const ModuleConfig& module_config)
- : CompositeType(kUninitialized)
- , app_policies_section(app_policies_section)
- , functional_groupings(functional_groupings)
- , consumer_friendly_messages(consumer_friendly_messages)
- , module_config(module_config) {}
-PolicyTable::~PolicyTable() {}
-PolicyTable::PolicyTable(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , 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"))
- , module_meta(impl::ValueMember(value__, "module_meta"))
- , usage_and_error_counts(
- impl::ValueMember(value__, "usage_and_error_counts"))
- , device_data(impl::ValueMember(value__, "device_data")) {}
-Json::Value PolicyTable::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- 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__);
- impl::WriteJsonField("module_meta", module_meta, &result__);
- impl::WriteJsonField(
- "usage_and_error_counts", usage_and_error_counts, &result__);
- impl::WriteJsonField("device_data", device_data, &result__);
- return result__;
-}
-bool PolicyTable::is_valid() const {
- if (!app_policies_section.is_valid()) {
- return false;
- }
- if (!functional_groupings.is_valid()) {
- return false;
- }
- if (!consumer_friendly_messages.is_valid()) {
- return false;
- }
- if (!module_config.is_valid()) {
- return false;
- }
- if (!module_meta.is_valid()) {
- return false;
- }
- if (!usage_and_error_counts.is_valid()) {
- return false;
- }
- if (!device_data.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool PolicyTable::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool PolicyTable::struct_empty() const {
- if (app_policies_section.is_initialized()) {
- return false;
- }
- if (functional_groupings.is_initialized()) {
- return false;
- }
-
- if (consumer_friendly_messages.is_initialized()) {
- return false;
- }
- if (module_config.is_initialized()) {
- return false;
- }
-
- if (module_meta.is_initialized()) {
- return false;
- }
- if (usage_and_error_counts.is_initialized()) {
- return false;
- }
-
- if (device_data.is_initialized()) {
- return false;
- }
- return true;
-}
-void PolicyTable::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
- std::string validation_info =
- ommited_validation_info + PolicyTableTypeToString(GetPolicyTableType());
-
- if (device_data.is_initialized()) {
- report__->ReportSubobject("device_data")
- .set_validation_info(validation_info);
- }
- }
- 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"));
- }
- if (!consumer_friendly_messages.is_valid()) {
- consumer_friendly_messages.ReportErrors(
- &report__->ReportSubobject("consumer_friendly_messages"));
- }
- if (!module_config.is_valid()) {
- module_config.ReportErrors(&report__->ReportSubobject("module_config"));
- }
- if (!module_meta.is_valid()) {
- module_meta.ReportErrors(&report__->ReportSubobject("module_meta"));
- }
- if (!usage_and_error_counts.is_valid()) {
- usage_and_error_counts.ReportErrors(
- &report__->ReportSubobject("usage_and_error_counts"));
- }
- if (!device_data.is_valid()) {
- device_data.ReportErrors(&report__->ReportSubobject("device_data"));
- }
-}
-
-void PolicyTable::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::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);
- module_meta.SetPolicyTableType(pt_type);
- usage_and_error_counts.SetPolicyTableType(pt_type);
- device_data.SetPolicyTableType(pt_type);
-}
-
-// Table methods
-Table::Table() : CompositeType(kUninitialized) {}
-Table::Table(const PolicyTable& policy_table)
- : CompositeType(kUninitialized), policy_table(policy_table) {}
-Table::~Table() {}
-Table::Table(const Json::Value* value__)
- : CompositeType(InitHelper(value__, &Json::Value::isObject))
- , policy_table(impl::ValueMember(value__, "policy_table")) {}
-Json::Value Table::ToJsonValue() const {
- Json::Value result__(Json::objectValue);
- impl::WriteJsonField("policy_table", policy_table, &result__);
- return result__;
-}
-bool Table::is_valid() const {
- if (!policy_table.is_valid()) {
- return false;
- }
- return Validate();
-}
-bool Table::is_initialized() const {
- return (initialization_state__ != kUninitialized) || (!struct_empty());
-}
-bool Table::struct_empty() const {
- if (policy_table.is_initialized()) {
- return false;
- }
- return true;
-}
-void Table::ReportErrors(rpc::ValidationReport* report__) const {
- if (struct_empty()) {
- rpc::CompositeType::ReportErrors(report__);
- }
- if (!policy_table.is_valid()) {
- policy_table.ReportErrors(&report__->ReportSubobject("policy_table"));
- }
-}
-
-void Table::SetPolicyTableType(PolicyTableType pt_type) {
- CompositeType::SetPolicyTableType(pt_type);
- policy_table.SetPolicyTableType(pt_type);
-}
-
-} // namespace policy_table_interface_base
-} // namespace rpc
diff --git a/src/components/policy/src/policy_table/validation.cc b/src/components/policy/src/policy_table/validation.cc
deleted file mode 100644
index b9bcbfa7ab..0000000000
--- a/src/components/policy/src/policy_table/validation.cc
+++ /dev/null
@@ -1,197 +0,0 @@
-#include <algorithm>
-#include "policy/policy_table/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_, "Policy")
-
-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;
-}
-bool RpcParameters::Validate() const {
- return true;
-}
-bool Rpcs::Validate() const {
- return true;
-}
-
-bool ModuleConfig::Validate() const {
- if (PT_PRELOADED == GetPolicyTableType()) {
- if (vehicle_make.is_initialized()) {
- return false;
- }
- if (vehicle_year.is_initialized()) {
- return false;
- }
- if (vehicle_model.is_initialized()) {
- return false;
- }
- }
- return true;
-}
-
-bool MessageString::Validate() const {
- return true;
-}
-
-bool MessageLanguages::Validate() const {
- if (PT_SNAPSHOT == GetPolicyTableType()) {
- return false;
- }
- return true;
-}
-
-bool ConsumerFriendlyMessages::Validate() const {
- /* According to requirements consumer_friendly_messages are optional for PTU
- and required for PTP and PTS. So, they are allowed always */
- if (PT_SNAPSHOT == GetPolicyTableType() && messages.is_initialized()) {
- return false;
- }
- return true;
-}
-
-bool ModuleMeta::Validate() const {
- return true;
-}
-
-bool AppLevel::Validate() const {
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
- return false;
- }
- return true;
-}
-
-bool UsageAndErrorCounts::Validate() const {
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
- return false;
- }
- return true;
-}
-bool DeviceParams::Validate() const {
- return true;
-}
-bool PolicyTable::Validate() const {
- if (PT_PRELOADED == GetPolicyTableType() ||
- PT_UPDATE == GetPolicyTableType()) {
- if (device_data.is_initialized()) {
- return false;
- }
- }
- return true;
-}
-bool Table::Validate() const {
- return true;
-}
-} // namespace policy_table_interface_base
-} // namespace rpc
diff --git a/src/components/policy/src/sql_pt_queries.cc b/src/components/policy/src/sql_pt_queries.cc
deleted file mode 100644
index df4bc74cc2..0000000000
--- a/src/components/policy/src/sql_pt_queries.cc
+++ /dev/null
@@ -1,712 +0,0 @@
-/*
- Copyright (c) 2015, " Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, " with or without
- modification, " are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, " this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice, "
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, " INCLUDING, " BUT NOT LIMITED TO, " THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, " INDIRECT, " INCIDENTAL, " SPECIAL, " EXEMPLARY, " OR
- CONSEQUENTIAL DAMAGES (INCLUDING, " BUT NOT LIMITED TO, " PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, " DATA, " OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, " WHETHER IN
- CONTRACT, " STRICT LIABILITY, " OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, " EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "policy/sql_pt_queries.h"
-
-namespace policy {
-namespace sql_pt {
-
-const std::string kSelectPriority =
- "SELECT `priority_value` FROM `application` WHERE `id` = ? LIMIT 1";
-const std::string kCreateSchema =
- "BEGIN; "
- "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 "
- "); "
- "CREATE TABLE IF NOT EXISTS `module_meta`( "
- " `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, "
- " `flag_update_required` BOOL NOT NULL "
- "); "
- "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, "
- " `certificate` TEXT, "
- " `vehicle_make` VARCHAR(45), "
- " `vehicle_model` VARCHAR(45), "
- " `vehicle_year` VARCHAR(4) "
- "); "
- "CREATE TABLE IF NOT EXISTS `functional_group`( "
- " `id` INTEGER PRIMARY KEY NOT NULL, "
- " `user_consent_prompt` TEXT, "
- " `name` VARCHAR(100) NOT NULL "
- "); "
- "CREATE TABLE IF NOT EXISTS `priority`( "
- " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
- "); "
- "CREATE TABLE IF NOT EXISTS `hmi_level`( "
- " `value` VARCHAR(45) PRIMARY KEY NOT NULL "
- "); "
- "CREATE TABLE IF NOT EXISTS `notifications_by_priority`( "
- " `priority_value` VARCHAR(45) PRIMARY KEY NOT NULL, "
- " `value` INTEGER NOT NULL, "
- " 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 "
- "); "
- "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` VARCHAR(45), "
- " 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, "
- " `count_of_tls_errors` 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 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`( "
- " `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` VARCHAR(45), "
- " 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` "
- " ON `message`(`message_type_name`);"
- "CREATE TABLE IF NOT EXISTS `_internal_data`( "
- " `db_version_hash` INTEGER "
- " ); "
- "COMMIT;";
-
-const std::string kInsertInitData =
- "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); "
- "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); "
- "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, 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'); "
- "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('COMMUNICATION'); "
- "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NORMAL'); "
- "INSERT OR IGNORE INTO `priority`(`value`) VALUES ('NONE'); "
- "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'); "
- "INSERT OR IGNORE INTO `version` (`number`) VALUES('0'); "
- "INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
- "";
-
-const std::string kDropSchema =
- "BEGIN; "
- "DROP INDEX IF EXISTS `message.fk_messages_languages1_idx`; "
- "DROP INDEX IF EXISTS "
- "`message.fk_message_consumer_friendly_messages1_idx`; "
- "DROP TABLE IF EXISTS `message`; "
- "DROP INDEX IF EXISTS `endpoint.fk_endpoint_application1_idx`; "
- "DROP TABLE IF EXISTS `endpoint`; "
- "DROP INDEX IF EXISTS `consent_group.fk_consent_group_device1_idx`; "
- "DROP INDEX IF EXISTS "
- "`consent_group.fk_consent_group_functional_group1_idx`; "
- "DROP TABLE IF EXISTS `consent_group`; "
- "DROP INDEX IF EXISTS `app_type.fk_app_type_application1_idx`; "
- "DROP TABLE IF EXISTS `app_type`; "
- "DROP INDEX IF EXISTS `nickname.fk_nickname_application1_idx`; "
- "DROP TABLE IF EXISTS `nickname`; "
- "DROP INDEX IF EXISTS `app_level.fk_app_level_language2_idx`; "
- "DROP INDEX IF EXISTS `app_level.fk_app_level_language1_idx`; "
- "DROP INDEX IF EXISTS `app_level.fk_app_levels_application1_idx`; "
- "DROP TABLE IF EXISTS `app_level`; "
- "DROP INDEX IF EXISTS "
- "`device_consent_group.fk_device_has_functional_group_device1_idx`; "
- "DROP INDEX IF EXISTS "
- "`device_consent_group.fk_device_has_functional_group_functional_group1_"
- "idx`; "
- "DROP TABLE IF EXISTS `device_consent_group`; "
- "DROP TABLE IF EXISTS `seconds_between_retry`; "
- "DROP INDEX IF EXISTS "
- "`preconsented_group.fk_application_has_functional_group_application2_idx`;"
- " "
- "DROP INDEX IF EXISTS "
- "`preconsented_group.fk_application_has_functional_group_functional_group2_"
- "idx`; "
- "DROP TABLE IF EXISTS `preconsented_group`; "
- "DROP INDEX IF EXISTS "
- "`app_group.fk_application_has_functional_group_application1_idx`; "
- "DROP INDEX IF EXISTS "
- "`app_group.fk_application_has_functional_group_functional_group1_idx`; "
- "DROP TABLE IF EXISTS `app_group`; "
- "DROP INDEX IF EXISTS `application.fk_application_priorities1_idx`; "
- "DROP INDEX IF EXISTS `application.fk_application_hmi_level1_idx`; "
- "DROP TABLE IF EXISTS `application`; "
- "DROP INDEX IF EXISTS `rpc.select_rpc_name_hmi_level`; "
- "DROP INDEX IF EXISTS `rpc.fk_rpc_functional_group1_idx`; "
- "DROP INDEX IF EXISTS `rpc.fk_rpc_hmi_level1_idx`; "
- "DROP TABLE IF EXISTS `rpc`; "
- "DROP TABLE IF EXISTS `version`; "
- "DROP TABLE IF EXISTS `message_type`; "
- "DROP TABLE IF EXISTS `language`; "
- "DROP INDEX IF EXISTS "
- "`notifications_by_priority.fk_notifications_by_priority_priority1_idx`; "
- "DROP TABLE IF EXISTS `notifications_by_priority`; "
- "DROP TABLE IF EXISTS `hmi_level`; "
- "DROP TABLE IF EXISTS `priority`; "
- "DROP TABLE IF EXISTS `functional_group`; "
- "DROP TABLE IF EXISTS `module_config`; "
- "DROP TABLE IF EXISTS `module_meta`; "
- "DROP TABLE IF EXISTS `usage_and_error_count`; "
- "DROP TABLE IF EXISTS `device`; "
- "DROP TABLE IF EXISTS `_internal_data`; "
- "COMMIT; "
- "VACUUM;";
-
-const std::string kDeleteData =
- "BEGIN; "
- "DELETE FROM `message`; "
- "DELETE FROM `endpoint`; "
- "DELETE FROM `consent_group`; "
- "DELETE FROM `app_type`; "
- "DELETE FROM `nickname`; "
- "DELETE FROM `app_level`; "
- "DELETE FROM `device_consent_group`; "
- "DELETE FROM `seconds_between_retry`; "
- "DELETE FROM `preconsented_group`; "
- "DELETE FROM `app_group`; "
- "DELETE FROM `application`; "
- "DELETE FROM `rpc`; "
- "DELETE FROM `version`; "
- "DELETE FROM `message_type`; "
- "DELETE FROM `language`; "
- "DELETE FROM `notifications_by_priority`; "
- "DELETE FROM `hmi_level`; "
- "DELETE FROM `priority`; "
- "DELETE FROM `functional_group`; "
- "DELETE FROM `module_config`; "
- "DELETE FROM `module_meta`; "
- "DELETE FROM `usage_and_error_count`; "
- "DELETE FROM `device`; "
- "COMMIT; "
- "VACUUM;";
-
-const std::string kCheckDBIntegrity = "PRAGMA integrity_check";
-
-const std::string kCheckPgNumber = "PRAGMA page_count";
-
-const std::string kSelectRpc =
- "SELECT DISTINCT `rpc`.`parameter` FROM `rpc` "
- " JOIN `app_group` AS `g` ON (`g`.`functional_group_id` = "
- "`rpc`.`functional_group_id` "
- " AND (`g`.`application_id` = ?)) "
- "WHERE `rpc`.`hmi_level_value` = ? AND `rpc`.`name` = ?";
-
-const std::string kSelectPreloaded =
- "SELECT `preloaded_pt` FROM `module_config` "
- "WHERE `preloaded_pt` = 1 LIMIT 1";
-
-const std::string kUpdatePreloaded =
- "UPDATE `module_config` SET `preloaded_pt` = ?";
-
-const std::string kIsFirstRun = "SELECT `is_first_run` FROM `module_config` ";
-
-const std::string kSetNotFirstRun =
- "UPDATE `module_config` SET `is_first_run`= 0 ";
-
-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 (?, ?, ?)";
-
-const std::string kInsertRpc =
- "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
- " VALUES (?, ?, ?)";
-
-const std::string kInsertRpcWithParameter =
- "INSERT INTO `rpc` (`name`, `hmi_level_value`, `parameter`, "
- "`functional_group_id`) "
- " VALUES (?, ?, ?, ?)";
-
-const std::string kInsertApplication =
- "INSERT OR IGNORE INTO `application` (`id`, `priority_value`, "
- "`is_revoked`, `memory_kb`,"
- " `heart_beat_timeout_ms`, `certificate`) VALUES (?,?,?,?,?,?)";
-
-const std::string kInsertAppGroup =
- "INSERT INTO `app_group` (`application_id`, `functional_group_id`)"
- " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1";
-
-const std::string kInsertNickname =
- "INSERT OR IGNORE INTO `nickname` (`application_id`, `name`) VALUES (?, ?)";
-
-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 =
- "INSERT OR IGNORE INTO `message_type` (`name`) VALUES (?)";
-
-const std::string kInsertLanguage =
- "INSERT OR IGNORE INTO `language` (`code`) VALUES (?)";
-
-const std::string kInsertMessageString =
- "INSERT INTO `message` (`language_code`, `message_type_name`) "
- "VALUES (?, ?)";
-
-const std::string kUpdateModuleConfig =
- "UPDATE `module_config` SET `preloaded_pt` = ?, "
- " `exchange_after_x_ignition_cycles` = ?,"
- " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, "
- " `timeout_after_x_seconds` = ?, `certificate` = ?, `vehicle_make` = ?, "
- " `vehicle_model` = ?, `vehicle_year` = ?";
-
-const std::string kInsertEndpoint =
- "INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
- " VALUES (?, ?, ?)";
-
-const std::string kInsertSecondsBetweenRetry =
- "INSERT INTO `seconds_between_retry` (`index`, `value`) VALUES (?, ?)";
-
-const std::string kInsertNotificationsByPriority =
- "INSERT OR REPLACE INTO `notifications_by_priority` (`priority_value`, "
- "`value`) "
- " VALUES (?, ?)";
-
-const std::string kInsertDeviceData =
- "INSERT OR IGNORE INTO `device` (`id`) VALUES (?)";
-
-const std::string kInsertAppLevel =
- "INSERT INTO `app_level` (`application_id`, `count_of_tls_errors`) "
- "VALUES(?,?)";
-
-const std::string kDeleteSecondsBetweenRetries =
- "DELETE FROM `seconds_between_retry`";
-
-const std::string kDeleteEndpoint = "DELETE FROM `endpoint`";
-
-const std::string kDeleteAppLevel = "DELETE FROM `app_level`";
-
-const std::string kDeleteMessageString = "DELETE FROM `message`";
-
-const std::string kDeleteFunctionalGroup = "DELETE FROM `functional_group`";
-
-const std::string kDeleteRpc = "DELETE FROM `rpc`";
-
-const std::string kDeleteAppGroup = "DELETE FROM `app_group`";
-
-const std::string kSelectModuleConfig =
- "SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, "
- " `exchange_after_x_kilometers`, `exchange_after_x_days`, "
- " `timeout_after_x_seconds`, `certificate`, `vehicle_make`,"
- " `vehicle_model`, `vehicle_year` "
- " FROM `module_config`";
-
-const std::string kSelectEndpoints =
- "SELECT `url`, `service`, `application_id` FROM `endpoint` ";
-
-const std::string kSelectNotificationsPerMin =
- "SELECT `priority_value`, `value` FROM notifications_by_priority";
-
-const std::string kSelectNotificationsPerPriority =
- "SELECT `value` FROM notifications_by_priority WHERE `priority_value` = ? ";
-
-const std::string kSelectAppLevels =
- "SELECT `application_id`, `count_of_tls_errors` "
- "FROM `app_level`";
-
-const std::string kSelectDeviceData = "SELECT * FROM `device`";
-
-const std::string kSelectFunctionalGroups =
- "SELECT `id`,`name`, `user_consent_prompt` "
- "FROM `functional_group`";
-
-const std::string kSelectAllRpcs =
- "SELECT `name`, `hmi_level_value`, `parameter` "
- "FROM `rpc` WHERE `functional_group_id` = ? ";
-
-const std::string kSelectUserMsgsVersion =
- "SELECT DISTINCT `number` FROM `version`";
-
-const std::string kSelectAppPolicies =
- "SELECT `id`, `priority_value`, `memory_kb`, "
- " `heart_beat_timeout_ms`, `certificate` FROM `application`";
-
-const std::string kCollectFriendlyMsg = "SELECT * FROM `message`";
-
-const std::string kSelectAppGroups =
- "SELECT `f`.`name` FROM `app_group` AS `a`"
- " LEFT JOIN `functional_group` AS `f` "
- " ON (`f`.`id` = `a`.`functional_group_id`)"
- " WHERE `a`.`application_id` = ?";
-
-const std::string kSelectNicknames =
- "SELECT DISTINCT `name` FROM `nickname` "
- "WHERE `application_id` = ?";
-
-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`";
-
-const std::string kSelectIgnitionCycles =
- "SELECT `c`.`exchange_after_x_ignition_cycles`, "
- " `m`.`ignition_cycles_since_last_exchange` "
- " FROM `module_config` AS `c`, `module_meta` AS `m` "
- "LIMIT 1";
-
-const std::string kSelectKilometers =
- "SELECT `c`.`exchange_after_x_kilometers`, "
- " `m`.`pt_exchanged_at_odometer_x` "
- " FROM `module_config` AS `c`, `module_meta` AS `m` "
- "LIMIT 1";
-
-const std::string kSelectDays =
- "SELECT `c`.`exchange_after_x_days`, "
- " `m`.`pt_exchanged_x_days_after_epoch` "
- " FROM `module_config` AS `c`, `module_meta` AS `m` "
- "LIMIT 1";
-
-const std::string kIncrementIgnitionCycles =
- "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 1 + "
- " `ignition_cycles_since_last_exchange`";
-
-const std::string kResetIgnitionCycles =
- "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 0";
-
-const std::string kSelectTimeoutResponse =
- "SELECT `timeout_after_x_seconds` FROM `module_config` LIMIT 1";
-
-const std::string kUpdateFlagUpdateRequired =
- "UPDATE `module_meta` SET `flag_update_required` = ?";
-
-const std::string kSelectFlagUpdateRequired =
- "SELECT `flag_update_required` FROM `module_meta` LIMIT 1";
-
-const std::string kUpdateCountersSuccessfulUpdate =
- "UPDATE `module_meta` SET `pt_exchanged_at_odometer_x` = ?,"
- "`pt_exchanged_x_days_after_epoch` = ?";
-
-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` = ?";
-
-const std::string kUpdateApplicationCustomData =
- "UPDATE `application` SET `is_revoked` = ?, `is_default` = ?,"
- "`is_predata` = ? WHERE `id` = ?";
-
-const std::string kSelectApplicationRepresented =
- "SELECT COUNT(`id`) FROM `application` WHERE `id` = ?";
-
-const std::string kSelectApplicationIsDefault =
- "SELECT `is_default` FROM `application` WHERE `id` = ?";
-
-const std::string kUpdateIsDefault =
- "UPDATE `application` SET `is_default` = ? WHERE `id` = ?";
-
-const std::string kDeleteDevice = "DELETE FROM `device` WHERE `id` = ?";
-
-const std::string kDeleteAppGroupByApplicationId =
- "DELETE FROM `app_group` WHERE `application_id` = ?";
-
-const std::string kInsertApplicationFull =
- "INSERT OR IGNORE INTO `application` (`id`, `keep_context`, `steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, "
- " `memory_kb`, `heart_beat_timeout_ms`, `certificate`) "
- " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
-
-const std::string kSelectApplicationFull =
- "SELECT `keep_context`, `steal_focus`, `default_hmi`, `priority_value`, "
- " `is_revoked`, `is_default`, `is_predata`, `memory_kb`,"
- " `heart_beat_timeout_ms`, `certificate` FROM `application` WHERE `id` = "
- "?";
-
-const std::string kSelectDBVersion =
- "SELECT `db_version_hash` from `_internal_data`";
-
-const std::string kUpdateDBVersion =
- "UPDATE `_internal_data` SET `db_version_hash` = ? ";
-
-const std::string kSaveModuleMeta =
- "UPDATE `module_meta` SET "
- "`pt_exchanged_at_odometer_x` = ?, "
- "`pt_exchanged_x_days_after_epoch` = ?, "
- "`ignition_cycles_since_last_exchange` = ? ";
-
-const std::string kSelectModuleMeta = "SELECT* FROM `module_meta`";
-
-} // namespace sql_pt
-} // namespace policy
diff --git a/src/components/policy/src/sql_pt_representation.cc b/src/components/policy/src/sql_pt_representation.cc
deleted file mode 100644
index ff301cf568..0000000000
--- a/src/components/policy/src/sql_pt_representation.cc
+++ /dev/null
@@ -1,1754 +0,0 @@
-/*
- Copyright (c) 2013, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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 <stdlib.h>
-#include <stdint.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include "utils/logger.h"
-#include "utils/file_system.h"
-#include "utils/gen_hash.h"
-#include "policy/sql_pt_representation.h"
-#include "policy/sql_wrapper.h"
-#include "policy/sql_pt_queries.h"
-#include "policy/policy_helper.h"
-#include "policy/cache_manager.h"
-#include "config_profile/profile.h"
-
-namespace policy {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
-
-namespace {
-template <typename T, typename K>
-void InsertUnique(K value, T* array) {
- uint32_t i = 0;
- for (; i < array->size() && array->at(i) != value; ++i) {
- continue;
- }
- if (array->size() == i) {
- array->push_back(value);
- }
-}
-} // namespace
-
-const std::string SQLPTRepresentation::kDatabaseName = "policy";
-
-SQLPTRepresentation::SQLPTRepresentation()
- : db_(new utils::dbms::SQLDatabase(kDatabaseName)) {}
-
-SQLPTRepresentation::~SQLPTRepresentation() {
- db_->Close();
- delete db_;
-}
-
-void SQLPTRepresentation::CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result) {
- utils::dbms::SQLQuery query(db());
-
- if (!query.Prepare(sql_pt::kSelectRpc)) {
- LOG4CXX_WARN(logger_,
- "Incorrect select statement from rpcs"
- << query.LastError().text());
- return;
- }
- query.Bind(0, app_id);
- query.Bind(1, hmi_level);
- query.Bind(2, rpc);
-
- bool ret = query.Next();
- result.hmi_level_permitted = ret ? kRpcAllowed : kRpcDisallowed;
- LOG4CXX_INFO(logger_,
- "Level is " << (result.hmi_level_permitted == kRpcAllowed
- ? "permitted"
- : "not permitted"));
- std::string parameter;
- while (ret) {
- if (!query.IsNull(0)) {
- parameter = query.GetString(0);
- result.list_of_allowed_params.push_back(parameter);
- }
- ret = query.Next();
- }
-}
-
-bool SQLPTRepresentation::IsPTPreloaded() {
- utils::dbms::SQLQuery query(db());
- return query.Prepare(sql_pt::kSelectPreloaded) && query.Next();
-}
-
-int SQLPTRepresentation::IgnitionCyclesBeforeExchange() {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectIgnitionCycles) || !query.Exec()) {
- LOG4CXX_WARN(logger_, "Can not select ignition cycles");
- return 0;
- }
- int limit = query.GetInteger(0);
- int current = query.GetInteger(1);
-
- if (limit < 0 || current < 0 || current > limit) {
- return 0;
- }
-
- return limit - current;
-}
-
-int SQLPTRepresentation::KilometersBeforeExchange(int current) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectKilometers) || !query.Exec()) {
- LOG4CXX_WARN(logger_, "Can not select kilometers");
- return 0;
- }
- int limit = query.GetInteger(0);
- int last = query.GetInteger(1);
-
- if (limit < 0 || last < 0 || current < 0 || current < last ||
- limit < (current - last)) {
- return 0;
- }
-
- return limit - (current - last);
-}
-
-bool SQLPTRepresentation::SetCountersPassedForSuccessfulUpdate(
- int kilometers, int days_after_epoch) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kUpdateCountersSuccessfulUpdate)) {
- LOG4CXX_WARN(logger_,
- "Wrong update query for counters on successful update.");
- return false;
- }
- query.Bind(0, kilometers);
- query.Bind(1, days_after_epoch);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed to update counters on successful update.");
- return false;
- }
- return true;
-}
-
-int SQLPTRepresentation::DaysBeforeExchange(int current) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectDays) || !query.Exec()) {
- LOG4CXX_WARN(logger_, "Can not select days");
- return 0;
- }
- int limit = query.GetInteger(0);
- int last = query.GetInteger(1);
-
- if (0 == last) {
- return limit;
- }
-
- if (limit < 0 || last < 0 || current < 0 || current < last ||
- limit < (current - last)) {
- return 0;
- }
-
- return limit - (current - last);
-}
-
-int SQLPTRepresentation::TimeoutResponse() {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectTimeoutResponse) || !query.Exec()) {
- LOG4CXX_INFO(logger_, "Can not select timeout response for retry sequence");
- const int kDefault = 30;
- return kDefault;
- }
- return query.GetInteger(0);
-}
-
-bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectSecondsBetweenRetries)) {
- LOG4CXX_INFO(logger_,
- "Incorrect select statement from seconds between retries");
- return false;
- }
- while (query.Next()) {
- seconds->push_back(query.GetInteger(0));
- }
- return true;
-}
-
-std::vector<UserFriendlyMessage> SQLPTRepresentation::GetUserFriendlyMsg(
- const std::vector<std::string>& msg_codes, const std::string& language) {
- std::vector<UserFriendlyMessage> result;
- 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) {
- UserFriendlyMessage msg;
- msg.message_code = *it;
- result.push_back(msg);
- }
- return result;
-}
-
-EndpointUrls SQLPTRepresentation::GetUpdateUrls(int service_type) {
- LOG4CXX_INFO(logger_,
- "SQLPTRepresentation::GetUpdateUrls for " << service_type);
- utils::dbms::SQLQuery query(db());
- EndpointUrls ret;
- if (query.Prepare(sql_pt::kSelectEndpoint)) {
- query.Bind(0, service_type);
- while (query.Next()) {
- EndpointData data;
-
- data.url.push_back(query.GetString(0));
- if (!query.IsNull(1)) {
- data.app_id = query.GetString(1);
- }
- ret.push_back(data);
- }
- } else {
- LOG4CXX_WARN(logger_, "Invalid select endpoints statement.");
- }
- return ret;
-}
-
-std::string SQLPTRepresentation::GetLockScreenIconUrl() const {
- utils::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_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectNotificationsPerPriority)) {
- LOG4CXX_WARN(logger_,
- "Incorrect select statement for priority "
- "notification number.");
- return 0;
- }
- query.Bind(0, priority);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect select from notifications by priority.");
- return 0;
- }
-
- if (!query.IsNull(0)) {
- return query.GetInteger(0);
- }
-
- return 0;
-}
-
-bool SQLPTRepresentation::GetPriority(const std::string& policy_app_id,
- std::string* priority) {
- LOG4CXX_AUTO_TRACE(logger_);
- if (NULL == priority) {
- LOG4CXX_WARN(logger_, "Input priority parameter is null.");
- return false;
- }
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectPriority)) {
- LOG4CXX_INFO(logger_, "Incorrect statement for priority.");
- return false;
- }
-
- query.Bind(0, policy_app_id);
-
- if (!query.Exec()) {
- LOG4CXX_INFO(logger_, "Error during select priority.");
- return false;
- }
-
- if (query.IsNull(0)) {
- priority->clear();
- return true;
- }
-
- priority->assign(query.GetString(0));
-
- return true;
-}
-
-InitResult SQLPTRepresentation::Init(const PolicySettings* settings) {
- settings_ = settings;
- LOG4CXX_AUTO_TRACE(logger_);
-#ifdef BUILD_TESTS
- open_counter_ = 0;
-#endif // BUILD_TESTS
- std::string path = get_settings().app_storage_folder();
- if (!path.empty()) {
- db_->set_path(path + "/");
- }
- if (!db_->Open()) {
- LOG4CXX_ERROR(logger_, "Failed opening database.");
- LOG4CXX_INFO(logger_, "Starting opening retries.");
- const uint16_t attempts = get_settings().attempts_to_open_policy_db();
- LOG4CXX_DEBUG(logger_, "Total attempts number is: " << attempts);
- bool is_opened = false;
- const uint16_t open_attempt_timeout_ms =
- get_settings().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);
-#ifdef BUILD_TESTS
- ++open_counter_;
-#endif // BUILD_TESTS
- 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__
- utils::dbms::SQLQuery check_pages(db());
- if (!check_pages.Prepare(sql_pt::kCheckPgNumber) || !check_pages.Next()) {
- LOG4CXX_WARN(logger_, "Incorrect pragma for page counting.");
- } else {
- if (0 < check_pages.GetInteger(0)) {
- utils::dbms::SQLQuery db_check(db());
- if (!db_check.Prepare(sql_pt::kCheckDBIntegrity)) {
- LOG4CXX_WARN(logger_, "Incorrect pragma for integrity check.");
- } else {
- while (db_check.Next()) {
- if (db_check.GetString(0).compare("ok") == 0) {
- utils::dbms::SQLQuery check_first_run(db());
- if (check_first_run.Prepare(sql_pt::kIsFirstRun) &&
- check_first_run.Next()) {
- LOG4CXX_INFO(logger_,
- "Selecting is first run "
- << check_first_run.GetBoolean(0));
- if (check_first_run.GetBoolean(0)) {
- utils::dbms::SQLQuery set_not_first_run(db());
- set_not_first_run.Exec(sql_pt::kSetNotFirstRun);
- return InitResult::SUCCESS;
- }
- } else {
- LOG4CXX_WARN(logger_, "Incorrect select is first run");
- }
- return InitResult::EXISTS;
- } else {
- LOG4CXX_ERROR(logger_,
- "Existing policy table representation is invlaid.");
- // TODO(PV): add handle
- return InitResult::FAIL;
- }
- }
- }
- }
- }
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kCreateSchema)) {
- LOG4CXX_ERROR(
- logger_,
- "Failed creating schema of database: " << query.LastError().text());
- return InitResult::FAIL;
- }
- if (!query.Exec(sql_pt::kInsertInitData)) {
- LOG4CXX_ERROR(
- logger_,
- "Failed insert init data to database: " << query.LastError().text());
- return InitResult::FAIL;
- }
- return InitResult::SUCCESS;
-}
-
-bool SQLPTRepresentation::Close() {
- db_->Close();
- return db_->LastError().number() == utils::dbms::OK;
-}
-
-const VehicleInfo SQLPTRepresentation::GetVehicleInfo() const {
- policy_table::ModuleConfig module_config;
- GatherModuleConfig(&module_config);
- VehicleInfo vehicle_info;
- vehicle_info.vehicle_make = *module_config.vehicle_make;
- vehicle_info.vehicle_model = *module_config.vehicle_model;
- vehicle_info.vehicle_year = *module_config.vehicle_year;
- return vehicle_info;
-}
-
-bool SQLPTRepresentation::Drop() {
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDropSchema)) {
- LOG4CXX_WARN(logger_,
- "Failed dropping database: " << query.LastError().text());
- return false;
- }
- return true;
-}
-
-void SQLPTRepresentation::WriteDb() {
- db_->Backup();
-}
-
-bool SQLPTRepresentation::Clear() {
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDeleteData)) {
- LOG4CXX_ERROR(logger_,
- "Failed clearing 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;
-}
-
-bool SQLPTRepresentation::RefreshDB() {
- utils::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_AUTO_TRACE(logger_);
- utils::SharedPtr<policy_table::Table> table = new policy_table::Table();
- GatherModuleMeta(&*table->policy_table.module_meta);
- GatherModuleConfig(&table->policy_table.module_config);
- GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts);
- GatherDeviceData(&*table->policy_table.device_data);
- GatherFunctionalGroupings(&table->policy_table.functional_groupings);
- GatherConsumerFriendlyMessages(
- &*table->policy_table.consumer_friendly_messages);
- GatherApplicationPoliciesSection(&table->policy_table.app_policies_section);
- return table;
-}
-
-void SQLPTRepresentation::GatherModuleMeta(
- policy_table::ModuleMeta* meta) const {
- LOG4CXX_INFO(logger_, "Gather Module Meta Info");
- utils::dbms::SQLQuery query(db());
- if (query.Prepare(sql_pt::kSelectModuleMeta) && query.Next()) {
- *meta->pt_exchanged_at_odometer_x = query.GetInteger(0);
- *meta->pt_exchanged_x_days_after_epoch = query.GetInteger(1);
- *meta->ignition_cycles_since_last_exchange = query.GetInteger(2);
- }
-}
-
-void SQLPTRepresentation::GatherModuleConfig(
- policy_table::ModuleConfig* config) const {
- LOG4CXX_INFO(logger_, "Gather Configuration Info");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectModuleConfig) || !query.Next()) {
- LOG4CXX_WARN(logger_, "Incorrect select statement for module config");
- } else {
- *config->preloaded_pt = query.GetBoolean(0);
- config->exchange_after_x_ignition_cycles = query.GetInteger(1);
- config->exchange_after_x_kilometers = query.GetInteger(2);
- config->exchange_after_x_days = query.GetInteger(3);
- config->timeout_after_x_seconds = query.GetInteger(4);
- *config->certificate = query.GetString(5);
- *config->vehicle_make = query.GetString(6);
- *config->vehicle_model = query.GetString(7);
- *config->vehicle_year = query.GetString(8);
- *config->preloaded_date = query.GetString(9);
- }
-
- utils::dbms::SQLQuery endpoints(db());
- if (!endpoints.Prepare(sql_pt::kSelectEndpoints)) {
- LOG4CXX_WARN(logger_, "Incorrect select statement for endpoints");
- } else {
- while (endpoints.Next()) {
- const std::string& url = endpoints.GetString(0);
- const std::string& service = endpoints.GetString(1);
- const std::string& app_id = endpoints.GetString(2);
- config->endpoints[service][app_id].push_back(url);
- }
- }
-
- utils::dbms::SQLQuery notifications(db());
- if (!notifications.Prepare(sql_pt::kSelectNotificationsPerMin)) {
- LOG4CXX_WARN(logger_, "Incorrect select statement for notifications");
- } else {
- while (notifications.Next()) {
- config->notifications_per_minute_by_priority[notifications.GetString(0)] =
- notifications.GetInteger(1);
- }
- }
- utils::dbms::SQLQuery seconds(db());
- if (!seconds.Prepare(sql_pt::kSelectSecondsBetweenRetries)) {
- LOG4CXX_INFO(logger_,
- "Incorrect select statement from seconds between retries");
- } else {
- while (seconds.Next()) {
- config->seconds_between_retries.push_back(seconds.GetInteger(0));
- }
- }
-}
-
-bool SQLPTRepresentation::GatherUsageAndErrorCounts(
- policy_table::UsageAndErrorCounts* counts) const {
- LOG4CXX_INFO(logger_, "Gather Usage and Error Counts.");
- utils::dbms::SQLQuery query(db());
- if (query.Prepare(sql_pt::kSelectAppLevels)) {
- policy_table::AppLevel app_level;
- app_level.mark_initialized();
- while (query.Next()) {
- app_level.count_of_tls_errors = query.GetInteger(1);
- const std::string app_id = query.GetString(0);
- (*counts->app_level)[app_id] = app_level;
- }
- return true;
- }
- return false;
-}
-
-void SQLPTRepresentation::GatherDeviceData(
- policy_table::DeviceData* data) const {
- LOG4CXX_INFO(logger_, "Gather device data.");
- data->mark_initialized();
-
- utils::dbms::SQLQuery query(db());
- if (query.Prepare(sql_pt::kSelectDeviceData)) {
- policy_table::DeviceParams device_data;
- device_data.mark_initialized();
- while (query.Next()) {
- const std::string device_id = query.GetString(0);
- (*data)[device_id] = device_data;
- }
- }
-}
-
-bool SQLPTRepresentation::GatherFunctionalGroupings(
- policy_table::FunctionalGroupings* groups) const {
- LOG4CXX_INFO(logger_, "Gather Functional Groupings info");
- utils::dbms::SQLQuery func_group(db());
- if (!func_group.Prepare(sql_pt::kSelectFunctionalGroups)) {
- LOG4CXX_WARN(logger_, "Incorrect select from functional_groupings");
- return false;
- }
- utils::dbms::SQLQuery rpcs(db());
- if (!rpcs.Prepare(sql_pt::kSelectAllRpcs)) {
- LOG4CXX_WARN(logger_, "Incorrect select all from rpc");
- return false;
- }
- while (func_group.Next()) {
- policy_table::Rpcs rpcs_tbl;
- if (!func_group.IsNull(2)) {
- *rpcs_tbl.user_consent_prompt = func_group.GetString(2);
- }
- int func_id = func_group.GetInteger(0);
- rpcs.Bind(0, func_id);
- while (rpcs.Next()) {
- if (!rpcs.IsNull(1)) {
- policy_table::HmiLevel level;
- if (policy_table::EnumFromJsonString(rpcs.GetString(1), &level)) {
- InsertUnique(level, &rpcs_tbl.rpcs[rpcs.GetString(0)].hmi_levels);
- }
- }
- if (!rpcs.IsNull(2)) {
- policy_table::Parameter param;
- if (policy_table::EnumFromJsonString(rpcs.GetString(2), &param)) {
- InsertUnique(param, &(*rpcs_tbl.rpcs[rpcs.GetString(0)].parameters));
- }
- }
- }
- if (!rpcs_tbl.rpcs.is_initialized()) {
- rpcs_tbl.rpcs.set_to_null();
- }
- rpcs.Reset();
- (*groups)[func_group.GetString(1)] = rpcs_tbl;
- }
- return true;
-}
-
-bool SQLPTRepresentation::GatherConsumerFriendlyMessages(
- policy_table::ConsumerFriendlyMessages* messages) const {
- LOG4CXX_INFO(logger_, "Gather Consumer Friendly Messages");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectUserMsgsVersion) || !query.Next()) {
- LOG4CXX_WARN(logger_, "Incorrect select from consumer_friendly_messages");
- return false;
- }
-
- messages->version = query.GetString(0);
-
- if (query.Prepare(sql_pt::kCollectFriendlyMsg)) {
- while (query.Next()) {
- UserFriendlyMessage msg;
- msg.message_code = query.GetString(7);
- std::string language = query.GetString(6);
-
- (*messages->messages)[msg.message_code].languages[language];
- }
- } else {
- LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages.");
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::GatherApplicationPoliciesSection(
- policy_table::ApplicationPoliciesSection* policies) const {
- LOG4CXX_INFO(logger_, "Gather applications policies");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectAppPolicies)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app_policies");
- return false;
- }
-
- while (query.Next()) {
- rpc::Nullable<policy_table::ApplicationParams> params;
- const std::string& app_id = query.GetString(0);
- if (IsApplicationRevoked(app_id)) {
- params.set_to_null();
- (*policies).apps[app_id] = params;
- continue;
- }
- if (IsDefaultPolicy(app_id)) {
- (*policies).apps[app_id].set_to_string(kDefaultId);
- }
- if (IsPredataPolicy(app_id)) {
- (*policies).apps[app_id].set_to_string(kPreDataConsentId);
- }
- if (kDeviceId == app_id) {
- // 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);
- params.priority = priority;
-
- *params.memory_kb = query.GetInteger(2);
-
- *params.heart_beat_timeout_ms = query.GetUInteger(3);
- if (!query.IsNull(3)) {
- *params.certificate = query.GetString(4);
- }
- if (!GatherAppGroup(app_id, &params.groups)) {
- return false;
- }
- if (!GatherNickName(app_id, &*params.nicknames)) {
- return false;
- }
- if (!GatherAppType(app_id, &*params.AppHMIType)) {
- return false;
- }
- if (!GatherRequestType(app_id, &*params.RequestType)) {
- return false;
- }
-
- (*policies).apps[app_id] = params;
- }
- return true;
-}
-
-bool SQLPTRepresentation::Save(const policy_table::Table& table) {
- LOG4CXX_AUTO_TRACE(logger_);
- db_->BeginTransaction();
- if (!SaveFunctionalGroupings(table.policy_table.functional_groupings)) {
- db_->RollbackTransaction();
- return false;
- }
- if (!SaveApplicationPoliciesSection(
- table.policy_table.app_policies_section)) {
- db_->RollbackTransaction();
- return false;
- }
- if (!SaveModuleConfig(table.policy_table.module_config)) {
- db_->RollbackTransaction();
- return false;
- }
- if (!SaveConsumerFriendlyMessages(
- *table.policy_table.consumer_friendly_messages)) {
- db_->RollbackTransaction();
- return false;
- }
-
- if (!SaveDeviceData(*table.policy_table.device_data)) {
- db_->RollbackTransaction();
- return false;
- }
- if (!SaveUsageAndErrorCounts(*table.policy_table.usage_and_error_counts)) {
- db_->RollbackTransaction();
- return false;
- }
- if (!SaveModuleMeta(*table.policy_table.module_meta)) {
- db_->RollbackTransaction();
- return false;
- }
- db_->CommitTransaction();
- return true;
-}
-
-bool SQLPTRepresentation::SaveFunctionalGroupings(
- const policy_table::FunctionalGroupings& groups) {
- utils::dbms::SQLQuery query_delete(db());
- if (!query_delete.Exec(sql_pt::kDeleteRpc)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from rpc.");
- return false;
- }
-
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDeleteFunctionalGroup)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from seconds between retries.");
- return false;
- }
- if (!query.Prepare(sql_pt::kInsertFunctionalGroup)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for functional groups");
- return false;
- }
-
- policy_table::FunctionalGroupings::const_iterator it;
-
- for (it = groups.begin(); it != groups.end(); ++it) {
- // Since we uses this id in other tables, we have to be sure
- // that id for certain group will be same in case when
- // we drop records from the table and add them again.
- // That's why we use hash as a primary key insted of
- // simple auto incremental index.
- const long int id = abs(CacheManager::GenerateHash(it->first));
- // SQLite's Bind doesn support 'long' type
- // So we need to explicitly cast it to int64_t
- // to avoid ambiguity.
- query.Bind(0, static_cast<int64_t>(id));
- query.Bind(1, it->first);
- it->second.user_consent_prompt.is_initialized()
- ? query.Bind(2, *(it->second.user_consent_prompt))
- : query.Bind(2);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into functional groups");
- return false;
- }
-
- if (!SaveRpcs(query.LastInsertId(), it->second.rpcs)) {
- return false;
- }
- }
- return true;
-}
-
-bool SQLPTRepresentation::SaveRpcs(int64_t group_id,
- const policy_table::Rpc& rpcs) {
- utils::dbms::SQLQuery query(db());
- utils::dbms::SQLQuery query_parameter(db());
- if (!query.Prepare(sql_pt::kInsertRpc) ||
- !query_parameter.Prepare(sql_pt::kInsertRpcWithParameter)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for rpc");
- return false;
- }
-
- policy_table::Rpc::const_iterator it;
- for (it = rpcs.begin(); it != rpcs.end(); ++it) {
- const policy_table::HmiLevels& hmi_levels = it->second.hmi_levels;
- // TODO(IKozyrenko): Check logic if optional container is missing
- const policy_table::Parameters& parameters = *it->second.parameters;
- policy_table::HmiLevels::const_iterator hmi_it;
- policy_table::Parameters::const_iterator ps_it;
- for (hmi_it = hmi_levels.begin(); hmi_it != hmi_levels.end(); ++hmi_it) {
- if (!parameters.empty()) {
- 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)));
- query_parameter.Bind(
- 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");
- return false;
- }
- }
- } else {
- query.Bind(0, it->first);
- query.Bind(1, std::string(policy_table::EnumToJsonString(*hmi_it)));
- query.Bind(2, group_id);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into rpc");
- return false;
- }
- }
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveApplicationPoliciesSection(
- const policy_table::ApplicationPoliciesSection& policies) {
- utils::dbms::SQLQuery query_delete(db());
- if (!query_delete.Exec(sql_pt::kDeleteAppGroup)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
- return false;
- }
- if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from application.");
- return false;
- }
-
- if (!query_delete.Exec(sql_pt::kDeleteRequestType)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from request type.");
- return false;
- }
-
- // 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 =
- 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 =
- policies.apps.find(kPreDataConsentId);
- if (policies.apps.end() != it_pre_data_consented) {
- if (!SaveSpecificAppPolicy(*it_pre_data_consented)) {
- return false;
- }
- }
-
- if (!SaveDevicePolicy(policies.device)) {
- return false;
- }
-
- policy_table::ApplicationPolicies::const_iterator it;
- for (it = policies.apps.begin(); it != policies.apps.end(); ++it) {
- // Skip saving of predefined app, since they should be saved before
- if (IsPredefinedApp(*it)) {
- continue;
- }
- if (!SaveSpecificAppPolicy(*it)) {
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveSpecificAppPolicy(
- const policy_table::ApplicationPolicies::value_type& app) {
- utils::dbms::SQLQuery app_query(db());
- if (!app_query.Prepare(sql_pt::kInsertApplication)) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert statement into application (device).");
- return false;
- }
-
- app_query.Bind(0, app.first);
- app_query.Bind(
- 1, std::string(policy_table::EnumToJsonString(app.second.priority)));
- app_query.Bind(2, app.second.is_null());
- app_query.Bind(3, *app.second.memory_kb);
- app_query.Bind(4, static_cast<int64_t>(*app.second.heart_beat_timeout_ms));
- app.second.certificate.is_initialized()
- ? app_query.Bind(5, *app.second.certificate)
- : app_query.Bind(5);
- if (!app_query.Exec() || !app_query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into application.");
- return false;
- }
-
- if (app.second.is_string()) {
- if (kDefaultId.compare(app.second.get_string()) == 0) {
- if (!SetDefaultPolicy(app.first)) {
- return false;
- }
- // Stop saving other params, since predefined permissions already set
- return true;
- }
- }
-
- if (!SaveAppGroup(app.first, app.second.groups)) {
- return false;
- }
- if (!SaveNickname(app.first, *app.second.nicknames)) {
- return false;
- }
- 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) {
- utils::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;
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveAppGroup(
- const std::string& app_id, const policy_table::Strings& app_groups) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertAppGroup)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for app group");
- return false;
- }
- LOG4CXX_INFO(logger_, "SaveAppGroup");
- policy_table::Strings::const_iterator it;
- for (it = app_groups.begin(); it != app_groups.end(); ++it) {
- std::string ssss = *it;
- LOG4CXX_INFO(logger_, "Group: " << ssss);
- query.Bind(0, app_id);
- query.Bind(1, *it);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert into app group."
- << query.LastError().text());
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveNickname(const std::string& app_id,
- const policy_table::Strings& nicknames) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertNickname)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for nickname");
- return false;
- }
-
- policy_table::Strings::const_iterator it;
- for (it = nicknames.begin(); it != nicknames.end(); ++it) {
- query.Bind(0, app_id);
- query.Bind(1, *it);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into nickname.");
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveAppType(const std::string& app_id,
- const policy_table::AppHMITypes& types) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertAppType)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for app type");
- return false;
- }
-
- policy_table::AppHMITypes::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 app type.");
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveRequestType(
- const std::string& app_id, const policy_table::RequestTypes& types) {
- utils::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) {
- utils::dbms::SQLQuery query(db());
-
- if (!query.Prepare(sql_pt::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, odometer);
- query.Bind(1, *(meta.pt_exchanged_x_days_after_epoch));
- query.Bind(2, *(meta.ignition_cycles_since_last_exchange));
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect update for module_meta.");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveModuleConfig(
- const policy_table::ModuleConfig& config) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kUpdateModuleConfig)) {
- LOG4CXX_WARN(logger_, "Incorrect update statement for module config");
- return 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);
- query.Bind(4, config.timeout_after_x_seconds);
- query.Bind(5, (*config.certificate));
- config.vehicle_make.is_initialized() ? query.Bind(6, *(config.vehicle_make))
- : query.Bind(6);
- config.vehicle_model.is_initialized() ? query.Bind(7, *(config.vehicle_model))
- : query.Bind(7);
- config.vehicle_year.is_initialized() ? query.Bind(8, *(config.vehicle_year))
- : query.Bind(8);
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect update module config");
- return false;
- }
-
- if (!SaveSecondsBetweenRetries(config.seconds_between_retries)) {
- return false;
- }
-
- if (!SaveNumberOfNotificationsPerMinute(
- config.notifications_per_minute_by_priority)) {
- return false;
- }
-
- if (!SaveServiceEndpoints(config.endpoints)) {
- return false;
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveServiceEndpoints(
- const policy_table::ServiceEndpoints& endpoints) {
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDeleteEndpoint)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from endpoint.");
- return false;
- }
-
- if (!query.Prepare(sql_pt::kInsertEndpoint)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for endpoint");
- return false;
- }
-
- policy_table::ServiceEndpoints::const_iterator it;
- for (it = endpoints.begin(); it != endpoints.end(); ++it) {
- const policy_table::URLList& apps = it->second;
- policy_table::URLList::const_iterator app_it;
- for (app_it = apps.begin(); app_it != apps.end(); ++app_it) {
- 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) {
- query.Bind(0, it->first);
- query.Bind(1, *url_it);
- query.Bind(2, app_it->first);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into endpoint");
- return false;
- }
- }
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveConsumerFriendlyMessages(
- const policy_table::ConsumerFriendlyMessages& messages) {
- 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
- // the policy table. So it won't be changed/updated
- if (messages.messages.is_initialized()) {
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDeleteMessageString)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from message.");
- return false;
- }
-
- if (query.Prepare(sql_pt::kUpdateVersion)) {
- query.Bind(0, messages.version);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect update into version.");
- return false;
- }
- } else {
- LOG4CXX_WARN(logger_, "Incorrect update statement for version.");
- return false;
- }
-
- policy_table::Messages::const_iterator it;
- for (it = messages.messages->begin(); it != messages.messages->end();
- ++it) {
- if (!SaveMessageType(it->first)) {
- return false;
- }
- const policy_table::Languages& langs = it->second.languages;
- policy_table::Languages::const_iterator lang_it;
- for (lang_it = langs.begin(); lang_it != langs.end(); ++lang_it) {
- if (!SaveLanguage(lang_it->first)) {
- return false;
- }
- if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) {
- return false;
- }
- }
- }
- } else {
- LOG4CXX_INFO(logger_, "Messages list is empty");
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveMessageType(const std::string& type) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertMessageType)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for message type.");
- return false;
- }
-
- query.Bind(0, type);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into message type.");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveLanguage(const std::string& code) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertLanguage)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for language.");
- return false;
- }
-
- query.Bind(0, code);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into language.");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveMessageString(
- const std::string& type,
- const std::string& lang,
- const policy_table::MessageString& strings) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertMessageString)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for message.");
- return false;
- }
-
- query.Bind(0, lang);
- query.Bind(1, type);
-
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into message.");
- return false;
- }
- return true;
-}
-
-bool SQLPTRepresentation::SaveSecondsBetweenRetries(
- const policy_table::SecondsBetweenRetries& seconds) {
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDeleteSecondsBetweenRetries)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from seconds between retries.");
- return false;
- }
- if (!query.Prepare(sql_pt::kInsertSecondsBetweenRetry)) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert statement for seconds between retries.");
- return false;
- }
-
- for (uint32_t i = 0; i < seconds.size(); ++i) {
- query.Bind(0, static_cast<int>(i));
- query.Bind(1, seconds[i]);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into seconds between retries.");
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveNumberOfNotificationsPerMinute(
- const policy_table::NumberOfNotificationsPerMinute& notifications) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertNotificationsByPriority)) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert statement for notifications by priority.");
- return false;
- }
-
- policy_table::NumberOfNotificationsPerMinute::const_iterator it;
- for (it = notifications.begin(); it != notifications.end(); ++it) {
- query.Bind(0, it->first);
- query.Bind(1, it->second);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into notifications by priority.");
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveDeviceData(
- const policy_table::DeviceData& devices) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertDeviceData)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for device data.");
- return false;
- }
-
- policy_table::DeviceData::const_iterator it;
- for (it = devices.begin(); it != devices.end(); ++it) {
- query.Bind(0, it->first);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into device data.");
- return false;
- }
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::SaveUsageAndErrorCounts(
- const policy_table::UsageAndErrorCounts& counts) {
- const_cast<policy_table::UsageAndErrorCounts&>(counts).mark_initialized();
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kDeleteAppLevel)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from app level.");
- return false;
- }
- if (!query.Prepare(sql_pt::kInsertAppLevel)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for app level.");
- return false;
- }
-
- policy_table::AppLevels::const_iterator it;
- 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);
- query.Bind(1, it->second.count_of_tls_errors);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_, "Incorrect insert into app level.");
- return false;
- }
- }
- return true;
-}
-
-void SQLPTRepresentation::IncrementIgnitionCycles() {
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kIncrementIgnitionCycles)) {
- LOG4CXX_WARN(logger_, "Failed incrementing ignition cycles");
- }
-}
-
-void SQLPTRepresentation::ResetIgnitionCycles() {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Exec(sql_pt::kResetIgnitionCycles)) {
- LOG4CXX_WARN(logger_, "Failed to reset ignition cycles number.");
- }
-}
-
-bool SQLPTRepresentation::UpdateRequired() const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectFlagUpdateRequired) || !query.Exec()) {
- LOG4CXX_WARN(logger_,
- "Failed select update required flag from module meta");
- return false;
- }
- return query.GetBoolean(0);
-}
-
-void SQLPTRepresentation::SaveUpdateRequired(bool value) {
- utils::dbms::SQLQuery query(db());
- // TODO(AOleynik): Quick fix, will be reworked
- if (!query.Prepare(/*sql_pt::kUpdateFlagUpdateRequired*/
- "UPDATE `module_meta` SET `flag_update_required` = ?")) {
- LOG4CXX_WARN(logger_,
- "Incorrect update into module meta (update_required): "
- << strerror(errno));
- return;
- }
- query.Bind(0, value);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed update module meta (update_required)");
- }
-}
-
-bool SQLPTRepresentation::GetInitialAppData(const std::string& app_id,
- StringArray* nicknames,
- StringArray* app_types) {
- LOG4CXX_INFO(logger_, "Getting initial application data.");
- utils::dbms::SQLQuery app_names(db());
- if (!app_names.Prepare(sql_pt::kSelectNicknames)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app nicknames");
- return false;
- }
- utils::dbms::SQLQuery app_hmi_types(db());
- if (!app_hmi_types.Prepare(sql_pt::kSelectAppTypes)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app types");
- return false;
- }
- app_names.Bind(0, app_id);
- while (app_names.Next()) {
- nicknames->push_back(app_names.GetString(0));
- }
- app_names.Reset();
- app_hmi_types.Bind(0, app_id);
- while (app_hmi_types.Next()) {
- app_types->push_back(app_hmi_types.GetString(0));
- }
- app_hmi_types.Reset();
- return true;
-}
-
-bool SQLPTRepresentation::GetFunctionalGroupings(
- policy_table::FunctionalGroupings& groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- return GatherFunctionalGroupings(&groups);
-}
-
-bool SQLPTRepresentation::GatherAppType(
- const std::string& app_id, policy_table::AppHMITypes* app_types) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectAppTypes)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app types");
- return false;
- }
-
- query.Bind(0, app_id);
- while (query.Next()) {
- policy_table::AppHMIType type;
- if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) {
- return false;
- }
- app_types->push_back(type);
- }
- return true;
-}
-
-bool SQLPTRepresentation::GatherRequestType(
- const std::string& app_id,
- policy_table::RequestTypes* request_types) const {
- utils::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 {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectNicknames)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app nicknames");
- return false;
- }
-
- query.Bind(0, app_id);
- while (query.Next()) {
- nicknames->push_back(query.GetString(0));
- }
- return true;
-}
-
-bool SQLPTRepresentation::GatherAppGroup(
- const std::string& app_id, policy_table::Strings* app_groups) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectAppGroups)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app groups");
- return false;
- }
-
- query.Bind(0, app_id);
- while (query.Next()) {
- app_groups->push_back(query.GetString(0));
- }
- return true;
-}
-
-bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id,
- bool is_revoked,
- bool is_default,
- bool is_predata) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kUpdateApplicationCustomData)) {
- LOG4CXX_WARN(logger_, "Incorrect update in application");
- return false;
- }
-
- query.Bind(0, is_revoked);
- query.Bind(1, is_default);
- query.Bind(2, is_predata);
- query.Bind(3, app_id);
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed update in application");
- return false;
- }
-
- return true;
-}
-
-bool SQLPTRepresentation::IsApplicationRevoked(
- const std::string& app_id) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectApplicationRevoked)) {
- LOG4CXX_WARN(logger_, "Incorrect select from is_revoked of application");
- }
-
- query.Bind(0, app_id);
-
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed select is_revoked of application");
- return false;
- }
- return query.IsNull(0) ? false : query.GetBoolean(0);
-}
-bool SQLPTRepresentation::IsApplicationRepresented(
- const std::string& app_id) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectApplicationRepresented)) {
- LOG4CXX_WARN(logger_, "Incorrect select application by id");
- return false;
- }
-
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed select application by id");
- return false;
- }
- return query.GetInteger(0) != 0;
-}
-
-bool SQLPTRepresentation::IsDefaultPolicy(const std::string& app_id) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectApplicationIsDefault)) {
- LOG4CXX_WARN(logger_, "Incorrect select application by id");
- return false;
- }
-
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed select application by id");
- return false;
- }
- return query.IsNull(0) ? false : query.GetBoolean(0);
-}
-
-bool SQLPTRepresentation::IsPredataPolicy(const std::string& app_id) const {
- return false;
-}
-
-bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kDeleteAppGroupByApplicationId)) {
- LOG4CXX_ERROR(logger_, "Incorrect statement to delete from app_group.");
- return false;
- }
- query.Bind(0, app_id);
- if (!query.Exec()) {
- LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
- return false;
- }
-
- if (!CopyApplication(kDefaultId, app_id)) {
- return false;
- }
-
- SetPreloaded(false);
-
- policy_table::Strings default_groups;
- if (!GatherAppGroup(kDefaultId, &default_groups) ||
- !SaveAppGroup(app_id, default_groups)) {
- return false;
- }
- policy_table::RequestTypes request_types;
- if (!GatherRequestType(kDefaultId, &request_types) ||
- !SaveRequestType(app_id, request_types)) {
- return false;
- }
- policy_table::AppHMITypes app_types;
- if (!GatherAppType(kDefaultId, &app_types) ||
- !SaveAppType(app_id, app_types)) {
- return false;
- }
- return SetIsDefault(app_id, true);
-}
-
-bool SQLPTRepresentation::SetIsDefault(const std::string& app_id,
- bool is_default) const {
- LOG4CXX_TRACE(logger_, "Set flag is_default of application");
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kUpdateIsDefault)) {
- LOG4CXX_WARN(logger_, "Incorect statement for updating is_default");
- return false;
- }
-
- query.Bind(0, is_default);
- query.Bind(1, app_id);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed update is_default");
- return false;
- }
- return true;
-}
-
-void SQLPTRepresentation::RemoveDB() const {
- file_system::DeleteFile(db_->get_path());
-}
-
-bool SQLPTRepresentation::IsDBVersionActual() const {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectDBVersion) || !query.Exec()) {
- LOG4CXX_ERROR(logger_,
- "Failed to get DB version: " << query.LastError().text());
- return false;
- }
-
- const int32_t saved_db_version = query.GetInteger(0);
- const int32_t current_db_version = GetDBVersion();
- LOG4CXX_DEBUG(logger_,
- "Saved DB version is: " << saved_db_version
- << ". Current DB vesion is: "
- << current_db_version);
-
- return current_db_version == saved_db_version;
-}
-
-bool SQLPTRepresentation::UpdateDBVersion() const {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kUpdateDBVersion)) {
- LOG4CXX_ERROR(logger_,
- "Incorrect DB version query: " << query.LastError().text());
- return false;
- }
-
- const int32_t db_version = GetDBVersion();
- LOG4CXX_DEBUG(logger_, "DB version will be updated to: " << db_version);
- query.Bind(0, db_version);
-
- if (!query.Exec()) {
- LOG4CXX_ERROR(logger_,
- "DB version getting failed: " << query.LastError().text());
- return false;
- }
-
- return true;
-}
-
-const int32_t SQLPTRepresentation::GetDBVersion() const {
- return utils::Djb2HashFromString(sql_pt::kCreateSchema);
-}
-
-utils::dbms::SQLDatabase* SQLPTRepresentation::db() const {
-#ifdef __QNX__
- utils::dbms::SQLDatabase* db = new utils::dbms::SQLDatabase(kDatabaseName);
- db->Open();
- return db;
-#else
- return db_;
-#endif
-}
-
-bool SQLPTRepresentation::CopyApplication(const std::string& source,
- const std::string& destination) {
- utils::dbms::SQLQuery source_app(db());
- if (!source_app.Prepare(sql_pt::kSelectApplicationFull)) {
- LOG4CXX_WARN(logger_, "Incorrect select statement from application.");
- return false;
- }
- source_app.Bind(0, source);
- if (!source_app.Exec()) {
- LOG4CXX_WARN(logger_, "Failed selecting from application.");
- return false;
- }
-
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertApplicationFull)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement into application.");
- return false;
- }
- query.Bind(0, destination);
- source_app.IsNull(0) ? query.Bind(1)
- : query.Bind(1, source_app.GetBoolean(0));
- source_app.IsNull(1) ? query.Bind(2)
- : query.Bind(2, source_app.GetBoolean(1));
- source_app.IsNull(2) ? query.Bind(3) : query.Bind(3, source_app.GetString(2));
- source_app.IsNull(3) ? query.Bind(4) : query.Bind(4, source_app.GetString(3));
- source_app.IsNull(4) ? query.Bind(5)
- : query.Bind(5, source_app.GetBoolean(4));
- source_app.IsNull(5) ? query.Bind(6)
- : query.Bind(6, source_app.GetBoolean(5));
- source_app.IsNull(6) ? query.Bind(7)
- : query.Bind(7, source_app.GetBoolean(6));
- query.Bind(8, source_app.GetInteger(7));
- query.Bind(9, source_app.GetInteger(8));
- source_app.IsNull(9) ? query.Bind(10)
- : query.Bind(10, source_app.GetString(9));
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed inserting into application.");
- return false;
- }
- return true;
-}
-
-void SQLPTRepresentation::SetPreloaded(bool value) {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kUpdatePreloaded)) {
- LOG4CXX_WARN(logger_, "Incorrect statement of updating preloaded.");
- return;
- }
-
- query.Bind(0, value);
- if (!query.Exec()) {
- LOG4CXX_WARN(logger_, "Failed updating preloaded.");
- return;
- }
-}
-
-bool SQLPTRepresentation::SetVINValue(const std::string& value) {
- return true;
-}
-
-} // namespace policy
diff --git a/src/components/policy/src/update_status_manager.cc b/src/components/policy/src/update_status_manager.cc
deleted file mode 100644
index f821b9655b..0000000000
--- a/src/components/policy/src/update_status_manager.cc
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "policy/update_status_manager.h"
-#include "policy/policy_listener.h"
-#include "utils/logger.h"
-
-namespace policy {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Policy")
-
-UpdateStatusManager::UpdateStatusManager()
- : listener_(NULL)
- , exchange_in_progress_(false)
- , update_required_(false)
- , update_scheduled_(false)
- , exchange_pending_(false)
- , 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_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) {
- listener_ = listener;
-}
-
-void UpdateStatusManager::OnUpdateSentOut(uint32_t update_timeout) {
- LOG4CXX_AUTO_TRACE(logger_);
- 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_AUTO_TRACE(logger_);
- 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_AUTO_TRACE(logger_);
- update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
- set_exchange_pending(false);
- set_exchange_in_progress(false);
-}
-
-void UpdateStatusManager::OnWrongUpdateReceived() {
- LOG4CXX_AUTO_TRACE(logger_);
- update_status_thread_delegate_->updateTimeOut(0); // Stop Timer
- set_update_required(true);
- set_exchange_in_progress(false);
- set_exchange_pending(false);
-}
-
-void UpdateStatusManager::OnResetDefaultPT(bool is_update_required) {
- LOG4CXX_AUTO_TRACE(logger_);
- exchange_in_progress_ = false;
- update_required_ = is_update_required;
- exchange_pending_ = false;
- last_update_status_ = policy::StatusUnknown;
-}
-
-void UpdateStatusManager::OnResetRetrySequence() {
- LOG4CXX_AUTO_TRACE(logger_);
- if (exchange_in_progress_) {
- set_exchange_pending(true);
- }
- set_update_required(true);
-}
-
-void UpdateStatusManager::OnNewApplicationAdded() {
- LOG4CXX_AUTO_TRACE(logger_);
- set_update_required(true);
-}
-
-void UpdateStatusManager::OnPolicyInit(bool is_update_required) {
- LOG4CXX_AUTO_TRACE(logger_);
- update_required_ = is_update_required;
-}
-
-PolicyTableStatus UpdateStatusManager::GetUpdateStatus() const {
- LOG4CXX_AUTO_TRACE(logger_);
- if (!exchange_in_progress_ && !exchange_pending_ && !update_required_) {
- return PolicyTableStatus::StatusUpToDate;
- }
-
- if (update_required_ && !exchange_in_progress_ && !exchange_pending_) {
- return PolicyTableStatus::StatusUpdateRequired;
- }
-
- 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_AUTO_TRACE(logger_);
- policy::PolicyTableStatus status = GetUpdateStatus();
- if (listener_ && last_update_status_ != status) {
- LOG4CXX_INFO(logger_, "Send OnUpdateStatusChanged");
- listener_->OnUpdateStatusChanged(StringifiedUpdateStatus());
- }
- last_update_status_ = status;
-}
-
-void UpdateStatusManager::set_exchange_in_progress(bool value) {
- sync_primitives::AutoLock lock(exchange_in_progress_lock_);
- LOG4CXX_INFO(logger_,
- "Exchange in progress value is:" << std::boolalpha << value);
- exchange_in_progress_ = value;
- CheckUpdateStatus();
-}
-
-void UpdateStatusManager::set_exchange_pending(bool value) {
- sync_primitives::AutoLock lock(exchange_pending_lock_);
- LOG4CXX_INFO(logger_,
- "Exchange pending value is:" << std::boolalpha << value);
- exchange_pending_ = value;
- CheckUpdateStatus();
-}
-
-void UpdateStatusManager::set_update_required(bool value) {
- sync_primitives::AutoLock lock(update_required_lock_);
- LOG4CXX_INFO(logger_, "Update required value is:" << std::boolalpha << value);
- update_required_ = value;
- CheckUpdateStatus();
-}
-
-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/test/CMakeLists.txt b/src/components/policy/test/CMakeLists.txt
deleted file mode 100644
index 95a61f92ff..0000000000
--- a/src/components/policy/test/CMakeLists.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2015, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-include_directories(
- include
- ${COMPONENTS_DIR}
- ${GMOCK_INCLUDE_DIRECTORY}
- ${JSONCPP_INCLUDE_DIRECTORY}
- ${COMPONENTS_DIR}/policy/include
- ${COMPONENTS_DIR}/rpc_base/include
- ${COMPONENTS_DIR}/config_profile/include
- ${COMPONENTS_DIR}/utils/include/
- ${COMPONENTS_DIR}/policy/test/include/
-)
-
-set(testLibraries
- gmock
- Utils
- Policy
- UsageStatistics
-)
-
-set(testSources
- counter_test.cc
- shared_library_test.cc
- generated_code_test.cc
- policy_manager_impl_test.cc
- update_status_manager_test.cc
-)
-
-list (APPEND testSources
- sql_pt_representation_test.cc
-)
-
-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 PTU.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY PTU2.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY PTU3.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY PTU4.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY ptu_requestType.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY ptu2_requestType.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY smartDeviceLink2.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY smartDeviceLink3.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY sdl_pt_first_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY sdl_pt_second_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY sdl_pt_update.json DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/components/policy/test/PTU.json b/src/components/policy/test/PTU.json
deleted file mode 100644
index a200667e54..0000000000
--- a/src/components/policy/test/PTU.json
+++ /dev/null
@@ -1,1949 +0,0 @@
- {
- "policy_table": {
- "module_config": {
- "preloaded_pt": true,
- "preloaded_date": "2015-12-08",
- "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"],
- "RequestType": [
- "HTTP",
- "FILE_RESUME"
- ]
- },
- "1234": "default",
- "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"],
- "RequestType": [
- "QUERY_APPS",
- "LAUNCH_APP",
- "PROPRIETARY"
- ]
- }
- }
- }
- }
-
diff --git a/src/components/policy/test/PTU3.json b/src/components/policy/test/PTU3.json
deleted file mode 100644
index 812fbfd36a..0000000000
--- a/src/components/policy/test/PTU3.json
+++ /dev/null
@@ -1,1951 +0,0 @@
- {
- "policy_table": {
- "module_config": {
- "preloaded_pt": true,
- "preloaded_date": "2015-12-08",
- "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"],
- "RequestType": [
- "HTTP",
- "FILE_RESUMED",
- "INVALID_REQUEST_TYPE"
- ]
- },
- "1234": "default",
- "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"],
- "RequestType": [
- "QUERY_APPS",
- "LAUNCH_APP",
- "PROPRIETARY",
- "INVALID_REQUEST_TYPE"
- ]
- }
- }
- }
- }
-
diff --git a/src/components/policy/test/counter_test.cc b/src/components/policy/test/counter_test.cc
deleted file mode 100644
index 84b6d7fef4..0000000000
--- a/src/components/policy/test/counter_test.cc
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gmock/gmock.h"
-
-#include "policy/mock_statistics_manager.h"
-#include "policy/usage_statistics/counter.h"
-
-using ::testing::StrictMock;
-using ::testing::InSequence;
-
-namespace test {
-namespace components {
-namespace usage_statistics_test {
-
-using namespace usage_statistics;
-
-// 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);
-
- // Assert
- EXPECT_CALL(*msm, Increment(SYNC_REBOOTS));
-
- // Act
- ++reboots_counter;
-}
-
-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(
- StatisticsManagerIncrementMethod2Args,
- AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) {
- // Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS);
-
- // Assert
- EXPECT_CALL(*msm, Increment("HelloApp", USER_SELECTIONS));
-
- // Act
- ++user_selections_counter;
-}
-
-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(StatisticsManagerSetMethod,
- AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) {
- // Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
-
- // Assert
- EXPECT_CALL(*msm, Set("HelloApp", LANGUAGE_GUI, "Klingon"));
-
- // Act
- gui_language_info.Update("Klingon");
-}
-
-TEST(StatisticsManagerSetMethod,
- AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) {
- // Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI);
-
- // 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(StatisticsManagerAddMethod,
- AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) {
- // Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- const std::uint32_t time_out = 1;
- AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
-
- hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
- // Assert
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, time_out));
-
- // Act
- hmi_full_stopwatch.WriteTime();
-}
-
-// Tests disabled due to uncorrect behavior of timer.
-// Will be undisabled after fix.
-TEST(StatisticsManagerAddMethod,
- DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) {
- // Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp");
- hmi_full_stopwatch.Start(SECONDS_HMI_FULL);
-
- hmi_full_stopwatch.Switch(SECONDS_HMI_FULL);
- // Assert
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_FULL, 60));
-
- // Act
- hmi_full_stopwatch.WriteTime();
-}
-
-TEST(
- StatisticsManagerAddMethod,
- DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) {
- // Arrange
- MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>();
- const std::uint32_t time_out = 1;
- AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out);
-
- // Act
- hmi_full_stopwatch.Start(SECONDS_HMI_NONE);
- // Assert
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_NONE, time_out));
- // Act
- hmi_full_stopwatch.WriteTime();
-
- hmi_full_stopwatch.Switch(SECONDS_HMI_BACKGROUND);
- // Assert
- EXPECT_CALL(*msm, Add("HelloApp", SECONDS_HMI_BACKGROUND, time_out));
- // Act
- hmi_full_stopwatch.WriteTime();
-}
-
-} // namespace usage_statistics_test
-} // namespace components
-} // namespace test
diff --git a/src/components/policy/test/generated_code_test.cc b/src/components/policy/test/generated_code_test.cc
deleted file mode 100644
index 8b1a4d7478..0000000000
--- a/src/components/policy/test/generated_code_test.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <fstream>
-
-#include "gtest/gtest.h"
-
-#include "json/reader.h"
-#include "json/value.h"
-#include "policy/policy_table/enums.h"
-#include "policy/policy_table/types.h"
-#include "rpc_base/gtest_support.h"
-
-using rpc::policy_table_interface_base::Table;
-
-namespace test {
-namespace components {
-namespace policy {
-
-TEST(PolicyGeneratedCodeTest, TestValidPTPreloadJsonIsValid) {
- std::ifstream json_file("sdl_preloaded_pt.json");
- ASSERT_TRUE(json_file.is_open());
- Json::Value valid_table;
- Json::Reader reader;
- ASSERT_TRUE(reader.parse(json_file, valid_table));
- Table table(&valid_table);
- table.SetPolicyTableType(rpc::policy_table_interface_base::PT_PRELOADED);
- ASSERT_RPCTYPE_VALID(table);
-}
-
-TEST(PolicyGeneratedCodeTest, TestValidPTUpdateJsonIsValid) {
- std::ifstream json_file("valid_sdl_pt_update.json");
- ASSERT_TRUE(json_file.is_open());
- Json::Value valid_table;
- Json::Reader reader;
- ASSERT_TRUE(reader.parse(json_file, valid_table));
- Table table(&valid_table);
- table.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
- ASSERT_RPCTYPE_VALID(table);
-}
-
-} // namespace policy
-} // namespace components
-} // namespace test
diff --git a/src/components/policy/test/include/driver_dbms.h b/src/components/policy/test/include/driver_dbms.h
deleted file mode 100644
index edd183dbd4..0000000000
--- a/src/components/policy/test/include/driver_dbms.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_POLICY_TEST_INCLUDE_DRIVER_DBMS_H_
-#define SRC_COMPONENTS_POLICY_TEST_INCLUDE_DRIVER_DBMS_H_
-
-#ifdef __QNX__
-#include <qdb/qdb.h>
-#else // __QNX__
-#include <sqlite3.h>
-#endif // __QNX__
-
-namespace test {
-namespace components {
-namespace policy {
-
-#ifdef __QNX__
-class DBMS {
- public:
- explicit DBMS(std::string db_name) : db_name_(db_name), conn_(0) {}
- ~DBMS() {
- Close();
- }
- bool Open() {
- conn_ = qdb_connect(db_name_.c_str(), 0);
- return conn_ != NULL;
- }
- void Close() {
- qdb_disconnect(conn_);
- }
- bool Exec(const char* query) {
- return -1 != qdb_statement(conn_, query);
- }
- int FetchOneInt(const char* query) {
- int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
- qdb_stmt_exec(conn_, stmt, NULL, 0);
- qdb_result_t* res = qdb_getresult(conn_);
- void* ret = qdb_cell(res, 0, 0);
- int value = 0;
- if (ret) {
- value = *static_cast<int*>(ret);
- }
- qdb_stmt_free(conn_, stmt);
- return value;
- }
- double FetchOneDouble(const char* query) {
- int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
- qdb_stmt_exec(conn_, stmt, NULL, 0);
- qdb_result_t* res = qdb_getresult(conn_);
- void* ret = qdb_cell(res, 0, 0);
- double value = 0.0;
- if (ret) {
- value = *static_cast<double*>(ret);
- }
- qdb_stmt_free(conn_, stmt);
-
- return value;
- }
- std::string FetchOneString(const char* query) {
- int stmt = qdb_stmt_init(conn_, query, strlen(query) + 1);
- qdb_stmt_exec(conn_, stmt, NULL, 0);
- qdb_result_t* res = qdb_getresult(conn_);
- void* ret = qdb_cell(res, 0, 0);
- std::string value = "";
- if (ret) {
- value = std::string(static_cast<const char*>(ret));
- }
- qdb_stmt_free(conn_, stmt);
-
- return value;
- }
-
- private:
- std::string db_name_;
- qdb_hdl_t* conn_;
-};
-
-#else // __QNX__
-class DBMS {
- public:
- explicit DBMS(std::string file_name) : file_name_(file_name), conn_(0) {}
- ~DBMS() {
- Close();
- }
- bool Open() {
- return SQLITE_OK == sqlite3_open(file_name_.c_str(), &conn_);
- }
- void Close() {
- sqlite3_close(conn_);
- remove(file_name_.c_str());
- }
- bool Exec(const char* query) {
- return SQLITE_OK == sqlite3_exec(conn_, query, NULL, NULL, NULL);
- }
- int FetchOneInt(const char* query) {
- sqlite3_stmt* statement;
- sqlite3_prepare(conn_, query, -1, &statement, NULL);
- sqlite3_step(statement);
- int value = sqlite3_column_int(statement, 0);
- sqlite3_finalize(statement);
- return value;
- }
- double FethcOneDouble(const char* query) {
- sqlite3_stmt* statement;
- sqlite3_prepare(conn_, query, -1, &statement, NULL);
- sqlite3_step(statement);
- double value = sqlite3_column_double(statement, 0);
- sqlite3_finalize(statement);
- return value;
- }
- std::string FetchOneString(const char* query) {
- sqlite3_stmt* statement;
- sqlite3_prepare(conn_, query, -1, &statement, NULL);
- sqlite3_step(statement);
- const unsigned char* txt = sqlite3_column_text(statement, 0);
- std::string value = std::string(reinterpret_cast<const char*>(txt));
- sqlite3_finalize(statement);
- return value;
- }
-
- private:
- std::string file_name_;
- sqlite3* conn_;
-};
-#endif // __QNX__
-
-} // namespace policy
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_DRIVER_DBMS_H_
diff --git a/src/components/policy/test/include/mock_cache_manager.h b/src/components/policy/test/include/mock_cache_manager.h
deleted file mode 100644
index 095319a090..0000000000
--- a/src/components/policy/test/include/mock_cache_manager.h
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_CACHE_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_CACHE_MANAGER_H_
-
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-
-#include "policy/cache_manager_interface.h"
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-namespace policy {
-
-class MockCacheManagerInterface : public CacheManagerInterface {
- public:
- MOCK_METHOD4(CheckPermissions,
- void(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result));
- MOCK_METHOD0(IsPTPreloaded, bool());
- MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
- MOCK_METHOD1(KilometersBeforeExchange, int(int current));
- MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
- bool(Counters counter, int value));
- MOCK_METHOD1(DaysBeforeExchange, int(int current));
- MOCK_METHOD0(IncrementIgnitionCycles, void());
- MOCK_METHOD0(ResetIgnitionCycles, void());
- MOCK_METHOD0(TimeoutResponse, int());
- MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>& seconds));
- MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
- MOCK_METHOD1(SetVINValue, bool(const std::string& value));
- MOCK_METHOD2(GetUserFriendlyMsg,
- std::vector<UserFriendlyMessage>(
- const std::vector<std::string>& msg_codes,
- const std::string& language));
- MOCK_METHOD2(GetUpdateUrls, void(int service_type, EndpointUrls& end_points));
- MOCK_METHOD1(
- GetNotificationsNumber,
- policy_table::NumberOfNotificationsType(const std::string& priority));
- MOCK_CONST_METHOD2(GetPriority,
- bool(const std::string& policy_app_id,
- std::string& priority));
- MOCK_METHOD2(GetServiceUrls,
- void(const std::string& service_type, EndpointUrls& end_points));
- MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string());
- MOCK_METHOD2(Init,
- bool(const std::string& file_name,
- const PolicySettings* settings));
- MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
- MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt));
- MOCK_METHOD1(Save, bool(const policy_table::Table& table));
- MOCK_CONST_METHOD0(UpdateRequired, bool());
- MOCK_METHOD1(SaveUpdateRequired, void(bool status));
- MOCK_METHOD3(GetInitialAppData,
- bool(const std::string& app_id,
- StringArray& nicknames,
- StringArray& app_hmi_types));
- MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
- MOCK_METHOD1(GetFunctionalGroupings,
- bool(policy_table::FunctionalGroupings& groups));
- MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id));
- MOCK_METHOD1(IsDefaultPolicy, bool(const std::string& app_id));
- MOCK_METHOD1(SetIsDefault, bool(const std::string& app_id));
- MOCK_METHOD1(IsPredataPolicy, bool(const std::string& app_id));
- MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id));
- MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
- MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
- MOCK_CONST_METHOD2(GetDefaultHMI,
- bool(const std::string& app_id, std::string& default_hmi));
- MOCK_METHOD0(ResetUserConsent, bool());
- MOCK_CONST_METHOD3(GetUserPermissionsForDevice,
- bool(const std::string& device_id,
- StringArray& consented_groups,
- StringArray& disallowed_groups));
- MOCK_METHOD3(GetPermissionsForApp,
- bool(const std::string& device_id,
- const std::string& app_id,
- FunctionalIdType& group_types));
- MOCK_CONST_METHOD2(
- GetDeviceGroupsFromPolicies,
- bool(rpc::policy_table_interface_base::Strings& groups,
- rpc::policy_table_interface_base::Strings& preconsented_groups));
- MOCK_METHOD2(AddDevice,
- bool(const std::string& device_id,
- const std::string& connection_type));
- MOCK_METHOD8(SetDeviceData,
- bool(const std::string& device_id,
- const std::string& hardware,
- const std::string& firmware,
- const std::string& os,
- const std::string& os_version,
- const std::string& carrier,
- const uint32_t number_of_ports,
- const std::string& connection_type));
- MOCK_METHOD3(SetUserPermissionsForDevice,
- bool(const std::string& device_id,
- const StringArray& consented_groups,
- const StringArray& disallowed_groups));
- MOCK_METHOD2(ReactOnUserDevConsentForApp,
- bool(const std::string& app_id, bool is_device_allowed));
- MOCK_METHOD1(SetUserPermissionsForApp,
- bool(const PermissionConsent& permissions));
- MOCK_METHOD3(SetMetaInfo,
- bool(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language));
- MOCK_CONST_METHOD0(IsMetaInfoPresent, bool());
- MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
- MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
- MOCK_METHOD2(Increment,
- void(const std::string& app_id,
- usage_statistics::AppCounterId type));
- MOCK_METHOD3(Set,
- 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_METHOD2(CountUnconsentedGroups,
- int(const std::string& policy_app_id,
- const std::string& device_id));
- MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
- MOCK_METHOD2(GetAllAppGroups,
- void(const std::string& app_id,
- FunctionalGroupIDs& all_group_ids));
- MOCK_METHOD2(GetPreConsentedGroups,
- void(const std::string& app_id,
- FunctionalGroupIDs& preconsented_groups));
- MOCK_METHOD4(GetConsentedGroups,
- void(const std::string& device_id,
- const std::string& app_id,
- FunctionalGroupIDs& allowed_groups,
- FunctionalGroupIDs& disallowed_groups));
- MOCK_METHOD3(GetUnconsentedGroups,
- void(const std::string& device_id,
- const std::string& policy_app_id,
- FunctionalGroupIDs& unconsented_groups));
- MOCK_METHOD2(RemoveAppConsentForGroup,
- void(const std::string& app_id, const std::string& group_name));
- MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_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, bool(const std::string& file_name));
- MOCK_METHOD0(LoadFromBackup, bool());
- MOCK_METHOD2(LoadFromFile,
- bool(const std::string& file_name, policy_table::Table&));
- MOCK_METHOD0(Backup, void());
- MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_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(GetPT, utils::SharedPtr<policy_table::Table>());
- MOCK_CONST_METHOD0(GetCertificate, std::string());
- MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_CACHE_MANAGER_H_
diff --git a/src/components/policy/test/include/mock_policy_listener.h b/src/components/policy/test/include/mock_policy_listener.h
deleted file mode 100644
index 73905f4dcb..0000000000
--- a/src/components/policy/test/include/mock_policy_listener.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_POLICY_LISTENER_H_
-#define SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_POLICY_LISTENER_H_
-
-#include <string>
-
-#include "gmock/gmock.h"
-
-#include "policy/policy_listener.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
-#include "utils/custom_string.h"
-
-namespace policy_table = ::rpc::policy_table_interface_base;
-
-namespace policy {
-
-namespace custom_str = utils::custom_string;
-
-class MockPolicyListener : public PolicyListener {
- public:
- 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(OnUpdateStatusChanged, void(const std::string& status));
- MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired,
- std::string(const std::string& policy_app_id));
- MOCK_METHOD0(OnSystemInfoUpdateRequired, void());
- MOCK_METHOD1(GetAppName,
- custom_str::CustomString(const std::string& policy_app_id));
- MOCK_METHOD0(OnUserRequestedUpdateCheckRequired, void());
- 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_METHOD1(OnSnapshotCreated, void(const BinaryMessage& pt_string));
- MOCK_METHOD0(CanUpdate, bool());
- MOCK_METHOD1(OnCertificateUpdated, void(const std::string&));
- MOCK_CONST_METHOD2(SendOnAppPermissionsChanged,
- void(const AppPermissions&, const std::string&));
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_POLICY_LISTENER_H_
diff --git a/src/components/policy/test/include/mock_policy_manager.h b/src/components/policy/test/include/mock_policy_manager.h
deleted file mode 100644
index 579e15fcca..0000000000
--- a/src/components/policy/test/include/mock_policy_manager.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_POLICY_MANAGER_H_
-
-#include <string>
-#include <vector>
-#include "gmock/gmock.h"
-#include "policy/policy_listener.h"
-#include "policy/policy_types.h"
-#include "policy/usage_statistics/statistics_manager.h"
-
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
-#include "policy/policy_manager.h"
-
-namespace policy_table = ::rpc::policy_table_interface_base;
-
-namespace policy_manager {
-
-using namespace policy;
-
-class MockPolicyManager : public PolicyManager {
- public:
- MOCK_METHOD1(set_listener, void(PolicyListener* listener));
- MOCK_METHOD2(InitPT,
- bool(const std::string& file_name,
- const PolicySettings* settings));
- MOCK_METHOD2(LoadPT,
- bool(const std::string& file, const BinaryMessage& pt_content));
- MOCK_METHOD1(ResetPT, bool(const std::string& file_name));
- MOCK_CONST_METHOD1(GetUpdateUrl, std::string(int service_type));
- MOCK_METHOD2(GetUpdateUrls, void(int service_type, EndpointUrls& end_points));
- MOCK_METHOD0(RequestPTUpdate, bool());
- MOCK_METHOD5(CheckPermissions,
- void(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result));
- MOCK_METHOD0(ResetUserConsent, bool());
- MOCK_CONST_METHOD0(GetPolicyTableStatus, std::string());
- MOCK_METHOD1(KmsChanged, void(int kilometers));
- MOCK_METHOD0(IncrementIgnitionCycles, void());
- MOCK_METHOD0(ForcePTExchange, std::string());
- MOCK_METHOD0(ResetRetrySequence, void());
- MOCK_METHOD0(NextRetryTimeout, int());
- MOCK_METHOD0(TimeoutExchange, int());
- MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector<int>());
- MOCK_METHOD0(OnExceededTimeout, void());
- MOCK_METHOD0(OnUpdateStarted, void());
- MOCK_CONST_METHOD1(GetUserConsentForDevice,
- DeviceConsent(const std::string& device_id));
- MOCK_METHOD3(
- GetUserConsentForApp,
- void(const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<policy::FunctionalGroupPermission>& permissions));
- MOCK_METHOD2(SetUserConsentForDevice,
- void(const std::string& device_id, bool is_allowed));
- MOCK_METHOD2(ReactOnUserDevConsentForApp,
- bool(const std::string app_id, bool is_device_allowed));
- MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value));
-
- MOCK_METHOD3(GetInitialAppData,
- bool(const std::string&,
- policy::StringArray*,
- policy::StringArray*));
-
- MOCK_METHOD2(AddDevice,
- void(const std::string& device_id,
- const std::string& connection_type));
- MOCK_METHOD2(SetDeviceInfo,
- void(const std::string& device_id,
- const policy::DeviceInfo& device_info));
- MOCK_METHOD1(SetUserConsentForApp,
- void(const policy::PermissionConsent& permissions));
- MOCK_CONST_METHOD2(GetDefaultHmi,
- bool(const std::string& policy_app_id,
- std::string* default_hmi));
- MOCK_CONST_METHOD2(GetPriority,
- bool(const std::string& policy_app_id,
- std::string* priority));
- MOCK_METHOD2(GetUserFriendlyMessages,
- std::vector<policy::UserFriendlyMessage>(
- const std::vector<std::string>& message_code,
- const std::string& language));
- MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
- MOCK_METHOD3(
- GetPermissionsForApp,
- void(const std::string& device_id,
- const std::string& policy_app_id,
- std::vector<policy::FunctionalGroupPermission>& permissions));
- MOCK_METHOD1(GetAppPermissionsChanges,
- policy::AppPermissions(const std::string& policy_app_id));
- MOCK_METHOD1(RemovePendingPermissionChanges, void(const std::string& app_id));
- MOCK_CONST_METHOD1(GetCurrentDeviceId,
- std::string&(const std::string& policy_app_id));
- MOCK_METHOD1(SetSystemLanguage, void(const std::string& language));
- MOCK_METHOD3(SetSystemInfo,
- void(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language));
- MOCK_METHOD1(SendNotificationOnPermissionsUpdated,
- void(const std::string& application_id));
- MOCK_METHOD1(MarkUnpairedDevice, void(const std::string& device_id));
- MOCK_METHOD1(AddApplication, void(const std::string& application_id));
- MOCK_METHOD0(CleanupUnpairedDevices, bool());
- MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
- MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
- MOCK_METHOD0(OnSystemReady, void());
- MOCK_CONST_METHOD1(GetNotificationsNumber,
- uint32_t(const std::string& priority));
- MOCK_METHOD1(SetVINValue, void(const std::string& value));
- MOCK_METHOD1(IsPredataPolicy, bool(const std::string& policy_app_id));
- MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id));
- MOCK_METHOD1(SaveUpdateStatusRequired, void(bool is_update_needed));
- MOCK_METHOD0(OnAppsSearchStarted, void());
- MOCK_METHOD0(OnAppsSearchCompleted, void());
- MOCK_METHOD1(OnAppRegisteredOnMobile,
- void(const std::string& application_id));
- MOCK_CONST_METHOD1(
- GetAppRequestTypes,
- const std::vector<std::string>(const std::string policy_app_id));
- MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo());
- MOCK_CONST_METHOD0(RetrieveCertificate, std::string());
- MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&));
- MOCK_METHOD0(ExceededIgnitionCycles, bool());
- MOCK_METHOD0(ExceededDays, bool());
- MOCK_METHOD0(StartPTExchange, void());
- MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type));
- MOCK_METHOD2(Increment,
- void(const std::string& app_id,
- usage_statistics::AppCounterId type));
- MOCK_METHOD3(Set,
- 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,
- int32_t timespan_seconds));
- MOCK_CONST_METHOD0(get_settings, const PolicySettings&());
- MOCK_METHOD1(set_settings, void(const PolicySettings* get_settings));
-};
-
-} // namespace policy_manager
-
-#endif // SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_POLICY_MANAGER_H_
diff --git a/src/components/policy/test/include/mock_pt_ext_representation.h b/src/components/policy/test/include/mock_pt_ext_representation.h
deleted file mode 100644
index 4f6eb7e08f..0000000000
--- a/src/components/policy/test/include/mock_pt_ext_representation.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
-
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-
-#include "policy/pt_ext_representation.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
-#include "mock_pt_representation.h"
-
-namespace policy_table = ::rpc::policy_table_interface_base;
-
-namespace policy {
-class MockPTExtRepresentation : public MockPTRepresentation,
- public PTExtRepresentation {
- public:
- MOCK_METHOD1(CanAppKeepContext, bool(const std::string& app_id));
- MOCK_METHOD1(CanAppStealFocus, bool(const std::string& app_id));
- MOCK_METHOD2(GetDefaultHMI,
- bool(const std::string& app_id, std::string* default_hmi));
- MOCK_METHOD0(ResetUserConsent, bool());
- MOCK_METHOD0(ResetDeviceConsents, bool());
- MOCK_METHOD0(ResetAppConsents, bool());
- MOCK_METHOD3(GetUserPermissionsForDevice,
- bool(const std::string&, StringArray*, StringArray*));
- MOCK_METHOD3(GetPermissionsForApp,
- bool(const std::string&,
- const std::string&,
- FunctionalIdType* group_types));
- MOCK_METHOD2(GetDeviceGroupsFromPolicies,
- bool(policy_table::Strings*, policy_table::Strings*));
- MOCK_METHOD2(
- GetUserFriendlyMsg,
- std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
- const std::string& language));
- MOCK_METHOD8(SetDeviceData,
- bool(const std::string& device_id,
- const std::string& hardware,
- const std::string& firmware,
- const std::string& os,
- const std::string& os_version,
- const std::string& carrier,
- const uint32_t number_of_ports,
- const std::string& connection_type));
- MOCK_METHOD6(SetDeviceData,
- bool(const std::string&,
- const std::string&,
- const std::string&,
- const std::string&,
- const std::string&,
- const std::string&));
- MOCK_METHOD2(SetMaxNumberPorts,
- bool(const std::string& device_id,
- unsigned int number_of_ports));
- MOCK_METHOD3(SetUserPermissionsForDevice,
- bool(const std::string&,
- const StringArray&,
- const StringArray&));
- MOCK_METHOD1(SetUserPermissionsForApp, bool(const PermissionConsent&));
- MOCK_METHOD1(IncreaseStatisticsData, bool(StatisticsType type));
- MOCK_METHOD3(SetAppRegistrationLanguage,
- bool(const std::string& app_id,
- LanguageType type,
- const std::string& language));
- MOCK_METHOD3(SetMetaInfo,
- bool(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& vin));
- MOCK_METHOD0(IsMetaInfoPresent, bool());
- MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language));
- MOCK_METHOD0(GetKmFromSuccessfulExchange, int());
- MOCK_METHOD0(GetDayFromScsExchange, int());
- MOCK_METHOD0(GetIgnitionsFromScsExchange, int());
- MOCK_CONST_METHOD1(Increment, void(const std::string& type));
- MOCK_CONST_METHOD2(Increment,
- void(const std::string& app_id, const std::string& type));
- MOCK_CONST_METHOD3(Set,
- void(const std::string& app_id,
- const std::string& type,
- const std::string& value));
- MOCK_CONST_METHOD3(Add,
- void(const std::string& app_id,
- const std::string& type,
- int seconds));
- MOCK_CONST_METHOD3(CountUnconsentedGroups,
- bool(const std::string& app_id,
- const std::string& device_id,
- int* count));
- MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names));
- MOCK_CONST_METHOD1(CleanupUnpairedDevices, bool(const DeviceIds& device_ids));
- MOCK_METHOD2(ReactOnUserDevConsentForApp,
- bool(const std::string& app_id, bool is_device_allowed));
- MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id));
- MOCK_METHOD2(SetIsPredata, bool(const std::string& app_id, bool is_predata));
- MOCK_CONST_METHOD2(SetUnpairedDevice,
- bool(const std::string& device_id, bool unpaired));
- MOCK_CONST_METHOD1(UnpairedDevicesList, bool(DeviceIds* device_ids));
- MOCK_CONST_METHOD2(RemoveAppConsentForGroup,
- bool(const std::string& policy_app_id,
- const std::string& functional_group));
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_PT_EXT_REPRESENTATION_H_
diff --git a/src/components/policy/test/include/mock_pt_representation.h b/src/components/policy/test/include/mock_pt_representation.h
deleted file mode 100644
index 045c901be2..0000000000
--- a/src/components/policy/test/include/mock_pt_representation.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_PT_REPRESENTATION_H_
-#define SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_PT_REPRESENTATION_H_
-
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-
-#include "policy/pt_representation.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/policy_table/types.h"
-
-namespace policy_table = ::rpc::policy_table_interface_base;
-
-namespace policy {
-
-class MockPTRepresentation : virtual public PTRepresentation {
- public:
- MOCK_METHOD4(CheckPermissions,
- void(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- CheckPermissionResult& result));
- MOCK_METHOD0(IsPTPreloaded, bool());
- MOCK_METHOD0(IgnitionCyclesBeforeExchange, int());
- MOCK_METHOD1(KilometersBeforeExchange, int(int current));
- MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate,
- bool(int kilometers, int days_after_epoch));
- MOCK_METHOD1(DaysBeforeExchange, int(int current));
- MOCK_METHOD0(IncrementIgnitionCycles, void());
- MOCK_METHOD0(ResetIgnitionCycles, void());
- MOCK_METHOD0(TimeoutResponse, int());
- MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector<int>* seconds));
- MOCK_METHOD2(GetPriority,
- bool(const std::string& app_id, std::string* priority));
- MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo());
- MOCK_METHOD1(SetVINValue, bool(const std::string& value));
- MOCK_METHOD2(
- GetUserFriendlyMsg,
- std::vector<UserFriendlyMessage>(const std::vector<std::string>& msg_code,
- const std::string& language));
- MOCK_METHOD2(GetUpdateUrls, void(int service_type, EndpointUrls&));
- MOCK_METHOD1(GetNotificationsNumber, int(const std::string& priority));
- MOCK_METHOD0(Init, InitResult());
- MOCK_METHOD0(Close, bool());
- MOCK_METHOD0(Clear, bool());
- MOCK_METHOD0(Drop, bool());
- MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr<policy_table::Table>());
- MOCK_METHOD1(Save, bool(const policy_table::Table& table));
- MOCK_CONST_METHOD0(UpdateRequired, bool());
- MOCK_METHOD1(SaveUpdateRequired, void(bool value));
- MOCK_METHOD3(GetInitialAppData,
- bool(const std::string& app_id,
- StringArray* nicknames,
- StringArray* app_types));
-
- MOCK_METHOD4(SaveApplicationCustomData,
- bool(const std::string& app_id,
- bool is_revoked,
- bool is_default,
- bool is_predata));
-
- MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id));
- MOCK_METHOD1(GetFunctionalGroupings,
- bool(policy_table::FunctionalGroupings& groups));
- MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id));
- MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id));
- MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id));
- MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id));
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_PT_REPRESENTATION_H_
diff --git a/src/components/policy/test/include/mock_update_status_manager.h b/src/components/policy/test/include/mock_update_status_manager.h
deleted file mode 100644
index aa6abd7301..0000000000
--- a/src/components/policy/test/include/mock_update_status_manager.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_UPDATE_STATUS_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_UPDATE_STATUS_MANAGER_H_
-
-#include "gmock/gmock.h"
-
-#include "policy/update_status_manager.h"
-
-namespace policy {
-
-class MockUpdateStatusManager : public UpdateStatusManager {
- public:
- MOCK_METHOD1(set_listener, void(PolicyListener* listener));
- MOCK_METHOD1(OnUpdateSentOut, void(uint32_t update_timeout));
- MOCK_METHOD0(OnUpdateTimeoutOccurs, void());
- MOCK_METHOD0(OnValidUpdateReceived, void());
- MOCK_METHOD0(OnWrongUpdateReceived, void());
- MOCK_METHOD1(OnResetDefaultPT, void(bool is_update_required));
- MOCK_METHOD0(OnResetRetrySequence, void());
- MOCK_METHOD0(OnNewApplicationAdded, void());
- MOCK_METHOD1(OnPolicyInit, void(bool is_update_required));
- MOCK_METHOD0(GetUpdateStatus, PolicyTableStatus());
-};
-
-} // namespace policy
-
-#endif // SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_MOCK_UPDATE_STATUS_MANAGER_H_
diff --git a/src/components/policy/test/policy_manager_impl_test.cc b/src/components/policy/test/policy_manager_impl_test.cc
deleted file mode 100644
index 34bcc1127e..0000000000
--- a/src/components/policy/test/policy_manager_impl_test.cc
+++ /dev/null
@@ -1,1340 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <vector>
-#include <fstream>
-#include <string>
-#include <ctime>
-
-#include "json/reader.h"
-#include "json/writer.h"
-#include "gtest/gtest.h"
-
-#include "policy/policy_manager_impl.h"
-#include "config_profile/profile.h"
-#include "policy/policy_table/enums.h"
-#include "policy/policy_table/types.h"
-#include "policy/mock_policy_settings.h"
-#include "mock_policy_listener.h"
-#include "mock_cache_manager.h"
-#include "mock_update_status_manager.h"
-
-#include "utils/macro.h"
-#include "utils/file_system.h"
-#include "utils/date_time.h"
-#include "utils/make_shared.h"
-#include "utils/gen_hash.h"
-
-using ::testing::ReturnRef;
-using ::testing::DoAll;
-using ::testing::SetArgReferee;
-using ::testing::NiceMock;
-using ::testing::_;
-using ::testing::SetArgReferee;
-using ::testing::AtLeast;
-using ::testing::Return;
-
-using ::policy::MockPolicyListener;
-
-using ::policy::MockCacheManagerInterface;
-using ::policy::MockUpdateStatusManager;
-
-using ::policy::PolicyManagerImpl;
-using ::policy::PolicyTable;
-
-namespace policy_table = rpc::policy_table_interface_base;
-
-namespace test {
-namespace components {
-namespace policy {
-
-namespace custom_str = utils::custom_string;
-
-typedef std::multimap<std::string, policy_table::Rpcs&>
- UserConsentPromptToRpcsConnections;
-
-template <typename T>
-std::string NumberToString(T Number) {
- std::ostringstream ss;
- ss << Number;
- return ss.str();
-}
-
-template <typename T>
-void SortAndCheckEquality(std::vector<T> first, std::vector<T> second) {
- ASSERT_EQ(first.size(), second.size());
- std::sort(first.begin(), first.end());
- std::sort(second.begin(), second.end());
- // Checks
- for (uint32_t i = 0; i < first.size(); ++i) {
- EXPECT_EQ(first[i], second[i]);
- }
-}
-
-struct StringsForUpdate {
- std::string new_field_value_;
- std::string new_field_name_;
- std::string new_date_;
-};
-
-char GenRandomString(const char* alphanum) {
- const int stringLength = sizeof(alphanum) - 1;
- return alphanum[rand() % stringLength];
-}
-
-struct StringsForUpdate CreateNewRandomData(StringsForUpdate& str) {
- // Generate random date
- srand(time(NULL));
- unsigned int day = 1 + rand() % 31; // Day from 1 - 31
- unsigned int month = 1 + rand() % 12; // Month from 1 - 12
- unsigned int year = 1985 + rand() % 31; // Year from 1985 - 2015
-
- // Convert date to string
- str.new_date_ = NumberToString(year) + '-' + NumberToString(month) + '-' +
- NumberToString(day);
-
- // Create new field
- unsigned int number = 1 + rand() % 100; // Number from 1 - 100
- str.new_field_name_ += NumberToString(number);
-
- // Create new field random value
- const char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- for (unsigned int i = 0; i < 5; ++i) {
- str.new_field_value_ += GenRandomString(alphanum);
- }
- return str;
-}
-
-class PolicyManagerImplTest : public ::testing::Test {
- public:
- PolicyManagerImplTest() : device_id("08-00-27-CE-76-FE") {}
-
- protected:
- PolicyManagerImpl* manager;
- MockCacheManagerInterface* cache_manager;
- NiceMock<MockPolicyListener> listener;
- const std::string device_id;
-
- void SetUp() OVERRIDE {
- manager = new PolicyManagerImpl();
- manager->set_listener(&listener);
- cache_manager = new MockCacheManagerInterface();
- manager->set_cache_manager(cache_manager);
- }
-
- void TearDown() OVERRIDE {
- delete manager;
- }
-
- ::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);
- }
- }
-};
-
-class PolicyManagerImplTest2 : public ::testing::Test {
- public:
- PolicyManagerImplTest2()
- : app_id1("123456789")
- , app_id2("1766825573")
- , dev_id1("XXX123456789ZZZ")
- , dev_id2("08-00-27-CE-76-FE")
- , PTU_request_types(Json::arrayValue) {}
-
- protected:
- PolicyManagerImpl* manager;
- NiceMock<MockPolicyListener> listener;
- std::vector<std::string> hmi_level;
- std::vector<std::string> PT_request_types;
- uint32_t PTU_request_types_size;
- unsigned int index;
- const std::string app_id1;
- const std::string app_id2;
- const std::string dev_id1;
- const std::string dev_id2;
- Json::Value PTU_request_types;
- NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- const std::string kAppStorageFolder = "storage1";
-
- void SetUp() OVERRIDE {
- file_system::CreateDirectory("storage1");
- file_system::DeleteFile("policy.sqlite");
-
- manager = new PolicyManagerImpl();
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- manager->set_listener(&listener);
- const char* levels[] = {"BACKGROUND", "FULL", "LIMITED", "NONE"};
- hmi_level.assign(levels, levels + sizeof(levels) / sizeof(levels[0]));
- srand(time(NULL));
- index = rand() % 3;
- }
-
- std::vector<std::string> JsonToVectorString(
- const Json::Value& PTU_request_types) {
- std::vector<std::string> result;
- for (uint32_t i = 0; i < PTU_request_types.size(); ++i) {
- result.push_back(PTU_request_types[i].asString());
- }
- return result;
- }
-
- const Json::Value GetPTU(std::string file_name) {
- // Get PTU
- std::ifstream ifile(file_name);
- Json::Reader reader;
- std::string json;
- Json::Value root(Json::objectValue);
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
- json = root.toStyledString();
- }
- ifile.close();
- ::policy::BinaryMessage msg(json.begin(), json.end());
- // Load Json to cache
- EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
- return root;
- }
-
- void CreateLocalPT(const std::string& file_name) {
- file_system::remove_directory_content("storage1");
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_));
- }
-
- void AddRTtoPT(const std::string& update_file_name,
- const std::string& section_name,
- const uint32_t rt_number,
- const uint32_t invalid_rt_number) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- // Get RequestTypes from section of preloaded_pt app_policies
- PT_request_types = manager->GetAppRequestTypes(section_name);
- EXPECT_EQ(rt_number, PT_request_types.size());
- Json::Value root = GetPTU(update_file_name);
- // Get Request Types from JSON (PTU)
- PTU_request_types =
- root["policy_table"]["app_policies"][section_name]["RequestType"];
- PTU_request_types_size = PTU_request_types.size();
- PT_request_types.clear();
- // Get RequestTypes from section of PT app policies after update
- PT_request_types = manager->GetAppRequestTypes(section_name);
- // Check number of RT in PTU and PT now are equal
- ASSERT_EQ(PTU_request_types_size - invalid_rt_number,
- PT_request_types.size());
- }
-
- void AddRTtoAppSectionPT(const std::string& update_file_name,
- const std::string& section_name,
- const uint32_t rt_number,
- const uint32_t invalid_rt_number) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- // Add app
- manager->AddApplication(section_name);
- // Check app gets RequestTypes from pre_DataConsent of app_policies
- // section
- PT_request_types = manager->GetAppRequestTypes(section_name);
- EXPECT_EQ(rt_number, PT_request_types.size());
- EXPECT_CALL(listener, OnPendingPermissionChange(section_name)).Times(1);
- Json::Value root = GetPTU(update_file_name);
-
- // Get App Request Types from PTU
- PTU_request_types =
- root["policy_table"]["app_policies"][section_name]["RequestType"];
- PTU_request_types_size = PTU_request_types.size();
-
- PT_request_types.clear();
- // Get RequestTypes from <app_id> section of app policies after PT update
- PT_request_types = manager->GetAppRequestTypes(section_name);
- // Check sizes of Request types of PT and PTU
- ASSERT_EQ(PTU_request_types_size - invalid_rt_number,
- PT_request_types.size());
-
- ::policy::AppPermissions permissions =
- manager->GetAppPermissionsChanges(section_name);
- EXPECT_TRUE(permissions.requestTypeChanged);
- }
-
- std::vector<policy_table::RequestType> PushRequestTypesToContainer(
- const std::vector<std::string>& temp_result) {
- policy_table::RequestType filtered_result;
- std::vector<policy_table::RequestType> final_result;
- for (uint32_t i = 0; i < temp_result.size(); ++i) {
- if (policy_table::EnumFromJsonString(temp_result[i], &filtered_result)) {
- final_result.push_back(filtered_result);
- }
- }
- return final_result;
- }
-
- void CheckResultForValidRT() {
- // Convert Json Array to std::vector<std::string>
- const std::vector<std::string>& result =
- JsonToVectorString(PTU_request_types);
- // Checks
- SortAndCheckEquality(PT_request_types, result);
- }
-
- void CheckResultForInvalidRT() {
- // Convert Json Array to std::vector<std::string>
- const std::vector<std::string>& temp_result =
- JsonToVectorString(PTU_request_types);
- std::vector<policy_table::RequestType> result1 =
- PushRequestTypesToContainer(temp_result);
- std::vector<policy_table::RequestType> result2 =
- PushRequestTypesToContainer(PT_request_types);
- // Checks
- SortAndCheckEquality(result1, result2);
- }
- void FillMultimapFromFunctionalGroupings(
- UserConsentPromptToRpcsConnections& input_multimap,
- policy_table::FunctionalGroupings& fg_table) {
- policy_table::FunctionalGroupings::iterator fg_itter = fg_table.begin();
- const policy_table::FunctionalGroupings::iterator fg_itter_end =
- fg_table.end();
- for (; fg_itter != fg_itter_end; ++fg_itter) {
- // RPCS getting
- policy_table::Rpcs& rpcs_ref = fg_itter->second;
- // User_consent_prompt getting
- rpc::Optional<rpc::String<1, 255> >& optional_ref =
- rpcs_ref.user_consent_prompt;
- rpc::String<1, 255>& ucp_string = *optional_ref;
- const std::string& ucp_std_string =
- static_cast<const std::string&>(ucp_string);
- // Multimap inserting
- input_multimap.insert(std::pair<std::string, policy_table::Rpcs&>(
- ucp_std_string, rpcs_ref));
- }
- }
-
- void GetFunctionalGroupingsFromManager(
- policy_table::FunctionalGroupings& input_functional_groupings) {
- // Get cache
- ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
- // Get table_snapshot
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
- // Set functional groupings from policy table
- input_functional_groupings = table->policy_table.functional_groupings;
- }
-
- void TearDown() OVERRIDE {
- delete manager;
- }
-};
-
-Json::Value CreatePTforLoad() {
- const std::string load_table(
- "{"
- "\"policy_table\": {"
- "\"module_config\": {"
- "\"preloaded_pt\": true,"
- "\"exchange_after_x_ignition_cycles\": 10,"
- "\"exchange_after_x_kilometers\": 100,"
- "\"exchange_after_x_days\": 5,"
- "\"timeout_after_x_seconds\": 500,"
- "\"seconds_between_retries\": [10, 20, 30],"
- "\"endpoints\": {"
- "\"0x00\": {"
- "\"default\": [\"http://ford.com/cloud/default\"]"
- "}"
- "},"
- "\"notifications_per_minute_by_priority\": {"
- "\"emergency\": 1,"
- "\"navigation\": 2,"
- "\"VOICECOMM\": 3,"
- "\"communication\": 4,"
- "\"normal\": 5,"
- "\"none\": 6"
- "},"
- "\"vehicle_make\" : \"MakeT\","
- "\"vehicle_model\" : \"ModelT\","
- "\"vehicle_year\": \"2014\""
- "},"
- "\"app_policies\": {"
- "\"default\": {"
- "\"memory_kb\": 50,"
- "\"heart_beat_timeout_ms\": 100,"
- "\"groups\": [\"default\"],"
- "\"keep_context\": true,"
- "\"steal_focus\": true,"
- "\"priority\": \"EMERGENCY\","
- "\"default_hmi\": \"FULL\","
- "\"certificate\": \"sign\""
- "}, "
- "\"pre_DataConsent\": {"
- "\"memory_kb\": 50,"
- "\"heart_beat_timeout_ms\": 100,"
- "\"groups\": [\"default\"],"
- "\"keep_context\": true,"
- "\"steal_focus\": true,"
- "\"priority\": \"EMERGENCY\","
- "\"default_hmi\": \"FULL\","
- "\"certificate\": \"sign\""
- "}, "
- "\"device\": {"
- "\"memory_kb\": 50,"
- "\"heart_beat_timeout_ms\": 100,"
- "\"groups\": [\"default\"],"
- "\"keep_context\": true,"
- "\"steal_focus\": true,"
- "\"priority\": \"EMERGENCY\","
- "\"default_hmi\": \"FULL\","
- "\"certificate\": \"sign\""
- "},"
- "\"1234\": {"
- "\"memory_kb\": 50,"
- "\"heart_beat_timeout_ms\": 100,"
- "\"groups\": [\"default\"],"
- "\"keep_context\": true,"
- "\"steal_focus\": true,"
- "\"priority\": \"EMERGENCY\","
- "\"default_hmi\": \"FULL\","
- "\"certificate\": \"sign\""
- "}"
- "},"
- "\"consumer_friendly_messages\": {"
- "\"version\": \"1.2\""
- "},"
- "\"functional_groupings\": {"
- "\"default\": {"
- "\"rpcs\": {"
- "\"Update\": {"
- "\"hmi_levels\": [\"FULL\"],"
- "\"parameters\" : [\"speed\"]"
- "}"
- "}"
- "}"
- "}"
- "}"
- "}");
- Json::Value table(Json::objectValue);
- Json::Reader reader;
- EXPECT_TRUE(reader.parse(load_table, table));
- return table;
-}
-
-TEST_F(PolicyManagerImplTest, GetNotificationsNumber) {
- const std::string priority = "EMERGENCY";
- const uint32_t notif_number = 100u;
- EXPECT_CALL(*cache_manager, GetNotificationsNumber(priority))
- .WillOnce(Return(notif_number));
-
- EXPECT_EQ(notif_number, manager->GetNotificationsNumber(priority));
-}
-
-TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) {
- // Arrange
- Json::Value table = CreatePTforLoad();
- policy_table::Table update(&table);
- update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
- // Act
- const std::string json = table.toStyledString();
- ::policy::BinaryMessage msg(json.begin(), json.end());
- EXPECT_CALL(listener, OnUpdateStatusChanged(_));
- EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
-
- std::string priority = "emergency";
- uint32_t notif_number = manager->GetNotificationsNumber(priority);
- EXPECT_EQ(1u, notif_number);
-
- priority = "navigation";
- notif_number = manager->GetNotificationsNumber(priority);
- EXPECT_EQ(2u, notif_number);
-
- priority = "emergency";
- notif_number = manager->GetNotificationsNumber(priority);
- EXPECT_EQ(1u, notif_number);
-
- priority = "VOICECOMM";
- notif_number = manager->GetNotificationsNumber(priority);
- EXPECT_EQ(3u, notif_number);
-
- priority = "normal";
- notif_number = manager->GetNotificationsNumber(priority);
- EXPECT_EQ(5u, notif_number);
-
- priority = "none";
- notif_number = manager->GetNotificationsNumber(priority);
- EXPECT_EQ(6u, notif_number);
-}
-
-TEST_F(PolicyManagerImplTest2, IsAppRevoked_SetRevokedAppID_ExpectAppRevoked) {
- // Arrange
- std::ifstream ifile("sdl_preloaded_pt.json");
- Json::Reader reader;
- std::string json;
- Json::Value root(Json::objectValue);
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
- root["policy_table"]["app_policies"][app_id1] = Json::nullValue;
- json = root.toStyledString();
- }
- ifile.close();
-
- ::policy::BinaryMessage msg(json.begin(), json.end());
- ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
- EXPECT_TRUE(manager->IsApplicationRevoked(app_id1));
-}
-
-TEST_F(PolicyManagerImplTest2,
- CheckPermissions_SetRevokedAppID_ExpectRPCDisallowed) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- (manager->GetCache())->AddDevice(dev_id1, "Bluetooth");
- (manager->GetCache())
- ->SetDeviceData(dev_id1,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth");
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id1))
- .WillRepeatedly(Return(dev_id1));
- manager->SetUserConsentForDevice(dev_id1, true);
- // Add app from consented device. App will be assigned with default policies
- manager->AddApplication(app_id1);
- // Check before action
- policy_table::RpcParameters rpc_parameters;
- rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
-
- policy_table::Rpc rpc;
- rpc["Alert"] = rpc_parameters;
-
- ::policy::RPCParams input_params;
- ::policy::CheckPermissionResult output;
-
- manager->CheckPermissions(
- app_id1, std::string("FULL"), "Alert", input_params, output);
-
- // Check RPC is allowed
- EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
- ASSERT_TRUE(output.list_of_allowed_params.empty());
- // Act
- std::ifstream ifile("sdl_preloaded_pt.json");
- Json::Reader reader;
- std::string json;
- Json::Value root(Json::objectValue);
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
- root["policy_table"]["app_policies"][app_id1] = Json::nullValue;
- json = root.toStyledString();
- }
- ifile.close();
-
- ::policy::BinaryMessage msg(json.begin(), json.end());
- ASSERT_TRUE(manager->LoadPT("file_pt_update.json", msg));
-
- manager->CheckPermissions(
- app_id1, std::string("FULL"), "Alert", input_params, output);
- // Check RPC is disallowed
- EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
- ASSERT_TRUE(output.list_of_allowed_params.empty());
-}
-
-TEST_F(PolicyManagerImplTest2,
- CheckPermissions_SetAppIDwithPolicies_ExpectRPCAllowed) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddDevice(dev_id1, "Bluetooth");
-
- ASSERT_TRUE((manager->GetCache())
- ->SetDeviceData(dev_id1,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth"));
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired("1234"))
- .WillRepeatedly(Return(dev_id1));
- manager->SetUserConsentForDevice(dev_id1, true);
- // Add app from consented device. App will be assigned with default policies
- manager->AddApplication("1234");
- // Emulate PTU with new policies for app added above
- std::ifstream ifile("sdl_preloaded_pt.json");
- Json::Reader reader;
- std::string json;
- Json::Value root(Json::objectValue);
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
- // Add AppID with policies
- root["policy_table"]["app_policies"]["1234"] =
- Json::Value(Json::objectValue);
- root["policy_table"]["app_policies"]["1234"]["memory_kb"] = Json::Value(50);
- root["policy_table"]["app_policies"]["1234"]["heart_beat_timeout_ms"] =
- Json::Value(100);
- root["policy_table"]["app_policies"]["1234"]["AppHMIType"] =
- Json::Value(Json::arrayValue);
- root["policy_table"]["app_policies"]["1234"]["AppHMIType"][0] =
- Json::Value("MEDIA");
- root["policy_table"]["app_policies"]["1234"]["groups"] =
- Json::Value(Json::arrayValue);
- root["policy_table"]["app_policies"]["1234"]["groups"][0] =
- Json::Value("Base-4");
- root["policy_table"]["app_policies"]["1234"]["priority"] =
- Json::Value("EMERGENCY");
- root["policy_table"]["app_policies"]["1234"]["default_hmi"] =
- Json::Value("FULL");
- root["policy_table"]["app_policies"]["1234"]["keep_context"] =
- Json::Value(true);
- root["policy_table"]["app_policies"]["1234"]["steal_focus"] =
- Json::Value(true);
- root["policy_table"]["app_policies"]["1234"]["certificate"] =
- Json::Value("sign");
- json = root.toStyledString();
- }
- ifile.close();
-
- ::policy::BinaryMessage msg(json.begin(), json.end());
- // Load Json to cache
- EXPECT_TRUE(manager->LoadPT("file_pt_update.json", msg));
-
- policy_table::RpcParameters rpc_parameters;
- rpc_parameters.hmi_levels.push_back(policy_table::HL_FULL);
-
- policy_table::Rpc rpc;
- rpc["Alert"] = rpc_parameters;
- ::policy::RPCParams input_params;
- ::policy::CheckPermissionResult output;
-
- (manager->GetCache())->AddDevice(dev_id1, "Bluetooth");
- (manager->GetCache())
- ->SetDeviceData(dev_id1,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth");
- manager->CheckPermissions(
- std::string("1234"), std::string("FULL"), "Alert", input_params, output);
- // Check RPC is allowed
- EXPECT_EQ(::policy::kRpcAllowed, output.hmi_level_permitted);
- // Check list of parameters empty
- ASSERT_TRUE(output.list_of_allowed_params.empty());
-}
-
-TEST_F(PolicyManagerImplTest, IncrementGlobalCounter) {
- // Assert
- EXPECT_CALL(*cache_manager, Increment(usage_statistics::SYNC_REBOOTS));
- manager->Increment(usage_statistics::SYNC_REBOOTS);
-}
-
-TEST_F(PolicyManagerImplTest, IncrementAppCounter) {
- // Assert
- EXPECT_CALL(*cache_manager,
- Increment("12345", usage_statistics::USER_SELECTIONS));
- manager->Increment("12345", usage_statistics::USER_SELECTIONS);
-}
-
-TEST_F(PolicyManagerImplTest, SetAppInfo) {
- // Assert
- EXPECT_CALL(*cache_manager,
- Set("12345", usage_statistics::LANGUAGE_GUI, "de-de"));
- manager->Set("12345", usage_statistics::LANGUAGE_GUI, "de-de");
-}
-
-TEST_F(PolicyManagerImplTest, AddAppStopwatch) {
- // Assert
- EXPECT_CALL(*cache_manager,
- Add("12345", usage_statistics::SECONDS_HMI_FULL, 30));
- manager->Add("12345", usage_statistics::SECONDS_HMI_FULL, 30);
-}
-
-TEST_F(PolicyManagerImplTest, ResetPT) {
- EXPECT_CALL(*cache_manager, ResetPT("filename"))
- .WillOnce(Return(true))
- .WillOnce(Return(false));
- EXPECT_CALL(*cache_manager, ResetCalculatedPermissions()).Times(AtLeast(1));
- EXPECT_CALL(*cache_manager, TimeoutResponse());
- EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_));
-
- EXPECT_TRUE(manager->ResetPT("filename"));
- EXPECT_FALSE(manager->ResetPT("filename"));
-}
-
-TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) {
- // Arrange
- Json::Value table = CreatePTforLoad();
- policy_table::Table update(&table);
- update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
-
- // Assert
- ASSERT_TRUE(IsValid(update));
-
- EXPECT_CALL(*cache_manager, GetHMIAppTypeAfterUpdate(_)).Times(AtLeast(1));
-
- // Act
- const std::string json = table.toStyledString();
- ::policy::BinaryMessage msg(json.begin(), json.end());
-
- utils::SharedPtr<policy_table::Table> snapshot =
- utils::MakeShared<policy_table::Table>(update.policy_table);
- // Assert
- EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot));
- EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true));
- EXPECT_CALL(listener, GetAppName("1234"))
- .WillOnce(Return(custom_str::CustomString("")));
- 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, LoadPT_SetInvalidUpdatePT_PTIsNotLoaded) {
- // Arrange
- Json::Value table(Json::objectValue);
-
- policy_table::Table update(&table);
- update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
-
- // Assert update is invalid
- ASSERT_FALSE(IsValid(update));
-
- // Act
- std::string json = table.toStyledString();
- ::policy::BinaryMessage msg(json.begin(), json.end());
-
- // Assert
- EXPECT_CALL(*cache_manager, GenerateSnapshot()).Times(0);
- EXPECT_CALL(*cache_manager, ApplyUpdate(_)).Times(0);
- EXPECT_CALL(listener, GetAppName(_)).Times(0);
- EXPECT_CALL(listener, OnUpdateStatusChanged(_)).Times(1);
- EXPECT_CALL(*cache_manager, SaveUpdateRequired(false)).Times(0);
- EXPECT_CALL(*cache_manager, TimeoutResponse()).Times(0);
- EXPECT_CALL(*cache_manager, SecondsBetweenRetries(_)).Times(0);
- EXPECT_FALSE(manager->LoadPT("file_pt_update.json", msg));
-}
-
-TEST_F(PolicyManagerImplTest2,
- KmsChanged_SetExceededKms_ExpectCorrectSchedule) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- ::policy::Counters counter = ::policy::Counters::KILOMETERS;
- manager->PTUpdatedAt(counter, 50000);
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- // Set kms changed but not exceed limit
- manager->KmsChanged(51500);
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- // Set kms changed and exceed limit
- manager->KmsChanged(52500);
- EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
-}
-
-TEST_F(
- PolicyManagerImplTest2,
- AddApplication_AddNewApplicationFromDeviceWithoutConsent_ExpectUpdateRequired) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id1);
- EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
-}
-
-TEST_F(
- PolicyManagerImplTest2,
- ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithConsent_ExpectDefault) {
- // Arrange
- // RequestTypes for default & preDataConsent are different
- CreateLocalPT("ptu_requestType.json");
- manager->AddApplication(app_id1);
- EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
- manager->ReactOnUserDevConsentForApp(app_id1, true);
- EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
- EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id1));
-}
-
-TEST_F(
- PolicyManagerImplTest2,
- ReactOnUserDevConsentForApp_AddNewApplicationFromDeviceWithConsent_ExpectPreDataConsent) {
- // Arrange
- // RequestTypes for default & preDataConsent are the same
- CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id1);
- EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
- EXPECT_CALL(listener, OnPendingPermissionChange(app_id1)).Times(0);
- manager->ReactOnUserDevConsentForApp(app_id1, true);
- EXPECT_FALSE(manager->IsPredataPolicy(app_id1));
- EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id1));
-}
-
-TEST_F(
- PolicyManagerImplTest2,
- AddApplication_AddExistingApplicationFromDeviceWithoutConsent_ExpectNoUpdateRequired) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- GetPTU("valid_sdl_pt_update.json");
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- // Try to add existing app
- manager->AddApplication(app_id2);
- // Check no update required
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
-}
-
-TEST_F(PolicyManagerImplTest2,
- PTUpdatedAt_DaysNotExceedLimit_ExpectNoUpdateRequired) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- TimevalStruct current_time = date_time::DateTime::getCurrentTime();
- const int kSecondsInDay = 60 * 60 * 24;
- int days = current_time.tv_sec / kSecondsInDay;
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
-
- GetPTU("valid_sdl_pt_update.json");
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
-
- manager->AddApplication(app_id2);
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- ::policy::Counters counter = ::policy::Counters::DAYS_AFTER_EPOCH;
- // Set PT was updated 10 days ago (limit is 30 days for now)
- // So no limit exceeded
- manager->PTUpdatedAt(counter, days - 10);
- manager->OnAppRegisteredOnMobile(app_id2);
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
-}
-
-TEST_F(PolicyManagerImplTest2, ForcePTExchange_ExpectUpdateNeeded) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
- // Force OT Exchange
- manager->ForcePTExchange();
- // Check update required
- EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
-}
-
-TEST_F(PolicyManagerImplTest2, OnSystemReady) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- // Check
- EXPECT_CALL(listener, OnSystemInfoUpdateRequired());
- manager->OnSystemReady();
-}
-
-TEST_F(PolicyManagerImplTest2, ResetRetrySequence) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->ResetRetrySequence();
- EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
- manager->OnUpdateStarted();
- EXPECT_EQ("UPDATING", manager->GetPolicyTableStatus());
-}
-
-TEST_F(PolicyManagerImplTest2, NextRetryTimeout_ExpectTimeoutsFromPT) {
- // Arrange
- std::ifstream ifile("sdl_preloaded_pt.json");
- Json::Reader reader;
- Json::Value root(Json::objectValue);
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
- Json::Value seconds_between_retries = Json::Value(Json::arrayValue);
- seconds_between_retries =
- root["policy_table"]["module_config"]["seconds_between_retries"];
- uint32_t size = seconds_between_retries.size();
- CreateLocalPT("sdl_preloaded_pt.json");
-
- uint32_t waiting_timeout = 0u;
-
- for (uint32_t retry_number = 0u; retry_number < size; ++retry_number) {
- waiting_timeout += seconds_between_retries[retry_number].asInt();
- waiting_timeout += manager->TimeoutExchange();
-
- // it's in miliseconds
- EXPECT_EQ(waiting_timeout * date_time::DateTime::MILLISECONDS_IN_SECOND,
- manager->NextRetryTimeout());
- }
- }
-}
-
-TEST_F(PolicyManagerImplTest2, TimeOutExchange) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- // Check value taken from PT
- EXPECT_EQ(70, manager->TimeoutExchange());
-}
-
-TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) {
- // Arrange necessary pre-conditions
- StringsForUpdate new_data;
- new_data.new_field_name_ = "Notifications-";
- CreateNewRandomData(new_data);
- // Create Initial LocalPT from preloadedPT
- CreateLocalPT("sdl_preloaded_pt.json");
- // Update preloadedPT
- std::ifstream ifile("sdl_preloaded_pt.json");
- Json::Reader reader;
- Json::Value root(Json::objectValue);
-
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
- root["policy_table"]["module_config"]["preloaded_date"] =
- new_data.new_date_;
- Json::Value val(Json::objectValue);
- Json::Value val2(Json::arrayValue);
- val2[0] = hmi_level[index];
- val[new_data.new_field_value_]["hmi_levels"] = val2;
- root["policy_table"]["functional_groupings"][new_data
- .new_field_name_]["rpcs"] =
- val;
- root["policy_table"]["functional_groupings"][new_data.new_field_name_]
- ["user_consent_prompt"] = new_data.new_field_name_;
- }
- ifile.close();
-
- Json::StyledStreamWriter writer;
- std::ofstream ofile("sdl_preloaded_pt.json");
- writer.write(ofile, root);
- ofile.flush();
- ofile.close();
-
- // Make PolicyManager to update LocalPT
- EXPECT_TRUE(manager->InitPT("sdl_preloaded_pt.json", &policy_settings_));
-
- // Arrange
- ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache();
- utils::SharedPtr<policy_table::Table> table = cache->GenerateSnapshot();
- // Get FunctionalGroupings
- policy_table::FunctionalGroupings& fc =
- table->policy_table.functional_groupings;
- // Get RPCs for new added field in functional_group
- policy_table::Rpcs& rpcs = fc[new_data.new_field_name_];
- // Get user consent prompt
- const std::string& ucp = *(rpcs.user_consent_prompt);
- // Get Rpcs
- policy_table::Rpc& rpc = rpcs.rpcs;
- // Get RPC's parameters
- policy_table::RpcParameters& rpc_param = rpc[new_data.new_field_value_];
-
- // Check preloaded date
- EXPECT_EQ(static_cast<std::string>(
- *(table->policy_table.module_config.preloaded_date)),
- new_data.new_date_);
- // Check if new field exists in Local PT
- EXPECT_TRUE(fc.find(new_data.new_field_name_) != fc.end());
- // Check if user_consent_propmp is correct
- EXPECT_EQ(new_data.new_field_name_, ucp);
- // Check if new RPC exists
- EXPECT_TRUE(rpc.find(new_data.new_field_value_) != rpc.end());
- // Check HMI level of new RPC
- EXPECT_EQ(index, static_cast<uint32_t>(rpc_param.hmi_levels[0]));
- // Check if new field matches field added to preloaded PT
- EXPECT_EQ(std::string((*(fc.find(new_data.new_field_name_))).first),
- new_data.new_field_name_);
-}
-
-TEST_F(PolicyManagerImplTest2, GetPolicyTableStatus_ExpectUpToDate) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- // Check
- EXPECT_EQ("UP_TO_DATE", manager->GetPolicyTableStatus());
-}
-
-TEST_F(PolicyManagerImplTest2,
- RetrySequenceDelaysSeconds_Expect_CorrectValues) {
- // Arrange
- std::ifstream ifile("sdl_preloaded_pt.json");
- Json::Reader reader;
- Json::Value root(Json::objectValue);
- if (ifile.is_open() && reader.parse(ifile, root, true)) {
- Json::Value seconds_between_retries = Json::Value(Json::arrayValue);
- seconds_between_retries =
- root["policy_table"]["module_config"]["seconds_between_retries"];
- uint32_t size = seconds_between_retries.size();
- CreateLocalPT("sdl_preloaded_pt.json");
- std::vector<int> delaySecs = manager->RetrySequenceDelaysSeconds();
- // Check
- ASSERT_EQ(size, delaySecs.size());
- for (uint32_t i = 0; i < size; ++i) {
- EXPECT_EQ(seconds_between_retries[i], delaySecs[i]);
- }
- }
-}
-
-TEST_F(PolicyManagerImplTest2,
- OnExceededTimeout_GetPolicyTableStatus_ExpectUpdateNeeded) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->OnExceededTimeout();
- // Check
- EXPECT_EQ("UPDATE_NEEDED", manager->GetPolicyTableStatus());
-}
-
-TEST_F(PolicyManagerImplTest2,
- GetUserConsentForDevice_SetDeviceAllowed_ExpectReceivedConsentCorrect) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
-
- ASSERT_TRUE((manager->GetCache())
- ->SetDeviceData(dev_id2,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth"));
-
- manager->SetUserConsentForDevice(dev_id2, true);
- ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
- // Check
- EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
-}
-
-TEST_F(PolicyManagerImplTest2,
- GetDefaultHmi_SetDeviceAllowed_ExpectReceivedHmiCorrect) {
- // Arrange
- CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id2);
- // Check if app has preData policy
- EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
- std::string default_hmi1;
- manager->GetDefaultHmi(app_id2, &default_hmi1);
- EXPECT_EQ("", default_hmi1);
- ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- ASSERT_TRUE((manager->GetCache())
- ->SetDeviceData(dev_id2,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth"));
- manager->SetUserConsentForDevice(dev_id2, true);
- ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
- // Check
- EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
- .WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2);
- EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
- std::string default_hmi2;
- manager->GetDefaultHmi(app_id2, &default_hmi2);
- EXPECT_EQ("", default_hmi2);
-}
-
-TEST_F(PolicyManagerImplTest2,
- GetDefaultPriority_SetDeviceAllowed_ExpectReceivedPriorityCorrect) {
- // Arrange
- CreateLocalPT("ptu2_requestType.json");
- manager->AddApplication(app_id2);
- // Check if app has preData policy
- EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
- std::string priority1;
- EXPECT_TRUE(manager->GetPriority(app_id2, &priority1));
- EXPECT_EQ("EMERGENCY", priority1);
- ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- ASSERT_TRUE((manager->GetCache())
- ->SetDeviceData(dev_id2,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth"));
- manager->SetUserConsentForDevice(dev_id2, true);
- ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
- // Check
- EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
- .WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2);
- EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
- std::string priority2;
- EXPECT_TRUE(manager->GetPriority(app_id2, &priority2));
- EXPECT_EQ("EMERGENCY", priority2);
-}
-
-TEST_F(PolicyManagerImplTest2, GetInitialAppData_ExpectReceivedConsentCorrect) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
- ::policy::StringArray app_nicknames;
- ::policy::StringArray app_hmi_types;
- manager->GetInitialAppData(app_id2, &app_nicknames, &app_hmi_types);
- // Expect Empty nicknames and AppHMITypes
- EXPECT_EQ(0u, app_nicknames.size());
- EXPECT_EQ(0u, app_hmi_types.size());
-
- Json::Value root = GetPTU("valid_sdl_pt_update.json");
-
- Json::Value appHmiTypes = Json::Value(Json::arrayValue);
- appHmiTypes = root["policy_table"]["app_policies"][app_id2]["AppHMIType"];
- uint32_t appHmiType_size = appHmiTypes.size();
-
- Json::Value appNicknames = Json::Value(Json::arrayValue);
- appNicknames = root["policy_table"]["app_policies"][app_id2]["nicknames"];
- uint32_t appNicknames_size = appNicknames.size();
-
- ::policy::StringArray app_nicknames1;
- ::policy::StringArray app_hmi_types1;
- manager->GetInitialAppData(app_id2, &app_nicknames1, &app_hmi_types1);
- uint32_t nick_names_size = app_nicknames1.size();
- uint32_t app_hmi_types_size = app_hmi_types1.size();
- ASSERT_EQ(appHmiType_size, app_hmi_types_size);
- ASSERT_EQ(appNicknames_size, nick_names_size);
- ASSERT_GT(nick_names_size, 0u);
- ASSERT_GT(app_hmi_types_size, 0u);
- // Check nicknames match
- for (uint32_t i = 0; i < nick_names_size; ++i) {
- EXPECT_EQ(app_nicknames1[i], appNicknames[i].asString());
- }
- // Check AppHMITypes match
- for (uint32_t i = 0; i < app_hmi_types_size; ++i) {
- EXPECT_EQ(app_hmi_types1[i], appHmiTypes[i].asString());
- }
-}
-
-TEST_F(
- PolicyManagerImplTest2,
- CanAppKeepContext_AddAppFromUnconsentedDevice_ExpectAppCannotKeepContext) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
- // Check if app has preData policy
- EXPECT_FALSE(manager->IsPredataPolicy(app_id2));
- // Check keep context in preData policy
- EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
-}
-
-TEST_F(PolicyManagerImplTest2,
- CanAppKeepContext_AddAppFromConsentedDevice_ExpectAppCannotKeepContext) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- manager->AddApplication(app_id2);
- ASSERT_TRUE((manager->GetCache())
- ->SetDeviceData(dev_id2,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth"));
- manager->SetUserConsentForDevice(dev_id2, true);
- ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
- EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
- .WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2);
- EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
- // Check keep context in default policy
- EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
-}
-
-TEST_F(PolicyManagerImplTest2,
- CanAppKeepContext_SetPoliciesForAppUpdated_ExpectAppCanKeepContext) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
- GetPTU("valid_sdl_pt_update.json");
- // Check keep context in updated policies for app
- EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
-}
-
-TEST_F(PolicyManagerImplTest2,
- CanAppStealFocus_AddAppFromConsentedDevice_ExpectAppCannotStealFocus) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- manager->AddApplication(app_id2);
- ASSERT_TRUE((manager->GetCache())
- ->SetDeviceData(dev_id2,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth"));
- manager->SetUserConsentForDevice(dev_id2, true);
- ::policy::DeviceConsent consent = manager->GetUserConsentForDevice(dev_id2);
- EXPECT_EQ(::policy::DeviceConsent::kDeviceAllowed, consent);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
- .WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2);
- EXPECT_TRUE((manager->GetCache())->IsDefaultPolicy(app_id2));
- // Check keep context in default policy
- EXPECT_TRUE(manager->CanAppStealFocus(app_id2));
-}
-
-TEST_F(PolicyManagerImplTest2,
- CanAppStealFocus_SetPoliciesForAppUpdated_ExpectAppCanStealFocus) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- manager->AddApplication(app_id2);
- GetPTU("valid_sdl_pt_update.json");
- // Check keep context in updated policies for app
- EXPECT_TRUE(manager->CanAppKeepContext(app_id2));
-}
-
-TEST_F(PolicyManagerImplTest2, GetCurrentDeviceId) {
- // Arrange
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2)).Times(2);
- EXPECT_EQ(custom_str::CustomString(""), manager->GetCurrentDeviceId(app_id2));
- EXPECT_EQ("", manager->GetCurrentDeviceId(app_id2));
-}
-
-TEST_F(PolicyManagerImplTest2,
- GetVehicleInfo_SetVehicleInfo_ExpectReceivedInfoCorrect) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- GetPTU("valid_sdl_pt_update.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->GetPT();
- policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
- ::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo();
-
- EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_make),
- vehicle_info.vehicle_make);
- EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_model),
- vehicle_info.vehicle_model);
- EXPECT_EQ(static_cast<std::string>(*module_config.vehicle_year),
- vehicle_info.vehicle_year);
-}
-
-TEST_F(
- PolicyManagerImplTest2,
- GetPermissionsForApp_SetUserConsentForApp_ExpectReceivedPermissionsCorrect) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
-
- ASSERT_TRUE((manager->GetCache())->AddDevice(dev_id2, "Bluetooth"));
- ASSERT_TRUE((manager->GetCache())
- ->SetDeviceData(dev_id2,
- "hardware IPX",
- "v.8.0.1",
- "Android",
- "4.4.2",
- "Life",
- 2,
- "Bluetooth"));
-
- ::policy::StringArray consented_groups;
- ::policy::StringArray disallowed_groups;
- consented_groups.push_back(std::string("Notifications"));
- (manager->GetCache())
- ->SetUserPermissionsForDevice(
- dev_id2, consented_groups, disallowed_groups);
- manager->SetUserConsentForDevice(dev_id2, true);
- EXPECT_CALL(listener, OnCurrentDeviceIdUpdateRequired(app_id2))
- .WillRepeatedly(Return(dev_id2));
- manager->AddApplication(app_id2);
-
- GetPTU("valid_sdl_pt_update.json");
- ::policy::PermissionConsent perm_consent;
- perm_consent.device_id = dev_id2;
- perm_consent.policy_app_id = app_id2;
- perm_consent.consent_source = "VR";
-
- ::policy::FunctionalGroupPermission group1_perm;
- group1_perm.group_alias = "Notifications";
- group1_perm.group_name = "Notifications";
- group1_perm.group_id = ::utils::Djb2HashFromString("Notifications");
- group1_perm.state = ::policy::GroupConsent::kGroupAllowed;
-
- std::vector< ::policy::FunctionalGroupPermission> groups_permissions;
- groups_permissions.push_back(group1_perm);
- perm_consent.group_permissions = groups_permissions;
-
- manager->SetUserConsentForApp(perm_consent);
- manager->SendNotificationOnPermissionsUpdated(app_id2);
- std::vector< ::policy::FunctionalGroupPermission> actual_groups_permissions;
- std::vector< ::policy::FunctionalGroupPermission>::iterator it;
- manager->GetPermissionsForApp(dev_id2, app_id2, actual_groups_permissions);
- uint32_t index = 0;
- for (; index < actual_groups_permissions.size(); ++index) {
- if (actual_groups_permissions[index].group_id == group1_perm.group_id) {
- break;
- }
- }
- // Check
- EXPECT_EQ(group1_perm.group_alias,
- actual_groups_permissions[index].group_alias);
- EXPECT_EQ(group1_perm.group_name,
- actual_groups_permissions[index].group_name);
- EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id);
- EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state);
-}
-
-TEST_F(
- PolicyManagerImplTest2,
- HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
- // Arrange
- CreateLocalPT("sdl_preloaded_pt.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->GetPT();
- ::policy_table::PolicyTableType type1 =
- ::policy_table::PolicyTableType::PT_PRELOADED;
- pt->SetPolicyTableType(type1);
- if (!pt->is_valid()) {
- std::cout << "\nPolicy table is not valid."
- << "\n";
- rpc::ValidationReport report("policy_table");
- pt->ReportErrors(&report);
- }
- // Add new app
- manager->AddApplication(app_id2);
- uint32_t result = manager->HeartBeatTimeout(app_id2);
- // By default hertbeat timeout is 0
- EXPECT_EQ(0u, result);
- Json::Value root = GetPTU("valid_sdl_pt_update.json");
-
- ::policy_table::PolicyTableType type2 =
- ::policy_table::PolicyTableType::PT_UPDATE;
- pt->SetPolicyTableType(type2);
- if (!pt->is_valid()) {
- std::cout << "\nPolicy table is not valid."
- << "\n";
- rpc::ValidationReport report("policy_table");
- pt->ReportErrors(&report);
- }
-
- Json::Value heart_beat_timeout = Json::Value(Json::uintValue);
- heart_beat_timeout =
- root["policy_table"]["app_policies"][app_id2]["heart_beat_timeout_ms"];
- result = manager->HeartBeatTimeout(app_id2);
- EXPECT_EQ(heart_beat_timeout.asUInt(), result);
-}
-
-} // namespace policy
-} // namespace components
-} // namespace test
diff --git a/src/components/policy/test/shared_library_test.cc b/src/components/policy/test/shared_library_test.cc
deleted file mode 100644
index f4177f0fd9..0000000000
--- a/src/components/policy/test/shared_library_test.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <dlfcn.h>
-
-#include "gtest/gtest.h"
-
-namespace test {
-namespace components {
-namespace policy {
-
-::testing::AssertionResult IsError(void* error) {
- if (error) {
- return ::testing::AssertionSuccess() << static_cast<const char*>(error);
- } else {
- return ::testing::AssertionFailure() << error;
- }
-}
-
-TEST(SharedLibraryTest,
- FullTest_OpenLibrarySetSymbolCloseLibrary_ExpectActsWithoutErrors) {
- // Arrange
- const std::string kLib = "../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()));
-}
-
-} // namespace policy
-} // namespace components
-} // namespace test
diff --git a/src/components/policy/test/sql_pt_representation_test.cc b/src/components/policy/test/sql_pt_representation_test.cc
deleted file mode 100644
index 42f7a9cc33..0000000000
--- a/src/components/policy/test/sql_pt_representation_test.cc
+++ /dev/null
@@ -1,1711 +0,0 @@
-/* Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <vector>
-#include <string>
-#include <algorithm>
-#include <fstream>
-#include <memory>
-#include <stdio.h>
-#include <sys/stat.h>
-
-#include "gtest/gtest.h"
-#include "policy/test/include/driver_dbms.h"
-#include "policy/sql_pt_representation.h"
-#include "policy/policy_types.h"
-#include "policy/mock_policy_settings.h"
-#include "json/writer.h"
-#include "json/reader.h"
-#include "rpc_base/rpc_base.h"
-#include "policy/mock_policy_settings.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
-#include "utils/file_system.h"
-#include "policy/policy_table/types.h"
-#include "policy/policy_table/enums.h"
-#include "rpc_base/rpc_base.h"
-#include "utils/sqlite_wrapper/sql_database.h"
-
-namespace policy_table = rpc::policy_table_interface_base;
-using policy::SQLPTRepresentation;
-using policy::CheckPermissionResult;
-using policy::UserFriendlyMessage;
-using policy::EndpointUrls;
-using policy::VehicleInfo;
-
-using testing::ReturnRef;
-using testing::Return;
-using testing::NiceMock;
-using testing::Mock;
-
-namespace test {
-namespace components {
-namespace policy {
-
-class SQLPTRepresentationTest : public SQLPTRepresentation,
- public ::testing::Test {
- protected:
- static DBMS* dbms;
- static SQLPTRepresentation* reps;
- static const std::string kDatabaseName;
- static const std::string kAppStorageFolder;
- // Gtest can show message that this object doesn't destroyed
- static std::auto_ptr<policy_handler_test::MockPolicySettings>
- policy_settings_;
-
- static void SetUpTestCase() {
- file_system::DeleteFile(kAppStorageFolder + "/policy.sqlite");
- reps = new SQLPTRepresentation;
- policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>(
- new policy_handler_test::MockPolicySettings());
- ON_CALL(*policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- EXPECT_EQ(::policy::SUCCESS, reps->Init(policy_settings_.get()));
- dbms = new DBMS(kAppStorageFolder + "/" + kDatabaseName);
- EXPECT_TRUE(dbms->Open());
- }
-
- void TearDown() OVERRIDE {
- EXPECT_TRUE(reps->Clear());
- }
-
- static void TearDownTestCase() {
- EXPECT_TRUE(reps->Drop());
- EXPECT_TRUE(reps->Close());
- reps->RemoveDB();
- delete reps;
- dbms->Close();
- file_system::RemoveDirectory(kAppStorageFolder);
- policy_settings_.reset();
- }
-
- virtual utils::dbms::SQLDatabase* db() const {
- return reps->db();
- }
-
- void GatherModuleMeta(policy_table::ModuleMeta* meta) const {
- ::SQLPTRepresentation::GatherModuleMeta(meta);
- }
-
- void GatherModuleConfig(policy_table::ModuleConfig* config) const {
- ::SQLPTRepresentation::GatherModuleConfig(config);
- }
-
- bool GatherUsageAndErrorCounts(
- policy_table::UsageAndErrorCounts* counts) const {
- return ::SQLPTRepresentation::GatherUsageAndErrorCounts(counts);
- }
-
- bool GatherApplicationPoliciesSection(
- policy_table::ApplicationPoliciesSection* policies) const {
- return ::SQLPTRepresentation::GatherApplicationPoliciesSection(policies);
- }
- virtual void GatherDeviceData(policy_table::DeviceData* data) const {
- ::SQLPTRepresentation::GatherDeviceData(data);
- }
-
- virtual bool GatherConsumerFriendlyMessages(
- policy_table::ConsumerFriendlyMessages* messages) const {
- return ::SQLPTRepresentation::GatherConsumerFriendlyMessages(messages);
- }
-
- bool GatherAppGroup(const std::string& app_id,
- policy_table::Strings* app_groups) const {
- return ::SQLPTRepresentation::GatherAppGroup(app_id, app_groups);
- }
-
- bool GatherAppType(const std::string& app_id,
- policy_table::AppHMITypes* app_types) const {
- return ::SQLPTRepresentation::GatherAppType(app_id, app_types);
- }
-
- bool GatherRequestType(const std::string& app_id,
- policy_table::RequestTypes* request_types) const {
- return ::SQLPTRepresentation::GatherRequestType(app_id, request_types);
- }
-
- bool GatherNickName(const std::string& app_id,
- policy_table::Strings* nicknames) const {
- return ::SQLPTRepresentation::GatherNickName(app_id, nicknames);
- }
-
- void CheckAppPoliciesSection(
- policy_table::ApplicationPoliciesSection& policies,
- uint16_t apps_size,
- policy_table::Priority prio,
- const std::string& section,
- uint16_t memory_kb,
- uint32_t heart_beat_timeout_ms,
- policy_table::Strings& groups) const {
- if (section != "device") {
- policy_table::ApplicationPolicies& apps = policies.apps;
- EXPECT_EQ(apps_size, apps.size());
- policy_table::ApplicationPolicies::iterator apps_iter =
- apps.find(section);
- ASSERT_TRUE(apps.end() != apps_iter);
- policy_table::Strings& temp_groups = apps_iter->second.groups;
- StringsCompare(groups, temp_groups);
- EXPECT_EQ(0u, (*(apps_iter->second.nicknames)).size());
- EXPECT_EQ(prio, apps_iter->second.priority);
- EXPECT_EQ(0u, (*(apps_iter->second.AppHMIType)).size());
- EXPECT_EQ(memory_kb, (*(apps_iter->second.memory_kb)));
- EXPECT_EQ(heart_beat_timeout_ms,
- (*(apps_iter->second.heart_beat_timeout_ms)));
- } else {
- policy_table::DevicePolicy& device = policies.device;
- EXPECT_EQ(prio, device.priority);
- }
- }
-
- void StringsCompare(policy_table::Strings& groups1,
- policy_table::Strings& groups2) const {
- EXPECT_EQ(groups1.size(), groups2.size());
- std::sort(groups1.begin(), groups1.end());
- std::sort(groups2.begin(), groups2.end());
- EXPECT_TRUE(groups1 == groups2);
- }
-
- void CheckAppGroups(const std::string& app_id,
- policy_table::Strings& groups) {
- policy_table::Strings app_groups;
- GatherAppGroup(app_id, &app_groups);
- StringsCompare(groups, app_groups);
- }
-
- void PolicyTableUpdatePrepare(Json::Value& table) {
- // Root
- table["policy_table"] = Json::Value(Json::objectValue);
-
- // 1st level
- 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);
- policy_table["usage_and_error_counts"] = Json::Value(Json::objectValue);
- policy_table["device_data"] = Json::Value(Json::objectValue);
-
- // 'module_config' section start
- Json::Value& module_config = policy_table["module_config"];
- module_config["preloaded_pt"] = Json::Value(false);
- module_config["preloaded_date"] = Json::Value("");
- 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("");
- module_config["vehicle_model"] = Json::Value("");
- module_config["vehicle_year"] = Json::Value("");
- module_config["certificate"] = Json::Value("encrypted_certificate_content");
- // 'module_config' section end
-
- // 'functional_groupings' section start
- 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("some_msg_version");
- consumer_friendly_messages["messages"] = Json::Value(Json::objectValue);
- consumer_friendly_messages["messages"]["MSG_CODE"] =
- Json::Value(Json::objectValue);
- Json::Value& msg1 = consumer_friendly_messages["messages"]["MSG_CODE"];
- msg1["languages"] = Json::Value(Json::objectValue);
- msg1["languages"]["en-us"] = Json::Value(Json::objectValue);
- // 'functional_groupings' section end
-
- // 'app_policies' section start
- 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);
- // 'app_policies' section end
-
- Json::Value& usage_and_error_counts =
- policy_table["usage_and_error_counts"];
- usage_and_error_counts["app_level"] = Json::Value(Json::objectValue);
- usage_and_error_counts["app_level"]["some_app_id"] =
- Json::Value(Json::objectValue);
- usage_and_error_counts["app_level"]["some_app_id"]["count_of_tls_errors"] =
- Json::Value(5);
-
- Json::Value& device_data = policy_table["device_data"];
- device_data["device_id_hash_1"] = Json::Value(Json::objectValue);
- device_data["device_id_hash_2"] = Json::Value(Json::objectValue);
- device_data["device_id_hash_3"] = Json::Value(Json::objectValue);
- }
-
- ::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);
- }
- }
-};
-
-DBMS* SQLPTRepresentationTest::dbms = 0;
-SQLPTRepresentation* SQLPTRepresentationTest::reps = 0;
-const std::string SQLPTRepresentationTest::kDatabaseName = "policy.sqlite";
-const std::string SQLPTRepresentationTest::kAppStorageFolder = "storage1";
-std::auto_ptr<policy_handler_test::MockPolicySettings>
- SQLPTRepresentationTest::policy_settings_;
-
-class SQLPTRepresentationTest2 : public ::testing::Test {
- protected:
- SQLPTRepresentationTest2()
- : kAppStorageFolder("storage123")
- , kOpenAttemptTimeoutMs(700u)
- , kAttemptsToOpenPolicyDB(8u) {}
-
- void SetUp() OVERRIDE {
- file_system::CreateDirectory(kAppStorageFolder);
- chmod(kAppStorageFolder.c_str(), 00000);
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- ON_CALL(policy_settings_, open_attempt_timeout_ms())
- .WillByDefault(Return(kOpenAttemptTimeoutMs));
- ON_CALL(policy_settings_, attempts_to_open_policy_db())
- .WillByDefault(Return(kAttemptsToOpenPolicyDB));
- reps = new SQLPTRepresentation;
- }
-
- void TearDown() OVERRIDE {
- file_system::RemoveDirectory(kAppStorageFolder, true);
- delete reps;
- }
-
- SQLPTRepresentation* reps;
- NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- const std::string kAppStorageFolder;
- const uint16_t kOpenAttemptTimeoutMs;
- const uint16_t kAttemptsToOpenPolicyDB;
-};
-
-class SQLPTRepresentationTest3 : public ::testing::Test {
- protected:
- SQLPTRepresentationTest3() : kAppStorageFolder("storage") {}
-
- void SetUp() OVERRIDE {
- file_system::CreateDirectory(kAppStorageFolder);
- reps = new SQLPTRepresentation;
- }
-
- void TearDown() OVERRIDE {
- file_system::RemoveDirectory(kAppStorageFolder, true);
- delete reps;
- }
-
- SQLPTRepresentation* reps;
- NiceMock<policy_handler_test::MockPolicySettings> policy_settings_;
- const std::string kAppStorageFolder;
-};
-
-// {AKozoriz} : Unknown behavior (must try 8 times, tried 2 and opened)
-TEST_F(SQLPTRepresentationTest2,
- DISABLED_OpenAttemptTimeOut_ExpectCorrectNumber) {
- EXPECT_EQ(::policy::FAIL, reps->Init(&policy_settings_));
- // Check Actual attempts number made to try to open DB
- EXPECT_EQ(kAttemptsToOpenPolicyDB, reps->open_counter());
- // Check timeot value correctly read from config file.
- EXPECT_EQ(700u, kOpenAttemptTimeoutMs);
-}
-
-TEST_F(SQLPTRepresentationTest,
- RefreshDB_DropExistedPTThenRefreshDB_ExpectTablesWithInitialData) {
- // Check
- const char* query_select =
- "SELECT COUNT(*) FROM sqlite_master WHERE `type` = 'table'";
- // In normally created PT there are more than 0 tables
- ASSERT_GT(dbms->FetchOneInt(query_select), 0);
- ASSERT_TRUE(reps->Drop());
- ASSERT_EQ(0, dbms->FetchOneInt(query_select));
- ASSERT_TRUE(reps->RefreshDB());
- // Check PT structure destroyed and tables number is 0
- ASSERT_EQ(25, dbms->FetchOneInt(query_select));
- const char* query_select_count_of_iap_buffer_full =
- "SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`";
- const char* query_select_count_sync_out_of_memory =
- "SELECT `count_sync_out_of_memory` FROM `usage_and_error_count`";
- const char* query_select_count_of_sync_reboots =
- "SELECT `count_of_sync_reboots` FROM `usage_and_error_count`";
- const char* query_select_pt_exchanged_at_odometer_x =
- "SELECT `pt_exchanged_at_odometer_x` FROM `module_meta`";
- const char* query_select_pt_exchanged_x_days_after_epoch =
- "SELECT `pt_exchanged_x_days_after_epoch` FROM `module_meta`";
- const char* query_select_flag_update_required =
- "SELECT `flag_update_required` FROM `module_meta`";
- const char* query_select_ignition_cycles_since_last_exchange =
- "SELECT `ignition_cycles_since_last_exchange` FROM `module_meta`";
- const char* query_select_preloaded_pt =
- "SELECT `preloaded_pt` FROM `module_config`";
- const char* query_select_is_first_run =
- "SELECT `is_first_run` FROM `module_config`";
- const char* query_select_exchange_after_x_ignition_cycles =
- "SELECT `exchange_after_x_ignition_cycles` FROM `module_config`";
- const char* query_select_exchange_after_x_kilometers =
- "SELECT `exchange_after_x_kilometers` FROM `module_config`";
- const char* query_select_exchange_after_x_days =
- "SELECT `exchange_after_x_days` FROM `module_config`";
- const char* query_select_timeout_after_x_seconds =
- "SELECT `timeout_after_x_seconds` FROM `module_config`";
- const char* query_select_priorities = "SELECT COUNT(`value`) FROM `priority`";
- const char* query_select_hmi_levels =
- "SELECT COUNT(`value`) FROM `hmi_level`";
- const char* query_select_version = "SELECT `number` FROM `version`";
-
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_count_of_iap_buffer_full));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_count_sync_out_of_memory));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_count_of_sync_reboots));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_pt_exchanged_at_odometer_x));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_pt_exchanged_x_days_after_epoch));
- ASSERT_EQ(
- 0, dbms->FetchOneInt(query_select_ignition_cycles_since_last_exchange));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_flag_update_required));
- ASSERT_EQ(1, dbms->FetchOneInt(query_select_preloaded_pt));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_is_first_run));
- ASSERT_EQ(0,
- dbms->FetchOneInt(query_select_exchange_after_x_ignition_cycles));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_exchange_after_x_kilometers));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_exchange_after_x_days));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_timeout_after_x_seconds));
- ASSERT_EQ(6, dbms->FetchOneInt(query_select_priorities));
- ASSERT_EQ(4, dbms->FetchOneInt(query_select_hmi_levels));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_version));
-}
-
-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);";
-
- // 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_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);";
-
- // 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,
- 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,
- 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_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);";
-
- // 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,
- 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";
-
- // 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";
-
- // 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";
-
- // 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_more_limit));
- // Chceck
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_negative_limit));
- // Check
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_negative_current));
- // Check
- EXPECT_EQ(0, reps->IgnitionCyclesBeforeExchange());
-}
-
-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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_zeros));
- // Checks
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_negative_limit));
- // Checks
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_negative_last));
- // Checks
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_limit));
- // Checks
- EXPECT_EQ(0, reps->KilometersBeforeExchange(120));
- EXPECT_EQ(60, reps->KilometersBeforeExchange(50));
- EXPECT_EQ(0, reps->KilometersBeforeExchange(5));
-}
-
-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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_zeros));
- // Checks
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_negative_limit));
- // Checks
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_negative_last));
- // Checks
- 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";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_limit));
- // Checks
- EXPECT_EQ(0, reps->DaysBeforeExchange(120));
- EXPECT_EQ(60, reps->DaysBeforeExchange(50));
- EXPECT_EQ(0, reps->DaysBeforeExchange(5));
-}
-
-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); ";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query_insert));
- ASSERT_TRUE(reps->SecondsBetweenRetries(&seconds));
- // Checks
- ASSERT_EQ(2u, seconds.size());
- EXPECT_EQ(10, seconds[0]);
- EXPECT_EQ(20, seconds[1]);
-}
-
-TEST_F(SQLPTRepresentationTest, TimeoutResponse_Set60Seconds_GetEqualTimeout) {
- // Arrange
- const char* query =
- "UPDATE `module_config` SET `timeout_after_x_seconds` = 60";
-
- // Assert
- ASSERT_TRUE(dbms->Exec(query));
- // Check
- EXPECT_EQ(60, reps->TimeoutResponse());
-}
-
-TEST_F(SQLPTRepresentationTest,
- IsPTPreloaded_SetPTPreloadedThenCheck_ExpectCorrectValue) {
- // Arrange
- const char* query_insert = "UPDATE `module_config` SET `preloaded_pt` = 1";
- ASSERT_TRUE(dbms->Exec(query_insert));
- // Check
- ASSERT_TRUE(reps->IsPTPreloaded());
-}
-
-TEST_F(
- SQLPTRepresentationTest,
- SetCountersPassedForSuccessfulUpdate_SetCounters_ExpectValueChangedInPT) {
- // Arrange
- const char* query_select_odometer =
- "SELECT `pt_exchanged_at_odometer_x` FROM`module_meta`";
- const char* query_select_days_after_epoch =
- "SELECT `pt_exchanged_x_days_after_epoch` FROM`module_meta`";
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_odometer));
- ASSERT_EQ(0, dbms->FetchOneInt(query_select_days_after_epoch));
- // Act
- ASSERT_TRUE(reps->SetCountersPassedForSuccessfulUpdate(100, 10000));
- ASSERT_EQ(100, dbms->FetchOneInt(query_select_odometer));
- ASSERT_EQ(10000, dbms->FetchOneInt(query_select_days_after_epoch));
-}
-
-TEST_F(
- SQLPTRepresentationTest,
- IncrementIgnitionCycles_SetIgnitionCyclesValueThenIncrement_ExpectValueIncrementedInPT) {
- // Arrange
- const char* query_insert =
- "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 54";
- const char* query_select =
- "SELECT `ignition_cycles_since_last_exchange`FROM `module_meta`";
- ASSERT_TRUE(dbms->Exec(query_insert));
- // Act
- reps->IncrementIgnitionCycles();
- // Check
- ASSERT_EQ(55, dbms->FetchOneInt(query_select));
-}
-
-TEST_F(
- SQLPTRepresentationTest,
- ResetIgnitionCycles_SetIgnitionCyclesValueThenReset_ExpectZeroValueInPT) {
- // Arrange
- const char* query_insert =
- "UPDATE `module_meta` SET `ignition_cycles_since_last_exchange` = 55";
- const char* query_select =
- "SELECT `ignition_cycles_since_last_exchange` FROM `module_meta`";
- ASSERT_TRUE(dbms->Exec(query_insert));
- // Act
- reps->ResetIgnitionCycles();
- // Check
- ASSERT_EQ(0, dbms->FetchOneInt(query_select));
-}
-
-TEST_F(SQLPTRepresentationTest,
- GetUserFriendlyMsg_SetMsg_ExpectReceivedMsgSetInParams) {
- // Arrange
-
- const char* query_insert =
- "INSERT INTO `message` (`language_code`, `message_type_name`) VALUES "
- "('en-en', 'AppPermissions')";
-
- ASSERT_TRUE(dbms->Exec(query_insert));
- query_insert =
- "INSERT INTO `message_type` (`name`) VALUES ('AppPermissions')";
- ASSERT_TRUE(dbms->Exec(query_insert));
- std::vector<std::string> msg_code;
- msg_code.push_back("AppPermissions");
- // Act
- std::vector<UserFriendlyMessage> result =
- reps->GetUserFriendlyMsg(msg_code, std::string("en-en"));
- // Checks
- ASSERT_EQ(1u, result.size());
- EXPECT_EQ(result[0].message_code, "AppPermissions");
-}
-
-TEST_F(
- SQLPTRepresentationTest,
- GetNotificationNumber_SetNotificationsPriorities_ExpectReceivedValuesCorrect) {
- // Arrange
- const char* query_insert =
- "INSERT INTO `notifications_by_priority` (`priority_value`, `value`) "
- "VALUES ('NAVIGATION', 15) , "
- "('COMMUNICATION', 6), ('EMERGENCY', 60), ('NONE', 0), ('NORMAL', 4), "
- "('VOICECOMMUNICATION', 20)";
-
- ASSERT_TRUE(dbms->Exec(query_insert));
- EXPECT_EQ(6, reps->GetNotificationsNumber("COMMUNICATION"));
- EXPECT_EQ(60, reps->GetNotificationsNumber("EMERGENCY"));
- EXPECT_EQ(15, reps->GetNotificationsNumber("NAVIGATION"));
- EXPECT_EQ(0, reps->GetNotificationsNumber("NONE"));
- EXPECT_EQ(4, reps->GetNotificationsNumber("NORMAL"));
- EXPECT_EQ(20, reps->GetNotificationsNumber("VOICECOMMUNICATION"));
-}
-
-TEST_F(SQLPTRepresentationTest,
- GetPriority_SetAppsPrioritiesThenGet_ExpectReceivedValuesCorrect) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
- "0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', "
- "'NONE', 0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
- "'COMMUNICATION', 0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
- "0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- std::string priority;
- // Checks
- EXPECT_TRUE(reps->GetPriority("default", &priority));
- EXPECT_EQ("NONE", priority);
- EXPECT_TRUE(reps->GetPriority("pre_DataConsent", &priority));
- EXPECT_EQ("NONE", priority);
- EXPECT_TRUE(reps->GetPriority("device", &priority));
- EXPECT_EQ("COMMUNICATION", priority);
- EXPECT_TRUE(reps->GetPriority("12345", &priority));
- EXPECT_EQ("EMERGENCY", priority);
-}
-
-TEST_F(SQLPTRepresentationTest3, Init_InitNewDataBase_ExpectResultSuccess) {
- // Arrange
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- // Checks
- EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_));
- EXPECT_EQ(::policy::EXISTS, reps->Init(&policy_settings_));
- reps->RemoveDB();
-}
-
-TEST_F(SQLPTRepresentationTest3,
- Init_TryInitNotExistingDataBase_ExpectResultFail) {
- const std::string kEmptyDirectory = "";
- // Arrange
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kEmptyDirectory));
- (reps->db())->set_path("/home/");
- // Check
- EXPECT_EQ(::policy::FAIL, reps->Init(&policy_settings_));
-}
-
-TEST_F(SQLPTRepresentationTest3,
- Close_InitNewDataBaseThenClose_ExpectResultSuccess) {
- // Arrange
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_));
- EXPECT_TRUE(reps->Close());
- utils::dbms::SQLError error(utils::dbms::Error::OK);
- // Checks
- EXPECT_EQ(error.number(), (reps->db()->LastError().number()));
- reps->RemoveDB();
-}
-
-TEST_F(SQLPTRepresentationTest,
- Clear_InitNewDataBaseThenClear_ExpectResultSuccess) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
- "0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'pre_DataConsent', 0, 0, 'NONE', "
- "'NONE', 0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
- "'COMMUNICATION', 0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
- "0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- const char* query_insert =
- "INSERT INTO `notifications_by_priority` (`priority_value`, `value`) "
- "VALUES ('NAVIGATION', 15) , "
- "('COMMUNICATION', 6), ('EMERGENCY', 60), ('NONE', 0), ('NORMAL', 4), "
- "('VOICECOMMUNICATION', 20)";
-
- ASSERT_TRUE(dbms->Exec(query_insert));
- EXPECT_TRUE(reps->Clear());
- utils::dbms::SQLError error(utils::dbms::Error::OK);
- EXPECT_EQ(error.number(), (reps->db()->LastError().number()));
-}
-
-TEST_F(SQLPTRepresentationTest,
- GetInitialAppData_SetData_ExpectCorrectValuesReceived) {
- // Arrange
- const char* query_insert =
- "INSERT INTO `nickname` (`application_id`, `name`)"
- "VALUES ('1111', 'first_app') , "
- "('2222', 'second_app'), ('3333', 'third_app')";
- ASSERT_TRUE(dbms->Exec(query_insert));
-
- query_insert =
- "INSERT INTO `app_type` (`application_id`, `name`)"
- "VALUES ('1111', 'NAVIGATION') , "
- "('1111', 'MEDIA'), ('3333', 'COMMUNICATION')";
- ASSERT_TRUE(dbms->Exec(query_insert));
- ::policy::StringArray nicknames;
- ::policy::StringArray app_types;
- ASSERT_TRUE(reps->GetInitialAppData("1111", &nicknames, &app_types));
- EXPECT_EQ(1u, nicknames.size());
- EXPECT_TRUE(nicknames.end() !=
- std::find(nicknames.begin(), nicknames.end(), "first_app"));
- EXPECT_EQ(2u, app_types.size());
- EXPECT_TRUE(app_types.end() !=
- std::find(app_types.begin(), app_types.end(), "NAVIGATION"));
- EXPECT_TRUE(app_types.end() !=
- std::find(app_types.begin(), app_types.end(), "MEDIA"));
- nicknames.clear();
- app_types.clear();
- ASSERT_TRUE(reps->GetInitialAppData("2222", &nicknames, &app_types));
- EXPECT_EQ(1u, nicknames.size());
- EXPECT_TRUE(nicknames.end() !=
- std::find(nicknames.begin(), nicknames.end(), "second_app"));
- EXPECT_EQ(0u, app_types.size());
- nicknames.clear();
- app_types.clear();
- ASSERT_TRUE(reps->GetInitialAppData("3333", &nicknames, &app_types));
- EXPECT_EQ(1u, nicknames.size());
- EXPECT_TRUE(nicknames.end() !=
- std::find(nicknames.begin(), nicknames.end(), "third_app"));
- EXPECT_EQ(1u, app_types.size());
- EXPECT_TRUE(app_types.end() !=
- std::find(app_types.begin(), app_types.end(), "COMMUNICATION"));
-}
-
-TEST_F(
- SQLPTRepresentationTest,
- GetFunctionalGroupings_SetFunctionalGroupings_ExpectCorrectValuesReceived) {
- // Arrange
- const char* query_insert =
- "INSERT INTO `functional_group` (`id`, `user_consent_prompt`, `name`) "
- "VALUES (73072936, null, 'SendLocation'), (1533011474, null, "
- "'OnKeyboardInputOnlyGroup')";
- ASSERT_TRUE(dbms->Exec(query_insert));
-
- query_insert =
- "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
- "VALUES ('SendLocation', 'BACKGROUND', 73072936), ('SendLocation', "
- "'FULL', 73072936), ('SendLocation', 'LIMITED', 73072936)";
- ASSERT_TRUE(dbms->Exec(query_insert));
-
- query_insert =
- "INSERT INTO `rpc` (`name`, `hmi_level_value`, `functional_group_id`) "
- "VALUES ('OnKeyboardInput', 'FULL', 1533011474)";
- ASSERT_TRUE(dbms->Exec(query_insert));
-
- policy_table::FunctionalGroupings func_groups;
- ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
- EXPECT_EQ(2u, func_groups.size());
- policy_table::FunctionalGroupings::iterator func_groups_it =
- func_groups.find("SendLocation");
- EXPECT_TRUE(func_groups.end() != func_groups_it);
- policy_table::Rpcs& rpcs = func_groups_it->second;
- EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
- policy_table::Rpc& rpc = rpcs.rpcs;
- EXPECT_EQ(1u, rpc.size());
- policy_table::Rpc::const_iterator rpc_it = rpc.find("SendLocation");
- EXPECT_TRUE(rpc.end() != rpc_it);
- const policy_table::HmiLevels& hmi_levels1 = rpc_it->second.hmi_levels;
- EXPECT_EQ(3u, hmi_levels1.size());
- EXPECT_TRUE(hmi_levels1.end() !=
- std::find(hmi_levels1.begin(),
- hmi_levels1.end(),
- policy_table::HmiLevel::HL_BACKGROUND));
- EXPECT_TRUE(hmi_levels1.end() !=
- std::find(hmi_levels1.begin(),
- hmi_levels1.end(),
- policy_table::HmiLevel::HL_LIMITED));
- EXPECT_TRUE(hmi_levels1.end() != std::find(hmi_levels1.begin(),
- hmi_levels1.end(),
- policy_table::HmiLevel::HL_FULL));
-
- func_groups_it = func_groups.find("OnKeyboardInputOnlyGroup");
- EXPECT_TRUE(func_groups.end() != func_groups_it);
- policy_table::Rpcs& rpcs2 = func_groups_it->second;
- EXPECT_EQ("", static_cast<std::string>(*rpcs2.user_consent_prompt));
- policy_table::Rpc& rpc2 = rpcs2.rpcs;
- EXPECT_EQ(1u, rpc2.size());
- rpc_it = rpc2.find("OnKeyboardInput");
- EXPECT_TRUE(rpc2.end() != rpc_it);
- const policy_table::HmiLevels& hmi_levels2 = rpc_it->second.hmi_levels;
- EXPECT_EQ(1u, hmi_levels2.size());
- EXPECT_TRUE(hmi_levels2.end() != std::find(hmi_levels2.begin(),
- hmi_levels2.end(),
- policy_table::HmiLevel::HL_FULL));
-}
-
-TEST_F(
- SQLPTRepresentationTest,
- UpdateRequired_SetUpdateNotRequiredFlagThenCheck_ExpectUpdateNotRequired) {
- // Arrange
- EXPECT_FALSE(reps->UpdateRequired());
-}
-
-TEST_F(SQLPTRepresentationTest,
- UpdateRequired_SetUpdateRequiredFlagThenCheck_ExpectUpdateRequired) {
- // Arrange
- const char* query_insert =
- "UPDATE `module_meta` SET `flag_update_required` = 1";
- // Assert
- ASSERT_TRUE(dbms->Exec(query_insert));
- // Check
- EXPECT_TRUE(reps->UpdateRequired());
-}
-
-TEST_F(SQLPTRepresentationTest,
- SaveUpdateRequired_SaveUpdateRequired_ExpectCorrectValues) {
- // Arrange
- reps->SaveUpdateRequired(true);
- // Check
- EXPECT_TRUE(reps->UpdateRequired());
- // Act
- reps->SaveUpdateRequired(false);
- // Check
- EXPECT_FALSE(reps->UpdateRequired());
-}
-
-TEST_F(SQLPTRepresentationTest,
- IsApplicationRepresented_Check_ExpectCorrectResult) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
- "0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'device', 0, 0, 'NONE', "
- "'COMMUNICATION', 0, 0, 0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
- "0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
- // Checks
- EXPECT_TRUE(reps->IsApplicationRepresented("default"));
- EXPECT_TRUE(reps->IsApplicationRepresented("device"));
- EXPECT_TRUE(reps->IsApplicationRepresented("12345"));
- EXPECT_FALSE(reps->IsApplicationRepresented("1234"));
-}
-
-TEST_F(SQLPTRepresentationTest,
- IsApplicationRevoked_CheckApps_ExpectCorrectResult) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( '7777', 0, 0, 'NONE', 'NONE', 1, "
- "0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'EMERGENCY', "
- "0, 0, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
- // Checks
- EXPECT_TRUE(reps->IsApplicationRevoked("7777"));
- EXPECT_FALSE(reps->IsApplicationRevoked("12345"));
-}
-
-TEST_F(SQLPTRepresentationTest,
- CopyApplication_CopyApplication_ExpectAppCopiedSuccesfully) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( 'default', 0, 0, 'NONE', 'NONE', 0, "
- "1, "
- "0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
-
- query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( '123', 1, 0, 'FULL', "
- "'COMMUNICATION', 1, 1, 0, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
- EXPECT_FALSE(reps->IsApplicationRepresented("7777"));
- EXPECT_FALSE(reps->IsApplicationRepresented("9999"));
- // Act
- EXPECT_TRUE(reps->CopyApplication("default", "7777"));
- EXPECT_TRUE(reps->CopyApplication("123", "9999"));
- // Checks
- EXPECT_TRUE(reps->IsApplicationRepresented("7777"));
- EXPECT_TRUE(reps->IsApplicationRepresented("9999"));
- EXPECT_FALSE(reps->IsApplicationRevoked("7777"));
- EXPECT_TRUE(reps->IsApplicationRevoked("9999"));
- EXPECT_TRUE(reps->IsDefaultPolicy("7777"));
- std::string priority1;
- std::string priority2;
- EXPECT_TRUE(reps->GetPriority("default", &priority1));
- EXPECT_TRUE(reps->GetPriority("7777", &priority2));
- EXPECT_EQ(priority1, priority2);
- EXPECT_TRUE(reps->GetPriority("123", &priority1));
- EXPECT_TRUE(reps->GetPriority("9999", &priority2));
- EXPECT_EQ(priority1, priority2);
-}
-
-TEST_F(SQLPTRepresentationTest,
- IsDefaultPolicy_SetAppPreDataThenCheck_ExpectNotDefaultPolicySet) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) VALUES( '12345', 0, 0, 'NONE', 'NONE', 0, "
- "0, "
- "1, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
- // Check
- EXPECT_FALSE(reps->IsDefaultPolicy("12345"));
-}
-
-TEST_F(SQLPTRepresentationTest,
- IsDefaultPolicy_SetAppDefaultThenCheck_ExpectNotDefaultPolicySet) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
- "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
- "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 1, 0, 64, 10) ";
-
- ASSERT_TRUE(dbms->Exec(query_insert_app));
- // Check
- EXPECT_TRUE(reps->IsDefaultPolicy("1234567"));
-}
-
-TEST_F(SQLPTRepresentationTest, Drop_DropExistedPT_ExpectZeroTables) {
- // Check
- const char* query_select =
- "SELECT COUNT(*) FROM `sqlite_master` WHERE `type` = 'table'";
- // In normally created PT there are more than 0 tables
- ASSERT_TRUE(dbms->Exec(query_select));
- ASSERT_GT(dbms->FetchOneInt(query_select), 0);
- // Destroy schema
- ASSERT_TRUE(reps->Drop());
- // Check PT structure destroyed and tables number is 0
- ASSERT_EQ(0, dbms->FetchOneInt(query_select));
- // Restore schema
- ASSERT_TRUE(reps->RefreshDB());
-}
-
-TEST_F(SQLPTRepresentationTest,
- SetDefaultPolicy_SetDefaultPolicyThenCheck_ExpectDefaultPolicySet) {
- // Arrange
- const std::string kDefaultId = "default";
- const std::string kAppId = "app_1234567";
- const std::string kRequestType = "HTTP";
- const std::string kHmiType = "MEDIA";
-
- const std::string query_insert_default_app =
- "INSERT INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, "
- " `default_hmi`, `priority_value`, `is_revoked`, `is_default`, "
- "`is_predata`, `memory_kb`, "
- " `heart_beat_timeout_ms`) "
- "VALUES( '" +
- kDefaultId + "', 0, 0, 'NONE', 'NONE', 0, 0, 0, 64, 10) ";
-
- ASSERT_TRUE(dbms->Exec(query_insert_default_app.c_str()));
-
- const std::string query_insert_default_app_request_types =
- "INSERT INTO `request_type` (`application_id`, `request_type`) "
- "VALUES ('" +
- kDefaultId + "', '" + kRequestType + "')";
-
- ASSERT_TRUE(dbms->Exec(query_insert_default_app_request_types.c_str()));
-
- const std::string query_insert_default_app_hmi_types =
- "INSERT INTO `app_type` (`application_id`, `name`) "
- "VALUES ('" +
- kDefaultId + "', '" + kHmiType + "')";
-
- ASSERT_TRUE(dbms->Exec(query_insert_default_app_hmi_types.c_str()));
-
- const std::string query_insert_new_app =
- "INSERT INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
- "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
- "VALUES('" +
- kAppId + "', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10)";
-
- ASSERT_TRUE(dbms->Exec(query_insert_new_app.c_str()));
-
- EXPECT_FALSE(reps->IsDefaultPolicy(kAppId));
- // Act
- ASSERT_TRUE(reps->SetDefaultPolicy(kAppId));
- // Check
- EXPECT_TRUE(reps->IsDefaultPolicy(kAppId));
-
- policy_table::RequestTypes request_types;
- GatherRequestType(kAppId, &request_types);
- ASSERT_TRUE(1 == request_types.size());
- EXPECT_EQ(policy_table::RT_HTTP, *request_types.begin());
-
- policy_table::AppHMITypes hmi_types;
- GatherAppType(kAppId, &hmi_types);
- ASSERT_TRUE(1 == hmi_types.size());
- EXPECT_EQ(policy_table::AHT_MEDIA, *hmi_types.begin());
-}
-
-TEST_F(SQLPTRepresentationTest,
- SetPreloaded_SetPreloaded_ExpectPTSetToPreloaded) {
- // Arrange
- const char* query_insert = "UPDATE `module_config` SET `preloaded_pt` = 0";
- ASSERT_TRUE(dbms->Exec(query_insert));
- // Check
- ASSERT_FALSE(reps->IsPTPreloaded());
- // Act
- reps->SetPreloaded(true);
- // Check
- ASSERT_TRUE(reps->IsPTPreloaded());
- // Act
- reps->SetPreloaded(false);
- // Check
- ASSERT_FALSE(reps->IsPTPreloaded());
-}
-
-TEST_F(SQLPTRepresentationTest,
- SetIsDefault_SetIsDefault_ExpectDefaultFlagSet) {
- // Arrange
- const char* query_insert_app =
- "INSERT OR IGNORE INTO `application`(`id`, `keep_context`, "
- "`steal_focus`, `default_hmi`, `priority_value`, `is_revoked`, "
- "`is_default`, `is_predata`, `memory_kb`, `heart_beat_timeout_ms`) "
- "VALUES( '1234567', 0, 0, 'NONE', 'NONE', 0, 0, 1, 64, 10) ";
- ASSERT_TRUE(dbms->Exec(query_insert_app));
- const char* query_select =
- "SELECT `is_default` FROM `application`WHERE`id`= '1234567' ";
- EXPECT_EQ(0, dbms->FetchOneInt(query_select));
- // Act
- EXPECT_TRUE(reps->SetIsDefault("1234567", true));
- // Check
- EXPECT_EQ(1, dbms->FetchOneInt(query_select));
- // Act
- EXPECT_TRUE(reps->SetIsDefault("1234567", false));
- // Check
- EXPECT_EQ(0, dbms->FetchOneInt(query_select));
-}
-
-TEST_F(SQLPTRepresentationTest3, RemoveDB_RemoveDB_ExpectFileDeleted) {
- // Arrange
- ON_CALL(policy_settings_, app_storage_folder())
- .WillByDefault(ReturnRef(kAppStorageFolder));
- EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_));
- EXPECT_EQ(::policy::EXISTS, reps->Init(&policy_settings_));
- std::string path = (reps->db())->get_path();
- // Act
- reps->RemoveDB();
- // Check
- EXPECT_FALSE(file_system::FileExists(path));
-}
-
-// TODO {AKozoriz} : Snapshot must have module meta section, but test
-// generates snapshot without it.
-TEST_F(SQLPTRepresentationTest,
- DISABLED_GenerateSnapshot_SetPolicyTable_SnapshotIsPresent) {
- // Arrange
- Json::Value table(Json::objectValue);
- 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);
- // 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());
-}
-
-TEST_F(SQLPTRepresentationTest, Save_SetPolicyTableThenSave_ExpectSavedToPT) {
- // Arrange
- Json::Value table(Json::objectValue);
- PolicyTableUpdatePrepare(table);
-
- policy_table::Table update(&table);
- update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE);
- // Checks PT before Save
- policy_table::FunctionalGroupings func_groups;
- ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
- // Check functional groupings section
- EXPECT_EQ(0u, func_groups.size());
-
- policy_table::ApplicationPoliciesSection policies;
- GatherApplicationPoliciesSection(&policies);
- // Check ApplicationPoliciesSection
- EXPECT_EQ(0u, policies.apps.size());
- EXPECT_EQ(policy_table::Priority::P_EMERGENCY, policies.device.priority);
-
- policy_table::ModuleConfig config;
- GatherModuleConfig(&config);
- // Check Module config section
- EXPECT_TRUE(*config.preloaded_pt);
- EXPECT_EQ(0, config.exchange_after_x_ignition_cycles);
- EXPECT_EQ(0, config.exchange_after_x_kilometers);
- EXPECT_EQ(0, config.exchange_after_x_days);
- EXPECT_EQ(0, config.timeout_after_x_seconds);
- EXPECT_EQ("", static_cast<std::string>(*config.vehicle_make));
- EXPECT_EQ("", static_cast<std::string>(*config.vehicle_model));
- EXPECT_EQ("", static_cast<std::string>(*config.vehicle_year));
- EXPECT_EQ("", static_cast<std::string>(*config.preloaded_date));
- EXPECT_EQ("", static_cast<std::string>(*config.certificate));
- EXPECT_EQ(0u, config.seconds_between_retries.size());
- EXPECT_EQ(0u, config.endpoints.size());
- EXPECT_EQ(0u, config.notifications_per_minute_by_priority.size());
-
- policy_table::ConsumerFriendlyMessages messages;
- GatherConsumerFriendlyMessages(&messages);
- EXPECT_EQ("0", static_cast<std::string>(messages.version));
-
- policy_table::DeviceData devices;
- GatherDeviceData(&devices);
- EXPECT_EQ(0u, devices.size());
-
- policy_table::UsageAndErrorCounts counts;
- GatherUsageAndErrorCounts(&counts);
- EXPECT_TRUE(0u == counts.app_level->size());
-
- // ASSERT_TRUE(IsValid(update));
- // Act
- ASSERT_TRUE(reps->Save(update));
-
- // Check Functional Groupings
- ASSERT_TRUE(reps->GetFunctionalGroupings(func_groups));
- // Checks
- EXPECT_EQ(1u, func_groups.size());
- policy_table::FunctionalGroupings::iterator func_groups_iter =
- func_groups.find("default");
- ASSERT_TRUE(func_groups.end() != func_groups_iter);
- policy_table::Rpcs& rpcs = func_groups_iter->second;
- EXPECT_EQ("", static_cast<std::string>(*rpcs.user_consent_prompt));
- policy_table::Rpc& rpc = rpcs.rpcs;
- EXPECT_EQ(1u, rpc.size());
- policy_table::Rpc::const_iterator rpc_iter = rpc.find("Update");
- EXPECT_TRUE(rpc.end() != rpc_iter);
- const policy_table::HmiLevels& hmi_levels = rpc_iter->second.hmi_levels;
- EXPECT_EQ(1u, hmi_levels.size());
- EXPECT_TRUE(hmi_levels.end() != std::find(hmi_levels.begin(),
- hmi_levels.end(),
- policy_table::HmiLevel::HL_FULL));
-
- const ::policy_table::Parameters& parameters = *(rpc_iter->second.parameters);
- EXPECT_EQ(1u, parameters.size());
- EXPECT_TRUE(parameters.end() != std::find(parameters.begin(),
- parameters.end(),
- policy_table::Parameter::P_SPEED));
- // Check Application Policies Section
- GatherApplicationPoliciesSection(&policies);
- const uint32_t apps_size = 3u;
-
- rpc::String<1ul, 255ul> str("default");
- policy_table::Strings groups;
- groups.push_back(str);
- CheckAppPoliciesSection(policies,
- apps_size,
- policy_table::Priority::P_EMERGENCY,
- "1234",
- 150u,
- 200u,
- groups);
- CheckAppPoliciesSection(policies,
- apps_size,
- policy_table::Priority::P_EMERGENCY,
- "default",
- 50u,
- 100u,
- groups);
- CheckAppPoliciesSection(policies,
- apps_size,
- policy_table::Priority::P_EMERGENCY,
- "pre_DataConsent",
- 40u,
- 90u,
- groups);
- CheckAppPoliciesSection(policies,
- apps_size,
- policy_table::Priority::P_EMERGENCY,
- "device",
- 0u,
- 0u,
- groups);
-
- CheckAppGroups("1234", groups);
- CheckAppGroups("default", groups);
- CheckAppGroups("pre_DataConsent", groups);
-
- GatherModuleConfig(&config);
- // Check Module Config section
- ASSERT_FALSE(*config.preloaded_pt);
- ASSERT_EQ("encrypted_certificate_content",
- static_cast<std::string>(*config.certificate));
- ASSERT_EQ("", static_cast<std::string>(*config.preloaded_date));
- ASSERT_EQ("", static_cast<std::string>(*config.vehicle_year));
- ASSERT_EQ("", static_cast<std::string>(*config.vehicle_model));
- ASSERT_EQ("", static_cast<std::string>(*config.vehicle_make));
- ASSERT_EQ(10, config.exchange_after_x_ignition_cycles);
- ASSERT_EQ(100, config.exchange_after_x_kilometers);
- ASSERT_EQ(5, config.exchange_after_x_days);
- ASSERT_EQ(500, config.timeout_after_x_seconds);
- ASSERT_EQ(3u, config.seconds_between_retries.size());
- ASSERT_EQ(10, config.seconds_between_retries[0]);
- ASSERT_EQ(20, config.seconds_between_retries[1]);
- ASSERT_EQ(30, config.seconds_between_retries[2]);
- ASSERT_EQ(6u, config.notifications_per_minute_by_priority.size());
- ASSERT_EQ(1, config.notifications_per_minute_by_priority["emergency"]);
- ASSERT_EQ(2, config.notifications_per_minute_by_priority["navigation"]);
- ASSERT_EQ(3, config.notifications_per_minute_by_priority["VOICECOMM"]);
- ASSERT_EQ(4, config.notifications_per_minute_by_priority["communication"]);
- ASSERT_EQ(5, config.notifications_per_minute_by_priority["normal"]);
- ASSERT_EQ(6, config.notifications_per_minute_by_priority["none"]);
- EXPECT_EQ(1u, config.endpoints.size());
- policy_table::ServiceEndpoints& service_endpoints = config.endpoints;
- EXPECT_EQ("0x00", service_endpoints.begin()->first);
- policy_table::URLList& url_list = service_endpoints.begin()->second;
- EXPECT_EQ("default", url_list.begin()->first);
- policy_table::URL& url = url_list.begin()->second;
- EXPECT_EQ("http://ford.com/cloud/default", static_cast<std::string>(url[0]));
-
- GatherConsumerFriendlyMessages(&messages);
- EXPECT_EQ("some_msg_version", static_cast<std::string>(messages.version));
- EXPECT_TRUE(0u != messages.messages->size());
- EXPECT_TRUE(0u != (*messages.messages)["MSG_CODE"].languages.size());
-
- GatherUsageAndErrorCounts(&counts);
- EXPECT_FALSE(0u == counts.app_level->size());
- EXPECT_EQ(5u, (*counts.app_level)["some_app_id"].count_of_tls_errors);
-
- GatherDeviceData(&devices);
- EXPECT_EQ(3u, devices.size());
-}
-
-} // namespace policy
-} // namespace components
-} // namespace test
diff --git a/src/components/policy/test/update_status_manager_test.cc b/src/components/policy/test/update_status_manager_test.cc
deleted file mode 100644
index 623cb974d8..0000000000
--- a/src/components/policy/test/update_status_manager_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "gtest/gtest.h"
-#include "mock_policy_listener.h"
-#include "policy/policy_manager_impl.h"
-#include "policy/update_status_manager.h"
-
-using ::policy::MockPolicyListener;
-
-namespace test {
-namespace components {
-namespace policy {
-
-using namespace ::policy;
-
-class UpdateStatusManagerTest : public ::testing::Test {
- protected:
- UpdateStatusManager* manager_;
- PolicyTableStatus status_;
- const uint32_t k_timeout_;
-
- public:
- UpdateStatusManagerTest() : k_timeout_(1) {}
-
- void SetUp() {
- manager_ = new UpdateStatusManager();
- }
-
- void TearDown() OVERRIDE {
- delete manager_;
- }
-};
-
-TEST_F(UpdateStatusManagerTest,
- StringifiedUpdateStatus_SetStatuses_ExpectCorrectStringifiedStatuses) {
- // Arrange
- manager_->OnPolicyInit(false);
- // Check
- EXPECT_EQ("UP_TO_DATE", manager_->StringifiedUpdateStatus());
- manager_->OnPolicyInit(true);
- // Check
- EXPECT_EQ("UPDATE_NEEDED", manager_->StringifiedUpdateStatus());
- manager_->OnUpdateSentOut(k_timeout_);
- // Check
- EXPECT_EQ("UPDATING", manager_->StringifiedUpdateStatus());
-}
-
-TEST_F(UpdateStatusManagerTest,
- OnAppSearchStartedCompleted_ExpectAppSearchCorrectStatus) {
- // Arrange
- manager_->OnAppsSearchStarted();
- // Check
- EXPECT_TRUE(manager_->IsAppsSearchInProgress());
- // Arrange
- manager_->OnAppsSearchCompleted();
- // Check
- EXPECT_FALSE(manager_->IsAppsSearchInProgress());
-}
-
-} // namespace policy
-} // namespace components
-} // namespace test
diff --git a/src/components/protocol/CMakeLists.txt b/src/components/protocol/CMakeLists.txt
index 8524ff4f44..7d8579bdbc 100644
--- a/src/components/protocol/CMakeLists.txt
+++ b/src/components/protocol/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,18 +28,18 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- ./include
- ${APR_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/include
+ ${COMPONENTS_DIR}/utils/include
)
-set(SOURCES
- ${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
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
+
+set(LIBRARIES
+ Utils
)
add_library(ProtocolLibrary ${SOURCES})
-target_link_libraries(ProtocolLibrary Utils)
+target_link_libraries(ProtocolLibrary ${LIBRARIES})
diff --git a/src/components/protocol/src/bson_object_keys.cc b/src/components/protocol/src/bson_object_keys.cc
new file mode 100644
index 0000000000..fb225b1461
--- /dev/null
+++ b/src/components/protocol/src/bson_object_keys.cc
@@ -0,0 +1,18 @@
+#include <protocol/bson_object_keys.h>
+
+namespace protocol_handler {
+
+namespace strings {
+
+const char* hash_id = "hashId";
+const char* protocol_version = "protocolVersion";
+const char* mtu = "mtu";
+const char* rejected_params = "rejectedParams";
+const char* height = "height";
+const char* width = "width";
+const char* video_protocol = "videoProtocol";
+const char* video_codec = "videoCodec";
+
+} // namespace strings
+
+} // namespace protocol_handler
diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt
index a09a565844..ebecff2402 100644
--- a/src/components/protocol_handler/CMakeLists.txt
+++ b/src/components/protocol_handler/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,26 +28,27 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- include
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/protocol_handler/include/
${COMPONENTS_DIR}/connection_handler/include/
${LOG4CXX_INCLUDE_DIRECTORY}
+ ${BSON_INCLUDE_DIRECTORY}
)
-set(SOURCES
- ${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
- ${COMPONENTS_DIR}/protocol_handler/src/multiframe_builder.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
+collect_sources(SOURCES "${PATHS}")
set(LIBRARIES
ProtocolLibrary
Utils
+ bson -L${BSON_LIBS_DIRECTORY}
+ emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}
)
get_property(dirs DIRECTORY "" PROPERTY LIBRARIES)
@@ -57,6 +58,7 @@ endforeach()
add_library(ProtocolHandler ${SOURCES})
+add_dependencies(ProtocolHandler libbson)
target_link_libraries(ProtocolHandler ${LIBRARIES})
if(BUILD_TESTS)
diff --git a/src/components/protocol_handler/include/protocol_handler/handshake_handler.h b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
new file mode 100644
index 0000000000..0ef40290f2
--- /dev/null
+++ b/src/components/protocol_handler/include/protocol_handler/handshake_handler.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_START_SESSION_HANDLER_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_START_SESSION_HANDLER_H_
+
+#include <memory>
+
+#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol_handler/protocol_packet.h"
+#include "protocol_handler/session_observer.h"
+#include "security_manager/security_manager_listener.h"
+
+namespace protocol_handler {
+
+class ProtocolHandlerImpl;
+
+/**
+ * @brief HandshakeHandler class for handling SSL handshake and sending
+ * Ack/Nack on its success or fail
+ */
+class HandshakeHandler : public security_manager::SecurityManagerListener {
+ public:
+ DEPRECATED HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ uint32_t connection_key,
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_id,
+ ServiceType service_type,
+ const std::vector<int>& force_protected_service,
+ const bool is_new_service,
+ ProtocolPacket::ProtocolVersion& full_version,
+ std::shared_ptr<uint8_t> payload);
+
+ HandshakeHandler(ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ ProtocolPacket::ProtocolVersion& full_version,
+ const SessionContext& context,
+ const uint8_t protocol_version,
+ std::shared_ptr<uint8_t> payload);
+
+ ~HandshakeHandler();
+
+ /**
+ * @brief Get certificate data from policy
+ * @param reference to string where to save certificate data
+ * @return true if listener saved some data to string otherwise false
+ */
+ bool GetPolicyCertificateData(std::string& data) const OVERRIDE;
+
+ /**
+ * @brief Notification about protection result
+ * @param connection_key Unique key of session which triggrs handshake
+ * @param result result of connection protection
+ * @return true on success notification handling or false otherwise
+ */
+ bool OnHandshakeDone(
+ uint32_t connection_key,
+ security_manager::SSLContext::HandshakeResult result) OVERRIDE;
+
+ /**
+ * @brief Notification that certificate update is required.
+ */
+ void OnCertificateUpdateRequired() OVERRIDE;
+
+ /**
+ * @brief Get connection key of this handler
+ * @return connection key
+ */
+ uint32_t connection_key() const;
+
+ private:
+ /**
+ * @brief Performs related actions if handshake was successfully finished
+ * @param connection_key Unique key of session which triggrs handshake
+ * @param params set of params used in bson part of message
+ */
+ void ProcessSuccessfulHandshake(const uint32_t connection_key,
+ BsonObject& params);
+
+ /**
+ * @brief Performs related actions if handshake was failed
+ * @param params set of params used in bson part of message
+ */
+ void ProcessFailedHandshake(BsonObject& params);
+
+ ProtocolHandlerImpl& protocol_handler_;
+ SessionObserver& session_observer_;
+ SessionContext context_;
+ ProtocolPacket::ProtocolVersion full_version_;
+ const uint8_t protocol_version_;
+ std::shared_ptr<uint8_t> payload_;
+};
+
+} // namespace protocol_handler
+
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_START_SESSION_HANDLER_H_
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 cd50f98bdb..0efb81cdd7 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
@@ -56,6 +56,7 @@
#include "transport_manager/transport_manager.h"
#include "transport_manager/transport_manager_listener_empty.h"
#include "connection_handler/connection_handler.h"
+#include "application_manager/policies/policy_handler_observer.h"
#ifdef TELEMETRY_MONITOR
#include "protocol_handler/telemetry_observer.h"
@@ -64,6 +65,7 @@
#ifdef ENABLE_SECURITY
#include "security_manager/security_manager.h"
+#include "protocol_handler/handshake_handler.h"
#endif // ENABLE_SECURITY
namespace connection_handler {
@@ -77,6 +79,7 @@ class ConnectionHandlerImpl;
namespace protocol_handler {
class ProtocolObserver;
class SessionObserver;
+class HandshakeHandler;
class MessagesFromMobileAppHandler;
class MessagesToMobileAppHandler;
@@ -84,6 +87,8 @@ class MessagesToMobileAppHandler;
using transport_manager::TransportManagerListenerEmpty;
typedef std::multimap<int32_t, RawMessagePtr> MessagesOverNaviMap;
+typedef std::map<std::pair<ConnectionID, uint8_t>, ProtocolFramePtr>
+ StartSessionFrameMap;
typedef std::set<ProtocolObserver*> ProtocolObservers;
typedef transport_manager::ConnectionUID ConnectionID;
@@ -139,6 +144,7 @@ typedef threads::MessageLoopThread<
class ProtocolHandlerImpl
: public ProtocolHandler,
public TransportManagerListenerEmpty,
+ public policy::PolicyHandlerObserver,
public impl::FromMobileQueue::Handler,
public impl::ToMobileQueue::Handler
#ifdef TELEMETRY_MONITOR
@@ -245,11 +251,59 @@ class ProtocolHandlerImpl
*/
void SendStartSessionAck(ConnectionID connection_id,
uint8_t session_id,
- uint8_t protocol_version,
+ uint8_t input_protocol_version,
uint32_t hash_code,
uint8_t service_type,
bool protection);
+ /**
+ * \brief Sends acknowledgement of starting session to mobile application
+ * with session number and hash code for second version of protocol
+ * was started
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param hash_code For second version of protocol: identifier of session
+ * to be sent to
+ * mobile app for using when ending session
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param protection Protection flag
+ * \param full_version full protocol version (major.minor.patch) used by the
+ * mobile proxy
+ */
+ void SendStartSessionAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_code,
+ uint8_t service_type,
+ bool protection,
+ ProtocolPacket::ProtocolVersion& full_version);
+
+ /**
+ * \brief Sends acknowledgement of starting session to mobile application
+ * with session number and hash code for second version of protocol
+ * was started
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param hash_code For second version of protocol: identifier of session
+ * to be sent to
+ * mobile app for using when ending session
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param protection Protection flag
+ * \param full_version full protocol version (major.minor.patch) used by the
+ * mobile proxy
+ * \param params Parameters added in the payload
+ */
+ void SendStartSessionAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_code,
+ uint8_t service_type,
+ bool protection,
+ ProtocolPacket::ProtocolVersion& full_version,
+ BsonObject& params);
+
const ProtocolHandlerSettings& get_settings() const OVERRIDE {
return settings_;
}
@@ -267,6 +321,20 @@ class ProtocolHandlerImpl
uint8_t service_type);
/**
+ * \brief Sends fail of starting session to mobile application
+ * \param connection_id Identifier of connection within which session
+ * \param session_id ID of session to be sent to mobile application
+ * \param protocol_version Version of protocol used for communication
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param rejected_params List of rejected params to send in payload
+ */
+ void SendStartSessionNAck(ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejectedParams);
+
+ /**
* \brief Sends acknowledgement of end session/service to mobile application
* with session number for second version of protocol.
* \param connection_id Identifier of connection
@@ -294,9 +362,66 @@ class ProtocolHandlerImpl
uint32_t session_id,
uint8_t protocol_version,
uint8_t service_type);
+ /**
+ * \brief Sends fail of ending session to mobile application (variant for
+ * Protocol v5)
+ * \param connection_id Identifier of connection within which
+ * session exists
+ * \param session_id ID of session ment to be ended
+ * \param protocol_version Version of protocol used for communication
+ * \param service_type Type of session: RPC or BULK Data. RPC by default
+ * \param rejected_params List of rejected params to send in payload
+ */
+ void SendEndSessionNAck(ConnectionID connection_id,
+ uint32_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejected_params);
SessionObserver& get_session_observer() OVERRIDE;
+ /**
+ * \brief Called by connection handler to notify the result of
+ * OnSessionStartedCallback().
+ * \param connection_id Identifier of connection within which session exists
+ * \param session_id session ID passed to OnSessionStartedCallback()
+ * \param generated_session_id Generated session ID, will be 0 if session is
+ * not started
+ * \param hash_id Generated Hash ID
+ * \param protection whether the service will be protected
+ * \param rejected_params list of parameters' name that are rejected.
+ * Only valid when generated_session_id is 0. Note, even if
+ * generated_session_id is 0, the list may be empty.
+ */
+ DEPRECATED void NotifySessionStartedResult(
+ int32_t connection_id,
+ uint8_t session_id,
+ uint8_t generated_session_id,
+ uint32_t hash_id,
+ bool protection,
+ std::vector<std::string>& rejected_params) OVERRIDE;
+
+ /**
+ * @brief Called by connection handler to notify the result of
+ * OnSessionStartedCallback().
+ * @param context reference to structure with started session data
+ * @param rejected_params list of parameters name that are rejected.
+ * Only valid when generated_session_id is 0. Note, even if
+ * generated_session_id is 0, the list may be empty.
+ */
+ void NotifySessionStarted(const SessionContext& context,
+ std::vector<std::string>& rejected_params) OVERRIDE;
+
+#ifdef BUILD_TESTS
+ const impl::FromMobileQueue& get_from_mobile_queue() const {
+ return raw_ford_messages_from_mobile_;
+ }
+
+ const impl::ToMobileQueue& get_to_mobile_queue() const {
+ return raw_ford_messages_to_mobile_;
+ }
+#endif
+
private:
void SendEndServicePrivate(int32_t connection_id,
uint8_t session_id,
@@ -348,6 +473,14 @@ class ProtocolHandlerImpl
const transport_manager::ConnectionUID connection_id) OVERRIDE;
/**
+ * @brief OnPTUFinished the callback which signals PTU has finished
+ *
+ * @param ptu_result the result from the PTU - true if successful,
+ * otherwise false.
+ */
+ void OnPTUFinished(const bool ptu_result) OVERRIDE;
+
+ /**
* @brief Notifies subscribers about message
* received from mobile device.
* @param message Message with already parsed header.
@@ -443,7 +576,10 @@ class ProtocolHandlerImpl
RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet);
- RESULT_CODE HandleControlMessageStartSession(const ProtocolPacket& packet);
+ DEPRECATED RESULT_CODE
+ HandleControlMessageStartSession(const ProtocolPacket& packet);
+
+ RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet);
RESULT_CODE HandleControlMessageHeartBeat(const ProtocolPacket& packet);
@@ -547,6 +683,10 @@ class ProtocolHandlerImpl
#ifdef ENABLE_SECURITY
security_manager::SecurityManager* security_manager_;
+
+ bool is_ptu_triggered_;
+ std::list<std::shared_ptr<HandshakeHandler> > ptu_pending_handlers_;
+ sync_primitives::Lock ptu_handlers_lock_;
#endif // ENABLE_SECURITY
// Thread that pumps non-parsed messages coming from mobile side.
@@ -556,6 +696,9 @@ class ProtocolHandlerImpl
sync_primitives::Lock protocol_observers_lock_;
+ sync_primitives::Lock start_session_frame_map_lock_;
+ StartSessionFrameMap start_session_frame_map_;
+
#ifdef TELEMETRY_MONITOR
PHTelemetryObserver* metric_observer_;
#endif // TELEMETRY_MONITOR
diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
index f8696c46a0..1c427533e6 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h
@@ -64,6 +64,58 @@ class ProtocolPacket {
};
/**
+ * \class ProtocolVersion
+ * \brief Used for storing the full protocol version of a service
+ * (major.minor.patch).
+ */
+ class ProtocolVersion {
+ public:
+ ProtocolVersion();
+ ProtocolVersion(uint8_t majorVersion,
+ uint8_t minorVersion,
+ uint8_t patchVersion);
+ ProtocolVersion(ProtocolVersion& other);
+ ProtocolVersion(std::string versionString);
+ uint8_t majorVersion;
+ uint8_t minorVersion;
+ uint8_t patchVersion;
+ static inline int16_t cmp(const ProtocolVersion& version1,
+ const ProtocolVersion& version2) {
+ int16_t diff =
+ static_cast<int16_t>(version1.majorVersion - version2.majorVersion);
+ if (diff == 0) {
+ diff =
+ static_cast<int16_t>(version1.minorVersion - version2.minorVersion);
+ if (diff == 0) {
+ diff = static_cast<int16_t>(version1.patchVersion -
+ version2.patchVersion);
+ }
+ }
+ return diff;
+ }
+ inline bool operator==(const ProtocolVersion& other) {
+ return ProtocolVersion::cmp(*this, other) == 0;
+ }
+ inline bool operator<(const ProtocolVersion& other) {
+ return ProtocolVersion::cmp(*this, other) < 0;
+ }
+ bool operator>(const ProtocolVersion& other) {
+ return ProtocolVersion::cmp(*this, other) > 0;
+ }
+ inline bool operator<=(const ProtocolVersion& other) {
+ return ProtocolVersion::cmp(*this, other) <= 0;
+ }
+ bool operator>=(const ProtocolVersion& other) {
+ return ProtocolVersion::cmp(*this, other) >= 0;
+ }
+ static inline ProtocolVersion* min(ProtocolVersion& version1,
+ ProtocolVersion& version2) {
+ return (version1 < version2) ? &version1 : &version2;
+ }
+ std::string to_string();
+ };
+
+ /**
* \class ProtocolHeader
* \brief Used for storing protocol header of a message.
*/
@@ -99,7 +151,19 @@ class ProtocolPacket {
* \brief Setter/getter maximum payload size of packets
*/
void set_max_payload_size(const size_t max_payload_size);
+ void set_max_control_payload_size(const size_t max_payload_size);
+ void set_max_rpc_payload_size(const size_t max_payload_size);
+ void set_max_audio_payload_size(const size_t max_payload_size);
+ void set_max_video_payload_size(const size_t max_payload_size);
+
size_t max_payload_size() const;
+ size_t max_control_payload_size() const;
+ size_t max_rpc_payload_size() const;
+ size_t max_audio_payload_size() const;
+ size_t max_video_payload_size() const;
+
+ size_t max_payload_size_by_service_type(const ServiceType type) const;
+
/**
* \brief Check ProtocolHeader according to protocol requiements
*/
@@ -107,6 +171,10 @@ class ProtocolPacket {
private:
size_t max_payload_size_;
+ size_t max_control_payload_size_;
+ size_t max_rpc_payload_size_;
+ size_t max_audio_payload_size_;
+ size_t max_video_payload_size_;
};
/**
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 ed61d3588d..83eaee62d9 100644
--- a/src/components/protocol_handler/include/protocol_handler/protocol_payload.h
+++ b/src/components/protocol_handler/include/protocol_handler/protocol_payload.h
@@ -29,6 +29,7 @@
* 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_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_
#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_
@@ -81,5 +82,4 @@ std::ostream& operator<<(std::ostream& os, const ProtocolPayloadV2& payload);
size_t ProtocolPayloadV2SizeBits();
} // namespace protocol_handler
-#endif /* SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_ \
- */
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_PROTOCOL_PAYLOAD_H_
diff --git a/src/components/protocol_handler/include/protocol_handler/telemetry_observer.h b/src/components/protocol_handler/include/protocol_handler/telemetry_observer.h
deleted file mode 100644
index 1f4c1ebcb5..0000000000
--- a/src/components/protocol_handler/include/protocol_handler/telemetry_observer.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_TIME_METRIC_OBSERVER_H_
-#define SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_TIME_METRIC_OBSERVER_H_
-#include "protocol/common.h"
-
-#include <stdint.h>
-#include "utils/date_time.h"
-
-namespace protocol_handler {
-
-class PHTelemetryObserver {
- public:
- struct MessageMetric {
- RawMessagePtr raw_msg;
- uint32_t message_id;
- uint8_t connection_key;
- TimevalStruct begin;
- TimevalStruct end;
- };
- virtual void StartMessageProcess(uint32_t message_id,
- const TimevalStruct& start_time) = 0;
- virtual void EndMessageProcess(utils::SharedPtr<MessageMetric> m) = 0;
- virtual ~PHTelemetryObserver() {}
-};
-} // protocol_handler
-#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_INCLUDE_PROTOCOL_HANDLER_TIME_METRIC_OBSERVER_H_
diff --git a/src/components/protocol_handler/src/handshake_handler.cc b/src/components/protocol_handler/src/handshake_handler.cc
new file mode 100644
index 0000000000..055ff2cf45
--- /dev/null
+++ b/src/components/protocol_handler/src/handshake_handler.cc
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "protocol_handler/handshake_handler.h"
+
+#include <bson_object.h>
+
+#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol_handler/protocol_packet.h"
+#include "security_manager/security_manager.h"
+#include "protocol_handler/session_observer.h"
+
+namespace protocol_handler {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
+
+HandshakeHandler::HandshakeHandler(
+ ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ uint32_t connection_key,
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint32_t hash_id,
+ ServiceType service_type,
+ const std::vector<int>& force_protected_service,
+ const bool is_new_service,
+ ProtocolPacket::ProtocolVersion& full_version,
+ std::shared_ptr<uint8_t> payload)
+ : protocol_handler_(protocol_handler)
+ , session_observer_(session_observer)
+ , context_()
+ , full_version_(full_version)
+ , protocol_version_(protocol_version)
+ , payload_(payload) {}
+
+HandshakeHandler::HandshakeHandler(
+ ProtocolHandlerImpl& protocol_handler,
+ SessionObserver& session_observer,
+ ProtocolPacket::ProtocolVersion& full_version,
+ const SessionContext& context,
+ const uint8_t protocol_version,
+ std::shared_ptr<uint8_t> payload)
+ : protocol_handler_(protocol_handler)
+ , session_observer_(session_observer)
+ , context_(context)
+ , full_version_(full_version)
+ , protocol_version_(protocol_version)
+ , payload_(payload) {}
+
+HandshakeHandler::~HandshakeHandler() {
+ LOG4CXX_DEBUG(logger_, "Destroying of HandshakeHandler: " << this);
+}
+
+uint32_t HandshakeHandler::connection_key() const {
+ return session_observer_.KeyFromPair(context_.connection_id_,
+ context_.new_session_id_);
+}
+
+bool HandshakeHandler::GetPolicyCertificateData(std::string& data) const {
+ return false;
+}
+
+void HandshakeHandler::OnCertificateUpdateRequired() {}
+
+bool HandshakeHandler::OnHandshakeDone(
+ uint32_t connection_key,
+ security_manager::SSLContext::HandshakeResult result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ if (connection_key != this->connection_key()) {
+ LOG4CXX_DEBUG(logger_,
+ "Listener " << this
+ << " expects notification for connection id: "
+ << this->connection_key()
+ << ". Received notification for connection id "
+ << connection_key << " will be ignored");
+ return false;
+ }
+
+ const bool success =
+ result == security_manager::SSLContext::Handshake_Result_Success;
+
+ BsonObject params;
+ if (payload_) {
+ params = bson_object_from_bytes(payload_.get());
+ } else {
+ bson_object_initialize_default(&params);
+ }
+
+ if (success) {
+ ProcessSuccessfulHandshake(connection_key, params);
+ } else {
+ ProcessFailedHandshake(params);
+ }
+
+ bson_object_deinitialize(&params);
+ return true;
+}
+
+void HandshakeHandler::ProcessSuccessfulHandshake(const uint32_t connection_key,
+ BsonObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::vector<int>& force_unprotected =
+ protocol_handler_.get_settings().force_unprotected_service();
+
+ const bool can_be_protected =
+ std::find(force_unprotected.begin(),
+ force_unprotected.end(),
+ context_.service_type_) == force_unprotected.end();
+
+ const bool is_service_already_protected =
+ session_observer_.GetSSLContext(connection_key, context_.service_type_) !=
+ NULL;
+
+ LOG4CXX_DEBUG(logger_,
+ "Service can be protected: " << can_be_protected
+ << " and service was protected: "
+ << is_service_already_protected);
+
+ if (can_be_protected && !is_service_already_protected) {
+ session_observer_.SetProtectionFlag(connection_key, context_.service_type_);
+ protocol_handler_.SendStartSessionAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.hash_id_,
+ context_.service_type_,
+ can_be_protected,
+ full_version_,
+ params);
+ } else {
+ protocol_handler_.SendStartSessionNAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.service_type_);
+ }
+}
+
+void HandshakeHandler::ProcessFailedHandshake(BsonObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Handshake failed");
+ const std::vector<int>& force_protected =
+ protocol_handler_.get_settings().force_protected_service();
+
+ const bool can_be_unprotected =
+ std::find(force_protected.begin(),
+ force_protected.end(),
+ context_.service_type_) == force_protected.end();
+
+ LOG4CXX_DEBUG(logger_,
+ "Service can be unprotected: " << can_be_unprotected
+ << " and this is a new service: "
+ << context_.is_new_service_);
+
+ if (can_be_unprotected && context_.is_new_service_) {
+ protocol_handler_.SendStartSessionAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.hash_id_,
+ context_.service_type_,
+ PROTECTION_OFF,
+ full_version_,
+ params);
+ } else {
+ protocol_handler_.SendStartSessionNAck(context_.connection_id_,
+ context_.new_session_id_,
+ protocol_version_,
+ context_.service_type_);
+ }
+}
+
+} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/incoming_data_handler.cc b/src/components/protocol_handler/src/incoming_data_handler.cc
index e1d08a6ada..4944ea9cc7 100644
--- a/src/components/protocol_handler/src/incoming_data_handler.cc
+++ b/src/components/protocol_handler/src/incoming_data_handler.cc
@@ -126,6 +126,7 @@ uint32_t IncomingDataHandler::GetPacketSize(
case PROTOCOL_VERSION_2:
case PROTOCOL_VERSION_3:
case PROTOCOL_VERSION_4:
+ case PROTOCOL_VERSION_5:
return header.dataSize + PROTOCOL_HEADER_V2_SIZE;
default:
LOG4CXX_WARN(logger_,
diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc
index aa2910722d..47d546657f 100644
--- a/src/components/protocol_handler/src/protocol_handler_impl.cc
+++ b/src/components/protocol_handler/src/protocol_handler_impl.cc
@@ -33,6 +33,8 @@
#include "protocol_handler/protocol_handler_impl.h"
#include <memory.h>
#include <algorithm> // std::find
+#include <bson_object.h>
+#include <protocol/bson_object_keys.h>
#include "connection_handler/connection_handler_impl.h"
#include "protocol_handler/session_observer.h"
@@ -55,7 +57,9 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler")
std::string ConvertPacketDataToString(const uint8_t* data,
const size_t data_size);
-const size_t kStackSize = 32768;
+const size_t kStackSize = 65536;
+
+ProtocolPacket::ProtocolVersion defaultProtocolVersion(5, 0, 0);
ProtocolHandlerImpl::ProtocolHandlerImpl(
const ProtocolHandlerSettings& settings,
@@ -73,10 +77,13 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
security_manager_(NULL)
,
#endif // ENABLE_SECURITY
- raw_ford_messages_from_mobile_(
- "PH FromMobile", this, threads::ThreadOptions(kStackSize))
+ is_ptu_triggered_(false)
+ , raw_ford_messages_from_mobile_(
+ "PH FromMobile", this, threads::ThreadOptions(kStackSize))
, raw_ford_messages_to_mobile_(
"PH ToMobile", this, threads::ThreadOptions(kStackSize))
+ , start_session_frame_map_lock_()
+ , start_session_frame_map_()
#ifdef TELEMETRY_MONITOR
, metric_observer_(NULL)
#endif // TELEMETRY_MONITOR
@@ -85,6 +92,14 @@ ProtocolHandlerImpl::ProtocolHandlerImpl(
LOG4CXX_AUTO_TRACE(logger_);
protocol_header_validator_.set_max_payload_size(
get_settings().maximum_payload_size());
+ protocol_header_validator_.set_max_control_payload_size(
+ get_settings().maximum_control_payload_size());
+ protocol_header_validator_.set_max_rpc_payload_size(
+ get_settings().maximum_rpc_payload_size());
+ protocol_header_validator_.set_max_audio_payload_size(
+ get_settings().maximum_audio_payload_size());
+ protocol_header_validator_.set_max_video_payload_size(
+ get_settings().maximum_video_payload_size());
incoming_data_handler_.set_validator(&protocol_header_validator_);
const size_t& message_frequency_count =
@@ -176,17 +191,82 @@ void set_hash_id(uint32_t hash_id, protocol_handler::ProtocolPacket& packet) {
void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
uint8_t session_id,
- uint8_t,
+ uint8_t input_protocol_version,
uint32_t hash_id,
uint8_t service_type,
bool protection) {
LOG4CXX_AUTO_TRACE(logger_);
+ ProtocolPacket::ProtocolVersion fullVersion;
+ SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ service_type,
+ protection,
+ fullVersion);
+}
+
+void ProtocolHandlerImpl::SendStartSessionAck(
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t input_protocol_version,
+ uint32_t hash_id,
+ uint8_t service_type,
+ bool protection,
+ ProtocolPacket::ProtocolVersion& full_version) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ BsonObject empty_param;
+ bson_object_initialize_default(&empty_param);
- uint8_t protocolVersion = SupportedSDLProtocolVersion();
+ SendStartSessionAck(connection_id,
+ session_id,
+ input_protocol_version,
+ hash_id,
+ service_type,
+ protection,
+ full_version,
+ empty_param);
+
+ bson_object_deinitialize(&empty_param);
+}
+
+void ProtocolHandlerImpl::SendStartSessionAck(
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t input_protocol_version,
+ uint32_t hash_id,
+ uint8_t service_type,
+ bool protection,
+ ProtocolPacket::ProtocolVersion& full_version,
+ BsonObject& params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ uint8_t ack_protocol_version = SupportedSDLProtocolVersion();
+
+ const bool proxy_supports_v5_protocol =
+ input_protocol_version >= PROTOCOL_VERSION_5 ||
+ (ServiceTypeFromByte(service_type) == kRpc &&
+ full_version.majorVersion >= PROTOCOL_VERSION_5);
+
+ if (kRpc != service_type) {
+ // In case if input protocol version os bigger then supported, SDL should
+ // respond with maximum supported protocol version
+ ack_protocol_version = input_protocol_version < ack_protocol_version
+ ? input_protocol_version
+ : ack_protocol_version;
+ }
+
+ // We can't send a V5+ packet if the proxy doesn't support it,
+ // so we manually set a maximum of V4 in that case
+ if (!proxy_supports_v5_protocol &&
+ ack_protocol_version >= PROTOCOL_VERSION_5) {
+ ack_protocol_version = PROTOCOL_VERSION_4;
+ }
ProtocolFramePtr ptr(
new protocol_handler::ProtocolPacket(connection_id,
- protocolVersion,
+ ack_protocol_version,
protection,
FRAME_TYPE_CONTROL,
service_type,
@@ -195,7 +275,37 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id,
0u,
message_counters_[session_id]++));
- set_hash_id(hash_id, *ptr);
+ // Cannot include a constructed payload if either side doesn't support it
+ if (ack_protocol_version >= PROTOCOL_VERSION_5) {
+ ServiceType serviceTypeValue = ServiceTypeFromByte(service_type);
+
+ bson_object_put_int64(
+ &params,
+ strings::mtu,
+ static_cast<int64_t>(
+ protocol_header_validator_.max_payload_size_by_service_type(
+ serviceTypeValue)));
+ if (serviceTypeValue == kRpc) {
+ // Hash ID is only used in RPC case
+ bson_object_put_int32(
+ &params, strings::hash_id, static_cast<int32_t>(hash_id));
+ // Minimum protocol version supported by both
+ ProtocolPacket::ProtocolVersion* minVersion =
+ (full_version.majorVersion < PROTOCOL_VERSION_5)
+ ? &defaultProtocolVersion
+ : ProtocolPacket::ProtocolVersion::min(full_version,
+ defaultProtocolVersion);
+ char protocolVersionString[256];
+ strncpy(protocolVersionString, (*minVersion).to_string().c_str(), 255);
+ bson_object_put_string(
+ &params, strings::protocol_version, protocolVersionString);
+ }
+ uint8_t* payloadBytes = bson_object_to_bytes(&params);
+ ptr->set_data(payloadBytes, bson_object_size(&params));
+ free(payloadBytes);
+ } else {
+ set_hash_id(hash_id, *ptr);
+ }
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
@@ -212,6 +322,20 @@ void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
uint8_t session_id,
uint8_t protocol_version,
uint8_t service_type) {
+ std::vector<std::string> rejectedParams;
+ SendStartSessionNAck(connection_id,
+ session_id,
+ protocol_version,
+ service_type,
+ rejectedParams);
+}
+
+void ProtocolHandlerImpl::SendStartSessionNAck(
+ ConnectionID connection_id,
+ uint8_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejectedParams) {
LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(
@@ -225,6 +349,27 @@ void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id,
0u,
message_counters_[session_id]++));
+ uint8_t maxProtocolVersion = SupportedSDLProtocolVersion();
+
+ if (protocol_version >= PROTOCOL_VERSION_5 &&
+ maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) {
+ BsonObject payloadObj;
+ bson_object_initialize_default(&payloadObj);
+ BsonArray rejectedParamsArr;
+ bson_array_initialize(&rejectedParamsArr, rejectedParams.size());
+ for (std::string param : rejectedParams) {
+ char paramPtr[255];
+ strncpy(paramPtr, param.c_str(), 255);
+ bson_array_add_string(&rejectedParamsArr, paramPtr);
+ }
+ bson_object_put_array(
+ &payloadObj, strings::rejected_params, &rejectedParamsArr);
+ uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj);
+ ptr->set_data(payloadBytes, bson_object_size(&payloadObj));
+ free(payloadBytes);
+ bson_object_deinitialize(&payloadObj);
+ }
+
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
@@ -239,6 +384,20 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id,
uint32_t session_id,
uint8_t protocol_version,
uint8_t service_type) {
+ std::vector<std::string> rejectedParams;
+ SendEndSessionNAck(connection_id,
+ session_id,
+ protocol_version,
+ service_type,
+ rejectedParams);
+}
+
+void ProtocolHandlerImpl::SendEndSessionNAck(
+ ConnectionID connection_id,
+ uint32_t session_id,
+ uint8_t protocol_version,
+ uint8_t service_type,
+ std::vector<std::string>& rejectedParams) {
LOG4CXX_AUTO_TRACE(logger_);
ProtocolFramePtr ptr(
@@ -252,6 +411,27 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id,
0u,
message_counters_[session_id]++));
+ uint8_t maxProtocolVersion = SupportedSDLProtocolVersion();
+
+ if (protocol_version >= PROTOCOL_VERSION_5 &&
+ maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) {
+ BsonObject payloadObj;
+ bson_object_initialize_default(&payloadObj);
+ BsonArray rejectedParamsArr;
+ bson_array_initialize(&rejectedParamsArr, rejectedParams.size());
+ for (std::string param : rejectedParams) {
+ char paramPtr[255];
+ strncpy(paramPtr, param.c_str(), 255);
+ bson_array_add_string(&rejectedParamsArr, paramPtr);
+ }
+ bson_object_put_array(
+ &payloadObj, strings::rejected_params, &rejectedParamsArr);
+ uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj);
+ ptr->set_data(payloadBytes, bson_object_size(&payloadObj));
+ free(payloadBytes);
+ bson_object_deinitialize(&payloadObj);
+ }
+
raw_ford_messages_to_mobile_.PostMessage(
impl::RawFordMessageToMobile(ptr, false));
@@ -413,7 +593,7 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
metric_observer_->StartMessageProcess(message_id, start_time);
}
#endif // TELEMETRY_MONITOR
- const size_t max_frame_size = get_settings().maximum_payload_size();
+ size_t max_frame_size = get_settings().maximum_payload_size();
size_t frame_size = MAXIMUM_FRAME_DATA_V2_SIZE;
switch (message->protocol_version()) {
case PROTOCOL_VERSION_3:
@@ -422,6 +602,13 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message,
? max_frame_size
: MAXIMUM_FRAME_DATA_V2_SIZE;
break;
+ case PROTOCOL_VERSION_5:
+ max_frame_size =
+ protocol_header_validator_.max_payload_size_by_service_type(
+ ServiceTypeFromByte(message->service_type()));
+ frame_size = max_frame_size > MAXIMUM_FRAME_DATA_V2_SIZE
+ ? max_frame_size
+ : MAXIMUM_FRAME_DATA_V2_SIZE;
default:
break;
}
@@ -652,6 +839,59 @@ void ProtocolHandlerImpl::OnConnectionClosed(
multiframe_builder_.RemoveConnection(connection_id);
}
+void ProtocolHandlerImpl::OnPTUFinished(const bool ptu_result) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+#ifdef ENABLE_SECURITY
+ sync_primitives::AutoLock lock(ptu_handlers_lock_);
+
+ if (!is_ptu_triggered_) {
+ LOG4CXX_ERROR(logger_,
+ "PTU was not triggered by service starting. Ignored");
+ return;
+ }
+
+ const bool is_cert_expired = security_manager_->IsCertificateUpdateRequired();
+ for (auto handler : ptu_pending_handlers_) {
+ security_manager::SSLContext* ssl_context =
+ is_cert_expired
+ ? NULL
+ : security_manager_->CreateSSLContext(handler->connection_key());
+
+ if (!ssl_context) {
+ const std::string error("CreateSSLContext failed");
+ LOG4CXX_ERROR(logger_, error);
+ security_manager_->SendInternalError(
+ handler->connection_key(),
+ security_manager::SecurityManager::ERROR_INTERNAL,
+ error);
+
+ handler->OnHandshakeDone(
+ handler->connection_key(),
+ security_manager::SSLContext::Handshake_Result_Fail);
+
+ continue;
+ }
+
+ if (ssl_context->IsInitCompleted()) {
+ handler->OnHandshakeDone(
+ handler->connection_key(),
+ security_manager::SSLContext::Handshake_Result_Success);
+ } else {
+ security_manager_->AddListener(new HandshakeHandler(*handler));
+ if (!ssl_context->IsHandshakePending()) {
+ // Start handshake process
+ security_manager_->StartHandshake(handler->connection_key());
+ }
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "Handshake handlers were notified");
+ ptu_pending_handlers_.clear();
+ is_ptu_triggered_ = false;
+#endif // ENABLE_SECURITY
+}
+
RESULT_CODE ProtocolHandlerImpl::SendFrame(const ProtocolFramePtr packet) {
LOG4CXX_AUTO_TRACE(logger_);
if (!packet) {
@@ -883,7 +1123,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage(
switch (packet->frame_data()) {
case FRAME_DATA_START_SERVICE: {
LOG4CXX_TRACE(logger_, "FrameData: StartService");
- return HandleControlMessageStartSession(*packet);
+ return HandleControlMessageStartSession(packet);
}
case FRAME_DATA_END_SERVICE: {
LOG4CXX_TRACE(logger_, "FrameData: StopService");
@@ -924,10 +1164,19 @@ uint32_t get_hash_id(const ProtocolPacket& packet) {
LOG4CXX_WARN(logger_, "Packet without hash data (data size less 4)");
return HASH_ID_WRONG;
}
- const uint32_t hash_be = *(reinterpret_cast<uint32_t*>(packet.data()));
- const uint32_t hash_le = BE_TO_LE32(hash_be);
- // null hash is wrong hash value
- return hash_le == HASH_ID_NOT_SUPPORTED ? HASH_ID_WRONG : hash_le;
+ if (packet.protocol_version() >= PROTOCOL_VERSION_5) {
+ BsonObject obj = bson_object_from_bytes(packet.data());
+ const uint32_t hash_id =
+ (uint32_t)bson_object_get_int32(&obj, strings::hash_id);
+ bson_object_deinitialize(&obj);
+ return hash_id;
+ } else {
+ const uint32_t hash_be = *(reinterpret_cast<uint32_t*>(packet.data()));
+ const uint32_t hash_le = BE_TO_LE32(hash_be);
+
+ // null hash is wrong hash value
+ return hash_le == HASH_ID_NOT_SUPPORTED ? HASH_ID_WRONG : hash_le;
+ }
}
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
@@ -935,12 +1184,12 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
LOG4CXX_AUTO_TRACE(logger_);
const uint8_t current_session_id = packet.session_id();
- const uint32_t hash_id = get_hash_id(packet);
+ uint32_t hash_id = get_hash_id(packet);
const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
const ConnectionID connection_id = packet.connection_id();
const uint32_t session_key = session_observer_.OnSessionEndedCallback(
- connection_id, current_session_id, hash_id, service_type);
+ connection_id, current_session_id, &hash_id, service_type);
// TODO(EZamakhov): add clean up output queue (for removed service)
if (session_key != 0) {
@@ -953,10 +1202,22 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession(
LOG4CXX_WARN(logger_,
"Refused to end session " << static_cast<int>(service_type)
<< " type.");
- SendEndSessionNAck(connection_id,
- current_session_id,
- packet.protocol_version(),
- service_type);
+ if (packet.protocol_version() >= PROTOCOL_VERSION_5) {
+ std::vector<std::string> rejectedParams;
+ if (hash_id == protocol_handler::HASH_ID_WRONG) {
+ rejectedParams.push_back(std::string(strings::hash_id));
+ }
+ SendEndSessionNAck(connection_id,
+ current_session_id,
+ packet.protocol_version(),
+ service_type,
+ rejectedParams);
+ } else {
+ SendEndSessionNAck(connection_id,
+ current_session_id,
+ packet.protocol_version(),
+ service_type);
+ }
}
return RESULT_OK;
}
@@ -966,12 +1227,12 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndServiceACK(
LOG4CXX_AUTO_TRACE(logger_);
const uint8_t current_session_id = packet.session_id();
- const uint32_t hash_id = get_hash_id(packet);
+ uint32_t hash_id = get_hash_id(packet);
const ServiceType service_type = ServiceTypeFromByte(packet.service_type());
const ConnectionID connection_id = packet.connection_id();
const uint32_t session_key = session_observer_.OnSessionEndedCallback(
- connection_id, current_session_id, hash_id, service_type);
+ connection_id, current_session_id, &hash_id, service_type);
if (0 == session_key) {
LOG4CXX_WARN(logger_, "Refused to end service");
@@ -981,88 +1242,9 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndServiceACK(
return RESULT_OK;
}
-#ifdef ENABLE_SECURITY
-namespace {
-/**
- * \brief SecurityManagerListener for send Ack/NAck on success or fail
- * SSL handshake
- */
-class StartSessionHandler : public security_manager::SecurityManagerListener {
- public:
- StartSessionHandler(uint32_t connection_key,
- ProtocolHandlerImpl* protocol_handler,
- SessionObserver& session_observer,
- ConnectionID connection_id,
- int32_t session_id,
- uint8_t protocol_version,
- uint32_t hash_id,
- ServiceType service_type,
- const std::vector<int>& force_protected_service)
- : connection_key_(connection_key)
- , protocol_handler_(protocol_handler)
- , session_observer_(session_observer)
- , connection_id_(connection_id)
- , session_id_(session_id)
- , protocol_version_(protocol_version)
- , hash_id_(hash_id)
- , service_type_(service_type)
- , force_protected_service_(force_protected_service) {}
-
- bool OnHandshakeDone(
- const uint32_t connection_key,
- security_manager::SSLContext::HandshakeResult result) OVERRIDE {
- if (connection_key != connection_key_) {
- return false;
- }
- const bool success =
- result == security_manager::SSLContext::Handshake_Result_Success;
- // check current service protection
- const bool was_service_protection_enabled =
- session_observer_.GetSSLContext(connection_key_, service_type_) != NULL;
- if (was_service_protection_enabled) {
- if (!success) {
- protocol_handler_->SendStartSessionNAck(
- connection_id_, session_id_, protocol_version_, service_type_);
- } else {
- // Could not be success handshake and not already protected service
- NOTREACHED();
- }
- } else {
- if (success) {
- session_observer_.SetProtectionFlag(connection_key_, service_type_);
- }
- protocol_handler_->SendStartSessionAck(connection_id_,
- session_id_,
- protocol_version_,
- hash_id_,
- service_type_,
- success);
- }
- delete this;
- return true;
- }
-
- void OnCertificateUpdateRequired() OVERRIDE {}
-
- virtual const std::vector<int>& force_protected_service() const {
- return force_protected_service_;
- }
-
- private:
- const uint32_t connection_key_;
- ProtocolHandlerImpl* protocol_handler_;
- SessionObserver& session_observer_;
-
- const ConnectionID connection_id_;
- const int32_t session_id_;
- const uint8_t protocol_version_;
- const uint32_t hash_id_;
- const ServiceType service_type_;
- const std::vector<int> force_protected_service_;
-};
-} // namespace
-#endif // ENABLE_SECURITY
-
+// Suppress warning for deprecated method used within another deprecated method
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
const ProtocolPacket& packet) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1121,7 +1303,30 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
PROTECTION_OFF);
return RESULT_OK;
}
- if (ssl_context->IsInitCompleted()) {
+ ProtocolPacket::ProtocolVersion* fullVersion;
+ std::vector<std::string> rejectedParams(0, std::string(""));
+ // Can't check protocol_version because the first packet is v1, but there
+ // could still be a payload, in which case we can get the real protocol
+ // version
+ if (packet.service_type() == kRpc && packet.data_size() != 0) {
+ BsonObject obj = bson_object_from_bytes(packet.data());
+ fullVersion = new ProtocolPacket::ProtocolVersion(
+ std::string(bson_object_get_string(&obj, "protocolVersion")));
+ bson_object_deinitialize(&obj);
+ // Constructed payloads added in Protocol v5
+ if (fullVersion->majorVersion < PROTOCOL_VERSION_5) {
+ rejectedParams.push_back(std::string("protocolVersion"));
+ }
+ } else {
+ fullVersion = new ProtocolPacket::ProtocolVersion();
+ }
+ if (!rejectedParams.empty()) {
+ SendStartSessionNAck(connection_id,
+ packet.session_id(),
+ protocol_version,
+ packet.service_type(),
+ rejectedParams);
+ } else if (ssl_context->IsInitCompleted()) {
// mark service as protected
session_observer_.SetProtectionFlag(connection_key, service_type);
// Start service as protected with current SSLContext
@@ -1130,38 +1335,330 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
packet.protocol_version(),
hash_id,
packet.service_type(),
- PROTECTION_ON);
+ PROTECTION_ON,
+ *fullVersion);
} else {
security_manager_->AddListener(
- new StartSessionHandler(connection_key,
- this,
- session_observer_,
- connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- service_type,
- get_settings().force_protected_service()));
+ new HandshakeHandler(*this,
+ session_observer_,
+ connection_key,
+ connection_id,
+ session_id,
+ packet.protocol_version(),
+ hash_id,
+ service_type,
+ get_settings().force_protected_service(),
+ false,
+ *fullVersion,
+ NULL));
if (!ssl_context->IsHandshakePending()) {
// Start handshake process
security_manager_->StartHandshake(connection_key);
}
}
+ delete fullVersion;
LOG4CXX_DEBUG(logger_,
"Protection establishing for connection "
<< connection_key << " is in progress");
return RESULT_OK;
}
#endif // ENABLE_SECURITY
- // Start service without protection
- SendStartSessionAck(connection_id,
- session_id,
- packet.protocol_version(),
- hash_id,
- packet.service_type(),
- PROTECTION_OFF);
+ if (packet.service_type() == kRpc && packet.data_size() != 0) {
+ BsonObject obj = bson_object_from_bytes(packet.data());
+ ProtocolPacket::ProtocolVersion fullVersion(
+ bson_object_get_string(&obj, "protocolVersion"));
+ bson_object_deinitialize(&obj);
+
+ if (fullVersion.majorVersion >= PROTOCOL_VERSION_5) {
+ // Start service without protection
+ SendStartSessionAck(connection_id,
+ session_id,
+ packet.protocol_version(),
+ hash_id,
+ packet.service_type(),
+ PROTECTION_OFF,
+ fullVersion);
+ } else {
+ std::vector<std::string> rejectedParams(1,
+ std::string("protocolVersion"));
+ SendStartSessionNAck(connection_id,
+ packet.session_id(),
+ protocol_version,
+ packet.service_type(),
+ rejectedParams);
+ }
+
+ } else {
+ // Start service without protection
+ SendStartSessionAck(connection_id,
+ session_id,
+ packet.protocol_version(),
+ hash_id,
+ packet.service_type(),
+ PROTECTION_OFF);
+ }
return RESULT_OK;
}
+#pragma GCC diagnostic pop
+
+RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession(
+ const ProtocolFramePtr packet) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(
+ logger_,
+ "Protocol version:" << static_cast<int>(packet->protocol_version()));
+ const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
+ const uint8_t protocol_version = packet->protocol_version();
+ BsonObject bson_obj;
+ if (packet->data() != NULL) {
+ bson_obj = bson_object_from_bytes(packet->data());
+ } else {
+ bson_object_initialize_default(&bson_obj);
+ }
+
+#ifdef ENABLE_SECURITY
+ const bool protection =
+ // Protocolo version 1 is not support protection
+ (protocol_version > PROTOCOL_VERSION_1) ? packet->protection_flag()
+ : false;
+#else
+ const bool protection = false;
+#endif // ENABLE_SECURITY
+
+ const ConnectionID connection_id = packet->connection_id();
+ const uint8_t session_id = packet->session_id();
+
+ {
+ sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
+ start_session_frame_map_[std::make_pair(connection_id, session_id)] =
+ packet;
+ }
+
+ session_observer_.OnSessionStartedCallback(
+ connection_id, packet->session_id(), service_type, protection, &bson_obj);
+ bson_object_deinitialize(&bson_obj);
+
+ return RESULT_OK;
+}
+
+void ProtocolHandlerImpl::NotifySessionStartedResult(
+ int32_t connection_id,
+ uint8_t session_id,
+ uint8_t generated_session_id,
+ uint32_t hash_id,
+ bool protection,
+ std::vector<std::string>& rejected_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ protocol_handler::SessionContext context(connection_id,
+ session_id,
+ generated_session_id,
+ ServiceType::kInvalidServiceType,
+ hash_id,
+ protection);
+ NotifySessionStarted(context, rejected_params);
+}
+
+void ProtocolHandlerImpl::NotifySessionStarted(
+ const SessionContext& context, std::vector<std::string>& rejected_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ ProtocolFramePtr packet;
+ {
+ sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
+ StartSessionFrameMap::iterator it = start_session_frame_map_.find(
+ std::make_pair(context.connection_id_, context.initial_session_id_));
+ if (it == start_session_frame_map_.end()) {
+ LOG4CXX_ERROR(logger_, "Cannot find Session Started packet");
+ return;
+ }
+ packet = it->second;
+ start_session_frame_map_.erase(it);
+ }
+
+ const ServiceType service_type = ServiceTypeFromByte(packet->service_type());
+ const uint8_t protocol_version = packet->protocol_version();
+
+ if (0 == context.new_session_id_) {
+ LOG4CXX_WARN(logger_,
+ "Refused by session_observer to create service "
+ << static_cast<int32_t>(service_type) << " type.");
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
+ protocol_version,
+ packet->service_type(),
+ rejected_params);
+ return;
+ }
+
+ std::shared_ptr<BsonObject> start_session_ack_params(
+ new BsonObject(), [](BsonObject* obj) { bson_object_deinitialize(obj); });
+ bson_object_initialize_default(start_session_ack_params.get());
+ // when video service is successfully started, copy input parameters
+ // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet
+ if (packet->service_type() == kMobileNav && packet->data() != NULL) {
+ BsonObject req_param = bson_object_from_bytes(packet->data());
+ BsonElement* element = NULL;
+
+ if ((element = bson_object_get(&req_param, strings::height)) != NULL &&
+ element->type == TYPE_INT32) {
+ bson_object_put_int32(start_session_ack_params.get(),
+ strings::height,
+ bson_object_get_int32(&req_param, strings::height));
+ }
+ if ((element = bson_object_get(&req_param, strings::width)) != NULL &&
+ element->type == TYPE_INT32) {
+ bson_object_put_int32(start_session_ack_params.get(),
+ strings::width,
+ bson_object_get_int32(&req_param, strings::width));
+ }
+ char* protocol =
+ bson_object_get_string(&req_param, strings::video_protocol);
+ if (protocol != NULL) {
+ bson_object_put_string(
+ start_session_ack_params.get(), strings::video_protocol, protocol);
+ }
+ char* codec = bson_object_get_string(&req_param, strings::video_codec);
+ if (codec != NULL) {
+ bson_object_put_string(
+ start_session_ack_params.get(), strings::video_codec, codec);
+ }
+ bson_object_deinitialize(&req_param);
+ }
+
+ std::shared_ptr<ProtocolPacket::ProtocolVersion> fullVersion;
+
+ // Can't check protocol_version because the first packet is v1, but there
+ // could still be a payload, in which case we can get the real protocol
+ // version
+ if (packet->service_type() == kRpc && packet->data() != NULL) {
+ BsonObject request_params = bson_object_from_bytes(packet->data());
+ char* version_param =
+ bson_object_get_string(&request_params, strings::protocol_version);
+ std::string version_string(version_param == NULL ? "" : version_param);
+ fullVersion =
+ std::make_shared<ProtocolPacket::ProtocolVersion>(version_string);
+ // Constructed payloads added in Protocol v5
+ if (fullVersion->majorVersion < PROTOCOL_VERSION_5) {
+ rejected_params.push_back(std::string(strings::protocol_version));
+ }
+ bson_object_deinitialize(&request_params);
+ } else {
+ fullVersion = std::make_shared<ProtocolPacket::ProtocolVersion>();
+ }
+
+#ifdef ENABLE_SECURITY
+ // for packet is encrypted and security plugin is enable
+ if (context.is_protected_ && security_manager_) {
+ const uint32_t connection_key = session_observer_.KeyFromPair(
+ context.connection_id_, context.new_session_id_);
+
+ std::shared_ptr<uint8_t> bson_object_bytes(
+ bson_object_to_bytes(start_session_ack_params.get()),
+ [](uint8_t* p) { delete[] p; });
+
+ std::shared_ptr<HandshakeHandler> handler =
+ std::make_shared<HandshakeHandler>(*this,
+ session_observer_,
+ *fullVersion,
+ context,
+ packet->protocol_version(),
+ bson_object_bytes);
+
+ const bool is_certificate_empty =
+ security_manager_->IsPolicyCertificateDataEmpty();
+
+ const bool is_certificate_expired =
+ is_certificate_empty ||
+ security_manager_->IsCertificateUpdateRequired();
+
+ if (context.is_ptu_required_ && is_certificate_empty) {
+ LOG4CXX_DEBUG(logger_,
+ "PTU for StartSessionHandler "
+ << handler.get()
+ << " is required and certificate data is empty");
+
+ sync_primitives::AutoLock lock(ptu_handlers_lock_);
+ if (!is_ptu_triggered_) {
+ LOG4CXX_DEBUG(logger_,
+ "PTU is not triggered yet. "
+ << "Starting PTU and postponing SSL handshake");
+
+ ptu_pending_handlers_.push_back(handler);
+ is_ptu_triggered_ = true;
+ security_manager_->NotifyOnCertificateUpdateRequired();
+ } else {
+ LOG4CXX_DEBUG(logger_, "PTU has been triggered. Added to pending.");
+ ptu_pending_handlers_.push_back(handler);
+ }
+ return;
+ }
+
+ security_manager::SSLContext* ssl_context =
+ is_certificate_expired
+ ? NULL
+ : security_manager_->CreateSSLContext(connection_key);
+ if (!ssl_context) {
+ const std::string error("CreateSSLContext failed");
+ LOG4CXX_ERROR(logger_, error);
+ security_manager_->SendInternalError(
+ connection_key,
+ security_manager::SecurityManager::ERROR_INTERNAL,
+ error);
+
+ handler->OnHandshakeDone(
+ connection_key, security_manager::SSLContext::Handshake_Result_Fail);
+
+ return;
+ }
+
+ if (!rejected_params.empty()) {
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
+ protocol_version,
+ packet->service_type(),
+ rejected_params);
+ } else if (ssl_context->IsInitCompleted()) {
+ // mark service as protected
+ session_observer_.SetProtectionFlag(connection_key, service_type);
+ // Start service as protected with current SSLContext
+ SendStartSessionAck(context.connection_id_,
+ context.new_session_id_,
+ packet->protocol_version(),
+ context.hash_id_,
+ packet->service_type(),
+ PROTECTION_ON,
+ *fullVersion,
+ *start_session_ack_params);
+ } else {
+ security_manager_->AddListener(new HandshakeHandler(*handler));
+ if (!ssl_context->IsHandshakePending()) {
+ // Start handshake process
+ security_manager_->StartHandshake(connection_key);
+ }
+ }
+ LOG4CXX_DEBUG(logger_,
+ "Protection establishing for connection "
+ << connection_key << " is in progress");
+ return;
+ }
+#endif // ENABLE_SECURITY
+ if (rejected_params.empty()) {
+ SendStartSessionAck(context.connection_id_,
+ context.new_session_id_,
+ packet->protocol_version(),
+ context.hash_id_,
+ packet->service_type(),
+ PROTECTION_OFF,
+ *fullVersion,
+ *start_session_ack_params);
+ } else {
+ SendStartSessionNAck(context.connection_id_,
+ packet->session_id(),
+ protocol_version,
+ packet->service_type(),
+ rejected_params);
+ }
+}
RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
const ProtocolPacket& packet) {
@@ -1173,8 +1670,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat(
if (session_observer_.ProtocolVersionUsed(
connection_id, packet.session_id(), protocol_version)) {
// TODO(EZamakhov): investigate message_id for HeartBeatAck
- if (PROTOCOL_VERSION_3 == protocol_version ||
- PROTOCOL_VERSION_4 == protocol_version) {
+ if (protocol_version >= PROTOCOL_VERSION_3 &&
+ protocol_version <= PROTOCOL_VERSION_5) {
return SendHeartBeatAck(
connection_id, packet.session_id(), packet.message_id());
} else {
@@ -1329,6 +1826,9 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) {
void ProtocolHandlerImpl::Stop() {
raw_ford_messages_from_mobile_.Shutdown();
raw_ford_messages_to_mobile_.Shutdown();
+
+ sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_);
+ start_session_frame_map_.clear();
}
#ifdef ENABLE_SECURITY
@@ -1369,11 +1869,11 @@ RESULT_CODE ProtocolHandlerImpl::EncryptFrame(ProtocolFramePtr packet) {
connection_key,
security_manager::SecurityManager::ERROR_ENCRYPTION_FAILED,
error_text);
+
+ uint32_t hash_id = packet->message_id();
// Close session to prevent usage unprotected service/session
- session_observer_.OnSessionEndedCallback(packet->connection_id(),
- packet->session_id(),
- packet->message_id(),
- kRpc);
+ session_observer_.OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(), &hash_id, kRpc);
return RESULT_OK;
}
LOG4CXX_DEBUG(logger_,
@@ -1422,11 +1922,11 @@ RESULT_CODE ProtocolHandlerImpl::DecryptFrame(ProtocolFramePtr packet) {
connection_key,
security_manager::SecurityManager::ERROR_DECRYPTION_FAILED,
error_text);
+
+ uint32_t hash_id = packet->message_id();
// Close session to prevent usage unprotected service/session
- session_observer_.OnSessionEndedCallback(packet->connection_id(),
- packet->session_id(),
- packet->message_id(),
- kRpc);
+ session_observer_.OnSessionEndedCallback(
+ packet->connection_id(), packet->session_id(), &hash_id, kRpc);
return RESULT_ENCRYPTION_FAILED;
}
LOG4CXX_DEBUG(logger_,
@@ -1444,33 +1944,34 @@ void ProtocolHandlerImpl::SendFramesNumber(uint32_t connection_key,
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);
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");
+ if (protocol_version > PROTOCOL_VERSION_1 &&
+ protocol_version < PROTOCOL_VERSION_5) {
+ 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_,
@@ -1504,17 +2005,6 @@ std::string ConvertPacketDataToString(const uint8_t* data,
uint8_t ProtocolHandlerImpl::SupportedSDLProtocolVersion() const {
LOG4CXX_AUTO_TRACE(logger_);
-
- bool heart_beat_support = (0 != get_settings().heart_beat_timeout());
-
- bool sdl4_support = get_settings().enable_protocol_4();
-
- if (sdl4_support) {
- return PROTOCOL_VERSION_4;
- }
- if (heart_beat_support) {
- return PROTOCOL_VERSION_3;
- }
- return PROTOCOL_VERSION_2;
+ return get_settings().max_supported_protocol_version();
}
} // namespace protocol_handler
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index d766cf18c4..ae52849de6 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -52,6 +52,48 @@ ProtocolPacket::ProtocolData::~ProtocolData() {
delete[] data;
}
+ProtocolPacket::ProtocolVersion::ProtocolVersion()
+ : majorVersion(0), minorVersion(0), patchVersion(0) {}
+
+ProtocolPacket::ProtocolVersion::ProtocolVersion(uint8_t majorVersion,
+ uint8_t minorVersion,
+ uint8_t patchVersion)
+ : majorVersion(majorVersion)
+ , minorVersion(minorVersion)
+ , patchVersion(patchVersion) {}
+
+ProtocolPacket::ProtocolVersion::ProtocolVersion(ProtocolVersion& other) {
+ this->majorVersion = other.majorVersion;
+ this->minorVersion = other.minorVersion;
+ this->patchVersion = other.patchVersion;
+}
+
+ProtocolPacket::ProtocolVersion::ProtocolVersion(std::string versionString)
+ : majorVersion(0), minorVersion(0), patchVersion(0) {
+ unsigned int majorInt, minorInt, patchInt;
+ int readElements = sscanf(
+ versionString.c_str(), "%u.%u.%u", &majorInt, &minorInt, &patchInt);
+ if (readElements != 3) {
+ LOG4CXX_WARN(logger_,
+ "Error while parsing version string: " << versionString);
+ } else {
+ majorVersion = static_cast<uint8_t>(majorInt);
+ minorVersion = static_cast<uint8_t>(minorInt);
+ patchVersion = static_cast<uint8_t>(patchInt);
+ }
+}
+
+std::string ProtocolPacket::ProtocolVersion::to_string() {
+ char versionString[256];
+ snprintf(versionString,
+ 255,
+ "%u.%u.%u",
+ static_cast<unsigned int>(majorVersion),
+ static_cast<unsigned int>(minorVersion),
+ static_cast<unsigned int>(patchVersion));
+ return std::string(versionString);
+}
+
ProtocolPacket::ProtocolHeader::ProtocolHeader()
: version(0x00)
, protection_flag(PROTECTION_OFF)
@@ -114,7 +156,8 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message,
switch (version) {
case PROTOCOL_VERSION_2:
case PROTOCOL_VERSION_3:
- case PROTOCOL_VERSION_4: {
+ case PROTOCOL_VERSION_4:
+ case PROTOCOL_VERSION_5: {
if (messageSize < PROTOCOL_HEADER_V2_SIZE) {
LOG4CXX_DEBUG(logger_,
"Message size less " << PROTOCOL_HEADER_V2_SIZE
@@ -131,7 +174,11 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message,
}
ProtocolPacket::ProtocolHeaderValidator::ProtocolHeaderValidator()
- : max_payload_size_(std::numeric_limits<size_t>::max()) {}
+ : max_payload_size_(std::numeric_limits<size_t>::max())
+ , max_control_payload_size_(0)
+ , max_rpc_payload_size_(0)
+ , max_audio_payload_size_(0)
+ , max_video_payload_size_(0) {}
void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size(
const size_t max_payload_size) {
@@ -139,15 +186,92 @@ void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size(
max_payload_size_ = max_payload_size;
}
+void ProtocolPacket::ProtocolHeaderValidator::set_max_control_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum Control payload size is " << max_payload_size);
+ max_control_payload_size_ = max_payload_size;
+}
+
+void ProtocolPacket::ProtocolHeaderValidator::set_max_rpc_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum RPC payload size is " << max_payload_size);
+ max_rpc_payload_size_ = max_payload_size;
+}
+
+void ProtocolPacket::ProtocolHeaderValidator::set_max_audio_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum audio payload size is " << max_payload_size);
+ max_audio_payload_size_ = max_payload_size;
+}
+
+void ProtocolPacket::ProtocolHeaderValidator::set_max_video_payload_size(
+ const size_t max_payload_size) {
+ LOG4CXX_DEBUG(logger_,
+ "New maximum video payload size is " << max_payload_size);
+ max_video_payload_size_ = max_payload_size;
+}
+
size_t ProtocolPacket::ProtocolHeaderValidator::max_payload_size() const {
return max_payload_size_;
}
+size_t ProtocolPacket::ProtocolHeaderValidator::max_control_payload_size()
+ const {
+ return max_control_payload_size_;
+}
+
+size_t ProtocolPacket::ProtocolHeaderValidator::max_rpc_payload_size() const {
+ return max_rpc_payload_size_;
+}
+
+size_t ProtocolPacket::ProtocolHeaderValidator::max_audio_payload_size() const {
+ return max_audio_payload_size_;
+}
+
+size_t ProtocolPacket::ProtocolHeaderValidator::max_video_payload_size() const {
+ return max_video_payload_size_;
+}
+
+size_t
+ProtocolPacket::ProtocolHeaderValidator::max_payload_size_by_service_type(
+ const ServiceType type) const {
+ size_t payload_size = 0;
+ switch (type) {
+ case kControl:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_control_payload_size_ == 0 ? max_payload_size_
+ : max_control_payload_size_;
+ break;
+ case kBulk:
+ case kRpc:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_rpc_payload_size_ == 0 ? max_payload_size_
+ : max_rpc_payload_size_;
+ break;
+ case kAudio:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_audio_payload_size_ == 0 ? max_payload_size_
+ : max_audio_payload_size_;
+ break;
+ case kMobileNav:
+ // Default to the generic MTU if specific MTU is not set
+ payload_size = max_video_payload_size_ == 0 ? max_payload_size_
+ : max_video_payload_size_;
+ break;
+ case kInvalidServiceType:
+ LOG4CXX_WARN(logger_, "Invalid service type: " << static_cast<int>(type));
+ }
+ return payload_size;
+}
+
RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
const ProtocolHeader& header) const {
LOG4CXX_DEBUG(logger_, "Validating header - " << header);
// expected payload size will be calculated depending
- // on used protocol version
+ // on used protocol version and service type
size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
// Protocol version shall be from 1 to 4
switch (header.version) {
@@ -160,6 +284,10 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
? max_payload_size_
: MAXIMUM_FRAME_DATA_V2_SIZE;
break;
+ case PROTOCOL_VERSION_5:
+ payload_size = max_payload_size_by_service_type(
+ ServiceTypeFromByte(header.serviceType));
+ break;
default:
LOG4CXX_WARN(logger_,
"Unknown version:" << static_cast<int>(header.version));
diff --git a/src/components/protocol_handler/test/CMakeLists.txt b/src/components/protocol_handler/test/CMakeLists.txt
index 87d91bfd54..ca079dcc7e 100644
--- a/src/components/protocol_handler/test/CMakeLists.txt
+++ b/src/components/protocol_handler/test/CMakeLists.txt
@@ -28,7 +28,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if (BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
include
@@ -38,9 +38,12 @@ include_directories (
${COMPONENTS_DIR}/protocol_handler/test/include
${COMPONENTS_DIR}/include/protocol
${JSONCPP_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
)
-set (LIBRARIES
+collect_sources(SOURCES ${CMAKE_CURRENT_SOURCE_DIR})
+
+set(LIBRARIES
gmock
ProtocolHandler
connectionHandler
@@ -49,15 +52,4 @@ set (LIBRARIES
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
- multiframe_builder_test.cc
-)
-
-create_test ("protocol_handler_test" "${SOURCES}" "${LIBRARIES}")
-
-endif ()
+create_test(protocol_handler_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
index 40d662ac9f..a1c1f188d1 100644
--- a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
+++ b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_TIME_METRIC_OBSERVER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_TIME_METRIC_OBSERVER_H_
+#ifndef SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_MOCK_TELEMETRY_OBSERVER_H_
+#define SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_MOCK_TELEMETRY_OBSERVER_H_
#include "gmock/gmock.h"
#include "protocol_handler/time_metric_observer.h"
@@ -51,4 +51,4 @@ class MockPHTelemetryObserver : public ::protocol_handler::PHTelemetryObserver {
} // namespace components
} // namespace test
-- #endif // SRC_COMPONENTS_INCLUDE_TEST_PROTOCOL_HANDLER_MOCK_TIME_METRIC_OBSERVER_H_
+#endif // SRC_COMPONENTS_PROTOCOL_HANDLER_TEST_INCLUDE_PROTOCOL_HANDLER_MOCK_TELEMETRY_OBSERVER_H_
diff --git a/src/components/protocol_handler/test/include/protocol_handler/protocol_observer_mock.h b/src/components/protocol_handler/test/include/protocol_handler/protocol_observer_mock.h
deleted file mode 100644
index 9f99ee41f8..0000000000
--- a/src/components/protocol_handler/test/include/protocol_handler/protocol_observer_mock.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc
index 66f5aea712..d0a311583c 100644
--- a/src/components/protocol_handler/test/incoming_data_handler_test.cc
+++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc
@@ -262,7 +262,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) {
FrameList malformed_packets;
std::vector<uint8_t> malformed_versions;
malformed_versions.push_back(0);
- for (uint8_t version = PROTOCOL_VERSION_4 + 1;
+ for (uint8_t version = PROTOCOL_VERSION_5 + 1;
version <= PROTOCOL_VERSION_MAX;
++version) {
malformed_versions.push_back(version);
diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
index 1a7be866d9..cb11eca887 100644
--- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc
+++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc
@@ -33,10 +33,11 @@
#include <string>
#include "protocol_handler/protocol_handler.h"
#include "protocol_handler/protocol_handler_impl.h"
+#include "protocol/bson_object_keys.h"
#include "protocol/common.h"
#include "protocol_handler/control_message_matcher.h"
#include "protocol_handler/mock_protocol_handler.h"
-#include "protocol_handler/protocol_observer_mock.h"
+#include "protocol_handler/mock_protocol_observer.h"
#include "protocol_handler/mock_protocol_handler_settings.h"
#include "protocol_handler/mock_session_observer.h"
#include "connection_handler/mock_connection_handler.h"
@@ -44,6 +45,8 @@
#include "security_manager/mock_ssl_context.h"
#include "transport_manager/mock_transport_manager.h"
#include "utils/make_shared.h"
+#include "utils/test_async_waiter.h"
+#include <bson_object.h>
namespace test {
namespace components {
@@ -62,6 +65,8 @@ using protocol_handler::PROTECTION_OFF;
using protocol_handler::PROTOCOL_VERSION_1;
using protocol_handler::PROTOCOL_VERSION_2;
using protocol_handler::PROTOCOL_VERSION_3;
+using protocol_handler::PROTOCOL_VERSION_4;
+using protocol_handler::PROTOCOL_VERSION_5;
using protocol_handler::PROTOCOL_VERSION_MAX;
using protocol_handler::FRAME_TYPE_CONTROL;
using protocol_handler::FRAME_TYPE_SINGLE;
@@ -76,6 +81,7 @@ using protocol_handler::FRAME_DATA_END_SERVICE_ACK;
using protocol_handler::FRAME_DATA_END_SERVICE;
using protocol_handler::FRAME_DATA_HEART_BEAT;
using protocol_handler::FRAME_DATA_HEART_BEAT_ACK;
+using protocol_handler::FRAME_DATA_SERVICE_DATA_ACK;
using protocol_handler::FRAME_DATA_SINGLE;
using protocol_handler::FRAME_DATA_FIRST;
using protocol_handler::FRAME_DATA_LAST_CONSECUTIVE;
@@ -95,8 +101,12 @@ using connection_handler::DeviceHandle;
using ::testing::Return;
using ::testing::ReturnRefOfCopy;
using ::testing::ReturnNull;
+using ::testing::An;
using ::testing::AnyOf;
+using ::testing::ByRef;
using ::testing::DoAll;
+using ::testing::SaveArg;
+using ::testing::Eq;
using ::testing::_;
using ::testing::Invoke;
using ::testing::SetArgReferee;
@@ -104,6 +114,17 @@ using ::testing::SetArgPointee;
typedef std::vector<uint8_t> UCharDataVector;
+// custom action to call a member function with 6 arguments
+ACTION_P4(InvokeMemberFuncWithArg2, ptr, memberFunc, a, b) {
+ (ptr->*memberFunc)(a, b);
+}
+
+namespace {
+const uint32_t kAsyncExpectationsTimeout = 10000u;
+const uint32_t kMicrosecondsInMillisecond = 1000u;
+const uint32_t kAddSessionWaitTimeMs = 100u;
+}
+
class ProtocolHandlerImplTest : public ::testing::Test {
protected:
void InitProtocolHandlerImpl(const size_t period_msec,
@@ -127,6 +148,13 @@ class ProtocolHandlerImplTest : public ::testing::Test {
.WillByDefault(Return(malformd_max_messages));
ON_CALL(protocol_handler_settings_mock, multiframe_waiting_timeout())
.WillByDefault(Return(multiframe_waiting_timeout));
+#ifdef ENABLE_SECURITY
+ ON_CALL(protocol_handler_settings_mock, force_protected_service())
+ .WillByDefault(ReturnRefOfCopy(force_protected_services));
+ ON_CALL(protocol_handler_settings_mock, force_unprotected_service())
+ .WillByDefault(ReturnRefOfCopy(force_unprotected_services));
+#endif
+
protocol_handler_impl.reset(
new ProtocolHandlerImpl(protocol_handler_settings_mock,
session_observer_mock,
@@ -156,8 +184,10 @@ class ProtocolHandlerImplTest : public ::testing::Test {
}
void TearDown() OVERRIDE {
- // Wait call methods in thread
- testing::Mock::AsyncVerifyAndClearExpectations(10000);
+ const_cast<protocol_handler::impl::FromMobileQueue&>(
+ protocol_handler_impl->get_from_mobile_queue()).WaitDumpQueue();
+ const_cast<protocol_handler::impl::ToMobileQueue&>(
+ protocol_handler_impl->get_to_mobile_queue()).WaitDumpQueue();
}
// Emulate connection establish
@@ -168,9 +198,30 @@ class ProtocolHandlerImplTest : public ::testing::Test {
std::string("BTMAC")),
connection_id);
}
- void AddSession() {
+
+ protocol_handler::SessionContext GetSessionContext(
+ const transport_manager::ConnectionUID connection_id,
+ const uint8_t initial_session_id,
+ const uint8_t new_session_id,
+ const protocol_handler::ServiceType service_type,
+ const uint32_t hash_id,
+ const bool protection_flag) {
+ return protocol_handler::SessionContext(connection_id,
+ initial_session_id,
+ new_session_id,
+ service_type,
+ hash_id,
+ protection_flag);
+ }
+
+ void AddSession(const ::utils::SharedPtr<TestAsyncWaiter>& waiter,
+ uint32_t& times) {
+ using namespace protocol_handler;
+ ASSERT_TRUE(NULL != waiter.get());
+
AddConnection();
const ServiceType start_service = kRpc;
+
#ifdef ENABLE_SECURITY
// For enabled protection callback shall use protection ON
const bool callback_protection_flag = PROTECTION_ON;
@@ -179,25 +230,43 @@ class ProtocolHandlerImplTest : public ::testing::Test {
// use protection OFF
const bool callback_protection_flag = PROTECTION_OFF;
#endif // ENABLE_SECURITY
+
+ const protocol_handler::SessionContext context =
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ callback_protection_flag);
+
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
OnSessionStartedCallback(connection_id,
NEW_SESSION_ID,
start_service,
callback_protection_flag,
- _))
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(DoAll(
+ NotifyTestAsyncWaiter(waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ context,
+ ByRef(empty_rejected_param_))));
+ times++;
// 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));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ usleep(kAddSessionWaitTimeMs * kMicrosecondsInMillisecond);
}
#ifdef ENABLE_SECURITY
@@ -206,6 +275,7 @@ class ProtocolHandlerImplTest : public ::testing::Test {
protocol_handler_impl->set_security_manager(&security_manager_mock);
}
#endif // ENABLE_SECURITY
+
void SendTMMessage(uint8_t connection_id,
uint8_t version,
bool protection,
@@ -277,7 +347,10 @@ class ProtocolHandlerImplTest : public ::testing::Test {
testing::NiceMock<security_manager_test::MockSecurityManager>
security_manager_mock;
testing::NiceMock<security_manager_test::MockSSLContext> ssl_context_mock;
+ std::vector<int> force_protected_services;
+ std::vector<int> force_unprotected_services;
#endif // ENABLE_SECURITY
+ std::vector<std::string> empty_rejected_param_;
};
#ifdef ENABLE_SECURITY
@@ -325,8 +398,13 @@ TEST_F(ProtocolHandlerImplTest, RecieveOnUnknownConnection) {
*/
TEST_F(ProtocolHandlerImplTest,
StartSession_Unprotected_SessionObserverReject) {
+ using namespace protocol_handler;
const int call_times = 5;
AddConnection();
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ ServiceType service_type;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -334,18 +412,31 @@ TEST_F(ProtocolHandlerImplTest,
NEW_SESSION_ID,
AnyOf(kControl, kRpc, kAudio, kMobileNav, kBulk),
PROTECTION_OFF,
- _))
+ An<const BsonObject*>()))
.Times(call_times)
.
// Return sessions start rejection
- WillRepeatedly(Return(SESSION_START_REJECT));
+ WillRepeatedly(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ SaveArg<2>(&service_type),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ SESSION_START_REJECT,
+ service_type,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
+ times += call_times;
// Expect send NAck
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK,
PROTECTION_OFF)))
.Times(call_times)
- .WillRepeatedly(Return(E_SUCCESS));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times += call_times;
SendControlMessage(
PROTECTION_OFF, kControl, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
@@ -357,6 +448,8 @@ TEST_F(ProtocolHandlerImplTest,
PROTECTION_OFF, kMobileNav, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
SendControlMessage(
PROTECTION_OFF, kBulk, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send NAck on session_observer rejection
@@ -365,6 +458,7 @@ TEST_F(ProtocolHandlerImplTest,
* OFF
*/
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
+ using namespace protocol_handler;
const int call_times = 5;
AddConnection();
#ifdef ENABLE_SECURITY
@@ -375,6 +469,10 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
// use protection OFF
const bool callback_protection_flag = PROTECTION_OFF;
#endif // ENABLE_SECURITY
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ ServiceType service_type;
// Expect ConnectionHandler check
EXPECT_CALL(
session_observer_mock,
@@ -382,18 +480,31 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
NEW_SESSION_ID,
AnyOf(kControl, kRpc, kAudio, kMobileNav, kBulk),
callback_protection_flag,
- _))
+ An<const BsonObject*>()))
.Times(call_times)
.
// Return sessions start rejection
- WillRepeatedly(Return(SESSION_START_REJECT));
+ WillRepeatedly(DoAll(
+ NotifyTestAsyncWaiter(&waiter),
+ SaveArg<2>(&service_type),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ SESSION_START_REJECT,
+ service_type,
+ HASH_ID_WRONG,
+ callback_protection_flag),
+ ByRef(empty_rejected_param_))));
+ times += call_times;
// 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));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times += call_times;
SendControlMessage(
PROTECTION_ON, kControl, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
@@ -405,6 +516,8 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
PROTECTION_ON, kMobileNav, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
SendControlMessage(
PROTECTION_ON, kBulk, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack on session_observer accept
@@ -412,26 +525,46 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) {
*/
TEST_F(ProtocolHandlerImplTest,
StartSession_Unprotected_SessionObserverAccept) {
+ using namespace protocol_handler;
AddConnection();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
+ times++;
SetProtocolVersion2();
// Expect send Ack
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_OFF)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_OFF, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack on session_observer accept
@@ -441,84 +574,317 @@ TEST_F(ProtocolHandlerImplTest,
*/
TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) {
SetProtocolVersion2();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+static std::vector<uint8_t> CreateVectorFromBsonObject(const BsonObject* bo) {
+ std::vector<uint8_t> output;
+ if (bo != NULL) {
+ size_t len = bson_object_size(const_cast<BsonObject*>(bo));
+ uint8_t* bytes = bson_object_to_bytes(const_cast<BsonObject*>(bo));
+ output.assign(bytes, bytes + len);
+ free(bytes);
+ }
+ return output;
}
+
+/*
+ * Simulate two StartService messages of video service from mobile.
+ * Session observer accepts the first message with delay, while rejects the
+ * second message immediately.
+ */
+TEST_F(ProtocolHandlerImplTest,
+ StartSession_Unprotected_Multiple_SessionObserverAcceptAndReject) {
+ using namespace protocol_handler;
+
+ ON_CALL(protocol_handler_settings_mock, max_supported_protocol_version())
+ .WillByDefault(Return(PROTOCOL_VERSION_5));
+
+ const size_t maximum_payload_size = 1000;
+ InitProtocolHandlerImpl(0u, 0u, false, 0u, 0u, 0, maximum_payload_size);
+
+ const ServiceType start_service = kMobileNav;
+ const ::transport_manager::ConnectionUID connection_id1 = 0xAu;
+ const uint8_t session_id1 = 1u;
+ const ::transport_manager::ConnectionUID connection_id2 = 0xBu;
+ const uint8_t session_id2 = 2u;
+
+ EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id1, _))
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id2, _))
+ .WillRepeatedly(Return(false));
+
+ // Add two connections
+ tm_listener->OnConnectionEstablished(DeviceInfo(DeviceHandle(1u),
+ std::string("mac"),
+ std::string("name"),
+ std::string("BTMAC")),
+ connection_id1);
+ tm_listener->OnConnectionEstablished(DeviceInfo(DeviceHandle(2u),
+ std::string("mac"),
+ std::string("name"),
+ std::string("BTMAC")),
+ connection_id2);
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ BsonObject bson_params1;
+ bson_object_initialize_default(&bson_params1);
+ bson_object_put_string(&bson_params1,
+ protocol_handler::strings::video_protocol,
+ const_cast<char*>("RAW"));
+ bson_object_put_string(&bson_params1,
+ protocol_handler::strings::video_codec,
+ const_cast<char*>("H264"));
+ std::vector<uint8_t> params1 = CreateVectorFromBsonObject(&bson_params1);
+
+ uint8_t generated_session_id1 = 100;
+
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id1,
+ session_id1,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
+ // don't call NotifySessionStartedContext() immediately, instead call it
+ // after second OnSessionStartedCallback()
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
+ BsonObject bson_params2;
+ bson_object_initialize_default(&bson_params2);
+ bson_object_put_string(&bson_params2,
+ protocol_handler::strings::video_protocol,
+ const_cast<char*>("RTP"));
+ bson_object_put_string(&bson_params2,
+ protocol_handler::strings::video_codec,
+ const_cast<char*>("H265"));
+ std::vector<uint8_t> params2 = CreateVectorFromBsonObject(&bson_params2);
+
+ std::vector<std::string> rejected_param_list;
+ rejected_param_list.push_back(protocol_handler::strings::video_codec);
+
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id2,
+ session_id2,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
+ .WillOnce(DoAll(
+ NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id2,
+ session_id2,
+ SESSION_START_REJECT,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(rejected_param_list)),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id1,
+ session_id1,
+ generated_session_id1,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
+ times++;
+
+ BsonObject bson_ack_params;
+ bson_object_initialize_default(&bson_ack_params);
+ bson_object_put_int64(
+ &bson_ack_params, protocol_handler::strings::mtu, maximum_payload_size);
+ bson_object_put_string(&bson_ack_params,
+ protocol_handler::strings::video_protocol,
+ const_cast<char*>("RAW"));
+ bson_object_put_string(&bson_ack_params,
+ protocol_handler::strings::video_codec,
+ const_cast<char*>("H264"));
+ std::vector<uint8_t> ack_params =
+ CreateVectorFromBsonObject(&bson_ack_params);
+ bson_object_deinitialize(&bson_ack_params);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK,
+ PROTECTION_OFF,
+ connection_id1,
+ Eq(ack_params))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ BsonArray bson_arr;
+ bson_array_initialize(&bson_arr, rejected_param_list.size());
+ for (unsigned int i = 0; i < rejected_param_list.size(); i++) {
+ bson_array_add_string(&bson_arr,
+ const_cast<char*>(rejected_param_list[i].c_str()));
+ }
+ BsonObject bson_nack_params;
+ bson_object_initialize_default(&bson_nack_params);
+ bson_object_put_array(
+ &bson_nack_params, protocol_handler::strings::rejected_params, &bson_arr);
+ std::vector<uint8_t> nack_params =
+ CreateVectorFromBsonObject(&bson_nack_params);
+ bson_object_deinitialize(&bson_nack_params);
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK,
+ PROTECTION_OFF,
+ connection_id2,
+ Eq(nack_params))))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
+
+ SendTMMessage(connection_id1,
+ PROTOCOL_VERSION_5,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ start_service,
+ FRAME_DATA_START_SERVICE,
+ session_id1,
+ params1.size(),
+ message_id,
+ params1.size() > 0 ? &params1[0] : NULL);
+
+ SendTMMessage(connection_id2,
+ PROTOCOL_VERSION_5,
+ PROTECTION_OFF,
+ FRAME_TYPE_CONTROL,
+ start_service,
+ FRAME_DATA_START_SERVICE,
+ session_id2,
+ params2.size(),
+ message_id,
+ params2.size() > 0 ? &params2[0] : NULL);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ bson_object_deinitialize(&bson_params1);
+ bson_object_deinitialize(&bson_params2);
+}
+
// 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();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
const ServiceType service = kRpc;
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionEndedCallback(connection_id, session_id, _, service))
+ OnSessionEndedCallback(
+ connection_id, session_id, An<uint32_t*>(), service))
.
// reject session start
- WillOnce(Return(SESSION_START_REJECT));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(waiter), Return(SESSION_START_REJECT)));
+ times++;
SetProtocolVersion2();
// Expect send NAck
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_END_SERVICE_NACK, PROTECTION_OFF)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_OFF, service, session_id, FRAME_DATA_END_SERVICE);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send NAck on wrong hash code
*/
TEST_F(ProtocolHandlerImplTest, EndSession_Success) {
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
const ServiceType service = kRpc;
// Expect ConnectionHandler check
EXPECT_CALL(session_observer_mock,
- OnSessionEndedCallback(connection_id, session_id, _, service))
+ OnSessionEndedCallback(
+ connection_id, session_id, An<uint32_t*>(), service))
.
// return sessions start success
- WillOnce(Return(connection_key));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(connection_key)));
+ times++;
SetProtocolVersion2();
// Expect send Ack
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_END_SERVICE_ACK, PROTECTION_OFF)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_OFF, service, session_id, FRAME_DATA_END_SERVICE);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
#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();
+ using namespace protocol_handler;
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
// 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, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
+ times++;
SetProtocolVersion2();
// 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));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)))
+ .RetiresOnSaturation();
+ times++;
SendTMMessage(connection_id,
PROTOCOL_VERSION_1,
@@ -529,66 +895,113 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) {
NEW_SESSION_ID,
0,
message_id);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall not call Security logics on start session with
* PROTECTION_OFF
*/
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) {
+ using namespace protocol_handler;
AddConnection();
// Add security manager
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_OFF,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_OFF),
+ ByRef(empty_rejected_param_))));
+ times++;
SetProtocolVersion2();
// 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));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_OFF, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack with PROTECTION_OFF on fail SLL creation
*/
TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+
+ protocol_handler::SessionContext context = GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON);
+ context.is_new_service_ = true;
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ context,
+ ByRef(empty_rejected_param_))));
+ times++;
SetProtocolVersion2();
// Expect start protection for unprotected session
EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
.
// Return fail protection
- WillOnce(ReturnNull());
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
+ times++;
// 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));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack with PROTECTION_ON on already established and
@@ -596,67 +1009,112 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) {
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_SSLInitialized) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
+ times++;
SetProtocolVersion2();
// call new SSLContext creation
EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
.
// Return new SSLContext
- WillOnce(Return(&ssl_context_mock));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(&ssl_context_mock)));
+ times++;
// Initilization check
EXPECT_CALL(ssl_context_mock, IsInitCompleted())
.
// emulate SSL is initilized
- WillOnce(Return(true));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// Expect service protection enable
EXPECT_CALL(session_observer_mock,
- SetProtectionFlag(connection_key, start_service));
+ SetProtectionFlag(connection_key, start_service))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
// Expect send Ack with PROTECTION_ON (on SSL is initilized)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack with PROTECTION_OFF on session handshhake fail
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeFail) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ protocol_handler::SessionContext context = GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON);
+ context.is_new_service_ = true;
+
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ context,
+ ByRef(empty_rejected_param_))));
+ times++;
std::vector<int> services;
// TODO(AKutsan) : APPLINK-21398 use named constants instead of magic numbers
services.push_back(0x0A);
services.push_back(0x0B);
- ON_CALL(protocol_handler_settings_mock, force_protected_service())
- .WillByDefault(ReturnRefOfCopy(services));
+ EXPECT_CALL(protocol_handler_settings_mock, force_protected_service())
+ .WillOnce(ReturnRefOfCopy(services));
// call new SSLContext creation
EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
@@ -668,13 +1126,15 @@ TEST_F(ProtocolHandlerImplTest,
EXPECT_CALL(ssl_context_mock, IsInitCompleted())
.
// emulate SSL is not initilized
- WillOnce(Return(false));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(false)));
+ times++;
// Pending handshake check
EXPECT_CALL(ssl_context_mock, IsHandshakePending())
.
// emulate is pending
- WillOnce(Return(true));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// Expect add listener for handshake result
EXPECT_CALL(security_manager_mock, AddListener(_))
@@ -683,21 +1143,17 @@ TEST_F(ProtocolHandlerImplTest,
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));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack with PROTECTION_ON on session handshhake
@@ -705,6 +1161,7 @@ TEST_F(ProtocolHandlerImplTest,
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeSuccess) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
@@ -714,59 +1171,87 @@ TEST_F(ProtocolHandlerImplTest,
ON_CALL(protocol_handler_settings_mock, force_protected_service())
.WillByDefault(ReturnRefOfCopy(services));
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
+ times++;
// call new SSLContext creation
EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
.
// Return new SSLContext
- WillOnce(Return(&ssl_context_mock));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(&ssl_context_mock)));
+ times++;
// Initilization check
EXPECT_CALL(ssl_context_mock, IsInitCompleted())
.
// emulate SSL is not initilized
- WillOnce(Return(false));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(false)));
+ times++;
// Pending handshake check
EXPECT_CALL(ssl_context_mock, IsHandshakePending())
.
// emulate is pending
- WillOnce(Return(true));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// 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)));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ Invoke(OnHandshakeDoneFunctor(
+ connection_key,
+ security_manager::SSLContext::Handshake_Result_Success))));
+ times++;
// Listener check SSLContext
EXPECT_CALL(session_observer_mock,
GetSSLContext(connection_key, start_service))
.
// Emulate protection for service is not enabled
- WillOnce(ReturnNull());
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
+ times++;
// Expect service protection enable
EXPECT_CALL(session_observer_mock,
- SetProtectionFlag(connection_key, start_service));
+ SetProtectionFlag(connection_key, start_service))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
// Expect send Ack with PROTECTION_OFF (on fail handshake)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack with PROTECTION_ON on session handshhake
@@ -775,6 +1260,7 @@ TEST_F(ProtocolHandlerImplTest,
TEST_F(
ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeSuccess_ServiceProtectedBefore) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
@@ -783,20 +1269,37 @@ TEST_F(
ON_CALL(protocol_handler_settings_mock, force_protected_service())
.WillByDefault(ReturnRefOfCopy(services));
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
+ times++;
// call new SSLContext creation
EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
.
// Return new SSLContext
- WillOnce(Return(&ssl_context_mock));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(&ssl_context_mock)));
+ times++;
// Initilization check
EXPECT_CALL(ssl_context_mock, IsInitCompleted())
@@ -808,34 +1311,44 @@ TEST_F(
EXPECT_CALL(ssl_context_mock, IsHandshakePending())
.
// emulate is pending
- WillOnce(Return(true));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// 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)));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ Invoke(OnHandshakeDoneFunctor(
+ connection_key,
+ security_manager::SSLContext::Handshake_Result_Success))));
+ times++;
// Listener check SSLContext
EXPECT_CALL(session_observer_mock,
GetSSLContext(connection_key, start_service))
.
// Emulate protection for service is not enabled
- WillOnce(ReturnNull());
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
+ times++;
// Expect service protection enable
EXPECT_CALL(session_observer_mock,
- SetProtectionFlag(connection_key, start_service));
+ SetProtectionFlag(connection_key, start_service))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
// Expect send Ack with PROTECTION_OFF (on fail handshake)
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* ProtocolHandler shall send Ack with PROTECTION_ON on session handshhake
@@ -843,6 +1356,7 @@ TEST_F(
*/
TEST_F(ProtocolHandlerImplTest,
SecurityEnable_StartSessionProtected_HandshakeSuccess_SSLIsNotPending) {
+ using namespace protocol_handler;
AddConnection();
AddSecurityManager();
const ServiceType start_service = kRpc;
@@ -851,35 +1365,56 @@ TEST_F(ProtocolHandlerImplTest,
ON_CALL(protocol_handler_settings_mock, force_protected_service())
.WillByDefault(ReturnRefOfCopy(services));
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect ConnectionHandler check
- EXPECT_CALL(
- session_observer_mock,
- OnSessionStartedCallback(
- connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _))
+ EXPECT_CALL(session_observer_mock,
+ OnSessionStartedCallback(connection_id,
+ NEW_SESSION_ID,
+ start_service,
+ PROTECTION_ON,
+ An<const BsonObject*>()))
.
// Return sessions start success
- WillOnce(Return(session_id));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter),
+ InvokeMemberFuncWithArg2(protocol_handler_impl.get(),
+ &ProtocolHandler::NotifySessionStarted,
+ GetSessionContext(connection_id,
+ NEW_SESSION_ID,
+ session_id,
+ start_service,
+ HASH_ID_WRONG,
+ PROTECTION_ON),
+ ByRef(empty_rejected_param_))));
+ times++;
// call new SSLContext creation
EXPECT_CALL(security_manager_mock, CreateSSLContext(connection_key))
.
// Return new SSLContext
- WillOnce(Return(&ssl_context_mock));
+ WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(&ssl_context_mock)));
+ times++;
// Initilization check
EXPECT_CALL(ssl_context_mock, IsInitCompleted())
.
// emulate SSL is not initilized
- WillOnce(Return(false));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(false)));
+ times++;
// Pending handshake check
EXPECT_CALL(ssl_context_mock, IsHandshakePending())
.
// emulate is pending
- WillOnce(Return(false));
+ WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(false)));
+ times++;
// Wait restart handshake operation
- EXPECT_CALL(security_manager_mock, StartHandshake(connection_key));
+ EXPECT_CALL(security_manager_mock, StartHandshake(connection_key))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
// Expect add listener for handshake result
EXPECT_CALL(security_manager_mock, AddListener(_))
@@ -903,23 +1438,32 @@ TEST_F(ProtocolHandlerImplTest,
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(
ControlMessage(FRAME_DATA_START_SERVICE_ACK, PROTECTION_ON)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS)));
+ times++;
SendControlMessage(
PROTECTION_ON, start_service, NEW_SESSION_ID, FRAME_DATA_START_SERVICE);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
#endif // ENABLE_SECURITY
-TEST_F(ProtocolHandlerImplTest, FloodVerification) {
+TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification) {
const size_t period_msec = 10000;
const size_t max_messages = 1000;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect flood notification to CH
EXPECT_CALL(session_observer_mock, OnApplicationFloodCallBack(connection_key))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(waiter));
+ times++;
ON_CALL(protocol_handler_settings_mock, message_frequency_time())
.WillByDefault(Return(period_msec));
@@ -938,13 +1482,21 @@ TEST_F(ProtocolHandlerImplTest, FloodVerification) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, period_msec));
}
-TEST_F(ProtocolHandlerImplTest, FloodVerification_ThresholdValue) {
+
+TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_ThresholdValue) {
const size_t period_msec = 10000;
const size_t max_messages = 1000;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
ON_CALL(protocol_handler_settings_mock, message_frequency_time())
.WillByDefault(Return(period_msec));
@@ -954,6 +1506,7 @@ TEST_F(ProtocolHandlerImplTest, FloodVerification_ThresholdValue) {
// Expect NO flood notification to CH
EXPECT_CALL(session_observer_mock, OnApplicationFloodCallBack(connection_key))
.Times(0);
+
for (size_t i = 0; i < max_messages - 1; ++i) {
SendTMMessage(connection_id,
PROTOCOL_VERSION_3,
@@ -966,13 +1519,21 @@ TEST_F(ProtocolHandlerImplTest, FloodVerification_ThresholdValue) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, period_msec));
}
-TEST_F(ProtocolHandlerImplTest, FloodVerification_VideoFrameSkip) {
+
+TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_VideoFrameSkip) {
const size_t period_msec = 10000;
const size_t max_messages = 1000;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect NO flood notification to CH on video data streaming
for (size_t i = 0; i < max_messages + 1; ++i) {
@@ -987,13 +1548,21 @@ TEST_F(ProtocolHandlerImplTest, FloodVerification_VideoFrameSkip) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, period_msec));
}
-TEST_F(ProtocolHandlerImplTest, FloodVerification_AudioFrameSkip) {
+
+TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_AudioFrameSkip) {
const size_t period_msec = 10000;
const size_t max_messages = 1000;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect NO flood notification to CH on video data streaming
for (size_t i = 0; i < max_messages + 1; ++i) {
@@ -1008,13 +1577,21 @@ TEST_F(ProtocolHandlerImplTest, FloodVerification_AudioFrameSkip) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, period_msec));
}
-TEST_F(ProtocolHandlerImplTest, FloodVerificationDisable) {
+
+TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerificationDisable) {
const size_t period_msec = 0;
const size_t max_messages = 0;
InitProtocolHandlerImpl(period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect NO flood notification to session observer
for (size_t i = 0; i < max_messages + 1; ++i) {
@@ -1029,6 +1606,8 @@ TEST_F(ProtocolHandlerImplTest, FloodVerificationDisable) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
@@ -1036,7 +1615,12 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
const size_t max_messages = 100;
InitProtocolHandlerImpl(0u, 0u, false, period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect malformed notification to CH
EXPECT_CALL(session_observer_mock, OnMalformedMessageCallback(connection_id))
@@ -1055,18 +1639,26 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
-TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification) {
+TEST_F(ProtocolHandlerImplTest, DISABLED_MalformedLimitVerification) {
const size_t period_msec = 10000;
const size_t max_messages = 100;
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect malformed notification to CH
EXPECT_CALL(session_observer_mock, OnMalformedMessageCallback(connection_id))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(waiter));
+ times++;
// Sending malformed packets
const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
@@ -1094,18 +1686,27 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
-TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedStock) {
+TEST_F(ProtocolHandlerImplTest,
+ DISABLED_MalformedLimitVerification_MalformedStock) {
const size_t period_msec = 10000;
const size_t max_messages = 100;
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect malformed notification to CH
EXPECT_CALL(session_observer_mock, OnMalformedMessageCallback(connection_id))
- .Times(1);
+ .WillOnce(NotifyTestAsyncWaiter(waiter));
+ times++;
// Sending malformed packets
const uint8_t malformed_version = PROTOCOL_VERSION_MAX;
@@ -1158,6 +1759,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedStock) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
@@ -1165,7 +1768,12 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
const size_t max_messages = 100;
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect NO malformed notification to CH
EXPECT_CALL(session_observer_mock, OnMalformedMessageCallback(connection_id))
@@ -1212,6 +1820,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) {
// No common message
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) {
@@ -1219,7 +1829,12 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) {
const size_t max_messages = 1000;
InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages);
AddConnection();
- AddSession();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect no malformed notification to CH
EXPECT_CALL(session_observer_mock, OnMalformedMessageCallback(connection_id))
@@ -1239,13 +1854,21 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
+
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();
+
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
// Expect no malformed notification to CH
EXPECT_CALL(session_observer_mock, OnMalformedMessageCallback(connection_id))
@@ -1265,6 +1888,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullCount) {
message_id,
&some_data[0]);
}
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest,
@@ -1275,13 +1900,20 @@ TEST_F(ProtocolHandlerImplTest,
.WillOnce(Return(false));
// Expect not send End Service
EXPECT_CALL(transport_manager_mock, SendMessageToDevice(_)).Times(0);
+
// Act
protocol_handler_impl->SendEndSession(connection_id, session_id);
}
-TEST_F(ProtocolHandlerImplTest, SendEndServicePrivate_EndSession_MessageSent) {
+TEST_F(ProtocolHandlerImplTest,
+ DISABLED_SendEndServicePrivate_EndSession_MessageSent) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
// Expect check connection with ProtocolVersionUsed
EXPECT_CALL(session_observer_mock,
ProtocolVersionUsed(connection_id, session_id, _))
@@ -1294,12 +1926,19 @@ TEST_F(ProtocolHandlerImplTest, SendEndServicePrivate_EndSession_MessageSent) {
.WillOnce(Return(E_SUCCESS));
// Act
protocol_handler_impl->SendEndSession(connection_id, session_id);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest,
SendEndServicePrivate_ServiceTypeControl_MessageSent) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
// Expect check connection with ProtocolVersionUsed
EXPECT_CALL(session_observer_mock,
ProtocolVersionUsed(connection_id, session_id, _))
@@ -1310,9 +1949,13 @@ TEST_F(ProtocolHandlerImplTest,
FRAME_DATA_END_SERVICE,
PROTECTION_OFF,
kControl)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
+
// Act
protocol_handler_impl->SendEndService(connection_id, session_id, kControl);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, SendHeartBeat_NoConnection_NotSent) {
@@ -1322,13 +1965,19 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_NoConnection_NotSent) {
.WillOnce(Return(false));
// Expect not send HeartBeat
EXPECT_CALL(transport_manager_mock, SendMessageToDevice(_)).Times(0);
+
// Act
protocol_handler_impl->SendHeartBeat(connection_id, session_id);
}
TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
// Expect check connection with ProtocolVersionUsed
EXPECT_CALL(session_observer_mock,
ProtocolVersionUsed(connection_id, session_id, _))
@@ -1339,13 +1988,21 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) {
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_CONTROL, FRAME_DATA_HEART_BEAT, PROTECTION_OFF, kControl)))
.WillOnce(Return(E_SUCCESS));
+
// Act
protocol_handler_impl->SendHeartBeat(connection_id, session_id);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
// Expect double check connection and protocol version with
// ProtocolVersionUsed
EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(connection_id, _, _))
@@ -1357,15 +2014,25 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) {
FRAME_DATA_HEART_BEAT_ACK,
PROTECTION_OFF,
kControl)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
+
// Act
SendControlMessage(
PROTECTION_OFF, kControl, session_id, FRAME_DATA_HEART_BEAT);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
-TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_WrongProtocolVersion_NotSent) {
+TEST_F(ProtocolHandlerImplTest,
+ DISABLED_SendHeartBeatAck_WrongProtocolVersion_NotSent) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
// Expect two checks of connection and protocol version with
// ProtocolVersionUsed
EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(connection_id, _, _))
@@ -1383,12 +2050,19 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_WrongProtocolVersion_NotSent) {
PROTECTION_OFF, kControl, session_id, FRAME_DATA_HEART_BEAT);
SendControlMessage(
PROTECTION_OFF, kControl, session_id, FRAME_DATA_HEART_BEAT);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleControlMessage) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
@@ -1399,8 +2073,8 @@ TEST_F(ProtocolHandlerImplTest,
PairFromKey(message->connection_key(), _, _))
.WillOnce(
DoAll(SetArgPointee<1>(connection_id), SetArgPointee<2>(session_id)));
-// Expect getting ssl context
#ifdef ENABLE_SECURITY
+ // Expect getting ssl context
EXPECT_CALL(session_observer_mock,
GetSSLContext(message->connection_key(), message->service_type()))
.WillOnce(Return(&ssl_context_mock));
@@ -1411,14 +2085,22 @@ TEST_F(ProtocolHandlerImplTest,
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_SINGLE, FRAME_DATA_SINGLE, PROTECTION_OFF, kControl)))
.WillOnce(Return(E_SUCCESS));
+
// Act
protocol_handler_impl->SendMessageToMobileApp(message, is_final);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest,
SendMessageToMobileApp_SendSingleNonControlMessage) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
const bool is_final = true;
const uint32_t total_data_size = 1;
UCharDataVector data(total_data_size);
@@ -1429,26 +2111,39 @@ TEST_F(ProtocolHandlerImplTest,
PairFromKey(message->connection_key(), _, _))
.WillOnce(
DoAll(SetArgPointee<1>(connection_id), SetArgPointee<2>(session_id)));
-// Expect getting ssl context
+
#ifdef ENABLE_SECURITY
+ // Expect getting ssl context
EXPECT_CALL(session_observer_mock,
GetSSLContext(message->connection_key(), message->service_type()))
.Times(2)
- .WillRepeatedly(Return(&ssl_context_mock));
+ .WillRepeatedly(
+ DoAll(NotifyTestAsyncWaiter(waiter), Return(&ssl_context_mock)));
+ times += 2;
AddSecurityManager();
#endif // ENABLE_SECURITY
+
// Expect send message to mobile
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_SINGLE, FRAME_DATA_SINGLE, PROTECTION_OFF, kRpc)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
+
// Act
protocol_handler_impl->SendMessageToMobileApp(message, is_final);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
// Arrange
- AddSession();
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
const bool is_final = true;
const uint32_t total_data_size = MAXIMUM_FRAME_DATA_V2_SIZE * 2;
UCharDataVector data(total_data_size);
@@ -1460,33 +2155,94 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) {
PairFromKey(message->connection_key(), _, _))
.WillOnce(
DoAll(SetArgPointee<1>(connection_id), SetArgPointee<2>(session_id)));
-// Expect getting ssl context
#ifdef ENABLE_SECURITY
+ // Expect getting ssl context
EXPECT_CALL(session_observer_mock,
GetSSLContext(message->connection_key(), message->service_type()))
.Times(4)
- .WillRepeatedly(Return(&ssl_context_mock));
+ .WillRepeatedly(
+ DoAll(NotifyTestAsyncWaiter(waiter), Return(&ssl_context_mock)));
+ times += 4;
AddSecurityManager();
#endif // ENABLE_SECURITY
// Expect sending message frame by frame to mobile
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ExpectedMessage(
FRAME_TYPE_FIRST, FRAME_DATA_FIRST, PROTECTION_OFF, kBulk)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONSECUTIVE,
first_consecutive_frame,
PROTECTION_OFF,
kBulk)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
EXPECT_CALL(transport_manager_mock,
SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONSECUTIVE,
FRAME_DATA_LAST_CONSECUTIVE,
PROTECTION_OFF,
kBulk)))
- .WillOnce(Return(E_SUCCESS));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
+
// Act
protocol_handler_impl->SendMessageToMobileApp(message, is_final);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) {
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
+ EXPECT_CALL(session_observer_mock, PairFromKey(connection_key, _, _))
+ .WillOnce(
+ DoAll(SetArgPointee<1>(connection_id), SetArgPointee<2>(session_id)));
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_4), Return(true)));
+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL,
+ FRAME_DATA_SERVICE_DATA_ACK,
+ PROTECTION_OFF,
+ kMobileNav)))
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(E_SUCCESS)));
+ times++;
+
+ protocol_handler_impl->SendFramesNumber(connection_key, 0);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
+}
+
+TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) {
+ ::utils::SharedPtr<TestAsyncWaiter> waiter =
+ utils::MakeShared<TestAsyncWaiter>();
+ uint32_t times = 0;
+
+ AddSession(waiter, times);
+
+ EXPECT_CALL(session_observer_mock, PairFromKey(connection_key, _, _))
+ .WillOnce(
+ DoAll(SetArgPointee<1>(connection_id), SetArgPointee<2>(session_id)));
+ EXPECT_CALL(session_observer_mock, ProtocolVersionUsed(connection_id, _, _))
+ .WillRepeatedly(
+ DoAll(SetArgReferee<2>(PROTOCOL_VERSION_5), Return(true)));
+
+ // It is expected that Service Data ACK is NOT sent for version 5+
+ EXPECT_CALL(transport_manager_mock,
+ SendMessageToDevice(ExpectedMessage(FRAME_TYPE_CONTROL,
+ FRAME_DATA_SERVICE_DATA_ACK,
+ PROTECTION_OFF,
+ kMobileNav))).Times(0);
+
+ protocol_handler_impl->SendFramesNumber(connection_key, 0);
+
+ EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout));
}
} // 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
index 40b0f34846..e42ba96251 100644
--- a/src/components/protocol_handler/test/protocol_header_validator_test.cc
+++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc
@@ -57,7 +57,7 @@ class ProtocolHeaderValidatorTest : public ::testing::Test {
uint32_t some_session_id;
};
-// Protocol version shall be from 1 to 3
+// Protocol version shall be from 1 to 5
TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) {
EXPECT_EQ(std::numeric_limits<size_t>::max(),
header_validator.max_payload_size());
@@ -67,11 +67,96 @@ TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) {
}
}
-// Protocol version shall be from 1 to 4
+TEST_F(ProtocolHeaderValidatorTest, MaxControlPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_control_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_control_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_control_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, MaxRpcPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_rpc_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_rpc_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_rpc_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, MaxAudioPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_audio_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_audio_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_audio_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, MaxVideoPayloadSizeSetGet) {
+ EXPECT_EQ(0u, header_validator.max_video_payload_size());
+ for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_video_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_video_payload_size());
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Control) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kControl));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_control_payload_size(value);
+ EXPECT_EQ(value,
+ header_validator.max_payload_size_by_service_type(kControl));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Rpc) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kRpc));
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kBulk));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_rpc_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kRpc));
+ EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kBulk));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Audio) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kAudio));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_audio_payload_size(value);
+ EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kAudio));
+ }
+}
+
+TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Video) {
+ size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE;
+ header_validator.set_max_payload_size(payload_size);
+ // Default to max_payload_size if a specific MTU is not set
+ EXPECT_EQ(payload_size,
+ header_validator.max_payload_size_by_service_type(kMobileNav));
+ for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) {
+ header_validator.set_max_video_payload_size(value);
+ EXPECT_EQ(value,
+ header_validator.max_payload_size_by_service_type(kMobileNav));
+ }
+}
+
+// Protocol version shall be from 1 to 5
TEST_F(ProtocolHeaderValidatorTest, Malformed_Version) {
std::vector<uint8_t> malformed_versions;
malformed_versions.push_back(0);
- for (uint8_t version = PROTOCOL_VERSION_4 + 1;
+ for (uint8_t version = PROTOCOL_VERSION_5 + 1;
version <= PROTOCOL_VERSION_MAX;
++version) {
malformed_versions.push_back(version);
diff --git a/src/components/protocol_handler/test/protocol_packet_test.cc b/src/components/protocol_handler/test/protocol_packet_test.cc
index 7819c4b5b0..71c7726243 100644
--- a/src/components/protocol_handler/test/protocol_packet_test.cc
+++ b/src/components/protocol_handler/test/protocol_packet_test.cc
@@ -125,7 +125,9 @@ TEST_F(ProtocolPacketTest, SerializePacketWithDiffServiceType) {
for (size_t i = 0; i < serv_types.size(); ++i) {
RawMessagePtr res =
GetRawMessage(PROTOCOL_VERSION_3, FRAME_TYPE_CONTROL, serv_types[i]);
- EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(serv_types[i], res->service_type());
EXPECT_EQ(PROTOCOL_HEADER_V2_SIZE, res->data_size());
}
@@ -146,7 +148,9 @@ TEST_F(ProtocolPacketTest, SerializePacketWithWrongServiceType) {
for (size_t i = 0; i < serv_types.size(); ++i) {
RawMessagePtr res =
GetRawMessage(PROTOCOL_VERSION_3, FRAME_TYPE_CONTROL, serv_types[i]);
- EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(kInvalidServiceType, res->service_type());
}
}
@@ -156,7 +160,9 @@ TEST_F(ProtocolPacketTest, SetPacketWithDiffFrameType) {
for (frame_type = FRAME_TYPE_CONTROL + 1; frame_type <= FRAME_TYPE_MAX_VALUE;
++frame_type) {
RawMessagePtr res = GetRawMessage(PROTOCOL_VERSION_3, frame_type, kControl);
- EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(kControl, res->service_type());
}
}
diff --git a/src/components/qt_hmi/CMakeLists.txt b/src/components/qt_hmi/CMakeLists.txt
deleted file mode 100644
index ee30f2b468..0000000000
--- a/src/components/qt_hmi/CMakeLists.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-add_subdirectory(./qml_plugins)
-
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- add_subdirectory(./qml_model_qt4)
-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/Readme.txt b/src/components/qt_hmi/Readme.txt
deleted file mode 100644
index 55e85db8ec..0000000000
--- a/src/components/qt_hmi/Readme.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-How to view QML HMI.
-
-1) Run setup_env.sh from root folder of SDL project (this will install right version of Qt and CMake)
-2) Run CMake with option HMI2=ON “cmake -DHMI2=ON <root_SDL_folder>” (this will build core+dbus adapter and QML HMI+ dbus adapter)
-3) Run “<QT510_INSTALL_PATH>/qmlscene <root_SDL_folder>/src/components/qt_hmi/qml_model_qt5/MainWindow.qml”
-4) Run SDL
-
diff --git a/src/components/qt_hmi/References/Look/.DS_Store b/src/components/qt_hmi/References/Look/.DS_Store
deleted file mode 100644
index c84f3ca965..0000000000
--- a/src/components/qt_hmi/References/Look/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf
deleted file mode 100644
index 4ae24370af..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-Lt.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf
deleted file mode 100644
index 2186efad6c..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-LtCn.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf
deleted file mode 100644
index c0232d069d..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTCom-ThCn.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf
deleted file mode 100644
index 8b82f0ae0c..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf
deleted file mode 100644
index 3595f70135..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Md.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf b/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf
deleted file mode 100644
index 7be067d905..0000000000
--- a/src/components/qt_hmi/References/Look/Fonts/HelveticaNeueLTStd-Roman.ttf
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/ImageHardkey.qml b/src/components/qt_hmi/References/Look/ImageHardkey.qml
deleted file mode 100644
index e39bb41605..0000000000
--- a/src/components/qt_hmi/References/Look/ImageHardkey.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FHardwareKey {
- width: 50
- height: 50
-
- property alias image : theImage.source
-
- Rectangle {
- anchors.fill: parent
- border.color: "black"
- border.width: 1
- radius: 10
- smooth: true
-
- gradient: Gradient {
- GradientStop {
- id: s1
- color: "#FF646464"
- position: 0.0
- }
- GradientStop {
- id: s2
- color: "#FF484848"
- position: 0.8
- }
- GradientStop {
- id: s3
- color: "#FF323232"
- position: 1.0
- }
- }
- }
-
- FWdgtImage {
- id: theImage
- //anchors.fill: parent
- anchors.centerIn: parent
- //fillMode: Image.PreserveAspectFit
- smooth: true
- }
-
-
- FViewUseCaseSimple {
- condition: pressed === true
- PropertyChanges { target: s1; position: 1.0 }
- PropertyChanges { target: s2; position: 0.2}
- PropertyChanges { target: s3; position: 0.0 }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml b/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml
deleted file mode 100644
index 3ee2761be9..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/AlphaSortLayout.qml
+++ /dev/null
@@ -1,378 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: alphaLayout
- width: 800
- height: 480
-
-
- property alias a: aBtn.touchBtn
- property alias b: bBtn.touchBtn
- property alias c: cBtn.touchBtn
- property alias d: dBtn.touchBtn
- property alias e: eBtn.touchBtn
- property alias f: fBtn.touchBtn
- property alias g: gBtn.touchBtn
- property alias h: hBtn.touchBtn
- property alias i: iBtn.touchBtn
- property alias j: jBtn.touchBtn
- property alias k: kBtn.touchBtn
- property alias l: lBtn.touchBtn
- property alias m: mBtn.touchBtn
- property alias n: nBtn.touchBtn
- property alias o: oBtn.touchBtn
- property alias p: pBtn.touchBtn
- property alias q: qBtn.touchBtn
- property alias r: rBtn.touchBtn
- property alias s: sBtn.touchBtn
- property alias t: tBtn.touchBtn
- property alias u: uBtn.touchBtn
- property alias v: vBtn.touchBtn
- property alias w: wBtn.touchBtn
- property alias xB: xBtn.touchBtn
- property alias yB: yBtn.touchBtn
- property alias zB: zBtn.touchBtn
- property alias num: numBtn.touchBtn
- property alias close: closeTouch
-
- property string phonEntry: ""
-
-// BaseText{
-// id: phoneEntry
-// x:25
-// y:115
-// text: phonEntry
-// theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
-// pxSize: 45
-// horAlignment: Text.AlignLeft
-// vertAlignment: Text.AlignTop
-// }
-
- TouchButtonClimatePCA{
- id: aBtn
- x:48
- y:131
- text: "A"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: jBtn
- x:48
- y:212
- text: "J"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: sBtn
- x:48
- y:293
- text: "S"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: bBtn
- x:129
- y:131
- text: "B"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: kBtn
- x:129
- y:212
- text: "K"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: tBtn
- x:129
- y:293
- text: "T"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: cBtn
- x:210
- y:131
- text: "C"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: lBtn
- x:210
- y:212
- text: "L"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: uBtn
- x:210
- y:293
- text: "U"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: dBtn
- x:291
- y:131
- text: "D"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: mBtn
- x:291
- y:212
- text: "M"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: vBtn
- x:291
- y:293
- text: "V"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: eBtn
- x:372
- y:131
- text: "E"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: nBtn
- x:372
- y:212
- text: "N"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: wBtn
- x:372
- y:293
- text: "W"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: fBtn
- x:453
- y:131
- text: "F"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: oBtn
- x:453
- y:212
- text: "O"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: xBtn
- x:453
- y:293
- text: "X"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: gBtn
- x:534
- y:131
- text: "G"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: pBtn
- x:534
- y:212
- text: "P"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: yBtn
- x:534
- y:293
- text: "Y"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: hBtn
- x:615
- y:131
- text: "H"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: qBtn
- x:615
- y:212
- text: "Q"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: zBtn
- x:615
- y:293
- text: "Z"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: iBtn
- x:696
- y:131
- text: "I"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: rBtn
- x:696
- y:212
- text: "R"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: numBtn
- x:696
- y:293
- text: "123"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- }
-
- FViewUseCase{condition: closeTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: closeTxt; color: "white"
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml b/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml
deleted file mode 100644
index 2a1b2aa5f1..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/BlankLayout.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FLayout {
- width: 800
- height: 480
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml
deleted file mode 100644
index 14daa544b7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ChromeLayout.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: chromelayout
- width: 800
- height: 480
-
- property alias button1: button1
- property alias button2: button2
- property alias button3: button3
-
-
-
- FWdgtTouchArea {
- id: blockClockTouch
- anchors.top: chromelayout.top
- anchors.horizontalCenter: chromelayout.horizontalCenter
- height: 60
- width: 160
- }
-
- Rectangle{
- id: clockBackground
- anchors.fill: blockClockTouch
- color: "red"
- }
-
- BaseText{
- id: clock
- anchors.centerIn: blockClockTouch
- text: "clock"
- horAlignment: Text.AlignHCenter
- }
-
- TouchButton{
- id: button1
- anchors.top: blockClockTouch.top
- anchors.right: blockClockTouch.left
- anchors.rightMargin: -5
- height: blockClockTouch.height
- width: 75
- text: "Button 1"
- unpressedColor: "darkRed"
- }
-
- TouchButton{
- id: button2
- anchors.top: blockClockTouch.top
- anchors.left: blockClockTouch.right
- anchors.leftMargin: -5
- height:blockClockTouch.height
- width: 75
- text: "Button 2"
- unpressedColor:"darkRed"
- }
-
- TouchButton{
- id: button3
- anchors.bottom: chromelayout.bottom
- anchors.horizontalCenter: chromelayout.horizontalCenter
- height:blockClockTouch.height
- width: 225
- text: "Button 3"
- unpressedColor: "red"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml b/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml
deleted file mode 100644
index 6b6a2761c5..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ClimatePCALayout.qml
+++ /dev/null
@@ -1,111 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: climateLayout
- width: 800
- height: 480
-
- property alias dualBtn: dualBtn.touchBtn
- property alias drvHeatSeat: drvHeatSeat.touchBtn
- property alias drvCoolSeat: drvCoolSeat.touchBtn
- property alias passCoolSeat: passCoolSeat.touchBtn
- property alias passHeatSeat: passHeatSeat.touchBtn
- property alias heatWheel: heatWheel.touchBtn
- property alias heatWinSheild: heatWinSheild.touchBtn
- property alias defrost: defrost.touchBtn
- property alias pannel: pannel.touchBtn
- property alias floor: floor.touchBtn
-
- property alias dualBtnSt: dualBtn.selected
- property alias drvHeatSeatSt: drvHeatSeat.selected
- property alias drvCoolSeatSt: drvCoolSeat.selected
- property alias passCoolSeatSt: passCoolSeat.selected
- property alias passHeatSeatSt: passHeatSeat.selected
- property alias heatWheelSt: heatWheel.selected
- property alias heatWinSheildSt: heatWinSheild.selected
- property alias defrostSt: defrost.selected
- property alias pannelSt: pannel.selected
- property alias floorSt: floor.selected
-
-
-
- TouchButtonClimatePCA{
- id: drvHeatSeat
- x:105
- y:178
- bitmap: "climate/heated seat icon.png"
- bitmap2: "climate/heated seat iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: drvCoolSeat
- x:105
- y:273
- bitmap: "climate/A_C icon.png"
- bitmap2: "climate/A_C iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: heatWheel
- x:200
- y:178
- bitmap: "climate/wheel icon.png"
- bitmap2: "climate/wheel iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: heatWinSheild
- x:200
- y:273
- bitmap: "climate/headed dashBlue.png"
- bitmap2: "climate/headed dash.png"
- }
-
- TouchButtonClimatePCA{
- id: defrost
- x:360
- y:130
- bitmap: "climate/defrost iconBlue.png"
- bitmap2: "climate/defrost icon.png"
- }
-
- TouchButtonClimatePCA{
- id: pannel
- x:360
- y:226
- bitmap: "climate/face icon.png"
- bitmap2: "climate/face iconBlack.png"
- }
-
- TouchButtonClimatePCA{
- id: floor
- x:360
- y:322
- bitmap: "climate/feet icon.png"
- bitmap2: "climate/feet iconBlack.png"
- }
-
-
- TouchButtonClimatePCA{
- id: dualBtn
- y:225
- x:528
- text: "Dual"
- }
-
- TouchButtonClimatePCA{
- id: passHeatSeat
- x:615
- y:178
- bitmap: "climate/heated seat icon.png"
- bitmap2: "climate/heated seat iconBlack.png"
- }
- TouchButtonClimatePCA{
- id: passCoolSeat
- x:615
- y:273
- bitmap: "climate/A_C icon.png"
- bitmap2: "climate/A_C iconBlack.png"
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml
deleted file mode 100644
index 0abc7db4b7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ControlMirrorLayout.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: alphaLayout
- width: 800
- height: 480
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
- x:0
- y:0
-
- FWdgtTouchArea{
- id: blockTouch
- x:0
- y:0
- height: 480
- width: 800
- }
-
- Rectangle{
- anchors.fill: blockTouch
- color: "black"
- opacity: 0.8
- }
-
- FWdgtImage{
- id: popupBg
- anchors.centerIn: blockTouch
- bitmap: "climate/ring.png"
- }
-
- BaseText{
- id:curTemp
- anchors.centerIn: popupBg
- text: dataPool.drvTemp + "\xBA"
- pxSize: 96
- }
-
- BaseText{
- id:drvPass
- anchors.horizontalCenter: popupBg.horizontalCenter
- anchors.bottom: curTemp.top
- horAlignment: Text.AlignHCenter
- text: "Driver"
- pxSize: 28
- }
-
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml b/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml
deleted file mode 100644
index 8057ff2e7e..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/FMLayout.qml
+++ /dev/null
@@ -1,217 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias albumInfoBtn: albumInfoBtn
- property alias albumInfoImg: stationLogoImg
- property alias stationTxt: stationTxt
- property alias trackTxt: trackTxt
- property alias artistTxt: artistTxt
- property alias alertBtn: alertBtn
- property alias preset1Btn: preset1Btn
- property alias preset2Btn: preset2Btn
- property alias preset3Btn: preset3Btn
- property alias preset4Btn: preset4Btn
- property alias preset5Btn: preset5Btn
- property alias preset6Btn: preset6Btn
- property alias replayBtn: replayBtn
- property alias tuneBtn: tuneBtn
- property alias presetsBtn: presetsBtn
- property bool artShown: true
-
-
- TouchButton{
- id: sourceBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 140
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Source"
- }
-
- TouchButton{
- id: browseBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 180
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Browse"
- }
-
- TouchButton{
- id: albumInfoBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:130
- width: 130
- text: "Album"
- vis: false
-
- }
-
- FWdgtImage{
- id: stationLogoImg
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:70
- width: 130
- bitmap: ""
- }
-
- TouchButton{
- id: alertBtn
- anchors.top: albumInfoImg.bottom
- anchors.topMargin: 20
- anchors.left: albumInfoImg.left
- height:25
- width: 90
- text: "Alert"
- }
-
- BaseText{
- id: stationTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: -45
- anchors.left: trackTxt.left
- text: "Ch 22 / Pearl Jam Radio"
- }
-
- BaseText{
- id: trackTxt
- anchors.verticalCenter: albumInfoBtn.verticalCenter
- anchors.left: albumInfoBtn.right
- anchors.leftMargin: 15
- pxSize: 34
- text: "State of Love ..."
-
- }
-
- BaseText{
- id: artistTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: 45
- anchors.left: trackTxt.left
- text: "Pearl Jam"
- }
-
- TouchButton{
- id: preset1Btn
- anchors.top: fmLayout.top
- anchors.topMargin: 280
- anchors.left: browseBtn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset2Btn
- anchors.top: preset1Btn.bottom
- anchors.left: preset1Btn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset3Btn
- anchors.top: preset1Btn.top
- anchors.left: preset1Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset4Btn
- anchors.top: preset2Btn.top
- anchors.left: preset2Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset5Btn
- anchors.top: preset3Btn.top
- anchors.left: preset3Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset6Btn
- anchors.top: preset4Btn.top
- anchors.left: preset4Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: replayBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: 35
- anchors.left: fmLayout.left
- anchors.leftMargin: 725
- height:40
- width: 55
- text: "rply"
- }
-
- TouchButton{
- id: tuneBtn
- anchors.top: preset1Btn.top
- anchors.right: replayBtn.right
- height:40
- width: 120
- text: "tune"
- }
-
- TouchButton{
- id: presetsBtn
- anchors.bottom: preset6Btn.bottom
- anchors.right: replayBtn.right
- height:60
- width: 120
- text: "presets"
- }
-
- FViewUseCaseGroup{
- FViewUseCase{
- condition: dataPool.hasArt === 0
- PropertyChanges { target: albumInfoBtn; vis: false;}
- PropertyChanges { target: albumInfoImg; visible: false;}
- PropertyChanges { target: trackTxt; anchors.left: albumInfoBtn.left;}
- PropertyChanges { target: alertBtn; vis: false;}
- }
- FViewUseCase{
- condition: dataPool.hasArt === 1
- PropertyChanges { target: albumInfoBtn; vis: false;}
- PropertyChanges { target: albumInfoImg; visible: false;}
- PropertyChanges { target: trackTxt; anchors.left: albumInfoBtn.left;}
- PropertyChanges { target: alertBtn; vis: false;}
- }
- FViewUseCase{
- condition: dataPool.hasArt === 2
- PropertyChanges { target: albumInfoImg; visible: true;}
- PropertyChanges { target: albumInfoBtn; vis: true;}
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml
deleted file mode 100644
index fd211b3c97..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/FMLayoutPCA.qml
+++ /dev/null
@@ -1,152 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias tuneBtn: tuneBtn
- property alias hdBtn: hdBtn
- property alias stationTxt: stationTxt.text
- property alias freqId: freqId.text
- property alias listModel: thePresets.listModel
- property alias artist: artistTxt.text
- property alias curHD: hdBtn.curHD
- property alias totHD: hdBtn.totHD
- property alias curPreset: thePresets.currPreset
- property alias moving: thePresets.moving
- property alias direction: thePresets.direction
- property bool page1: true
-
-
-
-
-
- FWdgtImage{
- bitmap: "Radio/Ford-HMI-PCA-audio_fm_sirius.png"
- visible: false
- }
-
- TouchButton_PCA{
- id: sourceBtn
- x:25
- y:80
- textWidth: 100
- text: "FM Radio"
-
- }
-
- TouchButton_PCA{
- id: tuneBtn
- anchors.right: fmLayout.right
- anchors.rightMargin: 25
- y:80
- textWidth: 55
- text: "Tune"
-
- }
-
- BaseText{
- id: stationTxt
- x:25
- y:155
- pxSize: 45
- text: "96.3"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
-
- }
-
- BaseText{
- id: freqId
- anchors.left: stationTxt.right
- anchors.leftMargin: 5
- anchors.bottom: stationTxt.bottom
- anchors.bottomMargin: 4
- text: "FM"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
-
- }
-
- BaseText{
- id: trackTxt
- x:25
- y:212
- text: "So Far Around The Bend"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 22
-
-
- }
-
- BaseText{
- id: artistTxt
- x:25
- y:240
- text: "The National"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 22
- }
-
- TouchButtonSpecial_PCA{
- id: hdBtn
- x:25
- y:288
- textWidth: 120
- bitmap: "Radio/HD Logo.png"
- bitmap2: "Radio/HD Logo1.png"
- imageShift: -9
- spacing: 0
- text: " 1 "
- text1: "2"
- text2: " 3 4"
-
- }
-
- Rectangle{
- x:25
- y: 365
- height:1
- width: 750
- color: "#1d81d5"
- }
-
-
- PresetsGridPCA{
- id: thePresets
- x:0
- y:365
-
- }
-
- FWdgtImage{
- id: swipeIcon1
- bitmap: "Radio/whiteBall.png"
- x: 389
- y: 381
- }
-
- FWdgtImage{
- id: swipeIcon2
- bitmap: "Radio/blueBall.png"
- x: 404
- y: 381
- }
-
- FViewUseCaseSimple{condition: fmLayout.page1===false
- PropertyChanges{
- target: swipeIcon2; bitmap: "Radio/whiteBall.png"
- }
- PropertyChanges{
- target: swipeIcon1; bitmap: "Radio/blueBall.png"
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml b/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml
deleted file mode 100644
index 375f96894a..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/HomeLayout.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: home
- width: 800
- height: 480
-
- property alias button1: button1
- property alias button2: button2
- property alias button3: button3
- property alias button4: button4
-
-
-
-
- TouchButton{
- id: button1
- anchors.top: home.top
- anchors.left: home.left
- height:235
- width: 395
- text: "Button 1"
- }
-
- TouchButton{
- id: button2
- anchors.top: home.top
- anchors.right: home.right
- height:235
- width: 395
- text: "Button 2"
- }
-
- TouchButton{
- id: button3
- anchors.bottom: home.bottom
- anchors.left: home.left
- height:235
- width: 395
- text: "Button 3"
- }
-
- TouchButton{
- id: button4
- anchors.bottom: home.bottom
- anchors.right: home.right
- height:235
- width: 395
- text: "Button 4"
- }
-
- BaseText{
- id: title
- anchors.centerIn: home
- text: "Home"
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml b/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml
deleted file mode 100644
index 326d4feb0b..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/ListLayout.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-
-FLayout {
-
- id: theLayout
- width: 800
- height: 480
- x:10
- y:10
- property alias list : theListView
- property alias list_itemWidget: theListView.itemWidget
- property alias list_data: theListView.data
- Rectangle{
- anchors.fill:parent
- color:"white"
-
- }
-
-
- FWdgtListView {
-
- id: theListView
- anchors.fill: parent
- clip: true
-
- }
- FWdgtListView {
- x:400
- id: filteredListView
- clip: true
- data:filtermodel
- itemWidget:list_itemWidget
- width:100
- height:400
- }
- TextInput{
- text:"HelloWorld"
- x:200
- y:20
- onTextChanged: {
-
- if(text.length > 0 ) {
- dataPool.filter = text
- console.log(dataPool.filter)
-
- sortList.fillFilterModel(theListView.data)//Just backup original
- sortList.updateFilterModel(text)
-
- } else {
- sortList.fillFilterModel(theListView.data)
- }
- }
-
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml
deleted file mode 100644
index d0f240f4b9..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/NavInRouteLayout.qml
+++ /dev/null
@@ -1,130 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: mapLayout
- width: 800
- height: 480
-
- property alias zoomIn: zoomIn.touchBtn
- property alias zoomOut: zoomOut.touchBtn
- property alias compass: compass.touchBtn
- property alias cancel: cancel.touchBtn
- property alias mute: mute.touchBtn
- property alias muteSt: mute.selected
- property alias options: options.touchBtn
-
-
-
- FWdgtImage{
- id: mapImg
- bitmap: "Nav/Map.png"
- anchors.fill: mapLayout
- }
-
- TouchButtonClimatePCA{
- id: zoomIn
- text: "+"
- x:25
- y:103
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
-
- }
- TouchButtonClimatePCA{
- id: zoomOut
- text: "-"
- x:25
- y:223
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
- }
- TouchButtonClimatePCA{
- id: options
- x:659
- y:80
- image: "Nav/Options_9_9.png"
- imageActive: "Nav/OptionsInActive.png"
- imagePressed: "Nav/OptionsPressed_9_9.png"
- }
- TouchButtonClimatePCA{
- id: compass
- x:34
- y:352
- image: "Nav/compass.png"
- imageActive: "Nav/compass.png"
- imagePressed: "Nav/compass.png"
- }
- TouchButtonClimatePCA{
- id: mute
- x:25
- y:419
- image: "buttons/mute_9_9.png"
- imageActive: "buttons/muteActive.png"
- imagePressed: "buttons/mutePressed_9_9.png"
- imageInActive: "buttons/muteInActive.png"
- }
- FWdgtImage{
- bitmap: "Nav/turnArrow.png"
- x:97
- y:428
- }
- BaseText{
- text: "0.2 mi on Cherry Hill Rd."
- pxSize: 22
- x:144
- y:434
- color: "white"
- }
-
- BaseText{
- text: "2 hrs 27 min"
- pxSize: 22
- anchors.right: cancel.left
- anchors.rightMargin: 26
- horAlignment: Text.AlignRight
- y:434
- color: "white"
- }
-
- TouchButtonSpecial_PCA{
- id: cancel
- x:621
- y:419
- textWidth: 110
- bitmap: "Nav/destIcon.png"
- bitmap2: "Nav/destIconBlack.png"
- imageShift: -9
- spacing: 0
- text: " Cancel"
- text1: ""
- text2: ""
- totHD: -1
-
- }
- FWdgtImage{
- id: currStBkgrnd
- bitmap: "Nav/current street.png"
- x:265
- y:349
- }
-
- BaseText{
- id: currentStreet
- x:312
- y:360
- text: "East Capital St. NE"
- pxSize: 18
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignTop
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml
deleted file mode 100644
index 6c7a031175..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/NavKeyboardLayout.qml
+++ /dev/null
@@ -1,547 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: alphaLayout
- width: 800
- height: 480
- property alias list : theListView
- property alias list_itemWidget: theListView.itemWidget
- property alias list_data: theListView.data
-
- property alias a: aBtn.touchBtn
- property alias b: bBtn.touchBtn
- property alias c: cBtn.touchBtn
- property alias d: dBtn.touchBtn
- property alias e: eBtn.touchBtn
- property alias f: fBtn.touchBtn
- property alias g: gBtn.touchBtn
- property alias h: hBtn.touchBtn
- property alias i: iBtn.touchBtn
- property alias j: jBtn.touchBtn
- property alias k: kBtn.touchBtn
- property alias l: lBtn.touchBtn
- property alias m: mBtn.touchBtn
- property alias n: nBtn.touchBtn
- property alias o: oBtn.touchBtn
- property alias p: pBtn.touchBtn
- property alias q: qBtn.touchBtn
- property alias r: rBtn.touchBtn
- property alias s: sBtn.touchBtn
- property alias t: tBtn.touchBtn
- property alias u: uBtn.touchBtn
- property alias v: vBtn.touchBtn
- property alias w: wBtn.touchBtn
- property alias xB: xBtn.touchBtn
- property alias yB: yBtn.touchBtn
- property alias zB: zBtn.touchBtn
- property alias num: numBtn.touchBtn
- property alias sym: symBtn.touchBtn
- property alias del: delBtn.touchBtn
- property alias clr: clrBtn.touchBtn
- property alias space: spaceBtn.touchBtn
- property alias close: closeTouch
- property string entry: ""
- property alias go: goBtn.touchBtn
- property alias listOpen: listOpen
-
- FWdgtListView {
- id: theListView
- anchors.fill: parent
- clip: true
- visible:false
- }
-
- FWdgtListView {
- x:400
- id: filteredListView
- clip: true
- data:filtermodel
- itemWidget:list_itemWidget
- width:100
- height:400
- visible: true
- }
- TextInput{ //Little Trick for Update on List
- text:dataPool.navEnrty
- x:200
- y:20
- onTextChanged: {
-
- if(text.length > 0 ) {
- dataPool.filter = text
- console.log(dataPool.filter)
- sortList.fillFilterModel(theListView.data)//Just backup original
- sortList.updateFilterModel(text)
-
- } else {
- sortList.fillFilterModel(theListView.data)
- dataPool.navList1stItem=""
-
- }
-
-
- }
-
- }
- BaseText{
- id: navEntry
- x:25
- y:65
- text: entry
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 45
- color: "#1d81d5"
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignTop
- }
- BaseText{
- id: listFiltEntry
- x:25
- y:130
- color:"#1d81d5"
- text:dataPool.navList1stItem
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 45
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignTop
- }
- Rectangle{
- id:rect
- x:20
- y:120
- height: 60
- radius:10
- width:650
- color:"transparent"
- border.color: "#1d81d5"
- border.width: 1
- visible: false
- }
-
- FWdgtTouchArea{
- id: listOpen
- anchors.fill: rect
- enabled: rect.visible
- }
-
- TouchButton_PCA{
- id: goBtn
- x:690
- y:115
- textWidth: 40
- text: "Go"
-
- }
-
-
- TouchButtonClimatePCA{
- id: qBtn
- x:61
- y:211
- text: "Q"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: wBtn
- x:130
- y:211
- text: "W"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: eBtn
- x:199
- y:211
- text: "E"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: rBtn
- x:268
- y:211
- text: "R"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: tBtn
- x:337
- y:211
- text: "T"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: yBtn
- x:406
- y:211
- text: "Y"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: uBtn
- x:475
- y:211
- text: "U"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: iBtn
- x:544
- y:211
- text: "I"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: oBtn
- x:613
- y:211
- text: "O"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: pBtn
- x:682
- y:211
- text: "P"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: numBtn
- x:27
- y:272
- text: "123"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 22
- }
-
- TouchButtonClimatePCA{
- id: aBtn
- x:96
- y:272
- text: "A"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: sBtn
- x:165
- y:272
- text: "S"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: dBtn
- x:234
- y:272
- text: "D"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: fBtn
- x:303
- y:272
- text: "F"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: gBtn
- x:372
- y:272
- text: "G"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: hBtn
- x:441
- y:272
- text: "H"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: jBtn
- x:510
- y:272
- text: "J"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: kBtn
- x:579
- y:272
- text: "K"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: lBtn
- x:648
- y:272
- text: "L"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: delBtn
- x:717
- y:272
- bitmap: "Nav/deleteIcon.png"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- }
-
- TouchButtonClimatePCA{
- id: symBtn
- x:61
- y:333
- text: "!@#"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 22
- }
-
- TouchButtonClimatePCA{
- id: zBtn
- x:130
- y:333
- text: "Z"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: xBtn
- x:199
- y:333
- text: "X"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: cBtn
- x:268
- y:333
- text: "C"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: vBtn
- x:337
- y:333
- text: "V"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: bBtn
- x:406
- y:333
- text: "B"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: nBtn
- x:475
- y:333
- text: "N"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: mBtn
- x:544
- y:333
- text: "M"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- txtSize: 30
- }
-
- TouchButtonClimatePCA{
- id: clrBtn
- x:613
- y:333
- text: "Clear"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- newFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- txtSize: 16
- }
-
- TouchButtonClimatePCA{
- id: spaceBtn
- x:682
- y:333
- text: "Space"
- image: "buttons/key_9_9.png"
- imagePressed: "buttons/keyPressed_9_9.png"
- imageActive: "buttons/keySelected.png"
- imageInActive: "buttons/keySelected.png"
- newFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- txtSize: 16
- }
-
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: alphaLayout.horizontalCenter
- }
-
- FViewUseCase{condition: closeTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: closeTxt; color: "white"
- }
- }
-
- FViewUseCaseSimple{condition: listFiltEntry.text !== ""
- PropertyChanges {
- target: rect; visible: true
- }
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml b/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml
deleted file mode 100644
index 7c65e911a7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/NavNoRouteLayout.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: mapLayout
- width: 800
- height: 480
-
- property alias zoomIn: zoomIn.touchBtn
- property alias zoomOut: zoomOut.touchBtn
- property alias compass: compass.touchBtn
- property alias destSearch: destSearch.touchBtn
- property alias options: options.touchBtn
-
-
-
- FWdgtImage{
- id: mapImg
- bitmap: "Nav/Map.png"
- anchors.fill: mapLayout
- }
-
- TouchButtonClimatePCA{
- id: zoomIn
- text: "+"
- x:25
- y:103
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
-
- }
- TouchButtonClimatePCA{
- id: zoomOut
- text: "-"
- x:25
- y:223
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
- }
- TouchButtonClimatePCA{
- id: options
- x:659
- y:80
- image: "Nav/Options_9_9.png"
- imageActive: "Nav/OptionsInActive.png"
- imagePressed: "Nav/OptionsPressed_9_9.png"
- }
- TouchButtonClimatePCA{
- id: compass
- x:34
- y:352
- image: "Nav/compass.png"
- imageActive: "Nav/compass.png"
- imagePressed: "Nav/compass.png"
- }
- TouchButtonSpecial_PCA{
- id: destSearch
- x:601
- y:419
- textWidth: 130
- bitmap: "Nav/destIcon.png"
- bitmap2: "Nav/destIconBlack.png"
- imageShift: -9
- spacing: 0
- text: " Destination"
- text1: ""
- text2: ""
- totHD: -1
-
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml b/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml
deleted file mode 100644
index f5cc5d57a6..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/OffLayout.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FLayout {
- width: 800
- height: 480
-
- property alias offTouch: offTouch
-
- Rectangle {
- id: bk
- anchors.fill: parent
- color: "black"
- }
-
- FWdgtTouchArea{
- id: offTouch
- anchors.fill: bk
- }
-
-/* RectangularGlow {
- id: effect
- anchors.fill: rect
- glowRadius: 4
- spread: 0.7
- color: "#1d81d5"
- cornerRadius: rect.radius //+ glowRadius
- }
-
- Rectangle {
- id: rect
- color: "black"
- x:40
- y:40
- width: 160
- height: 45
- radius: 23
- border.width: 1
- border.color: "#1d81d5"
- }
-
- FWdgtImage{
- id: img
- x:40
- y:90
- bitmap: "OButton.png"
- }
-
- FWdgtImage{
- id: img
- x:40
- y:40
- bitmap: "Radio/ButtonEnd_8_8.png"
- }
-
- FWdgtImage{
- id: img1
- anchors.left: img.right
- anchors.top: img.top
- width:2
- fillMode: Image.Stretch
- bitmap: "Radio/ButtonCenter_0_8.png"
- }
-
- FWdgtImage{
- id: img2
- anchors.left: img1.right
- anchors.top: img1.top
- bitmap: "Radio/ButtonOtherEnd_8_8.png"
- }*/
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml b/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml
deleted file mode 100644
index 1236ea4201..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/PCAstatusBarLayout.qml
+++ /dev/null
@@ -1,123 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: statusLayout
- width: 800
- height: 480
-
- property alias menuTouch: menuTouch
-
- Rectangle{
- id: ln1
- anchors.horizontalCenter: statusLayout.horizontalCenter
- y:15
- height:1
- width: 14
- color: "#1d81d5"
- }
- Rectangle{
- id: ln2
- anchors.horizontalCenter: statusLayout.horizontalCenter
- y:19
- height:1
- width: 14
- color: "#1d81d5"
- }
- Rectangle{
- id: ln3
- anchors.horizontalCenter: statusLayout.horizontalCenter
- y:23
- height:1
- width: 14
- color: "#1d81d5"
- }
-
-
-
- BaseText{
- id: menuTxt
- anchors.horizontalCenter: statusLayout.horizontalCenter
- anchors.bottom: statusLayout.top
- anchors.bottomMargin: -50
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignBottom
- text: "MENU"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
-
- }
-
- BaseText{
- id: tempTxt
- x:25
- anchors.bottom: statusLayout.top
- anchors.bottomMargin: -50
- horAlignment: Text.AlignLeft
- vertAlignment: Text.AlignBottom
- text: "75" + "\xBA"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 28
-
-
- }
-
- BaseText{
- id: clockTxt
- anchors.right: statusLayout.right
- anchors.rightMargin: 25
- anchors.bottom: statusLayout.top
- anchors.bottomMargin: -50
- horAlignment: Text.AlignRight
- vertAlignment: Text.AlignBottom
- text: "12:45"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- pxSize: 28
- }
-
- FWdgtTouchArea{
- id: menuTouch
- height: 75
- width: 80
- y:0
- anchors.horizontalCenter: statusLayout.horizontalCenter
- }
-
- FViewUseCase{condition: menuTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: ln1; color: "white"
- }
- PropertyChanges {
- target: ln2; color: "white"
- }
- PropertyChanges {
- target: ln3; color: "white"
- }
- PropertyChanges {
- target: menuTxt; color: "white"
- }
- }
-
- FViewUseCase{
- condition: dataPool.mainPCAmenuShown ===true
- PropertyChanges {
- target: ln1; visible: false
- }
- PropertyChanges {
- target: ln2; visible: false
- }
- PropertyChanges {
- target: ln3; visible: false
- }
- PropertyChanges {
- target: menuTxt; visible: false
- }
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml b/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml
deleted file mode 100644
index 9e119d9900..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/PhoneContactsLayout.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-
-FLayout {
-
- id: theLayout
- width: 800
- height: 480
-
- property alias list : theListPhoneView
- property alias list_itemWidget: theListPhoneView.itemWidget
- property alias list_data: theListPhoneView.data
- property alias back: back.touchBtn
- TouchButtonClimatePCA{
- id: back
- text: "+"
- x:25
- y:80
- image: "buttons/zoom_9_9.png"
- imageActive: "buttons/zoomSelected.png"
- imagePressed: "buttons/zoomPressed_9_9.png"
- txtColor: "white"
- txtSize: 40
- visible: false
-
- }
- FWdgtListView {
-
- width:600
- height:400
- id: theListPhoneView
- x:150
- y:80
- clip: true
- visible:true
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml b/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml
deleted file mode 100644
index e275c055a7..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/SiriusLayout.qml
+++ /dev/null
@@ -1,195 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias albumInfoBtn: albumInfoBtn
- property alias albumInfoImg: stationLogoImg
- property alias stationTxt: stationTxt
- property alias trackTxt: trackTxt
- property alias artistTxt: artistTxt
- property alias alertBtn: alertBtn
- property alias preset1Btn: preset1Btn
- property alias preset2Btn: preset2Btn
- property alias preset3Btn: preset3Btn
- property alias preset4Btn: preset4Btn
- property alias preset5Btn: preset5Btn
- property alias preset6Btn: preset6Btn
- property alias replayBtn: replayBtn
- property alias tuneBtn: tuneBtn
- property alias presetsBtn: presetsBtn
-
-
- TouchButton{
- id: sourceBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 140
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Source"
- }
-
- TouchButton{
- id: browseBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 180
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Browse"
- }
-
- TouchButton{
- id: albumInfoBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:130
- width: 130
- text: "Album"
- vis: false
-
- }
-
- FWdgtImage{
- id: stationLogoImg
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:70
- width: 130
- bitmap: ""
- }
-
- TouchButton{
- id: alertBtn
- anchors.top: albumInfoImg.bottom
- anchors.topMargin: 20
- anchors.left: albumInfoImg.left
- height:25
- width: 90
- text: "Alert"
- }
-
- BaseText{
- id: stationTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: -45
- anchors.left: trackTxt.left
- text: "Ch 22 / Pearl Jam Radio"
- }
-
- BaseText{
- id: trackTxt
- anchors.verticalCenter: albumInfoBtn.verticalCenter
- anchors.left: albumInfoBtn.right
- anchors.leftMargin: 15
- pxSize: 34
- text: "State of Love ..."
-
- }
-
- BaseText{
- id: artistTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: 45
- anchors.left: trackTxt.left
- text: "Pearl Jam"
- }
-
- TouchButton{
- id: preset1Btn
- anchors.top: fmLayout.top
- anchors.topMargin: 280
- anchors.left: browseBtn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset2Btn
- anchors.top: preset1Btn.bottom
- anchors.left: preset1Btn.left
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset3Btn
- anchors.top: preset1Btn.top
- anchors.left: preset1Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset4Btn
- anchors.top: preset2Btn.top
- anchors.left: preset2Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset5Btn
- anchors.top: preset3Btn.top
- anchors.left: preset3Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: preset6Btn
- anchors.top: preset4Btn.top
- anchors.left: preset4Btn.right
- height:60
- width: 208
- text: "WWWWWWWW"
- }
-
- TouchButton{
- id: replayBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: 35
- anchors.left: fmLayout.left
- anchors.leftMargin: 725
- height:40
- width: 55
- text: "rply"
- }
-
- TouchButton{
- id: tuneBtn
- anchors.top: preset1Btn.top
- anchors.right: replayBtn.right
- height:40
- width: 120
- text: "tune"
- }
-
- TouchButton{
- id: presetsBtn
- anchors.bottom: preset6Btn.bottom
- anchors.right: replayBtn.right
- height:60
- width: 120
- text: "presets"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml b/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml
deleted file mode 100644
index 3968438447..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/StartLayout.qml
+++ /dev/null
@@ -1,30 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: chrome
- width: 800
- height: 480
-
- //property alias bg: _bg
- //property alias btnIndicatorState: button1.indicatorState
- property alias button1: button1
-
-
-
-
- BaseText{
- id: title
- anchors.centerIn: chrome
- text: "Chrome"
- }
-
- TouchButton{
- id: button1
- anchors.top: title.bottom
- anchors.horizontalCenter: title.horizontalCenter
- text: "Button 1"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml b/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml
deleted file mode 100644
index d898a0c07f..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TC1_B1_Grid.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- width: 800
- height: 480
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
-
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
-
- GridViewWidget {
- id: listView
- x: 135; y: 170
- width: 530; height: 200
- gridItemHeight: 100; gridItemWidth: 180
-
- }
-
- FWdgtContainer {
- id: m1
- width: 530; height: 55
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml
deleted file mode 100644
index a1a0d32538..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TileBackImgLayoutPCA.qml
+++ /dev/null
@@ -1,76 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: layout
- width: 800
- height: 480
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
- property alias theX: listView.x
- property alias theY: listView.y
- property alias theWidth: listView.width
- property alias theHeight: listView.height
- property alias itemWidth: listView.gridItemWidth
- property alias itemHeight: listView.gridItemHeight
- property alias close: closeTouch
- property bool useClose: false
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
-
-
- GridViewWidget {
- id: listView
- x: 0; y: 75
- width: 800; height: 356
- gridItemHeight: 178; gridItemWidth: 200
-
- }
-
- FWdgtContainer {
- id: m1
- width: 530; height: 55
- }
- }
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: layout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- visible: useClose
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: layout.horizontalCenter
- visible: useClose
- enabled: useClose
- }
-
- FViewUseCase{condition: closeTouch.pressed === true
- //FActScriptCall { onScript: { FLogger.debug("Test color should change") } }
- PropertyChanges {
- target: closeTxt; color: "white"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml
deleted file mode 100644
index 0aed708e35..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TileBackLayout.qml
+++ /dev/null
@@ -1,107 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: tileLayout
- width: 800
- height: 480
-
- property alias button1: button1
- property alias button2: button2
- property alias button3: button3
- property alias button4: button4
- property alias button5: button5
- property alias button6: button6
- property alias button7: button7
- property alias button8: button8
- property alias backBtn: backBtn
-
-
-
- Grid {
- id: theGrid
- flow: Grid.TopToBottom
- anchors.top: tileLayout.top
- anchors.topMargin: 130
- anchors.horizontalCenter: tileLayout.horizontalCenter
- anchors.leftMargin: 100
- columns: 4
- spacing: 20
- TouchButton{
- id: button1
- height:125
- width: 135
- text: "Button 1"
- }
-
- TouchButton{
- id: button2
- height:125
- width: 135
- text: "Button 2"
- }
-
- TouchButton{
- id: button3
- height:125
- width: 135
- text: "Button 3"
- }
-
- TouchButton{
- id: button4
- height:125
- width: 135
- text: "Button 4"
- }
-
- TouchButton{
- id: button5
- height:125
- width: 135
- text: "Button 5"
- }
-
- TouchButton{
- id: button6
- height:125
- width: 135
- text: "Button 6"
- }
-
- TouchButton{
- id: button7
- height:125
- width: 135
- text: "Button 7"
- }
-
- TouchButton{
- id: button8
- height:125
- width: 135
- text: "Button 8"
- }
- }
-
-
-
- BaseText{
- id: title
- anchors.top: tileLayout.top
- anchors.topMargin: 80
- anchors.horizontalCenter: tileLayout.horizontalCenter
- text: "Select a Source"
- }
-
- TouchButton{
- id: backBtn
- anchors.verticalCenter: title.verticalCenter
- anchors.left: tileLayout.left
- anchors.leftMargin: 20
- height:40
- width: 60
- text: "<"
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml
deleted file mode 100644
index bc7545b6fd..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/TileBackLayoutPCA.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: layout
- width: 800
- height: 480
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
- property alias theX: listView.x
- property alias theY: listView.y
- property alias theWidth: listView.width
- property alias theHeight: listView.height
- property alias itemWidth: listView.gridItemWidth
- property alias itemHeight: listView.gridItemHeight
- property alias close: closeTouch
- property bool useClose: true
-
-
-
-
- Item {
- id: _fg
-
- width: 800; height: 480
-
- GridViewWidget {
- id: listView
- x: 130; y: 170
- width: 540; height: 200
- gridItemHeight: 100; gridItemWidth: 180
-
- }
-
- FWdgtContainer {
- id: m1
- width: 530; height: 55
- }
-
-
- }
-
- BaseText{
- id: closeTxt
- anchors.horizontalCenter: layout.horizontalCenter
- y:430
- horAlignment: Text.AlignHCenter
- vertAlignment: Text.AlignTop
- text: "CLOSE"
- color: "#1d81d5"
- pxSize: 22
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- visible: useClose
-
- }
-
- FWdgtTouchArea{
- id: closeTouch
- height: 75
- width: 750
- y:430
- anchors.horizontalCenter: layout.horizontalCenter
- visible: useClose
- enabled: useClose
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml b/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml
deleted file mode 100644
index 178fe6fc1a..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/USBLayout.qml
+++ /dev/null
@@ -1,132 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias albumInfoBtn: albumInfoBtn
- property alias stationTxt: stationTxt
- property alias trackTxt: trackTxt
- property alias artistTxt: artistTxt
- property alias seekBkBtn: seekBkBtn
- property alias playBtn: playBtn
- property alias seekFdBtn: seekFdBtn
- property alias repeatBtn: repeatBtn
- property alias shuffleBtn: shuffleBtn
-
-
- TouchButton{
- id: sourceBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 140
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Source"
- }
-
- TouchButton{
- id: browseBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 290
- anchors.left: fmLayout.left
- anchors.leftMargin: 10
- height:25
- width: 130
- text: "Browse"
- }
-
- TouchButton{
- id: albumInfoBtn
- anchors.top: fmLayout.top
- anchors.topMargin: 95
- anchors.left: fmLayout.left
- anchors.leftMargin: 190
- height:130
- width: 130
- text: "Album"
- }
-
- BaseText{
- id: stationTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: -45
- anchors.left: trackTxt.left
- text: "Ch 22 / Pearl Jam Radio"
- }
-
- BaseText{
- id: trackTxt
- anchors.verticalCenter: albumInfoBtn.verticalCenter
- anchors.left: albumInfoBtn.right
- anchors.leftMargin: 15
- pxSize: 34
- text: "State of Love ..."
-
- }
-
- BaseText{
- id: artistTxt
- anchors.verticalCenter: trackTxt.verticalCenter
- anchors.verticalCenterOffset: 45
- anchors.left: trackTxt.left
- text: "Pearl Jam"
- }
-
- TouchButton{
- id: seekBkBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.horizontalCenter: playBtn.horizontalCenter
- anchors.horizontalCenterOffset: -150
- height:100
- width: 100
- text: "<<"
- }
-
- TouchButton{
- id: playBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.horizontalCenter: fmLayout.horizontalCenter
- height:120
- width: 120
- text: "||"
- }
-
- TouchButton{
- id: seekFdBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.horizontalCenter: playBtn.horizontalCenter
- anchors.horizontalCenterOffset: 150
- height:100
- width: 100
- text: ">>"
- }
-
- TouchButton{
- id: repeatBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: -35
- anchors.left: fmLayout.left
- anchors.leftMargin: 670
- height:40
- width: 55
- text: "rpt"
- }
-
- TouchButton{
- id: shuffleBtn
- anchors.verticalCenter: browseBtn.verticalCenter
- anchors.verticalCenterOffset: 35
- anchors.left: repeatBtn.left
- height:40
- width: 55
- text: "sfl"
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml b/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml
deleted file mode 100644
index d82077b555..0000000000
--- a/src/components/qt_hmi/References/Look/Layouts/USBLayoutPCA.qml
+++ /dev/null
@@ -1,155 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: fmLayout
- width: 800
- height: 480
-
- property alias sourceBtn: sourceBtn
- property alias browseBtn: browseBtn
- property alias trackNumTxt: trackNumTxt.text
- property alias artist: artistTxt.text
- property alias play: play.touchBtn
- property alias pause: pause.touchBtn
- property bool playing: true
-
-
-
-
- FWdgtImage{
- id: albumArt
- x:25
- y:176
- bitmap: "USB/albumArt.png"
- }
-
- TouchButton_PCA{
- id: sourceBtn
- x:25
- y:80
- textWidth: 100
- text: "FM Radio"
-
- }
-
- TouchButton_PCA{
- id: browseBtn
- anchors.right: fmLayout.right
- anchors.rightMargin: 25
- y:80
- textWidth: 75
- text: "Browse"
-
- }
-
- BaseText{
- id: trackNumTxt
- x:181
- y:188
- pxSize: 22
- text: "Track 13/ 16"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTCom-Lt.ttf"
-
- }
-
- BaseText{
- id: trackTxt
- x:181
- y:225
- text: "The Dog Days Are Over"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 45
-
-
- }
-
- BaseText{
- id: artistTxt
- x:181
- y:280
- text: "Florence and the Machine"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 22
- }
-
-
- TouchButtonClimatePCA{
- id: play
- x:367
- y:390
- image: "USB/play_9_9.png"
- imagePressed: "USB/playPressed_9_9.png"
- visible: playing
- enabled: playing
- }
-
- TouchButtonClimatePCA{
- id: pause
- x:367
- y:390
- image: "USB/pause_9_9.png"
- imagePressed: "USB/pausePressed_9_9.png"
- visible: !playing
- enabled: !playing
- }
-
- TouchButtonClimatePCA{
- id: seekBack
- x:287
- y:399
- image: "USB/Prev_9_9.png"
- imagePressed: "USB/PrevPressed_9_9.png"
- }
-
- TouchButtonClimatePCA{
- id: seekNext
- x:463
- y:399
- image: "USB/Next_9_9.png"
- imagePressed: "USB/NextPressed_9_9.png"
- }
-
- Rectangle{
- x:92
- y: 365
- height:1
- width: 616
- color: "#1d81d5"
- }
-
- Rectangle{
- x:92
- y: 365
- height:1
- width: 138
- color: "white"
- }
-
- BaseText{
- id: elapsedTime
- x:25
- y:358
- text: "02:36"
- color: "white"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 18
- }
-
- BaseText{
- id: totTime
- y:358
- anchors.right: fmLayout.right
- anchors.rightMargin: 25
- horAlignment: Text.AlignRight
- text: "04:23"
- color: "#1d81d5"
- theFont: "../Fonts/HelveticaNeueLTStd-Md.ttf"
- pxSize: 18
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml
deleted file mode 100644
index 22e408c716..0000000000
--- a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qml
+++ /dev/null
@@ -1,373 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "Models"
-import "Widgets"
-import "Styles"
-
-Rectangle {
- width: 1360
- height: 768
- color: "black"
-
- // global events
- FEvent { id: cornerClicked }
- FEvent { id: closeNormalScreens }
-
- //global timers
- FTimer {id: testTimer; interval: 5000; repeat: false}
-
- // global datapools
- FDataPool {
- id: dataPool
-
- property string version: "V1.0.0"
- property string currSource: "FM"
- property string currStation: "91.9"
- property string currStatText: "WUOM"
- property string currSong: "Fresh Air"
- property string currAlbumArt: "album artRazorFish.png"
- property int layout: 2 //AM/FM:0, AMhd:1, FMhd:2, Sirius:3, USB:4, BT:5
- property int currFMpreset: 2
- property int currAMpreset: 1
- property int currSATpreset: 3
- property string curStationDT: ""
- property int statusBarChange: 0
- property int curFanSpeed: 1
- property int drvTemp: 70
- property int passTemp: 70
-
- property bool mainPCAmenuShown: false
-
-
- property string fm1pre1: "101.1"
- property string fm1pre2: "97.1"
- property string fm1pre3: "94.7"
- property string fm1pre4: "91.7"
- property string fm1pre5: "101.9"
- property string fm1pre6: "88.7"
-
- property string fm1stat1: "WRIF"
- property string fm1stat2: "WXYT"
- property string fm1stat3: "WCSX"
- property string fm1stat4: "WUOM"
- property string fm1stat5: "WDET"
- property string fm1stat6: "CIMX"
-
- property string fm1song1: "Ace of Spades"
- property string fm1song2: "Sports Talk"
- property string fm1song3: "Born to Run"
- property string fm1song4: "Fresh Air"
- property string fm1song5: "The Craig Fahle Show"
- property string fm1song6: "State of Love and Trust"
-
- property string fm2pre1: "101.1"
- property string fm2pre2: "97.1"
- property string fm2pre3: "94.7"
- property string fm2pre4: "91.7"
- property string fm2pre5: "101.9"
- property string fm2pre6: "88.7"
-
- property string fm2stat1: "WRIF"
- property string fm2stat2: "WXYT"
- property string fm2stat3: "WCSX"
- property string fm2stat4: "WUOM"
- property string fm2stat5: "WDET"
- property string fm2stat6: "CIMX"
-
- property string fm2song1: "Ace of Spades"
- property string fm2song2: "Sports Talk"
- property string fm2song3: "Born to Run"
- property string fm2song4: "Fresh Air"
- property string fm2song5: "The Craig Fahle Show"
- property string fm2song6: "State of Love and Trust"
-
- property string fm3pre1: "101.1"
- property string fm3pre2: "97.1"
- property string fm3pre3: "94.7"
- property string fm3pre4: "91.7"
- property string fm3pre5: "101.9"
- property string fm3pre6: "88.7"
-
- property string fm3stat1: "WRIF"
- property string fm3stat2: "WXYT"
- property string fm3stat3: "WCSX"
- property string fm3stat4: "WUOM"
- property string fm3stat5: "WDET"
- property string fm3stat6: "CIMX"
-
- property string fm3song1: "Ace of Spades"
- property string fm3song2: "Sports Talk"
- property string fm3song3: "Born to Run"
- property string fm3song4: "Fresh Air"
- property string fm3song5: "The Craig Fahle Show"
- property string fm3song6: "State of Love and Trust"
-
-
- /*List Filtered Variables*/
- property string navEnrty:""
- property string filter: ""
- property variant uniqueChars: undefined
- property string navList1stItem:""
- property string filterPhone:""
- }
-
- // global conditions
- FConditionPool {
- id: condPool
-
- property bool amfmActiveSource: true
- property bool settingsOpen: false
- property bool dualBtnSt: true
- property bool drvHeatSeatSt: false
- property bool drvCoolSeatSt: false
- property bool passCoolSeatSt: false
- property bool passHeatSeatSt: false
- property bool heatWheelSt: false
- property bool heatWinSheildSt: true
- property bool defrostSt: true
- property bool pannelSt: false
- property bool floorSt: false
-
- property bool showMenu: true
-
- }
-
-
- Component.onCompleted: {
- FThemeProvider.resourcePath = Qt.resolvedUrl("Resources");
- FThemeProvider.theme = "Theme1";
-
-
- }
- property QtObject filtermodel: ListModel {
- ListElement { staticItem: "Five Guys" }
- ListElement { staticItem: "Archers Of Loaf" }
- ListElement { staticItem: "Bob Mould" }
- ListElement { staticItem: "Cat Power" }
- ListElement { staticItem: "Cloud Nothings"}
- ListElement { staticItem: "Dentist"}
- ListElement { staticItem: "Dirty Frank's" }
- ListElement { staticItem: "Grouplove" }
- ListElement { staticItem: "Hudson Bell"}
- ListElement { staticItem: "Japandroids" }
- ListElement { staticItem: "Macklemore & Ryan Lewis"}
- ListElement { staticItem: "The National"}
- ListElement { staticItem: "Titus Andronicus" }
- ListElement { staticItem: "Tito" }
- ListElement { staticItem: "Tamal" }
- ListElement { staticItem: "Taco" }
- }
-
- QtObject{
- id:sortList
-
- //Check if char exist on Phone DataModel
- function existChar(model, character){
- //console.log(model.get(3).staticItem.charAt(0).toLowerCase())
- for (var i = 0; i < model.count; i++) {
- var u =model.get(i).staticItem.charAt(0).toLowerCase()
- if (character=== u){
- console.log(i)
- return i;
- }
-
- }
-
- }
-
- // Check whether given character exists in array
- function exist(array, character) {
- console.log(array[0]);
- for (var i = 0; i < array.length; i++) {
-
- if (array[i] == character) return true;
- }
- return false;
- }
-
- // Check whether given filter matches the string (e.g. "ce" would match "Cecilia")
- // The check is case-insensitive
- function checkFilter(filter, string) {
- if (filter.length > string.length) return false;
-
- var filterlower = filter.toLowerCase();
- var stringlower = string.toLowerCase();
-
- for (var i = 0; i < filter.length; i++) {
- if (filterlower[i] != stringlower[i])
- return false;
- }
-
- return true;
- }
-
- // Updates the filtermodel based on the current filter
- function updateFilterModel(name) {
- if (dataPool.filter.length > 0) {
- for (var i = filtermodel.count-1; i >= 0; i--) {
- if (!checkFilter(dataPool.filter, filtermodel.get(i).staticItem))
- filtermodel.remove(i)
- }
- }
-
- updateUniqueChars()
- }
-
- // Updates the array of unique first letters in the current index of the model
- function updateUniqueChars() {
-
- if (filtermodel.get(0) === undefined)
- {
- dataPool.navList1stItem=""
- return;
-
- }
-
- var characters = new Array();
-
- // If filter model has at most 1 item in it, no point in going
- // any further with filtering
- dataPool.navList1stItem=filtermodel.get(0).staticItem
- if (filtermodel.count > 1) {
-
- for (var i = 0; i < filtermodel.count; i++) {
- var name = filtermodel.get(i).staticItem;
-
- if (!exist(characters, name[dataPool.filter.length])) {
- characters.push(name[dataPool.filter.length])
- }
- }
-
- characters.sort()
-
-
- }
-
-
- dataPool.uniqueChars = characters
-
- }
-
-
- // Fills the filtermodel with contents from the source list's model
- function fillFilterModel(fullModel) {
- if (fullModel === undefined) return;
- filtermodel.clear();
- for (var i = 0; i < fullModel.count; i++) {
- filtermodel.append(fullModel.get(i))
- }
-
- }
-
- }
-
- FDisplay {
-
- /* modelPath:Qt.resolvedUrl(".")
- id: display
- //activeVariant: "ClassicTop"
- //activeVariant: "ClassicBottom"
- //activeVariant: "Tangier"
- viewCacheSize:0
-
- //width: 800
- //height: 480
-// xPixel: 800
-// yPixel: 480
- anchors.fill: parent
-// anchors { left: parent.left; top: parent.top;}
-
- priorityLayerCount: 9
- //initialView: "AutocompleteList"
- initialView: "Off"*/
-
-
-
- modelPath:Qt.resolvedUrl(".")
- id: display
- //activeVariant: "ClassicTop"
- //activeVariant: "ClassicBottom"
- //activeVariant: "Tangier"
- viewCacheSize:0
-
-
- width: 800
- height: 480
-
- xPixel: 800
- yPixel: 480
-
- anchors {
- horizontalCenter: parent.horizontalCenter;
- verticalCenter: parent.verticalCenter;
- verticalCenterOffset: 55
- }
-
- priorityLayerCount: 9
- initialView: "Off"
- //initialView: "NavTilesView"
- }
-
- Item
- {
- id: fHardwareKeybezel1
- width: 800
- height: 375
- x:10
- y:500
-
- // function keys
- TextHardkey {
- id: hk_OnOff
- width: 100
- height: 50
- anchors.left: parent.left
- anchors.leftMargin: 0
- anchors.top: parent.top
- anchors.topMargin: 0
- label: "On/Off"
- }
-
- BaseText {
- id: info
- text: dataPool.version
- color: "black"
- anchors.top: hk_OnOff.top
- anchors.left: hk_OnOff.right
- anchors.leftMargin: 20
- }
-
-
- FHardwareKey {
- id: buttonUp
- hardwareControlID: "buttonUp"
- //commName: "buttonBack"
-
- x:0
- y:0
- width: 60
- height:25
-
-
- keyboardKey: Qt.Key_Up
- visible: false
- }
-
- FHardwareKey {
- id: buttonDown
- hardwareControlID: "buttonDown"
- //commName: "buttonBack"
-
- x:0
- y:0
- width: 60
- height:25
-
-
- keyboardKey: Qt.Key_Down
- visible: false
- }
-
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject b/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject
deleted file mode 100644
index e9402cbac7..0000000000
--- a/src/components/qt_hmi/References/Look/PCA_HMI_v1_0.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-/* File generated by Qt Creator, version 2.6.1 */
-
-import QmlProject 1.1
-
-Project {
- mainFile: "PCA_HMI_v1_0.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [ "plugins" ]
-}
diff --git a/src/components/qt_hmi/References/Look/Resources/CButton.png b/src/components/qt_hmi/References/Look/Resources/CButton.png
deleted file mode 100644
index aeebdb64ca..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/CButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd b/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd
deleted file mode 100644
index 982bd5882c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Ford-HMI-PCA-phone_contacts.psd
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png b/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png
deleted file mode 100644
index 805236eaf6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/HierarchicalListBG.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/Map.png b/src/components/qt_hmi/References/Look/Resources/Nav/Map.png
deleted file mode 100644
index 4b39af9b22..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/Map.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png
deleted file mode 100644
index 601b242bbe..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsInActive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png
deleted file mode 100644
index 42c352a7e8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/OptionsPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png b/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png
deleted file mode 100644
index 46887f1061..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/Options_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/compass.png b/src/components/qt_hmi/References/Look/Resources/Nav/compass.png
deleted file mode 100644
index b78041307b..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/compass.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png
deleted file mode 100644
index 826b5faacf..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png b/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png
deleted file mode 100644
index 56e35c759b..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/deleteIconBlack.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png b/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png
deleted file mode 100644
index dadcfe25cf..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/destIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png b/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png
deleted file mode 100644
index 75c99bc4aa..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/destIconBlack.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png b/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png
deleted file mode 100644
index f37731f5af..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Nav/turnArrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/OButton.png b/src/components/qt_hmi/References/Look/Resources/OButton.png
deleted file mode 100644
index 2811770953..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/OButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png
deleted file mode 100644
index 9933dbcc72..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonCenter_0_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png
deleted file mode 100644
index 672e57bf39..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonEnd_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png
deleted file mode 100644
index cc9cb83ede..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/ButtonOtherEnd_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png b/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png
deleted file mode 100644
index efe0b7b586..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/Ford-HMI-PCA-audio_fm_sirius.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png
deleted file mode 100644
index 6ed0293aab..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/HDBtn_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png
deleted file mode 100644
index 375195bec3..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/SourceBtn_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png b/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png
deleted file mode 100644
index 99f5e90c3d..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/TuneBtn_8_8.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png b/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png
deleted file mode 100644
index d4db3f96ae..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/blueBall.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png b/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png
deleted file mode 100644
index 1422e00b42..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/menuIcon_2_2.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png b/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png
deleted file mode 100644
index 3c1cad7c33..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/perlJamIcon_0_0.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png b/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png
deleted file mode 100644
index 952714ebe6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Radio/whiteBall.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png
deleted file mode 100644
index aab3df8914..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/NextPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png
deleted file mode 100644
index c432068d4a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/Next_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png
deleted file mode 100644
index c6eefc09c9..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/PrevPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png
deleted file mode 100644
index acc2a71de3..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/Prev_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png b/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png
deleted file mode 100644
index 9000680276..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/albumArt.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pause.png b/src/components/qt_hmi/References/Look/Resources/USB/pause.png
deleted file mode 100644
index 71a7574d25..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/pause.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png
deleted file mode 100644
index a26cf2e4ea..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/pausePressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png
deleted file mode 100644
index 417bdbf248..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/pause_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png
deleted file mode 100644
index ecbb4f2ef0..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/playPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png b/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png
deleted file mode 100644
index f185e94461..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/USB/play_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png
deleted file mode 100644
index 94d5d44b5a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/cal.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png
deleted file mode 100644
index c5985043df..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/folders.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png
deleted file mode 100644
index a8e5d9d66c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/key_car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png b/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png
deleted file mode 100644
index 6424d9d210..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/Vehicle/sun.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png
deleted file mode 100644
index b0f8863423..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/keyPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png
deleted file mode 100644
index d264e201ad..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/keySelected.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png
deleted file mode 100644
index 3add8dd21c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/key_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png b/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png
deleted file mode 100644
index e14b9fb751..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/muteActive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png b/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png
deleted file mode 100644
index a2c1cb831a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/muteInActive.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png
deleted file mode 100644
index 9a9ae59346..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/mutePressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png
deleted file mode 100644
index f7306d96ae..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/mute_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png
deleted file mode 100644
index fd7606fbd6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/presetPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png
deleted file mode 100644
index 2b567e237e..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/presetSelected.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png
deleted file mode 100644
index 58c296a4e4..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/preset_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png
deleted file mode 100644
index c67d2c7c55..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/zoomPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png
deleted file mode 100644
index 36bba93d8c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/zoomSelected.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png b/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png
deleted file mode 100644
index 0df4d25109..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/buttons/zoom_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png
deleted file mode 100644
index 55e2cac50a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ButtonActive_0_0.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png
deleted file mode 100644
index 9f84a139e6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ButtonInActive_0_0.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png b/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png
deleted file mode 100644
index 691f6e3bf8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ButtonPressed_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png b/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png
deleted file mode 100644
index 411f003938..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/Button_9_9.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/climate/ring.png b/src/components/qt_hmi/References/Look/Resources/climate/ring.png
deleted file mode 100644
index 9908bf71be..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/climate/ring.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/dn-arrow.png b/src/components/qt_hmi/References/Look/Resources/dn-arrow.png
deleted file mode 100644
index bb1322277d..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/dn-arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/g136p.png b/src/components/qt_hmi/References/Look/Resources/g136p.png
deleted file mode 100644
index 1d49f184a1..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/g136p.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/g137p.png b/src/components/qt_hmi/References/Look/Resources/g137p.png
deleted file mode 100644
index 8e674d75b7..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/g137p.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/arrow.png b/src/components/qt_hmi/References/Look/Resources/menu/arrow.png
deleted file mode 100644
index 4c215b2bf7..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/car.png b/src/components/qt_hmi/References/Look/Resources/menu/car.png
deleted file mode 100644
index 18a21656d0..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/gear.png b/src/components/qt_hmi/References/Look/Resources/menu/gear.png
deleted file mode 100644
index b1eeba091c..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/gear.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/notes.png b/src/components/qt_hmi/References/Look/Resources/menu/notes.png
deleted file mode 100644
index 8b4a92fffc..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/notes.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/phone.png b/src/components/qt_hmi/References/Look/Resources/menu/phone.png
deleted file mode 100644
index 346f36cc33..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/phone.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/menu/snow.png b/src/components/qt_hmi/References/Look/Resources/menu/snow.png
deleted file mode 100644
index 54756bb2f6..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/menu/snow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png b/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png
deleted file mode 100644
index 04bb2476c1..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/DNDoff.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png b/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png
deleted file mode 100644
index 56b9fe7065..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/DNDon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/contacts.png b/src/components/qt_hmi/References/Look/Resources/phone/contacts.png
deleted file mode 100644
index a16d518ba8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/contacts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/keypad.png b/src/components/qt_hmi/References/Look/Resources/phone/keypad.png
deleted file mode 100644
index 1792c8fac8..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/keypad.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/messages.png b/src/components/qt_hmi/References/Look/Resources/phone/messages.png
deleted file mode 100644
index b5cbb8e8af..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/messages.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/more.png b/src/components/qt_hmi/References/Look/Resources/phone/more.png
deleted file mode 100644
index 908ebf654e..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/more.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/recent.png b/src/components/qt_hmi/References/Look/Resources/phone/recent.png
deleted file mode 100644
index db54c2f16e..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/recent.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/phone/texts.png b/src/components/qt_hmi/References/Look/Resources/phone/texts.png
deleted file mode 100644
index 31c024b1df..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/phone/texts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/scrollbar.png b/src/components/qt_hmi/References/Look/Resources/scrollbar.png
deleted file mode 100644
index c849382ae2..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/scrollbar.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/slider.png b/src/components/qt_hmi/References/Look/Resources/slider.png
deleted file mode 100644
index 83c54f854a..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/slider.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/Resources/up-arrow.png b/src/components/qt_hmi/References/Look/Resources/up-arrow.png
deleted file mode 100644
index b0e710a409..0000000000
--- a/src/components/qt_hmi/References/Look/Resources/up-arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/TextHardkey.qml b/src/components/qt_hmi/References/Look/TextHardkey.qml
deleted file mode 100644
index b73b991164..0000000000
--- a/src/components/qt_hmi/References/Look/TextHardkey.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "Widgets"
-
-FHardwareKey {
- width: 50
- height: 50
-
- property alias label : theText.text
-
- Rectangle {
- anchors.fill: parent
- border.color: "black"
- border.width: 1
- radius: 10
- smooth: true
-
- gradient: Gradient {
- GradientStop {
- id: s1
- color: "#FF646464"
- position: 0.0
- }
- GradientStop {
- id: s2
- color: "#FF484848"
- position: 0.8
- }
- GradientStop {
- id: s3
- color: "#FF323232"
- position: 1.0
- }
- }
- }
-
- CondText {
- id: theText
- anchors.fill: parent
- horizontalAlignment: Text.AlignHCenter
-
- }
-
-
- FViewUseCaseSimple {
- condition: pressed === true
- PropertyChanges { target: s1; position: 1.0 }
- PropertyChanges { target: s2; position: 0.2}
- PropertyChanges { target: s3; position: 0.0 }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AM.qml b/src/components/qt_hmi/References/Look/Views/AM.qml
deleted file mode 100644
index 2ed7d8085d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AM.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayout {
- id:home
- albumInfoBtn.vis: false
- albumInfoImg.visible: false
- alertBtn.vis: false
- browseBtn.vis: false
- replayBtn.vis: false
- preset1Btn.text: "WJR"
- preset2Btn.text: "1130"
- preset3Btn.text: "950"
- preset4Btn.text: "WWJ"
- preset5Btn.text: "WXYZ"
- preset6Btn.text: "1330"
- artistTxt.text: ""
- stationTxt.text: ""
- trackTxt.text: "950"
-
-
- }
-
-
- }
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.tuneBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AMPCA.qml b/src/components/qt_hmi/References/Look/Views/AMPCA.qml
deleted file mode 100644
index 9a0a99f832..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AMPCA.qml
+++ /dev/null
@@ -1,122 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
-
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "AM Radio"
- freqId: "AM"
- sourceBtn.textWidth: 100
- curPreset: dataPool.currAMpreset
- hdBtn.visible: false
-
- listModel: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- }
-
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "1130"; menuData: false; }
- FMenuElement { id: preset2; menuText: "950"; menuData: false }
- FMenuElement { id: preset3; menuText: "760"; menuData: true }
- FMenuElement { id: preset4; menuText: "1270"; menuData: false }
- FMenuElement { id: preset5; menuText: "1310"; menuData: false }
- FMenuElement { id: preset6; menuText: "800"; menuData: false }
- FMenuElement { id: preset7; menuText: "610"; menuData: false }
- FMenuElement { id: preset8; menuText: "820"; menuData: false}
- }
- }
-
-
-
- triggers: [
-
-
-
- FTrgEntry{
- FGrdCondition{condition: dataPool.currAMpreset === 1
- FActScriptCall { onScript: home.stationTxt = "1130" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 2
- FActScriptCall { onScript: home.stationTxt = "950" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 3
- FActScriptCall { onScript: home.stationTxt = "760" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 4
- FActScriptCall { onScript: home.stationTxt = "1270" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 5
- FActScriptCall { onScript: home.stationTxt = "1310" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 6
- FActScriptCall { onScript: home.stationTxt = "800" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 7
- FActScriptCall { onScript: home.stationTxt = "610" }
- }
- FGrdCondition{condition: dataPool.currAMpreset === 8
- FActScriptCall { onScript: home.stationTxt = "820" }
- }
- },
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgMenuElement { menuElement: preset1
- FActScriptCall { onScript: home.stationTxt = "1130" }
- FActScriptCall { onScript: dataPool.currAMpreset = 1 }
- },
- FTrgMenuElement { menuElement: preset2
- FActScriptCall { onScript: home.stationTxt = "950" }
- FActScriptCall { onScript: dataPool.currAMpreset = 2 }
- },
- FTrgMenuElement { menuElement: preset3
- FActScriptCall { onScript: home.stationTxt = "760" }
- FActScriptCall { onScript: dataPool.currAMpreset = 3 }
- },
- FTrgMenuElement { menuElement: preset4
- FActScriptCall { onScript: home.stationTxt = "1270" }
- FActScriptCall { onScript: dataPool.currAMpreset = 4 }
- },
- FTrgMenuElement { menuElement: preset5
- FActScriptCall { onScript: home.stationTxt = "1310" }
- FActScriptCall { onScript: dataPool.currAMpreset = 5 }
- },
- FTrgMenuElement { menuElement: preset6
- FActScriptCall { onScript: home.stationTxt = "800" }
- FActScriptCall { onScript: dataPool.currAMpreset = 6 }
- },
- FTrgMenuElement { menuElement: preset7
- FActScriptCall { onScript: home.stationTxt = "610" }
- FActScriptCall { onScript: dataPool.currAMpreset = 7 }
- },
- FTrgMenuElement { menuElement: preset8
- FActScriptCall { onScript: home.stationTxt = "820" }
- FActScriptCall { onScript: dataPool.currAMpreset = 8 }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml b/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml
deleted file mode 100644
index 0158451113..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AlphaSortPCA.qml
+++ /dev/null
@@ -1,151 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
-
-
-
-
- view: FView {
- id: v
-
- layout: AlphaSortLayout {
- id:home
- phonEntry: dataPool.filterPhone
-
- }
-
-
- }
-
- triggers: [
-
- FTrgEntry{
- FActScriptCall { onScript: dataPool.filterPhone= ""}
- },
- FTrgTouchArea { touchArea:home.a; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "a"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.b; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "b"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.c; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "c"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.d; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "d"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.e; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "e"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.f; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "f"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.g; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "g"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.h; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "h"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.i; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "i"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.j; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "j"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.k; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "k"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.l; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "l"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.m; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "m"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.n; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "n"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.o; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "o"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.p; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "p"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.q; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "q"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.r; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "r"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.s; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "s"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.t; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "t"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.u; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "u"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.v; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "v"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.w; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "w"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.xB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "x"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.yB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "y"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.zB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "z"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.num; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.filterPhone= "a"}
- FActViewShow { view: "PhoneContactsListView" }
- },
- FTrgTouchArea { touchArea:home.close; touchAction: TA.Out
-
- FActViewShow { view: "PhonePCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-
-}
diff --git a/src/components/qt_hmi/References/Look/Views/AuxPCA.qml b/src/components/qt_hmi/References/Look/Views/AuxPCA.qml
deleted file mode 100644
index 478d1e55d9..0000000000
--- a/src/components/qt_hmi/References/Look/Views/AuxPCA.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "Line In"
- sourceBtn.textWidth: 90
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml b/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml
deleted file mode 100644
index 83a83147f0..0000000000
--- a/src/components/qt_hmi/References/Look/Views/BT_AudioPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "BT Audio"
- sourceBtn.textWidth: 100
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/CDPCA.qml b/src/components/qt_hmi/References/Look/Views/CDPCA.qml
deleted file mode 100644
index bc6e6ab2fd..0000000000
--- a/src/components/qt_hmi/References/Look/Views/CDPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "CD"
- sourceBtn.textWidth: 40
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Chrome.qml b/src/components/qt_hmi/References/Look/Views/Chrome.qml
deleted file mode 100644
index e8029fb10a..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Chrome.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 8
-
-
-
- view: FView {
- id: v
-
- layout: ChromeLayout {
- id:chrome
- button2.indicatorState: condPool.settingsOpen
-
- }
-
-
- }
-
- /*FViewUseCaseSimple{condition:condPool.settingsOpen
- PropertyChanges {
- target: chrome.button2; indicatorState: true
- }
- }*/
-
- triggers: [
- FTrgEntry {
-
- },
-
- FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },
- FTrgTouchArea { touchArea:chrome.button1; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:chrome.button2; touchAction: TA.Out
- FActViewShow { view: "List" }
- },
- FTrgTouchArea { touchArea:chrome.button3; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml b/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml
deleted file mode 100644
index 812e6afac3..0000000000
--- a/src/components/qt_hmi/References/Look/Views/ClimatePCA.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
- view: FView {
- id: v
-
- layout: ClimatePCALayout {
- id:climate
- dualBtnSt: condPool.dualBtnSt
- drvHeatSeatSt: condPool.drvHeatSeatSt
- drvCoolSeatSt: condPool.drvCoolSeatSt
- passCoolSeatSt: condPool.passCoolSeatSt
- passHeatSeatSt: condPool.passHeatSeatSt
- heatWheelSt: condPool.heatWheelSt
- heatWinSheildSt: condPool.heatWinSheildSt
- defrostSt: condPool.defrostSt
- pannelSt: condPool.pannelSt
- floorSt: condPool.floorSt
-
- }
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:climate.dualBtn; touchAction: TA.Out
- FActScriptCall { onScript: condPool.dualBtnSt = !condPool.dualBtnSt }
- },
- FTrgTouchArea { touchArea:climate.drvHeatSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.drvHeatSeatSt = !condPool.drvHeatSeatSt }
- },
- FTrgTouchArea { touchArea:climate.drvCoolSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.drvCoolSeatSt = !condPool.drvCoolSeatSt }
- },
- FTrgTouchArea { touchArea:climate.passCoolSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.passCoolSeatSt = !condPool.passCoolSeatSt }
- },
- FTrgTouchArea { touchArea:climate.passHeatSeat; touchAction: TA.Out
- FActScriptCall { onScript: condPool.passHeatSeatSt = !condPool.passHeatSeatSt }
- },
- FTrgTouchArea { touchArea:climate.heatWheel; touchAction: TA.Out
- FActScriptCall { onScript: condPool.heatWheelSt = !condPool.heatWheelSt }
- },
- FTrgTouchArea { touchArea:climate.heatWinSheild; touchAction: TA.Out
- FActScriptCall { onScript: condPool.heatWinSheildSt = !condPool.heatWinSheildSt }
- },
- FTrgTouchArea { touchArea:climate.defrost; touchAction: TA.Out
- FActScriptCall { onScript: condPool.defrostSt = !condPool.defrostSt }
- },
- FTrgTouchArea { touchArea:climate.pannel; touchAction: TA.Out
- FActScriptCall { onScript: condPool.pannelSt = !condPool.pannelSt }
- },
- FTrgTouchArea { touchArea:climate.floor; touchAction: TA.Out
- FActScriptCall { onScript: condPool.floorSt = !condPool.floorSt }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/ControlMirror.qml b/src/components/qt_hmi/References/Look/Views/ControlMirror.qml
deleted file mode 100644
index 4cd1472c0d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/ControlMirror.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 5
- property string dirTuneEntry: ""
-
-
- FTimer { id: popupEnd; interval: 2500; repeat: false }
-
- view: FView {
- id: v
-
- layout: ControlMirrorLayout {
- id:home
- }
-
-
- }
-
-
-
-
- triggers: [
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- },
- FTrgEntry{
- FActTimer { timer: popupEnd; action: TM.Start }
- },
- FTrgTimer{timer: popupEnd
- FActTimer { timer: popupEnd; action: TM.Stop }
- FActViewHide { }
- },
- FTrgHardwareKey { hardkeys: buttonUp; keyAction: HK.In
- FActTimer { timer: popupEnd; action: TM.Restart }
- // FActScriptCall { onScript: condPool.climateOnOff = true }
- FGrdCondition { condition: dataPool.drvTemp !== 80
- FActScriptCall { onScript: dataPool.drvTemp = (dataPool.drvTemp+1) }
- }
- },
- FTrgHardwareKey { hardkeys: buttonDown; keyAction: HK.In
- FActTimer { timer: popupEnd; action: TM.Restart }
- // FActScriptCall { onScript: condPool.climateOnOff = true }
- FGrdCondition { condition: dataPool.drvTemp !== 65
- FActScriptCall { onScript: dataPool.drvTemp = (dataPool.drvTemp-1) }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/FM.qml b/src/components/qt_hmi/References/Look/Views/FM.qml
deleted file mode 100644
index 6aa98303bd..0000000000
--- a/src/components/qt_hmi/References/Look/Views/FM.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayout {
- id:home
- preset1Btn.text: dataPool.fm1pre1
- preset2Btn.text: dataPool.fm1pre2
- preset3Btn.text: dataPool.fm1pre3
- preset4Btn.text: dataPool.fm1pre4
- preset5Btn.text: dataPool.fm1pre5
- preset6Btn.text: dataPool.fm1pre6
- trackTxt.text: dataPool.currStation
- stationTxt.text: dataPool.currStatText
- artistTxt.text: dataPool.currSong
- albumInfoBtn.bitmap: dataPool.currAlbumArt
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre1 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat1}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song1 }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre2 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat2}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song2 }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre3 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat3}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song3 }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre4 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat4}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song4 }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre5 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat5}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song5 }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre6 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat6}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song6 }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.tuneBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/FMPCA.qml b/src/components/qt_hmi/References/Look/Views/FMPCA.qml
deleted file mode 100644
index 1e9a46a0b3..0000000000
--- a/src/components/qt_hmi/References/Look/Views/FMPCA.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
- property int currHD: 1
- property int totalHD: 4
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "FM Radio"
- sourceBtn.textWidth: 100
- freqId: "FM"
- curHD: currHD
- totHD: totalHD
- curPreset: dataPool.currFMpreset
-
- listModel: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- }
-
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "96.3"; menuData: false; }
- FMenuElement { id: preset2; menuText: "107.9"; menuData: false }
- FMenuElement { id: preset3; menuText: "104.3"; menuData: false }
- FMenuElement { id: preset4; menuText: "101.9"; menuData: false }
- FMenuElement { id: preset5; menuText: "97.1"; menuData: false }
- FMenuElement { id: preset6; menuText: "91.7"; menuData: false }
- FMenuElement { id: preset7; menuText: "101.1"; menuData: false }
- FMenuElement { id: preset8; menuText: "91.9"; menuData: false}
- }
- }
-
-
- triggers: [
-
- FTrgCondition{ condition: home.moving === true
- FActScriptCall { onScript: home.page1=!home.page1 }
- },
- FTrgEntry{
- FGrdCondition{condition: dataPool.currFMpreset === 1
- FActScriptCall { onScript: home.stationTxt = "96.3" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 2
- FActScriptCall { onScript: home.stationTxt = "107.9" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 3
- FActScriptCall { onScript: home.stationTxt = "104.3" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 4
- FActScriptCall { onScript: home.stationTxt = "101.9" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 5
- FActScriptCall { onScript: home.stationTxt = "97.1" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 6
- FActScriptCall { onScript: home.stationTxt = "91.7" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 7
- FActScriptCall { onScript: home.stationTxt = "101.1" }
- }
- FGrdCondition{condition: dataPool.currFMpreset === 8
- FActScriptCall { onScript: home.stationTxt = "91.9" }
- }
- },
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.hdBtn.touchBtn; touchAction: TA.Out
- FGrdCondition { condition: currHD === totalHD
- FActScriptCall { onScript: currHD = 1 }
- }
- FGrdCondition { condition: currHD !== totalHD
- FActScriptCall { onScript: currHD ++}
- }
- },
- FTrgMenuElement { menuElement: preset1
- FActScriptCall { onScript: home.stationTxt = "96.3" }
- FActScriptCall { onScript: dataPool.currFMpreset = 1 }
- },
- FTrgMenuElement { menuElement: preset2
- FActScriptCall { onScript: home.stationTxt = "107.9" }
- FActScriptCall { onScript: dataPool.currFMpreset = 2 }
- },
- FTrgMenuElement { menuElement: preset3
- FActScriptCall { onScript: home.stationTxt = "104.3" }
- FActScriptCall { onScript: dataPool.currFMpreset = 3 }
- },
- FTrgMenuElement { menuElement: preset4
- FActScriptCall { onScript: home.stationTxt = "101.9" }
- FActScriptCall { onScript: dataPool.currFMpreset = 4 }
- },
- FTrgMenuElement { menuElement: preset5
- FActScriptCall { onScript: home.stationTxt = "97.1" }
- FActScriptCall { onScript: dataPool.currFMpreset = 5 }
- },
- FTrgMenuElement { menuElement: preset6
- FActScriptCall { onScript: home.stationTxt = "91.7" }
- FActScriptCall { onScript: dataPool.currFMpreset = 6 }
- },
- FTrgMenuElement { menuElement: preset7
- FActScriptCall { onScript: home.stationTxt = "101.1" }
- FActScriptCall { onScript: dataPool.currFMpreset = 7 }
- },
- FTrgMenuElement { menuElement: preset8
- FActScriptCall { onScript: home.stationTxt = "91.9" }
- FActScriptCall { onScript: dataPool.currFMpreset = 8 }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- /*FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre1 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat1}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song1 }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre2 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat2}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song2 }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre3 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat3}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song3 }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre4 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat4}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song4 }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre5 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat5}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song5 }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currStation = dataPool.fm1pre6 }
- FActScriptCall { onScript:dataPool.currStatText = dataPool.fm1stat6}
- FActScriptCall { onScript:dataPool.currSong=dataPool.fm1song6 }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
-
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },*/
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/GenListHandling.qml b/src/components/qt_hmi/References/Look/Views/GenListHandling.qml
deleted file mode 100644
index 9abdb899fc..0000000000
--- a/src/components/qt_hmi/References/Look/Views/GenListHandling.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FState {
-
-
- triggers: [
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml b/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml
deleted file mode 100644
index fd43775f0d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/GridMenuPCA.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackImgLayoutPCA {
- id:l
- itemWidth: 266
-
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewImgItemWidget {
- width: 266
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: climate; menuIcon: "menu/snow.png"}
- FMenuElement { id: phone; menuIcon: "menu/phone.png" }
- FMenuElement { id: navigation; menuIcon: "menu/arrow.png" }
- FMenuElement { id: myVeh; menuIcon: "menu/car.png" }
- FMenuElement { id: entertainment; menuIcon: "menu/notes.png" }
- FMenuElement { id: settings; menuIcon: "menu/gear.png" }
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: climate
- FActViewShow { view: "ClimatePCA" }
- },
- FTrgMenuElement { menuElement: phone
- FActViewShow { view: "PhonePCA" }
- },
- FTrgMenuElement { menuElement: navigation
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgMenuElement { menuElement: myVeh
- FActViewShow { view: "MyVehiclePCA" }
- },
- FTrgMenuElement { menuElement: entertainment
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: settings
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: dataPool.mainPCAmenuShown = true }
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: dataPool.mainPCAmenuShown = false }
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Home.qml b/src/components/qt_hmi/References/Look/Views/Home.qml
deleted file mode 100644
index 3a7edc353d..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Home.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: HomeLayout {
- id:home
-
- }
-
-
- }
-
- triggers: [
-
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgTouchArea { touchArea:home.button1; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.button2; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgTouchArea { touchArea:home.button3; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.button4; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/List.qml b/src/components/qt_hmi/References/Look/Views/List.qml
deleted file mode 100644
index 5f63b77461..0000000000
--- a/src/components/qt_hmi/References/Look/Views/List.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
-
- view: FView {
- id: v
-
- layout: ListLayout {
- id:list
-
-
- listWrap: true
- list_data: menuItemData
- list_itemWidget: MenuListItemWidget { }
-
- }
-
-
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: menuAudio; menuText: "Audio Settings"; menuType: FMenuElement.Submenu
- FMenuElement { id: menuAudio1; menuText: "Audio 1"; menuType: FMenuElement.Submenu
- FMenuElement { id: menuAudio11; menuText: "Audio 11"; menuType: FMenuElement.Popup }
- FMenuElement { id: menuAudio12; menuText: "Audio 12"; menuType: FMenuElement.Popup }
- }
- FMenuElement { id: menuAudio2; menuText: "Audio 2"; menuType: FMenuElement.Popup }
- FMenuElement { id: menuAudio3; menuText: "Audio 3"; menuType: FMenuElement.Popup }
- }
- FMenuElement { id: menuVehicle; menuText: "Vehicle Settings"; menuType: FMenuElement.Submenu; isVisible: false }
- FMenuElement { id: menuClock; menuText: "Clock Settings"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuDisplay; menuText: "Display Settings"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuMC; menuText: "Message Centre"; menuType: FMenuElement.Popup }
- }
-
- triggers: [
- FTrgEntry {
- FActScriptCall {onScript: condPool.settingsOpen=true}
-
- },
- FTrgExit {
- FActScriptCall {onScript: condPool.settingsOpen=false}
- },
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- },
-
-
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: menuAudio
- FActScriptCall { onScript: menuAudio.isOpened = !menuAudio.isOpened }
- },
- // Example to use a list model trigger. This will work for all classes derived from FAbstractListModel (E.g. TreeModel, MenuModel)
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml b/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml
deleted file mode 100644
index ce477a12a7..0000000000
--- a/src/components/qt_hmi/References/Look/Views/MenuTopLevelGrid.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TC1_B1_Grid {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: menuAudio; menuText: "AM"; menuType: FMenuElement.Submenu}
- FMenuElement { id: menuVehicle; menuText: "FM"; menuType: FMenuElement.Submenu; isVisible: false}
- FMenuElement { id: menuClock; menuText: "Sirius"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuDisplay; menuText: "CD"; menuType: FMenuElement.Submenu }
- FMenuElement { id: menuMC; menuText: "BT Audio"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "USB"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 2"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 3"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 4"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 5"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 6"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 7"; menuType: FMenuElement.Popup }
- FMenuElement { menuText: "Dummy 8"; menuType: FMenuElement.Popup }
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: menuAudio
- FGrdCondition { condition: menuAudio.isEnabled
- FActViewShow { view: "MenuAudioSettings"; animation: "AnimWiperRight" }
- }
- },
- FTrgMenuElement { menuElement: menuClock
- FActViewShow { view: "MenuTopLevelMenu" }
- },
- FTrgMenuElement { menuElement: menuVehicle
- FActViewShow { view: "MenuTopLevelMenu"; animation: "AnimWiperRight" }
- },
- // Example to use a list model trigger. This will work for all classes derived from FAbstractListModel (E.g. TreeModel, MenuModel)
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml b/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml
deleted file mode 100644
index 6ecc512b60..0000000000
--- a/src/components/qt_hmi/References/Look/Views/MyVehiclePCA.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackImgLayoutPCA {
- id:l
-
-
- //useClose: true
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewImgItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: ev; menuIcon: "Vehicle/EV Icon.png"}
- FMenuElement { id: aLight; menuIcon: "Vehicle/Ambient Lighti Icon.png" }
- FMenuElement { id: mcs; menuIcon: "Vehicle/MCS Icon.png" }
- FMenuElement { id: weather; menuIcon: "Vehicle/sun.png" }
- FMenuElement { id: kepad; menuIcon: "Vehicle/key_car.png" }
- FMenuElement { id: calendar; menuIcon: "Vehicle/cal.png" }
- FMenuElement { id: browse; menuIcon: "Vehicle/folders.png" }
- FMenuElement { id: syncServices; menuIcon: "Vehicle/SYNC Services.png"}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: ev
- },
- FTrgMenuElement { menuElement: aLight
- },
- FTrgMenuElement { menuElement: mcs
- },
- FTrgMenuElement { menuElement: weather
- },
- FTrgMenuElement { menuElement: kepad
- },
- FTrgMenuElement { menuElement: calendar
- },
- FTrgMenuElement { menuElement: browse
- },
- FTrgMenuElement { menuElement: syncServices
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "GridMenuPCA" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavInRoute.qml b/src/components/qt_hmi/References/Look/Views/NavInRoute.qml
deleted file mode 100644
index e21d60a3cd..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavInRoute.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
- view: FView {
- id: v
-
- layout: NavInRouteLayout {
- id:map
-
-
- }
-
- }
-
-
-
- triggers: [
- FTrgTouchArea { touchArea:map.cancel; touchAction: TA.Out
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgTouchArea { touchArea:map.mute; touchAction: TA.Out
- FActScriptCall { onScript: { map.muteSt = !map.muteSt} }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml b/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml
deleted file mode 100644
index a3499f89d3..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavKeyboardPCA.qml
+++ /dev/null
@@ -1,159 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["PCAstatusBar"]
-
-
- view: FView {
- id: v
-
- layout: NavKeyboardLayout {
- id:nav
- entry:dataPool.navEnrty
- list_data:sItemData
- list_itemWidget: VerySimpleListItemWidget {
- vis: false
-
- }
- }
-
- }
- ListModel
- {
-
- id:sItemData
- ListElement { staticItem: "Five Guys" }
- ListElement { staticItem: "Archers Of Loaf" }
- ListElement { staticItem: "Bob Mould" }
- ListElement { staticItem: "Cat Power" }
- ListElement { staticItem: "Cloud Nothings"}
- ListElement { staticItem: "Dentist"}
- ListElement { staticItem: "Dirty Frank's" }
- ListElement { staticItem: "Grouplove" }
- ListElement { staticItem: "Hudson Bell"}
- ListElement { staticItem: "Japandroids" }
- ListElement { staticItem: "Macklemore & Ryan Lewis"}
- ListElement { staticItem: "The National"}
- ListElement { staticItem: "Titus Andronicus" }
- ListElement { staticItem: "Tito" }
- ListElement { staticItem: "Tamal" }
- ListElement { staticItem: "Taco" }
-
- }
-
- triggers: [
-
- FTrgTouchArea { touchArea:nav.listOpen; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= ""}
- FActViewShow { view: "NavInRoute" }
- },
- FTrgTouchArea { touchArea:nav.a; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"a"}
- },
- FTrgTouchArea { touchArea:nav.b; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"b"}
- },
- FTrgTouchArea { touchArea:nav.c; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"c"}
- },
- FTrgTouchArea { touchArea:nav.d; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"d"}
- },
- FTrgTouchArea { touchArea:nav.e; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"e"}
- },
- FTrgTouchArea { touchArea:nav.f; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"f"}
- },
- FTrgTouchArea { touchArea:nav.g; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"g"}
- },
- FTrgTouchArea { touchArea:nav.h; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"h"}
- },
- FTrgTouchArea { touchArea:nav.i; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"i"}
- },
- FTrgTouchArea { touchArea:nav.j; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"j"}
- },
- FTrgTouchArea { touchArea:nav.k; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"k"}
- },
- FTrgTouchArea { touchArea:nav.l; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"l"}
- },
- FTrgTouchArea { touchArea:nav.m; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"m"}
- },
- FTrgTouchArea { touchArea:nav.n; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"n"}
- },
- FTrgTouchArea { touchArea:nav.o; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"o"}
- },
- FTrgTouchArea { touchArea:nav.p; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"p"}
- },
- FTrgTouchArea { touchArea:nav.q; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"q"}
- },
- FTrgTouchArea { touchArea:nav.r; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"r"}
- },
- FTrgTouchArea { touchArea:nav.s; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"s"}
- },
- FTrgTouchArea { touchArea:nav.t; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"t"}
- },
- FTrgTouchArea { touchArea:nav.u; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"u"}
- },
- FTrgTouchArea { touchArea:nav.v; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"v"}
- },
- FTrgTouchArea { touchArea:nav.w; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"w"}
- },
- FTrgTouchArea { touchArea:nav.xB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"x"}
- },
- FTrgTouchArea { touchArea:nav.yB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"y"}
- },
- FTrgTouchArea { touchArea:nav.zB; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+"z"}
- },
- FTrgTouchArea { touchArea:nav.num; touchAction: TA.Out
- },
- FTrgTouchArea { touchArea:nav.clr; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= ""}
- },
- FTrgTouchArea { touchArea:nav.space; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty+" "}
- },
- FTrgTouchArea { touchArea:nav.del; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.navEnrty= dataPool.navEnrty.substring(0,dataPool.navEnrty.length-1)}
- },
- FTrgTouchArea { touchArea:nav.sym; touchAction: TA.Out
- },
- FTrgTouchArea { touchArea:nav.go; touchAction: TA.Out
- FActViewShow { view: "NavInRoute" }
- },
- FTrgTouchArea { touchArea:nav.close; touchAction: TA.Out
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavMenu.qml b/src/components/qt_hmi/References/Look/Views/NavMenu.qml
deleted file mode 100644
index 8d22aa77ea..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavMenu.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackLayoutPCA {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: sourceAM; menuText: "Home"; }
- FMenuElement { id: sourceFM; menuText: "Work"; }
- FMenuElement { id: sourceCD; menuText: "Keyboard"; }
- FMenuElement { id: sourceSat; menuText: "Recent"; }
- FMenuElement { id: sourceBt; menuText: "Favorites"; }
- FMenuElement { id: sourceIpod; menuText: "POI"; }
- FMenuElement { id: sourceUSB; menuText: "Scout"; }
- FMenuElement { id: sourceLineIn; menuText: "Waze";}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: sourceAM
- },
- FTrgMenuElement { menuElement: sourceFM
- },
- FTrgMenuElement { menuElement: sourceSat
- },
- FTrgMenuElement { menuElement: sourceCD
- FActViewShow { view: "NavKeyboardPCA" }
- },
- FTrgMenuElement { menuElement: sourceBt
- },
- FTrgMenuElement { menuElement: sourceIpod
- },
- FTrgMenuElement { menuElement: sourceUSB
- },
- FTrgMenuElement { menuElement: sourceLineIn
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "NavNoRoute" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml b/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml
deleted file mode 100644
index 0299c182e8..0000000000
--- a/src/components/qt_hmi/References/Look/Views/NavNoRoute.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
-
-
- view: FView {
- id: v
-
- layout: NavNoRouteLayout {
- id:map
-
-
- }
-
- }
-
-
-
- triggers: [
- FTrgTouchArea { touchArea:map.destSearch; touchAction: TA.Out
- FActViewShow { view: "NavMenu" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Off.qml b/src/components/qt_hmi/References/Look/Views/Off.qml
deleted file mode 100644
index 3e75999c66..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Off.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 1
-
- view: FView {
- layout: OffLayout {
- id:l
- }
- }
-
- triggers: [
- FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActViewShow { view: "On" }
- },
- FTrgTouchArea { touchArea:l.offTouch; touchAction: TA.Out
- FActViewShow { view: "On" }
- },
- /*FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- },*/
- FTrgEntry {
- //FActScriptCall { onScript: dataPool.phoneCrnIcons = false}
- //FActScriptCall { onScript: dataPool.phonePaired = false}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/On.qml b/src/components/qt_hmi/References/Look/Views/On.qml
deleted file mode 100644
index 6e09534309..0000000000
--- a/src/components/qt_hmi/References/Look/Views/On.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 1
-
- view: FView {
- layout: OffLayout {
- id:l
- offTouch.enabled: false
- }
- }
-
- triggers: [
- FTrgEntry {
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewShow { view: "Off" }
- },
- FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- //FActViewShow { view: "Off" }
- FActEventFire{ event: closeNormalScreens }
- },
- FTrgHardwareKey { hardkeys: buttonUp; keyAction: HK.In
- FActViewShow { view: "ControlMirror" }
- },
- FTrgHardwareKey { hardkeys: buttonDown; keyAction: HK.In
- FActViewShow { view: "ControlMirror" }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml b/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml
deleted file mode 100644
index e235f9c159..0000000000
--- a/src/components/qt_hmi/References/Look/Views/PCAstatusBar.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 8
-
-
- view: FView {
- id: v
-
- layout: PCAstatusBarLayout {
- id:statusBar
-
- }
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:statusBar.menuTouch; touchAction: TA.Out
- FActViewShow { view: "GridMenuPCA" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml b/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml
deleted file mode 100644
index f64062f3ab..0000000000
--- a/src/components/qt_hmi/References/Look/Views/PhoneContactsListView.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-
-FStateView {
- priority: 2
- view: FView {
- layout: PhoneContactsLayout {
- id:l
- list_data:phoneItemData
- list_itemWidget: PhoneContactListItemWdgt {
- itemClicked: childClicked
-
- }
- }
- }
-
- FEvent {id: browseSelected}
-
- ListModel
- {
-
- id:phoneItemData
- ListElement { staticItem: "Aaron" ; staticNumber:"(614)555-2444";type:"Mobile"}
- ListElement { staticItem: "Adrian" ; staticNumber:"(740)245-3434";type:"Mobile" }
- ListElement { staticItem: "Albert" ; staticNumber:"(614)245-5584";type:"Mobile" }
- ListElement { staticItem: "Alice" ; staticNumber:"(313)878-3566";type:"Office"}
- ListElement { staticItem: "Alec" ; staticNumber:"(917)608-2418";type:"Mobile"}
- ListElement { staticItem: "Alexander" ; staticNumber:"(614)608-2400";type:"Home"}
- ListElement { staticItem: "Alexander" ; staticNumber:"(614)608-2400";type:"Mobile"}
- ListElement { staticItem: "Amber" ; staticNumber:"(614)608-2111";type:"Mobile"}
- ListElement { staticItem: "Amy" ; staticNumber:"(440)245-3434";type:"Mobile" }
- ListElement { staticItem: "Andy" ; staticNumber:"(313)245-3434";type:"Mobile" }
- ListElement { staticItem: "Antje" ; staticNumber:"(567)245-3434";type:"Home" }
- ListElement { staticItem: "Barry" ; staticNumber:"(313)555-2211";type:"Mobile" }
- ListElement { staticItem: "Bea" ; staticNumber:"(614)455-3434";type:"Mobile" }
- ListElement { staticItem: "Ben" ; staticNumber:"(614)882-1843";type:"Office" }
- ListElement { staticItem: "Blake" ; staticNumber:"(330)149-7778";type:"Mobile" }
- ListElement { staticItem: "Bob Mould" ; staticNumber:"(313)245-3434";type:"Mobile" }
- ListElement { staticItem: "Brian" ; staticNumber:"(614)332-7499";type:"Mobile" }
- ListElement { staticItem: "Calvin" ; staticNumber:"(614)442-9974";type:"Mobile" }
- ListElement { staticItem: "Carl" ; staticNumber:"(567)773-3434";type:"Home" }
- ListElement { staticItem: "Cat Power" ; staticNumber:"(313)608-3434";type:"Home"}
- ListElement { staticItem: "Cathy" ; staticNumber:"(313)444-456";type:"Home"}
- ListElement { staticItem: "Chris" ; staticNumber:"(734)997-6514";type:"Home" }
- ListElement { staticItem: "Cloud Nothings"; staticNumber:"(444)608-543";type:"Mobile"}
- ListElement { staticItem: "Cody" ; staticNumber:"(567)365-8413";type:"Home" }
- ListElement { staticItem: "Curtis" ; staticNumber:"(614)245-1547";type:"Office" }
- ListElement { staticItem: "Dakota" ; staticNumber:"(567)555-4444";type:"Home" }
- ListElement { staticItem: "Dale" ; staticNumber:"(567)723-1974";type:"Mobile" }
- ListElement { staticItem: "Dallas"; staticNumber:"(614)556-879";type:"Home"}
- ListElement { staticItem: "Damian" ; staticNumber:"(614)245-3434";type:"Office" }
- ListElement { staticItem: "Daniel"; staticNumber:"(614)556-879";type:"Home"}
- ListElement { staticItem: "Darina"; staticNumber:"(313)895-888";type:"Mobile"}
- ListElement { staticItem: "Dee "; staticNumber:"(313)432-3434";type:"Home"}
- ListElement { staticItem: "Edward" ; staticNumber:"(917)608-975";type:"Office"}
- ListElement { staticItem: "Ferdinand" ; staticNumber:"(917)879-795";type:"Mobile"}
- ListElement { staticItem: "Gomez" ; staticNumber:"(313)455-543";type:"Mobile"}
- ListElement { staticItem: "Harry Potter"; staticNumber:"(313)888-432";type:"Home"}
- ListElement { staticItem: "Ivan"; staticNumber:"(313)996-225";type:"Home"}
- ListElement { staticItem: "James" ; staticNumber:"(917)608-3434";type:"Mobile"}
- ListElement { staticItem: "Karen"; staticNumber:"(313)998-332";type:"Home"}
- ListElement { staticItem: "Luis Torres"; staticNumber:"(313)779-111";type:"Home"}
- ListElement { staticItem: "Mary"; staticNumber:"(313)234-098";type:"Mobile"}
- ListElement { staticItem: "Neil"; staticNumber:"(313)444-112";type:"Mobile"}
- ListElement { staticItem: "Oswald"; staticNumber:"(313)456-921";type:"Mobile"}
- ListElement { staticItem: "Oscar"; staticNumber:"(313)332-778";type:"Home"}
- ListElement { staticItem: "Patrice"; staticNumber:"(313)789-111";type:"Mobile"}
- ListElement { staticItem: "Queen Elizabeth"; staticNumber:"(313)897-666";type:"Mobile"}
- ListElement { staticItem: "Rose"; staticNumber:"(313)111-211";type:"Mobile"}
- ListElement { staticItem: "Susell"; staticNumber:"(313)345-122";type:"Home"}
- ListElement { staticItem: "Susell"; staticNumber:"(313)345-122";type:"Home"}
- ListElement { staticItem: "Thomas"; staticNumber:"(917)608-342";type:"Mobile"}
- ListElement { staticItem: "Titus Andronicus" ; staticNumber:"(917)608-321";type:"Office"}
- ListElement { staticItem: "Toretto" ; staticNumber:"(917)608-3434";type:"Home"}
- ListElement { staticItem: "Uhl" ; staticNumber:"(313)444-654";type:"Office"}
- ListElement { staticItem: "Zara" ; staticNumber:"(313)231-009";type:"Mobile"}
-
- }
- FEvent { id: childClicked }
-
- triggers:[
- FTrgEntry {
- FActScriptCall{onScript: l.list.positionViewAtIndex(sortList.existChar(phoneItemData,dataPool.filterPhone),l.list.Beginning)}
- },
- FTrgTouchArea { touchArea:l.back; touchAction: TA.Out
- FActViewShow { view: "AlphaSortPCA" }
- },
- FTrgEvent { id: trig2; event: childClicked
- FActScriptCall { onScript:console.log(trig2.data) }
- }
-
-
-
- ]
-
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Views/PhonePCA.qml b/src/components/qt_hmi/References/Look/Views/PhonePCA.qml
deleted file mode 100644
index 40969a3a64..0000000000
--- a/src/components/qt_hmi/References/Look/Views/PhonePCA.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackImgLayoutPCA {
- id:l
-
- //useClose: true
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewImgItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: phone; menuIcon: "menu/phone.png"}
- FMenuElement { id: dnd; menuIcon: "phone/DNDoff.png" }
- FMenuElement { id: phoneBook; menuIcon: "phone/contacts.png" }
- FMenuElement { id: recent; menuIcon: "phone/recent.png" }
- FMenuElement { id: messages; menuIcon: "phone/messages.png" }
- FMenuElement { id: keyPad; menuIcon: "phone/keypad.png" }
- FMenuElement { id: textMsg; menuIcon: "phone/texts.png" }
- FMenuElement { id: more; menuIcon: "phone/more.png"}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: phone
- },
- FTrgMenuElement { menuElement: dnd
- },
- FTrgMenuElement { menuElement: phoneBook
- FActViewShow { view: "AlphaSortPCA" }
- },
- FTrgMenuElement { menuElement: recent
- },
- FTrgMenuElement { menuElement: more
- },
- FTrgMenuElement { menuElement: messages
- },
- FTrgMenuElement { menuElement: keyPad
- },
- FTrgMenuElement { menuElement: textMsg
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "GridMenuPCA" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml b/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml
deleted file mode 100644
index ef693d924c..0000000000
--- a/src/components/qt_hmi/References/Look/Views/RadioEventHandling.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 0
-
- view: FView {
- layout: BlankLayout {
- id:l
- }
- }
-
- triggers: [
- FTrgEntry {
- FGrdCondition{ condition: dataPool.currSource==="FM"
- FActViewShow{ view: "FMPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="USB"
- FActViewShow{ view: "USB"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="AM"
- FActViewShow{ view: "AM"}
- FActViewHide{}
- }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml b/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml
deleted file mode 100644
index 90bf0a801a..0000000000
--- a/src/components/qt_hmi/References/Look/Views/RadioEventHandlingPCA.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 0
-
- view: FView {
- layout: BlankLayout {
- id:l
- }
- }
-
- triggers: [
- FTrgEntry {
- FGrdCondition{ condition: dataPool.currSource==="FM"
- FActViewShow{ view: "FMPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="USB"
- FActViewShow{ view: "USBPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="AM"
- FActViewShow{ view: "AMPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="Sirius"
- FActViewShow{ view: "SiriusPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="CD"
- FActViewShow{ view: "CDPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="BT_Audio"
- FActViewShow{ view: "BT_AudioPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="iPod"
- FActViewShow{ view: "iPodPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="LineIn"
- FActViewShow{ view: "AuxPCA"}
- FActViewHide{}
- }
- FGrdCondition{ condition: dataPool.currSource==="SDL_Music"
- FActViewShow{ view: "SDL_MusicPCA"}
- FActViewHide{}
- }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml b/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml
deleted file mode 100644
index a68956518b..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SDL_MusicPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "SDL Music"
- sourceBtn.textWidth: 100
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Sirius.qml b/src/components/qt_hmi/References/Look/Views/Sirius.qml
deleted file mode 100644
index bf16b810a5..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Sirius.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: SiriusLayout {
- id:home
-
- }
-
-
- }
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset1Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset2Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset3Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset4Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset5Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.preset6Btn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.replayBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.tuneBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.presetsBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml b/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml
deleted file mode 100644
index afb5c42fc7..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SiriusPCA.qml
+++ /dev/null
@@ -1,115 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: FMLayoutPCA {
- id:home
- sourceBtn.text: "Sirius"
- sourceBtn.textWidth: 70
- freqId: ""
- curPreset: dataPool.currSATpreset
- hdBtn.visible: false
-
-
- listModel: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- }
-
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "Lithium"; menuData: true; }
- FMenuElement { id: preset2; menuText: "Spectrum"; menuData: false }
- FMenuElement { id: preset3; menuText: "ESPN"; menuData: false }
- FMenuElement { id: preset4; menuText: "Alt Nation"; menuData: false }
- FMenuElement { id: preset5; menuText: "NHL"; menuData: false }
- FMenuElement { id: preset6; menuText: "the Highway"; menuData: false }
- FMenuElement { id: preset7; menuText: "SiriusXMU"; menuData: false }
- FMenuElement { id: preset8; menuText: "First Wave"; menuData: false}
- }
- }
-
- triggers: [
-
- FTrgEntry{
- FGrdCondition{condition: dataPool.currSATpreset === 1
- FActScriptCall { onScript: home.stationTxt = "Lithium" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 2
- FActScriptCall { onScript: home.stationTxt = "Spectrum" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 3
- FActScriptCall { onScript: home.stationTxt = "ESPN" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 4
- FActScriptCall { onScript: home.stationTxt = "Alt Nation" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 5
- FActScriptCall { onScript: home.stationTxt = "NHL" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 6
- FActScriptCall { onScript: home.stationTxt = "the Highway" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 7
- FActScriptCall { onScript: home.stationTxt = "SiriusXMU" }
- }
- FGrdCondition{condition: dataPool.currSATpreset === 8
- FActScriptCall { onScript: home.stationTxt = "First Wave" }
- }
- },
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgMenuElement { menuElement: preset1
- FActScriptCall { onScript: home.stationTxt = "Lithium" }
- FActScriptCall { onScript: dataPool.currSATpreset = 1 }
- },
- FTrgMenuElement { menuElement: preset2
- FActScriptCall { onScript: home.stationTxt = "Spectrum" }
- FActScriptCall { onScript: dataPool.currSATpreset = 2 }
- },
- FTrgMenuElement { menuElement: preset3
- FActScriptCall { onScript: home.stationTxt = "ESPN" }
- FActScriptCall { onScript: dataPool.currSATpreset = 3 }
- },
- FTrgMenuElement { menuElement: preset4
- FActScriptCall { onScript: home.stationTxt = "Alt Nation" }
- FActScriptCall { onScript: dataPool.currSATpreset = 4 }
- },
- FTrgMenuElement { menuElement: preset5
- FActScriptCall { onScript: home.stationTxt = "NHL" }
- FActScriptCall { onScript: dataPool.currSATpreset = 5 }
- },
- FTrgMenuElement { menuElement: preset6
- FActScriptCall { onScript: home.stationTxt = "the Highway" }
- FActScriptCall { onScript: dataPool.currSATpreset = 6 }
- },
- FTrgMenuElement { menuElement: preset7
- FActScriptCall { onScript: home.stationTxt = "SiriusXMU" }
- FActScriptCall { onScript: dataPool.currSATpreset = 7 }
- },
- FTrgMenuElement { menuElement: preset8
- FActScriptCall { onScript: home.stationTxt = "First Wave" }
- FActScriptCall { onScript: dataPool.currSATpreset = 8 }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SourceChange.qml b/src/components/qt_hmi/References/Look/Views/SourceChange.qml
deleted file mode 100644
index 42680f9e80..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SourceChange.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: TileBackLayout {
- id:source
- button1.text: "AM"
- button2.text: "FM"
- button3.text: "Sirius"
- button4.text: "USB"
- button5.text: "BT Audio"
- button6.text: "Line In"
- button7.vis: false
- button8.vis: false
- }
-
-
- }
-
- triggers: [
-
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgTouchArea { touchArea:source.button1; touchAction: TA.Out
- FActScriptCall { onScript: dataPool.currSource = "AM" }
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgTouchArea { touchArea:source.button2; touchAction: TA.Out
- FActViewShow { view: "FM" }
- },
- FTrgTouchArea { touchArea:source.button3; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.button4; touchAction: TA.Out
- FActViewShow { view: "USB" }
- },
- FTrgTouchArea { touchArea:source.button5; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.button6; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgTouchArea { touchArea:source.button7; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.button8; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:source.backBtn; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandling" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml b/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml
deleted file mode 100644
index bb87d41c2c..0000000000
--- a/src/components/qt_hmi/References/Look/Views/SourceChangePCA.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-
-FStateView {
- id:sv
- priority: 2
-
- view: FView {
- //viewClass: baseScreen
- layout: TileBackLayoutPCA {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewItemWidget {
-
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: sourceAM; menuText: "AM"; }
- FMenuElement { id: sourceFM; menuText: "FM"; }
- FMenuElement { id: sourceSat; menuText: "Sirius"; }
- FMenuElement { id: sourceCD; menuText: "CD"; }
- FMenuElement { id: sourceBt; menuText: "BT Audio"; }
- FMenuElement { id: sourceIpod; menuText: "iPod"; }
- FMenuElement { id: sourceUSB; menuText: "USB"; }
- FMenuElement { id: sourceLineIn; menuText: "Line In";}
- FMenuElement { id: sourceSDL; menuText: "SDL Music";}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
- }
-
- baseBehavior: GenListHandling {}
-
- triggers: [
- // Example for a menu element trigger. This will only work for FMenuModels.
- FTrgMenuElement { menuElement: sourceAM
- FActScriptCall { onScript: dataPool.currSource = "AM" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceFM
- FActScriptCall { onScript: dataPool.currSource = "FM" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceSat
- FActScriptCall { onScript: dataPool.currSource = "Sirius" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceCD
- FActScriptCall { onScript: dataPool.currSource = "CD" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceBt
- FActScriptCall { onScript: dataPool.currSource = "BT_Audio" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceIpod
- FActScriptCall { onScript: dataPool.currSource = "iPod" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceUSB
- FActScriptCall { onScript: dataPool.currSource = "USB" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceLineIn
- FActScriptCall { onScript: dataPool.currSource = "LineIn" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgMenuElement { menuElement: sourceSDL
- FActScriptCall { onScript: dataPool.currSource = "SDL_Music" }
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgTouchArea { touchArea:l.close; touchAction: TA.Out
- FActViewShow { view: "RadioEventHandlingPCA" }
- },
- FTrgListModel { id: trgList; model: menuItemData
- FActScriptCall { onScript: { FLogger.debug("Test", trgList.element.menuText + ", index: " + trgList.index) } }
- },
- FTrgEntry {
- FActScriptCall { onScript: { FLogger.debug("Test", "Entry") } }
- },
- FTrgEntryComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "EntryComplete") } }
- },
- FTrgExit {
- FActScriptCall { onScript: { FLogger.debug("Test", "Exit") } }
- },
- FTrgExitComplete {
- FActScriptCall { onScript: { FLogger.debug("Test", "ExitComplete") } }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/Start.qml b/src/components/qt_hmi/References/Look/Views/Start.qml
deleted file mode 100644
index 4858474011..0000000000
--- a/src/components/qt_hmi/References/Look/Views/Start.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: StartLayout {
- id:corner
-
- }
-
-
- }
-
- triggers: [
- FTrgEntry {
-
- },
-
- /*FTrgHardwareKey { hardkeys: hk_OnOff; keyAction: HK.In
- FActEventFire { event: closeNormalScreens }
- FActViewShow { view: "Off" }
- },*/
- FTrgTouchArea { touchArea:corner.button1; touchAction: TA.Out
- FActViewShow { view: "Home" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/USB.qml b/src/components/qt_hmi/References/Look/Views/USB.qml
deleted file mode 100644
index 8931d61ff8..0000000000
--- a/src/components/qt_hmi/References/Look/Views/USB.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayout {
- id:home
-
- }
-
-
- }
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChange" }
- },
- FTrgTouchArea { touchArea:home.browseBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.albumInfoBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.seekBkBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.seekFdBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.playBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.shuffleBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgTouchArea { touchArea:home.repeatBtn; touchAction: TA.Out
- FActViewShow { view: "Start" }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/USBPCA.qml b/src/components/qt_hmi/References/Look/Views/USBPCA.qml
deleted file mode 100644
index 0b1b47270e..0000000000
--- a/src/components/qt_hmi/References/Look/Views/USBPCA.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "USB"
- sourceBtn.textWidth: 50
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Views/iPodPCA.qml b/src/components/qt_hmi/References/Look/Views/iPodPCA.qml
deleted file mode 100644
index f4d3f68b78..0000000000
--- a/src/components/qt_hmi/References/Look/Views/iPodPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Layouts"
-import "../Animations"
-import "../Widgets"
-import ".."
-
-FStateView {
- priority: 2
- //attachedViews: ["Chrome"]
-
-
-
- view: FView {
- id: v
-
- layout: USBLayoutPCA {
- id:home
- sourceBtn.text: "iPod"
- sourceBtn.textWidth: 50
- playing: true
- }
-
-
- }
-
-
-
- triggers: [
-
-
-
- FTrgTouchArea { touchArea:home.sourceBtn.touchBtn; touchAction: TA.Out
- FActViewShow { view: "SourceChangePCA" }
- },
- FTrgTouchArea { touchArea:home.play; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = false }
- },
- FTrgTouchArea { touchArea:home.pause; touchAction: TA.Out
- FActScriptCall { onScript: home.playing = true }
- },
- FTrgEvent { event: closeNormalScreens
- FActViewHide{}
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml
deleted file mode 100644
index 2e89924a20..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/FocusListViewLayout.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theLayout
-
- property alias list : theListView
- property alias list_itemWidget: theListView.itemWidget
- property alias list_data: theListView.data
- property bool listWrap: false
-
- FWdgtListView {
- id: theListView
- anchors.fill: theLayout
- clip: true
- //interactive: false
- highlightFollowsCurrentItem: true
- highlightMoveDuration: 100
- highlightMoveVelocity: -1
- keyNavigationWraps: listWrap
- highlight:
- Rectangle {
- id: focus
- height: 51
- width: theLayout.width
- radius: 10
- color: "transparent"
- border { color: "white"; width: 2 }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml
deleted file mode 100644
index cbe1737984..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewImgItemLayout.qml
+++ /dev/null
@@ -1,25 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: theItem
- width: 200
- height: 178
-
- property alias bitmap : _img.bitmap
- property alias touch: _touch
-
-
- FWdgtImage{
- id: _img
- anchors.centerIn: theItem
- }
-
- FWdgtTouchArea{
- id: _touch
- anchors.fill: theItem
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml
deleted file mode 100644
index 2e7712a65e..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewItemLayout.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: theItem
-
- property alias cx_text : _btn.text
- property int indentLevel: 0
- property alias touch: _btn.touchBtn
- property alias pressed: _btn.pressed
-
-
- TouchButton_PCA{
- id: _btn
- anchors.left: theItem.left
- anchors.leftMargin: 10
- anchors.top: theItem.top
- anchors.topMargin: 10
- textWidth: 100
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml
deleted file mode 100644
index d5fb962461..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewLayout.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theLayout
-
- property alias list : theGridView
- property alias list_itemWidget: theGridView.itemWidget
- property alias list_data: theGridView.data
- property bool listWrap: false
- property alias gridItemHeight: theGridView.cellHeight
- property alias gridItemWidth: theGridView.cellWidth
-
- FWdgtGridView {
- id: theGridView
- anchors.fill: theLayout
- clip: true
- highlightFollowsCurrentItem: true
- highlightMoveDuration: 100
- keyNavigationWraps: listWrap
- flow: GridView.TopToBottom
- snapMode: GridView.SnapOneRow
-
-
-
-
- populate: Transition {
- id: populateTransition
- SequentialAnimation {
- PropertyAction { property: "opacity"; value: 0 }
- PauseAnimation { duration: populateTransition.ViewTransition.index * 100 }
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 300 }
- }
- }
-
- add: Transition {
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 200 }
- }
-
- addDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }
-
- remove: Transition {
- NumberAnimation { properties: "opacity"; from: 1; to: 0; duration: 200 }
- }
-
- removeDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }
-
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml
deleted file mode 100644
index 9b28e961f9..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetItemLayout.qml
+++ /dev/null
@@ -1,22 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FLayout {
- id: theItem
-
- property alias presetName : _preset.presetName
- property alias presetNumber: _preset.presetNumber
- property alias pressed: _preset.active
- property alias touchBtn: _preset.touchBtn
-
-
- PresetPCA{
- id: _preset
- anchors.horizontalCenter: theItem.horizontalCenter
- anchors.horizontalCenterOffset: 0
- y:20
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml
deleted file mode 100644
index 82068b5560..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/GridViewPresetLayout.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theLayout
-
- property alias list : theGridView
- property alias list_itemWidget: theGridView.itemWidget
- property alias list_data: theGridView.data
- property bool listWrap: false
- property alias gridItemHeight: theGridView.cellHeight
- property alias gridItemWidth: theGridView.cellWidth
- property alias curItem: theGridView.currentIndex
- property alias moving: theGridView.moving
- property alias direction: theGridView.flickDeceleration
-
-
- FWdgtGridView {
- id: theGridView
- anchors.fill: theLayout
- clip: true
- highlightFollowsCurrentItem: true
- highlightMoveDuration: 100
- keyNavigationWraps: listWrap
- flow: GridView.TopToBottom
- snapMode: GridView.SnapToRow
-
-
-
-
-
- /* populate: Transition {
- id: populateTransition
- SequentialAnimation {
- PropertyAction { property: "opacity"; value: 0 }
- PauseAnimation { duration: populateTransition.ViewTransition.index * 100 }
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 300 }
- }
- }
-
- add: Transition {
- NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 200 }
- }
-
- addDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }
-
- remove: Transition {
- NumberAnimation { properties: "opacity"; from: 1; to: 0; duration: 200 }
- }
-
- removeDisplaced: Transition {
- NumberAnimation { properties: "x"; duration: 200 }
- }*/
-
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml
deleted file mode 100644
index ee2c0369f0..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/PhoneListWdgtLayout.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
-
- id: theItem
- height: 50; width: 50
-
- property alias cx_text: cx.text
- property alias cn_text: cn.text
- property alias ct_text: ct.text
- property alias touch:_touch
-
- FWdgtTouchArea {
- id: touch
- anchors.fill: theItem
- }
-
- Item{
-
-
- BaseText{
- color:"#9deaec"
- id: cx
- width: 100; height: 50
-
- }
- BaseText{
- color:"#9deaec"
- id: cn
- width: 302; height: 50
- x:300
- }
-
- BaseText{
- color:"#9deaec"
- id: ct
- width: 302; height: 50
- x:500
- }
-
- }
- FWdgtTouchArea {
- id: _touch
- height: 50; width: 600
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml
deleted file mode 100644
index c927433f16..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetGridLayoutPCA.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- width: 800
- height: 115
-
- property alias m1: m1.children
- property alias list: listView
- property alias list_data: listView.list_data
- property alias list_itemWidget: listView.list_itemWidget
- property alias listWrap: listView.listWrap
- property alias fg: _fg
- property alias gridCurItem: listView.gridCurItem
- property alias moving: listView.moving
- property alias direction: listView.direction
-
-
-
- Item {
- id: _fg
-
- width: 800; height: 115
-
- GridViewPresetWidget {
- id: listView
- x: 0; y: 0
- width: 800; height: 115
- gridItemHeight: 115; gridItemWidth: 200
-
- }
-
- FWdgtContainer {
- id: m1
- width: 676; height: 115
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml
deleted file mode 100644
index 2b832f4878..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/PresetPCALayout.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property alias active: presetBtn.selected
- property alias text: presetBtn.text
- property alias touchBtn: presetBtn
- property alias presetText: presetTxt.text
-
-
- TouchButtonClimatePCA{
- id: presetBtn
- text: "X"
- image: "buttons/preset_9_9.png"
- imageActive: "buttons/presetSelected.png"
- imagePressed: "buttons/presetPressed_9_9.png"
- }
-
- BaseText{
- id: presetTxt
- anchors.horizontalCenter: presetBtn.horizontalCenter
- anchors.horizontalCenterOffset: -16
- y:59
- horAlignment: Text.AlignHCenter
- text: "104.3"
- color: "#1d81d5"
- }
-
- FViewUseCaseSimple{
- condition: presetBtn.active === true
- PropertyChanges {
- target: presetTxt; color: "white"
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml
deleted file mode 100644
index d2dc8092bd..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/SimpleItemWdgLayout.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
-
- id: theItem
- height: 50; width: 50
- property bool vis: true
-
- property alias cx_text : cx.text
-
- Item{
-
- FWdgtText{
- color:"White"
- id: cx
- width: 302; height: 45
- visible: vis
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml
deleted file mode 100644
index 7708d3ca56..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TGListItemLayout.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: theItem
- height: 50; width: parent.width
-
- property alias cx_text : cx.text
- property alias cx_width : cx.width
- property alias ax_width : ax.width
- property alias ax_bitmap : ax.bitmap
- property alias activeMarker_visible: activeMarker.visible
- property alias touch: _touch
- property int indentLevel: 0
-
- Rectangle {
- id: activeMarker
- anchors.fill: theItem
- height: 50
- radius: 10
- color: "lightgray"
- }
-
- Item {
- x: 1; y: 0
- width: 502; height: 45
-
- BaseText {
- id: cx
- anchors.fill: parent
- anchors.leftMargin: 20*indentLevel+5
- vertAlignment: Text.AlignVCenter
- }
- }
-
- FWdgtImage {
- id: ax
- x: 549; y: 3
- width: 37; height: 45
- }
-
- FWdgtTouchArea {
- id: _touch
- width: 400
- height: 50
- }
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml
deleted file mode 100644
index ff6671cef6..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonBackGroundPCALayout.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string bitmap: ""
- property bool selected: false
- property string text: ""
- property alias touchBtn: myButton
- property string image: "climate/Button_9_9.png"
- property string imageActive: "climate/ButtonActive_0_0.png"
- property string imagePressed: "climate/ButtonPressed_9_9.png"
- property string imageInActive: "climate/ButtonInActive_0_0.png"
- property bool active: true
-
-
- FWdgtImage{
- id: img
- x:-9
- y:-9
- bitmap: "Radio/PresetBtnNotSelected_9_9.png"
- }
-
- FWdgtImage{
- id: imgSelected
- x:-9
- y:-9
- bitmap: "Radio/PresetBtn_9_9.png"
- visible: false
- }
-
- FWdgtTouchArea {
- id: myButton
- anchors.fill: img
- }
-
- Rectangle {
- id: btnFill
- color: "#1d81d5"
- anchors.centerIn: myButton
- height: 46
- width: 46
- radius: 23
- visible: false
- }
-
- BaseText {
- id: btnTxt
- anchors.centerIn: myButton
- text: button.text
- color: "#1d81d5"
- }
-
-
- FViewUseCaseSimple{
- condition: button.selected === true
- PropertyChanges {
- target: img; visible: false
- }
- PropertyChanges {
- target: imgSelected; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "white"
- }
- PropertyChanges {
- target: btnFill; color: "white"
- }
- }
-
-
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: btnFill; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- }
- FViewUseCase{condition: myButton.indicatorState === true
- /* PropertyChanges {
- target: buttonArea; color: pressedColor
- }*/
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: btnFill; visible: false
- }
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml
deleted file mode 100644
index c03f89c184..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonClimatePCALayout.qml
+++ /dev/null
@@ -1,143 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string bitmap: ""
- property string bitmap2: ""
- property bool selected: false
- property alias touchBtn: myButton
- property string text: ""
- property string image: "climate/Button_9_9.png"
- property string imageActive: "climate/ButtonActive_0_0.png"
- property string imagePressed: "climate/ButtonPressed_9_9.png"
- property string imageInActive: "climate/ButtonInActive_0_0.png"
- property bool active: true
- property string newFont: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- property int txtSize: 24
- property string txtColor: "#1d81d5"
-
-
- FWdgtImage{
- id: img
- x:-9
- y:-9
- bitmap: image
- }
-
- FWdgtImage{
- id: imgSelected
- x:0
- y:0
- bitmap: imageActive
- visible: false
- }
-
- FWdgtImage{
- id: imgInBtn
- anchors.centerIn: imgSelected
- bitmap: button.bitmap
- visible: false
- //height: 10
- //width: 10
- }
-
- BaseText {
- id: btnTxt
- anchors.horizontalCenter: imgSelected.horizontalCenter
- anchors.verticalCenter: imgSelected.verticalCenter
- //anchors.verticalCenterOffset: -1
- vertAlignment: Text.AlignVCenter
- horAlignment: Text.AlignHCenter
- text: button.text
- color: button.txtColor
- visible: false
- theFont: button.newFont
- pxSize: button.txtSize
-
- }
-
- FWdgtTouchArea {
- id: myButton
- anchors.fill: imgSelected
- }
-
-
-
- FViewUseCaseSimple{
- condition: button.text !== ""
- PropertyChanges {
- target: btnTxt; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.bitmap !== ""
- PropertyChanges {
- target: imgInBtn; visible: true
- }
- }
-
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: img; bitmap: imagePressed
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap2
- }
- }
- FViewUseCase{
- condition: button.active === false
- PropertyChanges {
- target: img; visible: false
- }
- PropertyChanges {
- target: imgSelected; visible: true; bitmap: imageInActive
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: myButton; enabled: false
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap2
- }
- }
- FViewUseCase{
- condition: button.selected === true
- PropertyChanges {
- target: img; visible: false
- }
- PropertyChanges {
- target: imgSelected; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap2
- }
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: img; bitmap: image
- }
- PropertyChanges {
- target: btnTxt; color: button.txtColor
- }
- PropertyChanges {
- target: imgInBtn; bitmap: button.bitmap
- }
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml
deleted file mode 100644
index db963dc752..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCALayout.qml
+++ /dev/null
@@ -1,95 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string text: ""
- property int centerWidth: 2
- property alias touchBtn: myButton
- property alias pressed: myButton.pressed
-
- FWdgtImage{
- id: img
- x:-8
- y:-8
- bitmap: "Radio/ButtonEnd_8_8.png"
- }
-
- FWdgtImage{
- id: img1
- anchors.left: img.right
- anchors.top: img.top
- width: centerWidth
- fillMode: Image.Stretch
- bitmap: "Radio/ButtonCenter_0_8.png"
- }
-
- FWdgtImage{
- id: img2
- anchors.left: img1.right
- anchors.top: img1.top
- bitmap: "Radio/ButtonOtherEnd_8_8.png"
- }
-
- FWdgtTouchArea {
- id: myButton
- width:img1.width+44
- height: 46
- anchors.left: img1.left
- anchors.leftMargin: -22
- anchors.top: img1.top
- anchors.topMargin: 8
- }
-
- Rectangle {
- id: btnFill
- color: "#1d81d5"
- anchors.fill: myButton
- radius: 23
- border.width: 1
- border.color: "#1d81d5"
- visible: false
- }
-
- BaseText {
- id: btnTxt
- anchors.centerIn: btnFill
- text: button.text
- color: "#1d81d5"
- visible: false
- }
-
-
-
- FViewUseCaseSimple{
- condition: button.text !== ""
- PropertyChanges {
- target: btnTxt; visible: true
- }
- }
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: btnFill; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- }
- FViewUseCase{condition: indicatorState === true
- /* PropertyChanges {
- target: buttonArea; color: pressedColor
- }*/
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: btnFill; visible: false
- }
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml b/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml
deleted file mode 100644
index 35b27c056f..0000000000
--- a/src/components/qt_hmi/References/Look/WidgetLayouts/TouchButtonPCASpecialLayout.qml
+++ /dev/null
@@ -1,325 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-import "../Widgets"
-
-FLayout {
- id: button
- property string bitmap: ""
- property string bitmap2: ""
- property bool vis: true
- property string text: ""
- property string text1: ""
- property string text2: ""
- property int centerWidth: 2
- property alias touchBtn: myButton
- property int imageShift: 0
- property alias spacing: btnArea.spacing
- property alias pressed: myButton.pressed
- property int curHD: 4
- property int totHD: 4
-
- FWdgtImage{
- id: img
- x:-8
- y:-8
- bitmap: "Radio/ButtonEnd_8_8.png"
- }
-
- FWdgtImage{
- id: img1
- anchors.left: img.right
- anchors.top: img.top
- width: centerWidth
- fillMode: Image.Stretch
- bitmap: "Radio/ButtonCenter_0_8.png"
- }
-
- FWdgtImage{
- id: img2
- anchors.left: img1.right
- anchors.top: img1.top
- bitmap: "Radio/ButtonOtherEnd_8_8.png"
- }
-
- FWdgtTouchArea {
- id: myButton
- width:img1.width+44
- height: 46
- anchors.left: img1.left
- anchors.leftMargin: -22
- anchors.top: img1.top
- anchors.topMargin: 8
-
- }
-
- Rectangle {
- id: btnFill
- color: "#1d81d5"
- anchors.fill: myButton
- radius: 23
- border.width: 1
- border.color: "#1d81d5"
- visible: false
- }
-
-
- Row {
- id: btnArea
- anchors.fill: img1
- anchors.left: img1.left
- anchors.leftMargin: imageShift
- spacing: 2
-
-
- FWdgtImage{
- id: btnImg
- anchors.verticalCenter: btnArea.verticalCenter
- bitmap: button.bitmap
- visible: false
- }
-
- BaseText {
- id: btnTxt
- anchors.verticalCenter: btnArea.verticalCenter
- text: button.text
- color: "#1d81d5"
- visible: false
- }
-
- BaseText {
- id: btnTxt1
- anchors.verticalCenter: btnArea.verticalCenter
- text: button.text1
- color: "white"
- visible: false
- theFont: "../Fonts/HelveticaNeueLTStd-Bold.ttf"
- //boldTx: true
- }
-
- BaseText {
- id: btnTxt2
- anchors.verticalCenter: btnArea.verticalCenter
- text: button.text2
- color: "#1d81d5"
- visible: false
- }
-
-
- }
-
- FViewUseCaseSimple{
- condition: button.bitmap !== ""
- PropertyChanges {
- target: btnImg; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.text !== ""
- PropertyChanges {
- target: btnTxt; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.text1 !== ""
- PropertyChanges {
- target: btnTxt1; visible: true
- }
- }
-
- FViewUseCaseSimple{
- condition: button.text2 !== ""
- PropertyChanges {
- target: btnTxt2; visible: true
- }
- }
-
- FViewUseCaseGroup{
- FViewUseCase{condition: myButton.pressed === true
- PropertyChanges {
- target: btnFill; visible: true
- }
- PropertyChanges {
- target: btnTxt; color: "black"
- }
- PropertyChanges {
- target: btnTxt2; color: "black"
- }
- PropertyChanges {
- target: btnImg; bitmap: button.bitmap2
- }
- }
- FViewUseCase{condition: indicatorState === true
- /* PropertyChanges {
- target: buttonArea; color: pressedColor
- }*/
- }
- FViewUseCase{condition: myButton.pressed === false
- PropertyChanges {
- target: btnFill; visible: false
- }
- }
- }
-
-
- FViewUseCaseGroup{
- FViewUseCase{condition: totHD === -1
- PropertyChanges {
- target: button; visible: true
- }
- }
- FViewUseCase{condition: totHD === 0
- PropertyChanges {
- target: button; visible: false
- }
- }
- FViewUseCase{condition: totHD === 1
- PropertyChanges {
- target: myButton; enabled: false
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: ""
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- PropertyChanges {
- target: img1; width: 4
- }
- }
- FViewUseCase{condition: totHD === 2 && curHD === 1
- PropertyChanges {
- target: img1; width: 50
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: " 1"
- }
- PropertyChanges {
- target: btnTxt2; text: " 2"
- }
- }
- FViewUseCase{condition: totHD === 2 && curHD === 2
- PropertyChanges {
- target: img1; width: 50
- }
- PropertyChanges {
- target: btnTxt; text: " 1 "
- }
- PropertyChanges {
- target: btnTxt1; text: "2"
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- }
- FViewUseCase{condition: totHD === 3 && curHD === 1
- PropertyChanges {
- target: img1; width: 65
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: " 1"
- }
- PropertyChanges {
- target: btnTxt2; text: " 2 3"
- }
- }
- FViewUseCase{condition: totHD === 3 && curHD === 2
- PropertyChanges {
- target: img1; width: 65
- }
- PropertyChanges {
- target: btnTxt; text: " 1 "
- }
- PropertyChanges {
- target: btnTxt1; text: "2"
- }
- PropertyChanges {
- target: btnTxt2; text: " 3"
- }
- }
- FViewUseCase{condition: totHD === 3 && curHD === 3
- PropertyChanges {
- target: img1; width: 65
- }
- PropertyChanges {
- target: btnTxt; text: " 1 2 "
- }
- PropertyChanges {
- target: btnTxt1; text: "3"
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 1
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: ""
- }
- PropertyChanges {
- target: btnTxt1; text: " 1"
- }
- PropertyChanges {
- target: btnTxt2; text: " 2 3 4"
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 2
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: " 1 "
- }
- PropertyChanges {
- target: btnTxt1; text: "2"
- }
- PropertyChanges {
- target: btnTxt2; text: " 3 4"
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 3
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: " 1 2 "
- }
- PropertyChanges {
- target: btnTxt1; text: "3"
- }
- PropertyChanges {
- target: btnTxt2; text: " 4"
- }
- }
- FViewUseCase{condition: totHD === 4 && curHD === 4
- PropertyChanges {
- target: img1; width: 85
- }
- PropertyChanges {
- target: btnTxt; text: " 1 2 3 "
- }
- PropertyChanges {
- target: btnTxt1; text: "4"
- }
- PropertyChanges {
- target: btnTxt2; text: ""
- }
- }
-
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/BaseText.qml b/src/components/qt_hmi/References/Look/Widgets/BaseText.qml
deleted file mode 100644
index b9bc380bd2..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/BaseText.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FWdgtText {
- id: myText
-
- property bool enabled: true
- property bool secondary: false
- property double secondaryOpacity: 0.7
- property alias horAlignment: myText.horizontalAlignment
- property alias vertAlignment: myText.verticalAlignment
- property int pxSize: 24
- property bool boldTx: false
- property alias theFont: testFont.source
-
- color: "white"
- smooth: true
-
- property alias style: _styler.style
-
- FontLoader {
- id: testFont; source: "../Fonts/HelveticaNeueLTStd-Roman.ttf"
- }
-
- font.family: testFont.name
- font.pixelSize: pxSize
- font.bold: boldTx
- //horizontalAlignment: Text.AlignLeft
- //verticalAlignment: Text.AlignTop
-
- states: [
- State {
- name: "disabled"
- when: enabled === false
- PropertyChanges { target:myText; opacity: secondaryOpacity }
- },
-
- State {
- name: "secondary"
- when: secondary === true
- PropertyChanges { target:myText; opacity: secondaryOpacity }
- }
- ]
-
- FStyler {
- id: _styler
- styleTarget: myText
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/CondText.qml b/src/components/qt_hmi/References/Look/Widgets/CondText.qml
deleted file mode 100644
index 7b8ae4ada6..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/CondText.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-BaseText {
- FontLoader {
- id: testFont; source: "../Fonts/HelveticaNeueLTCom-LtCn.ttf"
- }
-
- font.family: testFont.name
- font.pixelSize: 30
-
- height: 51
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml b/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml
deleted file mode 100644
index 082ebdf881..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/FocusListViewWidget.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../WidgetLayouts"
-
-FWidget {
- property alias focusNext: _focusNext
- property alias focusPrevious: _focusPrevious
- property alias selectElement: _selectElement
-
- property alias list: l.list
- property alias list_itemWidget: l.list_itemWidget
- property alias list_data: l.list_data
- property alias listWrap: l.listWrap
-
- FEvent { id: _focusNext; }
- FEvent { id: _focusPrevious; }
- FEvent { id: _selectElement; }
-
- layout: FocusListViewLayout {
- id: l
- anchors.fill: parent
- }
-
- triggers: [
- FTrgEvent { event: _focusPrevious
- FActScriptCall { onScript: {
- l.list.decrementCurrentIndex();
- }
- }
- },
- FTrgEvent { event: _focusNext
- FActScriptCall { onScript: {
- l.list.incrementCurrentIndex();
- }
- }
- },
- FTrgEvent { event: _selectElement
- FActScriptCall { onScript: {
- list_data.selectElement(l.list.currentIndex);
- }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml
deleted file mode 100644
index f76057722a..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewImgItemWidget.qml
+++ /dev/null
@@ -1,31 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 178
- width: 200
-
-
-
- layout: GridViewImgItemLayout {
- id: l
- bitmap: menuIcon
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
- FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml
deleted file mode 100644
index 5b81d7e1bc..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewItemWidget.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 55
- width: 200
-
-
-
- layout: GridViewItemLayout {
- id: l
- cx_text: menuText
- indentLevel: 0
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
- FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml
deleted file mode 100644
index fa2cb44918..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetItemWidget.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 115
- width: 169
-
- property int currPreset: 0
- property bool pressed: false
-
-
-
- layout: GridViewPresetItemLayout {
- id: l
- presetName: menuText
- pressed: w.pressed
- presetNumber: index + 1
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- FViewUseCaseSimple {
- condition: w.currPreset===index+1
- PropertyChanges { target: w; pressed: true}
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touchBtn.touchBtn; touchAction: TA.Out
- FActScriptCall { onScript: w.GridView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml
deleted file mode 100644
index f232bf2c68..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewPresetWidget.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../WidgetLayouts"
-
-FWidget {
-
- property alias selectElement: _selectElement
- property alias list: l.list
- property alias list_itemWidget: l.list_itemWidget
- property alias list_data: l.list_data
- property alias listWrap: l.listWrap
- property alias gridItemHeight: l.gridItemHeight
- property alias gridItemWidth: l.gridItemWidth
- property alias gridCurItem: l.curItem
- property alias moving: l.moving
- property alias direction: l.direction
-
-
- FEvent { id: _selectElement; }
-
- layout: GridViewPresetLayout {
- id: l
- anchors.fill: parent
- }
-
- triggers: [
- FTrgEvent { event: _selectElement
- FActScriptCall { onScript: {
- list_data.selectElement(l.list.currentIndex);
- }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml b/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml
deleted file mode 100644
index cfbba62530..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/GridViewWidget.qml
+++ /dev/null
@@ -1,31 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../WidgetLayouts"
-
-FWidget {
-
- property alias selectElement: _selectElement
- property alias list: l.list
- property alias list_itemWidget: l.list_itemWidget
- property alias list_data: l.list_data
- property alias listWrap: l.listWrap
- property alias gridItemHeight: l.gridItemHeight
- property alias gridItemWidth: l.gridItemWidth
-
- FEvent { id: _selectElement; }
-
- layout: GridViewLayout {
- id: l
- anchors.fill: parent
- }
-
- triggers: [
- FTrgEvent { event: _selectElement
- FActScriptCall { onScript: {
- list_data.selectElement(l.list.currentIndex);
- }
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml
deleted file mode 100644
index 48b3bff4a6..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/MenuListItemWidget.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- id: w
- height: 50
-
- layout: TGListItemLayout {
- id: l
- anchors.fill: parent
- ax_bitmap: ""
- cx_text: menuText
- activeMarker_visible: false
- indentLevel: level
- }
-
- FViewUseCaseSimple {
- condition: isEnabled == false
- PropertyChanges { target: l
- opacity: 0.5
- }
- }
-
- FViewUseCaseGroup {
- FViewUseCase {
- condition: menuType == FMenuElement.Popup
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g137p.png"
- }
- }
-
- FViewUseCase {
- condition: menuType == FMenuElement.Submenu
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g136p.png"
- }
- }
- }
-
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.In
- FActScriptCall { onScript: w.ListView.view.model.selectElement(index) }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml
deleted file mode 100644
index df96329060..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/MenuSubmenuListItemWidget.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-// import QtQuick 2.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
- height: 50
-
- layout: TGListItemLayout {
- id: l
- anchors.fill: parent
- ax_bitmap: ""
- cx_text: menuItem
- activeMarker_visible: false
- }
-
- FViewUseCaseGroup {
- FViewUseCase {
- condition: type === "popup"
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g137p.png"
- }
-
- }
-
- FViewUseCase {
- condition: type === "arrow"
- PropertyChanges { target: l
- ax_bitmap: "../Resources/g136p.png"
- }
- }
-
- FViewUseCase {
- condition: type === "tickboxChecked"
- PropertyChanges { target: l
- gx_bitmap: "../Resources/g134p.png"
- cx_width: ++ax_width
- }
- }
-
- FViewUseCase {
- condition: type === "tickboxUnchecked"
- PropertyChanges { target: l
- gx_bitmap: "../Resources/g135p.png"
- cx_width: ++ax_width
- }
- }
-
-
- FViewUseCase {
- condition: type === ""
- PropertyChanges { target: l
- visible: true
- ax_bitmap: ""
- cx_width: ++(ax_width+gx_width)
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml b/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml
deleted file mode 100644
index d357c50dc2..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/PhoneContactListItemWdgt.qml
+++ /dev/null
@@ -1,28 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-
-FWidget {
- id: w
- height: 50
-
- property FEvent itemClicked
-
- layout: PhoneListWdgtLayout {
- anchors.fill: parent
- id: l
- cx_text: staticItem
- cn_text: staticNumber
- ct_text: type
- }
- triggers: [
- FTrgTouchArea { touchArea: l.touch; touchAction: TA.Out
- FActEventFire{ event: itemClicked; data: index }
- FActScriptCall { onScript: console.log(staticItem) }
- }
- ]
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml b/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml
deleted file mode 100644
index a575ff91eb..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/PresetPCA.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias active: button.active
- property alias presetNumber: button.text
- property alias presetName: button.presetText
- property alias touchBtn: button.touchBtn
-
-
- clip: false
-
-
-
- layout: PresetPCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml b/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml
deleted file mode 100644
index b23375f886..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/PresetsGridPCA.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-
-
-FWidget {
- id:sv
- property int currPreset: 2
- property alias listModel: l.list_data
- property alias gridCurItem: l.gridCurItem
- property alias moving: l.moving
- property alias direction: l.direction
-
-
- layout: PresetGridLayoutPCA {
- id:l
-
-
- listWrap: false
- list_data: FProxyListModel {
- id: menuProxy
- sourceModel: menuItemData
- }
- list_itemWidget: GridViewPresetItemWidget {
- currPreset: sv.currPreset
- }
- }
-
- FMenuModel {
- id: menuItemData
- FMenuElement { id: preset1; menuText: "96.3"; menuData: false; }
- FMenuElement { id: preset2; menuText: "107.9"; menuData: true }
- FMenuElement { id: preset3; menuText: "104.3"; menuData: false }
- FMenuElement { id: preset4; menuText: "101.9"; menuData: false }
- FMenuElement { id: preset5; menuText: "97.1"; menuData: false }
- FMenuElement { id: preset6; menuText: "91.7"; menuData: false }
- FMenuElement { id: preset7; menuText: "101.1"; menuData: false }
- FMenuElement { id: preset8; menuText: "91.9"; menuData: false}
- }
-
- FViewUseCaseSimple { condition: sv.isInEntry
- PropertyChanges { target: l; list_data: null }
- }
-
-
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml b/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml
deleted file mode 100644
index b1f67d043c..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/ScrollBar.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Item {
- id: scrollbar
- property variant target
-
- clip: true
-
- //anchors {top: target.top; bottom: target.bottom; right: target.right }
- visible: (track.height == slider.height) ? false : true //TODO: !visible -> width: 0 (but creates a binding loop)
-
- Timer {
- property int scrollAmount
-
- id: timer
- repeat: true
- interval: 20
- onTriggered: {
- target.contentY = Math.max(
- 0, Math.min(
- target.contentY + scrollAmount,
- target.contentHeight - target.height));
- }
- }
-
- MouseArea {
- anchors.fill: scrollbar
- onPressed: {
- timer.scrollAmount = target.height * (mouseY < slider.y ? -1 : 1) // scroll by a page
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
-
- Rectangle {
- id: track
-
- color: "red"
- opacity: 0.3
- radius: 2
- smooth: true
-
- anchors.top: scrollbar.top
- anchors.bottom: scrollbar.bottom
- anchors.horizontalCenter: scrollbar.horizontalCenter
- width: 3
- }
-
- Rectangle {
- id:slider
-
- width: scrollbar.width
- color: "red"
- opacity: 0.7
- radius: 4
- smooth: true
-
- height: Math.min(target.height / target.contentHeight * track.height, track.height)
- y: target.visibleArea.yPosition * track.height
-
- MouseArea {
- anchors.fill: parent
- drag.target: parent
- drag.axis: Drag.YAxis
- drag.minimumY: 0
- drag.maximumY: track.height - height
-
- onPositionChanged: {
- if (pressedButtons == Qt.LeftButton) {
- target.contentY = slider.y * target.contentHeight / track.height
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml
deleted file mode 100644
index c05e1ab525..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-
-FWdgtTouchArea {
- id: button
-
- property string text: "Text"
- property string bitmap: ""
- property int wrapText: Text.NoWrap
- property bool indicatorState: false
- property string unpressedColor: "gray"
- property string pressEventColor: "lightGray"
- property string pressedColor: "darkGray"
- property bool vis: true
-
-
- width: 120
- height: 40
- enabled: button.vis
-
-
-
- Rectangle {
- id: buttonArea
- radius: 10
- anchors.centerIn: parent
- width: button.width
- height: button.height
- color: "gray"
- visible: button.vis
-
- BaseText {
- id: st
- anchors.centerIn: parent
- text: button.text
- wrapMode: wrapText
- visible: button.vis
- }
-
- FWdgtImage{
- id: img
- anchors.fill: buttonArea
- bitmap: button.bitmap
- visible: false
- }
-
-
- }
-
- FViewUseCaseSimple{
- condition: button.bitmap !== ""
- PropertyChanges {
- target: img; visible: true
- }
- }
-
- FViewUseCaseGroup{
- FViewUseCase{condition: pressed === true
- PropertyChanges {
- target: buttonArea; color: pressEventColor
- }
- }
- FViewUseCase{condition: indicatorState === true
- PropertyChanges {
- target: buttonArea; color: pressedColor
- }
- }
- FViewUseCase{condition: pressed === false
- PropertyChanges {
- target: buttonArea; color: unpressedColor
- }
- }
- }
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml
deleted file mode 100644
index 2f3ca939a2..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButton2.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import QtGraphicalEffects 1.0
-import "../Widgets"
-
-
-
-Item {
- width: 160
- height: 45
-
- RectangularGlow {
- id: effect
- anchors.fill: rect
- glowRadius: 10
- spread: 0.2
- color: "#1d81d5"
- cornerRadius: rect.radius + glowRadius
- }
-
- Rectangle {
- id: rect
- color: "black"
- anchors.centerIn: parent
- width: 160
- height: 45
- radius: 25
- border.color: "#1d81d5"
- }
-}
-
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml
deleted file mode 100644
index 6dbd6b125b..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButtonBackGround_PCA.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias bitmap:button.bitmap
- property alias active: button.selected
- property alias text: button.text
- property alias touchBtn: button.touchBtn
-
-
- clip: false
-
-
-
- layout: TouchButtonBackGroundPCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml
deleted file mode 100644
index 401e538201..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButtonClimatePCA.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias bitmap: button.bitmap
- property alias bitmap2: button.bitmap2
- property alias selected: button.selected
- property alias touchBtn: button.touchBtn
- property alias text: button.text
- property alias image: button.image
- property alias imageActive: button.imageActive
- property alias imagePressed: button.imagePressed
- property alias imageInActive: button.imageInActive
- property alias active: button.active
- property alias newFont: button.newFont
- property alias txtSize: button.txtSize
- property alias txtColor: button.txtColor
-
-
- height: 80
- width: 80
- clip: false
-
-
-
- layout: TouchButtonClimatePCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml
deleted file mode 100644
index e48c5f2762..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButtonSpecial_PCA.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
- property alias bitmap:button.bitmap
- property alias bitmap2: button.bitmap2
- property alias text: button.text
- property alias text1: button.text1
- property alias text2:button.text2
- property alias textWidth: button.centerWidth
- property alias touchBtn: button.touchBtn
- property alias imageShift: button.imageShift
- property alias spacing: button.spacing
- property alias pressed: button.pressed
- property alias curHD: button.curHD
- property alias totHD: button.totHD
- width: 164
- clip: false
-
-
-
- layout: TouchButtonPCASpecialLayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml b/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml
deleted file mode 100644
index e46dbf28c5..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/TouchButton_PCA.qml
+++ /dev/null
@@ -1,27 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-FWidget {
-
- id:pcaButton
-
-
- property alias text: button.text
- property alias textWidth: button.centerWidth
- property alias touchBtn: button.touchBtn
- property alias pressed: button.pressed
- width: textWidth+44
- clip: false
-
-
-
- layout: TouchButtonPCALayout{
- id:button
- }
-
-
-
-}
-
diff --git a/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml b/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml
deleted file mode 100644
index 42049240fd..0000000000
--- a/src/components/qt_hmi/References/Look/Widgets/VerySimpleListItemWidget.qml
+++ /dev/null
@@ -1,18 +0,0 @@
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-import "../Widgets"
-import "../WidgetLayouts"
-
-
-FWidget {
- id: w
- height: 50
- property alias vis: l.vis
-
- layout: SimpleItemWdgLayout {
- anchors.fill: parent
- id: l
- cx_text: staticItem
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll
deleted file mode 100644
index 52506bb139..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFramework.dll
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll
deleted file mode 100644
index 4d811bed1e..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.dll
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb
deleted file mode 100644
index b6a4d31838..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/QtHMIFrameworkd.pdb
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes
deleted file mode 100644
index b03753aa5c..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/plugin.qmltypes
+++ /dev/null
@@ -1,682 +0,0 @@
-import QtQuick.tooling 1.1
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated with the command 'C:\Qt\Qt5.0.1\5.0.1\msvc2010\bin\qmlplugindump.exe -notrelocatable com.ford.hmiframework 1.0 C:\HMIRepository\trunk\Framework\QtHMIFramework\output'.
-
-Module {
- Component {
- name: "FAbstractListElement"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FAbstractListElement 1.0"]
- Signal {
- name: "elementSelected"
- Parameter { name: "element"; type: "FAbstractListElement"; isPointer: true }
- }
- Method { name: "selectElement" }
- }
- Component {
- name: "FAbstractListModel"
- prototype: "QAbstractListModel"
- exports: ["com.ford.hmiframework/FAbstractListModel 1.0"]
- Signal {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- Parameter { type: "int" }
- }
- }
- Component {
- name: "FActAnimControl"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActAnimControl 1.0"]
- Property { name: "animation"; type: "FAnimation"; isPointer: true }
- Property { name: "animAction"; type: "int" }
- }
- Component {
- name: "FActEventFire"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActEventFire 1.0"]
- Property { name: "event"; type: "FEvent"; isPointer: true }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FActFunction"
- defaultProperty: "actions"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActFunction 1.0"]
- Property { name: "data"; type: "QVariant" }
- Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
- }
- Component {
- name: "FActFunctionCall"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActFunctionCall 1.0"]
- Property { name: "func"; type: "FActFunction"; isPointer: true }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FActHistoryClear"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryClear 1.0"]
- Property { name: "queue"; type: "string" }
- }
- Component {
- name: "FActHistoryPop"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryPop 1.0"]
- Property { name: "queue"; type: "string" }
- }
- Component {
- name: "FActHistoryPush"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryPush 1.0"]
- Property { name: "queue"; type: "string" }
- Property { name: "animation"; type: "string" }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FActHistoryShow"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActHistoryShow 1.0"]
- Property { name: "queue"; type: "string" }
- Property { name: "animation"; type: "string" }
- Property { name: "skipMe"; type: "bool" }
- }
- Component {
- name: "FActViewHide"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActViewHide 1.0"]
- Property { name: "view"; type: "string" }
- Property { name: "animation"; type: "string" }
- }
- Component {
- name: "FActViewShow"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FActViewShow 1.0"]
- Property { name: "view"; type: "string" }
- Property { name: "animation"; type: "string" }
- Property { name: "data"; type: "QVariant" }
- }
- Component {
- name: "FAction"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FAction 1.0"]
- Property { name: "passed"; type: "bool" }
- Signal { name: "execute" }
- Method { name: "getDisplay"; type: "FDisplay*" }
- Method { name: "getStateView"; type: "FStateView*" }
- }
- Component {
- name: "FAnimView"
- defaultProperty: "data"
- prototype: "FAnimation"
- exports: ["com.ford.hmiframework/FAnimView 1.0"]
- Property { name: "inView"; type: "FStateView"; isPointer: true }
- Property { name: "outView"; type: "FStateView"; isPointer: true }
- Property { name: "ingoing"; type: "FLayout"; isReadonly: true; isPointer: true }
- Property { name: "outgoing"; type: "FLayout"; isReadonly: true; isPointer: true }
- }
- Component {
- name: "FAnimation"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FAnimation 1.0"]
- Property { name: "isRunning"; type: "bool"; isReadonly: true }
- Signal {
- name: "animationComplete"
- Parameter { name: "anim"; type: "FAnimation"; isPointer: true }
- }
- }
- Component {
- name: "FAnimationCoordinator"
- defaultProperty: "defaultAnims"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FAnimationCoordinator 1.0"]
- Property { name: "defaultAnims"; type: "FDefaultAnimation"; isList: true; isReadonly: true }
- }
- Component {
- name: "FDefaultAnimation"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FDefaultAnimation 1.0"]
- Property { name: "from"; type: "FViewClass"; isPointer: true }
- Property { name: "to"; type: "FViewClass"; isPointer: true }
- Property { name: "animation"; type: "string" }
- }
- Component {
- name: "FDisplay"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FDisplay 1.0"]
- Property { name: "xPixel"; type: "int" }
- Property { name: "yPixel"; type: "int" }
- Property { name: "initialView"; type: "string" }
- Property { name: "initialAnim"; type: "string" }
- Property { name: "modelPath"; type: "QUrl" }
- Property { name: "activeVariant"; type: "string" }
- Property { name: "priorityLayerCount"; type: "int" }
- Property { name: "minPriority"; type: "int" }
- Property { name: "priorityLayerDebug"; type: "QStringList"; isReadonly: true }
- Property { name: "viewCacheSize"; type: "int" }
- Signal { name: "preStartInit" }
- Method {
- name: "animationCompleted"
- Parameter { type: "FAnimation"; isPointer: true }
- }
- Method { name: "updateDebugInformation" }
- }
- Component {
- name: "FEvent"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FEvent 1.0"]
- Signal {
- name: "fire"
- Parameter { name: "data"; type: "QVariant" }
- }
- Method {
- name: "doFire"
- Parameter { name: "data"; type: "QVariant" }
- }
- }
- Component {
- name: "FGrdCondition"
- defaultProperty: "actions"
- prototype: "FGuard"
- exports: ["com.ford.hmiframework/FGrdCondition 1.0"]
- Property { name: "condition"; type: "bool" }
- }
- Component {
- name: "FGuard"
- defaultProperty: "actions"
- prototype: "FAction"
- exports: ["com.ford.hmiframework/FGuard 1.0"]
- Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
- }
- Component {
- name: "FHardwareControl"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FHardwareControl 1.0"]
- Property { name: "hardwareControlID"; type: "string" }
- Signal {
- name: "checkKeyPressed"
- Parameter { name: "key"; type: "int" }
- }
- Signal {
- name: "checkKeyReleased"
- Parameter { name: "key"; type: "int" }
- }
- Method {
- name: "sendHardwareControlEvent"
- Parameter { name: "data"; type: "int" }
- }
- }
- Component {
- name: "FHardwareKey"
- defaultProperty: "data"
- prototype: "FHardwareControl"
- exports: ["com.ford.hmiframework/FHardwareKey 1.0"]
- Property { name: "pressed"; type: "bool" }
- Property { name: "keyboardKey"; type: "int" }
- Property { name: "longPressMSec"; type: "int" }
- Property { name: "repeatDelayMSec"; type: "int" }
- Property { name: "repeatIntervalMSec"; type: "int" }
- }
- Component {
- name: "FHardwareRotary"
- defaultProperty: "knob"
- prototype: "FHardwareControl"
- exports: ["com.ford.hmiframework/FHardwareRotary 1.0"]
- Property { name: "knob"; type: "QQuickItem"; isPointer: true }
- Property { name: "stepsPerRotation"; type: "int" }
- Property { name: "currentAbsPosition"; type: "int" }
- Property { name: "currentRelPosition"; type: "int" }
- Property { name: "generateEvents"; type: "bool" }
- Property { name: "updateInterval"; type: "int" }
- }
- Component {
- name: "FLayer"
- defaultProperty: "data"
- prototype: "FWidgetBase"
- exports: ["com.ford.hmiframework/FLayer 1.0"]
- Property { name: "layerID"; type: "int" }
- Property { name: "initialView"; type: "string" }
- Property { name: "activeViewName"; type: "string" }
- }
- Component {
- name: "FLayout"
- defaultProperty: "data"
- prototype: "FMetaInfoItem"
- exports: ["com.ford.hmiframework/FLayout 1.0"]
- Property { name: "viewX"; type: "double" }
- Property { name: "viewY"; type: "double" }
- Property { name: "viewZ"; type: "double" }
- }
- Component {
- name: "FLogHandlerItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FLogHandlerItem 1.0"]
- Signal {
- name: "newEntry"
- Parameter { name: "s"; type: "string" }
- }
- }
- Component {
- name: "FLogger"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FLogger 1.0"]
- Property { name: "perfStamp"; type: "bool" }
- Method {
- name: "debug"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "warning"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "error"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "info"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- Method {
- name: "perf"
- Parameter { name: "name"; type: "string" }
- Parameter { name: "s"; type: "string" }
- }
- }
- Component {
- name: "FLoggerConsole"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FLoggerConsole 1.0"]
- }
- Component {
- name: "FLoggerFile"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FLoggerFile 1.0"]
- Property { name: "file"; type: "string" }
- }
- Component {
- name: "FMenuElement"
- defaultProperty: "children"
- prototype: "FTreeElement"
- exports: ["com.ford.hmiframework/FMenuElement 1.0"]
- Enum {
- name: "MenuElementType"
- values: {
- "Undefined": 0,
- "Submenu": 1,
- "Popup": 2,
- "Hyperlink": 3,
- "Checkbox": 4,
- "Radiobutton": 5,
- "Multistate": 6
- }
- }
- Property { name: "isVisible"; type: "bool" }
- Property { name: "isEnabled"; type: "bool" }
- Property { name: "menuType"; type: "int" }
- Property { name: "menuText"; type: "string" }
- Property { name: "menuIcon"; type: "string" }
- Property { name: "menuStatus"; type: "int" }
- Property { name: "menuData"; type: "QVariant" }
- }
- Component {
- name: "FMenuModel"
- defaultProperty: "children"
- prototype: "FTreeModel"
- exports: ["com.ford.hmiframework/FMenuModel 1.0"]
- }
- Component {
- name: "FMetaInfoItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FMetaInfoItem 1.0"]
- Property { name: "metaInfo"; type: "string" }
- Property { name: "metaID"; type: "string" }
- Property { name: "metaVersion"; type: "string" }
- }
- Component {
- name: "FMetaInfoObject"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FMetaInfoObject 1.0"]
- Property { name: "metaInfo"; type: "string" }
- Property { name: "metaID"; type: "string" }
- Property { name: "metaVersion"; type: "string" }
- }
- Component {
- name: "FProxyListModel"
- prototype: "QIdentityProxyModel"
- exports: ["com.ford.hmiframework/FProxyListModel 1.0"]
- Property { name: "sourceModel"; type: "FAbstractListModel"; isPointer: true }
- Property { name: "isFrozen"; type: "bool" }
- Signal {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- Parameter { type: "int" }
- }
- Method {
- name: "selectElement"
- Parameter { name: "index"; type: "int" }
- }
- }
- Component {
- name: "FReactiveElementBase"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FReactiveElementBase 1.0"]
- Property { name: "triggers"; type: "FTrigger"; isList: true; isReadonly: true }
- }
- Component {
- name: "FState"
- prototype: "FStateBase"
- exports: ["com.ford.hmiframework/FState 1.0"]
- Property { name: "baseBehavior"; type: "FStateBase"; isPointer: true }
- }
- Component {
- name: "FStateBase"
- prototype: "FReactiveElementBase"
- exports: ["com.ford.hmiframework/FStateBase 1.0"]
- }
- Component {
- name: "FStateView"
- defaultProperty: "childObjects"
- prototype: "FState"
- exports: ["com.ford.hmiframework/FStateView 1.0"]
- Property { name: "priority"; type: "int" }
- Property { name: "visualPriority"; type: "int" }
- Property { name: "view"; type: "FView"; isPointer: true }
- Property { name: "preload"; type: "QVariant" }
- Property { name: "attachedViews"; type: "QStringList" }
- Property { name: "childObjects"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "isInEntry"; type: "bool"; isReadonly: true }
- Property { name: "isInExit"; type: "bool"; isReadonly: true }
- Signal {
- name: "entry"
- Parameter { name: "previousView"; type: "string" }
- Parameter { name: "data"; type: "QVariant" }
- }
- Signal { name: "entryComplete" }
- Signal { name: "exit" }
- Signal { name: "exitComplete" }
- }
- Component {
- name: "FThemeProvider"
- prototype: "QObject"
- exports: ["com.ford.hmiframework/FThemeProvider 1.0"]
- Property { name: "theme"; type: "string" }
- Property { name: "resourcePath"; type: "QUrl" }
- Method {
- name: "getFileSubPath"
- type: "string"
- Parameter { type: "string" }
- }
- Method {
- name: "getStyle"
- type: "FStyle*"
- Parameter { type: "string" }
- }
- Method {
- name: "applyStyle"
- Parameter { name: "target"; type: "QObject"; isPointer: true }
- Parameter { name: "styleName"; type: "string" }
- }
- }
- Component {
- name: "FTreeElement"
- defaultProperty: "children"
- prototype: "FAbstractListElement"
- exports: ["com.ford.hmiframework/FTreeElement 1.0"]
- Property { name: "children"; type: "FTreeElement"; isList: true; isReadonly: true }
- Property { name: "level"; type: "int"; isReadonly: true }
- Property { name: "isOpened"; type: "bool" }
- }
- Component {
- name: "FTreeModel"
- defaultProperty: "children"
- prototype: "FAbstractListModel"
- exports: ["com.ford.hmiframework/FTreeModel 1.0"]
- Property { name: "children"; type: "FTreeElement"; isList: true; isReadonly: true }
- Property { name: "root"; type: "FTreeElement"; isPointer: true }
- Property { name: "rootRoot"; type: "FTreeElement"; isReadonly: true; isPointer: true }
- Method {
- name: "openElement"
- Parameter { name: "numIndex"; type: "int" }
- }
- Method {
- name: "closeElement"
- Parameter { name: "numIndex"; type: "int" }
- }
- Method {
- name: "selectElement"
- Parameter { name: "index"; type: "int" }
- }
- }
- Component {
- name: "FTrgAnimCompleted"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgAnimCompleted 1.0"]
- Property { name: "animation"; type: "FAnimation"; isPointer: true }
- Method {
- name: "animCompleted"
- Parameter { type: "FAnimation"; isPointer: true }
- }
- }
- Component {
- name: "FTrgCondition"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgCondition 1.0"]
- Property { name: "condition"; type: "bool" }
- Property { name: "checkOnEntry"; type: "bool" }
- }
- Component {
- name: "FTrgEntry"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgEntry 1.0"]
- Property { name: "previousView"; type: "string"; isReadonly: true }
- Property { name: "data"; type: "QVariant"; isReadonly: true }
- Method {
- name: "entry"
- Parameter { name: "previousView"; type: "string" }
- Parameter { name: "data"; type: "QVariant" }
- }
- }
- Component {
- name: "FTrgEntryComplete"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgEntryComplete 1.0"]
- }
- Component {
- name: "FTrgEvent"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgEvent 1.0"]
- Property { name: "event"; type: "FEvent"; isPointer: true }
- Property { name: "data"; type: "QVariant" }
- Method {
- name: "eventTrigger"
- Parameter { name: "data"; type: "QVariant" }
- }
- }
- Component {
- name: "FTrgExit"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgExit 1.0"]
- }
- Component {
- name: "FTrgExitComplete"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgExitComplete 1.0"]
- }
- Component {
- name: "FTrgHardwareControl"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgHardwareControl 1.0"]
- Property { name: "hardControls"; type: "QVariant" }
- Signal {
- name: "handleHardwareControlEvent"
- Parameter { name: "action"; type: "int" }
- }
- }
- Component {
- name: "FTrgHardwareKey"
- defaultProperty: "actions"
- prototype: "FTrgHardwareControl"
- exports: ["com.ford.hmiframework/FTrgHardwareKey 1.0"]
- Property { name: "keyAction"; type: "int" }
- Property { name: "hardkeys"; type: "QVariant" }
- }
- Component {
- name: "FTrgHardwareRotary"
- defaultProperty: "actions"
- prototype: "FTrgHardwareControl"
- exports: ["com.ford.hmiframework/FTrgHardwareRotary 1.0"]
- Property { name: "valueChange"; type: "int" }
- Property { name: "rotary"; type: "QVariant" }
- }
- Component {
- name: "FTrgListModel"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgListModel 1.0"]
- Property { name: "model"; type: "FAbstractListModel"; isPointer: true }
- Property { name: "element"; type: "FAbstractListElement"; isReadonly: true; isPointer: true }
- Property { name: "index"; type: "int"; isReadonly: true }
- Method {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- Parameter { type: "int" }
- }
- }
- Component {
- name: "FTrgMenuElement"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgMenuElement 1.0"]
- Property { name: "menuElement"; type: "FMenuElement"; isPointer: true }
- Method {
- name: "elementSelected"
- Parameter { type: "FAbstractListElement"; isPointer: true }
- }
- }
- Component {
- name: "FTrgTouchArea"
- defaultProperty: "actions"
- prototype: "FTrigger"
- exports: ["com.ford.hmiframework/FTrgTouchArea 1.0"]
- Property { name: "touchArea"; type: "FWdgtTouchArea"; isPointer: true }
- Property { name: "touchAction"; type: "int" }
- Property { name: "xPos"; type: "int" }
- Property { name: "yPos"; type: "int" }
- Method {
- name: "touchEvent"
- Parameter { name: "action"; type: "int" }
- Parameter { name: "x"; type: "int" }
- Parameter { name: "y"; type: "int" }
- }
- }
- Component {
- name: "FTrigger"
- defaultProperty: "actions"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FTrigger 1.0"]
- Property { name: "initialized"; type: "bool" }
- Property { name: "actions"; type: "FAction"; isList: true; isReadonly: true }
- Signal {
- name: "init"
- Parameter { type: "FStateView"; isPointer: true }
- }
- Signal {
- name: "cleanup"
- Parameter { type: "FStateView"; isPointer: true }
- }
- Signal { name: "intializedChanged" }
- }
- Component {
- name: "FView"
- defaultProperty: "data"
- prototype: "FWidget"
- exports: ["com.ford.hmiframework/FView 1.0"]
- Property { name: "viewClass"; type: "FViewClass"; isPointer: true }
- }
- Component {
- name: "FViewClass"
- defaultProperty: "derivedClass"
- prototype: "FMetaInfoObject"
- exports: ["com.ford.hmiframework/FViewClass 1.0"]
- Property { name: "derivedClass"; type: "FViewClass"; isList: true; isReadonly: true }
- }
- Component {
- name: "FWdgtTouchArea"
- defaultProperty: "data"
- prototype: "QQuickItem"
- exports: ["com.ford.hmiframework/FWdgtTouchArea 1.0"]
- Property { name: "pressed"; type: "bool" }
- Property { name: "enabled"; type: "bool" }
- Property { name: "longPressMSec"; type: "int" }
- Property { name: "repeatDelayMSec"; type: "int" }
- Property { name: "repeatIntervalMSec"; type: "int" }
- Signal {
- name: "touchEvent"
- Parameter { name: "event"; type: "int" }
- Parameter { name: "x"; type: "int" }
- Parameter { name: "y"; type: "int" }
- }
- }
- Component {
- name: "FWidget"
- defaultProperty: "data"
- prototype: "FWidgetBase"
- exports: ["com.ford.hmiframework/FWidget 1.0"]
- Property { name: "layout"; type: "FLayout"; isPointer: true }
- Property { name: "triggers"; type: "FTrigger"; isList: true; isReadonly: true }
- }
- Component { name: "FWidgetBase"; defaultProperty: "data"; prototype: "FMetaInfoItem" }
- Component {
- name: "QAbstractProxyModel"
- prototype: "QAbstractItemModel"
- Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true }
- }
- Component { name: "QIdentityProxyModel"; prototype: "QAbstractProxyModel" }
- Component {
- name: "QSortFilterProxyModel"
- prototype: "QAbstractProxyModel"
- exports: ["com.ford.hmiframework/FSortFilterProxyListModel 1.0"]
- Property { name: "filterRegExp"; type: "QRegExp" }
- Property { name: "filterKeyColumn"; type: "int" }
- Property { name: "dynamicSortFilter"; type: "bool" }
- Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" }
- Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" }
- Property { name: "isSortLocaleAware"; type: "bool" }
- Property { name: "sortRole"; type: "int" }
- Property { name: "filterRole"; type: "int" }
- Method {
- name: "setFilterRegExp"
- Parameter { name: "pattern"; type: "string" }
- }
- Method {
- name: "setFilterWildcard"
- Parameter { name: "pattern"; type: "string" }
- }
- Method {
- name: "setFilterFixedString"
- Parameter { name: "pattern"; type: "string" }
- }
- Method { name: "clear" }
- Method { name: "invalidate" }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml
deleted file mode 100644
index c95ebd3191..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtBorderImage.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-BorderImage {
- property string bitmap: ""
- property bool themed: false
-
- onBitmapChanged: {
- applyThemedImage();
- }
-
- function applyThemedImage() {
- if (bitmap !== "") {
- if (themed) {
- source = FThemeProvider.resourcePath + "/" + FThemeProvider.theme + "/" + bitmap;
- }
- else {
- source = FThemeProvider.resourcePath + "/" + bitmap;
- }
- }
- else {
- source = "";
- }
- }
-
- Component.onCompleted: {
- if (themed)
- {
- FThemeProvider.themeChanged.connect(applyThemedImage);
- }
- }
-
- Component.onDestruction: {
- if (themed)
- {
- FThemeProvider.themeChanged.disconnect(applyThemedImage);
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml
deleted file mode 100644
index f0e4720cce..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtContainer.qml
+++ /dev/null
@@ -1,8 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Item {
- id: container
-
- property alias widget: container.children
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml
deleted file mode 100644
index 61d1832db4..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtGridView.qml
+++ /dev/null
@@ -1,35 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-GridView {
- id: theGrid
-
- property alias data : theGrid.model
- property alias itemWidget : theGrid.delegate
-
- /*
- Setting rows/columns fundamentally changes how children fit into the GridView.
- -Normal behaviour: Children have a fixed size (cellWidth/cellHeight) and the NUMBER of them
- that will fit into the GridView varies with the GridView's size.
- -Modified behaviour(setting rows and/or columns triggers this mode): A fixed number of children
- will fit into the GridView (determined by number of rows/columns) and their SIZE
- (cellWidth/cellHeight) will vary with the GridView's size
- -rows/columns determines the size of VISIBLE children and simply sets cellWidth/cellHeight at runtime.
- If the number of children is different than rows * columns, it will either scroll or not
- fill the GridView completely, same as normal.
- -the item_Widget component must be designed for fluid layout using anchors, not fixed sizes,
- for this to have any effect besides spacing
- */
- property int rows
- property int columns
-
- Component.onCompleted: {
- if (rows) {
- theGrid.cellHeight = theGrid.height/rows
- }
- if (columns) {
- theGrid.cellWidth = theGrid.width/columns
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml
deleted file mode 100644
index 89e57bbf0e..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtImage.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-Image {
- property string bitmap: ""
- property bool themed: false
-
- fillMode: Image.PreserveAspectFit
- asynchronous: true
-
- onBitmapChanged: {
- applyThemedImage();
- }
-
- function applyThemedImage() {
- if (bitmap !== "") {
- if (themed) {
- source = FThemeProvider.resourcePath + "/" + FThemeProvider.getFileSubPath(bitmap) + bitmap;
- }
- else {
- source = FThemeProvider.resourcePath + "/" + bitmap;
- }
- }
- else {
- source = "";
- }
- }
-
- Component.onCompleted: {
- if (themed)
- {
- FThemeProvider.themeChanged.connect(applyThemedImage);
- }
- }
-
- Component.onDestruction: {
- if (themed)
- {
- FThemeProvider.themeChanged.disconnect(applyThemedImage);
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml
deleted file mode 100644
index 7e1ccd10a3..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtListView.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-ListView {
- id: theList
-
- property alias data : theList.model
- property alias itemWidget : theList.delegate
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml
deleted file mode 100644
index 08762015a9..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtPathView.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-PathView {
- id: thePathView
-
- property alias data : thePathView.model
- property alias itemWidget : thePathView.delegate
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml
deleted file mode 100644
index 74c1e27e9b..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollbar.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-BorderImage {
- property variant target
-
- source: "../Resources/scrollbar.png"
- border {left: 0; top: 3; right: 0; bottom: 3}
- width: 17
-
- //anchors {top: target.top; bottom: target.bottom; right: target.right }
- visible: (track.height == slider.height) ? false : true //TODO: !visible -> width: 0 (but creates a binding loop)
-
- Item {
- anchors {fill: parent; margins: 1; rightMargin: 2; bottomMargin: 2}
-
- Image {
- id: upArrow
- source: "../Resources/up-arrow.png"
- anchors.top: parent.top
- MouseArea {
- anchors.fill: parent
- onPressed: {
- timer.scrollAmount = -10
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
- }
-
- Timer {
- property int scrollAmount
-
- id: timer
- repeat: true
- interval: 20
- onTriggered: {
- target.contentY = Math.max(
- 0, Math.min(
- target.contentY + scrollAmount,
- target.contentHeight - target.height));
- }
- }
-
- Item {
- id: track
- anchors {top: upArrow.bottom; topMargin: 1; bottom: dnArrow.top;}
- width: parent.width
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- timer.scrollAmount = target.height * (mouseY < slider.y ? -1 : 1) // scroll by a page
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
-
- BorderImage {
- id:slider
-
- source: "../Resources/slider.png"
- border {left: 0; top: 3; right: 0; bottom: 3}
- width: parent.width
-
- height: Math.min(target.height / target.contentHeight * track.height, track.height)
- y: target.visibleArea.yPosition * track.height
-
- MouseArea {
- anchors.fill: parent
- drag.target: parent
- drag.axis: Drag.YAxis
- drag.minimumY: 0
- drag.maximumY: track.height - height
-
- onPositionChanged: {
- if (pressedButtons == Qt.LeftButton) {
- target.contentY = slider.y * target.contentHeight / track.height
- }
- }
- }
- }
- }
- Image {
- id: dnArrow
- source: "../Resources/dn-arrow.png"
- anchors.bottom: parent.bottom
- MouseArea {
- anchors.fill: parent
- onPressed: {
- timer.scrollAmount = 10
- timer.running = true;
- }
- onReleased: {
- timer.running = false;
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml
deleted file mode 100644
index a42f74c9fe..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtScrollview.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Flickable {
- id: theScrollView
- clip: true
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml
deleted file mode 100644
index 9e7a93773f..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtText.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Text {
- id: myText
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js
deleted file mode 100644
index f21a454065..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/BaseWidgets/FWdgtTouchAreaEnums.js
+++ /dev/null
@@ -1,12 +0,0 @@
-.pragma library
-
-var In = 1
-var Out = 2
-var Short = 4
-var Long = 8
-var Repeat = 16
-var InRepeat = 17
-var All = 31
-var Cancel = 32
-var DragOut = 64
-var DragIn = 128
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml
deleted file mode 100644
index 39862d6f22..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActScriptCall.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- signal script
-
- onExecute: {
- script();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml
deleted file mode 100644
index 5783286ccf..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActSystemModelCall.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-
-FAction {
- id: theAction
-
- signal call
-
- onExecute: {
- call();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml
deleted file mode 100644
index e31937a2b9..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActTimer.qml
+++ /dev/null
@@ -1,25 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- property variant timer
- property int action: 1
-
- onExecute: {
- switch(action)
- {
- case TM.Start:
- timer.start();
- break;
- case TM.Restart:
- timer.restart();
- break;
- case TM.Stop:
- timer.stop();
- break;
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml
deleted file mode 100644
index 6e7048fe9a..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetCall.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- signal call
-
- onExecute: {
- call();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml
deleted file mode 100644
index 040695d298..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FActWidgetProperty.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FAction {
- id: theAction
-
- signal change
-
- onExecute: {
- change();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml
deleted file mode 100644
index 4eef062bea..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimViewHide.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-FAnimView {
- supportOutgoing: true
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js
deleted file mode 100644
index 117cb99267..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FAnimationEnums.js
+++ /dev/null
@@ -1,7 +0,0 @@
-.pragma library
-
-var Start = 1
-var Restart = 2
-var Pause = 3
-var Resume = 4
-var Stop = 0
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml
deleted file mode 100644
index 97c502e517..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FConditionPool.qml
+++ /dev/null
@@ -1,5 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-QtObject {
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml
deleted file mode 100644
index 97c502e517..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FDataPool.qml
+++ /dev/null
@@ -1,5 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-QtObject {
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml
deleted file mode 100644
index add0413172..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FEventPool.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-QtObject {
- id: theEventPool
- default property alias events: theEventPool._events
- property list<FEvent> _events
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml
deleted file mode 100644
index 1886d54af7..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FGaugeValue.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-// The FGauge allows to transform an input value range into an output value rang using a smooth transition
-// it can be e.g. used to transfrom the speed of a vehicle into an angle of the pointer needle
-// The borders of the input and output ranges are mapped to each other and a linear transformation is executed
-
-Item {
- id: theGauge
-
- // the time required to move through the full range from e.g. min to max
- property int fullSweepTime: 1000
-
- // minimum border, the input value can reach
- property double minInput: 0.0
- // maximum value, the input can reach
- property double maxInput: 100.0
- // the current input value. Each change will trigger an animated change of the output
- property double currentInput: 50.0
-
- // minimum border, the output value can reach
- property double minOutput: 0.0
- // maximum value, the output can reach
- property double maxOutput: 100.0
- //
- property double currentOutput: 50.0
-
- // this is the targetted output. Changing this, will trigger the animation to be executed
- property double targetOutput
- // this is the time required to move to the target value
- property int targetTime
-
- PropertyAnimation { id: anim; target: theGauge; properties: "currentOutput"; to: theGauge.targetOutput; duration: theGauge.targetTime }
-
- onCurrentInputChanged: {
- // we need to calculate the target and the required time to reach it
- var target = (currentInput - minInput) * (maxOutput - minOutput) / (maxInput - minInput) + minOutput;
- if(target < minOutput) {
- target = minOutput;
- }
- else if (target > maxOutput) {
- target = maxOutput;
- }
-
- targetTime = Math.abs((target - currentOutput) / (maxOutput - minOutput)) * fullSweepTime;
- if(targetTime > 0) {
- targetOutput = target;
- anim.restart();
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js
deleted file mode 100644
index ee1db632a7..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FHardwareKeyEnums.js
+++ /dev/null
@@ -1,9 +0,0 @@
-.pragma library
-
-var In = 1
-var Out = 2
-var Short = 4
-var Long = 8
-var Repeat = 16
-var InRepeat = 17
-var All = 31
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js
deleted file mode 100644
index 1a1d2af589..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.js
+++ /dev/null
@@ -1,132 +0,0 @@
-var leadSection = ""
-var trailSection = ""
-var varName = ""
-var formatSection = ""
-
-var digits = 0
-var digitZeros = 0
-var decimals = 0
-var decimalsZeros = 0
-var decimalSymbol = "."
-
-function splitFormatString(format) {
- // we need to analyze the structure of the string first
- // a typical notation is like this: "{distance:#00.0#} km", where
- // "{" "}" variable limiters
- // "distance" variable name, this will be discarded and has not effect
- // "#" non-leading/-trailing zero character
- // "0" leading/trailing zero character
- // " km" additional text which will remain unchanged
- leadSection = ""
- trailSection = ""
- varName = ""
- formatSection = ""
-
- var startPos = 0;
- var searchStep = 0;
- for(var i = 0; i < format.length; ++i)
- {
- // search for the opening "{"
- if(searchStep === 0) {
- if(format.charAt(i)==='{') {
- leadSection = format.slice(startPos, i);
- startPos = i + 1;
- searchStep++;
- }
- }
- // search for the ":" or the closing "}"
- else if(searchStep === 1) {
- if(format.charAt(i) === '}') {
- formatSection = format.slice(startPos, i);
- startPos = i + 1;
- trailSection = format.slice(startPos)
- break;
- }
- else if(format.charAt(i) === ':') {
- varName = format.slice(startPos, i);
- startPos = i + 1;
- searchStep++;
- }
- }
- else if(searchStep === 2) {
- if(format.charAt(i) === '}') {
- formatSection = format.slice(startPos, i);
- startPos = i + 1;
- trailSection = format.slice(startPos)
- break;
- }
- }
- }
-
- // finally we need to create the formatting string for sprintf out of the formatSection
- digits = 0;
- digitZeros = 0;
- decimals = 0;
- decimalsZeros = 0;
- searchStep = 0;
- for(var i = 0; i < formatSection.length; ++i) {
- if(searchStep === 0) {
- if(formatSection.charAt(i) === '#') {
- digits++;
- }
- else if(formatSection.charAt(i) === '0') {
- digits++;
- digitZeros++;
- }
- else if(formatSection.charAt(i) === '.' || formatSection.charAt(i) === ',') {
- decimalSymbol = formatSection.charAt(i);
- searchStep++;
- }
- }
- else if(searchStep === 1) {
- if(formatSection.charAt(i) === '#') {
- decimals++;
- }
- else if(formatSection.charAt(i) === '0') {
- decimals++;
- decimalsZeros++;
- }
- }
- }
-}
-
-function formatOutput(data)
-{
- // format the output, first the digits
- var digitString = Math.floor(data).toString();
- if(digitString.length < digitZeros) {
- // zero pad the string
- var temp = "";
- for(var i = 0; i < digitZeros - digitString.length; ++i) {
- temp += '0';
- }
- digitString = temp + digitString;
- }
- else {
- digitString = digitString.slice(-digits);
- }
-
- var decimalString = (data - Math.floor(data)).toFixed(decimals).slice(2);
- if (decimalString.length > decimalsZeros) {
- for (var i = decimalString.length - 1; i >= decimalsZeros; i--)
- {
- if(decimalString.charAt(i) === '0')
- {
- decimalString = decimalString.slice(0, -1);
- }
- }
- }
- else {
- for (var i = decimalString.length; i < decimalsZeros; i++)
- {
- decimalString += '0';
- }
- }
-
- if (decimalString.length > 0) {
- return leadSection + digitString + decimalSymbol + decimalString + trailSection;
- }
- else {
- return leadSection + digitString + trailSection;
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml
deleted file mode 100644
index c3be3832fa..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStringFormat.qml
+++ /dev/null
@@ -1,28 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import "FStringFormat.js" as CB
-
-QtObject {
- // output string for which is used as output
- property string output
-
- // this string defines the format of the output
- property string format
-
- // this is the data to be formatted into the output
- property variant data
-
-
- onFormatChanged: {
- CB.splitFormatString(format);
- }
-
- onDataChanged: {
- doFormat();
- }
-
- function doFormat()
- {
- output = CB.formatOutput(data);
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml
deleted file mode 100644
index 5f9106f9af..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyle.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-QtObject {
- id: _style
-
- Component.onCompleted: {
- FThemeProvider.themeChanged.connect(themeChanged);
- }
-
- // This property is used to assign a "style" filename to the style. This file loads the style data and updates the properties of the style
- property string styleFile: ""
-
- property bool themed: false
-
- onStyleFileChanged: {
- loadStyle(_style);
- }
-
- function themeChanged() {
- if (themed)
- {
- loadStyle(_style);
- }
- }
-
- // indicate, that the style has been updated to the attached widgets
- signal styleUpdated
-
- function loadStyle(style)
- {
- if(styleFile.length > 0) {
- console.log( "Loading style: " + styleFile + " (" + FThemeProvider.theme + ")")
- var xhr = new XMLHttpRequest();
- xhr.open("GET", FThemeProvider.resourcePath + FThemeProvider.getFileSubPath(styleFile + ".qmlstyle") + "/" + styleFile + ".qmlstyle");
- xhr.onreadystatechange = function() {
- if (xhr.readyState === XMLHttpRequest.DONE) {
- try {
- var a = JSON.parse(xhr.responseText);
- for (var b in a) {
- if (style.hasOwnProperty(b)) {
- style[b] = a[b];
- }
- }
- styleUpdated();
- }
- catch (ex) {
- console.log("Style exception (" + styleFile + "): " + ex);
- }
- }
- }
- xhr.send();
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml
deleted file mode 100644
index 3fb89882da..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FStyler.qml
+++ /dev/null
@@ -1,41 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-QtObject {
- // this property can be FStyle, but only if the instance is created in place and not assigned. Otherwise we need to use variant
- //property FStyle style
- property variant style
- property variant styleTarget
-
- onStyleChanged: {
- if(style !== undefined && style !== null) {
- style.styleUpdated.connect(applyStyle);
- applyStyle();
- }
- }
-
- onStyleTargetChanged: {
- applyStyle();
- }
-
- function applyStyle()
- {
- if(style !== undefined && style !== null && styleTarget !== undefined && styleTarget !== null) {
- setStyledProperties(style, styleTarget)
- }
- }
-
- function setStyledProperties(style, target)
- {
- for(var prop in style) {
- // first filter unwanted properties
- if(prop !== "objectName" && prop.slice(-7) !== "Changed" ) {
- // process only properties owned by style & target
- if (target.hasOwnProperty(prop)) {
- // assign the value
- target[prop] = style[prop];
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml
deleted file mode 100644
index bc148998b9..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimer.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Timer {
- triggeredOnStart: false
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js
deleted file mode 100644
index d657de1f0c..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTimerEnums.js
+++ /dev/null
@@ -1,5 +0,0 @@
-.pragma library
-
-var Stop = 0
-var Start = 1
-var Restart = 2
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml
deleted file mode 100644
index b3ac5f8a15..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FTrgTimer.qml
+++ /dev/null
@@ -1,19 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-import com.ford.hmiframework 1.0
-
-FTrigger {
- property QtObject timer
-
- onInit: {
- timer.triggered.connect(timerTrigger);
- }
-
- onCleanup: {
- timer.triggered.disconnect(timerTrigger);
- }
-
- function timerTrigger() {
- executeActions();
- }
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml
deleted file mode 100644
index 258a1da623..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCase.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-State {
- default property alias propertyChange: myState.changes
- property alias condition: myState.when
- id: myState
- when: true === true
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml
deleted file mode 100644
index 7b1fa6ba51..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseGroup.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-StateGroup {
- id: myUseCaseGroup
- default property alias useCases: myUseCaseGroup.states
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml
deleted file mode 100644
index 44da5a5a79..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseSimple.qml
+++ /dev/null
@@ -1,15 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-StateGroup {
- default property alias propertyChange: theState.changes
- property alias condition: theState.when
-
- states: [
- State {
- id: theState
- name: "*"
- when: true == true
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml
deleted file mode 100644
index 24f6acfa4f..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qml/Framework/FViewUseCaseTransition.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
-import QtQuick 2.0
-
-Transition {
- to: "*"
-}
diff --git a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir b/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir
deleted file mode 100644
index 3ccd0e58e8..0000000000
--- a/src/components/qt_hmi/References/Look/plugins/com/ford/hmiframework/qmldir
+++ /dev/null
@@ -1,35 +0,0 @@
-module com.ford.hmiframework
-plugin QtHMIFramework
-typeinfo plugin.qmltypes
-FActScriptCall 1.0 qml/Framework/FActScriptCall.qml
-FActSystemModelCall 1.0 qml/Framework/FActSystemModelCall.qml
-FActTimer 1.0 qml/Framework/FActTimer.qml
-FActWidgetCall 1.0 qml/Framework/FActWidgetCall.qml
-FActWidgetProperty 1.0 qml/Framework/FActWidgetProperty.qml
-FConditionPool 1.0 qml/Framework/FConditionPool.qml
-FDataPool 1.0 qml/Framework/FDataPool.qml
-FEventPool 1.0 qml/Framework/FEventPool.qml
-FGaugeValue 1.0 qml/Framework/FGaugeValue.qml
-FStringFormat 1.0 qml/Framework/FStringFormat.qml
-FStyle 1.0 qml/Framework/FStyle.qml
-FStyler 1.0 qml/Framework/FStyler.qml
-FTimer 1.0 qml/Framework/FTimer.qml
-FTrgTimer 1.0 qml/Framework/FTrgTimer.qml
-FViewUseCase 1.0 qml/Framework/FViewUseCase.qml
-FViewUseCaseGroup 1.0 qml/Framework/FViewUseCaseGroup.qml
-FViewUseCaseSimple 1.0 qml/Framework/FViewUseCaseSimple.qml
-FViewUseCaseTransition 1.0 qml/Framework/FViewUseCaseTransition.qml
-FWdgtBorderImage 1.0 qml/BaseWidgets/FWdgtBorderImage.qml
-FWdgtContainer 1.0 qml/BaseWidgets/FWdgtContainer.qml
-FWdgtImage 1.0 qml/BaseWidgets/FWdgtImage.qml
-FWdgtListView 1.0 qml/BaseWidgets/FWdgtListView.qml
-FWdgtPathView 1.0 qml/BaseWidgets/FWdgtPathView.qml
-FWdgtGridView 1.0 qml/BaseWidgets/FWdgtGridView.qml
-FWdgtScrollbar 1.0 qml/BaseWidgets/FWdgtScrollbar.qml
-FWdgtScrollview 1.0 qml/BaseWidgets/FWdgtScrollview.qml
-FWdgtScrollText 1.0 qml/BaseWidgets/FWdgtScrollText.qml
-FWdgtText 1.0 qml/BaseWidgets/FWdgtText.qml
-HK 1.0 qml/Framework/FHardwareKeyEnums.js
-TA 1.0 qml/BaseWidgets/FWdgtTouchAreaEnums.js
-ANIM 1.0 qml/Framework/FAnimationEnums.js
-TM 1.0 qml/Framework/FTimerEnums.js
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro b/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro
deleted file mode 100644
index c20d41ede5..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/BananaSnacks.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add more folders to ship with the application, here
-folder_01.source = qml/Bananas
-folder_01.target = qml
-
-folder_02.source = plugins/com
-folder_02.target = plugins
-DEPLOYMENTFOLDERS = folder_01 folder_02
-
-SOURCES += main.cpp
-
-linux-g++* {
- QMAKE_CXXFLAGS += -m32
- QMAKE_LFLAGS += -m32 -L/usr/lib/i386-linux-gnu/mesa
-}
-
-# Please do not modify the following two lines. Required for deployment.
-include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
-qtcAddDeployment()
-
-OTHER_FILES += \
- qml/Bananas/Layouts/TitledLayout.qml
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop b/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop
deleted file mode 100644
index a7bfa0111f..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=Bananas
-Exec=/opt/Bananas/bin/Bananas
-Icon=Bananas64
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png b/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png
deleted file mode 100644
index 707d5c4e85..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas64.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png b/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png
deleted file mode 100644
index 6ad8096c45..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas80.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop b/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop
deleted file mode 100644
index 5ced151d06..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/Bananas_harmattan.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=Bananas
-Exec=/usr/bin/single-instance /opt/Bananas/bin/Bananas
-Icon=/usr/share/icons/hicolor/80x80/apps/Bananas80.png
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/README.md b/src/components/qt_hmi/References/Work/bananasnacks/README.md
deleted file mode 100644
index 993a4bf59d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-#### sudo vi /etc/apt/apt.conf
-
-``ruby
-Acquire::http::proxy "http://proxyvipecc.nb.ford.com:83";
-Acquire::https::proxy "https://proxyvipecc.nb.ford.com:83";
-``
-
-``bash
-sudo apt-get update
-sudo apt-get install git vim build-essential mesa-common-dev libgl1-mesa-dev # for 64bit: libc6-dev-i386 lib32stdc++6 lib32stdc++6-4.7-dev libgl1-mesa-dev:i386
-
-ssh-keygen
-<enter x3>
-cat ~/.ssh/id_rsa.pub # Save this as a public ssh key on your Gitlab account
-
-git clone git@devbox.pd8.ford.com:zchurch/bananasnacks.git # Type 'yes' to trust the remote host
-
-wget http://releases.qt-project.org/qt5/5.0.1/qt-linux-opensource-5.0.1-x86-offline.run
-chmod +x qt-linux-opensource-5.0.1-x86-offline.run
-./qt-linux-opensource-5.0.1-x86-offline.run # Press next, accept, etc... Do install the Tools. This includes Creator.
-
-echo "export PATH=\$PATH:~/Qt5.0.1/5.0.1/gcc/bin" >> ~/.bashrc
-
-cd ~/bananasnacks
-./fetch_plugins.sh
-qmake
-make
-./Bananas
-
-``
-
-
-### Troubleshooting
-
-#### bash: ./qt-linux-opensource-5.0.1-x86-offline.run: No such file or directory
-You didn't install all your apt-get things. You're missing ia32-libs. Or the file isn't there.
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject b/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject
deleted file mode 100644
index f9502d2a90..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/bananas.qmlproject
+++ /dev/null
@@ -1,19 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "qml/Bananas/main.qml"
-
- QmlFiles {
- directory: "."
- }
-
- JavaScriptFiles {
- directory: "."
- }
-
- ImageFiles {
- directory: "."
- }
-
- importPaths: [ "plugins" ]
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh b/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh
deleted file mode 100755
index 0f90baeb58..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/fetch_plugins.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-wget http://19.7.95.92/uploads/note/attachment/12/libFordMediaCore.so
-chmod 775 libFordMediaCore.so
-mv libFordMediaCore.so plugins/com/ford/mediacore
-
-wget http://19.7.95.92/uploads/note/attachment/11/libFordPhoneCore.so
-chmod 775 libFordPhoneCore.so
-mv libFordPhoneCore.so plugins/com/ford/phonecore
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh b/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh
deleted file mode 100755
index 0f094b5275..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/load_env.sh
+++ /dev/null
@@ -1 +0,0 @@
-# source ./load_env.sh
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/main.cpp b/src/components/qt_hmi/References/Work/bananasnacks/main.cpp
deleted file mode 100644
index bb40110e13..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/main.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <QtGui/QGuiApplication>
-#include <QQmlContext>
-#include "qtquick2applicationviewer.h"
-
-int main(int argc, char* argv[]) {
- QGuiApplication app(argc, argv);
-
- QtQuick2ApplicationViewer viewer;
-
- viewer.addImportPath(QStringLiteral("plugins"));
-
- viewer.setMainQmlFile(QStringLiteral("qml/Bananas/main.qml"));
- viewer.showExpanded();
-
- return app.exec();
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir
deleted file mode 100644
index bb93f40934..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/mediacore/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-module com.ford.mediacore
-plugin FordMediaCore
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir
deleted file mode 100644
index aaacfe020e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/navcore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.navcore
-plugin FordNavCore
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir
deleted file mode 100644
index 861f2e2232..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/phonecore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.phonecore
-plugin FordPhoneCore
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir b/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir
deleted file mode 100644
index da1a7b7f96..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/plugins/com/ford/sdlcore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdlcore
-plugin FordSdlCore
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png
deleted file mode 100644
index 7111c7c932..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/AddIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png
deleted file mode 100644
index d8e6079685..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BackIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png
deleted file mode 100644
index 1a65f07518..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/BluetoothIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png
deleted file mode 100644
index cfb6d6d59e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CMaxCal.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png
deleted file mode 100644
index 91ed3ef6e2..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeBottom.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png
deleted file mode 100644
index d7ba38ab8c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ChromeTop.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png
deleted file mode 100644
index 4555d71dfb..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Cloud.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png
deleted file mode 100644
index c21373f220..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/CloudNight.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png
deleted file mode 100644
index 251db8a7a5..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/FunArtwork.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png
deleted file mode 100644
index 2f8dc5130c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/MapMich.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png
deleted file mode 100644
index 49a01feeaf..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Content/SiriusArtwork.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png
deleted file mode 100644
index 52430d8c56..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Crosshairs.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png
deleted file mode 100644
index f47954968c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DeleteIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png
deleted file mode 100644
index caa6489154..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/DndIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png
deleted file mode 100644
index 6c58389891..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/EvIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png
deleted file mode 100644
index 0871c51503..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/FavoritesIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png
deleted file mode 100644
index 02548e946d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Forward.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png
deleted file mode 100644
index 2bdd652e0a..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/HomeIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png
deleted file mode 100644
index c6797a440b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeyboardIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png
deleted file mode 100644
index b9ca08ad02..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadEntryIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png
deleted file mode 100644
index a70ee397fe..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/KeypadIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png
deleted file mode 100644
index 3847da93c8..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/LightingIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png
deleted file mode 100644
index 4405a629ce..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Loop.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png
deleted file mode 100644
index 482b6821e2..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MediaTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png
deleted file mode 100644
index 5e86d80c76..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MessagesIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png
deleted file mode 100644
index 525e4b9158..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/MissingArtwork.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png
deleted file mode 100644
index 4bce721385..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/NavigationTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png
deleted file mode 100644
index 55498b9134..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PandoraIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png
deleted file mode 100644
index bbede19900..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Pause.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png
deleted file mode 100644
index 281e20a1f4..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneCornerIcons.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png
deleted file mode 100644
index e4071e0932..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneIcons.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png
deleted file mode 100644
index 9b36907b33..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhoneTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png
deleted file mode 100644
index 6af9c10463..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PhonebookIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png
deleted file mode 100644
index 1b665e3633..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Play.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png
deleted file mode 100644
index b7b532db7b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/PoiIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png
deleted file mode 100644
index f660610202..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RadioIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png
deleted file mode 100644
index 16a31b29ba..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentCallsIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png
deleted file mode 100644
index 4351243d4b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RecentDestinationsIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png
deleted file mode 100644
index 798f754801..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Rewind.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png
deleted file mode 100644
index b1d03d24ae..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/RightTurn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png
deleted file mode 100644
index 2c8e7cb2da..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ScoutIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png
deleted file mode 100644
index 571d06c97b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SearchIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png
deleted file mode 100644
index caff60c58b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SeatsIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png
deleted file mode 100644
index 63a5a6a9db..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/ServicesIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png
deleted file mode 100644
index 4b3fc65c61..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/Shuffle.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png
deleted file mode 100644
index 0ea1209925..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SiriusIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png
deleted file mode 100644
index f871a96543..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/SpeedDialIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png
deleted file mode 100644
index 8f0c759edf..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/UsbIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png
deleted file mode 100644
index 79a277b185..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleCornerIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png
deleted file mode 100644
index b6fb90276f..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VehicleTab.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png
deleted file mode 100644
index c27ac4a874..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VhrIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png
deleted file mode 100644
index c3f91de709..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/VoicemailIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png
deleted file mode 100644
index e3277af0ac..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WallpaperIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png
deleted file mode 100644
index 97ce15688d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WifiIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png
deleted file mode 100644
index 69e50caa39..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Assets/WorkIcon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml
deleted file mode 100644
index 61f0311815..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/BackButton.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-import QtQuick 2.0
-
-ImageButton {
- icon: "../Assets/BackIcon.png"
- height: 42
- width: 60
- anchors.top: parent.top
- anchors.left: parent.left
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml
deleted file mode 100644
index 7f3c30126b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Button.qml
+++ /dev/null
@@ -1,32 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
- property alias textAnchors: clickable.textAnchors
- property alias clickable: clickable
- id: container
- border.color: "#333"
- border.width: 1
- height: 45
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: clickable.pressed ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: clickable.pressed ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: container.press()
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.verticalCenter: verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml
deleted file mode 100644
index 713d00d1b3..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/CheckButton.qml
+++ /dev/null
@@ -1,36 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
-
- states: [
- State {
- name: 'pressed'
- }
- ]
- id: container
- border.color: "#333"
- border.width: 1
- height: 45
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: (state === 'pressed' || clickable.pressed) ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: (state === 'pressed' || clickable.pressed) ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: { container.press(); container.state = (container.state === '') ? 'pressed' : '' }
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.verticalCenter: verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml
deleted file mode 100644
index 2fdc97d7cd..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Clickable.qml
+++ /dev/null
@@ -1,24 +0,0 @@
-import QtQuick 2.0
-
-Item {
- property alias text: text.text
- property alias pressed: mousearea.pressed
- property alias textAnchors: text.anchors
- signal press
-
- id: container
-
- Text {
- id: text
- color: "white"
- font.pixelSize: 16
- }
-
- MouseArea {
- id: mousearea
- width: parent.width
- height: parent.height
-
- onClicked: container.press()
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml
deleted file mode 100644
index 2e670682ee..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/GraphicalButton.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
- property alias image: image.source
-
- id: container
- border.color: "#333"
- border.width: 1
- height: 110
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: clickable.pressed ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: clickable.pressed ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: container.press()
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.bottom: bottom
- textAnchors.bottomMargin: 10
-
- Image {
- id: image
- anchors.top: parent.top
- anchors.topMargin: 10
- anchors.horizontalCenter: parent.horizontalCenter
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml
deleted file mode 100644
index b68c7f0f1b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H1.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-Text {
- color: "#fff"
- font.pixelSize: 32
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml
deleted file mode 100644
index 775838be06..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/H2.qml
+++ /dev/null
@@ -1,9 +0,0 @@
-import QtQuick 2.0
-
-Text {
- color: "#fff"
- font.pixelSize: 24
- anchors.margins: 20
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml
deleted file mode 100644
index 81c18a4311..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/ImageButton.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.0
-
-Button {
- property alias icon: icon.source
-
- width: icon.width + 30
-
- Image {
- id: icon
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml
deleted file mode 100644
index 7fe5dbab83..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Key.qml
+++ /dev/null
@@ -1,7 +0,0 @@
-import QtQuick 2.0
-
-Button {
- width: 60
-
- onPress: keyboard.letterClicked(text)
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml
deleted file mode 100644
index fc5d26aa88..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keyboard.qml
+++ /dev/null
@@ -1,129 +0,0 @@
-import QtQuick 2.0
-
-Item {
- signal letterClicked(string letter)
- signal go()
- id: keyboard
-
- states: [
- State {
- name: 'numpad'
- PropertyChanges {
- target: qwerty
- visible: false
- }
- PropertyChanges {
- target: numpad
- visible: true
- }
- }
-
- ]
-
- Column {
- id: qwerty
- anchors.fill: parent
- spacing: 10
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "Q" }
- Key { text: "W" }
- Key { text: "E" }
- Key { text: "R" }
- Key { text: "T" }
- Key { text: "Y" }
- Key { text: "U" }
- Key { text: "I" }
- Key { text: "O" }
- Key { text: "P" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "A" }
- Key { text: "S" }
- Key { text: "D" }
- Key { text: "F" }
- Key { text: "G" }
- Key { text: "H" }
- Key { text: "J" }
- Key { text: "K" }
- Key { text: "L" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "Z" }
- Key { text: "X" }
- Key { text: "C" }
- Key { text: "V" }
- Key { text: "B" }
- Key { text: "N" }
- Key { text: "M" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
- Button { text: "123"; width: 60
- onPress: keyboard.state = 'numpad'
- }
- Button { text: "!@#"; width: 60 }
- Key { text: " "; width: 300 }
- Key { text: "." }
- Key { text: "&" }
- }
- }
-
- Column {
- id: numpad
- visible: false
- anchors.fill: parent
- spacing: 10
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "1" }
- Key { text: "2" }
- Key { text: "3" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "4" }
- Key { text: "5" }
- Key { text: "6" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "7" }
- Key { text: "8" }
- Key { text: "9" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Button {
- text: "ABC"
- width: 60
- onPress: keyboard.state = ''
- }
- Key { text: "*" }
- Key { text: "0" }
- Key { text: "#" }
- Button {
- text: "Go"
- width: 60
- onPress: keyboard.go()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml
deleted file mode 100644
index 0dc0115acf..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Keypad.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-import QtQuick 2.0
-
-Item {
- signal letterClicked(string letter)
- id: keyboard
-
- Column {
- anchors.fill: parent
- spacing: 10
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "1" }
- Key { text: "2" }
- Key { text: "3" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "4" }
- Key { text: "5" }
- Key { text: "6" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "7" }
- Key { text: "8" }
- Key { text: "9" }
- }
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- Key { text: "*" }
- Key { text: "0" }
- Key { text: "#" }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml
deleted file mode 100644
index f0ef3ed2ae..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml
+++ /dev/null
@@ -1,40 +0,0 @@
-import QtQuick 2.0
-
-ListView {
- id: listView
- anchors.fill: parent
- anchors.topMargin: 120
- spacing: 10
- clip: true
- model: MediaModel
-
- delegate: Button {
- width: 500
- anchors.horizontalCenter: parent.horizontalCenter
- OverflowableText {
- text: name
- fontColor: "#fff"
- font.pixelSize: 20
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
- width: parent.width - 40
- }
- Text {
- text: (model.count === 0) ? "" : model.count
- anchors.right: parent.right
- anchors.rightMargin: 20
- anchors.verticalCenter: parent.verticalCenter
- color: "#fff"
- }
-
- onPress: {
- if (model.is_file) {
- MediaPlayer.setPlaylist(model.pid, model.index);
- usb.state = '';
- } else {
- MediaModel.browseToChild(model.id)
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml
deleted file mode 100644
index 3149943613..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/OverflowableText.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-import QtQuick 2.0
-import QtGraphicalEffects 1.0
-
-Rectangle {
- id: oflow_text
- property alias text: text.text
- property alias font: text.font
- property alias fontColor: text.color
- property string textAlign
- color: Qt.rgba(0,0,0,0)
- height: text.font.pixelSize * 1.2
- clip: true
- Text {
- id: text
- Component.onCompleted: {
- if (oflow_text.width < width) {
- anchors.left = parent.left
- }
- else if (oflow_text.textAlign == 'center') {
- anchors.horizontalCenter = parent.horizontalCenter
- }
- }
-
- NumberAnimation on anchors.leftMargin {
- id: scroll_animation
- to: oflow_text.width - text.width
- duration: ((oflow_text.width - text.width) < 0) ? (text.width - oflow_text.width) * 15 : 0
- running: false
- onStopped: {
- restart_timer.start()
- }
- }
- }
-
- Timer {
- id: scroll_timer
- running: true
- interval: 3000
- onTriggered: { if (oflow_text.width < text.width) scroll_animation.start();}
- }
- Timer {
- id: restart_timer
- interval: 3000
- onTriggered: text.anchors.leftMargin = 0
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml
deleted file mode 100644
index 676d65be39..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButton.qml
+++ /dev/null
@@ -1,30 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- signal press
- property alias text: clickable.text
- id: container
- border.color: "#333"
- border.width: 1
- height: 45
- width: 150
- radius: 3
- gradient: Gradient {
- GradientStop {
- position: 0.0
- color: (container.focus || clickable.pressed) ? "#3C1414" : Qt.rgba(0.18, 0.18, 0.18, 1)
- }
- GradientStop {
- position: 1.0
- color: (container.focus || clickable.pressed) ? "#9C3335" : "black"
- }
- }
- Clickable {
- anchors.fill: parent
- id: clickable
- onPress: { container.forceActiveFocus(); container.press(); }
-
- textAnchors.horizontalCenter: horizontalCenter
- textAnchors.verticalCenter: verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml
deleted file mode 100644
index d4266d149b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/RadioButtonGroup.qml
+++ /dev/null
@@ -1,5 +0,0 @@
-import QtQuick 2.0
-
-FocusScope {
-
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml
deleted file mode 100644
index 18b5c22f7d..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Section.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-Loader {
- anchors.fill: parent
- asynchronous: true
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml
deleted file mode 100644
index 4c52e05b2a..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextBox.qml
+++ /dev/null
@@ -1,29 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- property alias text: text.text
- property alias icon: icon.source
-
- border.width: 2
- color: 'black'
- height: 42
- radius: 3
-
- Image {
- id: icon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
- }
-
- TextInput {
- id: text
- color: "white"
- font.pixelSize: 24
- anchors.left: icon.right
- anchors.right: parent.right
- anchors.leftMargin: 20
- anchors.rightMargin: 10
- anchors.verticalCenter: parent.verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml
deleted file mode 100644
index 774894c137..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/TextEntry.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-import QtQuick 2.0
-
-Item {
- id: textentry
- property alias input_border: search_text_box.border
- property alias autocompleteModel: autocomplete.model
- property alias text: search_text_box.text
- signal selected
- anchors.fill: parent
-
- TextBox {
- id: search_text_box
- icon: "../Assets/SearchIcon.png"
- anchors.top: parent.top
- width: parent.width - 160
- anchors.horizontalCenter: parent.horizontalCenter
-
- onTextChanged: if (autocomplete.model) autocomplete.model.setSearchString(text)
- }
-
- BackButton {
- anchors.top: search_text_box.top
- anchors.topMargin: 1
- anchors.right: search_text_box.left
- anchors.rightMargin: 10
- onPress: section.state = 'menu'
- }
-
- ImageButton {
- anchors.top: search_text_box.top
- anchors.topMargin: 1
- icon: "../Assets/DeleteIcon.png"
- anchors.left: search_text_box.right
- anchors.leftMargin: 10
- height: 42
-
- onPress: search_text_box.text = search_text_box.text.replace(/.$/, '')
- }
-
- Keyboard {
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.topMargin: 40
- anchors.top: search_text_box.bottom
-
- onLetterClicked: search_text_box.text += letter
- onGo: textentry.selected()
- }
-
- ListView {
- id: autocomplete
- anchors.top: search_text_box.bottom
- anchors.bottom: parent.bottom
- anchors.right: search_text_box.right
- anchors.left: search_text_box.left
- clip: true
- visible: (count > 0 && count <= 5)
-
- delegate: Button {
- text: model.text
- width: parent.width
- textAnchors.horizontalCenter: undefined
- textAnchors.left: clickable.left
- textAnchors.leftMargin: 70
-
- onPress: {
- autocomplete.model.selected = model.text;
- textentry.selected()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml
deleted file mode 100644
index 0bcaf77205..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/Weather.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-import QtQuick 2.0
-
-Item {
- property alias text: text.text
- property alias temp: temp.text
- property alias image: image.source
-
- width: 150
- height: 75
-
- Text {
- id: text
- text: "Today"
- anchors.top: parent.top
- color: "#ffffff"
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Text {
- id: temp
- text: "72"
- font.pixelSize: 36
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- color: "#ffffff"
- }
-
- Image {
- id: image
- source: "../Assets/Cloud.png"
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml
deleted file mode 100644
index 8fe6fcfd7c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/EmptyLayout.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-Item {
- anchors.fill: parent
- anchors.topMargin: 70
- anchors.leftMargin: 20
- anchors.rightMargin: 20
- anchors.bottomMargin: 70
- property bool back_button: false
-
- BackButton {
- onPress: section.state = ''
- visible: parent.back_button
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml
deleted file mode 100644
index b0a7c2f6af..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/LeftThirdSection.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-FocusScope {
- anchors.fill: parent
- property alias header: header.text
-
- Text {
- id: header
- font.pixelSize: 24
- color: "#ffffff"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: 70
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml
deleted file mode 100644
index 767184de36..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaLayout.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-FocusScope {
- anchors.fill: parent
- property alias header: header.text
- property alias artwork: artwork.source
- property alias title: title.text
- property alias artist: artist.text
-
- Text {
- id: title
- text: ""
- color: "#ffffff"
- anchors.top: source_select.bottom
- anchors.topMargin: 20
- font.pixelSize: 28
- anchors.left: parent.left
- anchors.leftMargin: 20
- }
- Text {
- id: artist
- text: ""
- color: "#ffffff"
- anchors.top: title.bottom
- anchors.topMargin: 10
- font.pixelSize: 18
- anchors.left: title.left
- }
-
- Text {
- id: header
- font.pixelSize: 24
- color: "#ffffff"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: parent.height / 20 + 60
- }
-
- Button {
- id: source_select
- text: "Select source"
- x: 20
- y: 75
- onPress: section.state = 'menu'
- }
-
- Image {
- id: artwork
- anchors.right: parent.right
- anchors.rightMargin: 40
- anchors.top: parent.top
- width: 230
- height: 230
- anchors.topMargin: 140
- source: ""
- }
-
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml
deleted file mode 100644
index 797815d058..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/MediaPlayerLayout.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-MediaLayout {
-
- Row {
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 100
- anchors.left: parent.left
- anchors.leftMargin: 20
- spacing: 10
-
- ImageButton {
- icon: "../Assets/Rewind.png"
- onPress: MediaPlayer.previous()
- }
-
- ImageButton {
- icon: "../Assets/Pause.png"
- visible: MediaPlayer.playing
- onPress: MediaPlayer.pause()
- }
- ImageButton {
- icon: "../Assets/Play.png"
- visible: ! MediaPlayer.playing
- onPress: MediaPlayer.play()
- }
- ImageButton {
- icon: "../Assets/Forward.png"
- onPress: MediaPlayer.next()
- }
-
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml
deleted file mode 100644
index 2ef47fa101..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Layouts/TitledLayout.qml
+++ /dev/null
@@ -1,14 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-EmptyLayout {
- property alias title: title.text
- anchors.topMargin: 120
-
- H1 {
- id: title
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.top
- anchors.bottomMargin: 10
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp
deleted file mode 100644
index a88c240c3a..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/.usb.qml.swp
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml
deleted file mode 100644
index af5804e72e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/Browse/artists.qml
+++ /dev/null
@@ -1,6 +0,0 @@
-import QtQuick 2.0
-
-Rectangle {
- width: 100
- height: 62
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml
deleted file mode 100644
index 4f9d281964..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/applink.qml
+++ /dev/null
@@ -1,29 +0,0 @@
-import QtQuick 2.0
-import com.ford.sdlcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-MediaPlayerLayout {
- header: "AppLink"
- id: applink
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
-
- Text {
- id: title
- text: AppLink.show1
- color: "#ffffff"
- font.pixelSize: 28
- anchors.leftMargin: 20
- }
- Text {
- id: artist
- text: AppLink.show2
- color: "#ffffff"
- font.pixelSize: 18
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml
deleted file mode 100644
index 397b844698..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/bluetooth.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaLayout {
- header: "Bluetooth"
-
- Image {
- source: "../../Assets/Content/SiriusArtwork.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml
deleted file mode 100644
index b5f3ad1c8c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/fm.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaLayout {
- header: "FM"
-
- Flickable {
- width: 700
- height: 50
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 80
- contentHeight: height
- contentWidth: row.width
- clip: true
-
- RadioButtonGroup {
- width: row.width
- height: row.height
- Row {
- id: row
- spacing: 8
-
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- RadioButton {
- text: "Button"
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml
deleted file mode 100644
index d9d951ef3b..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/menu.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-import QtQuick 2.0
-import com.ford.sdlcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-LeftThirdSection {
- header: "Select a source"
-
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "Radio"
- image: "../../Assets/RadioIcon.png"
- onPress: section.state = 'fm'
- }
-
- GraphicalButton {
- text: "Pandora"
- image: "../../Assets/PandoraIcon.png"
- onPress: section.state = 'fm'
- }
-
- GraphicalButton {
- text: "Sirius"
- image: "../../Assets/SiriusIcon.png"
- onPress: section.state = 'sirius'
- }
-
- GraphicalButton {
- text: "Bluetooth"
- image: "../../Assets/BluetoothIcon.png"
- onPress: section.state = 'bluetooth'
- }
-
- GraphicalButton {
- text: "USB"
- image: "../../Assets/UsbIcon.png"
- onPress: section.state = 'usb'
- }
-
- Repeater {
- model: MediaApps
-
- delegate: GraphicalButton {
- text: modelData
- image: "../../Assets/UsbIcon.png"
- onPress: section.state = 'applink'
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml
deleted file mode 100644
index dfe9fc4d53..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/sirius.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaLayout {
- header: "Sirius"
-
- Image {
- source: "../../Assets/Content/SiriusArtwork.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml
deleted file mode 100644
index 7236e98cbe..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Media/usb.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-MediaPlayerLayout {
- header: "USB"
- id: usb
-
- Button {
- text: "Browse Media"
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.rightMargin: 40
- anchors.topMargin: 75
-
- onPress: parent.state = 'browse'
- }
-
- states: [
- State {
- name: 'browse'
- PropertyChanges { target: browse_interface; visible: true; opacity: 0.9 }
- }
-
- ]
-
- Rectangle {
- color: "#000000"
- opacity: 0
- anchors.fill: parent
- radius: 10
- visible: false
- id: browse_interface
-
- BackButton {
- id: back_button
- anchors.topMargin: 80
- anchors.leftMargin: 20
- }
-
-
- H2 {
- id: header
- text: "Browse Media"
- anchors.topMargin: 80
- }
-
- Item {
- anchors.fill: parent
- id: browse_container
- }
-
- Button {
- anchors.top: back_button.bottom
- anchors.left: parent.left
- text: "Jump"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp
deleted file mode 100644
index 183438e037..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/.menu.qml.swp
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml
deleted file mode 100644
index db16b994b4..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/favorites.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-import QtQuick 2.0
-import com.ford.navcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- BackButton { onPress: section.state = 'menu' }
- NavController {
- id: navController
- }
-
- Flickable {
- height: 300
- width: 400
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- clip: true
- contentWidth: content.width
- contentHeight: content.height
-
- Column {
- id: content
- width: parent.width
- spacing: 10
-
- Button {
- text: "Barry Church's home"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Davison", "Victoria Sta", "3465");
- section.state = 'map';
- }
- }
- Button {
- text: "Subway"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn Heights", "Pelham St", "3929");
- section.state = 'map';
- }
- }
- Button {
- text: "Ford World Headquarters"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "American Rd", "1");
- section.state = 'map';
- }
- }
- Button {
- text: "Qdoba"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Allen Park", "Fairlane Dr", "48101");
- section.state = 'map';
- }
- }
- Button {
- text: "Levagood Park"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "Denwood St", "1100");
- section.state = 'map';
- }
- }
-
- }
- }
-}
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml
deleted file mode 100644
index 011c761646..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/keyboard_search.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- anchors.fill: parent
- id: keyboard_search
-
- states: [
- State {
- name: 'city'
- PropertyChanges {target: text_entry; autocompleteModel: citySuggestions}
- },
- State {
- name: 'street'
- PropertyChanges {target: text_entry; autocompleteModel: streetSuggestions}
- },
- State {
- name: 'door'
- PropertyChanges {target: text_entry; autocompleteModel: undefined}
- },
- State {
- name: 'review'
- PropertyChanges {target: text_entry; visible: false}
- PropertyChanges {target: review; visible: true}
- }
- ]
-
- Column {
- id: review
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- width: 500
-
- visible: false
- Button {
- text: stateSuggestions.selected
- width: parent.width
- onPress: keyboard_search.state = ""
- }
- Button {
- text: citySuggestions.selected
- width: parent.width
- onPress: keyboard_search.state = "city"
- }
- Button {
- text: streetSuggestions.selected
- width: parent.width
- onPress: keyboard_search.state = "city"
- }
- Button {
- id: doornumber
- width: parent.width
- onPress: keyboard_search.state = "door"
- }
- Button {
- text: "Begin navigation"
- anchors.horizontalCenter: parent.horizontalCenter
- onPress: {
- section.state = 'map';
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml
deleted file mode 100644
index 8b48efe780..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/map.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-
-Item {
- Column {
- anchors.left: parent.left;
- anchors.verticalCenter: parent.verticalCenter
- spacing: 10
-
- Button {
- text: "Zoom in"
- }
-
- Button {
- text: "Zoom out"
- }
-
- Button {
- text: "3D"
- }
-
- Button {
- text: "2D"
- }
-
- Button {
- text: "North up"
- }
- }
-
- Rectangle {
- width: next_turn.width + 20
- height: 30
- anchors.top: parent.top
- anchors.topMargin: 65
- anchors.horizontalCenter: parent.horizontalCenter
- color: "black"
- opacity: 0.6
-
- }
-
- Rectangle {
- width: current_street.width + 20
- height: 30
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 65
- anchors.horizontalCenter: parent.horizontalCenter
- color: "black"
- opacity: 0.6
- visible: navController.current_street.length > 0
-
- }
-
-
- Button {
- text: "Go"
- anchors.top: parent.top
- anchors.topMargin: 3
- anchors.right: parent.right
- anchors.rightMargin: 20
- onPress: section.state = 'menu'
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml
deleted file mode 100644
index fdcae3f58e..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/menu.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-EmptyLayout {
- back_button: true
-
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "Home"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- section.state = 'map';
- }
- }
- GraphicalButton {
- text: "Work"
- image: "../../Assets/WorkIcon.png"
- onPress: {
- section.state = 'map';
- }
- }
- GraphicalButton {
- text: "Recent Destination"
- image: "../../Assets/RecentDestinationsIcon.png"
- onPress: section.state = 'recent_destinations'
- }
- GraphicalButton {
- text: "Keyboard"
- image: "../../Assets/KeyboardIcon.png"
- onPress: section.state = 'keyboard_search'
- }
- GraphicalButton {
- text: "Favorites"
- image: "../../Assets/FavoritesIcon.png"
- onPress: section.state = 'favorites'
- }
- GraphicalButton {
- text: "Point of Interest"
- image: "../../Assets/PoiIcon.png"
- onPress: section.state = 'poi'
- }
- GraphicalButton {
- text: "Scout"
- image: "../../Assets/ScoutIcon.png"
- }
- GraphicalButton {
- text: "SYNC Services"
- image: "../../Assets/ServicesIcon.png"
- onPress: section.state = "video_moving_map"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml
deleted file mode 100644
index 0ecea8a113..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/poi.qml
+++ /dev/null
@@ -1,205 +0,0 @@
-import QtQuick 2.0
-import com.ford.navcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-EmptyLayout {
- anchors.fill: parent
- back_button: true
- id: poi_search
-
- Component.onCompleted: state = "search_type"
-
- states: [
- State {
- name: 'search_type'
- PropertyChanges {
- target: search_type
- visible: true
- }
- },
- State {
- name: 'categories'
- PropertyChanges {
- target: category_select
- visible: true
- }
- },
- State {
- name: 'select_state'
- PropertyChanges {
- target: text_entry
- visible: true
- }
- },
- State {
- name: 'results'
- PropertyChanges {
- target: results
- visible: true
- }
- },
- State {
- name: 'result'
- PropertyChanges {
- target: result
- visible: true
- }
- }
- ]
-
- NavController {
- id: navController
- }
-
- Grid {
- id: search_type
- property string type
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
- visible: false
-
- GraphicalButton {
- text: "Near me"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- search_type.type = "nearby"
- poi_search.state = "categories"
- }
- }
-
- GraphicalButton {
- text: "Along route"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- search_type.type = "route"
- poi_search.state = "categories"
- }
- }
-
- GraphicalButton {
- text: "In city"
- image: "../../Assets/HomeIcon.png"
- onPress: {
- search_type.type = "city"
- poi_search.state = "select_state"
- }
- }
- }
-
- ListView {
- id: category_select
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height - 120
- width: parent.width
- spacing: 10
- clip: true
-
- GraphicalButton {
- text: "Search by name"
- image: "../../Assets/HomeIcon.png"
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 20
- }
-
- visible: false
- model: NavPoiCategoryListModel { id: poi_categories }
-
- delegate: Button {
- property int category_id: id
- text: name
- width: 400
- anchors.horizontalCenter: parent.horizontalCenter
- onPress: {
- navController.poiSearch(search_type.type, category_id, "USA", state_suggestions.getSelected(), city_suggestions.getSelected());
- poi_search.state = "results"
- }
- }
- }
-
- ListView {
- id: results
- visible: false
- anchors.topMargin: 80
- anchors.top: parent.top
- anchors.bottomMargin: 80
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- width: 400
- height: parent.height - 120
- spacing: 10
- clip: true
-
- model: NavPoiSuggestionListModel {
- id: poi_suggestions
- }
-
- delegate: Button {
- text: name
- width: parent.width
- onPress: {
- results.currentIndex = index
- poi_search.state = "result"
- }
- }
- }
-
- Item {
- anchors.fill: parent
- anchors.topMargin: 80
- anchors.bottomMargin: 80
- id: result
- visible: false
-
- H1 {
- id: poi_name
- anchors.horizontalCenter: parent.horizontalCenter
- text: (results.currentItem ? results.currentItem.text : "")
- }
-
- Button {
- text: "Begin navigation"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: poi_name.bottom
- onPress: {
- poi_suggestions.navigateToResult(results.currentIndex);
- section.state = 'map'
- }
- }
- }
-
- TextEntry {
- id: text_entry
- anchors.topMargin: 80
- input_border.color: "#3C7855"
-
- states: [
- State {
- name: "city_select"
- PropertyChanges {
- target: text_entry
- autocompleteModel: city_suggestions
- }
- }
-
- ]
-
- NavStateSuggestionListModel { id: state_suggestions }
- NavCitySuggestionListModel { id: city_suggestions; stateListModel: state_suggestions }
- autocompleteModel: state_suggestions
- visible: false
-
- onSelected: {
- if (text_entry.state === '') {
- text = "";
- text_entry.state = 'city_select';
- }
- else {
- poi_search.state = 'categories'
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml
deleted file mode 100644
index db16b994b4..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/recent_destinations.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-import QtQuick 2.0
-import com.ford.navcore 1.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- BackButton { onPress: section.state = 'menu' }
- NavController {
- id: navController
- }
-
- Flickable {
- height: 300
- width: 400
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- clip: true
- contentWidth: content.width
- contentHeight: content.height
-
- Column {
- id: content
- width: parent.width
- spacing: 10
-
- Button {
- text: "Barry Church's home"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Davison", "Victoria Sta", "3465");
- section.state = 'map';
- }
- }
- Button {
- text: "Subway"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn Heights", "Pelham St", "3929");
- section.state = 'map';
- }
- }
- Button {
- text: "Ford World Headquarters"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "American Rd", "1");
- section.state = 'map';
- }
- }
- Button {
- text: "Qdoba"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Allen Park", "Fairlane Dr", "48101");
- section.state = 'map';
- }
- }
- Button {
- text: "Levagood Park"
- width: parent.width
- onPress: {
- navController.beginNavigation("USA", "MI", "Dearborn", "Denwood St", "1100");
- section.state = 'map';
- }
- }
-
- }
- }
-}
-
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml
deleted file mode 100644
index 2f6b798d18..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Navigation/video_moving_map.qml
+++ /dev/null
@@ -1,20 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import QtMultimedia 5.0
-
-Item {
- Video {
- anchors.fill: parent
- source: "rtsp://172.20.10.7:8086"
- autoPlay: true
- }
-
- Button {
- text: "Go"
- anchors.top: parent.top
- anchors.topMargin: 3
- anchors.right: parent.right
- anchors.rightMargin: 20
- onPress: section.state = 'menu'
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml
deleted file mode 100644
index 1f409f58e6..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/device_info.qml
+++ /dev/null
@@ -1,21 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import com.ford.phonecore 1.0
-
-Item {
- anchors.fill: parent
-
- H2 {
- id: h2
- text: PhoneCore.device_name
-
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Button {
- text: "Forget device"
- onPress: PhoneCore.unpairDevice()
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: h2.bottom
- anchors.topMargin: 20
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml
deleted file mode 100644
index 5d7c51be6c..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/discovery.qml
+++ /dev/null
@@ -1,23 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-
-Item {
- ListView {
- anchors.horizontalCenter: parent.horizontalCenter
- width: 300
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- spacing: 10
-
- delegate: Button {
- text: name
- width: parent.width
- onPress: bluetooth_devices.createPairedDevice(mac)
- }
-
- model: BluetoothDiscoveredDevices {
- id: bluetooth_devices
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml
deleted file mode 100644
index fd5ed4ff09..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/keypad.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-import "../../Layouts"
-
-Item {
- anchors.top: parent.top
- anchors.topMargin: 80
-
- TextBox {
- id: phone_number
- border.color: Qt.rgba(0.454901961,0.37254902,0.203921569,1)
- anchors.top: parent.top
- width: parent.width - 160
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- BackButton {
- anchors.top: phone_number.top
- anchors.topMargin: 1
- anchors.right: phone_number.left
- anchors.rightMargin: 10
- onPress: section.state = ''
- }
-
- ImageButton {
- anchors.top: phone_number.top
- anchors.topMargin: 1
- icon: "../../Assets/DeleteIcon.png"
- anchors.left: phone_number.right
- anchors.leftMargin: 10
- height: 42
-
- onPress: phone_number.text = phone_number.text.replace(/.$/, '')
- }
-
- Keypad {
- anchors.topMargin: 40
- anchors.top: phone_number.bottom
- anchors.horizontalCenter: parent.horizontalCenter
-
- onLetterClicked: phone_number.text += letter
- }
-
- Button {
- text: "Call"
- onPress: PhoneCore.dial(phone_number.text);
- y: 100
- }
- Button {
- text: "End call"
- onPress: PhoneCore.hangup();
- y: 160
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml
deleted file mode 100644
index cf62a9c287..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/manage_devices.qml
+++ /dev/null
@@ -1,16 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-import "../../Layouts"
-
-TitledLayout {
- title: "Manage Bluetooth devices"
- back_button: true
-
- Loader {
- id: view
-
- anchors.fill: parent
- source: (PhoneCore.device_name === "") ? "discovery.qml" : "device_info.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml
deleted file mode 100644
index 2d53656ba0..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/menu.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-LeftThirdSection {
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "Do Not Disturb"
- image: "../../Assets/DndIcon.png"
- }
-
- GraphicalButton {
- text: "Phonebook"
- image: "../../Assets/PhonebookIcon.png"
- }
-
- GraphicalButton {
- text: "Voicemail"
- image: "../../Assets/VoicemailIcon.png"
- }
-
- GraphicalButton {
- text: "Messages"
- image: "../../Assets/MessagesIcon.png"
- }
-
- GraphicalButton {
- text: "Recent Calls"
- image: "../../Assets/RecentCallsIcon.png"
- onPress: section.state = 'recent_calls'
- }
-
- GraphicalButton {
- text: "Keypad"
- image: "../../Assets/KeypadIcon.png"
- onPress: section.state = 'keypad'
- }
-
- GraphicalButton {
- text: "Speed Dial"
- image: "../../Assets/SpeedDialIcon.png"
- }
-
- GraphicalButton {
- text: "Devices"
- image: "../../Assets/SpeedDialIcon.png"
- onPress: section.state = 'manage_devices'
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml
deleted file mode 100644
index 1873ed4382..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Phone/recent_calls.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../../Components"
-import "../../Layouts"
-
-TitledLayout {
- title: "Recent calls"
- Component.onCompleted: PhoneCore.hangup()
- back_button: true
-
- Flickable {
- height: 300
- width: 400
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- clip: true
- contentWidth: content.width
- contentHeight: content.height
-
- Column {
- id: content
- width: parent.width
- spacing: 10
-
- Button {
- text: "Chris Church: Mobile"
- onPress: PhoneCore.dial("8106567195")
- width: parent.width
- }
- Button {
- text: "Barry Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Barry Church: Work"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- Button {
- text: "Aaron Church: Mobile"
- onPress: PhoneCore.dial("3134074522")
- width: parent.width
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml
deleted file mode 100644
index b95bc52da8..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/Vehicle/menu.qml
+++ /dev/null
@@ -1,60 +0,0 @@
-import QtQuick 2.0
-import "../../Components"
-import "../../Layouts"
-
-LeftThirdSection {
- MultiPointTouchArea {
- anchors.fill: parent
- }
-
- Grid {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: 10
-
- GraphicalButton {
- text: "HEV"
- image: "../../Assets/EvIcon.png"
- }
-
- GraphicalButton {
- text: "Ambient Lighting"
- image: "../../Assets/LightingIcon.png"
- }
-
- GraphicalButton {
- text: "Wallpaper"
- image: "../../Assets/WallpaperIcon.png"
- }
-
- GraphicalButton {
- text: "Wi-Fi"
- image: "../../Assets/WifiIcon.png"
- }
-
- GraphicalButton {
- text: "Health Report"
- image: "../../Assets/VhrIcon.png"
- }
-
- GraphicalButton {
- text: "Seats"
- image: "../../Assets/SeatsIcon.png"
- }
-
- GraphicalButton {
- text: "Keypad Entry"
- image: "../../Assets/KeypadEntryIcon.png"
- }
-
- GraphicalButton {
- text: "Sync Services"
- image: "../../Assets/ServicesIcon.png"
- }
-
- GraphicalButton {
- text: "Add Shortcut"
- image: "../../Assets/AddIcon.png"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml
deleted file mode 100644
index f19539b9be..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/alert.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-import QtQuick 2.0
-
-Item {
- property alias text: alert_text.text
- id: alert_item
- opacity: 0
-
- transitions: Transition {
- NumberAnimation {
- properties: "opacity"
- }
- }
-
- function alert(message) {
- text = message;
- state = 'alerting';
- alert_timer.start();
- }
-
- states: [
- State {
- name: 'alerting'
- PropertyChanges {
- target: alert_item
- opacity: 1
- }
- }
- ]
-
- Timer {
- id: alert_timer
- running: false
- interval: 4000
- onTriggered: alert_item.state = '';
- }
-
-
- Rectangle {
- id: background
- anchors.fill: parent
- color: "#000"
- opacity: 0.8
- }
-
- Rectangle {
- color: "#111"
- width: 500
- height: alert_text.height + 40
- radius: 8
- border.color: "#666"
- border.width: 2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- Text {
- id: alert_text
- text: "This is a really really long long really really long longreally really long longreally really long longreally really long long alert"
- color: "#fff"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: 24
- width: parent.width
- wrapMode: Text.WordWrap
- }
- }
-
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml
deleted file mode 100644
index b8f4f09d56..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/chrome.qml
+++ /dev/null
@@ -1,144 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-
-Item {
- id: container
- anchors.fill: parent
-
- property int horizontalLabelMargin: 20
-
- Image {
- id: phonetab
- source: "../Assets/PhoneTab.png"
- anchors.top: parent.top
- anchors.topMargin: (root.state === "phone") ? -height : 0
- Behavior on anchors.topMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Phone"
- onPress: go("phone")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.leftMargin: horizontalLabelMargin
- textAnchors.left: left
- }
- }
- Row {
- anchors.right: phonetab.right
- anchors.rightMargin: phonetab.width / 4
- anchors.top: parent.top
- height: phonetab.height
- spacing: 10
-
- Image {
- source: "../Assets/PhoneCornerIcons.png"
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
-
- Image {
- source: "../Assets/NavigationTab.png"
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.topMargin: (root.state === "navigation") ? -height : 0
- Behavior on anchors.topMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Navigation"
- onPress: go("navigation")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.rightMargin: horizontalLabelMargin
- textAnchors.right: right
- }
- }
-
- Image {
- id: test1
- source: "../Assets/MediaTab.png"
- anchors.bottom: parent.bottom
- anchors.bottomMargin: (root.state === "media") ? -height : 0
- anchors.left: parent.left
- Behavior on anchors.bottomMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Media"
- onPress: go("media")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.leftMargin: horizontalLabelMargin
- textAnchors.left: left
- }
- }
-
- Image {
- source: "../Assets/VehicleTab.png"
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.bottomMargin: (root.state === "vehicle") ? -height : 0
- Behavior on anchors.bottomMargin { PropertyAnimation {} }
- width: parent.width / 2 - 145
- height: parent.height / 20 + 25
-
- Clickable {
- anchors.fill: parent
- text: "Vehicle"
- onPress: go("vehicle")
- textAnchors.verticalCenter: verticalCenter
- textAnchors.rightMargin: horizontalLabelMargin
- textAnchors.right: right
- }
- }
-
- Image {
- id: chrometop
- source: "../Assets/ChromeTop.png"
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height / 18 + 35
- width: parent.width / 2 + 40
- fillMode: Image.PreserveAspectFit
- Clickable {
- onPress: go((root.state === 'home_corners') ? 'home' : 'home_corners')
- width: parent.width / 5
- height: parent.height
- anchors.left: parent.left
- anchors.leftMargin: (parent.width - parent.paintedWidth)/2 + 20
- }
-
- Text {
- id: clock
- text: "12:00"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: 10
- color: "#ffffff"
- font.pixelSize: 28
- }
- }
- Image {
- source: "../Assets/ChromeBottom.png"
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height / 18 + 35
- width: parent.width / 2
- fillMode: Image.PreserveAspectFit
-
- Text {
- id: exterior_temp
- text: "72F Outside"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- color: "#ffffff"
- anchors.bottomMargin: 15
- font.pixelSize: 18
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml
deleted file mode 100644
index c45f66782f..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-import com.ford.phonecore 1.0
-
-LeftThirdSection {
- header: "Good Morning, Jen"
-
- Column {
- anchors.left: parent.left
- anchors.leftMargin: 60
- spacing: 40
- anchors.verticalCenter: parent.verticalCenter
-
- Weather {}
- Weather {
- text: "Tonight"
- temp: "55"
- image: "../Assets/CloudNight.png"
- }
- }
-
-
- Image {
- id: schedule
- source: "../Assets/CMaxCal.png"
- anchors.right: parent.right
- anchors.rightMargin: 70
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Column {
- anchors.right: schedule.left
- anchors.rightMargin: 20
- anchors.top: schedule.top
- anchors.topMargin: 5
- spacing: 40
-
- Button {
- text: "Dial"
- }
- Button {
- text: "Navigate"
- }
- Button {
- text: "Siri"
- onPress: PhoneCore.siriEyesFree()
- visible: PhoneCore.device_state === "connected" || PhoneCore.device_state === "playing"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml
deleted file mode 100644
index 432e978b87..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/home_corners.qml
+++ /dev/null
@@ -1,133 +0,0 @@
-import QtQuick 2.0
-import com.ford.phonecore 1.0
-import "../Components"
-import "../Layouts"
-
-Item {
-
- Image {
- source: "../Assets/Crosshairs.png"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
-
- Image {
- id: phone_corner_icon
- visible: (PhoneCore.device_state === "connected")
- source: "../Assets/PhoneIcons.png"
- anchors.top: parent.top
- anchors.topMargin: 80
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- OverflowableText {
- id: phone_name
- text: PhoneCore.device_name
- anchors.top: phone_corner_icon.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- textAlign: 'center'
- anchors.topMargin: 10
- width: 350
- fontColor: (PhoneCore.device_state === "connected") ? "#ffffff" : "#333"
- font.pixelSize: 24
- }
-
- Text {
- text: "Connecting..."
- anchors.top: phone_name.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 10
- color: "#333"
- visible: (PhoneCore.device_state === "connecting")
- font.pixelSize: 24
- }
-
- CheckButton {
- text: "Do Not Disturb"
- visible: (PhoneCore.device_state === "connected")
- anchors.top: phone_name.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 10
- }
-
-
-
- Row {
- anchors.top: phone_name.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.topMargin: 10
- visible: (PhoneCore.device_state === "disconnected")
- spacing: 10
-
- Button {
- text: "Connect"
- onPress: {
- PhoneCore.initializeDevice()
- }
- }
-
- Button {
- text: "Manage Phones"
- onPress: {
- go("phone");
- }
- }
- }
-
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
- anchors.right: parent.right
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
- anchors.right: parent.right
- anchors.bottom: parent.bottom
-
- Image {
- source: "../Assets/VehicleCornerIcon.png"
- anchors.horizontalCenter: parent.horizontalCenter
- }
- }
-
- Item {
- width: parent.width / 2
- height: parent.height / 2
- anchors.bottom: parent.bottom
-
- Image {
- id: media_corner_icon
- source: "../Assets/UsbIcon.png"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: 40
- }
-
- Text {
- id: media_artist
- text: ""
- font.pixelSize: 18
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: media_corner_icon.bottom
- color: "#ffffff"
- anchors.topMargin: 10
- }
-
- Text {
- id: media_title
- text: ""
- font.pixelSize: 24
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: media_artist.bottom
- color: "#ffffff"
- }
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml
deleted file mode 100644
index af33ddaffd..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/media.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- anchors.fill: parent
- id: section
-
- gradient: Gradient {
- GradientStop { position: 0.8; color: "#000000" }
- GradientStop { position: 1.0; color: "#7C3232" }
- }
-
- states: [
- State {
- name: 'menu'
- PropertyChanges { target: page; source: "Media/menu.qml" }
- },
- State {
- name: 'fm'
- PropertyChanges { target: page; source: "Media/fm.qml" }
- },
- State {
- name: 'sirius'
- PropertyChanges { target: page; source: "Media/sirius.qml" }
- },
- State {
- name: 'usb'
- PropertyChanges { target: page; source: "Media/usb.qml" }
- },
- State {
- name: 'bluetooth'
- PropertyChanges { target: page; source: "Media/bluetooth.qml" }
- },
- State {
- name: 'applink'
- PropertyChanges { target: page; source: "Media/applink.qml" }
- }
- ]
-
- transitions: [
- Transition {
- to: "bluetooth"
- },
- Transition {
- to: "usb"
- }
-
- ]
-
- Section {
- id: page
- source: "Media/usb.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml
deleted file mode 100644
index e26326b458..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/navigation.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- id: section
- anchors.fill: parent
-
- gradient: Gradient {
- GradientStop { position: 0.0; color: "#3C7855" }
- GradientStop { position: 0.4; color: "#000000" }
- }
-
- Section {
- id: page
- source: "Navigation/map.qml"
- }
-
- states: [
- State {
- name: ''
- PropertyChanges { target: page; source: "Navigation/map.qml" }
- },
- State {
- name: 'menu'
- PropertyChanges { target: page; source: "Navigation/menu.qml" }
- },
- State {
- name: 'keyboard_search'
- PropertyChanges { target: page; source: "Navigation/keyboard_search.qml" }
- },
- State {
- name: 'favorites'
- PropertyChanges { target: page; source: "Navigation/favorites.qml" }
- },
- State {
- name: 'recent_destinations'
- PropertyChanges { target: page; source: "Navigation/recent_destinations.qml" }
- },
- State {
- name: 'poi'
- PropertyChanges { target: page; source: "Navigation/poi.qml" }
- },
- State {
- name: 'video_moving_map'
- PropertyChanges { target: page; source: "Navigation/video_moving_map.qml" }
- }
- ]
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml
deleted file mode 100644
index 8c2987f2f9..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/phone.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- id: section
- anchors.fill: parent
-
- states: [
- State {
- name: ''
- PropertyChanges { target: page; source: "Phone/menu.qml" }
- },
- State {
- name: 'recent_calls'
- PropertyChanges { target: page; source: "Phone/recent_calls.qml" }
- },
- State {
- name: 'keypad'
- PropertyChanges { target: page; source: "Phone/keypad.qml" }
- },
- State {
- name: 'manage_devices'
- PropertyChanges { target: page; source: "Phone/manage_devices.qml" }
- }
- ]
-
- gradient: Gradient {
- GradientStop { position: 0.0; color: Qt.rgba(0.454901961,0.37254902,0.203921569,1) }
- GradientStop { position: 0.4; color: "#000000" }
- }
-
- Section {
- id: page
- source: "Phone/menu.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml
deleted file mode 100644
index 9687e7c463..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Sections/vehicle.qml
+++ /dev/null
@@ -1,17 +0,0 @@
-import QtQuick 2.0
-import "../Components"
-import "../Layouts"
-
-Rectangle {
- anchors.fill: parent
-
- gradient: Gradient {
- GradientStop { position: 0.4; color: "#000000" }
- GradientStop { position: 1.0; color: "#104369" }
- }
-
- Section {
- id: section
- source: "Vehicle/menu.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml b/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml
deleted file mode 100644
index c6f0b0e769..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/main.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-import QtQuick 2.0
-import "Components"
-import com.ford.sdlcore 1.0
-import com.ford.phonecore 1.0
-
-Rectangle {
- id: root
- width: 800
- height: 470
- color: "#000"
-
- states: [
- State {
- name: "home"
- PropertyChanges { target: maincontent; source: "Sections/home.qml" }
- },
- State {
- name: "home_corners"
- PropertyChanges { target: maincontent; source: "Sections/home_corners.qml" }
- },
- State {
- name: "phone"
- PropertyChanges { target: maincontent; source: "Sections/phone.qml" }
- },
- State {
- name: "navigation"
- PropertyChanges { target: maincontent; source: "Sections/navigation.qml" }
- },
- State {
- name: "media"
- PropertyChanges { target: maincontent; source: "Sections/media.qml" }
- },
- State {
- name: "vehicle"
- PropertyChanges { target: maincontent; source: "Sections/vehicle.qml" }
- }
- ]
-
- transitions: [
- Transition {
- to: '*'
- PropertyAnimation { target: maincontent; property: 'opacity'; from: 0; to: 1}
- }
- ]
-
- function go(string) {
- state = string
- }
-
- Connections {
- target: AppLink
- onAlert: root.alert(message);
- }
-
- Connections {
- target: PhoneCore
- onCallAdded: root.alert("Incoming call: \n" + name + "\n" + number)
- onCallRemoved: root.alert("Call ended")
- }
-
- function alert(message) {
- alert_loader.item.alert(message)
- }
-
- Section {
- id: maincontent
- source: "Sections/home.qml"
- }
-
- Section {
- id: alert_loader
- source: "Sections/alert.qml"
- }
-
- Section {
- id: chrome
- source: "Sections/chrome.qml"
- }
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp
deleted file mode 100644
index 8fcc4a6d38..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-// checksum 0x56a9 version 0x80001
-/*
- This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
- QtQuick2ApplicationViewer is a convenience class containing mobile device
- specific
- code such as screen orientation handling. Also QML paths and debugging are
- handled here.
- It is recommended not to modify this file, since newer versions of Qt Creator
- may offer an updated version of it.
-*/
-
-#include "qtquick2applicationviewer.h"
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDir>
-#include <QtQml/QQmlEngine>
-
-class QtQuick2ApplicationViewerPrivate {
- QString mainQmlFile;
- friend class QtQuick2ApplicationViewer;
- static QString adjustPath(const QString& path);
-};
-
-QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString& path) {
-#if defined(Q_OS_MAC)
- if (!QDir::isAbsolutePath(path))
- return QString::fromLatin1("%1/../Resources/%2")
- .arg(QCoreApplication::applicationDirPath(), path);
-#elif defined(Q_OS_UNIX)
- const QString pathInInstallDir =
- QString::fromLatin1("%1/../%2")
- .arg(QCoreApplication::applicationDirPath(), path);
- if (QFileInfo(pathInInstallDir).exists())
- return pathInInstallDir;
-#endif
- return path;
-}
-
-QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow* parent)
- : QQuickView(parent), d(new QtQuick2ApplicationViewerPrivate()) {
- connect(engine(), SIGNAL(quit()), SLOT(close()));
- setResizeMode(QQuickView::SizeRootObjectToView);
-}
-
-QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() {
- delete d;
-}
-
-void QtQuick2ApplicationViewer::setMainQmlFile(const QString& file) {
- d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file);
- setSource(QUrl::fromLocalFile(d->mainQmlFile));
-}
-
-void QtQuick2ApplicationViewer::addImportPath(const QString& path) {
- engine()->addImportPath(QtQuick2ApplicationViewerPrivate::adjustPath(path));
-}
-
-void QtQuick2ApplicationViewer::showExpanded() {
-#if defined(Q_WS_SIMULATOR)
- showFullScreen();
-#else
- show();
-#endif
-}
diff --git a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h b/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
deleted file mode 100644
index 42287e8d79..0000000000
--- a/src/components/qt_hmi/References/Work/bananasnacks/qtquick2applicationviewer/qtquick2applicationviewer.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// checksum 0xfde6 version 0x80001
-/*
- This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
- QtQuick2ApplicationViewer is a convenience class containing mobile device
- specific
- code such as screen orientation handling. Also QML paths and debugging are
- 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
-
-#include <QtQuick/QQuickView>
-
-class QtQuick2ApplicationViewer : public QQuickView {
- Q_OBJECT
-
- public:
- explicit QtQuick2ApplicationViewer(QWindow* parent = 0);
- virtual ~QtQuick2ApplicationViewer();
-
- void setMainQmlFile(const QString& file);
- void addImportPath(const QString& path);
-
- void showExpanded();
-
- private:
- class QtQuick2ApplicationViewerPrivate* d;
-};
-
-#endif // QTQUICK2APPLICATIONVIEWER_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro b/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro
deleted file mode 100644
index ea541b24ce..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/FordSdlCore.pro
+++ /dev/null
@@ -1,48 +0,0 @@
-TEMPLATE = lib
-TARGET = FordSdlCore
-QT += qml quick
-CONFIG += qt plugin
-
-TARGET = $$qtLibraryTarget($$TARGET)
-uri = com.ford.sdlcore
-
-# Input
-SOURCES += \
- fordsdlcore_plugin.cpp \
- smartdevicelink.cpp \
- sdlalert.cpp \
- QtWebsocket/QWsSocket.cpp \
- QtWebsocket/QWsServer.cpp \
- sdlappslistmodel.cpp
-
-HEADERS += \
- fordsdlcore_plugin.h \
- smartdevicelink.h \
- sdlalert.h \
- QtWebsocket/QWsSocket.h \
- QtWebsocket/QWsServer.h \
- sdlappslistmodel.h
-
-OTHER_FILES = qmldir
-
-!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
- copy_qmldir.target = $$OUT_PWD/qmldir
- copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
- copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
- QMAKE_EXTRA_TARGETS += copy_qmldir
- PRE_TARGETDEPS += $$copy_qmldir.target
-}
-
-qmldir.files = qmldir
-unix {
- installPath = ../BananaSnacks/plugins/com/ford/sdlcore
- qmldir.path = $$installPath
- target.path = $$installPath
- INSTALLS += target qmldir
-}
-
-linux-g++* {
- QMAKE_CXXFLAGS += -m32
- QMAKE_LFLAGS += -m32
-}
-QMAKE_LIBDIR += /usr/lib/i386-linux-gnu/mesa
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp
deleted file mode 100644
index 9c4eed8cc1..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.cpp
+++ /dev/null
@@ -1,456 +0,0 @@
-#include "QWsServer.h"
-
-#include <QRegExp>
-#include <QStringList>
-#include <QByteArray>
-#include <QCryptographicHash>
-#include <QDateTime>
-
-const QString QWsServer::regExpResourceNameStr(
- QLatin1String("^GET\\s(.*)\\sHTTP/1.1\r\n"));
-const QString QWsServer::regExpHostStr(
- QLatin1String("\r\nHost:\\s(.+(:\\d+)?)\r\n"));
-const QString QWsServer::regExpKeyStr(
- QLatin1String("\r\nSec-WebSocket-Key:\\s(.{24})\r\n"));
-const QString QWsServer::regExpKey1Str(
- QLatin1String("\r\nSec-WebSocket-Key1:\\s(.+)\r\n"));
-const QString QWsServer::regExpKey2Str(
- QLatin1String("\r\nSec-WebSocket-Key2:\\s(.+)\r\n"));
-const QString QWsServer::regExpKey3Str(QLatin1String("\r\n(.{8})$"));
-const QString QWsServer::regExpVersionStr(
- QLatin1String("\r\nSec-WebSocket-Version:\\s(\\d+)\r\n"));
-const QString QWsServer::regExpOriginStr(
- QLatin1String("\r\nSec-WebSocket-Origin:\\s(.+)\r\n"));
-const QString QWsServer::regExpOrigin2Str(
- QLatin1String("\r\nOrigin:\\s(.+)\r\n"));
-const QString QWsServer::regExpProtocolStr(
- QLatin1String("\r\nSec-WebSocket-Protocol:\\s(.+)\r\n"));
-const QString QWsServer::regExpExtensionsStr(
- QLatin1String("\r\nSec-WebSocket-Extensions:\\s(.+)\r\n"));
-
-QWsServer::QWsServer(QObject* parent) : QObject(parent) {
- tcpServer = new QTcpServer(this);
- connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newTcpConnection()));
- qsrand(QDateTime::currentMSecsSinceEpoch());
-}
-
-QWsServer::~QWsServer() {
- tcpServer->deleteLater();
-}
-
-bool QWsServer::listen(const QHostAddress& address, quint16 port) {
- return tcpServer->listen(address, port);
-}
-
-void QWsServer::close() {
- tcpServer->close();
-}
-
-QAbstractSocket::SocketError QWsServer::serverError() {
- return tcpServer->serverError();
-}
-
-QString QWsServer::errorString() {
- return tcpServer->errorString();
-}
-
-void QWsServer::newTcpConnection() {
- QTcpSocket* tcpSocket = tcpServer->nextPendingConnection();
- connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(dataReceived()));
- headerBuffer.insert(tcpSocket, QStringList());
-}
-
-void QWsServer::closeTcpConnection() {
- QTcpSocket* tcpSocket = qobject_cast<QTcpSocket*>(sender());
- if (tcpSocket == 0)
- return;
-
- tcpSocket->close();
-}
-
-void QWsServer::dataReceived() {
- QTcpSocket* tcpSocket = qobject_cast<QTcpSocket*>(sender());
- if (tcpSocket == 0)
- return;
-
- bool allHeadersFetched = false;
-
- const QLatin1String emptyLine("\r\n");
-
- while (tcpSocket->canReadLine()) {
- QString line = tcpSocket->readLine();
-
- if (line == emptyLine) {
- allHeadersFetched = true;
- break;
- }
-
- headerBuffer[tcpSocket].append(line);
- }
-
- if (!allHeadersFetched)
- return;
-
- QString request(headerBuffer[tcpSocket].join(""));
-
- QRegExp regExp;
- regExp.setMinimal(true);
-
- // Extract mandatory datas
- // Version
- regExp.setPattern(QWsServer::regExpVersionStr);
- regExp.indexIn(request);
- QString versionStr = regExp.cap(1);
- EWebsocketVersion version;
- if (!versionStr.isEmpty()) {
- version = (EWebsocketVersion)versionStr.toInt();
- } else if (tcpSocket->bytesAvailable() >= 8) {
- version = WS_V0;
- request.append(tcpSocket->read(8));
- } else {
- version = WS_VUnknow;
- }
-
- // Resource name
- regExp.setPattern(QWsServer::regExpResourceNameStr);
- regExp.indexIn(request);
- QString resourceName = regExp.cap(1);
-
- // Host (address & port)
- regExp.setPattern(QWsServer::regExpHostStr);
- regExp.indexIn(request);
- QString host = regExp.cap(1);
- QStringList hostTmp = host.split(':');
- QString hostAddress = hostTmp[0];
- QString hostPort;
- if (hostTmp.size() > 1)
- hostPort = hostTmp.last(); // fix for IPv6
-
- // Key
- QString key, key1, key2, key3;
- if (version >= WS_V4) {
- regExp.setPattern(QWsServer::regExpKeyStr);
- regExp.indexIn(request);
- key = regExp.cap(1);
- } else {
- regExp.setPattern(QWsServer::regExpKey1Str);
- regExp.indexIn(request);
- key1 = regExp.cap(1);
- regExp.setPattern(QWsServer::regExpKey2Str);
- regExp.indexIn(request);
- key2 = regExp.cap(1);
- regExp.setPattern(QWsServer::regExpKey3Str);
- regExp.indexIn(request);
- key3 = regExp.cap(1);
- }
-
- ////////////////////////////////////////////////////////////////////
-
- // If the mandatory fields are not specified, we abord the connection to the
- // Websocket server
- if (version == WS_VUnknow || resourceName.isEmpty() ||
- hostAddress.isEmpty() ||
- (key.isEmpty() && (key1.isEmpty() || key2.isEmpty() || key3.isEmpty()))) {
- // Send bad request response
- QString response = QWsServer::composeBadRequestResponse(
- QList<EWebsocketVersion>() << WS_V6 << WS_V7 << WS_V8 << WS_V13);
- tcpSocket->write(response.toUtf8());
- tcpSocket->flush();
- return;
- }
-
- ////////////////////////////////////////////////////////////////////
-
- // Extract optional datas
-
- // Origin
- regExp.setPattern(QWsServer::regExpOriginStr);
- if (regExp.indexIn(request) == -1) {
- regExp.setPattern(QWsServer::regExpOrigin2Str);
- regExp.indexIn(request);
- }
- QString origin = regExp.cap(1);
-
- // Protocol
- regExp.setPattern(QWsServer::regExpProtocolStr);
- regExp.indexIn(request);
- QString protocol = regExp.cap(1);
-
- // Extensions
- regExp.setPattern(QWsServer::regExpExtensionsStr);
- regExp.indexIn(request);
- QString extensions = regExp.cap(1);
-
- ////////////////////////////////////////////////////////////////////
-
- // Compose opening handshake response
- QString response;
-
- if (version >= WS_V6) {
- QString accept = computeAcceptV4(key);
- response = QWsServer::composeOpeningHandshakeResponseV6(accept, protocol);
- } else if (version >= WS_V4) {
- QString accept = computeAcceptV4(key);
- QString nonce = generateNonce();
- response =
- QWsServer::composeOpeningHandshakeResponseV4(accept, nonce, protocol);
- } else {
- QString accept = computeAcceptV0(key1, key2, key3);
- response = QWsServer::composeOpeningHandshakeResponseV0(
- accept, origin, hostAddress, hostPort, resourceName, protocol);
- }
-
- // Handshake OK, disconnect readyRead
- disconnect(tcpSocket, SIGNAL(readyRead()), this, SLOT(dataReceived()));
-
- // Send opening handshake response
- if (version == WS_V0)
- tcpSocket->write(response.toLatin1());
- else
- tcpSocket->write(response.toUtf8());
- tcpSocket->flush();
-
- QWsSocket* wsSocket = new QWsSocket(this, tcpSocket, version);
- wsSocket->setResourceName(resourceName);
- wsSocket->setHost(host);
- wsSocket->setHostAddress(hostAddress);
- wsSocket->setHostPort(hostPort.toInt());
- wsSocket->setOrigin(origin);
- wsSocket->setProtocol(protocol);
- wsSocket->setExtensions(extensions);
- wsSocket->serverSideSocket = true;
-
- // ORIGINAL CODE
- // int socketDescriptor = tcpSocket->socketDescriptor();
- // incomingConnection( socketDescriptor );
-
- // CHANGED CODE FOR LINUX COMPATIBILITY
- addPendingConnection(wsSocket);
- emit newConnection();
-}
-
-void QWsServer::incomingConnection(int socketDescriptor) {
- QTcpSocket* tcpSocket = new QTcpSocket(tcpServer);
- tcpSocket->setSocketDescriptor(socketDescriptor,
- QAbstractSocket::ConnectedState);
- QWsSocket* wsSocket = new QWsSocket(this, tcpSocket);
-
- addPendingConnection(wsSocket);
- emit newConnection();
-}
-
-void QWsServer::addPendingConnection(QWsSocket* socket) {
- if (pendingConnections.size() < maxPendingConnections())
- pendingConnections.enqueue(socket);
-}
-
-QWsSocket* QWsServer::nextPendingConnection() {
- return pendingConnections.dequeue();
-}
-
-bool QWsServer::hasPendingConnections() {
- if (pendingConnections.size() > 0)
- return true;
- return false;
-}
-
-int QWsServer::maxPendingConnections() {
- return tcpServer->maxPendingConnections();
-}
-
-bool QWsServer::isListening() {
- return tcpServer->isListening();
-}
-
-QNetworkProxy QWsServer::proxy() {
- return tcpServer->proxy();
-}
-
-QHostAddress QWsServer::serverAddress() {
- return tcpServer->serverAddress();
-}
-
-quint16 QWsServer::serverPort() {
- return tcpServer->serverPort();
-}
-
-void QWsServer::setMaxPendingConnections(int numConnections) {
- tcpServer->setMaxPendingConnections(numConnections);
-}
-
-void QWsServer::setProxy(const QNetworkProxy& networkProxy) {
- tcpServer->setProxy(networkProxy);
-}
-
-bool QWsServer::setSocketDescriptor(int socketDescriptor) {
- return tcpServer->setSocketDescriptor(socketDescriptor);
-}
-
-int QWsServer::socketDescriptor() {
- return tcpServer->socketDescriptor();
-}
-
-bool QWsServer::waitForNewConnection(int msec, bool* timedOut) {
- return tcpServer->waitForNewConnection(msec, timedOut);
-}
-
-QString QWsServer::computeAcceptV0(QString key1, QString key2, QString key3) {
- QString numStr1;
- QString numStr2;
-
- QChar carac;
- for (int i = 0; i < key1.size(); i++) {
- carac = key1[i];
- if (carac.isDigit())
- numStr1.append(carac);
- }
- for (int i = 0; i < key2.size(); i++) {
- carac = key2[i];
- if (carac.isDigit())
- numStr2.append(carac);
- }
-
- quint32 num1 = numStr1.toUInt();
- quint32 num2 = numStr2.toUInt();
-
- int numSpaces1 = key1.count(' ');
- int numSpaces2 = key2.count(' ');
-
- num1 /= numSpaces1;
- num2 /= numSpaces2;
-
- QString concat = serializeInt(num1) + serializeInt(num2) + key3;
-
- QByteArray md5 =
- QCryptographicHash::hash(concat.toLatin1(), QCryptographicHash::Md5);
-
- return QString(md5);
-}
-
-QString QWsServer::computeAcceptV4(QString key) {
- key += QLatin1String("258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
- QByteArray hash =
- QCryptographicHash::hash(key.toUtf8(), QCryptographicHash::Sha1);
- return hash.toBase64();
-}
-
-QString QWsServer::generateNonce() {
- qsrand(QDateTime::currentDateTime().toTime_t());
-
- QByteArray nonce;
- int i = 16;
-
- while (i--) {
- nonce.append(qrand() % 0x100);
- }
-
- return QString(nonce.toBase64());
-}
-
-QByteArray QWsServer::serializeInt(quint32 number, quint8 nbBytes) {
- QByteArray ba;
- quint8 currentNbBytes = 0;
- while (number > 0 && currentNbBytes < nbBytes) {
- char car = static_cast<char>(number & 0xFF);
- ba.prepend(car);
- number = number >> 8;
- currentNbBytes++;
- }
- char car = 0x00;
- while (currentNbBytes < nbBytes) {
- ba.prepend(car);
- currentNbBytes++;
- }
- return ba;
-}
-
-QString QWsServer::composeOpeningHandshakeResponseV0(QString accept,
- QString origin,
- QString hostAddress,
- QString hostPort,
- QString resourceName,
- QString protocol) {
- QString response;
-
- response.append(
- QLatin1String("HTTP/1.1 101 WebSocket Protocol Handshake\r\n"));
- response.append(QLatin1String("Upgrade: Websocket\r\n"));
- response.append(QLatin1String("Connection: Upgrade\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Origin: ") + origin +
- QLatin1String("\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Location: ws://") + hostAddress);
- if (!hostPort.isEmpty())
- response.append(QLatin1String(":") + hostPort);
- response.append(resourceName + QLatin1String("\r\n"));
- if (!protocol.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Protocol: ") + protocol +
- QLatin1String("\r\n"));
- response.append(QLatin1String("\r\n"));
- response.append(accept);
-
- return response;
-}
-
-QString QWsServer::composeOpeningHandshakeResponseV4(QString accept,
- QString nonce,
- QString protocol,
- QString extensions) {
- QString response;
-
- response.append(QLatin1String("HTTP/1.1 101 Switching Protocols\r\n"));
- response.append(QLatin1String("Upgrade: websocket\r\n"));
- response.append(QLatin1String("Connection: Upgrade\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Accept: ") + accept +
- QLatin1String("\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Nonce: ") + nonce +
- QLatin1String("\r\n"));
- if (!protocol.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Protocol: ") + protocol +
- QLatin1String("\r\n"));
- if (!extensions.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Extensions: ") + extensions +
- QLatin1String("\r\n"));
- response.append(QLatin1String("\r\n"));
-
- return response;
-}
-
-QString QWsServer::composeOpeningHandshakeResponseV6(QString accept,
- QString protocol,
- QString extensions) {
- QString response;
-
- response.append(QLatin1String("HTTP/1.1 101 Switching Protocols\r\n"));
- response.append(QLatin1String("Upgrade: websocket\r\n"));
- response.append(QLatin1String("Connection: Upgrade\r\n"));
- response.append(QLatin1String("Sec-WebSocket-Accept: ") + accept +
- QLatin1String("\r\n"));
- if (!protocol.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Protocol: ") + protocol +
- QLatin1String("\r\n"));
- if (!extensions.isEmpty())
- response.append(QLatin1String("Sec-WebSocket-Extensions: ") + extensions +
- QLatin1String("\r\n"));
- response.append(QLatin1String("\r\n"));
-
- return response;
-}
-
-QString QWsServer::composeBadRequestResponse(
- QList<EWebsocketVersion> versions) {
- QString response;
-
- response.append(QLatin1String("HTTP/1.1 400 Bad Request\r\n"));
- if (!versions.isEmpty()) {
- QString versionsStr = QString::number((int)versions.takeLast());
- int i = versions.size();
- while (i--) {
- versionsStr.append(QLatin1String(", ") +
- QString::number((int)versions.takeLast()));
- }
- response.append(QLatin1String("Sec-WebSocket-Version: ") + versionsStr +
- QLatin1String("\r\n"));
- }
-
- return response;
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h
deleted file mode 100644
index f37dd4b5b2..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsServer.h
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef QWSSERVER_H
-#define QWSSERVER_H
-
-#include <QTcpServer>
-#include <QTcpSocket>
-#include <QNetworkProxy>
-#include <QString>
-#include <QStringList>
-#include <QMap>
-#include <QQueue>
-
-#include "QWsSocket.h"
-
-class QWsServer : public QObject {
- Q_OBJECT
-
- public:
- // ctor
- QWsServer(QObject* parent = 0);
- // dtor
- virtual ~QWsServer();
-
- // public functions
- void close();
- QString errorString();
- bool hasPendingConnections();
- bool isListening();
- bool listen(const QHostAddress& address = QHostAddress::Any,
- quint16 port = 0);
- int maxPendingConnections();
- virtual QWsSocket* nextPendingConnection();
- QNetworkProxy proxy();
- QHostAddress serverAddress();
- QAbstractSocket::SocketError serverError();
- quint16 serverPort();
- void setMaxPendingConnections(int numConnections);
- void setProxy(const QNetworkProxy& networkProxy);
- bool setSocketDescriptor(int socketDescriptor);
- int socketDescriptor();
- bool waitForNewConnection(int msec = 0, bool* timedOut = 0);
-
-signals:
- void newConnection();
-
- protected:
- // protected functions
- void addPendingConnection(QWsSocket* socket);
- virtual void incomingConnection(int socketDescriptor);
-
- private slots:
- // private slots
- void newTcpConnection();
- void closeTcpConnection();
- void dataReceived();
-
- private:
- // private attributes
- QTcpServer* tcpServer;
- QQueue<QWsSocket*> pendingConnections;
- QMap<const QTcpSocket*, QStringList> headerBuffer;
-
- public:
- // public static functions
- static QByteArray serializeInt(quint32 number, quint8 nbBytes = 4);
- static QString computeAcceptV0(QString key1, QString key2, QString thirdPart);
- static QString computeAcceptV4(QString key);
- static QString generateNonce();
- static QString composeOpeningHandshakeResponseV0(QString accept,
- QString origin,
- QString hostAddress,
- QString hostPort,
- QString resourceName,
- QString protocol = "");
- static QString composeOpeningHandshakeResponseV4(QString accept,
- QString nonce,
- QString protocol = "",
- QString extensions = "");
- static QString composeOpeningHandshakeResponseV6(QString accept,
- QString protocol = "",
- QString extensions = "");
- static QString composeBadRequestResponse(
- QList<EWebsocketVersion> versions = QList<EWebsocketVersion>());
-
- // public static vars
- static const QString regExpResourceNameStr;
- static const QString regExpHostStr;
- static const QString regExpKeyStr;
- static const QString regExpKey1Str;
- static const QString regExpKey2Str;
- static const QString regExpKey3Str;
- static const QString regExpVersionStr;
- static const QString regExpOriginStr;
- static const QString regExpOrigin2Str;
- static const QString regExpProtocolStr;
- static const QString regExpExtensionsStr;
-};
-
-#endif // QWSSERVER_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp
deleted file mode 100644
index 428f559517..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.cpp
+++ /dev/null
@@ -1,749 +0,0 @@
-#include "QWsSocket.h"
-
-#include <QCryptographicHash>
-#include <QtEndian>
-
-#include "QWsServer.h"
-
-int QWsSocket::maxBytesPerFrame = 1400;
-const QString QWsSocket::regExpAcceptStr(
- QLatin1String("Sec-WebSocket-Accept:\\s(.{28})\r\n"));
-const QString QWsSocket::regExpUpgradeStr(QLatin1String("Upgrade:\\s(.+)\r\n"));
-const QString QWsSocket::regExpConnectionStr(
- QLatin1String("Connection:\\s(.+)\r\n"));
-
-QWsSocket::QWsSocket(QObject* parent,
- QTcpSocket* socket,
- EWebsocketVersion ws_v)
- : QAbstractSocket(QAbstractSocket::UnknownSocketType, parent)
- , tcpSocket(socket ? socket : new QTcpSocket(this))
- , _version(ws_v)
- , _hostPort(-1)
- , closingHandshakeSent(false)
- , closingHandshakeReceived(false)
- , readingState(HeaderPending)
- , isFinalFragment(false)
- , hasMask(false)
- , payloadLength(0)
- , maskingKey(4, 0)
- , serverSideSocket(false) {
- tcpSocket->setParent(this);
-
- QAbstractSocket::setSocketState(tcpSocket->state());
- QAbstractSocket::setPeerAddress(tcpSocket->peerAddress());
- QAbstractSocket::setPeerPort(tcpSocket->peerPort());
-
- if (_version == WS_V0)
- connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(processDataV0()));
- else if (_version >= WS_V4)
- connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(processDataV4()));
- connect(tcpSocket,
- SIGNAL(error(QAbstractSocket::SocketError)),
- this,
- SIGNAL(error(QAbstractSocket::SocketError)));
- connect(tcpSocket,
- SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&,
- QAuthenticator*)),
- this,
- SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&,
- QAuthenticator*)));
- connect(tcpSocket,
- SIGNAL(stateChanged(QAbstractSocket::SocketState)),
- this,
- SLOT(processTcpStateChanged(QAbstractSocket::SocketState)));
- connect(tcpSocket,
- SIGNAL(readChannelFinished()),
- this,
- SIGNAL(readChannelFinished()));
- connect(tcpSocket, SIGNAL(hostFound()), this, SIGNAL(hostFound()));
-}
-
-QWsSocket::~QWsSocket() {
- QAbstractSocket::SocketState state = QAbstractSocket::state();
- if (state != QAbstractSocket::UnconnectedState) {
- qDebug() << "CloseAway, socket destroyed in server";
- close(CloseGoingAway, QLatin1String("The server destroyed the socket."));
- tcpSocket->abort();
- QAbstractSocket::setSocketState(QAbstractSocket::UnconnectedState);
- QAbstractSocket::stateChanged(QAbstractSocket::UnconnectedState);
- emit QAbstractSocket::disconnected();
- }
-}
-
-void QWsSocket::connectToHost(const QString& hostName,
- quint16 port,
- OpenMode mode) {
- QWsSocket::connectToHost(QHostAddress(hostName), port, mode);
-}
-
-void QWsSocket::connectToHost(const QHostAddress& address,
- quint16 port,
- OpenMode mode) {
- handshakeResponse.clear();
- setPeerAddress(address);
- setPeerPort(port);
- setOpenMode(mode);
- tcpSocket->connectToHost(address, port, mode);
-}
-
-void QWsSocket::disconnectFromHost() {
- QWsSocket::close();
-}
-
-void QWsSocket::abort(QString reason) {
- QWsSocket::close(CloseAbnormalDisconnection, reason);
- tcpSocket->abort();
-}
-
-void QWsSocket::close(ECloseStatusCode closeStatusCode, QString reason) {
- if (QAbstractSocket::state() == QAbstractSocket::UnconnectedState)
- return;
-
- if (!closingHandshakeSent) {
- switch (_version) {
- case WS_V4:
- case WS_V5:
- case WS_V6:
- case WS_V7:
- case WS_V8:
- case WS_V13: {
- // Compose and send close frame
- QByteArray BA;
-
- // Body
- if (closeStatusCode == NoCloseStatusCode) {
- // Header
- BA.append(QWsSocket::composeHeader(true, OpClose, 0));
- } else {
- // Header
- QByteArray maskingKey;
- if (!serverSideSocket)
- maskingKey = QWsSocket::generateMaskingKey();
- BA.append(QWsSocket::composeHeader(
- true, OpClose, reason.size() + 2, maskingKey));
-
- QByteArray body;
-
- // Close status code (optional)
- body.append(QWsServer::serializeInt((int)closeStatusCode, 2));
-
- // Reason (optional)
- if (reason.size()) {
- QByteArray reason_ba = reason.toUtf8();
- if (!serverSideSocket) {
- reason_ba = QWsSocket::mask(reason_ba, maskingKey);
- }
- body.append(reason_ba);
- }
-
- BA.append(body);
- }
-
- // Send closing handshake
- tcpSocket->write(BA);
-
- break;
- }
- case WS_V0: {
- QByteArray closeFrame;
- closeFrame.append((char)0xFF);
- closeFrame.append((char)0x00);
- tcpSocket->write(closeFrame);
- break;
- }
- default: { break; }
- }
-
- closingHandshakeSent = true;
- }
-
- if (QAbstractSocket::state() != QAbstractSocket::ClosingState) {
- QAbstractSocket::setSocketState(QAbstractSocket::ClosingState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ClosingState);
- emit QAbstractSocket::aboutToClose();
- }
-
- if (closingHandshakeSent && closingHandshakeReceived) {
- QAbstractSocket::setSocketState(QAbstractSocket::UnconnectedState);
- emit stateChanged(QAbstractSocket::UnconnectedState);
- emit disconnected();
- tcpSocket->disconnectFromHost();
- }
-}
-
-qint64 QWsSocket::write(const QString& string) {
- if (_version == WS_V0) {
- return QWsSocket::write(string.toUtf8());
- }
-
- const QList<QByteArray>& framesList =
- QWsSocket::composeFrames(string.toUtf8(), false, maxBytesPerFrame);
- return writeFrames(framesList);
-}
-
-qint64 QWsSocket::write(const QByteArray& byteArray) {
- if (_version == WS_V0) {
- QByteArray BA;
- BA.append((char)0x00);
- BA.append(byteArray);
- BA.append((char)0xFF);
- return writeFrame(BA);
- }
-
- const QList<QByteArray>& framesList =
- QWsSocket::composeFrames(byteArray, true, maxBytesPerFrame);
-
- qint64 nbBytesWritten = writeFrames(framesList);
- emit bytesWritten(nbBytesWritten);
-
- return nbBytesWritten;
-}
-
-void QWsSocket::processHandshake() {
- // copy from QWsServer::dataReceived();
- QTcpSocket* tcpSocket = qobject_cast<QTcpSocket*>(sender());
- if (tcpSocket == 0)
- return;
-
- bool allHeadersFetched = false;
-
- const QLatin1String emptyLine("\r\n");
-
- while (tcpSocket->canReadLine()) {
- QString line = tcpSocket->readLine();
-
- if (line == emptyLine) {
- allHeadersFetched = true;
- break;
- }
-
- handshakeResponse.append(line);
- }
-
- if (!allHeadersFetched)
- return;
-
- QRegExp regExp;
- regExp.setMinimal(true);
-
- // check accept field
- regExp.setPattern(regExpAcceptStr);
- regExp.indexIn(handshakeResponse);
- QString acceptFromServer = regExp.cap(1);
-
- // check upgrade field
- regExp.setPattern(regExpUpgradeStr);
- regExp.indexIn(handshakeResponse);
- QString upgrade = regExp.cap(1);
-
- // check connection field
- regExp.setPattern(regExpConnectionStr);
- regExp.indexIn(handshakeResponse);
- QString connection = regExp.cap(1);
-
- // check extensions field
- regExp.setPattern(QWsServer::regExpExtensionsStr);
- regExp.indexIn(handshakeResponse);
- QString extensions = regExp.cap(1);
-
- // TODO: check extensions field
- // If the mandatory params are not setted, we abord the connection to the
- // Websocket server
- if ((acceptFromServer.isEmpty()) ||
- (!upgrade.contains(QLatin1String("websocket"), Qt::CaseInsensitive)) ||
- (!connection.contains(QLatin1String("Upgrade"), Qt::CaseInsensitive))) {
- // emit error(QAbstractSocket::ConnectionRefusedError);
- // return;
- }
-
- // TODO: check HTTP code
-
- // TODO: check protocol field
-
- QString accept = QWsServer::computeAcceptV4(key);
- if (accept != acceptFromServer) {
- // emit error(QAbstractSocket::ConnectionRefusedError);
- // return;
- }
-
- // handshake procedure succeeded
- QAbstractSocket::setSocketState(QAbstractSocket::ConnectedState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ConnectedState);
- emit QAbstractSocket::connected();
-}
-
-void QWsSocket::processDataV0() {
- if (state() == QAbstractSocket::ConnectingState) {
- processHandshake();
- return;
- }
-
- QByteArray BA, buffer;
- quint8 type, b = 0x00;
-
- BA = tcpSocket->read(1); // TODO: refactor like processDataV4
- type = BA[0];
-
- if ((type & 0x80) == 0x00) // MSB of type not set
- {
- if (type != 0x00) {
- // ABORT CONNEXION
- tcpSocket->readAll();
- return;
- }
-
- // read data
- do {
- BA = tcpSocket->read(1);
- b = BA[0];
- if (b != 0xFF)
- buffer.append(b);
- } while (b != 0xFF);
-
- currentFrame.append(buffer);
- } else // MSB of type set
- {
- if (type != 0xFF) {
- // ERROR, ABORT CONNEXION
- close();
- return;
- }
-
- quint8 length = 0x00;
-
- bool bIsNotZero = true;
- do {
- BA = tcpSocket->read(1);
- b = BA[0];
- bIsNotZero = (b != 0x00 ? true : false);
- if (bIsNotZero) // b must be != 0
- {
- quint8 b_v = b & 0x7F;
- length *= 128;
- length += b_v;
- }
- } while (((b & 0x80) == 0x80) && bIsNotZero);
-
- BA = tcpSocket->read(length); // discard this bytes
- }
-
- if (currentFrame.size() > 0) {
- emit frameReceived(QString::fromUtf8(currentFrame));
- currentFrame.clear();
- }
-
- if (tcpSocket->bytesAvailable())
- processDataV0();
-}
-
-void QWsSocket::processDataV4() {
- if (state() == QAbstractSocket::ConnectingState) {
- processHandshake();
- } else
- while (true)
- switch (readingState) {
- case HeaderPending: {
- if (tcpSocket->bytesAvailable() < 2)
- return;
-
- // END, RSV1-3, Opcode
- char header[2];
- tcpSocket->read(header, 2); // XXX: Handle return value
- isFinalFragment = (header[0] & 0x80) != 0;
- opcode = static_cast<EOpcode>(header[0] & 0x0F);
-
- // Mask, PayloadLength
- hasMask = (header[1] & 0x80) != 0;
- quint8 length = (header[1] & 0x7F);
-
- switch (length) {
- case 126:
- readingState = PayloadLengthPending;
- break;
- case 127:
- readingState = BigPayloadLenghPending;
- break;
- default:
- payloadLength = length;
- readingState = MaskPending;
- break;
- }
- }; break;
- case PayloadLengthPending: {
- if (tcpSocket->bytesAvailable() < 2)
- return;
-
- uchar length[2];
- tcpSocket->read(reinterpret_cast<char*>(length),
- 2); // XXX: Handle return value
- payloadLength =
- qFromBigEndian<quint16>(reinterpret_cast<const uchar*>(length));
- readingState = MaskPending;
- }; break;
- case BigPayloadLenghPending: {
- if (tcpSocket->bytesAvailable() < 8)
- return;
-
- uchar length[8];
- tcpSocket->read(reinterpret_cast<char*>(length),
- 8); // XXX: Handle return value
- // Most significant bit must be set to 0 as per
- // http://tools.ietf.org/html/rfc6455#section-5.2
- // XXX: Check for that?
- payloadLength = qFromBigEndian<quint64>(length) & ~(1LL << 63);
- readingState = MaskPending;
- }; break;
- case MaskPending: {
- if (!hasMask) {
- readingState = PayloadBodyPending;
- break;
- }
-
- if (tcpSocket->bytesAvailable() < 4)
- return;
-
- tcpSocket->read(maskingKey.data(), 4); // XXX: Handle return value
-
- if (opcode == OpClose) {
- readingState = CloseDataPending;
- } else {
- readingState = PayloadBodyPending;
- }
- }; /* Intentional fall-through */
- case PayloadBodyPending: {
- // TODO: Handle large payloads
- if (tcpSocket->bytesAvailable() < static_cast<qint32>(payloadLength))
- return;
-
- if (opcode == OpClose) {
- if (payloadLength >= 2 && tcpSocket->bytesAvailable() >= 2) {
- uchar bytes[2];
- tcpSocket->read(reinterpret_cast<char*>(bytes), 2);
- closeStatusCode = (ECloseStatusCode)qFromBigEndian<quint16>(
- reinterpret_cast<const uchar*>(bytes));
- } else {
- closeStatusCode = NoCloseStatusCode;
- }
- }
-
- QByteArray ApplicationData = tcpSocket->read(payloadLength);
- if (hasMask)
- ApplicationData = QWsSocket::mask(ApplicationData, maskingKey);
- currentFrame.append(ApplicationData);
-
- readingState = HeaderPending;
-
- if (!isFinalFragment)
- break;
-
- switch (opcode) {
- case OpBinary:
- emit frameReceived(currentFrame);
- break;
- case OpText:
- emit frameReceived(QString::fromUtf8(currentFrame));
- break;
- case OpPing:
- write(QWsSocket::composeHeader(true, OpPong, 0));
- break;
- case OpPong:
- emit pong(pingTimer.elapsed());
- break;
- case OpClose:
- closingHandshakeReceived = true;
- close(closeStatusCode);
- break;
- default:
- // DO NOTHING
- break;
- }
-
- currentFrame.clear();
- }; break;
- case CloseDataPending:
- default:
- break;
- } /* while (true) switch */
-}
-
-qint64 QWsSocket::writeFrame(const QByteArray& byteArray) {
- return tcpSocket->write(byteArray);
-}
-
-qint64 QWsSocket::writeFrames(const QList<QByteArray>& framesList) {
- qint64 nbBytesWritten = 0;
- for (int i = 0; i < framesList.size(); i++) {
- nbBytesWritten += writeFrame(framesList[i]);
- }
- return nbBytesWritten;
-}
-
-void QWsSocket::processTcpStateChanged(
- QAbstractSocket::SocketState tcpSocketState) {
- QAbstractSocket::SocketState wsSocketState = QAbstractSocket::state();
- switch (tcpSocketState) {
- case QAbstractSocket::HostLookupState: {
- QAbstractSocket::setSocketState(QAbstractSocket::HostLookupState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::HostLookupState);
- break;
- }
- case QAbstractSocket::ConnectingState: {
- QAbstractSocket::setSocketState(QAbstractSocket::ConnectingState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ConnectingState);
- break;
- }
- case QAbstractSocket::ConnectedState: {
- if (wsSocketState == QAbstractSocket::ConnectingState) {
- key = QWsServer::generateNonce();
- QString handshake =
- composeOpeningHandShake(QLatin1String("/"),
- QLatin1String("example.com"),
- QString(),
- QString(),
- key);
- tcpSocket->write(handshake.toUtf8());
- }
- break;
- }
- case QAbstractSocket::ClosingState: {
- if (wsSocketState == QAbstractSocket::ConnectedState) {
- QWsSocket::close(CloseGoingAway);
- QAbstractSocket::setSocketState(QAbstractSocket::ClosingState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::ClosingState);
- emit QAbstractSocket::aboutToClose();
- }
- break;
- }
- case QAbstractSocket::UnconnectedState: {
- if (wsSocketState != QAbstractSocket::UnconnectedState) {
- QAbstractSocket::setSocketError(QAbstractSocket::NetworkError);
- emit QAbstractSocket::error(QAbstractSocket::NetworkError);
- QAbstractSocket::setSocketState(QAbstractSocket::UnconnectedState);
- emit QAbstractSocket::stateChanged(QAbstractSocket::UnconnectedState);
- emit QAbstractSocket::disconnected();
- }
- closingHandshakeSent = false;
- closingHandshakeReceived = false;
- break;
- }
- default:
- break;
- }
-}
-
-QByteArray QWsSocket::generateMaskingKey() {
- QByteArray key;
- for (int i = 0; i < 4; i++) {
- key.append(qrand() % 0x100);
- }
- return key;
-}
-
-QByteArray QWsSocket::generateMaskingKeyV4(QString key, QString nonce) {
- QString concat =
- key + nonce + QLatin1String("61AC5F19-FBBA-4540-B96F-6561F1AB40A8");
- QByteArray hash =
- QCryptographicHash::hash(concat.toUtf8(), QCryptographicHash::Sha1);
- return hash;
-}
-
-QByteArray QWsSocket::mask(QByteArray& data, QByteArray& maskingKey) {
- QByteArray result;
- result.reserve(data.size());
-
- for (int i = 0; i < data.size(); i++) {
- result[i] = (data[i] ^ maskingKey[i % 4]);
- }
-
- return result;
-}
-
-QList<QByteArray> QWsSocket::composeFrames(QByteArray byteArray,
- bool asBinary,
- int maxFrameBytes) {
- if (maxFrameBytes == 0)
- maxFrameBytes = maxBytesPerFrame;
-
- QList<QByteArray> framesList;
-
- QByteArray maskingKey;
-
- int nbFrames = byteArray.size() / maxFrameBytes + 1;
-
- for (int i = 0; i < nbFrames; i++) {
- QByteArray BA;
-
- // end, size
- bool end = false;
- quint64 size = maxFrameBytes;
- EOpcode opcode = OpContinue;
- if (i == nbFrames - 1) // for multi-frames
- {
- end = true;
- size = byteArray.size();
- }
- if (i == 0) {
- if (asBinary)
- opcode = OpBinary;
- else
- opcode = OpText;
- }
-
- // Header
- BA.append(QWsSocket::composeHeader(end, opcode, size, maskingKey));
-
- // Application Data
- QByteArray dataForThisFrame = byteArray.left(size);
- byteArray.remove(0, size);
-
- // dataForThisFrame = QWsSocket::mask( dataForThisFrame, maskingKey );
- BA.append(dataForThisFrame);
-
- framesList << BA;
- }
-
- return framesList;
-}
-
-QByteArray QWsSocket::composeHeader(bool end,
- EOpcode opcode,
- quint64 payloadLength,
- QByteArray maskingKey) {
- QByteArray BA;
- quint8 byte;
-
- // end, RSV1-3, Opcode
- byte = 0x00;
- // end
- if (end)
- byte = (byte | 0x80);
- // Opcode
- byte = (byte | opcode);
- BA.append(byte);
-
- // Mask, PayloadLength
- byte = 0x00;
- QByteArray BAsize;
- // Mask
- if (maskingKey.size() == 4)
- byte = (byte | 0x80);
- // PayloadLength
- if (payloadLength <= 125) {
- byte = (byte | payloadLength);
- }
- // Extended payloadLength
- else {
- // 2 bytes
- if (payloadLength <= 0xFFFF) {
- byte = (byte | 126);
- BAsize.append((payloadLength >> 1 * 8) & 0xFF);
- BAsize.append((payloadLength >> 0 * 8) & 0xFF);
- }
- // 8 bytes
- else if (payloadLength <= 0x7FFFFFFF) {
- byte = (byte | 127);
- BAsize.append((payloadLength >> 7 * 8) & 0xFF);
- BAsize.append((payloadLength >> 6 * 8) & 0xFF);
- BAsize.append((payloadLength >> 5 * 8) & 0xFF);
- BAsize.append((payloadLength >> 4 * 8) & 0xFF);
- BAsize.append((payloadLength >> 3 * 8) & 0xFF);
- BAsize.append((payloadLength >> 2 * 8) & 0xFF);
- BAsize.append((payloadLength >> 1 * 8) & 0xFF);
- BAsize.append((payloadLength >> 0 * 8) & 0xFF);
- }
- }
- BA.append(byte);
- BA.append(BAsize);
-
- // Masking
- if (maskingKey.size() == 4)
- BA.append(maskingKey);
-
- return BA;
-}
-
-void QWsSocket::ping() {
- pingTimer.restart();
- QByteArray pingFrame = QWsSocket::composeHeader(true, OpPing, 0);
- writeFrame(pingFrame);
-}
-
-void QWsSocket::setResourceName(QString rn) {
- _resourceName = rn;
-}
-
-void QWsSocket::setHost(QString h) {
- _host = h;
-}
-
-void QWsSocket::setHostAddress(QString ha) {
- _hostAddress = ha;
-}
-
-void QWsSocket::setHostPort(int hp) {
- _hostPort = hp;
-}
-
-void QWsSocket::setOrigin(QString o) {
- _origin = o;
-}
-
-void QWsSocket::setProtocol(QString p) {
- _protocol = p;
-}
-
-void QWsSocket::setExtensions(QString e) {
- _extensions = e;
-}
-
-EWebsocketVersion QWsSocket::version() {
- return _version;
-}
-
-QString QWsSocket::resourceName() {
- return _resourceName;
-}
-
-QString QWsSocket::host() {
- return _host;
-}
-
-QString QWsSocket::hostAddress() {
- return _hostAddress;
-}
-
-int QWsSocket::hostPort() {
- return _hostPort;
-}
-
-QString QWsSocket::origin() {
- return _origin;
-}
-
-QString QWsSocket::protocol() {
- return _protocol;
-}
-
-QString QWsSocket::extensions() {
- return _extensions;
-}
-
-QString QWsSocket::composeOpeningHandShake(QString resourceName,
- QString host,
- QString origin,
- QString extensions,
- QString key) {
- QString hs;
- hs.append(QLatin1String("GET ") + resourceName +
- QLatin1String(" HTTP/1.1\r\n"));
- hs.append(QLatin1String("Host: ") + host + "\r\n");
- hs.append(QLatin1String("Upgrade: websocket\r\n"));
- hs.append(QLatin1String("Connection: Upgrade\r\n"));
- hs.append(QLatin1String("Sec-WebSocket-Key: ") + key + QLatin1String("\r\n"));
- hs.append(QLatin1String("Origin: ") + origin + QLatin1String("\r\n"));
- hs.append(QLatin1String("Sec-WebSocket-Extensions: ") + extensions +
- QLatin1String("\r\n"));
- hs.append(QLatin1String("Sec-WebSocket-Version: 13\r\n"));
- hs.append(QLatin1String("\r\n"));
- return hs;
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h
deleted file mode 100644
index cdd19db38a..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QWsSocket.h
+++ /dev/null
@@ -1,181 +0,0 @@
-#ifndef QWSSOCKET_H
-#define QWSSOCKET_H
-
-#include <QTcpSocket>
-#include <QHostAddress>
-#include <QTime>
-
-enum EWebsocketVersion {
- WS_VUnknow = -1,
- WS_V0 = 0,
- WS_V4 = 4,
- WS_V5 = 5,
- WS_V6 = 6,
- WS_V7 = 7,
- WS_V8 = 8,
- WS_V13 = 13
-};
-
-class QWsSocket : public QAbstractSocket {
- Q_OBJECT
-
- friend class QWsServer;
-
- public:
- enum EOpcode {
- OpContinue = 0x0,
- OpText = 0x1,
- OpBinary = 0x2,
- OpReserved3 = 0x3,
- OpReserved4 = 0x4,
- OpReserved5 = 0x5,
- OpReserved6 = 0x6,
- OpReserved7 = 0x7,
- OpClose = 0x8,
- OpPing = 0x9,
- OpPong = 0xA,
- OpReservedB = 0xB,
- OpReservedV = 0xC,
- OpReservedD = 0xD,
- OpReservedE = 0xE,
- OpReservedF = 0xF
- };
- enum ECloseStatusCode {
- NoCloseStatusCode = 0,
- CloseNormal = 1000,
- CloseGoingAway = 1001,
- CloseProtocolError = 1002,
- CloseDataTypeNotSupported = 1003,
- CloseReserved1004 = 1004,
- CloseMissingStatusCode = 1005,
- CloseAbnormalDisconnection = 1006,
- CloseWrongDataType = 1007,
- ClosePolicyViolated = 1008,
- CloseTooMuchData = 1009,
- CloseMissingExtension = 1010,
- CloseBadOperation = 1011,
- CloseTLSHandshakeFailed = 1015
- };
-
- public:
- // ctor
- QWsSocket(QObject* parent = 0,
- QTcpSocket* socket = 0,
- EWebsocketVersion ws_v = WS_V13);
- // dtor
- virtual ~QWsSocket();
-
- // Public methods
- EWebsocketVersion version();
- QString resourceName();
- QString host();
- QString hostAddress();
- int hostPort();
- QString origin();
- QString protocol();
- QString extensions();
-
- void setResourceName(QString rn);
- void setHost(QString h);
- void setHostAddress(QString ha);
- void setHostPort(int hp);
- void setOrigin(QString o);
- void setProtocol(QString p);
- void setExtensions(QString e);
-
- qint64 write(const QString& string); // write data as text
- qint64 write(const QByteArray& byteArray); // write data as binary
-
- public slots:
- void connectToHost(const QString& hostName,
- quint16 port,
- OpenMode mode = ReadWrite);
- void connectToHost(const QHostAddress& address,
- quint16 port,
- OpenMode mode = ReadWrite);
- void disconnectFromHost();
- void abort(QString reason = QString());
- void ping();
-
-signals:
- void frameReceived(QString frame);
- void frameReceived(QByteArray frame);
- void pong(quint64 elapsedTime);
-
- protected:
- qint64 writeFrames(const QList<QByteArray>& framesList);
- qint64 writeFrame(const QByteArray& byteArray);
-
- protected slots:
- virtual void close(ECloseStatusCode closeStatusCode = NoCloseStatusCode,
- QString reason = QString());
- void processDataV0();
- void processDataV4();
- void processHandshake();
- void processTcpStateChanged(QAbstractSocket::SocketState socketState);
-
- private:
- enum EReadingState {
- HeaderPending,
- PayloadLengthPending,
- BigPayloadLenghPending,
- MaskPending,
- PayloadBodyPending,
- CloseDataPending
- };
-
- // private vars
- QTcpSocket* tcpSocket;
- QByteArray currentFrame;
- QTime pingTimer;
-
- EWebsocketVersion _version;
- QString _resourceName;
- QString _host;
- QString _hostAddress;
- int _hostPort;
- QString _origin;
- QString _protocol;
- QString _extensions;
- bool serverSideSocket;
-
- bool closingHandshakeSent;
- bool closingHandshakeReceived;
-
- EReadingState readingState;
- EOpcode opcode;
- bool isFinalFragment;
- bool hasMask;
- quint64 payloadLength;
- QByteArray maskingKey;
- ECloseStatusCode closeStatusCode;
-
- static const QString regExpAcceptStr;
- static const QString regExpUpgradeStr;
- static const QString regExpConnectionStr;
- QString handshakeResponse;
- QString key;
-
- public:
- // Static functions
- static QByteArray generateMaskingKey();
- static QByteArray generateMaskingKeyV4(QString key, QString nonce);
- static QByteArray mask(QByteArray& data, QByteArray& maskingKey);
- static QList<QByteArray> composeFrames(QByteArray byteArray,
- bool asBinary = false,
- int maxFrameBytes = 0);
- static QByteArray composeHeader(bool end,
- EOpcode opcode,
- quint64 payloadLength,
- QByteArray maskingKey = QByteArray());
- static QString composeOpeningHandShake(QString resourceName,
- QString host,
- QString origin,
- QString extensions,
- QString key);
-
- // static vars
- static int maxBytesPerFrame;
-};
-
-#endif // QWSSOCKET_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro
deleted file mode 100644
index f52bda256e..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2012-03-05T10:38:43
-#
-#-------------------------------------------------
-
-QT += network
-
-QT -= gui
-
-TARGET = QtWebsocket
-TEMPLATE = lib
-CONFIG += staticlib
-
-SOURCES += \
- QWsServer.cpp \
- QWsSocket.cpp
-
-HEADERS += \
- QWsServer.h \
- QWsSocket.h
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj b/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj
deleted file mode 100644
index 306dcada09..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/QtWebsocket/QtWebsocket.vcproj
+++ /dev/null
@@ -1,328 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="QtWebsocket"
- ProjectGUID="{7E3A920C-4257-41A1-B9B9-BFA138C1C8A2}"
- Keyword="Qt4VSv1.0"
- TargetFrameworkVersion="0"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;.\GeneratedFiles&quot;;&quot;.&quot;;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;"
- PreprocessorDefinitions=",UNICODE,WIN32,QT_LARGEFILE_SUPPORT;QT_DLL;QT_NO_DEBUG,NDEBUG;QT_CORE_LIB;QT_NETWORK_LIB;QTWEBSOCKET_LIB"
- RuntimeLibrary="2"
- TreatWChar_tAsBuiltInType="false"
- DebugInformationFormat="0"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)\$(ProjectName).lib"
- AdditionalLibraryDirectories="$(QTDIR)\lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="4"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;.\GeneratedFiles&quot;;&quot;.&quot;;&quot;$(QTDIR)\include&quot;;&quot;.\GeneratedFiles\$(ConfigurationName)&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;"
- PreprocessorDefinitions=",UNICODE,WIN32,QT_LARGEFILE_SUPPORT;QT_DLL;QT_CORE_LIB;QT_NETWORK_LIB;QTWEBSOCKET_LIB"
- RuntimeLibrary="3"
- TreatWChar_tAsBuiltInType="false"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)\$(ProjectName).lib"
- AdditionalLibraryDirectories="$(QTDIR)\lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;c;def"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\QWsServer.cpp"
- >
- </File>
- <File
- RelativePath=".\QWsSocket.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\QWsServer.h"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsServer.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsServer.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\QWsSocket.h"
- >
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsSocket.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Moc&apos;ing QWsSocket.h..."
- CommandLine="&quot;$(QTDIR)\bin\moc.exe&quot; &quot;$(InputPath)&quot; -o &quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot; -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_CORE_LIB -DQT_NETWORK_LIB -DQTWEBSOCKET_LIB &quot;-I.\GeneratedFiles&quot; &quot;-I.&quot; &quot;-I$(QTDIR)\include&quot; &quot;-I.\GeneratedFiles\$(ConfigurationName)\.&quot; &quot;-I$(QTDIR)\include\QtCore&quot; &quot;-I$(QTDIR)\include\QtNetwork&quot;&#x0D;&#x0A;"
- AdditionalDependencies="&quot;$(QTDIR)\bin\moc.exe&quot;;$(InputPath)"
- Outputs="&quot;.\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp&quot;"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Form Files"
- Filter="ui"
- UniqueIdentifier="{99349809-55BA-4b9d-BF79-8FDBB0286EB3}"
- >
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="qrc;*"
- UniqueIdentifier="{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}"
- ParseFiles="false"
- >
- </Filter>
- <Filter
- Name="Generated Files"
- Filter="moc;h;cpp"
- UniqueIdentifier="{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}"
- SourceControlFiles="false"
- >
- <Filter
- Name="Release"
- Filter="cpp;moc"
- SourceControlFiles="false"
- >
- <File
- RelativePath=".\GeneratedFiles\Release\moc_QWsServer.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\GeneratedFiles\Release\moc_QWsSocket.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Debug"
- Filter="cpp;moc"
- SourceControlFiles="false"
- >
- <File
- RelativePath=".\GeneratedFiles\Debug\moc_QWsServer.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\GeneratedFiles\Debug\moc_QWsSocket.cpp"
- >
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- </Filter>
- </Filter>
- </Files>
- <Globals>
- <Global
- Name="lreleaseOptions"
- Value=""
- />
- <Global
- Name="lupdateOnBuild"
- Value="0"
- />
- <Global
- Name="lupdateOptions"
- Value=""
- />
- <Global
- Name="MocDir"
- Value=".\GeneratedFiles\$(ConfigurationName)"
- />
- <Global
- Name="MocOptions"
- Value=""
- />
- <Global
- Name="QtVersion Win32"
- Value="4.8.2"
- />
- <Global
- Name="RccDir"
- Value=".\GeneratedFiles"
- />
- <Global
- Name="UicDir"
- Value=".\GeneratedFiles"
- />
- </Globals>
-</VisualStudioProject>
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
deleted file mode 100644
index 003b098d47..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "fordsdlcore_plugin.h"
-#include "smartdevicelink.h"
-#include <QDebug>
-#include <qqml.h>
-#include "sdlalert.h"
-#include <QQmlEngine>
-#include <QQmlContext>
-
-QObject* sdlSingleton(QQmlEngine* engine, QJSEngine* js) {
- Q_UNUSED(engine)
- Q_UNUSED(js)
-
- engine->rootContext()->setContextProperty(
- "MediaApps", SmartDeviceLink::getInstance().getMediaApps());
-
- return (QObject*)&SmartDeviceLink::getInstance();
-}
-
-QObject* mediaAppsSingleton(QQmlEngine* engine, QJSEngine* js) {
- Q_UNUSED(engine)
- Q_UNUSED(js)
-
- return (QObject*)SmartDeviceLink::getInstance().getMediaApps();
-}
-
-void FordSdlCorePlugin::registerTypes(const char* uri) {
- qmlRegisterSingletonType<SdlAppsListModel>(
- uri, 1, 0, "MediaApps", mediaAppsSingleton);
- qmlRegisterSingletonType<SmartDeviceLink>(uri, 1, 0, "AppLink", sdlSingleton);
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h b/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h
deleted file mode 100644
index 2c8bf39d28..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/fordsdlcore_plugin.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef FORDSDLCORE_PLUGIN_H
-#define FORDSDLCORE_PLUGIN_H
-
-#include <QQmlExtensionPlugin>
-
-class FordSdlCorePlugin : public QQmlExtensionPlugin {
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-
- public:
- void registerTypes(const char* uri);
-};
-
-#endif // FORDSDLCORE_PLUGIN_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/qmldir b/src/components/qt_hmi/References/Work/fordsdlcore/qmldir
deleted file mode 100644
index da1a7b7f96..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdlcore
-plugin FordSdlCore
-
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp
deleted file mode 100644
index ec4350df77..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "sdlalert.h"
-
-SdlAlert::SdlAlert(QObject* parent) : QQuickItem() {}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h b/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h
deleted file mode 100644
index 9c32718c56..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlalert.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef SDLALERT_H
-#define SDLALERT_H
-
-#include <QQuickItem>
-
-class SdlAlert : public QQuickItem {
- Q_OBJECT
- public:
- explicit SdlAlert(QObject* parent = 0);
-
-signals:
-
- public slots:
-};
-
-#endif // SDLALERT_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp
deleted file mode 100644
index 419908339e..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "sdlappslistmodel.h"
-
-SdlAppsListModel::SdlAppsListModel(QObject* parent)
- : QAbstractListModel(parent) {}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h b/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h
deleted file mode 100644
index b78aeeec01..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/sdlappslistmodel.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef SDLAPPSLISTMODEL_H
-#define SDLAPPSLISTMODEL_H
-
-#include <QAbstractListModel>
-#include <QStringList>
-
-class SdlAppsListModel : public QAbstractListModel {
- Q_OBJECT
- public:
- explicit SdlAppsListModel(QObject* parent = 0);
-
- int rowCount(const QModelIndex& parent) const {
- return m_data.size();
- }
-
- QVariant data(const QModelIndex& index, int role) const {
- return m_data.values().at(index.row());
- }
-
- virtual QHash<int, QByteArray> roleNames() const {
- QHash<int, QByteArray> roles;
- roles['t'] = "text";
- return roles;
- }
-
- void append(int id, QString string) {
- beginResetModel();
- m_data.clear();
- m_data[id] = string;
- endResetModel();
- }
-
- void clear() {
- beginResetModel();
- m_data.clear();
- endResetModel();
- }
-
-signals:
-
- public slots:
-
- private:
- QHash<int, QString> m_data;
-};
-
-#endif // SDLAPPSLISTMODEL_H
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp
deleted file mode 100644
index 5ee8c455e9..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.cpp
+++ /dev/null
@@ -1,386 +0,0 @@
-#include "smartdevicelink.h"
-#include <QDebug>
-#include "QtWebsocket/QWsSocket.h"
-#include <QJsonDocument>
-#include <QJsonObject>
-#include <unistd.h>
-
-SmartDeviceLink::SmartDeviceLink(QQuickItem* parent) : QObject(parent) {
- connect(&m_ws_basic, SIGNAL(connected()), this, SLOT(basic_connected()));
- connect(&m_ws_basic,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(basic_receive(QString)));
- connect(&m_ws_basic, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_buttons, SIGNAL(connected()), this, SLOT(buttons_connected()));
- connect(&m_ws_buttons,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(buttons_receive(QString)));
- connect(&m_ws_buttons, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_tts, SIGNAL(connected()), this, SLOT(tts_connected()));
- connect(&m_ws_tts,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(tts_receive(QString)));
- connect(&m_ws_tts, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_vehicle, SIGNAL(connected()), this, SLOT(vehicle_connected()));
- connect(&m_ws_vehicle,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(vehicle_receive(QString)));
- connect(&m_ws_vehicle, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_ui, SIGNAL(connected()), this, SLOT(ui_connected()));
- connect(&m_ws_ui,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(ui_receive(QString)));
- connect(&m_ws_ui, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(&m_ws_vr, SIGNAL(connected()), this, SLOT(vr_connected()));
- connect(&m_ws_vr,
- SIGNAL(frameReceived(QString)),
- this,
- SLOT(vr_receive(QString)));
- connect(&m_ws_vr, SIGNAL(disconnected()), this, SLOT(disconnected()));
-
- connect(this,
- SIGNAL(newAppAvailable(int, QString)),
- this,
- SLOT(registerApp(int, QString)));
-
- m_ws_buttons.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_tts.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_vr.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_basic.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_vehicle.connectToHost(QLatin1String("127.0.0.1"), 8087);
- m_ws_ui.connectToHost(QLatin1String("127.0.0.1"), 8087);
-}
-
-SmartDeviceLink::~SmartDeviceLink() {
- qDebug() << "SmartDeviceLink destroyed";
-}
-
-void SmartDeviceLink::basic_connected() {
- basic_send(
- "{\"jsonrpc\":\"2.0\",\"id\":600,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"BasicCommunicationClient\"}}");
-}
-
-void SmartDeviceLink::buttons_connected() {
- buttons_send(
- "{\"jsonrpc\":\"2.0\",\"id\":200,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"Buttons\"}}");
-}
-
-void SmartDeviceLink::tts_connected() {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":300,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"TTS\"}}");
-}
-
-void SmartDeviceLink::vehicle_connected() {
- vehicle_send(
- "{\"jsonrpc\":\"2.0\",\"id\":700,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"VehicleInfo\"}}");
-}
-
-void SmartDeviceLink::ui_connected() {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":400,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"UI\"}}");
-}
-
-void SmartDeviceLink::vr_connected() {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":500,\"method\":\"MB.registerComponent\","
- "\"params\":{\"componentName\":\"VR\"}}");
-}
-
-void SmartDeviceLink::basic_send(QString message) {
- qDebug() << "Sending (basic):" << message;
- m_ws_basic.write(message.append('\n'));
-}
-
-void SmartDeviceLink::buttons_send(QString message) {
- qDebug() << "Sending (buttons):" << message;
- m_ws_buttons.write(message.append('\n'));
-}
-
-void SmartDeviceLink::tts_send(QString message) {
- qDebug() << "Sending (tts):" << message;
- m_ws_tts.write(message.append('\n'));
-}
-
-void SmartDeviceLink::vehicle_send(QString message) {
- qDebug() << "Sending (vehicle):" << message;
- m_ws_vehicle.write(message.append('\n'));
-}
-
-void SmartDeviceLink::ui_send(QString message) {
- qDebug() << "Sending (ui):" << message;
- m_ws_ui.write(message.append('\n'));
-}
-
-void SmartDeviceLink::vr_send(QString message) {
- qDebug() << "Sending (vr):" << message;
- m_ws_vr.write(message.append('\n'));
-}
-
-void SmartDeviceLink::basic_receive(QString message) {
- qDebug() << "Receiving(basic):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- int result = root.value("result").toDouble();
- QString method = root.value("method").toString();
-
- if (id == 600) {
- char* reg, *unreg, *update;
-
- asprintf(&reg,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"BasicCommunication."
- "OnAppRegistered\"}}",
- result + 1);
- basic_send(reg);
- free(reg);
-
- asprintf(&unreg,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"BasicCommunication."
- "OnAppUnregistered\"}}",
- result + 2);
- basic_send(unreg);
- free(unreg);
-
- asprintf(&update,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"BasicCommunication."
- "OnDeviceListUpdated\"}} ",
- result + 3);
- basic_send(update);
- free(update);
- } else if (method.compare("BasicCommunication.OnAppRegistered") == 0) {
- QJsonObject params = root.value("params").toObject();
- QJsonObject application = params.value("application").toObject();
- QString appName = application.value("appName").toString();
- int appId = application.value("appId").toDouble();
-
- char* update;
- asprintf(&update,
- "{\"jsonrpc\":\"2.0\",\"id\":3000,\"method\":\"BasicCommunication."
- "ActivateApp\",\"params\":{\"appName\":\"%s\",\"appId\":%i}}",
- appName.toLocal8Bit().data(),
- appId);
- basic_send(update);
- free(update);
- emit newAppAvailable(appId, appName);
- } else if (method.compare("BasicCommunication.OnAppUnregistered") == 0) {
- m_media_apps.clear();
- }
-}
-
-void SmartDeviceLink::buttons_receive(QString message) {
- qDebug() << "Receiving(buttons):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("Buttons.GetCapabilities") == 0) {
- buttons_send(
- "{\"jsonrpc\":\"2.0\",\"id\":19,\"result\":{\"capabilities\":[{"
- "\"name\":\"PRESET_0\",\"shortPressAvailable\":true,"
- "\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":"
- "\"PRESET_1\",\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_2\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_3\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_4\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_5\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_6\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_7\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_8\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"PRESET_9\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"OK\",\"shortPressAvailable\":"
- "true,\"longPressAvailable\":true,\"upDownAvailable\":true},{\"name\":"
- "\"SEEKLEFT\",\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"SEEKRIGHT\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"TUNEUP\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true},{\"name\":\"TUNEDOWN\","
- "\"shortPressAvailable\":true,\"longPressAvailable\":true,"
- "\"upDownAvailable\":true}],\"presetBankCapabilities\":{"
- "\"onScreenPresetsAvailable\":true},\"method\":\"Buttons."
- "GetCapabilitiesResponse\",\"resultCode\":\"SUCCESS\"}}");
- }
-}
-
-void SmartDeviceLink::tts_receive(QString message) {
- qDebug() << "Receiving(tts):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("TTS.GetCapabilities") == 0) {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":18,\"result\":{\"capabilities\":[\"TEXT\"]"
- ",\"resultCode\":\"SUCCESS\",\"method\":\"TTS."
- "GetCapabilitiesResponse\"}}");
- } else if (method.compare("TTS.GetLanguage") == 0) {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":26,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"TTS.GetLanguageResponse\",\"language\":\"EN-US\"}}");
- } else if (method.compare("TTS.GetSupportedLanguages") == 0) {
- tts_send(
- "{\"jsonrpc\":\"2.0\",\"id\":22,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"TTS.GetSupportedLanguagesResponse\",\"languages\":[\"EN-"
- "US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-"
- "TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-"
- "AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
- }
-}
-
-void SmartDeviceLink::vehicle_receive(QString message) {
- qDebug() << "Receiving(vehicle):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("VehicleInfo.GetVehicleType") == 0) {
- vehicle_send(
- "{\"jsonrpc\":\"2.0\",\"id\":20,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"VehicleInfo.GetVehicleTypeResponse\",\"vehicleType\":{"
- "\"make\":\"Ford\",\"model\":\"Fiesta\",\"modelYear\":\"2013\","
- "\"trim\":\"SE\"}}}");
- }
-}
-
-void SmartDeviceLink::ui_receive(QString message) {
- qDebug() << "Receiving(ui):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- int result = root.value("result").toDouble();
- QString method = root.value("method").toString();
-
- if (id == 400) {
- char* onchoise;
- asprintf(&onchoise,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"method\":\"MB.subscribeTo\","
- "\"params\":{\"propertyName\":\"VR.OnChoise\"}}",
- result + 1);
- ui_send(onchoise);
- free(onchoise);
-
- ui_send("{\"jsonrpc\":\"2.0\",\"method\":\"UI.OnReady\"}");
- } else if (method.compare("UI.GetCapabilities") == 0) {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":16,\"result\":{\"displayCapabilities\":{"
- "\"displayType\":\"GEN2_8_DMA\",\"textFields\":[{\"name\":"
- "\"mainField1\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{"
- "\"name\":\"mainField2\",\"characterSet\":\"TYPE2SET\",\"width\":1,"
- "\"rows\":1},{\"name\":\"statusBar\",\"characterSet\":\"TYPE2SET\","
- "\"width\":1,\"rows\":1},{\"name\":\"mediaClock\",\"characterSet\":"
- "\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":\"mediaTrack\","
- "\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{\"name\":"
- "\"alertText1\",\"characterSet\":\"TYPE2SET\",\"width\":1,\"rows\":1},{"
- "\"name\":\"alertText2\",\"characterSet\":\"TYPE2SET\",\"width\":1,"
- "\"rows\":1}],\"mediaClockFormats\":[\"CLOCK1\",\"CLOCK2\","
- "\"CLOCKTEXT1\",\"CLOCKTEXT2\",\"CLOCKTEXT3\"]},"
- "\"hmiZoneCapabilities\":[\"FRONT\",\"BACK\"],"
- "\"softButtonCapabilities\":[{\"shortPressAvailable\":true,"
- "\"longPressAvailable\":true,\"upDownAvailable\":true,"
- "\"imageSupported\":true}],\"method\":\"UI.GetCapabilitiesResponse\","
- "\"resultCode\":\"SUCCESS\"}}");
- } else if (method.compare("UI.GetSupportedLanguages") == 0) {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":21,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"UI.GetSupportedLanguagesResponse\",\"languages\":[\"EN-"
- "US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-"
- "TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-"
- "AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
- } else if (method.compare("UI.GetLanguage") == 0) {
- ui_send(
- "{\"jsonrpc\":\"2.0\",\"id\":24,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"UI.GetLanguageResponse\",\"hmiDisplayLanguage\":\"EN-"
- "US\"}}");
- } else if (method.compare("UI.Show") == 0) {
- QJsonObject params = root.value("params").toObject();
- setShow1(params.value("mainField1").toString());
- setShow2(params.value("mainField2").toString());
- char* response;
- asprintf(&response,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"result\":{\"resultCode\":"
- "\"SUCCESS\",\"method\":\"UI.ShowResponse\"}}",
- id);
- ui_send(response);
- free(response);
- } else if (method.compare("UI.Alert") == 0) {
- QJsonObject params = root.value("params").toObject();
- QString message(params.value("AlertText1").toString());
- message.append("\n").append(params.value("AlertText2").toString());
- char* response;
- asprintf(&response,
- "{\"jsonrpc\":\"2.0\",\"id\":%i,\"result\":{\"resultCode\":"
- "\"SUCCESS\",\"method\":\"UI.AlertResponse\"}}",
- id);
- ui_send(response);
- free(response);
- emit alert(message);
- }
-}
-
-void SmartDeviceLink::vr_receive(QString message) {
- qDebug() << "Receiving(vr):" << message;
- QJsonObject root = QJsonDocument::fromJson(message.toLocal8Bit()).object();
- int id = root.value("id").toDouble();
- QString method = root.value("method").toString();
-
- if (method.compare("VR.GetCapabilities") == 0) {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":17,\"result\":{\"capabilities\":[\"TEXT\"]"
- ",\"method\":\"VR.GetCapabilitiesResponse\",\"resultCode\":\"SUCCESS\"}"
- "}");
- } else if (method.compare("VR.GetSupportedLanguages") == 0) {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":23,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"VR.GetSupportedLanguagesResponse\",\"languages\":[\"EN-"
- "US\",\"ES-MX\",\"FR-CA\",\"DE-EU\",\"ES-EU\",\"EN-EU\",\"RU-RU\",\"TR-"
- "TR\",\"PL-EU\",\"FR-EU\",\"IT-EU\",\"SV-EU\",\"PT-EU\",\"NL-EU\",\"EN-"
- "AU\",\"ZH-CN\",\"ZH-TW\",\"JA-JP\",\"AR\",\"KO-KR\"]}}");
- } else if (method.compare("VR.GetLanguage") == 0) {
- vr_send(
- "{\"jsonrpc\":\"2.0\",\"id\":25,\"result\":{\"resultCode\":\"SUCCESS\","
- "\"method\":\"VR.GetLanguageResponse\",\"language\":\"EN-US\"}}");
- }
-}
-
-void SmartDeviceLink::registerApp(int appId, QString appName) {
- qDebug() << "New app registered:" << appName;
- m_media_apps.append(appId, appName);
-}
-
-void SmartDeviceLink::setShow1(QString show) {
- m_show1 = show;
- emit show1Changed(show);
-}
-
-void SmartDeviceLink::setShow2(QString show) {
- m_show2 = show;
- emit show2Changed(show);
-}
-
-void SmartDeviceLink::disconnected() {
- qDebug() << "Websocket disconnected";
-}
diff --git a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h b/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h
deleted file mode 100644
index 18ad605f40..0000000000
--- a/src/components/qt_hmi/References/Work/fordsdlcore/smartdevicelink.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef SMARTDEVICELINK_H
-#define SMARTDEVICELINK_H
-
-#include <QQuickItem>
-#include <QStringListModel>
-#include "QtWebsocket/QWsSocket.h"
-#include "sdlappslistmodel.h"
-
-class SmartDeviceLink : public QObject {
- Q_OBJECT
- Q_PROPERTY(QString show1 READ getShow1 NOTIFY show1Changed)
- Q_PROPERTY(QString show2 READ getShow2 NOTIFY show2Changed)
-
- public:
- SmartDeviceLink(QQuickItem* parent = 0);
- ~SmartDeviceLink();
-
- static SmartDeviceLink& getInstance() {
- static SmartDeviceLink instance;
- return instance;
- }
-
- SdlAppsListModel* getMediaApps() {
- return &m_media_apps;
- }
- QString getShow1() {
- return m_show1;
- }
- QString getShow2() {
- return m_show2;
- }
-
- private:
- QWsSocket m_ws_basic;
- QWsSocket m_ws_tts;
- QWsSocket m_ws_buttons;
- QWsSocket m_ws_vehicle;
- QWsSocket m_ws_ui;
- QWsSocket m_ws_vr;
-
- SdlAppsListModel m_media_apps;
-
- QString m_show1;
- QString m_show2;
-
- void basic_send(QString message);
- void tts_send(QString message);
- void buttons_send(QString message);
- void vehicle_send(QString message);
- void ui_send(QString message);
- void vr_send(QString message);
- void setShow1(QString);
- void setShow2(QString);
-
- public slots:
- void basic_connected();
- void tts_connected();
- void buttons_connected();
- void vehicle_connected();
- void ui_connected();
- void vr_connected();
-
- void basic_receive(QString);
- void tts_receive(QString);
- void buttons_receive(QString);
- void vehicle_receive(QString);
- void ui_receive(QString);
- void vr_receive(QString);
- void registerApp(int, QString);
-
- void disconnected();
-
-signals:
- void show1Changed(QString);
- void show2Changed(QString);
- void newAppAvailable(int, QString);
- void alert(QString message);
-};
-
-#endif // SMARTDEVICELINK_H
diff --git a/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt b/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt
deleted file mode 100644
index e6eeb9e525..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../..)
-set(dbus_dir ${components_dir}/dbus)
-set(codegen_dir ${dbus_dir}/codegen)
-set(codegen ${codegen_dir}/make_qml_dbus_qml.py)
-set(parser ${codegen_dir}/ford_xml_parser.py)
-set(interfaces_dir ${components_dir}/interfaces)
-set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
-set(proxy_dir ${CMAKE_CURRENT_BINARY_DIR}/hmi_api)
-set(qml_dirs hmi_api controls models popups views)
-set(qml_files MainWindow.qml)
-
-add_custom_target(qml_auto ALL
- COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${proxy_dir}
- DEPENDS ${api_xml} ${codegen} ${parser}
- COMMENT "Generating files:
- ${proxy_dir}/BasicCommunicationProxy.qml
- ${proxy_dir}/ButtonsProxy.qml
- ${proxy_dir}/NavigationProxy.qml
- ${proxy_dir}/TTSProxy.qml
- ${proxy_dir}/UIProxy.qml
- ${proxy_dir}/VehicleInfoProxy.qml
- ${proxy_dir}/VRProxy.qml
- from:
- ${api_xml} ..."
-)
-
-add_custom_target(qml_copy_resources ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${CMAKE_CURRENT_BINARY_DIR}/res
- COMMENT "Copying resources")
-
-if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
- foreach(qml_dir ${qml_dirs})
- add_custom_target(qml_copy_${qml_dir} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${qml_dir}
- COMMENT "Copying directory ${qml_dir}")
- endforeach(qml_dir)
-
- add_dependencies(qml_auto qml_copy_hmi_api)
-
- foreach(qml_file ${qml_files})
- add_custom_target(qml_copy_${qml_file} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${qml_file} ${CMAKE_CURRENT_BINARY_DIR}/${qml_file}
- COMMENT "Copying file ${qml_file}")
- endforeach(qml_file)
-endif()
-
-install(DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/controls
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_api
- ${CMAKE_CURRENT_BINARY_DIR}/models
- ${CMAKE_CURRENT_BINARY_DIR}/popups
- ${CMAKE_CURRENT_BINARY_DIR}/res
- ${CMAKE_CURRENT_BINARY_DIR}/views
- DESTINATION bin/hmi)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainWindow.qml DESTINATION bin/hmi)
diff --git a/src/components/qt_hmi/qml_model_qt4/MainWindow.qml b/src/components/qt_hmi/qml_model_qt4/MainWindow.qml
deleted file mode 100644
index 1a3b06fd41..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/MainWindow.qml
+++ /dev/null
@@ -1,356 +0,0 @@
-/**
- * @file MainWindow.qml
- * @brief Implementation of main window.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import "./controls"
-import "./views"
-import "./hmi_api" as HmiApi
-import "./models"
-import "./popups"
-import "hmi_api/Common.js" as Common
-import "./models/Constants.js" as Constants
-import "models/Internal.js" as Internal
-
-Rectangle {
- width: 1280
- height: 768
- property string startQml: "./views/ApplicationListView.qml"
- property int minWidth: Constants.mainScreenMinWidth
- property int minHeight: Constants.mainScreenMiHeight
- color: Constants.secondaryColor
-
- DataStorage {
- id: dataContainer
-
- onSystemContextChanged: {
- sdlUI.onSystemContext(systemContext)
- }
-
- // Please note that applicationContext is changed only after setting currentApplication
- onApplicationContextChanged: {
- if (applicationContext) {
- sdlBasicCommunication.onAppActivated(currentApplication.appId)
- } else {
- sdlBasicCommunication.onAppDeactivated(currentApplication.appId, contentLoader.item.category)
- }
- }
- }
-
-// TODO(KKolodiy): find way for play sound
-// Audio {
-// id: beep
-// source: "res/initial.wav"
-// }
-
- SettingsStorage {
- id: settingsContainer
- }
-
- Item {
- id: mainScreen
- anchors.top: parent. top
- anchors.left: parent.left
- width: (parent.width - simulationScreen.width < minWidth) ?
- minWidth : parent.width - simulationScreen.width
- height: (parent.height - hardwareScreen.height < minHeight) ?
- minHeight : parent.height - hardwareScreen.height
- clip: true
- visible: false
-
- Item {
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height * 0.10
- width: parent.width
- HeaderMenu {}
- }
-
- Item {
- height: parent.height * 0.90
- width: parent.width
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
-
- Loader {
- id: contentLoader
- height: parent.height - Constants.margin
- width: parent.width - 2 * Constants.margin
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.leftMargin: Constants.margin
- anchors.rightMargin: Constants.margin
- anchors.bottomMargin: Constants.margin
-
-
- source:startQml
- property variant viewTransitionStack : []
-
- function reset() {
- viewTransitionStack = []
- }
-
- property string currentLocation
- function go(path, appId) {
- console.debug("enter:", path, ", appId:", appId)
- if (path) {
- if (currentLocation !== path) {
- viewTransitionStack.push({ uri: source.toString(), applicationContext: false })
- if (appId) {
- dataContainer.setCurrentApplication(appId)
- }
- currentLocation = path
- source = path
- }
- }
- console.debug("exit")
- }
-
- function back() {
- if (viewTransitionStack.length) {
- source = viewTransitionStack.pop().uri
- }
- currentLocation = ""
- }
-
- onStatusChanged: {
- if (status == Component.Ready) {
- if (!dataContainer.activeAlert) {
- dataContainer.applicationContext = item.applicationContext
- }
- else {
- dataContainer.applicationSavedContext = item.applicationContext
- }
- if (viewTransitionStack && viewTransitionStack.length) {
- viewTransitionStack[viewTransitionStack.length - 1].applicationContext = item.applicationContext
- }
- dataContainer.setSystemContext()
- }
- }
- }
- }
-
- WarningInfo { id: warningInfo }
-
- InteractionPopup {
- id: interactionPopup
- popUpName: "UI.PerformInteraction"
- anchors.centerIn: parent
- visible: false
- }
-
- SliderPopup {
- id: sliderPopup
- popUpName: "UI.Slider"
- anchors.centerIn: parent
- visible: false
- }
-
- PerformAudioPassThruPopup {
- id: performAudioPassThruPopup
- popUpName: "UI.PerformAudioPassThru"
- anchors.centerIn: parent
- visible: false
- }
-
- VRHelpPopup {
- id: vrHelpPopup
- popUpName: "UI.VrHelp"
- anchors.centerIn: parent
- visible: false
- }
-
- AlertWindow {
- id: alertWindow
- popUpName: "UI.Alert"
- objectName: "AlertWindow"
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: simulationScreen
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: mainScreen.right
- width: simulationPanel.width
- clip: true
- SimulationView {
- id: simulationPanel
-
- VRPopUp {
- id: vrPopUp
- visible: false
- anchors.fill: parent
- }
-
- TTSPopUp {
- id: ttsPopUp
- anchors.top: parent.top
- anchors.right: parent.right
- visible: false
- }
- }
- }
-
- Item {
- id: hardwareScreen
- anchors.top: mainScreen.bottom
- anchors.left: parent.left
- anchors.right: simulationScreen.left
- height: hardwarePanel.height
- clip: true
- HardwareButtonsView { id: hardwarePanel }
- }
-
- HMIProxy {
- HmiApi.ButtonsProxy {
- id: sdlButtons
- objectName: "Buttons"
- }
- HmiApi.BasicCommunicationProxy {
- id: sdlBasicCommunication
- objectName: "BasicCommunication"
- }
- HmiApi.VRProxy {
- id: sdlVR
- objectName: "VR"
- }
- HmiApi.TTSProxy {
- id: sdlTTS
- objectName: "TTS"
- }
- HmiApi.NavigationProxy {
- id: sdlNavigation
- objectName: "Navigation"
- }
- HmiApi.VehicleInfoProxy {
- id: sdlVehicleInfo
- objectName: "VehicleInfo"
- }
- HmiApi.UIProxy {
- id: sdlUI
- objectName: "UI"
- }
- }
-
- SDLProxy {
- id: sdlProxy
-
- onAppRegistered: {
- dataContainer.addApplication(
- {
- appName: application.appName,
- ngnMediaScreenAppName: application.ngnMediaScreenAppName,
- icon: application.icon,
- deviceName: application.deviceName,
- appId: application.appId,
- hmiDisplayLanguageDesired: application.hmiDisplayLanguageDesired,
- isMediaApplication: application.isMediaApplication,
- appType: application.appType,
- hmiUIText: { },
- mediaClock: {
- "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
- "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
- "startTime": -1,
- "endTime": -1,
- "startTimeForProgress": -1
- }
- });
- }
-
- onAppUnregistered: {
- console.debug("enter")
- dataContainer.removeApplication(appId);
- if ((dataContainer.currentApplication.appId === appId)) {
- if (dataContainer.applicationContext) {
- contentLoader.go("views/ApplicationListView.qml");
- }
- if (contentLoader.viewTransitionStack.filter(function(x) { return x.applicationContext })) {
- contentLoader.reset();
- }
- dataContainer.currentApplication.reset()
- }
- console.debug("exit")
- }
-
- onPlayTone: {
- beep.play()
- }
-
- }
-
- Component.onCompleted: {
- dataContainer.hmiVRAvailable = true
- dataContainer.hmiTTSAvailable = true
- dataContainer.hmiNavigationAvailable = true
- dataContainer.hmiVehicleInfoAvailable = true
- dataContainer.hmiUIAvailable = true
-
- sdlBasicCommunication.onReady()
- }
-
- /*
- * Test Support Section
- *
- */
- function getSlider(){
- return sliderPopup
- }
-
- function getDataStorage(){
- return dataContainer
- }
-
- function getUIProxy(){
- return sdlUI
- }
-
- function getMainScreen(){
- return mainScreen
- }
-
- function getContentLoader(){
- return contentLoader
- }
-
- function getWarningInfo(){
- return warningInfo
- }
- /*
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml b/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml
deleted file mode 100644
index 4f33960127..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ArrowKeys.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @file ArrowKeys.qml
- * @brief Keys with arrow for cursor movement.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item {
- width: buttonOk.width
- height: buttonOk.height
-
- HardwareButton {
- id: arrowUp
- buttonId: Common.ButtonName.TUNEUP
- name: "Up"
- }
- HardwareButton {
- id: arrowDown
- buttonId: Common.ButtonName.TUNEDOWN
- name: "Down"
- }
- HardwareButton {
- id: arrowLeft
- buttonId: Common.ButtonName.SEEKLEFT
- name: "Left"
- }
- HardwareButton {
- id: arrowRight
- buttonId: Common.ButtonName.SEEKRIGHT
- name: "Right"
- }
- HardwareButton {
- id: buttonOk
- buttonId: Common.ButtonName.OK
- name: "Ok"
- longPressAvailable: false
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml
deleted file mode 100644
index 906b3098ba..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/BackButton.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file BackButton.qml
- * @brief Button "Back" that return to previous menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-OvalButton {
- text: "Back"
- onClicked: { contentLoader.back() }
- fontSize: Constants.fontSize
- opacity: 0
-
- NumberAnimation on opacity {
- to: 1;
- duration: Constants.animationDuration
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml b/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml
deleted file mode 100644
index 39d693b971..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/CheckBox.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file CheckBox.qml
- * @brief Check box
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- property alias text: text.text
- property alias color: text.color
- property bool checked: false
-
- signal clicked
-
- onCheckedChanged: {
- selector.color = checked ? Constants.primaryColorPressed : Constants.transparentColor
- }
-
- height: checkbox.height + Constants.generalSpacing / 2
- width: checkbox.width + text.width + 1.5 * Constants.generalSpacing
-
- MouseArea {
- anchors.fill: parent
- onClicked: { checked = !checked; parent.clicked() }
- }
- Rectangle {
- id: checkbox
- width: text.font.pixelSize + Constants.generalSpacing / 2
- height: width
- anchors.left: parent.left
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- color: Constants.panelTextColor
- radius: Constants.controlsRadius
- Rectangle {
- id: selector
- anchors.fill: parent
- anchors.margins: checkbox.width / 8
- color: Constants.transparentColor
- }
- }
- Text {
- id: text
- anchors.left: checkbox.right
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenter: checkbox.verticalCenter
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml
deleted file mode 100644
index 818f07ffc5..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/CircleButton.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * @file CircleButton.qml
- * @brief Parent class for circle button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Image {
- id: circleBtn
- source: imgOff
- property alias text: btnText.text
- property alias pixelSize: btnText.font.pixelSize
- property string dest: ""
- property bool isPressed: false
- property string imgOff: "../res/buttons/round_btn.png"
- property string imgOn: "../res/buttons/round_pressed_btn.png"
- property string textColorOnPressed: Constants.secondaryColor
- property string textColorDefault: Constants.primaryColor
-
- signal clicked()
- function wasClicked()
- {
- clicked()
- }
-
- Text {
- anchors.centerIn: parent
- id: btnText
- color: textColorDefault
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- console.log("CircleButton onPressed enter");
- source = imgOn
- btnText.color = textColorOnPressed
- isPressed = true
- console.log("CircleButton onPressed exit");
- }
- onReleased: {
- console.log("CircleButton onReleased enter");
- source = imgOff
- btnText.color = textColorDefault
- isPressed = false
- console.log("CircleButton onReleased exit");
- }
- onClicked: {
- console.log("CircleButton onClicked enter");
- if(dest !== ""){
- contentLoader.go(dest)
- }
- circleBtn.wasClicked()
- console.log("CircleButton onClicked enter");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml
deleted file mode 100644
index f35f7c3020..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ClickableImage.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file ClickableImage.qml
- * @brief Clickable image item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Image {
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked()
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- parent.scale = Constants.pressedIconScale
- parent.pressed()
- }
-
- onReleased: {
- parent.scale = 1
- parent.released()
- }
-
- onCanceled: {
- parent.scale = 1
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml
deleted file mode 100644
index e6b9fbf246..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ClickableText.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file ClickableText.qml
- * @brief Clickable text item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-Text {
- property string defaultColor
- property string pressedColor
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked ()
-
- color: defaultColor
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- press()
- parent.pressed()
- }
-
- onReleased: {
- release()
- parent.released()
- }
-
- onCanceled: {
- release()
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-
- function press () {
- color = pressedColor
- }
-
- function release () {
- color = defaultColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml b/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml
deleted file mode 100644
index abd344272c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ClimateControlBtn.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * @file ClimateControlBtn.qml
- * @brief Round button, which is used at climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item
-{
- id: climateControlBtn
- width: climateBtnImg.width
- height: climateBtnImg.height
- property string name: ""
- property string txt: ""
- state: "off"
-
- Image {
- id: climateBtnImg
- source: climateControlBtn.state === "off" ? "../res/climate/climate_round_off_btn.png" : "../res/climate/climate_round_on_btn.png"
-
- Image {
- id: hoverImg
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- property string st: climateControlBtn.state === "off" ? "_off" : "_on"
- source: climateControlBtn.name === "" ? "": "../res/climate/" + climateControlBtn.name + st + ".png"
- }
-
- Text {
- id: hoverText
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: climateControlBtn.txt
- font.pixelSize: Constants.fontSize
- color: climateControlBtn.state === "off" ? Constants.primaryColor : Constants.secondaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if(climateControlBtn.state === "on") {
- climateControlBtn.state = "off"
- climateBtnImg.source = "../res/climate/climate_round_off_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.primaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_off.png"
- }
- } else {
- climateControlBtn.state = "on"
- climateBtnImg.source = "../res/climate/climate_round_on_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.secondaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_on.png"
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml b/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml
deleted file mode 100644
index d5129a2a10..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ComboBox.qml
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * @file ComboBox.qml
- * @brief Combo box
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: container
- width: Constants.defaultComboboxWidth
- height: main.height
-
- property alias model: listView.model
- property alias currentIndex: listView.currentIndex
- property alias currentText: textMain.text
- property string textRole
-
- function choose(name) {
- var count = listView.count
- for (var i = 0; i < count; ++i) {
- if (name === listView.model.get(i).name) {
- listView.currentIndex = i
- break
- }
- }
-
- textMain.text = name
- }
-
- Rectangle {
- id: main
-
- anchors.left: parent.left
- anchors.right: parent.right
- height: label.font.pixelSize + Constants.generalSpacing
- color: Constants.panelTextColor
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- radius: Constants.controlsRadius
-
- Text {
- id: textMain
- anchors.left: parent.left
- anchors.right: arrow.left
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- color: Constants.secondaryColor
- verticalAlignment: Text.AlignVCenter
- anchors.leftMargin: Constants.generalSpacing
- anchors.rightMargin: Constants.generalSpacing
- elide: Text.ElideRight
- }
-
- Rectangle {
- id: arrow
- anchors.right: parent.right
- height: parent.height; width: height
-
- color: Constants.panelTextColor
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- radius: Constants.controlsRadius
-
- Text {
- anchors.fill: parent
- text: "v"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- color: Constants.secondaryColor
- }
- }
-
- MouseArea {
- anchors.fill: parent
- hoverEnabled: true
- onClicked: listView.visible = !listView.visible
- }
- }
-
- ScrollableListView {
- id: listView
- anchors.top: main.bottom
- anchors.left: main.left
- anchors.right: main.right
- height: 150
- visible: false
- delegate: Rectangle {
- anchors.left: parent.left
- anchors.right: parent.right
- height: label.font.pixelSize + Constants.generalSpacing
- color: Constants.panelTextColor
- border.color: Constants.controlsBorderColor
- border.width: Constants.controlsBorderWidth
- Text {
- id: label
- anchors.fill: parent
- anchors.leftMargin: Constants.generalSpacing
- anchors.rightMargin: Constants.generalSpacing
- verticalAlignment: Text.AlignVCenter
- text: model.name
- color: Constants.secondaryColor
- elide: Text.ElideRight
- }
- MouseArea {
- anchors.fill: parent
- hoverEnabled: true
- onClicked: { choose(model.name); listView.visible = false }
- onEntered: { parent.color = Constants.primaryColorPressed }
- onExited: { parent.color = Constants.panelTextColor }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml b/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml
deleted file mode 100644
index 7b21bb4567..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/GradientRectangle.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * @file GradientRectangle.qml
- * @brief Rectangle with gradient.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-Rectangle {
- property string firstColor: "grey"
- property string secondColor: "#2E2E2E"
- property alias fontSize: text.font.pixelSize
- property alias text: text.text
- property int customButtonID
- property bool isCustomButton: false
- property bool clickProcessed
- signal pressed()
- signal released()
-
- radius: 5
- border.color: "#D3D3D3"
-
- Text {
- id: text
- anchors.fill: parent
- font.pixelSize: Constants.titleFontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- elide: Text.ElideRight
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- firstColor = "#2E2E2E"
- secondColor = "grey"
- parent.pressed()
- }
- onReleased: {
- firstColor = "grey"
- secondColor = "#2E2E2E"
- parent.released()
- }
- }
-
- Timer {
- id: timer
- interval: Constants.customButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- onPressed: {
- if (isCustomButton) {
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, customButtonID)
- }
- }
-
- onReleased: {
- if (isCustomButton) {
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, customButtonID)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, customButtonID)
- }
- }
- }
-
- Connections {
- target: timer
- onTriggered: {
- if (isCustomButton) {
- if(!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, customButtonID)
- clickProcessed = true
- }
- }
- }
- }
-
- gradient: Gradient {
- GradientStop {
- position: 0.1
- color: firstColor
- }
- GradientStop {
- position: 0.5
- color: secondColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml b/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml
deleted file mode 100644
index 84528ab800..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/GridItem.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file GridItem.qml
- * @brief Item with animation for GridMenu
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: item
- opacity: 0
- SequentialAnimation {
- id: animation
- PauseAnimation {duration: index * 100 }
- NumberAnimation {
- target: item
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
- Component.onCompleted: {
- animation.start()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml
deleted file mode 100644
index ea8e406c6e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/HardwareButton.qml
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @file HardwareButton.qml
- * @brief Parent class for hardware button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import com.ford.sdl.hmi.hw_buttons 1.0
-import "../hmi_api/Common.js" as Common
-
-MaskedContainer {
- property string name
- property int buttonId: Common.ButtonName.CUSTOM_BUTTON
- property bool upDownAvailable: true
- property bool shortPressAvailable: true
- property bool longPressAvailable: true
-
- signal hold
-
- Image {
- source: "../res/controlButtons/" + name + "Button.png"
- }
- Image {
- id: pressedImg
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- visible: false
- Behavior on opacity {
- NumberAnimation { duration: 80 }
- }
- }
- Timer {
- id: timer
- interval: 2000
- repeat: false
- triggeredOnStart: false
- }
- property bool clickProcessed
- onPressed: {
- clickProcessed = false
- pressedImg.visible = true
- timer.start()
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- }
-
- onReleased: {
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONUP, undefined)
- }
- timer.stop()
- if (!clickProcessed && shortPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.SHORT, undefined)
- }
- pressedImg.visible = false
- }
-
- Connections {
- target: timer
- onTriggered: {
- if(!clickProcessed && longPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.LONG, undefined)
- clickProcessed = true
- hold()
- }
- }
- }
-
- Component.onCompleted: {
- if (buttonId !== Common.ButtonName.CUSTOM_BUTTON) {
- settingsContainer.buttonCapabilities.push(
- {
- name: buttonId,
- upDownAvailable: upDownAvailable,
- shortPressAvailable: shortPressAvailable,
- longPressAvailable: longPressAvailable
- });
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml b/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml
deleted file mode 100644
index 2b0b418c54..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/HeaderMenu.qml
+++ /dev/null
@@ -1,134 +0,0 @@
-/**
- * @file HeaderMenu.qml
- * @brief Header menu view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: headerMenu
- anchors.fill: parent
-
- Text {
- anchors.leftMargin: Constants.margin
- anchors.topMargin: Constants.margin
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: "75°"
- }
-
- Item {
- width: menuText.width
- height: parent.height
- anchors.topMargin: Constants.margin
- anchors.horizontalCenter: headerMenu.horizontalCenter
- signal clicked ()
-
- ClickableText {
- id: menuLogo
- anchors.horizontalCenter: menuText.horizontalCenter
- anchors.bottom: parent.verticalCenter
- text: "≡"
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuLogo.press()
- onReleased: menuLogo.release()
- onCanceled: menuLogo.release()
- }
-
- ClickableText {
- id: menuText
- anchors.top: parent.verticalCenter
- text: "MENU";
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuText.press()
- onReleased: menuText.release()
- onCanceled: menuText.release()
- }
-
- onClicked: {
- contentLoader.go("./views/MainMenuView.qml")
- }
- }
-
- Row {
- id: clock
- height: childrenRect.height
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.rightMargin: Constants.margin
- anchors.topMargin: Constants.margin
- property date date: new Date()
-
- Timer {
- running: true
- repeat: true
- interval: 1000
- onTriggered: {
- clock.date = new Date();
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "hh");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
-
- Item {
- width: 10
- height: parent.height
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: clock.date.getSeconds() % 2 ? ":" : ""
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "mm");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml b/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml
deleted file mode 100644
index d0bfdba78b..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/Icon.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Icon.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item {
- property variant source
-
- Image {
- anchors.fill: parent
- source: url(parent.source)
-
- function image(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.STATIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
-
- function url(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.DYNAMIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
- }
-
- function reset () {
- source = undefined
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml b/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml
deleted file mode 100644
index c87c24de4d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ListItem.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @file Entry.qml
- * @brief Entry with icon and text for list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: main
- color: Constants.transparentColor
-
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
-
- Icon {
- id: image
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- anchors.left: parent.left
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- anchors.verticalCenter: parent.verticalCenter
- height: image.height
- width: parent.width - image.width
- z: 50
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- text: "Name Entry"
- anchors.left: image.right
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenterOffset: 0
- visible: text !== ""
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml
deleted file mode 100644
index d8a95d1a00..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/MaskedButton.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * @file MaskedButton.qml
- * @brief Masked button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import com.ford.sdl.hmi.hw_buttons 1.0
-
-MaskedContainer {
- property string name
-
- Image {
- id: icon
- source: "../res/controlButtons/" + name + "Button.png"
- }
-
- onPressed: {
- state = "pressed";
- }
-
- onReleased: {
- state = "";
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: icon
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml b/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml
deleted file mode 100644
index e86dcedc8f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/MultiTouchArea.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file MultiTouchArea.qml
- * @brief Area for multitouch.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-MultiPointTouchArea {
- readonly property int created: Date.now()
-
- signal pressed(var touchPoints)
- signal released(var touchPoints)
- signal canceled(var touchPoints)
- signal updated(var touchPoints)
-
- function fillEvent(touchPoints) {
- var event = []
- for (var i = 0; i < touchPoints.length; ++i) {
- event.push({
- id: touchPoints[i].pointId,
- ts: [Date.now() - created],
- c: [{ x: touchPoints.x, y: touchPoints.y }] // TODO(KKolodiy): need cast to int
- })
- }
- return event
- }
-
- minimumTouchPoints: 1
- maximumTouchPoints: 10
-
- onPressed: {
- sdlUI.onTouchEvent(Common.BEGIN, fillEvent(touchPoints))
- parent.pressed(touchPoints)
- }
- onReleased: {
- sdlUI.onTouchEvent(Common.END, fillEvent(touchPoints))
- parent.released(touchPoints)
- }
- onCanceled: {
- sdlUI.onTouchEvent(Common.END, fillEvent(touchPoints))
- parent.canceled(touchPoints)
- }
- onUpdated: {
- sdlUI.onTouchEvent(Common.MOVE, fillEvent(touchPoints))
- parent.updated(touchPoints)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml
deleted file mode 100644
index 59458499a7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/OvalButton.qml
+++ /dev/null
@@ -1,240 +0,0 @@
-/**
- * @file OvalButton.qml
- * @brief Oval button with flexible width.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import com.ford.sdl.hmi.hw_buttons 1.0
-import "../models/Constants.js" as Constants
-
-// Don't change constants. It break button
-// TODO (dchmerev@luxoft.com): make this comment more clear
-// todo (ykazakov): eliminate this problem and remove all such comments
-
-Item {
- id: main
- width: dynamic ? field.width + 2 * left.width : Constants.ovalButtonWidth
- height: Constants.ovalButtonHeight
-
- signal clicked;
- signal pressed;
- signal released;
- signal pressAndHold;
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
- property bool highlighted: false
- property bool dynamic: false
- property bool disabled: false
- property color colorizeColor
- property real colorizeStrength
-
- onDisabledChanged: colorize()
- onHighlightedChanged: colorize()
- Component.onCompleted: colorize()
-
- function colorize() {
- if (disabled) {
- colorizeColor = "gray";
- colorizeStrength = 1;
- } else if (highlighted) {
- colorizeColor = "cyan";
- colorizeStrength = 1;
- } else {
- colorizeStrength = 0;
- }
- }
-
- Item {
- id: buttonBorderImage
- visible: true
- anchors.fill: parent
- Image {
- id: left
- width: 31
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.top: parent.top
- source: "../res/buttons/oval_btn_left.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- Image {
- id: right
- width: 31
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- source: "../res/buttons/oval_btn_right.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- Image {
- id: top
- height: 10
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.top: parent.top
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_top.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- Image {
- id: bottom
- height: 11
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.bottom: parent.bottom
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_bottom.png"
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
- }
-
- Rectangle {
- id: background
- color: Constants.transparentColor
- anchors.fill: parent
- anchors.rightMargin: 31
- anchors.leftMargin: 31
- anchors.bottomMargin: 10
- anchors.topMargin: 10
- visible: true
- effect: Colorize {
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
-
- MouseArea {
- id: mousearea
- anchors.rightMargin: 15
- anchors.leftMargin: 15
- anchors.bottomMargin: 11
- anchors.topMargin: 10
- anchors.fill: parent
- enabled: !parent.disabled
- onPressed: {
- parent.state = "pressed";
- parent.pressed();
- }
- onReleased: {
- parent.state = "";
- parent.released();
- }
- onClicked: {
- parent.clicked();
- }
- onPressAndHold: {
- parent.pressAndHold();
- }
- onCanceled: {
- parent.state = "";
- }
- }
-
- Item {
- id: field
- anchors.fill: background
-
- Icon {
- id: image
- width: Constants.iconButtonSize
- height: Constants.iconButtonSize
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- width: image.visible ? parent.width - image.width : parent.width
- color: Constants.primaryColor
- anchors.centerIn: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: Constants.ovalButtonFontSize
- visible: true
- elide: Text.ElideRight
- effect: Colorize {
- id: colorizeLabel
- color: main.colorizeColor
- strength: main.colorizeStrength
- }
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: left
- source: "../res/buttons/oval_btn_pressed_left.png"
- }
-
- PropertyChanges {
- target: right
- source: "../res/buttons/oval_btn_pressed_right.png"
- }
-
- PropertyChanges {
- target: background
- color: Constants.primaryColor
- }
-
- PropertyChanges {
- target: label
- color: Constants.secondaryColor
- }
-
- PropertyChanges {
- target: colorizeLabel
- strength: 0
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml b/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml
deleted file mode 100644
index 6d40ad6478..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PagedFlickable.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @file PagedFlickable.qml
- * @brief Animated row.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-Item
-{
- id: flickablePage
- height: container.height + pager.height
- default property alias content: containerRow.children
- property alias spacing: containerRow.spacing
- property int elementWidth
- property int snapTo
- property int count: 0
-
- Flickable {
- id: container
- anchors.bottom: parent.bottom
- maximumFlickVelocity: 1500
- contentWidth: containerRow.width
- height: containerRow.height
- width: parent.width
- interactive: contentWidth > width
-
- onMovementEnded: {
- var rest = contentX % snapTo
- var t = 0.25
- if (rest > parent.snapTo / 2) {
- rest = rest - parent.snapTo
- }
- var vel = 2 * rest / t
- flickDeceleration = Math.abs(vel) / t
- flick(vel, 0)
- flickDeceleration = 1500
- }
- Row {
- id: containerRow
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Pager {
- id: pager
- space: 7
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
-
- pages: {
- if ( (container.contentWidth % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentWidth / container.width)
- }
- else {
- return Math.floor(container.contentWidth / container.width)
- }
- }
-
- activePage: {
- if (container.contentX <= 0) {
- return 0
- }
- else if ( (container.contentWidth - container.contentX) < container.width) {
- return pages -1
- }
- else {
- if ( (container.contentX % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentX / container.width)
- }
- else if ( (container.contentX % container.width) > 0) {
- return Math.floor(container.contentX / container.width)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml b/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml
deleted file mode 100644
index 471d932113..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/Pager.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file Pager.qml
- * @brief Bubbles that indicate about page switch.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-Row {
- id: pager
- property int pages
- property int activePage: 0
- property int space
- property int itemsInRowOnScreen: 3
-
- spacing: space
- visible: pages !== 1
-
- Repeater {
- model: pages
- Image {
- source: index === activePage ? "../res/white_ball.png" : "../res/blue_ball.png"
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml
deleted file mode 100644
index 825884cc1e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PlayPauseButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file PlayPauseButton.qml
- * @brief Behavior of Play/Pause button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-Image {
- id: playPauseButton
- property string sourceOnPressed: ""
- property string sourceOnReleased: ""
-
- signal clicked
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- playPauseButton.source = playPauseButton.sourceOnPressed
- }
- onReleased: {
- playPauseButton.source = playPauseButton.sourceOnReleased
- }
- onClicked: {
- playPauseButton.clicked()
- }
- }
- states: [
- State {
- name: "Play"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_play_btn.png"
- sourceOnPressed: "../res/buttons/player_play_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_pause_btn.png"
- }
- },
-
- State {
- name: "Pause"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_pause_btn.png"
- sourceOnPressed: "../res/buttons/player_pause_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_play_btn.png"
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml
deleted file mode 100644
index 2027e1f592..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PowerSwitchButton.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file PowerSwitchBtn.qml
- * @brief On/Off button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: powerSwitchBtn
- state: "Turn ON"
- width: 120
- height: 80
- radius: 5
- property bool pressed;
-
- gradient: Gradient {
- GradientStop { position: pressed ? 1.0 : 0.0; color: "#2c2c2c" }
- GradientStop { position: pressed ? 0.0 : 1.0; color: "black" }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.pressed = true
- }
- onReleased: {
- parent.pressed = false
- parent.state = parent.state === "Turn ON" ? "Turn OFF" : "Turn ON"
- btnText.text = parent.state
- if (parent.state === "Turn OFF") {
- contentLoader.reset()
- mainScreen.visible = true
- warningInfo.showOkButton()
- }
- }
- }
-
- Text {
- id: btnText
- color: "red"
- text: parent.state
- anchors.centerIn: parent
- font.pixelSize: Constants.powerButtonFornSize
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml b/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml
deleted file mode 100644
index 1454ed812d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PresetRow.qml
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * @file PresetRow.qml
- * @brief Animated row with radio stations.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- id: presetRow
- height: childrenRect.height
- property variant presets: []
- property int selectedIndex: 0
- signal presetSelected
- signal presetButtonPressed()
- signal presetButtonReleased()
- signal presetButtonClicked()
- signal presetButtonHold()
-
- Image {
- id: circleButton
- source: "../res/buttons/preset_pressed_btn.png"
- visible: false
- enabled: false
- }
-
- PagedFlickable {
- width: parent.width
- spacing: (width - (circleButton.width * 4)) / 3
- snapTo: spacing + circleButton.width
- elementWidth: circleButton.width
-
- Repeater {
- model: presetRow.presets.length
- delegate:
- Column {
- width: circleButton.width
- Image {
- anchors.horizontalCenter: parent.horizontalCenter
- source: presetRow.selectedIndex === index ? "../res/buttons/preset_pressed_btn.png" : "../res/buttons/preset_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- presetRow.selectedIndex = index;
- presetButtonPressed()
- }
- onReleased: {
- presetRow.selectedIndex = index;
- presetButtonReleased()
- }
- onClicked: {
- presetRow.selectedIndex = index
- presetButtonClicked()
- }
- onPressAndHold: {
- presetRow.selectedIndex = index;
- presetButtonHold()
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: index + 1
- font.pixelSize: Constants.fontSize
- color: presetRow.selectedIndex === index ? Constants.secondaryColor : Constants.primaryColor
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: presetRow.presets[index]
- font.pixelSize: Constants.fontSize
- color: "white"
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml
deleted file mode 100644
index 36ee9bbb3f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/PushButton.qml
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * @file PushButton.qml
- * @brief Simple button
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-Rectangle {
- id: toggleButton
- width: 160
- height: 40
- radius: 2
- border.width: 2
- border.color: "#000000"
- gradient: grUnpressed
-
- property alias label : label.text
-
- signal pressed()
- signal unpressed()
- signal clicked()
-
- property bool toggleMode: false
-
- state: "unpressed"
- onStateChanged: {
- if (state == "pressed") {
- pressed();
- } else {
- unpressed();
- }
- }
-
- Text {
- id: label
- color: "white"
- text: "PushButton"
- font.pixelSize: 18
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.fill: parent
- }
- MouseArea {
- id: mouseArea
-
- anchors.fill: parent
- onPressed: {
- if (toggleMode) {
- if (parent.state == "unpressed") {
- parent.state = "pressed"
- } else {
- parent.state = "unpressed"
- }
- } else {
- parent.state = "pressed"
- }
- }
- onReleased: {
- if (!toggleMode) {
- parent.state = "unpressed"
- if (mouse.isClick) {
- parent.clicked()
- }
- }
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: toggleButton
- gradient: grPressed
- }
- },
- State {
- name: "unpressed"
- PropertyChanges {
- target: toggleButton
- gradient: grUnpressed
- }
- }
- ]
-
- Gradient {
- id: grUnpressed
-
- GradientStop { position: 0.0; color: "#2c2c2c" }
- GradientStop { position: 1.0; color: "#0c0c0c" }
- }
-
- Gradient {
- id: grPressed
-
- GradientStop { position: 0.0; color: "black" }
- GradientStop { position: 1.0; color: "black" }
- }
-
- transitions: [
- Transition {
- from: "unpressed"
- to: "pressed"
- reversible: true
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml
deleted file mode 100644
index cc26c87271..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableListView.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @file ScrollableListView.qml
- * @brief ListView with scrollbar on the right
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-ListView {
- clip: true
-
- Rectangle {
- visible: parent.height < parent.contentHeight
- anchors.right: parent.right
- y: parent.visibleArea.yPosition * parent.height
- width: Constants.scrollBarWidth
- height: parent.visibleArea.heightRatio * parent.height
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml b/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml
deleted file mode 100644
index 82f568414b..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/ScrollableText.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @file ScrollableText.qml
- * @brief Text with scrollers if text more than zone
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- property alias text: text.text
- clip: true
-
- Flickable {
- id: flickable
- anchors.fill: parent
- contentWidth: text.width
- contentHeight: text.height
-
- Text {
- id: text
- color: Constants.popUpBorderColor
- font.pixelSize: Constants.ttsFontSize
- }
- }
- Rectangle {
- visible: flickable.height < flickable.contentHeight
- anchors.right: flickable.right
- y: flickable.visibleArea.yPosition * flickable.height
- width: Constants.scrollBarWidth
- height: flickable.visibleArea.heightRatio * flickable.height
- color: Constants.popUpBorderColor
- }
- Rectangle {
- visible: flickable.width < flickable.contentWidth
- anchors.bottom: flickable.bottom
- x: flickable.visibleArea.xPosition * flickable.width
- height: Constants.scrollBarWidth
- width: flickable.visibleArea.widthRatio * flickable.width
- color: Constants.popUpBorderColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js
deleted file mode 100644
index 227f638366..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * @file SoftButton.js
- * @brief Soft button view constants
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-var Action = {
- doOnClicked: 0,
- doOnReleased: 1
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml b/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml
deleted file mode 100644
index b92cd51263..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/SoftButton.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * @file SoftButton.qml
- * @brief Soft button view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "SoftButton.js" as SoftButton
-
-OvalButton {
- property variant button
- property int appId
- visible: !!button
-
- signal defaultAction;
- signal stealFocus;
- signal keepContext;
-
- property int actionOrder: SoftButton.Action.doOnClicked
-
- highlighted: button ? button.isHighlighted : false
- onPressed: {
- actionOrder = SoftButton.Action.doOnClicked
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID)
- }
-
- onReleased: {
- if (actionOrder === SoftButton.Action.doOnReleased) {
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- if (dataContainer.currentApplication.isMediaApplication) {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- } else {
- contentLoader.go("views/SDLNonMediaView.qml", appId);
- }
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID)
- }
-
- onClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID);
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- if (dataContainer.currentApplication.isMediaApplication) { contentLoader.go("views/SDLPlayerView.qml", appId); }
- else { contentLoader.go("views/SDLNonMediaView.qml", appId); }
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- onPressAndHold: {
- actionOrder = SoftButton.Action.doOnReleased; // action should be triggered on release
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID);
- }
-
- onButtonChanged: {
- icon = button && button.type !== Common.SoftButtonType.SBT_TEXT ? button.image : undefined;
- text = button && button.type !== Common.SoftButtonType.SBT_IMAGE ? button.text : ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml b/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml
deleted file mode 100644
index a6d7640f36..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/controls/StatusBar.qml
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file StatusBar.qml
- * @brief Status bar that contains text string.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Text {
- text: dataContainer.currentApplication.hmiUIText.statusBar
- color: Constants.primaryColor
- font.pixelSize: Constants.statusBarFontSize
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js b/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js
deleted file mode 100644
index ebc5bfa3ca..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/Async.js
+++ /dev/null
@@ -1,7 +0,0 @@
-.pragma library
-
-var async_uid = 1;
-
-function AsyncCall() {
- this.__async_uid = async_uid++;
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml
deleted file mode 100644
index 9d7e0432f2..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/BasicCommunication.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @file BasicCommunication.qml
- * @brief Implement of interface Basic Communication.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-Item {
- function updateDeviceList (deviceList) {
- dataContainer.deviceList.clear();
- for(var i = 0; i < deviceList.length; i++) {
- dataContainer.deviceList.append({ name: deviceList[i].name, devid: deviceList[i].id })
- }
- }
-
- function updateAppList (applications) {
- dataContainer.applicationList.clear();
- for(var i = 0; i < applications.length; i++) {
- dataContainer.applicationList.append({
- appName: applications[i].appName,
- ngnMediaScreenAppName: applications[i].ngnMediaScreenAppName,
- icon: applications[i].icon,
- deviceName: applications[i].deviceName,
- appId: applications[i].appID,
- hmiDisplayLanguageDesired: applications[i].hmiDisplayLanguageDesired,
- isMediaApplication: applications[i].isMediaApplication,
- appType: applications[i].appType
- });
- }
- }
-
- function allowDeviceToConnect (device) {
- return {
- allow: true
- }
- }
-
- function mixingAudioSupported() {
- return {
- attenuatedSupport: true
- }
- }
-
- function allowAllApps() {
- return {
- allowed: true
- }
- }
-
- function allowApp(app, appPermissions) {
- return {
- allowed: true
- }
- }
-
- function activateApp() {
- contentLoader.go("views/SDLPlayerView.qml", appID);
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml
deleted file mode 100644
index 83ea933eda..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/Buttons.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file Buttons.qml
- * @brief Implement of interface Buttons.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-Item
-{
- function getCapabilities()
- {
- return {
- capabilities: settingsContainer.buttonCapabilities,
- presetBankCapabilities: {
- onScreenPresetsAvailable: true
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml
deleted file mode 100644
index 3ec131c8c1..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/Navigation.qml
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "Common.js" as Common
-
-Item {
- function isReady () {
- return {
- available: dataContainer.hmiNavigationAvailable
- }
- }
-
- function showConstantTBT(navigationTexts, turnIcon, nextTurnIcon, distanceToManeuver,
- distanceToManeuverScale, maneuverComplete,
- softButtons, appID) {
- console.debug("enter")
- navigationTexts.forEach(fillTexts);
- dataContainer.navigationModel.turnIcon = turnIcon ? turnIcon.value : ""
- dataContainer.navigationModel.nextTurnIcon = nextTurnIcon ? nextTurnIcon.value : ""
- dataContainer.navigationModel.distanceToManeuver = distanceToManeuver;
- dataContainer.navigationModel.distanceToManeuverScale = distanceToManeuverScale;
- if (maneuverComplete !== undefined) {
- dataContainer.navigationModel.maneuverComplete = maneuverComplete;
- }
- if (softButtons !== undefined) {
- dataContainer.navigationModel.softButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.navigationModel.softButtons);
- }
- dataContainer.navigationModel.appId = appID;
- contentLoader.go("./views/TurnByTurnView.qml");
- console.debug("exit")
- }
-
- function alertManeuver(softButtons) {
- console.debug("enter")
- if (softButtons !== undefined) {
- dataContainer.navigationModel.alertManeuverSoftButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.navigationModel.alertManeuverSoftButtons);
- }
- console.debug("exit")
- }
-
- function updateTurnList(turnList, softButtons, appID) {
- console.debug("enter")
- if (turnList !== undefined) {
- dataContainer.getApplication(appID).turnList.clear();
- turnList.forEach(fillTurnList, dataContainer.getApplication(appID).turnList);
- }
- if (softButtons !== undefined) {
- dataContainer.getApplication(appID).turnListSoftButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.getApplication(appID).turnListSoftButtons);
- }
- dataContainer.navigationModel.appId = appID;
- console.debug("exit")
- }
-
- function fillTexts(element, index, array) {
- switch (element.fieldName) {
- case Common.TextFieldName.navigationText1:
- dataContainer.navigationModel.text1 = element.fieldText;
- break;
- case Common.TextFieldName.navigationText2:
- dataContainer.navigationModel.text2 = element.fieldText;
- break;
- case Common.TextFieldName.ETA:
- dataContainer.navigationModel.eta = element.fieldText;
- break;
- case Common.TextFieldName.totalDistance:
- dataContainer.navigationModel.totalDistance = element.fieldText;
- break;
- case Common.TextFieldName.timeToDestination:
- dataContainer.navigationModel.timeToDestination = element.fieldText;
- break;
- }
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- buttonId: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
- function fillTurnList(element, index, array) {
- this.append({
- navigationText: element.navigationText,
- turnIcon: element.turnIcon
- });
- console.debug(element.navigationText)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml
deleted file mode 100644
index 96aa9b2c29..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/TTS.qml
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 1.1
-import "Common.js" as Common
-import "Async.js" as Async
-
-Item {
- function isReady() {
- return {
- available: dataContainer.hmiTTSAvailable
- }
- }
-
- function speak(ttsChunks, appID) {
- // appID unused
- console.debug('enter:', ttsChunks, appID);
- if (ttsPopUp.async) {
- console.log('speak send abort');
- throw Common.Result.ABORTED;
- }
-
- var message = ttsChunks.map(function(str) { return str.text }).join('\n');
- ttsPopUp.activate(message);
- ttsPopUp.async = new Async.AsyncCall();
- console.debug('exit');
- return ttsPopUp.async;
- }
-
- function stopSpeaking() {
- console.debug("enter");
- ttsPopUp.deactivate();
- console.debug("exit");
- }
-
- function getLanguage() {
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- return {
- capabilities: Common.SpeechCapabilities.SC_TEXT
- }
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter:", language, appID);
- dataContainer.changeRegistrationTTSVR(language, appID);
- console.debug("exit");
- }
-
- function setGlobalProperties(helpPrompt, timeoutPrompt, appID) {
- console.debug("enter: " + helpPrompt + ", " + timeoutPrompt + ", " + appID)
-
- var newHelpPropmt = helpPrompt ?
- helpPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.helpPrompt
-
- var newTimeoutPrompt = timeoutPrompt ?
- timeoutPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.timeoutPrompt
-
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- helpPrompt: newHelpPropmt,
- timeoutPrompt: newTimeoutPrompt
- })
- console.debug("exit")
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml
deleted file mode 100644
index 648cd1397f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/UI.qml
+++ /dev/null
@@ -1,449 +0,0 @@
-/**
- * @file UI.qml
- * @brief UI interface implementation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "Common.js" as Common
-import "Async.js" as Async
-import "../models/Internal.js" as Internal
-
-Item {
- function filter (strings, fields) {
- console.debug("enter")
-// substrings for each allowed field
- var fieldSubstrings = {}
-// this cycle concatenates allowed lines sorting them by field
- for (var stringIndex = 0; stringIndex < strings.length; ++stringIndex) {
- for (var fieldIndex = 0; fieldIndex < fields.length; ++fieldIndex) {
- var fieldName = strings[stringIndex].fieldName
- if (fieldName === fields[fieldIndex]) {
- if (fieldSubstrings[fieldName] !== undefined) {
- fieldSubstrings[fieldName] += "\n";
- fieldSubstrings[fieldName] += strings[stringIndex].fieldText
- }
- else {
- fieldSubstrings[fieldName] = strings[stringIndex].fieldText
- }
- }
- }
- }
- console.debug("exit")
- return fieldSubstrings
- }
-
- function alert (alertStrings, duration, softButtons, progressIndicator, appID) {
- var fieldSubstrings = alertStrings
- .sort(function(a, b) { return a.fieldName - b.fieldName }) // sorting by fieldName
- .map(function(val) { return val.fieldText }); // mapping to array of strings
-
- var tryAgainTime = alertWindow.alert(fieldSubstrings, duration, progressIndicator, softButtons, appID)
- if (tryAgainTime === undefined) {
- alertWindow.async = new Async.AsyncCall();
- return alertWindow.async;
- }
- else {
- return {
- "__retCode": Common.Result.REJECTED,
- "tryAgainTime": tryAgainTime
- }
- }
- }
-
- function show (showStrings, alignment, graphic, softButtons, customPresets, appID) {
- console.debug("enter: " + showStrings + ", " + alignment + ", " + graphic + ", "+ softButtons + ", " + customPresets + ", " + appID)
- var app = dataContainer.getApplication(appID);
-
- if (softButtons) {
- app.softButtons.clear()
- softButtons.forEach(function(x) { app.softButtons.append(x); });
- }
-
- if (customPresets) {
- app.customPresets.clear()
- customPresets.forEach( function(x) { app.customPresets.append( {text: x} ); } )
- }
-
- var textAlignment
- switch (alignment) {
- case Common.TextAlignment.LEFT_ALIGNED:
- textAlignment = Text.AlignLeft
- break;
- case Common.TextAlignment.RIGHT_ALIGNED:
- textAlignment = Text.AlignRight
- break;
- case Common.TextAlignment.CENTERED:
- textAlignment = Text.AlignHCenter
- break;
- default:
- textAlignment = Text.AlignHCenter
- break;
- }
-
- // with this array we grab only the lines we need
- var showFields = [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack
- ]
- var fieldSubstrings = filter(showStrings, showFields)
- var showData = { hmiUIText: {} }
- if (fieldSubstrings[Common.TextFieldName.mainField1] !== undefined) { showData.hmiUIText.mainField1 = fieldSubstrings[Common.TextFieldName.mainField1]; }
- if (fieldSubstrings[Common.TextFieldName.mainField2] !== undefined) { showData.hmiUIText.mainField2 = fieldSubstrings[Common.TextFieldName.mainField2]; }
- if (fieldSubstrings[Common.TextFieldName.mainField3] !== undefined) { showData.hmiUIText.mainField3 = fieldSubstrings[Common.TextFieldName.mainField3]; }
- if (fieldSubstrings[Common.TextFieldName.mainField4] !== undefined) { showData.hmiUIText.mainField4 = fieldSubstrings[Common.TextFieldName.mainField4]; }
- if (fieldSubstrings[Common.TextFieldName.statusBar] !== undefined) { showData.hmiUIText.statusBar = fieldSubstrings[Common.TextFieldName.statusBar]; }
- if (fieldSubstrings[Common.TextFieldName.mediaTrack] !== undefined) { showData.hmiUIText.mediaTrack = fieldSubstrings[Common.TextFieldName.mediaTrack]; }
- if (graphic) { showData.hmiUIText.image = graphic.value; }
- if (textAlignment) { showData.hmiUITextAlignment = textAlignment; }
- if (fieldSubstrings[Common.TextFieldName.mediaClock]) {
- showData.mediaClock = {
- "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
- "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
- "magic": Internal.stringToHmsTime(fieldSubstrings[Common.TextFieldName.mediaClock]),
- "total": 0
- }
- }
-
- dataContainer.setApplicationProperties(appID, showData);
- console.debug("exit")
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- dataContainer.addCommand(cmdID, menuParams, cmdIcon, appID)
- }
-
- function deleteCommand (cmdID, appID) {
- dataContainer.deleteCommand(cmdID, appID)
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- dataContainer.addSubMenu(menuID, menuParams, appID)
- }
-
- function deleteSubMenu (menuID, appID) {
- dataContainer.deleteSubMenu(menuID, appID)
- }
-
- function performInteraction (initialText, choiceSet, vrHelp, timeout, appID) {
- console.debug("enter")
- var async = dataContainer.interactionModel.performInteraction(initialText, choiceSet, vrHelp, timeout, appID)
- console.debug("exit")
- return async
- }
-
- function setMediaClockTimer (startTime, endTime, updateMode, appID) {
- console.debug("enter: {", startTime, ", ", endTime, ", ", updateMode, ", ", appID, "}")
-
- var app = dataContainer.getApplication(appID)
- var newStartTime
- var newEndTime
- var newUpdateMode
- var newRunningMode
- var newStartTimeForProgress
- var resultCode
- var sendErrorResponce = false
-
- switch (updateMode) {
- case Common.ClockUpdateMode.COUNTUP:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
- newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTUP
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.COUNTDOWN:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- newEndTime = endTime ? Internal.hmsTime(endTime.hours, endTime.minutes, endTime.seconds) : -1
- newUpdateMode = Internal.MediaClockUpdateMode.MCU_COUNTDOWN
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.PAUSE:
- // Already paused or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_STOPPED)
- || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = app.mediaClock.startTime
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.RESUME:
- // Already resumed or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_RUNNING)
- || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = app.mediaClock.startTime
- newUpdateMode = app.mediaClock.updateMode
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.CLEAR:
- newStartTime = -1
- newEndTime = -1
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = -1
- resultCode = Common.Result.SUCCESS
- break
- }
-
- if (sendErrorResponce) {
- console.debug("exit with result code: ", resultCode)
- return { __retCode: resultCode }
- }
-
- dataContainer.setApplicationProperties(appID, {
- "mediaClock": {
- "updateMode": newUpdateMode,
- "runningMode": newRunningMode,
- "startTime": newStartTime,
- "endTime": newEndTime,
- "startTimeForProgress": newStartTimeForProgress
- }
- })
-
- console.debug("exit")
- return { __retCode: resultCode }
- }
-
- function setGlobalProperties (vrHelpTitle, vrHelp, menuTitle, menuIcon, keyboardProperties, appID) {
- console.debug("enter: " + vrHelpTitle + ", " + vrHelp + ", " + menuTitle + ", " + menuIcon + ", " + keyboardProperties + ", " + appID)
- if (vrHelpTitle) {
- vrHelpPopup.title = vrHelpTitle
- }
- dataContainer.setVrHelp(vrHelp)
- console.debug("exit")
- }
-
- function showVrHelp (vrHelpTitle, vrHelp, appID) {
- console.debug("enter: " + vrHelpTitle + ", " + vrHelp + ", " + appID)
- if (vrHelpTitle) {
- vrHelpPopup.title = vrHelpTitle
- }
- dataContainer.setVrHelp(vrHelp)
- vrHelpPopup.show()
- console.debug("exit")
- }
-
- function isReady () {
- return {
- available: dataContainer.hmiUIAvailable
- }
- }
-
- function getLanguage () {
- return {
- language: dataContainer.hmiUILanguage
- }
- }
-
- function getSupportedLanguages () {
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function changeRegistration (language, appID) {
- dataContainer.changeRegistrationUI(language, appID)
- }
-
- function setAppIcon (syncFileName, appID) {
- dataContainer.setApplicationProperties(appID, { icon: syncFileName.value })
- }
-
- function slider (numTicks, position, sliderHeader, sliderFooter, timeout, appID) {
- console.debug("enter", numTicks, position, sliderHeader, sliderFooter, timeout, appID)
- if (dataContainer.uiSlider.running) {
- console.debug("aborted")
- return {__retCode: Common.Result.ABORTED, sliderPosition: position}
- }
-
- dataContainer.uiSlider.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiSlider.header = sliderHeader
- dataContainer.uiSlider.footer = sliderFooter
- dataContainer.uiSlider.numTicks = numTicks
- dataContainer.uiSlider.position = position
- dataContainer.uiSlider.timeout = timeout
-
- if (timeout !== 0) {
- sliderPopup.showSlider()
- sliderPopup.async = new Async.AsyncCall();
- console.debug("exit")
- return sliderPopup.async;
- } else {
- return { sliderPosition: position }
- }
- }
-
- function scrollableMessage (messageText, timeout, softButtons, appID) {
- console.debug("scrollableMessage ", messageText, timeout, softButtons, appID)
- if(dataContainer.scrollableMessageModel.running){
- //send error response if long message already running
- console.debug("scrollableMessage throw")
- throw Common.Result.ABORTED
- }
-
- dataContainer.scrollableMessageModel.longMessageText = messageText.fieldText
- dataContainer.scrollableMessageModel.softButtons.clear();
- if (softButtons !== undefined) {
- softButtons.forEach(fillSoftButtons, dataContainer.scrollableMessageModel.softButtons);
- }
- dataContainer.scrollableMessageModel.timeout = timeout
- dataContainer.scrollableMessageModel.appId = appID
- dataContainer.scrollableMessageModel.async = new Async.AsyncCall()
- contentLoader.go("./views/ScrollableMessageView.qml")
- console.debug("scrollableMessage exit")
- return dataContainer.scrollableMessageModel.async
- }
-
- function getCapabilities() {
- return {
- "audioPassThruCapabilities": {
- "samplingRate": Common.SamplingRate.RATE_44KHZ,
- "bitsPerSample": Common.BitsPerSample.RATE_8_BIT,
- "audioType": Common.AudioType.PCM
- },
- "displayCapabilities": settingsContainer.displayCapabilities,
- "hmiZoneCapabilities": Common.HmiZoneCapabilities.FRONT,
- "softButtonCapabilities": settingsContainer.softButtonCapabilities
- }
- }
-
- function performAudioPassThru (audioPassThruDisplayTexts, timeout, appID) {
- console.debug("enter", audioPassThruDisplayTexts, timeout)
-
- if (dataContainer.uiAudioPassThru.running) {
- console.debug("aborted")
- throw Common.Result.ABORTED
- }
-
- dataContainer.uiAudioPassThru.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiAudioPassThru.timeout = timeout
- if (audioPassThruDisplayTexts.length === 2) {
- dataContainer.uiAudioPassThru.firstLine = audioPassThruDisplayTexts[0].fieldText
- dataContainer.uiAudioPassThru.secondLine = audioPassThruDisplayTexts[1].fieldText
- }
- performAudioPassThruPopup.async = new Async.AsyncCall();
- performAudioPassThruPopup.showAudioPassThru()
- console.debug("exit")
- return performAudioPassThruPopup.async;
- }
-
- function endAudioPassThru () {
- console.debug("enter")
- if (!dataContainer.uiAudioPassThru.running) {
- console.debug("rejected")
- throw Common.Result.REJECTED
- }
- DBus.sendReply({__retCode: Common.Result.SUCCESS})
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- console.debug("exit")
- }
-
- function closePopUp (methodName) {
- console.debug("enter")
- var popUpToClose
-
- if (dataContainer.activePopup.length === 0) {
- return { __retCode: Common.Result.ABORT, __message: "No active PopUps"}
- }
-
- if (methodName !== undefined) {
- popUpToClose = methodName
- } else {
- popUpToClose = dataContainer.activePopup[dataContain.activePopUp.length - 1]
- }
-
- switch (popUpToClose) {
- case "UI.PerformInteraction":
- interactionPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Slider":
- sliderPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.PerformAudioPassThru":
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Alert":
- alertWindow.complete(Common.Result.SUCCESS)
- break
- case "UI.VrHelp":
- vrHelpPopup.complete(Common.Result.SUCCESS)
- break
- }
- console.debug("exit")
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- softButtonID: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml
deleted file mode 100644
index 37d19f6a46..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/VR.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * @file VR.qml
- * @brief Implement of interface VR.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "Common.js" as Common
-
-Item {
- function isReady() {
- return {
- available: dataContainer.hmiVRAvailable
- }
- }
-
- function addCommand(cmdID, vrCommands, appID) {
- console.log("VR.AddCommand: cmd ", cmdID, ", app ", appID);
- for (var i = 0; i < vrCommands.length; ++i) {
- dataContainer.vrCommands.append({
- cmdID: cmdID,
- command: vrCommands[i],
- appID: appID === undefined ? 0 : appID,
- });
- }
- console.log("exit")
- }
-
- function deleteCommand(cmdID, appID) {
- console.log("VR.DeleteCommand: cmd ", cmdID, ", app ", appID);
- for (var i = 0; i < dataContainer.vrCommands.count; ) {
- if ((dataContainer.vrCommands.get(i).cmdID === cmdID) &&
- ((appID === undefined) || (dataContainer.vrCommands.get(i).appID === appID))) {
- dataContainer.vrCommands.remove(i);
- continue;
- }
- ++i;
- }
- console.log("exit")
- }
-
- function getLanguage() {
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- return {
- vrCapabilities: [ Common.VrCapabilities.VR_TEXT ]
- }
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter:", language, appID);
- dataContainer.changeRegistrationTTSVR(language, appID);
- console.debug("exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml b/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml
deleted file mode 100644
index 18f3a1ce9e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/hmi_api/VehicleInfo.qml
+++ /dev/null
@@ -1,749 +0,0 @@
-/**
- * @file VehicleInfo.qml
- * @brief Vehicle information interface realisation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "Common.js" as Common
-
-Item {
- function isReady () {
- return {
- available: dataContainer.hmiVehicleInfoAvailable
- }
- }
-
- function getVehicleType() {
- return {
- "vehicleType": {
- "make": "Ford",
- "model": "Fiesta",
- "modelYear": "2013",
- "trim": "SE"
- }
- }
- }
-
- function getGpsData(appID) {
- console.debug("enter")
- console.debug("exit")
- return { gps: dataContainer.vehicleInfoModel.gps }
- }
-
- function getSpeed(appID) {
- console.debug("enter")
- console.debug("exit")
- return { speed: dataContainer.vehicleInfoModel.speed }
- }
-
- function getRpm(appID) {
- console.debug("enter")
- console.debug("exit")
- return {
- rpm: dataContainer.vehicleInfoModel.rpm,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
-
- function getFuelLevel(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel: dataContainer.vehicleInfoModel.fuelLevel }
- }
-
- function getFuelLevelState(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel_State: dataContainer.vehicleInfoModel.fuelLevel_State }
- }
-
- function getInstantFuelConsumption(appID) {
- console.debug("enter")
- console.debug("exit")
- return { instantFuelConsumption: dataContainer.vehicleInfoModel.instantFuelConsumption }
- }
-
- function getExternalTemperature(appID) {
- console.debug("enter")
- console.debug("exit")
- return { externalTemperature: dataContainer.vehicleInfoModel.externalTemperature }
- }
-
- function getVin(appID) {
- console.debug("enter")
- console.debug("exit")
- return { vin: dataContainer.vehicleInfoModel.vin }
- }
-
- function getPrndl(appID) {
- console.debug("enter")
- if (dataContainer.vehicleInfoModel.prndl === -1) { // Test value, to check response
- console.debug("exit")
- return {
- prndl: dataContainer.vehicleInfoModel.prndl,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
- console.debug("exit")
- return { prndl: dataContainer.vehicleInfoModel.prndl }
- }
-
- function getTirePressure(appID) {
- console.debug("enter")
- console.debug("exit")
- return { tirePressure: dataContainer.vehicleInfoModel.tirePressure }
- }
-
- function getOdometer(appID) {
- console.debug("enter")
- console.debug("exit")
- return { odometer: dataContainer.vehicleInfoModel.odometer }
- }
-
- function getBeltStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { beltStatus: dataContainer.vehicleInfoModel.beltStatus }
- }
-
- function getBodyInformation(appID) {
- console.debug("enter")
- console.debug("exit")
- return { bodyInformation: dataContainer.vehicleInfoModel.bodyInformation }
- }
-
- function getDeviceStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { deviceStatus: dataContainer.vehicleInfoModel.deviceStatus }
- }
-
- function getDriverBraking(appID) {
- console.debug("enter")
- console.debug("exit")
- return { driverBraking: dataContainer.vehicleInfoModel.driverBraking }
- }
-
- function getWiperStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { wiperStatus: dataContainer.vehicleInfoModel.wiperStatus }
- }
-
- function getHeadLampStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { headLampStatus: dataContainer.vehicleInfoModel.headLampStatus }
- }
-
- function getEngineTorque(appID) {
- console.debug("enter")
- console.debug("exit")
- return { engineTorque: dataContainer.vehicleInfoModel.engineTorque }
- }
-
- function getAccPedalPosition(appID) {
- console.debug("enter")
- console.debug("exit")
- return { accPedalPosition: dataContainer.vehicleInfoModel.accPedalPosition }
- }
-
- function getSteeringWheelAngle(appID) {
- console.debug("enter")
- console.debug("exit")
- return { steeringWheelAngle: dataContainer.vehicleInfoModel.steeringWheelAngle }
- }
-
- function getECallInfo(appID) {
- console.debug("enter")
- console.debug("exit")
- return { eCallInfo: dataContainer.vehicleInfoModel.eCallInfo }
- }
-
- function getAirbagStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { airbagStatus: dataContainer.vehicleInfoModel.airbagStatus }
- }
-
- function getEmergencyEvent(appID) {
- console.debug("enter")
- console.debug("exit")
- return { emergencyEvent: dataContainer.vehicleInfoModel.emergencyEvent }
- }
-
- function getClusterModeStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { clusterModeStatus: dataContainer.vehicleInfoModel.clusterModeStatus }
- }
-
- function getMyKey(appID) {
- console.debug("enter")
- console.debug("exit")
- return { myKey: dataContainer.vehicleInfoModel.myKey }
- }
-
- function getDTCs(ecuName, dtcMask, appID) {
- var ecuHeader = 2
- var dtc = []
-
- for (var i = 0; i < 3; i++) {
- dtc.push("line" + i)
- }
- return {ecuHeader: ecuHeader, dtc: dtc}
- }
-
- function readDID(ecuName, didLocation, appID) {
- console.debug("Enter")
- //TODO{ALeshin}: refactoring of this function, when we'll have Vehicle Info module
- var didResult = []
-
- for (var i = 0; i < didLocation.length; i++) {
- if (i < 10) {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_SUCCESS
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- else {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_DATA_NOT_AVAILABLE
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- }
- console.debug("Exit")
- return {didResult: didResult}
- }
-
- function subscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- model.onGpsChanged.connect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
- }
- function unsubscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
-
- }
-
- function subscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- model.onSpeedChanged.connect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- model.onRpmChanged.connect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- model.onFuelLevelChanged.connect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- model.onFuelLevel_StateChanged.connect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- model.onInstantFuelConsumptionChanged.connect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- model.onExternalTemperatureChanged.connect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- model.onPrndlChanged.connect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- model.onVinChanged.connect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- model.onTirePressureChanged.connect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- model.onOdometerChanged.connect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- model.onBeltStatusChanged.connect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- model.onBodyInformationChanged.connect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- model.onDeviceStatusChanged.connect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- model.onDriverBrakingChanged.connect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- model.onWiperStatusChanged.connect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- model.onHeadLampStatusChanged.connect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- model.onEngineTorqueChanged.connect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- model.onAccPedalPositionChanged.connect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- model.onSteeringWheelAngleChanged.connect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- model.onECallInfoChanged.connect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- model.onAirbagStatusChanged.connect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- model.onEmergencyEventChanged.connect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- model.onClusterModeStatusChanged.connect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- model.onMyKeyChanged.connect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/log4cxx.properties b/src/components/qt_hmi/qml_model_qt4/log4cxx.properties
deleted file mode 100644
index 0bc5ac8fdf..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/log4cxx.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-# Socket logger
-log4j.appender.SocketHub=org.apache.log4j.net.SocketHubAppender
-log4j.appender.SocketHub.port=4555
-log4j.appender.SocketHub.locationInfo=true
-
-# 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=ERROR
-
-# Log for all DBus plugin messages
-log4j.appender.DBusPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.DBusPluginLogFile.File=DBusPlugin.log
-log4j.appender.DBusPluginLogFile.append=false
-log4j.appender.DBusPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.DBusPluginLogFile.ImmediateFlush=true
-log4j.appender.DBusPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.DBusPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all HMI Framework plugin
-log4j.appender.HmiFrameworkPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.HmiFrameworkPluginLogFile.File=HmiFrameworkPlugin.log
-log4j.appender.HmiFrameworkPluginLogFile.append=false
-log4j.appender.HmiFrameworkPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.HmiFrameworkPluginLogFile.ImmediateFlush=true
-log4j.appender.HmiFrameworkPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.HmiFrameworkPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all Qt HMI
-log4j.rootLogger=ALL, Console
-
-# Log for DBus plugin QtHMI
-log4j.logger.DBusPlugin=ALL, DBusPluginLogFile
-
-# Log for HMI Framework plugin
-log4j.logger.HmiFrameworkPlugin=ALL, HmiFrameworkPluginLogFile
-
-# Log by log4cxx plugin
-log4j.logger.Log4cxxPlugin=ALL, HmiFrameworkPluginLogFile
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml b/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml
deleted file mode 100644
index a50113095c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ApplicationData.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * @file ApplicationData.qml
- * @brief Model for Application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-QtObject {
- property string mainField1
- property string mainField2
- property string mainField3
- property string mainField4
- property string statusBar
- property string mediaTrack
- property string image
-
- function reset () {
- console.debug("enter")
- mainField1 = ""
- mainField2 = ""
- mainField3 = ""
- mainField4 = ""
- statusBar = ""
- mediaTrack = ""
- image = ""
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml
deleted file mode 100644
index 206eaa9185..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ApplicationModel.qml
+++ /dev/null
@@ -1,91 +0,0 @@
-/**
- * @file ApplicationModel.qml
- * @brief Own fields for each application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-
-QtObject {
- property int appId
- property string appName
- property string ngnMediaScreenAppName
- property Icon appIcon: Icon { }
- property string deviceName
- property int hmiDisplayLanguageDesired
- property bool isMediaApplication
- property variant appType
- property int hmiUITextAlignment
-
- // media player
- property string playPauseState
- property ApplicationData hmiUIText: ApplicationData { }
- property MediaClockModel mediaClock: MediaClockModel { }
-
- property string helpPrompt
- property string timeoutPrompt
- property ListModel options: ListModel { }
-
- property ListModel currentSubMenu: options
- property ListModel turnList
- property ListModel softButtons
- property ListModel turnListSoftButtons
- property ListModel customPresets
- property int languageTTSVR
- // This place is for adding new properties
-
- function reset () {
- console.debug("enter")
- appId = -1
- appName = ""
- ngnMediaScreenAppName = ""
- appIcon.reset()
- deviceName = ""
- hmiDisplayLanguageDesired = -1
- isMediaApplication = false
- appType = undefined
- playPauseState = ""
- hmiUIText.reset()
-// no need to reset mediaClock
- helpPrompt = ""
- timeoutPrompt = ""
- options.clear()
- currentSubMenu = options
- turnList = null
- softButtons = null
- turnListSoftButtons = null
- customPresets = null
- languageTTSVR = -1
- hmiUITextAlignment = null
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml
deleted file mode 100644
index f636d1e794..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/CarMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file CarMenuModel.qml
- * @brief Car menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-ListModel
-{
- ListElement {
- name: "ambient"
- icon: "../res/vehicle/Ambient Lighti Icon.png"
- qml: ""
- }
- ListElement {
- name: "cal"
- icon: "../res/vehicle/cal.png"
- qml: ""
- }
- ListElement {
- name: "ev"
- icon: "../res/vehicle/EV Icon.png"
- qml: ""
- }
- ListElement {
- name: "folders"
- icon: "../res/vehicle/folders.png"
- qml: ""
- }
- ListElement {
- name: "key"
- icon: "../res/vehicle/key_car.png"
- qml: ""
- }
- ListElement {
- name: "mcs"
- icon: "../res/vehicle/MCS Icon.png"
- qml: ""
- }
- ListElement {
- name: "sun"
- icon: "../res/vehicle/sun.png"
- qml: ""
- }
- ListElement {
- name: "sync"
- icon: "../res/vehicle/SYNC Services.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/Constants.js b/src/components/qt_hmi/qml_model_qt4/models/Constants.js
deleted file mode 100644
index 1bc5c558ba..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/Constants.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/**
- * @file Constants.js
- * @brief Namespace of constants.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-// Colors
-
-// Main color of HMI model(now it ~lightblue). Buttons, text, icons of this color.
-var primaryColor = "#1d81d5"
-
-// Color of pressed buttons, text, icons etc.
-var primaryColorPressed = "#8ec0ea"
-
-// Secondary color of HMI model, backgroud of this color.
-var secondaryColor = "black"
-
-// Color of text at buttonts that are inactive (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColor = "grey"
-
-// Color of text at buttonts that are inactive but nevertheless pressed (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColorPressed = "lightgrey"
-
-// Color of text at contact list screen view (Name, number and number type).
-var contactTextColor = "lightblue"
-
-// Color of text at buttons, when they are pressed.
-var pressedButtonTextColor = "black"
-
-// Color of text at "white" buttons, for all other buttons (which most) use primaryColor.
-var releasedButtonTextColor = "white"
-
-// Transparent background.
-var transparentColor = "#00000000"
-
-// "Warning" word color
-var warningColor = "red"
-
-// Color for PopUp
-var popUpBorderColor = "white"
-
-// Color for hardware and simulation panels
-var panelColor = "#003"
-
-// Color for text in hardware and simulation panels
-var panelTextColor = "white"
-
-// Audio pass thru PopUp text color
-var audioPassThruTextColor = "white"
-
-// Color for border of controls
-var controlsBorderColor = "#ababab"
-
-//--------------------------------------------------------------------------------------
-
-// Font sizes of different elements
-
-// Font size for most of text in HMI model.
-var fontSize = 20
-
-// Font size for text inside oval buttons.
-var ovalButtonFontSize = 15
-
-// Title font size
-var titleFontSize = 35
-
-// Power on/off button font size
-var powerButtonFornSize = 25
-
-// Font size of status bar
-var statusBarFontSize = 15
-
-// Size icon for buttons
-var iconButtonSize = 30
-
-// Size icon for item list
-var iconItemListSize = 40
-
-// font size fo TTS popup
-var ttsFontSize = 12
-
-// Font size for list of applications
-var appListFontSize = 40
-
-// Size of contact list fields
-var contactListNameFieldSize = 0.4
-var contactListPhoneFieldSize = 0.3
-var contactListDescriptionFieldSize = 0.3
-
-//--------------------------------------------------------------------------------------
-
-// Sizes of buttons, menus, screen, etc
-
-// Minimal width and height of screen (screen wont resize, if height and width are lower).
-var mainScreenMinWidth = 800
-var mainScreenMiHeight = 600
-
-// Width for long oval button
-var ovalButtonWidth = 163
-
-// Height for oval button
-var ovalButtonHeight = 65
-
-// Height item list
-var itemListHeight = 60
-
-// Width for TTS popup
-var ttsPopUpWidth = 250
-
-// Height for TTS popup
-var ttsPopUpHeight = 100
-
-// Width for popup view
-var popupWidth = 700
-
-// Width for alert window
-var alertWidth = 360
-
-// Height for popup view
-var popupHeigth = 500
-
-// Width for combobox
-var defaultComboboxWidth = 150
-
-// Size icon for list of applications
-var appListIconSize = 100
-
-// DistanceBar height
-var distanceBarHeight = 1
-
-
-//---------------------------------------------------------------------------------------
-
-// Other
-
-// Offset from the edges of the screen.
-var margin = 20
-
-// Offset from the edges of the popup
-var popupMargin = 15
-
-// Spacing between contacts at contact screen view.
-var contactListSpacing = 30
-
-// Duration of appearance of icon/button at icon/button menus.
-var animationDuration = 500
-
-// Duration of appearence of "OK" button at warning screen view, when HMI starts.
-var warningScreenDuration = 1000
-
-// Timer to check how long preset button is pressed.
-var presetButtonTimer = 800
-
-// Spacing between icon and item in list
-var iconItemListSpacing = 20
-
-// Spacing between item on views
-var generalSpacing = 10
-
-// Width of scrollBar
-var scrollBarWidth = 5
-
-// Speak text for a given time
-var ttsSpeakTime = 2000
-
-// Maximal number of submenus
-var maximumSubmenus = 1000
-
-// Maximal number of commands in submenu or root menu
-var maximumCommandsPerSubmenu = 1000
-
-// padding for popup view
-var popUpPadding = 20
-
-// Padding for TTS popup
-var ttsPopUpPadding = 10
-
-// -------------------------
-var sliderBarWidth = 400
-var sliderBarHeight = 50
-var sliderBarRadius = 3
-var sliderBarBorderWidth = 1
-var sliderTextColor = "white"
-var sliderBarBorderColor = "white"
-var sliderBarFillColor = "white"
-
-// -------------------------
-var scrollableMessageTextColor = "white"
-var scrollableMessageScrollBarColor = "gray"
-var scrollableMessageScrollBarWidth = 10
-
-// Padding for hardware and simulation panels
-var panelPadding = 20
-
-// Scale for pressed icon in menu
-var pressedIconScale = 1.1
-
-// Values of color effect for highlighted button
-var highlightedButtonHue = 0.9
-var highlightedButtonSaturation = 0.0
-var highlightedButtonLightness = 0.1
-
-// Values of color effect for disabled button
-var disabledButtonHue = 0.0
-var disabledButtonSaturation = -1.0
-var disabledButtonLightness = 0.1
-
-// Count of rows for grid menu
-var menuRowCount = 2
-
-// Count of columns for grid menu
-var menuColumnCount = 3
-
-// Radius of controls
-var controlsRadius = 2
-
-// Width of border of controls
-var controlsBorderWidth = 1
-// Position for element that came without position value (should be always at the end)
-var positionOfElementWithoutPosition = 1001
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml
deleted file mode 100644
index 348d30156c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ContactsListModel.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file ContactsListModel.qml
- * @brief List of contacts.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-ListModel
-{
- // TODO {ALeshin}: This list model should be sorted in ABC and Upper/lower case order,
- // when it will be filled dynamically.
- ListElement { name: "Aaron" ; phone:"(614)555-2444";type:"Mobile"}
- ListElement { name: "Adrian" ; phone:"(740)245-3434";type:"Mobile" }
- ListElement { name: "Albert" ; phone:"(614)245-5584";type:"Mobile" }
- ListElement { name: "Alice" ; phone:"(313)878-3566";type:"Office"}
- ListElement { name: "Alec" ; phone:"(917)608-2418";type:"Mobile"}
- ListElement { name: "Alexander" ; phone:"(614)608-2400";type:"Home"}
- ListElement { name: "Alexander Vasil'evich Michail Leontiy" ; phone:"(614)608-2400";type:"Mobile"}
- ListElement { name: "Amber" ; phone:"(614)608-2111";type:"Mobile"}
- ListElement { name: "Amy" ; phone:"(440)245-3434";type:"Mobile" }
- ListElement { name: "Andy" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Antje" ; phone:"(567)245-3434";type:"Home" }
- ListElement { name: "buddy" ; phone:"(614)813-6610";type:"Mobile" }
- ListElement { name: "Barry" ; phone:"(313)555-2211";type:"Mobile" }
- ListElement { name: "Bea" ; phone:"(614)455-3434";type:"Mobile" }
- ListElement { name: "Ben" ; phone:"(614)882-1843";type:"Office" }
- ListElement { name: "Blake" ; phone:"(330)149-7778";type:"Mobile" }
- ListElement { name: "Bob Mould" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Brian" ; phone:"(614)332-7499";type:"Mobile" }
- ListElement { name: "Calvin" ; phone:"(614)442-9974";type:"Mobile" }
- ListElement { name: "Carl" ; phone:"(567)773-3434";type:"Home" }
- ListElement { name: "Cat Power" ; phone:"(313)608-3434";type:"Home"}
- ListElement { name: "Cathy" ; phone:"(313)444-456";type:"Home"}
- ListElement { name: "Chris" ; phone:"(734)997-6514";type:"Home" }
- ListElement { name: "Cloud Nothings"; phone:"(444)608-543";type:"Mobile"}
- ListElement { name: "Cody" ; phone:"(567)365-8413";type:"Home" }
- ListElement { name: "Curtis" ; phone:"(614)245-1547";type:"Office" }
- ListElement { name: "Dakota" ; phone:"(567)555-4444";type:"Home" }
- ListElement { name: "Dale" ; phone:"(567)723-1974";type:"Mobile" }
- ListElement { name: "Dallas"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Damian" ; phone:"(614)245-3434";type:"Office" }
- ListElement { name: "Daniel"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Darina"; phone:"(313)895-888";type:"Mobile"}
- ListElement { name: "Dee "; phone:"(313)432-3434";type:"Home"}
-// ListElement { name: "Edward" ; phone:"(917)608-975";type:"Office"}
- ListElement { name: "Ferdinand" ; phone:"(917)879-795";type:"Mobile"}
- ListElement { name: "gomez" ; phone:"(313)455-543";type:"Mobile"}
- ListElement { name: "Harry Potter"; phone:"(313)888-432";type:"Home"}
- ListElement { name: "Ivan"; phone:"(313)996-225";type:"Home"}
-// ListElement { name: "James" ; phone:"(917)608-3434";type:"Mobile"}
- ListElement { name: "Karen"; phone:"(313)998-332";type:"Home"}
- ListElement { name: "Luis Torres"; phone:"(313)779-111";type:"Home"}
- ListElement { name: "Mary"; phone:"(313)234-098";type:"Mobile"}
- ListElement { name: "Neil"; phone:"(313)444-112";type:"Mobile"}
- ListElement { name: "Oswald"; phone:"(313)456-921";type:"Mobile"}
- ListElement { name: "Oscar"; phone:"(313)332-778";type:"Home"}
- ListElement { name: "~1123"; phone:"(313)1332";type:"Home"}
- ListElement { name: "Patrice"; phone:"(313)789-111";type:"Mobile"}
- ListElement { name: "Queen Elizabeth"; phone:"(313)897-666";type:"Mobile"}
- ListElement { name: "Rose"; phone:"(313)111-211";type:"Mobile"}
- ListElement { name: "Susell"; phone:"(313)345-122";type:"Home"}
- ListElement { name: "Thomas"; phone:"(917)608-342";type:"Mobile"}
- ListElement { name: "Titus Andronicus" ; phone:"(917)608-321";type:"Office"}
- ListElement { name: "Toretto" ; phone:"(917)608-3434";type:"Home"}
- ListElement { name: "Uhl" ; phone:"(313)444-654";type:"Office"}
- ListElement { name: "willi" ; phone:"(313)224-5712";type:"Office"}
- ListElement { name: "Wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "Zara" ; phone:"(313)231-009";type:"Mobile"}
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml
deleted file mode 100644
index cc5f6fc215..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/DataStorage.qml
+++ /dev/null
@@ -1,510 +0,0 @@
-/**
- * @file DataStorage.qml
- * @brief Container for data.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "Internal.js" as Internal
-import "Constants.js" as Constants
-
-QtObject {
-
- property string contactsFirstLetter // first letter of contact's name that need to find at contact list
- property ApplicationModel currentApplication: ApplicationModel { }
- property SliderModel uiSlider: SliderModel { }
- property PerformAudioPassThruModel uiAudioPassThru: PerformAudioPassThruModel { }
-
- function getApplication(appId) {
- console.log("dataContainer getApplication enter");
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- console.log("Application found", applicationList.get(i));
- return applicationList.get(i);
- }
- }
- console.log("dataContainer getApplication exit");
- }
-
- onApplicationListChanged: {
- console.log("onApplicationListChanged()");
- setCurrentApplication(appId);
- }
-
- function setCurrentApplication(appId) {
- console.log("Enter setCurrentApplication function");
- var oldApplicationContext = applicationContext;
- if (currentApplication.appId !== appId) {
- applicationContext = false;
- }
-
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- currentApplication.appId = appId
- var application = applicationList.get(i)
- currentApplication.appName = application.appName
- currentApplication.appType = application.appType
- currentApplication.appIcon.source = application.icon
- currentApplication.playPauseState = application.playPauseState
- currentApplication.options = application.options
- currentApplication.softButtons = application.softButtons
- currentApplication.customPresets = application.customPresets
-
- if (application.hmiUIText.mainField1 !== undefined) {
- currentApplication.hmiUIText.mainField1 = application.hmiUIText.mainField1
- }
- if (application.hmiUIText.mainField2 !== undefined) {
- currentApplication.hmiUIText.mainField2 = application.hmiUIText.mainField2
- }
- if (application.hmiUIText.mainField3 !== undefined) {
- currentApplication.hmiUIText.mainField3 = application.hmiUIText.mainField3
- }
- if (application.hmiUIText.mainField4 !== undefined) {
- currentApplication.hmiUIText.mainField4 = application.hmiUIText.mainField4
- }
- if (application.hmiUIText.statusBar !== undefined) {
- currentApplication.hmiUIText.statusBar = application.hmiUIText.statusBar
- }
- if (application.hmiUIText.mediaTrack !== undefined) {
- currentApplication.hmiUIText.mediaTrack = application.hmiUIText.mediaTrack
- }
- if (application.hmiUIText.image !== undefined) {
- currentApplication.hmiUIText.image = application.hmiUIText.image
- }
- if (application.hmiUITextAlignment !== undefined) {
- currentApplication.hmiUITextAlignment = application.hmiUITextAlignment
- }
- if (application.helpPrompt !== undefined) {
- currentApplication.helpPrompt = application.helpPrompt
- }
- if (application.timeoutPrompt !== undefined) {
- currentApplication.timeoutPrompt = application.timeoutPrompt
- }
- // Check fields with mandatory = false
-
- currentApplication.deviceName = application.deviceName
- currentApplication.isMediaApplication = application.isMediaApplication
- currentApplication.turnList = application.turnList
- currentApplication.turnListSoftButtons = application.turnListSoftButtons
- currentApplication.mediaClock.updateMode = application.mediaClock.updateMode
- currentApplication.mediaClock.runningMode = application.mediaClock.runningMode
- currentApplication.mediaClock.startTimeForProgress = application.mediaClock.startTimeForProgress
- if (application.mediaClock.startTime !== undefined) {
- currentApplication.mediaClock.startTime = application.mediaClock.startTime
- }
- if (application.mediaClock.endTime !== undefined) {
- currentApplication.mediaClock.endTime = application.mediaClock.endTime
- }
- currentApplication.languageTTSVR = application.languageTTSVR
- currentApplication.hmiDisplayLanguageDesired = application.hmiDisplayLanguageDesired
- // This place is for adding new properties
- }
- }
- applicationContext = oldApplicationContext;
- currentApplicationChanged()
- console.log("Exit setCurrentApplication function")
- }
-
- function addApplication(app) {
- console.log("enter")
- applicationList.append({
- appName: app.appName,
- ngnMediaScreenAppName: app.ngnMediaScreenAppName,
- icon: app.icon,
- deviceName: app.deviceName,
- appId: app.appId,
- hmiDisplayLanguageDesired: app.hmiDisplayLanguageDesired,
- isMediaApplication: app.isMediaApplication,
- appType: app.appType,
- helpPrompt: "",
- timeoutPrompt: "",
- customPresets: app.customPresets ? app.customPresets : [],
- playPauseState: 'Pause',
- hmiUIText: app.hmiUIText,
- hmiUITextAlignment: app.hmiUITextAlignment,
- options: [],
- turnList: [],
- turnListSoftButtons: [],
- mediaClock: app.mediaClock,
- languageTTSVR: Common.Language.EN_US,
- softButtons: []
- // This place is for adding new properties
- })
-
- if (app.isMediaApplication) {
- musicSourceModel.insert(0, {
- "title": app.appName,
- "qml": "views/SDLPlayerView.qml",
- "appId": app.appId
- })
- }
-
- console.log("exit")
- }
-
- function setApplicationProperties(appId, props) {
- console.log("Enter setApplicationProperties function");
- var app = getApplication(appId)
- for (var p in props) {
- if (props[p] !== undefined) {
- app[p] = props[p]
- }
- }
- if (currentApplication.appId === appId) {
- setCurrentApplication(appId); // copy new values to current application
- }
- console.log("Exit setApplicationProperties function");
- }
-
- function removeApplication(appId) {
- console.log("enter");
- for (var j = 0; j < musicSourceModel.count; ++j) {
- if (musicSourceModel.get(j).appId === appId) {
- musicSourceModel.remove(j);
- break;
- }
- }
- for (var i = 0; i < applicationList.count; i++) {
- if (applicationList.get(i).appId === appId) {
- applicationList.remove(i);
- break;
- }
- }
- console.log("exit");
- }
-
- property int systemContext
- property int hmiContext
- property bool applicationContext: false
- property bool applicationSavedContext
- property string routeText: ""
- property PlayerState cdPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState ipodPlayerState: PlayerState {
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- playPauseState: 'Pause'
- }
- property PlayerState usbPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState linePlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState btPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState amPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "1130", "950", "760", "1270", "1400", "2100", "940", "1001" ]
- }
- property PlayerState fmPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: ["96.3", "107.9", "104.3", "101.9", "105.3", "100.5", "107.9", "103.4"]
- }
- property PlayerState siriusPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "Lithium", "Spectrum", "ESPN", "Alt Nation", "Lithium", "Spectrum", "ESPN", "Alt Nation" ]
- }
-
- property bool hmiVRAvailable: false
- property bool hmiTTSAvailable: false
- property bool hmiNavigationAvailable: false
- property bool hmiVehicleInfoAvailable: false
- property bool hmiUIAvailable: false
-
- property int hmiUILanguage: Common.Language.EN_US
- property int hmiTTSVRLanguage: Common.Language.EN_US
-
- property ListModel deviceList: ListModel { }
- property ListModel applicationList: ListModel { }
-
- property ListModel vrCommands: ListModel {}
-
- property ListModel vrHelp: ListModel {}
-
- function reset () {
- console.log("dataContainer reset enter");
- routeText = ""
- console.log("dataContainer reset exit");
- }
-
- function changeRegistrationUI (language, appID) {
- console.log("dataContainer changeRegistrarionUI enter");
- setApplicationProperties(appID, { hmiDisplayLanguageDesired: language });
- console.log("dataContainer changeRegistrarionUI exit");
- }
-
- function changeRegistrationTTSVR(language, appID) {
- console.log("dataContainer changeRegistrationTTSVR enter");
- setApplicationProperties(appID, { languageTTSVR: language });
- console.log("dataContainer changeRegistrationTTSVR exit");
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- console.debug("enter: " +
- cmdID +
- ", " +
- (menuParams ?
- "{" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}" : menuParams) +
- ", " +
- (cmdIcon ?
- "{" + cmdIcon.value + ", " + cmdIcon.imageType + "}" : cmdIcon) +
- ", " +
- appID
- )
- var commandToAddPosition
- var app = getApplication(appID)
- var currentMenu = app.options
- var maximumCommands = Constants.maximumCommandsPerSubmenu
- var index = 0
-
- if ((menuParams) && (menuParams.parentID)) { // Work with sub menu
- var parentNotFound = true
- for (var optionIndex = 0; optionIndex < app.options.count; ++optionIndex) {
- if ((app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) && (app.options.get(optionIndex).id === menuParams.parentID)) {
- currentMenu = app.options.get(optionIndex).subMenu
- parentNotFound = false
- maximumCommands += 1
- }
- }
- if (parentNotFound) {
- console.log("UI::addCommand(): parentID " + menuParams.parentID + " not found")
- }
- }
-
- if (currentMenu.count < maximumCommands) {
- if (menuParams && (menuParams.position !== undefined)) {
- commandToAddPosition = menuParams.position
- } else {
- commandToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < currentMenu.count; i++) {
- if (commandToAddPosition >= currentMenu.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- currentMenu.insert( index,
- { id: cmdID,
- name: menuParams.menuName,
- type: Internal.MenuItemType.MI_NODE,
- position: commandToAddPosition,
- icon: cmdIcon ? cmdIcon : {},
- subMenu: []
- })
- } else {
- console.log("addCommand(): too many commands in menu: ", menuParams.parentID, " rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteCommand (cmdID, appID) {
- console.debug("enter: " + cmdID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if (option.type === Internal.MenuItemType.MI_NODE) {
- if (option.id === cmdID) {
- getApplication(appID).options.remove(optionIndex)
- break
- }
- }
- if (option.type === Internal.MenuItemType.MI_SUBMENU) {
- var subMenu = option.subMenu
- var idMatchFound = false
- for (var subOptionIndex = 0; subOptionIndex < subMenu.count; ++subOptionIndex) {
- if (subMenu.get(subOptionIndex).id === cmdID) {
- idMatchFound = true
- if (subMenu !== currentApplication.currentSubMenu) {
- subMenu.remove(subOptionIndex)
- }
- else {
- console.log("UI::deleteCommand(): cannot remove item from current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- if (idMatchFound) {
- break
- }
- }
- }
- console.debug("exit")
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- console.debug("enter: " + menuID + ", {" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}, " + appID)
- var app = getApplication(appID)
- var index = 0
- var count = app.options.count
- var subMenuToAddPosition
-
- if (count < Constants.maximumSubmenus) {
- if (menuParams.position !== undefined) {
- subMenuToAddPosition = menuParams.position
- } else {
- subMenuToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < count; i++) {
- if (subMenuToAddPosition >= app.options.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- app.options.insert(index, {
- "id": menuID,
- "name": menuParams.menuName,
- "position": subMenuToAddPosition,
- "type": Internal.MenuItemType.MI_SUBMENU,
- "icon": undefined,
- "subMenu": [{
- "id": -1,
- "name": menuParams.menuName,
- "position": -1,
- "type": Internal.MenuItemType.MI_PARENT,
- "icon": {
- "imageType": Common.ImageType.DYNAMIC,
- "value": "../res/nav/turnArrow.png"
- },
- "subMenu": getApplication(appID).options
- }]
- })
- }
- else {
- console.log("addSubMenu(): too many submenus, rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteSubMenu (menuID, appID) {
- console.debug("enter: " + menuID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if ((option.type === Internal.MenuItemType.MI_SUBMENU) && (option.id === menuID)) {
- if (option.subMenu !== currentApplication.currentSubMenu) {
- getApplication(appID).options.remove(optionIndex)
- }
- else {
- console.log("UI::deleteSubMenu(): cannot remove current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- console.debug("exit")
- }
-
- function setVrHelp (vrHelp) {
- this.vrHelp.clear()
- var index
- for (var i = 0; i < vrHelp.length; ++i) {
- index = 0
-// sort by simple inserts
- while ((index < this.vrHelp.count) && (this.vrHelp.get(index).position < vrHelp[i].position)) {
- ++index
- }
- this.vrHelp.insert(index, {
- "text": vrHelp[i].text,
- "icon": vrHelp[i].image ? vrHelp[i].image : {},
- "position": vrHelp[i].position
- })
- }
- }
-
- property NavigationModel navigationModel: NavigationModel { }
- property VehicleInfoModel vehicleInfoModel: VehicleInfoModel { }
- property ScrollableMessageModel scrollableMessageModel: ScrollableMessageModel { }
- property bool activeVR: false
-
- property InteractionModel interactionModel: InteractionModel {
- }
-
- property int driverDistractionState: Common.DriverDistractionState.DD_OFF
- onDriverDistractionStateChanged: {
- sdlUI.onDriverDistraction(driverDistractionState);
- }
- property bool activeTTS: false
- property variant activePopup
- property int popups: 0
-
- property bool activeAlert: false
-
- onActiveVRChanged: setSystemContext()
- onActiveAlertChanged: setSystemContext()
- onPopupsChanged: setSystemContext()
-
- function setSystemContext () {
- console.debug("enter")
- if (popups > 0) {
- systemContext = Common.SystemContext.SYSCTXT_HMI_OBSCURED
- }
- else if (activeAlert) {
- systemContext = Common.SystemContext.SYSCTXT_ALERT
- }
- else if (activeVR) {
- systemContext = Common.SystemContext.SYSCTXT_VRSESSION
- }
- else if (contentLoader.item !== null) {
- systemContext = contentLoader.item.systemContext
- }
- console.debug("exit")
- }
- property MusicSourceModel musicSourceModel: MusicSourceModel {
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml b/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml
deleted file mode 100644
index 8da8a035db..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/InteractionModel.qml
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @file InteractionModel.qml
- * @brief Interaction model.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Async.js" as Async
-
-QtObject {
- property string initialText
- property ListModel choice: ListModel {
- }
- property int timeout
- property variant async
-
- function performInteraction (initialText, choiceSet, vrHelp, timeout, appID) {
- console.debug("enter")
- this.initialText = initialText.fieldText
- choice.clear()
- for (var i = 0; i < choiceSet.length; ++i) {
- choice.append({"id": choiceSet[i].choiceID, "name": choiceSet[i].menuName ? choiceSet[i].menuName : "choiceID = " + choiceSet[i].choiceID, image: choiceSet[i].image})
- }
- this.timeout = timeout
- interactionPopup.activate()
- async = new Async.AsyncCall()
- console.debug("exit")
- return async
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/Internal.js b/src/components/qt_hmi/qml_model_qt4/models/Internal.js
deleted file mode 100644
index 4a1ebc625a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/Internal.js
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-var MenuItemType = {
- MI_NODE: 0,
- MI_SUBMENU: 1,
- MI_PARENT: 2
-}
-
-function activePageChoose(flickElement, pages) {
- if (flickElement.contentX <= 0) {
- return 0
- }
- else if ( (flickElement.contentWidth - flickElement.contentX) < flickElement.width) {
- return pages -1
- }
- else {
- if ( (flickElement.contentX % flickElement.width) >= (1/6 * flickElement.width)) {
- return Math.ceil(flickElement.contentX / flickElement.width)
- }
- else if ( (flickElement.contentX % flickElement.width) > 0) {
- return Math.floor(flickElement.contentX / flickElement.width)
- }
- }
-}
-
-var MediaClockUpdateMode = {
- MCU_COUNTUP: 0,
- MCU_COUNTDOWN: 1,
-}
-
-var MediaClockRunningMode = {
- MCR_RUNNING: 0,
- MCR_STOPPED: 1
-}
-
-function appendVrHelpItem (arrayElement, index, array) {
- this.append({
- text: arrayElement.text,
- image: arrayElement.image ? arrayElement.image : "",
- position: arrayElement.position
- })
-}
-
-function checkBit(value, bitPosition) {
- return (value & (1 << bitPosition))
-}
-
-function getArrayForPresetRow() {
- var array = []
- for (var i = 0; i < dataContainer.currentApplication.customPresets.count; i++) {
- array.push(dataContainer.currentApplication.customPresets.get(i).text)
- }
- return array
-}
-
-function pad (string, length, lead) {
- if (!lead) {
- lead = '0'
- }
- var paddedString = "" + string
- while (paddedString.length < length) {
- paddedString = lead + paddedString
- }
- return paddedString
-}
-
-function hmsTime (hours, minutes, seconds) {
- return 60 * (60 * hours + minutes) + seconds
-}
-
-function hmsTimeToString (hmsTime) {
- if (hmsTime === -1) {
- return "0:00:00"
- }
-
- var _time = hmsTime
- var seconds = _time % 60
- _time -= seconds
- _time /= 60
- var minutes = _time % 60
- _time -= minutes
- _time /= 60
- var hours = _time
- var string = ""
- string += hours
- string += ":"
- string += pad(minutes, 2)
- string += ":"
- string += pad(seconds, 2)
- return string
-}
-
-function stringToHmsTime (hmsString) {
- console.debug("enter: \"" + hmsString + "\"")
- var substrings = hmsString.split(":")
- var seconds = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (seconds >= 60) {
- console.log("incorrect field \"seconds\": " + seconds)
- console.debug("exit")
- return 0
- }
- var minutes = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (minutes >= 60) {
- console.log("incorrect field \"minutes\": " + minutes)
- console.debug("exit")
- return 0
- }
- var hours = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- console.debug("exit")
- return hmsTime(hours, minutes, seconds)
-}
-
-function mediaClockUpdateModeToString (mediaClockUpdateMode) {
- switch (mediaClockUpdateMode) {
- case MediaClockUpdateMode.MCU_COUNTUP:
- return "Internal.MediaClockUpdateMode.MCU_COUNTUP"
- case MediaClockUpdateMode.MCU_COUNTDOWN:
- return "Internal.MediaClockUpdateMode.MCU_COUNTDOWN"
- default:
- return ""
- }
-}
-
-function mediaClockRunningModeToString (mediaClockRunningMode) {
- switch (mediaClockRunningMode) {
- case MediaClockRunningMode.MCR_RUNNING:
- return "Internal.MediaClockRunningMode.MCR_RUNNING"
- case MediaClockRunningMode.MCR_STOPPED:
- return "Internal.MediaClockRunningMode.MCR_STOPPED"
- default:
- return ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml
deleted file mode 100644
index 49b4e7fb9a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/MainMenuListModel.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file MainMenuListModel.qml
- * @brief Main menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-ListModel
-{
- ListElement {
- name: "Climate"
- icon: "../res/snow.png"
- qml: "./views/ClimateControlView.qml"
- }
-
- ListElement {
- name: "Navigation"
- icon: "../res/arrow.png"
- qml: "./views/NavigationNoRouteGridView.qml"
- }
-
- ListElement {
- name: "Media"
- icon: "../res/notes.png"
- qml: "./views/MusicSourceView.qml"
- }
-
- ListElement {
- name: "Preferences"
- icon: "../res/gear.png"
- qml: ""
- }
-
- ListElement {
- name: "Apps"
- icon: "../res/apps.png"
- qml: "./views/ApplicationListView.qml"
- }
-
- ListElement {
- name: "Phone"
- icon: "../res/phone/phone.png"
- qml: "./views/PhoneMenuGridView.qml"
- }
-
- ListElement {
- name: "Car"
- icon: "../res/car.png"
- qml: "./views/CarMenuGridView.qml"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml
deleted file mode 100644
index 8f062008a4..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/MediaClockModel.qml
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * @file MediaClockModel.qml
- * @brief Media clock model
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "Internal.js" as Internal
-
-QtObject {
- property int updateMode
- property int runningMode
- property int startTime
- property int endTime
- property int upperTimeLimit: 60 * 60 * 60 - 1
- property int startTimeForProgress
- property real progress
-
- property Timer timer: Timer {
- id: timer
- interval: 1000
- repeat: true
- onTriggered: onTimer()
- }
- onRunningModeChanged: {
- if (runningMode === Internal.MediaClockRunningMode.MCR_STOPPED) {
- timer.stop()
- } else {
- timer.start()
- }
- }
-
- onStartTimeChanged: {
- 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)
- }
- }
- }
-
- 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")
- }
- } else {
- if (startTime < upperTimeLimit) {
- startTime++
- } else {
- startTime = 0
- }
- }
- break
- case Internal.MediaClockUpdateMode.MCU_COUNTDOWN:
- console.debug("count down")
- if (--startTime === 0) {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- startTime = endTime = -1
- console.debug("count Down timer stopped")
- }
- break
- }
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- "mediaClock": {startTime: startTime,
- endTime: endTime,
- updateMode: updateMode,
- runningMode: runningMode,
- startTimeForProgress: startTimeForProgress
- }
- })
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml b/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml
deleted file mode 100644
index b01c4cf834..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/MusicSourceModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file MusicSourceModel.qml
- * @brief Music source menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-ListModel
-{
- ListElement {
- title: "FM"
- qml: "./views/FMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "AM"
- qml: "./views/AMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "BT Audio"
- qml: "./views/BTPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "Sirius"
- qml: "./views/SiriusPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "CD"
- qml: "./views/CDPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "iPod"
- qml: "./views/IPodPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "USB"
- qml: "./views/UsbPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "LineIn"
- qml: "./views/LineInPlayerView.qml"
- appId: 0
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml
deleted file mode 100644
index 963225719e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/NavigationMenuModel.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @file NavigationMenuModel.qml
- * @brief Music source menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-ListModel
-{
- ListElement {
- title: "Home"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Keyboard"
- icon: "../res/buttons/long_oval_btn.png"
- qml: "./views/NavigationKeyboardView.qml"
- }
- ListElement {
- title: "Favorites"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Work"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Recent"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "POI"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Scout"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Waze"
- icon: "../res/buttons/long_oval_btn.png"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml b/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml
deleted file mode 100644
index f9203875d3..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/NavigationModel.qml
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * @file NavigationModel.qml
- * @brief Model for Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-QtObject {
- property string text1: ""
- property string text2: ""
- property string totalDistance: ""
- property string eta: ""
- property string timeToDestination: ""
- property variant turnIcon
- property variant nextTurnIcon
-
- property real distanceToManeuver: 0
- property real distanceToManeuverScale: 0
- property bool maneuverComplete
- property ListModel softButtons: ListModel {}
- property int appId: -1
- property ListModel alertManeuverSoftButtons: ListModel {}
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml b/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml
deleted file mode 100644
index 8b861d37a2..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/PerformAudioPassThruModel.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * @file PerformAudioPassThruModel.qml
- * @brief Data model audio pass thru.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-QtObject {
- property string appName: ""
- property string firstLine: ""
- property string secondLine: ""
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml b/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml
deleted file mode 100644
index a191f46e46..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/PhoneMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file PhoneMenuModel.qml
- * @brief Phone menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-ListModel
-{
- ListElement {
- name: "phone"
- icon: "../res/phone/phone.png"
- qml: ""
- }
- ListElement {
- name: "contacts"
- icon: "../res/phone/contacts.png"
- qml: "./views/PhoneKeyboardView.qml"
- }
- ListElement {
- name: "messages"
- icon: "../res/phone/messages.png"
- qml: ""
- }
- ListElement {
- name: "DND"
- icon: "../res/phone/dnd_off.png"
- qml: ""
- }
- ListElement {
- name: "texts"
- icon: "../res/phone/texts.png"
- qml: ""
- }
- ListElement {
- name: "recent"
- icon: "../res/phone/recent.png"
- qml: ""
- }
- ListElement {
- name: "keyboard"
- icon: "../res/phone/keypad.png"
- qml: ""
- }
- ListElement {
- name: "more"
- icon: "../res/phone/more.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml b/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml
deleted file mode 100644
index bbacd49f8c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/PlayerState.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * @file PlayerState.qml
- * @brief List of parameters for each player.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-// Player state for all players except SDL media player
-Item {
- // Media players
- property string playPauseState
- property string albumImage
- property string trackNumber
- property int songPosition
- property string trackName
-
- // Radio Players
- property variant presets: []
-
- // Both players
- property string songName
- property string albumName
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml b/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml
deleted file mode 100644
index 6fd441ac3d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/ScrollableMessageModel.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file ScrollableMessageModel.qml
- * @brief Model for Scrollable Message.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- property string longMessageText: "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh"
- property ListModel softButtons: ListModel {}
- property int appId: -1
- property int timeout: 0
- property variant async
- property bool running: false
-
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml b/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml
deleted file mode 100644
index 7fb6cfcdd6..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/SettingsStorage.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * @file SettingsStorage.qml
- * @brief Storage for keeping settings.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item
-{
- property variant sdlLanguagesList: [
- Common.Language.EN_US,
- Common.Language.ES_MX,
- Common.Language.FR_CA,
- Common.Language.DE_DE,
- Common.Language.ES_ES,
- Common.Language.EN_GB,
- Common.Language.RU_RU,
- Common.Language.TR_TR,
- Common.Language.PL_PL,
- Common.Language.FR_FR,
- Common.Language.IT_IT,
- Common.Language.SV_SE,
- Common.Language.PT_PT,
- Common.Language.NL_NL,
- Common.Language.ZH_TW,
- Common.Language.JA_JP,
- Common.Language.AR_SA,
- Common.Language.KO_KR,
- Common.Language.PT_BR,
- Common.Language.CS_CZ,
- Common.Language.DA_DK,
- Common.Language.NO_NO
- ]
-
- property variant displayCapabilities: {
- "displayType": Common.DisplayType.GEN2_8_DMA,
- "textFields": [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack,
- Common.TextFieldName.alertText1,
- Common.TextFieldName.alertText2,
- Common.TextFieldName.alertText3,
- Common.TextFieldName.scrollableMessageBody,
- Common.TextFieldName.initialInteractionText,
- Common.TextFieldName.navigationText1,
- Common.TextFieldName.navigationText2,
- Common.TextFieldName.ETA,
- Common.TextFieldName.totalDistance,
- Common.TextFieldName.navigationText,
- Common.TextFieldName.audioPassThruDisplayText1,
- Common.TextFieldName.audioPassThruDisplayText2,
- Common.TextFieldName.sliderHeader,
- Common.TextFieldName.sliderFooter,
- Common.TextFieldName.notificationText
- ],
- "mediaClockFormats": [
- Common.MediaClockFormat.CLOCK1,
- Common.MediaClockFormat.CLOCK2,
- Common.MediaClockFormat.CLOCK3,
- Common.MediaClockFormat.CLOCKTEXT1,
- Common.MediaClockFormat.CLOCKTEXT2,
- Common.MediaClockFormat.CLOCKTEXT3,
- Common.MediaClockFormat.CLOCKTEXT4
- ],
- "graphicSupported": true,
- "imageCapabilities": [ Common.ImageType.DYNAMIC ],
- "templatesAvailable": [ "" ],
- "screenParams": {
- "resolution": {
- "resolutionWidth": 800,
- "resolutionHeight": 480
- },
- "touchEventAvailable": {
- "pressAvailable": true,
- "multiTouchAvailable": true,
- "doublePressAvailable": true
- }
- },
- "numCustomPresetsAvailable": 6
- }
-
- property variant softButtonCapabilities: {
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true,
- "imageSupported": true
- }
-
- property variant buttonCapabilities: []
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml b/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml
deleted file mode 100644
index d335c9eb2a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/SliderModel.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file SliderModel.qml
- * @brief Data model 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 QtQuick 1.1
-
-QtObject {
- property string appName: ""
- property string header: ""
- property variant footer: []
- property int numTicks: 0
- property int position: 0
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml b/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml
deleted file mode 100644
index f5c309880c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/models/VehicleInfoModel.qml
+++ /dev/null
@@ -1,234 +0,0 @@
-/**
- * @file VehicleInfoModel.qml
- * @brief Data model for vehicle info.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- id: vehicleInfo
- property real speed: 80.1
- property int rpm: 5000
- property real fuelLevel: 0.2
- property int fuelLevel_State: Common.ComponentVolumeStatus.CVS_LOW
- property real instantFuelConsumption: 2.2
- property int driverBraking: Common.VehicleDataEventStatus.VDES_NO_EVENT
- property int wiperStatus: Common.WiperStatus.OFF
- property real engineTorque: 2.5
- property real accPedalPosition: 0.5
- property real steeringWheelAngle: 1.2
- property real externalTemperature: 40.0
- property string vin: '52-452-52-752'
- property int odometer: 2
- property int prndl: Common.PRNDL.FIFTH
-
- property variant headLampStatus: {
- "lowBeamsOn": false,
- "highBeamsOn": false,
- "ambientLightSensorStatus": Common.AmbientLightStatus.TWILIGHT_1
- }
- property variant deviceStatus: {
- 'voiceRecOn': false,
- 'btIconOn': false,
- 'callActive': false,
- 'phoneRoaming': false,
- 'textMsgAvailable': false,
- 'battLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'stereoAudioOutputMuted': false,
- 'monoAudioOutputMuted': false,
- 'signalLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'primaryAudioSource': Common.PrimaryAudioSource.NO_SOURCE_SELECTED,
- 'eCallEventActive': false
- }
- property variant bodyInformation: {
- 'parkBrakeActive': false,
- 'ignitionStableStatus': Common.IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE,
- 'ignitionStatus': Common.IgnitionStatus.IS_UNKNOWN
- }
- property variant beltStatus: {
- 'driverBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'driverBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerChildDetected': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- }
- property variant tirePressure: {
- 'pressureTelltale': Common.WarningLightStatus.WLS_ON,
- 'leftFront': { status: Common.ComponentVolumeStatus.CVS_NORMAL},
- 'rightFront': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'leftRear': { status: Common.ComponentVolumeStatus.CVS_NORMAL },
- 'rightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerLeftRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerRightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN }
- }
- property variant gps: {
- 'longitudeDegrees': 42.3293,
- 'latitudeDegrees': -83.0464,
- 'utcYear': 2013,
- 'utcMonth': 2,
- 'utcDay': 14,
- 'utcHours': 13,
- 'utcMinutes': 16,
- 'utcSeconds': 54,
- 'compassDirection': Common.CompassDirection.SOUTHWEST,
- 'pdop': 4,
- 'hdop': 5,
- 'vdop': 6,
- 'actual': false,
- 'satellites': 8,
- 'dimension': Common.Dimension.Dimension_2D,
- 'altitude': 7,
- 'heading': 173,
- 'speed': 2
- }
- property variant ecuDIDData: {
- 'data1': 'ECU 1 Test Data',
- 'data2': 'ECU 2 Test Data'
- }
- property variant eCallInfo: {
- "eCallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_NORMAL,
- "auxECallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_ACTIVE,
- "eCallConfirmationStatus" : Common.ECallConfirmationStatus.ECCS_NORMAL
- }
- property variant airbagStatus: {
- "driverAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO_EVENT,
- "driverSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "driverCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED,
- "passengerCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_FAULT,
- "driverKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "passengerSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED
- }
- property variant emergencyEvent: {
- "emergencyEventType" : Common.EmergencyEventType.EET_NO_EVENT,
- "fuelCutoffStatus" : Common.EmergencyEventType.EET_FRONTAL,
- "rolloverEvent" : Common.EmergencyEventType.EET_SIDE,
- "maximumChangeVelocity" : Common.EmergencyEventType.EET_REAR,
- "multipleEvents" : Common.EmergencyEventType.EET_ROLLOVER
- }
- property variant clusterModeStatus: {
- "powerModeActive" : true,
- "powerModeQualificationStatus" : Common.PowerModeQualificationStatus.POWER_MODE_UNDEFINED,
- "carModeStatus" : Common.CarModeStatus.CMS_NORMAL,
- "powerModeStatus" : Common.PowerModeStatus.KEY_OUT
- }
- property variant myKey: {
- "e911Override": Common.VehicleDataStatus.VDS_NO_DATA_EXISTS
- }
-
-
- function sendGpsChange(){
- sdlVehicleInfo.onGps(vehicleInfo.gps)
- }
- function sendSpeedChange(){
- sdlVehicleInfo.onSpeed(vehicleInfo.speed)
- }
- function sendRpmChange(){
- sdlVehicleInfo.onRpm(vehicleInfo.rpm)
- }
- function sendFuelLevelChange(){
- sdlVehicleInfo.onFuelLevel(vehicleInfo.fuelLevel)
- }
- function sendFuelLevel_StateChange(){
- sdlVehicleInfo.onFuelLevel_State(vehicleInfo.fuelLevel_State)
- }
- function sendInstantFuelConsumptionChange(){
- sdlVehicleInfo.onInstantFuelConsumption(vehicleInfo.instantFuelConsumption)
- }
- function sendExternalTemperatureChange(){
- sdlVehicleInfo.onExternalTemperature(vehicleInfo.externalTemperature)
- }
- function sendPrndlChange() {
- if (dataContainer.vehicleInfoModel.prndl !== -1)
- {sdlVehicleInfo.onPrndl(vehicleInfo.prndl)}
- }
- function sendTirePressureChange(){
- sdlVehicleInfo.onTirePressure(vehicleInfo.tirePressure)
- }
- function sendOdometerChange(){
- sdlVehicleInfo.onOdometer(vehicleInfo.odometer)
- }
- function sendBeltStatusChange(){
- sdlVehicleInfo.onBeltStatus(vehicleInfo.beltStatus)
- }
- function sendBodyInformationChange(){
- sdlVehicleInfo.onBodyInformation(vehicleInfo.bodyInformation)
- }
- function sendDeviceStatusChange(){
- sdlVehicleInfo.onDeviceStatus(vehicleInfo.deviceStatus)
- }
- function sendDriverBrakingChange(){
- sdlVehicleInfo.onDriverBraking(vehicleInfo.driverBraking)
- }
- function sendWiperStatusChange(){
- sdlVehicleInfo.onWiperStatus(vehicleInfo.wiperStatus)
- }
- function sendHeadLampStatusChange(){
- sdlVehicleInfo.onHeadLampStatus(vehicleInfo.headLampStatus)
- }
- function sendEngineTorqueChange(){
- sdlVehicleInfo.onEngineTorque(vehicleInfo.engineTorque)
- }
- function sendAccPedalPositionChange(){
- sdlVehicleInfo.onAccPedalPosition(vehicleInfo.accPedalPosition)
- }
- function sendSteeringWheelAngleChange(){
- sdlVehicleInfo.onSteeringWheelAngle(vehicleInfo.steeringWheelAngle)
- }
- function sendECallInfoChange(){
- sdlVehicleInfo.onECallInfo(vehicleInfo.eCallInfo)
- }
- function sendAirbagStatusChange(){
- sdlVehicleInfo.onAirbagStatus(vehicleInfo.airbagStatus)
- }
- function sendEmergencyEventChange(){
- sdlVehicleInfo.onEmergencyEvent(vehicleInfo.emergencyEvent)
- }
- function sendClusterModeStatusChange(){
- sdlVehicleInfo.onClusterModeStatus(vehicleInfo.clusterModeStatus)
- }
- function sendMyKeyChange(){
- sdlVehicleInfo.onMyKey(vehicleInfo.myKey)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml b/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml
deleted file mode 100644
index 70e7ba29ef..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/AlertWindow.qml
+++ /dev/null
@@ -1,285 +0,0 @@
-/**
- * @file AlertWindow.qml
- * @brief Alert popup window
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: alertWindow
- property date lastAlertTime
- property variant softButtons
- property int appId
- property string popUpName // TODO{ALESHIN}: No requerments for closePopUp, if alert couldn't be closed by closePopUp request - delete everywhere
-
- color: "transparent"
-
- property variant async
-
- Rectangle {
- id: rectangle
-
- anchors.centerIn: parent
- color: "black"
- border.color: "white"
-
- width: alertContent.width + 60
- height: alertContent.height + 60
-
- property alias alertString: alert.text
- property alias appNameString: appName.text
- property int duration
-
- Column {
- id: alertContent
- anchors.centerIn: parent
- spacing: 20
-
- Text {
- id: appName
- anchors.horizontalCenter: parent.horizontalCenter
- color: "white"
- font.pointSize: 16
- }
-
- Row {
- width: Constants.alertWidth
- spacing: 20
-
- Image {
- id: alertLogo
- source: "../res/warning.png"
- }
-
- Text {
- id: alert
- width: parent.width - alertLogo.width - parent.spacing
- clip: true
- color: "white"
- font.pointSize: 16
- }
- }
-
- Rectangle {
- id: progressIndicator
- color: "white"
- height: 10
- }
-
- Column {
- Item {
- width: Constants.alertWidth
- height: alertButton1.visible ? alertButton1.height : 0
-
- SoftButton {
- id: alertButton1
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 0 ? softButtons[0] : undefined
- anchors.left: parent.left
- anchors.right: alertButton2.visible ? alertButton2.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- SoftButton {
- id: alertButton2
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 1 ? softButtons[1] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- }
- Item {
- width: Constants.alertWidth
- height: alertButton3.visible ? childrenRect.height : 0
- SoftButton {
- id: alertButton3
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 2 ? softButtons[2] : undefined
- anchors.left: parent.left
- anchors.right: alertButton4.visible ? alertButton4.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- SoftButton {
- id: alertButton4
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 3 ? softButtons[3] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- contentLoader.go("views/SDLPlayerView.qml", appId);
- alertWindow.complete(Common.Result.SUCCESS);
- }
- }
- }
- }
- }
-
- SequentialAnimation {
- id: animation
- PropertyAction { target: progressIndicator; property: "width"; value: alertContent.width }
- PropertyAnimation {
- id: shrinkProgressAnimation
- target: progressIndicator
- property: "width"
- to: 0
- duration: rectangle.duration
- }
- }
- }
-
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- function alert (alertStrings, duration, showIndicator, sButtons, applicationId) {
- if (timer.running) { // we have alert already
- var currentTime = new Date()
- var timeFromLastAlert = currentTime - lastAlertTime
- var timeLeft = timer.interval - timeFromLastAlert
- var discreteInMilliseconds = 1000 // wish to round left time to integer seconds
- var timeLeftRounded = discreteInMilliseconds * Math.ceil(timeLeft / discreteInMilliseconds)
- return timeLeftRounded
- }
- else {
- lastAlertTime = new Date();
- appId = applicationId
- rectangle.appNameString = dataContainer.getApplication(appId).appName;
- softButtons = sButtons;
- rectangle.alertString = alertStrings.join('\n');
- timer.interval = duration;
- rectangle.duration = duration;
- timer.start();
- show();
-
- progressIndicator.visible = !!showIndicator
- progressIndicator.width = alertContent.width
- console.log("ProgressIndicator.width:", progressIndicator.width)
- animation.start()
- }
- }
-
- function show () {
- dataContainer.activeAlert = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- visible = true
- }
-
- function complete (reason, data) {
- if (!keep) {
- hide()
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(async, { __retCode: Common.Result.SUCCESS, __message: "UI.Alert" })
- break
- // For other cases
- }
- }
- timer.stop()
- }
-
- function hide() {
- console.debug(popUpName, "HIDE")
- dataContainer.activeAlert = false
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- visible = false
- }
-
- function restart() {
- animation.restart();
- timer.restart();
- }
-
- property bool keep: false
-
- onKeepChanged: {
- if (visible && !keep && !timer.running) {
- hide()
- }
- }
-
- onVisibleChanged: {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml
deleted file mode 100644
index a1ef64144d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/ContextPopup.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file ContextPopup.qml
- * @brief Popup view with system context.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-
-PopUp {
- function show() {
- console.debug("enter")
- if (!visible) { // must not increment counter if show() called for visible popup
- visible = true;
- dataContainer.popups++
- }
- console.debug("exit")
- }
-
- function hide() {
- console.debug("enter")
- console.debug(popUpName, "HIDE")
- if (visible) { // must not decrement counter if hide() called for invisible popup
- visible = false;
- dataContainer.popups--
- }
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml
deleted file mode 100644
index 17e5de50b7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/ExitAllApplicationsPopup.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-PopUp {
- function complete(reason){
- hide()
- }
-
- Item {
- ListModel {
- id: reasonExit
-
- Component.onCompleted: {
- for (var name in Common.ApplicationsCloseReason) {
- append({name: name});
- }
- }
- }
- }
-
- Column
- {
- anchors.centerIn: parent
- Row {
- Text {
- text: "Select reason: "
- color: "white"
- }
-
- ComboBox {
- id: reasonComboBox
- model: reasonExit
- }
- z: 1000
- }
- OvalButton {
- text: "Exit"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- sdlBasicCommunication.onExitAllApplications(Common.ApplicationsCloseReason[reasonComboBox.currentText])
- hide()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml
deleted file mode 100644
index 7a5c53501e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/InteractionPopup.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * @file InteractionPopup.qml
- * @brief Interaction popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-ContextPopup {
- Text {
- id: initialText
- text: dataContainer.interactionModel.initialText
- anchors.top: parent.top
- anchors.topMargin: Constants.popupMargin
- anchors.left: parent.left
- anchors.leftMargin: Constants.popupMargin
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- ListView {
- anchors.top: initialText.bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- model: dataContainer.interactionModel.choice
- delegate: OvalButton {
- width: parent.width
- text: name
- icon: image
- onClicked: {
- complete(Common.Result.SUCCESS, {"choiceID": id})
- }
- }
- }
-
- Item {
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.TIMED_OUT)
- }
- }
- }
-
- function activate () {
- console.debug("enter")
- timer.interval = dataContainer.interactionModel.timeout
- timer.start()
- show()
- console.debug("exit")
- }
-
- function complete (reason, data) {
- console.debug("enter")
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(dataContainer.interactionModel.async, data)
- break
- case Common.Result.ABORTED:
- DBus.sendReply(dataContainer.interactionModel.async, { __retCode: Common.Result.ABORTED })
- break
- case Common.Result.TIMED_OUT:
- DBus.sendReply(dataContainer.interactionModel.async, { __retCode: Common.Result.TIMED_OUT })
- break
- }
- timer.stop()
- hide()
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml
deleted file mode 100644
index e65519d363..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/PerformAudioPassThruPopup.qml
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- * @file PerformAudioPassThruPopup.qml
- * @brief Popup for audio pass thru
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property variant async
-
- function showAudioPassThru(){
- console.debug("entered")
- dataContainer.uiAudioPassThru.running = true
- show()
- if (dataContainer.uiAudioPassThru.timeout) {
- timer.start()
- }
- console.debug("exited")
- }
-
- function complete(reason){
- console.debug("enter", reason)
- timer.stop()
- dataContainer.uiAudioPassThru.timeout = 0
- dataContainer.uiAudioPassThru.running = false
- switch (reason) {
- case Common.Result.ABORTED:
- console.debug("exit with abort")
- DBus.sendError(async, Common.Result.ABORTED)
- break;
- case Common.Result.SUCCESS:
- console.debug("exit with success")
- DBus.sendReply(async, {})
- break;
- case Common.Result.RETRY:
- console.debug("exit with retry")
- DBus.sendError(async, Common.Result.RETRY)
- break;
- }
- hide()
- }
-
-
- Column {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiAudioPassThru.timeout
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Row {
- spacing: Constants.generalSpacing
- Image {
- source: "../res/controlButtons/vrImage.png"
- }
-
- Column {
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.firstLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.secondLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: Constants.generalSpacing
-
- OvalButton {
- text: "Retry"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.RETRY)
- }
- }
-
- OvalButton {
- text: "Done"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.SUCCESS)
- }
- }
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml
deleted file mode 100644
index 07f8c98011..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/PopUp.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file PopUp.qml
- * @brief General popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-Item {
- default property alias content: content.children
- property int padding: Constants.popUpPadding
- property string popUpName
-
- visible: false
-
- width: Constants.popupWidth
- height: Constants.popupHeigth
-
- MouseArea { anchors.fill: parent }
-
- Rectangle {
- width: parent.width - padding / 2
- height: parent.height - padding / 2
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.secondaryColor
- border.width: 1
- border.color: Constants.popUpBorderColor
- radius: padding
- Rectangle {
- id: content
- width: parent.width - padding
- height: parent.height - padding
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.transparentColor
- }
- }
-
- onVisibleChanged: {
- if (popUpName) {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
- }
-
- function show() {
- console.debug("enter");
- visible = true;
- console.debug("exit");
- }
-
- function hide() {
- console.debug("enter");
- visible = false;
- console.debug("exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml
deleted file mode 100644
index 6dcd222ed3..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/SliderPopup.qml
+++ /dev/null
@@ -1,214 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property variant async
- property int position: 1
- /**
- * Test Support Section
- */
- property int resultCode: -1
- signal onReady
- /**
- * Test Support Section End
- */
-
- function showSlider(){
- console.debug("enter")
-
- dataContainer.uiSlider.running = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- if(dataContainer.uiSlider.footer.length === 0 || dataContainer.uiSlider.position === 0 ) {
- footerText.text = ""
- } else {
- footerText.text = dataContainer.uiSlider.footer.length === 1 ? dataContainer.uiSlider.footer[0] : dataContainer.uiSlider.footer[dataContainer.uiSlider.position - 1]
- }
- position = dataContainer.uiSlider.position
- show()
- timer.start()
- onReady()
- console.debug("exit")
- }
-
- function complete(reason){
- console.debug("enter reason = ", reason)
- timer.stop()
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- dataContainer.uiSlider.running = false
- switch(reason) {
- case Common.Result.ABORTED:
- console.debug("aborted position is", position)
- resultCode = Common.Result.ABORTED
- DBus.sendReply(async, {__retCode: resultCode, sliderPosition: position})
- break
- case Common.Result.SUCCESS:
- console.debug("send position", position)
- resultCode = Common.Result.SUCCESS
- dataContainer.uiSlider.position = position
- DBus.sendReply(async, {sliderPosition:position})
- break
- default:
- break
- }
- hide()
- position = 1
- console.debug("exit")
- }
-
-
- Column
- {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiSlider.timeout
- onTriggered: {
- console.debug("triggered")
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Text {
- id: headerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.header
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Rectangle {
- id: borderRectangle
- width: Constants.sliderBarWidth
- height: Constants.sliderBarHeight
- anchors.horizontalCenter: parent.horizontalCenter
- border.color: Constants.sliderBarBorderColor
- border.width: Constants.sliderBarBorderWidth
- radius: Constants.sliderBarRadius
- color: "black"
-
- Rectangle {
- id: rectangle
- color: Constants.sliderBarFillColor
- height: parent.height
- border.color: parent.border.color
- border.width: parent.border.width
- radius: parent.radius
-
- onVisibleChanged: {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- rectangle.width = dataContainer.uiSlider.position * tickWidth
- }
- }
-
- MouseArea{
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- onPositionChanged(mouse)
- }
-
- onPositionChanged: {
- if(mouseX <= 0){
- rectangle.width = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = 1
- }
-
- if(mouseX > borderRectangle.width) {
- rectangle.width = borderRectangle.width
- position = dataContainer.uiSlider.numTicks
- }
-
- if(mouseX > 0 && mouseX < borderRectangle.width) {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = Math.ceil(mouseX / tickWidth)
- rectangle.width = position * tickWidth
- }
-
- if(dataContainer.uiSlider.footer.length > 1){
- footerText.text = dataContainer.uiSlider.footer[position - 1]
- }
- }
- }
- }
-
- Text {
- id:footerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: ""
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-
- function getTimer() {
- return timer
- }
- function getBackButton() {
- return backButton
- }
- function getFooterText() {
- return footerText
- }
- function getBorderRectangle() {
- return borderRectangle
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml
deleted file mode 100644
index 9a833b19e7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/TBTClientStatePopUp.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * @file TBTClientStatePopUp.qml
- * @brief Popup view for TBT interface (list of states).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-PopUp {
- Item {
- ListModel {
- id: tbtState
-
- Component.onCompleted: {
- for (var name in Common.TBTState) {
- append({name: name});
- }
- }
- }
- }
- Text {
- text: "TBT Client State"
- verticalAlignment: Text.AlignVCenter
- anchors.right: parent.right
- anchors.left: parent.left
- anchors.top: parent.top
- color: Constants.primaryColor
- }
- ComboBox {
- id: comboBox
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- model: tbtState
- onCurrentTextChanged: {
- console.log("Send signal onTBTClientState:", currentText);
- sdlNavigation.onTBTClientState(Common.TBTState[currentText]);
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml
deleted file mode 100644
index ce64a6be89..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/TTSPopUp.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file TTSPopUp.qml
- * @brief Popup view for TTS
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-PopUp {
- height: Constants.ttsPopUpHeight
- width: Constants.ttsPopUpWidth
- padding: Constants.ttsPopUpPadding
- property variant async
-
- ScrollableText {
- id: text
- anchors.fill: parent
- }
-
- resources: [
- Timer {
- id: timer
- interval: Constants.ttsSpeakTime
- onTriggered: deactivate()
- }
- ]
-
- function activate(message) {
- console.debug("Activate TTS popup:", message);
- dataContainer.activeTTS = true;
- text.text = message;
- show();
- timer.restart();
- console.debug("Exit");
- }
-
- function deactivate() {
- console.debug("Deactivate TTS popup");
- dataContainer.activeTTS = false;
- text.text = '';
- timer.stop();
- hide();
- DBus.sendReply(async, {});
- async = null;
- console.debug("Exit");
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml b/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml
deleted file mode 100644
index 8718c8cd69..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/VRHelpPopup.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * @file VRHelpPopup.qml
- * @brief Popup view for VR help
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-PopUp {
- Text {
- id: title
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- text: "VR HELP" // default title
- font.pixelSize: Constants.titleFontSize
- color: Constants.primaryColor
- }
-
- ScrollableListView {
- anchors.top: title.bottom
- anchors.bottom: closeButton.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
-
- model: dataContainer.vrHelp
-
- delegate: Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.icon
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- }
-
- Text {
- text: model.text
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
- OvalButton {
- id: closeButton
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: Constants.popupMargin
- width: Constants.ovalButtonWidth
- text: "Close"
- onClicked: complete()
- }
-
- property alias title: title.text
-
- function complete(reason, data) {
- hide()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml
deleted file mode 100644
index 8a8be54be7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/VRPopUp.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * @file VRPopUp.qml
- * @brief Popup view for VR interface (list commands).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../controls"
-
-PopUp {
- Text {
- id: title
- anchors.left: parent.left
- anchors.top: parent.top
- height: voice.height
- width: parent.width - voice.width
- text: "Speak the command"
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Image {
- id: voice
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/controlButtons/vrImage.png"
- }
-
- ScrollableListView {
- anchors.bottomMargin: Constants.popupMargin
- anchors.rightMargin: Constants.popupMargin
- anchors.leftMargin: Constants.popupMargin
- anchors.top: voice.bottom
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.left: parent.left
-
- model: dataContainer.vrCommands
-
- delegate: OvalButton {
- width: parent.width
- text: command
- onClicked: {
- sdlVR.onCommand(cmdID, appID === 0 ? undefined : appID);
- }
- }
- }
-
- function activate() {
- dataContainer.activeVR = true;
- sdlVR.started();
- show();
- }
-
- function complete(reason) {
- dataContainer.activeVR = false;
- sdlVR.stopped();
- hide();
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml b/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml
deleted file mode 100644
index f4582c28ca..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/popups/VehicleInfoPopUp.qml
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * @file VIPopUp.qml
- * @brief Pop up window with information about vehicle.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-PopUp {
- //TODO{ALeshin}: Redraw this window as ListView or Column, when we'll get requirements
- Column {
- anchors.fill: parent
- Text {
- id: viText
- width: parent.width
- height: 1/5 * parent.height
- text: "Vehicle Information"
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- }
-
- Row {
- height: 1/5 * parent.height
- width: parent.width
-
- Text {
- width: 1/4 * parent.width
- height: 1/5 * parent.height
- anchors.verticalCenter: parent.verticalCenter
- text: "PRNDL: "
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- ComboBox {
- anchors.verticalCenter: parent.verticalCenter
- id: comboBox
- model: prndlList
-
- onCurrentIndexChanged: {
- console.debug("PRNDL:", currentIndex)
- dataContainer.vehicleInfoModel.prndl = model.get(currentIndex).id
- }
-
- textRole: "name"
- ListModel {
- id: prndlList
- Component.onCompleted: {
- append({ id: -1, name: "<NO DATA (prndl)>" })
- for (var name in Common.PRNDL) {
- append({ id: Common.PRNDL[name], name: name });
- }
- }
- }
- }
- z: 1000
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 1: " + dataContainer.vehicleInfoModel.ecuDIDData.data1
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 2: " + dataContainer.vehicleInfoModel.ecuDIDData.data2
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject b/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject
deleted file mode 100644
index ea820e8019..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/qml_model.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-/* File generated by Qt Creator, version 2.7.0 */
-
-import QmlProject 1.1
-
-Project {
- mainFile: "MainWindow.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "../res"
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [ "." ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml
deleted file mode 100644
index 4a29168881..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/AMPlayerView.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file AMPlayerView.qml
- * @brief AM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: amRadioPlayer
- anchors.fill: parent
- radioType: "AM"
- radioName: "AM Radio"
-
- playerState: dataContainer.amPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml b/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml
deleted file mode 100644
index 19ecf4ca47..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ApplicationListView.qml
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * @file ApplicationListView.qml
- * @brief Application list view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Column {
- anchors.fill: parent
- Item {
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- OvalButton {
- text: "Find New Apps"
- }
-
- OvalButton {
- text: "Change device"
- onReleased: contentLoader.go("./views/ChangeDeviceView.qml")
- }
-
- OvalButton {
- text: "911 Assist"
- }
-
- OvalButton {
- text: "Vehicle Health Report"
- }
-
- OvalButton {
- text: "Install applications/Up"
- }
- }
- }
-
- Item {
- height: parent.height / 2
- width: parent.width
-
- ScrollableListView {
- id: applicationListView
- anchors.fill: parent
- model: dataContainer.applicationList
-
- delegate: Item {
- width: parent.width
- height: Math.max(applicationName.height, appIcon.height)
- Image {
- id: appIcon
- source: icon
- height: Constants.appListIconSize
- width: height
- }
- ClickableText {
- id: applicationName
- text: appName
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.appListFontSize
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: appIcon.right
- anchors.leftMargin: Constants.margin
- onClicked: {
- dataContainer.setCurrentApplication(appId)
- dataContainer.currentApplication.isMediaApplication ? contentLoader.go("./views/SDLPlayerView.qml", dataContainer.currentApplication.appId)
- : contentLoader.go("./views/SDLNonMediaView.qml", dataContainer.currentApplication.appId)
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml
deleted file mode 100644
index 0a5390e920..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/BTPlayerView.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * @file BTPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: btPlayer
- playerName: "BT Audio"
- anchors.fill: parent
-
- playerState: dataContainer.btPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: btPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml
deleted file mode 100644
index f582ff2f7e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/CDPlayerView.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * @file CDPlayerView.qml
- * @brief CD player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: cdPlayer
- playerName: "CD"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.cdPlayerState
-
- buttons: [
- OvalButton {
- text: cdPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml
deleted file mode 100644
index 9b04b1bad7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/CarMenuGridView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file CarMenuGridView.qml
- * @brief Car menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: CarMenuModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml b/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml
deleted file mode 100644
index 643b074506..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ChangeDeviceView.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * @file ChangeDeviceView.qml
- * @brief Screen view with list of available devices.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Text {
- id: searchDeviceText
- anchors.left: parent.left
- anchors.top: parent.top
- height: 1/4 * parent.height
- width: parent.width
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- text: "Devices available:"
- verticalAlignment: Text.AlignVCenter
- }
-
- ListView {
- id: changeDeviceListView
- anchors.left: parent.left
- anchors.top: searchDeviceText.bottom
- model: dataContainer.deviceList
- width:parent.width
- height:parent.height - searchDeviceText.height
-
- delegate: Text {
- MouseArea {
- anchors.fill: parent
- onClicked: {
- sdlBasicCommunication.onDeviceChosen({ name: name, id: devid });
- sdlBasicCommunication.onFindApplications({ name: name, id: devid })
- contentLoader.go("./views/ApplicationListView.qml")
- }
- }
- text: name
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- }
- }
- }
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-
- Component.onCompleted: {
- console.log("ChangeDeviceView Component.onCompleted enter");
- sdlBasicCommunication.onStartDeviceDiscovery();
- console.log("ChangeDeviceView Component.onCompleted exit");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml b/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml
deleted file mode 100644
index 01c289b139..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ClimateControlView.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file ClimateControlView.qml
- * @brief Screen view of climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-
-GeneralView {
- Item {
- id: climatMenu
- anchors.fill: parent
-
- Item {
- height: parent.height
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Column {
- id: leftItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- Row {
- ClimateControlBtn {name: "heated_seat"}
- ClimateControlBtn {name: "heated_wheel"}
- }
- Row {
- ClimateControlBtn {name: "AC"}
- ClimateControlBtn {name: "headed_dash"}
- }
- }
-
- Column {
- id: centralItem
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- ClimateControlBtn {id: useThisToGetButtonSize; name: "defrost"; state: "on"}
- ClimateControlBtn {name: "face"; state: "on"}
- ClimateControlBtn {name: "feet"}
- }
-
- Row {
- id: rightItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- ClimateControlBtn {
- anchors.verticalCenter: parent.verticalCenter
- txt: "Dual"
- state: "on"
- }
-
- Column {
- ClimateControlBtn { name: "heated_seat" }
- ClimateControlBtn { name: "AC" }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml b/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml
deleted file mode 100644
index a2b2be590b..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ContactsListView.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * @file ContactsListView.qml
- * @brief Contact list screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- function setCurrent(firstLetter){
- for(var i = 0; i < contactsListView.count; i ++) {
- if (contactsListView.model.get(i).name[0].toUpperCase() === firstLetter) {
- contactsListView.positionViewAtIndex(i, ListView.Beginning)
- break;
- }
- }
- }
- Component.onCompleted: setCurrent(dataContainer.contactsFirstLetter)
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- ScrollableListView {
- id: contactsListView
- anchors.fill: parent
- clip: true
- spacing: 1/2 * Constants.fontSize
- model: ContactsListModel { }
-
- section.property: "name"
- section.criteria: ViewSection.FirstCharacter
- section.delegate: Text {
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: section.toUpperCase()
- }
-
- delegate: Item {
- anchors.left: parent.left
- width: parent.width - Constants.scrollBarWidth
- height: typeText.height
-
- Text {
- id: contactName
- anchors.left: parent.left
- text: name
- width: Constants.contactListNameFieldSize * parent.width
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- elide: Text.ElideRight
- }
- Text {
- id: phoneText
- anchors.left: contactName.right
- width: Constants.contactListPhoneFieldSize * parent.width
- text: phone
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- Text {
- id: typeText
- anchors.right: parent.right
- width: Constants.contactListDescriptionFieldSize * parent.width
- text: type
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml
deleted file mode 100644
index 5c3ca6a5a9..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/FMPlayerView.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * @file FMPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: fmRadioPlayer
- anchors.fill: parent
- radioType: "FM"
- radioName: "FM Radio"
-
- playerState: dataContainer.fmPlayerState
-
- property int hdButtonValue: 1
-
- buttonHD: [
- Image {
- id: hdButton
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- source: "../res/buttons/long_oval_btn.png"
- property string textColor: Constants.primaryColor
-
- Row {
- anchors.centerIn: parent
- spacing: (hdButton.width - hdLogo.width - one.width - two.width - three.width - four.width) / 10
-
- Image {
- id: hdLogo
- anchors.verticalCenter: parent.verticalCenter
- source:"../res/hd_logo_on.png"
- }
-
- Text {
- id: one
- anchors.verticalCenter: parent.verticalCenter
- text: "1"
- color: fmRadioPlayer.hdButtonValue === 1 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: two
- anchors.verticalCenter: parent.verticalCenter
- text: "2"
- color: fmRadioPlayer.hdButtonValue === 2 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: three
- anchors.verticalCenter: parent.verticalCenter
- text: "3"
- color: fmRadioPlayer.hdButtonValue === 3 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: four
- anchors.verticalCenter: parent.verticalCenter
- text: "4"
- color: fmRadioPlayer.hdButtonValue === 4 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- hdLogo.source = "../res/hd_logo_off.png"
- hdButton.source = "../res/buttons/long_oval_pressed_btn.png"
- hdButton.textColor = Constants.secondaryColor
-
- }
- onReleased: {
- hdLogo.source = "../res/hd_logo_on.png"
- hdButton.source = "../res/buttons/long_oval_btn.png"
- hdButton.textColor = Constants.primaryColor
- fmRadioPlayer.hdButtonValue === 4 ? fmRadioPlayer.hdButtonValue = 1 : fmRadioPlayer.hdButtonValue++
- }
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml b/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml
deleted file mode 100644
index 40f809299d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/GeneralView.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file GeneralView.qml
- * @brief Base view class. Defines properties and behavior common for all views
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-
-Item {
- /// HMI context view is related to
- property int systemContext: Common.SystemContext.SYSCTXT_MAIN
- /// True if view is in application context
- property bool applicationContext: false
- /// View category for AppDeactivated notification (reason)
- property int category: Common.DeactivateReason.GENERAL
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml b/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml
deleted file mode 100644
index 4cc2f4f615..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/GridMenu.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file GridMenu.qml
- * @brief Parent class for main menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- id: main
- property alias model: repeater.model
- property alias delegate: repeater.delegate
- property alias rows: grid.rows
- property int columnsOnPage: Constants.menuColumnCount
-
- Flickable {
- id: flicker
- anchors.fill: parent
- contentWidth: grid.width
- flickableDirection: Flickable.HorizontalFlick
-
- Grid {
- id: grid
- anchors.centerIn: parent
- rows: Constants.menuRowCount
- columns: Math.ceil(model.count / rows)
- flow: Grid.TopToBottom
- Repeater {
- id: repeater
- }
- }
-
- property int snapTo: width / parent.columnsOnPage
- onMovementEnded: {
- var rest = flicker.contentX % snapTo
- var time = 0.25
- if (rest > flicker.snapTo / 2) { rest = rest - flicker.snapTo }
- var vel = 2 * rest / time
- flickDeceleration = Math.abs(vel) / time
- flick(vel, 0)
- flickDeceleration = 1500
- }
- }
-
- Pager {
- id: pager
- space: 10
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: Constants.margin
-
- pages: Math.ceil(grid.columns / parent.columnsOnPage)
- activePage: Internal.activePageChoose(flicker, pager.pages)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml b/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml
deleted file mode 100644
index 83f1ffcd01..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/HardwareButtonsView.qml
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * @file HardwareButtonsView.qml
- * @brief Area of screen responsible for hardware buttons
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-Rectangle {
- height: row.height + row.anchors.margins
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.panelColor
-
- signal buttonDown(string name)
- signal buttonUp(string name)
-
- function pressButton(name) {
- buttonDown(name)
- }
-
- function longPressButton(name) {
- console.log("long press " + name)
- }
-
- function releaseButton(name) {
- buttonUp(name)
- }
-
- Row {
- id: row
- spacing: Constants.panelPadding
- anchors.centerIn: parent
- anchors.margins: Constants.panelPadding
-
- PowerSwitchButton {anchors.verticalCenter: parent.verticalCenter}
-
- MaskedButton {
- name: "vr"
- anchors.verticalCenter: parent.verticalCenter
- onReleased: {
- console.debug("Clicked VR button");
- if (!dataContainer.activeVR) {
- vrPopUp.activate();
- } else {
- vrPopUp.complete();
- }
- }
- }
-
- ArrowKeys {anchors.verticalCenter: parent.verticalCenter}
-
- Grid {
- columns: 5
- rows: 2
- spacing: 5
- anchors.verticalCenter: parent.verticalCenter
- Repeater {
- model: 10
- delegate : Rectangle {
- width: 40
- height: 40
- radius: 5
- gradient: Gradient {
- GradientStop
- {
- position: 0.0;
- color: "#2c2c2c"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
-
- GradientStop
- {
- position: 1.0;
- color: "black"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
- }
-
- Text {
- text: (1 + index) % 10
- font.pixelSize: 30
- color: Constants.panelTextColor
- anchors.centerIn: parent
- }
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- property bool clickProcessed
- onPressed: {
- parent.gradient.stops[0].position = 1.0
- parent.gradient.stops[1].position = 0.0
- clickProcessed = false
- timer.start()
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- onReleased: {
- parent.gradient.stops[0].position = 0.0
- parent.gradient.stops[1].position = 1.0
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.SHORT, undefined)
- }
- }
- Connections {
- target: timer
- onTriggered: {
- if(!mouseArea.clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.LONG, undefined)
- mouseArea.clickProcessed = true
- }
- }
- }
- }
-
- Component.onCompleted: {
- settingsContainer.buttonCapabilities.push(
- {
- name: Common.ButtonName.PRESET_0 + index,
- upDownAvailable: true,
- shortPressAvailable: true,
- longPressAvailable: true
- });
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml
deleted file mode 100644
index 4d9b8091d7..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/IPodPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file IPodPlayerView.qml
- * @brief IPod player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: ipodPlayer
- playerName: "iPod"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.ipodPlayerState
-
- buttons: [
- OvalButton {
- text: ipodPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml
deleted file mode 100644
index eca575d6b1..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/LineInPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file LineInPlayerView.qml
- * @brief LineIn player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: lineInPlayer
- playerName: "LineIn"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.linePlayerState
-
- buttons: [
- OvalButton {
- text: lineInPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml b/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml
deleted file mode 100644
index 321a67831c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MainMenuView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file MainMenuView.qml
- * @brief Main menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: MainMenuListModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml b/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml
deleted file mode 100644
index 183798eb49..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MediaClockView.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @file MediaClockView.qml
- * @brief Media clock view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- property alias time: timeText.text
- Text {
- id: timeText
- anchors.left: parent.left
- width: 1/10 * parent.width
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignRight
- color: "white"
- text: (mediaPlayerView.playerType === "SDL") ? Internal.hmsTimeToString(dataContainer.currentApplication.mediaClock.startTime)
- : "02:36" //TODO {Aleshin}: get track time for all players except SDL
- font.pixelSize: 18
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- height: parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: dataContainer.currentApplication.mediaClock.progress * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: (1 - dataContainer.currentApplication.mediaClock.progress) * parent.width
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml b/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml
deleted file mode 100644
index 866f5399cb..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MediaPlayer.qml
+++ /dev/null
@@ -1,325 +0,0 @@
-/**
- * @file MediaPlayerView.qml
- * @brief Parent for BT, IPod, CD players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- id: mediaPlayerView
-
- property string playerName: ""
- property string playerType: ""
-
- signal rewind
- signal forward
- signal play
- signal pause
-
- // Holds players state(song name, play/pause state, track number etc). For all players except SDL.
- property PlayerState playerState;
-
- property alias buttons: buttonsRow.content
- property alias buttonsSpacing: buttonsRow.spacing
- property alias image: image.source
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- width: parent.width
- height: 1/5 * parent.height
- anchors.left: parent.left
- anchors.top: parent.top
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (mediaPlayerView.playerType === "SDL") ? ((width - 4 * elementWidth) / 3)
- : (width - 2 * elementWidth)
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
- }
- }
-
- Item {
- id: spacingBetweenItems
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 2/5 * parent.height
- anchors.left: parent.left
- anchors.top: spacingBetweenItems.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - titleText.height - 3 * text.height) / 3
-
- Text {
- id: titleText
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField1
- : playerState.trackName
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- }
-
- Text {
- id: text
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField2
- : playerState.albumName
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mediaTrack
- : playerState.trackNumber
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Time to destination: " + dataContainer.navigationModel.timeToDestination
- font.pixelSize: Constants.fontSize
- horizontalAlignment: dataContainer.hmiUITextAlignment
- visible: mediaPlayerView.playerType === "SDL" && dataContainer.navigationModel.timeToDestination
- }
- }
- }
-
- MediaClockView {
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- id: spacingBetweenItems2
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: mediaContent.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Row {
- // Rewind, play, pause, forward buttons
- id: playPauseRewindForward
- width: parent.width
- height: 1/5 * parent.height - statusBar.height
- anchors.left: parent.left
- anchors.leftMargin: (width - playPauseButton.width - prevButton.width - nextButton.width) / 2
- anchors.top: spacingBetweenItems2.bottom
-
- Image {
- id: prevButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_prev_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- prevButton.source = "../res/buttons/player_prev_pressed_btn.png"
- }
- onReleased: {
- prevButton.source = "../res/buttons/player_prev_btn.png"
- }
- }
- }
-
- PlayPauseButton {
- id: playPauseButton
- anchors.verticalCenter: parent.verticalCenter
- state: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.playPauseState : playerState.playPauseState
- onClicked: {
- (state == 'Play') ? play() : pause();
- var newState = state === "Play" ? "Pause" : "Play";
- (mediaPlayerView.playerType === "SDL") ? dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, { playPauseState: newState } )
- : playerState.playPauseState = newState
- }
- }
-
- Image {
- id: nextButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_next_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- nextButton.source = "../res/buttons/player_next_pressed_btn.png"
- }
- onReleased: {
- nextButton.source = "../res/buttons/player_next_btn.png"
- }
- }
- }
- }
-
- Item {
- id: presetButtons
- width: parent.width
- height: 1/5 * parent.height
- anchors.top: playPauseRewindForward.bottom
- anchors.left: parent.left
-
- PresetRow {
- id: presetsRow
- anchors.top: parent.top
- anchors.left: parent.left
- presets: mediaPlayerView.playerType === "SDL" ? Internal.getArrayForPresetRow() : []
- width: parent.width
- property bool clickProcessed
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- onTriggered: {
- console.log("preset button hold")
- presetsRow.clickProcessed = true
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + presetsRow.selectedIndex, Common.ButtonPressMode.LONG, undefined)
- }
- }
-
- onPresetButtonPressed: {
- console.log("preset button pressed")
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- console.log("preset button released")
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
- }
- }
- }
-
- StatusBar {
- id: statusBar
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-
- states: [
- State {
- name: 'presetButtonsON'
- when: (dataContainer.currentApplication.customPresets.count > 0) && (mediaPlayerView.playerType === "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1
- }
- PropertyChanges {
- target: presetButtons
- visible: true
- enabled: true
- }
- },
-
- State {
- name: 'presetButtonsOFF'
- when: (dataContainer.currentApplication.customPresets.count === 0) || (mediaPlayerView.playerType !== "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: presetButtons
- visible: false
- enabled: false
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml b/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml
deleted file mode 100644
index c9c30e200c..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/MusicSourceView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file MusicSourceView.qml
- * @brief Music source screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: dataContainer.musicSourceModel
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml, appId)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml
deleted file mode 100644
index 6d5ad5027f..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationInRouteGridView.qml
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @file NavigationInRouteGridView.qml
- * @brief Navigation in route screen veiw.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-
-GeneralView {
- Item {
- id: navInRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: Constants.releasedButtonTextColor
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- Image {
- id: muteBtnImg
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * muteBtnImg.width
- source: "../res/nav/mute_off.png"
- MouseArea {
- anchors.fill: parent
- onClicked: if (muteBtnImg.state === "off") {
- muteBtnImg.state = "on"
- muteBtnImg.source = "../res/nav/mute_off.png"
- }
- else {
- muteBtnImg.source = "../res/nav/mute_on.png"
- muteBtnImg.state = "off"
- }
- }
- }
-
- Image {
- id: turnArrow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: muteBtnImg.right
- anchors.leftMargin: 1/20 * contentLoader.width
- source: "../res/nav/turnArrow.png"
- }
-
- Text {
- id: street
- anchors.verticalCenter: cancel.verticalCenter
- anchors.left: turnArrow.right
- anchors.leftMargin: 1/20 * contentLoader.width
- text: "0.2 mi on Cherry Hill Rd."
- color: "White"
- font.pixelSize: 20
- }
-
- Text {
- id: timeToDest
- anchors.verticalCenter: cancel.verticalCenter
- anchors.right: cancel.left
- anchors.rightMargin: 1/20 * contentLoader.width
- text: "2 hrs 27 min"
- color: "White"
- font.pixelSize: 20
- }
-
- Image {
- id: cancel
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
-
- source: "../res/buttons/long_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: cancel.left
- anchors.leftMargin: Constants.fontSize
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: cancelText
- anchors.centerIn: parent
- text: "Cancel"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- cancel.source = "../res/buttons/long_oval_pressed_btn.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- cancelText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- cancel.source = "../res/buttons/long_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- cancelText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationNoRouteGridView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml
deleted file mode 100644
index 3ef73ee67d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationKeyboardView.qml
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * @file NavigationKeyboardView.qml
- * @brief Navigation keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navKeyboard
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- // Text line with input text
- TextInput {
- id: inputText
- anchors.top:parent.top
- anchors.left:parent.left
- maximumLength: 30
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: dataContainer.routeText
- }
-
- // Keyboard
- Column {
- anchors.centerIn: parent
- Row {
- id: upperRow
- property string qWERTY : "QWERTYUIOP"
- anchors.horizontalCenter: parent.horizontalCenter
-
- Repeater {
- model: 10
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: upperRow.qWERTY.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += upperRow.qWERTY.charAt(index)
- }
- }
- }
- }
- Row {
- id: middleRow
- property string aSDFGH : "ASDFGHJKL"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 15
- }
- //--------------
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: middleRow.aSDFGH.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += middleRow.aSDFGH.charAt(index)
- }
- }
- }
- //--------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- onIsPressedChanged: {
- hoverImg.source = isPressed ? "../res/nav/delete_icon_black.png" : "../res/nav/delete_icon.png";
- }
- Image {
- id: hoverImg
- anchors.centerIn: parent
- source: "../res/nav/delete_icon.png"
- }
-
- onClicked: {
- dataContainer.routeText = dataContainer.routeText.substring(0,dataContainer.routeText.length - 1)
- }
- }
- }
- Row {
- id: lowerRow
- property string zXCVBN : "ZXCVBNM"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "!@#"
- pixelSize: 15
- }
- //-----------------
- Repeater {
- model: 7
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: lowerRow.zXCVBN.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += lowerRow.zXCVBN.charAt(index)
- }
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Clear"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText = ""
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Space"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText += " "
- }
- }
- }
-
- } // column
-
- Image {
- id: goBtn
- anchors.right: parent.right
- anchors.top: parent.top
- source: "../res/buttons/short_oval_btn.png"
-
- Text {
- id: goText
- anchors.centerIn: parent
- text: "Go"
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- goBtn.source = "../res/buttons/short_oval_btn_pressed.png"
- goText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- goBtn.source = "../res/buttons/short_oval_btn.png"
- goText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationInRouteGridView.qml")
- }
- }
- }
- } // 3/4 top screen
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml
deleted file mode 100644
index 5ceffe0526..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationMenuView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file NavigationMenuView.qml
- * @brief Navigation menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: NavigationMenuModel {}
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml
deleted file mode 100644
index 312f076394..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/NavigationNoRouteGridView.qml
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * @file NavigationNoRouteGridView.qml
- * @brief Navigation no route screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navNoRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- id: bottomPart
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Destination search button
- Image {
- id: destSearch
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- source: "../res/buttons/longest_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 15
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: destText
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: destIcon.right
- anchors.leftMargin: 5
- text: "Destination"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- destSearch.source = "../res/buttons/longest_oval_btn_pressed.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- destText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- destSearch.source = "../res/buttons/longest_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- destText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationMenuView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml b/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml
deleted file mode 100644
index b328406d68..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/PhoneKeyboardView.qml
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * @file PhoneKeyboardView.qml
- * @brief Phone keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView{
- Component.onCompleted: phoneKeyboard.changeColorOfActiveButtons()
-
- Item {
- function changeColorOfActiveButtons() {
- for (var i = 0; i < contactsListModel.count; i++) {
- activeButtons[contactsListModel.get(i).name[0].toUpperCase()] = true
- }
- }
-
- id: phoneKeyboard
- anchors.fill: parent
-
- property variant activeButtons: {
- "A": false, "B": false, "C": false, "D": false, "E": false,
- "F": false, "G": false, "H": false, "I": false, "J": false,
- "K": false, "L": false, "M": false, "N": false, "O": false,
- "P": false, "Q": false, "R": false, "S": false, "T": false,
- "U": false, "V": false, "W": false, "X": false, "Y": false, "Z": false
- }
-
- ContactsListModel {
- id: contactsListModel
- }
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- Column {
- anchors.centerIn: parent
-
- Row {
- id: upperRow
- property string contentLoader : "ABCDEFGHI"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: upperRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: middleRow
- property string contentLoader : "JKLMNOPQR"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: middleRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: lowerRow
- property string contentLoader : "STUVWXYZ"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 8
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: lowerRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 20
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent}
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml b/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml
deleted file mode 100644
index 7d52b1223a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/PhoneMenuGridView.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * @file PhoneMenuGridView.qml
- * @brief View for phone menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: PhoneMenuModel {}
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml b/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml
deleted file mode 100644
index 1df65d4235..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/RadioPlayer.qml
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * @file RadioPlayerView.qml
- * @brief Parent for AM, FM, Sirius players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-Item {
- id: radioPlayerView
-
- property string radioType: ""
- property string radioName: ""
- property alias buttonHD: bot.children
-
- property PlayerState playerState
-
- Item {
- // top 3/4 screen
- id: upperContent
- anchors.top: parent.top
- anchors.left: parent.left
- height: parent.height * 3/4
- width: parent.width
-
- Item {
- // top part for buttons
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- OvalButton {
- text: radioName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- }
-
- OvalButton {
- anchors.right: parent.right
- anchors.top: parent.top
- text: "Tune"
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- // mid part for information about song
- id: mid
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- width: parent.width
- height: parent.height / 2
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
-
- Row {
- Text {
- id: radioChannelNameText
- color: Constants.primaryColor
- text: playerState.presets[0]
- font.pixelSize: 45
- }
- Text {
- anchors.bottom: radioChannelNameText.bottom
- color: Constants.primaryColor
- text: " " + radioType
- font.pixelSize: 25
- }
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.songName
- font.pixelSize: 25
- font.bold: true
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.albumName
- font.pixelSize: 25
- }
- }
- }
-
- Item {
- // bottom part for HD button (for FM radio)
- id: bot
- anchors.left: parent.left
- anchors.bottom: parent. bottom
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Line that divide screen in two parts
- Rectangle {
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 2
- color: Constants.primaryColor
- }
-
- PresetRow {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: playerState.presets
- width: parent.width
- onSelectedIndexChanged: {
- radioChannelNameText.text = presets[selectedIndex];
- }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml
deleted file mode 100644
index 620b0434c6..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLNavi.qml
+++ /dev/null
@@ -1,223 +0,0 @@
-/**
- * @file SDLNavi.qml
- * @brief SDL navigation screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- anchors.fill: parent
- id: wholeWindow
-
- Row {
- // Top items
- id: topItems
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField1
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- anchors.top: parent.top
- width: 3/5 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField2
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- id: rightRectOfTopItems
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField3 ? dataContainer.currentApplication.hmiUIText.mainField3 : "field3"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Column {
- // "+", "-" button at left
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- width: 1/12 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "+"
- isCustomButton: true
- customButtonID: 3
- }
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "-"
- isCustomButton: true
- customButtonID: 4
- }
- }
-
- Column {
- anchors.right: parent.right
- anchors.top: topItems.bottom
- width: 1/6 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: ""
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField4 ? dataContainer.currentApplication.hmiUIText.mainField4 : "mainField4"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Row {
- // bottom items
- id: bottomItems
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Menu"
- isCustomButton: true
- customButtonID: 1
- }
- Rectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: "mainField5"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Custom Button"
- isCustomButton: true
- customButtonID: 2
- }
- }
-
- GradientRectangle {
- anchors.right: parent.right
- anchors.bottom: bottomItems.top
- anchors.bottomMargin: Constants.sdlNaviSpacing
- width: 1/6 * parent.width
- height: 1/10 * parent.height
- text: "Options"
- fontSize: Constants.fontSize
- onReleased: {
- contentLoader.go("./views/SDLPlayerOptionsListView.qml", dataContainer.currentApplication.appId)
- }
-
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml
deleted file mode 100644
index bebfe9585d..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLNonMediaView.qml
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * @file SDLNonMediaView.qml
- * @brief SDL non media screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: upperContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Item {
- id: topButtonRow
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- spacing: (width - 4 * elementWidth) / 3
- snapTo: elementWidth + spacing
-
- OvalButton {
- text: "Options"
- onClicked: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- }
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- }
- }
-
- Column {
- id: midContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: topButtonRow.bottom
- anchors.left: parent.left
-
- Text {
- id: deviceName
- width: parent.width
- height: 1/5 * parent.height
- text: "Device: " + dataContainer.currentApplication.deviceName
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Row {
- width: parent.width
- height: 4/5 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- source: dataContainer.currentApplication.hmiUIText.image
- }
-
- Column {
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: Constants.margin
-
- Text {
- id: text1
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField1
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField2
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- PresetRow {
- id: presetsRow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: Internal.getArrayForPresetRow()
- width: parent.width
- property bool clickProcessed
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- onPresetButtonPressed: {
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
- }
-
- Connections {
- target: timer
- onTriggered: {
- if(!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
- clickProcessed = true
- }
- }
- }
- }
- }
-
- StatusBar {
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml
deleted file mode 100644
index 076851b29a..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerOptionsListView.qml
+++ /dev/null
@@ -1,120 +0,0 @@
-/**
- * @file SDLPlayerOptionsListView.qml
- * @brief SDL player options screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- applicationContext: true
- systemContext: Common.SystemContext.SYSCTXT_MENU
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- ListView {
- id: sdlPlayerOptionsListView
- anchors.horizontalCenter: parent.horizontalCenter
- width:parent.width
- height:parent.height
-
- model: dataContainer.currentApplication.currentSubMenu
-
- delegate: Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.icon
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
-
- MouseArea {
- anchors.fill: parent
- enabled: model.icon.value !== undefined
-
- onPressed: text.press()
- onReleased: text.release()
- onCanceled: text.release()
- onClicked: text.click()
- }
- }
-
- ClickableText {
- id: text
- text: name + (type === Internal.MenuItemType.MI_SUBMENU ? " >" : "")
- width: sdlPlayerOptionsListView.width - x
- elide: Text.ElideRight
- defaultColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColor :
- Constants.primaryColor
- pressedColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColorPressed :
- Constants.primaryColorPressed
- font.pixelSize: Constants.titleFontSize
-
- function click() {
- console.debug("enter")
- switch (type) {
- case Internal.MenuItemType.MI_NODE:
- sdlUI.onCommand(model.id, dataContainer.currentApplication.appId)
- contentLoader.back()
- break;
- case Internal.MenuItemType.MI_SUBMENU:
- case Internal.MenuItemType.MI_PARENT:
- dataContainer.currentApplication.currentSubMenu = subMenu
- break;
- }
- console.debug("exit")
- }
- onClicked: click()
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml
deleted file mode 100644
index 0c1bd5b7e9..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SDLPlayerView.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file SDLPlayerView.qml
- * @brief SDL player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- applicationContext: true
- MediaPlayer {
- id: mediaPlayer
- onPlay: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- onPause: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- playerName: "SDL music"
- playerType: "SDL"
- image: dataContainer.currentApplication.hmiUIText.image
- anchors.fill: parent
-
- buttons: [
- OvalButton {
- text: dataContainer.currentApplication.appName
- onReleased: { contentLoader.go("./views/MusicSourceView.qml") }
- },
-
- OvalButton {
- text: "SDL Menu"
- onReleased: { contentLoader.go("./views/ApplicationListView.qml") }
- },
-
- OvalButton {
- text: "Options"
- onReleased: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- },
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
-
- delegate: SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml
deleted file mode 100644
index f7111906de..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/ScrollableMessageView.qml
+++ /dev/null
@@ -1,216 +0,0 @@
-/**
- * @file ScrollableMessageView.qml
- * @brief Scrollable Message View .
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models"
-import "../popups"
-
-GeneralView {
- applicationContext: true
- id: scrollableMessageView
-
- function complete(abort){
- console.debug("enter")
- timer.stop()
- dataContainer.scrollableMessageModel.running = false
-
- dataContainer.popups--
- dataContainer.applicationContext = dataContainer.applicationSavedContext
-
- if(abort) {
- console.debug("send error")
- DBus.sendError(dataContainer.scrollableMessageModel.async, Common.Result.ABORTED)
- } else {
- console.debug("send ok")
- DBus.sendReply(dataContainer.scrollableMessageModel.async, {})
- }
-
- contentLoader.back()
- console.debug("exit")
- }
-
-
- Connections {
- target: contentLoader
- onStatusChanged: {
- if (status == Component.Ready) {
- console.debug("enter")
- console.debug("timeout in timer", timer.interval)
- dataContainer.popups++
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- dataContainer.scrollableMessageModel.running = true
- timer.start()
- console.debug("exit")
- }
- }
- }
-
- Rectangle {
- anchors.fill: parent
- color: Constants.secondaryColor
-
- Timer {
- id: timer
- interval: dataContainer.scrollableMessageModel.timeout
- onTriggered: {
- complete(false)
- }
- }
-
- Item {
- // top 1/6 of screen
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: dataContainer.scrollableMessageModel.softButtons.count > 0 ? parent.height * 1/6 : 1
-
- OvalButton {
- //this button is used only to get item size for PagedFlickable
- id: fakeButton
- text: "defaultBtnSize"//remove this line when default size for btn will be introduced
- visible:false
- }
-
- PagedFlickable {
- id: flickRow
- width: top.width
- spacing: (width - fakeButton.width * 4) / 3
- snapTo: fakeButton.width + spacing
- elementWidth: fakeButton.width
-
-
- ListView {
- id: softButtons
- width: model.count * fakeButton.width + (model.count - 1) * flickRow.spacing
- height: fakeButton.height
- spacing: flickRow.spacing
-
- orientation: ListView.Horizontal
- interactive: false
- model: dataContainer.scrollableMessageModel.softButtons
-
- delegate: SoftButton {
- appId: dataContainer.currentApplication.appId
- button: model
- onKeepContext: timer.restart()
- onDefaultAction: scrollableMessageView.complete(true)
- }
- }
- }
- }
-
- Item {
- id: middle
- anchors.top: top.bottom
- anchors.left: parent.left
- anchors.bottom: bottom.top
- width: parent.width
-
- Flickable {
- id:flickable
- anchors.fill: middle
- flickableDirection: Flickable.VerticalFlick
- contentWidth: longMessageText.width
- contentHeight: longMessageText.height
- clip: true
-
-
- Text {
- id: longMessageText
- wrapMode: Text.Wrap
- width: middle.width
- text: dataContainer.scrollableMessageModel.longMessageText
- color: Constants.scrollableMessageTextColor
- font.pixelSize: Constants.fontSize
-
- }
- }
- Rectangle {
- id: scrollbar
- anchors.right: flickable.right
- y: flickable.visibleArea.yPosition * flickable.height
- width: Constants.scrollableMessageScrollBarWidth
- height: flickable.visibleArea.heightRatio * flickable.height
- visible: !(flickable.visibleArea.heightRatio > 1)
- color: Constants.scrollableMessageScrollBarColor
- }
-
- }
-
- Item {
- // 1/4 bottom screen
- id: bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton {
- id:backButton
- anchors.centerIn: parent
- onClicked: {
- console.debug("enter")
- complete(true)
- console.debug("exit")
- }
- }
- }
- }
- /**
- * Test Support Section
- *
- */
- function getTimer(){
- return timer
- }
- function getSoftButtonsListView(){
- return softButtons
- }
- function getScrollbar(){
- return scrollbar
- }
- function getTextArea(){
- return middle
- }
- function getBackButton(){
- return backButton
- }
- /**
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml b/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml
deleted file mode 100644
index c30d83f019..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SimulationView.qml
+++ /dev/null
@@ -1,284 +0,0 @@
-/**
- * @file SimulationView.qml
- * @brief Area of screen responsible for simulation actions
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../popups"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- width: controlArea.width + controlArea.anchors.margins
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- color: Constants.panelColor
-
- Item {
- id: showArea
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- height: parent.height - (controlArea.childrenRect.height + controlArea.anchors.margins)
-
- ExitAllApplicationsPopup {
- id: exitAllApplicationsPopup
- anchors.fill: parent
- visible: false
- }
-
- VehicleInfoPopUp {
- id: viPopUp
- anchors.fill: parent
- }
-
- TBTClientStatePopUp {
- id: tbtClientStatePopUp
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: controlArea
- anchors.bottom: parent.bottom
- anchors.margins: Constants.panelPadding
- anchors.horizontalCenter: parent.horizontalCenter
- width: table.width
-
- ListModel {
- id: languagesList
-
- Component.onCompleted: {
- for (var name in Common.Language) {
- if (settingsContainer.sdlLanguagesList.indexOf(Common.Language[name]) != -1) {
- append({name: name.replace('_', '-')});
- }
- }
- }
- }
-
- Text {
- id: label
- text: "Languages"
- color: Constants.panelTextColor
- anchors.bottom: table.top
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Grid {
- id: table
- spacing: 5
- columns: 2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: globalProperties.top
-
- Text {
- text: "HMI UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "HMI TTS + VR"
- color: Constants.panelTextColor
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiUILanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlUI.onLanguageChange(dataContainer.hmiUILanguage);
- }
- z: 1000
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiTTSVRLanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlTTS.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- sdlVR.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- }
- z: 1000
- }
-
- Text {
- text: "Application UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "Application TTS + VR"
- color: Constants.panelTextColor
- }
-
- Text {
- id: uiLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.hmiDisplayLanguageDesired) {
- uiLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- Text {
- id: ttsLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.languageTTSVR) {
- ttsLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- PushButton {
- id: vehicleInfo
- label: "Vehicle info"
- toggleMode: true
- onPressed: {
- viPopUp.show();
- }
- onUnpressed: {
- viPopUp.hide();
- }
- }
-
- PushButton {
- id: tbtClientState
- label: "TBT Client state"
- toggleMode: true
- onPressed: {
- tbtClientStatePopUp.show();
- }
- onUnpressed: {
- tbtClientStatePopUp.hide();
- }
- }
-
- PushButton {
- label: "Exit application"
- onClicked: {
- if (dataContainer.applicationContext) {
- sdlBasicCommunication.onExitApplication(dataContainer.currentApplication.appId)
- }
- }
- }
-
- PushButton {
- id: exitAllAppsButton
- label: "Exit all apps"
- toggleMode: true
- onPressed: {
- exitAllApplicationsPopup.show()
-
- }
- onUnpressed: {
- exitAllApplicationsPopup.hide()
- }
- Connections {
- target: exitAllApplicationsPopup
- onVisibleChanged: {
- if (!exitAllApplicationsPopup.visible) {
- exitAllAppsButton.state = "unpressed"
- }
- }
- }
- }
-
- CheckBox {
- color: Constants.panelTextColor
- text: "Use URL"
- }
-
- CheckBox {
- color: Constants.panelTextColor
- text: "DD"
-
- onClicked: {
- if (checked) {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_ON;
- } else {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_OFF;
- }
- }
- }
- }
-
- Rectangle {
- id: globalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- height: listGlobalProperties.height + Constants.panelPadding
- border.color: Constants.panelTextColor
- border.width: 1
- color: Constants.panelColor
- Column {
- id: listGlobalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.panelPadding / 4
- Text {
- text: "HELP_PROMPT: " + dataContainer.currentApplication.helpPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "TIMEOUT_PROMPT: " + dataContainer.currentApplication.timeoutPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "AUTOCOMPLETE_TEXT: " // TODO(ALeshin): Function didn' realized yet
- color: Constants.panelTextColor
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml
deleted file mode 100644
index 14dd211303..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/SiriusPlayerView.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @file SiriusPlayerView.qml
- * @brief Sirius player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-
-GeneralView {
- RadioPlayer {
- id: siriusRadioPlayer
- anchors.fill: parent
- radioType: ""
- radioName: "Sirius"
-
- playerState: dataContainer.siriusPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml b/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml
deleted file mode 100644
index 630113334e..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/TurnByTurnView.qml
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * @file TurnByTurnView.qml
- * @brief View for TurnByTurn.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models"
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: turnByTurnView
- anchors.fill: parent
-
- Item {
- // top 3/4 of screen
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 3/4
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (width - 4 * elementWidth) / 3
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
-
- OvalButton {
- id: turnListButton
- text: "TurnList"
- onClicked: {
- console.log("Go to TurnListView");
- contentLoader.go("./views/TurnListView.qml");
- }
- }
-
- Repeater {
- model: dataContainer.navigationModel.softButtons ?
- dataContainer.navigationModel.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.navigationModel.appId
- button: dataContainer.navigationModel.softButtons.get(index)
- }
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 3/4 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- source: dataContainer.navigationModel.turnIcon
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - 5 * navText1.height) / 4
-
- Text {
- id: navText1
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.navigationModel.text1
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.text1
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.navigationModel.text2
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.text2
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Total distance: " + dataContainer.navigationModel.totalDistance
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.totalDistance
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Time to destination: " + dataContainer.navigationModel.timeToDestination
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.timeToDestination
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "ETA: " + dataContainer.navigationModel.eta
- font.pixelSize: Constants.fontSize
- visible: dataContainer.navigationModel.eta
- }
- }
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- height: 1/4 * parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- id: coveredDistance
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: dataContainer.navigationModel.distanceToManeuver / dataContainer.navigationModel.distanceToManeuverScale * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: parent.width - coveredDistance.width
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml b/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml
deleted file mode 100644
index 91ff02ea02..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/TurnListView.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * @file TurnListView.qml
- * @brief View for TurnByTurn list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- anchors.left: parent.left
- anchors.top: parent.top
- width: parent.width
- height: 3/4 * parent.height
-
- Item {
- id: sotfButtons
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- Repeater {
- model: dataContainer.currentApplication.turnListSoftButtons ?
- dataContainer.currentApplication.turnListSoftButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.turnListSoftButtons.get(index)
- }
- }
- }
- }
-
- ScrollableListView {
- id: scrollableList
- anchors.top: sotfButtons.bottom
- anchors.left: parent.left
- width: parent.width
- height: 3/4 * parent.height
-
- model: dataContainer.currentApplication.turnList
-
- delegate:
- ListItem {
- width: scrollableList.width
- height: Constants.iconItemListSize
- text: dataContainer.currentApplication.turnList.get(index).navigationText.fieldText
- fontSize: Constants.fontSize
- icon: dataContainer.currentApplication.turnList.get(index).turnIcon
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- id: back
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml b/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml
deleted file mode 100644
index 4b17b55c10..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/UsbPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file UsbPlayerView.qml
- * @brief USB player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: usbPlayer
- playerName: "USB"
- anchors.fill: parent
- playerState: dataContainer.usbPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: usbPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml b/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml
deleted file mode 100644
index e096cb80d1..0000000000
--- a/src/components/qt_hmi/qml_model_qt4/views/WarningInfo.qml
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * @file WarningInfo.qml
- * @brief Screen with warning information.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 1.1
-import "../controls"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: warningInfo
- anchors.fill: parent
- color: Constants.secondaryColor
- Text {
- anchors.top: parent.top
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- text: "WARNING!"
- color: Constants.warningColor
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- style: Text.Raised
- styleColor: "gray"
- }
-
- Text {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.margin
- height: 1/2 * parent.height
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- wrapMode: Text.WordWrap
-
- text: "This application is intended to be used as a demonstrative aid only, "
- + "while the vehicle is parked. Don't use it while driving. <br /><br />"
- + "Use extreme caution when using any device that takes your attention off the road. "
- + "Ford recommends against the use of any hand-held device while driving and that you comply "
- + "with all applicable laws. Your primary responsibility is the safe operation of the vehicle."
- color: "white"
- font.pixelSize: 25
- font.bold: true
- }
-
- function showOkButton() {
- okButtonAnimation.start()
- }
-
- Item {
- id: ok
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- opacity: 0
-
- SequentialAnimation
- {
- id: okButtonAnimation
- // Decrease this value while debugging
- PauseAnimation { duration: Constants.warningScreenDuration }
- NumberAnimation {
- target: ok
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
-
- Image {
- id: okButton
- anchors.centerIn: parent
- source: "../res/buttons/longest_oval_btn.png"
-
- Text {
- id: text
- anchors.centerIn: parent
- text: "OK"
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/longest_oval_btn_pressed.png"
- text.color = Constants.secondaryColor
- }
- onReleased: {
- parent.source = "../res/buttons/longest_oval_btn.png"
- text.color = Constants.primaryColor
- }
- onClicked: {
- console.log("WarningInfo OkButton - on clicked enter");
- warningInfo.visible = false
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt b/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt
deleted file mode 100644
index e6eeb9e525..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../..)
-set(dbus_dir ${components_dir}/dbus)
-set(codegen_dir ${dbus_dir}/codegen)
-set(codegen ${codegen_dir}/make_qml_dbus_qml.py)
-set(parser ${codegen_dir}/ford_xml_parser.py)
-set(interfaces_dir ${components_dir}/interfaces)
-set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
-set(proxy_dir ${CMAKE_CURRENT_BINARY_DIR}/hmi_api)
-set(qml_dirs hmi_api controls models popups views)
-set(qml_files MainWindow.qml)
-
-add_custom_target(qml_auto ALL
- COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${proxy_dir}
- DEPENDS ${api_xml} ${codegen} ${parser}
- COMMENT "Generating files:
- ${proxy_dir}/BasicCommunicationProxy.qml
- ${proxy_dir}/ButtonsProxy.qml
- ${proxy_dir}/NavigationProxy.qml
- ${proxy_dir}/TTSProxy.qml
- ${proxy_dir}/UIProxy.qml
- ${proxy_dir}/VehicleInfoProxy.qml
- ${proxy_dir}/VRProxy.qml
- from:
- ${api_xml} ..."
-)
-
-add_custom_target(qml_copy_resources ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../res ${CMAKE_CURRENT_BINARY_DIR}/res
- COMMENT "Copying resources")
-
-if(NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
- foreach(qml_dir ${qml_dirs})
- add_custom_target(qml_copy_${qml_dir} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/${qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${qml_dir}
- COMMENT "Copying directory ${qml_dir}")
- endforeach(qml_dir)
-
- add_dependencies(qml_auto qml_copy_hmi_api)
-
- foreach(qml_file ${qml_files})
- add_custom_target(qml_copy_${qml_file} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${qml_file} ${CMAKE_CURRENT_BINARY_DIR}/${qml_file}
- COMMENT "Copying file ${qml_file}")
- endforeach(qml_file)
-endif()
-
-install(DIRECTORY
- ${CMAKE_CURRENT_BINARY_DIR}/controls
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_api
- ${CMAKE_CURRENT_BINARY_DIR}/models
- ${CMAKE_CURRENT_BINARY_DIR}/popups
- ${CMAKE_CURRENT_BINARY_DIR}/res
- ${CMAKE_CURRENT_BINARY_DIR}/views
- DESTINATION bin/hmi)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MainWindow.qml DESTINATION bin/hmi)
diff --git a/src/components/qt_hmi/qml_model_qt5/MainWindow.qml b/src/components/qt_hmi/qml_model_qt5/MainWindow.qml
deleted file mode 100644
index 59fed45707..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/MainWindow.qml
+++ /dev/null
@@ -1,462 +0,0 @@
-/**
- * @file MainWindow.qml
- * @brief Implementation of main window.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtMultimedia 5.0
-import com.ford.sdl.hmi.dbus_adapter 1.0
-import com.ford.sdl.hmi.log4cxx 1.0
-import com.ford.sdl.hmi.named_pipe_notifier 1.0
-import "./controls"
-import "./views"
-import "./hmi_api" as HmiApi
-import "./models"
-import "./popups"
-import "hmi_api/Common.js" as Common
-import "./models/Constants.js" as Constants
-import "models/Internal.js" as Internal
-
-Rectangle {
- width: 1280
- height: 768
- property string startQml: "./views/ApplicationListView.qml"
- property int minWidth: Constants.mainScreenMinWidth
- property int minHeight: Constants.mainScreenMiHeight
- color: Constants.secondaryColor
-
- DataStorage {
- id: dataContainer
-
- onSystemContextChanged: {
- sdlUI.onSystemContext(systemContext, currentApplication.appId)
- }
-
- // Please note that applicationContext is changed only after setting currentApplication
- onApplicationContextChanged: {
- if (applicationContext) {
- sdlBasicCommunication.onAppActivated(currentApplication.appId)
- } else {
- sdlBasicCommunication.onAppDeactivated(currentApplication.appId, contentLoader.item.category)
- }
- }
- }
-
- Audio {
- id: beep
- source: "res/initial.wav"
- }
-
- Audio {
- id: stream
-
- property real bufferProgress: 0.0
- }
-
- SettingsStorage {
- id: settingsContainer
- }
-
- Item {
- id: mainScreen
- anchors.top: parent. top
- anchors.left: parent.left
- width: (parent.width - simulationScreen.width < minWidth) ?
- minWidth : parent.width - simulationScreen.width
- height: (parent.height - hardwareScreen.height < minHeight) ?
- minHeight : parent.height - hardwareScreen.height
- clip: true
- visible: false
-
- Item {
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- height: parent.height * 0.10
- width: parent.width
- HeaderMenu {}
- }
-
- Item {
- height: parent.height * 0.90
- width: parent.width
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
-
- Video {
- id: player
- anchors.fill: parent
- visible: {
- var naviString = new RegExp("SDLNavi\.qml")
- return naviString.test(contentLoader.source);
- }
-
- NamedPipeNotifier {
- id: notifier
- onReadyRead: {
- player.source = name
- player.play()
- }
- }
-
- Component.onCompleted: {
- notifier.start()
- }
- onStopped: {
- notifier.start()
-
- }
- function startStream(url) {
- notifier.name = url
- notifier.start()
- }
- }
-
- Loader {
- id: contentLoader
- height: parent.height - Constants.margin
- width: parent.width - 2 * Constants.margin
- asynchronous: true
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.leftMargin: Constants.margin
- anchors.rightMargin: Constants.margin
- anchors.bottomMargin: Constants.margin
-
-
- source:startQml
- property var viewTransitionStack : []
-
- function reset() {
- viewTransitionStack = []
- }
-
- property string currentLocation
- function go(path, appId) {
- console.debug("enter:", path, ", appId:", appId)
- if (path) {
- if (currentLocation !== path) {
- viewTransitionStack.push({ uri: source.toString(), applicationContext: false })
- if (appId) {
- dataContainer.setCurrentApplication(appId)
- }
- item.leaveScreen()
- currentLocation = path
- source = path
- }
- }
- console.debug("exit")
- }
-
- function back() {
- if (viewTransitionStack.length) {
- item.leaveScreen()
- source = viewTransitionStack.pop().uri
- }
- currentLocation = ""
- }
-
- onStatusChanged: {
- if (status == Component.Ready) {
- if (!dataContainer.activeAlert) {
- dataContainer.applicationContext = item.applicationContext
- }
- else {
- dataContainer.applicationSavedContext = item.applicationContext
- }
- if (viewTransitionStack && viewTransitionStack.length) {
- viewTransitionStack[viewTransitionStack.length - 1].applicationContext = item.applicationContext
- }
- dataContainer.setSystemContext()
- }
- }
- }
- }
-
- WarningInfo { id: warningInfo }
-
- VRHelpPopup {
- id: vrHelpPopup
- popUpName: "UI.VrHelp"
- anchors.centerIn: parent
- visible: false
- }
-
- InteractionPopup {
- id: interactionPopup
- popUpName: "UI.PerformInteraction"
- anchors.centerIn: parent
- visible: false
- }
-
- SliderPopup {
- id: sliderPopup
- popUpName: "UI.Slider"
- anchors.centerIn: parent
- visible: false
- }
-
- PerformAudioPassThruPopup {
- id: performAudioPassThruPopup
- popUpName: "UI.PerformAudioPassThru"
- anchors.centerIn: parent
- visible: false
- }
-
- AlertWindow {
- id: alertWindow
- popUpName: "UI.Alert"
- objectName: "AlertWindow"
- anchors.fill: parent
- visible: false
- }
-
- UserActionPopUp {
- id: userActionPopUp
- popUpName: "ActionPopUp"
- objectName: "ActionPopUp"
- anchors.fill: parent
- visible: false
- }
-
- OnAppPermissionConsentPopUp {
- id: onAppPermissionConsentPopUp
- popUpName: "onAppPermissionConsent"
- objectName: "onAppPermissionConsent"
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: simulationScreen
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.left: mainScreen.right
- width: simulationPanel.width
- clip: true
- SimulationView {
- id: simulationPanel
-
- VRPopUp {
- id: vrPopUp
- visible: false
- anchors.fill: parent
- }
-
- TTSPopUp {
- id: ttsPopUp
- anchors.top: parent.top
- anchors.right: parent.right
- visible: false
- }
- }
- }
-
- Item {
- id: hardwareScreen
- anchors.top: mainScreen.bottom
- anchors.left: parent.left
- anchors.right: simulationScreen.left
- height: hardwarePanel.height
- clip: true
- HardwareButtonsView { id: hardwarePanel }
- }
-
- HMIAdapter {
- HmiApi.ButtonsProxy {
- id: sdlButtons
- objectName: "Buttons"
- }
- HmiApi.BasicCommunicationProxy {
- id: sdlBasicCommunication
- objectName: "BasicCommunication"
- }
- HmiApi.VRProxy {
- id: sdlVR
- objectName: "VR"
- }
- HmiApi.TTSProxy {
- id: sdlTTS
- objectName: "TTS"
- }
- HmiApi.NavigationProxy {
- id: sdlNavigation
- objectName: "Navigation"
- }
- HmiApi.VehicleInfoProxy {
- id: sdlVehicleInfo
- objectName: "VehicleInfo"
- }
- HmiApi.UIProxy {
- id: sdlUI
- objectName: "UI"
- }
-
- HmiApi.SDLProxy {
- id: sdlSDL
- objectName: "SDL"
- }
- }
-
- SDLAdapter {
- id: sdlProxy
-
- onOnResumeAudioSource: {
-
- }
-
- onOnFileRemoved: {
-
- }
-
- onOnAppRegistered: {
- console.debug("enter onAppRegistered")
- var appTypeToAdd = 0
- if (application.appType !== undefined) {
- for (var index in application.appType) {
- if (application.appType[index] > 31) {
- return { __retCode: Common.Result.GENERIC_ERROR, __message: "Apptype value > 31" }
- }
- appTypeToAdd |= 1 << application.appType[index]
- }
- }
-
- dataContainer.addApplication(
- {
- appName: application.appName,
- ngnMediaScreenAppName: application.ngnMediaScreenAppName,
- icon: application.icon,
- deviceName: application.deviceName,
- appId: application.appID,
- hmiDisplayLanguageDesired: application.hmiDisplayLanguageDesired,
- isMediaApplication: application.isMediaApplication,
- appType: appTypeToAdd,
- hmiUIText: { },
- mediaClock: {
- "updateMode": Internal.MediaClockUpdateMode.MCU_COUNTUP,
- "runningMode": Internal.MediaClockRunningMode.MCR_STOPPED,
- "startTime": -1,
- "endTime": -1,
- "startTimeForProgress": -1
- }
- });
- console.debug("exit onAppRegistered")
- }
-
- onOnAppUnregistered: {
- console.debug("enter onAppUnregistered")
- if ((dataContainer.currentApplication.appId === appID)) {
- if (dataContainer.applicationContext) {
- contentLoader.go("views/ApplicationListView.qml");
- }
- if (contentLoader.viewTransitionStack.filter(function(x) { return x.applicationContext })) {
- contentLoader.reset();
- }
- dataContainer.currentApplication.reset()
- }
- dataContainer.removeApplication(appID);
- console.debug("exit onAppUnregistered")
- }
-
- onPlayTone: {
- beep.play()
- }
-
- onOnSDLClose: {
-
- }
-
- onOnPutFile: {
- console.log("OnPutFile: ", offset, length, fileSize, FileName,
- syncFileName, fileType, persistentFile);
- }
-
- onOnRecordStart: {
-
- }
-
- onOnAppPermissionChanged: {
-
- }
-
-
- onOnSDLConsentNeeded: {
-
- }
-
- onOnStatusUpdate: {
- console.log("enter onStatusUpdate")
- settingsContainer.updateStatus(status);
- }
- }
-
- Component.onCompleted: {
- dataContainer.hmiVRAvailable = true
- dataContainer.hmiTTSAvailable = true
- dataContainer.hmiNavigationAvailable = true
- dataContainer.hmiVehicleInfoAvailable = true
- dataContainer.hmiUIAvailable = true
-
- sdlBasicCommunication.onReady()
- }
-
- /*
- * Test Support Section
- *
- */
- function getSlider(){
- return sliderPopup
- }
-
- function getDataStorage(){
- return dataContainer
- }
-
- function getUIProxy(){
- return sdlUI
- }
-
- function getMainScreen(){
- return mainScreen
- }
-
- function getContentLoader(){
- return contentLoader
- }
-
- function getWarningInfo(){
- return warningInfo
- }
- /*
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml b/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml
deleted file mode 100644
index 58cba17707..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ArrowKeys.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @file ArrowKeys.qml
- * @brief Keys with arrow for cursor movement.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- width: buttonOk.width
- height: buttonOk.height
-
- HardwareButton {
- id: arrowUp
- buttonId: Common.ButtonName.TUNEUP
- name: "Up"
- }
- HardwareButton {
- id: arrowDown
- buttonId: Common.ButtonName.TUNEDOWN
- name: "Down"
- }
- HardwareButton {
- id: arrowLeft
- buttonId: Common.ButtonName.SEEKLEFT
- name: "Left"
- }
- HardwareButton {
- id: arrowRight
- buttonId: Common.ButtonName.SEEKRIGHT
- name: "Right"
- }
- HardwareButton {
- id: buttonOk
- buttonId: Common.ButtonName.OK
- name: "Ok"
- longPressAvailable: false
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml
deleted file mode 100644
index 5d82f15592..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/BackButton.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file BackButton.qml
- * @brief Button "Back" that return to previous menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-OvalButton {
- text: "Back"
- onClicked: { contentLoader.back() }
- fontSize: Constants.fontSize
- opacity: 0
-
- NumberAnimation on opacity {
- to: 1;
- duration: Constants.animationDuration
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml
deleted file mode 100644
index f0755b3980..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/CircleButton.qml
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * @file CircleButton.qml
- * @brief Parent class for circle button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Image {
- id: circleBtn
- source: imgOff
- property alias text: btnText.text
- property alias pixelSize: btnText.font.pixelSize
- property string dest: ""
- property bool isPressed: false
- property string imgOff: "../res/buttons/round_btn.png"
- property string imgOn: "../res/buttons/round_pressed_btn.png"
- property string textColorOnPressed: Constants.secondaryColor
- property string textColorDefault: Constants.primaryColor
-
- signal clicked()
- function wasClicked()
- {
- clicked()
- }
-
- Text {
- anchors.centerIn: parent
- id: btnText
- color: textColorDefault
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- console.log("CircleButton onPressed enter");
- source = imgOn
- btnText.color = textColorOnPressed
- isPressed = true
- console.log("CircleButton onPressed exit");
- }
- onReleased: {
- console.log("CircleButton onReleased enter");
- source = imgOff
- btnText.color = textColorDefault
- isPressed = false
- console.log("CircleButton onReleased exit");
- }
- onClicked: {
- console.log("CircleButton onClicked enter");
- if(dest !== ""){
- contentLoader.go(dest)
- }
- circleBtn.wasClicked()
- console.log("CircleButton onClicked enter");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml
deleted file mode 100644
index dc1231570a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ClickableImage.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file ClickableImage.qml
- * @brief Clickable image item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Image {
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked()
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- parent.scale = Constants.pressedIconScale
- parent.pressed()
- }
-
- onReleased: {
- parent.scale = 1
- parent.released()
- }
-
- onCanceled: {
- parent.scale = 1
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml
deleted file mode 100644
index c56e3dc13d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ClickableText.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file ClickableText.qml
- * @brief Clickable text item
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-Text {
- property string defaultColor
- property string pressedColor
- signal pressed ()
- signal released ()
- signal canceled ()
- signal clicked ()
-
- color: defaultColor
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- press()
- parent.pressed()
- }
-
- onReleased: {
- release()
- parent.released()
- }
-
- onCanceled: {
- release()
- parent.canceled()
- }
-
- onClicked: {
- parent.clicked()
- }
- }
-
- function press () {
- color = pressedColor
- }
-
- function release () {
- color = defaultColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml b/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml
deleted file mode 100644
index 9211ac1baf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ClimateControlBtn.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * @file ClimateControlBtn.qml
- * @brief Round button, which is used at climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item
-{
- id: climateControlBtn
- width: climateBtnImg.width
- height: climateBtnImg.height
- property string name: ""
- property string txt: ""
- state: "off"
-
- Image {
- id: climateBtnImg
- source: climateControlBtn.state === "off" ? "../res/climate/climate_round_off_btn.png" : "../res/climate/climate_round_on_btn.png"
-
- Image {
- id: hoverImg
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- property string st: climateControlBtn.state === "off" ? "_off" : "_on"
- source: climateControlBtn.name === "" ? "": "../res/climate/" + climateControlBtn.name + st + ".png"
- }
-
- Text {
- id: hoverText
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: climateControlBtn.txt
- font.pixelSize: Constants.fontSize
- color: climateControlBtn.state === "off" ? Constants.primaryColor : Constants.secondaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if(climateControlBtn.state === "on") {
- climateControlBtn.state = "off"
- climateBtnImg.source = "../res/climate/climate_round_off_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.primaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_off.png"
- }
- } else {
- climateControlBtn.state = "on"
- climateBtnImg.source = "../res/climate/climate_round_on_btn.png"
- if(climateControlBtn.txt != "") {
- hoverText.color = Constants.secondaryColor
- }
- if(climateControlBtn.name != "") {
- hoverImg.source = "../res/climate/" + climateControlBtn.name + "_on.png"
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml b/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml
deleted file mode 100644
index 3695070dfd..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/GradientRectangle.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-/**
- * @file GradientRectangle.qml
- * @brief Rectangle with gradient.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-Rectangle {
- property string firstColor: "grey"
- property string secondColor: "#2E2E2E"
- property alias fontSize: text.font.pixelSize
- property alias text: text.text
- property int customButtonID
- property bool isCustomButton: false
- property bool clickProcessed
- signal pressed()
- signal released()
-
- radius: 5
- border.color: "#D3D3D3"
-
- Text {
- id: text
- anchors.fill: parent
- font.pixelSize: Constants.titleFontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- elide: Text.ElideRight
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- firstColor = "#2E2E2E"
- secondColor = "grey"
- parent.pressed()
- }
- onReleased: {
- firstColor = "grey"
- secondColor = "#2E2E2E"
- parent.released()
- }
- }
-
- Timer {
- id: timer
- interval: Constants.customButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- onPressed: {
- if (isCustomButton) {
- timer.start()
- clickProcessed = false
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, customButtonID)
- }
- }
-
- onReleased: {
- if (isCustomButton) {
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, customButtonID)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, customButtonID)
- }
- }
- }
-
- Connections {
- target: timer
- onTriggered: {
- if (isCustomButton) {
- if(!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, customButtonID)
- clickProcessed = true
- }
- }
- }
- }
-
- gradient: Gradient {
- GradientStop {
- position: 0.1
- color: firstColor
- }
- GradientStop {
- position: 0.5
- color: secondColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml b/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml
deleted file mode 100644
index 39e1f0d7c4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/GridItem.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file GridItem.qml
- * @brief Item with animation for GridMenu
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- id: item
- opacity: 0
- SequentialAnimation {
- id: animation
- PauseAnimation {duration: index * 100 }
- NumberAnimation {
- target: item
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
- Component.onCompleted: {
- animation.start()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml
deleted file mode 100644
index 47f034082e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/HardwareButton.qml
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @file HardwareButton.qml
- * @brief Parent class for hardware button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-import "../hmi_api/Common.js" as Common
-
-MaskedContainer {
- property string name
- property int buttonId: Common.ButtonName.CUSTOM_BUTTON
- property bool upDownAvailable: true
- property bool shortPressAvailable: true
- property bool longPressAvailable: true
-
- signal hold
-
- Image {
- source: "../res/controlButtons/" + name + "Button.png"
- }
- Image {
- id: pressedImg
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- visible: false
- Behavior on opacity {
- NumberAnimation { duration: 80 }
- }
- }
- Timer {
- id: timer
- interval: 2000
- repeat: false
- triggeredOnStart: false
- }
- property bool clickProcessed
- onPressed: {
- clickProcessed = false
- pressedImg.visible = true
- timer.start()
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- }
-
- onReleased: {
- if (upDownAvailable) {
- sdlButtons.onButtonEvent(buttonId, Common.ButtonEventMode.BUTTONUP, undefined)
- }
- timer.stop()
- if (!clickProcessed && shortPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.SHORT, undefined)
- }
- pressedImg.visible = false
- }
-
- Connections {
- target: timer
- onTriggered: {
- if(!clickProcessed && longPressAvailable) {
- sdlButtons.onButtonPress(buttonId, Common.ButtonPressMode.LONG, undefined)
- clickProcessed = true
- hold()
- }
- }
- }
-
- Component.onCompleted: {
- if (buttonId !== Common.ButtonName.CUSTOM_BUTTON) {
- settingsContainer.buttonCapabilities.push(
- {
- name: buttonId,
- upDownAvailable: upDownAvailable,
- shortPressAvailable: shortPressAvailable,
- longPressAvailable: longPressAvailable
- });
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml b/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml
deleted file mode 100644
index 26cfe9abe0..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/HeaderMenu.qml
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * @file HeaderMenu.qml
- * @brief Header menu view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- id: headerMenu
- anchors.fill: parent
- Text {
- anchors.leftMargin: Constants.margin
- anchors.topMargin: Constants.margin
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: "75°"
- }
-
- Item {
- width: menuText.width
- height: parent.height
- anchors.topMargin: Constants.margin
- anchors.horizontalCenter: headerMenu.horizontalCenter
- signal clicked ()
-
- ClickableText {
- id: menuLogo
- anchors.horizontalCenter: menuText.horizontalCenter
- anchors.bottom: parent.verticalCenter
- text: "≡"
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuText.press()
- onReleased: menuText.release()
- onCanceled: menuText.release()
- }
-
- ClickableText {
- id: menuText
- anchors.top: parent.verticalCenter
- text: "MENU";
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.fontSize
-
- onClicked: parent.clicked()
- onPressed: menuLogo.press()
- onReleased: menuLogo.release()
- onCanceled: menuLogo.release()
- }
-
- onClicked: {
- contentLoader.go("./views/MainMenuView.qml")
- }
- }
-
- Row {
- id: clock
- height: childrenRect.height
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.rightMargin: Constants.margin
- anchors.topMargin: Constants.margin
- property date date: new Date()
-
- Timer {
- running: true
- repeat: true
- interval: 1000
- onTriggered: {
- clock.date = new Date();
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "hh");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
-
- Item {
- width: 10
- height: parent.height
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: clock.date.getSeconds() % 2 ? ":" : ""
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-
- Text {
- text: Qt.formatTime(clock.date, "mm");
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize;
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml b/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml
deleted file mode 100644
index 2aa7019428..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/Icon.qml
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Icon.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- property var source
-
- Image {
- anchors.fill: parent
- source: url(parent.source)
-
- function image(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.STATIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
-
- function url(turnIcon) {
- if (turnIcon && turnIcon.imageType === Common.ImageType.DYNAMIC) {
- return turnIcon.value;
- } else {
- return "";
- }
- }
- }
-
- function reset () {
- source = undefined
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml b/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml
deleted file mode 100644
index 6373237241..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ListItem.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @file Entry.qml
- * @brief Entry with icon and text for list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: main
- color: Constants.transparentColor
-
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
-
- Icon {
- id: image
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- anchors.left: parent.left
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- anchors.verticalCenter: parent.verticalCenter
- height: image.height
- width: parent.width - image.width
- z: 50
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- text: "Name Entry"
- anchors.left: image.right
- anchors.leftMargin: Constants.generalSpacing
- anchors.verticalCenterOffset: 0
- visible: text !== ""
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml
deleted file mode 100644
index a7f91dd397..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/MaskedButton.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * @file MaskedButton.qml
- * @brief Masked button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import com.ford.sdl.hmi.hw_buttons 1.0
-
-MaskedContainer {
- property string name
-
- Image {
- id: icon
- source: "../res/controlButtons/" + name + "Button.png"
- }
-
- onPressed: {
- state = "pressed";
- }
-
- onReleased: {
- state = "";
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: icon
- source: "../res/controlButtons/" + name + "Button_pressed.png"
- }
- }
-
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml b/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml
deleted file mode 100644
index 32626d292d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/MultiTouchArea.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-MultiPointTouchArea {
- property date created
-
- minimumTouchPoints: 1
- maximumTouchPoints: 10
-
- MouseArea {
- anchors.fill: parent
-
- function mouseTouchEvent() {
- var now = new Date()
- var touchEvents = [
- {
- id: 0,
- ts: [now.valueOf() - created.valueOf()],
- c: [{x: mouseX, y: mouseY}]
- }
- ]
- return touchEvents
- }
-
- onPressed: {
- sdlUI.onTouchEvent(Common.TouchType.BEGIN, mouseTouchEvent())
- }
- onReleased: {
- sdlUI.onTouchEvent(Common.TouchType.END, mouseTouchEvent())
- }
- onCanceled: {
- sdlUI.onTouchEvent(Common.TouchType.END, mouseTouchEvent())
- }
- onPositionChanged: {
- sdlUI.onTouchEvent(Common.TouchType.MOVE, mouseTouchEvent())
- }
- }
-
- function touchEvents() {
- var now = new Date()
- var touchEvents = []
- for (var i = 0; i < touchPoints.length; ++i) {
- touchEvents.push(
- {
-// pointId is guaranteed to be unique but is not guaranteed to fit in range
-// perhaps we will have to edit protocol xml
- id: touchPoints[i].pointId,
- ts: [now.valueOf() - created.valueOf()],
- c: [{x: touchPoints[i].x, y: touchPoints[i].y}]
- }
- )
- }
- return touchEvents
- }
-
- onPressed: {
- sdlUI.onTouchEvent(Common.TouchType.BEGIN, touchEvents())
- }
- onReleased: {
- sdlUI.onTouchEvent(Common.TouchType.END, touchEvents())
- }
- onCanceled: {
- sdlUI.onTouchEvent(Common.TouchType.END, touchEvents())
- }
- onUpdated: {
- sdlUI.onTouchEvent(Common.TouchType.MOVE, touchEvents())
- }
- Component.onCompleted: {
- created = new Date()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml
deleted file mode 100644
index 6d68a9096b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/OvalButton.qml
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * @file OvalButton.qml
- * @brief Oval button with flexible width.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtGraphicalEffects 1.0
-import "../models/Constants.js" as Constants
-
-// Don't change constants. It break button
-// TODO (dchmerev@luxoft.com): make this comment more clear
-// todo (ykazakov): eliminate this problem and remove all such comments
-
-Item {
- id: main
- width: dynamic ? field.width + 2 * left.width : Constants.ovalButtonWidth
- height: Constants.ovalButtonHeight
-
- signal clicked;
- signal pressed;
- signal released;
- signal pressAndHold;
- property alias text: label.text
- property alias fontSize: label.font.pixelSize
- property alias icon: image.source
- property bool highlighted: false
- property bool dynamic: false
- property bool disabled: false
-
- function hue() {
- var ret = 0;
- if (disabled) {
- ret = Constants.disabledButtonHue;
- } else if (highlighted) {
- ret = Constants.highlightedButtonHue;
- }
- return ret;
- }
-
- function saturation() {
- var ret = 0;
- if (disabled) {
- ret = Constants.disabledButtonSaturation;
- } else if (highlighted) {
- ret = Constants.highlightedButtonSaturation;
- }
- return ret;
- }
-
- function lightness() {
- var ret = 0;
- if (disabled) {
- ret = Constants.disabledButtonLightness;
- } else if (highlighted) {
- ret = Constants.highlightedButtonLightness;
- }
- return ret;
- }
-
- Item {
- id: buttonBorderImage
- visible: false
- anchors.fill: parent
- Image {
- id: left
- width: 31
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- anchors.top: parent.top
- source: "../res/buttons/oval_btn_left.png"
- }
-
- Image {
- id: right
- width: 31
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- source: "../res/buttons/oval_btn_right.png"
- }
-
- Image {
- id: top
- height: 10
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.top: parent.top
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_top.png"
- }
-
- Image {
- id: bottom
- height: 11
- anchors.right: parent.right
- anchors.rightMargin: 31
- anchors.left: parent.left
- anchors.leftMargin: 31
- anchors.bottom: parent.bottom
- fillMode: Image.TileHorizontally
- source: "../res/buttons/oval_btn_bottom.png"
- }
- }
-
- HueSaturation {
- anchors.fill: buttonBorderImage
- source: buttonBorderImage
- hue: main.hue()
- saturation: main.saturation()
- lightness: main.lightness()
- }
-
- Rectangle {
- id: background
- color: Constants.transparentColor
- anchors.fill: parent
- anchors.rightMargin: 31
- anchors.leftMargin: 31
- anchors.bottomMargin: 10
- anchors.topMargin: 10
- visible: false
- }
-
- HueSaturation {
- anchors.fill: background
- source: background
- hue: main.hue()
- saturation: main.saturation()
- lightness: main.lightness()
- }
-
- MouseArea {
- id: mousearea
- anchors.rightMargin: 15
- anchors.leftMargin: 15
- anchors.bottomMargin: 11
- anchors.topMargin: 10
- anchors.fill: parent
- enabled: !parent.disabled
- onPressed: {
- parent.state = "pressed";
- parent.pressed();
- }
- onReleased: {
- parent.state = "";
- parent.released();
- }
- onClicked: {
- parent.clicked();
- }
- onPressAndHold: {
- parent.pressAndHold();
- }
- onCanceled: {
- parent.state = "";
- }
- }
-
- Item {
- id: field
- anchors.fill: background
-
- Icon {
- id: image
- width: Constants.iconButtonSize
- height: Constants.iconButtonSize
- anchors.verticalCenter: parent.verticalCenter
- visible: source ? true : false
- }
- Text {
- id: label
- width: image.visible ? parent.width - image.width : parent.width
- color: Constants.primaryColor
- anchors.centerIn: parent
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: Constants.ovalButtonFontSize
- visible: false
- elide: Text.ElideRight
- }
- HueSaturation {
- anchors.fill: label
- source: label
- hue: main.hue()
- saturation: main.saturation()
- lightness: main.lightness()
- visible: label.text !== ""
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: left
- source: "../res/buttons/oval_btn_pressed_left.png"
- }
-
- PropertyChanges {
- target: right
- source: "../res/buttons/oval_btn_pressed_right.png"
- }
-
- PropertyChanges {
- target: background
- color: Constants.primaryColor
- }
-
- PropertyChanges {
- target: label
- color: Constants.secondaryColor
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml b/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml
deleted file mode 100644
index 5b150d560d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PagedFlickable.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @file PagedFlickable.qml
- * @brief Animated row.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-Item
-{
- id: flickablePage
- height: container.height + pager.height
- default property alias content: containerRow.children
- property alias spacing: containerRow.spacing
- property int elementWidth
- property int snapTo
- property int count: 0
-
- Flickable {
- id: container
- anchors.bottom: parent.bottom
- maximumFlickVelocity: 1500
- contentWidth: containerRow.width
- height: containerRow.height
- width: parent.width
- interactive: contentWidth > width
-
- onMovementEnded: {
- var rest = contentX % snapTo
- var t = 0.25
- if (rest > parent.snapTo / 2) {
- rest = rest - parent.snapTo
- }
- var vel = 2 * rest / t
- flickDeceleration = Math.abs(vel) / t
- flick(vel, 0)
- flickDeceleration = 1500
- }
- Row {
- id: containerRow
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Pager {
- id: pager
- space: 7
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
-
- pages: {
- if ( (container.contentWidth % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentWidth / container.width)
- }
- else {
- return Math.floor(container.contentWidth / container.width)
- }
- }
-
- activePage: {
- if (container.contentX <= 0) {
- return 0
- }
- else if ( (container.contentWidth - container.contentX) < container.width) {
- return pages -1
- }
- else {
- if ( (container.contentX % container.width) >= (flickablePage.elementWidth / 2 + flickablePage.spacing)) {
- return Math.ceil(container.contentX / container.width)
- }
- else if ( (container.contentX % container.width) > 0) {
- return Math.floor(container.contentX / container.width)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml b/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml
deleted file mode 100644
index 53d99436ce..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/Pager.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file Pager.qml
- * @brief Bubbles that indicate about page switch.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-Row {
- id: pager
- property int pages
- property int activePage: 0
- property int space
- property int itemsInRowOnScreen: 3
-
- spacing: space
- visible: pages !== 1
-
- Repeater {
- model: pages
- Image {
- source: index === activePage ? "../res/white_ball.png" : "../res/blue_ball.png"
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml
deleted file mode 100644
index bb1cb38388..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PlayPauseButton.qml
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file PlayPauseButton.qml
- * @brief Behavior of Play/Pause button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-Image {
- id: playPauseButton
- property string sourceOnPressed: ""
- property string sourceOnReleased: ""
-
- signal clicked
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- playPauseButton.source = playPauseButton.sourceOnPressed
- }
- onReleased: {
- playPauseButton.source = playPauseButton.sourceOnReleased
- }
- onClicked: {
- playPauseButton.clicked()
- }
- }
- states: [
- State {
- name: "Play"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_play_btn.png"
- sourceOnPressed: "../res/buttons/player_play_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_pause_btn.png"
- }
- },
-
- State {
- name: "Pause"
- PropertyChanges {
- target: playPauseButton
- source: "../res/buttons/player_pause_btn.png"
- sourceOnPressed: "../res/buttons/player_pause_pressed_btn.png"
- sourceOnReleased: "../res/buttons/player_play_btn.png"
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml
deleted file mode 100644
index 95a751c39b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PowerSwitchButton.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file PowerSwitchBtn.qml
- * @brief On/Off button.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: powerSwitchBtn
- state: "Turn ON"
- width: 120
- height: 80
- radius: 5
- property bool pressed;
-
- gradient: Gradient {
- GradientStop { position: pressed ? 1.0 : 0.0; color: "#2c2c2c" }
- GradientStop { position: pressed ? 0.0 : 1.0; color: "black" }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.pressed = true
- }
- onReleased: {
- parent.pressed = false
- parent.state = parent.state === "Turn ON" ? "Turn OFF" : "Turn ON"
- btnText.text = parent.state
- if (parent.state === "Turn OFF") {
- contentLoader.reset()
- mainScreen.visible = true
- warningInfo.showOkButton()
- }
- }
- }
-
- Text {
- id: btnText
- color: "red"
- text: parent.state
- anchors.centerIn: parent
- font.pixelSize: Constants.powerButtonFornSize
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml b/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml
deleted file mode 100644
index 32e74d71bb..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PresetRow.qml
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * @file PresetRow.qml
- * @brief Animated row with radio stations.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- id: presetRow
- height: childrenRect.height
- property variant presets: []
- property int selectedIndex: 0
- signal presetSelected
- signal presetButtonPressed()
- signal presetButtonReleased()
- signal presetButtonClicked()
- signal presetButtonHold()
-
- Image {
- id: circleButton
- source: "../res/buttons/preset_pressed_btn.png"
- visible: false
- enabled: false
- }
-
- PagedFlickable {
- width: parent.width
- spacing: (width - (circleButton.width * 4)) / 3
- snapTo: spacing + circleButton.width
- elementWidth: circleButton.width
-
- Repeater {
- model: presetRow.presets.length
- delegate:
- Column {
- width: circleButton.width
- Image {
- anchors.horizontalCenter: parent.horizontalCenter
- source: presetRow.selectedIndex === index ? "../res/buttons/preset_pressed_btn.png" : "../res/buttons/preset_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- presetRow.selectedIndex = index;
- presetButtonPressed()
- }
- onReleased: {
- presetRow.selectedIndex = index;
- presetButtonReleased()
- }
- onClicked: {
- presetRow.selectedIndex = index
- presetButtonClicked()
- }
- onPressAndHold: {
- presetRow.selectedIndex = index;
- presetButtonHold()
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- text: index + 1
- font.pixelSize: Constants.fontSize
- color: presetRow.selectedIndex === index ? Constants.secondaryColor : Constants.primaryColor
- }
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: presetRow.presets[index]
- font.pixelSize: Constants.fontSize
- color: "white"
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml
deleted file mode 100644
index f83370a207..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/PushButton.qml
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * @file PushButton.qml
- * @brief Simple button
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-Rectangle {
- id: toggleButton
- width: 160
- height: 40
- radius: 2
- border.width: 2
- border.color: "#000000"
- gradient: grUnpressed
-
- property alias label : label.text
-
- signal pressed()
- signal unpressed()
- signal clicked()
-
- property bool toggleMode: false
-
- state: "unpressed"
- onStateChanged: {
- if (state == "pressed") {
- pressed();
- } else {
- unpressed();
- }
- }
-
- Text {
- id: label
- color: "white"
- text: "PushButton"
- font.pixelSize: 18
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.fill: parent
- }
- MouseArea {
- id: mouseArea
-
- anchors.fill: parent
- onPressed: {
- if (toggleMode) {
- if (parent.state == "unpressed") {
- parent.state = "pressed"
- } else {
- parent.state = "unpressed"
- }
- } else {
- parent.state = "pressed"
- }
- }
- onReleased: {
- if (!toggleMode) {
- parent.state = "unpressed"
- if (mouse.isClick) {
- parent.clicked()
- }
- }
- }
- }
-
- states: [
- State {
- name: "pressed"
- PropertyChanges {
- target: toggleButton
- gradient: grPressed
- }
- },
- State {
- name: "unpressed"
- PropertyChanges {
- target: toggleButton
- gradient: grUnpressed
- }
- }
- ]
-
- Gradient {
- id: grUnpressed
-
- GradientStop { position: 0.0; color: "#2c2c2c" }
- GradientStop { position: 1.0; color: "#0c0c0c" }
- }
-
- Gradient {
- id: grPressed
-
- GradientStop { position: 0.0; color: "black" }
- GradientStop { position: 1.0; color: "black" }
- }
-
- transitions: [
- Transition {
- from: "unpressed"
- to: "pressed"
- reversible: true
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml b/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml
deleted file mode 100644
index a63960d16d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/ScrollableListView.qml
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * @file ScrollableListView.qml
- * @brief ListView with scrollbar on the right
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-ListView {
- clip: true
-
- Rectangle {
- visible: parent.height < parent.contentHeight
- anchors.right: parent.right
- y: parent.visibleArea.yPosition * parent.height
- width: Constants.scrollBarWidth
- height: parent.visibleArea.heightRatio * parent.height
- color: Constants.primaryColor
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js
deleted file mode 100644
index 227f638366..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * @file SoftButton.js
- * @brief Soft button view constants
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-var Action = {
- doOnClicked: 0,
- doOnReleased: 1
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml b/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
deleted file mode 100644
index b1b7f71799..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/SoftButton.qml
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * @file SoftButton.qml
- * @brief Soft button view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "SoftButton.js" as SoftButton
-
-OvalButton {
- property var button
- property int appId
- visible: !!button
-
- signal defaultAction;
- signal stealFocus;
- signal keepContext;
-
- property int actionOrder: SoftButton.Action.doOnClicked
-
- highlighted: button ? button.isHighlighted : false
- onPressed: {
- actionOrder = SoftButton.Action.doOnClicked
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONDOWN, button.softButtonID, appId)
- }
-
- onReleased: {
- if (actionOrder === SoftButton.Action.doOnReleased) {
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- sdlButtons.onButtonEvent(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonEventMode.BUTTONUP, button.softButtonID, appId)
- }
-
- onClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.SHORT, button.softButtonID, appId);
- switch (button.systemAction) {
- case Common.SystemAction.DEFAULT_ACTION:
- defaultAction();
- break;
- case Common.SystemAction.STEAL_FOCUS:
- stealFocus();
- break;
- case Common.SystemAction.KEEP_CONTEXT:
- keepContext();
- break;
- }
- }
-
- onPressAndHold: {
- actionOrder = SoftButton.Action.doOnReleased; // action should be triggered on release
- sdlButtons.onButtonPress(Common.ButtonName.CUSTOM_BUTTON, Common.ButtonPressMode.LONG, button.softButtonID, appId);
- }
-
- onButtonChanged: {
- icon = button && button.type !== Common.SoftButtonType.SBT_TEXT ? button.image : undefined;
- text = button && button.type !== Common.SoftButtonType.SBT_IMAGE ? button.text : ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml b/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml
deleted file mode 100644
index c06ebc45e4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/controls/StatusBar.qml
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file StatusBar.qml
- * @brief Status bar that contains text string.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Text {
- text: dataContainer.currentApplication.hmiUIText.statusBar
- color: Constants.primaryColor
- font.pixelSize: Constants.statusBarFontSize
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js b/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js
deleted file mode 100644
index ebc5bfa3ca..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/Async.js
+++ /dev/null
@@ -1,7 +0,0 @@
-.pragma library
-
-var async_uid = 1;
-
-function AsyncCall() {
- this.__async_uid = async_uid++;
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml
deleted file mode 100644
index ba066e628b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/BasicCommunication.qml
+++ /dev/null
@@ -1,187 +0,0 @@
-/**
- * @file BasicCommunication.qml
- * @brief Implement of interface Basic Communication.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- function updateDeviceList (deviceList) {
- var deviceListLog = "";
- deviceList.forEach(function (device) {
- deviceListLog += "{name: '" + device.name + "', " +
- "id: '" + device.id + "'},";
- });
- console.log("Message Received - {method: 'BasicCommunication.UpdateDeviceList', params:{ " +
- "deviceList: [" + deviceListLog + "]" +
- "}}")
-
- deviceList.forEach(function (device) {
- var exist = false;
- for (var i = 0; i < dataContainer.deviceList.count; ++i) {
- exist = device.id === dataContainer.deviceList[i].devid;
- }
- if (!exist) {
- dataContainer.deviceList.append({ name: device.name,
- devid: device.id,
- allowed: false})
- }
- });
-
- for (var i = 0; i < dataContainer.deviceList.count; ++i) {
- deviceList.forEach(function (device) {
- var exist = dataContainer.deviceList[i].id === device.id;
- if (!exist) {
- dataContainer.deviceList.remove(i);
- }
- });
- }
- }
-
- function updateAppList (applications) {
- var applicationsLog = "",
- appTypeLog = "";
- if (applications) {
- for (var i = 0; i < applications.length; i++) {
- appTypeLog = "";
-
- for (var j = 0; j < applications[i].appType.length; i++) {
- appTypeLog += "'" + applications[i].appType + "', "
- }
-
- applicationsLog += "{name: '" + applications[i].name + "', " +
- "appName: '" + applications[i].appName + "', " +
- "ngnMediaScreenAppName: '" + applications[i].ngnMediaScreenAppName + "', " +
- "icon: '" + applications[i].icon + "', " +
- "deviceName: '" + applications[i].deviceName + "', " +
- "appID: " + applications[i].appID + ", " +
- "hmiDisplayLanguageDesired: '" + applications[i].hmiDisplayLanguageDesired + "', " +
- "isMediaApplication: " + applications[i].isMediaApplication + ", " +
- "appType: [" + applications[i].deviceName + "]" +
- "},";
- }
- }
- console.log("Message Received - {method: 'BasicCommunication.UpdateAppList', params:{ " +
- "applications: [" + applicationsLog + "]" +
- "}}")
-
-
- dataContainer.applicationList.clear();
- for(var i = 0; i < applications.length; i++) {
- dataContainer.applicationList.append({
- appName: applications[i].appName,
- ngnMediaScreenAppName: applications[i].ngnMediaScreenAppName,
- icon: applications[i].icon,
- deviceName: applications[i].deviceName,
- appId: applications[i].appID,
- hmiDisplayLanguageDesired: applications[i].hmiDisplayLanguageDesired,
- isMediaApplication: applications[i].isMediaApplication,
- appType: applications[i].appType
- });
- }
- }
-
- function getResumeResult (appID) {
- return dataContainer.getResumeResult(appID)
- }
-
- function allowDeviceToConnect (device) {
- console.log("Message Received - {method: 'BasicCommunication.AllowDeviceToConnect', params:{ " +
- "device: {name: '" + device.name + "', " +
- "id: '" + device.id + "'}," +
- "}}")
- return {
- allow: true
- }
- }
-
- function mixingAudioSupported() {
- console.log("Message Received - {method: 'BasicCommunication.MixingAudioSupported'}")
- return {
- attenuatedSupport: true
- }
- }
-
- function allowAllApps() {
- console.log("Message Received - {method: 'BasicCommunication.AllowAllApps'}")
- return {
- allowed: true
- }
- }
-
- function allowApp(app, appPermissions) {
- console.log("Message Received - {method: 'BasicCommunication.AllowApp'}")
- return {
- allowed: true
- }
- }
-
- function activateApp(appID, priority, level) {
- console.log("Message Received - {method: 'BasicCommunication.ActivateApp', params:{ " +
- "appID: " + appID +
- "}}")
- contentLoader.go("views/SDLPlayerView.qml", appID);
- }
-
- function policyUpdate(file, timeout, retry) {
- console.log("enter policyUpdate");
- settingsContainer.filePTSnapshot = file;
- settingsContainer.timeoutPTExchange = timeout;
- settingsContainer.retriesPTExchange = retry;
- var service = 7; // service type for Ford specific policy
- RequestToSDL.SDL_GetURLS(service, settingsContainer.startPTExchange);
- console.log("exit policyUpdate");
- }
-
- function systemRequest(requestType, fileName, appID) {
- console.log("enter systemRequest", requestType, fileName, appID);
-
- console.log(requestType, Common.RequestType.PROPRIETARY, Common.RequestType.HTTP);
-
- switch (requestType) {
- case Common.RequestType.PROPRIETARY: {
- settingsContainer.stopPTExchange(fileName);
- break;
- }
- case Common.RequestType.HTTP: {
- if (fileName === "IVSU") {
- settingsContainer.updateIVSU(appID);
- } else {
- settingsContainer.decrypt(fileName, appID);
- }
- break;
- }
- }
- console.log("exit systemRequest");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml
deleted file mode 100644
index b8b3da5932..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/Buttons.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file Buttons.qml
- * @brief Implement of interface Buttons.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-Item
-{
- function getCapabilities() {
- console.log("Message Received - {method: 'Buttons.GetCapabilities'}")
- return {
- capabilities: settingsContainer.buttonCapabilities,
- presetBankCapabilities: {
- onScreenPresetsAvailable: true
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml
deleted file mode 100644
index bab54220b1..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/Navigation.qml
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * @file Navigation.qml
- * @brief Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "Common.js" as Common
-
-Item {
- function isReady () {
- console.log("Message Received - {method: 'Navigation.IsReady'}")
- return {
- available: dataContainer.hmiNavigationAvailable
- }
- }
-
- function showConstantTBT(navigationTexts, turnIcon, nextTurnIcon, distanceToManeuver,
- distanceToManeuverScale, maneuverComplete,
- softButtons, appID) {
- console.debug("enter")
- var navigationTextsLog = "",
- softButtonsLog = "",
- turnIconLogs = "",
- nextTurnIconLogs = "";
- if (navigationTexts) {
- for (var i = 0; i < navigationTexts.length; i++) {
- navigationTextsLog += "{fieldName: '" + navigationTexts[i].fieldName + "', " +
- "fieldText: '" + navigationTexts[i].fieldText + "'},";
- }
- }
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- if (turnIcon) {
- turnIconLogs = "{value: '" + turnIcon.value + "', imageType: " + turnIcon.imageType + "}";
- }
- if (nextTurnIcon) {
- nextTurnIconLogs = "{value: '" + nextTurnIcon.value + "', imageType: " + nextTurnIcon.imageType + "}";
- }
- console.log("Message Received - {method: 'Navigation.ShowConstantTBT', params:{ " +
- "navigationTexts: [" + navigationTextsLog + "], " +
- "turnIcon: " + turnIconLogs + ", " +
- "nextTurnIcon: " + nextTurnIconLogs + ", " +
- "distanceToManeuver: " + distanceToManeuver + ", " +
- "distanceToManeuverScale: " + distanceToManeuverScale + ", " +
- "maneuverComplete: " + maneuverComplete + ", " +
- "softButtons: [" + softButtonsLog + "], " +
- "appID: " + appID +
- "}}")
-
- var app = dataContainer.getApplication(appID)
- var dataToUpdate = {}
-
- navigationTexts.forEach(fillTexts, dataToUpdate)
- if (turnIcon !== undefined) { dataToUpdate.turnIcon = turnIcon }
- if (nextTurnIcon !== undefined) { dataToUpdate.nextTurnIcon = nextTurnIcon }
- if (distanceToManeuver !== undefined) {
- dataToUpdate.distanceToManeuver = distanceToManeuver
- } else {
- DBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "distanceToManeuver absence"} )
- }
- if (distanceToManeuverScale !== undefined) {
- dataToUpdate.distanceToManeuverScale = distanceToManeuverScale
- } else {
- DBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "distanceToManeuverScale absence"} )
- }
- if (maneuverComplete !== undefined) {
- dataToUpdate.maneuverComplete = maneuverComplete
- }
- if (softButtons !== undefined) {
- app.navigationSoftButtons.clear()
- softButtons.forEach(function(x) { app.navigationSoftButtons.append(x); });
- }
- if (appID !== undefined) {
- dataToUpdate.appID = appID
- } else {
- dBus.sendReply( {__retCode: Common.Result.INVALID_DATA, __message: "appID absence"} )
- }
-
- dataContainer.setApplicationProperties(appID, { navigationModel : dataToUpdate } )
- contentLoader.go("./views/TurnByTurnView.qml", appID)
- }
-
- function alertManeuver(softButtons) {
- console.debug("enter")
- var softButtonsLog = "";
-
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- console.log("Message Received - {method: 'Navigation.AlertManeuver', params:{ " +
- "softButtons: [" + softButtonsLog + "]" +
- "}}")
-
- console.debug("exit")
- return { __retCode: Common.Result.SUCCESS }
- }
-
- function updateTurnList(turnList, softButtons, appID) {
- console.debug("enter")
- var turnListLog = "",
- softButtonsLog = "";
- if (turnList) {
- for (var i = 0; i < turnList.length; i++) {
- turnList[i].navigationText ? turnListLog += "{navigationText: {fieldName: '" + turnList[i].navigationText.fieldName + "', fieldText: '" + turnList[i].navigationText.fieldText + "'}," : turnListLog += "{";
- turnList[i].turnIcon ? turnListLog += "turnIcon: " + "{value: '" + turnList[i].turnIcon.value + "', imageType: " + turnList[i].turnIcon.imageType + "}}, " : turnListLog += "},";
- }
- }
- if (softButtons) {
- softButtonsLog += "{type: '" + softButtons[0].type + "', " +
- "text: '" + softButtons[0].text + "', ";
- softButtons[0].image ? softButtonsLog += "image: " + "{value: '" + softButtons[0].image.value + "', imageType: " + softButtons[0].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[0].isHighlighted + "', " +
- "softButtonID: " + softButtons[0].softButtonID + "', " +
- "systemAction: " + softButtons[0].systemAction +
- "},";
- }
- console.log("Message Received - {method: 'Navigation.UpdateTurnList', params:{ " +
- "softButtons: [" + softButtonsLog + "], " +
- "turnList: [" + turnListLog + "], " +
- "appID: " + appID +
- "}}")
- if (turnList !== undefined) {
- dataContainer.getApplication(appID).turnList.clear();
- turnList.forEach(fillTurnList, dataContainer.getApplication(appID).turnList);
- }
- if (softButtons !== undefined) {
- dataContainer.getApplication(appID).turnListSoftButtons.clear();
- softButtons.forEach(fillSoftButtons, dataContainer.getApplication(appID).turnListSoftButtons);
- }
- dataContainer.navigationModel.appId = appID;
- console.debug("exit")
- }
-
- function fillTexts(element, index, array) {
- switch (element.fieldName) {
- case Common.TextFieldName.navigationText1:
- this.text1 = element.fieldText;
- break;
- case Common.TextFieldName.navigationText2:
- this.text2 = element.fieldText;
- break;
- case Common.TextFieldName.ETA:
- this.eta = element.fieldText;
- break;
- case Common.TextFieldName.totalDistance:
- this.totalDistance = element.fieldText;
- break;
- case Common.TextFieldName.timeToDestination:
- this.timeToDestination = element.fieldText;
- break;
- }
- }
-
- function startStream(url, appID) {
- console.debug("enter")
- player.startStream(url)
- console.debug("exit")
- }
-
- function stopStream(appID) {
- console.debug("enter")
- player.stop()
- console.debug("exit")
- }
-
- function startAudioStream(url, appID) {
- console.log("Message Received - {method: 'Navigation.StartAudioStream', params:{ " +
- "url: '" + url + "'" +
- "appID: " + appID +
- "}}")
- stream.source = url;
- stream.play();
- }
-
- function stopAudioStream(appID) {
- console.log("Message Received - {method: 'Navigation.StopAudioStream', params:{ " +
- "appID: " + appID +
- "}}")
- stream.stop();
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- buttonId: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
- function fillTurnList(element, index, array) {
- this.append({
- navigationText: element.navigationText,
- turnIcon: element.turnIcon
- });
- console.debug(element.navigationText)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml
deleted file mode 100644
index c16e1d7750..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/SDL.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-import QtQuick 2.0
-import "Common.js" as Common
-import "Async.js" as Async
-
-Item {
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml
deleted file mode 100644
index 7884b31097..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/TTS.qml
+++ /dev/null
@@ -1,203 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "Common.js" as Common
-import "Async.js" as Async
-
-Item {
- function ttsChunksToString(ttsChunks){
- return ttsChunks.map(function(str) { return str.text }).join('\n')
- }
-
- function isReady() {
- console.log("Message Received - {method: 'TTS.IsReady'}")
- return {
- available: dataContainer.hmiTTSAvailable
- }
- }
-
- function speak(ttsChunks, appID) {
- // appID unused
- console.debug('enter:', ttsChunks, appID);
- var ttsChunksLog = "";
- if (ttsChunks) {
- for (var i = 0; i < ttsChunks.length; i++) {
- ttsChunksLog += "{type: " + ttsChunks[i].type + ", " +
- "text: '" + ttsChunks[i].text + "'}, ";
- }
- }
- console.log("Message Received - {method: 'TTS.Speak', params:{ " +
- "ttsChunks: [" + ttsChunksLog + "], " +
- "appID: " + appID + "', " +
- "}}")
- if (ttsPopUp.async) {
- console.log('speak send abort');
- throw Common.Result.ABORTED;
- }
- var message = ttsChunksToString(ttsChunks);
- ttsPopUp.activate(message);
- ttsPopUp.async = new Async.AsyncCall();
- console.debug('exit');
- return ttsPopUp.async;
- }
-
- function stopSpeaking() {
- console.debug("enter");
- console.log("Message Received - {method: 'TTS.StopSpeaking'}")
- ttsPopUp.deactivate();
- console.debug("exit");
- }
-
- function getLanguage() {
- console.log("Message Received - {method: 'TTS.GetLanguage'}")
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- console.log("Message Received - {method: 'TTS.GetSupportedLanguages'}")
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- console.log("Message Received - {method: 'TTS.GetCapabilities'}")
- return {
- speechCapabilities: [
- Common.SpeechCapabilities.SC_TEXT,
- Common.SpeechCapabilities.PRE_RECORDED
- ],
- prerecordedSpeechCapabilities: [
- Common.PrerecordedSpeech.HELP_JINGLE,
- Common.PrerecordedSpeech.INITIAL_JINGLE,
- Common.PrerecordedSpeech.LISTEN_JINGLE,
- Common.PrerecordedSpeech.POSITIVE_JINGLE,
- Common.PrerecordedSpeech.NEGATIVE_JINGLE
- ]
- }
- }
-
- function performInteraction(helpPrompt, initialPrompt, timeoutPrompt, timeout) {
- console.debug("enter");
- var helpttsChunksLog = "",
- initialttsChunkLog = "",
- timeoutttsChunkLog = "";
-
- 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)
- console.debug("exit");
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter:", language, appID);
- console.log("Message Received - {method: 'TTS.ChangeRegistration', params:{ " +
- "language: " + language + ", " +
- "appID: " + appID +
- "}}")
- dataContainer.changeRegistrationTTSVR(language, appID);
- console.debug("exit");
- }
-
- function setGlobalProperties(helpPrompt, timeoutPrompt, appID) {
- var helpPromptLog = "",
- timeoutPromptLog = "";
- if (helpPrompt) {
- for (var i = 0; i < helpPrompt.length; i++) {
- helpPromptLog += "{type: " + helpPrompt[i].type + ", " +
- "text: '" + helpPrompt[i].text + "'}, ";
- }
- }
- if (timeoutPrompt) {
- for (var i = 0; i < timeoutPrompt.length; i++) {
- timeoutPromptLog += "{type: " + timeoutPrompt[i].type + ", " +
- "text: '" + timeoutPrompt[i].text + "'}, ";
- }
- }
- console.log("Message Received - {method: 'TTS.SetGlobalProperties', params:{ " +
- "appID:" + appID + ", " +
- "helpPrompt: [" + helpPromptLog + "], " +
- "timeoutPrompt: [" + timeoutPromptLog + "]" +
- "}}")
-
- var newHelpPropmt = helpPrompt ?
- helpPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.helpPrompt
-
- var newTimeoutPrompt = timeoutPrompt ?
- timeoutPrompt.map(
- function (structure) {
- return structure.text
- }
- ).join(", ") :
- dataContainer.currentApplication.timeoutPrompt
-
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- helpPrompt: newHelpPropmt,
- timeoutPrompt: newTimeoutPrompt
- })
- console.debug("exit")
- }
-}
-
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
deleted file mode 100644
index 659b7842c6..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/UI.qml
+++ /dev/null
@@ -1,730 +0,0 @@
-/**
- * @file UI.qml
- * @brief UI interface implementation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "Common.js" as Common
-import "Async.js" as Async
-import "../models/Internal.js" as Internal
-
-Item {
- function filter (strings, fields) {
- console.debug("enter")
-// substrings for each allowed field
- var fieldSubstrings = {}
-// this cycle concatenates allowed lines sorting them by field
- for (var stringIndex = 0; stringIndex < strings.length; ++stringIndex) {
- for (var fieldIndex = 0; fieldIndex < fields.length; ++fieldIndex) {
- var fieldName = strings[stringIndex].fieldName
- if (fieldName === fields[fieldIndex]) {
- if (fieldSubstrings[fieldName] !== undefined) {
- fieldSubstrings[fieldName] += "\n";
- fieldSubstrings[fieldName] += strings[stringIndex].fieldText
- }
- else {
- fieldSubstrings[fieldName] = strings[stringIndex].fieldText
- }
- }
- }
- }
- console.debug("exit")
- return fieldSubstrings
- }
-
- function alert (alertStrings, duration, softButtons, progressIndicator, alertType, appID) {
- var softButtonsLog = "",
- alertStringsLog = "";
- if (alertStrings) {
- for (var i = 0; i < alertStrings.length; i++) {
- alertStringsLog += "{fieldName: '" + alertStrings[i].fieldName + "', " +
- "fieldText: '" + alertStrings[i].fieldText + "'},";
- }
- }
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- console.log("Message Received - {method: 'UI.Alert', params:{ " +
- "alertStrings: [" + alertStringsLog + "]," +
- "duration: " + duration + "', " +
- "softButtons: [" + softButtonsLog + "]," +
- "progressIndicator: " + progressIndicator + "', " +
- "appID: " + appID + "', " +
- "}}")
- var fieldSubstrings = alertStrings
- .sort(function(a, b) { return a.fieldName - b.fieldName }) // sorting by fieldName
- .map(function(val) { return val.fieldText }); // mapping to array of strings
-
- var tryAgainTime = alertWindow.alert(fieldSubstrings, duration, softButtons, progressIndicator, alertType, appID)
- if (tryAgainTime === undefined) {
- alertWindow.async = new Async.AsyncCall();
- return alertWindow.async;
- }
- else {
- return {
- "__retCode": Common.Result.REJECTED,
- "tryAgainTime": tryAgainTime
- }
- }
- }
-
- function show (showStrings, alignment, graphic, secondaryGraphic, softButtons, customPresets, appID) {
- var softButtonsLog = "",
- showStringsLog = "",
- customPresetsLog = "",
- graphiLog = "",
- secondaryGraphicLog = "";
- if (showStrings) {
- for (var i = 0; i < showStrings.length; i++) {
- showStringsLog += "{fieldName: '" + showStrings[i].fieldName + "', " +
- "fieldText: '" + showStrings[i].fieldText + "'},";
- }
- }
- if (customPresets) {
- for (var i = 0; i < customPresets.length; i++) {
- customPresetsLog += "'" + customPresets[i] + "', ";
- }
- }
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- if (graphic) {
- graphiLog = "{value: '" + graphic.value + "', imageType: " + graphic.imageType + "}";
- }
- if (secondaryGraphic) {
- secondaryGraphicLog = "{value: '" + secondaryGraphic.value + "', imageType: " + secondaryGraphic.imageType + "}";
- }
-
- console.log("Message Received - {method: 'UI.Show', params:{ " +
- "showStrings: [" + showStringsLog + "], " +
- "alignment: " + alignment + "', " +
- "graphic: " + graphiLog + ", " +
- "secondaryGraphic: " + secondaryGraphicLog+ ", " +
- "softButtons: [" + softButtonsLog + "], " +
- "customPresets: [" + customPresetsLog + "], " +
- "appID: " + appID +
- "}}")
- var app = dataContainer.getApplication(appID);
-
- app.softButtons.clear()
- if (softButtons) {
- softButtons.forEach(function(x) { app.softButtons.append(x); });
- }
-
- app.customPresets.clear()
- if (customPresets) {
- customPresets.forEach( function(x) { app.customPresets.append( {text: x} ); } )
- }
-
- var textAlignment
- switch (alignment) {
- case Common.TextAlignment.LEFT_ALIGNED:
- textAlignment = Text.AlignLeft
- break;
- case Common.TextAlignment.RIGHT_ALIGNED:
- textAlignment = Text.AlignRight
- break;
- case Common.TextAlignment.CENTERED:
- textAlignment = Text.AlignHCenter
- break;
- default:
- textAlignment = Text.AlignHCenter
- break;
- }
-
- // with this array we grab only the lines we need
- var showFields = [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack
- ]
- var fieldSubstrings = filter(showStrings, showFields)
- var showData = { hmiUIText: {} }
- if (fieldSubstrings[Common.TextFieldName.mainField1] !== undefined) { showData.hmiUIText.mainField1 = fieldSubstrings[Common.TextFieldName.mainField1]; }
- if (fieldSubstrings[Common.TextFieldName.mainField2] !== undefined) { showData.hmiUIText.mainField2 = fieldSubstrings[Common.TextFieldName.mainField2]; }
- if (fieldSubstrings[Common.TextFieldName.mainField3] !== undefined) { showData.hmiUIText.mainField3 = fieldSubstrings[Common.TextFieldName.mainField3]; }
- if (fieldSubstrings[Common.TextFieldName.mainField4] !== undefined) { showData.hmiUIText.mainField4 = fieldSubstrings[Common.TextFieldName.mainField4]; }
- if (fieldSubstrings[Common.TextFieldName.statusBar] !== undefined) { showData.hmiUIText.statusBar = fieldSubstrings[Common.TextFieldName.statusBar]; }
- if (fieldSubstrings[Common.TextFieldName.mediaTrack] !== undefined) { showData.hmiUIText.mediaTrack = fieldSubstrings[Common.TextFieldName.mediaTrack]; }
- if (graphic) { showData.hmiUIText.image = graphic.value; }
- if (secondaryGraphic) { showData.hmiUIText.secondaryImage = secondaryGraphic.value; }
- if (textAlignment) { showData.hmiUITextAlignment = textAlignment; }
- if (fieldSubstrings[Common.TextFieldName.mediaClock]) {
- showData.mediaClock = {
- "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
- }
- }
-
- dataContainer.setApplicationProperties(appID, showData);
- console.debug("exit")
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- var cmdIconLogs = "",
- menuParamsLogs = "";
-
- if (cmdIcon) {
- cmdIconLogs = "{value: '" + cmdIcon.value + "', imageType: " + cmdIcon.imageType + "}";
- }
- if (menuParams) {
- menuParamsLogs = "{parentID: " + menuParams.parentID + ", position: " + menuParams.position + "}";
- }
- console.log("Message Received - {method: 'UI.AddCommand', params:{ " +
- "appID: " + appID + ", " +
- "cmdID: " + cmdID + ", " +
- "cmdIcon: " + cmdIconLogs + ", " +
- "menuParams: " + menuParamsLogs +
- "}}")
- dataContainer.addCommand(cmdID, menuParams, cmdIcon, appID)
- }
-
- function deleteCommand (cmdID, appID) {
- console.log("Message Received - {method: 'UI.DeleteCommand', params:{ " +
- "appID: " + appID + ", " +
- "cmdID: " + cmdID +
- "}}")
- dataContainer.deleteCommand(cmdID, appID)
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- var menuParamsLogs = "";
-
- if (menuParams) {
- menuParamsLogs = "{parentID: " + menuParams.parentID + ", position: " + menuParams.position + "}";
- }
- console.log("Message Received - {method: 'UI.AddSubMenu', params:{ " +
- "appID: " + appID + ", " +
- "menuID: " + menuID + ", " +
- "menuParams: " + menuParamsLogs +
- "}}")
- dataContainer.addSubMenu(menuID, menuParams, appID)
- }
-
- function deleteSubMenu (menuID, appID) {
- console.log("Message Received - {method: 'UI.DeleteSubMenu', params:{ " +
- "appID:" + appID + ", " +
- "menuID: " + menuID +
- "}}")
- dataContainer.deleteSubMenu(menuID, appID)
- }
-
- function performInteraction (initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
- console.debug("enter")
- var choiseLog = "",
- vrHelpLog = "",
- initialTextLog = "";
- if (choiceSet) {
- for (var i = 0; i < choiceSet.length; i++) {
- choiseLog += "{choiceID: " + choiceSet[i].choiceID + ", " +
- "menuName: '" + choiceSet[i].menuName + "', " +
- "image: {value: '" + choiceSet[i].image.value + "', imageType: " + choiceSet[i].image.imageType + "}, " +
- "secondaryText: '" + choiceSet[i].secondaryText + "', " +
- "tertiaryText: '" + choiceSet[i].tertiaryText + "', " +
- "secondaryImage: {value: '" + choiceSet[i].image.value + "', imageType: " + choiceSet[i].image.imageType + "}},";
- }
- }
- if (vrHelp) {
- for (var i = 0; i < vrHelp.length; i++) {
- var vrHelpImageLog = "";
- if (vrHelp[i].image) {
- vrHelpImageLog = "{value: '" + vrHelp[i].image.value + "', imageType: " + vrHelp[i].image.imageType + "}";
- }
-
- vrHelpLog += "{text: '" + vrHelp[i].text + "', " +
- "image: " + vrHelpImageLog + ", " +
- "position: " + vrHelp[i].position +
- "},";
- }
- }
- if (initialText) {
- initialTextLog = "{fieldName: " + initialText.fieldName + ", fieldText: '" + initialText.fieldText + "'}";
- }
-
- console.log("Message Received - {method: 'UI.PerformInteraction', params:{ " +
- "appID:" + appID + ", " +
- "initialText: " + initialTextLog + ", " +
- "choiceSet: [" + choiseLog + "], " +
- "vrHelpTitle: '" + vrHelpTitle + "', " +
- "vrHelp: [" + vrHelpLog + "], " +
- "timeout: " + timeout + ", " +
- "interactionLayout: " + interactionLayout +
- "}}")
- var async = interactionPopup.performInteraction(initialText, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID)
- console.debug("exit")
- return async
- }
-
- function setMediaClockTimer (startTime, endTime, updateMode, appID) {
- var startTimeLog = "",
- endTimeLog = "";
- if (startTime) {
- startTimeLog = "hours: " + startTime.hours + ", minutes: " + startTime.minutes + ", seconds: " + startTime.seconds;
- }
- if (endTime) {
- endTimeLog = "hours: " + endTime.hours + ", minutes: " + endTime.minutes + ", seconds: " + endTime.seconds;
- }
-
- console.log("Message Received - {method: 'UI.SetMediaClockTimer', params:{ " +
- "startTime: {" + startTimeLog + "}, " +
- "endTime: {" + endTimeLog + "}, " +
- "updateMode: " + updateMode + ", " +
- "appID: " + appID +
- "}}")
- var app = dataContainer.getApplication(appID)
- var newStartTime
- var newEndTime
- var newUpdateMode
- var newRunningMode
- var newStartTimeForProgress
- var resultCode
- var sendErrorResponce = false
-
- switch (updateMode) {
- case Common.ClockUpdateMode.COUNTUP:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- 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)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.COUNTDOWN:
- if (startTime === undefined) {
- resultCode = Common.Result.INVALID_DATA
- sendErrorResponce = true
- break
- }
- newStartTime = Internal.hmsTime(startTime.hours, startTime.minutes, startTime.seconds)
- 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)
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.PAUSE:
- // Already paused or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_STOPPED)
- || (app.mediaClock.startTime === -1 && app.mediaClock.endTime === -1)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = app.mediaClock.startTimeForProgress
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.RESUME:
- // Already resumed or cleared
- if ((app.mediaClock.runningMode === Internal.MediaClockRunningMode.MCR_RUNNING)
- || (app.mediaClock.startTime === app.mediaClock.endTime)) {
- resultCode = Common.Result.IGNORED
- sendErrorResponce = true
- break
- }
- newStartTime = app.mediaClock.startTime
- newEndTime = app.mediaClock.endTime
- newRunningMode = Internal.MediaClockRunningMode.MCR_RUNNING
- newStartTimeForProgress = app.mediaClock.startTimeForProgress
- newUpdateMode = app.mediaClock.updateMode
- resultCode = Common.Result.SUCCESS
- break
-
- case Common.ClockUpdateMode.CLEAR:
- newStartTime = -1
- newEndTime = -1
- newRunningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- newUpdateMode = app.mediaClock.updateMode
- newStartTimeForProgress = -1
- resultCode = Common.Result.SUCCESS
- break
- }
-
- if (sendErrorResponce) {
- console.debug("exit with result code: ", resultCode)
- return { __retCode: resultCode }
- }
-
- dataContainer.setApplicationProperties(appID, {
- "mediaClock": {
- "updateMode": newUpdateMode,
- "runningMode": newRunningMode,
- "startTime": newStartTime,
- "endTime": newEndTime,
- "startTimeForProgress": newStartTimeForProgress
- }
- })
-
- console.debug("exit")
- return { __retCode: resultCode }
- }
-
- function setGlobalProperties (vrHelpTitle, vrHelp, menuTitle, menuIcon, keyboardProperties, appID) {
- console.debug("enter")
- var vrHelpLog = "",
- menuIconLog = "",
- keyboardPropertiesLog = "";
- if (vrHelp) {
- for (var i = 0; i < vrHelp.length; i++) {
- var vrHelpImageLog = "";
- if (vrHelp[i].image) {
- vrHelpImageLog = "{value: '" + vrHelp[i].image.value + "', imageType: " + vrHelp[i].image.imageType + "}";
- }
- vrHelpLog += "{text: '" + vrHelp[i].text + "', " +
- "image: " + vrHelpImageLog + ", " +
- "position: " + vrHelp[i].position +
- "},";
- }
- }
- if (menuIcon) {
- menuIconLog = "{value: '" + menuIcon.value + "', imageType: " + menuIcon.imageType + "}";
- }
- if (keyboardProperties) {
- keyboardPropertiesLog = "{language: '" + keyboardProperties.language + "', keyboardLayout: '" + keyboardProperties.language +
- "', sendDynamicEntry: '" + keyboardProperties.sendDynamicEntry + "', keypressMode: '" + keyboardProperties.keypressMode +
- "', limitedCharacterList: '" + keyboardProperties.limitedCharacterList + "', autoCompleteText: '" + keyboardProperties.autoCompleteText + "'}";
- }
-
- console.log("Message Received - {method: 'UI.SetGlobalProperties', params:{ " +
- "appID:" + appID + ", " +
- "vrHelpTitle: '" + vrHelpTitle + "', " +
- "vrHelp: [" + vrHelpLog + "], " +
- "menuTitle: '" + menuTitle + "', " +
- "menuIcon: " + menuIconLog + ", " +
- "keyboardProperties: " + keyboardPropertiesLog +
- "}}")
- var app = dataContainer.getApplication(appID)
- var dataToUpdate = {}
-
- if (vrHelpTitle !== undefined) {
- dataToUpdate.vrHelpTitle = vrHelpTitle
- } else if ( (vrHelp !== undefined) && (vrHelp.length >= 1) ) {
- return { __retCode: Common.Result.REJECTED, __message: "vrHelpTitle - undefined, vrHelpItem - provided" }
- }
-
- if (vrHelp !== undefined) {
- var checkSequentialPosition = vrHelp[0].position
- for (var index = 0; index < vrHelp.length; index++) {
- if (vrHelp[index].position !== checkSequentialPosition) {
- return { __retCode: Common.Result.REJECTED, __message: "Nonsequential positions of VrHelpItems" }
- }
- checkSequentialPosition++
- }
-
- if (app.vrHelpItems.count !== 0) {
- app.vrHelpItems.clear()
- }
- vrHelp.forEach( Internal.appendVrHelpItem, app.vrHelpItems )
- } else {
- if (vrHelpTitle !== undefined) {
- return { __retCode: Common.Result.REJECTED, __message: "vrHelpItems - undefined, vrHelpTitle - provided" }
- }
- }
- if (menuTitle !== undefined) {
- dataToUpdate.menuTitle = menuTitle
- }
- if (menuIcon !== undefined) {
- dataToUpdate.menuIcon = menuIcon
- }
- dataContainer.setApplicationProperties(appID, dataToUpdate)
- console.debug("exit")
- }
-
- function isReady () {
- console.log("Message Received - {method: 'UI.IsReady'}")
- return {
- available: dataContainer.hmiUIAvailable
- }
- }
-
- function getLanguage () {
- console.log("Message Received - {method: 'UI.GetLanguage'}")
- return {
- language: dataContainer.hmiUILanguage
- }
- }
-
- function getSupportedLanguages () {
- console.log("Message Received - {method: 'UI.GetSupportedLanguages'}")
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function changeRegistration (language, appID) {
- console.log("Message Received - {method: 'UI.ChangeRegistration', params:{ " +
- "language: " + language + ", " +
- "appID: " + appID +
- "}}")
- dataContainer.changeRegistrationUI(language, appID)
- }
-
- function setAppIcon (syncFileName, appID) {
- var syncFileNameLog = "";
- if (syncFileName) {
- syncFileNameLog = "{value: '" + syncFileName.value + "', imageType: " + syncFileName.imageType + "}";
- }
-
- console.log("Message Received - {method: 'UI.SetAppIcon', params:{ " +
- "syncFileName: " + syncFileNameLog + ", " +
- "appID: " + appID +
- "}}")
- dataContainer.setApplicationProperties(appID, { icon: syncFileName.value })
- }
-
- function slider (numTicks, position, sliderHeader, sliderFooter, timeout, appID) {
- console.log("Message Received - {method: 'UI.Slider', params:{ " +
- "numTicks: " + numTicks + "', " +
- "position: " + position + "', " +
- "sliderHeader: '" + sliderHeader + "', " +
- "sliderFooter: [" + sliderFooter + "], " +
- "timeout: " + timeout + ", " +
- "appID: " + appID +
- "}}")
- if (dataContainer.uiSlider.running) {
- console.debug("aborted")
- return {__retCode: Common.Result.ABORTED, sliderPosition: position}
- }
-
- dataContainer.uiSlider.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiSlider.header = sliderHeader
- dataContainer.uiSlider.footer = sliderFooter
- dataContainer.uiSlider.numTicks = numTicks
- dataContainer.uiSlider.position = position
- dataContainer.uiSlider.timeout = timeout
-
- if (timeout !== 0) {
- sliderPopup.showSlider()
- sliderPopup.async = new Async.AsyncCall();
- console.debug("exit")
- return sliderPopup.async;
- } else {
- console.debug("exit")
- return { sliderPosition: position }
- }
- }
-
- function scrollableMessage (messageText, timeout, softButtons, appID) {
- var softButtonsLog = "",
- messageTextLog = "";
- if (softButtons) {
- for (var i = 0; i < softButtons.length; i++) {
- softButtonsLog += "{type: '" + softButtons[i].type + "', " +
- "text: " + softButtons[i].text + "', ";
- softButtons[i].image ? softButtonsLog += "image: " + "{value: '" + softButtons[i].image.value + "', imageType: " + softButtons[i].image.imageType + "}, " : softButtonsLog += "";
- softButtonsLog += "isHighlighted: " + softButtons[i].isHighlighted + "', " +
- "softButtonID: " + softButtons[i].softButtonID + "', " +
- "systemAction: " + softButtons[i].systemAction +
- "},";
- }
- }
- if (messageText) {
- messageTextLog = "{fieldName: " + messageText.fieldName + ", fieldText: '" + messageText.fieldText + "'}";
- }
-
- console.log("Message Received - {method: 'UI.ScrollableMessage', params:{ " +
- "messageText: " + messageTextLog + ", " +
- "timeout: " + timeout + "', " +
- "softButtons: [" + softButtonsLog + "]," +
- "appID: " + appID + "', " +
- "}}")
- // TODO{ALeshin}: Also check HMILevel, when it will be available. It should be FULL otherwise - REJECTED
- if (contentLoader.item.systemContext !== Common.SystemContext.SYSCTXT_MAIN) {
- return { __retCode: Common.Result.REJECTED, __message: "System Context isn't MAIN" }
- }
- if(dataContainer.scrollableMessageModel.running){
- //send error response if scrollable message already running
- return { __retCode: Common.Result.ABORTED, __message: "ScrollableMessage already running" }
- }
-
- dataContainer.scrollableMessageModel.longMessageText = messageText.fieldText
- if (timeout === 0) {
- return { __retCode: Common.Result.SUCCESS, __message: "Timeout = 0" }
- } else {
- dataContainer.scrollableMessageModel.timeout = timeout
- }
-
- dataContainer.scrollableMessageModel.softButtons.clear();
- if (softButtons !== undefined) {
- softButtons.forEach(fillSoftButtons, dataContainer.scrollableMessageModel.softButtons);
- }
- dataContainer.scrollableMessageModel.appId = appID
- dataContainer.scrollableMessageModel.async = new Async.AsyncCall()
- contentLoader.go("./views/ScrollableMessageView.qml")
- console.debug("exit")
- return dataContainer.scrollableMessageModel.async
- }
-
- function getCapabilities() {
- console.log("Message Received - {method: 'UI.GetCapabilities'}")
- return {
- "audioPassThruCapabilities": {
- "samplingRate": Common.SamplingRate.RATE_44KHZ,
- "bitsPerSample": Common.BitsPerSample.RATE_8_BIT,
- "audioType": Common.AudioType.PCM
- },
- "displayCapabilities": settingsContainer.displayCapabilities,
- "hmiZoneCapabilities": Common.HmiZoneCapabilities.FRONT,
- "softButtonCapabilities": settingsContainer.softButtonCapabilities
- }
- }
-
- function performAudioPassThru (appID, audioPassThruDisplayTexts, timeout) {
- var displayTextsLog = "";
- if (audioPassThruDisplayTexts) {
- for (var i = 0; i < audioPassThruDisplayTexts.length; i++) {
- displayTextsLog += "{fieldName: '" + audioPassThruDisplayTexts[i].fieldName + "', " +
- "fieldText: " + audioPassThruDisplayTexts[i].fieldText + "'},";
- }
- }
- console.log("Message Received - {method: 'UI.PerformAudioPassThru', params:{ " +
- "audioPassThruDisplayTexts: [" + displayTextsLog + "], " +
- "maxDuration: " + timeout +
- "}}")
-
- if (dataContainer.uiAudioPassThru.running) {
- console.debug("aborted")
- throw Common.Result.ABORTED
- }
-
- dataContainer.uiAudioPassThru.appName = dataContainer.getApplication(appID).appName
- dataContainer.uiAudioPassThru.timeout = timeout
- if (audioPassThruDisplayTexts.length === 2) {
- dataContainer.uiAudioPassThru.firstLine = audioPassThruDisplayTexts[0].fieldText
- dataContainer.uiAudioPassThru.secondLine = audioPassThruDisplayTexts[1].fieldText
- }
- performAudioPassThruPopup.async = new Async.AsyncCall();
- performAudioPassThruPopup.showAudioPassThru()
- console.debug("exit")
- return performAudioPassThruPopup.async;
- }
-
- function endAudioPassThru () {
- console.debug("enter")
- console.log("Message Received - {method: 'UI.EndAudioPassThru'}")
-
- if (!dataContainer.uiAudioPassThru.running) {
- console.debug("rejected")
- throw Common.Result.REJECTED
- }
- DBus.sendReply({__retCode: Common.Result.SUCCESS})
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- console.debug("exit")
- }
-
- function closePopUp (methodName) {
- console.debug("enter")
- console.log("Message Received - {method: 'UI.ClosePopUp', params:{ " +
- "methodName: " + methodName +
- "}}")
- var popUpToClose
-
- if (dataContainer.activePopup.length === 0) {
- return { __retCode: Common.Result.ABORT, __message: "No active PopUps"}
- }
-
- if (methodName !== undefined) {
- popUpToClose = methodName
- } else {
- popUpToClose = dataContainer.activePopup[dataContain.activePopUp.length - 1]
- }
-
- switch (popUpToClose) {
- case "UI.PerformInteraction":
- interactionPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Slider":
- sliderPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.PerformAudioPassThru":
- performAudioPassThruPopup.complete(Common.Result.SUCCESS)
- break
- case "UI.Alert":
- alertWindow.complete(Common.Result.SUCCESS)
- break
- case "UI.VrHelp":
- vrHelpPopup.complete(Common.Result.SUCCESS)
- break
- }
- console.debug("exit")
- }
-
- function fillSoftButtons(element, index, array) {
- this.append({
- type: element.type,
- text: element.text,
- image: element.image,
- isHighlighted: element.isHighlighted,
- softButtonID: element.softButtonID,
- systemAction: element.systemAction
- });
- }
-
-}
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
deleted file mode 100644
index 8158b3271e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/VR.qml
+++ /dev/null
@@ -1,170 +0,0 @@
-/**
- * @file VR.qml
- * @brief Implement of interface VR.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "Common.js" as Common
-Item {
- function isReady() {
- console.log("Message Received - {method: 'VR.IsReady'}")
- return {
- available: dataContainer.hmiVRAvailable
- }
- }
-
- function addCommand(cmdID, vrCommands, type, grammarID, appID) {
- var vrCommandsLog = "";
- if (vrCommands) {
- for (var i = 0; i < vrCommands.length; i++) {
- vrCommandsLog += "'" + vrCommands[i] + "', ";
- }
- }
- console.log("Message Received - {method: 'VR.AddCommand', params:{ " +
- "vrCommands: [" + vrCommandsLog + "], " +
- "cmdID: " + cmdID + ", " +
- "appID: " + appID + ", " +
- "type: " + type + ", " +
- "grammarID: " + grammarID +
- "}}")
- for (var i = 0; i < vrCommands.length; ++i) {
- 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")
- }
-
- function deleteCommand(cmdID, appID) {
- console.log("Message Received - {method: 'VR.DeleteCommand', params:{ " +
- "appID: " + appID + ", " +
- "cmdID: " + cmdID +
- "}}")
- for (var i = 0; i < dataContainer.vrCommands.count; ) {
- if ((dataContainer.vrCommands.get(i).cmdID === cmdID) &&
- ((appID === undefined) || (dataContainer.vrCommands.get(i).appID === appID))) {
- dataContainer.vrCommands.remove(i);
- continue;
- }
- ++i;
- }
- console.log("exit")
- }
-
- function getLanguage() {
- console.log("Message Received - {method: 'VR.GetLanguage'}")
- return {
- language: dataContainer.hmiTTSVRLanguage
- }
- }
-
- function getSupportedLanguages() {
- console.log("Message Received - {method: 'VR.GetSupportedLanguages'}")
- return {
- languages: settingsContainer.sdlLanguagesList
- }
- }
-
- function getCapabilities() {
- console.log("Message Received - {method: 'UI.GetCapabilities'}")
- return {
- vrCapabilities: [ Common.VrCapabilities.VR_TEXT ]
- }
- }
-
- function changeRegistration(language, appID) {
- console.debug("enter");
- console.log("Message Received - {method: 'VR.ChangeRegistration', params:{ " +
- "language: " + language + ", " +
- "appID: " + appID +
- "}}")
- 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/hmi_api/VehicleInfo.qml b/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml
deleted file mode 100644
index e564860517..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/hmi_api/VehicleInfo.qml
+++ /dev/null
@@ -1,764 +0,0 @@
-/**
- * @file VehicleInfo.qml
- * @brief Vehicle information interface realisation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "Common.js" as Common
-
-Item {
- function isReady () {
- console.log("Message Received - {method: 'VehicleInfo.IsReady'}")
- return {
- available: dataContainer.hmiVehicleInfoAvailable
- }
- }
-
- function getVehicleType() {
- console.log("Message Received - {method: 'VehicleInfo.GetVehicleType'}")
- return {
- "vehicleType": {
- "make": "Ford",
- "model": "Fiesta",
- "modelYear": "2013",
- "trim": "SE"
- }
- }
- }
-
- function getGpsData(appID) {
- console.debug("enter")
- console.debug("exit")
- return { gps: dataContainer.vehicleInfoModel.gps }
- }
-
- function getSpeed(appID) {
- console.debug("enter")
- console.debug("exit")
- return { speed: dataContainer.vehicleInfoModel.speed }
- }
-
- function getRpm(appID) {
- console.debug("enter")
- console.debug("exit")
- return {
- rpm: dataContainer.vehicleInfoModel.rpm,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
-
- function getFuelLevel(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel: dataContainer.vehicleInfoModel.fuelLevel }
- }
-
- function getFuelLevelState(appID) {
- console.debug("enter")
- console.debug("exit")
- return { fuelLevel_State: dataContainer.vehicleInfoModel.fuelLevel_State }
- }
-
- function getInstantFuelConsumption(appID) {
- console.debug("enter")
- console.debug("exit")
- return { instantFuelConsumption: dataContainer.vehicleInfoModel.instantFuelConsumption }
- }
-
- function getExternalTemperature(appID) {
- console.debug("enter")
- console.debug("exit")
- return { externalTemperature: dataContainer.vehicleInfoModel.externalTemperature }
- }
-
- function getVin(appID) {
- console.debug("enter")
- console.debug("exit")
- return { vin: dataContainer.vehicleInfoModel.vin }
- }
-
- function getPrndl(appID) {
- console.debug("enter")
- if (dataContainer.vehicleInfoModel.prndl === -1) { // Test value, to check response
- console.debug("exit")
- return {
- prndl: dataContainer.vehicleInfoModel.prndl,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
- console.debug("exit")
- return { prndl: dataContainer.vehicleInfoModel.prndl }
- }
-
- function getTirePressure(appID) {
- console.debug("enter")
- console.debug("exit")
- return { tirePressure: dataContainer.vehicleInfoModel.tirePressure }
- }
-
- function getOdometer(appID) {
- console.debug("enter")
- console.debug("exit")
- return {
- odometer: dataContainer.vehicleInfoModel.odometer,
- __retCode: Common.Result.DATA_NOT_AVAILABLE
- }
- }
-
- function getBeltStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { beltStatus: dataContainer.vehicleInfoModel.beltStatus }
- }
-
- function getBodyInformation(appID) {
- console.debug("enter")
- console.debug("exit")
- return { bodyInformation: dataContainer.vehicleInfoModel.bodyInformation }
- }
-
- function getDeviceStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { deviceStatus: dataContainer.vehicleInfoModel.deviceStatus }
- }
-
- function getDriverBraking(appID) {
- console.debug("enter")
- console.debug("exit")
- return { driverBraking: dataContainer.vehicleInfoModel.driverBraking }
- }
-
- function getWiperStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { wiperStatus: dataContainer.vehicleInfoModel.wiperStatus }
- }
-
- function getHeadLampStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { headLampStatus: dataContainer.vehicleInfoModel.headLampStatus }
- }
-
- function getEngineTorque(appID) {
- console.debug("enter")
- console.debug("exit")
- return { engineTorque: dataContainer.vehicleInfoModel.engineTorque }
- }
-
- function getAccPedalPosition(appID) {
- console.debug("enter")
- console.debug("exit")
- return { accPedalPosition: dataContainer.vehicleInfoModel.accPedalPosition }
- }
-
- function getSteeringWheelAngle(appID) {
- console.debug("enter")
- console.debug("exit")
- return { steeringWheelAngle: dataContainer.vehicleInfoModel.steeringWheelAngle }
- }
-
- function getECallInfo(appID) {
- console.debug("enter")
- console.debug("exit")
- return { eCallInfo: dataContainer.vehicleInfoModel.eCallInfo }
- }
-
- function getAirbagStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { airbagStatus: dataContainer.vehicleInfoModel.airbagStatus }
- }
-
- function getEmergencyEvent(appID) {
- console.debug("enter")
- console.debug("exit")
- return { emergencyEvent: dataContainer.vehicleInfoModel.emergencyEvent }
- }
-
- function getClusterModeStatus(appID) {
- console.debug("enter")
- console.debug("exit")
- return { clusterModeStatus: dataContainer.vehicleInfoModel.clusterModeStatus }
- }
-
- function getMyKey(appID) {
- console.debug("enter")
- console.debug("exit")
- return { myKey: dataContainer.vehicleInfoModel.myKey }
- }
-
- function getDTCs(ecuName, dtcMask, appID) {
- console.log("Message Received - {method: 'VehicleInfo.GetDTCs', params:{ " +
- "ecuName: " + ecuName + ", " +
- "dtcMask: " + dtcMask + ", " +
- "appID: " + appID +
- "}}")
- var ecuHeader = 2
- var dtc = []
-
- for (var i = 0; i < 3; i++) {
- dtc.push("line" + i)
- }
- return {ecuHeader: ecuHeader, dtc: dtc}
- }
-
- function readDID(ecuName, didLocation, appID) {
- console.debug("Enter")
- console.log("Message Received - {method: 'VehicleInfo.ReadDID', params:{ " +
- "ecuName: " + ecuName + ", " +
- "didLocation: " + didLocation + ", " +
- "appID: " + appID +
- "}}")
- //TODO{ALeshin}: refactoring of this function, when we'll have Vehicle Info module
- var didResult = []
-
- for (var i = 0; i < didLocation.length; i++) {
- if (i < 10) {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_SUCCESS
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- else {
- didResult[i] = {}
- didResult[i].resultCode = Common.VehicleDataResultCode.VDRC_DATA_NOT_AVAILABLE
- didResult[i].didLocation = didLocation[i]
- didResult[i].data = '0'
- }
- }
- console.debug("Exit")
- return {didResult: didResult}
- }
-
- function subscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- model.onGpsChanged.connect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
- }
- function unsubscribeGps(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onGpsChanged.disconnect(model.sendGpsChange)
- console.debug("exit")
- return {gps:
- { dataType: Common.VehicleDataType.VEHICLEDATA_GPS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS} }
-
- }
-
- function subscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- model.onSpeedChanged.connect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSpeed(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSpeedChanged.disconnect(model.sendSpeedChange)
- console.debug("exit")
- return { speed:
- { dataType: Common.VehicleDataType.VEHICLEDATA_SPEED,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- model.onRpmChanged.connect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeRpm(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onRpmChanged.disconnect(model.sendRpmChange)
- console.debug("exit")
- return { rpm:
- { dataType: Common.VehicleDataType.VEHICLEDATA_RPM,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- model.onFuelLevelChanged.connect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevelChanged.disconnect(model.sendFuelLevelChange)
- console.debug("exit")
- return { fuelLevel:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- model.onFuelLevel_StateChanged.connect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeFuelLevel_State(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onFuelLevel_StateChanged.disconnect(model.sendFuelLevel_StateChange)
- console.debug("exit")
- return { fuelLevel_State:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELLEVEL_STATE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- model.onInstantFuelConsumptionChanged.connect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeInstantFuelConsumption(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onInstantFuelConsumptionChanged.disconnect(model.sendInstantFuelConsumptionChange)
- console.debug("exit")
- return { instantFuelConsumption:
- { dataType: Common.VehicleDataType.VEHICLEDATA_FUELCONSUMPTION,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- model.onExternalTemperatureChanged.connect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeExternalTemperature(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onExternalTemperatureChanged.disconnect(model.sendExternalTemperatureChange)
- console.debug("exit")
- return { externalTemperature:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EXTERNTEMP,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- model.onPrndlChanged.connect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribePrndl(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onPrndlChanged.disconnect(model.sendPrndlChange)
- console.debug("exit")
- return { prndl:
- { dataType: Common.VehicleDataType.VEHICLEDATA_PRNDL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- model.onVinChanged.connect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeVin(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onVinChanged.disconnect(model.sendVinChange)
- console.debug("exit")
- return { vin:
- { dataType: Common.VehicleDataType.VEHICLEDATA_VIN,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- model.onTirePressureChanged.connect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeTirePressure(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onTirePressureChanged.disconnect(model.sendTirePressureChange)
- console.debug("exit")
- return { tirePressure:
- { dataType: Common.VehicleDataType.VEHICLEDATA_TIREPRESSURE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- model.onOdometerChanged.connect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeOdometer(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onOdometerChanged.disconnect(model.sendOdometerChange)
- console.debug("exit")
- return { odometer:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ODOMETER,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- model.onBeltStatusChanged.connect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBeltStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBeltStatusChanged.disconnect(model.sendBeltStatusChange)
- console.debug("exit")
- return { beltStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BELTSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- model.onBodyInformationChanged.connect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeBodyInformation(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onBodyInformationChanged.disconnect(model.sendBodyInformationChange)
- console.debug("exit")
- return { bodyInformation:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BODYINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- model.onDeviceStatusChanged.connect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDeviceStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDeviceStatusChanged.disconnect(model.sendDeviceStatusChange)
- console.debug("exit")
- return { deviceStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_DEVICESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- model.onDriverBrakingChanged.connect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeDriverBraking(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onDriverBrakingChanged.disconnect(model.sendDriverBrakingChange)
- console.debug("exit")
- return { driverBraking:
- { dataType: Common.VehicleDataType.VEHICLEDATA_BRAKING,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- model.onWiperStatusChanged.connect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeWiperStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onWiperStatusChanged.disconnect(model.sendWiperStatusChange)
- console.debug("exit")
- return { wiperStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_WIPERSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- model.onHeadLampStatusChanged.connect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeHeadLampStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onHeadLampStatusChanged.disconnect(model.sendHeadLampStatusChange)
- console.debug("exit")
- return { headLampStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_HEADLAMPSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- model.onEngineTorqueChanged.connect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEngineTorque(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEngineTorqueChanged.disconnect(model.sendEngineTorqueChange)
- console.debug("exit")
- return { engineTorque:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ENGINETORQUE,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- model.onAccPedalPositionChanged.connect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAccPedalPosition(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAccPedalPositionChanged.disconnect(model.sendAccPedalPositionChange)
- console.debug("exit")
- return { accPedalPosition:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ACCPEDAL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- model.onSteeringWheelAngleChanged.connect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeSteeringWheelAngle(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onSteeringWheelAngleChanged.disconnect(model.sendSteeringWheelAngleChange)
- console.debug("exit")
- return { steeringWheelAngle:
- { dataType: Common.VehicleDataType.VEHICLEDATA_STEERINGWHEEL,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- model.onECallInfoChanged.connect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeECallInfo(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onECallInfoChanged.disconnect(model.sendECallInfoChange)
- console.debug("exit")
- return { eCallInfo:
- { dataType: Common.VehicleDataType.VEHICLEDATA_ECALLINFO,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- model.onAirbagStatusChanged.connect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeAirbagStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onAirbagStatusChanged.disconnect(model.sendAirbagStatusChange)
- console.debug("exit")
- return { airbagStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_AIRBAGSTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- model.onEmergencyEventChanged.connect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeEmergencyEvent(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onEmergencyEventChanged.disconnect(model.sendEmergencyEventChange)
- console.debug("exit")
- return { emergencyEvent:
- { dataType: Common.VehicleDataType.VEHICLEDATA_EMERGENCYEVENT,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- model.onClusterModeStatusChanged.connect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeClusterModeStatus(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onClusterModeStatusChanged.disconnect(model.sendClusterModeStatusChange)
- console.debug("exit")
- return { clusterModeStatus:
- { dataType: Common.VehicleDataType.VEHICLEDATA_CLUSTERMODESTATUS,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-
- function subscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- model.onMyKeyChanged.connect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
- function unsubscribeMyKey(appID) {
- console.debug("enter")
- var model = dataContainer.vehicleInfoModel;
- model.onMyKeyChanged.disconnect(model.sendMyKeyChange)
- console.debug("exit")
- return { myKey:
- { dataType: Common.VehicleDataType.VEHICLEDATA_MYKEY,
- resultCode: Common.VehicleDataResultCode.VDRC_SUCCESS } }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/log4cxx.properties b/src/components/qt_hmi/qml_model_qt5/log4cxx.properties
deleted file mode 100644
index 0bc5ac8fdf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/log4cxx.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-# Socket logger
-log4j.appender.SocketHub=org.apache.log4j.net.SocketHubAppender
-log4j.appender.SocketHub.port=4555
-log4j.appender.SocketHub.locationInfo=true
-
-# 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=ERROR
-
-# Log for all DBus plugin messages
-log4j.appender.DBusPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.DBusPluginLogFile.File=DBusPlugin.log
-log4j.appender.DBusPluginLogFile.append=false
-log4j.appender.DBusPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.DBusPluginLogFile.ImmediateFlush=true
-log4j.appender.DBusPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.DBusPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all HMI Framework plugin
-log4j.appender.HmiFrameworkPluginLogFile=org.apache.log4j.FileAppender
-log4j.appender.HmiFrameworkPluginLogFile.File=HmiFrameworkPlugin.log
-log4j.appender.HmiFrameworkPluginLogFile.append=false
-log4j.appender.HmiFrameworkPluginLogFile.DatePattern='.' yyyy-MM-dd
-log4j.appender.HmiFrameworkPluginLogFile.ImmediateFlush=true
-log4j.appender.HmiFrameworkPluginLogFile.layout=org.apache.log4j.PatternLayout
-log4j.appender.HmiFrameworkPluginLogFile.layout.ConversionPattern=%-5p [%d{dd MMM yyyy HH:mm:ss,SSS}][%c] %F:%L %M: %m%n
-
-# Log for all Qt HMI
-log4j.rootLogger=ALL, Console
-
-# Log for DBus plugin QtHMI
-log4j.logger.DBusPlugin=ALL, DBusPluginLogFile
-
-# Log for HMI Framework plugin
-log4j.logger.HmiFrameworkPlugin=ALL, HmiFrameworkPluginLogFile
-
-# Log by log4cxx plugin
-log4j.logger.Log4cxxPlugin=ALL, HmiFrameworkPluginLogFile
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml b/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml
deleted file mode 100644
index ec40819040..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ApplicationData.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * @file ApplicationData.qml
- * @brief Model for Application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-QtObject {
- property string mainField1
- property string mainField2
- property string mainField3
- property string mainField4
- property string statusBar
- property string mediaTrack
- property string image: ""
- property string secondaryImage: ""
-
- function reset () {
- console.debug("enter")
- mainField1 = ""
- mainField2 = ""
- mainField3 = ""
- mainField4 = ""
- statusBar = ""
- mediaTrack = ""
- image = ""
- secondaryImage = ""
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml
deleted file mode 100644
index 5181e04a5b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ApplicationModel.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * @file ApplicationModel.qml
- * @brief Own fields for each application.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-
-QtObject {
- property int appId
- property string appName
- property string ngnMediaScreenAppName
- property Icon appIcon: Icon { }
- property string deviceName
- property int hmiDisplayLanguageDesired
- property bool isMediaApplication
- property int appType
- property int hmiUITextAlignment
- property string vrHelpTitle
- property string vrHelpTitleDefault: "VR HELP"
- property string vrHelpTitlePerformInteraction
- property string menuTitle
- property Icon menuIcon: Icon { }
-
- // media player
- property string playPauseState
- property ApplicationData hmiUIText: ApplicationData { }
- property MediaClockModel mediaClock: MediaClockModel { }
- property NavigationModel navigationModel: NavigationModel { }
-
- property string helpPrompt
- property string timeoutPrompt
- property ListModel vrHelpItems: ListModel { }
- property ListModel vrHelpItemsDefault: VrHelpItemsDefault { }
- property ListModel vrHelpItemsPerformInteraction: ListModel { }
- property ListModel options: ListModel { }
- property ListModel currentSubMenu: options
- property ListModel turnList
- property ListModel softButtons
- property ListModel turnListSoftButtons
- property ListModel navigationSoftButtons
- property ListModel alertManeuverSoftButtons
- property ListModel customPresets
- property int languageTTSVR
- property var allowedFunctions: []
- // This place is for adding new properties
-
- function reset () {
- console.debug("enter")
- appId = -1
- appName = ""
- ngnMediaScreenAppName = ""
- appIcon.reset()
- deviceName = ""
- hmiDisplayLanguageDesired = -1
- isMediaApplication = false
- playPauseState = ""
- hmiUIText.reset()
-// no need to reset mediaClock
- helpPrompt = ""
- timeoutPrompt = ""
- options.clear()
- currentSubMenu = options
- turnList.clear()
- softButtons.clear()
- navigationSoftButtons.clear()
- alertManeuverSoftButtons.clear()
- turnListSoftButtons.clear()
- customPresets.clear()
- languageTTSVR = -1
- hmiUITextAlignment = -1
- appType = 0
- allowedFunctions = []
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml
deleted file mode 100644
index c715ae091f..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/CarMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file CarMenuModel.qml
- * @brief Car menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-ListModel
-{
- ListElement {
- name: "ambient"
- icon: "../res/vehicle/Ambient Lighti Icon.png"
- qml: ""
- }
- ListElement {
- name: "cal"
- icon: "../res/vehicle/cal.png"
- qml: ""
- }
- ListElement {
- name: "ev"
- icon: "../res/vehicle/EV Icon.png"
- qml: ""
- }
- ListElement {
- name: "folders"
- icon: "../res/vehicle/folders.png"
- qml: ""
- }
- ListElement {
- name: "key"
- icon: "../res/vehicle/key_car.png"
- qml: ""
- }
- ListElement {
- name: "mcs"
- icon: "../res/vehicle/MCS Icon.png"
- qml: ""
- }
- ListElement {
- name: "sun"
- icon: "../res/vehicle/sun.png"
- qml: ""
- }
- ListElement {
- name: "sync"
- icon: "../res/vehicle/SYNC Services.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/Constants.js b/src/components/qt_hmi/qml_model_qt5/models/Constants.js
deleted file mode 100644
index 0b4a3191d7..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/Constants.js
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @file Constants.js
- * @brief Namespace of constants.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-.pragma library
-
-// Colors
-
-// Main color of HMI model(now it ~lightblue). Buttons, text, icons of this color.
-var primaryColor = "#1d81d5"
-
-// Color of pressed buttons, text, icons etc.
-var primaryColorPressed = "#8ec0ea"
-
-// Secondary color of HMI model, backgroud of this color.
-var secondaryColor = "black"
-
-// Color of text at buttonts that are inactive (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColor = "grey"
-
-// Color of text at buttonts that are inactive but nevertheless pressed (at phone keyboard, when no any contact started with current letter).
-var inactiveButtonTextColorPressed = "lightgrey"
-
-// Color of text at contact list screen view (Name, number and number type).
-var contactTextColor = "lightblue"
-
-// Color of text at buttons, when they are pressed.
-var pressedButtonTextColor = "black"
-
-// Color of text at "white" buttons, for all other buttons (which most) use primaryColor.
-var releasedButtonTextColor = "white"
-
-// Transparent background.
-var transparentColor = "#00000000"
-
-// "Warning" word color
-var warningColor = "red"
-
-// Color for PopUp
-var popUpBorderColor = "white"
-
-// Color for hardware and simulation panels
-var panelColor = "#003"
-
-// Color for text in hardware and simulation panels
-var panelTextColor = "white"
-
-// Audio pass thru PopUp text color
-var audioPassThruTextColor = "white"
-
-// Semi transparent color of item in SDL Navi menu
-var sdlNaviTransparentItemColor = "#30C0C0C0"
-
-//--------------------------------------------------------------------------------------
-
-// Font sizes of different elements
-
-// Font size for most of text in HMI model.
-var fontSize = 20
-
-// Font size for text inside oval buttons.
-var ovalButtonFontSize = 15
-
-// Title font size
-var titleFontSize = 35
-
-// Power on/off button font size
-var powerButtonFornSize = 25
-
-// Font size of status bar
-var statusBarFontSize = 15
-
-// Size icon for buttons
-var iconButtonSize = 30
-
-// Size icon for item list
-var iconItemListSize = 40
-
-// font size fo TTS popup
-var ttsFontSize = 12
-
-// Font size for list of applications
-var appListFontSize = 40
-
-// Size of contact list fields
-var contactListNameFieldSize = 0.4
-var contactListPhoneFieldSize = 0.3
-var contactListDescriptionFieldSize = 0.3
-
-//--------------------------------------------------------------------------------------
-
-// Sizes of buttons, menus, screen, etc
-
-// Minimal width and height of screen (screen wont resize, if height and width are lower).
-var mainScreenMinWidth = 800
-var mainScreenMiHeight = 600
-
-// Width for long oval button
-var ovalButtonWidth = 163
-
-// Height for oval button
-var ovalButtonHeight = 65
-
-// Height item list
-var itemListHeight = 60
-
-// Width for TTS popup
-var ttsPopUpWidth = 250
-
-// Height for TTS popup
-var ttsPopUpHeight = 100
-
-// Width for popup view
-var popupWidth = 700
-
-// Width for alert window
-var alertWidth = 360
-
-// Height for popup view
-var popupHeigth = 500
-
-// Width for combobox
-var defaultComboboxWidth = 150
-
-// Size icon for list of applications
-var appListIconSize = 100
-
-// DistanceBar height
-var distanceBarHeight = 1
-
-
-//---------------------------------------------------------------------------------------
-
-// Other
-
-// Offset from the edges of the screen.
-var margin = 20
-
-// Offset from the edges of the popup
-var popupMargin = 15
-
-// Spacing between items in SDLNavi view
-var sdlNaviSpacing = 5
-
-// Spacing between contacts at contact screen view.
-var contactListSpacing = 30
-
-// Duration of appearance of icon/button at icon/button menus.
-var animationDuration = 500
-
-// Duration of appearence of "OK" button at warning screen view, when HMI starts.
-var warningScreenDuration = 1000
-
-// Timer to check how long preset button is pressed.
-var presetButtonTimer = 800
-
-// Timer to check got long custom button is pressed.
-var customButtonTimer = 2000
-
-// Spacing between icon and item in list
-var iconItemListSpacing = 20
-
-// Spacing between item on views
-var generalSpacing = 10
-
-// Width of scrollBar
-var scrollBarWidth = 5
-
-// Speak text for a given time
-var ttsSpeakTime = 2000
-
-// Maximal number of submenus
-var maximumSubmenus = 1000
-
-// Maximal number of commands in submenu or root menu
-var maximumCommandsPerSubmenu = 1000
-
-// padding for popup view
-var popUpPadding = 20
-
-// Padding for TTS popup
-var ttsPopUpPadding = 10
-
-// -------------------------
-var sliderBarWidth = 400
-var sliderBarHeight = 50
-var sliderBarRadius = 3
-var sliderBarBorderWidth = 1
-var sliderTextColor = "white"
-var sliderBarBorderColor = "white"
-var sliderBarFillColor = "white"
-
-// -------------------------
-var scrollableMessageTextColor = "white"
-var scrollableMessageScrollBarColor = "gray"
-var scrollableMessageScrollBarWidth = 10
-
-// Padding for hardware and simulation panels
-var panelPadding = 20
-
-// Scale for pressed icon in menu
-var pressedIconScale = 1.1
-
-// Values of color effect for highlighted button
-var highlightedButtonHue = 0.9
-var highlightedButtonSaturation = 0.0
-var highlightedButtonLightness = 0.1
-
-// Values of color effect for disabled button
-var disabledButtonHue = 0.0
-var disabledButtonSaturation = -1.0
-var disabledButtonLightness = 0.1
-
-// Count of rows for grid menu
-var menuRowCount = 2
-
-// Count of columns for grid menu
-var menuColumnCount = 3
-
-// Position for element that came without position value (should be always at the end)
-var positionOfElementWithoutPosition = 1001
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml
deleted file mode 100644
index 7e9326e9d8..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ContactsListModel.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file ContactsListModel.qml
- * @brief List of contacts.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-ListModel
-{
- // TODO {ALeshin}: This list model should be sorted in ABC and Upper/lower case order,
- // when it will be filled dynamically.
- ListElement { name: "Aaron" ; phone:"(614)555-2444";type:"Mobile"}
- ListElement { name: "Adrian" ; phone:"(740)245-3434";type:"Mobile" }
- ListElement { name: "Albert" ; phone:"(614)245-5584";type:"Mobile" }
- ListElement { name: "Alice" ; phone:"(313)878-3566";type:"Office"}
- ListElement { name: "Alec" ; phone:"(917)608-2418";type:"Mobile"}
- ListElement { name: "Alexander" ; phone:"(614)608-2400";type:"Home"}
- ListElement { name: "Alexander Vasil'evich Michail Leontiy" ; phone:"(614)608-2400";type:"Mobile"}
- ListElement { name: "Amber" ; phone:"(614)608-2111";type:"Mobile"}
- ListElement { name: "Amy" ; phone:"(440)245-3434";type:"Mobile" }
- ListElement { name: "Andy" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Antje" ; phone:"(567)245-3434";type:"Home" }
- ListElement { name: "buddy" ; phone:"(614)813-6610";type:"Mobile" }
- ListElement { name: "Barry" ; phone:"(313)555-2211";type:"Mobile" }
- ListElement { name: "Bea" ; phone:"(614)455-3434";type:"Mobile" }
- ListElement { name: "Ben" ; phone:"(614)882-1843";type:"Office" }
- ListElement { name: "Blake" ; phone:"(330)149-7778";type:"Mobile" }
- ListElement { name: "Bob Mould" ; phone:"(313)245-3434";type:"Mobile" }
- ListElement { name: "Brian" ; phone:"(614)332-7499";type:"Mobile" }
- ListElement { name: "Calvin" ; phone:"(614)442-9974";type:"Mobile" }
- ListElement { name: "Carl" ; phone:"(567)773-3434";type:"Home" }
- ListElement { name: "Cat Power" ; phone:"(313)608-3434";type:"Home"}
- ListElement { name: "Cathy" ; phone:"(313)444-456";type:"Home"}
- ListElement { name: "Chris" ; phone:"(734)997-6514";type:"Home" }
- ListElement { name: "Cloud Nothings"; phone:"(444)608-543";type:"Mobile"}
- ListElement { name: "Cody" ; phone:"(567)365-8413";type:"Home" }
- ListElement { name: "Curtis" ; phone:"(614)245-1547";type:"Office" }
- ListElement { name: "Dakota" ; phone:"(567)555-4444";type:"Home" }
- ListElement { name: "Dale" ; phone:"(567)723-1974";type:"Mobile" }
- ListElement { name: "Dallas"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Damian" ; phone:"(614)245-3434";type:"Office" }
- ListElement { name: "Daniel"; phone:"(614)556-879";type:"Home"}
- ListElement { name: "Darina"; phone:"(313)895-888";type:"Mobile"}
- ListElement { name: "Dee "; phone:"(313)432-3434";type:"Home"}
-// ListElement { name: "Edward" ; phone:"(917)608-975";type:"Office"}
- ListElement { name: "Ferdinand" ; phone:"(917)879-795";type:"Mobile"}
- ListElement { name: "gomez" ; phone:"(313)455-543";type:"Mobile"}
- ListElement { name: "Harry Potter"; phone:"(313)888-432";type:"Home"}
- ListElement { name: "Ivan"; phone:"(313)996-225";type:"Home"}
-// ListElement { name: "James" ; phone:"(917)608-3434";type:"Mobile"}
- ListElement { name: "Karen"; phone:"(313)998-332";type:"Home"}
- ListElement { name: "Luis Torres"; phone:"(313)779-111";type:"Home"}
- ListElement { name: "Mary"; phone:"(313)234-098";type:"Mobile"}
- ListElement { name: "Neil"; phone:"(313)444-112";type:"Mobile"}
- ListElement { name: "Oswald"; phone:"(313)456-921";type:"Mobile"}
- ListElement { name: "Oscar"; phone:"(313)332-778";type:"Home"}
- ListElement { name: "~1123"; phone:"(313)1332";type:"Home"}
- ListElement { name: "Patrice"; phone:"(313)789-111";type:"Mobile"}
- ListElement { name: "Queen Elizabeth"; phone:"(313)897-666";type:"Mobile"}
- ListElement { name: "Rose"; phone:"(313)111-211";type:"Mobile"}
- ListElement { name: "Susell"; phone:"(313)345-122";type:"Home"}
- ListElement { name: "Thomas"; phone:"(917)608-342";type:"Mobile"}
- ListElement { name: "Titus Andronicus" ; phone:"(917)608-321";type:"Office"}
- ListElement { name: "Toretto" ; phone:"(917)608-3434";type:"Home"}
- ListElement { name: "Uhl" ; phone:"(313)444-654";type:"Office"}
- ListElement { name: "willi" ; phone:"(313)224-5712";type:"Office"}
- ListElement { name: "Wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "wanda" ; phone:"(313)666-6969";type:"Office"}
- ListElement { name: "Zara" ; phone:"(313)231-009";type:"Mobile"}
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
deleted file mode 100644
index e3785bdf19..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/DataStorage.qml
+++ /dev/null
@@ -1,660 +0,0 @@
-/**
- * @file DataStorage.qml
- * @brief Container for data.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "Internal.js" as Internal
-import "Constants.js" as Constants
-
-QtObject {
- property string contactsFirstLetter // first letter of contact's name that need to find at contact list
- property ApplicationModel currentApplication: ApplicationModel { }
- property SliderModel uiSlider: SliderModel { }
- property PerformAudioPassThruModel uiAudioPassThru: PerformAudioPassThruModel { }
- property ScrollableMessageModel scrollableMessageModel: ScrollableMessageModel { }
-
- function getApplication(appId) {
- console.log("enter");
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- console.log("Application found", applicationList.get(i));
- return applicationList.get(i);
- }
- }
- console.log("exit");
- }
-
- function getStashedApplication(appId) {
- console.log("enter getStashedApplication function");
- for(var i = 0; i < stashedApplicationsList.count; i++) {
- if(stashedApplicationsList.get(i).appId === appId) {
- console.log("Application found", stashedApplicationsList.get(i));
- return stashedApplicationsList.get(i);
- }
- }
- console.log("exit getStashedApplication: application was not found");
- }
-
- onApplicationListChanged: {
- console.log("onApplicationListChanged()");
- setCurrentApplication(appId);
- }
-
- function setCurrentApplication(appId) {
- console.log("Enter setCurrentApplication function");
- var oldApplicationContext = applicationContext;
- if (currentApplication.appId !== appId) {
- applicationContext = false;
- }
-
- for(var i = 0; i < applicationList.count; i++) {
- if(applicationList.get(i).appId === appId) {
- currentApplication.appId = appId
- var application = applicationList.get(i)
-
- currentApplication.appName = application.appName
- currentApplication.appType = application.appType
- currentApplication.appIcon.source = application.icon
- currentApplication.playPauseState = application.playPauseState
- currentApplication.options = application.options
- currentApplication.softButtons = application.softButtons
- currentApplication.navigationSoftButtons = application.navigationSoftButtons
- currentApplication.alertManeuverSoftButtons = application.alertManeuverSoftButtons
- currentApplication.customPresets = application.customPresets
-
- if (application.navigationModel.text1 !== undefined) {
- currentApplication.navigationModel.text1 = application.navigationModel.text1
- }
- if (application.navigationModel.text2 !== undefined) {
- currentApplication.navigationModel.text2 = application.navigationModel.text2
- }
- if (application.navigationModel.totalDistance !== undefined) {
- currentApplication.navigationModel.totalDistance = application.navigationModel.totalDistance
- }
- if (application.navigationModel.eta !== undefined) {
- currentApplication.navigationModel.eta = application.navigationModel.eta
- }
- if (application.navigationModel.timeToDestination !== undefined) {
- currentApplication.navigationModel.timeToDestination = application.navigationModel.timeToDestination
- }
- if (application.navigationModel.turnIcon !== undefined) {
- currentApplication.navigationModel.turnIcon = application.navigationModel.turnIcon
- }
- if (application.navigationModel.nextTurnIcon !== undefined) {
- currentApplication.navigationModel.nextTurnIcon = application.navigationModel.nextTurnIcon
- }
- if (application.navigationModel.distanceToManeuver !== undefined) {
- currentApplication.navigationModel.distanceToManeuver = application.navigationModel.distanceToManeuver
- }
- if (application.navigationModel.distanceToManeuverScale !== undefined) {
- currentApplication.navigationModel.distanceToManeuverScale = application.navigationModel.distanceToManeuverScale
- }
- if (application.navigationModel.maneuverComplete !== undefined) {
- currentApplication.navigationModel.maneuverComplete = application.navigationModel.maneuverComplete
- }
- if (application.navigationModel.appID !== undefined) {
- currentApplication.navigationModel.appID = application.navigationModel.appID
- }
- if (application.hmiUIText.mainField1 !== undefined) {
- currentApplication.hmiUIText.mainField1 = application.hmiUIText.mainField1
- }
- if (application.hmiUIText.mainField2 !== undefined) {
- currentApplication.hmiUIText.mainField2 = application.hmiUIText.mainField2
- }
- if (application.hmiUIText.mainField3 !== undefined) {
- currentApplication.hmiUIText.mainField3 = application.hmiUIText.mainField3
- }
- if (application.hmiUIText.mainField4 !== undefined) {
- currentApplication.hmiUIText.mainField4 = application.hmiUIText.mainField4
- }
- if (application.hmiUIText.statusBar !== undefined) {
- currentApplication.hmiUIText.statusBar = application.hmiUIText.statusBar
- }
- if (application.hmiUIText.mediaTrack !== undefined) {
- currentApplication.hmiUIText.mediaTrack = application.hmiUIText.mediaTrack
- }
- if (application.hmiUIText.image !== undefined) {
- currentApplication.hmiUIText.image = application.hmiUIText.image
- }
- if (application.hmiUIText.secondaryImage!== undefined) {
- currentApplication.hmiUIText.secondaryImage= application.hmiUIText.secondaryImage
- }
- if (application.hmiUITextAlignment !== undefined) {
- currentApplication.hmiUITextAlignment = application.hmiUITextAlignment
- }
- if (application.helpPrompt !== undefined) {
- currentApplication.helpPrompt = application.helpPrompt
- }
- if (application.timeoutPrompt !== undefined) {
- currentApplication.timeoutPrompt = application.timeoutPrompt
- }
- if (application.mediaClock.startTime !== undefined) {
- currentApplication.mediaClock.startTime = application.mediaClock.startTime
- }
- if (application.mediaClock.endTime !== undefined) {
- currentApplication.mediaClock.endTime = application.mediaClock.endTime
- }
- // Check fields with mandatory = false
-
- if (application.menuIcon !== undefined) {
- currentApplication.menuIcon.source = application.menuIcon
- }
- currentApplication.vrHelpTitle = application.vrHelpTitle
- currentApplication.vrHelpTitleDefault = application.vrHelpTitleDefault
- currentApplication.vrHelpTitlePerformInteraction = application.vrHelpTitlePerformInteraction
- currentApplication.menuTitle = application.menuTitle
- currentApplication.vrHelpItems = application.vrHelpItems
- currentApplication.vrHelpItemsPerformInteraction = application.vrHelpItemsPerformInteraction
- currentApplication.deviceName = application.deviceName
- currentApplication.isMediaApplication = application.isMediaApplication
- currentApplication.turnList = application.turnList
- currentApplication.turnListSoftButtons = application.turnListSoftButtons
- currentApplication.mediaClock.updateMode = application.mediaClock.updateMode
- currentApplication.mediaClock.runningMode = application.mediaClock.runningMode
- if (application.mediaClock.startTimeForProgress !== undefined) {
- currentApplication.mediaClock.startTimeForProgress = application.mediaClock.startTimeForProgress
- }
- currentApplication.languageTTSVR = application.languageTTSVR
- currentApplication.hmiDisplayLanguageDesired = application.hmiDisplayLanguageDesired
- currentApplication.allowedFunctions = application.allowedFunctions
- // This place is for adding new properties
- }
- }
- applicationContext = oldApplicationContext;
- currentApplicationChanged()
- console.log("Exit setCurrentApplication function")
- }
-
- function addApplication(app) {
- console.log("enter")
- applicationList.append({
- appName: app.appName,
- ngnMediaScreenAppName: app.ngnMediaScreenAppName,
- icon: app.icon,
- menuIcon: {
- value: "",
- imageType: 1
- },
- deviceName: app.deviceName,
- appId: app.appId,
- hmiDisplayLanguageDesired: app.hmiDisplayLanguageDesired,
- isMediaApplication: app.isMediaApplication,
- appType: app.appType,
- helpPrompt: "",
- timeoutPrompt: "",
- customPresets: app.customPresets ? app.customPresets : [],
- playPauseState: 'Pause',
- hmiUIText: app.hmiUIText,
- hmiUITextAlignment: app.hmiUITextAlignment,
- options: [],
- turnList: [],
- turnListSoftButtons: [],
- mediaClock: app.mediaClock,
- languageTTSVR: Common.Language.EN_US,
- softButtons: [],
- vrHelpTitle: "",
- vrHelpTitlePerformInteraction: "",
- vrHelpTitleDefault: "VR HELP",
- menuTitle: "",
- keyboardProperties: [],
- vrHelpItems: [],
- vrHelpItemsPerformInteraction: [],
- vrHelpItemsDefault: {
- text: "VrHelpItems - defaultText1",
- image: "",
- position: 1
- },
- navigationSoftButtons: [],
- alertManeuverSoftButtons: [],
- navigationModel: {
- appID: -1,
- text1: "",
- text2: "",
- totalDistance: "",
- eta: "",
- timeToDestination: "",
- turnIcon: {
- value: "",
- imageType: -1
- },
- nextTurnIcon: {
- value: "",
- imageType: -1
- },
- distanceToManeuver: 0,
- distanceToManeuverScale: 0,
- maneuverComplete: false
- },
- allowedFunctions: []
- // This place is for adding new properties
- })
- if (app.isMediaApplication) {
- musicSourceModel.insert(0, {
- "title": app.appName,
- "qml": "views/SDLPlayerView.qml",
- "appId": app.appId
- })
- }
-
- console.log("exit")
- }
-
- function setApplicationProperties(appId, props) {
- console.log("Enter setApplicationProperties function");
-
- var app = getApplication(appId)
- for (var p in props) {
- console.debug(p)
- if (props[p] !== undefined) {
- app[p] = props[p]
- }
- }
- if (currentApplication.appId === appId) {
- setCurrentApplication(appId); // copy new values to current application
- }
- console.log("Exit setApplicationProperties function");
- }
-
- function removeApplication(appId) {
- console.log("enter removeApplication");
- for (var j = 0; j < musicSourceModel.count; ++j) {
- if (musicSourceModel.get(j).appId === appId) {
- musicSourceModel.remove(j);
- break;
- }
- }
- for (var i = 0; i < applicationList.count; i++) {
- if (applicationList.get(i).appId === appId) {
- applicationList.remove(i);
- break;
- }
- }
- console.log("exit removeApplication");
- }
-
- function stashApplication(appId) {
- console.log("stashApplication enter");
- stashedApplicationsList.append(getApplication(appId))
- console.log("stashApplication exit");
- }
-
- function getResumeResult (appID) {
-
- if (getStashedApplication(appId) && getApplication(appID)) {
- var stashedApp = getStashedApplication(appId),
- app = getApplication(appID);
- if (stashedApp.options.count == app.options.count) {
- for (var optionIndex = 0; optionIndex < stashedApp.options.count; ++optionIndex) {
- if (app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) {
- //comparison subMenu compare
-
- if ( !((app.options.get(optionIndex).id === stashedApp.options.get(optionIndex).id) &&
- (app.options.get(optionIndex).name === stashedApp.options.get(optionIndex).name) &&
- (app.options.get(optionIndex).position === stashedApp.options.get(optionIndex).position) &&
- (app.options.get(optionIndex).icon === stashedApp.options.get(optionIndex).icon))) {
- return {
- result: false
- }
- }
-
- var stashedAppSubMenu = stashedApp.options.get(optionIndex).subMenu,
- appSubMenuArray = app.options.get(optionIndex).subMenu;
-
- if (stashedAppSubMenu.length != appSubMenuArray.length) {
- return {
- result: false
- }
- }
-
- for (var subMenuIndex = 0; subMenuIndex < stashedAppSubMenu.length; subMenuIndex++) {
- if ( !((appSubMenuArray[subMenuIndex].id === stashedAppSubMenu[subMenuIndex].id) &&
- (appSubMenuArray[subMenuIndex].name === stashedAppSubMenu[subMenuIndex].name) &&
- (appSubMenuArray[subMenuIndex].position === stashedAppSubMenu[subMenuIndex].position) &&
- (appSubMenuArray[subMenuIndex].icon === stashedAppSubMenu[subMenuIndex].icon)
- )) {
- return {
- result: false
- }
- }
- }
- } else {
- //comparison Command compare
- if ( !((app.options.get(optionIndex).id === stashedApp.options.get(optionIndex).id) &&
- (app.options.get(optionIndex).name === stashedApp.options.get(optionIndex).name) &&
- (app.options.get(optionIndex).position === stashedApp.options.get(optionIndex).position) &&
- (app.options.get(optionIndex).icon === stashedApp.options.get(optionIndex).icon)
- )) {
- return {
- result: false
- }
- }
- }
- }
- // if all commands and subMenus were same
- // rerturn SUCCESS result
- return {
- result: true
- }
- }
- }
-
- return {
- result: false
- }
- }
-
- property int systemContext
- property int hmiContext
- property bool applicationContext: false
- property bool applicationSavedContext
- property string routeText: ""
- property PlayerState cdPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState ipodPlayerState: PlayerState {
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- playPauseState: 'Pause'
- }
- property PlayerState usbPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState linePlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState btPlayerState: PlayerState {
- playPauseState: 'Pause'
- albumImage: "../res/album_art.png"
- trackNumber: "13/16"
- trackName: "The Dog Days Are Over"
- albumName: "Florence and the Machine"
- }
- property PlayerState amPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "1130", "950", "760", "1270", "1400", "2100", "940", "1001" ]
- }
- property PlayerState fmPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: ["96.3", "107.9", "104.3", "101.9", "105.3", "100.5", "107.9", "103.4"]
- }
- property PlayerState siriusPlayerState: PlayerState {
- songName: "So Far Around The Bend"
- albumName: "The National"
- presets: [ "Lithium", "Spectrum", "ESPN", "Alt Nation", "Lithium", "Spectrum", "ESPN", "Alt Nation" ]
- }
-
- property bool hmiVRAvailable: false
- property bool hmiTTSAvailable: false
- property bool hmiNavigationAvailable: false
- property bool hmiVehicleInfoAvailable: false
- property bool hmiUIAvailable: false
-
- property int hmiUILanguage: Common.Language.EN_US
- property int hmiTTSVRLanguage: Common.Language.EN_US
-
- property ListModel deviceList: ListModel { }
- property ListModel applicationList: ListModel { }
- property ListModel stashedApplicationsList: ListModel { }
- property ListModel vrCommands: ListModel { }
- property ListModel choicesVrCommands: ListModel { }
-
- function reset () {
- console.log("dataContainer reset enter");
- routeText = ""
- console.log("dataContainer reset exit");
- }
-
- function changeRegistrationUI (language, appID) {
- console.log("dataContainer changeRegistrarionUI enter");
- setApplicationProperties(appID, { hmiDisplayLanguageDesired: language });
- console.log("dataContainer changeRegistrarionUI exit");
- }
-
- function changeRegistrationTTSVR(language, appID) {
- console.log("dataContainer changeRegistrationTTSVR enter");
- setApplicationProperties(appID, { languageTTSVR: language });
- console.log("dataContainer changeRegistrationTTSVR exit");
- }
-
- function addCommand (cmdID, menuParams, cmdIcon, appID) {
- console.debug("enter: " +
- cmdID +
- ", " +
- (menuParams ?
- "{" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}" : menuParams) +
- ", " +
- (cmdIcon ?
- "{" + cmdIcon.value + ", " + cmdIcon.imageType + "}" : cmdIcon) +
- ", " +
- appID
- )
- var commandToAddPosition
- var app = getApplication(appID)
- var currentMenu = app.options
- var maximumCommands = Constants.maximumCommandsPerSubmenu
- var index = 0
-
- if ((menuParams) && (menuParams.parentID)) { // Work with sub menu
- var parentNotFound = true
- for (var optionIndex = 0; optionIndex < app.options.count; ++optionIndex) {
- if ((app.options.get(optionIndex).type === Internal.MenuItemType.MI_SUBMENU) && (app.options.get(optionIndex).id === menuParams.parentID)) {
- currentMenu = app.options.get(optionIndex).subMenu
- parentNotFound = false
- maximumCommands += 1
- }
- }
- if (parentNotFound) {
- console.log("UI::addCommand(): parentID " + menuParams.parentID + " not found")
- }
- }
-
- if (currentMenu.count < maximumCommands) {
- if (menuParams && (menuParams.position !== undefined)) {
- commandToAddPosition = menuParams.position
- } else {
- commandToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < currentMenu.count; i++) {
- if (commandToAddPosition >= currentMenu.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- currentMenu.insert( index,
- { id: cmdID,
- name: menuParams.menuName,
- type: Internal.MenuItemType.MI_NODE,
- position: commandToAddPosition,
- icon: cmdIcon ? cmdIcon : {},
- subMenu: []
- })
- } else {
- console.log("addCommand(): too many commands in menu: ", menuParams.parentID, " rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteCommand (cmdID, appID) {
- console.debug("enter: " + cmdID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if (option.type === Internal.MenuItemType.MI_NODE) {
- if (option.id === cmdID) {
- getApplication(appID).options.remove(optionIndex)
- break
- }
- }
- if (option.type === Internal.MenuItemType.MI_SUBMENU) {
- var subMenu = option.subMenu
- var idMatchFound = false
- for (var subOptionIndex = 0; subOptionIndex < subMenu.count; ++subOptionIndex) {
- if (subMenu.get(subOptionIndex).id === cmdID) {
- idMatchFound = true
- if (subMenu !== currentApplication.currentSubMenu) {
- subMenu.remove(subOptionIndex)
- }
- else {
- console.log("UI::deleteCommand(): cannot remove item from current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- if (idMatchFound) {
- break
- }
- }
- }
- console.debug("exit")
- }
-
- function addSubMenu (menuID, menuParams, appID) {
- console.debug("enter: " + menuID + ", {" + menuParams.parentID + ", " + menuParams.position + ", " + menuParams.menuName + "}, " + appID)
- var app = getApplication(appID)
- var index = 0
- var count = app.options.count
- var subMenuToAddPosition
-
- if (count < Constants.maximumSubmenus) {
- if (menuParams.position !== undefined) {
- subMenuToAddPosition = menuParams.position
- } else {
- subMenuToAddPosition = Constants.positionOfElementWithoutPosition
- }
- for (var i = 0; i < count; i++) {
- if (subMenuToAddPosition >= app.options.get(i).position) {
- index = i + 1
- } else {
- break
- }
- }
- app.options.insert(index, {
- "id": menuID,
- "name": menuParams.menuName,
- "position": subMenuToAddPosition,
- "type": Internal.MenuItemType.MI_SUBMENU,
- "icon": undefined,
- "subMenu": [{
- "id": -1,
- "name": menuParams.menuName,
- "position": -1,
- "type": Internal.MenuItemType.MI_PARENT,
- "icon": {
- "imageType": Common.ImageType.DYNAMIC,
- "value": "../res/nav/turnArrow.png"
- },
- "subMenu": getApplication(appID).options
- }]
- })
- }
- else {
- console.log("addSubMenu(): too many submenus, rejecting")
- throw Common.Result.REJECTED
- }
- console.debug("exit")
- }
-
- function deleteSubMenu (menuID, appID) {
- console.debug("enter: " + menuID + ", " + appID)
- for (var optionIndex = 0; optionIndex < getApplication(appID).options.count; ++optionIndex) {
- var option = getApplication(appID).options.get(optionIndex)
- if ((option.type === Internal.MenuItemType.MI_SUBMENU) && (option.id === menuID)) {
- if (option.subMenu !== currentApplication.currentSubMenu) {
- getApplication(appID).options.remove(optionIndex)
- }
- else {
- console.log("UI::deleteSubMenu(): cannot remove current submenu")
- throw Common.Result.IN_USE
- }
- break
- }
- }
- console.debug("exit")
- }
- property VehicleInfoModel vehicleInfoModel: VehicleInfoModel { }
- property bool activeVR: false
- property int driverDistractionState: Common.DriverDistractionState.DD_OFF
- onDriverDistractionStateChanged: {
- sdlUI.onDriverDistraction(driverDistractionState);
- }
- property bool activeTTS: false
- property var activePopup: [] // Stack of names of active pop ups
- property int popups: 0
-
- property bool activeAlert: false
-
- onActiveVRChanged: setSystemContext()
- onActiveAlertChanged: setSystemContext()
- onPopupsChanged: setSystemContext()
-
- function setSystemContext () {
- console.debug("enter")
- if (popups > 0) {
- systemContext = Common.SystemContext.SYSCTXT_HMI_OBSCURED
- }
- else if (activeAlert) {
- systemContext = Common.SystemContext.SYSCTXT_ALERT
- }
- else if (activeVR) {
- systemContext = Common.SystemContext.SYSCTXT_VRSESSION
- }
- else if (contentLoader.item !== null) {
- systemContext = contentLoader.item.systemContext
- }
- console.debug("exit")
- }
- property MusicSourceModel musicSourceModel: MusicSourceModel {
- }
-
- property SettingsSourceModel settingsSourceModel: SettingsSourceModel {
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/Internal.js b/src/components/qt_hmi/qml_model_qt5/models/Internal.js
deleted file mode 100644
index 53d7640136..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/Internal.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-.pragma library
-.import "../hmi_api/Common.js" as Common
-
-var MenuItemType = {
- MI_NODE: 0,
- MI_SUBMENU: 1,
- MI_PARENT: 2
-}
-
-function activePageChoose(flickElement, pages) {
- if (flickElement.contentX <= 0) {
- return 0
- }
- else if ( (flickElement.contentWidth - flickElement.contentX) < flickElement.width) {
- return pages -1
- }
- else {
- if ( (flickElement.contentX % flickElement.width) >= (1/6 * flickElement.width)) {
- return Math.ceil(flickElement.contentX / flickElement.width)
- }
- else if ( (flickElement.contentX % flickElement.width) > 0) {
- return Math.floor(flickElement.contentX / flickElement.width)
- }
- }
-}
-
-var MediaClockUpdateMode = {
- MCU_COUNTUP: 0,
- MCU_COUNTDOWN: 1,
-}
-
-var MediaClockRunningMode = {
- MCR_RUNNING: 0,
- MCR_STOPPED: 1
-}
-
-function chooseAppStartScreen(appType, isMediaApplication) {
- if (checkBit(appType, Common.AppHMIType.NAVIGATION)) {
- return "./views/SDLNavi.qml"
- } else if (isMediaApplication) {
- return "./views/SDLPlayerView.qml"
- } else {
- return "./views/SDLNonMediaView.qml"
- }
-}
-
-function appendVrHelpItem (arrayElement, index, array) {
- this.append({
- text: arrayElement.text,
- image: arrayElement.image ? arrayElement.image : "",
- position: arrayElement.position
- })
-}
-
-function checkBit(value, bitPosition) {
- return (value & (1 << bitPosition))
-}
-
-function getArrayForPresetRow(app) {
- var array = []
- for (var i = 0; i < app.customPresets.count; i++) {
- array.push(app.customPresets.get(i).text)
- }
- return array
-}
-
-function pad (string, length, lead) {
- if (!lead) {
- lead = '0'
- }
- var paddedString = "" + string
- while (paddedString.length < length) {
- paddedString = lead + paddedString
- }
- return paddedString
-}
-
-function hmsTime (hours, minutes, seconds) {
- return 60 * (60 * hours + minutes) + seconds
-}
-
-function hmsTimeToString (hmsTime) {
- if (hmsTime === -1) {
- return "0:00:00"
- }
-
- var _time = hmsTime
- var seconds = _time % 60
- _time -= seconds
- _time /= 60
- var minutes = _time % 60
- _time -= minutes
- _time /= 60
- var hours = _time
- var string = ""
- string += hours
- string += ":"
- string += pad(minutes, 2)
- string += ":"
- string += pad(seconds, 2)
- return string
-}
-
-function stringToHmsTime (hmsString) {
- console.debug("enter: \"" + hmsString + "\"")
- var substrings = hmsString.split(":")
- var seconds = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (seconds >= 60) {
- console.log("incorrect field \"seconds\": " + seconds)
- console.debug("exit")
- return 0
- }
- var minutes = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- if (minutes >= 60) {
- console.log("incorrect field \"minutes\": " + minutes)
- console.debug("exit")
- return 0
- }
- var hours = substrings.length > 0 ? parseInt(substrings.pop()) : 0
- console.debug("exit")
- return hmsTime(hours, minutes, seconds)
-}
-
-function mediaClockUpdateModeToString (mediaClockUpdateMode) {
- switch (mediaClockUpdateMode) {
- case MediaClockUpdateMode.MCU_COUNTUP:
- return "Internal.MediaClockUpdateMode.MCU_COUNTUP"
- case MediaClockUpdateMode.MCU_COUNTDOWN:
- return "Internal.MediaClockUpdateMode.MCU_COUNTDOWN"
- default:
- return ""
- }
-}
-
-function mediaClockRunningModeToString (mediaClockRunningMode) {
- switch (mediaClockRunningMode) {
- case MediaClockRunningMode.MCR_RUNNING:
- return "Internal.MediaClockRunningMode.MCR_RUNNING"
- case MediaClockRunningMode.MCR_STOPPED:
- return "Internal.MediaClockRunningMode.MCR_STOPPED"
- default:
- return ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml
deleted file mode 100644
index a2f659c393..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/MainMenuListModel.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file MainMenuListModel.qml
- * @brief Main menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-ListModel
-{
- ListElement {
- name: "Climate"
- icon: "../res/snow.png"
- qml: "./views/ClimateControlView.qml"
- }
-
- ListElement {
- name: "Navigation"
- icon: "../res/arrow.png"
- qml: "./views/NavigationNoRouteGridView.qml"
- }
-
- ListElement {
- name: "Media"
- icon: "../res/notes.png"
- qml: "./views/MusicSourceView.qml"
- }
-
- ListElement {
- name: "Settings"
- icon: "../res/gear.png"
- qml: "./views/SettingsSourceView.qml"
- }
-
- ListElement {
- name: "Apps"
- icon: "../res/apps.png"
- qml: "./views/ApplicationListView.qml"
- }
-
- ListElement {
- name: "Phone"
- icon: "../res/phone/phone.png"
- qml: "./views/PhoneMenuGridView.qml"
- }
-
- ListElement {
- name: "Car"
- icon: "../res/car.png"
- qml: "./views/CarMenuGridView.qml"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
deleted file mode 100644
index 3712ca4c31..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/MediaClockModel.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * @file MediaClockModel.qml
- * @brief Media clock model
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "Internal.js" as Internal
-
-QtObject {
- property int updateMode
- property int runningMode
- property int startTime
- property int endTime
- property int upperTimeLimit: 60 * 60 * 60 - 1
- property int startTimeForProgress
- property real progress
-
- property Timer timer: Timer {
- id: timer
- interval: 1000
- repeat: true
- onTriggered: onTimer()
- }
- onRunningModeChanged: {
- if (runningMode === Internal.MediaClockRunningMode.MCR_STOPPED) {
- timer.stop()
- } else {
- timer.start()
- }
- }
-
- onStartTimeChanged: {
- onProgress()
- }
-
- onEndTimeChanged: {
- onProgress()
- }
-
- onStartTimeForProgressChanged: {
- onProgress()
- }
-
- function onTimer () {
- switch (updateMode) {
- case Internal.MediaClockUpdateMode.MCU_COUNTUP:
- console.debug("count up")
- if (startTime < endTime) {
- startTime++
- } else {
- 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 > endTime) {
- startTime--
- } else {
- timer.stop()
- runningMode = Internal.MediaClockRunningMode.MCR_STOPPED
- console.debug("count Down timer stopped")
- }
- break
- }
- dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, {
- "mediaClock": {startTime: startTime,
- endTime: endTime,
- updateMode: updateMode,
- runningMode: runningMode,
- startTimeForProgress: startTimeForProgress
- }
- })
- }
-
- function onProgress () {
- if (startTime === -1) {
- progress = 0
- }
- else if (endTime != -1 && endTime === startTimeForProgress) {
- progress = 1
- }
- else {
- progress = (startTime - startTimeForProgress) / (endTime - startTimeForProgress)
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml b/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml
deleted file mode 100644
index 7497d987d4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/MusicSourceModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file MusicSourceModel.qml
- * @brief Music source menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-ListModel
-{
- ListElement {
- title: "FM"
- qml: "./views/FMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "AM"
- qml: "./views/AMPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "BT Audio"
- qml: "./views/BTPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "Sirius"
- qml: "./views/SiriusPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "CD"
- qml: "./views/CDPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "iPod"
- qml: "./views/IPodPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "USB"
- qml: "./views/UsbPlayerView.qml"
- appId: 0
- }
- ListElement {
- title: "LineIn"
- qml: "./views/LineInPlayerView.qml"
- appId: 0
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml
deleted file mode 100644
index 6e434495a6..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/NavigationMenuModel.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * @file NavigationMenuModel.qml
- * @brief Model for navigation menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-ListModel
-{
- ListElement {
- title: "Home"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Keyboard"
- icon: "../res/buttons/long_oval_btn.png"
- qml: "./views/NavigationKeyboardView.qml"
- }
- ListElement {
- title: "Favorites"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Work"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Recent"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "POI"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Scout"
- icon: "../res/buttons/long_oval_btn.png"
- }
- ListElement {
- title: "Waze"
- icon: "../res/buttons/long_oval_btn.png"
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml b/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml
deleted file mode 100644
index 0abbe6b309..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/NavigationModel.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * @file NavigationModel.qml
- * @brief Model for Navigation.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-QtObject {
- property string text1: ""
- property string text2: ""
- property string totalDistance: ""
- property string eta: ""
- property string timeToDestination: ""
- property var turnIcon
- property var nextTurnIcon
-
- property real distanceToManeuver: 0
- property real distanceToManeuverScale: 0
- property bool maneuverComplete: false
- property int appID: -1
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml b/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml
deleted file mode 100644
index 0952b7d8ad..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/PerformAudioPassThruModel.qml
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * @file PerformAudioPassThruModel.qml
- * @brief Data model audio pass thru.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-QtObject {
- property string appName: ""
- property string firstLine: ""
- property string secondLine: ""
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml b/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml
deleted file mode 100644
index 519f48a809..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/PhoneMenuModel.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file PhoneMenuModel.qml
- * @brief Phone menu list of elements.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-ListModel
-{
- ListElement {
- name: "phone"
- icon: "../res/phone/phone.png"
- qml: ""
- }
- ListElement {
- name: "contacts"
- icon: "../res/phone/contacts.png"
- qml: "./views/PhoneKeyboardView.qml"
- }
- ListElement {
- name: "messages"
- icon: "../res/phone/messages.png"
- qml: ""
- }
- ListElement {
- name: "DND"
- icon: "../res/phone/dnd_off.png"
- qml: ""
- }
- ListElement {
- name: "texts"
- icon: "../res/phone/texts.png"
- qml: ""
- }
- ListElement {
- name: "recent"
- icon: "../res/phone/recent.png"
- qml: ""
- }
- ListElement {
- name: "keyboard"
- icon: "../res/phone/keypad.png"
- qml: ""
- }
- ListElement {
- name: "more"
- icon: "../res/phone/more.png"
- qml: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml b/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml
deleted file mode 100644
index 9707f35193..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/PlayerState.qml
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * @file PlayerState.qml
- * @brief List of parameters for each player.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-// Player state for all players except SDL media player
-Item {
- // Media players
- property string playPauseState
- property string albumImage
- property string trackNumber
- property int songPosition
- property string trackName
-
- // Radio Players
- property var presets: []
-
- // Both players
- property string songName
- property string albumName
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml b/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml
deleted file mode 100644
index 9f45a5d06d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/ScrollableMessageModel.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file ScrollableMessageModel.qml
- * @brief Model for Scrollable Message.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- property string longMessageText: "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh" +
- "ffsdjjjjjjjjj jjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjj jjjjiiiiiiiiiiiii iiiiiiiiiiii iiiiiiiii iiiiiiiiiiiii iiiiiiiiiiiiioooooo ooooooooo oooooooooooooooo ooooooooooooo ooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooooooooooooooooooo ooooooohhhhhhhhhh hhhhhhhhhhhhh hhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhh hhhhh"
- property ListModel softButtons: ListModel {}
- property int appId: -1
- property int timeout: 0
- property var async
- property bool running: false
- property int result: -1
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml b/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml
deleted file mode 100644
index fed6d499d9..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/SettingsSourceModel.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/**
- * @file SettingsSourceModel.qml
- * @brief Settings source menu list of elements.
- * 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 QtQuick 2.0
-
-ListModel
-{
- ListElement {
- title: "Allow SDL Functionality"
- qml: "./views/SDLFunctionalityView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "Update SDL"
- qml: ""
- appId: 0
- action: "update_sdl"
- }
- ListElement {
- title: "Policy table update status"
- qml: ""
- appId: 0
- action: "get_status_update"
- }
- ListElement {
- title: "Send request GetURLS"
- qml: ""
- appId: 0
- action: "get_urls"
- }
- ListElement {
- title: "Statistics info settings"
- qml: "./views/StatisticsInfoView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "App permissions"
- qml: "./views/PolicyAppListView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "Device state change"
- qml: "./views/DeviceStateChangedView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "System Error"
- qml: "./views/SystemErrorView.qml"
- appId: 0
- action: ""
- }
- ListElement {
- title: "System Request"
- qml: "./views/SystemRequestView.qml"
- appId: 0
- action: ""
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml b/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml
deleted file mode 100644
index a102b4ee27..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/SettingsStorage.qml
+++ /dev/null
@@ -1,401 +0,0 @@
-/**
- * @file SettingsStorage.qml
- * @brief Storage for keeping settings.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Internal.js" as Internal
-
-Item
-{
- property var sdlLanguagesList: [
- Common.Language.EN_US,
- Common.Language.ES_MX,
- Common.Language.FR_CA,
- Common.Language.DE_DE,
- Common.Language.ES_ES,
- Common.Language.EN_GB,
- Common.Language.RU_RU,
- Common.Language.TR_TR,
- Common.Language.PL_PL,
- Common.Language.FR_FR,
- Common.Language.IT_IT,
- Common.Language.SV_SE,
- Common.Language.PT_PT,
- Common.Language.NL_NL,
- Common.Language.ZH_TW,
- Common.Language.JA_JP,
- Common.Language.AR_SA,
- Common.Language.KO_KR,
- Common.Language.PT_BR,
- Common.Language.CS_CZ,
- Common.Language.DA_DK,
- Common.Language.NO_NO
- ]
-
- property var displayCapabilities: {
- "displayType": Common.DisplayType.GEN2_8_DMA,
- "textFields": [
- Common.TextFieldName.mainField1,
- Common.TextFieldName.mainField2,
- Common.TextFieldName.mainField3,
- Common.TextFieldName.mainField4,
- Common.TextFieldName.statusBar,
- Common.TextFieldName.mediaClock,
- Common.TextFieldName.mediaTrack,
- Common.TextFieldName.alertText1,
- Common.TextFieldName.alertText2,
- Common.TextFieldName.alertText3,
- Common.TextFieldName.scrollableMessageBody,
- Common.TextFieldName.initialInteractionText,
- Common.TextFieldName.navigationText1,
- Common.TextFieldName.navigationText2,
- Common.TextFieldName.ETA,
- Common.TextFieldName.totalDistance,
- Common.TextFieldName.navigationText,
- Common.TextFieldName.audioPassThruDisplayText1,
- Common.TextFieldName.audioPassThruDisplayText2,
- Common.TextFieldName.sliderHeader,
- Common.TextFieldName.sliderFooter,
- Common.TextFieldName.notificationText
- ],
- "mediaClockFormats": [
- Common.MediaClockFormat.CLOCK1,
- Common.MediaClockFormat.CLOCK2,
- Common.MediaClockFormat.CLOCK3,
- Common.MediaClockFormat.CLOCKTEXT1,
- Common.MediaClockFormat.CLOCKTEXT2,
- Common.MediaClockFormat.CLOCKTEXT3,
- Common.MediaClockFormat.CLOCKTEXT4
- ],
- "graphicSupported": true,
- "imageCapabilities": [ Common.ImageType.DYNAMIC ],
- "templatesAvailable": [ "" ],
- "screenParams": {
- "resolution": {
- "resolutionWidth": 800,
- "resolutionHeight": 480
- },
- "touchEventAvailable": {
- "pressAvailable": true,
- "multiTouchAvailable": true,
- "doublePressAvailable": true
- }
- },
- "numCustomPresetsAvailable": 6
- }
-
- property var softButtonCapabilities: {
- "shortPressAvailable": true,
- "longPressAvailable": true,
- "upDownAvailable": true,
- "imageSupported": true
- }
-
- property var buttonCapabilities: []
-
- readonly property string fileIVSU: "hmi/res/IVSU/PROPRIETARY_REQUEST"
-
- property string filePTSnapshot: ""
-
- property int timeoutPTExchange: 500
-
- property var retriesPTExchange: []
-
- property var urlsPTExchange: []
-
- property int currentRetry: 0
-
- property int currentUrl: 0
-
- property string appIdIVSU: ""
-
- property var urlsIVSU: []
-
- function updateStatus(result) {
- console.debug("Result update SDL:", result);
- var text = {}
- text[Common.UpdateResult.UP_TO_DATE] = "UP_TO_DATE";
- text[Common.UpdateResult.UPDATING] = "UPDATING";
- text[Common.UpdateResult.UPDATE_NEEDED] = "UPDATE_NEEDED";
- ttsPopUp.activate(text[result])
- }
-
- function startPTExchange(urls) {
- console.log("enter startPTExchange");
- urlsPTExchange = urls;
- currentRetry = 0;
- currentUrl = 0;
- tryUpdatePolicy();
- console.log("exit startPTExchange");
- }
-
- function startIVSU(urls) {
- urlsIVSU = urls;
- sendSystemRequest(Common.RequestType.PROPRIETARY, urlsIVSU[0].url,
- fileIVSU, appIdIVSU);
- }
-
- function getUrl() {
- console.log("enter getUrl");
- if (currentUrl >= 0 && currentUrl < urlsPTExchange.length) {
- var url = urlsPTExchange[currentUrl];
- currentUrl = (currentUrl + 1) / urlsPTExchange.length;
- console.log("exit getUrl");
- return url;
- } else {
- console.log("exit getUrl (empty)");
- return {url: ""}
- }
- }
-
- function getInterval() {
- if (currentRetry >= 0 && currentRetry < retriesPTExchange.length) {
- var interval = (timeoutPTExchange + retriesPTExchange[currentRetry]) * 1000;
- currentRetry++;
- return interval;
- } else {
- return 0;
- }
- }
-
- function sendSystemRequest(type, url, fileName, applicationId) {
- console.log("enter sendSystemRequest");
- var offset = 1000;
- var length = 10000;
- var appId = applicationId ? applicationId : "default";
- var file = fileName ? fileName : fileIVSU;
-
- sdlBasicCommunication.onSystemRequest(type, url, Common.FileType.JSON,
- offset, length, timeoutPTExchange,
- file, appId);
- console.log("enter sendSystemRequest");
- }
-
- function tryUpdatePolicy() {
- console.log("enter tryUpdatePolicy");
- if (urlsPTExchange.length) {
- var url = getUrl();
- sendSystemRequest(Common.RequestType.PROPRIETARY, url.url, filePTSnapshot, url.policyAppId);
- } else {
- sendSystemRequest(Common.RequestType.PROPRIETARY);
- }
-
- retriesTimer.interval = getInterval();
- if (retriesTimer.interval > 0) {
- console.log("start retry strategy");
- retriesTimer.start();
- }
- console.log("exit tryUpdatePolicy");
- }
-
- function systemRequest(type) {
- if (urlsPTExchange.length) {
- sendSystemRequest(type, urlsPTExchange[0].url, null, urlsPTExchange[0].policyAppId);
- } else {
- sendSystemRequest(type);
- }
- }
-
- function stopPTExchange(fileName) {
- console.log("enter stopPTExchange");
- retriesTimer.stop();
- sdlSDL.onReceivedPolicyUpdate(fileName);
- console.log("exit stopPTExchange");
- }
-
- Timer {
- id: retriesTimer
- interval: timeoutPTExchange; running: false; repeat: false
- onTriggered: sendSystemRequest()
- }
-
- function activateApp (appId) {
-
- console.debug("SDL.ActivateApp Request enter", appId);
-
- RequestToSDL.SDL_ActivateApp(appId, function(isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority){
- settingsContainer.activateApp_Response(appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority)
- })
-
- console.debug("SDL.ActivateApp Request exit");
- }
-
- function activateApp_Response (appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority) {
-
- console.debug("activateApp_Response enter", appId, isSDLAllowed, device, isPermissionsConsentNeeded, isAppPermissionsRevoked, appRevokedPermissions, isAppRevoked, priority);
-
- if (!isSDLAllowed) {
-
- userActionPopUp.activate("Allow SDL Functionality request",
- "Would you like to allow SDL functionality for device '" + device.name + "'?",
- function(result){
- allowSDLFunctionality(result, device)
- },
- true
- )
- }
-
- if (isPermissionsConsentNeeded) {
- RequestToSDL.SDL_GetListOfPermissions(appId, function(allowedFunctions){
- settingsContainer.getListOfPermissions_Response(appId, allowedFunctions)
- })
- }
-
- if (isAppPermissionsRevoked) {
-
- appPermissionsRevoked(appId, appRevokedPermissions, "AppPermissionsRevoked")
- }
-
- if (isAppRevoked) {
-
- RequestToSDL.SDL_GetUserFriendlyMessage(["AppUnsupported"], dataContainer.hmiUILanguage, function(messages){
- settingsContainer.getUserFriendlyMessageAppPermissionsRevoked("AppUnsupported", messages)
- });
- } else if (isSDLAllowed && !isPermissionsConsentNeeded) {
-
- dataContainer.setCurrentApplication(appId)
- contentLoader.go(
- Internal.chooseAppStartScreen(
- dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication
- ),
- appId
- )
- }
- }
-
- function allowSDLFunctionality (result, device) {
- console.log("allowSDLFunctionality enter", result, device);
-
- sdlSDL.onAllowSDLFunctionality(device, result, Common.ConsentSource.GUI)
-
- console.log("allowSDLFunctionality exit");
- }
-
- function getListOfPermissions_Response (appId, allowedFunctions) {
- console.log("getListOfPermissions_Response enter");
-
- var app = dataContainer.getApplication(appId);
- var messageCodes = [];
-
- app.allowedFunctions = allowedFunctions;
-
- allowedFunctions.forEach(function (x) {
- messageCodes.push(x.name);
- });
-
- RequestToSDL.SDL_GetUserFriendlyMessage(messageCodes, dataContainer.hmiUILanguage, function(messages){
- settingsContainer.onAppPermissionConsent_Notification(appId, messages)
- });
-
- console.log("getListOfPermissions_Response exit");
- }
-
- function appPermissionsRevoked (appId, permissions, title) {
-
- var messageCodes = [];
-
- permissions.forEach(function (x) {
- messageCodes.push(x.name);
- });
-
- messageCodes.push("AppPermissionsRevoked");
-
- RequestToSDL.SDL_GetUserFriendlyMessage(messageCodes, dataContainer.hmiUILanguage, function(messages){
- settingsContainer.getUserFriendlyMessageAppPermissionsRevoked(title, messages)
- });
- }
-
- function getUserFriendlyMessageAppPermissionsRevoked (title, messages) {
- var tts = "",
- text = "";
-
- messages.forEach(function (x) {
- if (x.tts) {
- tts += x.tts;
- }
- if (x.textBody) {
- text += x.textBody;
- }
- });
-
- if (tts) {
- ttsPopUp.activate(tts)
- }
-
- userActionPopUp.activate(title, text, null, false)
-
- }
-
- function onAppPermissionConsent_Notification (appId, messages) {
- console.log("onAppPermissionConsent_Notification enter");
-
- onAppPermissionConsentPopUp.permissionItems.clear()
-
- var tts = "";
-
- for (var i = 0; i < messages.length; i++) {
- onAppPermissionConsentPopUp.permissionItems.append({
- "messageCode": messages[i].messageCode,
- "label": messages[i].label,
- "textBody": messages[i].textBody,
- "allowed": false,
- "id": messages[i].id
- });
-
- if (messages[i].tts) {
- tts += x.tts;
- }
- }
-
- if (tts) {
- ttsPopUp.activate(tts)
- }
-
- onAppPermissionConsentPopUp.activate(appId)
-
- console.log("onAppPermissionConsent_Notification enter");
- }
-
- function decrypt(file, appId) {
- sendSystemRequest(Common.RequestType.FILE_RESUME, urlsIVSU[0].url, file,
- appId);
- }
-
- function updateIVSU(appId) {
- appIdIVSU = appId;
- var service = 4; // service type for IVSU
- RequestToSDL.SDL_GetURLS(service, startIVSU);
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml b/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml
deleted file mode 100644
index 359eb5d59c..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/SliderModel.qml
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file SliderModel.qml
- * @brief Data model 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 QtQuick 2.0
-
-QtObject {
- property string appName: ""
- property string header: ""
- property var footer: []
- property int numTicks: 0
- property int position: 0
- property int timeout: 0
- property bool running: false
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml b/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml
deleted file mode 100644
index 997ce1ee0a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/VehicleInfoModel.qml
+++ /dev/null
@@ -1,234 +0,0 @@
-/**
- * @file VehicleInfoModel.qml
- * @brief Data model for vehicle info.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-QtObject {
- id: vehicleInfo
- property real speed: 80.1
- property int rpm: 5000
- property real fuelLevel: 0.2
- property int fuelLevel_State: Common.ComponentVolumeStatus.CVS_LOW
- property real instantFuelConsumption: 2.2
- property int driverBraking: Common.VehicleDataEventStatus.VDES_NO_EVENT
- property int wiperStatus: Common.WiperStatus.OFF
- property real engineTorque: 2.5
- property real accPedalPosition: 0.5
- property real steeringWheelAngle: 1.2
- property real externalTemperature: 40.0
- property string vin: '52-452-52-752'
- property int odometer: 2
- property int prndl: Common.PRNDL.FIFTH
-
- property var headLampStatus: {
- "lowBeamsOn": false,
- "highBeamsOn": false,
- "ambientLightSensorStatus": Common.AmbientLightStatus.TWILIGHT_1
- }
- property var deviceStatus: {
- 'voiceRecOn': false,
- 'btIconOn': false,
- 'callActive': false,
- 'phoneRoaming': false,
- 'textMsgAvailable': false,
- 'battLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'stereoAudioOutputMuted': false,
- 'monoAudioOutputMuted': false,
- 'signalLevelStatus': Common.DeviceLevelStatus.ZERO_LEVEL_BARS,
- 'primaryAudioSource': Common.PrimaryAudioSource.NO_SOURCE_SELECTED,
- 'eCallEventActive': false
- }
- property var bodyInformation: {
- 'parkBrakeActive': false,
- 'ignitionStableStatus': Common.IgnitionStableStatus.IGNITION_SWITCH_NOT_STABLE,
- 'ignitionStatus': Common.IgnitionStatus.IS_UNKNOWN
- }
- property var beltStatus: {
- 'driverBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'driverBuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'passengerChildDetected': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow2BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRow3BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'leftRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'rightRearInflatableBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BeltDeployed': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- 'middleRow1BuckleBelted': Common.VehicleDataEventStatus.VDES_NO_EVENT,
- }
- property var tirePressure: {
- 'pressureTelltale': Common.WarningLightStatus.WLS_ON,
- 'leftFront': { status: Common.ComponentVolumeStatus.CVS_NORMAL},
- 'rightFront': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'leftRear': { status: Common.ComponentVolumeStatus.CVS_NORMAL },
- 'rightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerLeftRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN },
- 'innerRightRear': { status: Common.ComponentVolumeStatus.CVS_UNKNOWN }
- }
- property var gps: {
- 'longitudeDegrees': 42.3293,
- 'latitudeDegrees': -83.0464,
- 'utcYear': 2013,
- 'utcMonth': 2,
- 'utcDay': 14,
- 'utcHours': 13,
- 'utcMinutes': 16,
- 'utcSeconds': 54,
- 'compassDirection': Common.CompassDirection.SOUTHWEST,
- 'pdop': 4,
- 'hdop': 5,
- 'vdop': 6,
- 'actual': false,
- 'satellites': 8,
- 'dimension': Common.Dimension.Dimension_2D,
- 'altitude': 7,
- 'heading': 173,
- 'speed': 2
- }
- property var ecuDIDData: {
- 'data1': 'ECU 1 Test Data',
- 'data2': 'ECU 2 Test Data'
- }
- property var eCallInfo: {
- "eCallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_NORMAL,
- "auxECallNotificationStatus" : Common.VehicleDataNotificationStatus.VDNS_ACTIVE,
- "eCallConfirmationStatus" : Common.ECallConfirmationStatus.ECCS_NORMAL
- }
- property var airbagStatus: {
- "driverAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO_EVENT,
- "driverSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "driverCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED,
- "passengerCurtainAirbagDeployed" : Common.VehicleDataEventStatus.VDES_FAULT,
- "driverKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NO,
- "passengerSideAirbagDeployed" : Common.VehicleDataEventStatus.VDES_YES,
- "passengerKneeAirbagDeployed" : Common.VehicleDataEventStatus.VDES_NOT_SUPPORTED
- }
- property var emergencyEvent: {
- "emergencyEventType" : Common.EmergencyEventType.EET_NO_EVENT,
- "fuelCutoffStatus" : Common.EmergencyEventType.EET_FRONTAL,
- "rolloverEvent" : Common.EmergencyEventType.EET_SIDE,
- "maximumChangeVelocity" : Common.EmergencyEventType.EET_REAR,
- "multipleEvents" : Common.EmergencyEventType.EET_ROLLOVER
- }
- property var clusterModeStatus: {
- "powerModeActive" : true,
- "powerModeQualificationStatus" : Common.PowerModeQualificationStatus.POWER_MODE_UNDEFINED,
- "carModeStatus" : Common.CarModeStatus.CMS_NORMAL,
- "powerModeStatus" : Common.PowerModeStatus.KEY_OUT
- }
- property var myKey: {
- "e911Override": Common.VehicleDataStatus.VDS_NO_DATA_EXISTS
- }
-
-
- function sendGpsChange(){
- sdlVehicleInfo.onGps(vehicleInfo.gps)
- }
- function sendSpeedChange(){
- sdlVehicleInfo.onSpeed(vehicleInfo.speed)
- }
- function sendRpmChange(){
- sdlVehicleInfo.onRpm(vehicleInfo.rpm)
- }
- function sendFuelLevelChange(){
- sdlVehicleInfo.onFuelLevel(vehicleInfo.fuelLevel)
- }
- function sendFuelLevel_StateChange(){
- sdlVehicleInfo.onFuelLevel_State(vehicleInfo.fuelLevel_State)
- }
- function sendInstantFuelConsumptionChange(){
- sdlVehicleInfo.onInstantFuelConsumption(vehicleInfo.instantFuelConsumption)
- }
- function sendExternalTemperatureChange(){
- sdlVehicleInfo.onExternalTemperature(vehicleInfo.externalTemperature)
- }
- function sendPrndlChange() {
- if (dataContainer.vehicleInfoModel.prndl !== -1)
- {sdlVehicleInfo.onPrndl(vehicleInfo.prndl)}
- }
- function sendTirePressureChange(){
- sdlVehicleInfo.onTirePressure(vehicleInfo.tirePressure)
- }
- function sendOdometerChange(){
- sdlVehicleInfo.onOdometer(vehicleInfo.odometer)
- }
- function sendBeltStatusChange(){
- sdlVehicleInfo.onBeltStatus(vehicleInfo.beltStatus)
- }
- function sendBodyInformationChange(){
- sdlVehicleInfo.onBodyInformation(vehicleInfo.bodyInformation)
- }
- function sendDeviceStatusChange(){
- sdlVehicleInfo.onDeviceStatus(vehicleInfo.deviceStatus)
- }
- function sendDriverBrakingChange(){
- sdlVehicleInfo.onDriverBraking(vehicleInfo.driverBraking)
- }
- function sendWiperStatusChange(){
- sdlVehicleInfo.onWiperStatus(vehicleInfo.wiperStatus)
- }
- function sendHeadLampStatusChange(){
- sdlVehicleInfo.onHeadLampStatus(vehicleInfo.headLampStatus)
- }
- function sendEngineTorqueChange(){
- sdlVehicleInfo.onEngineTorque(vehicleInfo.engineTorque)
- }
- function sendAccPedalPositionChange(){
- sdlVehicleInfo.onAccPedalPosition(vehicleInfo.accPedalPosition)
- }
- function sendSteeringWheelAngleChange(){
- sdlVehicleInfo.onSteeringWheelAngle(vehicleInfo.steeringWheelAngle)
- }
- function sendECallInfoChange(){
- sdlVehicleInfo.onECallInfo(vehicleInfo.eCallInfo)
- }
- function sendAirbagStatusChange(){
- sdlVehicleInfo.onAirbagStatus(vehicleInfo.airbagStatus)
- }
- function sendEmergencyEventChange(){
- sdlVehicleInfo.onEmergencyEvent(vehicleInfo.emergencyEvent)
- }
- function sendClusterModeStatusChange(){
- sdlVehicleInfo.onClusterModeStatus(vehicleInfo.clusterModeStatus)
- }
- function sendMyKeyChange(){
- sdlVehicleInfo.onMyKey(vehicleInfo.myKey)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml b/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml
deleted file mode 100644
index 3dc6ad563d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/models/VrHelpItemsDefault.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * @file VrHelpItemsDefault.qml
- * @brief Default voice recognition help items.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-ListModel {
- id: vrHelpItemsDefault
-
- Component.onCompleted: {
- vrHelpItemsDefault.append({
- text: "Default VR Help Text1",
- image: {
- value: "",
- imageType: 1
- },
- position: 1
- });
- vrHelpItemsDefault.append({
- text: "Default VR Help Text2",
- image: {
- value: "",
- imageType: 1
- },
- position: 2
- });
- vrHelpItemsDefault.append({
- text: "Default VR Help Text3",
- image: {
- value: "",
- imageType: 1
- },
- position: 3
- });
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml b/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml
deleted file mode 100644
index 2d0c4119b1..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/AlertWindow.qml
+++ /dev/null
@@ -1,290 +0,0 @@
-/**
- * @file AlertWindow.qml
- * @brief Alert popup window
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Rectangle {
- id: alertWindow
- property date lastAlertTime
- property var softButtons
- property int appId
- property string popUpName // TODO{ALESHIN}: No requerments for closePopUp, if alert couldn't be closed by closePopUp request - delete everywhere
-
- color: "transparent"
-
- property var async
-
- Rectangle {
- id: rectangle
-
- anchors.centerIn: parent
- color: "black"
- border.color: "white"
-
- width: alertContent.width + 60
- height: alertContent.height + 60
-
- property alias alertString: alert.text
- property alias appNameString: appName.text
- property int duration
-
- Column {
- id: alertContent
- anchors.centerIn: parent
- spacing: 20
-
- Text {
- id: appName
- anchors.horizontalCenter: parent.horizontalCenter
- color: "white"
- font.pointSize: 16
- }
-
- Row {
- width: Constants.alertWidth
- spacing: 20
-
- Image {
- id: alertLogo
- source: "../res/warning.png"
- }
-
- Text {
- id: alert
- width: parent.width - alertLogo.width - parent.spacing
- clip: true
- color: "white"
- font.pointSize: 16
- }
- }
-
- Rectangle {
- id: progressIndicator
- color: "white"
- height: 10
- }
-
- Column {
- Item {
- width: Constants.alertWidth
- height: alertButton1.visible ? alertButton1.height : 0
-
- SoftButton {
- id: alertButton1
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 0 ? softButtons[0] : undefined
- anchors.left: parent.left
- anchors.right: alertButton2.visible ? alertButton2.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- SoftButton {
- id: alertButton2
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 1 ? softButtons[1] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- }
- Item {
- width: Constants.alertWidth
- height: alertButton3.visible ? childrenRect.height : 0
- SoftButton {
- id: alertButton3
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 2 ? softButtons[2] : undefined
- anchors.left: parent.left
- anchors.right: alertButton4.visible ? alertButton4.left : parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- SoftButton {
- id: alertButton4
- appId: alertWindow.appId
- button: softButtons && softButtons.length > 3 ? softButtons[3] : undefined
- anchors.right: parent.right
- width: Constants.alertWidth / 2
- onPressed: { alertWindow.keep = true; }
- onReleased: { alertWindow.keep = false; }
- onKeepContext: {
- alertWindow.restart();
- sdlUI.onResetTimeout(appId, "UI.Alert")
- }
- onDefaultAction: { alertWindow.complete(Common.Result.SUCCESS); }
- onStealFocus: {
- alertWindow.complete(Common.Result.SUCCESS);
- contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
- dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- }
- }
- }
-
- SequentialAnimation {
- id: animation
- PropertyAction { target: progressIndicator; property: "width"; value: alertContent.width }
- PropertyAnimation {
- id: shrinkProgressAnimation
- target: progressIndicator
- property: "width"
- to: 0
- duration: rectangle.duration
- }
- }
- }
-
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- function alert (alertStrings, duration, sButtons, showIndicator, alertType, applicationId) {
- if (timer.running) { // we have alert already
- var currentTime = new Date()
- var timeFromLastAlert = currentTime - lastAlertTime
- var timeLeft = timer.interval - timeFromLastAlert
- var discreteInMilliseconds = 1000 // wish to round left time to integer seconds
- var timeLeftRounded = discreteInMilliseconds * Math.ceil(timeLeft / discreteInMilliseconds)
- return timeLeftRounded
- }
- else {
- lastAlertTime = new Date();
- appId = applicationId
- rectangle.appNameString = dataContainer.getApplication(appId).appName;
- softButtons = sButtons;
- rectangle.alertString = alertStrings.join('\n');
- timer.interval = duration;
- rectangle.duration = duration;
- timer.start();
- show();
-
- progressIndicator.visible = !!showIndicator
- progressIndicator.width = alertContent.width
- console.log("ProgressIndicator.width:", progressIndicator.width)
- animation.start()
- }
- }
-
- function show () {
- dataContainer.activeAlert = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- visible = true
- }
-
- function complete (reason, data) {
- if (!keep) {
- hide()
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(async, { __retCode: Common.Result.SUCCESS, __message: "UI.Alert" })
- break
- // For other cases
- }
- }
- timer.stop()
- }
-
- function hide() {
- console.debug(popUpName, "HIDE")
- dataContainer.activeAlert = false
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- visible = false
- }
-
- function restart() {
- animation.restart();
- timer.restart();
- }
-
- property bool keep: false
-
- onKeepChanged: {
- if (visible && !keep && !timer.running) {
- hide()
- }
- }
-
- onVisibleChanged: {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml
deleted file mode 100644
index 92e9d7442b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/ContextPopup.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file ContextPopup.qml
- * @brief Popup view with system context.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-
-PopUp {
- function show() {
- console.debug("enter")
- if (!visible) { // must not increment counter if show() called for visible popup
- visible = true;
- dataContainer.popups++
- }
- console.debug("exit")
- }
-
- function hide() {
- console.debug("enter")
- console.debug(popUpName, "HIDE")
- if (visible) { // must not decrement counter if hide() called for invisible popup
- visible = false;
- dataContainer.popups--
- }
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml
deleted file mode 100644
index bf88366eae..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/ExitAllApplicationsPopup.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-PopUp {
- function complete(reason){
- hide()
- }
-
- Item {
- ListModel {
- id: reasonExit
-
- Component.onCompleted: {
- for (var name in Common.ApplicationsCloseReason) {
- append({name: name});
- }
- }
- }
- }
-
- Column
- {
- anchors.centerIn: parent
- Row {
- Text {
- text: "Select reason: "
- color: "white"
- }
-
- ComboBox {
- id: reasonComboBox
- model: reasonExit
- }
- z: 1000
- }
- OvalButton {
- text: "Exit"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- sdlBasicCommunication.onExitAllApplications(Common.ApplicationsCloseReason[reasonComboBox.currentText])
- hide()
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
deleted file mode 100644
index a6fc4d7107..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/InteractionPopup.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * @file InteractionPopup.qml
- * @brief Interaction popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../hmi_api/Async.js" as Async
-import "../models/Internal.js" as Internal
-
-ContextPopup {
- id: piPopUp
- property ListModel choiceSet: ListModel { }
- property int timeout
- property int appID
- property int interactionLayout
- property var async
- property var grammarID
- property bool performInteractionIsActiveNow
-
- Text {
- id: initialText
- anchors.top: parent.top
- anchors.topMargin: Constants.popupMargin
- anchors.left: parent.left
- anchors.leftMargin: Constants.popupMargin
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- ListView {
- anchors.top: initialText.bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- model: choiceSet
- delegate: OvalButton {
- width: parent.width
- text: menuName
- icon: image
- onClicked: {
- complete(Common.Result.SUCCESS, {"choiceID": model.choiceID})
- }
- }
- }
-
- Item {
- Timer {
- id: timer
- onTriggered: {
- complete(Common.Result.TIMED_OUT)
- }
- }
- }
-
- function performInteraction(initialTextArg, choiceSet, vrHelpTitle, vrHelp, timeout, interactionLayout, appID) {
- console.debug("enter")
- var app = dataContainer.getApplication(appID)
- var dataToUpdate = {}
-
- performInteractionIsActiveNow = true
- if (initialTextArg !== undefined){
- initialText.text = initialTextArg.fieldText
- }
- this.timeout = timeout
- this.appID = appID
-
- this.choiceSet.clear()
- if (choiceSet !== undefined) {
- choiceSet.forEach( function(arrayElement) {
- piPopUp.choiceSet.append({
- choiceID: arrayElement.choiceID,
- menuName: arrayElement.menuName ? arrayElement.menuName : "",
- image: arrayElement.image ? arrayElement.image : "",
- secondaryText: arrayElement.secondaryText ? arrayElement.secondaryText : "",
- tertiaryText: arrayElement.tertiaryText ? arrayElement.tertiaryText: "",
- secondaryImage: arrayElement.secondaryImage ? arrayElement.secondaryImage : ""
- })
- })
- }
- if (vrHelpTitle !== undefined) {
- dataToUpdate.vrHelpTitlePerformInteraction = vrHelpTitle
- }
-
- app.vrHelpItemsPerformInteraction.clear()
-
- if (vrHelp !== undefined) {
- vrHelp.forEach( Internal.appendVrHelpItem, app.vrHelpItemsPerformInteraction )
- }
- if (interactionLayout !== undefined) {
- this.interactionLayout = interactionLayout
- }
- dataContainer.setApplicationProperties(appID, dataToUpdate)
- async = new Async.AsyncCall()
- if (piPopUp.choiceSet.count !== 0) {
- activate()
- }else if (grammarID) {
- vrActivate()
- }
- console.debug("exit")
- return async
- }
-
- function activate () {
- 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")
- switch (reason) {
- case Common.Result.SUCCESS:
- DBus.sendReply(async, data)
- break
- case Common.Result.ABORTED:
- DBus.sendReply(async, { __retCode: Common.Result.ABORTED })
- break
- case Common.Result.TIMED_OUT:
- DBus.sendReply(async, { __retCode: Common.Result.TIMED_OUT })
- break
- }
- timer.stop()
- grammarID = ""
- hide()
- performInteractionIsActiveNow = false
- console.debug("exit")
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml
deleted file mode 100644
index 2c4fe8bd3d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/OnAppPermissionConsentPopUp.qml
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * @file OnAppPermissionConsent.qml
- * @brief Settings source screen view.
- * 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 QtQuick 2.0
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-PopUp {
-
- width: Constants.popupWidth - 200
- height: Constants.popupHeigth - 200
-
- property int appID
- property ListModel permissionItems: ListModel{}
-
- function activate(appId) {
- console.debug("onAppPermissionConsentPopUp activate enter");
- appID = appId
- show()
- console.debug("onAppPermissionConsentPopUp activate exit");
- }
-
- function getFunctionalID(messageCode) {
-
- console.debug(appID);
-
- var app = dataContainer.getApplication(appID);
-
- for (var i = 0; i < app.allowedFunctions.length; i++) {
- if (messageCode == app.allowedFunctions[i].name) {
-
- return app.allowedFunctions[i].id;
- }
- }
- }
-
- function deactivate() {
- console.debug("onAppPermissionConsentPopUp deactivate enter");
- hide()
-
- var consentedFunctions = [];
-
- for (var i = 0; i < permissionItems.count; i++) {
- consentedFunctions.push({
- "name": permissionItems.get(i).messageCode,
- "id": getFunctionalID(permissionItems.get(i).messageCode),
- "allowed": permissionItems.get(i).allowed
- })
-
- console.debug("consentedFunctions.push", consentedFunctions[i].name,consentedFunctions[i].id,consentedFunctions[i].allowed);
- }
-
- sdlSDL.onAppPermissionConsent(appID, consentedFunctions, Common.ConsentSource.GUI);
- console.debug("onAppPermissionConsentPopUp deactivate exit");
- }
-
- Column {
- anchors.fill: parent
-
- Component {
- id: listDelegate
-
- Item {
- height: 70
- width: parent.width
-
- CheckBox {
- id: checkBox
- height: 20
-
- style: CheckBoxStyle {
- label: Text {
- color: Constants.panelTextColor
- text: permissionItems.get(index).label
- }
- }
- onClicked: {
- permissionItems.setProperty(index, "allowed", !allowed)
- }
- }
-
- Text {
- id: label
- color: Constants.primaryColor
- font.pixelSize: 0
- text: textBody
- wrapMode: TextEdit.Wrap
- width: parent.width
- anchors.top: checkBox.bottom
- }
- }
- }
-
- ScrollableListView {
- id: onAppPermissonList
- anchors.fill: parent;
- anchors.margins: 5
- anchors.bottomMargin: 100
- model: permissionItems
- delegate: listDelegate
- }
-
- Item {
- id: bottomPanel
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 100
- width: parent.width
-
- OvalButton {
- anchors.centerIn: parent
- text: "Done"
- onClicked: {
- deactivate()
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml
deleted file mode 100644
index 2cb0212a34..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/PerformAudioPassThruPopup.qml
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * @file PerformAudioPassThruPopup.qml
- * @brief Popup for audio pass thru
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property var async
-
- function showAudioPassThru(){
- console.debug("entered")
- dataContainer.uiAudioPassThru.running = true
- show()
- if (dataContainer.uiAudioPassThru.timeout) {
- timer.start()
- }
- console.debug("exited")
- }
-
- function complete(reason){
- console.debug("enter", reason)
- timer.stop()
- dataContainer.uiAudioPassThru.timeout = 0
- dataContainer.uiAudioPassThru.running = false
- switch (reason) {
- case Common.Result.ABORTED:
- console.debug("exit with abort")
- DBus.sendError(async, Common.Result.ABORTED)
- break;
- case Common.Result.SUCCESS:
- console.debug("exit with success")
- DBus.sendReply(async, {})
- break;
- case Common.Result.RETRY:
- console.debug("exit with retry")
- DBus.sendError(async, Common.Result.RETRY)
- break;
- }
- hide()
- }
-
-
- Column {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiAudioPassThru.timeout
- onTriggered: {
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Row {
- spacing: Constants.generalSpacing
- Image {
- source: "../res/controlButtons/vrImage.png"
- }
-
- Column {
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.firstLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiAudioPassThru.secondLine
- color: Constants.audioPassThruTextColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- spacing: Constants.generalSpacing
-
- OvalButton {
- text: "Retry"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.RETRY)
- }
- }
-
- OvalButton {
- text: "Done"
- fontSize: Constants.fontSize
- onClicked: {
- complete(Common.Result.SUCCESS)
- }
- }
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml
deleted file mode 100644
index 544852638d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/PopUp.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file PopUp.qml
- * @brief General popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-Item {
- default property alias content: content.children
- property int padding: Constants.popUpPadding
- property string popUpName
-
- visible: false
-
- width: Constants.popupWidth
- height: Constants.popupHeigth
-
- MouseArea { anchors.fill: parent }
-
- Rectangle {
- width: parent.width - padding / 2
- height: parent.height - padding / 2
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.secondaryColor
- border.width: 1
- border.color: Constants.popUpBorderColor
- radius: padding
- Rectangle {
- id: content
- width: parent.width - padding
- height: parent.height - padding
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.transparentColor
- }
- }
-
- onVisibleChanged: {
- if (popUpName) {
- if (visible) {
- dataContainer.activePopup.push(popUpName)
- } else {
- for (var i in dataContainer.activePopup) {
- if (dataContainer.activePopup[i] === popUpName) {
- dataContainer.activePopup.splice(i, 1)
- }
- }
- }
- }
- }
-
- function show() {
- console.debug("enter");
- visible = true;
- console.debug("exit");
- }
-
- function hide() {
- console.debug("enter");
- visible = false;
- console.debug("exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml
deleted file mode 100644
index 38f866797d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/SliderPopup.qml
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * @file ExitAllApplicationsPopup.qml
- * @brief Popup "Exit all applications"
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-
-ContextPopup {
- property var async
- property int position: 1
- /**
- * Test Support Section
- */
- property int resultCode: -1
- signal onReady
- /**
- * Test Support Section End
- */
-
- function showSlider(){
- console.debug("enter")
-
- dataContainer.uiSlider.running = true
- dataContainer.applicationSavedContext = dataContainer.applicationContext
- if(dataContainer.uiSlider.footer === undefined ||
- dataContainer.uiSlider.footer.length === 0 ||
- dataContainer.uiSlider.position === 0 ) {
- footerText.text = ""
- } else {
- footerText.text = dataContainer.uiSlider.footer.length === 1 ? dataContainer.uiSlider.footer[0] : dataContainer.uiSlider.footer[dataContainer.uiSlider.position - 1]
- }
- position = dataContainer.uiSlider.position
- show()
- timer.start()
- onReady()
- console.debug("exit")
- }
-
- function complete(reason){
- console.debug("enter reason = ", reason)
- timer.stop()
- dataContainer.applicationContext = dataContainer.applicationSavedContext
- dataContainer.uiSlider.running = false
- switch(reason) {
- case Common.Result.ABORTED:
- console.debug("aborted position is", position)
- resultCode = Common.Result.ABORTED
- DBus.sendReply(async, {__retCode: resultCode, sliderPosition: position})
- break
- case Common.Result.SUCCESS:
- console.debug("send position", position)
- resultCode = Common.Result.SUCCESS
- dataContainer.uiSlider.position = position
- DBus.sendReply(async, {sliderPosition:position})
- break
- default:
- break
- }
- hide()
- position = 1
- console.debug("exit")
- }
-
-
- Column
- {
- spacing: Constants.generalSpacing
- anchors.centerIn: parent
- Timer {
- id: timer
- interval: dataContainer.uiSlider.timeout
- onTriggered: {
- console.debug("triggered")
- complete(Common.Result.SUCCESS)
- }
- }
-
- Text {
- id: appNameText
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.appName
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Text {
- id: headerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: dataContainer.uiSlider.header
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- Rectangle {
- id: borderRectangle
- width: Constants.sliderBarWidth
- height: Constants.sliderBarHeight
- anchors.horizontalCenter: parent.horizontalCenter
- border.color: Constants.sliderBarBorderColor
- border.width: Constants.sliderBarBorderWidth
- radius: Constants.sliderBarRadius
- color: "black"
-
- Rectangle {
- id: rectangle
- color: Constants.sliderBarFillColor
- height: parent.height
- border.color: parent.border.color
- border.width: parent.border.width
- radius: parent.radius
-
- onVisibleChanged: {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- rectangle.width = dataContainer.uiSlider.position * tickWidth
- }
- }
-
- MouseArea{
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- onPositionChanged(mouse)
- }
-
- onPositionChanged: {
- if(mouseX <= 0){
- rectangle.width = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = 1
- }
-
- if(mouseX > borderRectangle.width) {
- rectangle.width = borderRectangle.width
- position = dataContainer.uiSlider.numTicks
- }
-
- if(mouseX > 0 && mouseX < borderRectangle.width) {
- var tickWidth = borderRectangle.width / dataContainer.uiSlider.numTicks
- position = Math.ceil(mouseX / tickWidth)
- rectangle.width = position * tickWidth
- }
-
- if(dataContainer.uiSlider.footer.length > 1){
- footerText.text = dataContainer.uiSlider.footer[position - 1]
- }
- }
- }
- }
-
- Text {
- id:footerText
- width: borderRectangle.width
- elide: Text.ElideRight
- anchors.horizontalCenter: parent.horizontalCenter
- text: ""
- color: Constants.sliderTextColor
- font.pixelSize: Constants.fontSize * 2
- }
-
- OvalButton {
- text: "Close"
- anchors.horizontalCenter: parent.horizontalCenter
- onClicked: {
- console.debug("enter")
- complete(Common.Result.ABORTED)
- console.debug("exit")
- }
- }
- }
-
- function getTimer() {
- return timer
- }
- function getBackButton() {
- return backButton
- }
- function getFooterText() {
- return footerText
- }
- function getBorderRectangle() {
- return borderRectangle
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml
deleted file mode 100644
index 5cd49bdd51..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/TBTClientStatePopUp.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * @file TBTClientStatePopUp.qml
- * @brief Popup view for TBT interface (list of states).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-PopUp {
- Item {
- ListModel {
- id: tbtState
-
- Component.onCompleted: {
- for (var name in Common.TBTState) {
- append({name: name});
- }
- }
- }
- }
- Text {
- text: "TBT Client State"
- verticalAlignment: Text.AlignVCenter
- anchors.right: parent.right
- anchors.left: parent.left
- anchors.top: parent.top
- color: Constants.primaryColor
- }
- ComboBox {
- id: comboBox
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- model: tbtState
- onCurrentTextChanged: {
- console.log("Send signal onTBTClientState:", currentText);
- sdlNavigation.onTBTClientState(Common.TBTState[currentText]);
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
deleted file mode 100644
index d16015ec56..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/TTSPopUp.qml
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- * @file TTSPopUp.qml
- * @brief Popup view for TTS
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtQuick.Controls 1.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-PopUp {
- height: Constants.ttsPopUpHeight
- width: Constants.ttsPopUpWidth
- padding: Constants.ttsPopUpPadding
- property var async
- property string helpPromptstr
-
- ScrollView {
- anchors.fill: parent
- Text {
- id: text
- anchors.fill: parent
- color: Constants.popUpBorderColor
- font.pixelSize: Constants.ttsFontSize
- text:""
- }
- }
-
- resources: [
- Timer {
- id: timer
- interval: Constants.ttsSpeakTime
- onTriggered: deactivate()
- },
-
- Timer {
- id: ttsPerformInteractionTimer
- interval: Constants.ttsSpeakTime
- 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;
- ttsPerformInteractionTimer.interval = timeout - Constants.ttsSpeakTime;
- ttsPerformInteractionTimer.restart()
- }
- }
-
- function activate(message) {
- console.debug("Activate TTS popup:", message);
- dataContainer.activeTTS = true;
- sdlTTS.started();
- console.debug("TTS started");
- text.text = message;
- show();
- timer.restart();
- console.debug("Exit");
- }
-
- function deactivate() {
- console.debug("Deactivate TTS popup");
- dataContainer.activeTTS = false;
- sdlTTS.stopped();
- console.debug("TTS stopped");
- text.text = '';
- timer.stop();
- hide();
- DBus.sendReply(async, {});
- async = null;
- console.debug("Exit");
- }
-}
-
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml
deleted file mode 100644
index d49c212297..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/UserActionPopUp.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * @file PopUp.qml
- * @brief General popup view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../controls"
-
-Item {
- default property alias content: content.children
- property var callbackFunc: null
- property int padding: Constants.popUpPadding
- property string popUpName
-
- visible: false
-
- width: Constants.popupWidth
- height: Constants.popupHeigth
-
- MouseArea { anchors.fill: parent }
-
- Rectangle {
- width: parent.width / 2
- height: parent.height / 2
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.secondaryColor
- border.width: 1
- border.color: Constants.popUpBorderColor
- radius: padding
- Rectangle {
- id: content
- width: parent.width - padding
- height: parent.height - padding
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: parent.horizontalCenter
- color: Constants.transparentColor
- }
-
- Text {
- id: title
- text: "adsadad"
- anchors.top: parent.top
- anchors.topMargin: 5
- anchors.horizontalCenter: parent.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- width: parent.width - padding
- height: 20
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- wrapMode: TextEdit.Wrap
- }
-
- Text {
- id: message
- text: "adsadad"
- anchors.top: parent.top
- anchors.topMargin: 30
- anchors.horizontalCenter: parent.horizontalCenter
- horizontalAlignment: Text.AlignHCenter
- width: parent.width - padding
- height: 100
- font.pixelSize: 0
- color: Constants.primaryColor
- wrapMode: TextEdit.Wrap
- }
-
- OvalButton {
- id: okButton
- text: "Ok"
- fontSize: Constants.fontSize
- property bool result: true
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.leftMargin: 15
- width: parent.width / 2 - 20
- onClicked: {
- deactivate(result)
- }
- visible: false
- }
-
- OvalButton {
- id: cancelButton
- text: "Cancel"
- fontSize: Constants.fontSize
- property bool result: false
- anchors.bottom: parent.bottom
- anchors.right: parent.right
- anchors.rightMargin: 15
- width: parent.width / 2 - 20
- onClicked: {
- deactivate(result)
- }
- visible: false
- }
-
- OvalButton {
- id: closeButton
- text: "Close"
- fontSize: Constants.fontSize
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.leftMargin: 15
- width: parent.width - 20
- onClicked: {
- deactivate()
- }
- visible: false
- }
-
- }
-
- function activate(titleText, textBoxText, callback, buttons) {
- console.log("userActionPopUp activate enter");
- title.text = titleText;
- message.text = textBoxText;
-
- if (buttons) {
- callbackFunc = callback;
- okButton.visible = true
- cancelButton.visible = true
- } else {
- closeButton.visible = true
- }
-
- visible = true;
- console.debug("userActionPopUp activate exit");
- }
-
- function deactivate(result) {
- console.log("userActionPopUp deactivate enter");
- visible = false;
- title.text = "";
- message.text = "";
- if (callbackFunc) {
- callbackFunc(result);
- callbackFunc = null;
- }
- okButton.visible = false
- cancelButton.visible = false
- closeButton.visible = false
- console.debug("userActionPopUp deactivate exit");
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml b/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml
deleted file mode 100644
index c699f0f51d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/VRHelpPopup.qml
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * @file VRHelpPopup.qml
- * @brief Popup view for VR help
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-PopUp {
- property alias title: title.text
- Text {
- id: title
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
- text: {
- // not in application
- if (!dataContainer.applicationContext) {
- return dataContainer.currentApplication.vrHelpTitleDefault
- // in application
- } else {
- if (interactionPopup.performInteractionIsActiveNow) {
- return dataContainer.currentApplication.vrHelpTitlePerformInteraction
- } else if (dataContainer.currentApplication.vrHelpTitle) {
- return dataContainer.currentApplication.vrHelpTitle
- } else {
- return dataContainer.currentApplication.vrHelpTitleDefault
- }
- }
- }
- font.pixelSize: Constants.titleFontSize
- color: Constants.primaryColor
- }
-
- ScrollableListView {
- anchors.top: title.bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.popupMargin
-
- model: {
- // not in application
- if (!dataContainer.applicationContext) {
- return dataContainer.currentApplication.vrHelpItemsDefault
- // in application
- } else {
- if (interactionPopup.performInteractionIsActiveNow) {
- return dataContainer.currentApplication.vrHelpItemsPerformInteraction
- } else if (dataContainer.currentApplication.vrHelpItems.count > 0) {
- return dataContainer.currentApplication.vrHelpItems
- } else {
- return dataContainer.currentApplication.vrHelpItemsDefault
- }
- }
- }
-
- delegate:
- Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.image
- anchors.verticalCenter: parent.verticalCenter
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
- }
-
- Text {
- id: text
- anchors.verticalCenter: parent.verticalCenter
- text: model.text
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
- function complete(reason, data) {
- hide()
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
deleted file mode 100644
index ed33e5ca8d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/VRPopUp.qml
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * @file VRPopUp.qml
- * @brief Popup view for VR interface (list commands).
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../controls"
-
-PopUp {
- Text {
- id: title
- anchors.left: parent.left
- anchors.top: parent.top
- height: voice.height
- width: parent.width - voice.width
- text: "Speak the command"
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Image {
- id: voice
- anchors.top: parent.top
- 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: helpButton.bottom
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- anchors.left: parent.left
-
- 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();
- vrHelpPopup.hide()
- }
- }
- }
- }
-
- function activate() {
- dataContainer.activeVR = true;
- sdlVR.started();
- show();
- }
-
- function complete(reason) {
- dataContainer.activeVR = false;
- 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/popups/VehicleInfoPopUp.qml b/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml
deleted file mode 100644
index a97f346719..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/popups/VehicleInfoPopUp.qml
+++ /dev/null
@@ -1,112 +0,0 @@
-/**
- * @file VIPopUp.qml
- * @brief Pop up window with information about vehicle.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-import "../controls"
-import QtQuick.Controls 1.0
-
-PopUp {
- //TODO{ALeshin}: Redraw this window as ListView or Column, when we'll get requirements
- Column {
- anchors.fill: parent
- Text {
- id: viText
- width: parent.width
- height: 1/5 * parent.height
- text: "Vehicle Information"
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- }
-
- Row {
- height: 1/5 * parent.height
- width: parent.width
-
- Text {
- width: 1/4 * parent.width
- height: 1/5 * parent.height
- anchors.verticalCenter: parent.verticalCenter
- text: "PRNDL: "
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- ComboBox {
- anchors.verticalCenter: parent.verticalCenter
- id: comboBox
- model: prndlList
-
- onCurrentIndexChanged: {
- console.debug("PRNDL:", currentIndex)
- dataContainer.vehicleInfoModel.prndl = model.get(currentIndex).id
- }
-
- textRole: "name"
- ListModel {
- id: prndlList
- Component.onCompleted: {
- append({ id: -1, name: "<NO DATA (prndl)>" })
- for (var name in Common.PRNDL) {
- append({ id: Common.PRNDL[name], name: name });
- }
- }
- }
- }
- z: 1000
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 1: " + dataContainer.vehicleInfoModel.ecuDIDData.data1
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- height: 1/5 * parent.height
- text: "ECU 2: " + dataContainer.vehicleInfoModel.ecuDIDData.data2
- font.pixelSize: Constants.fontSize
- verticalAlignment: Text.AlignVCenter
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject b/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject
deleted file mode 100644
index ea820e8019..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/qml_model.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-/* File generated by Qt Creator, version 2.7.0 */
-
-import QmlProject 1.1
-
-Project {
- mainFile: "MainWindow.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "../res"
- }
- /* List of plugin directories passed to QML runtime */
- importPaths: [ "." ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml
deleted file mode 100644
index ad0c9d1907..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file AMPlayerView.qml
- * @brief AM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: amRadioPlayer
- anchors.fill: parent
- radioType: "AM"
- radioName: "AM Radio"
-
- playerState: dataContainer.amPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml
deleted file mode 100644
index 38c5ab067e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * @file ApplicationListView.qml
- * @brief Application list view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- Column {
- anchors.fill: parent
- Item {
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- OvalButton {
- text: "Find New Apps"
- }
-
- OvalButton {
- text: "Change device"
- onReleased: contentLoader.go("./views/ChangeDeviceView.qml")
- }
-
- OvalButton {
- text: "911 Assist"
- }
-
- OvalButton {
- text: "Vehicle Health Report"
- }
-
- OvalButton {
- text: "Install applications/Up"
- }
- }
- }
-
- Item {
- height: parent.height / 2
- width: parent.width
-
- ScrollableListView {
- id: applicationListView
- anchors.fill: parent
- model: dataContainer.applicationList
-
- delegate: Item {
- width: parent.width
- height: Math.max(applicationName.height, appIcon.height)
- Image {
- id: appIcon
- source: icon
- height: Constants.appListIconSize
- width: height
- }
- ClickableText {
- id: applicationName
- text: appName
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.appListFontSize
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: appIcon.right
- anchors.leftMargin: Constants.margin
- onClicked: {
- settingsContainer.activateApp(appId)
-// dataContainer.setCurrentApplication(appId)
-// contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType,
-// dataContainer.currentApplication.isMediaApplication), appId )
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml
deleted file mode 100644
index a1d8c43a39..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * @file BTPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: btPlayer
- playerName: "BT Audio"
- anchors.fill: parent
-
- playerState: dataContainer.btPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: btPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml
deleted file mode 100644
index 8cf1c3f728..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * @file CDPlayerView.qml
- * @brief CD player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: cdPlayer
- playerName: "CD"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.cdPlayerState
-
- buttons: [
- OvalButton {
- text: cdPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml
deleted file mode 100644
index e61bac1d08..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file CarMenuGridView.qml
- * @brief Car menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: CarMenuModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml b/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml
deleted file mode 100644
index 84a751efec..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * @file ChangeDeviceView.qml
- * @brief Screen view with list of available devices.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Text {
- id: searchDeviceText
- anchors.left: parent.left
- anchors.top: parent.top
- height: 1/4 * parent.height
- width: parent.width
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- text: "Devices available:"
- verticalAlignment: Text.AlignVCenter
- }
-
- ListView {
- id: changeDeviceListView
- anchors.left: parent.left
- anchors.top: searchDeviceText.bottom
- model: dataContainer.deviceList
- width:parent.width
- height:parent.height - searchDeviceText.height
-
- delegate: Text {
- MouseArea {
- anchors.fill: parent
- onClicked: {
- sdlBasicCommunication.onDeviceChosen({ name: name, id: devid });
- sdlBasicCommunication.onFindApplications({ name: name, id: devid })
- contentLoader.go("./views/ApplicationListView.qml")
- }
- }
- text: name
- color: Constants.primaryColor
- font.pixelSize: Constants.titleFontSize
- }
- }
- }
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-
- Component.onCompleted: {
- console.log("ChangeDeviceView Component.onCompleted enter");
- sdlBasicCommunication.onStartDeviceDiscovery();
- console.log("ChangeDeviceView Component.onCompleted exit");
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml b/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml
deleted file mode 100644
index 41b0c32efa..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file ClimateControlView.qml
- * @brief Screen view of climat menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-
-GeneralView {
- Item {
- id: climatMenu
- anchors.fill: parent
-
- Item {
- height: parent.height
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Column {
- id: leftItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- Row {
- ClimateControlBtn {name: "heated_seat"}
- ClimateControlBtn {name: "heated_wheel"}
- }
- Row {
- ClimateControlBtn {name: "AC"}
- ClimateControlBtn {name: "headed_dash"}
- }
- }
-
- Column {
- id: centralItem
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
-
- ClimateControlBtn {id: useThisToGetButtonSize; name: "defrost"; state: "on"}
- ClimateControlBtn {name: "face"; state: "on"}
- ClimateControlBtn {name: "feet"}
- }
-
- Row {
- id: rightItem
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- anchors.rightMargin: 1/4*parent.width - useThisToGetButtonSize.width
-
- ClimateControlBtn {
- anchors.verticalCenter: parent.verticalCenter
- txt: "Dual"
- state: "on"
- }
-
- Column {
- ClimateControlBtn { name: "heated_seat" }
- ClimateControlBtn { name: "AC" }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml
deleted file mode 100644
index 90f817036d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/**
- * @file ContactsListView.qml
- * @brief Contact list screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- function setCurrent(firstLetter){
- for(var i = 0; i < contactsListView.count; i ++) {
- if (contactsListView.model.get(i).name[0].toUpperCase() === firstLetter) {
- contactsListView.positionViewAtIndex(i, ListView.Beginning)
- break;
- }
- }
- }
- Component.onCompleted: setCurrent(dataContainer.contactsFirstLetter)
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- ScrollableListView {
- id: contactsListView
- anchors.fill: parent
- clip: true
- spacing: 1/2 * Constants.fontSize
- model: ContactsListModel { }
-
- section.property: "name"
- section.criteria: ViewSection.FirstCharacter
- section.delegate: Text {
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: section.toUpperCase()
- }
-
- delegate: Item {
- anchors.left: parent.left
- width: parent.width - Constants.scrollBarWidth
- height: typeText.height
-
- Text {
- id: contactName
- anchors.left: parent.left
- text: name
- width: Constants.contactListNameFieldSize * parent.width
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- elide: Text.ElideRight
- }
- Text {
- id: phoneText
- anchors.left: contactName.right
- width: Constants.contactListPhoneFieldSize * parent.width
- text: phone
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- Text {
- id: typeText
- anchors.right: parent.right
- width: Constants.contactListDescriptionFieldSize * parent.width
- text: type
- color: Constants.contactTextColor
- font.pixelSize: Constants.fontSize
- horizontalAlignment: Text.AlignHCenter
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml b/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml
deleted file mode 100644
index 5a0b5b7754..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "Choose devices to be Unpaired:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: dataContainer.deviceList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: {
- sdlSDL.onDeviceStateChanged(Common.DeviceState.UNPAIRED,
- "", {id: devid, name: name});
- }
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml
deleted file mode 100644
index ae117ccd05..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * @file FMPlayerView.qml
- * @brief FM player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- RadioPlayer {
- id: fmRadioPlayer
- anchors.fill: parent
- radioType: "FM"
- radioName: "FM Radio"
-
- playerState: dataContainer.fmPlayerState
-
- property int hdButtonValue: 1
-
- buttonHD: [
- Image {
- id: hdButton
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- source: "../res/buttons/long_oval_btn.png"
- property string textColor: Constants.primaryColor
-
- Row {
- anchors.centerIn: parent
- spacing: (hdButton.width - hdLogo.width - one.width - two.width - three.width - four.width) / 10
-
- Image {
- id: hdLogo
- anchors.verticalCenter: parent.verticalCenter
- source:"../res/hd_logo_on.png"
- }
-
- Text {
- id: one
- anchors.verticalCenter: parent.verticalCenter
- text: "1"
- color: fmRadioPlayer.hdButtonValue === 1 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: two
- anchors.verticalCenter: parent.verticalCenter
- text: "2"
- color: fmRadioPlayer.hdButtonValue === 2 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: three
- anchors.verticalCenter: parent.verticalCenter
- text: "3"
- color: fmRadioPlayer.hdButtonValue === 3 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- id: four
- anchors.verticalCenter: parent.verticalCenter
- text: "4"
- color: fmRadioPlayer.hdButtonValue === 4 ? "white" : hdButton.textColor
- font.pixelSize: Constants.fontSize
- }
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- hdLogo.source = "../res/hd_logo_off.png"
- hdButton.source = "../res/buttons/long_oval_pressed_btn.png"
- hdButton.textColor = Constants.secondaryColor
-
- }
- onReleased: {
- hdLogo.source = "../res/hd_logo_on.png"
- hdButton.source = "../res/buttons/long_oval_btn.png"
- hdButton.textColor = Constants.primaryColor
- fmRadioPlayer.hdButtonValue === 4 ? fmRadioPlayer.hdButtonValue = 1 : fmRadioPlayer.hdButtonValue++
- }
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml b/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml
deleted file mode 100644
index ca6eb12e8f..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @file GeneralView.qml
- * @brief Base view class. Defines properties and behavior common for all views
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-
-Item {
- /// HMI context view is related to
- property int systemContext: Common.SystemContext.SYSCTXT_MAIN
- /// True if view is in application context
- property bool applicationContext: false
- /// View category for AppDeactivated notification (reason)
- property int category: Common.DeactivateReason.GENERAL
-
- signal enterScreen
- signal leaveScreen
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml b/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml
deleted file mode 100644
index f935b030c4..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file GridMenu.qml
- * @brief Parent class for main menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- id: main
- property alias model: repeater.model
- property alias delegate: repeater.delegate
- property alias rows: grid.rows
- property int columnsOnPage: Constants.menuColumnCount
-
- Flickable {
- id: flicker
- anchors.fill: parent
- contentWidth: grid.width
- flickableDirection: Flickable.HorizontalFlick
-
- Grid {
- id: grid
- anchors.centerIn: parent
- rows: Constants.menuRowCount
- columns: Math.ceil(model.count / rows)
- flow: Grid.TopToBottom
- Repeater {
- id: repeater
- }
- }
-
- property int snapTo: width / parent.columnsOnPage
- onMovementEnded: {
- var rest = flicker.contentX % snapTo
- var time = 0.25
- if (rest > flicker.snapTo / 2) { rest = rest - flicker.snapTo }
- var vel = 2 * rest / time
- flickDeceleration = Math.abs(vel) / time
- flick(vel, 0)
- flickDeceleration = 1500
- }
- }
-
- Pager {
- id: pager
- space: 10
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.top
- anchors.topMargin: Constants.margin
-
- pages: Math.ceil(grid.columns / parent.columnsOnPage)
- activePage: Internal.activePageChoose(flicker, pager.pages)
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml b/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml
deleted file mode 100644
index 1a162f2caa..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml
+++ /dev/null
@@ -1,175 +0,0 @@
-/**
- * @file HardwareButtonsView.qml
- * @brief Area of screen responsible for hardware buttons
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-Rectangle {
- height: row.height + row.anchors.margins
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.panelColor
-
- signal buttonDown(string name)
- signal buttonUp(string name)
-
- function pressButton(name) {
- buttonDown(name)
- }
-
- function longPressButton(name) {
- console.log("long press " + name)
- }
-
- function releaseButton(name) {
- buttonUp(name)
- }
-
- Row {
- id: row
- spacing: Constants.panelPadding
- anchors.centerIn: parent
- anchors.margins: Constants.panelPadding
-
- PowerSwitchButton {anchors.verticalCenter: parent.verticalCenter}
-
- MaskedButton {
- name: "vr"
- anchors.verticalCenter: parent.verticalCenter
- onReleased: {
- console.debug("Clicked VR button");
- if (!dataContainer.activeVR) {
- vrPopUp.activate();
- vrHelpPopup.show();
- } else {
- vrPopUp.complete();
- vrHelpPopup.hide()
- }
- }
- }
-
- ArrowKeys {anchors.verticalCenter: parent.verticalCenter}
-
- Grid {
- columns: 5
- rows: 2
- spacing: 5
- anchors.verticalCenter: parent.verticalCenter
- Repeater {
- model: 10
- delegate : Rectangle {
- width: 40
- height: 40
- radius: 5
- gradient: Gradient {
- GradientStop
- {
- position: 0.0;
- color: "#2c2c2c"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
-
- GradientStop
- {
- position: 1.0;
- color: "black"
- Behavior on position {
- NumberAnimation { duration: 80 }
- }
- }
- }
-
- Text {
- text: (1 + index) % 10
- font.pixelSize: 30
- color: Constants.panelTextColor
- anchors.centerIn: parent
- }
-
- Timer {
- id: timer
- interval: Constants.presetButtonTimer
- repeat: false
- triggeredOnStart: false
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- property bool clickProcessed
- onPressed: {
- parent.gradient.stops[0].position = 1.0
- parent.gradient.stops[1].position = 0.0
- clickProcessed = false
- timer.start()
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
- onReleased: {
- parent.gradient.stops[0].position = 0.0
- parent.gradient.stops[1].position = 1.0
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONUP, undefined)
- timer.stop()
- if (!clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.SHORT, undefined)
- }
- }
- Connections {
- target: timer
- onTriggered: {
- if(!mouseArea.clickProcessed) {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.LONG, undefined)
- mouseArea.clickProcessed = true
- }
- }
- }
- }
-
- Component.onCompleted: {
- settingsContainer.buttonCapabilities.push(
- {
- name: Common.ButtonName.PRESET_0 + index,
- upDownAvailable: true,
- shortPressAvailable: true,
- longPressAvailable: true
- });
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml
deleted file mode 100644
index 65a667702b..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file IPodPlayerView.qml
- * @brief IPod player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: ipodPlayer
- playerName: "iPod"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.ipodPlayerState
-
- buttons: [
- OvalButton {
- text: ipodPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml
deleted file mode 100644
index 70f3e04772..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file LineInPlayerView.qml
- * @brief LineIn player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: lineInPlayer
- playerName: "LineIn"
- anchors.fill: parent
- image: playerState.albumImage
- playerState: dataContainer.linePlayerState
-
- buttons: [
- OvalButton {
- text: lineInPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml
deleted file mode 100644
index 7ed435b137..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @file MainMenuView.qml
- * @brief Main menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: MainMenuListModel { }
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml
deleted file mode 100644
index 5178d979cf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * @file MediaClockView.qml
- * @brief Media clock view
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- property alias time: timeText.text
- Text {
- id: timeText
- anchors.left: parent.left
- width: 1/10 * parent.width
- anchors.verticalCenter: parent.verticalCenter
- horizontalAlignment: Text.AlignRight
- color: "white"
- text: (mediaPlayerView.playerType === "SDL") ? Internal.hmsTimeToString(dataContainer.currentApplication.mediaClock.startTime)
- : "02:36" //TODO {Aleshin}: get track time for all players except SDL
- font.pixelSize: 18
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.verticalCenter: parent.verticalCenter
- height: parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: dataContainer.currentApplication.mediaClock.progress * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: 2
- width: (1 - dataContainer.currentApplication.mediaClock.progress) * parent.width
- color: Constants.primaryColor
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml
deleted file mode 100644
index ed4eda014e..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml
+++ /dev/null
@@ -1,302 +0,0 @@
-/**
- * @file MediaPlayerView.qml
- * @brief Parent for BT, IPod, CD players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-Item {
- id: mediaPlayerView
-
- property string playerName: ""
- property string playerType: ""
-
- signal rewind
- signal forward
- signal play
- signal pause
-
- // Holds players state(song name, play/pause state, track number etc). For all players except SDL.
- property PlayerState playerState;
-
- property alias buttons: buttonsRow.content
- property alias buttonsSpacing: buttonsRow.spacing
- property alias image: image.source
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- width: parent.width
- height: 1/5 * parent.height
- anchors.left: parent.left
- anchors.top: parent.top
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (mediaPlayerView.playerType === "SDL") ? ((width - 4 * elementWidth) / 3)
- : (width - 2 * elementWidth)
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
- }
- }
-
- Item {
- id: spacingBetweenItems
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 2/5 * parent.height
- anchors.left: parent.left
- anchors.top: spacingBetweenItems.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - titleText.height - 3 * text.height) / 3
-
- Text {
- id: titleText
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField1
- : playerState.trackName
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- }
-
- Text {
- id: text
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField2
- : playerState.albumName
- font.pixelSize: Constants.fontSize
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- horizontalAlignment: Text.AlignHCenter
- color: Constants.primaryColor
- text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mediaTrack
- : playerState.trackNumber
- font.pixelSize: Constants.fontSize
- }
- }
- }
-
- MediaClockView {
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- id: spacingBetweenItems2
- width: parent.width
- height: 1/10 * parent.height
- anchors.left: parent.left
- anchors.top: mediaContent.bottom
-
- Behavior on height {
- NumberAnimation {
- duration : Constants.animationDuration
- }
- }
- }
-
- Row {
- // Rewind, play, pause, forward buttons
- id: playPauseRewindForward
- width: parent.width
- height: 1/5 * parent.height - statusBar.height
- anchors.left: parent.left
- anchors.leftMargin: (width - playPauseButton.width - prevButton.width - nextButton.width) / 2
- anchors.top: spacingBetweenItems2.bottom
-
- Image {
- id: prevButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_prev_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- prevButton.source = "../res/buttons/player_prev_pressed_btn.png"
- }
- onReleased: {
- prevButton.source = "../res/buttons/player_prev_btn.png"
- }
- }
- }
-
- PlayPauseButton {
- id: playPauseButton
- anchors.verticalCenter: parent.verticalCenter
- state: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.playPauseState : playerState.playPauseState
- onClicked: {
- (state == 'Play') ? play() : pause();
- var newState = state === "Play" ? "Pause" : "Play";
- (mediaPlayerView.playerType === "SDL") ? dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, { playPauseState: newState } )
- : playerState.playPauseState = newState
- }
- }
-
- Image {
- id: nextButton
- anchors.verticalCenter: parent.verticalCenter
- source: "../res/buttons/player_next_btn.png"
- MouseArea {
- anchors.fill: parent
- onPressed: {
- nextButton.source = "../res/buttons/player_next_pressed_btn.png"
- }
- onReleased: {
- nextButton.source = "../res/buttons/player_next_btn.png"
- }
- }
- }
- }
-
- Item {
- id: presetButtons
- width: parent.width
- height: 1/5 * parent.height
- anchors.top: playPauseRewindForward.bottom
- anchors.left: parent.left
-
- PresetRow {
- id: presetsRow
- anchors.top: parent.top
- anchors.left: parent.left
- presets: mediaPlayerView.playerType === "SDL" ? Internal.getArrayForPresetRow(dataContainer.currentApplication) : []
- width: parent.width
-
- onPresetButtonPressed: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- }
-
- onPresetButtonClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
-
- onPresetButtonHold: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
- }
- }
- }
-
- StatusBar {
- id: statusBar
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-
- states: [
- State {
- name: 'presetButtonsON'
- when: (dataContainer.currentApplication.customPresets.count > 0) && (mediaPlayerView.playerType === "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1
- }
- PropertyChanges {
- target: presetButtons
- visible: true
- enabled: true
- }
- },
-
- State {
- name: 'presetButtonsOFF'
- when: (dataContainer.currentApplication.customPresets.count === 0) || (mediaPlayerView.playerType !== "SDL")
- PropertyChanges {
- target: spacingBetweenItems
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: spacingBetweenItems2
- height: 1/10 * mediaPlayerView.height
- }
- PropertyChanges {
- target: presetButtons
- visible: false
- enabled: false
- }
- }
- ]
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml
deleted file mode 100644
index 08f1d76b60..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file MusicSourceView.qml
- * @brief Music source screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: dataContainer.musicSourceModel
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml, appId)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml
deleted file mode 100644
index 99f1877a51..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @file NavigationInRouteGridView.qml
- * @brief Navigation in route screen veiw.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-
-GeneralView {
- Item {
- id: navInRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: Constants.releasedButtonTextColor
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: 30
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- Image {
- id: muteBtnImg
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * muteBtnImg.width
- source: "../res/nav/mute_off.png"
- MouseArea {
- anchors.fill: parent
- onClicked: if (muteBtnImg.state === "off") {
- muteBtnImg.state = "on"
- muteBtnImg.source = "../res/nav/mute_off.png"
- }
- else {
- muteBtnImg.source = "../res/nav/mute_on.png"
- muteBtnImg.state = "off"
- }
- }
- }
-
- Image {
- id: turnArrow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: muteBtnImg.right
- anchors.leftMargin: 1/20 * contentLoader.width
- source: "../res/nav/turnArrow.png"
- }
-
- Text {
- id: street
- anchors.verticalCenter: cancel.verticalCenter
- anchors.left: turnArrow.right
- anchors.leftMargin: 1/20 * contentLoader.width
- text: "0.2 mi on Cherry Hill Rd."
- color: "White"
- font.pixelSize: 20
- }
-
- Text {
- id: timeToDest
- anchors.verticalCenter: cancel.verticalCenter
- anchors.right: cancel.left
- anchors.rightMargin: 1/20 * contentLoader.width
- text: "2 hrs 27 min"
- color: "White"
- font.pixelSize: 20
- }
-
- Image {
- id: cancel
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
-
- source: "../res/buttons/long_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: cancel.left
- anchors.leftMargin: Constants.fontSize
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: cancelText
- anchors.centerIn: parent
- text: "Cancel"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- cancel.source = "../res/buttons/long_oval_pressed_btn.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- cancelText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- cancel.source = "../res/buttons/long_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- cancelText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationNoRouteGridView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml
deleted file mode 100644
index f5d19e7626..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * @file NavigationKeyboardView.qml
- * @brief Navigation keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navKeyboard
- anchors.fill: parent
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- // Text line with input text
- TextInput {
- id: inputText
- anchors.top:parent.top
- anchors.left:parent.left
- maximumLength: 30
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- text: dataContainer.routeText
- }
-
- // Keyboard
- Column {
- anchors.centerIn: parent
- Row {
- id: upperRow
- property string qWERTY : "QWERTYUIOP"
- anchors.horizontalCenter: parent.horizontalCenter
-
- Repeater {
- model: 10
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: upperRow.qWERTY.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += upperRow.qWERTY.charAt(index)
- }
- }
- }
- }
- Row {
- id: middleRow
- property string aSDFGH : "ASDFGHJKL"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 15
- }
- //--------------
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: middleRow.aSDFGH.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += middleRow.aSDFGH.charAt(index)
- }
- }
- }
- //--------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- onIsPressedChanged: {
- hoverImg.source = isPressed ? "../res/nav/delete_icon_black.png" : "../res/nav/delete_icon.png";
- }
- Image {
- id: hoverImg
- anchors.centerIn: parent
- source: "../res/nav/delete_icon.png"
- }
-
- onClicked: {
- dataContainer.routeText = dataContainer.routeText.substring(0,dataContainer.routeText.length - 1)
- }
- }
- }
- Row {
- id: lowerRow
- property string zXCVBN : "ZXCVBNM"
- anchors.horizontalCenter: parent.horizontalCenter
-
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "!@#"
- pixelSize: 15
- }
- //-----------------
- Repeater {
- model: 7
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: lowerRow.zXCVBN.charAt(index)
- pixelSize: Constants.fontSize
-
- onClicked: {
- dataContainer.routeText += lowerRow.zXCVBN.charAt(index)
- }
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Clear"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText = ""
- }
- }
- //----------------
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "Space"
- pixelSize: 12
-
- onClicked: {
- dataContainer.routeText += " "
- }
- }
- }
-
- } // column
-
- Image {
- id: goBtn
- anchors.right: parent.right
- anchors.top: parent.top
- source: "../res/buttons/short_oval_btn.png"
-
- Text {
- id: goText
- anchors.centerIn: parent
- text: "Go"
- color: Constants.primaryColor
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- goBtn.source = "../res/buttons/short_oval_btn_pressed.png"
- goText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- goBtn.source = "../res/buttons/short_oval_btn.png"
- goText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationInRouteGridView.qml")
- }
- }
- }
- } // 3/4 top screen
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml
deleted file mode 100644
index 8b8b7ef261..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * @file NavigationMenuView.qml
- * @brief Navigation menu screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- GridMenu {
- id: menu
- model: NavigationMenuModel {}
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- OvalButton {
- text: title
- onReleased: contentLoader.go(qml)
- anchors.centerIn: parent
- fontSize: Constants.fontSize
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml
deleted file mode 100644
index d4fbb9f4ef..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * @file NavigationNoRouteGridView.qml
- * @brief Navigation no route screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: navNoRoute
- anchors.fill: parent
-
- Image {
- // 3/4 top screen
- id: map
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- source: "../res/nav/map.png"
-
- Image {
- id: compas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 1/4 * compas.width
- anchors.left: parent.left
- anchors.leftMargin: 1/4 * compas.width
- source: "../res/nav/compass.png"
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.horizontalCenter: compas.horizontalCenter
- spacing: 1/8 * parent.height
-
- // Zoom "+" button
- Image {
- id: zoomIn
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomInBtn
- anchors.centerIn: parent
- text: "+"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomInBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomInBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
-
- // Zoom "-" button
- Image {
- id: zoomOut
- source: "../res/buttons/zoom.png"
-
- Text {
- id: zoomOutBtn
- anchors.centerIn: parent
- text: "-"
- color: "white"
- font.pixelSize: Constants.fontSize
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/zoom_pressed.png"
- zoomOutBtn.color = Constants.pressedButtonTextColor
- }
- onReleased: {
- parent.source = "../res/buttons/zoom.png"
- zoomOutBtn.color = Constants.releasedButtonTextColor
- }
-
- onClicked: {
- //Some behavior
- }
- }
- }
- } // column
-
- // Options button
- Image {
- id: navOptions
- anchors.top: parent.top
- anchors.right: parent.right
- source: "../res/nav/options.png"
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/nav/options_pressed.png"
- }
- onReleased: {
- parent.source = "../res/nav/options.png"
- }
- onClicked: {
- //Options screen
- }
- }
- }
- } //map
-
- Item {
- // 1/4 bottom screen
- id: bottomPart
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Destination search button
- Image {
- id: destSearch
- anchors.verticalCenter: parent.verticalCenter
- anchors.right: parent.right
- source: "../res/buttons/longest_oval_btn.png"
-
- Image {
- id: destIcon
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 15
- source: "../res/nav/dest_icon.png"
- }
-
- Text {
- id: destText
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: destIcon.right
- anchors.leftMargin: 5
- text: "Destination"
- color: Constants.primaryColor
- font.pixelSize: 20
- }
-
- MouseArea {
- anchors.fill: parent
-
- onPressed: {
- destSearch.source = "../res/buttons/longest_oval_btn_pressed.png"
- destIcon.source = "../res/nav/dest_icon_black.png"
- destText.color = Constants.pressedButtonTextColor
- }
-
- onReleased: {
- destSearch.source = "../res/buttons/longest_oval_btn.png"
- destIcon.source = "../res/nav/dest_icon.png"
- destText.color = Constants.primaryColor
- }
-
- onClicked: {
- contentLoader.go("./views/NavigationMenuView.qml")
- }
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml
deleted file mode 100644
index 4b217cf9f5..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml
+++ /dev/null
@@ -1,171 +0,0 @@
-/**
- * @file PhoneKeyboardView.qml
- * @brief Phone keyboard screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-GeneralView{
- Component.onCompleted: phoneKeyboard.changeColorOfActiveButtons()
-
- Item {
- function changeColorOfActiveButtons() {
- for (var i = 0; i < contactsListModel.count; i++) {
- activeButtons[contactsListModel.get(i).name[0].toUpperCase()] = true
- }
- }
-
- id: phoneKeyboard
- anchors.fill: parent
-
- property var activeButtons: {
- "A": false, "B": false, "C": false, "D": false, "E": false,
- "F": false, "G": false, "H": false, "I": false, "J": false,
- "K": false, "L": false, "M": false, "N": false, "O": false,
- "P": false, "Q": false, "R": false, "S": false, "T": false,
- "U": false, "V": false, "W": false, "X": false, "Y": false, "Z": false
- }
-
- ContactsListModel {
- id: contactsListModel
- }
-
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- Column {
- anchors.centerIn: parent
-
- Row {
- id: upperRow
- property string contentLoader : "ABCDEFGHI"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: upperRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: middleRow
- property string contentLoader : "JKLMNOPQR"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 9
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: middleRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- }
-
- Row {
- id: lowerRow
- property string contentLoader : "STUVWXYZ"
- anchors.horizontalCenter: parent.horizontalCenter
- Repeater {
- model: 8
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- textColorDefault: phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]
- ? Constants.primaryColor : Constants.inactiveButtonTextColor
- text: lowerRow.contentLoader.charAt(index)
- pixelSize: Constants.fontSize
- onIsPressedChanged: {
- if (!isPressed){
- if (phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]) {
- dataContainer.contactsFirstLetter = text
- contentLoader.go("./views/ContactsListView.qml")
- }
- }
- }
- }
- }
- CircleButton {
- imgOff: "../res/buttons/preset_btn.png"
- imgOn: "../res/buttons/preset_pressed_btn.png"
- text: "123"
- pixelSize: 20
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent}
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml
deleted file mode 100644
index 5cfdc5a309..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * @file PhoneMenuGridView.qml
- * @brief View for phone menu.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models"
-import "../controls"
-
-GridMenu {
- id: menu
- model: PhoneMenuModel {}
- delegate: GridItem {
- width: menu.width / menu.columnsOnPage
- height: menu.height / menu.rows
- ClickableImage {
- anchors.centerIn: parent
- source: icon
- onClicked: {
- if(qml !== "") {
- contentLoader.go(qml)
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml b/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml
deleted file mode 100644
index 83a223a18a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * @file SettingsSourceView.qml
- * @brief Settings source screen view.
- * 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 QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "Permissions (choose application):"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
- ScrollableListView {
- id: applicationList
- anchors.top: title.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- model: dataContainer.applicationList
-
- delegate: Item {
- width: parent.width
- height: Math.max(applicationName.height, appIcon.height)
- Image {
- id: appIcon
- source: icon
- height: Constants.appListIconSize
- width: height
- }
- ClickableText {
- id: applicationName
- text: appName
- defaultColor: Constants.primaryColor
- pressedColor: Constants.primaryColorPressed
- font.pixelSize: Constants.appListFontSize
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: appIcon.right
- anchors.leftMargin: Constants.margin
- onClicked: {
- RequestToSDL.SDL_GetListOfPermissions(appId, function(params){
- settingsContainer.getListOfPermissions_Response(appId, params)
- });
- }
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml
deleted file mode 100644
index f673327c68..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * @file RadioPlayerView.qml
- * @brief Parent for AM, FM, Sirius players screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models"
-import "../models/Constants.js" as Constants
-
-Item {
- id: radioPlayerView
-
- property string radioType: ""
- property string radioName: ""
- property alias buttonHD: bot.children
-
- property PlayerState playerState
-
- Item {
- // top 3/4 screen
- id: upperContent
- anchors.top: parent.top
- anchors.left: parent.left
- height: parent.height * 3/4
- width: parent.width
-
- Item {
- // top part for buttons
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- OvalButton {
- text: radioName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- }
-
- OvalButton {
- anchors.right: parent.right
- anchors.top: parent.top
- text: "Tune"
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- // mid part for information about song
- id: mid
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- width: parent.width
- height: parent.height / 2
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
-
- Row {
- Text {
- id: radioChannelNameText
- color: Constants.primaryColor
- text: playerState.presets[0]
- font.pixelSize: 45
- }
- Text {
- anchors.bottom: radioChannelNameText.bottom
- color: Constants.primaryColor
- text: " " + radioType
- font.pixelSize: 25
- }
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.songName
- font.pixelSize: 25
- font.bold: true
- }
-
- Text {
- color: Constants.primaryColor
- text: playerState.albumName
- font.pixelSize: 25
- }
- }
- }
-
- Item {
- // bottom part for HD button (for FM radio)
- id: bot
- anchors.left: parent.left
- anchors.bottom: parent. bottom
- width: parent.width
- height: parent.height * 1/4
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- // Line that divide screen in two parts
- Rectangle {
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 2
- color: Constants.primaryColor
- }
-
- PresetRow {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: playerState.presets
- width: parent.width
- onSelectedIndexChanged: {
- radioChannelNameText.text = presets[selectedIndex];
- }
- }
- }
-}
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml
deleted file mode 100644
index 8ac6e6d9b8..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- id: deviceList
- property bool allowed: false
-
- function setAllowed(allowed) {
- console.debug("Set allowed", allowed, deviceList.allowed);
- deviceList.allowed = allowed;
- for (var i = 0; i < dataContainer.deviceList.count; ++i) {
- menu.model.get(i).allowed = allowed;
- }
- }
-
- anchors.fill: parent
- Text {
- id: title
- text: "Choose devices to be allowed for SDL functionality:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- OvalButton {
- id: allDevice
- text: "All devices Not Allowed"
- onClicked: {
- if (parent.allowed) {
- parent.setAllowed(false);
- text = "All devices Not Allowed";
- } else {
- parent.setAllowed(true);
- text = "All devices Allowed";
- }
- settingsContainer.allowSDLFunctionality(parent.allowed, undefined);
- }
- anchors.top: title.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
-
- ScrollableListView {
- id: menu
- model: dataContainer.deviceList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: allDevice.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: (allowed) ? name + " - Allowed" :
- name + " - Not allowed"
- onClicked: {
- var item = menu.model.get(index);
- allDevice.text = "All devices manual Configuration";
- item.allowed = !item.allowed;
- settingsContainer.allowSDLFunctionality(item.allowed,
- {id: item.devid,
- name: item.name});
- deviceList.allowed = null;
- }
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml
deleted file mode 100644
index ef98ffb10d..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml
+++ /dev/null
@@ -1,223 +0,0 @@
-/**
- * @file SDLNavi.qml
- * @brief SDL navigation screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtMultimedia 5.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- MultiTouchArea {
- anchors.fill: parent
- id: wholeWindow
-
- Row {
- // Top items
- id: topItems
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField1
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- anchors.top: parent.top
- width: 3/5 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
-
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField2
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- id: rightRectOfTopItems
- anchors.top: parent.top
- width: 1/5 * parent.width
- height: 4/5 * parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField3 ? dataContainer.currentApplication.hmiUIText.mainField3 : "field3"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Column {
- // "+", "-" button at left
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- width: 1/12 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "+"
- isCustomButton: true
- customButtonID: 3
- }
- GradientRectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- text: "-"
- isCustomButton: true
- customButtonID: 4
- }
- }
-
- Column {
- anchors.right: parent.right
- anchors.top: topItems.bottom
- width: 1/6 * parent.width
- height: 2/10 * parent.height + spacing
- spacing: Constants.sdlNaviSpacing
-
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: ""
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- Rectangle {
- width: parent.width
- height: 1/10 * wholeWindow.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: dataContainer.currentApplication.hmiUIText.mainField4 ? dataContainer.currentApplication.hmiUIText.mainField4 : "mainField4"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- }
-
- Row {
- // bottom items
- id: bottomItems
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/6 * parent.height
- spacing: Constants.sdlNaviSpacing
-
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Menu"
- isCustomButton: true
- customButtonID: 1
- }
- Rectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width - 2 * parent.spacing
- height: parent.height
- color: Constants.sdlNaviTransparentItemColor
- radius: 5
- Text {
- text: "mainField5"
- anchors.fill: parent
- font.pixelSize: Constants.fontSize
- color: "white"
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
- }
- GradientRectangle {
- anchors.bottom: parent.bottom
- width: 1/3 * parent.width
- height: parent.height
- text: "Custom Button"
- isCustomButton: true
- customButtonID: 2
- }
- }
-
- GradientRectangle {
- anchors.right: parent.right
- anchors.bottom: bottomItems.top
- anchors.bottomMargin: Constants.sdlNaviSpacing
- width: 1/6 * parent.width
- height: 1/10 * parent.height
- text: "Options"
- fontSize: Constants.fontSize
- onReleased: {
- contentLoader.go("./views/SDLPlayerOptionsListView.qml", dataContainer.currentApplication.appId)
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml
deleted file mode 100644
index 231ab03135..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * @file SDLNonMediaView.qml
- * @brief SDL non media screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: upperContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
-
- Item {
- id: topButtonRow
- // top 1/4 of screen
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- spacing: (width - 4 * elementWidth) / 3
- snapTo: elementWidth + spacing
-
- OvalButton {
- text: "Options"
- onClicked: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- }
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- }
- }
-
- Column {
- id: midContent
- height: parent.height * 3/4
- width: parent.width
- anchors.top: topButtonRow.bottom
- anchors.left: parent.left
-
- Text {
- id: deviceName
- width: parent.width
- height: 1/5 * parent.height
- text: "Device: " + dataContainer.currentApplication.deviceName
- verticalAlignment: Text.AlignVCenter
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Row {
- width: parent.width
- height: 4/5 * parent.height
- spacing: Constants.margin
-
- Image {
- id: image
- height: parent.height
- width: height
- source: dataContainer.currentApplication.hmiUIText.image
- }
-
- Column {
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: Constants.margin
-
- Text {
- id: text1
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField1
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- Text {
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment
- text: dataContainer.currentApplication.hmiUIText.mainField2
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // bottom 1/4 screen
- id: lowerContent
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 1/4
-
- PresetRow {
- id: presetsRow
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- presets: Internal.getArrayForPresetRow(dataContainer.currentApplication)
- width: parent.width
- property bool clickProcessed
-
- onPresetButtonPressed: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined)
- }
-
- onPresetButtonReleased: {
- sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined)
- }
-
- onPresetButtonClicked: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined)
- }
-
- onPresetButtonHold: {
- sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined)
- }
- }
- }
-
- StatusBar {
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
deleted file mode 100644
index e249a5eb76..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * @file SDLPlayerOptionsListView.qml
- * @brief SDL player options screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models/Internal.js" as Internal
-
-GeneralView {
- applicationContext: true
- systemContext: Common.SystemContext.SYSCTXT_MENU
- Item {
- // 3/4 top screen
- height: parent.height * 3/4
- width: parent.width
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
-
- ListView {
- id: sdlPlayerOptionsListView
- anchors.horizontalCenter: parent.horizontalCenter
- width:parent.width
- height:parent.height
-
- model: dataContainer.currentApplication.currentSubMenu
-
- delegate: Row {
- spacing: Constants.iconItemListSpacing
- Icon {
- source: model.icon
- width: Constants.iconItemListSize
- height: Constants.iconItemListSize
-
- MouseArea {
- anchors.fill: parent
- enabled: model.icon.value !== undefined
-
- onPressed: text.press()
- onReleased: text.release()
- onCanceled: text.release()
- onClicked: text.click()
- }
- }
-
- ClickableText {
- id: text
- text: name + (type === Internal.MenuItemType.MI_SUBMENU ? " >" : "")
- width: sdlPlayerOptionsListView.width - x
- elide: Text.ElideRight
- defaultColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColor :
- Constants.primaryColor
- pressedColor: type === Internal.MenuItemType.MI_PARENT ?
- Constants.inactiveButtonTextColorPressed :
- Constants.primaryColorPressed
- font.pixelSize: Constants.titleFontSize
-
- function click() {
- console.debug("enter")
- switch (type) {
- 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:
- dataContainer.currentApplication.currentSubMenu = subMenu
- break;
- }
- console.debug("exit")
- }
- onClicked: click()
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml
deleted file mode 100644
index 4fff5aa826..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * @file SDLPlayerView.qml
- * @brief SDL player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- applicationContext: true
- MediaPlayer {
- id: mediaPlayer
- onPlay: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- onPause: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) }
- playerName: "SDL music"
- playerType: "SDL"
- image: dataContainer.currentApplication.hmiUIText.image
- anchors.fill: parent
-
- buttons: [
- OvalButton {
- text: dataContainer.currentApplication.appName
- onReleased: { contentLoader.go("./views/MusicSourceView.qml") }
- },
-
- OvalButton {
- text: "SDL Menu"
- onReleased: { contentLoader.go("./views/ApplicationListView.qml") }
- },
-
- OvalButton {
- text: "Options"
- onReleased: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") }
- },
-
- Repeater {
- model: dataContainer.currentApplication.softButtons ?
- dataContainer.currentApplication.softButtons.count :
- 0
-
- delegate: SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.softButtons.get(index)
- }
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
deleted file mode 100644
index 0dcb7a3b32..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml
+++ /dev/null
@@ -1,181 +0,0 @@
-/**
- * @file ScrollableMessageView.qml
- * @brief Scrollable Message View.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../hmi_api/Async.js" as Async
-import "../models/Constants.js" as Constants
-import "../models"
-import "../popups"
-
-GeneralView {
- applicationContext: true
- systemContext: Common.SystemContext.SYSCTXT_HMI_OBSCURED
- onLeaveScreen: {
- timer.stop()
- dataContainer.scrollableMessageModel.running = false
- DBus.sendReply(dataContainer.scrollableMessageModel.async, { __retCode: dataContainer.scrollableMessageModel.result })
- }
- Component.onCompleted: {
- dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
- dataContainer.scrollableMessageModel.running = true
- timer.start()
- }
-
- Timer {
- id: timer
- interval: dataContainer.scrollableMessageModel.timeout
- onTriggered: {
- dataContainer.scrollableMessageModel.result = Common.Result.SUCCESS
- contentLoader.back()
- }
- }
-
- Rectangle {
- anchors.fill: parent
- color: Constants.secondaryColor
-
- Item {
- // top 1/5 of screen
- id: top
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: dataContainer.scrollableMessageModel.softButtons.count > 0 ? parent.height * 1/5 : 1
-
- PagedFlickable {
- id: flickRow
- width: top.width
- spacing: (width - elementWidth * 4) / 3
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
- Repeater {
- model: dataContainer.scrollableMessageModel.softButtons ?
- dataContainer.scrollableMessageModel.softButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.scrollableMessageModel.appId
- button: dataContainer.scrollableMessageModel.softButtons.get(index)
- onKeepContext: { timer.restart() }
- onDefaultAction: {
- dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
- contentLoader.back()
- }
- onStealFocus: {
- dataContainer.scrollableMessageModel.result = Common.Result.SUCCESS
- contentLoader.back()
- }
- }
- }
- }
- }
-
- Item {
- id: middle
- anchors.top: top.bottom
- anchors.left: parent.left
- anchors.bottom: bottom.top
- width: parent.width
- clip: true
-
- Flickable {
- id:flickable
- anchors.fill: middle
- flickableDirection: Flickable.VerticalFlick
- contentWidth: longMessageText.width
- contentHeight: longMessageText.height
- clip: true
-
- Text {
- id: longMessageText
- wrapMode: Text.Wrap
- width: middle.width
- text: dataContainer.scrollableMessageModel.longMessageText
- color: Constants.scrollableMessageTextColor
- font.pixelSize: Constants.fontSize
- }
- }
- Rectangle {
- id: scrollbar
- anchors.right: flickable.right
- y: flickable.visibleArea.yPosition * flickable.height
- width: Constants.scrollableMessageScrollBarWidth
- height: flickable.visibleArea.heightRatio * flickable.height
- visible: !(flickable.visibleArea.heightRatio > 1)
- color: Constants.scrollableMessageScrollBarColor
- }
- }
- Item {
- // 1/5 bottom screen
- id: bottom
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/5 * parent.height
- OvalButton {
- anchors.centerIn: parent
- text: "Close"
- onClicked: {
- dataContainer.scrollableMessageModel.result = Common.Result.ABORTED
- contentLoader.back()
- }
- }
- }
- }
- /**
- * Test Support Section
- *
- */
- function getTimer(){
- return timer
- }
- function getSoftButtonsListView(){
- return softButtons
- }
- function getScrollbar(){
- return scrollbar
- }
- function getTextArea(){
- return middle
- }
- function getBackButton(){
- return backButton
- }
-
- /**
- * Test Support Section End
- */
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml
deleted file mode 100644
index fa0bfbc821..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * @file SettingsSourceView.qml
- * @brief Settings source screen view.
- * 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 QtQuick 2.0
-import "../models"
-import "../controls"
-import "../models/Constants.js" as Constants
-
-GeneralView {
- signal itemActivated(string item)
-
- onItemActivated: {
- switch (item) {
- case "update_sdl": RequestToSDL.SDL_UpdateSDL(settingsContainer.updateStatus); break;
- case "get_status_update": RequestToSDL.SDL_GetStatusUpdate(settingsContainer.updateStatus); break;
- case "get_urls": RequestToSDL.SDL_GetURLS(0, settingsContainer.startPTExchange); break;
- }
- }
-
- Item {
- anchors.fill: parent
- ScrollableListView {
- id: menu
- model: dataContainer.settingsSourceModel
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: title
- onReleased: {
- if (qml) {
- contentLoader.go(qml, appId);
- } else {
- itemActivated(action);
- }
- }
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
-
-
-
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml b/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml
deleted file mode 100644
index b79cddf8cf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml
+++ /dev/null
@@ -1,293 +0,0 @@
-/**
- * @file SimulationView.qml
- * @brief Area of screen responsible for simulation actions
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Styles 1.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../views"
-import "../popups"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- width: controlArea.width + controlArea.anchors.margins
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- color: Constants.panelColor
-
- Item {
- id: showArea
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- height: parent.height - (controlArea.childrenRect.height + controlArea.anchors.margins)
-
- ExitAllApplicationsPopup {
- id: exitAllApplicationsPopup
- anchors.fill: parent
- visible: false
- }
-
- VehicleInfoPopUp {
- id: viPopUp
- anchors.fill: parent
- }
-
- TBTClientStatePopUp {
- id: tbtClientStatePopUp
- anchors.fill: parent
- visible: false
- }
- }
-
- Item {
- id: controlArea
- anchors.bottom: parent.bottom
- anchors.margins: Constants.panelPadding
- anchors.horizontalCenter: parent.horizontalCenter
- width: table.width
-
- ListModel {
- id: languagesList
-
- Component.onCompleted: {
- for (var name in Common.Language) {
- if (settingsContainer.sdlLanguagesList.indexOf(Common.Language[name]) != -1) {
- append({name: name.replace('_', '-')});
- }
- }
- }
- }
-
- Text {
- id: label
- text: "Languages"
- color: Constants.panelTextColor
- anchors.bottom: table.top
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Grid {
- id: table
- spacing: 5
- columns: 2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: globalProperties.top
-
- Text {
- text: "HMI UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "HMI TTS + VR"
- color: Constants.panelTextColor
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiUILanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlUI.onLanguageChange(dataContainer.hmiUILanguage);
- }
- z: 1000
- }
-
- ComboBox {
- width: table.width / table.columns - table.spacing
- model: languagesList
- onCurrentIndexChanged: {
- dataContainer.hmiTTSVRLanguage = settingsContainer.sdlLanguagesList[currentIndex];
- sdlTTS.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- sdlVR.onLanguageChange(dataContainer.hmiTTSVRLanguage);
- }
- z: 1000
- }
-
- Text {
- text: "Application UI"
- color: Constants.panelTextColor
- }
-
- Text {
- text: "Application TTS + VR"
- color: Constants.panelTextColor
- }
-
- Text {
- id: uiLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.hmiDisplayLanguageDesired) {
- uiLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- Text {
- id: ttsLanguageLabel
- color: Constants.panelTextColor
- text: " "
- Connections {
- target: dataContainer
- onCurrentApplicationChanged: {
- for (var s in Common.Language) {
- if (Common.Language[s] === dataContainer.currentApplication.languageTTSVR) {
- ttsLanguageLabel.text = s;
- }
- }
- }
- }
- }
-
- PushButton {
- id: vehicleInfo
- label: "Vehicle info"
- toggleMode: true
- onPressed: {
- viPopUp.show();
- }
- onUnpressed: {
- viPopUp.hide();
- }
- }
-
- PushButton {
- id: tbtClientState
- label: "TBT Client state"
- toggleMode: true
- onPressed: {
- tbtClientStatePopUp.show();
- }
- onUnpressed: {
- tbtClientStatePopUp.hide();
- }
- }
-
- PushButton {
- label: "Exit application"
- onClicked: {
- if (dataContainer.applicationContext) {
- sdlBasicCommunication.onExitApplication(dataContainer.currentApplication.appId)
- }
- }
- }
-
- PushButton {
- id: exitAllAppsButton
- label: "Exit all apps"
- toggleMode: true
- onPressed: {
- exitAllApplicationsPopup.show()
-
- }
- onUnpressed: {
- exitAllApplicationsPopup.hide()
- }
- Connections {
- target: exitAllApplicationsPopup
- onVisibleChanged: {
- if (!exitAllApplicationsPopup.visible) {
- exitAllAppsButton.state = "unpressed"
- }
- }
- }
- }
-
- CheckBox {
- style: CheckBoxStyle {
- label: Text {
- color: Constants.panelTextColor
- text: "Use URL"
- }
- }
- }
-
- CheckBox {
- style: CheckBoxStyle {
- label: Text {
- color: Constants.panelTextColor
- text: "DD"
- }
- }
- onClicked: {
- if (checked) {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_ON;
- } else {
- dataContainer.driverDistractionState =
- Common.DriverDistractionState.DD_OFF;
- }
- }
- }
- }
-
- Rectangle {
- id: globalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
- height: listGlobalProperties.height + Constants.panelPadding
- border.color: Constants.panelTextColor
- border.width: 1
- color: Constants.panelColor
- Column {
- id: listGlobalProperties
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.panelPadding / 4
- Text {
- text: "HELP_PROMPT: " + dataContainer.currentApplication.helpPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "TIMEOUT_PROMPT: " + dataContainer.currentApplication.timeoutPrompt
- color: Constants.panelTextColor
- }
- Text {
- text: "AUTOCOMPLETE_TEXT: " // TODO(ALeshin): Function didn' realized yet
- color: Constants.panelTextColor
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml
deleted file mode 100644
index e5d2149542..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * @file SiriusPlayerView.qml
- * @brief Sirius player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-
-GeneralView {
- RadioPlayer {
- id: siriusRadioPlayer
- anchors.fill: parent
- radioType: ""
- radioName: "Sirius"
-
- playerState: dataContainer.siriusPlayerState
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml b/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml
deleted file mode 100644
index 75f76249d5..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "Statistics Info:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: statisticsTypeList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: sdlSDL.addStatisticsInfo(Common.StatisticsType[name]);
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- ListModel {
- id: statisticsTypeList
-
- Component.onCompleted: {
- for (var name in Common.StatisticsType) {
- append({name: name});
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml
deleted file mode 100644
index 058282ae00..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "System Error:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: systemErrorList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: sdlSDL.onSystemError(Common.SystemError[name]);
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- ListModel {
- id: systemErrorList
-
- Component.onCompleted: {
- for (var name in Common.SystemError) {
- append({name: name});
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml
deleted file mode 100644
index 32a3987e74..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-import QtQuick 2.0
-import "../models"
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-
-GeneralView {
- Item {
- anchors.fill: parent
- Text {
- id: title
- text: "System Request:"
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- height: Constants.fontSize + Constants.panelPadding
- }
-
- ScrollableListView {
- id: menu
- model: requestTypeList
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.top: title.bottom
- anchors.bottom: bottomPanel.top
- delegate: OvalButton {
- text: name
- onClicked: settingsContainer.systemRequest(Common.RequestType[name]);
- anchors.left: parent.left
- anchors.right: parent.right
- fontSize: Constants.fontSize
- }
- }
-
- ListModel {
- id: requestTypeList
-
- Component.onCompleted: {
- for (var name in Common.RequestType) {
- append({name: name});
- }
- }
- }
-
- Item {
- id: bottomPanel
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
-
- BackButton { anchors.centerIn: parent }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml
deleted file mode 100644
index a69a86a40a..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml
+++ /dev/null
@@ -1,202 +0,0 @@
-/**
- * @file TurnByTurnView.qml
- * @brief View for TurnByTurn.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../models"
-
-GeneralView {
- applicationContext: true
-
- Item {
- id: turnByTurnView
- anchors.fill: parent
-
- Item {
- // top 3/4 of screen
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: parent.height * 3/4
-
- Item {
- // row of oval buttons
- id: ovalButtonsRow
- anchors.top: parent.top
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- id: buttonsRow
- width: parent.width
- spacing: (width - 4 * elementWidth) / 3
- anchors.verticalCenter: parent.verticalCenter
- snapTo: Constants.ovalButtonWidth + spacing
- elementWidth: Constants.ovalButtonWidth
-
- OvalButton {
- id: turnListButton
- text: "TurnList"
- onClicked: {
- console.log("Go to TurnListView");
- contentLoader.go("./views/TurnListView.qml");
- }
- }
-
- Repeater {
- model: dataContainer.currentApplication.navigationSoftButtons ?
- dataContainer.currentApplication.navigationSoftButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.navigationSoftButtons.get(index)
- }
- }
- }
- }
-
- Column {
- // Picture + text information + media clock
- id: mediaContent
- width: parent.width
- height: 3/4 * parent.height
- anchors.left: parent.left
- anchors.top: ovalButtonsRow.bottom
-
- Row {
- // picture + text info
- width: parent.width
- height: 3/4 * parent.height
- spacing: Constants.margin
-
- Icon {
- id: image
- height: parent.height
- width: height
- source: dataContainer.currentApplication.navigationModel.turnIcon
- }
-
- Column {
- // text info
- id: textInfo
- height: parent.height
- width: parent.width - image.width - parent.spacing
- spacing: (height - 5 * navText1.height) / 4
-
- Text {
- id: navText1
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.currentApplication.navigationModel.text1
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.text1
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: dataContainer.currentApplication.navigationModel.text2
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.text2
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Total distance: " + dataContainer.currentApplication.navigationModel.totalDistance
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.totalDistance
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "Time to destination: " + dataContainer.currentApplication.navigationModel.timeToDestination
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.timeToDestination
- }
-
- Text {
- anchors.left: parent.left
- anchors.right: parent.right
- color: Constants.primaryColor
- text: "ETA: " + dataContainer.currentApplication.navigationModel.eta
- font.pixelSize: Constants.fontSize
- visible: dataContainer.currentApplication.navigationModel.eta
- }
- }
- }
-
- Row {
- anchors.horizontalCenter: parent.horizontalCenter
- height: 1/4 * parent.height
- width: 2/3 * parent.width
-
- Rectangle {
- id: coveredDistance
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: dataContainer.currentApplication.navigationModel.distanceToManeuver /
- dataContainer.currentApplication.navigationModel.distanceToManeuverScale * parent.width
- color: "white"
- }
-
- Rectangle {
- anchors.verticalCenter: parent.verticalCenter
- height: Constants.distanceBarHeight
- width: parent.width - coveredDistance.width
- color: Constants.primaryColor
- }
- }
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml
deleted file mode 100644
index bdd0b3d6cf..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * @file TurnListView.qml
- * @brief View for TurnByTurn list.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-import "../hmi_api/Common.js" as Common
-
-GeneralView {
- applicationContext: true
-
- Item {
- anchors.left: parent.left
- anchors.top: parent.top
- width: parent.width
- height: 3/4 * parent.height
-
- Item {
- id: sotfButtons
- width: parent.width
- height: 1/4 * parent.height
-
- PagedFlickable {
- anchors.verticalCenter: parent.verticalCenter
- width: parent.width
- elementWidth: Constants.ovalButtonWidth
- snapTo: elementWidth + spacing
- spacing: (width - 4 * elementWidth) / 3
-
- Repeater {
- model: dataContainer.currentApplication.turnListSoftButtons ?
- dataContainer.currentApplication.turnListSoftButtons.count :
- 0
- delegate:
- SoftButton {
- appId: dataContainer.currentApplication.appId
- button: dataContainer.currentApplication.turnListSoftButtons.get(index)
- }
- }
- }
- }
-
- ScrollableListView {
- id: scrollableList
- anchors.top: sotfButtons.bottom
- anchors.left: parent.left
- width: parent.width
- height: 3/4 * parent.height
-
- model: dataContainer.currentApplication.turnList
-
- delegate:
- ListItem {
- width: scrollableList.width
- height: Constants.iconItemListSize
- text: dataContainer.currentApplication.turnList.get(index).navigationText.fieldText
- fontSize: Constants.fontSize
- icon: dataContainer.currentApplication.turnList.get(index).turnIcon
- }
- }
- }
-
- Item {
- // 1/4 bottom screen
- id: back
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- BackButton { anchors.centerIn: parent }
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml
deleted file mode 100644
index f8a2d39806..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @file UsbPlayerView.qml
- * @brief USB player screen view.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../hmi_api/Common.js" as Common
-import "../models/Constants.js" as Constants
-import "../controls"
-
-GeneralView {
- category: Common.DeactivateReason.AUDIO
- MediaPlayer {
- id: usbPlayer
- playerName: "USB"
- anchors.fill: parent
- playerState: dataContainer.usbPlayerState
- image: playerState.albumImage
-
- buttons: [
- OvalButton {
- text: usbPlayer.playerName
- onReleased: contentLoader.go("./views/MusicSourceView.qml")
- fontSize: Constants.fontSize
- },
-
- OvalButton {
- text: "Browse"
- fontSize: Constants.fontSize
- }
- ]
- }
-}
diff --git a/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml b/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml
deleted file mode 100644
index 6228b63c79..0000000000
--- a/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * @file WarningInfo.qml
- * @brief Screen with warning information.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (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 QtQuick 2.0
-import "../controls"
-import "../models/Constants.js" as Constants
-
-Rectangle {
- id: warningInfo
- anchors.fill: parent
- color: Constants.secondaryColor
- Text {
- anchors.top: parent.top
- anchors.left: parent.left
- height: 1/4 * parent.height
- width: parent.width
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
-
- text: "WARNING!"
- color: Constants.warningColor
- font.pixelSize: Constants.titleFontSize
- font.bold: true
- style: Text.Raised
- styleColor: "gray"
- }
-
- Text {
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: Constants.margin
- height: 1/2 * parent.height
- width: parent.width
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
- wrapMode: Text.WordWrap
-
- text: "This application is intended to be used as a demonstrative aid only, "
- + "while the vehicle is parked. Don't use it while driving. <br /><br />"
- + "Use extreme caution when using any device that takes your attention off the road. "
- + "Ford recommends against the use of any hand-held device while driving and that you comply "
- + "with all applicable laws. Your primary responsibility is the safe operation of the vehicle."
- color: "white"
- font.pixelSize: 25
- font.bold: true
- }
-
- function showOkButton() {
- okButtonAnimation.start()
- }
-
- Item {
- id: ok
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- width: parent.width
- height: 1/4 * parent.height
- opacity: 0
-
- SequentialAnimation
- {
- id: okButtonAnimation
- // Decrease this value while debugging
- PauseAnimation { duration: Constants.warningScreenDuration }
- NumberAnimation {
- target: ok
- duration: Constants.animationDuration
- property: "opacity"
- from: 0; to: 1;
- }
- }
-
- Image {
- id: okButton
- anchors.centerIn: parent
- source: "../res/buttons/longest_oval_btn.png"
-
- Text {
- id: text
- anchors.centerIn: parent
- text: "OK"
- font.pixelSize: Constants.fontSize
- color: Constants.primaryColor
- }
-
- MouseArea {
- anchors.fill: parent
- onPressed: {
- parent.source = "../res/buttons/longest_oval_btn_pressed.png"
- text.color = Constants.secondaryColor
- }
- onReleased: {
- parent.source = "../res/buttons/longest_oval_btn.png"
- text.color = Constants.primaryColor
- }
- onClicked: {
- console.log("WarningInfo OkButton - on clicked enter");
- warningInfo.visible = false
- }
- }
- }
- }
-}
diff --git a/src/components/qt_hmi/qml_plugins/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/CMakeLists.txt
deleted file mode 100644
index 6ff595315c..0000000000
--- a/src/components/qt_hmi/qml_plugins/CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-# --- DBus plugin
-add_subdirectory(./dbus_adapter)
-
-# --- Hmi Framework plugin
-add_subdirectory(./hw_buttons)
-
-# --- Log4cxx plugin
-add_subdirectory(./log4cxx)
-
-# --- NamedPipeNotifier plugin
-add_subdirectory(./named_pipe_notifier)
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt
deleted file mode 100644
index 53d1144356..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/CMakeLists.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(components_dir ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
-set(dbus_dir ${components_dir}/dbus)
-set(codegen_dir ${dbus_dir}/codegen)
-set(codegen ${codegen_dir}/make_qml_dbus_cpp.py)
-set(codegen_request_to_sdl ${codegen_dir}/make_request_to_sdl.py)
-set(codegen_hmi_requests ${codegen_dir}/make_hmi_requests.py)
-set(codegen_notification_qml ${codegen_dir}/make_notifications_qml.py)
-set(parser ${codegen_dir}/ford_xml_parser.py)
-set(interfaces_dir ${components_dir}/interfaces)
-set(api_xml ${interfaces_dir}/QT_HMI_API.xml)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h
- COMMAND python ${codegen} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc
- ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h
- from:
- ${api_xml} ..."
-)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.cc ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h
- COMMAND python ${codegen_request_to_sdl} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen_request_to_sdl} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.cc
- ${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h
- from:
- ${api_xml} ..."
-)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.cc ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h
- COMMAND python ${codegen_hmi_requests} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen_hmi_requests} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.cc
- ${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h
- from:
- ${api_xml} ..."
-)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.cc ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h
- COMMAND python ${codegen_notification_qml} --infile ${api_xml} --version ${qt_version} --outdir ${CMAKE_CURRENT_BINARY_DIR}
- DEPENDS ${api_xml} ${codegen_notification_qml} ${parser}
- COMMENT "Generating files:
- ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.cc
- ${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h
- from:
- ${api_xml} ..."
-)
-
-set(target DbusAdapter)
-set(destination com/ford/sdl/hmi/dbus_adapter)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES
- dbus_plugin.cc
- ${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.cc
- moc_qml_dbus.cpp
- sdl_proxy.cc
- moc_sdl_proxy.cpp
- hmi_proxy.cc
- stream_qvariant.cc
- moc_qml_dbus.cpp
- dbus_controller.cc
- request_to_sdl.cc
- moc_request_to_sdl.cpp
- hmi_requests.cc
- moc_hmi_requests.cpp
-)
-include_directories(
- ${LOG4CXX_INCLUDE_DIRECTORY}
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_BINARY_DIR}/src/components
- ${CMAKE_SOURCE_DIR}/src/components/utils/include/
-)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h moc_hmi_requests.cpp)
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h moc_request_to_sdl.cpp)
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h moc_qml_dbus.cpp)
- qt4_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h moc_sdl_proxy.cpp)
- qt4_use_modules(${target} Core DBus Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/hmi_requests.h moc_hmi_requests.cpp)
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/request_to_sdl.h moc_request_to_sdl.cpp)
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/qml_dbus.h moc_qml_dbus.cpp)
- qt5_generate_moc(${CMAKE_CURRENT_BINARY_DIR}/sdl_proxy.h moc_sdl_proxy.cpp)
- qt5_use_modules(${target} Core DBus Qml)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
-target_link_libraries(${target} Utils)
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.dbus_adapter 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null || true
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
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
deleted file mode 100644
index 60f07783a9..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * \file dbus_controller.cpp
- * \brief DbusController class.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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_controller.h"
-#include "interfaces/QT_HMI_API.h"
-#include <QtDBus/QDBusConnection>
-
-DBusController::DBusController(QObject* parent)
- : QObject(parent), message(NULL) {}
-
-void DBusController::addMessage(const QDBusMessage& message,
- fillRoutine fill,
- int async_uid) {
- delayedReply reply;
- reply.message = message;
- reply.fill = fill;
- replies_[async_uid] = reply;
-}
-
-void DBusController::sendReply(QVariant asyncObject, QVariant data) {
- int uid = asyncObject.toMap()["__async_uid"].toInt();
- std::map<int, delayedReply>::iterator it = replies_.find(uid);
- if (it != replies_.end()) {
- QDBusMessage msg = it->second.message.createReply();
- if (!it->second.fill(msg, data.toMap())) {
- QDBusConnection::sessionBus().send(it->second.message.createErrorReply(
- QDBusError::InternalError,
- QString::number(hmi_apis::Common_Result::INVALID_DATA)));
- } else {
- QDBusConnection::sessionBus().send(msg);
- }
- replies_.erase(it);
- }
-}
-
-void DBusController::sendReply(QVariant data) {
- if (!message)
- return;
- QDBusMessage msg = message->createReply();
- if (!fill(msg, data.toMap())) {
- QDBusConnection::sessionBus().send(message->createErrorReply(
- QDBusError::InternalError,
- QString::number(hmi_apis::Common_Result::INVALID_DATA)));
- } else {
- QDBusConnection::sessionBus().send(msg);
- }
-}
-
-void DBusController::sendError(QVariant asyncObject,
- QVariant code,
- QVariant message) {
- int uid = asyncObject.toMap()["__async_uid"].toInt();
- std::map<int, delayedReply>::iterator it = replies_.find(uid);
- if (it != replies_.end()) {
- QDBusMessage msg = it->second.message.createErrorReply(code.toString(),
- message.toString());
- QDBusConnection::sessionBus().send(msg);
- replies_.erase(it);
- }
-}
-
-void DBusController::sendError(QVariant asyncObject, QVariant code) {
- sendError(asyncObject, code, QVariant(""));
-}
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
deleted file mode 100644
index 937bab5f90..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_controller.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * \file dbus_controller.h
- * \brief DbusController class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
-
-#include <QtDBus/QDBusMessage>
-#include <QtCore/QObject>
-#include <map>
-
-typedef bool (*fillRoutine)(QDBusMessage&, const QVariantMap&);
-
-class DBusController : public QObject {
- struct delayedReply {
- QDBusMessage message;
- fillRoutine fill;
- };
- Q_OBJECT
-
- public:
- explicit DBusController(QObject* parent = 0);
- void addMessage(const QDBusMessage& message, fillRoutine fill, int async_uid);
- Q_INVOKABLE void sendReply(QVariant asyncObject, QVariant data);
- Q_INVOKABLE void sendReply(QVariant data);
- Q_INVOKABLE void sendError(QVariant asyncObject, QVariant code);
- Q_INVOKABLE void sendError(QVariant asyncObject,
- QVariant code,
- QVariant message);
- const QDBusMessage* message;
- fillRoutine fill;
-
- private:
- std::map<int, delayedReply> replies_;
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_CONTROLLER_H_
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
deleted file mode 100644
index 5cc4dadb1e..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * \file dbus_plugin.cpp
- * \brief DbusPlugin class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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_plugin.h"
-
-#include "hmi_proxy.h"
-#include "sdl_proxy.h"
-#include "optional_argument.h"
-#include "qml_dbus.h"
-#include "dbus_controller.h"
-#include "request_to_sdl.h"
-
-#include <log4cxx/logger.h>
-#include <log4cxx/propertyconfigurator.h>
-
-#include <QtCore/QString>
-#include <QtDBus/QDBusConnection>
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeContext>
-#include <QtDeclarative/QDeclarativeListReference>
-#include <QtDeclarative/QDeclarativeEngine>
-#elif QT_5
-#include <QtQml/QQmlContext>
-#include <QtQml/QQmlListReference>
-#include <QtQml/QQmlEngine>
-#endif // QT_VERSION
-log4cxx::LoggerPtr logger_ =
- log4cxx::LoggerPtr(log4cxx::Logger::getLogger("DBusPlugin"));
-
-void DbusPlugin::registerTypes(const char* uri) {
- log4cxx::PropertyConfigurator::configure("log4cxx.properties");
-
- // @uri sdl.core.api
- qmlRegisterType<HmiProxy>(uri, 1, 0, "HMIAdapter");
- qmlRegisterType<SdlProxy>(uri, 1, 0, "SDLAdapter");
-
- RegisterDbusMetatypes();
- qDBusRegisterMetaType<OptionalArgument<int> >();
- qDBusRegisterMetaType<OptionalArgument<QList<int> > >();
- qDBusRegisterMetaType<OptionalArgument<QString> >();
- qDBusRegisterMetaType<OptionalArgument<QStringList> >();
- qDBusRegisterMetaType<OptionalArgument<bool> >();
- qDBusRegisterMetaType<OptionalArgument<QList<bool> > >();
- qDBusRegisterMetaType<OptionalArgument<double> >();
- qDBusRegisterMetaType<OptionalArgument<QList<double> > >();
-
- HmiProxy::api_adaptors_.Init(this);
-
- QDBusConnection::sessionBus().registerObject("/", this);
- QDBusConnection::sessionBus().registerService("com.ford.sdl.hmi");
-
- dbusController_ = new DBusController();
- requestToSDL_ = new RequestToSDL();
-
- HmiProxy::api_adaptors_.SetDBusController(dbusController_);
-}
-
-void DbusPlugin::initializeEngine(Engine* engine, const char* uri) {
- engine->rootContext()->setContextProperty("DBus", dbusController_);
- engine->rootContext()->setContextProperty("RequestToSDL", requestToSDL_);
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(DbusAdapter, DbusPlugin)
-#endif // QT_4
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
deleted file mode 100644
index 2b5bba6235..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/dbus_plugin.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * \file dbus_plugin.h
- * \brief DbusPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-typedef QDeclarativeEngine Engine;
-#elif QT_5
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-typedef QQmlEngine Engine;
-#endif // QT_VERSION
-#include <QtDBus/QDBusContext>
-
-class DBusController;
-class RequestToSDL;
-
-class DbusPlugin : public ExtensionPlugin, public QDBusContext {
- Q_OBJECT
-
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- DBusController* dbusController_;
- RequestToSDL* requestToSDL_;
-
- public:
- void registerTypes(const char* uri);
- void initializeEngine(Engine* engine, const char* uri);
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_DBUS_PLUGIN_H_
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
deleted file mode 100644
index e196e5c5de..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * \file hmiproxy.cpp
- * \brief HmiProxy class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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_proxy.h"
-#include <QtDBus/QDBusConnection>
-
-ApiAdaptors HmiProxy::api_adaptors_;
-
-HmiProxy::HmiProxy(Item* parent) : Item(parent) {}
-
-void HmiProxy::componentComplete() {
- Item::componentComplete();
- api_adaptors_.SetApi(this);
-}
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
deleted file mode 100644
index d7277d017b..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/hmi_proxy.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * \file hmiproxy.h
- * \brief HmiProxy class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
-
-#include "qt_version.h"
-#include "qml_dbus.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeItem>
-typedef QDeclarativeItem Item;
-#elif QT_5
-#include <QtQuick/QQuickItem>
-typedef QQuickItem Item;
-#endif // QT_VERSION
-
-class HmiProxy : public Item {
- Q_OBJECT
- Q_DISABLE_COPY(HmiProxy)
-
- public:
- explicit HmiProxy(Item* parent = 0);
- static ApiAdaptors api_adaptors_;
-
- protected:
- virtual void componentComplete();
-};
-
-QML_DECLARE_TYPE(HmiProxy)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_HMI_PROXY_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h b/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
deleted file mode 100644
index b127cea1a8..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/metatype.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
-
-#include <QMetaType>
-
-template <typename T>
-QMetaType::Type metatype();
-
-template <>
-inline QMetaType::Type metatype<int>() {
- return QMetaType::Int;
-}
-
-template <>
-inline QMetaType::Type metatype<QString>() {
- return QMetaType::QString;
-}
-
-template <>
-inline QMetaType::Type metatype<bool>() {
- return QMetaType::Bool;
-}
-
-template <>
-inline QMetaType::Type metatype<double>() {
- return QMetaType::Double;
-}
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_METATYPE_H_
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
deleted file mode 100644
index ea6f68bb31..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/optional_argument.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * \file optional_argument.h
- * \brief OptionalArgument struct header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
-
-#include "qt_version.h"
-#include <QtDBus/QDBusArgument>
-
-template <class T>
-struct OptionalArgument {
- T val;
- bool presence;
- explicit OptionalArgument(const T& value) : val(value), presence(true) {}
- OptionalArgument() : presence(false) {}
-};
-
-template <class T>
-inline QDBusArgument& operator<<(QDBusArgument& arg,
- const OptionalArgument<T>& o) {
- arg.beginStructure();
- arg << o.presence << o.val;
- arg.endStructure();
- return arg;
-}
-
-template <class T>
-inline const QDBusArgument& operator>>(const QDBusArgument& arg,
- OptionalArgument<T>& o) {
- arg.beginStructure();
- arg >> o.presence >> o.val;
- arg.endStructure();
- return arg;
-}
-
-template <class T>
-inline bool VariantToValue(const QVariant& variant, OptionalArgument<T>& o) {
- if (variant.isNull()) {
- o.presence = false;
- return true;
- }
- o.presence = true;
- return VariantToValue(variant, o.val);
-}
-
-#if QT_4
-Q_DECLARE_METATYPE(QList<int>)
-#endif // QT_4
-
-Q_DECLARE_METATYPE(OptionalArgument<int>)
-Q_DECLARE_METATYPE(OptionalArgument<QString>)
-Q_DECLARE_METATYPE(OptionalArgument<bool>)
-Q_DECLARE_METATYPE(OptionalArgument<double>)
-
-Q_DECLARE_METATYPE(OptionalArgument<QList<int> >)
-Q_DECLARE_METATYPE(OptionalArgument<QStringList>)
-Q_DECLARE_METATYPE(OptionalArgument<QList<bool> >)
-Q_DECLARE_METATYPE(OptionalArgument<QList<double> >)
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_OPTIONAL_ARGUMENT_H_
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
deleted file mode 100644
index fa9692f9d9..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qml_dbus_common.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * \file qml_dbus_common.h
- * \brief Contain utilities for DBus plugin.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
-
-#include <QtDBus/QDBusContext>
-#include "optional_argument.h"
-#include "stream_qvariant.h"
-#include "metatype.h"
-
-enum ErrorCode {
- Success = 0,
- UnsupportedRequest,
- UnsupportedResource,
- Disallowed,
- Rejected,
- Aborted,
- Ignored,
- Retry,
- InUse,
- DataNotAvailable,
- TimedOut,
- InvalidData,
- CharLimitExceeded,
- InvalidId,
- DuplicateName,
- ApplicationNotRegistered,
- WrongLanguage,
- OutOfMemory,
- TooManyPendingRequests,
- NoAppsRegistered,
- NoDevicesConnected,
- Warnings,
- GenericError,
- UserDisallowed
-};
-
-inline void RaiseDbusError(QObject* adaptor, int code, const QString& message) {
- QDBusContext* context = dynamic_cast<QDBusContext*>(adaptor->parent());
- if (context) {
- context->sendErrorReply(QString::number(static_cast<int>(code)), message);
- }
-}
-
-inline void RaiseDbusError(QObject* adaptor, int code) {
- RaiseDbusError(adaptor, code, "");
-}
-
-template <typename T>
-inline void PutArgToMap(QVariantMap& map, const char* name, const T& v) {
- map.insert(name, QVariant::fromValue(v));
-}
-
-inline bool GetArgFromMap(const QVariantMap& map, const char* name, int& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (it->type() != QVariant::Int)
- return false;
- v = it->toInt();
- return true;
-}
-
-inline bool GetArgFromMap(const QVariantMap& map,
- const char* name,
- QString& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (it->type() != QVariant::String)
- return false;
- v = it->toString();
- return true;
-}
-
-inline bool GetArgFromMap(const QVariantMap& map, const char* name, bool& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (it->type() != QVariant::Bool)
- return false;
- v = it->toBool();
- return true;
-}
-
-inline bool isNumber(QVariant v) {
- QVariant::Type t = v.type();
- return (t == QVariant::Double) || (t == QVariant::Int) ||
- (t == QVariant::UInt) || (t == QVariant::LongLong) ||
- (t == QVariant::ULongLong);
-}
-
-inline bool GetArgFromMap(const QVariantMap& map, const char* name, double& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- if (!isNumber(*it))
- return false;
- v = it->toDouble();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, int& v) {
- if (variant.type() != QVariant::Int)
- return false;
- v = variant.toInt();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, QString& v) {
- if (variant.type() != QVariant::String)
- return false;
- v = variant.toString();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, bool& v) {
- if (variant.type() != QVariant::Bool)
- return false;
- v = variant.toBool();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, double& v) {
- if (variant.type() != QVariant::Double)
- return false;
- v = variant.toDouble();
- return true;
-}
-
-inline bool VariantToValue(const QVariant& variant, QStringList& v) {
- if (variant.type() != QVariant::List)
- return false;
- QList<QVariant> list = variant.toList();
- for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
- if (i->type() != QVariant::String)
- return false;
- v.append(i->toString());
- }
- return true;
-}
-
-template <typename T>
-bool VariantToValue(const QVariant& variant, QList<T>& v) {
- if (variant.type() != QVariant::List)
- return false;
- QList<T> spare;
- QList<QVariant> list = variant.toList();
- for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
- QVariant::Type type = i->type();
- // Although this function is declared as returning QVariant::Type(obsolete),
- // the return value should be interpreted as QMetaType::Type.
- // (http://qt-project.org/doc/qt-5.0/qtcore/qvariant.html#type)
- QMetaType::Type type_casted = static_cast<QMetaType::Type>(type);
- if (type_casted != metatype<T>()) {
- return false;
- }
- spare.append(i->value<T>());
- }
- v.swap(spare);
- return true;
-}
-
-template <typename T>
-inline QVariant ValueToVariant(const T& v) {
- return QVariant::fromValue(v);
-}
-
-template <typename T>
-inline QVariant ValueToVariant(const QList<T>& v) {
- QList<QVariant> list;
- for (typename QList<T>::const_iterator i = v.begin(); i != v.end(); ++i)
- list.append(ValueToVariant(*i));
- return QVariant::fromValue(list);
-}
-
-template <typename T>
-inline void PutArgToMap(QVariantMap& map, const char* name, const QList<T>& v) {
- QList<QVariant> list;
- for (typename QList<T>::const_iterator i = v.begin(); i != v.end(); ++i)
- list.append(ValueToVariant(*i));
- map.insert(name, QVariant::fromValue(list));
-}
-
-template <typename T>
-inline bool GetArgFromMap(const QVariantMap& map,
- const char* name,
- QList<T>& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it)
- return false;
- const QVariant& variant = *it;
- if (variant.type() != QVariant::List)
- return false;
- QList<QVariant> list = variant.toList();
- for (QList<QVariant>::const_iterator i = list.begin(); i != list.end(); ++i) {
- T t;
- bool ok = VariantToValue(*i, t);
- if (!ok)
- return false;
- v.append(t);
- }
- return true;
-}
-
-template <typename T>
-inline void PutArgToMap(QVariantMap& map,
- const char* name,
- const OptionalArgument<T>& v) {
- if (v.presence)
- map.insert(name, ValueToVariant(v.val));
-}
-
-template <typename T>
-inline bool GetArgFromMap(const QVariantMap& map,
- const char* name,
- OptionalArgument<T>& v) {
- QVariantMap::const_iterator it = map.find(name);
- if (map.end() == it || !it->isValid()) {
- v.presence = false;
- return true;
- }
- v.presence = true;
- return GetArgFromMap(map, name, v.val);
-}
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QML_DBUS_COMMON_H_
diff --git a/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir b/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir
deleted file mode 100644
index 5f426d357d..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdl.hmi.dbus_adapter
-plugin DbusAdapter
-
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
deleted file mode 100644
index c41eea7403..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/qt_version.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * @file qt_version.h
- * @brief Defines for check Qt version.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_QT_VERSION_H_
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
deleted file mode 100644
index ec049b9533..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "stream_qvariant.h"
-
-std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os,
- const QVariant& value) {
- switch (value.type()) {
- case QVariant::Map: {
- os << "{ ";
- QVariantMap structure = value.toMap();
- QMapIterator<QString, QVariant> i(structure);
- while (i.hasNext()) {
- i.next();
- os << i.key() << ":" << i.value();
- if (i.hasNext()) {
- os << ", ";
- }
- }
- os << " }";
- } break;
- case QVariant::List: {
- os << "[ ";
- QVariantList array = value.toList();
- QListIterator<QVariant> i(array);
- while (i.hasNext()) {
- os << i.next();
- if (i.hasNext()) {
- os << ", ";
- }
- }
- os << " ]";
- } break;
- default:
- os << value.toString().toLatin1().data();
- }
-
- return os;
-}
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
deleted file mode 100644
index 0d0e279b87..0000000000
--- a/src/components/qt_hmi/qml_plugins/dbus_adapter/stream_qvariant.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
-
-#include <QtCore/QVariant>
-#include <sstream>
-
-std::basic_ostream<char>& operator<<(std::basic_ostream<char>& os,
- const QVariant& value);
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_DBUS_ADAPTER_STREAM_QVARIANT_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt
deleted file mode 100644
index 56a64b48b3..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/CMakeLists.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(target HWButtons)
-set(destination com/ford/sdl/hmi/hw_buttons)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES
- attributed_mouse_event.cc
- hmi_hwbuttons.cc
- masked_container.cc
-)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_use_modules(${target} Core Gui Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_use_modules(${target} Core Qml Quick)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.hw_buttons 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
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
deleted file mode 100644
index 899fc5b615..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * \file attributed_mouse_event.cpp
- * \brief AttributedMouseEvent class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "attributed_mouse_event.h"
-
-Item* AttributedMouseEvent::item() const {
- return item_;
-}
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
deleted file mode 100644
index 0486397058..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/attributed_mouse_event.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * \file attributed_mouse_event.h
- * \brief AttributedMouseEvent class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
-
-#include "qt_version.h"
-
-#include <QtCore/QObject>
-#if QT_4
-#include <QtDeclarative/QDeclarativeItem>
-typedef QDeclarativeItem Item;
-#elif QT_5
-#include <QtQuick/QQuickItem>
-typedef QQuickItem Item;
-#endif // QT_VERSION
-
-class AttributedMouseEvent : public QObject {
- Q_OBJECT
- Q_PROPERTY(Item* item READ item)
-
- public:
- explicit AttributedMouseEvent(Item* item) : item_(item) {}
-
- Item* item() const;
-
- private:
- Item* item_;
- Q_DISABLE_COPY(AttributedMouseEvent)
-};
-
-QML_DECLARE_TYPE(AttributedMouseEvent)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_ATTRIBUTED_MOUSE_EVENT_H_
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
deleted file mode 100644
index 62a090a509..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * \file hmi_hwbuttons.cpp
- * \brief HmiHWButtons class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 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_hwbuttons.h"
-
-#if QT_4
-#include <QtDeclarative/qdeclarative.h>
-#include <QtGui/QGraphicsColorizeEffect>
-#elif QT_5
-#include <QtQml>
-#endif // QT_VERSION
-
-#include "masked_container.h"
-#include "attributed_mouse_event.h"
-
-void HmiHWButtons::registerTypes(const char* uri) {
- // @uri com.ford.hmi_framework
- qmlRegisterType<MaskedContainer>(uri, 1, 0, "MaskedContainer");
- qmlRegisterType<AttributedMouseEvent>();
-#if QT_4
- qmlRegisterType<QGraphicsColorizeEffect>(uri, 1, 0, "Colorize");
-#endif // QT_4
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(HWButtons, HmiHWButtons)
-#endif // QT_4
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
deleted file mode 100644
index 0cf71807c4..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/hmi_hwbuttons.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * \file hmi_hwbuttons.h
- * \brief HmiHWButtons class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-#elif QT_5
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-#endif // QT_VERSION
-
-class HmiHWButtons : public ExtensionPlugin {
- Q_OBJECT
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- public:
- void registerTypes(const char* uri);
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_HMI_HWBUTTONS_H_
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
deleted file mode 100644
index f80e80907e..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * \file masked_container.cpp
- * \brief MaskedContainer class source file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "masked_container.h"
-
-#if QT_4
-#include <QtCore/QPointF>
-#include <QtGui/QGraphicsSceneMouseEvent>
-#define IMAGE "QDeclarativeImage"
-#elif QT_5
-#include <QtGui/QImage>
-#include <QtCore/QEvent>
-#define IMAGE "QQuickImage"
-#endif // QT_VERSION
-
-MaskedContainer::MaskedContainer(Item* parent) : Item(parent), mask_(NULL) {
- setAcceptedMouseButtons(Qt::LeftButton);
-}
-
-void MaskedContainer::componentComplete() {
- Item::componentComplete();
-
- for (QObjectList::ConstIterator it = children().begin();
- it != children().end();
- ++it) {
- Item* item = qobject_cast<Item*>(*it);
- if (item && item->inherits(IMAGE) && item->isVisible()) {
- images_.push_back(item);
- }
- }
-
- int height = this->height();
- int width = this->width();
-
- for (size_t i = 0; i < images_.size(); ++i) {
- Item* item = images_[i];
- int itemWidth = item->width();
- int itemHeight = item->height();
- int itemX = item->x();
- int itemY = item->y();
- if (height < itemHeight + itemY)
- height = itemHeight + itemY;
- if (width < itemWidth + itemX)
- width = itemWidth + itemX;
- }
-
- setHeight(height);
- setWidth(width);
-
- mask_ = new int[height * width];
- std::fill(mask_, mask_ + height * width, -1);
-
- for (size_t i = 0; i < images_.size(); ++i) {
- Item* item = images_[i];
- int itemWidth = item->width();
- int itemHeight = item->height();
- int itemX = item->x();
- int itemY = item->y();
-
- QUrl url = item->property("source").toUrl();
- QImage img(url.path());
- const QRgb* bits = reinterpret_cast<const QRgb*>(img.constBits());
- for (int x = 0; x < itemWidth; ++x) {
- for (int y = 0; y < itemHeight; ++y) {
- if (qAlpha(bits[y * itemWidth + x]) > 128) {
- mask_[(itemY + y) * width + (x + itemX)] = i;
- }
- }
- }
- }
-}
-
-void MaskedContainer::mousePressEvent(MouseEvent* mouse) {
-#if QT_4
- qreal x = mouse->pos().x();
- qreal y = mouse->pos().y();
-#elif QT_5
- int x = mouse->x();
- int y = mouse->y();
-#endif // QT_VERSION
-
- if (width() * y + x > width() * height()) {
- mouse->ignore();
- } else {
- int idx = mask_[indexOfMask(x, y)];
- if (idx >= 0) {
- AttributedMouseEvent ev(images_[idx]);
- emit pressed(&ev);
- grabMouse();
- mouse->accept();
- } else {
- mouse->ignore();
- }
- }
-}
-
-void MaskedContainer::mouseReleaseEvent(MouseEvent* mouse) {
-#if QT_4
- qreal x = mouse->pos().x();
- qreal y = mouse->pos().y();
-#elif QT_5
- int x = mouse->x();
- int y = mouse->y();
-#endif // QT_VERSION
-
- if (width() * y + x > width() * height()) {
- return;
- } else {
- int idx = mask_[indexOfMask(x, y)];
- if (idx >= 0) {
- AttributedMouseEvent ev(images_[idx]);
- emit released(&ev);
- } else {
- emit released(NULL);
- }
- }
- ungrabMouse();
-}
-
-MaskedContainer::~MaskedContainer() {
- delete[] mask_;
-}
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
deleted file mode 100644
index ae5303a693..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/masked_container.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * \file masked_container.h
- * \brief MaskedContainer class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
-
-#include <vector>
-#include <QtCore/QString>
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeItem>
-typedef QDeclarativeItem Item;
-typedef QGraphicsSceneMouseEvent MouseEvent;
-#elif QT_5
-#include <QtQuick/QQuickItem>
-typedef QQuickItem Item;
-typedef QMouseEvent MouseEvent;
-#endif
-
-#include "attributed_mouse_event.h"
-
-class MaskedContainer : public Item {
- Q_OBJECT
- Q_DISABLE_COPY(MaskedContainer)
-
- public:
- explicit MaskedContainer(Item* parent = 0);
- ~MaskedContainer();
-
-signals:
- void pressed(AttributedMouseEvent* attr);
- void released(AttributedMouseEvent* attr);
-
- protected:
- virtual void componentComplete();
- virtual void mousePressEvent(MouseEvent* event);
- virtual void mouseReleaseEvent(MouseEvent* event);
-
- private:
- std::vector<Item*> images_;
- int* mask_;
-
-#if QT_4
- int indexOfMask(qreal x, qreal y) const {
- return static_cast<int>(y * width() + x);
- }
-#elif QT_5
- int indexOfMask(int x, int y) const {
- return y * static_cast<int>(width()) + x;
- }
-#endif // QT_VERSION
-};
-
-QML_DECLARE_TYPE(MaskedContainer)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_MASKED_CONTAINER_H_
diff --git a/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir b/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir
deleted file mode 100644
index a4bae8144b..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdl.hmi.hw_buttons
-plugin HWButtons
-
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
deleted file mode 100644
index a700a87919..0000000000
--- a/src/components/qt_hmi/qml_plugins/hw_buttons/qt_version.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * @file qt_version.h
- * @brief Defines for check Qt version.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_HW_BUTTONS_QT_VERSION_H_
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt
deleted file mode 100644
index 1a5baadaa9..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/CMakeLists.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(target QmlLog4cxx)
-set(destination com/ford/sdl/hmi/log4cxx)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-include_directories(
- ${LOG4CXX_INCLUDE_DIRECTORY}
-)
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES log4cxx_plugin.cc)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_use_modules(${target} Core Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_use_modules(${target} Core Qml)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND LD_LIBRARY_PATH=${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.log4cxx 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
deleted file mode 100644
index 8b7efe23d7..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * @file log4cxx_plugin.cpp
- * @brief Log4cxxPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "log4cxx_plugin.h"
-
-#include <log4cxx/log4cxx.h>
-#include <log4cxx/propertyconfigurator.h>
-
-log4cxx::LoggerPtr logger_ =
- log4cxx::LoggerPtr(log4cxx::Logger::getLogger("Log4cxxPlugin"));
-
-#if QT_4
-void smartLogger(QtMsgType type, const char* msg) {
- log4cxx::spi::LocationInfo location("", "", -1);
-
- switch (type) {
- case QtDebugMsg:
- (*logger_).debug(msg, location);
- break;
- case QtWarningMsg:
- (*logger_).warn(msg, location);
- break;
- case QtCriticalMsg:
- (*logger_).error(msg, location);
- break;
- case QtFatalMsg:
- (*logger_).fatal(msg, location);
- break;
- default:
- (*logger_).info(msg, location);
- break;
- }
-}
-#elif QT_5
-void smartLogger(QtMsgType type,
- const QMessageLogContext& context,
- const QString& msg) {
- log4cxx::spi::LocationInfo location(
- context.file, context.function ? context.function : "", context.line);
- switch (type) {
- case QtDebugMsg:
- (*logger_).debug(msg.toStdString(), location);
- break;
- case QtWarningMsg:
- (*logger_).warn(msg.toStdString(), location);
- break;
- case QtCriticalMsg:
- (*logger_).error(msg.toStdString(), location);
- break;
- case QtFatalMsg:
- (*logger_).fatal(msg.toStdString(), location);
- break;
- default:
- (*logger_).info(msg.toStdString(), location);
- break;
- }
-}
-#endif // QT_VERSION
-
-void Log4cxxPlugin::registerTypes(const char* uri) {
- log4cxx::PropertyConfigurator::configure("log4cxx.properties");
-
-#if QT_4
- qInstallMsgHandler(smartLogger);
-#elif QT_5
- qInstallMessageHandler(smartLogger);
-#endif // QT_VERSION
-
- // @uri com.ford.sdl.hmi.log4cxx
- qmlRegisterType<Logger>(uri, 1, 0, "Logger");
- // Use standart console API Javascript
- // See Debugging QML Applications in Qt documentation
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(QmlLog4cxx, Log4cxxPlugin)
-#endif // QT_4
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h b/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
deleted file mode 100644
index e8d1ff3347..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/log4cxx_plugin.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * @file log4cxx_plugin.h
- * @brief Log4cxxPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#if QT_4
-#include <QtDeclarative/qdeclarative.h>
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-#elif QT_5
-#include <QtQml/qqml.h>
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-#endif // QT_VERSION
-
-class Logger : public QObject {
- Q_OBJECT
- Q_DISABLE_COPY(Logger)
-
- public:
- explicit Logger(QObject* parent = 0) : QObject(parent) {}
-};
-
-class Log4cxxPlugin : public ExtensionPlugin {
- Q_OBJECT
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- public:
- void registerTypes(const char* uri);
-};
-
-QML_DECLARE_TYPE(Logger)
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_LOG4CXX_LOG4CXX_PLUGIN_H_
diff --git a/src/components/qt_hmi/qml_plugins/log4cxx/qmldir b/src/components/qt_hmi/qml_plugins/log4cxx/qmldir
deleted file mode 100644
index ddd7bc99a5..0000000000
--- a/src/components/qt_hmi/qml_plugins/log4cxx/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module com.ford.sdl.hmi.log4cxx
-plugin QmlLog4cxx
-
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt
deleted file mode 100644
index e777e95263..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/CMakeLists.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright (c) 2013, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-cmake_minimum_required(VERSION 2.8.11)
-
-set(target NamedPipeNotifier)
-set(destination com/ford/sdl/hmi/named_pipe_notifier)
-set(install_destination bin/hmi/plugins/${destination})
-set(library_name ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-set(CMAKE_AUTOMOC ON)
-set(SOURCES
- named_pipe_notifier.cc
- named_pipe_notifier_plugin.cc
-)
-
-add_library(${target} SHARED ${SOURCES})
-
-if (${qt_version} MATCHES "4.8.5")
- qt4_use_modules(${target} Core Declarative)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt4/${destination})
-elseif (${qt_version} MATCHES "5.1.0")
- qt5_use_modules(${target} Core Qml)
- set(model_dir ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/)
- set(copy_destination ${CMAKE_CURRENT_BINARY_DIR}/../../qml_model_qt5/${destination})
-endif ()
-
-add_custom_target(copy_library_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/${library_name}
- ${copy_destination}
- DEPENDS ${target}
- COMMENT "Copying library ${library_name}")
-file(COPY qmldir DESTINATION ${copy_destination})
-
-install(TARGETS ${target}
- DESTINATION ${install_destination}
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
- GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
-)
-install(FILES qmldir DESTINATION ${install_destination})
-
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- add_custom_target(qmltypes_${target} ALL
- COMMAND ${qmlplugindump_binary} -nonrelocatable com.ford.sdl.hmi.named_pipe_notifier 1.0 ${model_dir} > ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes 2>/dev/null
- DEPENDS copy_library_${target}
- )
- add_custom_target(copy_qmltypes_${target} ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes
- ${copy_destination}
- DEPENDS qmltypes_${target}
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugins.qmltypes DESTINATION ${install_destination})
-endif ()
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
deleted file mode 100644
index 46b057dcca..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * @file named_pipe_notifier.cc
- * @brief NamedPipeNotifier class implementation file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <fcntl.h>
-#include <sys/select.h>
-#include <sys/stat.h>
-#include <errno.h>
-
-#include "named_pipe_notifier.h"
-
-void NamedPipeNotifier::run() {
- int fd = ::open(name_.toLocal8Bit().constData(), O_RDONLY);
- if (-1 == fd) { // if open() fails
- if ((errno != ENOENT) // we can only manage lack of pipe
- ||
- (-1 == ::mkfifo(name_.toLocal8Bit().constData(), 0666)) ||
- (-1 == (fd = ::open(name_.toLocal8Bit().constData(), O_RDONLY)))) {
- emit openFailed();
- return;
- }
- }
- ::fd_set readfds;
- FD_ZERO(&readfds);
- FD_SET(fd, &readfds);
- // this select() is supposed to block till pipe is empty
- if (::select(fd + 1, &readfds, 0, 0, 0) > 0) {
- emit readyRead();
- }
-}
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
deleted file mode 100644
index cdca06466f..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * \file named_pipe_notifier.h
- * \brief NamedPipeNotifier class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
-
-#include <QThread>
-
-class NamedPipeNotifier : public QThread {
- Q_OBJECT
- Q_PROPERTY(QString name READ name WRITE set_name NOTIFY nameChanged)
- QString name_;
-
- public:
- explicit NamedPipeNotifier(QObject* parent = 0) : QThread(parent) {}
-
- const QString& name() const {
- return name_;
- }
- void set_name(const QString& name) {
- if (name_ != name) {
- name_ = name;
- emit nameChanged();
- }
- }
-
- protected:
- virtual void run();
-
-signals:
- void nameChanged();
- void readyRead();
- void openFailed();
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_H_
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
deleted file mode 100644
index dacb11ad93..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * \file named_pipe_notifier_plugin.cc
- * \brief NamedPipeNotifierPlugin class implementation file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "named_pipe_notifier_plugin.h"
-
-#if QT_4
-#include <QtDeclarative/qdeclarative.h>
-#elif QT_5
-#include <QtQml/qqml.h>
-#endif // QT_VERSION
-
-#include "named_pipe_notifier.h"
-
-void NamedPipeNotifierPlugin::registerTypes(const char* uri) {
- // @uri com.ford.sdl.hmi.named_pipe_notifier
- qmlRegisterType<NamedPipeNotifier>(uri, 1, 0, "NamedPipeNotifier");
-}
-
-#if QT_4
-Q_EXPORT_PLUGIN2(NamedPipeNotifier, NamedPipeNotifierPlugin)
-#endif // QT_4
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
deleted file mode 100644
index 426df483a2..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/named_pipe_notifier_plugin.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * \file named_pipe_notifier_plugin.h
- * \brief NamedPipeNotifierPlugin class header file.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
-
-#include "qt_version.h"
-
-#if QT_4
-#include <QtDeclarative/QDeclarativeExtensionPlugin>
-typedef QDeclarativeExtensionPlugin ExtensionPlugin;
-#elif QT_5
-#include <QtQml/QQmlExtensionPlugin>
-typedef QQmlExtensionPlugin ExtensionPlugin;
-#endif // QT_5
-
-class NamedPipeNotifierPlugin : public ExtensionPlugin {
- Q_OBJECT
-
-#if QT_5
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
-#endif // QT_5
-
- public:
- void registerTypes(const char* uri);
-};
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_NAMED_PIPE_NOTIFIER_PLUGIN_H_
diff --git a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir b/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir
deleted file mode 100644
index 86ede716ee..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qmldir
+++ /dev/null
@@ -1,2 +0,0 @@
-module com.ford.sdl.hmi.named_pipe_notifier
-plugin NamedPipeNotifier
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
deleted file mode 100644
index 0e2456d732..0000000000
--- a/src/components/qt_hmi/qml_plugins/named_pipe_notifier/qt_version.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * @file qt_version.h
- * @brief Defines for check Qt version.
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
-#define SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
-
-#include <qglobal.h>
-
-#define QT_4 \
- ((QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)))
-
-#define QT_5 \
- ((QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) && \
- (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)))
-
-#endif // SRC_COMPONENTS_QT_HMI_QML_PLUGINS_NAMED_PIPE_NOTIFIER_QT_VERSION_H_
diff --git a/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST b/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST
deleted file mode 100644
index ab0a27b552..0000000000
--- a/src/components/qt_hmi/res/IVSU/PROPRIETARY_REQUEST
+++ /dev/null
@@ -1,2 +0,0 @@
-4Ezay^ק<yi'*';(*'-N)z:nx:Rǂi^^笴ǭO9$ySgږ爞ZDžYhږǜzۭקoj[nruZL
-w>^7k͆
diff --git a/src/components/qt_hmi/res/SPT.png b/src/components/qt_hmi/res/SPT.png
deleted file mode 100644
index efe0b43dc2..0000000000
--- a/src/components/qt_hmi/res/SPT.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/album_art.png b/src/components/qt_hmi/res/album_art.png
deleted file mode 100644
index 9000680276..0000000000
--- a/src/components/qt_hmi/res/album_art.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/app_911_assist.png b/src/components/qt_hmi/res/app_911_assist.png
deleted file mode 100644
index dc7d3c6630..0000000000
--- a/src/components/qt_hmi/res/app_911_assist.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/app_vehicle_info.png b/src/components/qt_hmi/res/app_vehicle_info.png
deleted file mode 100644
index 1542c787db..0000000000
--- a/src/components/qt_hmi/res/app_vehicle_info.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/apps.png b/src/components/qt_hmi/res/apps.png
deleted file mode 100644
index 48d8284b2a..0000000000
--- a/src/components/qt_hmi/res/apps.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/arrow.png b/src/components/qt_hmi/res/arrow.png
deleted file mode 100644
index 4c215b2bf7..0000000000
--- a/src/components/qt_hmi/res/arrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/blue_ball.png b/src/components/qt_hmi/res/blue_ball.png
deleted file mode 100644
index d4db3f96ae..0000000000
--- a/src/components/qt_hmi/res/blue_ball.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/long_oval_btn.png b/src/components/qt_hmi/res/buttons/long_oval_btn.png
deleted file mode 100644
index 375195bec3..0000000000
--- a/src/components/qt_hmi/res/buttons/long_oval_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png b/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png
deleted file mode 100644
index bd4ba813d5..0000000000
--- a/src/components/qt_hmi/res/buttons/long_oval_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/longest_oval_btn.png b/src/components/qt_hmi/res/buttons/longest_oval_btn.png
deleted file mode 100644
index 6ed0293aab..0000000000
--- a/src/components/qt_hmi/res/buttons/longest_oval_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png b/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png
deleted file mode 100644
index 73ee397da6..0000000000
--- a/src/components/qt_hmi/res/buttons/longest_oval_btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_bottom.png b/src/components/qt_hmi/res/buttons/oval_btn_bottom.png
deleted file mode 100644
index 4964b4787a..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_bottom.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_left.png b/src/components/qt_hmi/res/buttons/oval_btn_left.png
deleted file mode 100644
index 4818162a19..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_left.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png b/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png
deleted file mode 100644
index 29c47e189f..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_pressed_left.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png b/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png
deleted file mode 100644
index c7d7d53ab6..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_pressed_right.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_right.png b/src/components/qt_hmi/res/buttons/oval_btn_right.png
deleted file mode 100644
index d566ac8ca5..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_right.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/oval_btn_top.png b/src/components/qt_hmi/res/buttons/oval_btn_top.png
deleted file mode 100644
index 787e0990e2..0000000000
--- a/src/components/qt_hmi/res/buttons/oval_btn_top.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_next_btn.png b/src/components/qt_hmi/res/buttons/player_next_btn.png
deleted file mode 100644
index c432068d4a..0000000000
--- a/src/components/qt_hmi/res/buttons/player_next_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png
deleted file mode 100644
index aab3df8914..0000000000
--- a/src/components/qt_hmi/res/buttons/player_next_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_pause_btn.png b/src/components/qt_hmi/res/buttons/player_pause_btn.png
deleted file mode 100644
index a9443feb8b..0000000000
--- a/src/components/qt_hmi/res/buttons/player_pause_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png
deleted file mode 100644
index 9c409c8f17..0000000000
--- a/src/components/qt_hmi/res/buttons/player_pause_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_play_btn.png b/src/components/qt_hmi/res/buttons/player_play_btn.png
deleted file mode 100644
index f185e94461..0000000000
--- a/src/components/qt_hmi/res/buttons/player_play_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png
deleted file mode 100644
index ecbb4f2ef0..0000000000
--- a/src/components/qt_hmi/res/buttons/player_play_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_prev_btn.png b/src/components/qt_hmi/res/buttons/player_prev_btn.png
deleted file mode 100644
index acc2a71de3..0000000000
--- a/src/components/qt_hmi/res/buttons/player_prev_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png b/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png
deleted file mode 100644
index c6eefc09c9..0000000000
--- a/src/components/qt_hmi/res/buttons/player_prev_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/preset_btn.png b/src/components/qt_hmi/res/buttons/preset_btn.png
deleted file mode 100644
index 58c296a4e4..0000000000
--- a/src/components/qt_hmi/res/buttons/preset_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/preset_pressed_btn.png b/src/components/qt_hmi/res/buttons/preset_pressed_btn.png
deleted file mode 100644
index fd7606fbd6..0000000000
--- a/src/components/qt_hmi/res/buttons/preset_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/round_btn.png b/src/components/qt_hmi/res/buttons/round_btn.png
deleted file mode 100644
index 3add8dd21c..0000000000
--- a/src/components/qt_hmi/res/buttons/round_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/round_pressed_btn.png b/src/components/qt_hmi/res/buttons/round_pressed_btn.png
deleted file mode 100644
index b0f8863423..0000000000
--- a/src/components/qt_hmi/res/buttons/round_pressed_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/short_oval_btn.png b/src/components/qt_hmi/res/buttons/short_oval_btn.png
deleted file mode 100644
index 99f5e90c3d..0000000000
--- a/src/components/qt_hmi/res/buttons/short_oval_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png b/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png
deleted file mode 100644
index 6b8bc61d80..0000000000
--- a/src/components/qt_hmi/res/buttons/short_oval_btn_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/zoom.png b/src/components/qt_hmi/res/buttons/zoom.png
deleted file mode 100644
index 0df4d25109..0000000000
--- a/src/components/qt_hmi/res/buttons/zoom.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/buttons/zoom_pressed.png b/src/components/qt_hmi/res/buttons/zoom_pressed.png
deleted file mode 100644
index c67d2c7c55..0000000000
--- a/src/components/qt_hmi/res/buttons/zoom_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/car.png b/src/components/qt_hmi/res/car.png
deleted file mode 100644
index 18a21656d0..0000000000
--- a/src/components/qt_hmi/res/car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/change_devices.png b/src/components/qt_hmi/res/change_devices.png
deleted file mode 100644
index 24a43a0d32..0000000000
--- a/src/components/qt_hmi/res/change_devices.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/AC_off.png b/src/components/qt_hmi/res/climate/AC_off.png
deleted file mode 100644
index 8554ddfb4c..0000000000
--- a/src/components/qt_hmi/res/climate/AC_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/AC_on.png b/src/components/qt_hmi/res/climate/AC_on.png
deleted file mode 100644
index c549010d6b..0000000000
--- a/src/components/qt_hmi/res/climate/AC_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/climate_round_off_btn.png b/src/components/qt_hmi/res/climate/climate_round_off_btn.png
deleted file mode 100644
index 411f003938..0000000000
--- a/src/components/qt_hmi/res/climate/climate_round_off_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/climate_round_on_btn.png b/src/components/qt_hmi/res/climate/climate_round_on_btn.png
deleted file mode 100644
index 691f6e3bf8..0000000000
--- a/src/components/qt_hmi/res/climate/climate_round_on_btn.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/defrost_off.png b/src/components/qt_hmi/res/climate/defrost_off.png
deleted file mode 100644
index 22e384dbc0..0000000000
--- a/src/components/qt_hmi/res/climate/defrost_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/defrost_on.png b/src/components/qt_hmi/res/climate/defrost_on.png
deleted file mode 100644
index 9b0fc7aa43..0000000000
--- a/src/components/qt_hmi/res/climate/defrost_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/face_off.png b/src/components/qt_hmi/res/climate/face_off.png
deleted file mode 100644
index 72448d6aaf..0000000000
--- a/src/components/qt_hmi/res/climate/face_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/face_on.png b/src/components/qt_hmi/res/climate/face_on.png
deleted file mode 100644
index 4ed6089800..0000000000
--- a/src/components/qt_hmi/res/climate/face_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/feet_off.png b/src/components/qt_hmi/res/climate/feet_off.png
deleted file mode 100644
index bac7bc9cfb..0000000000
--- a/src/components/qt_hmi/res/climate/feet_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/feet_on.png b/src/components/qt_hmi/res/climate/feet_on.png
deleted file mode 100644
index 6d7a3b7a14..0000000000
--- a/src/components/qt_hmi/res/climate/feet_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/headed_dash_off.png b/src/components/qt_hmi/res/climate/headed_dash_off.png
deleted file mode 100644
index cf5168b559..0000000000
--- a/src/components/qt_hmi/res/climate/headed_dash_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/headed_dash_on.png b/src/components/qt_hmi/res/climate/headed_dash_on.png
deleted file mode 100644
index c46b690f7f..0000000000
--- a/src/components/qt_hmi/res/climate/headed_dash_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_seat_off.png b/src/components/qt_hmi/res/climate/heated_seat_off.png
deleted file mode 100644
index 11a32048c9..0000000000
--- a/src/components/qt_hmi/res/climate/heated_seat_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_seat_on.png b/src/components/qt_hmi/res/climate/heated_seat_on.png
deleted file mode 100644
index 8211eb79e5..0000000000
--- a/src/components/qt_hmi/res/climate/heated_seat_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_wheel_off.png b/src/components/qt_hmi/res/climate/heated_wheel_off.png
deleted file mode 100644
index 5956f5a3dc..0000000000
--- a/src/components/qt_hmi/res/climate/heated_wheel_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/climate/heated_wheel_on.png b/src/components/qt_hmi/res/climate/heated_wheel_on.png
deleted file mode 100644
index af3c2598da..0000000000
--- a/src/components/qt_hmi/res/climate/heated_wheel_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/DownButton.png b/src/components/qt_hmi/res/controlButtons/DownButton.png
deleted file mode 100644
index fd44c5438c..0000000000
--- a/src/components/qt_hmi/res/controlButtons/DownButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png b/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png
deleted file mode 100644
index 013672bbf9..0000000000
--- a/src/components/qt_hmi/res/controlButtons/DownButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/LeftButton.png b/src/components/qt_hmi/res/controlButtons/LeftButton.png
deleted file mode 100644
index e65dd5ce04..0000000000
--- a/src/components/qt_hmi/res/controlButtons/LeftButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png b/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png
deleted file mode 100644
index 8df2e136ef..0000000000
--- a/src/components/qt_hmi/res/controlButtons/LeftButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/OkButton.png b/src/components/qt_hmi/res/controlButtons/OkButton.png
deleted file mode 100644
index 9e82fe298b..0000000000
--- a/src/components/qt_hmi/res/controlButtons/OkButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png b/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png
deleted file mode 100644
index 478d9ef7e5..0000000000
--- a/src/components/qt_hmi/res/controlButtons/OkButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/RightButton.png b/src/components/qt_hmi/res/controlButtons/RightButton.png
deleted file mode 100644
index 24e0f50a88..0000000000
--- a/src/components/qt_hmi/res/controlButtons/RightButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png b/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png
deleted file mode 100644
index 9e70d8d729..0000000000
--- a/src/components/qt_hmi/res/controlButtons/RightButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/UpButton.png b/src/components/qt_hmi/res/controlButtons/UpButton.png
deleted file mode 100644
index 3547a7fc70..0000000000
--- a/src/components/qt_hmi/res/controlButtons/UpButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png b/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png
deleted file mode 100644
index 2cbcfbe679..0000000000
--- a/src/components/qt_hmi/res/controlButtons/UpButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png b/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png
deleted file mode 100644
index 041d49e7e9..0000000000
--- a/src/components/qt_hmi/res/controlButtons/backGroundControllButtons.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrButton.png b/src/components/qt_hmi/res/controlButtons/vrButton.png
deleted file mode 100644
index af09282dff..0000000000
--- a/src/components/qt_hmi/res/controlButtons/vrButton.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png b/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png
deleted file mode 100644
index 9206e42a95..0000000000
--- a/src/components/qt_hmi/res/controlButtons/vrButton_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/controlButtons/vrImage.png b/src/components/qt_hmi/res/controlButtons/vrImage.png
deleted file mode 100644
index 2f6bac2d9f..0000000000
--- a/src/components/qt_hmi/res/controlButtons/vrImage.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/find_apps.png b/src/components/qt_hmi/res/find_apps.png
deleted file mode 100644
index 55a9a28676..0000000000
--- a/src/components/qt_hmi/res/find_apps.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/gear.png b/src/components/qt_hmi/res/gear.png
deleted file mode 100644
index b1eeba091c..0000000000
--- a/src/components/qt_hmi/res/gear.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/hd_logo_off.png b/src/components/qt_hmi/res/hd_logo_off.png
deleted file mode 100644
index 80c9d58b46..0000000000
--- a/src/components/qt_hmi/res/hd_logo_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/hd_logo_on.png b/src/components/qt_hmi/res/hd_logo_on.png
deleted file mode 100644
index dfc3d4ccf1..0000000000
--- a/src/components/qt_hmi/res/hd_logo_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/initial.wav b/src/components/qt_hmi/res/initial.wav
deleted file mode 100644
index 61a549fbc6..0000000000
--- a/src/components/qt_hmi/res/initial.wav
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/install_apps.png b/src/components/qt_hmi/res/install_apps.png
deleted file mode 100644
index dc33c0965c..0000000000
--- a/src/components/qt_hmi/res/install_apps.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/compass.png b/src/components/qt_hmi/res/nav/compass.png
deleted file mode 100644
index 15c73ee878..0000000000
--- a/src/components/qt_hmi/res/nav/compass.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/current_street.png b/src/components/qt_hmi/res/nav/current_street.png
deleted file mode 100644
index e289c054ff..0000000000
--- a/src/components/qt_hmi/res/nav/current_street.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/delete_icon.png b/src/components/qt_hmi/res/nav/delete_icon.png
deleted file mode 100644
index 826b5faacf..0000000000
--- a/src/components/qt_hmi/res/nav/delete_icon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/delete_icon_black.png b/src/components/qt_hmi/res/nav/delete_icon_black.png
deleted file mode 100644
index 56e35c759b..0000000000
--- a/src/components/qt_hmi/res/nav/delete_icon_black.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/dest_icon.png b/src/components/qt_hmi/res/nav/dest_icon.png
deleted file mode 100644
index dadcfe25cf..0000000000
--- a/src/components/qt_hmi/res/nav/dest_icon.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/dest_icon_black.png b/src/components/qt_hmi/res/nav/dest_icon_black.png
deleted file mode 100644
index 75c99bc4aa..0000000000
--- a/src/components/qt_hmi/res/nav/dest_icon_black.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/map.png b/src/components/qt_hmi/res/nav/map.png
deleted file mode 100644
index 328bca44cf..0000000000
--- a/src/components/qt_hmi/res/nav/map.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/mute_off.png b/src/components/qt_hmi/res/nav/mute_off.png
deleted file mode 100644
index f7306d96ae..0000000000
--- a/src/components/qt_hmi/res/nav/mute_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/mute_on.png b/src/components/qt_hmi/res/nav/mute_on.png
deleted file mode 100644
index de2a2bb5bc..0000000000
--- a/src/components/qt_hmi/res/nav/mute_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options.png b/src/components/qt_hmi/res/nav/options.png
deleted file mode 100644
index 46887f1061..0000000000
--- a/src/components/qt_hmi/res/nav/options.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options_in_active.png b/src/components/qt_hmi/res/nav/options_in_active.png
deleted file mode 100644
index 601b242bbe..0000000000
--- a/src/components/qt_hmi/res/nav/options_in_active.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/options_pressed.png b/src/components/qt_hmi/res/nav/options_pressed.png
deleted file mode 100644
index 42c352a7e8..0000000000
--- a/src/components/qt_hmi/res/nav/options_pressed.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/nav/turnArrow.png b/src/components/qt_hmi/res/nav/turnArrow.png
deleted file mode 100644
index f37731f5af..0000000000
--- a/src/components/qt_hmi/res/nav/turnArrow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/notes.png b/src/components/qt_hmi/res/notes.png
deleted file mode 100644
index 8b4a92fffc..0000000000
--- a/src/components/qt_hmi/res/notes.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/contacts.png b/src/components/qt_hmi/res/phone/contacts.png
deleted file mode 100644
index a16d518ba8..0000000000
--- a/src/components/qt_hmi/res/phone/contacts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/dnd_off.png b/src/components/qt_hmi/res/phone/dnd_off.png
deleted file mode 100644
index 04bb2476c1..0000000000
--- a/src/components/qt_hmi/res/phone/dnd_off.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/dnd_on.png b/src/components/qt_hmi/res/phone/dnd_on.png
deleted file mode 100644
index 56b9fe7065..0000000000
--- a/src/components/qt_hmi/res/phone/dnd_on.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/keypad.png b/src/components/qt_hmi/res/phone/keypad.png
deleted file mode 100644
index 1792c8fac8..0000000000
--- a/src/components/qt_hmi/res/phone/keypad.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/messages.png b/src/components/qt_hmi/res/phone/messages.png
deleted file mode 100644
index b5cbb8e8af..0000000000
--- a/src/components/qt_hmi/res/phone/messages.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/more.png b/src/components/qt_hmi/res/phone/more.png
deleted file mode 100644
index 908ebf654e..0000000000
--- a/src/components/qt_hmi/res/phone/more.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/phone.png b/src/components/qt_hmi/res/phone/phone.png
deleted file mode 100644
index 346f36cc33..0000000000
--- a/src/components/qt_hmi/res/phone/phone.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/recent.png b/src/components/qt_hmi/res/phone/recent.png
deleted file mode 100644
index db54c2f16e..0000000000
--- a/src/components/qt_hmi/res/phone/recent.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/phone/texts.png b/src/components/qt_hmi/res/phone/texts.png
deleted file mode 100644
index 31c024b1df..0000000000
--- a/src/components/qt_hmi/res/phone/texts.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/snow.png b/src/components/qt_hmi/res/snow.png
deleted file mode 100644
index 54756bb2f6..0000000000
--- a/src/components/qt_hmi/res/snow.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/cal.png b/src/components/qt_hmi/res/vehicle/cal.png
deleted file mode 100644
index 94d5d44b5a..0000000000
--- a/src/components/qt_hmi/res/vehicle/cal.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/folders.png b/src/components/qt_hmi/res/vehicle/folders.png
deleted file mode 100644
index c5985043df..0000000000
--- a/src/components/qt_hmi/res/vehicle/folders.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/key_car.png b/src/components/qt_hmi/res/vehicle/key_car.png
deleted file mode 100644
index a8e5d9d66c..0000000000
--- a/src/components/qt_hmi/res/vehicle/key_car.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/vehicle/sun.png b/src/components/qt_hmi/res/vehicle/sun.png
deleted file mode 100644
index 6424d9d210..0000000000
--- a/src/components/qt_hmi/res/vehicle/sun.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/warning.png b/src/components/qt_hmi/res/warning.png
deleted file mode 100644
index c91cd31d34..0000000000
--- a/src/components/qt_hmi/res/warning.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/res/white_ball.png b/src/components/qt_hmi/res/white_ball.png
deleted file mode 100644
index 952714ebe6..0000000000
--- a/src/components/qt_hmi/res/white_ball.png
+++ /dev/null
Binary files differ
diff --git a/src/components/qt_hmi/test/CMakeLists.txt b/src/components/qt_hmi/test/CMakeLists.txt
deleted file mode 100644
index b0c48a4348..0000000000
--- a/src/components/qt_hmi/test/CMakeLists.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (c) 2014, Ford Motor Company
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# Redistributions of source code must retain the above copyright notice, this
-# list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright notice,
-# this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of the Ford Motor Company nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-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
deleted file mode 100644
index 0241549ca5..0000000000
--- a/src/components/qt_hmi/test/qt_hmi_test.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright (c) 2014, Ford Motor Company
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
- Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following
- disclaimer in the documentation and/or other materials provided with the
- distribution.
-
- Neither the name of the Ford Motor Company nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-#include <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
deleted file mode 100644
index e169a4eb87..0000000000
--- a/src/components/qt_hmi/test/readme.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-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
deleted file mode 100644
index e71fb66b11..0000000000
--- a/src/components/qt_hmi/test/src/tst_AddCommand.qml
+++ /dev/null
@@ -1,320 +0,0 @@
-/**
- * @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
deleted file mode 100644
index 7f9477cab1..0000000000
--- a/src/components/qt_hmi/test/src/tst_AddSubMenu.qml
+++ /dev/null
@@ -1,328 +0,0 @@
-/**
- * @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
deleted file mode 100644
index bf28be0282..0000000000
--- a/src/components/qt_hmi/test/src/tst_DeleteCommand.qml
+++ /dev/null
@@ -1,210 +0,0 @@
-/**
- * @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
deleted file mode 100644
index abf3105b1a..0000000000
--- a/src/components/qt_hmi/test/src/tst_ScrollableMessage.qml
+++ /dev/null
@@ -1,421 +0,0 @@
-/**
- * @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
deleted file mode 100644
index 212cdfc143..0000000000
--- a/src/components/qt_hmi/test/src/tst_SetMediaClockTimer.qml
+++ /dev/null
@@ -1,292 +0,0 @@
-/**
- * @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
deleted file mode 100644
index cce2e7de49..0000000000
--- a/src/components/qt_hmi/test/src/tst_Show.qml
+++ /dev/null
@@ -1,363 +0,0 @@
-/**
- * @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
deleted file mode 100644
index 0e6acef078..0000000000
--- a/src/components/qt_hmi/test/src/tst_Slider.qml
+++ /dev/null
@@ -1,204 +0,0 @@
-/**
- * @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/remote_control/CMakeLists.txt b/src/components/remote_control/CMakeLists.txt
new file mode 100644
index 0000000000..a320273a1e
--- /dev/null
+++ b/src/components/remote_control/CMakeLists.txt
@@ -0,0 +1,83 @@
+set(target "RemoteControlModule")
+set(install_destination ${CMAKE_BINARY_DIR}/bin/plugins)
+if (ENABLE_GCOV)
+ set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs")
+else()
+ set(GCOV_FLAGS "")
+endif()
+
+if (CMAKE_BUILD_TYPE)
+ if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
+ set(CMAKE_CXX_FLAGS_DEBUG "")
+ else ()
+ set(CMAKE_CXX_FLAGS_RELEASE "")
+ set(CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG")
+ endif()
+endif()
+
+include_directories (
+ ${COMPONENTS_DIR}/include/
+ ${COMPONENTS_DIR}/application_manager/include
+ ${COMPONENTS_DIR}/remote_control/include/
+ ${COMPONENTS_DIR}/connection_handler/include/
+ ${COMPONENTS_DIR}/protocol_handler/include/
+ ${COMPONENTS_DIR}/functional_module/include/
+ ${COMPONENTS_DIR}/config_profile/include/
+
+ ${COMPONENTS_DIR}/hmi_message_handler/include/
+ ${COMPONENTS_DIR}/formatters/include/
+ ${POLICY_PATH}/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
+ ${COMPONENTS_DIR}/rpc_base/include/
+ ${COMPONENTS_DIR}/application_manager/test/include/
+
+ ${COMPONENTS_DIR}/smart_objects/include/
+ ${COMPONENTS_DIR}/utils/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+)
+
+set (RC_SOURCE_DIR ${COMPONENTS_DIR}/remote_control/src)
+set (RC_TEST_DIR ${COMPONENTS_DIR}/remote_control/test)
+set (RC_COMMANDS_DIR ${RC_SOURCE_DIR}/commands)
+
+collect_sources(RC_SOURCES "${RC_SOURCE_DIR}")
+collect_sources(RC_COMMANDS_SOURCES "${RC_COMMANDS_DIR}")
+
+set (SOURCES
+ ${RC_SOURCES}
+ ${RC_COMMANDS_SOURCES}
+)
+
+set (LIBRARIES
+ jsoncpp
+ FunctionalModule
+ Utils
+ ConfigProfile
+)
+
+add_library(${target} SHARED ${SOURCES})
+target_link_libraries(${target} ${LIBRARIES} )
+
+if(ENABLE_LOG)
+ target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
+endif()
+
+
+install(TARGETS ${target}
+ DESTINATION ${install_destination}
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+
+install(
+ FILES ${FILES_FOR_COPY}
+ DESTINATION ${install_destination}
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
diff --git a/src/components/remote_control/include/remote_control/commands/base_command_notification.h b/src/components/remote_control/include/remote_control/commands/base_command_notification.h
new file mode 100644
index 0000000000..578afad67b
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/base_command_notification.h
@@ -0,0 +1,110 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_
+
+#include "remote_control/commands/command.h"
+#include "application_manager/message.h"
+#include "application_manager/service.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/remote_plugin_interface.h"
+#include "utils/logger.h"
+
+namespace Json {
+class Value;
+}
+
+namespace remote_control {
+
+namespace commands {
+
+/**
+ * @brief Base command class for notifications
+ */
+class BaseCommandNotification : public Command {
+ public:
+ /**
+ * @brief BaseCommandNotification class constructor
+ *
+ * @param message Message from mobile
+ **/
+ BaseCommandNotification(const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module);
+
+ /**
+ * @brief BaseCommandNotification class destructor
+ */
+ virtual ~BaseCommandNotification();
+
+ /**
+ * \brief BaseCommandNotification on timeout reaction
+ */
+ virtual void OnTimeout() {}
+
+ void Run();
+
+ protected:
+ application_manager::MessagePtr message() {
+ return message_;
+ }
+ application_manager::ServicePtr service_;
+
+ RCAppExtensionPtr GetAppExtension(
+ application_manager::ApplicationSharedPtr app) const;
+
+ /**
+ * @brief executes specific logic of children classes
+ */
+ virtual void Execute() = 0;
+
+ /**
+ * @brief Validates notification by xml schema
+ */
+ virtual bool Validate();
+
+ virtual std::string ModuleType(const Json::Value& message);
+ virtual std::vector<std::string> ControlData(const Json::Value& message);
+
+ void NotifyOneApplication(application_manager::MessagePtr message);
+
+ private:
+ void NotifyApplications();
+ bool CheckPolicy(application_manager::MessagePtr message);
+ application_manager::MessagePtr message_;
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_
diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h
new file mode 100644
index 0000000000..64128b971e
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h
@@ -0,0 +1,293 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_
+
+#include "remote_control/commands/command.h"
+#include "remote_control/event_engine/event_observer.h"
+#include "application_manager/message.h"
+#include "application_manager/service.h"
+#include "utils/logger.h"
+#include "interfaces/HMI_API.h"
+#include "remote_control/rc_app_extension.h"
+#include "json/json.h"
+#include "remote_control/remote_plugin_interface.h"
+
+namespace remote_control {
+
+namespace commands {
+
+// Forward declaration to make this struct friend to BaseCommandRequest
+struct OnDriverAnswerCallback;
+
+/**
+ * @brief Base command class for requests
+ */
+class BaseCommandRequest
+ : public Command,
+ public rc_event_engine::EventObserver<application_manager::MessagePtr,
+ std::string> {
+ public:
+ /**
+ * @brief BaseCommandRequest class constructor
+ *
+ * @param message Message from mobile
+ **/
+ BaseCommandRequest(const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module);
+
+ /**
+ * @brief BaseCommandRequest class destructor
+ */
+ virtual ~BaseCommandRequest();
+
+ /**
+ * @brief BaseCommandRequest on timeout reaction
+ */
+ virtual void OnTimeout();
+
+ void Run();
+ void on_event(const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event);
+
+ /**
+ * @brief Generates correct request to HMI
+ * @param function_id request ID
+ * @param msg_params json with message params
+ * @return generated request shared ptr
+ */
+ application_manager::MessagePtr CreateHmiRequest(
+ const char* function_id, const Json::Value& message_params);
+
+ /**
+ * @brief Prepares response for sending to mobile
+ * Adds necessary fields to message
+ * @param success true if successful; false, if failed
+ * @param result_code Mobile result code in string ("SUCCESS", "INVALID_DATA",
+ * e.t.c)
+ * @param info Provides additional human readable info regarding the
+ *result(may be empty)
+ */
+ void PrepareResponse(const bool success,
+ const char* result_code,
+ const std::string& info);
+
+ protected:
+ application_manager::MessagePtr message_;
+ Json::Value response_params_;
+
+ /**
+ * @brief AcquireResource try to allocate resource for application
+ * In case if allocation of resource is not required, return ALLOWED by
+ * default.
+ * This method should be overrided in RPCs that requires resource allocation
+ * @return result of resource allocation, in case if allocation os not
+ * required, return ALLOWED
+ */
+ virtual AcquireResult::eType AcquireResource(const Json::Value&) {
+ return AcquireResult::ALLOWED;
+ }
+
+ /**
+ * @brief IsResourceFree check resource state
+ * This is default implementation which has to be redefined for RPCs which
+ * need to manage the resources
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ virtual bool IsResourceFree(const std::string& module_type) const {
+ UNUSED(module_type);
+ return true;
+ }
+
+ /**
+ * @brief SetResourceState changes state of resource
+ * This is default implementation which has to be redefined for RPCs which
+ * need to manage the resources
+ * @param Message containing type of module to extract
+ * @param State to set for resource
+ */
+ virtual void SetResourceState(const Json::Value&,
+ const ResourceState::eType) {}
+
+ /**
+ * @brief Get extension for specified application. If extension doesn't exist,
+ * it will be created
+ * @param app pointer to application
+ * @return pointer to extension
+ */
+ RCAppExtensionPtr GetAppExtension(
+ application_manager::ApplicationSharedPtr app) const;
+
+ /**
+ * @brief Converts HMI result code to string with mobile result code
+ *
+ * @param hmi_code HMI result code
+ * @return String with mobile result code
+ */
+ const char* GetMobileResultCode(
+ const hmi_apis::Common_Result::eType& hmi_code) const;
+
+ /**
+ * @brief Sends Mobile response
+ * @param success true if successful; false, if failed
+ * @param result_code Mobile result code in string ("SUCCESS", "INVALID_DATA",
+ *e.t.c)
+ * @param info Provides additional human readable info regarding the
+ *result(may be empty)
+ */
+ void SendResponse(const bool success,
+ const char* result_code,
+ const std::string& info);
+
+ /**
+ * @brief Parse result code from response
+ *
+ * @param message Response from HMI or Can
+ * @param result_code Outgoing param with mobile result code in string
+ *("SUCCESS", "INVALID_DATA", e.t.c)
+ * @param info Outgoing param with additional human readable info regarding
+ *the result(may be empty)
+ * @return true if it is success response? otherwise false
+ */
+ bool ParseResultCode(const Json::Value& value,
+ std::string& result_code,
+ std::string& info);
+
+ /**
+ * @brief Sends request to HMI
+ * @param message_to_send to send
+ */
+ void SendMessageToHMI(const application_manager::MessagePtr& message_to_send);
+
+ /**
+ * @brief Sends request to CAN or HMI
+ * @param function_id request ID
+ * @param msg_params json with message params
+ */
+ void SendRequest(const char* function_id, const Json::Value& message_params);
+
+ application_manager::ApplicationSharedPtr app() {
+ DCHECK(app_);
+ return app_;
+ }
+
+ /**
+ * @brief executes specific logic of children classes
+ */
+ void virtual Execute() = 0;
+
+ /**
+ * @brief Validates request by xml schema
+ */
+ bool Validate();
+
+ /*
+ * @brief Parses incoming string into Json
+ * @param parsed_mgs Resulting json object (must be valid pointer)
+ * @returns True if json string was valid false otherwise.
+ */
+ virtual bool ParseJsonString(Json::Value* parsed_msg);
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ * @param event The received event
+ */
+ void virtual OnEvent(
+ const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event) = 0;
+
+ virtual std::string ModuleType(const Json::Value& message);
+ virtual std::vector<std::string> ControlData(const Json::Value& message);
+ virtual application_manager::TypeAccess CheckModule(
+ const Json::Value& message);
+
+ bool auto_allowed() const {
+ return auto_allowed_;
+ }
+
+ void set_auto_allowed(bool value) {
+ auto_allowed_ = value;
+ }
+
+ application_manager::ServicePtr service() {
+ return service_;
+ }
+
+ void set_disallowed_info(const std::string& info) {
+ disallowed_info_ = info;
+ }
+
+ private:
+ /**
+ * @brief CheckPolicyPermissions checks RPC permissions defined in policy
+ * table
+ * @return True if RPC is allowed, otherwise - false
+ */
+ bool CheckPolicyPermissions();
+
+ /**
+ * @brief CheckDriverConsent checks driver consent defined in policy table
+ * @return True if no consent is required, otherwise - false
+ */
+ bool CheckDriverConsent();
+
+ /**
+ * @brief AcquireResources checks whether resource status is busy or not and
+ * then tries to acquire this resource. In case driver consent is required -
+ * sends consent request to HMI.
+ * @return True in case of resource is free and successfully acquired,
+ * otherwise false
+ */
+ bool AcquireResources();
+ inline bool IsAutoAllowed(application_manager::TypeAccess access) const;
+ void SendDisallowed(application_manager::TypeAccess access);
+ void SendGetUserConsent(const Json::Value& value);
+ void ProcessAccessResponse(
+ const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event);
+
+ const Json::Value msg_json_;
+ application_manager::ApplicationSharedPtr app_;
+ application_manager::ServicePtr service_;
+ bool auto_allowed_;
+ std::string disallowed_info_;
+
+ friend struct OnDriverAnswerCallback;
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/commands/button_press_request.h b/src/components/remote_control/include/remote_control/commands/button_press_request.h
new file mode 100644
index 0000000000..945f98bdc8
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/button_press_request.h
@@ -0,0 +1,104 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_
+
+#include "remote_control/commands/base_command_request.h"
+#include "remote_control/event_engine/event.h"
+#include "utils/macro.h"
+
+namespace remote_control {
+
+namespace commands {
+
+/**
+ * @brief ButtonPressRequest command class
+ */
+class ButtonPressRequest : public BaseCommandRequest {
+ public:
+ /**
+ * @brief ButtonPressRequest class constructor
+ *
+ * @param message Message from mobile
+ **/
+ ButtonPressRequest(const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module);
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief AcquireResource Tries to acquire specific resource
+ * @param message Incoming message containg the resource name
+ * @return Acquire result
+ */
+ AcquireResult::eType AcquireResource(
+ const Json::Value& message) OVERRIDE FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ /**
+ * @brief SetResourceState changes state of resource
+ * @param state State to set for resource
+ */
+ void SetResourceState(const Json::Value& message,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void OnEvent(const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event);
+
+ /**
+ * @brief ButtonPressRequest class destructor
+ */
+ virtual ~ButtonPressRequest();
+
+ protected:
+ std::string ModuleType(const Json::Value& message) FINAL;
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/commands/command.h b/src/components/remote_control/include/remote_control/commands/command.h
new file mode 100644
index 0000000000..0e03f8b330
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/command.h
@@ -0,0 +1,84 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_
+
+#include "utils/shared_ptr.h"
+#include "remote_control/remote_plugin_interface.h"
+#include "remote_control/event_engine/event.h"
+
+namespace remote_control {
+
+class RemotePluginInterface;
+
+namespace commands {
+
+/**
+ * @brief Command interface
+ **/
+class Command {
+ public:
+ /**
+ * @brief Execute command
+ */
+ virtual void Run() = 0;
+
+ /**
+ * \brief Command class destructor
+ */
+ virtual ~Command() {}
+
+ /**
+ * \brief Command on timeout reaction
+ */
+ virtual void OnTimeout() = 0;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ * @param event The received event
+ */
+ virtual void on_event(
+ const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event) {}
+
+ protected:
+ Command(RemotePluginInterface& rc_module) : rc_module_(rc_module) {}
+
+ RemotePluginInterface& rc_module_;
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_
diff --git a/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..220f7da979
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h
@@ -0,0 +1,101 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "remote_control/commands/base_command_request.h"
+#include "remote_control/event_engine/event.h"
+#include "utils/macro.h"
+
+namespace remote_control {
+
+namespace commands {
+
+/**
+ * @brief GetInteriorVehicleDataRequest command class
+ */
+class GetInteriorVehicleDataRequest : public BaseCommandRequest {
+ public:
+ /**
+ * @brief GetInteriorVehicleDataRequest class constructor
+ *
+ * @param message Message from mobile
+ **/
+ explicit GetInteriorVehicleDataRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module);
+
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void OnEvent(const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event);
+
+ /**
+ * @brief Check if app wants to proceed with already setup subscription
+ * @param request_params request parameters to check
+ * @return true if app already subscribed(unsubsribed) for module type but
+ * wants to subscribe(unsubscribe) for the same module again
+ * otherwise - false
+ */
+ bool HasRequestExcessiveSubscription(const Json::Value& request_params);
+
+ protected:
+ virtual std::string ModuleType(const Json::Value& message);
+
+ private:
+ /**
+ * @brief Handle subscription to vehicle data
+ * @param hmi_response json message with response from HMI
+ */
+ void ProccessSubscription(const Json::Value& hmi_response);
+
+ /**
+ * @brief Cuts off subscribe parameter
+ * @param request_params request parameters to handle
+ */
+ void RemoveExcessiveSubscription(Json::Value& request_params);
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h
new file mode 100644
index 0000000000..4ee9ce4709
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
+
+#include "utils/macro.h"
+#include "remote_control/commands/base_command_notification.h"
+
+namespace remote_control {
+
+namespace commands {
+
+/**
+ * @brief OnInteriorVehicleDataNotification command class
+ */
+class OnInteriorVehicleDataNotification : public BaseCommandNotification {
+ public:
+ /**
+ * @brief OnInteriorVehicleDataNotification class constructor
+ *
+ * @param message Message with notification
+ **/
+ OnInteriorVehicleDataNotification(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module);
+
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief OnInteriorVehicleDataNotification class destructor
+ */
+ virtual ~OnInteriorVehicleDataNotification();
+
+ protected:
+ std::string ModuleType(const Json::Value& message) FINAL;
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_
diff --git a/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h b/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h
new file mode 100644
index 0000000000..ef248a2b38
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h
@@ -0,0 +1,79 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
+
+#include "utils/macro.h"
+#include "remote_control/commands/base_command_notification.h"
+
+namespace remote_control {
+
+namespace commands {
+
+/**
+ * @brief OnRemoteControlSettingsNotification command class
+ */
+class OnRemoteControlSettingsNotification : public BaseCommandNotification {
+ public:
+ /**
+ * @brief OnRemoteControlSettingsNotification class constructor
+ *
+ * @param message Message with notification
+ * @param rc_module Module used for handling RC functionality
+ **/
+ OnRemoteControlSettingsNotification(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module);
+
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ private:
+ /**
+ * @brief Disalows RC functionality for all RC apps
+ * All registered apps with appHMIType REMOTE_CONTROL will be put to NONE hmi
+ * level
+ * OnHMIStatus (NONE) will be send to such apps
+ * All registered apps will be unsubsribed from OnInteriorVehicleData
+ * notifications
+ */
+ void DisallowRCFunctionality();
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_
diff --git a/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h
new file mode 100644
index 0000000000..bc1e3942e5
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h
@@ -0,0 +1,127 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
+
+#include "remote_control/commands/base_command_request.h"
+#include "remote_control/event_engine/event.h"
+#include "utils/macro.h"
+
+namespace remote_control {
+
+namespace commands {
+
+/**
+ * @brief SetInteriorVehicleDataRequest command class
+ */
+class SetInteriorVehicleDataRequest : public BaseCommandRequest {
+ public:
+ /**
+ * @brief SetInteriorVehicleDataRequest class constructor
+ *
+ * @param message Message from mobile
+ * @param rc_module Module used for handling RC functionality
+ **/
+ SetInteriorVehicleDataRequest(const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module);
+
+ /**
+ * @brief Execute command
+ */
+ void Execute() FINAL;
+
+ /**
+ * @brief AcquireResource proxy AcquireResource to Resource allocation manager
+ * @param message message of requires contatin module types
+ * @return result of acauiring resources
+ */
+ AcquireResult::eType AcquireResource(
+ const Json::Value& message) OVERRIDE FINAL;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ /**
+ * @brief SetResourceState changes state of resource
+ * @param state State to set for resource
+ */
+ void SetResourceState(const Json::Value& message,
+ const ResourceState::eType state) FINAL;
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ void OnEvent(const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event) OVERRIDE;
+ /**
+ * @brief Method that check if READ_ONLY parameters present
+ * @param request_params params from received message
+ * @return true if present , false - otherwise
+ */
+ bool AreReadOnlyParamsPresent(const Json::Value& request_params);
+
+ /**
+ * @brief Method that check if all request parameters are READ_ONLY
+ * @param request_params params from received message
+ * @return true if all are read only , false - otherwise
+ */
+ bool AreAllParamsReadOnly(const Json::Value& request_params);
+
+ /**
+ * @brief Method that cuts-off READ_ONLY parameters
+ * @param request_params params to handle
+ */
+ void CutOffReadOnlyParams(Json::Value& request_params);
+
+ /**
+ * @brief SetInteriorVehicleDataRequest class destructor
+ */
+ virtual ~SetInteriorVehicleDataRequest();
+
+ protected:
+ virtual std::string ModuleType(const Json::Value& message) FINAL;
+ virtual std::vector<std::string> ControlData(
+ const Json::Value& message) FINAL;
+};
+
+} // namespace commands
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_
diff --git a/src/components/remote_control/include/remote_control/event_engine/event.h b/src/components/remote_control/include/remote_control/event_engine/event.h
new file mode 100644
index 0000000000..0da248e5a7
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/event_engine/event.h
@@ -0,0 +1,127 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_
+
+#include <string>
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/message.h"
+
+namespace rc_event_engine {
+
+template <typename EventMessage, typename EventID>
+class EventDispatcher;
+
+template <typename EventMessage, typename EventID>
+class Event {
+ public:
+ /*
+ * @brief Constructor with parameters
+ *
+ * @param id Event ID.
+ * @param message Message received in event
+ */
+ Event(EventMessage& message, const EventID& id);
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~Event() {}
+
+ /*
+ * @brief Provides event ID
+ */
+ inline const EventID& id() const;
+
+ /*
+ * @brief Sets event message
+ *
+ * @param message The message received in event
+ */
+ void set_event_message(EventMessage& message);
+
+ /*
+ * @brief Retrieves event message
+ *
+ * @return The message received in event
+ */
+ inline const EventMessage& event_message() const;
+
+ /*
+ * @brief Retrieves event message request ID
+ */
+ virtual int32_t event_message_function_id() const = 0;
+
+ /*
+ * @brief Retrieves event message correlation ID
+ */
+ virtual int32_t event_message_correlation_id() const = 0;
+
+ /*
+ * @brief Retrieves event message response type
+ */
+ virtual int32_t event_message_type() const = 0;
+
+ void raise(EventDispatcher<EventMessage, EventID>& event_dispatcher);
+
+ protected:
+ EventMessage event_message_;
+
+ private:
+ EventID id_;
+};
+
+template <typename EventMessage, typename EventID>
+const EventID& Event<EventMessage, EventID>::id() const {
+ return id_;
+}
+
+template <typename EventMessage, typename EventID>
+const EventMessage& Event<EventMessage, EventID>::event_message() const {
+ return event_message_;
+}
+
+template <typename EventMessage, typename EventID>
+Event<EventMessage, EventID>::Event(EventMessage& message, const EventID& id)
+ : event_message_(message), id_(id) {}
+
+template <typename EventMessage, typename EventID>
+void Event<EventMessage, EventID>::raise(
+ EventDispatcher<EventMessage, EventID>& event_dispatcher) {
+ event_dispatcher.raise_event(*this);
+}
+
+} // namespace event_engine
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_
diff --git a/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h
new file mode 100644
index 0000000000..ddee6caccc
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h
@@ -0,0 +1,203 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_
+
+#include <list>
+#include <map>
+
+#include "utils/lock.h"
+
+#include "remote_control/event_engine/event.h"
+#include "remote_control/event_engine/event_observer.h"
+
+#include "interfaces/HMI_API.h"
+
+namespace rc_event_engine {
+
+template <typename EventMessage, typename EventID>
+class Event;
+
+template <typename EventMessage, typename EventID>
+class EventObserver;
+
+template <typename EventMessage, typename EventID>
+class EventDispatcher {
+ public:
+ /**
+ * @brief Default constructor
+ */
+ EventDispatcher();
+
+ /**
+ * @brief Destructor
+ */
+ virtual ~EventDispatcher();
+
+ /*
+ * @brief Delivers the event to all subscribers
+ *
+ * @param event Received event
+ */
+ void raise_event(const Event<EventMessage, EventID>& event);
+
+ /*
+ * @brief Subscribe the observer to event
+ *
+ * @param event_id The event ID to subscribe for
+ * @param hmi_correlation_id The event HMI correlation ID
+ * @param observer The observer to subscribe for event
+ */
+ void add_observer(const EventID& event_id,
+ int32_t hmi_correlation_id,
+ EventObserver<EventMessage, EventID>* const observer);
+
+ /*
+ * @brief Unsubscribes the observer from specific event
+ *
+ * @param event_id The event ID to unsubscribe from
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_observer(
+ const EventID& event_id,
+ const EventObserver<EventMessage, EventID>* const observer);
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_observer(
+ const EventObserver<EventMessage, EventID>* const observer);
+
+ protected:
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
+
+ // Data types section
+ typedef std::list<EventObserver<EventMessage, EventID>*> ObserverList;
+ typedef std::map<int32_t, ObserverList> ObserversMap;
+ typedef std::map<EventID, ObserversMap> EventObserverMap;
+
+ // Members section
+ sync_primitives::Lock state_lock_;
+ EventObserverMap observers_;
+};
+
+template <typename EventMessage, typename EventID>
+EventDispatcher<EventMessage, EventID>::EventDispatcher()
+ : observers_() {}
+
+template <typename EventMessage, typename EventID>
+EventDispatcher<EventMessage, EventID>::~EventDispatcher() {}
+
+template <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::raise_event(
+ const Event<EventMessage, EventID>& event) {
+ // create local list
+ ObserverList list;
+ {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ // check if event is notification
+ if (hmi_apis::messageType::notification == event.event_message_type()) {
+ // ObserversMap iterator
+ typename ObserversMap::iterator it = observers_[event.id()].begin();
+ for (; observers_[event.id()].end() != it; ++it) {
+ list = it->second;
+ }
+ }
+
+ if ((hmi_apis::messageType::response == event.event_message_type()) ||
+ (hmi_apis::messageType::error_response == event.event_message_type())) {
+ list = observers_[event.id()][event.event_message_correlation_id()];
+ }
+ }
+
+ // Call observers
+ typename ObserverList::iterator observers = list.begin();
+ for (; list.end() != observers; ++observers) {
+ (*observers)->on_event(event);
+ }
+}
+
+template <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::add_observer(
+ const EventID& event_id,
+ int32_t hmi_correlation_id,
+ EventObserver<EventMessage, EventID>* const observer) {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ observers_[event_id][hmi_correlation_id].push_back(observer);
+}
+
+template <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::remove_observer(
+ const EventID& event_id,
+ const EventObserver<EventMessage, EventID>* const observer) {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ typename ObserversMap::iterator it = observers_[event_id].begin();
+ for (; observers_[event_id].end() != it; ++it) {
+ // ObserverList iterator
+ typename ObserverList::iterator observer_it = it->second.begin();
+ while (it->second.end() != observer_it) {
+ if (observer->id() == (*observer_it)->id()) {
+ observer_it = it->second.erase(observer_it);
+ } else {
+ ++observer_it;
+ }
+ }
+ }
+}
+
+template <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::remove_observer(
+ const EventObserver<EventMessage, EventID>* const observer) {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ typename EventObserverMap::iterator event_map = observers_.begin();
+ for (; observers_.end() != event_map; ++event_map) {
+ typename ObserversMap::iterator it = event_map->second.begin();
+ for (; event_map->second.end() != it; ++it) {
+ // ObserverList iterator
+ typename ObserverList::iterator observer_it = it->second.begin();
+ while (it->second.end() != observer_it) {
+ if (observer->id() == (*observer_it)->id()) {
+ observer_it = it->second.erase(observer_it);
+ } else {
+ ++observer_it;
+ }
+ }
+ }
+ }
+}
+}
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_
diff --git a/src/components/remote_control/include/remote_control/event_engine/event_observer.h b/src/components/remote_control/include/remote_control/event_engine/event_observer.h
new file mode 100644
index 0000000000..66a38da88b
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/event_engine/event_observer.h
@@ -0,0 +1,96 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_
+
+#include <string>
+#include "remote_control/event_engine/event.h"
+
+namespace rc_event_engine {
+
+template <typename EventMessage, typename EventID>
+class Event;
+
+template <typename EventMessage, typename EventID>
+class EventObserver {
+ public:
+ // Typedef for possible Observer ID's from mobile_apis functionID enum
+ typedef unsigned long ObserverID;
+
+ /*
+ * @brief Constructor
+ *
+ */
+ EventObserver();
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~EventObserver();
+
+ /**
+ * @brief Retrieves observer unique id
+ *
+ * @return Unique Observer id
+ */
+ const ObserverID& id() const {
+ return id_;
+ }
+
+ /**
+ * @brief Interface method that is called whenever new event received
+ *
+ * @param event The received event
+ */
+ virtual void on_event(const Event<EventMessage, EventID>& event) = 0;
+
+ private:
+ ObserverID id_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventObserver);
+};
+
+template <typename EventMessage, typename EventID>
+EventObserver<EventMessage, EventID>::EventObserver()
+ : id_(0) {
+ // Get unique id based on this
+ id_ = reinterpret_cast<unsigned long>(this);
+}
+
+template <typename EventMessage, typename EventID>
+EventObserver<EventMessage, EventID>::~EventObserver() {
+ // unsubscribe_from_all_events();
+}
+}
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_
diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h
new file mode 100644
index 0000000000..6358459da7
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/message_helper.h
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_
+
+#include <stdint.h>
+#include <string>
+#include <map>
+
+#include "utils/macro.h"
+#include "json/json.h"
+#include "interfaces/HMI_API.h"
+#include "functional_module/function_ids.h"
+#include "remote_control/remote_plugin_interface.h"
+#include "application_manager/message.h"
+
+namespace remote_control {
+
+/**
+ * @brief MessageHelper class
+ **/
+class MessageHelper {
+ public:
+ static const std::string GetMobileAPIName(
+ functional_modules::RCFunctionID func_id);
+
+ /**
+ * @brief Convert Json::Value to std::string
+ *
+ * @param value Value with json
+ *
+ * @return string with json
+ */
+ static std::string ValueToString(const Json::Value& value);
+
+ /**
+ * @brief Convert std::string to Json::Value
+ *
+ * @param string string with json
+ *
+ * @return Value created from string with json
+ */
+ static Json::Value StringToValue(const std::string& string);
+
+ /**
+ * Creates hmi request
+ * @param function_id - API function we create request for
+ * @param message_params - params in request
+ * @param rc_module - used module for requests handling
+ * @param hmi_app_id - app is used between SDL & HMI
+ * @return creted request - reqdy to be sent to hmi
+ */
+ static application_manager::MessagePtr CreateHmiRequest(
+ const char* function_id,
+ const uint32_t hmi_app_id,
+ const Json::Value& message_params,
+ RemotePluginInterface& rc_module);
+
+ /** @brief Converts string to hmi AccessMode enum value
+ * @param access_mode stringified value
+ * @return hmi AccessMode enum value if succedeed, otherwise - INVALID_ENUM
+ * value
+ */
+ static hmi_apis::Common_RCAccessMode::eType AccessModeFromString(
+ const std::string& access_mode);
+
+ /**
+ * @brief AccessModeToString converts enum values to string
+ * @param access_mode Access mode enum value
+ * @return Appropriate string value
+ */
+ static std::string AccessModeToString(
+ const hmi_apis::Common_RCAccessMode::eType access_mode);
+
+ private:
+ MessageHelper();
+
+ static const std::map<functional_modules::RCFunctionID, std::string>
+ kMobileAPINames;
+ DISALLOW_COPY_AND_ASSIGN(MessageHelper);
+};
+
+/** @brief Check for existence of specified key in Json::Value
+ * @param value Value with json
+ * @param key string with key name
+ * @return true if key exist
+ */
+bool IsMember(const Json::Value& value, const std::string& key);
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_
diff --git a/src/components/remote_control/include/remote_control/module_helper.h b/src/components/remote_control/include/remote_control/module_helper.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/module_helper.h
diff --git a/src/components/remote_control/include/remote_control/rc_app_extension.h b/src/components/remote_control/include/remote_control/rc_app_extension.h
new file mode 100644
index 0000000000..485514faba
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_app_extension.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
+
+#include <string>
+#include <set>
+#include "application_manager/service.h"
+#include "application_manager/app_extension.h"
+#include "remote_control/remote_control_plugin.h"
+#include "json/json.h"
+
+namespace remote_control {
+
+class RCAppExtension : public application_manager::AppExtension {
+ public:
+ explicit RCAppExtension(application_manager::AppExtensionUID uid);
+ ~RCAppExtension();
+
+ /**
+ * @brief Subscribe to OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ void SubscribeToInteriorVehicleData(const Json::Value& module_type);
+
+ /**
+ * @brief Unsubscribe from OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ void UnsubscribeFromInteriorVehicleData(const Json::Value& module_type);
+
+ /**
+ * @brief UnsubscribeFromInteriorVehicleData removes all subscriptions for
+ * interior data
+ */
+ void UnsubscribeFromInteriorVehicleData();
+
+ /**
+ * @brief Check if application subscribed to OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ bool IsSubscibedToInteriorVehicleData(const Json::Value& module_type);
+
+ private:
+ std::set<Json::Value> subscribed_interior_vehicle_data_;
+};
+
+typedef utils::SharedPtr<RCAppExtension> RCAppExtensionPtr;
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
diff --git a/src/components/remote_control/include/remote_control/rc_command_factory.h b/src/components/remote_control/include/remote_control/rc_command_factory.h
new file mode 100644
index 0000000000..9463c4b1ef
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_command_factory.h
@@ -0,0 +1,66 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_
+
+#include "utils/shared_ptr.h"
+#include "remote_control/commands/command.h"
+#include "remote_control/remote_control_plugin.h"
+#include "application_manager/message.h"
+#include "utils/macro.h"
+
+namespace remote_control {
+
+/**
+ * @brief Factory class for command creation
+ **/
+class RCCommandFactory {
+ public:
+ /**
+ * @brief Create command object and return pointer to it
+ *
+ * @param message Message shared pointer.
+ * @return Pointer to created command object.
+ **/
+ static utils::SharedPtr<commands::Command> CreateCommand(
+ const application_manager::MessagePtr& msg,
+ RemotePluginInterface& rc_module);
+
+ private:
+ RCCommandFactory();
+ DISALLOW_COPY_AND_ASSIGN(RCCommandFactory);
+};
+
+} // namespace can_cooperaion
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_
diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h
new file mode 100644
index 0000000000..021e3cd6f0
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_module_constants.h
@@ -0,0 +1,233 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
+
+namespace remote_control {
+
+namespace strings {
+// RemoteControlCapabilities constants
+const char kclimateControlCapabilities[] = "climateControlCapabilities";
+const char kradioControlCapabilities[] = "radioControlCapabilities";
+const char kbuttonCapabilities[] = "buttonCapabilities";
+// RemoteControlCapabilities constants
+
+const char kRadioControlData[] = "radioControlData";
+const char kClimateControlData[] = "climateControlData";
+} // strings
+
+namespace result_codes {
+const char kSuccess[] = "SUCCESS";
+const char kUnsupportedRequest[] = "UNSUPPORTED_REQUEST";
+const char kUnsupportedResource[] = "UNSUPPORTED_RESOURCE";
+const char kDisallowed[] = "DISALLOWED";
+const char kRejected[] = "REJECTED";
+const char kAborted[] = "ABORTED";
+const char kIgnored[] = "IGNORED";
+const char kRetry[] = "RETRY";
+const char kInUse[] = "IN_USE";
+const char kVehicleDataNotAvailable[] = "VEHICLE_DATA_NOT_AVAILABLE";
+const char kTimedOut[] = "TIMED_OUT";
+const char kInvalidData[] = "INVALID_DATA";
+const char kCharLimitExceeded[] = "CHAR_LIMIT_EXCEEDED";
+const char kInvalidId[] = "INVALID_ID";
+const char kDuplicateName[] = "DUPLICATE_NAME";
+const char kApplicationNotRegistered[] = "APPLICATION_NOT_REGISTERED";
+const char kOutOfMemory[] = "OUT_OF_MEMORY";
+const char kTooManyPendingRequests[] = "TOO_MANY_PENDING_REQUESTS";
+const char kWarnings[] = "WARNINGS";
+const char kWrongLanguage[] = "WRONG_LANGUAGE";
+const char kGenericError[] = "GENERIC_ERROR";
+const char kUserDisallowed[] = "USER_DISALLOWED";
+const char kReadOnly[] = "READ_ONLY";
+} // result_codes
+
+namespace json_keys {
+const char kParams[] = "params";
+const char kSuccess[] = "success";
+const char kResultCode[] = "resultCode";
+const char kResult[] = "result";
+const char kInfo[] = "info";
+const char kId[] = "id";
+const char kJsonrpc[] = "jsonrpc";
+const char kMethod[] = "method";
+const char kError[] = "error";
+const char kMessage[] = "message";
+const char kData[] = "data";
+const char kAppId[] = "appID";
+const char kCode[] = "code";
+} // json_keys
+
+namespace message_params {
+const char kName[] = "name";
+
+// SetInteriorVehicleData request
+const char kModuleData[] = "moduleData";
+// SetInteriorVehicleData request
+
+// GetInteriorVehicleData request
+const char kSubscribe[] = "subscribe";
+// GetInteriorVehicleData request
+
+// GetInteriorVehicleData response
+const char kIsSubscribed[] = "isSubscribed";
+// GetInteriorVehicleData response
+
+// OnRemoteControlSettings notification
+const char kAccessMode[] = "accessMode";
+const char kAllowed[] = "allowed";
+// OnRemoteControlSettings notification
+
+// ButtonPress request
+const char kModuleType[] = "moduleType";
+const char kButtonName[] = "buttonName";
+const char kButtonPressMode[] = "buttonPressMode";
+// ButtonPress request
+
+// RdsData struct
+const char kPS[] = "PS";
+const char kRT[] = "RT";
+const char kCT[] = "CT";
+const char kPI[] = "PI";
+const char kPTY[] = "PTY";
+const char kTA[] = "TA";
+const char kTP[] = "TP";
+const char kREG[] = "REG";
+// RdsData struct
+
+// RadioControlData struct
+const char kFrequencyInteger[] = "frequencyInteger";
+const char kFrequencyFraction[] = "frequencyFraction";
+const char kBand[] = "band";
+const char kRdsData[] = "rdsData";
+const char kAvailableHDs[] = "availableHDs";
+const char kHdChannel[] = "hdChannel";
+const char kSignalStrength[] = "signalStrength";
+const char kSignalChangeThreshold[] = "signalChangeThreshold";
+const char kRadioEnable[] = "radioEnable";
+const char kState[] = "state";
+// RadioControlData struct
+
+// ClimateControlData struct
+const char kFanSpeed[] = "fanSpeed";
+const char kCurrentTemperature[] = "currentTemperature";
+const char kDesiredTemperature[] = "desiredTemperature";
+const char kTemperatureUnit[] = "temperatureUnit";
+const char kACEnable[] = "acEnable";
+const char kCirculateAirEnable[] = "circulateAirEnable";
+const char kAutoModeEnable[] = "autoModeEnable";
+const char kDefrostZone[] = "defrostZone";
+const char kDualModeEnable[] = "dualModeEnable";
+const char kACMaxEnable[] = "acMaxEnable";
+const char kVentilationMode[] = "ventilationMode";
+// ClimateControlData struct
+
+// ModuleData struct
+const char kRadioControlData[] = "radioControlData";
+const char kClimateControlData[] = "climateControlData";
+// ModuleData struct
+
+const char kHMIAppID[] = "appID";
+const char kHmiLevel[] = "hmiLevel";
+const char kSysContext[] = "systemContext";
+const char kAudioState[] = "audioStreamingState";
+} // namespace message_params
+
+namespace enums_value {
+
+// ModuleType enum
+const char kClimate[] = "CLIMATE";
+const char kRadio[] = "RADIO";
+// ModuleType enum
+
+// RadioBand enum
+const char kAM[] = "AM";
+const char kFM[] = "FM";
+const char kXM[] = "XM";
+// RadioBand enum
+
+// RadioState enum
+const char kAcquiring[] = "ACQUIRING";
+const char kAcquired[] = "ACQUIRED";
+const char kMulticast[] = "MULTICAST";
+const char kNotFound[] = "NOT_FOUND";
+// RadioState enum
+
+// DefrostZone enum
+const char kFront[] = "FRONT";
+const char kRear[] = "REAR";
+const char kAll[] = "ALL";
+// DefrostZone enum
+
+// TemperatureUnit enum
+const char kFahrenheit[] = "FAHRENHEIT";
+const char kCelsius[] = "CELSIUS";
+// TemperatureUnit enum
+
+// ButtonName enum
+const char kACMax[] = "AC_MAX";
+const char kAC[] = "AC";
+const char kRecirculate[] = "RECIRCULATE";
+const char kFanUp[] = "FAN_UP";
+const char kFanDown[] = "FAN_DOWN";
+const char kTempUp[] = "TEMP_UP";
+const char kTempDown[] = "TEMP_DOWN";
+const char kDefrostMax[] = "DEFROST_MAX";
+const char kDefrost[] = "DEFROST";
+const char kDefrostRear[] = "DEFROST_REAR";
+const char kUpperVent[] = "UPPER_VENT";
+const char kLowerVent[] = "LOWER_VENT";
+const char kVolumeUp[] = "VOLUME_UP";
+const char kVolumeDown[] = "VOLUME_DOWN";
+const char kEject[] = "EJECT";
+const char kSource[] = "SOURCE";
+const char kShuffle[] = "SHUFFLE";
+const char kRepeat[] = "REPEAT";
+// ButtonName enum
+
+// ButtonPressMode enum
+const char kLong[] = "LONG";
+const char kShort[] = "SHORT";
+// ButtonPressMode enum
+
+// Access mode enum
+const char kAutoAllow[] = "AUTO_ALLOW";
+const char kAutoDeny[] = "AUTO_DENY";
+const char kAskDriver[] = "ASK_DRIVER";
+// Access mode enum
+
+} // namespace enums_value
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
diff --git a/src/components/remote_control/include/remote_control/rc_module_timer.h b/src/components/remote_control/include/remote_control/rc_module_timer.h
new file mode 100644
index 0000000000..813f26a885
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_module_timer.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_
+
+#include "functional_module/timer/module_timer.h"
+
+namespace remote_control {
+
+class TrackableMessage : public functional_modules::Trackable {
+ public:
+ TrackableMessage(uint32_t app_id, uint32_t correlation_id)
+ : custom_interval_(0), app_id_(app_id), correlation_id_(correlation_id) {}
+
+ functional_modules::TimeUnit custom_interval() const {
+ return custom_interval_;
+ }
+
+ uint32_t app_id() const {
+ return app_id_;
+ }
+
+ uint32_t correlation_id() const {
+ return correlation_id_;
+ }
+
+ bool operator==(const TrackableMessage& other) const {
+ return (other.app_id_ == app_id_ &&
+ other.correlation_id_ == correlation_id_);
+ }
+
+ private:
+ functional_modules::TimeUnit custom_interval_;
+ uint32_t app_id_;
+ uint32_t correlation_id_;
+};
+
+} // namesapce remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_
diff --git a/src/components/remote_control/include/remote_control/remote_control_event.h b/src/components/remote_control/include/remote_control/remote_control_event.h
new file mode 100644
index 0000000000..3c98f971ac
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/remote_control_event.h
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_
+
+#include <string>
+
+#include "application_manager/message.h"
+
+#include "remote_control/event_engine/event.h"
+
+namespace remote_control {
+
+class RCPluginEvent
+ : public rc_event_engine::Event<application_manager::MessagePtr,
+ std::string> {
+ public:
+ /*
+ * @brief Constructor with parameters
+ *
+ * @param id Event ID. (HMI or CAN function name)
+ * @param message Message received in HMI or CAN response
+ */
+ RCPluginEvent(application_manager::MessagePtr& message,
+ const std::string& id);
+
+ /*
+ * @brief Destructor
+ */
+ virtual ~RCPluginEvent();
+
+ /*
+ * @brief Retrieves event message request ID
+ */
+ virtual int32_t event_message_function_id() const;
+
+ /*
+ * @brief Retrieves event message correlation ID
+ */
+ virtual int32_t event_message_correlation_id() const;
+
+ /*
+ * @brief Retrieves event message response type
+ */
+ virtual int32_t event_message_type() const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCPluginEvent);
+};
+}
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_
diff --git a/src/components/remote_control/include/remote_control/remote_control_plugin.h b/src/components/remote_control/include/remote_control/remote_control_plugin.h
new file mode 100644
index 0000000000..1e7d49c18e
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/remote_control_plugin.h
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_
+
+#include <queue>
+#include <string>
+
+#include "remote_control/remote_plugin_interface.h"
+#include "functional_module/generic_module.h"
+#include "remote_control/request_controller.h"
+#include "utils/threads/message_loop_thread.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "remote_control/resource_allocation_manager_impl.h"
+
+namespace remote_control {
+typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
+ std::string> RCEventDispatcher;
+
+class RemoteControlPlugin : public RemotePluginInterface {
+ public:
+ RemoteControlPlugin();
+ ~RemoteControlPlugin();
+
+ functional_modules::PluginInfo GetPluginInfo() const;
+ virtual functional_modules::ProcessResult ProcessMessage(
+ application_manager::MessagePtr msg);
+ virtual functional_modules::ProcessResult ProcessHMIMessage(
+ application_manager::MessagePtr msg);
+
+ /**
+ * @brief Sends response to mobile application
+ * @param msg response mesage
+ */
+ void SendResponseToMobile(application_manager::MessagePtr msg);
+
+ /**
+ * @brief Sends timeout response to mobile application
+ * @param msg response mesage
+ */
+ void SendTimeoutResponseToMobile(application_manager::MessagePtr msg);
+
+ /**
+ * @brief Remove extension created for specified application
+ * @param app_id application id
+ */
+ virtual void RemoveAppExtension(uint32_t app_id);
+
+ /**
+ * @brief Check registering app can be handled by plugin
+ * @param msg Registration message
+ * @param app Application basis already create by Core
+ */
+ bool IsAppForPlugin(application_manager::ApplicationSharedPtr app);
+
+ /**
+ * @brief Notify about change of HMILevel of plugin's app
+ * @param app App with new HMILevel
+ * @param old_level Old HMILevel of app
+ */
+ void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType old_level);
+
+ /**
+ * @brief Sends HMI status notification to mobile
+ * @param app application with changed HMI status
+ **/
+ void SendHmiStatusNotification(
+ application_manager::ApplicationSharedPtr app) OVERRIDE;
+
+ /**
+ * @brief Getter for event_dispatcher
+ * @return reference to RCEventDispatcher instance
+ */
+ RCEventDispatcher& event_dispatcher() OVERRIDE;
+
+ /**
+ * @brief Getter for resource_allocation_manager
+ * @return reference to ResourceAllocationManager instance
+ */
+ ResourceAllocationManager& resource_allocation_manager() OVERRIDE;
+
+ /**
+ * @brief Overriden setter for service
+ * @param service pointer to new service instance
+ */
+ void set_service(application_manager::ServicePtr service) OVERRIDE;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ void OnApplicationEvent(
+ functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) OVERRIDE;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(functional_modules::PolicyEvent event) OVERRIDE;
+
+ protected:
+ /**
+ * @brief Remove extension for all applications
+ */
+ virtual void RemoveAppExtensions() OVERRIDE;
+
+ private:
+ /**
+ * @brief Trigger actions which should be done after plugin service instance
+ * have been changed
+ */
+ void OnPluginServiceChanged();
+
+ /**
+ * @brief Subscribes on all RC related functions
+ */
+ void SubscribeOnFunctions();
+
+ functional_modules::PluginInfo plugin_info_;
+ bool is_scan_started_;
+ request_controller::RequestController request_controller_;
+
+ RCEventDispatcher event_dispatcher_;
+
+ ResourceAllocationManagerImpl resource_allocation_manager_;
+ DISALLOW_COPY_AND_ASSIGN(RemoteControlPlugin);
+};
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_
diff --git a/src/components/remote_control/include/remote_control/remote_plugin_interface.h b/src/components/remote_control/include/remote_control/remote_plugin_interface.h
new file mode 100644
index 0000000000..51135d8a8a
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/remote_plugin_interface.h
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_
+
+#include <queue>
+#include <string>
+#include "functional_module/generic_module.h"
+#include "remote_control/request_controller.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "utils/threads/message_loop_thread.h"
+#include "utils/shared_ptr.h"
+
+namespace remote_control {
+
+class RCAppExtension;
+class ResourceAllocationManager;
+
+typedef utils::SharedPtr<RCAppExtension> RCAppExtensionPtr;
+
+class RemotePluginInterface : public functional_modules::GenericModule {
+ public:
+ RemotePluginInterface() : GenericModule(kCANModuleID) {}
+ virtual ~RemotePluginInterface() {}
+ virtual functional_modules::PluginInfo GetPluginInfo() const = 0;
+ virtual functional_modules::ProcessResult ProcessMessage(
+ application_manager::MessagePtr msg) = 0;
+ virtual functional_modules::ProcessResult ProcessHMIMessage(
+ application_manager::MessagePtr msg) = 0;
+
+ /**
+ * @brief Sends response to mobile application
+ * @param msg response mesage
+ */
+ virtual void SendResponseToMobile(application_manager::MessagePtr msg) = 0;
+
+ /**
+ * @brief Sends timeout response to mobile application
+ * @param msg response mesage
+ */
+ virtual void SendTimeoutResponseToMobile(
+ application_manager::MessagePtr msg) = 0;
+
+ /**
+ * @brief Remove extension created for specified application
+ * @param app_id application id
+ */
+ virtual void RemoveAppExtension(uint32_t app_id) = 0;
+
+ /**
+ * @brief Check registering app can be handled by plugin
+ * @param msg Registration message
+ * @param app Application basis already create by Core
+ */
+ virtual bool IsAppForPlugin(
+ application_manager::ApplicationSharedPtr app) = 0;
+
+ /**
+ * @brief Notify about change of HMILevel of plugin's app
+ * @param app App with new HMILevel
+ * @param old_level Old HMILevel of app
+ */
+ virtual void OnAppHMILevelChanged(
+ application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType old_level) = 0;
+
+ virtual void SendHmiStatusNotification(
+ application_manager::ApplicationSharedPtr app) = 0;
+
+ typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
+ std::string> RCPluginEventDispatcher;
+
+ virtual RCPluginEventDispatcher& event_dispatcher() = 0;
+
+ virtual ResourceAllocationManager& resource_allocation_manager() = 0;
+
+ protected:
+ /**
+ * @brief Remove extension for all applications
+ */
+ virtual void RemoveAppExtensions() = 0;
+
+ static const functional_modules::ModuleID kCANModuleID = 153;
+};
+
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_
diff --git a/src/components/remote_control/include/remote_control/request_controller.h b/src/components/remote_control/include/remote_control/request_controller.h
new file mode 100644
index 0000000000..8a79d9ebc4
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/request_controller.h
@@ -0,0 +1,110 @@
+/**
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_
+
+#include <map>
+
+#include "remote_control/commands/command.h"
+#include "remote_control/rc_module_timer.h"
+#include "functional_module/timer/timer_director.h"
+#include "utils/lock.h"
+
+namespace remote_control {
+
+namespace commands {
+class Command;
+}
+
+namespace request_controller {
+
+typedef utils::SharedPtr<commands::Command> MobileRequestPtr;
+typedef uint32_t correlation_id;
+
+/**
+ * @brief RequestController class is used to manage mobile requests lifetime.
+ */
+class RequestController
+ : public functional_modules::TimerObserver<TrackableMessage> {
+ public:
+ /**
+ * @brief Class constructor
+ *
+ */
+ RequestController();
+
+ /**
+ * @brief Class destructor
+ *
+ */
+ virtual ~RequestController();
+
+ /**
+ * @brief Adds pointer to request.
+ * @param mobile_correlation_id mobile request correlation id
+ * @param command pointer to request created in mobile factory
+ */
+ void AddRequest(const uint32_t mobile_correlation_id,
+ MobileRequestPtr request);
+
+ /**
+ * @brief Removes request
+ * @param mobile_corellation_id mobile request correlation id
+ */
+ void DeleteRequest(const uint32_t& mobile_correlation_id);
+
+ /**
+ * @brief Sets timeout value for RC requests
+ * @param timeout_seconds new timeout value in seconds
+ */
+ void SetRequestTimeout(const functional_modules::TimeUnit timeout_seconds);
+
+ /**
+ * @brief Triggers actions when timeout for some request is expired
+ * @param expired reference to request which timeout was expired
+ */
+ void OnTimeoutTriggered(const TrackableMessage& expired) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestController);
+
+ std::map<correlation_id, MobileRequestPtr> mobile_request_list_;
+ functional_modules::ModuleTimer<TrackableMessage> timer_;
+ functional_modules::TimerDirector time_director_;
+ sync_primitives::Lock mobile_request_lock_;
+};
+
+} // namespace request_controller
+} // namespace remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_
diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager.h b/src/components/remote_control/include/remote_control/resource_allocation_manager.h
new file mode 100644
index 0000000000..f789fe4af9
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/resource_allocation_manager.h
@@ -0,0 +1,115 @@
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
+#include <string>
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "interfaces/HMI_API.h"
+#include "remote_control/event_engine/event.h"
+#include "functional_module/generic_module.h"
+
+namespace remote_control {
+
+/**
+ * Enum for list of results of allocation resources
+ */
+namespace AcquireResult {
+enum eType { ALLOWED = 0, IN_USE, ASK_DRIVER, REJECTED };
+}
+
+/**
+ * Defines states of acquired resource
+ */
+namespace ResourceState {
+enum eType { FREE = 0, BUSY };
+}
+
+/**
+ * @brief Resources defines list of resources
+ */
+typedef std::vector<std::string> Resources;
+
+class ResourceAllocationManager {
+ public:
+ /**
+ * @brief AcquireResource acquires resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ * @return ALLOWED if resource acquired \
+ * IN_USE if subscription is not allowed
+ * ASK_DRIVER if driver confirmation is required
+ */
+ virtual AcquireResult::eType AcquireResource(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief SetResourceState changes resource state. Resource must be acquired
+ * beforehand.
+ * @param module_type Resource to change its state
+ * @param app_id Application aquired resource before
+ * @param state State to set for resource
+ */
+ virtual void SetResourceState(const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) = 0;
+
+ /**
+ * @brief IsResourceFree check resource state
+ * @param module_type Resource name
+ * @return True if free, otherwise - false
+ */
+ virtual bool IsResourceFree(const std::string& module_type) const = 0;
+
+ /**
+ * @brief AcquireResource forces acquiring resource by application
+ * @param module_type resource to acquire
+ * @param app_id application that acquire resource
+ */
+ virtual void ForceAcquireResource(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief OnDriverDisallowed callback for rejecting acquiring resource
+ * @param module_type resource type
+ * @param app_id application id
+ */
+ virtual void OnDriverDisallowed(const std::string& module_type,
+ const uint32_t app_id) = 0;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ virtual void OnApplicationEvent(
+ functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) = 0;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(functional_modules::PolicyEvent event) = 0;
+
+ /**
+ * @brief Set current access mode for acquiring resource
+ * @param access_mode
+ */
+ virtual void SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) = 0;
+
+ /**
+ * @brief Get last set access mode for acquiring resource
+ * @param access_mode
+ */
+ virtual hmi_apis::Common_RCAccessMode::eType GetAccessMode() const = 0;
+
+ /**
+ * @brief Remove all information about all allocations
+ */
+ virtual void ResetAllAllocations() = 0;
+
+ virtual ~ResourceAllocationManager() {}
+};
+
+} // namespace remote_control
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h
new file mode 100644
index 0000000000..57c2a8f360
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h
@@ -0,0 +1,137 @@
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
+#include "remote_control/resource_allocation_manager.h"
+#include "remote_control/remote_plugin_interface.h"
+#include "utils/macro.h"
+#include "utils/lock.h"
+
+namespace remote_control {
+
+typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
+ std::string> RCEventDispatcher;
+
+class ResourceAllocationManagerImpl : public ResourceAllocationManager {
+ public:
+ ResourceAllocationManagerImpl(RemotePluginInterface& rc_plugin);
+
+ ~ResourceAllocationManagerImpl();
+
+ AcquireResult::eType AcquireResource(const std::string& module_type,
+ const uint32_t app_id) OVERRIDE FINAL;
+
+ void SetResourceState(const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) FINAL;
+
+ bool IsResourceFree(const std::string& module_type) const FINAL;
+
+ void SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL;
+
+ hmi_apis::Common_RCAccessMode::eType GetAccessMode() const FINAL;
+
+ void ForceAcquireResource(const std::string& module_type,
+ const uint32_t app_id) FINAL;
+
+ void OnDriverDisallowed(const std::string& module_type,
+ const uint32_t app_id) FINAL;
+
+ /**
+ * @brief OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application Pointer to application struct
+ */
+ void OnApplicationEvent(
+ functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) FINAL;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(functional_modules::PolicyEvent event) FINAL;
+
+ void ResetAllAllocations() FINAL;
+
+ private:
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+
+ /**
+ * @brief IsModuleTypeRejected check if current resource was rejected by
+ * driver for current application
+ * @param module_type resource to check
+ * @param app_id application id
+ * @return true if current resource was rejected by driver for current
+ * application, otherwise - false
+ */
+ bool IsModuleTypeRejected(const std::string& module_type,
+ const uint32_t app_id);
+
+ /**
+ * @brief ReleaseResource Releases resource acquired by application
+ * @param module_type Module name
+ * @param application_id Application id
+ */
+ void ReleaseResource(const std::string& module_type,
+ const uint32_t application_id);
+
+ /**
+ * @brief GetAcquiredResources Provides resources acquired by particular
+ * application currently
+ * @param application_id Application id
+ * @return List of acquired resources by specific application
+ */
+ Resources GetAcquiredResources(const uint32_t application_id) const;
+
+ /**
+ * @brief ProcessApplicationPolicyUpdate Checks if allowed modules list is
+ * changed for registered RC applications and releases in case some modules
+ * now out of the list
+ */
+ void ProcessApplicationPolicyUpdate();
+
+ /**
+ * @brief GetApplicationExtention Provides access to application RC extention
+ * @param application Application
+ * @return Pointer to RC extention of application or NULL if not available
+ */
+ RCAppExtensionPtr GetApplicationExtention(
+ application_manager::ApplicationSharedPtr application);
+
+ /**
+ * @brief RemoveAppsSubscriptions Removes subscriptions for interior data for
+ * applications in the list
+ * @param apps Application list
+ */
+ void RemoveAppsSubscriptions(const Apps& apps);
+
+ /**
+ * @brief AllocatedResources contains link between resource and application
+ * owning that resource
+ */
+ typedef std::map<std::string, uint32_t> AllocatedResources;
+ AllocatedResources allocated_resources_;
+ mutable sync_primitives::Lock allocated_resources_lock_;
+
+ /**
+ * @brief ResourcesState contains states of ALLOCATED resources
+ */
+ typedef std::map<std::string, ResourceState::eType> ResourcesState;
+ ResourcesState resources_state_;
+ mutable sync_primitives::Lock resources_state_lock_;
+
+ /**
+ * @brief RejectedResources type for connecting list of resources rejected by
+ * driver for application
+ * application_id : [vector of rejected resources]
+ */
+ typedef std::map<uint32_t, std::vector<std::string> > RejectedResources;
+ RejectedResources rejected_resources_for_application_;
+ mutable sync_primitives::Lock rejected_resources_for_application_lock_;
+
+ hmi_apis::Common_RCAccessMode::eType current_access_mode_;
+ RemotePluginInterface& rc_plugin_;
+};
+} // remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
diff --git a/src/components/remote_control/src/commands/base_command_notification.cc b/src/components/remote_control/src/commands/base_command_notification.cc
new file mode 100644
index 0000000000..2de82abdef
--- /dev/null
+++ b/src/components/remote_control/src/commands/base_command_notification.cc
@@ -0,0 +1,154 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/base_command_notification.h"
+#include "json/json.h"
+#include "remote_control/remote_control_plugin.h"
+#include "remote_control/rc_module_constants.h"
+#include "application_manager/application_manager.h"
+
+namespace remote_control {
+
+namespace commands {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+BaseCommandNotification::BaseCommandNotification(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : Command(rc_module), service_(rc_module_.service()), message_(message) {
+ Json::Value value;
+ Json::Reader reader;
+ reader.parse(message_->json_message(), value);
+ if (value.isMember(json_keys::kParams)) {
+ Json::FastWriter writer;
+ message_->set_json_message(writer.write(value[json_keys::kParams]));
+ } else {
+ message_->set_json_message("");
+ }
+}
+
+BaseCommandNotification::~BaseCommandNotification() {}
+
+RCAppExtensionPtr BaseCommandNotification::GetAppExtension(
+ application_manager::ApplicationSharedPtr app) const {
+ if (!app) {
+ return NULL;
+ }
+
+ functional_modules::ModuleID id = rc_module_.GetModuleID();
+
+ RCAppExtensionPtr rc_app_extension;
+ application_manager::AppExtensionPtr app_extension = app->QueryInterface(id);
+ if (!app_extension) {
+ return NULL;
+ }
+
+ rc_app_extension =
+ application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
+ app_extension);
+
+ return rc_app_extension;
+}
+
+void BaseCommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Execute();
+}
+
+void BaseCommandNotification::NotifyApplications() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ typedef std::vector<application_manager::ApplicationSharedPtr> AppList;
+ AppList applications = service_->GetApplications(rc_module_.GetModuleID());
+ for (AppList::iterator i = applications.begin(); i != applications.end();
+ ++i) {
+ application_manager::MessagePtr message(
+ new application_manager::Message(*message_));
+ message->set_connection_key((*i)->app_id());
+ NotifyOneApplication(message);
+ }
+}
+
+void BaseCommandNotification::NotifyOneApplication(
+ application_manager::MessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (CheckPolicy(message)) {
+ service_->SendMessageToMobile(message);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Function \"" << message->function_name() << "\" (#"
+ << message->function_id()
+ << ") not allowed by policy");
+ }
+}
+
+bool BaseCommandNotification::CheckPolicy(
+ application_manager::MessagePtr message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager::ApplicationSharedPtr app =
+ service_->GetApplication(message->connection_key());
+
+ if (!app) {
+ LOG4CXX_WARN(logger_,
+ "Application " << message->connection_key()
+ << "isn't registered");
+ return false;
+ }
+
+ mobile_apis::Result::eType permission =
+ service_->CheckPolicyPermissions(message);
+
+ Json::Value value;
+ Json::Reader reader;
+ LOG4CXX_DEBUG(logger_, "Notification: " << message->json_message());
+ reader.parse(message->json_message(), value);
+
+ return permission == mobile_apis::Result::eType::SUCCESS &&
+ service_->CheckModule(app->app_id(), ModuleType(value));
+}
+
+std::string BaseCommandNotification::ModuleType(const Json::Value& message) {
+ return "";
+}
+
+bool BaseCommandNotification::Validate() {
+ return true;
+}
+
+std::vector<std::string> BaseCommandNotification::ControlData(
+ const Json::Value& message) {
+ return std::vector<std::string>();
+}
+
+} // namespace commands
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc
new file mode 100644
index 0000000000..bc6202d2a8
--- /dev/null
+++ b/src/components/remote_control/src/commands/base_command_request.cc
@@ -0,0 +1,564 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/base_command_request.h"
+#include <cstring>
+#include "utils/make_shared.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/remote_control_plugin.h"
+#include "remote_control/rc_module_constants.h"
+#include "application_manager/application_manager_impl.h"
+
+namespace remote_control {
+
+namespace commands {
+
+using rc_event_engine::EventDispatcher;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+BaseCommandRequest::BaseCommandRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : Command(rc_module)
+ , message_(message)
+ , msg_json_(MessageHelper::StringToValue(message->json_message()))
+ , auto_allowed_(false) {
+ service_ = rc_module_.service();
+ app_ = service_->GetApplication(message_->connection_key());
+}
+
+BaseCommandRequest::~BaseCommandRequest() {
+ rc_module_.event_dispatcher().remove_observer(this);
+}
+
+void BaseCommandRequest::OnTimeout() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SetResourceState(msg_json_, ResourceState::FREE);
+
+ PrepareResponse(
+ false, result_codes::kGenericError, "Request timeout expired.");
+ rc_module_.SendTimeoutResponseToMobile(message_);
+}
+
+void BaseCommandRequest::PrepareResponse(const bool success,
+ const char* result_code,
+ const std::string& info) {
+ message_->set_message_type(application_manager::MessageType::kResponse);
+ Json::Value msg_params;
+
+ if (!response_params_.isNull()) {
+ msg_params = response_params_;
+ }
+
+ msg_params[json_keys::kSuccess] = success;
+ msg_params[json_keys::kResultCode] = result_code;
+ if (!info.empty()) {
+ msg_params[json_keys::kInfo] = info;
+ }
+
+ Json::FastWriter writer;
+ std::string params = writer.write(msg_params);
+ message_->set_json_message(params);
+}
+
+void BaseCommandRequest::SendResponse(const bool success,
+ const char* result_code,
+ const std::string& info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SetResourceState(msg_json_, ResourceState::FREE);
+ PrepareResponse(success, result_code, info);
+ rc_module_.SendResponseToMobile(message_);
+}
+
+void BaseCommandRequest::SendMessageToHMI(
+ const application_manager::MessagePtr& message_to_send) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ using application_manager::HmiInterfaces;
+
+ const bool is_rc_available =
+ service_->IsInterfaceAvailable(HmiInterfaces::HMI_INTERFACE_RC);
+ LOG4CXX_DEBUG(logger_, "HMI interface RC is available: " << is_rc_available);
+ if (!is_rc_available) {
+ const bool success = false;
+ const char* result_code = result_codes::kUnsupportedResource;
+ const std::string info = "Remote control is not supported by system";
+
+ SendResponse(success, result_code, info);
+ return;
+ }
+
+ const std::string function_name = message_to_send->function_name();
+ const int32_t correlation_id = message_to_send->correlation_id();
+ LOG4CXX_DEBUG(logger_,
+ "Subsribing to response for function: "
+ << function_name
+ << " and correlation id: " << correlation_id);
+
+ rc_module_.event_dispatcher().add_observer(
+ function_name, correlation_id, this);
+
+ LOG4CXX_DEBUG(logger_, "HMI Request:\n " << message_to_send->json_message());
+
+ service_->SendMessageToHMI(message_to_send);
+}
+
+void BaseCommandRequest::SendRequest(const char* function_id,
+ const Json::Value& message_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager::MessagePtr message_to_send =
+ CreateHmiRequest(function_id, message_params);
+ SendMessageToHMI(message_to_send);
+}
+
+application_manager::MessagePtr BaseCommandRequest::CreateHmiRequest(
+ const char* function_id, const Json::Value& message_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const uint32_t hmi_app_id = app_->hmi_app_id();
+ return MessageHelper::CreateHmiRequest(
+ function_id, hmi_app_id, message_params, rc_module_);
+}
+
+bool BaseCommandRequest::Validate() {
+ return application_manager::MessageValidationResult::SUCCESS ==
+ service_->ValidateMessageBySchema(*message_);
+}
+
+bool BaseCommandRequest::ParseJsonString(Json::Value* parsed_msg) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(parsed_msg);
+ if (!parsed_msg)
+ return false;
+
+ (*parsed_msg) = MessageHelper::StringToValue(message_->json_message());
+ if (Json::ValueType::nullValue == parsed_msg->type()) {
+ LOG4CXX_ERROR(logger_,
+ "Invalid JSON received in " << message_->json_message());
+ SendResponse(
+ false, result_codes::kInvalidData, "Mobile request validation failed!");
+ return false;
+ }
+ return true;
+}
+
+const char* BaseCommandRequest::GetMobileResultCode(
+ const hmi_apis::Common_Result::eType& hmi_code) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ switch (hmi_code) {
+ case hmi_apis::Common_Result::SUCCESS: {
+ return result_codes::kSuccess;
+ }
+ case hmi_apis::Common_Result::UNSUPPORTED_REQUEST: {
+ return result_codes::kUnsupportedRequest;
+ }
+ case hmi_apis::Common_Result::UNSUPPORTED_RESOURCE: {
+ return result_codes::kUnsupportedResource;
+ }
+ case hmi_apis::Common_Result::DISALLOWED: {
+ return result_codes::kDisallowed;
+ }
+ case hmi_apis::Common_Result::REJECTED: {
+ return result_codes::kRejected;
+ }
+ case hmi_apis::Common_Result::ABORTED: {
+ return result_codes::kAborted;
+ }
+ case hmi_apis::Common_Result::IGNORED: {
+ return result_codes::kIgnored;
+ }
+ case hmi_apis::Common_Result::RETRY: {
+ return result_codes::kRetry;
+ }
+ case hmi_apis::Common_Result::IN_USE: {
+ return result_codes::kInUse;
+ }
+ case hmi_apis::Common_Result::DATA_NOT_AVAILABLE: {
+ return result_codes::kVehicleDataNotAvailable;
+ }
+ case hmi_apis::Common_Result::TIMED_OUT: {
+ return result_codes::kTimedOut;
+ }
+ case hmi_apis::Common_Result::INVALID_DATA: {
+ return result_codes::kInvalidData;
+ }
+ case hmi_apis::Common_Result::CHAR_LIMIT_EXCEEDED: {
+ return result_codes::kCharLimitExceeded;
+ }
+ case hmi_apis::Common_Result::INVALID_ID: {
+ return result_codes::kInvalidId;
+ }
+ case hmi_apis::Common_Result::DUPLICATE_NAME: {
+ return result_codes::kDuplicateName;
+ }
+ case hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED: {
+ return result_codes::kApplicationNotRegistered;
+ }
+ case hmi_apis::Common_Result::WRONG_LANGUAGE: {
+ return result_codes::kWrongLanguage;
+ }
+ case hmi_apis::Common_Result::OUT_OF_MEMORY: {
+ return result_codes::kOutOfMemory;
+ }
+ case hmi_apis::Common_Result::TOO_MANY_PENDING_REQUESTS: {
+ return result_codes::kTooManyPendingRequests;
+ }
+ case hmi_apis::Common_Result::NO_APPS_REGISTERED: {
+ return result_codes::kApplicationNotRegistered;
+ }
+ case hmi_apis::Common_Result::NO_DEVICES_CONNECTED: {
+ return result_codes::kApplicationNotRegistered;
+ }
+ case hmi_apis::Common_Result::WARNINGS: {
+ return result_codes::kWarnings;
+ }
+ case hmi_apis::Common_Result::GENERIC_ERROR: {
+ return result_codes::kGenericError;
+ }
+ case hmi_apis::Common_Result::USER_DISALLOWED: {
+ return result_codes::kUserDisallowed;
+ }
+ case hmi_apis::Common_Result::READ_ONLY: {
+ return result_codes::kReadOnly;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Unknown HMI result code " << hmi_code);
+ return result_codes::kGenericError;
+ }
+ }
+}
+
+RCAppExtensionPtr BaseCommandRequest::GetAppExtension(
+ application_manager::ApplicationSharedPtr app) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app) {
+ return NULL;
+ }
+
+ functional_modules::ModuleID id = rc_module_.GetModuleID();
+
+ RCAppExtensionPtr rc_app_extension;
+ application_manager::AppExtensionPtr app_extension = app->QueryInterface(id);
+ if (!app_extension) {
+ LOG4CXX_DEBUG(logger_, "New app extension will be created");
+ app_extension = new RCAppExtension(id);
+ app->AddExtension(app_extension);
+ }
+
+ rc_app_extension =
+ application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
+ app_extension);
+
+ return rc_app_extension;
+}
+
+bool BaseCommandRequest::ParseResultCode(const Json::Value& value,
+ std::string& result_code,
+ std::string& info) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ result_code = result_codes::kInvalidData;
+ info = "";
+
+ if (IsMember(value, json_keys::kResult) &&
+ IsMember(value[json_keys::kResult], json_keys::kCode)) {
+ result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ value[json_keys::kResult][json_keys::kCode].asInt()));
+ } else if (IsMember(value, json_keys::kError) &&
+ IsMember(value[json_keys::kError], json_keys::kCode)) {
+ result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ value[json_keys::kError][json_keys::kCode].asInt()));
+
+ if (IsMember(value[json_keys::kError], json_keys::kMessage)) {
+ info = value[json_keys::kError][json_keys::kMessage].asCString();
+ }
+ }
+
+ if ((result_codes::kSuccess == result_code) ||
+ (result_codes::kWarnings == result_code)) {
+ return true;
+ }
+
+ return false;
+}
+
+void BaseCommandRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!Validate()) {
+ LOG4CXX_WARN(logger_, "Request message validation failed !");
+ SendResponse(
+ false, result_codes::kInvalidData, "Validation by schema failed");
+ return;
+ }
+ LOG4CXX_TRACE(logger_, "Request message validated successfully!");
+ using application_manager::HmiInterfaces;
+ if (!service_->IsInterfaceAvailable(HmiInterfaces::HMI_INTERFACE_RC)) {
+ LOG4CXX_WARN(logger_, "HMI interface RC is not available");
+ SendResponse(false,
+ result_codes::kUnsupportedResource,
+ "Remote control is not supported by system");
+ return;
+ }
+ LOG4CXX_TRACE(logger_, "RC interface is available!");
+ if (CheckPolicyPermissions() && CheckDriverConsent()) {
+ if (AcquireResources()) {
+ Execute(); // run child's logic
+ }
+ // If resource is not aqcuired, AcquireResources method will either
+ // send response to mobile or
+ // send additional request to HMI to ask driver consent
+ }
+}
+
+bool BaseCommandRequest::CheckPolicyPermissions() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_) {
+ LOG4CXX_ERROR(logger_, "Application doesn't registered!");
+ SendResponse(false, result_codes::kApplicationNotRegistered, "");
+ return false;
+ }
+
+ if (!service_->IsRemoteControlApplication(app_)) {
+ LOG4CXX_WARN(logger_, "Application has no remote control functions");
+ SendResponse(false, result_codes::kDisallowed, "");
+ return false;
+ }
+
+ mobile_apis::Result::eType ret = service_->CheckPolicyPermissions(message_);
+ if (ret != mobile_apis::Result::eType::SUCCESS) {
+ LOG4CXX_WARN(logger_,
+ "Function \"" << message_->function_name() << "\" (#"
+ << message_->function_id()
+ << ") not allowed by policy");
+
+ SendResponse(false, result_codes::kDisallowed, "");
+ return false;
+ }
+
+ return true;
+}
+
+application_manager::TypeAccess BaseCommandRequest::CheckModule(
+ const Json::Value& message) {
+ const std::string& module = ModuleType(message);
+ return service_->CheckModule(app_->app_id(), module)
+ ? application_manager::TypeAccess::kAllowed
+ : application_manager::TypeAccess::kDisallowed;
+}
+
+bool BaseCommandRequest::CheckDriverConsent() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RCAppExtensionPtr extension = GetAppExtension(app_);
+ if (!extension) {
+ return false;
+ }
+ Json::Value value;
+ Json::Reader reader;
+ LOG4CXX_DEBUG(logger_, "Request: " << message_->json_message());
+ reader.parse(message_->json_message(), value);
+
+ application_manager::TypeAccess access = CheckModule(value);
+
+ if (IsAutoAllowed(access)) {
+ set_auto_allowed(true);
+ return true;
+ } else {
+ SendDisallowed(access);
+ }
+ return false;
+}
+
+bool BaseCommandRequest::AcquireResources() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const Json::Value message_params =
+ MessageHelper::StringToValue(message_->json_message());
+
+ if (!IsResourceFree(ModuleType(message_params))) {
+ LOG4CXX_WARN(logger_, "Resource is busy.");
+ SendResponse(false, result_codes::kInUse, "");
+ return false;
+ }
+
+ AcquireResult::eType acquire_result = AcquireResource(message_params);
+ switch (acquire_result) {
+ case AcquireResult::ALLOWED: {
+ SetResourceState(msg_json_, ResourceState::BUSY);
+ return true;
+ }
+ case AcquireResult::IN_USE: {
+ SendResponse(false, result_codes::kInUse, "");
+ return false;
+ }
+ case AcquireResult::ASK_DRIVER: {
+ SetResourceState(msg_json_, ResourceState::BUSY);
+
+ Json::Value value;
+ Json::Reader reader;
+ LOG4CXX_DEBUG(logger_, "Request: " << message_->json_message());
+ reader.parse(message_->json_message(), value);
+
+ SendGetUserConsent(value);
+
+ return false;
+ }
+ case AcquireResult::REJECTED: {
+ SendResponse(false, result_codes::kRejected, "");
+ return false;
+ }
+ }
+
+ return false;
+}
+
+bool BaseCommandRequest::IsAutoAllowed(
+ application_manager::TypeAccess access) const {
+ return access == application_manager::kAllowed;
+}
+
+void BaseCommandRequest::SendDisallowed(
+ application_manager::TypeAccess access) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::string info;
+ switch (access) {
+ case application_manager::kAllowed:
+ return;
+ case application_manager::kDisallowed:
+ info = disallowed_info_.empty()
+ ? "The RPC is disallowed by vehicle settings"
+ : disallowed_info_;
+ break;
+ default:
+ info = "Unknown issue";
+ }
+ LOG4CXX_ERROR(logger_, info);
+ SendResponse(false, result_codes::kDisallowed, info);
+}
+
+void BaseCommandRequest::SendGetUserConsent(const Json::Value& value) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK(app_);
+ Json::Value params;
+ params[json_keys::kAppId] = app_->hmi_app_id();
+ params[message_params::kModuleType] = ModuleType(value);
+ SendRequest(functional_modules::hmi_api::get_user_consent, params);
+}
+
+std::string BaseCommandRequest::ModuleType(const Json::Value& message) {
+ return "";
+}
+
+std::vector<std::string> BaseCommandRequest::ControlData(
+ const Json::Value& message) {
+ return std::vector<std::string>();
+}
+
+void BaseCommandRequest::on_event(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SetResourceState(msg_json_, ResourceState::FREE);
+
+ if (event.id() == functional_modules::hmi_api::get_user_consent) {
+ ProcessAccessResponse(event);
+ } else {
+ OnEvent(event); // run child's logic
+ }
+}
+
+void BaseCommandRequest::ProcessAccessResponse(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_) {
+ LOG4CXX_ERROR(logger_, "Application doesn't registered!");
+ SendResponse(false, result_codes::kApplicationNotRegistered, "");
+ return;
+ }
+
+ application_manager::Message& hmi_response = *(event.event_message());
+ const application_manager::MessageValidationResult validate_result =
+ service_->ValidateMessageBySchema(hmi_response);
+ LOG4CXX_DEBUG(logger_,
+ "HMI response validation result is " << validate_result);
+
+ if (validate_result !=
+ application_manager::MessageValidationResult::SUCCESS) {
+ SendResponse(
+ false, result_codes::kGenericError, "HMI has sent invalid parameters");
+ return;
+ }
+
+ Json::Value value;
+ Json::Reader reader;
+ reader.parse(event.event_message()->json_message(), value);
+
+ std::string result_code;
+ std::string info;
+ const bool is_succeeded = ParseResultCode(value, result_code, info);
+
+ bool is_allowed = false;
+ if (is_succeeded) {
+ if (IsMember(value[json_keys::kResult], message_params::kAllowed) &&
+ value[json_keys::kResult][message_params::kAllowed].isBool()) {
+ is_allowed = value[json_keys::kResult][message_params::kAllowed].asBool();
+ }
+
+ const std::string module = ModuleType(msg_json_);
+
+ // Check the actual User's answer.
+ LOG4CXX_DEBUG(logger_,
+ "Setting allowed access for " << app_->app_id() << " for "
+ << module);
+ if (is_allowed) {
+ rc_module_.resource_allocation_manager().ForceAcquireResource(
+ module, app_->app_id());
+
+ Execute(); // run child's logic
+ } else {
+ rc_module_.resource_allocation_manager().OnDriverDisallowed(
+ module, app_->app_id());
+
+ SendResponse(
+ false,
+ result_codes::kRejected,
+ "The resource is in use and the driver disallows this remote "
+ "control RPC");
+ }
+ } else {
+ SendResponse(false, result_code.c_str(), info);
+ }
+}
+
+} // namespace commands
+} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/button_press_request.cc b/src/components/remote_control/src/commands/button_press_request.cc
new file mode 100644
index 0000000000..1e5eef1e64
--- /dev/null
+++ b/src/components/remote_control/src/commands/button_press_request.cc
@@ -0,0 +1,264 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/button_press_request.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_module_constants.h"
+#include "functional_module/function_ids.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace remote_control {
+
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+typedef std::map<std::string, mobile_apis::ButtonName::eType> ButtonsMap;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ButtonPressRequest")
+
+ButtonPressRequest::ButtonPressRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : BaseCommandRequest(message, rc_module) {}
+
+ButtonPressRequest::~ButtonPressRequest() {}
+
+const std::vector<std::string> buttons_climate() {
+ std::vector<std::string> data;
+ data.push_back(enums_value::kACMax);
+ data.push_back(enums_value::kAC);
+ data.push_back(enums_value::kRecirculate);
+ data.push_back(enums_value::kFanUp);
+ data.push_back(enums_value::kFanDown);
+ data.push_back(enums_value::kTempUp);
+ data.push_back(enums_value::kTempDown);
+ data.push_back(enums_value::kDefrostMax);
+ data.push_back(enums_value::kDefrost);
+ data.push_back(enums_value::kDefrostRear);
+ data.push_back(enums_value::kUpperVent);
+ data.push_back(enums_value::kLowerVent);
+ return data;
+}
+
+const std::vector<std::string> buttons_radio() {
+ std::vector<std::string> data;
+ data.push_back(enums_value::kVolumeUp);
+ data.push_back(enums_value::kVolumeDown);
+ data.push_back(enums_value::kEject);
+ data.push_back(enums_value::kSource);
+ data.push_back(enums_value::kShuffle);
+ data.push_back(enums_value::kRepeat);
+ return data;
+}
+
+const ButtonsMap buttons_map() {
+ using namespace mobile_apis;
+
+ ButtonsMap buttons_map;
+ buttons_map[enums_value::kACMax] = ButtonName::AC_MAX;
+ buttons_map[enums_value::kAC] = ButtonName::AC;
+ buttons_map[enums_value::kRecirculate] = ButtonName::RECIRCULATE;
+ buttons_map[enums_value::kFanUp] = ButtonName::FAN_UP;
+ buttons_map[enums_value::kFanDown] = ButtonName::FAN_DOWN;
+ buttons_map[enums_value::kTempUp] = ButtonName::TEMP_UP;
+ buttons_map[enums_value::kTempDown] = ButtonName::TEMP_DOWN;
+ buttons_map[enums_value::kDefrostMax] = ButtonName::DEFROST_MAX;
+ buttons_map[enums_value::kDefrost] = ButtonName::DEFROST;
+ buttons_map[enums_value::kDefrostRear] = ButtonName::DEFROST_REAR;
+ buttons_map[enums_value::kUpperVent] = ButtonName::UPPER_VENT;
+ buttons_map[enums_value::kLowerVent] = ButtonName::LOWER_VENT;
+ buttons_map[enums_value::kVolumeUp] = ButtonName::VOLUME_UP;
+ buttons_map[enums_value::kVolumeDown] = ButtonName::VOLUME_DOWN;
+ buttons_map[enums_value::kEject] = ButtonName::EJECT;
+ buttons_map[enums_value::kSource] = ButtonName::SOURCE;
+ buttons_map[enums_value::kShuffle] = ButtonName::SHUFFLE;
+ buttons_map[enums_value::kRepeat] = ButtonName::REPEAT;
+
+ return buttons_map;
+}
+
+bool CheckIfButtonExistInRCCaps(
+ const smart_objects::SmartObject& rc_capabilities,
+ const mobile_apis::ButtonName::eType button) {
+ if (rc_capabilities.keyExists(strings::kbuttonCapabilities)) {
+ const smart_objects::SmartObject& button_caps =
+ rc_capabilities[strings::kbuttonCapabilities];
+ smart_objects::SmartArray::iterator it = button_caps.asArray()->begin();
+ for (; it != button_caps.asArray()->end(); ++it) {
+ smart_objects::SmartObject& so = *it;
+ int64_t current_id = so[message_params::kName].asInt();
+ if (-1 == current_id) {
+ // capabilities received from HMI contains enum values
+ // capabilities loaded from file contains string values
+ // TODO : unificate capabilities storing
+ const std::string& bt_name = so[message_params::kName].asString();
+ static ButtonsMap btn_map = buttons_map();
+ current_id = btn_map[bt_name];
+ }
+ const mobile_apis::ButtonName::eType current_button =
+ static_cast<mobile_apis::ButtonName::eType>(current_id);
+ if (current_button == button) {
+ LOG4CXX_TRACE(logger_,
+ "Button id " << current_button
+ << " exist in capabilities");
+ return true;
+ }
+ }
+ }
+ LOG4CXX_TRACE(logger_,
+ "Button id " << button << " do not exist in capabilities");
+ return false;
+}
+
+bool CheckButtonName(const std::string& module_type,
+ const std::string& button_name,
+ const smart_objects::SmartObject* rc_capabilities) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (rc_capabilities == NULL) {
+ LOG4CXX_ERROR(logger_, "No remote controll capabilities available");
+ return false;
+ }
+
+ if (enums_value::kRadio == module_type) {
+ if (!helpers::in_range(buttons_radio(), button_name)) {
+ LOG4CXX_WARN(logger_,
+ "Trying to acceess climate button with module type radio");
+ return false;
+ }
+ }
+
+ if (enums_value::kClimate == module_type) {
+ if (!helpers::in_range(buttons_climate(), button_name)) {
+ LOG4CXX_WARN(logger_,
+ "Trying to acceess radio button with module type climate");
+ return false;
+ }
+ }
+ return true;
+}
+
+void ButtonPressRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ const Json::Value request_params =
+ MessageHelper::StringToValue(message_->json_message());
+
+ const std::string button_name = request_params[kButtonName].asString();
+ const std::string module_type = request_params[kModuleType].asString();
+
+ static ButtonsMap btn_map = buttons_map();
+ mobile_apis::ButtonName::eType button_id =
+ mobile_apis::ButtonName::INVALID_ENUM;
+ if (btn_map.end() != btn_map.find(button_name)) {
+ button_id = btn_map[button_name];
+ }
+
+ const smart_objects::SmartObject* rc_capabilities =
+ service()->GetRCCapabilities();
+ const bool button_name_matches_module_type =
+ CheckButtonName(module_type, button_name, rc_capabilities);
+ const bool button_id_exist_in_caps =
+ rc_capabilities &&
+ CheckIfButtonExistInRCCaps(*rc_capabilities, button_id);
+
+ if (button_name_matches_module_type && button_id_exist_in_caps) {
+ SendRequest(functional_modules::hmi_api::button_press, request_params);
+ } else if (!button_name_matches_module_type) {
+ LOG4CXX_WARN(logger_, "Request module type and button name mismatch!");
+ SendResponse(false,
+ result_codes::kInvalidData,
+ "Request module type and button name mismatch!");
+ } else {
+ LOG4CXX_WARN(logger_, "Requested button is not exists in capabilities!");
+ SendResponse(false,
+ result_codes::kUnsupportedResource,
+ "Requested button is not exists in capabilities!");
+ }
+}
+
+AcquireResult::eType ButtonPressRequest::AcquireResource(
+ const Json::Value& message) {
+ ResourceAllocationManager& allocation_manager =
+ rc_module_.resource_allocation_manager();
+ const std::string& module_type = ModuleType(message);
+ const uint32_t app_id = app()->app_id();
+ return allocation_manager.AcquireResource(module_type, app_id);
+}
+
+bool ButtonPressRequest::IsResourceFree(const std::string& module_type) const {
+ return rc_module_.resource_allocation_manager().IsResourceFree(module_type);
+}
+
+void ButtonPressRequest::SetResourceState(const Json::Value& message,
+ const ResourceState::eType state) {
+ const std::string& module_type = ModuleType(message);
+ const uint32_t app_id = app()->app_id();
+
+ ResourceAllocationManager& allocation_manager =
+ rc_module_.resource_allocation_manager();
+ allocation_manager.SetResourceState(module_type, app_id, state);
+}
+
+void ButtonPressRequest::OnEvent(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(
+ (functional_modules::hmi_api::button_press == event.id()));
+
+ application_manager::Message& hmi_response = *(event.event_message());
+ const Json::Value value =
+ MessageHelper::StringToValue(hmi_response.json_message());
+
+ std::string result_code;
+ std::string info;
+
+ bool is_response_successful = ParseResultCode(value, result_code, info);
+
+ if (remote_control::result_codes::kReadOnly == result_code) {
+ is_response_successful = false;
+ result_code = result_codes::kGenericError;
+ }
+ SendResponse(is_response_successful, result_code.c_str(), info);
+}
+
+std::string ButtonPressRequest::ModuleType(const Json::Value& message) {
+ return message.get(message_params::kModuleType, Json::Value("")).asString();
+}
+
+} // namespace commands
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..6a7e746aa5
--- /dev/null
+++ b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc
@@ -0,0 +1,224 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <map>
+
+#include "remote_control/commands/get_interior_vehicle_data_request.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/remote_control_plugin.h"
+#include "functional_module/function_ids.h"
+#include "json/json.h"
+
+namespace remote_control {
+
+namespace commands {
+
+using namespace enums_value;
+using namespace json_keys;
+using namespace message_params;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "GetInteriorVehicleDataRequest")
+
+GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : BaseCommandRequest(message, rc_module) {}
+
+bool CheckIfModuleTypeExistInCapabilities(
+ const smart_objects::SmartObject& rc_capabilities,
+ const std::string& module_type) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (enums_value::kRadio == module_type &&
+ !rc_capabilities.keyExists(strings::kradioControlCapabilities)) {
+ LOG4CXX_DEBUG(logger_, " Radio control capabilities not present");
+ return false;
+ }
+ if (enums_value::kClimate == module_type &&
+ !rc_capabilities.keyExists(strings::kclimateControlCapabilities)) {
+ LOG4CXX_DEBUG(logger_, " Climate control capabilities not present");
+ return false;
+ }
+
+ return true;
+}
+
+void GetInteriorVehicleDataRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value request_params =
+ MessageHelper::StringToValue(message_->json_message());
+
+ const smart_objects::SmartObject* capabilities =
+ service()->GetRCCapabilities();
+ if (capabilities &&
+ !CheckIfModuleTypeExistInCapabilities(*capabilities,
+ ModuleType(request_params))) {
+ LOG4CXX_WARN(logger_, "Accessing not supported module data");
+ SendResponse(false,
+ result_codes::kUnsupportedResource,
+ "Accessing not supported module data");
+ return;
+ }
+ if (HasRequestExcessiveSubscription(request_params)) {
+ RemoveExcessiveSubscription(request_params);
+ }
+
+ SendRequest(functional_modules::hmi_api::get_interior_vehicle_data,
+ request_params);
+}
+
+void GetInteriorVehicleDataRequest::OnEvent(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(
+ (functional_modules::hmi_api::get_interior_vehicle_data == event.id()));
+
+ application_manager::Message& hmi_response = *(event.event_message());
+ const bool validate_result =
+ application_manager::MessageValidationResult::SUCCESS ==
+ service()->ValidateMessageBySchema(hmi_response);
+ LOG4CXX_DEBUG(logger_,
+ "HMI response validation result is " << validate_result);
+ const Json::Value value =
+ MessageHelper::StringToValue(hmi_response.json_message());
+ std::string result_code;
+ std::string info;
+ bool success = validate_result && ParseResultCode(value, result_code, info);
+
+ if (!validate_result ||
+ remote_control::result_codes::kReadOnly == result_code) {
+ success = false;
+ result_code = result_codes::kGenericError;
+ }
+
+ if (success) {
+ ProccessSubscription(value);
+ response_params_[kModuleData] =
+ value[json_keys::kResult][message_params::kModuleData];
+ }
+ SendResponse(success, result_code.c_str(), info);
+}
+
+void GetInteriorVehicleDataRequest::ProccessSubscription(
+ const Json::Value& hmi_response) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Json::Value request_params;
+ Json::Reader reader;
+ reader.parse(message_->json_message(), request_params);
+
+ const bool is_subscribe_present_in_request =
+ IsMember(request_params, kSubscribe);
+ const bool isSubscribed_present_in_response =
+ IsMember(hmi_response[json_keys::kResult], message_params::kIsSubscribed);
+
+ if (!is_subscribe_present_in_request && !isSubscribed_present_in_response) {
+ return;
+ }
+
+ RCAppExtensionPtr extension = GetAppExtension(app());
+ if (is_subscribe_present_in_request && !isSubscribed_present_in_response) {
+ LOG4CXX_WARN(logger_,
+ "conditional mandatory parameter "
+ << kIsSubscribed << " missed in hmi response");
+ response_params_[kIsSubscribed] =
+ extension->IsSubscibedToInteriorVehicleData(
+ request_params[kModuleType]);
+ return;
+ }
+
+ if (!is_subscribe_present_in_request && isSubscribed_present_in_response) {
+ LOG4CXX_WARN(logger_,
+ "Parameter " << message_params::kIsSubscribed
+ << " is ignored due to absence '"
+ << message_params::kSubscribe
+ << "' parameter in request");
+ return;
+ }
+
+ const bool request_subscribe = request_params[kSubscribe].asBool();
+ const bool response_subscribe =
+ hmi_response[json_keys::kResult][message_params::kIsSubscribed].asBool();
+ response_params_[message_params::kIsSubscribed] = response_subscribe;
+ LOG4CXX_TRACE(logger_, "request_subscribe = " << request_subscribe);
+ LOG4CXX_TRACE(logger_, "response_subscribe = " << response_subscribe);
+ if (request_subscribe == response_subscribe) {
+ if (response_subscribe) {
+ LOG4CXX_DEBUG(logger_,
+ "SubscribeToInteriorVehicleData "
+ << app()->app_id() << " "
+ << request_params[kModuleType].asString());
+ extension->SubscribeToInteriorVehicleData(request_params[kModuleType]);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "UnsubscribeFromInteriorVehicleData "
+ << app()->app_id() << " "
+ << request_params[kModuleType].asString());
+ extension->UnsubscribeFromInteriorVehicleData(
+ request_params[kModuleType]);
+ }
+ }
+}
+
+bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription(
+ const Json::Value& request_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const bool is_subscribe_present_in_request =
+ IsMember(request_params, kSubscribe);
+ if (is_subscribe_present_in_request) {
+ RCAppExtensionPtr extension = GetAppExtension(app());
+ const bool is_app_already_subscribed =
+ extension->IsSubscibedToInteriorVehicleData(
+ request_params[kModuleType]);
+ const bool app_wants_to_subscribe = request_params[kSubscribe].asBool();
+ if (!app_wants_to_subscribe && !is_app_already_subscribed) {
+ return true;
+ }
+ return app_wants_to_subscribe && is_app_already_subscribed;
+ }
+ return false;
+}
+
+void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription(
+ Json::Value& request_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ request_params.removeMember(kSubscribe);
+}
+
+std::string GetInteriorVehicleDataRequest::ModuleType(
+ const Json::Value& message) {
+ return message.get(message_params::kModuleType, "").asString();
+}
+
+} // namespace commands
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc b/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc
new file mode 100644
index 0000000000..fccd8392c7
--- /dev/null
+++ b/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc
@@ -0,0 +1,103 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/on_interior_vehicle_data_notification.h"
+#include <algorithm>
+#include <vector>
+#include "json/json.h"
+#include "utils/make_shared.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/remote_control_plugin.h"
+#include "remote_control/rc_app_extension.h"
+
+namespace remote_control {
+
+namespace commands {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "OnInteriorVehicleDataNotification")
+
+OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : BaseCommandNotification(message, rc_module) {}
+
+OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() {}
+
+void OnInteriorVehicleDataNotification::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ Json::Value json;
+
+ application_manager::MessagePtr msg = message();
+
+ json = MessageHelper::StringToValue(msg->json_message());
+
+ Json::Value module_type = ModuleType(json);
+
+ typedef std::vector<application_manager::ApplicationSharedPtr> AppPtrs;
+ AppPtrs apps = service_->GetApplications(rc_module_.GetModuleID());
+
+ for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) {
+ DCHECK(*it);
+ application_manager::Application& app = **it;
+
+ RCAppExtensionPtr extension =
+ application_manager::AppExtensionPtr::static_pointer_cast<
+ RCAppExtension>(app.QueryInterface(rc_module_.GetModuleID()));
+ DCHECK(extension);
+ LOG4CXX_TRACE(logger_, "Check subscription for " << app.app_id());
+ if (extension->IsSubscibedToInteriorVehicleData(module_type)) {
+ application_manager::MessagePtr message =
+ utils::MakeShared<application_manager::Message>(*msg);
+ message->set_message_type(
+ application_manager::MessageType::kNotification);
+ message->set_protocol_version(app.protocol_version());
+ message->set_function_id(functional_modules::ON_INTERIOR_VEHICLE_DATA);
+ message->set_function_name(MessageHelper::GetMobileAPIName(
+ functional_modules::ON_INTERIOR_VEHICLE_DATA));
+ message->set_connection_key(app.app_id());
+ NotifyOneApplication(message);
+ }
+ }
+}
+
+std::string OnInteriorVehicleDataNotification::ModuleType(
+ const Json::Value& message) {
+ const Json::Value& module_data =
+ message.get(message_params::kModuleData, Json::Value(Json::objectValue));
+ return module_data.get(message_params::kModuleType, "").asString();
+}
+
+} // namespace commands
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc
new file mode 100644
index 0000000000..f18180aa21
--- /dev/null
+++ b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/on_remote_control_settings_notification.h"
+#include <algorithm>
+#include <vector>
+#include "json/json.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/remote_control_plugin.h"
+#include "remote_control/rc_app_extension.h"
+#include "functional_module/function_ids.h"
+
+namespace remote_control {
+
+namespace commands {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "OnRemoteControlSettingsNotification");
+
+OnRemoteControlSettingsNotification::OnRemoteControlSettingsNotification(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : BaseCommandNotification(message, rc_module) {}
+
+void UnsubscribeFromInteriorVehicleDataForAllModules(
+ RCAppExtensionPtr extension) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const Json::Value climate(enums_value::kClimate);
+ extension->UnsubscribeFromInteriorVehicleData(climate);
+ const Json::Value radio(enums_value::kRadio);
+ extension->UnsubscribeFromInteriorVehicleData(radio);
+}
+
+void OnRemoteControlSettingsNotification::DisallowRCFunctionality() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+ Apps apps = service_->GetApplications(rc_module_.GetModuleID());
+ for (Apps::iterator it = apps.begin(); it != apps.end(); ++it) {
+ application_manager::ApplicationSharedPtr app = *it;
+ DCHECK(app);
+ service_->ChangeNotifyHMILevel(app, mobile_apis::HMILevel::eType::HMI_NONE);
+
+ const RCAppExtensionPtr extension =
+ application_manager::AppExtensionPtr::static_pointer_cast<
+ RCAppExtension>(app->QueryInterface(rc_module_.GetModuleID()));
+ if (extension) {
+ UnsubscribeFromInteriorVehicleDataForAllModules(extension);
+ }
+ }
+}
+
+void OnRemoteControlSettingsNotification::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const Json::Value value =
+ MessageHelper::StringToValue(message()->json_message());
+
+ if (!value.isMember(message_params::kAllowed)) {
+ LOG4CXX_DEBUG(logger_,
+ "Notification is ignored due to \"allow\" parameter absense");
+ LOG4CXX_DEBUG(logger_, "RC Functionality remains unchanged");
+ return;
+ }
+ ResourceAllocationManager& allocation_manager =
+ rc_module_.resource_allocation_manager();
+ const bool is_allowed = value[message_params::kAllowed].asBool();
+ if (is_allowed) {
+ hmi_apis::Common_RCAccessMode::eType access_mode =
+ hmi_apis::Common_RCAccessMode::INVALID_ENUM;
+ LOG4CXX_DEBUG(logger_, "Allowing RC Functionality");
+ if (value.isMember(message_params::kAccessMode)) {
+ const std::string access_mode_str =
+ value.get(message_params::kAccessMode, enums_value::kAutoAllow)
+ .asString();
+
+ access_mode = MessageHelper::AccessModeFromString(access_mode_str);
+ LOG4CXX_DEBUG(logger_, "Setting up access mode : " << access_mode_str);
+ } else {
+ access_mode = allocation_manager.GetAccessMode();
+ LOG4CXX_DEBUG(logger_,
+ "No access mode received. Using last known: "
+ << MessageHelper::AccessModeToString(access_mode));
+ }
+ allocation_manager.SetAccessMode(access_mode);
+ } else {
+ LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality");
+ DisallowRCFunctionality();
+ allocation_manager.ResetAllAllocations();
+ }
+}
+
+} // namespace commands
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc
new file mode 100644
index 0000000000..70fbd9280e
--- /dev/null
+++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc
@@ -0,0 +1,350 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/set_interior_vehicle_data_request.h"
+#include <algorithm>
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "functional_module/function_ids.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+
+namespace remote_control {
+
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+namespace {
+std::vector<std::string> GetModuleReadOnlyParams(
+ const std::string& module_type) {
+ std::vector<std::string> module_ro_params;
+ if (enums_value::kClimate == module_type) {
+ module_ro_params.push_back(kCurrentTemperature);
+ } else if (enums_value::kRadio == module_type) {
+ module_ro_params.push_back(kRdsData);
+ module_ro_params.push_back(kAvailableHDs);
+ module_ro_params.push_back(kSignalStrength);
+ module_ro_params.push_back(kSignalChangeThreshold);
+ module_ro_params.push_back(kState);
+ }
+ return module_ro_params;
+}
+
+const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
+ std::map<std::string, std::string> mapping;
+ // climate
+ mapping["fanSpeed"] = "fanSpeedAvailable";
+ mapping["currentTemperature"] = "currentTemperatureAvailable";
+ mapping["desiredTemperature"] = "desiredTemperatureAvailable";
+ mapping["acEnable"] = "acEnableAvailable";
+ mapping["circulateAirEnable"] = "circulateAirEnableAvailable";
+ mapping["autoModeEnable"] = "autoModeEnableAvailable";
+ mapping["defrostZone"] = "defrostZoneAvailable";
+ mapping["dualModeEnable"] = "dualModeEnableAvailable";
+ mapping["acMaxEnable"] = "acMaxEnableAvailable";
+ mapping["ventilationMode"] = "ventilationModeAvailable";
+
+ // radio
+ mapping["band"] = "radioBandAvailable";
+ mapping["frequencyInteger"] = "radioFrequencyAvailable";
+ mapping["frequencyFraction"] = "radioFrequencyAvailable";
+ mapping["rdsData"] = "rdsDataAvailable";
+ mapping["availableHDs"] = "availableHDsAvailable";
+ mapping["hdChannel"] = "availableHDsAvailable";
+ mapping["signalStrength"] = "signalStrengthAvailable";
+ mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable";
+ mapping["radioEnable"] = "radioEnableAvailable";
+ mapping["state"] = "stateAvailable";
+
+ return mapping;
+}
+} // namespace
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "SetInteriorVehicleDataRequest")
+
+SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : BaseCommandRequest(message, rc_module) {}
+
+SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {}
+
+bool CheckControlDataByCapabilities(
+ const smart_objects::SmartObject& module_caps,
+ const Json::Value& control_data) {
+ std::map<std::string, std::string> mapping =
+ GetModuleDataToCapabilitiesMapping();
+ Json::Value::Members control_data_keys = control_data.getMemberNames();
+
+ Json::Value::Members::const_iterator it = control_data_keys.begin();
+ for (; it != control_data_keys.end(); ++it) {
+ const std::string& request_parameter = *it;
+ const std::string& caps_key = mapping[request_parameter];
+ const smart_objects::SmartObject& capabilities_status = module_caps[0];
+ LOG4CXX_DEBUG(logger_,
+ "Checking request parameter "
+ << request_parameter
+ << " with capabilities. Appropriate key is " << caps_key);
+ if (!capabilities_status.keyExists(caps_key)) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << caps_key
+ << " is missed in RemoteControl capabilities");
+ return false;
+ }
+ if (!capabilities_status[caps_key].asBool()) {
+ LOG4CXX_DEBUG(logger_,
+ "Capability "
+ << caps_key
+ << " is switched off in RemoteControl capabilities");
+ return false;
+ }
+ }
+ return true;
+}
+
+bool CheckIfModuleDataExistInCapabilities(
+ const smart_objects::SmartObject& rc_capabilities,
+ const Json::Value& module_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ bool is_radio_data_valid = true;
+ bool is_climate_data_valid = true;
+ if (IsMember(module_data, kRadioControlData)) {
+ if (!rc_capabilities.keyExists(strings::kradioControlCapabilities)) {
+ LOG4CXX_DEBUG(logger_, " Radio control capabilities not present");
+ return false;
+ }
+ const smart_objects::SmartObject& radio_caps =
+ rc_capabilities[strings::kradioControlCapabilities];
+ is_radio_data_valid = CheckControlDataByCapabilities(
+ radio_caps, module_data[strings::kRadioControlData]);
+ }
+ if (IsMember(module_data, kClimateControlData)) {
+ if (!rc_capabilities.keyExists(strings::kclimateControlCapabilities)) {
+ LOG4CXX_DEBUG(logger_, " Climate control capabilities not present");
+ return false;
+ }
+ const smart_objects::SmartObject& climate_caps =
+ rc_capabilities[strings::kclimateControlCapabilities];
+ is_climate_data_valid = CheckControlDataByCapabilities(
+ climate_caps, module_data[strings::kClimateControlData]);
+ }
+
+ return is_radio_data_valid && is_climate_data_valid;
+}
+
+void SetInteriorVehicleDataRequest::Execute() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ Json::Value request_params =
+ MessageHelper::StringToValue(message_->json_message());
+ const Json::Value module_data = request_params[kModuleData];
+ const std::string module_type = module_data[kModuleType].asString();
+ bool module_type_and_data_match = true;
+
+ if (enums_value::kRadio == module_type) {
+ module_type_and_data_match = !IsMember(module_data, kClimateControlData);
+ }
+
+ if (enums_value::kClimate == module_type) {
+ module_type_and_data_match = !IsMember(module_data, kRadioControlData);
+ }
+
+ if (module_type_and_data_match) {
+ const smart_objects::SmartObject* capabilities =
+ service()->GetRCCapabilities();
+ if (capabilities &&
+ !CheckIfModuleDataExistInCapabilities(*capabilities, module_data)) {
+ LOG4CXX_WARN(logger_, "Accessing not supported module data");
+ SendResponse(false,
+ result_codes::kUnsupportedResource,
+ "Accessing not supported module data");
+ return;
+ }
+ if (AreAllParamsReadOnly(request_params)) {
+ LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!");
+ SendResponse(false,
+ result_codes::kReadOnly,
+ "All request params in module type are READ ONLY!");
+ return;
+ }
+ if (AreReadOnlyParamsPresent(request_params)) {
+ LOG4CXX_DEBUG(logger_, "Request module type has READ ONLY parameters");
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameters... ");
+ CutOffReadOnlyParams(request_params);
+ }
+ application_manager::MessagePtr hmi_request = CreateHmiRequest(
+ functional_modules::hmi_api::set_interior_vehicle_data, request_params);
+ service()->RemoveHMIFakeParameters(hmi_request);
+ SendMessageToHMI(hmi_request);
+ } else {
+ LOG4CXX_WARN(logger_, "Request module type & data mismatch!");
+ SendResponse(false,
+ result_codes::kInvalidData,
+ "Request module type & data mismatch!");
+ }
+}
+
+AcquireResult::eType SetInteriorVehicleDataRequest::AcquireResource(
+ const Json::Value& message) {
+ return rc_module_.resource_allocation_manager().AcquireResource(
+ ModuleType(message), app()->app_id());
+}
+
+bool SetInteriorVehicleDataRequest::IsResourceFree(
+ const std::string& module_type) const {
+ return rc_module_.resource_allocation_manager().IsResourceFree(module_type);
+}
+
+void SetInteriorVehicleDataRequest::SetResourceState(
+ const Json::Value& message, const ResourceState::eType state) {
+ const std::string& module_type = ModuleType(message);
+ const uint32_t app_id = app()->app_id();
+
+ ResourceAllocationManager& allocation_manager =
+ rc_module_.resource_allocation_manager();
+
+ allocation_manager.SetResourceState(module_type, app_id, state);
+}
+
+bool SetInteriorVehicleDataRequest::AreReadOnlyParamsPresent(
+ const Json::Value& request_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<std::string> module_type_params = ControlData(request_params);
+ std::vector<std::string>::iterator it = module_type_params.begin();
+ std::vector<std::string> ro_params =
+ GetModuleReadOnlyParams(ModuleType(request_params));
+ for (; it != module_type_params.end(); ++it) {
+ if (helpers::in_range(ro_params, *it)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void SetInteriorVehicleDataRequest::CutOffReadOnlyParams(
+ Json::Value& request_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<std::string> module_type_params = ControlData(request_params);
+ std::vector<std::string>::iterator it = module_type_params.begin();
+ const std::string module_type = ModuleType(request_params);
+ std::vector<std::string> ro_params = GetModuleReadOnlyParams(module_type);
+ for (; it != module_type_params.end(); ++it) {
+ if (helpers::in_range(ro_params, *it)) {
+ if (enums_value::kClimate == module_type) {
+ request_params[message_params::kModuleData]
+ [message_params::kClimateControlData].removeMember(*it);
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << *it);
+ } else if (enums_value::kRadio == module_type) {
+ request_params[message_params::kModuleData]
+ [message_params::kRadioControlData].removeMember(*it);
+ LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << *it);
+ }
+ }
+ }
+}
+
+bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly(
+ const Json::Value& request_params) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::vector<std::string> module_type_params = ControlData(request_params);
+ std::vector<std::string>::iterator it = module_type_params.begin();
+ std::vector<std::string> ro_params =
+ GetModuleReadOnlyParams(ModuleType(request_params));
+ for (; it != module_type_params.end(); ++it) {
+ if (!helpers::in_range(ro_params, *it)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+void SetInteriorVehicleDataRequest::OnEvent(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(
+ (functional_modules::hmi_api::set_interior_vehicle_data == event.id()));
+
+ application_manager::Message& hmi_response = *(event.event_message());
+ if (application_manager::MessageValidationResult::SUCCESS !=
+ service()->ValidateMessageBySchema(hmi_response)) {
+ SendResponse(false, result_codes::kGenericError, "");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_, "HMI response is valid");
+ const Json::Value value =
+ MessageHelper::StringToValue(hmi_response.json_message());
+
+ std::string result_code;
+ std::string info;
+
+ const bool is_response_successful = ParseResultCode(value, result_code, info);
+
+ if (is_response_successful) {
+ response_params_[message_params::kModuleData] =
+ value[json_keys::kResult][message_params::kModuleData];
+ }
+
+ SendResponse(is_response_successful, result_code.c_str(), info);
+}
+
+std::string SetInteriorVehicleDataRequest::ModuleType(
+ const Json::Value& message) {
+ const Json::Value& module_data =
+ message.get(message_params::kModuleData, Json::Value(Json::objectValue));
+ return module_data.get(message_params::kModuleType, "").asString();
+}
+
+std::vector<std::string> SetInteriorVehicleDataRequest::ControlData(
+ const Json::Value& message) {
+ Json::Value data =
+ message.get(message_params::kModuleData, Json::Value(Json::objectValue));
+ std::string module = ModuleType(message);
+ Json::Value params;
+ if (module == enums_value::kRadio) {
+ params = data.get(message_params::kRadioControlData,
+ Json::Value(Json::objectValue));
+ }
+ if (module == enums_value::kClimate) {
+ params = data.get(message_params::kClimateControlData,
+ Json::Value(Json::objectValue));
+ }
+ return params.getMemberNames();
+}
+
+} // namespace commands
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc
new file mode 100644
index 0000000000..140e0a977a
--- /dev/null
+++ b/src/components/remote_control/src/message_helper.cc
@@ -0,0 +1,154 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <string>
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_module_constants.h"
+#include "utils/make_shared.h"
+
+namespace remote_control {
+using functional_modules::RCFunctionID;
+namespace {
+std::map<RCFunctionID, std::string> GenerateAPINames() {
+ std::map<RCFunctionID, std::string> result;
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::BUTTON_PRESS, "ButtonPress"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::GET_INTERIOR_VEHICLE_DATA, "GetInteriorVehicleData"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::SET_INTERIOR_VEHICLE_DATA, "SetInteriorVehicleData"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::ON_INTERIOR_VEHICLE_DATA, "OnInteriorVehicleData"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSettings"));
+ return result;
+}
+
+std::map<std::string, hmi_apis::Common_RCAccessMode::eType> access_modes{
+ {enums_value::kAutoAllow, hmi_apis::Common_RCAccessMode::AUTO_ALLOW},
+ {enums_value::kAutoDeny, hmi_apis::Common_RCAccessMode::AUTO_DENY},
+ {enums_value::kAskDriver, hmi_apis::Common_RCAccessMode::ASK_DRIVER}};
+}
+
+const std::map<RCFunctionID, std::string> MessageHelper::kMobileAPINames =
+ GenerateAPINames();
+
+const std::string MessageHelper::GetMobileAPIName(RCFunctionID func_id) {
+ std::map<RCFunctionID, std::string>::const_iterator it =
+ kMobileAPINames.find(func_id);
+ if (kMobileAPINames.end() != it) {
+ return it->second;
+ } else {
+ return "";
+ }
+}
+
+std::string MessageHelper::ValueToString(const Json::Value& value) {
+ Json::FastWriter writer;
+
+ return writer.write(value);
+}
+
+Json::Value MessageHelper::StringToValue(const std::string& string) {
+ Json::Reader reader;
+ Json::Value json;
+
+ return reader.parse(string, json) ? json
+ : Json::Value(Json::ValueType::nullValue);
+}
+
+bool IsMember(const Json::Value& value, const std::string& key) {
+ if (!value.isObject()) {
+ return false;
+ }
+
+ return value.isMember(key);
+}
+
+application_manager::MessagePtr MessageHelper::CreateHmiRequest(
+ const char* function_id,
+ const uint32_t hmi_app_id,
+ const Json::Value& message_params,
+ RemotePluginInterface& rc_module) {
+ using namespace json_keys;
+ Json::Value msg;
+
+ msg[json_keys::kId] = rc_module.service()->GetNextCorrelationID();
+
+ msg[json_keys::kJsonrpc] = "2.0";
+ msg[json_keys::kMethod] = function_id;
+ if (!message_params.isNull()) {
+ msg[json_keys::kParams] = message_params;
+ }
+
+ msg[json_keys::kParams][json_keys::kAppId] = hmi_app_id;
+
+ Json::FastWriter writer;
+ application_manager::MessagePtr message_to_send =
+ utils::MakeShared<application_manager::Message>(
+ application_manager::Message(
+ protocol_handler::MessagePriority::kDefault));
+ message_to_send->set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
+ message_to_send->set_correlation_id(msg[json_keys::kId].asInt());
+ message_to_send->set_function_name(msg[json_keys::kMethod].asString());
+ std::string json_msg = writer.write(msg);
+ message_to_send->set_json_message(json_msg);
+ message_to_send->set_message_type(application_manager::MessageType::kRequest);
+
+ return message_to_send;
+}
+
+hmi_apis::Common_RCAccessMode::eType MessageHelper::AccessModeFromString(
+ const std::string& access_mode) {
+ std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
+ mode = access_modes.find(access_mode);
+ return access_modes.end() != mode
+ ? mode->second
+ : hmi_apis::Common_RCAccessMode::INVALID_ENUM;
+}
+
+std::string MessageHelper::AccessModeToString(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
+ it = access_modes.begin();
+ for (; access_modes.end() != it; ++it) {
+ if (access_mode == it->second) {
+ return it->first;
+ }
+ }
+ const std::string error = "UNKNOW_ACCESS_MODE";
+ DCHECK_OR_RETURN(false, error);
+ return error;
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/module_helper.cc b/src/components/remote_control/src/module_helper.cc
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/components/remote_control/src/module_helper.cc
diff --git a/src/components/remote_control/src/rc_app_extension.cc b/src/components/remote_control/src/rc_app_extension.cc
new file mode 100644
index 0000000000..3431a713f9
--- /dev/null
+++ b/src/components/remote_control/src/rc_app_extension.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/rc_app_extension.h"
+
+namespace remote_control {
+RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid)
+ : AppExtension(uid) {}
+
+void RCAppExtension::SubscribeToInteriorVehicleData(
+ const Json::Value& module_type) {
+ subscribed_interior_vehicle_data_.insert(module_type);
+}
+
+void RCAppExtension::UnsubscribeFromInteriorVehicleData(
+ const Json::Value& module_type) {
+ subscribed_interior_vehicle_data_.erase(module_type);
+}
+
+void RCAppExtension::UnsubscribeFromInteriorVehicleData() {
+ subscribed_interior_vehicle_data_.clear();
+}
+
+bool RCAppExtension::IsSubscibedToInteriorVehicleData(
+ const Json::Value& module_type) {
+ std::set<Json::Value>::iterator it =
+ subscribed_interior_vehicle_data_.find(module_type);
+
+ return (it != subscribed_interior_vehicle_data_.end());
+}
+
+RCAppExtension::~RCAppExtension() {}
+} // namespace remote_control
diff --git a/src/components/remote_control/src/rc_command_factory.cc b/src/components/remote_control/src/rc_command_factory.cc
new file mode 100644
index 0000000000..93b90b64ac
--- /dev/null
+++ b/src/components/remote_control/src/rc_command_factory.cc
@@ -0,0 +1,86 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "remote_control/rc_command_factory.h"
+#include "functional_module/function_ids.h"
+#include "remote_control/commands/get_interior_vehicle_data_request.h"
+#include "remote_control/commands/set_interior_vehicle_data_request.h"
+#include "remote_control/commands/button_press_request.h"
+#include "remote_control/commands/on_interior_vehicle_data_notification.h"
+#include "remote_control/commands/on_remote_control_settings_notification.h"
+
+namespace remote_control {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl")
+
+using functional_modules::RCFunctionID;
+
+utils::SharedPtr<commands::Command> RCCommandFactory::CreateCommand(
+ const application_manager::MessagePtr& msg,
+ RemotePluginInterface& rc_module) {
+ switch (msg->function_id()) {
+ case RCFunctionID::GET_INTERIOR_VEHICLE_DATA: {
+ return utils::MakeShared<commands::GetInteriorVehicleDataRequest>(
+ msg, rc_module);
+ break;
+ }
+ case RCFunctionID::SET_INTERIOR_VEHICLE_DATA: {
+ return utils::MakeShared<commands::SetInteriorVehicleDataRequest>(
+ msg, rc_module);
+ break;
+ }
+ case RCFunctionID::BUTTON_PRESS: {
+ return utils::MakeShared<commands::ButtonPressRequest>(msg, rc_module);
+ break;
+ }
+ case RCFunctionID::ON_INTERIOR_VEHICLE_DATA: {
+ return utils::MakeShared<commands::OnInteriorVehicleDataNotification>(
+ msg, rc_module);
+ break;
+ }
+ case RCFunctionID::ON_REMOTE_CONTROL_SETTINGS: {
+ return utils::MakeShared<commands::OnRemoteControlSettingsNotification>(
+ msg, rc_module);
+ break;
+ }
+ default: {
+ utils::SharedPtr<commands::Command> invalid_command;
+ LOG4CXX_DEBUG(logger_,
+ "RSDL unable to proces function " << msg->function_id());
+ return invalid_command;
+ }
+ }
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/remote_control_event.cc b/src/components/remote_control/src/remote_control_event.cc
new file mode 100644
index 0000000000..e4f887ffc6
--- /dev/null
+++ b/src/components/remote_control/src/remote_control_event.cc
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/remote_control_event.h"
+
+namespace remote_control {
+
+RCPluginEvent::RCPluginEvent(application_manager::MessagePtr& message,
+ const std::string& id)
+ : rc_event_engine::Event<application_manager::MessagePtr, std::string>(
+ message, id) {}
+
+RCPluginEvent::~RCPluginEvent() {}
+
+int32_t RCPluginEvent::event_message_function_id() const {
+ return event_message_->function_id();
+}
+
+int32_t RCPluginEvent::event_message_correlation_id() const {
+ return event_message_->correlation_id();
+}
+
+int32_t RCPluginEvent::event_message_type() const {
+ return event_message_->type();
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc
new file mode 100644
index 0000000000..c885d724ad
--- /dev/null
+++ b/src/components/remote_control/src/remote_control_plugin.cc
@@ -0,0 +1,341 @@
+/*
+ Copyright (c) 2017, Ford Motor Company
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with the
+ distribution.
+
+ Neither the name of the Ford Motor Company nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/remote_control_plugin.h"
+#include "remote_control/rc_command_factory.h"
+#include "remote_control/remote_control_event.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/message_helper.h"
+#include "utils/logger.h"
+#include "interfaces/MOBILE_API.h"
+#include "utils/macro.h"
+#include "utils/make_shared.h"
+#include "application_manager/smart_object_keys.h"
+
+namespace remote_control {
+
+using functional_modules::ProcessResult;
+using functional_modules::GenericModule;
+using functional_modules::PluginInfo;
+using functional_modules::RCFunctionID;
+namespace hmi_api = functional_modules::hmi_api;
+
+using namespace json_keys;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl");
+
+EXPORT_FUNCTION_IMPL(remote_control::RemoteControlPlugin);
+
+RemoteControlPlugin::RemoteControlPlugin()
+ : is_scan_started_(false), resource_allocation_manager_(*this) {
+ plugin_info_.name = "RemoteControlPlugin";
+ plugin_info_.version = 1;
+ SubscribeOnFunctions();
+}
+
+void RemoteControlPlugin::SubscribeOnFunctions() {
+ plugin_info_.rc_function_list.push_back(RCFunctionID::BUTTON_PRESS);
+ plugin_info_.rc_function_list.push_back(
+ RCFunctionID::GET_INTERIOR_VEHICLE_DATA);
+ plugin_info_.rc_function_list.push_back(
+ RCFunctionID::SET_INTERIOR_VEHICLE_DATA);
+ plugin_info_.rc_function_list.push_back(
+ RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
+
+ plugin_info_.hmi_function_list.push_back(hmi_api::get_interior_vehicle_data);
+ plugin_info_.hmi_function_list.push_back(hmi_api::set_interior_vehicle_data);
+ plugin_info_.hmi_function_list.push_back(hmi_api::on_interior_vehicle_data);
+ plugin_info_.hmi_function_list.push_back(hmi_api::button_press);
+ plugin_info_.hmi_function_list.push_back(hmi_api::get_user_consent);
+ plugin_info_.hmi_function_list.push_back(hmi_api::on_remote_control_settings);
+}
+
+RemoteControlPlugin::~RemoteControlPlugin() {
+ RemoveAppExtensions();
+}
+
+functional_modules::PluginInfo RemoteControlPlugin::GetPluginInfo() const {
+ return plugin_info_;
+}
+
+const std::string ExtractFunctionAndAddMetadata(
+ const Json::Value& value, application_manager::Message& out_msg) {
+ if (value.isMember(json_keys::kMethod)) {
+ const std::string& function_name =
+ value.get(json_keys::kMethod, "").asCString();
+
+ // Existence of method name must be guaranteed by plugin manager
+ DCHECK_OR_RETURN(!function_name.empty(), "");
+
+ if (value.isMember(json_keys::kId)) {
+ out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt());
+ out_msg.set_message_type(application_manager::MessageType::kRequest);
+ } else {
+ out_msg.set_message_type(application_manager::MessageType::kNotification);
+ }
+ return function_name;
+ }
+
+ if (value.isMember(json_keys::kResult)) {
+ const Json::Value& result = value.get(json_keys::kResult, Json::Value());
+ const std::string& function_name =
+ result.get(json_keys::kMethod, "").asCString();
+ out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt());
+
+ // Existence of method name must be guaranteed by plugin manager
+ DCHECK_OR_RETURN(!function_name.empty(), "");
+
+ out_msg.set_message_type(application_manager::MessageType::kResponse);
+ return function_name;
+ }
+
+ if (value.isMember(json_keys::kError)) {
+ const Json::Value& error = value.get(json_keys::kError, Json::Value());
+ const Json::Value& data = error.get(json_keys::kData, Json::Value());
+ const std::string& function_name =
+ data.get(json_keys::kMethod, "").asCString();
+
+ // Existence of method name must be guaranteed by plugin manager
+ DCHECK_OR_RETURN(!function_name.empty(), "");
+
+ out_msg.set_message_type(application_manager::MessageType::kErrorResponse);
+ out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt());
+ return function_name;
+ }
+ return std::string();
+}
+
+ProcessResult RemoteControlPlugin::ProcessMessage(
+ application_manager::MessagePtr msg) {
+ DCHECK_OR_RETURN(msg, ProcessResult::FAILED);
+
+ const std::string& function_name = MessageHelper::GetMobileAPIName(
+ static_cast<functional_modules::RCFunctionID>(msg->function_id()));
+
+ LOG4CXX_DEBUG(logger_, "Function name to set : " << function_name);
+ msg->set_function_name(function_name);
+
+ LOG4CXX_DEBUG(logger_, "Mobile message: " << msg->json_message());
+
+ request_controller::MobileRequestPtr command(
+ RCCommandFactory::CreateCommand(msg, *this));
+ if (command) {
+ request_controller_.AddRequest(msg->correlation_id(), command);
+ command->Run();
+ } else {
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ return ProcessResult::PROCESSED;
+}
+
+ProcessResult RemoteControlPlugin::ProcessHMIMessage(
+ application_manager::MessagePtr msg) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ Json::Value value;
+ Json::Reader reader;
+ reader.parse(msg->json_message(), value);
+ LOG4CXX_TRACE(logger_, "Process " << msg->json_message());
+ const std::string& function_name = ExtractFunctionAndAddMetadata(value, *msg);
+
+ // Existence of method name must be guaranteed by plugin manager
+ DCHECK_OR_RETURN(!function_name.empty(), ProcessResult::FAILED);
+
+ LOG4CXX_DEBUG(logger_, "Process " << function_name);
+
+ switch (msg->type()) {
+ case application_manager::MessageType::kResponse:
+ case application_manager::MessageType::kErrorResponse: {
+ RCPluginEvent event(msg, function_name);
+ LOG4CXX_DEBUG(logger_, "Response received");
+ event_dispatcher_.raise_event(event);
+ return ProcessResult::PROCESSED;
+ }
+ case application_manager::MessageType::kRequest:
+ case application_manager::MessageType::kNotification: {
+ if (hmi_api::on_interior_vehicle_data == function_name) {
+ msg->set_function_id(functional_modules::ON_INTERIOR_VEHICLE_DATA);
+ }
+ if (hmi_api::on_remote_control_settings == function_name) {
+ msg->set_function_id(functional_modules::ON_REMOTE_CONTROL_SETTINGS);
+ }
+ const application_manager::MessageValidationResult validation_result =
+ service()->ValidateMessageBySchema(*msg);
+ utils::SharedPtr<commands::Command> command =
+ RCCommandFactory::CreateCommand(msg, *this);
+ if ((validation_result ==
+ application_manager::MessageValidationResult::SUCCESS) &&
+ command) {
+ command->Run();
+ return ProcessResult::PROCESSED;
+ }
+ LOG4CXX_DEBUG(logger_, "Message validation failed");
+ break;
+ }
+ default: { LOG4CXX_DEBUG(logger_, "Unknown message type"); }
+ }
+ return ProcessResult::CANNOT_PROCESS;
+}
+
+void RemoteControlPlugin::SendHmiStatusNotification(
+ application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager::MessagePtr msg = new application_manager::Message(
+ protocol_handler::MessagePriority::kDefault);
+ Json::Value msg_params;
+
+ msg->set_function_id(mobile_apis::FunctionID::OnHMIStatusID);
+ msg->set_message_type(application_manager::MessageType::kNotification);
+
+ msg->set_connection_key(app->app_id());
+ msg->set_protocol_version(app->protocol_version());
+
+ msg_params["hmiLevel"] = static_cast<uint32_t>(app->hmi_level());
+
+ msg_params["audioStreamingState"] =
+ static_cast<uint32_t>(app->audio_streaming_state());
+
+ msg_params["systemContext"] = static_cast<uint32_t>(app->system_context());
+
+ msg->set_json_message(MessageHelper::ValueToString(msg_params));
+
+ service()->SendMessageToMobile(msg);
+}
+
+void RemoteControlPlugin::SendResponseToMobile(
+ application_manager::MessagePtr msg) {
+ LOG4CXX_DEBUG(logger_, "Response to mobile: " << msg->json_message());
+ service()->SendMessageToMobile(msg);
+ request_controller_.DeleteRequest(msg->correlation_id());
+}
+
+void RemoteControlPlugin::SendTimeoutResponseToMobile(
+ application_manager::MessagePtr msg) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Timeout is expired. Response to mobile: " << msg->json_message());
+ service()->SendMessageToMobile(msg);
+}
+
+void RemoteControlPlugin::RemoveAppExtensions() {
+ std::vector<application_manager::ApplicationSharedPtr> applications =
+ service()->GetApplications(GetModuleID());
+
+ std::vector<application_manager::ApplicationSharedPtr>::iterator it =
+ applications.begin();
+
+ for (; it != applications.end(); ++it) {
+ application_manager::ApplicationSharedPtr app = *it;
+ if (app) {
+ app->RemoveExtension(GetModuleID());
+ }
+ }
+}
+
+void RemoteControlPlugin::RemoveAppExtension(uint32_t app_id) {
+ application_manager::ApplicationSharedPtr app =
+ service()->GetApplication(app_id);
+
+ if (app) {
+ app->RemoveExtension(GetModuleID());
+ }
+}
+
+bool RemoteControlPlugin::IsAppForPlugin(
+ application_manager::ApplicationSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ application_manager::AppExtensionPtr app_extension =
+ app->QueryInterface(GetModuleID());
+ if (app_extension) {
+ return true;
+ }
+
+ if (service()->IsRemoteControlApplication(app)) {
+ RCAppExtensionPtr rc_app_extension = new RCAppExtension(GetModuleID());
+ app->AddExtension(rc_app_extension);
+ return true;
+ }
+ return false;
+}
+
+void RemoteControlPlugin::OnAppHMILevelChanged(
+ application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType) {
+ LOG4CXX_DEBUG(logger_,
+ "RSDL application " << app->name().AsMBString()
+ << " has changed hmi level to "
+ << app->hmi_level());
+ service()->NotifyHMIAboutHMILevel(app, app->hmi_level());
+}
+
+void RemoteControlPlugin::OnPluginServiceChanged() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const functional_modules::TimeUnit timeout_msec =
+ service()->GetSettings().default_timeout();
+ request_controller_.SetRequestTimeout(timeout_msec / 1000);
+}
+
+void RemoteControlPlugin::set_service(application_manager::ServicePtr service) {
+ RemotePluginInterface::set_service(service);
+ OnPluginServiceChanged();
+}
+
+RCEventDispatcher& RemoteControlPlugin::event_dispatcher() {
+ return event_dispatcher_;
+}
+
+ResourceAllocationManager& RemoteControlPlugin::resource_allocation_manager() {
+ return resource_allocation_manager_;
+}
+
+void RemoteControlPlugin::OnApplicationEvent(
+ functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (false == service()->IsRemoteControlApplication(application)) {
+ LOG4CXX_DEBUG(logger_,
+ "Application " << application->app_id()
+ << " has no remote control functionality."
+ << " Event will be ignored for RC plugin");
+ return;
+ }
+ resource_allocation_manager_.OnApplicationEvent(event, application);
+}
+
+void RemoteControlPlugin::OnPolicyEvent(functional_modules::PolicyEvent event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ resource_allocation_manager_.OnPolicyEvent(event);
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/src/request_controller.cc b/src/components/remote_control/src/request_controller.cc
new file mode 100644
index 0000000000..9ffc639898
--- /dev/null
+++ b/src/components/remote_control/src/request_controller.cc
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/request_controller.h"
+#include "json/json.h"
+#include "utils/logger.h"
+
+namespace remote_control {
+namespace request_controller {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RCRequestController")
+
+RequestController::RequestController() {
+ timer_.AddObserver(this);
+ time_director_.RegisterTimer(timer_);
+}
+
+RequestController::~RequestController() {
+ time_director_.UnregisterTimer(timer_);
+ timer_.RemoveObserver(this);
+}
+
+void RequestController::AddRequest(const uint32_t mobile_correlation_id,
+ MobileRequestPtr request) {
+ // TODO(VS) Research and fix be problem with overlap correlation ids from two
+ // different apllications(on two different mobile devices)
+ sync_primitives::AutoLock lock(mobile_request_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "Add request with correlation_id: " << mobile_correlation_id);
+ mobile_request_list_[mobile_correlation_id] = request;
+ // TODO(VS): add app id
+ timer_.AddTrackable(TrackableMessage(0, mobile_correlation_id));
+ time_director_.ResetTimer(timer_);
+}
+
+void RequestController::DeleteRequest(const uint32_t& mobile_correlation_id) {
+ sync_primitives::AutoLock lock(mobile_request_lock_);
+ LOG4CXX_DEBUG(
+ logger_, "Delete request with correlation_id: " << mobile_correlation_id);
+ mobile_request_list_.erase(mobile_correlation_id);
+ // TODO(VS): add app id
+ timer_.RemoveTrackable(TrackableMessage(0, mobile_correlation_id));
+}
+
+void RequestController::OnTimeoutTriggered(const TrackableMessage& expired) {
+ sync_primitives::AutoLock lock(mobile_request_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "Timeout is expired for request with correlation_id: "
+ << expired.correlation_id());
+ std::map<correlation_id, MobileRequestPtr>::iterator it =
+ mobile_request_list_.find(expired.correlation_id());
+ if (mobile_request_list_.end() == it) {
+ // no corresponding request found, error.
+ return;
+ }
+ it->second->OnTimeout();
+ mobile_request_list_.erase(it);
+}
+
+void RequestController::SetRequestTimeout(
+ const functional_modules::TimeUnit timeout_seconds) {
+ LOG4CXX_DEBUG(logger_, "RC request timeout is set to " << timeout_seconds);
+ timer_.set_period(timeout_seconds);
+}
+
+} // namespace request_controller
+} // namespace remote_control
diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc
new file mode 100644
index 0000000000..233cc79764
--- /dev/null
+++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc
@@ -0,0 +1,377 @@
+#include "remote_control/resource_allocation_manager_impl.h"
+#include "application_manager/application.h"
+#include "application_manager/message_helper.h"
+#include "remote_control/rc_module_constants.h"
+#include "json/json.h"
+#include "utils/helpers.h"
+#include "utils/make_shared.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_app_extension.h"
+
+namespace remote_control {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+ResourceAllocationManagerImpl::ResourceAllocationManagerImpl(
+ RemotePluginInterface& rc_plugin)
+ : current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW)
+ , rc_plugin_(rc_plugin) {}
+
+ResourceAllocationManagerImpl::~ResourceAllocationManagerImpl() {}
+
+AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const application_manager::ApplicationSharedPtr acquiring_app =
+ rc_plugin_.service()->GetApplication(app_id);
+ if (!acquiring_app) {
+ LOG4CXX_WARN(logger_, "App with app_id: " << app_id << "does not exist!");
+ return AcquireResult::IN_USE;
+ }
+
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const AllocatedResources::const_iterator allocated_it =
+ allocated_resources_.find(module_type);
+ if (allocated_resources_.end() == allocated_it) {
+ allocated_resources_[module_type] = app_id;
+ LOG4CXX_DEBUG(logger_,
+ "Resource is not acquired yet. "
+ << "App: " << app_id << " is allowed to acquire "
+ << module_type);
+ return AcquireResult::ALLOWED;
+ }
+
+ if (app_id == allocated_resources_[module_type]) {
+ LOG4CXX_DEBUG(logger_,
+ "App: " << app_id << " is already acquired resource "
+ << module_type);
+ return AcquireResult::ALLOWED;
+ }
+
+ if (IsModuleTypeRejected(module_type, app_id)) {
+ LOG4CXX_DEBUG(logger_,
+ "Driver disallowed app: " << app_id << " to acquire "
+ << module_type);
+ return AcquireResult::REJECTED;
+ }
+
+ const mobile_apis::HMILevel::eType acquiring_app_hmi_level =
+ acquiring_app->hmi_level();
+
+ if (mobile_apis::HMILevel::HMI_FULL != acquiring_app_hmi_level) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Aquiring resources is not allowed in HMI level: "
+ << application_manager::MessageHelper::StringifiedHMILevel(
+ acquiring_app_hmi_level) << ". App: " << app_id
+ << " is disallowed to acquire " << module_type);
+ return AcquireResult::REJECTED;
+ }
+
+ switch (current_access_mode_) {
+ case hmi_apis::Common_RCAccessMode::AUTO_DENY: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is AUTO_DENY. "
+ << "App: " << app_id << " is disallowed to acquire "
+ << module_type);
+ return AcquireResult::IN_USE;
+ }
+ case hmi_apis::Common_RCAccessMode::ASK_DRIVER: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is ASK_DRIVER. "
+ "Driver confirmation is required for app: "
+ << app_id << " to acquire " << module_type);
+ return AcquireResult::ASK_DRIVER;
+ }
+ case hmi_apis::Common_RCAccessMode::AUTO_ALLOW: {
+ LOG4CXX_DEBUG(logger_,
+ "Current access_mode is AUTO_ALLOW. "
+ << "App: " << app_id << " is allowed to acquire "
+ << module_type);
+
+ allocated_resources_[module_type] = app_id;
+ return AcquireResult::ALLOWED;
+ }
+ default: { DCHECK_OR_RETURN(false, AcquireResult::IN_USE); }
+ }
+}
+
+void ResourceAllocationManagerImpl::ReleaseResource(
+ const std::string& module_type, const uint32_t application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Release " << module_type << " by " << application_id);
+ AllocatedResources::const_iterator allocation =
+ allocated_resources_.find(module_type);
+ if (allocated_resources_.end() == allocation) {
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is not allocated.");
+ return;
+ }
+
+ if (application_id != allocation->second) {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type
+ << " is allocated by different application "
+ << allocation->second);
+ return;
+ }
+
+ allocated_resources_.erase(allocation);
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is released.");
+ return;
+}
+
+void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() {
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+ Apps app_list =
+ rc_plugin_.service()->GetApplications(rc_plugin_.GetModuleID());
+ Apps::const_iterator app = app_list.begin();
+ for (; app_list.end() != app; ++app) {
+ application_manager::ApplicationSharedPtr app_ptr = *app;
+ const uint32_t application_id = app_ptr->app_id();
+ Resources acquired_modules = GetAcquiredResources(application_id);
+ std::sort(acquired_modules.begin(), acquired_modules.end());
+
+ Resources allowed_modules;
+ rc_plugin_.service()->GetModuleTypes((*app)->policy_app_id(),
+ &allowed_modules);
+ std::sort(allowed_modules.begin(), allowed_modules.end());
+
+ LOG4CXX_DEBUG(logger_,
+ "Acquired modules: " << acquired_modules.size()
+ << " , allowed modules: "
+ << allowed_modules.size());
+
+ Resources disallowed_modules;
+ std::set_difference(acquired_modules.begin(),
+ acquired_modules.end(),
+ allowed_modules.begin(),
+ allowed_modules.end(),
+ std::back_inserter(disallowed_modules));
+
+ RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
+ Resources::const_iterator module = disallowed_modules.begin();
+ for (; disallowed_modules.end() != module; ++module) {
+ ReleaseResource(*module, application_id);
+ if (rc_extention) {
+ rc_extention->UnsubscribeFromInteriorVehicleData(Json::Value(*module));
+ }
+ }
+ }
+}
+
+RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention(
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ RCAppExtensionPtr rc_app_extension;
+ if (!application) {
+ return rc_app_extension;
+ }
+
+ application_manager::AppExtensionPtr app_extension =
+ application->QueryInterface(rc_plugin_.GetModuleID());
+ if (!app_extension) {
+ return rc_app_extension;
+ }
+
+ rc_app_extension =
+ application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
+ app_extension);
+
+ return rc_app_extension;
+}
+
+void ResourceAllocationManagerImpl::RemoveAppsSubscriptions(const Apps& apps) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Apps::const_iterator app = apps.begin();
+ for (; apps.end() != app; ++app) {
+ application_manager::ApplicationSharedPtr app_ptr = *app;
+ if (!app_ptr) {
+ continue;
+ }
+ RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
+ if (rc_extention) {
+ rc_extention->UnsubscribeFromInteriorVehicleData();
+ }
+ }
+}
+
+std::vector<std::string> ResourceAllocationManagerImpl::GetAcquiredResources(
+ const uint32_t application_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Resources allocated_resources;
+ AllocatedResources::const_iterator allocation = allocated_resources_.begin();
+ for (; allocated_resources_.end() != allocation; ++allocation) {
+ if (application_id == allocation->second) {
+ allocated_resources.push_back(allocation->first);
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application " << application_id << " acquired "
+ << allocated_resources.size()
+ << " resource(s).");
+
+ return allocated_resources;
+}
+
+void ResourceAllocationManagerImpl::SetResourceState(
+ const std::string& module_type,
+ const uint32_t app_id,
+ const ResourceState::eType state) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Setting state for " << module_type << " by app_id " << app_id
+ << " to state " << state);
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const AllocatedResources::const_iterator allocated_it =
+ allocated_resources_.find(module_type);
+
+ const bool acquired = allocated_resources_.end() != allocated_it;
+ if (acquired) {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is already acquired."
+ << " Owner application id is "
+ << allocated_it->second
+ << " Changing application id is " << app_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is not acquired yet");
+ }
+ }
+
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ resources_state_[module_type] = state;
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " got state " << state);
+}
+
+bool ResourceAllocationManagerImpl::IsResourceFree(
+ const std::string& module_type) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ const ResourcesState::const_iterator resource =
+ resources_state_.find(module_type);
+
+ if (resources_state_.end() == resource) {
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is free.");
+ return true;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " state is " << resource->second);
+
+ return ResourceState::FREE == resource->second;
+}
+
+void ResourceAllocationManagerImpl::SetAccessMode(
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ if (hmi_apis::Common_RCAccessMode::ASK_DRIVER != access_mode) {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+ current_access_mode_ = access_mode;
+}
+
+hmi_apis::Common_RCAccessMode::eType
+ResourceAllocationManagerImpl::GetAccessMode() const {
+ return current_access_mode_;
+}
+
+void ResourceAllocationManagerImpl::ForceAcquireResource(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type);
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ allocated_resources_[module_type] = app_id;
+}
+
+bool ResourceAllocationManagerImpl::IsModuleTypeRejected(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ RejectedResources::iterator it =
+ rejected_resources_for_application_.find(app_id);
+
+ if (rejected_resources_for_application_.end() == it) {
+ return false;
+ }
+
+ const std::vector<std::string>& list_of_rejected_resources =
+ rejected_resources_for_application_[app_id];
+
+ return helpers::in_range(list_of_rejected_resources, module_type);
+}
+
+void ResourceAllocationManagerImpl::OnDriverDisallowed(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ RejectedResources::iterator it =
+ rejected_resources_for_application_.find(app_id);
+
+ if (rejected_resources_for_application_.end() == it) {
+ rejected_resources_for_application_[app_id] = std::vector<std::string>();
+ }
+ std::vector<std::string>& list_of_rejected_resources =
+ rejected_resources_for_application_[app_id];
+ list_of_rejected_resources.push_back(module_type);
+}
+
+void ResourceAllocationManagerImpl::OnApplicationEvent(
+ functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Event " << event << " came for " << application->app_id());
+
+ if (functional_modules::ApplicationEvent::kApplicationExit == event ||
+ functional_modules::ApplicationEvent::kApplicationUnregistered == event) {
+ Resources acquired_modules = GetAcquiredResources(application->app_id());
+ Resources::const_iterator module = acquired_modules.begin();
+ for (; acquired_modules.end() != module; ++module) {
+ ReleaseResource(*module, application->app_id());
+ }
+
+ Apps app_list;
+ app_list.push_back(application);
+ RemoveAppsSubscriptions(app_list);
+ }
+}
+
+void ResourceAllocationManagerImpl::OnPolicyEvent(
+ functional_modules::PolicyEvent event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Event " << event);
+
+ if (functional_modules::PolicyEvent::kApplicationPolicyUpdated == event) {
+ ProcessApplicationPolicyUpdate();
+ return;
+ }
+
+ if (functional_modules::PolicyEvent::kApplicationsDisabled == event) {
+ ResetAllAllocations();
+ application_manager::ServicePtr s = rc_plugin_.service();
+ Apps app_list = s->GetApplications(rc_plugin_.GetModuleID());
+ RemoveAppsSubscriptions(app_list);
+ return;
+ }
+}
+
+void ResourceAllocationManagerImpl::ResetAllAllocations() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ resources_state_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ allocated_resources_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/test/CMakeLists.txt b/src/components/remote_control/test/CMakeLists.txt
new file mode 100644
index 0000000000..6457b56397
--- /dev/null
+++ b/src/components/remote_control/test/CMakeLists.txt
@@ -0,0 +1,67 @@
+include_directories (
+ ${LOG4CXX_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/
+ ${CMAKE_SOURCE_DIR}/src/components/functional_module/test/
+ ${CMAKE_SOURCE_DIR}/src/components/remote_control/include/
+ ${CMAKE_SOURCE_DIR}/src/components/remote_control/test/include/
+ ${CMAKE_SOURCE_DIR}/src/components/include/
+ ${CMAKE_SOURCE_DIR}/src/components/application_manager/test/include/
+ ${CMAKE_SOURCE_DIR}/src/components/connection_handler/include/
+ ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/
+ ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/usage_statistics/include/
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${CMAKE_BINARY_DIR}/src/components/
+ include/
+)
+
+set (SOURCES
+ src/rc_module_test.cc
+ src/rc_app_extension_test.cc
+ src/resource_allocation_manager_impl_test.cc
+ ${CMAKE_SOURCE_DIR}/src/components/application_manager/test/mock_message_helper.cc
+)
+
+set (LIBRARIES
+ gtest
+ gmock
+ gmock_main
+ RemoteControlModule
+ SmartObjects
+ gcov
+ Policy
+)
+
+if (ENABLE_TEST_COV_COUNT)
+ set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs")
+else()
+ set(GCOV_FLAGS "")
+endif()
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCOV_FLAGS}")
+
+# use, i.e. don't skip the full RPATH for the build tree
+#SET(CMAKE_SKIP_BUILD_RPATH FALSE)
+
+# when building, don't use the install RPATH already
+# (but later on when installing)
+#SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+
+#SET(RPATH_DIRECTORIES
+# ${CMAKE_BINARY_DIR}/src/components/remote_control/
+# /usr/local/lib
+# /usr/local
+# ${CMAKE_BINARY_DIR}/src/components/utils
+#)
+
+#SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}")
+
+add_custom_command(
+OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libPolicy.so
+ COMMAND ${CMAKE_COMMAND} -E
+ copy ${COMPONENTS_DIR}/policy/libPolicy.so ${CMAKE_CURRENT_BINARY_DIR})
+ set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}")
+
+create_test("remote_control_test" "${SOURCES}" "${LIBRARIES}")
+add_subdirectory(commands)
diff --git a/src/components/remote_control/test/commands/CMakeLists.txt b/src/components/remote_control/test/commands/CMakeLists.txt
new file mode 100644
index 0000000000..09c706fc2f
--- /dev/null
+++ b/src/components/remote_control/test/commands/CMakeLists.txt
@@ -0,0 +1,62 @@
+# Copyright (c) 2017, Ford Motor Company
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided with the
+# distribution.
+#
+# Neither the name of the Ford Motor Company nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+include_directories(
+ ${GMOCK_INCLUDE_DIRECTORY}
+ ${COMPONENTS_DIR}/remote_control/include/
+ ${COMPONENTS_DIR}/remote_control/include/remote_control/
+ ${COMPONENTS_DIR}/remote_control/include/remote_control/commands/
+ ${COMPONENTS_DIR}/remote_control/test/include
+)
+
+set(RC_COMMANDS_TEST_DIR ${RC_TEST_DIR}/commands)
+
+file(GLOB SOURCES
+ ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc
+ ${RC_COMMANDS_TEST_DIR}/*
+)
+
+set(LIBRARIES
+ gmock
+ RemoteControlModule
+ Utils
+ SmartObjects
+ jsoncpp
+ HMI_API
+ MOBILE_API
+ ApplicationManager
+ AMHMICommandsLibrary
+ AMMobileCommandsLibrary
+ connectionHandler
+)
+
+create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" )
diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc
new file mode 100644
index 0000000000..06a48fc077
--- /dev/null
+++ b/src/components/remote_control/test/commands/button_press_request_test.cc
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/button_press_request.h"
+#include "gtest/gtest.h"
+#include "mock_remote_control_plugin.h"
+#include "mock_application.h"
+#include "mock_resource_allocation_manager.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/remote_control_event.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_command_factory.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "remote_control/rc_module_constants.h"
+#include "functional_module/function_ids.h"
+#include "include/mock_service.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+using functional_modules::RCFunctionID;
+using application_manager::ServicePtr;
+
+using application_manager::MockService;
+using test::components::remote_control_test::MockApplication;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::protocol_handler::MessagePriority;
+using remote_control::RemotePluginInterface;
+using remote_control::MessageHelper;
+
+namespace {
+const int kModuleId = 153;
+
+const std::string kCorrectMobileRequest =
+ "{\"moduleType\":\"CLIMATE\",\"buttonName\":\"AC\",\"buttonPressMode\":"
+ "\"SHORT\"}";
+const std::string kWrongMobileRequest =
+ "{\"moduleType\":\"RADIO\",\"buttonName\":\"AC\",\"buttonPressMode\":"
+ "\"SHORT\"}";
+const std::string kValidHmiResponse =
+ "{\"result\":{\"code\":0,\"method\":\"Buttons.ButtonPress\"},\"id\":31,"
+ "\"jsonrpc\":\"2.0\"} ";
+const std::string KReadOnlyHmiResponse =
+ "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":26,\"data\":{\"method\":"
+ "\"Buttons.ButtonPress\"},\"message\":\"Read only parameters "
+ "received\"},\"id\":31}";
+const uint32_t kAppId = 11u;
+}
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+namespace button_press_request_test {
+
+class ButtonPressRequestTest : public ::testing::Test {
+ public:
+ ButtonPressRequestTest()
+ : rc_capabilities_(smart_objects::SmartType_Map)
+ , mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
+ ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
+ ON_CALL(mock_module_, resource_allocation_manager())
+ .WillByDefault(ReturnRef(mock_allocation_manager_));
+ ON_CALL(*mock_service_, GetApplication(kAppId))
+ .WillByDefault(Return(mock_app_));
+ EXPECT_CALL(mock_module_, event_dispatcher())
+ .WillRepeatedly(ReturnRef(event_dispatcher_));
+ ServicePtr exp_service(mock_service_);
+ mock_module_.set_service(exp_service);
+ }
+
+ smart_objects::SmartObject ButtonCapability(
+ const mobile_apis::ButtonName::eType button_name) {
+ smart_objects::SmartObject button(smart_objects::SmartType_Map);
+ button["name"] = button_name;
+ return button;
+ }
+
+ void SetUp() OVERRIDE {
+ using namespace remote_control;
+ using namespace mobile_apis;
+
+ std::vector<ButtonName::eType> button_names;
+ button_names.push_back(ButtonName::AC_MAX);
+ button_names.push_back(ButtonName::AC);
+ button_names.push_back(ButtonName::RECIRCULATE);
+ button_names.push_back(ButtonName::FAN_UP);
+ button_names.push_back(ButtonName::FAN_DOWN);
+ button_names.push_back(ButtonName::TEMP_UP);
+ button_names.push_back(ButtonName::TEMP_DOWN);
+ button_names.push_back(ButtonName::DEFROST_MAX);
+ button_names.push_back(ButtonName::DEFROST);
+ button_names.push_back(ButtonName::DEFROST_REAR);
+ button_names.push_back(ButtonName::UPPER_VENT);
+ button_names.push_back(ButtonName::LOWER_VENT);
+ button_names.push_back(ButtonName::VOLUME_UP);
+ button_names.push_back(ButtonName::VOLUME_DOWN);
+ button_names.push_back(ButtonName::EJECT);
+ button_names.push_back(ButtonName::SOURCE);
+ button_names.push_back(ButtonName::SHUFFLE);
+ button_names.push_back(ButtonName::REPEAT);
+
+ smart_objects::SmartObject button_caps(smart_objects::SmartType_Array);
+ for (size_t i = 0; i < button_names.size(); i++) {
+ button_caps[i] = ButtonCapability(button_names[i]);
+ }
+ rc_capabilities_[strings::kbuttonCapabilities] = button_caps;
+ ON_CALL(*mock_service_, GetRCCapabilities())
+ .WillByDefault(Return(&rc_capabilities_));
+ ON_CALL(*mock_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ }
+
+ remote_control::request_controller::MobileRequestPtr CreateCommand(
+ application_manager::MessagePtr msg) {
+ return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
+ }
+
+ application_manager::MessagePtr CreateBasicMessage() {
+ application_manager::MessagePtr message = utils::MakeShared<Message>(
+ MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
+ message->set_function_id(RCFunctionID::BUTTON_PRESS);
+ message->set_function_name(
+ MessageHelper::GetMobileAPIName(functional_modules::BUTTON_PRESS));
+ message->set_connection_key(kAppId);
+ return message;
+ }
+
+ protected:
+ smart_objects::SmartObject rc_capabilities_;
+ utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ testing::NiceMock<remote_control_test::MockRemotePluginInterface>
+ mock_module_;
+ testing::NiceMock<remote_control_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
+};
+
+TEST_F(ButtonPressRequestTest,
+ Execute_ButtonNameMatchesModuleType_ExpectCorrectMessageSentToHMI) {
+ namespace json_keys = remote_control::json_keys;
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kCorrectMobileRequest);
+ // Expectations
+ ON_CALL(*mock_app_, app_id())
+ .WillByDefault(Return(mobile_message->connection_key()));
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(invalid_ext))
+ .WillRepeatedly(Return(rc_app_extention_));
+ application_manager::AppExtensionPtr app_extension;
+ EXPECT_CALL(*mock_app_, AddExtension(_))
+ .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
+ EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1));
+
+ const std::string resource = "CLIMATE";
+
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId))
+ .WillOnce(Return(remote_control::AcquireResult::ALLOWED));
+ EXPECT_CALL(
+ mock_allocation_manager_,
+ SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY));
+
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+ // Assertions
+ EXPECT_EQ(kModuleId, app_extension->uid());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ result_msg->protocol_version());
+ EXPECT_EQ(1, result_msg->correlation_id());
+ EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
+ const Json::Value& hmi_request_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_EQ(functional_modules::hmi_api::button_press,
+ hmi_request_params[json_keys::kMethod].asString());
+}
+
+TEST_F(
+ ButtonPressRequestTest,
+ Execute_ButtonNameDoesNotMatchModuleType_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ namespace json_keys = remote_control::json_keys;
+ namespace result_codes = remote_control::result_codes;
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kWrongMobileRequest);
+ // Expectations
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(invalid_ext))
+ .WillRepeatedly(Return(rc_app_extention_));
+ application_manager::AppExtensionPtr app_extension;
+ EXPECT_CALL(*mock_app_, AddExtension(_))
+ .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
+ EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillOnce(Return(::remote_control::AcquireResult::ALLOWED));
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+ // Assertions
+ const Json::Value& response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kInvalidData,
+ response_params[json_keys::kResultCode].asString());
+}
+
+TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) {
+ namespace json_keys = remote_control::json_keys;
+ namespace result_codes = remote_control::result_codes;
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kCorrectMobileRequest);
+
+ application_manager::MessagePtr hmi_message = CreateBasicMessage();
+ hmi_message->set_json_message(kValidHmiResponse);
+ hmi_message->set_message_type(application_manager::MessageType::kResponse);
+ // Expectations
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::RCPluginEvent event(
+ hmi_message, functional_modules::hmi_api::button_press);
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->on_event(event);
+ // Assertions
+ const Json::Value& response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_TRUE(response_params[json_keys::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kSuccess,
+ response_params[json_keys::kResultCode].asString());
+}
+
+TEST_F(ButtonPressRequestTest,
+ OnEvent_ReadOnlyParamFromHMI_ExpectFalseSentToMobile) {
+ namespace json_keys = remote_control::json_keys;
+ namespace result_codes = remote_control::result_codes;
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kCorrectMobileRequest);
+
+ application_manager::MessagePtr hmi_message = CreateBasicMessage();
+ hmi_message->set_json_message(KReadOnlyHmiResponse);
+ hmi_message->set_message_type(application_manager::MessageType::kResponse);
+ // Expectations
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::RCPluginEvent event(
+ hmi_message, functional_modules::hmi_api::button_press);
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->on_event(event);
+ // Assertions
+ const Json::Value& response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_FALSE(response_params[json_keys::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kGenericError,
+ response_params[json_keys::kResultCode].asString());
+}
+
+} // namespace button_press_request_test
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
diff --git a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc
new file mode 100644
index 0000000000..4ad833aa60
--- /dev/null
+++ b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/get_interior_vehicle_data_request.h"
+#include "gtest/gtest.h"
+#include "mock_remote_control_plugin.h"
+#include "mock_application.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/remote_control_event.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_command_factory.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "functional_module/function_ids.h"
+#include "include/mock_service.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+using functional_modules::RCFunctionID;
+using application_manager::ServicePtr;
+
+using application_manager::MockService;
+using test::components::remote_control_test::MockApplication;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+using remote_control::RemotePluginInterface;
+using remote_control::MessageHelper;
+using namespace remote_control;
+
+namespace {
+const int32_t kConnectionKey = 5;
+const int kModuleId = 153;
+const std::string kInvalidMobileRequest = "{{\"moduleTip\":\"LUXOFT\"}}";
+const std::string kValidMobileRequest =
+ "{\"subscribe\":true,\"moduleDescription\":{\"moduleType\":\"CLIMATE\"}}";
+const std::string kValidHmiResponse =
+ "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":0,\"method\":\"RC."
+ "GetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
+ "\"climateControlData\":{\"fanSpeed\":0,\"currentTemperature\":{\"unit\":"
+ "\"CELSIUS\",\"value\":20},\"desiredTemperature\":{\"unit\":\"CELSIUS\","
+ "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
+ "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
+ "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":"
+ "true}}";
+const std::string kInvalidHmiResponse =
+ "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":21,\"method\":\"RC."
+ "GetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
+ "\"ControlData\":{\"Speed\":0,\"outsideTemperature\":{\"unit\":"
+ "\"CELSIUS\",\"value\":\"high\"},\"desiredTemperature\":{\"unit\":"
+ "\"CELSIUS\","
+ "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
+ "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
+ "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":"
+ "false}}";
+}
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+namespace get_interior_vehicle_data_request_test {
+
+class GetInteriorVehicleDataRequestTest : public ::testing::Test {
+ public:
+ typedef utils::SharedPtr<remote_control::commands::BaseCommandRequest>
+ GIVDRequestPtr;
+ typedef rc_event_engine::Event<application_manager::MessagePtr, std::string>
+ GIVD_HMI_Response;
+ GetInteriorVehicleDataRequestTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(app_id_));
+ ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
+ ON_CALL(*mock_service_, GetApplication(app_id_))
+ .WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ EXPECT_CALL(mock_module_, event_dispatcher())
+ .WillRepeatedly(ReturnRef(event_dispatcher_));
+ ServicePtr exp_service(mock_service_);
+ mock_module_.set_service(exp_service);
+ }
+
+ remote_control::request_controller::MobileRequestPtr CreateCommand(
+ application_manager::MessagePtr msg) {
+ return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
+ }
+
+ application_manager::MessagePtr CreateBasicMessage() {
+ application_manager::MessagePtr message = utils::MakeShared<Message>(
+ MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
+ message->set_connection_key(kConnectionKey);
+ message->set_function_id(RCFunctionID::GET_INTERIOR_VEHICLE_DATA);
+ message->set_function_name("GetInteriorVehicleData");
+ return message;
+ }
+
+ protected:
+ utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ remote_control_test::MockRemotePluginInterface mock_module_;
+ RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
+ const uint32_t app_id_ = 11u;
+};
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ Execute_MessageValidationOk_ExpectCorrectMessageSentToHMI) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kValidMobileRequest);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).Times(2).WillOnce(Return(mock_service_));
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(invalid_ext))
+ .WillRepeatedly(Return(rc_app_extention_));
+ application_manager::AppExtensionPtr app_extension;
+ EXPECT_CALL(*mock_app_, AddExtension(_))
+ .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
+ EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+ // Assertions
+ EXPECT_EQ(kModuleId, app_extension->uid());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ result_msg->protocol_version());
+ EXPECT_EQ(1, result_msg->correlation_id());
+ EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
+ const Json::Value hmi_request_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_EQ(functional_modules::hmi_api::get_interior_vehicle_data,
+ hmi_request_params[json_keys::kMethod].asString());
+}
+
+TEST_F(
+ GetInteriorVehicleDataRequestTest,
+ Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kInvalidMobileRequest);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(
+ Return(application_manager::MessageValidationResult::INVALID_JSON));
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+ // Assertions
+ const Json::Value response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kInvalidData,
+ response_params[json_keys::kResultCode].asString());
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_ExpectSuccessfullResponseSentToMobile) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kValidMobileRequest);
+
+ application_manager::MessagePtr hmi_message = CreateBasicMessage();
+ hmi_message->set_json_message(kValidHmiResponse);
+ hmi_message->set_message_type(application_manager::MessageType::kResponse);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(rc_app_extention_));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::RCPluginEvent event(
+ hmi_message, functional_modules::hmi_api::get_interior_vehicle_data);
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->on_event(event);
+ // Assertions
+ const Json::Value response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_TRUE(response_params[json_keys::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kSuccess,
+ response_params[json_keys::kResultCode].asString());
+}
+
+TEST_F(GetInteriorVehicleDataRequestTest,
+ OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kValidMobileRequest);
+ application_manager::MessagePtr hmi_message = CreateBasicMessage();
+ hmi_message->set_json_message(kInvalidHmiResponse);
+ hmi_message->set_message_type(application_manager::MessageType::kResponse);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key()))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
+ .WillOnce(
+ Return(application_manager::MessageValidationResult::INVALID_JSON));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ remote_control::RCPluginEvent event(
+ hmi_message, functional_modules::hmi_api::get_interior_vehicle_data);
+ command->on_event(event);
+ const Json::Value response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_FALSE(response_params[json_keys::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kGenericError,
+ response_params[json_keys::kResultCode].asString());
+ const Json::Value hmi_response =
+ MessageHelper::StringToValue(hmi_message->json_message());
+ EXPECT_EQ(hmi_response[json_keys::kInfo].asString(),
+ response_params[json_keys::kInfo].asString());
+}
+
+} // namespace get_interior_vehicle_data_request_test
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
diff --git a/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc
new file mode 100644
index 0000000000..7329890e94
--- /dev/null
+++ b/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/on_interior_vehicle_data_notification.h"
+#include "gtest/gtest.h"
+#include "mock_remote_control_plugin.h"
+#include "mock_application.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/remote_control_event.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_command_factory.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "functional_module/function_ids.h"
+#include "include/mock_service.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+using functional_modules::RCFunctionID;
+using application_manager::ServicePtr;
+
+using application_manager::MockService;
+using test::components::remote_control_test::MockApplication;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+using remote_control::RemotePluginInterface;
+using remote_control::MessageHelper;
+using namespace remote_control;
+
+namespace {
+const int kModuleId = 153;
+const std::string kJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnInteriorVehicleData\",\
+ \"params\":{\"moduleData\":{\
+ \"moduleType\": \"CLIMATE\",\"climateControlData\": {\"fanSpeed\": 100}}}}";
+const uint32_t kAppId_ = 11u;
+}
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+namespace on_interior_vehicle_data_notification_test {
+
+class OnInteriorVehicleDataNotificationTest : public ::testing::Test {
+ public:
+ OnInteriorVehicleDataNotificationTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
+ ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
+ ServicePtr exp_service(mock_service_);
+ mock_module_.set_service(exp_service);
+ }
+
+ remote_control::request_controller::MobileRequestPtr CreateCommand(
+ application_manager::MessagePtr msg) {
+ return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
+ }
+
+ application_manager::MessagePtr CreateBasicMessage() {
+ application_manager::MessagePtr message = utils::MakeShared<Message>(
+ MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
+ message->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
+ message->set_function_name("OnInteriorVehicleData");
+ message->set_json_message(kJson);
+ return message;
+ }
+
+ protected:
+ utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ remote_control_test::MockRemotePluginInterface mock_module_;
+ std::vector<ApplicationSharedPtr> apps_;
+};
+
+TEST_F(OnInteriorVehicleDataNotificationTest,
+ Execute_SendMessageToMobile_IfAppIsSubscribed) {
+ // Arrange
+ application_manager::MessagePtr message = CreateBasicMessage();
+ Json::Value json_value = MessageHelper::StringToValue(kJson);
+ Json::Value module_type =
+ json_value[json_keys::kParams][message_params::kModuleData]
+ [message_params::kModuleType];
+ rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
+ apps_.push_back(mock_app_);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
+ .WillOnce(Return(apps_));
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(rc_app_extention_));
+
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId_));
+ EXPECT_CALL(*mock_app_, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId_))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(_))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckModule(kAppId_, enums_value::kClimate))
+ .WillOnce(Return(true));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(*mock_service_, SendMessageToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+ // Assertions
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3,
+ result_msg->protocol_version());
+ EXPECT_EQ(application_manager::MessageType::kNotification,
+ result_msg->type());
+ EXPECT_EQ(functional_modules::ON_INTERIOR_VEHICLE_DATA,
+ result_msg->function_id());
+ EXPECT_EQ(MessageHelper::GetMobileAPIName(
+ functional_modules::ON_INTERIOR_VEHICLE_DATA),
+ result_msg->function_name());
+}
+
+TEST_F(OnInteriorVehicleDataNotificationTest,
+ Execute_NotSendMessageToMobile_IfAppUnsubscribed) {
+ // Arrange
+ application_manager::MessagePtr message = CreateBasicMessage();
+ apps_.push_back(mock_app_);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
+ .WillOnce(Return(apps_));
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(rc_app_extention_));
+ EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+}
+
+} // namespace on_interior_vehicle_data_notification_test
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
diff --git a/src/components/remote_control/test/commands/on_remote_control_settings_test.cc b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc
new file mode 100644
index 0000000000..5c13ea63d5
--- /dev/null
+++ b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc
@@ -0,0 +1,326 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/on_remote_control_settings_notification.h"
+#include "gtest/gtest.h"
+#include "mock_remote_control_plugin.h"
+#include "mock_application.h"
+#include "mock_resource_allocation_manager.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/remote_control_event.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_command_factory.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "functional_module/function_ids.h"
+#include "include/mock_service.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+using functional_modules::RCFunctionID;
+using application_manager::ServicePtr;
+
+using application_manager::MockService;
+using test::components::remote_control_test::MockApplication;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+using remote_control::RemotePluginInterface;
+using remote_control::MessageHelper;
+using namespace remote_control;
+
+namespace {
+const int kModuleId = 153;
+const std::string kAllowedTrueAUTO_ALLOWJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
+ \"params\":{\"accessMode\": \"AUTO_ALLOW\", \"allowed\":true}}";
+const std::string kAllowedTrueASK_DRIVERJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
+ \"params\":{\"accessMode\": \"ASK_DRIVER\", \"allowed\":true}}";
+const std::string kAllowedTrueAUTO_DENYJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
+ \"params\":{\"accessMode\": \"AUTO_DENY\", \"allowed\":true}}";
+const std::string kAllowedFalseAUTO_ALLOWJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
+ \"params\":{\"accessMode\": \"AUTO_ALLOW\", \"allowed\":false}}";
+const std::string kAllowedFalseASK_DRIVERJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
+ \"params\":{\"accessMode\": \"ASK_DRIVER\", \"allowed\":false}}";
+const std::string kAllowedFalseAUTO_DENYJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\
+ \"params\":{\"accessMode\": \"AUTO_DENY\", \"allowed\":false}}";
+const std::string kWithoutParamsJson =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\"}";
+}
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+namespace on_remote_control_settings_notification_test {
+
+class OnRemoteControlSettingsNotificationTest : public ::testing::Test {
+ public:
+ OnRemoteControlSettingsNotificationTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
+ ON_CALL(mock_module_, resource_allocation_manager())
+ .WillByDefault(ReturnRef(mock_allocation_manager_));
+ ON_CALL(*mock_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ apps_.push_back(mock_app_);
+ }
+
+ remote_control::request_controller::MobileRequestPtr CreateCommand(
+ application_manager::MessagePtr msg) {
+ return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
+ }
+
+ application_manager::MessagePtr CreateBasicMessage(
+ const std::string& json_message) {
+ application_manager::MessagePtr message = utils::MakeShared<Message>(
+ MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
+ message->set_function_id(RCFunctionID::ON_REMOTE_CONTROL_SETTINGS);
+ message->set_function_name(
+ MessageHelper::GetMobileAPIName(functional_modules::BUTTON_PRESS));
+ message->set_json_message(json_message);
+ return message;
+ }
+
+ protected:
+ utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ remote_control_test::MockRemotePluginInterface mock_module_;
+ std::vector<ApplicationSharedPtr> apps_;
+ testing::NiceMock<remote_control_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+};
+
+TEST_F(OnRemoteControlSettingsNotificationTest,
+ Execute_SetAccessModeAUTO_ALLOW_IfAllowedTrue) {
+ // Arrange
+ const Json::Value value =
+ MessageHelper::StringToValue(kAllowedTrueAUTO_ALLOWJson);
+ const std::string access_mode =
+ value[json_keys::kParams][message_params::kAccessMode].asString();
+ const hmi_apis::Common_RCAccessMode::eType access_mode_ =
+ MessageHelper::AccessModeFromString(access_mode);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_));
+
+ application_manager::MessagePtr message =
+ CreateBasicMessage(kAllowedTrueAUTO_ALLOWJson);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+}
+
+TEST_F(OnRemoteControlSettingsNotificationTest,
+ Execute_SetAccessModeAUTO_DENY_IfAllowedTrue) {
+ // Arrange
+ const Json::Value value =
+ MessageHelper::StringToValue(kAllowedTrueAUTO_DENYJson);
+ const std::string access_mode =
+ value[json_keys::kParams][message_params::kAccessMode].asString();
+ const hmi_apis::Common_RCAccessMode::eType access_mode_ =
+ MessageHelper::AccessModeFromString(access_mode);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_));
+
+ application_manager::MessagePtr message =
+ CreateBasicMessage(kAllowedTrueAUTO_DENYJson);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+}
+
+TEST_F(OnRemoteControlSettingsNotificationTest,
+ Execute_SetAccessModeASK_DRIVER_IfAllowedTrue) {
+ // Arrange
+ const Json::Value value =
+ MessageHelper::StringToValue(kAllowedTrueASK_DRIVERJson);
+ const std::string access_mode =
+ value[json_keys::kParams][message_params::kAccessMode].asString();
+ const hmi_apis::Common_RCAccessMode::eType access_mode_ =
+ MessageHelper::AccessModeFromString(access_mode);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_));
+ application_manager::MessagePtr message =
+ CreateBasicMessage(kAllowedTrueASK_DRIVERJson);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+}
+
+TEST_F(OnRemoteControlSettingsNotificationTest,
+ Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeAUTO_ALLOW) {
+ // Arrange
+ const Json::Value module_type(enums_value::kClimate);
+ rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
+ const Json::Value value =
+ MessageHelper::StringToValue(kAllowedFalseAUTO_ALLOWJson);
+ const std::string access_mode =
+ value[json_keys::kParams][message_params::kAccessMode].asString();
+ const hmi_apis::Common_RCAccessMode::eType access_mode_ =
+ MessageHelper::AccessModeFromString(access_mode);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0);
+ EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
+ .WillOnce(Return(apps_));
+ EXPECT_CALL(
+ *mock_service_,
+ ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE));
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(rc_app_extention_));
+ EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
+ true);
+ application_manager::MessagePtr message =
+ CreateBasicMessage(kAllowedFalseAUTO_ALLOWJson);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+ // Assertions
+ EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
+ false);
+}
+
+TEST_F(OnRemoteControlSettingsNotificationTest,
+ Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeASK_DRIVER) {
+ // Arrange
+ const Json::Value module_type(enums_value::kRadio);
+ rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
+ const Json::Value value =
+ MessageHelper::StringToValue(kAllowedFalseASK_DRIVERJson);
+ const std::string access_mode =
+ value[json_keys::kParams][message_params::kAccessMode].asString();
+ const hmi_apis::Common_RCAccessMode::eType access_mode_ =
+ MessageHelper::AccessModeFromString(access_mode);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0);
+ EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
+ .WillOnce(Return(apps_));
+ EXPECT_CALL(
+ *mock_service_,
+ ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE));
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(rc_app_extention_));
+ EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
+ true);
+ application_manager::MessagePtr message =
+ CreateBasicMessage(kAllowedFalseASK_DRIVERJson);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+ // Assertions
+ EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
+ false);
+}
+
+TEST_F(OnRemoteControlSettingsNotificationTest,
+ Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeAUTO_DENY) {
+ // Arrange
+ const Json::Value module_type(enums_value::kClimate);
+ rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
+ const Json::Value value =
+ MessageHelper::StringToValue(kAllowedFalseAUTO_DENYJson);
+ const std::string access_mode =
+ value[json_keys::kParams][message_params::kAccessMode].asString();
+ const hmi_apis::Common_RCAccessMode::eType access_mode_ =
+ MessageHelper::AccessModeFromString(access_mode);
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0);
+ EXPECT_CALL(*mock_service_, GetApplications(kModuleId))
+ .WillOnce(Return(apps_));
+ EXPECT_CALL(
+ *mock_service_,
+ ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE));
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(rc_app_extention_));
+ EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
+ true);
+ application_manager::MessagePtr message =
+ CreateBasicMessage(kAllowedFalseAUTO_DENYJson);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+ // Assertions
+ EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type),
+ false);
+}
+
+TEST_F(OnRemoteControlSettingsNotificationTest,
+ Execute_NothingHappens_IfParamsOmitted) {
+ // Expectations
+ EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_));
+ EXPECT_CALL(mock_allocation_manager_, SetAccessMode(_)).Times(0);
+ EXPECT_CALL(*mock_service_, GetApplications(kModuleId)).Times(0);
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)).Times(0);
+ EXPECT_CALL(*mock_service_,
+ ChangeNotifyHMILevel(
+ apps_[0], mobile_apis::HMILevel::eType::HMI_NONE)).Times(0);
+
+ application_manager::MessagePtr message =
+ CreateBasicMessage(kWithoutParamsJson);
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(message);
+ command->Run();
+}
+
+} // namespace on_remote_control_settings_notification_test
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
diff --git a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc
new file mode 100644
index 0000000000..a219bc086d
--- /dev/null
+++ b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc
@@ -0,0 +1,433 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "remote_control/commands/set_interior_vehicle_data_request.h"
+#include "gtest/gtest.h"
+#include "mock_remote_control_plugin.h"
+#include "mock_application.h"
+#include "mock_resource_allocation_manager.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/remote_control_event.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "remote_control/rc_command_factory.h"
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "functional_module/function_ids.h"
+#include "include/mock_service.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+using functional_modules::RCFunctionID;
+using application_manager::ServicePtr;
+
+using application_manager::MockService;
+using test::components::remote_control_test::MockApplication;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+using remote_control::RemotePluginInterface;
+using remote_control::MessageHelper;
+using namespace remote_control;
+
+namespace {
+const uint32_t kAppId = 11u;
+const int32_t kConnectionKey = 5;
+const int kModuleId = 153;
+const uint32_t kCorrelationId = 1u;
+const std::string kValidMobileRequestWithOnlySettableParams =
+ "{\"moduleData\":{\"moduleType\":\"CLIMATE\", "
+ "\"climateControlData\":{\"defrostZone\":"
+ "\"FRONT\", \"fanSpeed\":10}}}";
+const std::string kValidMobileRequestWithSettableAndReadOnlyParams =
+ "{\"moduleData\":{\"moduleType\":\"CLIMATE\", "
+ "\"climateControlData\":{\"defrostZone\":"
+ "\"FRONT\", \"fanSpeed\":10, \"currentTemperature\":{\"unit\":\"CELSIUS\", "
+ "\"value\":17.5}}}}";
+const std::string kValidMobileRequestWithoutSettableAndWithReadOnlyParams =
+ "{\"moduleData\":{\"moduleType\":\"CLIMATE\", \"climateControlData\":"
+ "{\"currentTemperature\":{\"unit\":\"CELSIUS\", \"value\":17.5}}}}";
+const std::string kInvalidMobileRequest = "{{\"moduleTip\":\"LUXOFT\"}}";
+const std::string kValidHmiResponse =
+ "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":0,\"method\":\"RC."
+ "SetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
+ "\"climateControlData\":{\"fanSpeed\":0,\"desiredTemperature\":{\"unit\":"
+ "\"CELSIUS\","
+ "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
+ "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
+ "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}}}}";
+const std::string kInvalidHmiResponse =
+ "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":21,\"method\":\"RC."
+ "SetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\","
+ "\"ControlData\":{\"Speed\":0,\"outsideTemperature\":{\"unit\":"
+ "\"CELSIUS\",\"value\":\"high\"},\"desiredTemperature\":{\"unit\":"
+ "\"CELSIUS\","
+ "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true,"
+ "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true,"
+ "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":"
+ "false}}";
+}
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+namespace set_interior_vehicle_data_request_test {
+
+class SetInteriorVehicleDataRequestTest : public ::testing::Test {
+ public:
+ SetInteriorVehicleDataRequestTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
+ ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId));
+ ON_CALL(mock_module_, resource_allocation_manager())
+ .WillByDefault(ReturnRef(mock_allocation_manager_));
+ ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_));
+ ON_CALL(*mock_service_, GetApplication(_)).WillByDefault(Return(mock_app_));
+ ON_CALL(*mock_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ ON_CALL(mock_module_, event_dispatcher())
+ .WillByDefault(ReturnRef(event_dispatcher_));
+ ServicePtr exp_service(mock_service_);
+ }
+
+ remote_control::request_controller::MobileRequestPtr CreateCommand(
+ application_manager::MessagePtr msg) {
+ return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_);
+ }
+
+ application_manager::MessagePtr CreateBasicMessage() {
+ application_manager::MessagePtr message = utils::MakeShared<Message>(
+ MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc));
+ message->set_connection_key(kConnectionKey);
+ message->set_function_id(RCFunctionID::SET_INTERIOR_VEHICLE_DATA);
+ message->set_function_name(MessageHelper::GetMobileAPIName(
+ functional_modules::SET_INTERIOR_VEHICLE_DATA));
+ return message;
+ }
+
+ protected:
+ utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ testing::NiceMock<remote_control_test::MockRemotePluginInterface>
+ mock_module_;
+ testing::NiceMock<remote_control_test::MockResourceAllocationManager>
+ mock_allocation_manager_;
+ RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
+};
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithoutReadOnlyParams_ExpectResendToHMI) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams);
+
+ // Expectations
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(invalid_ext))
+ .WillRepeatedly(Return(rc_app_extention_));
+
+ application_manager::AppExtensionPtr app_extension;
+ EXPECT_CALL(*mock_app_, AddExtension(_))
+ .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
+ EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(*mock_service_, GetNextCorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ const std::string resource = "CLIMATE";
+
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId))
+ .WillOnce(Return(remote_control::AcquireResult::ALLOWED));
+ EXPECT_CALL(
+ mock_allocation_manager_,
+ SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY));
+
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+
+ // Assertions
+ EXPECT_EQ(kModuleId, app_extension->uid());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ result_msg->protocol_version());
+ EXPECT_EQ(1, result_msg->correlation_id());
+ EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
+ const Json::Value hmi_request_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_EQ(functional_modules::hmi_api::set_interior_vehicle_data,
+ hmi_request_params[json_keys::kMethod].asString());
+ const Json::Value hmi_request_climate_control_data =
+ hmi_request_params[json_keys::kParams][message_params::kModuleData]
+ [message_params::kClimateControlData];
+ EXPECT_EQ(2u, hmi_request_climate_control_data.size());
+ const Json::Value hmi_request_module_data_fan_speed =
+ hmi_request_climate_control_data[message_params::kFanSpeed];
+ const Json::Value hmi_request_module_data_defrost_zone =
+ hmi_request_climate_control_data[message_params::kDefrostZone];
+ EXPECT_EQ("FRONT", hmi_request_module_data_defrost_zone.asString());
+ EXPECT_EQ(10, hmi_request_module_data_fan_speed.asInt());
+}
+
+TEST_F(
+ SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithSettableAndReadOnlyParams_ExpectCutReadOnlyAndResendToHMI) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(
+ kValidMobileRequestWithSettableAndReadOnlyParams);
+
+ // Expectations
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(invalid_ext))
+ .WillRepeatedly(Return(rc_app_extention_));
+
+ application_manager::AppExtensionPtr app_extension;
+ EXPECT_CALL(*mock_app_, AddExtension(_))
+ .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
+ EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(*mock_service_, GetNextCorrelationID())
+ .WillOnce(Return(kCorrelationId));
+
+ const std::string resource = "CLIMATE";
+
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId))
+ .WillOnce(Return(remote_control::AcquireResult::ALLOWED));
+ EXPECT_CALL(
+ mock_allocation_manager_,
+ SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY));
+
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+
+ // Assertions
+ EXPECT_EQ(kModuleId, app_extension->uid());
+ EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ result_msg->protocol_version());
+ EXPECT_EQ(1, result_msg->correlation_id());
+ EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type());
+ const Json::Value hmi_request_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_EQ(functional_modules::hmi_api::set_interior_vehicle_data,
+ hmi_request_params[json_keys::kMethod].asString());
+ const Json::Value hmi_request_climate_control_data =
+ hmi_request_params[json_keys::kParams][message_params::kModuleData]
+ [message_params::kClimateControlData];
+ EXPECT_EQ(2u, hmi_request_climate_control_data.size());
+ const Json::Value hmi_request_module_data_fan_speed =
+ hmi_request_climate_control_data[message_params::kFanSpeed];
+ const Json::Value hmi_request_module_data_defrost_zone =
+ hmi_request_climate_control_data[message_params::kDefrostZone];
+ EXPECT_EQ("FRONT", hmi_request_module_data_defrost_zone.asString());
+ EXPECT_EQ(10, hmi_request_module_data_fan_speed.asInt());
+}
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ Execute_ValidWithOnlyParamsReadOnly_ExpectResponseReadOnly) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(
+ kValidMobileRequestWithoutSettableAndWithReadOnlyParams);
+
+ // Expectations
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+ EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_))
+ .WillOnce(Return(true));
+ EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _))
+ .WillOnce(Return(::remote_control::AcquireResult::ALLOWED));
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*mock_app_, QueryInterface(kModuleId))
+ .WillOnce(Return(invalid_ext))
+ .WillRepeatedly(Return(rc_app_extention_));
+
+ application_manager::AppExtensionPtr app_extension;
+ EXPECT_CALL(*mock_app_, AddExtension(_))
+ .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true)));
+ EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true));
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
+
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+
+ // Assertions
+ const Json::Value response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kReadOnly,
+ response_params[json_keys::kResultCode].asString());
+}
+
+TEST_F(
+ SetInteriorVehicleDataRequestTest,
+ Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kInvalidMobileRequest);
+
+ // Expectations
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message))
+ .WillOnce(
+ Return(application_manager::MessageValidationResult::INVALID_JSON));
+ EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0);
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->Run();
+
+ // Assertions
+ const Json::Value response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_FALSE(response_params[result_codes::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kInvalidData,
+ response_params[json_keys::kResultCode].asString());
+}
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ OnEvent_ValidHmiResponse_ExpectSuccessfulResponseSentToMobile) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams);
+
+ application_manager::MessagePtr hmi_message = CreateBasicMessage();
+ hmi_message->set_json_message(kValidHmiResponse);
+ hmi_message->set_message_type(application_manager::MessageType::kResponse);
+
+ // Expectations
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+
+ // Act
+ remote_control::RCPluginEvent event(
+ hmi_message, functional_modules::hmi_api::set_interior_vehicle_data);
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ command->on_event(event);
+
+ // Assertions
+ const Json::Value response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_TRUE(response_params[json_keys::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kSuccess,
+ response_params[json_keys::kResultCode].asString());
+}
+
+TEST_F(SetInteriorVehicleDataRequestTest,
+ OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) {
+ // Arrange
+ application_manager::MessagePtr mobile_message = CreateBasicMessage();
+ mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams);
+ application_manager::MessagePtr hmi_message = CreateBasicMessage();
+ hmi_message->set_json_message(kInvalidHmiResponse);
+ hmi_message->set_message_type(application_manager::MessageType::kResponse);
+
+ // Expectations
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message))
+ .WillOnce(
+ Return(application_manager::MessageValidationResult::INVALID_JSON));
+ application_manager::MessagePtr result_msg;
+ EXPECT_CALL(mock_module_, SendResponseToMobile(_))
+ .WillOnce(SaveArg<0>(&result_msg));
+
+ // Act
+ remote_control::request_controller::MobileRequestPtr command =
+ CreateCommand(mobile_message);
+ remote_control::RCPluginEvent event(
+ hmi_message, functional_modules::hmi_api::set_interior_vehicle_data);
+ command->on_event(event);
+ const Json::Value response_params =
+ MessageHelper::StringToValue(result_msg->json_message());
+ EXPECT_FALSE(response_params[json_keys::kSuccess].asBool());
+ EXPECT_EQ(result_codes::kGenericError,
+ response_params[json_keys::kResultCode].asString());
+ const Json::Value hmi_response =
+ MessageHelper::StringToValue(hmi_message->json_message());
+ EXPECT_EQ(hmi_response[json_keys::kInfo].asString(),
+ response_params[json_keys::kInfo].asString());
+}
+
+} // namespace set_interior_vehicle_data_request_test
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
diff --git a/src/components/remote_control/test/include/mock_application.h b/src/components/remote_control/test/include/mock_application.h
new file mode 100644
index 0000000000..a46b48673d
--- /dev/null
+++ b/src/components/remote_control/test/include/mock_application.h
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_
+
+#include <string>
+
+#include <string>
+#include "gmock/gmock.h"
+#include "application_manager/application.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/app_extension.h"
+#include "smart_objects/smart_object.h"
+#include "utils/custom_string.h"
+#include "application_manager/usage_statistics.h"
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+
+namespace am = application_manager;
+namespace mobile_api = mobile_apis;
+namespace custom_str = utils::custom_string;
+
+namespace custom_str = utils::custom_string;
+class MockApplication : public ::application_manager::Application {
+ public:
+ MockApplication() {}
+ MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(curHash, const std::string&());
+ MOCK_METHOD0(UpdateHash, void());
+ DEPRECATED MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool());
+ DEPRECATED MOCK_METHOD1(set_flag_sending_hash_change_after_awake,
+ void(bool flag));
+ MOCK_CONST_METHOD0(IsHashChangedDuringSuspend, bool());
+ MOCK_METHOD1(SetHashChangedDuringSuspend, void(const bool state));
+ MOCK_CONST_METHOD0(is_application_data_changed, bool());
+ MOCK_METHOD1(set_is_application_data_changed,
+ void(bool state_application_data));
+ MOCK_METHOD0(CloseActiveMessage, void());
+ MOCK_CONST_METHOD0(IsFullscreen, bool());
+ MOCK_METHOD0(ChangeSupportingAppHMIType, void());
+ MOCK_CONST_METHOD0(is_navi, bool());
+ MOCK_METHOD1(set_is_navi, void(bool allow));
+ MOCK_CONST_METHOD0(video_streaming_approved, bool());
+ MOCK_METHOD1(set_video_streaming_approved, void(bool state));
+ MOCK_CONST_METHOD0(audio_streaming_approved, bool());
+ MOCK_METHOD1(set_audio_streaming_approved, void(bool state));
+ MOCK_CONST_METHOD0(video_streaming_allowed, bool());
+ MOCK_METHOD1(set_video_streaming_allowed, void(bool state));
+ MOCK_CONST_METHOD0(audio_streaming_allowed, bool());
+ MOCK_METHOD1(set_audio_streaming_allowed, void(bool state));
+ MOCK_CONST_METHOD0(is_audio, bool());
+ MOCK_METHOD2(SetVideoConfig,
+ bool(protocol_handler::ServiceType service_type,
+ const smart_objects::SmartObject& params));
+ MOCK_METHOD1(StartStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(StopStreamingForce,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(SuspendStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_METHOD1(WakeUpStreaming,
+ void(protocol_handler::ServiceType service_type));
+ MOCK_CONST_METHOD0(is_voice_communication_supported, bool());
+ MOCK_METHOD1(set_voice_communication_supported,
+ void(bool is_voice_communication_supported));
+ MOCK_CONST_METHOD0(app_allowed, bool());
+ MOCK_CONST_METHOD0(has_been_activated, bool());
+ MOCK_METHOD1(set_activated, bool(bool is_active));
+ MOCK_CONST_METHOD0(version, const ::application_manager::Version&());
+ MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id));
+ MOCK_CONST_METHOD0(hmi_app_id, uint32_t());
+ MOCK_CONST_METHOD0(name, const custom_str::CustomString&());
+ MOCK_METHOD1(set_folder_name, void(const std::string& folder_name));
+ MOCK_CONST_METHOD0(folder_name, const std::string());
+ MOCK_CONST_METHOD0(is_media_application, bool());
+ MOCK_CONST_METHOD0(hmi_level, const mobile_apis::HMILevel::eType());
+ MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t());
+ MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType());
+ MOCK_CONST_METHOD0(audio_streaming_state,
+ const mobile_apis::AudioStreamingState::eType());
+ MOCK_CONST_METHOD0(app_icon_path, const std::string&());
+ MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle());
+ MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr());
+ MOCK_CONST_METHOD0(PostponedHmiState,
+ const application_manager::HmiStatePtr());
+ MOCK_METHOD1(set_tts_properties_in_none, void(bool active));
+ MOCK_METHOD0(tts_properties_in_none, bool());
+ MOCK_METHOD1(set_tts_properties_in_full, void(bool active));
+ MOCK_METHOD0(tts_properties_in_full, bool());
+ MOCK_METHOD1(set_version,
+ void(const ::application_manager::Version& version));
+ MOCK_METHOD1(set_name, void(const custom_str::CustomString& name));
+ MOCK_METHOD1(set_is_media_application, void(bool is_media));
+ MOCK_METHOD0(increment_put_file_in_none_count, void());
+ MOCK_METHOD0(increment_delete_file_in_none_count, void());
+ MOCK_METHOD0(increment_list_files_in_none_count, void());
+ MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name));
+ MOCK_METHOD1(set_app_allowed, void(const bool allowed));
+ MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device));
+ MOCK_CONST_METHOD0(get_grammar_id, uint32_t());
+ MOCK_METHOD1(set_grammar_id, void(uint32_t value));
+ MOCK_METHOD1(
+ set_protocol_version,
+ void(const ::protocol_handler::MajorProtocolVersion& protocol_version));
+ MOCK_CONST_METHOD0(protocol_version,
+ ::protocol_handler::MajorProtocolVersion());
+ MOCK_METHOD1(set_is_resuming, void(bool));
+ MOCK_CONST_METHOD0(is_resuming, bool());
+ MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file));
+ MOCK_CONST_METHOD0(getAppFiles, const ::application_manager::AppFilesMap&());
+ MOCK_METHOD1(UpdateFile, bool(const ::application_manager::AppFile& file));
+ MOCK_METHOD1(DeleteFile, bool(const std::string& file_name));
+ MOCK_METHOD1(
+ GetFile,
+ const ::application_manager::AppFile*(const std::string& file_name));
+ MOCK_METHOD1(SubscribeToButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(IsSubscribedToButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(UnsubscribeFromButton,
+ bool(mobile_apis::ButtonName::eType btn_name));
+ MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type));
+ MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type));
+ MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type));
+ MOCK_METHOD0(ResetDataInNone, void());
+ MOCK_METHOD2(AreCommandLimitsExceeded,
+ bool(mobile_apis::FunctionID::eType cmd_id,
+ ::application_manager::TLimitSource source));
+ MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&());
+ MOCK_METHOD1(SetInitialState, void(::application_manager::HmiStatePtr state));
+ MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state));
+ MOCK_METHOD1(SetPostponedState,
+ void(::application_manager::HmiStatePtr state));
+ MOCK_METHOD0(RemovePostponedState, void());
+ MOCK_METHOD1(AddHMIState, void(::application_manager::HmiStatePtr state));
+ MOCK_METHOD1(RemoveHMIState,
+ void(::application_manager::HmiState::StateID state_id));
+ MOCK_METHOD2(SubscribeToSoftButtons,
+ void(int32_t cmd_id,
+ const ::application_manager::SoftButtonID& softbuttons_id));
+ MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id));
+ MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id));
+ MOCK_CONST_METHOD0(IsAudioApplication, bool());
+ MOCK_METHOD0(LoadPersistentFiles, void());
+ // InitialApplicationData methods
+ MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(policy_app_id, std::string());
+ MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(ngn_media_screen_name,
+ const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(language, const mobile_apis::Language::eType&());
+ MOCK_CONST_METHOD0(ui_language, const mobile_apis::Language::eType&());
+ MOCK_METHOD1(set_app_types,
+ void(const smart_objects::SmartObject& app_types));
+ MOCK_METHOD1(set_vr_synonyms,
+ void(const smart_objects::SmartObject& vr_synonyms));
+ MOCK_METHOD1(set_policy_app_id, void(const std::string& policy_app_id));
+ MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name));
+ MOCK_METHOD1(set_ngn_media_screen_name,
+ void(const smart_objects::SmartObject& ngn_name));
+ MOCK_METHOD1(set_language,
+ void(const mobile_apis::Language::eType& language));
+ MOCK_METHOD1(set_ui_language,
+ void(const mobile_apis::Language::eType& ui_language));
+ // DynamicApplicationData methods
+ MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(vr_help, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(tbt_state, const mobile_apis::TBTState::eType&());
+ MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(
+ SubscribedButtons,
+ DataAccessor< ::application_manager::ButtonSubscriptions>());
+ MOCK_CONST_METHOD0(
+ SubscribedIVI,
+ DataAccessor< ::application_manager::VehicleInfoSubscriptions>());
+ MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*());
+ MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*());
+ MOCK_METHOD1(load_global_properties,
+ void(const smart_objects::SmartObject& so));
+ MOCK_METHOD1(set_help_prompt,
+ void(const smart_objects::SmartObject& help_prompt));
+ MOCK_METHOD1(set_timeout_prompt,
+ void(const smart_objects::SmartObject& timeout_prompt));
+ MOCK_METHOD1(set_vr_help_title,
+ void(const smart_objects::SmartObject& vr_help_title));
+ MOCK_METHOD0(reset_vr_help_title, void());
+ MOCK_METHOD1(set_vr_help, void(const smart_objects::SmartObject& vr_help));
+ MOCK_METHOD0(reset_vr_help, void());
+ MOCK_METHOD1(set_tbt_state,
+ void(const mobile_apis::TBTState::eType& tbt_state));
+ MOCK_METHOD1(set_show_command,
+ void(const smart_objects::SmartObject& show_command));
+ MOCK_METHOD1(set_tbt_show_command,
+ void(const smart_objects::SmartObject& tbt_show));
+ MOCK_METHOD1(set_keyboard_props,
+ void(const smart_objects::SmartObject& keyboard_props));
+ MOCK_METHOD1(set_menu_title,
+ void(const smart_objects::SmartObject& menu_title));
+ MOCK_METHOD1(set_menu_icon,
+ void(const smart_objects::SmartObject& menu_icon));
+ MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t());
+ MOCK_METHOD1(set_audio_stream_retry_number,
+ void(const uint32_t& audio_stream_retry_number));
+ MOCK_CONST_METHOD0(video_stream_retry_number, uint32_t());
+ MOCK_METHOD1(set_video_stream_retry_number,
+ void(const uint32_t& video_stream_retry_number));
+ MOCK_METHOD2(AddCommand,
+ void(uint32_t cmd_id,
+ const smart_objects::SmartObject& command));
+ MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id));
+ MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id));
+ MOCK_METHOD2(AddSubMenu,
+ void(uint32_t menu_id, const smart_objects::SmartObject& menu));
+ MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id));
+ MOCK_CONST_METHOD1(FindSubMenu,
+ smart_objects::SmartObject*(uint32_t menu_id));
+ MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name));
+ MOCK_METHOD2(AddChoiceSet,
+ void(uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set));
+ MOCK_METHOD1(RemoveChoiceSet, void(uint32_t choice_set_id));
+ MOCK_METHOD1(FindChoiceSet,
+ smart_objects::SmartObject*(uint32_t choice_set_id));
+ MOCK_METHOD3(AddPerformInteractionChoiceSet,
+ void(uint32_t correlation_id,
+ uint32_t choice_set_id,
+ const smart_objects::SmartObject& choice_set));
+ MOCK_METHOD1(DeletePerformInteractionChoiceSet,
+ void(uint32_t correlation_id));
+ MOCK_CONST_METHOD0(
+ performinteraction_choice_set_map,
+ DataAccessor< ::application_manager::PerformChoiceSetMap>());
+ MOCK_CONST_METHOD0(commands_map,
+ DataAccessor< ::application_manager::CommandsMap>());
+ MOCK_CONST_METHOD0(sub_menu_map,
+ DataAccessor< ::application_manager::SubMenuMap>());
+ MOCK_CONST_METHOD0(choice_set_map,
+ DataAccessor< ::application_manager::ChoiceSetMap>());
+ MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active));
+ MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t());
+ MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode));
+ MOCK_CONST_METHOD0(perform_interaction_mode, int32_t());
+ MOCK_METHOD1(set_perform_interaction_layout,
+ void(mobile_apis::LayoutMode::eType mode));
+ MOCK_CONST_METHOD0(perform_interaction_layout,
+ mobile_apis::LayoutMode::eType());
+ MOCK_METHOD1(set_reset_global_properties_active, void(bool active));
+ MOCK_CONST_METHOD0(is_reset_global_properties_active, bool());
+ MOCK_CONST_METHOD0(app_id, uint32_t());
+ MOCK_CONST_METHOD0(mac_address, const std::string&());
+ MOCK_CONST_METHOD0(bundle_id, const std::string&());
+ MOCK_METHOD1(set_bundle_id, void(const std::string& bundle_id));
+ MOCK_METHOD0(GetAvailableDiskSpace, uint32_t());
+
+ MOCK_METHOD1(set_mobile_projection_enabled, void(bool));
+ MOCK_CONST_METHOD0(mobile_projection_enabled, bool());
+
+ MOCK_METHOD1(set_mobile_app_id, void(const std::string& policy_app_id));
+ MOCK_CONST_METHOD0(is_foreground, bool());
+ MOCK_METHOD1(set_foreground, void(bool is_foreground));
+ MOCK_CONST_METHOD0(IsRegistered, bool());
+ MOCK_CONST_METHOD0(SchemaUrl, std::string());
+ MOCK_CONST_METHOD0(PackageName, std::string());
+ MOCK_METHOD1(PushMobileMessage, void(smart_objects::SmartObjectSPtr message));
+ MOCK_METHOD1(
+ SwapMobileMessageQueue,
+ void(::application_manager::MobileMessageQueue& mobile_messages));
+
+#ifdef SDL_REMOTE_CONTROL
+ MOCK_METHOD1(
+ set_system_context,
+ void(const application_manager::mobile_api::SystemContext::eType&));
+ MOCK_METHOD1(
+ set_audio_streaming_state,
+ void(const application_manager::mobile_api::AudioStreamingState::eType&
+ state));
+ MOCK_METHOD1(IsSubscribedToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(SubscribeToInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(UnsubscribeFromInteriorVehicleData,
+ bool(smart_objects::SmartObject module));
+ MOCK_METHOD1(
+ set_hmi_level,
+ void(const application_manager::mobile_api::HMILevel::eType& hmi_level));
+ MOCK_METHOD1(QueryInterface,
+ application_manager::AppExtensionPtr(
+ application_manager::AppExtensionUID uid));
+ MOCK_METHOD1(AddExtension,
+ bool(application_manager::AppExtensionPtr extention));
+ MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid));
+ MOCK_METHOD0(RemoveExtensions, void());
+ MOCK_CONST_METHOD0(SubscribesIVI,
+ const application_manager::VehicleInfoSubscriptions&());
+
+#endif // SDL_REMOTE_CONTROL
+};
+
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_
diff --git a/src/components/remote_control/test/include/mock_remote_control_plugin.h b/src/components/remote_control/test/include/mock_remote_control_plugin.h
new file mode 100644
index 0000000000..a8143f448c
--- /dev/null
+++ b/src/components/remote_control/test/include/mock_remote_control_plugin.h
@@ -0,0 +1,54 @@
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_
+
+#include <stdint.h>
+#include "remote_control/remote_plugin_interface.h"
+#include "remote_control/resource_allocation_manager.h"
+#include "application_manager/message.h"
+#include "mock_application.h"
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+
+class RCAppExtension;
+typedef utils::SharedPtr<RCAppExtension> RCAppExtensionPtr;
+
+class MockRemotePluginInterface : public remote_control::RemotePluginInterface {
+ public:
+ MOCK_CONST_METHOD0(GetPluginInfo, functional_modules::PluginInfo());
+ MOCK_METHOD1(
+ ProcessMessage,
+ functional_modules::ProcessResult(application_manager::MessagePtr msg));
+ MOCK_METHOD1(
+ ProcessHMIMessage,
+ functional_modules::ProcessResult(application_manager::MessagePtr msg));
+ MOCK_METHOD1(SendResponseToMobile, void(application_manager::MessagePtr msg));
+ MOCK_METHOD1(SendTimeoutResponseToMobile,
+ void(application_manager::MessagePtr msg));
+ MOCK_METHOD1(RemoveAppExtension, void(uint32_t app_id));
+ MOCK_METHOD1(IsAppForPlugin,
+ bool(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD2(OnAppHMILevelChanged,
+ void(application_manager::ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType old_level));
+ MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id));
+ MOCK_METHOD1(SendHmiStatusNotification,
+ void(application_manager::ApplicationSharedPtr app));
+ MOCK_METHOD0(event_dispatcher, RCPluginEventDispatcher&());
+ MOCK_METHOD0(RemoveAppExtensions, void());
+ MOCK_METHOD0(service, application_manager::ServicePtr());
+ MOCK_CONST_METHOD0(GetModuleID, functional_modules::ModuleID());
+ MOCK_METHOD0(resource_allocation_manager,
+ remote_control::ResourceAllocationManager&());
+ MOCK_METHOD2(OnApplicationEvent,
+ void(functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
+};
+
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_
diff --git a/src/components/remote_control/test/include/mock_resource_allocation_manager.h b/src/components/remote_control/test/include/mock_resource_allocation_manager.h
new file mode 100644
index 0000000000..6337d8a32a
--- /dev/null
+++ b/src/components/remote_control/test/include/mock_resource_allocation_manager.h
@@ -0,0 +1,40 @@
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
+
+#include "gmock/gmock.h"
+#include "remote_control/resource_allocation_manager.h"
+
+namespace test {
+namespace components {
+namespace remote_control_test {
+
+class MockResourceAllocationManager
+ : public remote_control::ResourceAllocationManager {
+ public:
+ MOCK_METHOD2(AcquireResource,
+ remote_control::AcquireResult::eType(
+ const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(ForceAcquireResource,
+ void(const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(OnDriverDisallowed,
+ void(const std::string& module_type, const uint32_t app_id));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(functional_modules::ApplicationEvent event,
+ application_manager::ApplicationSharedPtr application));
+ MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
+ MOCK_METHOD1(SetAccessMode,
+ void(const hmi_apis::Common_RCAccessMode::eType access_mode));
+ MOCK_CONST_METHOD0(GetAccessMode, hmi_apis::Common_RCAccessMode::eType());
+ MOCK_METHOD3(SetResourceState,
+ void(const std::string& module_type,
+ const uint32_t app_id,
+ const remote_control::ResourceState::eType state));
+ MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type));
+ MOCK_METHOD0(ResetAllAllocations, void());
+};
+
+} // namespace remote_control_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_
diff --git a/src/components/remote_control/test/src/rc_app_extension_test.cc b/src/components/remote_control/test/src/rc_app_extension_test.cc
new file mode 100644
index 0000000000..78388ccbf1
--- /dev/null
+++ b/src/components/remote_control/test/src/rc_app_extension_test.cc
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "remote_control/rc_app_extension.h"
+
+namespace remote_control {
+
+TEST(CanAppExtensionTest, Create) {
+ RCAppExtension extension(7);
+ ASSERT_TRUE(extension.uid() == 7);
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/test/src/rc_library_test.cc b/src/components/remote_control/test/src/rc_library_test.cc
new file mode 100644
index 0000000000..77a57c4c3f
--- /dev/null
+++ b/src/components/remote_control/test/src/rc_library_test.cc
@@ -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.
+ */
+
+#include <dlfcn.h>
+#include "gtest/gtest.h"
+#include "remote_control/remote_control_plugin.h"
+#include "mock_service.h"
+
+using functional_modules::PluginInfo;
+using application_manager::MockService;
+
+using ::testing::Return;
+
+namespace remote_control {
+
+::testing::AssertionResult IsError(void* error) {
+ if (error) {
+ return ::testing::AssertionSuccess() << static_cast<const char*>(error);
+ } else {
+ return ::testing::AssertionFailure() << error;
+ }
+}
+
+TEST(CanLibraryTest, Load) {
+ const std::string kLibraryPath = "libRemoteControlModule.so";
+
+ void* handle = dlopen(kLibraryPath.c_str(), RTLD_LAZY);
+ EXPECT_FALSE(IsError(dlerror()));
+ ASSERT_TRUE(handle != NULL);
+
+ const std::string kSymbol = "Create";
+ void* symbol = dlsym(handle, kSymbol.c_str());
+ EXPECT_FALSE(IsError(dlerror()));
+ ASSERT_TRUE(symbol != NULL);
+
+ typedef CANModule* (*Create)();
+ Create create_manager = reinterpret_cast<Create>(symbol);
+ CANModule* module = create_manager();
+ ASSERT_TRUE(module != NULL);
+
+ PluginInfo plugin = module->GetPluginInfo();
+ EXPECT_EQ(plugin.name, "RemoteControlPlugin");
+ EXPECT_EQ(plugin.version, 1);
+
+ MockService* service = new MockService();
+ module->set_service(service);
+ std::vector<application_manager::ApplicationSharedPtr> apps;
+ EXPECT_CALL(*service, GetApplications(module->GetModuleID()))
+ .Times(1)
+ .WillOnce(Return(apps));
+
+ // in order for all sub-threads to start before shutting them down
+ // The logic conditions must be chosen to insure that the "signal" is
+ // executed if the "wait" is ever processed.
+ // (see http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html)
+ sleep(3);
+ // CANModule::destroy();
+ int ret = dlclose(handle);
+ EXPECT_FALSE(ret);
+ EXPECT_FALSE(IsError(dlerror()));
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/test/src/rc_module_test.cc b/src/components/remote_control/test/src/rc_module_test.cc
new file mode 100644
index 0000000000..7bdf9fb9dd
--- /dev/null
+++ b/src/components/remote_control/test/src/rc_module_test.cc
@@ -0,0 +1,263 @@
+/*
+ * Copyright (c) 2015, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "gtest/gtest.h"
+#include "remote_control/remote_control_plugin.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "functional_module/module_observer.h"
+#include "application_manager/mock_application.h"
+#include "include/mock_service.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/mock_application_manager_settings.h"
+
+using functional_modules::PluginInfo;
+using functional_modules::ProcessResult;
+using functional_modules::RCFunctionID;
+using application_manager::ServicePtr;
+
+using application_manager::MockService;
+using application_manager::MockMessageHelper;
+using test::components::application_manager_test::MockApplication;
+using test::components::application_manager_test::
+ MockApplicationManagerSettings;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::Eq;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+
+namespace {
+const bool kDeviceHandle = 1u;
+const std::string kDeviceId = "1";
+const std::string kDeviceName = "1";
+const uint32_t kDefaultTimeout = 10000;
+}
+
+namespace remote_control {
+
+class RCModuleTest : public ::testing::Test {
+ public:
+ RCModuleTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_settings_(
+ utils::MakeShared<NiceMock<MockApplicationManagerSettings> >())
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , app0_(utils::MakeShared<NiceMock<MockApplication> >())
+ , app1_(utils::MakeShared<NiceMock<MockApplication> >())
+ , message_(utils::MakeShared<Message>(MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc)))
+ , rc_app_extention_(
+ utils::MakeShared<RCAppExtension>(module_.GetModuleID())) {}
+
+ void HandleMessage() {
+ module_.ProcessHMIMessage(message_);
+ }
+
+ protected:
+ RemoteControlPlugin module_;
+ utils::SharedPtr<NiceMock<MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplicationManagerSettings> > mock_settings_;
+ MockMessageHelper& mock_message_helper_;
+ std::vector<ApplicationSharedPtr> apps_;
+ utils::SharedPtr<NiceMock<MockApplication> > app0_;
+ utils::SharedPtr<NiceMock<MockApplication> > app1_;
+ application_manager::MessagePtr message_;
+ utils::SharedPtr<RCAppExtension> rc_app_extention_;
+
+ void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ ON_CALL(*mock_service_, GetSettings())
+ .WillByDefault(ReturnRef(*mock_settings_));
+ ON_CALL(*mock_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kDefaultTimeout));
+ ServicePtr exp_service(mock_service_);
+ module_.set_service(exp_service);
+ ServicePtr out_service = module_.service();
+ EXPECT_EQ(exp_service.get(), out_service.get());
+ }
+
+ void TearDown() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID()))
+ .WillOnce(Return(apps_));
+ }
+};
+
+TEST_F(RCModuleTest, Create) {
+ EXPECT_EQ(153, module_.GetModuleID());
+ PluginInfo plugin = module_.GetPluginInfo();
+ EXPECT_EQ(plugin.name, "RemoteControlPlugin");
+ EXPECT_EQ(plugin.version, 1);
+}
+
+TEST_F(RCModuleTest, ProcessMessageWrongMessage) {
+ message_->set_function_id(-1);
+ EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0);
+ EXPECT_EQ(ProcessResult::CANNOT_PROCESS, module_.ProcessMessage(message_));
+}
+
+TEST_F(RCModuleTest, ProcessMessageEmptyapps_List) {
+ message_->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
+ message_->set_function_name("OnInteriorVehicleData");
+
+ std::string json =
+ "{\"jsonrpc\": \"2.0\", \"method\": \"RC.OnInteriorVehicleData\",\
+ \"params\": {\"moduleData\": {\"moduleType\": \"CLIMATE\",\
+ \"climateControlData\": {\"fanSpeed\": 100} }}}";
+ message_->set_json_message(json);
+
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(_))
+ .WillOnce(Return(
+ application_manager::MessageValidationResult::SCHEMA_MISMATCH));
+ EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0);
+
+ // EXPECT_EQ(ProcessResult::PROCESSED, module_.ProcessMessage(message_));
+ EXPECT_EQ(ProcessResult::CANNOT_PROCESS, module_.ProcessHMIMessage(message_));
+}
+
+TEST_F(RCModuleTest, ProcessMessagePass) {
+ message_->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA);
+
+ std::string json =
+ "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnInteriorVehicleData\",\
+ \"params\":{\"moduleData\":{\
+ \"moduleType\": \"CLIMATE\",\"climateControlData\": {\"fanSpeed\": 100}}}}";
+
+ message_->set_json_message(json);
+
+ application_manager::BinaryData buf;
+ application_manager::BinaryData* data = &buf;
+ data->push_back(1);
+
+ message_->set_binary_data(
+ static_cast<const application_manager::BinaryData*>(data));
+
+ Json::Value json_value = MessageHelper::StringToValue(json);
+ Json::Value module_type =
+ json_value[json_keys::kParams][message_params::kModuleData]
+ [message_params::kModuleType];
+ apps_.push_back(app0_);
+ rc_app_extention_->SubscribeToInteriorVehicleData(module_type);
+ EXPECT_CALL(*mock_service_, ValidateMessageBySchema(_))
+ .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS));
+ EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
+ .WillOnce(Return(rc_app_extention_));
+ EXPECT_CALL(*app0_, app_id()).WillRepeatedly(Return(1));
+ EXPECT_CALL(*app0_, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
+ EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID()))
+ .WillOnce(Return(apps_));
+ EXPECT_CALL(*mock_service_, GetApplication(1)).WillOnce(Return(app0_));
+ EXPECT_CALL(*mock_service_, CheckPolicyPermissions(_))
+ .WillOnce(Return(mobile_apis::Result::eType::SUCCESS));
+ EXPECT_CALL(*mock_service_, CheckModule(1, "CLIMATE")).WillOnce(Return(true));
+ EXPECT_CALL(*mock_service_, SendMessageToMobile(_));
+
+ EXPECT_EQ(ProcessResult::PROCESSED, module_.ProcessHMIMessage(message_));
+}
+
+TEST_F(RCModuleTest, RemoveAppExtensionPassWay) {
+ EXPECT_CALL(*mock_service_, GetApplication(1)).WillOnce(Return(app0_));
+ EXPECT_CALL(*app0_, RemoveExtension(module_.GetModuleID()));
+
+ module_.RemoveAppExtension(1);
+}
+
+TEST_F(RCModuleTest, RemoveAppExtensionIfAppNoExist) {
+ ApplicationSharedPtr invalid_app;
+
+ EXPECT_CALL(*mock_service_, GetApplication(_)).WillOnce(Return(invalid_app));
+
+ module_.RemoveAppExtension(1);
+}
+
+TEST_F(RCModuleTest, SendResponseToMobile) {
+ EXPECT_CALL(*mock_service_, SendMessageToMobile(message_));
+
+ module_.SendResponseToMobile(message_);
+}
+
+TEST_F(RCModuleTest, IsAppForPluginSuccess) {
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
+ .WillOnce(Return(invalid_ext))
+ .WillRepeatedly(Return(rc_app_extention_));
+ EXPECT_CALL(*app0_, AddExtension(_)).WillOnce(Return(true));
+ mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL;
+ EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi));
+ ON_CALL(*app0_, device()).WillByDefault(Return(1));
+ EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_)))
+ .WillOnce(Return(true));
+ ASSERT_TRUE(module_.IsAppForPlugin(app0_));
+}
+
+TEST_F(RCModuleTest, IsAppForPluginNotNew) {
+ EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
+ .WillOnce(Return(rc_app_extention_));
+ EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)).Times(0);
+ ASSERT_TRUE(module_.IsAppForPlugin(app0_));
+}
+
+TEST_F(RCModuleTest, IsAppForPluginFail) {
+ application_manager::AppExtensionPtr invalid_ext;
+ EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID()))
+ .WillOnce(Return(invalid_ext));
+ EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_)))
+ .Times(1)
+ .WillOnce(Return(false));
+ ASSERT_FALSE(module_.IsAppForPlugin(app0_));
+}
+
+TEST_F(RCModuleTest, OnAppHMILevelChanged) {
+ const application_manager::custom_str::CustomString name("name");
+ ON_CALL(*app0_, name()).WillByDefault(ReturnRef(name));
+ mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_NONE;
+ EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi));
+ EXPECT_CALL(*mock_service_,
+ NotifyHMIAboutHMILevel(Eq(app0_),
+ mobile_apis::HMILevel::eType::HMI_NONE));
+ module_.OnAppHMILevelChanged(app0_, mobile_apis::HMILevel::eType::HMI_FULL);
+}
+
+} // namespace remote_control
diff --git a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc
new file mode 100644
index 0000000000..a69702d424
--- /dev/null
+++ b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc
@@ -0,0 +1,481 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. */
+
+#include "gtest/gtest.h"
+#include <algorithm>
+#include "remote_control/resource_allocation_manager_impl.h"
+#include "mock_resource_allocation_manager.h"
+#include "mock_remote_control_plugin.h"
+#include "remote_control/rc_app_extension.h"
+#include "remote_control/rc_module_constants.h"
+#include "remote_control/message_helper.h"
+#include "functional_module/module_observer.h"
+#include "application_manager/mock_application.h"
+#include "include/mock_service.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+#include "interfaces/HMI_API.h"
+#include "interfaces/MOBILE_API.h"
+
+using functional_modules::PluginInfo;
+using functional_modules::ProcessResult;
+using functional_modules::RCFunctionID;
+using application_manager::ServicePtr;
+
+using application_manager::MockService;
+using namespace test::components;
+using application_manager_test::MockApplication;
+
+using ::testing::_;
+using ::testing::Mock;
+using ::testing::NiceMock;
+using ::testing::StrictMock;
+using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::SaveArg;
+using ::testing::Eq;
+using ::testing::DoAll;
+using ::testing::SetArgPointee;
+using ::application_manager::Message;
+using ::application_manager::MessageType;
+using ::application_manager::ApplicationSharedPtr;
+using ::protocol_handler::MessagePriority;
+
+namespace {
+const bool kDeviceHandle = 1u;
+const std::string kModuleType1 = "CLIMATE";
+const std::string kModuleType2 = "RADIO";
+const int32_t kConnectionKey = 5;
+const int32_t kCorrelationId = 5;
+const uint32_t kAppId1 = 11u;
+const uint32_t kAppId2 = 22u;
+const std::string policy_app_id_1_ = "policy_id_1";
+const functional_modules::ModuleID kDefaultModuleID = 0;
+}
+
+namespace remote_control {
+
+class RAManagerTest : public ::testing::Test {
+ public:
+ RAManagerTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_1_(utils::MakeShared<NiceMock<MockApplication> >())
+ , mock_app_2_(utils::MakeShared<NiceMock<MockApplication> >())
+ , message_(utils::MakeShared<Message>(MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc))) {
+ EXPECT_CALL(mock_module_, service()).WillRepeatedly(Return(mock_service_));
+ EXPECT_CALL(mock_module_, GetModuleID())
+ .WillRepeatedly(Return(kDefaultModuleID));
+ }
+
+ void CheckResultWithHMILevelAndAccessMode(
+ ResourceAllocationManagerImpl& ra_manager,
+ mobile_apis::HMILevel::eType app_level,
+ const remote_control::AcquireResult::eType expected_result,
+ const hmi_apis::Common_RCAccessMode::eType access_mode) {
+ // Arrange
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ ra_manager.SetAccessMode(access_mode);
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level()).WillOnce(Return(app_level));
+ // Second app tries to get already acquired resource by 1st app
+ EXPECT_EQ(expected_result,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ }
+
+ protected:
+ utils::SharedPtr<NiceMock<MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_1_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_2_;
+ application_manager::MessagePtr message_;
+ remote_control_test::MockRemotePluginInterface mock_module_;
+ RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_;
+};
+
+TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) {
+ // Arrange
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ // Act & Assert
+ EXPECT_EQ(remote_control::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(RAManagerTest,
+ AcquireResource_AppRegisteredAnyHmiLevelResourceFree_Expect_Allowed) {
+ // Arrange
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ // Act & Assert
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_AppInAnyHmiLevelWantsToAcquireSameResourceTwice_Expect_Allowed) {
+ // Arrange
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ // Same app tries to get already acquired resource
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_NotInFULLWantsToGetAcquiredResource_Expect_Rejected) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace remote_control;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_BACKGROUND;
+ const AcquireResult::eType expected_result = AcquireResult::REJECTED;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_ALLOW;
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_DENY_Expect_InUse) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace remote_control;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::IN_USE;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_DENY;
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_ALLOW_Expect_Allowed) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace remote_control;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::ALLOWED;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::AUTO_ALLOW;
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(
+ RAManagerTest,
+ AcquireResource_App2_InFULLWantsToGetAcquiredResource_ASK_DRIVER_Expect_AskDriver) {
+ using namespace mobile_apis;
+ using namespace hmi_apis;
+ using namespace remote_control;
+ const HMILevel::eType app_level = HMILevel::eType::HMI_FULL;
+ const AcquireResult::eType expected_result = AcquireResult::ASK_DRIVER;
+ const Common_RCAccessMode::eType access_mode =
+ Common_RCAccessMode::eType::ASK_DRIVER;
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ CheckResultWithHMILevelAndAccessMode(
+ ra_manager, app_level, expected_result, access_mode);
+}
+
+TEST_F(RAManagerTest,
+ AcquireResource_AcquiredModuleIsRejectedForApp2_ExpectApp2Rejected) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ EXPECT_EQ(AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ ra_manager.OnDriverDisallowed(kModuleType1, kAppId2);
+
+ // Assert
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_EQ(AcquireResult::REJECTED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppExit_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_1_);
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationExit, app_ptr);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_2_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
+ EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationExit, app_ptr);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_1_);
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationUnregistered, app_ptr);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillOnce(Return(mock_app_1_));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_2_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ // Act
+ application_manager::ApplicationSharedPtr app_ptr(mock_app_2_);
+ EXPECT_CALL(*mock_app_2_, app_id()).WillRepeatedly(Return(kAppId2));
+
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationUnregistered, app_ptr);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ std::vector<ApplicationSharedPtr> apps;
+ apps.push_back(mock_app_1_);
+ EXPECT_CALL(*mock_service_, GetApplications(_)).WillRepeatedly(Return(apps));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ // Act
+ ra_manager.OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationsDisabled);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ EXPECT_CALL(*mock_app_1_, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_1_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ std::vector<application_manager::ApplicationSharedPtr> apps;
+ apps.push_back(mock_app_1_);
+ EXPECT_CALL(*mock_service_, GetApplications(_)).WillOnce(Return(apps));
+
+ Resources allowed_modules;
+ allowed_modules.push_back(kModuleType1);
+
+ EXPECT_CALL(*mock_service_, GetModuleTypes(policy_app_id_1_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(allowed_modules), Return(true)));
+
+ // Act
+ ra_manager.OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationPolicyUpdated);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId2));
+}
+
+TEST_F(RAManagerTest, GetAccessMode_ExpectedSameAsHadSet) {
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_DENY);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_DENY,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::ASK_DRIVER,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_ALLOW);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_ALLOW,
+ ra_manager.GetAccessMode());
+
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::INVALID_ENUM);
+ EXPECT_EQ(hmi_apis::Common_RCAccessMode::INVALID_ENUM,
+ ra_manager.GetAccessMode());
+}
+
+} // namespace remote_control
diff --git a/src/components/resumption/CMakeLists.txt b/src/components/resumption/CMakeLists.txt
index b8fa277cae..a2c93b0689 100644
--- a/src/components/resumption/CMakeLists.txt
+++ b/src/components/resumption/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ford Motor Company
+# Copyright (c) 2017, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,20 +28,24 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
- include
+ ${COMPONENTS_DIR}/resumption/include
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/config_profile/include/
${JSONCPP_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ${COMPONENTS_DIR}/resumption/src/last_state.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
+collect_sources(SOURCES "${PATHS}")
add_library("Resumption" ${SOURCES})
+target_link_libraries("Resumption" Utils)
if(BUILD_TESTS)
add_subdirectory(test)
diff --git a/src/components/resumption/include/resumption/last_state.h b/src/components/resumption/include/resumption/last_state.h
index a331d9291c..3481fc9327 100644
--- a/src/components/resumption/include/resumption/last_state.h
+++ b/src/components/resumption/include/resumption/last_state.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,7 +35,6 @@
#include <string>
-#include "utils/macro.h"
#include "json/json.h"
namespace resumption {
@@ -43,36 +42,19 @@ namespace resumption {
class LastState {
public:
/**
- * @brief Constructor
- */
- LastState(const std::string& app_storage_folder,
- const std::string& app_info_storage);
-
- /**
* @brief Destructor
*/
- ~LastState();
+ virtual ~LastState() {}
/**
* @brief Saving dictionary to filesystem
*/
- void SaveToFileSystem();
-
- /**
- * @brief public dictionary
- */
- Json::Value dictionary;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(LastState);
+ virtual void SaveStateToFileSystem() = 0;
/**
- * @brief Load dictionary from filesystem
+ * @brief Get reference to dictionary
*/
- void LoadFromFileSystem();
-
- std::string app_storage_folder_;
- std::string app_info_storage_;
+ virtual Json::Value& get_dictionary() = 0;
};
} // namespace resumption
diff --git a/src/components/resumption/include/resumption/last_state_impl.h b/src/components/resumption/include/resumption/last_state_impl.h
new file mode 100644
index 0000000000..2da3147930
--- /dev/null
+++ b/src/components/resumption/include/resumption/last_state_impl.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_RESUMPTION_INCLUDE_RESUMPTION_LAST_STATE_IMPL_H_
+#define SRC_COMPONENTS_RESUMPTION_INCLUDE_RESUMPTION_LAST_STATE_IMPL_H_
+
+#include "resumption/last_state.h"
+#include "utils/macro.h"
+
+namespace resumption {
+
+/**
+ * @brief The LastStateImpl class handles interface of last state
+ */
+
+class LastStateImpl : public LastState {
+ public:
+ /**
+ * @brief Constructor
+ */
+ LastStateImpl(const std::string& app_storage_folder,
+ const std::string& app_info_storage);
+
+ /**
+ * @brief Destructor
+ */
+ ~LastStateImpl();
+
+ /**
+ * @brief Saving dictionary to filesystem
+ */
+ void SaveStateToFileSystem() OVERRIDE;
+
+ /**
+ * @brief Get reference to dictionary
+ */
+ Json::Value& get_dictionary() OVERRIDE;
+
+ private:
+ const std::string app_storage_folder_;
+ const std::string app_info_storage_;
+ Json::Value dictionary_;
+
+ /**
+ * @brief Load dictionary from filesystem
+ */
+ void LoadStateFromFileSystem();
+
+ DISALLOW_COPY_AND_ASSIGN(LastStateImpl);
+};
+
+} // namespace resumption
+
+#endif // SRC_COMPONENTS_RESUMPTION_INCLUDE_RESUMPTION_LAST_STATE_IMPL_H_
diff --git a/src/components/resumption/src/last_state.cc b/src/components/resumption/src/last_state.cc
deleted file mode 100644
index c1b8534bfc..0000000000
--- a/src/components/resumption/src/last_state.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2013, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "resumption/last_state.h"
-#include "utils/file_system.h"
-#include "utils/logger.h"
-
-namespace resumption {
-
-CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
-
-LastState::LastState(const std::string& app_storage_folder,
- const std::string& app_info_storage)
- : app_storage_folder_(app_storage_folder)
- , app_info_storage_(app_info_storage) {
- LoadFromFileSystem();
- LOG4CXX_AUTO_TRACE(logger_);
-}
-
-LastState::~LastState() {
- LOG4CXX_AUTO_TRACE(logger_);
- SaveToFileSystem();
-}
-
-void LastState::SaveToFileSystem() {
- LOG4CXX_AUTO_TRACE(logger_);
- const std::string& str = dictionary.toStyledString();
- const std::vector<uint8_t> char_vector_pdata(str.begin(), str.end());
-
- DCHECK(file_system::CreateDirectoryRecursively(app_storage_folder_));
- LOG4CXX_INFO(logger_,
- "LastState::SaveToFileSystem " << app_info_storage_ << str);
- DCHECK(file_system::Write(app_info_storage_, char_vector_pdata));
-}
-
-void LastState::LoadFromFileSystem() {
- std::string buffer;
- bool result = file_system::ReadFile(app_info_storage_, buffer);
- Json::Reader m_reader;
- if (result && m_reader.parse(buffer, dictionary)) {
- LOG4CXX_INFO(logger_,
- "Valid last state was found." << dictionary.toStyledString());
- return;
- }
- LOG4CXX_WARN(logger_, "No valid last state was found.");
-}
-
-} // resumption
diff --git a/src/components/resumption/src/last_state_impl.cc b/src/components/resumption/src/last_state_impl.cc
new file mode 100644
index 0000000000..4d3fd1526c
--- /dev/null
+++ b/src/components/resumption/src/last_state_impl.cc
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "resumption/last_state_impl.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+
+namespace resumption {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption")
+
+LastStateImpl::LastStateImpl(const std::string& app_storage_folder,
+ const std::string& app_info_storage)
+ : app_storage_folder_(app_storage_folder)
+ , app_info_storage_(app_info_storage) {
+ LoadStateFromFileSystem();
+ LOG4CXX_AUTO_TRACE(logger_);
+}
+
+LastStateImpl::~LastStateImpl() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SaveStateToFileSystem();
+}
+
+void LastStateImpl::SaveStateToFileSystem() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const std::string& str = dictionary_.toStyledString();
+ const std::vector<uint8_t> char_vector_pdata(str.begin(), str.end());
+
+ DCHECK(file_system::CreateDirectoryRecursively(app_storage_folder_));
+ LOG4CXX_INFO(logger_,
+ "LastState::SaveStateToFileSystem " << app_info_storage_ << str);
+ DCHECK(file_system::Write(app_info_storage_, char_vector_pdata));
+}
+
+Json::Value& LastStateImpl::get_dictionary() {
+ return dictionary_;
+}
+
+void LastStateImpl::LoadStateFromFileSystem() {
+ std::string buffer;
+ bool result = file_system::ReadFile(app_info_storage_, buffer);
+ Json::Reader m_reader;
+ if (result && m_reader.parse(buffer, dictionary_)) {
+ LOG4CXX_INFO(logger_,
+ "Valid last state was found." << dictionary_.toStyledString());
+ return;
+ }
+ LOG4CXX_WARN(logger_, "No valid last state was found.");
+}
+
+} // resumption
diff --git a/src/components/resumption/test/CMakeLists.txt b/src/components/resumption/test/CMakeLists.txt
index 6fa1c07381..5481d5f80f 100644
--- a/src/components/resumption/test/CMakeLists.txt
+++ b/src/components/resumption/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
${LOG4CXX_INCLUDE_DIRECTORY}
@@ -41,22 +41,14 @@ include_directories(
${CMAKE_BINARY_DIR}
)
+collect_sources(SOURCES ${CMAKE_CURRENT_SOURCE_DIR})
+
set(LIBRARIES
gmock
ConfigProfile
Utils
Resumption
jsoncpp
- ConfigProfile
)
-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()
+create_test(resumption_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/resumption/test/last_state_test.cc b/src/components/resumption/test/last_state_test.cc
index 78acc68c90..15180fa12c 100644
--- a/src/components/resumption/test/last_state_test.cc
+++ b/src/components/resumption/test/last_state_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,7 @@
#include "gtest/gtest.h"
-#include "resumption/last_state.h"
+#include "resumption/last_state_impl.h"
#include "utils/file_system.h"
namespace test {
@@ -69,17 +69,17 @@ class LastStateTest : public ::testing::Test {
const std::string empty_dictionary_;
const std::string app_info_dat_file_;
- resumption::LastState last_state_;
+ resumption::LastStateImpl last_state_;
};
TEST_F(LastStateTest, Basic) {
- const Value& dictionary = last_state_.dictionary;
+ const Value& dictionary = last_state_.get_dictionary();
EXPECT_EQ(empty_dictionary_, dictionary.toStyledString());
}
TEST_F(LastStateTest, SetGetData) {
{
- const Value& dictionary = last_state_.dictionary;
+ Value& dictionary = last_state_.get_dictionary();
const Value& bluetooth_info =
dictionary["TransportManager"]["BluetoothAdapter"];
EXPECT_EQ(empty_dictionary_, bluetooth_info.toStyledString());
@@ -98,14 +98,14 @@ TEST_F(LastStateTest, SetGetData) {
Value test_value;
test_value["name"] = "test_device";
- last_state_.dictionary["TransportManager"]["TcpAdapter"]["devices"] =
- test_value;
- last_state_.dictionary["TransportManager"]["BluetoothAdapter"]["devices"] =
+ dictionary["TransportManager"]["TcpAdapter"]["devices"] = test_value;
+
+ dictionary["TransportManager"]["BluetoothAdapter"]["devices"] =
"bluetooth_device";
- last_state_.SaveToFileSystem();
+ last_state_.SaveStateToFileSystem();
}
- const Value& dictionary = last_state_.dictionary;
+ const Value& dictionary = last_state_.get_dictionary();
const Value& bluetooth_info =
dictionary["TransportManager"]["BluetoothAdapter"];
diff --git a/src/components/rpc_base/CMakeLists.txt b/src/components/rpc_base/CMakeLists.txt
index 94e67cc985..d9bf821b67 100644
--- a/src/components/rpc_base/CMakeLists.txt
+++ b/src/components/rpc_base/CMakeLists.txt
@@ -28,31 +28,28 @@
# 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- include
+ ${COMPONENTS_DIR}/rpc_base/include
+ ${COMPONENTS_DIR}/utils/include
${JSONCPP_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
+collect_sources(SOURCES "${PATHS}")
-set (HEADERS
- ${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
+set(LIBRARIES
+ jsoncpp
+ Utils
)
-add_library(rpc_base ${HEADERS} ${SOURCES})
-target_link_libraries(rpc_base jsoncpp)
+add_library(rpc_base ${SOURCES})
+target_link_libraries(rpc_base ${LIBRARIES})
if(BUILD_TESTS)
add_subdirectory(test)
-endif() \ No newline at end of file
+endif()
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 04ad1219b5..64930f7259 100644
--- a/src/components/rpc_base/include/rpc_base/gtest_support.h
+++ b/src/components/rpc_base/include/rpc_base/gtest_support.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RPC_BASE_GTEST_SUPPORT_H_
-#define RPC_BASE_GTEST_SUPPORT_H_
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_GTEST_SUPPORT_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_GTEST_SUPPORT_H_
#include <gtest/gtest.h>
@@ -59,4 +59,4 @@ template <typename T>
#define EXPECT_RPCTYPE_VALID(object) \
EXPECT_PRED_FORMAT1(AssertRpcObjValid, object)
-#endif /* RPC_BASE_GTEST_SUPPORT_H_ */
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_GTEST_SUPPORT_H_
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 883c2ec4bf..6792f47732 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_base.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_base.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef VALIDATED_TYPES_H_
-#define VALIDATED_TYPES_H_
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_H_
#include <stdint.h>
#include <map>
@@ -58,7 +58,7 @@ enum PolicyTableType {
PT_UPDATE,
PT_SNAPSHOT
};
-const std::string ommited_validation_info = "should be ommited in ";
+const std::string omitted_validation_info = "should be omitted in ";
const std::string required_validation_info = "is required in ";
std::string PolicyTableTypeToString(const PolicyTableType pt_type);
@@ -300,7 +300,7 @@ class Array : public std::vector<T>, public CompositeType {
Json::Value ToJsonValue() const;
void ToDbusWriter(dbus::MessageWriter* writer) const;
- bool is_valid() const;
+ virtual bool is_valid() const;
bool is_initialized() const;
void ReportErrors(ValidationReport* report) const;
virtual void SetPolicyTableType(
@@ -439,4 +439,4 @@ class Optional {
#include "rpc_base_inl.h"
#include "rpc_base_json_inl.h"
-#endif /* VALIDATED_TYPES_H_ */
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_H_
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 2b968dd034..aae1a34ac2 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef RPC_BASE_DBUS_INL_H_
-#define RPC_BASE_DBUS_INL_H_
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
#include "dbus/dbus_message.h"
#include "json/value.h"
@@ -498,4 +498,4 @@ inline void Optional<T>::ToDbusWriter(dbus::MessageWriter* writer) const {
} // namespace rpc
-#endif // RPC_BASE_DBUS_INL_H_
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_DBUS_INL_H_
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 a9ff484eb0..b6b47c2ed8 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef VALIDATED_TYPES_INL_H_
-#define VALIDATED_TYPES_INL_H_
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_INL_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_INL_H_
#include "rpc_base.h"
@@ -177,7 +177,7 @@ Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator=(
const Integer& new_val) {
this->value_ = new_val.value_;
if (new_val.is_initialized()) {
- this->value_state_ = range_.Includes(new_val.value_) ? kValid : kInvalid;
+ this->value_state_ = new_val.value_state_;
}
return *this;
@@ -547,12 +547,14 @@ void Nullable<T>::ReportErrors(ValidationReport* report) const {
* Optional class
*/
template <typename T>
-Optional<T>::Optional() {}
+Optional<T>::Optional()
+ : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE) {}
template <typename T>
template <typename U>
Optional<T>::Optional(const U& value)
- : value_(value) {}
+ : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE)
+ , value_(value) {}
template <typename T>
T& Optional<T>::operator*() {
@@ -672,4 +674,4 @@ void Stringifyable<T>::ReportErrors(ValidationReport* report) const {
} // namespace rpc
-#endif /* VALIDATED_TYPES_INL_H_ */
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_INL_H_
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 b9fcac4b6a..6c8bb359af 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef VALIDATED_TYPES_JSON_INL_H_
-#define VALIDATED_TYPES_JSON_INL_H_
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_JSON_INL_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_JSON_INL_H_
#include "rpc_base/rpc_base.h"
#include "json/value.h"
@@ -140,8 +140,7 @@ 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_) {}
+ : PrimitiveType(val.value_state_), value_(val.value_) {}
template <typename T, T minval, T maxval>
Integer<T, minval, maxval>::Integer(const Json::Value* value, IntType def_value)
@@ -351,7 +350,8 @@ inline Json::Value Nullable<T>::ToJsonValue() const {
template <typename T>
template <typename U>
Optional<T>::Optional(const Json::Value* value, const U& def_value)
- : value_(value, def_value) {}
+ : policy_table_type_(policy_table_interface_base::INVALID_PT_TYPE)
+ , value_(value, def_value) {}
template <typename T>
inline Json::Value Optional<T>::ToJsonValue() const {
@@ -384,4 +384,4 @@ inline Json::Value Stringifyable<T>::ToJsonValue() const {
} // namespace rpc
-#endif /* VALIDATED_TYPES_JSON_INL_H_ */
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_BASE_JSON_INL_H_
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 7b5ed2e375..5d1958157f 100644
--- a/src/components/rpc_base/include/rpc_base/rpc_message.h
+++ b/src/components/rpc_base/include/rpc_base/rpc_message.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TYPE_BASE_H_
-#define TYPE_BASE_H_
+#ifndef SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_MESSAGE_H_
+#define SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_MESSAGE_H_
#include "rpc_base.h"
@@ -99,4 +99,4 @@ class NotificationBase : public Message, public CompositeType {
} // namespace rpc
-#endif /* TYPE_BASE_H_ */
+#endif // SRC_COMPONENTS_RPC_BASE_INCLUDE_RPC_BASE_RPC_MESSAGE_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
deleted file mode 100644
index 941c8f61cc..0000000000
--- a/src/components/rpc_base/include/rpc_base/validation_report.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef RPC_BASE_VALIDATION_REPORT_H_
-#define RPC_BASE_VALIDATION_REPORT_H_
-
-#include <string>
-#include <list>
-
-namespace rpc {
-
-class ValidationReport;
-typedef std::list<ValidationReport> ValidationReports;
-
-class ValidationReport {
- public:
- explicit ValidationReport(const std::string& object_name);
- const std::string& object_name() const;
- const std::string& validation_info() const;
- void set_validation_info(const std::string& info);
- const ValidationReports& subobject_reports() const;
- ValidationReport& ReportSubobject(const std::string& object_name);
-
- private:
- std::string object_name_;
- std::string validation_info_;
- ValidationReports subobject_reports_;
-};
-
-std::string PrettyFormat(const ValidationReport& report);
-
-// Implementation
-
-namespace impl {
-inline void PrettyFormat(const ValidationReport& report,
- const std::string& parent_path,
- std::string* result) {
- std::string object_path = parent_path;
- if (!object_path.empty() && report.object_name()[0] != '[') {
- object_path.append(".");
- }
- object_path.append(report.object_name());
- if (!report.validation_info().empty()) {
- result->append(object_path);
- result->append(": ");
- result->append(report.validation_info());
- result->append("\n");
- }
- const ValidationReports& subreports = report.subobject_reports();
- for (ValidationReports::const_iterator i = subreports.begin(),
- end = subreports.end();
- i != end;
- ++i) {
- PrettyFormat(*i, object_path, result);
- }
-}
-} // namespace impl
-
-inline ValidationReport::ValidationReport(const std::string& object_name)
- : object_name_(object_name) {}
-
-inline const std::string& ValidationReport::object_name() const {
- return object_name_;
-}
-
-inline const std::string& ValidationReport::validation_info() const {
- return validation_info_;
-}
-
-inline void ValidationReport::set_validation_info(const std::string& info) {
- validation_info_ = info;
-}
-
-inline const std::list<ValidationReport>& ValidationReport::subobject_reports()
- const {
- return subobject_reports_;
-}
-
-inline ValidationReport& ValidationReport::ReportSubobject(
- const std::string& object_name) {
- subobject_reports_.push_back(ValidationReport(object_name));
- return subobject_reports_.back();
-}
-
-inline std::string PrettyFormat(const ValidationReport& report) {
- std::string result;
- impl::PrettyFormat(report, "", &result);
- return result;
-}
-
-} // namespace rpc
-
-#endif /* RPC_BASE_VALIDATION_REPORT_H_ */
diff --git a/src/components/rpc_base/test/CMakeLists.txt b/src/components/rpc_base/test/CMakeLists.txt
index 76cf738f46..ca4f41fe76 100644
--- a/src/components/rpc_base/test/CMakeLists.txt
+++ b/src/components/rpc_base/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,12 +28,12 @@
# 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 (
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
+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}
)
@@ -43,20 +43,16 @@ set(LIBRARIES
jsoncpp
)
-set(SOURCES
- rpc_base_json_test.cc
- rpc_base_test.cc
- validation_report_test.cc
-)
-
-if (${HMI_DBUS_API})
- # Build dbus tests
+if(${HMI_DBUS_API})
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}")
-
+ list(APPEND LIBRARIES
+ DBus
+ )
+else()
+ set(EXCLUDE_PATHS
+ rpc_base_dbus_test.cc
+ )
endif()
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+create_test(rpc_base_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/rpc_base/test/rpc_base_dbus_test.cc b/src/components/rpc_base/test/rpc_base_dbus_test.cc
index f26ce25c5d..4a22e111a3 100644
--- a/src/components/rpc_base/test/rpc_base_dbus_test.cc
+++ b/src/components/rpc_base/test/rpc_base_dbus_test.cc
@@ -35,6 +35,9 @@
#include "rpc_base/rpc_base_dbus_inl.h"
namespace test {
+namespace components {
+namespace rpc_base_test {
+
using namespace rpc;
using namespace dbus;
@@ -169,7 +172,7 @@ TEST_F(DbusDeserialization, DeserializeArray) {
{
dbus::MessageWriter writer(msgref);
std::string array_signature;
- rpc::DbusSignature<Integer<int32_t, 1, 50>>(&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);
@@ -192,13 +195,13 @@ TEST_F(DbusDeserialization, DeserializeArrayOfArrays) {
{
dbus::MessageWriter writer(msgref);
std::string array_signature;
- rpc::DbusSignature<Array<Integer<int32_t, 1, 50>, 1, 5>>(&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);
+ rpc::DbusSignature<Integer<int32_t, 1, 50> >(&subarray_signature);
dbus::MessageWriter subarray_wirter(
&array_writer, dbus::kArray, subarray_signature.c_str());
@@ -275,7 +278,7 @@ TEST_F(DbusDeserialization, DeserializeOptionalString) {
}
{
dbus::MessageReader reader(msgref);
- Optional<String<1, 100>> readback(&reader);
+ Optional<String<1, 100> > readback(&reader);
ASSERT_TRUE(readback.is_initialized());
ASSERT_TRUE(readback.is_valid());
ASSERT_EQ(std::string(*readback), "Hello dear");
@@ -293,7 +296,7 @@ TEST_F(DbusDeserialization, DeserializeOptionalInt) {
}
{
dbus::MessageReader reader(msgref);
- Optional<Integer<int32_t, 1, 90>> readback(&reader);
+ Optional<Integer<int32_t, 1, 90> > readback(&reader);
ASSERT_FALSE(readback.is_initialized());
ASSERT_TRUE(readback.is_valid());
ASSERT_FALSE(reader.has_failed());
@@ -494,61 +497,61 @@ TEST(ValidatedTypes, TestBooleanDbusSignature) {
TEST(ValidatedTypes, TestIntDbusSignature) {
std::string sign;
- DbusSignature<Integer<int32_t, 1, 2>>(&sign);
+ DbusSignature<Integer<int32_t, 1, 2> >(&sign);
ASSERT_EQ(sign, "i");
}
TEST(ValidatedTypes, TestFloatDbusSignature) {
std::string sign;
- DbusSignature<Float<1, 2>>(&sign);
+ DbusSignature<Float<1, 2> >(&sign);
ASSERT_EQ(sign, "d");
}
TEST(ValidatedTypes, TestStringDbusSignature) {
std::string sign;
- DbusSignature<String<1, 2>>(&sign);
+ DbusSignature<String<1, 2> >(&sign);
ASSERT_EQ(sign, "s");
}
TEST(ValidatedTypes, TestEnumDbusSignature) {
std::string sign;
- DbusSignature<Enum<TestEnum>>(&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);
+ 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);
+ 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);
+ 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);
+ DbusSignature<Enum<TestEnum> >(&sign);
ASSERT_EQ(sign, "i");
}
TEST(ValidatedTypes, TestOptionalEnumDbusSignature) {
std::string sign;
- DbusSignature<Optional<Enum<TestEnum>>>(&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);
+ DbusSignature<Optional<Array<Float<1, 2>, 3, 4> > >(&sign);
ASSERT_EQ(sign, "(bad)");
}
@@ -674,4 +677,6 @@ TEST_F(DbusFailuresTest, DbusNonExistentArrayReadTest) {
ASSERT_EQ(val, 0);
}
+} // namespace rpc_base_test
+} // namespace components
} // 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
index 07ac0418e0..cad9dd3a65 100644
--- a/src/components/rpc_base/test/rpc_base_json_test.cc
+++ b/src/components/rpc_base/test/rpc_base_json_test.cc
@@ -35,6 +35,9 @@
#include "rpc_base/rpc_base.h"
namespace test {
+namespace components {
+namespace rpc_base_test {
+
using namespace rpc;
using Json::Value;
@@ -278,8 +281,8 @@ TEST(ValidatedTypesJson, OptionalMapAbsentValueTest) {
TEST(ValidatedTypesJson, ArrayJsonTest) {
Value array_value;
- array_value.append(Value("Hello"));
- array_value.append(Value("World"));
+ array_value.append(Value(10));
+ array_value.append(Value(20));
Array<Integer<int8_t, 0, 32>, 2, 4> int_array(&array_value);
ASSERT_TRUE(int_array.is_initialized());
ASSERT_TRUE(int_array.is_valid());
@@ -365,4 +368,6 @@ TEST(ValidatedTypesJson, OptionalIntFromJsonTest) {
ASSERT_EQ(readback.asInt(), 42);
}
+} // namespace rpc_base_test
+} // namespace components
} // namespace test
diff --git a/src/components/rpc_base/test/rpc_base_test.cc b/src/components/rpc_base/test/rpc_base_test.cc
index 37a64b319e..d81e01db6c 100644
--- a/src/components/rpc_base/test/rpc_base_test.cc
+++ b/src/components/rpc_base/test/rpc_base_test.cc
@@ -36,6 +36,8 @@
#include "rpc_base/rpc_base.h"
namespace test {
+namespace components {
+namespace rpc_base_test {
using namespace rpc;
namespace {
@@ -318,7 +320,7 @@ TEST(ValidatedTypes, ReportUninitializedIntType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("val: value is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectInitializedIntType) {
@@ -326,7 +328,7 @@ TEST(ValidatedTypes, ReportIncorrectInitializedIntType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value initialized incorrectly\n", PrettyFormat(report));
+ ASSERT_EQ("val: value initialized incorrectly", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportUninitializedOptionalType) {
@@ -342,7 +344,7 @@ TEST(ValidatedTypes, ReportIncorrectInitializedOptionalType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value initialized incorrectly\n", PrettyFormat(report));
+ ASSERT_EQ("val: value initialized incorrectly", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportUninitializedNullableIntType) {
@@ -350,7 +352,7 @@ TEST(ValidatedTypes, ReportUninitializedNullableIntType) {
ASSERT_FALSE(val.is_valid());
ValidationReport report("val");
val.ReportErrors(&report);
- ASSERT_EQ("val: value is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("val: value is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportNullInitializedNullableIntType) {
@@ -367,7 +369,7 @@ TEST(ValidatedTypes, ReportNoninitializedIntArray) {
ASSERT_FALSE(array.is_valid());
ValidationReport report("array");
array.ReportErrors(&report);
- ASSERT_EQ("array: object is not initialized\n", PrettyFormat(report));
+ ASSERT_EQ("array: object is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray1) {
@@ -376,7 +378,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray1) {
ASSERT_FALSE(array.is_valid());
ValidationReport report("array");
array.ReportErrors(&report);
- ASSERT_EQ("array[0]: value initialized incorrectly\n", PrettyFormat(report));
+ ASSERT_EQ("array[0]: value initialized incorrectly", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray2) {
@@ -388,7 +390,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedIntArray2) {
ASSERT_FALSE(array.is_valid());
ValidationReport report("array");
array.ReportErrors(&report);
- ASSERT_EQ("array: array has invalid size\n", PrettyFormat(report));
+ ASSERT_EQ("array: array has invalid size", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedArray3) {
@@ -401,7 +403,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedArray3) {
array.ReportErrors(&report);
ASSERT_EQ(
"array: array has invalid size\n"
- "array[2]: value initialized incorrectly\n",
+ "array[2]: value initialized incorrectly",
PrettyFormat(report));
}
@@ -409,7 +411,7 @@ 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));
+ ASSERT_EQ("map: object is not initialized", PrettyFormat(report));
}
TEST(ValidatedTypes, ReportIncorrectlyInitializedMap1) {
@@ -417,7 +419,7 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedMap1) {
map["aha"] = 42;
ValidationReport report("map");
map.ReportErrors(&report);
- ASSERT_EQ("map[\"aha\"]: value initialized incorrectly\n",
+ ASSERT_EQ("map[\"aha\"]: value initialized incorrectly",
PrettyFormat(report));
}
@@ -431,8 +433,10 @@ TEST(ValidatedTypes, ReportIncorrectlyInitializedMap2) {
map.ReportErrors(&report);
ASSERT_EQ(
"map[\"haha\"]: value initialized incorrectly\n"
- "map[\"muhahaha\"]: value initialized incorrectly\n",
+ "map[\"muhahaha\"]: value initialized incorrectly",
PrettyFormat(report));
}
-} // namespace codegen
+} // namespace rpc_base_test
+} // namespace components
+} // namespace test
diff --git a/src/components/rpc_base/test/validation_report_test.cc b/src/components/rpc_base/test/validation_report_test.cc
index e7dded342c..10effe7dd2 100644
--- a/src/components/rpc_base/test/validation_report_test.cc
+++ b/src/components/rpc_base/test/validation_report_test.cc
@@ -35,6 +35,8 @@
#include "rpc_base/validation_report.h"
namespace test {
+namespace components {
+namespace rpc_base_test {
using namespace rpc;
class ValidationReportTest : public testing::Test {
@@ -73,7 +75,7 @@ class ValidationReportTest : public testing::Test {
} else {
temp = "";
}
- result = parent_name + temp + obj_name + ":" + " " + val_info + "\n";
+ result = parent_name + temp + obj_name + ":" + " " + val_info;
}
void ClearValidationInfo() {
@@ -157,4 +159,6 @@ TEST_F(ValidationReportTest, PrettyFormat_ExpectDataCorrect) {
EXPECT_EQ(temp2, result2);
}
-} // namespace rpc
+} // namespace rpc_base_test
+} // namespace components
+} // namespace test
diff --git a/src/components/security_manager/CMakeLists.txt b/src/components/security_manager/CMakeLists.txt
index 3cc6178931..88bc1ddab4 100644
--- a/src/components/security_manager/CMakeLists.txt
+++ b/src/components/security_manager/CMakeLists.txt
@@ -1,4 +1,4 @@
-# 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
@@ -27,29 +27,38 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-
+
+
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
- include/
+ ${COMPONENTS_DIR}/security_manager/include/
${COMPONENTS_DIR}/protocol_handler/include/
${COMPONENTS_DIR}/connection_handler/include
${COMPONENTS_DIR}/config_profile/include/
${COMPONENTS_DIR}/utils/include/
${COMPONENTS_DIR}/application_manager/include/
${JSONCPP_INCLUDE_DIRECTORY}
- ${CMAKE_SOURCE_DIR}/src/thirdPartyLibs/jsoncpp/include
${APR_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ${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
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+collect_sources(SOURCES "${PATHS}")
+
+set(LIBRARIES
+ Utils
+ crypto
+ ssl
+ ProtocolHandler
+ jsoncpp
+ ProtocolLibrary
)
add_library(SecurityManager ${SOURCES})
-target_link_libraries(SecurityManager crypto ssl ProtocolHandler jsoncpp ProtocolLibrary)
+target_link_libraries(SecurityManager ${LIBRARIES})
if(BUILD_TESTS)
add_subdirectory(test)
diff --git a/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox b/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox
new file mode 100644
index 0000000000..42da2364d3
--- /dev/null
+++ b/src/components/security_manager/docs/FORD.OpenSDL.SDD.Security.dox
@@ -0,0 +1,241 @@
+/**
+\page security_manager Security Manager Detailed Design
+## Table of contents
+- \subpage security_manager_intoduction
+ + \ref security_manager_rationale "1.1 Rationale"
+ + \ref security_manager_scope "1.2 Scope"
+ + \ref security_manager_abbreviations "1.3 Abbreviations"
+- \subpage security_manager_detail_design
+ + \ref security_manager_design_solutions "2.1 Design solutions"
+ + \ref security_manager_class_structure "2.2 Class Structure"
+ + \ref security_manager_sequence_diagram "2.3 Sequence diagram"
+ + \ref security_manager_state_chart "2.4 State chart diagram"
+- \subpage security_manager_interfaces
+ + \ref security_manager_public_interfaces "3.1 Public interfaces description"
+ + \ref security_manager_internal_interfaces "3.2 Internal interfaces description"
+ + \ref security_manager_derived_interfaces "3.3 Derived interfaces and dependencies"
+- \subpage security_manager_data_structure_resources
+ + \ref security_manager_data_structure "4.1 Element Data Structure"
+ + \ref security_manager_resources "4.2 Resource usage"
+- \subpage security_manager_references_and_history
+ + \ref security_manager_references "5.1 References"
+ + \ref security_manager_history "5.2 Document history change and approve"
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_intoduction 1 Introduction
+The document is intended to support software developers,
+maintenance and integration engineers with sufficient,
+detailed information concerning the design, development and
+deployment concepts, to accomplish their respective tasks without reliance on the authors.
+
+\anchor security_manager_rationale
+## 1.1 Rationale
+Security Manager implements SDL Architectural Solution according to:
+- https://smartdevicelink.com/en/guides/core/software-architecture-document/components-view/#security-manager
+
+\anchor security_manager_scope
+## 1.2 Scope
+Security Manager component extracted as a separate module for
+Ford channel data protection.
+This components is used to:
+- Provide security communications
+- Protect income and outcome business layer data from interception
+- Verify the relation between a mobile application certificate and its owner
+
+\anchor security_manager_abbreviations
+## 1.3 Abbreviations
+Abbreviations used in this document please find in the table below.
+| Abbreviation | Expansion |
+|------------------|----------------------------------|
+| SSL | Secure Sockets Layer cryptographic protocol |
+| TLS | Transport Layer Security cryptographic protocol |
+| DTLS | Datagram TLS cryptographic protocol |
+
+Definitions used in this document are in the table below.
+
+| Definition | Description |
+|---------------------------|-----------------------------------|
+| SSL/TLS/DTL | Cryptographic protocols that provide communications security over a computer network |
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_detail_design 2 Component detail design
+\anchor security_manager_design_solutions
+### 2.1 Design solutions
+The following design approaches and pattern was used for Security Manager:
+- Protection, creation and business logic is spitted to separates interfaces
+ + SecurityManager for handling Security queries from mobile side
+ + SSLContext provides for SSL connection establishing, encryption and decryption
+ + CryptoManager provides a factory for SSLContext
+- [Abstract Factory pattern design](https://sourcemaking.com/design_patterns/abstract_factory)
+ used for SSLContext objects creation
+ + It also guaranty correctness of SSLContext destruction by the
+ same Compiled SecurityManager object
+
+#### Design description
+security_manager::SSLContext is an interface for TLS connection establishing, data encryption and
+decryption within this connection.
+security_manager::SSLContextImpl implements SSLContext and wraps OpenSSL library handshake procedure,
+encryption and decryption, contains handshake procedure error handling.
+_Note:_ security_manager::SSLContext objects are stored in connection_handler::ConnectionHandlerImpl,
+which implements protocol_handler::SessionObserver interface.
+
+security_manager::CryptoManager is an interface for SSLContext creation and destruction,
+CA certificate update and last SSL error providing.
+security_manager::CryptoManagerImpl implements security_manager::CryptoManager and hides
+all OpenSSL initialization logics and SSL internal structures creation.
+
+security_manager::SecurityManager is a Facade of security_manager component and provides
+external interface for security_manager::SSLContext creation and sending security error
+via control service.
+security_manager::SecurityManagerImpl implements security_manager::SecurityManager and
+encapsulates control service data (security internal errors, handshake data) handling.
+
+security_manager::SecurityManagerListener is an interface for protection result notification
+to other components.
+security_manager::SecurityManagerListener is implemented in a protocol_handler::ProtocolHandlerImpl for sending
+protocol layer response on handshake procedure finish.
+
+
+\anchor security_manager_class_structure
+### 2.2 Class Structure
+The following UML class digram shows the component structure.
+![Security Manager class diagram](sm_class_digram.png)
+For more information about class digram follow:
+- http://www.uml-diagrams.org/class-diagrams-overview.htqml
+- https://sourcemaking.com/uml/modeling-it-systems/structural-view/class-diagram
+
+\anchor security_manager_sequence_diagram
+### 2.3 Sequence diagram
+The following UML sequence digram shows the component dynamic behavior.
+For more information about sequence digram follow:
+- http://www.uml-diagrams.org/sequence-diagrams.html
+- https://sourcemaking.com/uml/modeling-it-systems/external-view/use-case-sequence-diagram
+
+Security first initialization on session:
+![Start encryption](sm_sequence_digram_init.png)
+
+Security initialization for service on session with already initialized security:
+![Initialization](sm_sequence_digram_verify.png)
+
+Decryption procedure:
+![Decryption](sm_sequence_digram_decryption.png)
+
+Encryption procedure:
+![Encryption](sm_sequence_digram_encryption.png)
+
+\anchor security_manager_state_chart
+### 2.4 State chart diagram
+Not applicable for Security Manager.
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_interfaces 3 Component Interfaces
+\anchor security_manager_public_interfaces
+### 3.1 Public interfaces description
+Security Manager provides functionality with following interfaces:
+- security_manager::SecurityManager
+- security_manager::SecurityManagerListener
+- security_manager::SSLContext
+
+\anchor security_manager_internal_interfaces
+### 3.2 Internal interfaces description
+The following interfaces are provided by component for internal usage only:
+ - security_manager::CryptoManager
+ - security_manager::CryptoManagerSettings
+
+\anchor security_manager_derived_interfaces
+### 3.3 Derived interfaces and dependencies
+Security Manager required following 3d-party libraries:
+ - OpenSSL library v 1.0.1g and higher to meet TLS cipher restricts
+
+The following interfaces are required by component:
+- \ref src/components/include/utils Utils
+- protocol_handler::ProtocolObserver for getting Protocol notifications
+- implements protocol_handler::SessionObserver for providing SSLContext object managing
+- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+ + [SSL_library_init()](https://www.openssl.org/docs/manmaster/ssl/SSL_library_init.html)
+ - registers the available SSL/TLS ciphers and digests.
+ + [SSL_METHOD](https://www.openssl.org/docs/manmaster/ssl/ssl.html)
+ - That's a dispatch structure describing the internal ssl library methods/functions which implement the various protocol versions (SSLv3 TLSv1, ...). It's needed to create an SSL_CTX.
+ + [(D)TLSv1(_1/2)_(server/client)_method, ]
+ (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
+ - TLS/SSL connections established with these methods will understand the TLSv1 protocol.
+ - A client will send out TLSv1 client hello messages and will indicate that it only understands TLSv1. A server will only understand TLSv1 client hello messages.
+ + [SSL_CTX_new](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_new.html)
+ - creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections.
+ + [SSL_CTX_free](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_free.html)
+ - decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0.
+ + [SSL_CTX_use_certificate_file, SSL_CTX_use_PrivateKey_file, SSL_CTX_check_private_key]
+ (https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_use_certificate.html)
+ - load certificate and key data
+ + [SSL_CTX_set_cipher_list](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_cipher_list.html)
+ - choose list of available [cipher suites](https://en.wikipedia.org/wiki/Cipher_suite)
+ + [SSL_new](https://www.openssl.org/docs/manmaster/ssl/SSL_new.html)
+ - creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. The new structure inherits the settings of the underlying context ctx: connection method, options, verification settings, timeout settings.
+ + [SSL_CTX_set_verify](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_verify.html)
+ - sets the verification flags for ctx to be mode and specifies the verify_callback function to be used.
+ + [SSL_CTX_load_verify_locations](https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_load_verify_locations.html)
+ - specifies the locations for ctx, at which CA certificates for verification purposes are located.
+ + [X509_STORE_CTX_get_error, X509_STORE_CTX_set_error](https://www.openssl.org/docs/manmaster/crypto/X509_STORE_CTX_set_error.html)
+ - get or set certificate verification status information
+ + [SSL_do_handshake](https://www.openssl.org/docs/manmaster/ssl/SSL_do_handshake.html)
+ - waits for a SSL/TLS handshake to take place. If the connection is in client mode, the handshake will be started.
+ - The handshake routines may have to be explicitly set in advance using either SSL_set_connect_state or SSL_set_accept_state.
+ + [SSL_shutdown](https://www.openssl.org/docs/manmaster/ssl/SSL_shutdown.html)
+ - shuts down an active TLS/SSL connection. It sends the "close notify" shutdown alert to the peer.
+ + [SSL_free](https://www.openssl.org/docs/manmaster/ssl/SSL_free.html)
+ - decrements the reference count of ssl, and removes the SSL structure pointed to by ssl
+ - frees up the allocated memory if the reference count has reached 0.
+ +[BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all](https://www.openssl.org/docs/manmaster/crypto/bio.html)
+ - BIO allocation and freeing functions
+ + [BIO_read, BIO_write, BIO_gets, BIO_puts](https://www.openssl.org/docs/manmaster/crypto/BIO_read.html)
+ - BIO I/O functions
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_data_structure_resources 4 Component data and resources
+\anchor security_manager_data_structure
+### 4.1 Element Data Structure
+The following data types are used by the Component:
+ - security_manager::SecurityQuery
+ - protocol_handler::ProtocolPacket
+
+The format of certificate data exchange is:
+ - PEM certificates according to [APPLINK-21512](https://adc.luxoft.com/jira/browse/APPLINK-21512)
+
+\anchor security_manager_resources
+### 4.2 Resource usage
+Security Manager get an assess to certificate and private key
+data using OpenSSl API.
+*/
+//-----------------------------------------------------------
+/**
+\page security_manager_references_and_history 5 References and history
+\anchor security_manager_references
+### 5.1 References
+- [Software Architecture Document](https://smartdevicelink.com/en/guides/core/software-architecture-document/table-of-contents/)
+- [OpenSSL API](https://www.openssl.org/docs/manmaster/ssl/)
+- [TLS 1.1 RFC](https://tools.ietf.org/html/rfc4346)
+- [TLS 1.2 RFC](https://tools.ietf.org/html/rfc5246)
+- [DTLS RFC](https://tools.ietf.org/html/rfc4347)
+
+\anchor security_manager_history
+### 5.2 Document history
+Document change history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|----------------------------------------|---------------------|
+| 0.1 | 08/11/2016 | [EZamakhov](https://github.com/pestOO) | Initial version from the previous [SDL SDD](https://adc.luxoft.com/confluence/pages/viewpage.action?pageId=279677125) |
+
+Document approve history
+
+| Version | Data | Author/Editor | Change description |
+|-------------|------------|-----------------------------|---------------------|
+| | | | |
+
+For more precise document change history follow github history -
+- https://github.com/smartdevicelink/sdl_core/commits/master/src/components/security_manager/docs/security_manager_software_detailed_design.dox
+- https://github.com/smartdevicelink/sdl_core/commits/develop/src/components/security_manager/docs/security_manager_software_detailed_design.dox
+*/ \ No newline at end of file
diff --git a/src/components/security_manager/docs/assets/sm_class_digram.png b/src/components/security_manager/docs/assets/sm_class_digram.png
new file mode 100644
index 0000000000..61e300f4e7
--- /dev/null
+++ b/src/components/security_manager/docs/assets/sm_class_digram.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png b/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png
new file mode 100644
index 0000000000..849fe45b88
--- /dev/null
+++ b/src/components/security_manager/docs/assets/sm_sequence_digram_decryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png b/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png
new file mode 100644
index 0000000000..66dffd265e
--- /dev/null
+++ b/src/components/security_manager/docs/assets/sm_sequence_digram_encryption.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_init.png b/src/components/security_manager/docs/assets/sm_sequence_digram_init.png
new file mode 100644
index 0000000000..334b42b258
--- /dev/null
+++ b/src/components/security_manager/docs/assets/sm_sequence_digram_init.png
Binary files differ
diff --git a/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png b/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png
new file mode 100644
index 0000000000..cb040c918b
--- /dev/null
+++ b/src/components/security_manager/docs/assets/sm_sequence_digram_verify.png
Binary files differ
diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
index 6aea2e28b1..4e48858e5c 100644
--- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h
+++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h
@@ -80,6 +80,15 @@ class CryptoManagerImpl : public CryptoManager {
private:
void PrintCertInfo();
+
+ /**
+ * @brief Removes disallowed for printing certificate information from input
+ * data
+ * @param in_data input data with certificate information
+ * @return filtered string with allowed for printing information
+ */
+ const std::string RemoveDisallowedInfo(X509_NAME* in_data) const;
+
HandshakeResult CheckCertContext();
bool ReadHandshakeData(const uint8_t** const out_data,
size_t* out_data_size);
@@ -128,6 +137,11 @@ class CryptoManagerImpl : public CryptoManager {
int pull_number_from_buf(char* buf, int* idx);
void asn1_time_to_tm(ASN1_TIME* time);
+ /**
+ * @brief Sets initial certificate datetime
+ */
+ void InitCertExpTime();
+
const utils::SharedPtr<const CryptoManagerSettings> settings_;
SSL_CTX* context_;
mutable struct tm expiration_time_;
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 d4231ffaa0..469b97d1e1 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
@@ -141,6 +141,12 @@ class SecurityManagerImpl : public SecurityManager,
void StartHandshake(uint32_t connection_key) OVERRIDE;
/**
+ * @brief Checks whether certificate should be updated
+ * @return true if certificate should be updated otherwise false
+ */
+ bool IsCertificateUpdateRequired() OVERRIDE;
+
+ /**
* \brief Add/Remove for SecurityManagerListener
*/
void AddListener(SecurityManagerListener* const listener) OVERRIDE;
@@ -158,7 +164,19 @@ class SecurityManagerImpl : public SecurityManager,
* @brief Notifiers for listeners.
* Allows to notify that certificate should be updated
*/
- void NotifyOnCertififcateUpdateRequired();
+ DEPRECATED void NotifyOnCertififcateUpdateRequired();
+
+ /**
+ * @brief Notifiers for listeners.
+ * Allows to notify that certificate should be updated
+ */
+ void NotifyOnCertificateUpdateRequired() OVERRIDE;
+
+ /**
+ * @brief Check is policy certificate data is empty
+ * @return true if policy certificate data is not empty otherwise false
+ */
+ bool IsPolicyCertificateDataEmpty() OVERRIDE;
/**
* @brief SecurityConfigSection
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index f44198953b..6bee28a976 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -93,6 +93,7 @@ CryptoManagerImpl::CryptoManagerImpl(
OpenSSL_add_all_algorithms();
SSL_library_init();
}
+ InitCertExpTime();
}
CryptoManagerImpl::~CryptoManagerImpl() {
@@ -295,41 +296,30 @@ const CryptoManagerSettings& CryptoManagerImpl::get_settings() const {
}
bool CryptoManagerImpl::set_certificate(const std::string& cert_data) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
if (cert_data.empty()) {
LOG4CXX_WARN(logger_, "Empty certificate");
return false;
}
- BIO* bio = BIO_new(BIO_f_base64());
- BIO* bmem = BIO_new_mem_buf((char*)cert_data.c_str(), cert_data.length());
- bmem = BIO_push(bio, bmem);
-
- char* buf = new char[cert_data.length()];
- int len = BIO_read(bmem, buf, cert_data.length());
-
- BIO* bio_cert = BIO_new(BIO_s_mem());
- if (NULL == bio_cert) {
- LOG4CXX_WARN(logger_, "Unable to update certificate. BIO not created");
- return false;
- }
+ BIO* bio_cert =
+ BIO_new_mem_buf(const_cast<char*>(cert_data.c_str()), cert_data.length());
utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert);
UNUSED(bio_guard)
- int k = 0;
- if ((k = BIO_write(bio_cert, buf, len)) <= 0) {
- LOG4CXX_WARN(logger_, "Unable to write into BIO");
- return false;
- }
- PKCS12* p12 = d2i_PKCS12_bio(bio_cert, NULL);
- if (NULL == p12) {
- LOG4CXX_ERROR(logger_, "Unable to parse certificate");
- return false;
- }
+ X509* cert = NULL;
+ PEM_read_bio_X509(bio_cert, &cert, 0, 0);
EVP_PKEY* pkey = NULL;
- X509* cert = NULL;
- PKCS12_parse(p12, NULL, &pkey, &cert, NULL);
+ if (1 == BIO_reset(bio_cert)) {
+ PEM_read_bio_PrivateKey(bio_cert, &pkey, 0, 0);
+ } else {
+ LOG4CXX_WARN(logger_,
+ "Unabled to reset BIO in order to read private key, "
+ << LastError());
+ }
if (NULL == cert || NULL == pkey) {
LOG4CXX_WARN(logger_, "Either certificate or key not valid.");
@@ -337,20 +327,35 @@ bool CryptoManagerImpl::set_certificate(const std::string& cert_data) {
}
if (!SSL_CTX_use_certificate(context_, cert)) {
- LOG4CXX_WARN(logger_, "Could not use certificate");
+ LOG4CXX_WARN(logger_, "Could not use certificate: " << LastError());
return false;
}
asn1_time_to_tm(X509_get_notAfter(cert));
if (!SSL_CTX_use_PrivateKey(context_, pkey)) {
- LOG4CXX_ERROR(logger_, "Could not use key");
+ LOG4CXX_ERROR(logger_, "Could not use key: " << LastError());
return false;
}
+
if (!SSL_CTX_check_private_key(context_)) {
- LOG4CXX_ERROR(logger_, "Could not use certificate ");
+ LOG4CXX_ERROR(logger_, "Could not use certificate: " << LastError());
return false;
}
+
+ X509_STORE* store = SSL_CTX_get_cert_store(context_);
+ if (store) {
+ X509* extra_cert = NULL;
+ while ((extra_cert = PEM_read_bio_X509(bio_cert, NULL, 0, 0))) {
+ if (extra_cert != cert) {
+ LOG4CXX_DEBUG(logger_,
+ "Added new certificate to store: " << extra_cert);
+ X509_STORE_add_cert(store, extra_cert);
+ }
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "Certificate and key successfully updated");
return true;
}
@@ -397,4 +402,8 @@ void CryptoManagerImpl::asn1_time_to_tm(ASN1_TIME* time) {
}
}
+void CryptoManagerImpl::InitCertExpTime() {
+ strptime("1 Jan 1970 00:00:00", "%d %b %Y %H:%M:%S", &expiration_time_);
+}
+
} // namespace security_manager
diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc
index 556cc291d1..1853b218b4 100644
--- a/src/components/security_manager/src/security_manager_impl.cc
+++ b/src/components/security_manager/src/security_manager_impl.cc
@@ -188,10 +188,6 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
return;
}
- if (crypto_manager_->IsCertificateUpdateRequired()) {
- NotifyOnCertififcateUpdateRequired();
- }
-
if (ssl_context->IsInitCompleted()) {
NotifyListenersOnHandshakeDone(connection_key,
SSLContext::Handshake_Result_Success);
@@ -219,14 +215,22 @@ void SecurityManagerImpl::StartHandshake(uint32_t connection_key) {
SendHandshakeBinData(connection_key, data, data_size);
}
}
+
+bool SecurityManagerImpl::IsCertificateUpdateRequired() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return crypto_manager_->IsCertificateUpdateRequired();
+}
+
void SecurityManagerImpl::AddListener(SecurityManagerListener* const listener) {
if (!listener) {
LOG4CXX_ERROR(logger_,
"Invalid (NULL) pointer to SecurityManagerListener.");
return;
}
+ LOG4CXX_DEBUG(logger_, "Adding listener " << listener);
listeners_.push_back(listener);
}
+
void SecurityManagerImpl::RemoveListener(
SecurityManagerListener* const listener) {
if (!listener) {
@@ -236,13 +240,15 @@ void SecurityManagerImpl::RemoveListener(
}
listeners_.remove(listener);
}
+
void SecurityManagerImpl::NotifyListenersOnHandshakeDone(
const uint32_t& connection_key, SSLContext::HandshakeResult error) {
LOG4CXX_AUTO_TRACE(logger_);
std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
while (it != listeners_.end()) {
if ((*it)->OnHandshakeDone(connection_key, error)) {
- // On get notification remove listener
+ LOG4CXX_DEBUG(logger_, "Destroying listener: " << *it);
+ delete (*it);
it = listeners_.erase(it);
} else {
++it;
@@ -251,6 +257,10 @@ void SecurityManagerImpl::NotifyListenersOnHandshakeDone(
}
void SecurityManagerImpl::NotifyOnCertififcateUpdateRequired() {
+ NotifyOnCertificateUpdateRequired();
+}
+
+void SecurityManagerImpl::NotifyOnCertificateUpdateRequired() {
LOG4CXX_AUTO_TRACE(logger_);
std::list<SecurityManagerListener*>::iterator it = listeners_.begin();
while (it != listeners_.end()) {
@@ -259,6 +269,19 @@ void SecurityManagerImpl::NotifyOnCertififcateUpdateRequired() {
}
}
+bool SecurityManagerImpl::IsPolicyCertificateDataEmpty() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ std::string certificate_data;
+ for (auto it = listeners_.begin(); it != listeners_.end(); ++it) {
+ if ((*it)->GetPolicyCertificateData(certificate_data)) {
+ LOG4CXX_DEBUG(logger_, "Certificate data received from listener");
+ return certificate_data.empty();
+ }
+ }
+ return false;
+}
+
bool SecurityManagerImpl::ProccessHandshakeData(
const SecurityMessage& inMessage) {
LOG4CXX_INFO(logger_, "SendHandshakeData processing");
diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc
index 6f53234867..5be5ff8363 100644
--- a/src/components/security_manager/src/ssl_context_impl.cc
+++ b/src/components/security_manager/src/ssl_context_impl.cc
@@ -32,12 +32,14 @@
#include "security_manager/crypto_manager_impl.h"
#include <assert.h>
-#include <openssl/bio.h>
-#include <openssl/ssl.h>
-#include <openssl/err.h>
#include <memory.h>
#include <map>
#include <algorithm>
+#include <vector>
+
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
#include "utils/macro.h"
@@ -55,7 +57,8 @@ CryptoManagerImpl::SSLContextImpl::SSLContextImpl(SSL* conn,
, buffer_size_(maximum_payload_size)
, buffer_(new uint8_t[buffer_size_])
, is_handshake_pending_(false)
- , mode_(mode) {
+ , mode_(mode)
+ , max_block_size_(0) {
SSL_set_bio(connection_, bioIn_, bioOut_);
}
@@ -136,32 +139,69 @@ std::map<std::string, CryptoManagerImpl::SSLContextImpl::BlockSizeGetter>
CryptoManagerImpl::SSLContextImpl::max_block_sizes =
CryptoManagerImpl::SSLContextImpl::create_max_block_sizes();
+const std::string CryptoManagerImpl::SSLContextImpl::RemoveDisallowedInfo(
+ X509_NAME* in_data) const {
+ if (!in_data) {
+ return std::string();
+ }
+
+ char* tmp_char_str = X509_NAME_oneline(in_data, NULL, 0);
+ std::string out_str(tmp_char_str);
+ OPENSSL_free(tmp_char_str);
+
+ typedef std::vector<std::string> StringVector;
+ StringVector disallowed_params;
+ disallowed_params.push_back("CN");
+ disallowed_params.push_back("serialNumber");
+
+ const char str_delimiter = '/', param_delimiter = '=';
+ for (StringVector::const_iterator it = disallowed_params.begin();
+ it != disallowed_params.end();
+ ++it) {
+ const std::string search_str = str_delimiter + (*it) + param_delimiter;
+ const size_t occurence_start = out_str.find(search_str);
+ if (std::string::npos == occurence_start) {
+ continue;
+ }
+
+ const size_t occurence_end =
+ out_str.find(str_delimiter, occurence_start + 1);
+ out_str.erase(occurence_start, occurence_end - occurence_start);
+ }
+
+ return out_str;
+}
+
void CryptoManagerImpl::SSLContextImpl::PrintCertData(
X509* cert, const std::string& cert_owner) {
- if (cert) {
- X509_NAME* subj_name = X509_get_subject_name(cert);
- char* subj = X509_NAME_oneline(subj_name, NULL, 0);
- if (subj) {
- std::replace(subj, subj + strlen(subj), '/', ' ');
- LOG4CXX_DEBUG(logger_, cert_owner << " subject:" << subj);
- OPENSSL_free(subj);
- }
- char* issuer = X509_NAME_oneline(X509_get_issuer_name(cert), NULL, 0);
- if (issuer) {
- std::replace(issuer, issuer + strlen(issuer), '/', ' ');
- LOG4CXX_DEBUG(logger_, cert_owner << " issuer:" << issuer);
- OPENSSL_free(issuer);
- }
+ if (!cert) {
+ LOG4CXX_DEBUG(logger_, "Empty certificate data");
+ return;
+ }
- ASN1_TIME* notBefore = X509_get_notBefore(cert);
- ASN1_TIME* notAfter = X509_get_notAfter(cert);
+ std::string subj = RemoveDisallowedInfo(X509_get_subject_name(cert));
+ if (!subj.empty()) {
+ std::replace(subj.begin(), subj.end(), '/', ' ');
+ LOG4CXX_DEBUG(logger_, cert_owner << " subject:" << subj);
+ }
- if (notBefore) {
- LOG4CXX_DEBUG(logger_, " Start date: " << (char*)notBefore->data);
- }
- if (notAfter) {
- LOG4CXX_DEBUG(logger_, " End date: " << (char*)notAfter->data);
- }
+ std::string issuer = RemoveDisallowedInfo(X509_get_issuer_name(cert));
+ if (!issuer.empty()) {
+ std::replace(issuer.begin(), issuer.end(), '/', ' ');
+ LOG4CXX_DEBUG(logger_, cert_owner << " issuer:" << issuer);
+ }
+
+ ASN1_TIME* not_before = X509_get_notBefore(cert);
+ if (not_before) {
+ LOG4CXX_DEBUG(
+ logger_,
+ "Start date: " << static_cast<unsigned char*>(not_before->data));
+ }
+
+ ASN1_TIME* not_after = X509_get_notAfter(cert);
+ if (not_after) {
+ LOG4CXX_DEBUG(logger_,
+ "End date: " << static_cast<unsigned char*>(not_after->data));
}
}
diff --git a/src/components/security_manager/test/CMakeLists.txt b/src/components/security_manager/test/CMakeLists.txt
index 6707e5ea5a..ba1fbcca8b 100644
--- a/src/components/security_manager/test/CMakeLists.txt
+++ b/src/components/security_manager/test/CMakeLists.txt
@@ -28,8 +28,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if (BUILD_TESTS)
-
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
include_directories(
${GMOCK_INCLUDE_DIRECTORY}
${COMPONENTS_DIR}/protocol_handler/test/include
@@ -39,20 +39,15 @@ include_directories(
${JSONCPP_INCLUDE_DIRECTORY}
)
-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
- ${COMPONENTS_DIR}/security_manager/test/ssl_context_test.cc
- ${COMPONENTS_DIR}/security_manager/test/ssl_certificate_handshake_test.cc
- )
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
set(LIBRARIES
gmock
${SecurityManagerLibrary}
)
+create_test (security_manager_test "${SOURCES}" "${LIBRARIES}")
+
set(CERT_LIST
${CMAKE_SOURCE_DIR}/mycert.pem
${CMAKE_SOURCE_DIR}/mykey.pem
@@ -64,11 +59,8 @@ add_custom_target(generate_certificates
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
-foreach( file_i ${CERT_LIST})
- file(COPY ${file_i} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-endforeach( file_i )
+foreach(CERT_ENTRY ${CERT_LIST})
+ file(COPY ${CERT_ENTRY} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+endforeach()
-create_test (security_manager_test "${SOURCES}" "${LIBRARIES}")
add_dependencies(security_manager_test generate_certificates)
-
-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
index 27f91866ac..b30684e5f6 100644
--- a/src/components/security_manager/test/crypto_manager_impl_test.cc
+++ b/src/components/security_manager/test/crypto_manager_impl_test.cc
@@ -39,6 +39,7 @@
#include <fstream>
#include <sstream>
+#include "utils/make_shared.h"
#include "gtest/gtest.h"
#include "security_manager/crypto_manager_impl.h"
#include "security_manager/mock_security_manager_settings.h"
@@ -64,10 +65,14 @@ namespace test {
namespace components {
namespace crypto_manager_test {
+using security_manager::CryptoManagerImpl;
+
class CryptoManagerTest : public testing::Test {
protected:
+ typedef NiceMock<security_manager_test::MockCryptoManagerSettings>
+ MockCryptoManagerSettings;
static void SetUpTestCase() {
- std::ifstream certificate_file("server/spt_credential.p12.enc");
+ std::ifstream certificate_file("server/spt_credential.pem");
ASSERT_TRUE(certificate_file.is_open())
<< "Could not open certificate data file";
@@ -81,17 +86,9 @@ class CryptoManagerTest : public testing::Test {
void SetUp() OVERRIDE {
ASSERT_FALSE(certificate_data_base64_.empty());
mock_security_manager_settings_ =
- new NiceMock<security_manager_test::MockCryptoManagerSettings>();
- utils::SharedPtr<security_manager::CryptoManagerSettings> scrypto =
- utils::SharedPtr<security_manager::CryptoManagerSettings>::
- static_pointer_cast<security_manager::CryptoManagerSettings>(
- mock_security_manager_settings_);
- crypto_manager_ = new security_manager::CryptoManagerImpl(scrypto);
- }
-
- void TearDown() OVERRIDE {
- delete mock_security_manager_settings_;
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ utils::MakeShared<MockCryptoManagerSettings>();
+ crypto_manager_ =
+ utils::MakeShared<CryptoManagerImpl>(mock_security_manager_settings_);
}
void InitSecurityManager() {
@@ -118,11 +115,9 @@ class CryptoManagerTest : public testing::Test {
.WillByDefault(Return(false));
}
- security_manager::CryptoManager* crypto_manager_;
+ utils::SharedPtr<CryptoManagerImpl> crypto_manager_;
+ utils::SharedPtr<MockCryptoManagerSettings> mock_security_manager_settings_;
static std::string certificate_data_base64_;
-
- NiceMock<security_manager_test::MockCryptoManagerSettings>*
- mock_security_manager_settings_;
};
std::string CryptoManagerTest::certificate_data_base64_;
diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc
index b5f9ae2e78..b334e78e19 100644
--- a/src/components/security_manager/test/security_manager_test.cc
+++ b/src/components/security_manager/test/security_manager_test.cc
@@ -31,6 +31,7 @@
*/
#include <string>
+#include <memory>
#include "gtest/gtest.h"
#include "utils/byte_order.h"
@@ -44,6 +45,7 @@
#include "security_manager/mock_crypto_manager.h"
#include "security_manager/mock_security_manager_listener.h"
#include "utils/make_shared.h"
+#include "utils/test_async_waiter.h"
namespace test {
namespace components {
@@ -72,6 +74,7 @@ using ::testing::DoAll;
using ::testing::SetArgPointee;
using ::testing::_;
+namespace {
// Sample data for handshake data emulation
const int32_t key = 0x1;
const int32_t seq_number = 0x2;
@@ -87,6 +90,8 @@ 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]);
+const uint32_t kAsyncExpectationsTimeout = 10000u;
+}
class SecurityManagerTest : public ::testing::Test {
protected:
@@ -94,11 +99,9 @@ class SecurityManagerTest : public ::testing::Test {
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
- testing::Mock::AsyncVerifyAndClearExpectations(1000);
+ mock_sm_listener.reset(new testing::StrictMock<
+ security_manager_test::MockSecurityManagerListener>());
+ security_manager_->AddListener(mock_sm_listener.get());
}
void SetMockCryptoManager() {
@@ -161,8 +164,8 @@ class SecurityManagerTest : public ::testing::Test {
mock_ssl_context_new;
testing::StrictMock<security_manager_test::MockSSLContext>
mock_ssl_context_exists;
- testing::StrictMock<security_manager_test::MockSecurityManagerListener>
- mock_sm_listener;
+ std::unique_ptr<testing::StrictMock<
+ security_manager_test::MockSecurityManagerListener> > mock_sm_listener;
};
// Test Bodies
@@ -190,15 +193,15 @@ TEST_F(SecurityManagerTest, Listeners_NULL) {
* Twice remove listener
*/
TEST_F(SecurityManagerTest, Listeners_TwiceRemoveListeners) {
- security_manager_->RemoveListener(&mock_sm_listener);
- security_manager_->RemoveListener(&mock_sm_listener);
+ security_manager_->RemoveListener(mock_sm_listener.get());
+ security_manager_->RemoveListener(mock_sm_listener.get());
}
/*
* Add and remove listeners
*/
TEST_F(SecurityManagerTest, Listeners_NoListeners) {
// Check correct removing listener
- security_manager_->RemoveListener(&mock_sm_listener);
+ security_manager_->RemoveListener(mock_sm_listener.get());
// Expect no calls
testing::StrictMock<MockSecurityManagerListener> mock_listener2;
@@ -215,49 +218,51 @@ TEST_F(SecurityManagerTest, Listeners_NoListeners) {
*/
TEST_F(SecurityManagerTest, Listeners_Notifying) {
// Check correct removing listener
- security_manager_->RemoveListener(&mock_sm_listener);
+ security_manager_->RemoveListener(mock_sm_listener.get());
- testing::StrictMock<MockSecurityManagerListener> mock_listener1;
- testing::StrictMock<MockSecurityManagerListener> mock_listener2;
+ testing::StrictMock<MockSecurityManagerListener>* mock_listener1 =
+ new testing::StrictMock<MockSecurityManagerListener>();
+ testing::StrictMock<MockSecurityManagerListener>* mock_listener2 =
+ new testing::StrictMock<MockSecurityManagerListener>();
const SSLContext::HandshakeResult first_call_value =
SSLContext::Handshake_Result_Success;
// Expect call both listeners on 1st call
- EXPECT_CALL(mock_listener1, OnHandshakeDone(key, first_call_value))
+ EXPECT_CALL(*mock_listener1, OnHandshakeDone(key, first_call_value))
.
// Emulate false (reject) result
WillOnce(Return(false));
- EXPECT_CALL(mock_listener2, OnHandshakeDone(key, first_call_value))
+ EXPECT_CALL(*mock_listener2, OnHandshakeDone(key, first_call_value))
.
// Emulate true (accept) result
WillOnce(Return(true));
// First listener was not removed from listener list
// So this callback wil lbe either call.
- EXPECT_CALL(mock_listener1, OnCertificateUpdateRequired());
+ EXPECT_CALL(*mock_listener1, OnCertificateUpdateRequired());
const SSLContext::HandshakeResult second_call_value =
SSLContext::Handshake_Result_Fail;
// Expect call last listener on 2d call
- EXPECT_CALL(mock_listener1, OnHandshakeDone(key, second_call_value))
+ EXPECT_CALL(*mock_listener1, OnHandshakeDone(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);
+ security_manager_->AddListener(mock_listener1);
+ security_manager_->AddListener(mock_listener2);
// 1st call
security_manager_->NotifyListenersOnHandshakeDone(key, first_call_value);
- security_manager_->NotifyOnCertififcateUpdateRequired();
+ security_manager_->NotifyOnCertificateUpdateRequired();
// 2nd call
security_manager_->NotifyListenersOnHandshakeDone(key, second_call_value);
- security_manager_->NotifyOnCertififcateUpdateRequired();
+ security_manager_->NotifyOnCertificateUpdateRequired();
// 3nd call
security_manager_->NotifyListenersOnHandshakeDone(
key, SSLContext::Handshake_Result_Fail);
- security_manager_->NotifyOnCertififcateUpdateRequired();
+ security_manager_->NotifyOnCertificateUpdateRequired();
}
/*
@@ -268,7 +273,8 @@ 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;
+
+ TestAsyncWaiter waiter;
EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
@@ -277,12 +283,14 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) {
EXPECT_CALL(mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_NOT_SUPPORTED),
- is_final));
+ is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
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);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
/*
* Shall skip all OnMobileMessageSent
@@ -354,21 +362,30 @@ TEST_F(SecurityManagerTest, GetInvalidQueryId) {
SetMockCryptoManager();
uint32_t connection_id = 0;
uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
- EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
- .WillOnce(Return(true));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
+
// Expect InternalError with ERROR_ID
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_ID),
- is_final));
+ is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
const SecurityQuery::QueryHeader header(SecurityQuery::REQUEST,
SecurityQuery::INVALID_QUERY_ID);
const uint8_t data = 0;
EmulateMobileMessage(header, &data, 1);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
}
/*
* Shall send Internall Error on call
@@ -483,7 +500,7 @@ TEST_F(SecurityManagerTest, StartHandshake_ServiceStillUnprotected) {
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
+ EXPECT_CALL(*mock_sm_listener,
OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
.WillOnce(Return(true));
@@ -492,6 +509,9 @@ TEST_F(SecurityManagerTest, StartHandshake_ServiceStillUnprotected) {
.WillOnce(ReturnNull());
security_manager_->StartHandshake(key);
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send InternallError on SSL error and notify listeners
@@ -515,7 +535,7 @@ TEST_F(SecurityManagerTest, StartHandshake_SSLInternalError) {
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INTERNAL), is_final));
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
+ EXPECT_CALL(*mock_sm_listener,
OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
.WillOnce(Return(true));
@@ -531,6 +551,9 @@ TEST_F(SecurityManagerTest, StartHandshake_SSLInternalError) {
Return(SSLContext::Handshake_Result_Fail)));
security_manager_->StartHandshake(key);
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send data on call StartHandshake
@@ -586,7 +609,7 @@ TEST_F(SecurityManagerTest, StartHandshake_SSLInitIsComplete) {
SetMockCryptoManager();
// Expect no message send
// Expect notifying listeners (success)
- EXPECT_CALL(mock_sm_listener,
+ EXPECT_CALL(*mock_sm_listener,
OnHandshakeDone(key, SSLContext::Handshake_Result_Success))
.WillOnce(Return(true));
@@ -595,10 +618,11 @@ TEST_F(SecurityManagerTest, StartHandshake_SSLInitIsComplete) {
.WillOnce(Return(&mock_ssl_context_exists));
EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
.WillOnce(Return(true));
- EXPECT_CALL(mock_crypto_manager, IsCertificateUpdateRequired())
- .WillOnce(Return(false));
security_manager_->StartHandshake(key);
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send InternallError on
@@ -608,7 +632,8 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
SetMockCryptoManager();
uint32_t connection_id = 0;
uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
+
+ TestAsyncWaiter waiter;
EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _));
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
@@ -619,41 +644,58 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_WrongDataSize) {
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_INVALID_QUERY_SIZE),
- is_final));
+ is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+
EmulateMobileMessageHandshake(NULL, 0);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
/*
* Shall send InternallError on
* getting SEND_HANDSHAKE_DATA from mobile side
* for service which is not protected
*/
-TEST_F(SecurityManagerTest, ProccessHandshakeData_ServiceNotProtected) {
+TEST_F(SecurityManagerTest,
+ DISABLED_ProccessHandshakeData_ServiceNotProtected) {
SetMockCryptoManager();
// 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, _, _));
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
+ EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
- .WillOnce(Return(true));
-
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_SERVICE_NOT_PROTECTED),
- is_final));
+ is_final)).WillOnce(NotifyTestAsyncWaiter(&waiter));
+ times++;
+
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
+ EXPECT_CALL(*mock_sm_listener,
OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
- .WillOnce(Return(true));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// Emulate SessionObserver result
EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
- .WillOnce(ReturnNull());
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), ReturnNull()));
+ times++;
const uint8_t data[] = {0x1, 0x2};
EmulateMobileMessageHandshake(data, sizeof(data) / sizeof(data[0]));
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send InternallError on getting
@@ -668,29 +710,39 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
- .Times(handshake_emulates);
+ .Times(handshake_emulates)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
+ times += handshake_emulates;
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.Times(handshake_emulates)
- .WillRepeatedly(Return(true));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times += handshake_emulates;
// Expect InternalError with ERROR_ID
EXPECT_CALL(
mock_protocol_handler,
SendMessageToMobileApp(
InternalErrorWithErrId(SecurityManager::ERROR_SSL_INVALID_DATA),
- is_final)).Times(handshake_emulates);
+ is_final))
+ .Times(handshake_emulates)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
+ times += handshake_emulates;
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
+ EXPECT_CALL(*mock_sm_listener,
OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
- .WillOnce(Return(true));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// 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,
@@ -700,16 +752,21 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
_))
.WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_AbnormalFail)))
.WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_AbnormalFail)))
.WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_AbnormalFail)))
.WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_AbnormalFail)));
+ times += 4; // matches to each single call above
// On each wrong handshake will be asked error
EXPECT_CALL(mock_ssl_context_exists, LastError()).Times(handshake_emulates);
@@ -717,6 +774,11 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_InvalidData) {
// Emulate handshare #handshake_emulates times for 5 cases
EmulateMobileMessageHandshake(
handshake_data, handshake_data_size, handshake_emulates);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall send HandshakeData on getting SEND_HANDSHAKE_DATA from mobile side
@@ -729,31 +791,44 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
uint32_t connection_id = 0;
uint8_t session_id = 0;
- // uint8_t protocol_version = 0;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
EXPECT_CALL(mock_session_observer, PairFromKey(key, _, _))
- .Times(handshake_emulates);
+ .Times(handshake_emulates)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
+ times += handshake_emulates;
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.Times(handshake_emulates)
- .WillRepeatedly(Return(true));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times += handshake_emulates;
// Get size of raw message after
const size_t raw_message_size = 15;
- EXPECT_CALL(mock_protocol_handler,
- SendMessageToMobileApp(RawMessageEqSize(raw_message_size),
- is_final)).Times(handshake_emulates);
+ EXPECT_CALL(
+ mock_protocol_handler,
+ SendMessageToMobileApp(RawMessageEqSize(raw_message_size), is_final))
+ .Times(handshake_emulates)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
+ times += handshake_emulates;
+
// Expect notifying listeners (unsuccess)
- EXPECT_CALL(mock_sm_listener,
+ EXPECT_CALL(*mock_sm_listener,
OnHandshakeDone(key, SSLContext::Handshake_Result_Fail))
- .WillOnce(Return(true));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// Emulate SessionObserver and CryptoManager result
EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
.Times(handshake_emulates)
- .WillRepeatedly(Return(false));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(false)));
+ times += handshake_emulates;
EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
.Times(handshake_emulates)
- .WillRepeatedly(Return(&mock_ssl_context_exists));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter),
+ Return(&mock_ssl_context_exists)));
+ times += handshake_emulates;
// Emulate DoHandshakeStep correct logics
EXPECT_CALL(
@@ -764,13 +839,21 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_Answer) {
_))
.WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Success)))
.WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Fail)));
+ times += 2; // matches to each single call above
EmulateMobileMessageHandshake(
handshake_data, handshake_data_size, handshake_emulates);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall call all listeners on success end handshake
@@ -781,19 +864,26 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
SetMockCryptoManager();
// Count handshake calls
const int handshake_emulates = 6;
+
+ TestAsyncWaiter waiter;
+ uint32_t times = 0;
// Expect no errors
// Expect notifying listeners (success)
- EXPECT_CALL(mock_sm_listener,
+ EXPECT_CALL(*mock_sm_listener,
OnHandshakeDone(key, SSLContext::Handshake_Result_Success))
- .WillOnce(Return(true));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times++;
// Emulate SessionObserver and CryptoManager result
EXPECT_CALL(mock_session_observer, GetSSLContext(key, kControl))
.Times(handshake_emulates)
- .WillRepeatedly(Return(&mock_ssl_context_exists));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter),
+ Return(&mock_ssl_context_exists)));
+ times += handshake_emulates;
EXPECT_CALL(mock_ssl_context_exists, IsInitCompleted())
.Times(handshake_emulates)
- .WillRepeatedly(Return(true));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times += handshake_emulates;
EXPECT_CALL(
mock_ssl_context_exists,
@@ -805,26 +895,33 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
// two states with correct out data
WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Success)))
.WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Fail)))
.
// two states with with null pointer data
WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Success)))
.WillOnce(DoAll(SetArgPointee<2>((uint8_t*)NULL),
SetArgPointee<3>(handshake_data_out_size),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Fail)))
.
// two states with with null data size
WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Success)))
.WillOnce(DoAll(SetArgPointee<2>(handshake_data_out_pointer),
SetArgPointee<3>(0),
+ NotifyTestAsyncWaiter(&waiter),
Return(SSLContext::Handshake_Result_Success)));
+ times += 6; // matches to each single call above
// Expect send two message (with correct pointer and size data)
@@ -835,14 +932,22 @@ TEST_F(SecurityManagerTest, ProccessHandshakeData_HandshakeFinished) {
EXPECT_CALL(mock_session_observer,
ProtocolVersionUsed(connection_id, session_id, _))
.Times(2)
- .WillRepeatedly(Return(true));
+ .WillRepeatedly(DoAll(NotifyTestAsyncWaiter(&waiter), Return(true)));
+ times += 2; // matches to the number above
EXPECT_CALL(mock_protocol_handler, SendMessageToMobileApp(_, is_final))
- .Times(2);
+ .Times(2)
+ .WillRepeatedly(NotifyTestAsyncWaiter(&waiter));
+ times += 2; // matches to the number above
// Expect NO InternalError with ERROR_ID
EmulateMobileMessageHandshake(
handshake_data, handshake_data_size, handshake_emulates);
+
+ EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout));
+
+ // Listener was destroyed after OnHandshakeDone call
+ mock_sm_listener.release();
}
/*
* Shall not any query on getting empty SEND_INTERNAL_ERROR
diff --git a/src/components/security_manager/test/ssl_certificate_handshake_test.cc b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
index 3d62dd5d6a..dc335c8da2 100644
--- a/src/components/security_manager/test/ssl_certificate_handshake_test.cc
+++ b/src/components/security_manager/test/ssl_certificate_handshake_test.cc
@@ -56,12 +56,12 @@ namespace custom_str = utils::custom_string;
namespace {
const std::string server_ca_cert_filename = "server";
const std::string client_ca_cert_filename = "client";
-const std::string client_certificate = "client/client_credential.p12.enc";
-const std::string server_certificate = "server/spt_credential.p12.enc";
+const std::string client_certificate = "client/client_credential.pem";
+const std::string server_certificate = "server/spt_credential.pem";
const std::string server_unsigned_cert_file =
- "server/spt_credential_unsigned.p12.enc";
+ "server/spt_credential_unsigned.pem";
const std::string server_expired_cert_file =
- "server/spt_credential_expired.p12.enc";
+ "server/spt_credential_expired.pem";
const bool verify_peer = true;
const bool skip_peer_verification = false;
@@ -372,11 +372,8 @@ TEST_F(SSLHandshakeTest, CAVerification_ServerSide) {
}
TEST_F(SSLHandshakeTest, CAVerification_ServerSide_NoCACertificate) {
- ASSERT_TRUE(InitServerManagers(security_manager::TLSv1_2,
- server_certificate,
- "ALL",
- verify_peer,
- "unex"))
+ ASSERT_TRUE(InitServerManagers(
+ security_manager::TLSv1_2, "", "ALL", verify_peer, "unex"))
<< server_manager->LastError();
ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
client_certificate,
@@ -423,7 +420,7 @@ TEST_F(SSLHandshakeTest, CAVerification_ClientSide_NoCACertificate) {
""))
<< server_manager->LastError();
ASSERT_TRUE(InitClientManagers(security_manager::TLSv1_2,
- client_certificate,
+ "",
"ALL",
verify_peer,
"client_ca_cert_filename"))
diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc
index b35da3fc61..945059e58c 100644
--- a/src/components/security_manager/test/ssl_context_test.cc
+++ b/src/components/security_manager/test/ssl_context_test.cc
@@ -88,20 +88,28 @@ struct ProtocolAndCipher {
class SSLTest : public testing::Test {
protected:
static void SetUpTestCase() {
- std::ifstream certificate_file("server/spt_credential_unsigned.p12");
+ SetCertificate("server/spt_credential_unsigned.pem",
+ server_certificate_data_base64_);
+ SetCertificate("client/client_credential_unsigned.pem",
+ client_certificate_data_base64_);
+ }
+
+ static void SetCertificate(const std::string& file_name,
+ std::string& out_certificate_data) {
+ std::ifstream certificate_file(file_name.c_str());
+ ASSERT_TRUE(certificate_file.is_open()) << "Could not open " << file_name
+ << "certificate data file";
std::stringstream certificate;
- if (certificate_file.is_open()) {
- certificate << certificate_file.rdbuf();
- }
+ certificate << certificate_file.rdbuf();
certificate_file.close();
- certificate_data_base64_ = certificate.str();
- ASSERT_FALSE(certificate_data_base64_.empty())
- << "Certificate data file is empty";
+ out_certificate_data = certificate.str();
+ ASSERT_FALSE(out_certificate_data.empty()) << file_name
+ << " data file is empty";
}
virtual void SetUp() OVERRIDE {
mock_crypto_manager_settings_ = utils::MakeShared<
- NiceMock<security_manager_test::MockCryptoManagerSettings>>();
+ NiceMock<security_manager_test::MockCryptoManagerSettings> >();
utils::SharedPtr<security_manager::CryptoManagerSettings> crypto_set(
mock_crypto_manager_settings_);
crypto_manager_ = new security_manager::CryptoManagerImpl(crypto_set);
@@ -112,7 +120,7 @@ class SSLTest : public testing::Test {
security_manager_protocol_name())
.WillOnce(Return(security_manager::TLSv1_2));
EXPECT_CALL(*mock_crypto_manager_settings_, certificate_data())
- .WillOnce(ReturnRef(certificate_data_base64_));
+ .WillOnce(ReturnRef(server_certificate_data_base64_));
EXPECT_CALL(*mock_crypto_manager_settings_, ciphers_list())
.WillRepeatedly(ReturnRef(kAllCiphers));
EXPECT_CALL(*mock_crypto_manager_settings_, ca_cert_path())
@@ -123,7 +131,7 @@ class SSLTest : public testing::Test {
EXPECT_TRUE(crypto_manager_initialization);
mock_client_manager_settings_ = utils::MakeShared<
- NiceMock<security_manager_test::MockCryptoManagerSettings>>();
+ NiceMock<security_manager_test::MockCryptoManagerSettings> >();
utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
client_manager_ = new security_manager::CryptoManagerImpl(client_crypto);
@@ -134,7 +142,7 @@ class SSLTest : public testing::Test {
security_manager_protocol_name())
.WillOnce(Return(security_manager::TLSv1_2));
EXPECT_CALL(*mock_client_manager_settings_, certificate_data())
- .WillOnce(ReturnRef(certificate_data_base64_));
+ .WillOnce(ReturnRef(client_certificate_data_base64_));
EXPECT_CALL(*mock_client_manager_settings_, ciphers_list())
.WillRepeatedly(ReturnRef(kAllCiphers));
EXPECT_CALL(*mock_client_manager_settings_, ca_cert_path())
@@ -182,16 +190,18 @@ class SSLTest : public testing::Test {
const size_t kMaximumPayloadSize = 1000u;
security_manager::CryptoManager* crypto_manager_;
security_manager::CryptoManager* client_manager_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings>>
+ utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings>>
+ utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
security_manager::SSLContext* server_ctx;
security_manager::SSLContext* client_ctx;
- static std::string certificate_data_base64_;
+ static std::string client_certificate_data_base64_;
+ static std::string server_certificate_data_base64_;
};
-std::string SSLTest::certificate_data_base64_;
+std::string SSLTest::client_certificate_data_base64_;
+std::string SSLTest::server_certificate_data_base64_;
// StartHandshake() fails when client and server protocols are not TLSv1_2
class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
@@ -209,7 +219,7 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
certificate_data_base64_ = certificate;
mock_crypto_manager_settings_ = utils::MakeShared<
- NiceMock<security_manager_test::MockCryptoManagerSettings>>();
+ NiceMock<security_manager_test::MockCryptoManagerSettings> >();
utils::SharedPtr<security_manager::CryptoManagerSettings> server_crypto(
mock_crypto_manager_settings_);
crypto_manager = new security_manager::CryptoManagerImpl(server_crypto);
@@ -221,7 +231,7 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
EXPECT_TRUE(crypto_manager_initialization);
mock_client_manager_settings_ = utils::MakeShared<
- NiceMock<security_manager_test::MockCryptoManagerSettings>>();
+ NiceMock<security_manager_test::MockCryptoManagerSettings> >();
utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto(
mock_client_manager_settings_);
@@ -289,9 +299,9 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> {
.WillByDefault(Return(false));
}
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings>>
+ utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_crypto_manager_settings_;
- utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings>>
+ utils::SharedPtr<NiceMock<security_manager_test::MockCryptoManagerSettings> >
mock_client_manager_settings_;
security_manager::CryptoManager* crypto_manager;
security_manager::CryptoManager* client_manager;
@@ -378,20 +388,21 @@ TEST_F(SSLTest, OnTSL2Protocol_BrokenHandshake) {
// TODO {AKozoriz} : Unexpected uncomplited init of SSL component.
// In this and next tests.
// Must be fixed after merge to develop.
-TEST_F(SSLTest, DISABLED_OnTSL2Protocol_Positive) {
+TEST_F(SSLTest, OnTSL2Protocol_Positive) {
ASSERT_EQ(client_ctx->StartHandshake(&kClientBuf, &client_buf_len),
security_manager::SSLContext::Handshake_Result_Success);
- ASSERT_FALSE(NULL == kClientBuf);
- ASSERT_LT(0u, client_buf_len);
- EXPECT_TRUE(server_ctx->IsInitCompleted());
+ EXPECT_FALSE(server_ctx->IsInitCompleted());
while (true) {
+ ASSERT_TRUE(NULL != kClientBuf);
+ ASSERT_LT(0u, client_buf_len);
+
const security_manager::SSLContext::HandshakeResult server_result =
server_ctx->DoHandshakeStep(
kClientBuf, client_buf_len, &kServerBuf, &server_buf_len);
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
server_result);
- ASSERT_FALSE(NULL == kServerBuf);
+ ASSERT_TRUE(NULL != kServerBuf);
ASSERT_LT(0u, server_buf_len);
const security_manager::SSLContext::HandshakeResult client_result =
@@ -433,7 +444,7 @@ TEST_F(SSLTest, DISABLED_OnTSL2Protocol_Positive) {
ASSERT_EQ(strncmp(reinterpret_cast<const char*>(text), "abra", 4), 0);
}
-TEST_F(SSLTest, DISABLED_OnTSL2Protocol_EcncryptionFail) {
+TEST_F(SSLTest, OnTSL2Protocol_EcncryptionFail) {
ASSERT_EQ(security_manager::SSLContext::Handshake_Result_Success,
client_ctx->StartHandshake(&kClientBuf, &client_buf_len));
diff --git a/src/components/smart_objects/CMakeLists.txt b/src/components/smart_objects/CMakeLists.txt
index c1d599db67..84da05ce03 100644
--- a/src/components/smart_objects/CMakeLists.txt
+++ b/src/components/smart_objects/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,30 +28,22 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-set(SMART_OBJECTS_SRC_DIR ${COMPONENTS_DIR}/smart_objects/src)
-
-include_directories (
- include
- ${COMPONENTS_DIR}/utils/include/
+include_directories(
+ ${COMPONENTS_DIR}/include
+ ${COMPONENTS_DIR}/smart_objects/include
+ ${COMPONENTS_DIR}/utils/include
)
-set (SOURCES
- ${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
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
)
+collect_sources(SOURCES "${PATHS}")
add_library("SmartObjects" ${SOURCES})
+target_link_libraries("SmartObjects" Utils)
if(ENABLE_LOG)
target_link_libraries("SmartObjects" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
@@ -60,4 +52,3 @@ endif()
if(BUILD_TESTS)
add_subdirectory(test)
endif()
-
diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
index dfbf4ba43e..cdddcfed55 100644
--- a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h
@@ -49,11 +49,20 @@ class CAlwaysFalseSchemaItem : public ISchemaItem {
**/
static utils::SharedPtr<CAlwaysFalseSchemaItem> create();
/**
+ * @deprecated
* @brief Validate smart object.
* @param Object Object to validate.
* @return Errors::ERROR
**/
Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @return Errors::ERROR
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
private:
CAlwaysFalseSchemaItem();
diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
index 3dd598d7bd..e078ae3240 100644
--- a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h
@@ -49,11 +49,20 @@ class CAlwaysTrueSchemaItem : public ISchemaItem {
**/
static utils::SharedPtr<CAlwaysTrueSchemaItem> create();
/**
+ * @deprecated
* @brief Validate smart object.
* @param Object Object to validate.
* @return NsSmartObjects::Errors::eType
**/
Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
private:
CAlwaysTrueSchemaItem();
diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h
index 0d3a651d56..937979f2fa 100644
--- a/src/components/smart_objects/include/smart_objects/array_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h
@@ -63,6 +63,8 @@ class CArraySchemaItem : public ISchemaItem {
TSchemaItemParameter<size_t>());
/**
+ * @deprecated
+ *
* @brief Validate smart object.
*
* @param Object Object to validate.
@@ -72,6 +74,18 @@ class CArraySchemaItem : public ISchemaItem {
Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
+ * @brief Validate smart object.
+ *
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * message if an error occurs
+ *
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
+
+ /**
* @brief Apply schema.
*
* @param Object Object to apply schema.
diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h
index 857354a4e6..56952dbac1 100644
--- a/src/components/smart_objects/include/smart_objects/default_shema_item.h
+++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h
@@ -50,11 +50,20 @@ class CDefaultSchemaItem : public ISchemaItem {
public:
typedef TSchemaItemParameter<Type> ParameterType;
/**
+ * @deprecated
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @return Errors::ERROR
**/
Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @return Errors::ERROR
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
/**
* @brief Set default value to an object.
@@ -99,8 +108,23 @@ CDefaultSchemaItem<Type>::CDefaultSchemaItem(const ParameterType& DefaultValue)
template <typename Type>
Errors::eType CDefaultSchemaItem<Type>::validate(const SmartObject& Object) {
- return (getSmartType() == Object.getType()) ? Errors::OK
- : Errors::INVALID_VALUE;
+ rpc::ValidationReport report("RPC");
+ return validate(Object, &report);
+}
+
+template <typename Type>
+Errors::eType CDefaultSchemaItem<Type>::validate(
+ const SmartObject& Object, rpc::ValidationReport* report__) {
+ if (getSmartType() != Object.getType()) {
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(getSmartType()) +
+ ", got: " +
+ SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
+ return Errors::INVALID_VALUE;
+ } else {
+ return Errors::OK;
+ }
}
template <typename Type>
diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
index a0d6d94017..524d966188 100644
--- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h
@@ -65,12 +65,21 @@ class TEnumSchemaItem : public CDefaultSchemaItem<EnumType> {
const TSchemaItemParameter<EnumType>& DefaultValue =
TSchemaItemParameter<EnumType>());
/**
+ * @deprecated
* @brief Validate smart object.
* @param Object Object to validate.
* @return NsSmartObjects::Errors::eType
**/
Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
+ /**
* @brief Apply schema.
* This implementation checks if enumeration is represented as string
* and tries to convert it to integer according to element-to-string
@@ -207,11 +216,32 @@ utils::SharedPtr<TEnumSchemaItem<EnumType> > TEnumSchemaItem<EnumType>::create(
template <typename EnumType>
Errors::eType TEnumSchemaItem<EnumType>::validate(const SmartObject& Object) {
+ rpc::ValidationReport report("RPC");
+ return validate(Object, &report);
+}
+
+template <typename EnumType>
+Errors::eType TEnumSchemaItem<EnumType>::validate(
+ const SmartObject& Object, rpc::ValidationReport* report__) {
if (SmartType_Integer != Object.getType()) {
+ std::string validation_info;
+ if (SmartType_String == Object.getType()) {
+ validation_info = "Invalid enum value: " + Object.asString();
+ } else {
+ validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Integer) +
+ " (enum), got: " +
+ SmartObject::typeToString(Object.getType());
+ }
+ report__->set_validation_info(validation_info);
return Errors::INVALID_VALUE;
}
if (mAllowedElements.find(static_cast<EnumType>(Object.asInt())) ==
mAllowedElements.end()) {
+ std::stringstream stream;
+ stream << "Invalid enum value: " << Object.asInt();
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
return Errors::OUT_OF_RANGE;
}
return Errors::OK;
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 01d6c08daa..d549b9891a 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
@@ -65,11 +65,20 @@ class TNumberSchemaItem : public CDefaultSchemaItem<NumberType> {
TSchemaItemParameter<NumberType>());
/**
+ * @deprecated
* @brief Validate smart object.
* @param Object Object to validate.
- * @return NsSmartObjects::Errors::eType
+ * @return Errors::ERROR
**/
Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @return Errors::ERROR
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
private:
/**
@@ -128,7 +137,21 @@ bool TNumberSchemaItem<NumberType>::isValidNumberType(SmartType type) {
template <typename NumberType>
Errors::eType TNumberSchemaItem<NumberType>::validate(
const SmartObject& Object) {
+ rpc::ValidationReport report("RPC");
+ return validate(Object, &report);
+}
+
+template <typename NumberType>
+Errors::eType TNumberSchemaItem<NumberType>::validate(
+ const SmartObject& Object, rpc::ValidationReport* report__) {
if (!isValidNumberType(Object.getType())) {
+ SmartType expectedType = (typeid(double) == typeid(Object.getType()))
+ ? SmartType_Double
+ : SmartType_Integer;
+ std::string validation_info =
+ "Incorrect type, expected: " + SmartObject::typeToString(expectedType) +
+ ", got: " + SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
return Errors::INVALID_VALUE;
}
NumberType value(0);
@@ -148,10 +171,20 @@ Errors::eType TNumberSchemaItem<NumberType>::validate(
NumberType rangeLimit;
if (mMinValue.getValue(rangeLimit) && (value < rangeLimit)) {
+ std::stringstream stream;
+ stream << "Value too small, got: " << value
+ << ", minimum allowed: " << rangeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
return Errors::OUT_OF_RANGE;
}
if (mMaxValue.getValue(rangeLimit) && (value > rangeLimit)) {
+ std::stringstream stream;
+ stream << "Value too large, got: " << value
+ << ", maximum allowed: " << rangeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
return Errors::OUT_OF_RANGE;
}
return Errors::OK;
diff --git a/src/components/smart_objects/include/smart_objects/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h
index 549166e723..8922caba45 100644
--- a/src/components/smart_objects/include/smart_objects/object_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/object_schema_item.h
@@ -84,12 +84,21 @@ class CObjectSchemaItem : public ISchemaItem {
**/
static utils::SharedPtr<CObjectSchemaItem> create(const Members& Members);
/**
+ * @deprecated
* @brief Validate smart object.
* @param Object Object to validate.
* @return NsSmartObjects::Errors::eType
**/
Errors::eType validate(const SmartObject& Object) OVERRIDE;
/**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
+ /**
* @brief Apply schema.
* @param Object Object to apply schema.
* @param RemoveFakeParameters contains true if need to remove fake parameters
diff --git a/src/components/smart_objects/include/smart_objects/schema_item.h b/src/components/smart_objects/include/smart_objects/schema_item.h
index 08610f244e..446c7fa65f 100644
--- a/src/components/smart_objects/include/smart_objects/schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/schema_item.h
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include "utils/shared_ptr.h"
+#include "rpc_base/validation_report.h"
#include "smart_objects/errors.h"
@@ -47,13 +48,27 @@ class SmartObject;
class ISchemaItem {
public:
/**
- * @brief Validate object.
+ * @deprecated
+ *
+ * @brief Validate smart object.
+ *
+ * @param Object Object to validate.
+ *
+ * @return NsSmartObjects::Errors::eType
+ **/
+ DEPRECATED virtual Errors::eType validate(const SmartObject& Object);
+
+ /**
+ * @brief Validate smart object.
*
* @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * message if an error occurs
*
* @return NsSmartObjects::Errors::eType
**/
- virtual Errors::eType validate(const SmartObject& Object);
+ virtual Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__);
/**
* @brief Set default value to an object.
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 688550b040..cc2bc7e22c 100644
--- a/src/components/smart_objects/include/smart_objects/smart_object.h
+++ b/src/components/smart_objects/include/smart_objects/smart_object.h
@@ -40,6 +40,7 @@
#include "smart_objects/smart_schema.h"
#include "utils/custom_string.h"
+#include "rpc_base/validation_report.h"
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
@@ -670,11 +671,20 @@ class SmartObject FINAL {
bool isValid() const;
/**
+ * @deprecated
* @brief Validates object according to attached schema.
*
* @return Result of validation.
*/
- Errors::eType validate();
+ DEPRECATED Errors::eType validate();
+
+ /**
+ * @brief Validates object according to attached schema.
+ *
+ * @param report__ object for reporting errors during validation
+ * @return Result of validation.
+ */
+ Errors::eType validate(rpc::ValidationReport* report__);
/**
* @brief Sets new schema
@@ -727,6 +737,35 @@ class SmartObject FINAL {
return !(*this == Other);
}
+ static std::string typeToString(SmartType type) {
+ switch (type) {
+ case SmartType_Null:
+ return "Null";
+ case SmartType_Boolean:
+ return "Boolean";
+ case SmartType_Integer:
+ return "Integer";
+ case SmartType_Character:
+ return "Character";
+ case SmartType_String:
+ return "String";
+ case SmartType_Double:
+ return "Double";
+ case SmartType_Map:
+ return "Object";
+ case SmartType_Array:
+ return "Array";
+ case SmartType_Binary:
+ return "Binary_Data";
+ case SmartType_UInteger:
+ return "Unsigned_Integer";
+ case SmartType_Invalid:
+ return "Invalid_Type";
+ default:
+ return "Unknown_Type";
+ }
+ }
+
protected:
static std::string OperatorToTransform(const SmartMap::value_type& pair);
/**
@@ -1016,4 +1055,7 @@ static SmartObject invalid_object_value(SmartType_Invalid);
static const SmartBinary invalid_binary_value;
} // namespace NsSmartObjects
} // namespace NsSmartDeviceLink
+
+namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;
+
#endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SMART_OBJECT_H_
diff --git a/src/components/smart_objects/include/smart_objects/smart_schema.h b/src/components/smart_objects/include/smart_objects/smart_schema.h
index 52dfa12004..ada5646043 100644
--- a/src/components/smart_objects/include/smart_objects/smart_schema.h
+++ b/src/components/smart_objects/include/smart_objects/smart_schema.h
@@ -61,13 +61,26 @@ class CSmartSchema FINAL {
explicit CSmartSchema(const ISchemaItemPtr SchemaItem);
/**
+ * @deprecated
+ *
* @brief Validate smart object.
*
- * @param Object SmartObject to validate.
+ * @param Object Object to validate.
*
- * @return Result of validation.
- */
- Errors::eType validate(const SmartObject& Object) const;
+ * @return NsSmartObjects::Errors::eType
+ **/
+ DEPRECATED Errors::eType validate(const SmartObject& Object) const;
+
+ /**
+ * @brief Validate smart object.
+ *
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ *
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) const;
/**
* @brief Set new root schema item.
diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h
index 7fad8491a5..6c98dcc3b3 100644
--- a/src/components/smart_objects/include/smart_objects/string_schema_item.h
+++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h
@@ -62,11 +62,20 @@ class CStringSchemaItem : public CDefaultSchemaItem<std::string> {
const TSchemaItemParameter<std::string>& DefaultValue =
TSchemaItemParameter<std::string>());
/**
+ * @deprecated
* @brief Validate smart object.
* @param Object Object to validate.
* @return NsSmartObjects::Errors::eType
**/
Errors::eType validate(const SmartObject& Object) OVERRIDE;
+ /**
+ * @brief Validate smart object.
+ * @param Object Object to validate.
+ * @param report__ object for reporting errors during validation
+ * @return NsSmartObjects::Errors::eType
+ **/
+ Errors::eType validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) OVERRIDE;
private:
/**
diff --git a/src/components/smart_objects/src/always_false_schema_item.cc b/src/components/smart_objects/src/always_false_schema_item.cc
index 59e50e10c2..1893ed24d1 100644
--- a/src/components/smart_objects/src/always_false_schema_item.cc
+++ b/src/components/smart_objects/src/always_false_schema_item.cc
@@ -42,6 +42,13 @@ utils::SharedPtr<CAlwaysFalseSchemaItem> CAlwaysFalseSchemaItem::create() {
}
Errors::eType CAlwaysFalseSchemaItem::validate(const SmartObject& object) {
+ rpc::ValidationReport report("RPC");
+ return validate(object, &report);
+}
+
+Errors::eType CAlwaysFalseSchemaItem::validate(
+ const SmartObject& object, rpc::ValidationReport* report__) {
+ report__->set_validation_info("Generic error");
return Errors::ERROR;
}
} // namespace NsSmartObjects
diff --git a/src/components/smart_objects/src/always_true_schema_item.cc b/src/components/smart_objects/src/always_true_schema_item.cc
index a474b0e157..1e7115316d 100644
--- a/src/components/smart_objects/src/always_true_schema_item.cc
+++ b/src/components/smart_objects/src/always_true_schema_item.cc
@@ -43,5 +43,10 @@ Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object) {
return Errors::OK;
}
+Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object,
+ rpc::ValidationReport* report__) {
+ return Errors::OK;
+}
+
} // namespace NsSmartObjects
} // namespace NsSmartDeviceLink
diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc
index 105cacb25c..dca0a815e0 100644
--- a/src/components/smart_objects/src/array_schema_item.cc
+++ b/src/components/smart_objects/src/array_schema_item.cc
@@ -42,22 +42,45 @@ utils::SharedPtr<CArraySchemaItem> CArraySchemaItem::create(
}
Errors::eType CArraySchemaItem::validate(const SmartObject& Object) {
+ rpc::ValidationReport report("RPC");
+ return validate(Object, &report);
+}
+
+Errors::eType CArraySchemaItem::validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) {
if (SmartType_Array != Object.getType()) {
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Array) +
+ ", got: " +
+ SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
return Errors::INVALID_VALUE;
}
size_t sizeLimit;
const size_t array_len = Object.length();
if (mMinSize.getValue(sizeLimit) && (array_len < sizeLimit)) {
+ std::stringstream stream;
+ stream << "Got array of size: " << array_len
+ << ", minimum allowed: " << sizeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
return Errors::OUT_OF_RANGE;
}
if (mMaxSize.getValue(sizeLimit) && (array_len > sizeLimit)) {
+ std::stringstream stream;
+ stream << "Got array of size: " << array_len
+ << ", maximum allowed: " << sizeLimit;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
return Errors::OUT_OF_RANGE;
}
for (size_t i = 0u; i < array_len; ++i) {
- const Errors::eType result =
- mElementSchemaItem->validate(Object.getElement(i));
+ std::stringstream strVal;
+ strVal << i;
+ const Errors::eType result = mElementSchemaItem->validate(
+ Object.getElement(i), &report__->ReportSubobject(strVal.str()));
if (Errors::OK != result) {
return result;
}
diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc
index f0c17faaea..2bed3d9a26 100644
--- a/src/components/smart_objects/src/object_schema_item.cc
+++ b/src/components/smart_objects/src/object_schema_item.cc
@@ -57,7 +57,18 @@ utils::SharedPtr<CObjectSchemaItem> CObjectSchemaItem::create(
}
Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
+ rpc::ValidationReport report("RPC");
+ return validate(object, &report);
+}
+
+Errors::eType CObjectSchemaItem::validate(const SmartObject& object,
+ rpc::ValidationReport* report__) {
if (SmartType_Map != object.getType()) {
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_Map) +
+ ", got: " +
+ SmartObject::typeToString(object.getType());
+ report__->set_validation_info(validation_info);
return Errors::INVALID_VALUE;
}
@@ -71,12 +82,15 @@ Errors::eType CObjectSchemaItem::validate(const SmartObject& object) {
std::set<std::string>::const_iterator key_it = object_keys.find(key);
if (object_keys.end() == key_it) {
if (member.mIsMandatory) {
+ std::string validation_info = "Missing mandatory parameter: " + key;
+ report__->set_validation_info(validation_info);
return Errors::MISSING_MANDATORY_PARAMETER;
}
continue;
}
const SmartObject& field = object.getElement(key);
- const Errors::eType result = member.mSchemaItem->validate(field);
+ const Errors::eType result =
+ member.mSchemaItem->validate(field, &report__->ReportSubobject(key));
if (Errors::OK != result) {
return result;
}
diff --git a/src/components/smart_objects/src/schema_item.cc b/src/components/smart_objects/src/schema_item.cc
index 8c0bc0edb3..22735d40d5 100644
--- a/src/components/smart_objects/src/schema_item.cc
+++ b/src/components/smart_objects/src/schema_item.cc
@@ -35,7 +35,12 @@
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
-Errors::eType ISchemaItem::validate(const SmartObject& object) {
+Errors::eType ISchemaItem::validate(const SmartObject& Object) {
+ return Errors::ERROR;
+}
+
+Errors::eType ISchemaItem::validate(const SmartObject& object,
+ rpc::ValidationReport* report__) {
return Errors::ERROR;
}
diff --git a/src/components/smart_objects/src/smart_object.cc b/src/components/smart_objects/src/smart_object.cc
index 5c90de5671..a0925eef05 100644
--- a/src/components/smart_objects/src/smart_object.cc
+++ b/src/components/smart_objects/src/smart_object.cc
@@ -869,11 +869,17 @@ bool SmartObject::erase(const std::string& Key) {
}
bool SmartObject::isValid() const {
- return (Errors::OK == m_schema.validate(*this));
+ rpc::ValidationReport report("RPC");
+ return (Errors::OK == m_schema.validate(*this, &report));
}
Errors::eType SmartObject::validate() {
- return m_schema.validate(*this);
+ rpc::ValidationReport report("RPC");
+ return validate(&report);
+}
+
+Errors::eType SmartObject::validate(rpc::ValidationReport* report__) {
+ return m_schema.validate(*this, report__);
}
void SmartObject::setSchema(const CSmartSchema& schema) {
diff --git a/src/components/smart_objects/src/smart_schema.cc b/src/components/smart_objects/src/smart_schema.cc
index be24ceb076..7509ea80f1 100644
--- a/src/components/smart_objects/src/smart_schema.cc
+++ b/src/components/smart_objects/src/smart_schema.cc
@@ -40,8 +40,14 @@ CSmartSchema::CSmartSchema() : mSchemaItem(CAlwaysTrueSchemaItem::create()) {}
CSmartSchema::CSmartSchema(const ISchemaItemPtr SchemaItem)
: mSchemaItem(SchemaItem) {}
-Errors::eType CSmartSchema::validate(const SmartObject& object) const {
- return mSchemaItem->validate(object);
+Errors::eType CSmartSchema::validate(const SmartObject& Object) const {
+ rpc::ValidationReport report("RPC");
+ return validate(Object, &report);
+}
+
+Errors::eType CSmartSchema::validate(const SmartObject& object,
+ rpc::ValidationReport* report__) const {
+ return mSchemaItem->validate(object, report__);
}
void CSmartSchema::setSchemaItem(const ISchemaItemPtr schemaItem) {
diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc
index 3fac3a6cde..1e4c8372f0 100644
--- a/src/components/smart_objects/src/string_schema_item.cc
+++ b/src/components/smart_objects/src/string_schema_item.cc
@@ -46,7 +46,18 @@ utils::SharedPtr<CStringSchemaItem> CStringSchemaItem::create(
}
Errors::eType CStringSchemaItem::validate(const SmartObject& Object) {
+ rpc::ValidationReport report("RPC");
+ return validate(Object, &report);
+}
+
+Errors::eType CStringSchemaItem::validate(const SmartObject& Object,
+ rpc::ValidationReport* report__) {
if (SmartType_String != Object.getType()) {
+ std::string validation_info = "Incorrect type, expected: " +
+ SmartObject::typeToString(SmartType_String) +
+ ", got: " +
+ SmartObject::typeToString(Object.getType());
+ report__->set_validation_info(validation_info);
return Errors::INVALID_VALUE;
}
@@ -54,9 +65,19 @@ Errors::eType CStringSchemaItem::validate(const SmartObject& Object) {
size_t length;
if (mMinLength.getValue(length) && (value.size() < length)) {
+ std::stringstream stream;
+ stream << "Got string of size: " << value.size()
+ << ", minimum allowed: " << length;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
return Errors::OUT_OF_RANGE;
}
if (mMaxLength.getValue(length) && (value.size() > length)) {
+ std::stringstream stream;
+ stream << "Got string of size: " << value.size()
+ << ", maximum allowed: " << length;
+ std::string validation_info = stream.str();
+ report__->set_validation_info(validation_info);
return Errors::OUT_OF_RANGE;
}
return Errors::OK;
diff --git a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
index cf1d107ba2..9d88178598 100644
--- a/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysFalseSchemaItem_test.cc
@@ -39,8 +39,8 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
+
using namespace NsSmartDeviceLink::NsSmartObjects;
/**
@@ -52,43 +52,44 @@ TEST(test_AlwaysFalseSchemaItemTest, simple_test) {
ISchemaItemPtr item = CAlwaysFalseSchemaItem::create();
obj = 5;
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::ERROR, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::ERROR, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::ERROR, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
- resultType = item->validate(obj["First"]);
+ resultType = item->validate(obj["First"], &report);
EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj["Second"]);
+ resultType = item->validate(obj["Second"], &report);
EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
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]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::ERROR, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::ERROR, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
-} // namespace SchemaItem
-} // namespace SmartObjects
+
+} // namespace smart_object_test
} // namespace components
} // namespace test
diff --git a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
index a29567293d..40c827e17b 100644
--- a/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
+++ b/src/components/smart_objects/test/AlwaysTrueSchemaItem_test.cc
@@ -39,8 +39,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
using namespace NsSmartDeviceLink::NsSmartObjects;
@@ -53,43 +52,44 @@ TEST(test_AlwaysTrueSchemaItemTest, simple_test) {
ISchemaItemPtr item = CAlwaysTrueSchemaItem::create();
obj = 5;
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(5, obj.asInt());
obj = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_TRUE(obj.asBool());
obj = "Test";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(std::string("Test"), obj.asString());
obj["First"] = "Some string";
obj["Second"] = 555;
- resultType = item->validate(obj["First"]);
+ resultType = item->validate(obj["First"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["Second"]);
+ resultType = item->validate(obj["Second"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
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]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_TRUE(obj[0].asBool());
EXPECT_FALSE(obj[1].asBool());
}
-} // namespace SchemaItem
-} // namespace SmartObjects
+
+} // namespace smart_object_test
} // namespace components
} // namespace test
diff --git a/src/components/smart_objects/test/ArraySchemaItem_test.cc b/src/components/smart_objects/test/ArraySchemaItem_test.cc
index c4c7254cb8..9831f08442 100644
--- a/src/components/smart_objects/test/ArraySchemaItem_test.cc
+++ b/src/components/smart_objects/test/ArraySchemaItem_test.cc
@@ -40,8 +40,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
/**
* Test ArraySchemaItem no schema item, no min and max size
@@ -67,28 +66,29 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
EXPECT_FALSE(obj[3][1].asBool());
EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(Errors::OK, resultType);
item->applySchema(obj, false);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(38, obj[0].asInt());
@@ -102,19 +102,19 @@ TEST(test_no_default_value, test_ArraySchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
// Obj - bool
obj = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
}
@@ -138,24 +138,25 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
EXPECT_EQ(std::string("true"), obj[1].asString());
EXPECT_EQ(std::string("New String"), obj[2].asString());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
item->applySchema(obj, false);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[0]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
@@ -170,14 +171,14 @@ TEST(test_item_with_default_value, test_ArraySchemaItemTest) {
EXPECT_EQ(std::string("false"), obj[3][1].asString());
EXPECT_EQ(std::string("Another String"), obj[3][2].asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(Errors::OK, resultType);
obj[3][3] = "Another very very loooooong String";
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(Errors::OK, resultType);
}
@@ -194,17 +195,18 @@ TEST(test_array_with_min_size, test_ArraySchemaItemTest) {
obj[0] = "Some String";
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
obj[2] = "New String";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
@@ -227,22 +229,23 @@ TEST(test_array_with_max_size, test_ArraySchemaItemTest) {
obj[0] = "Some String";
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
obj[1] = "true";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
obj[2] = "New String";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
obj[3] = "Another String";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
@@ -266,27 +269,28 @@ TEST(test_array_with_min_and_max_size, test_ArraySchemaItemTest) {
obj[0] = "Some String";
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
obj[1] = "true";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
obj[2] = "New String";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
obj[3] = "Another String";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
obj[4] = "Out of array";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(std::string("Some String"), obj[0].asString());
@@ -308,29 +312,30 @@ TEST(test_map_validate, test_ArraySchemaItemTest) {
obj["array"][0] = "Some String";
- int resultType = item->validate(obj["array"]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["array"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
obj["array"][1] = "true";
- resultType = item->validate(obj["array"]);
+ resultType = item->validate(obj["array"], &report);
EXPECT_EQ(Errors::OK, resultType);
obj["array"][2] = "New String";
- resultType = item->validate(obj["array"]);
+ resultType = item->validate(obj["array"], &report);
EXPECT_EQ(Errors::OK, resultType);
obj["array"][3] = "Another String";
- resultType = item->validate(obj["array"]);
+ resultType = item->validate(obj["array"], &report);
EXPECT_EQ(Errors::OK, resultType);
obj["array"][4] = "Out of array";
- resultType = item->validate(obj["array"]);
+ resultType = item->validate(obj["array"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("Some String"), obj["array"][0].asString());
@@ -339,7 +344,7 @@ TEST(test_map_validate, test_ArraySchemaItemTest) {
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 smart_object_test
} // namespace components
} // namespace test
diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc
index fa9c6a3d5d..8d67aa59b2 100644
--- a/src/components/smart_objects/test/BoolSchemaItem_test.cc
+++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc
@@ -41,8 +41,8 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
+
using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
/**
@@ -63,14 +63,15 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -79,12 +80,12 @@ TEST(test_no_default_value, test_BoolSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
}
@@ -109,14 +110,15 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -125,14 +127,14 @@ TEST(test_item_with_default_value, test_BoolSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
EXPECT_FALSE(obj.asBool());
}
@@ -147,10 +149,11 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
obj["aa"] = true;
ASSERT_TRUE(obj["aa"].asBool());
- int resultType = item->validate(obj["aa"]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["aa"], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
@@ -162,11 +165,11 @@ TEST(test_map_validate, test_BoolSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_FALSE(obj.asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
obj["ind"] = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
}
@@ -182,13 +185,14 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
ASSERT_TRUE(obj[0].asBool());
ASSERT_FALSE(obj[1].asBool());
- int resultType = item->validate(obj[0]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
@@ -200,16 +204,16 @@ TEST(test_array_validate, test_BoolSchemaItemTest) {
EXPECT_FALSE(resDefault);
EXPECT_FALSE(obj[1].asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
obj = false;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
}
-} // namespace SchemaItem"
-} // namespace SmartObjects"
-} // namespace components"
-} // namespace test"
+
+} // namespace smart_object_test
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/CMakeLists.txt b/src/components/smart_objects/test/CMakeLists.txt
index e8bc20b6b8..e0cc37e104 100644
--- a/src/components/smart_objects/test/CMakeLists.txt
+++ b/src/components/smart_objects/test/CMakeLists.txt
@@ -28,8 +28,11 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
+
if(BUILD_TESTS)
-add_definitions(-DUNIT_TESTS)
+ add_definitions(-DUNIT_TESTS)
+endif()
include_directories (
${GMOCK_INCLUDE_DIRECTORY}
@@ -45,22 +48,10 @@ set(LIBRARIES
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
+set(EXCLUDE_PATHS
+ EnumSchemaItem_test.cc
+ SmartObjectConvertionTime_test.cc
)
-create_test("smart_object_test" "${SOURCES}" "${LIBRARIES}")
-
-endif()
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+create_test(smart_object_test "${SOURCES}" "${LIBRARIES}")
diff --git a/src/components/smart_objects/test/CObjectSchemaItem_test.cc b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
index b3777ad028..523b25a8d8 100644
--- a/src/components/smart_objects/test/CObjectSchemaItem_test.cc
+++ b/src/components/smart_objects/test/CObjectSchemaItem_test.cc
@@ -53,8 +53,7 @@ using namespace NsSmartDeviceLink::NsJSONHandler::strings;
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
namespace FunctionID {
enum eType {
@@ -156,7 +155,9 @@ TEST_F(ObjectSchemaItemTest, validation_correct) {
obj[S_MSG_PARAMS][Keys::INFO] = "0123456789";
obj[S_MSG_PARAMS][Keys::SUCCESS] = true;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
@@ -168,7 +169,9 @@ TEST_F(ObjectSchemaItemTest, validation_correct_skip_not_mandatory) {
// skip non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
@@ -176,7 +179,9 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
obj[S_PARAMS] = "some parameters";
obj[S_MSG_PARAMS] = "some message parameters";
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = "some function";
obj[S_PARAMS][S_CORRELATION_ID] = "some correlation id";
@@ -184,23 +189,35 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_param) {
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));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 1;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = -0xFF1;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 2;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::RESULT_CODE] = 1;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
SmartObject obj;
@@ -212,18 +229,26 @@ TEST_F(ObjectSchemaItemTest, validation_invalid_not_mandatory_param) {
// 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));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = true;
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// invalid non-mandatory obj[S_MSG_PARAMS][Keys::INFO]
obj[S_MSG_PARAMS][Keys::INFO] = SmartObject();
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][Keys::INFO] = "info";
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_missing_mandatory) {
@@ -235,18 +260,29 @@ TEST_F(ObjectSchemaItemTest, validation_missing_mandatory) {
obj[S_MSG_PARAMS][Keys::INFO] = "123";
obj[S_MSG_PARAMS][Keys::SUCCESS] = false;
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_FUNCTION_ID] = 2;
// S_CORRELATION_ID and S_PROTOCOL_VERSION is still missed
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_CORRELATION_ID] = 0XFF2;
// S_PROTOCOL_VERSION is still missed
- EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::MISSING_MANDATORY_PARAMETER,
+ schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_unexpected_param) {
@@ -264,15 +300,21 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param) {
obj[fake1] = SmartObject(static_cast<int64_t>(0));
// any fake parameter is OK
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_PARAMS][fake2] = SmartObject("123");
// any fake parameters are OK
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[S_MSG_PARAMS][fake3] = true;
// any fake parameters are OK
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
@@ -298,7 +340,9 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
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));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// Check apply schema, remove fake parameter
schema_item->applySchema(obj, true);
@@ -311,7 +355,9 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::RESULT_CODE));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::INFO));
EXPECT_TRUE(obj[S_MSG_PARAMS].keyExists(Keys::SUCCESS));
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
obj[fake1] = SmartObject(static_cast<int64_t>(0));
obj[S_PARAMS][fake2] = SmartObject("123");
@@ -325,7 +371,9 @@ TEST_F(ObjectSchemaItemTest, validation_unexpected_param_remove) {
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));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, validation_empty_params) {
@@ -339,14 +387,20 @@ TEST_F(ObjectSchemaItemTest, validation_empty_params) {
obj[S_MSG_PARAMS]["FAKE_PARAM2"] = SmartObject(0x1);
obj[S_MSG_PARAMS]["FAKE_PARAM3"] = SmartObject("2");
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ rpc::ValidationReport report("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(obj, false);
- EXPECT_EQ(Errors::OK, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(obj, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
schema_item->unapplySchema(obj);
// Invalide state after enum convertion
- EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::INVALID_VALUE, schema_item->validate(obj, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
}
TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
@@ -381,10 +435,14 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
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));
+ rpc::ValidationReport report("RPC");
+ EXPECT_NE(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
schema_item->applySchema(object, false);
- EXPECT_EQ(Errors::OK, schema_item->validate(object));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_EQ(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_EQ(std::string(""), rpc::PrettyFormat(report));
// check conversion result
EXPECT_EQ(function_type, object[S_PARAMS][S_FUNCTION_ID].asInt());
@@ -392,7 +450,9 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
schema_item->unapplySchema(object);
// S_FUNCTION_ID and RESULT_CODE are string
- EXPECT_NE(Errors::OK, schema_item->validate(object));
+ report = rpc::ValidationReport("RPC");
+ EXPECT_NE(Errors::OK, schema_item->validate(object, &report));
+ EXPECT_NE(std::string(""), rpc::PrettyFormat(report));
// check conversion result
EXPECT_EQ(function_str, object[S_PARAMS][S_FUNCTION_ID].asString());
@@ -401,16 +461,15 @@ TEST_F(ObjectSchemaItemTest, test_strings_to_enum_conversion) {
}
}
}
-// ----------------------------------------------------------------------------
-} // namespace SchemaItem
-} // namespace SmartObjects
+
+} // namespace smart_object_test
} // namespace components
} // namespace test
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
-namespace FunctionID = test::components::SmartObjects::SchemaItem::FunctionID;
+namespace FunctionID = test::components::smart_object_test::FunctionID;
typedef EnumConversionHelper<FunctionID::eType> FunctionConvertor;
template <>
@@ -444,7 +503,7 @@ const FunctionID::eType FunctionConvertor::enum_values_[] = {
// ----------------------------------------------------------------------------
-namespace ResultType = test::components::SmartObjects::SchemaItem::ResultType;
+namespace ResultType = test::components::smart_object_test::ResultType;
typedef EnumConversionHelper<ResultType::eType> ResultTypeConvertor;
template <>
diff --git a/src/components/smart_objects/test/EnumSchemaItem_test.cc b/src/components/smart_objects/test/EnumSchemaItem_test.cc
index 24cde07193..9914167e5a 100644
--- a/src/components/smart_objects/test/EnumSchemaItem_test.cc
+++ b/src/components/smart_objects/test/EnumSchemaItem_test.cc
@@ -40,8 +40,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
using namespace NsSmartDeviceLink::NsSmartObjects;
namespace TestType {
@@ -93,7 +92,8 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - valid enum
obj = TestType::BLUETOOTH_OFF;
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -102,7 +102,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -111,7 +111,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
@@ -120,7 +120,7 @@ TEST_F(EnumSchemaItemTest, test_item_with_default_value) {
// Object - string
obj = "Some string";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
@@ -143,7 +143,8 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - valid enum
obj = TestType::BLUETOOTH_OFF;
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -152,7 +153,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -161,7 +162,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
@@ -170,7 +171,7 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - string
obj = "Some string";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
@@ -179,12 +180,12 @@ TEST_F(EnumSchemaItemTest, test_item_without_default_value) {
// Object - int in range of enum
obj = 6;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object - int out of enum range
obj = 15;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
}
@@ -200,38 +201,39 @@ TEST_F(EnumSchemaItemTest, test_apply_unapply_schema) {
// Object - valid enum
obj = TestType::BLUETOOTH_OFF;
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
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);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("FACTORY_DEFAULTS"), obj.asString());
item->applySchema(obj, false);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(TestType::FACTORY_DEFAULTS, obj.asInt());
obj = "TOO_MANY_REQUESTS";
item->applySchema(obj, false);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(TestType::TOO_MANY_REQUESTS, obj.asInt());
obj = "ENOUGH_REQUESTS";
item->applySchema(obj, false);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
EXPECT_EQ(std::string("ENOUGH_REQUESTS"), obj.asString());
}
-}
-}
-}
-}
+
+} // namespace smart_object_test
+} // namespace components
+} // namespace test
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
diff --git a/src/components/smart_objects/test/NumberSchemaItem_test.cc b/src/components/smart_objects/test/NumberSchemaItem_test.cc
index 2c4b24e927..0315bcedb3 100644
--- a/src/components/smart_objects/test/NumberSchemaItem_test.cc
+++ b/src/components/smart_objects/test/NumberSchemaItem_test.cc
@@ -38,8 +38,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
using NsSmartDeviceLink::NsSmartObjects::ISchemaItemPtr;
@@ -62,20 +61,21 @@ TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
obj = 5;
ASSERT_EQ(5, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
@@ -83,11 +83,11 @@ TEST(test_int_no_default_value, test_NumberSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
}
@@ -106,21 +106,22 @@ TEST(test_int_min_value, test_NumberSchemaItemTest) {
obj = 15;
ASSERT_EQ(15, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = 9;
ASSERT_EQ(9, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 10;
ASSERT_EQ(10, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
}
@@ -140,21 +141,22 @@ TEST(test_int_max_value, test_NumberSchemaItemTest) {
obj = 749;
ASSERT_EQ(749, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -750;
ASSERT_EQ(-750, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
}
@@ -174,28 +176,29 @@ TEST(test_int_min_max_value, test_NumberSchemaItemTest) {
obj = 749;
ASSERT_EQ(749, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = 750;
ASSERT_EQ(750, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = -949;
ASSERT_EQ(-949, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = -950;
ASSERT_EQ(-950, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
}
@@ -216,44 +219,45 @@ TEST(test_int_correct_default_value, test_NumberSchemaItemTest) {
obj = -12000;
ASSERT_EQ(-12000, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = -12001;
ASSERT_EQ(-12001, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
// Object string
obj = "string";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(-38, obj.asInt());
}
@@ -275,44 +279,45 @@ TEST(test_int_default_value_out_of_range, test_NumberSchemaItemTest) {
obj = 90;
ASSERT_EQ(90, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = 89;
ASSERT_EQ(89, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object int correct
obj = 100;
ASSERT_EQ(100, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object int incorrect
obj = 101;
ASSERT_EQ(101, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
// Object string
obj = "string";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50, obj.asInt());
}
@@ -332,15 +337,16 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
obj["max"] = 100;
obj["out_of_max"] = 101;
- int resultType = item->validate(obj["min"]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["min"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["max"]);
+ resultType = item->validate(obj["max"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["out_of_min"]);
+ resultType = item->validate(obj["out_of_min"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["out_of_max"]);
+ resultType = item->validate(obj["out_of_max"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
// Set default value
@@ -352,13 +358,13 @@ TEST(test_int_map_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["min"]);
+ resultType = item->validate(obj["min"], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
}
@@ -377,21 +383,22 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
obj[2] = 100;
obj[3] = 101;
- int resultType = item->validate(obj[0]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
@@ -403,14 +410,14 @@ TEST(test_int_array_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[0]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
}
@@ -434,20 +441,21 @@ TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
obj = 5.79;
ASSERT_EQ(5.79, obj.asDouble());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Obj bool
obj = true;
ASSERT_TRUE(obj.asBool());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
EXPECT_TRUE(obj.asBool());
@@ -455,13 +463,13 @@ TEST(test_double_no_default_value, test_NumberSchemaItemTest) {
obj = "Test";
ASSERT_EQ(std::string("Test"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
// Set default value
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
}
@@ -480,21 +488,22 @@ TEST(test_double_min_value, test_NumberSchemaItemTest) {
obj = 10.000001;
ASSERT_EQ(10.000001, obj.asDouble());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = 9.999999;
ASSERT_EQ(9.999999, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
/*
//Object int
obj = 10;
ASSERT_EQ(10, obj.asInt());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);*/
}
@@ -514,21 +523,22 @@ TEST(test_double_max_value, test_NumberSchemaItemTest) {
obj = 749.0;
ASSERT_EQ(749.0, obj.asDouble());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = 749.0001;
ASSERT_EQ(749.0001, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -750.0;
ASSERT_EQ(-750.0, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
}
@@ -548,28 +558,29 @@ TEST(test_double_min_max_value, test_NumberSchemaItemTest) {
obj = 749.0;
ASSERT_EQ(749.0, obj.asDouble());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = 749.001;
ASSERT_EQ(749.001, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = -949.0;
ASSERT_EQ(-949.0, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = -949.00001;
ASSERT_EQ(-949.00001, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
}
@@ -590,44 +601,45 @@ TEST(test_double_correct_default_value, test_NumberSchemaItemTest) {
obj = -12000.0;
ASSERT_EQ(-12000.0, obj.asDouble());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = -12000.01;
ASSERT_EQ(-12000.01, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
// Object string
obj = "string";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(-38.0, obj.asDouble());
}
@@ -649,44 +661,45 @@ TEST(test_double_default_value_out_of_range, test_NumberSchemaItemTest) {
obj = 90.0;
ASSERT_EQ(90.0, obj.asDouble());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = 89.999;
ASSERT_EQ(89.999, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Object double correct
obj = 100.0;
ASSERT_EQ(100.0, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
// Object double incorrect
obj = 100.001;
ASSERT_EQ(100.001, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
// Set default value
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
// Object string
obj = "string";
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
EXPECT_EQ(50.0, obj.asDouble());
}
@@ -706,15 +719,16 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
obj["max"] = 100.0;
obj["out_of_max"] = 100.001;
- int resultType = item->validate(obj["min"]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["min"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["max"]);
+ resultType = item->validate(obj["max"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["out_of_min"]);
+ resultType = item->validate(obj["out_of_min"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["out_of_max"]);
+ resultType = item->validate(obj["out_of_max"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["aa"]);
@@ -725,13 +739,13 @@ TEST(test_double_map_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38.0, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["min"]);
+ resultType = item->validate(obj["min"], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
}
@@ -750,21 +764,22 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
obj[2] = 100.0;
obj[3] = 100.000001;
- int resultType = item->validate(obj[0]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OUT_OF_RANGE,
resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
@@ -776,14 +791,14 @@ TEST(test_double_array_validate, test_NumberSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(-38.0, obj.asDouble());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::OK, resultType);
- resultType = item->validate(obj[0]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(NsSmartDeviceLink::NsSmartObjects::Errors::INVALID_VALUE,
resultType);
}
@@ -800,7 +815,8 @@ TEST(test_int_double_value, test_NumberSchemaItemTest) {
obj = value;
ASSERT_EQ(value, obj.asDouble());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
}
@@ -816,11 +832,11 @@ TEST(test_double_int_value, test_NumberSchemaItemTest) {
obj = value;
ASSERT_EQ(value, obj.asInt());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
}
-} // namespace SchemaItem
-} // namespace SmartObjects
+} // namespace smart_object_test
} // namespace components
} // namespace test
diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
index d9f099afb1..b11560914e 100644
--- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
+++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc
@@ -41,8 +41,8 @@
#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 "formatters/CFormatterJsonSDLRPCv2.h"
+#include "formatters/CFormatterJsonSDLRPCv1.h"
#include "smart_objects/array_schema_item.h"
#include "smart_objects/bool_schema_item.h"
#include "smart_objects/object_schema_item.h"
@@ -56,8 +56,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SmartObjectConvertionTimeTest {
+namespace smart_object_test {
using namespace NsSmartDeviceLink::NsJSONHandler::strings;
using namespace NsSmartDeviceLink::NsSmartObjects;
@@ -429,6 +428,8 @@ TEST_F(SmartObjectConvertionTimeTest, test_some_object_convertion) {
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]["syncMsgVersion"]["patchVersion"] = 5;
+
srcObj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
srcObj[S_MSG_PARAMS]["ttsName"][0]["type"] = "TEXT";
srcObj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
@@ -634,10 +635,10 @@ TEST_F(SmartObjectConvertionTimeTest, test_object_without_enum_convertion) {
printf("\n Object without enum.\n");
calculateConvertionTime(srcObj, dstObj);
}
-}
-}
-}
-}
+
+} // namespace smart_object_test
+} // namespace components
+} // namespace test
namespace NsSmartDeviceLink {
namespace NsSmartObjects {
diff --git a/src/components/smart_objects/test/SmartObjectDraft_test.cc b/src/components/smart_objects/test/SmartObjectDraft_test.cc
index 2932a68167..de8103771c 100644
--- a/src/components/smart_objects/test/SmartObjectDraft_test.cc
+++ b/src/components/smart_objects/test/SmartObjectDraft_test.cc
@@ -42,8 +42,7 @@ using ::testing::ContainerEq;
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SmartObjectDraftTest {
+namespace smart_object_test {
using NsSmartDeviceLink::NsSmartObjects::SmartObject;
using NsSmartDeviceLink::NsSmartObjects::SmartType;
@@ -358,7 +357,7 @@ TEST(SmartObjectsDraftTest, compare_map_type) {
ASSERT_NE(other_value2, SmartObject());
}
// TODO(Ezamakhov): add test for conversion string/int/double
-} // namespace SmartObjectDraftTest
-} // namespace SmartObjects
+
+} // namespace smart_object_test
} // namespace components
} // namespace test
diff --git a/src/components/smart_objects/test/SmartObjectInvalid_test.cc b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
index 6a3caf2950..68afbb6237 100644
--- a/src/components/smart_objects/test/SmartObjectInvalid_test.cc
+++ b/src/components/smart_objects/test/SmartObjectInvalid_test.cc
@@ -38,8 +38,8 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SmartObjectInvalidTest {
+namespace smart_object_test {
+
using namespace NsSmartDeviceLink::NsSmartObjects;
TEST(test_SmartObjectInvalidTest, simple_type_can_be_set_in_constructor) {
@@ -171,7 +171,7 @@ TEST(test_SmartObjectInvalidTest, invalid_object_remains_invalid) {
ASSERT_EQ(invalid_bool_value,
obj["we"]["need"]["to"]["go"]["deeper"].asBool());
}
-} // namespace SmartObjectInvalidTest
-} // namespace SmartObjects
+
+} // namespace smart_object_test
} // namespace components
} // namespace test
diff --git a/src/components/smart_objects/test/SmartObjectStress_test.cc b/src/components/smart_objects/test/SmartObjectStress_test.cc
index da6e804e2b..698bd0415a 100644
--- a/src/components/smart_objects/test/SmartObjectStress_test.cc
+++ b/src/components/smart_objects/test/SmartObjectStress_test.cc
@@ -39,9 +39,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SmartObjectStressTest {
-
+namespace smart_object_test {
using namespace NsSmartDeviceLink::NsSmartObjects;
class StressTestHelper : public ::testing::Test {
@@ -343,7 +341,7 @@ TEST_F(StressTestHelper, ExtraManualDebugTest) {
ASSERT_EQ("0.59432", get_object(obj, "A6 A4 M0").asString());
ASSERT_TRUE(get_object(obj, "A6 A4 M1 M0 M0 A0").asBool());
}
-}
-}
-}
-}
+
+} // namespace smart_object_test
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/SmartObjectUnit_test.cc b/src/components/smart_objects/test/SmartObjectUnit_test.cc
index cd5cd0c131..0a67b7e922 100644
--- a/src/components/smart_objects/test/SmartObjectUnit_test.cc
+++ b/src/components/smart_objects/test/SmartObjectUnit_test.cc
@@ -35,8 +35,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SmartObjectUnitTest {
+namespace smart_object_test {
using namespace NsSmartDeviceLink::NsSmartObjects;
@@ -585,7 +584,7 @@ TEST(MapEraseTest, SmartObjectTest) {
ASSERT_FALSE(srcObj.erase("one"));
}
// TODO: Add a test to check accessing an array at strange indexes.
-} // namespace SmartObjectUnitTest
-} // namespace SmartObjects
+
+} // namespace smart_object_test
} // namespace components
} // namespace test
diff --git a/src/components/smart_objects/test/StringSchemaItem_test.cc b/src/components/smart_objects/test/StringSchemaItem_test.cc
index c5c2b4dee0..4e4688d354 100644
--- a/src/components/smart_objects/test/StringSchemaItem_test.cc
+++ b/src/components/smart_objects/test/StringSchemaItem_test.cc
@@ -39,8 +39,7 @@
namespace test {
namespace components {
-namespace SmartObjects {
-namespace SchemaItem {
+namespace smart_object_test {
/**
* Test StringSchemaItem no default value
@@ -60,7 +59,8 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -69,7 +69,7 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
@@ -78,12 +78,12 @@ TEST(test_no_default_value, test_StringSchemaItemTest) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_FALSE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
EXPECT_EQ(3.1415926, obj.asDouble());
}
@@ -111,7 +111,8 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -120,7 +121,7 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
// Obj - bool
obj = true;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -129,12 +130,12 @@ TEST(test_item_with_default_value, test_StringSchemaItemTest) {
// Object - number
obj = 3.1415926;
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
EXPECT_EQ(std::string("Default string"), obj.asString());
}
@@ -155,7 +156,8 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
obj = "New valid string";
ASSERT_EQ(std::string("New valid string"), obj.asString());
- int resultType = item->validate(obj);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
bool resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
@@ -165,13 +167,13 @@ TEST(test_item_with_max_length, test_StringSchemaItemTest) {
obj = "New very very loooooong string";
ASSERT_EQ(std::string("New very very loooooong string"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
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);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
}
@@ -189,19 +191,20 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
obj["bool"] = true;
obj["num"] = 3.14;
- int resultType = item->validate(obj["str"]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj["str"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["long"]);
+ resultType = item->validate(obj["long"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["bool"]);
+ resultType = item->validate(obj["bool"], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj["num"]);
+ resultType = item->validate(obj["num"], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj["str"]);
@@ -216,23 +219,23 @@ TEST(test_map_validate, test_StringSchemaItemTest) {
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj["num"].asString());
- resultType = item->validate(obj["str"]);
+ resultType = item->validate(obj["str"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["long"]);
+ resultType = item->validate(obj["long"], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj["bool"]);
+ resultType = item->validate(obj["bool"], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj["num"]);
+ resultType = item->validate(obj["num"], &report);
EXPECT_EQ(Errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
}
@@ -251,22 +254,23 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
obj[3] = 3.14;
obj[4] = "New valid string";
- int resultType = item->validate(obj[0]);
+ rpc::ValidationReport report("RPC");
+ int resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[4]);
+ resultType = item->validate(obj[4], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
bool resDefault = item->setDefaultValue(obj[0]);
@@ -285,27 +289,27 @@ TEST(test_array_validate, test_StringSchemaItemTest) {
EXPECT_EQ(std::string("Default string"), obj[4].asString());
EXPECT_EQ(std::string("Default string"), obj[5].asString());
- resultType = item->validate(obj[0]);
+ resultType = item->validate(obj[0], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[1]);
+ resultType = item->validate(obj[1], &report);
EXPECT_EQ(Errors::OUT_OF_RANGE, resultType);
- resultType = item->validate(obj[2]);
+ resultType = item->validate(obj[2], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[3]);
+ resultType = item->validate(obj[3], &report);
EXPECT_EQ(Errors::INVALID_VALUE, resultType);
- resultType = item->validate(obj[4]);
+ resultType = item->validate(obj[4], &report);
EXPECT_EQ(Errors::OK, resultType);
- resultType = item->validate(obj[5]);
+ resultType = item->validate(obj[5], &report);
EXPECT_EQ(Errors::OK, resultType);
resDefault = item->setDefaultValue(obj);
EXPECT_TRUE(resDefault);
EXPECT_EQ(std::string("Default string"), obj.asString());
- resultType = item->validate(obj);
+ resultType = item->validate(obj, &report);
EXPECT_EQ(Errors::OK, resultType);
}
-} // namespace SchemaItem
-} // namespace SmartObjects
+
+} // namespace smart_object_test
} // 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
index 35863da420..b0544a94d4 100644
--- a/src/components/smart_objects/test/map_performance_test.cc
+++ b/src/components/smart_objects/test/map_performance_test.cc
@@ -40,6 +40,10 @@ typedef std::string Key;
typedef std::vector<std::string> Value;
typedef std::map<Key, Value> Map;
+namespace test {
+namespace components {
+namespace smart_object_test {
+
namespace {
void MakeMapObject(Map& obj, const int size) {
char i_key[8], j_key[8];
@@ -73,3 +77,7 @@ TEST(SmartObjectPerformanceTest, SmartObjectMapPerformance) {
}
}
}
+
+} // namespace smart_object_test
+} // namespace components
+} // namespace test
diff --git a/src/components/smart_objects/test/smart_object_performance_test.cc b/src/components/smart_objects/test/smart_object_performance_test.cc
index e699da54fe..503652dcda 100644
--- a/src/components/smart_objects/test/smart_object_performance_test.cc
+++ b/src/components/smart_objects/test/smart_object_performance_test.cc
@@ -39,6 +39,10 @@
using namespace NsSmartDeviceLink::NsSmartObjects;
+namespace test {
+namespace components {
+namespace smart_object_test {
+
namespace {
void MakeMapObject(SmartObject& obj, const int size) {
char i_key[8], j_key[8];
@@ -73,3 +77,7 @@ TEST(SmartObjectPerformanceTest, SmartObjectPerformance) {
}
}
}
+
+} // namespace smart_object_test
+} // namespace components
+} // namespace test
diff --git a/src/components/telemetry_monitor/CMakeLists.txt b/src/components/telemetry_monitor/CMakeLists.txt
index f3004dc61e..bb419a92e9 100644
--- a/src/components/telemetry_monitor/CMakeLists.txt
+++ b/src/components/telemetry_monitor/CMakeLists.txt
@@ -28,17 +28,22 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-
-set(TELEMETRY_MONITOR_SRC_DIR ${COMPONENTS_DIR}/telemetry_monitor/src)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
- include
+ include/
+ ${COMPONENTS_DIR}/include/application_manager/
+ ${COMPONENTS_DIR}/telemetry_monitor/include/
${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/include/
+ ${COMPONENTS_DIR}/remote_control/include/
+ ${POLICY_PATH}/include/
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
+ ${COMPONENTS_DIR}/rpc_base/include/
+ ${COMPONENTS_DIR}/functional_module/include/
${COMPONENTS_DIR}/hmi_message_handler/include/
${COMPONENTS_DIR}/formatters/include/
${COMPONENTS_DIR}/media_manager/include/
@@ -49,15 +54,17 @@ include_directories (
${LOG4CXX_INCLUDE_DIRECTORY}
)
-set(SOURCES
- ${TELEMETRY_MONITOR_SRC_DIR}/metric_wrapper.cc
- ${TELEMETRY_MONITOR_SRC_DIR}/telemetry_monitor.cc
- ${TELEMETRY_MONITOR_SRC_DIR}/application_manager_observer.cc
- ${TELEMETRY_MONITOR_SRC_DIR}/transport_manager_observer.cc
- ${TELEMETRY_MONITOR_SRC_DIR}/protocol_handler_observer.cc
- ${TELEMETRY_MONITOR_SRC_DIR}/application_manager_metric_wrapper.cc
- ${TELEMETRY_MONITOR_SRC_DIR}/transport_manager_metric_wrapper.cc
- ${TELEMETRY_MONITOR_SRC_DIR}/protocol_handler_metric_wrapper.cc
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+collect_sources(SOURCES "${PATHS}")
+
+set(LIBRARIES
+ HMI_API
+ MOBILE_API
+ Utils
+ Policy
)
add_library("TelemetryMonitor" ${SOURCES})
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
index d35de52e3b..3c3de20e0e 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_MECTRIC_WRAPPER_H_
-#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_MECTRIC_WRAPPER_H_
+#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_METRIC_WRAPPER_H_
+#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_METRIC_WRAPPER_H_
#include <string>
@@ -49,4 +49,4 @@ class ApplicationManagerMetricWrapper : public MetricWrapper {
virtual Json::Value GetJsonMetric();
};
}
-#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_MECTRIC_WRAPPER_H_
+#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_APPLICATION_MANAGER_METRIC_WRAPPER_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h
index b4d7ed12cb..431e255c7b 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/metric_wrapper.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_MECTRIC_WRAPPER_H_
-#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_MECTRIC_WRAPPER_H_
+#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_METRIC_WRAPPER_H_
+#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_METRIC_WRAPPER_H_
#include <string>
#include "utils/resource_usage.h"
@@ -57,4 +57,4 @@ class MetricWrapper {
};
} // namespace telemetry_monitor
-#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_MECTRIC_WRAPPER_H_
+#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_METRIC_WRAPPER_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
index bc4e4c8e53..daf602e9ca 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_MECTRIC_WRAPPER_H_
-#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_MECTRIC_WRAPPER_H_
+#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_METRIC_WRAPPER_H_
+#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_METRIC_WRAPPER_H_
#include <string>
#include "utils/shared_ptr.h"
@@ -47,4 +47,4 @@ class ProtocolHandlerMecticWrapper : public MetricWrapper {
virtual Json::Value GetJsonMetric();
};
} // namespace telemetry_monitor
-#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_MECTRIC_WRAPPER_H_
+#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_METRIC_WRAPPER_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
index 49895de8d3..618901ffa8 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h
@@ -30,12 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_H_
-#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_H_
+#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TELEMETRY_MONITOR_H_
+#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TELEMETRY_MONITOR_H_
#include <string>
-#include "utils/shared_ptr.h"
#include "utils/message_queue.h"
#include "utils/threads/thread.h"
#include "utils/threads/thread_delegate.h"
@@ -47,6 +46,11 @@
#include "protocol_handler_observer.h"
#include "protocol_handler/protocol_handler_impl.h"
+namespace utils {
+template <typename T>
+class SharedPtr;
+}
+
namespace telemetry_monitor {
using ::utils::MessageQueue;
@@ -88,16 +92,16 @@ class TelemetryMonitor {
virtual void Stop();
virtual void Start();
virtual void SendMetric(utils::SharedPtr<MetricWrapper> metric);
- void set_streamer(Streamer* streamer);
+ DEPRECATED void set_streamer(Streamer* streamer);
+ void set_streamer(utils::SharedPtr<Streamer> streamer);
const std::string& ip() const;
int16_t port() const;
private:
std::string server_address_;
int16_t port_;
- bool is_ready_;
threads::Thread* thread_;
- Streamer* streamer_;
+ utils::SharedPtr<Streamer> streamer_;
ApplicationManagerObserver app_observer;
TransportManagerObserver tm_observer;
ProtocolHandlerObserver ph_observer;
@@ -105,4 +109,4 @@ class TelemetryMonitor {
DISALLOW_COPY_AND_ASSIGN(TelemetryMonitor);
};
} // namespace telemetry_monitor
-#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_H_
+#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TELEMETRY_MONITOR_H_
diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
index 9cb158fa98..b601e89b18 100644
--- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
+++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_MECTRIC_WRAPPER_H_
-#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_MECTRIC_H_
+#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_METRIC_WRAPPER_H_
+#define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_METRIC_WRAPPER_H_
#include <string>
#include "telemetry_monitor/metric_wrapper.h"
@@ -46,4 +46,4 @@ class TransportManagerMecticWrapper : public MetricWrapper {
virtual Json::Value GetJsonMetric();
};
} // namespace telemetry_monitor
-#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_MECTRIC_WRAPPER_H_
+#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_TRANSPORT_MANAGER_METRIC_WRAPPER_H_
diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc
index 759b843961..53a5a2dc70 100644
--- a/src/components/telemetry_monitor/src/telemetry_monitor.cc
+++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc
@@ -1,34 +1,34 @@
/*
- * Copyright (c) 2014, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+* Copyright (c) 2014, Ford Motor Company
+* All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following disclaimer.
+*
+* Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following
+* disclaimer in the documentation and/or other materials provided with the
+* distribution.
+*
+* Neither the name of the Ford Motor Company nor the names of its contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+* POSSIBILITY OF SUCH DAMAGE.
+*/
#include "telemetry_monitor/telemetry_monitor.h"
@@ -42,6 +42,8 @@
#include "transport_manager/transport_manager_default.h"
#include "utils/resource_usage.h"
+#include "utils/make_shared.h"
+#include "utils/shared_ptr.h"
#include "telemetry_monitor/telemetry_observable.h"
namespace telemetry_monitor {
@@ -53,24 +55,22 @@ TelemetryMonitor::TelemetryMonitor(const std::string& server_address,
: server_address_(server_address)
, port_(port)
, thread_(NULL)
- , streamer_(NULL)
, app_observer(this)
, tm_observer(this)
, ph_observer(this) {}
void TelemetryMonitor::Start() {
- streamer_ = new Streamer(this);
- thread_ = threads::CreateThread("TelemetryMonitor", streamer_);
+ streamer_ = streamer_ ? streamer_ : utils::MakeShared<Streamer>(this);
+ thread_ = threads::CreateThread("TelemetryMonitor", streamer_.get());
}
-void TelemetryMonitor::set_streamer(Streamer* streamer) {
+void TelemetryMonitor::set_streamer(Streamer* streamer) {}
+
+void TelemetryMonitor::set_streamer(utils::SharedPtr<Streamer> streamer) {
LOG4CXX_AUTO_TRACE(logger_);
if (thread_ && !thread_->is_running()) {
- thread_->set_delegate(streamer);
- if (streamer_) {
- delete streamer_;
- }
streamer_ = streamer;
+ thread_->set_delegate(streamer_.get());
} else {
LOG4CXX_ERROR(logger_, "Unable to replace streamer if it is active");
}
@@ -116,7 +116,7 @@ void TelemetryMonitor::Stop() {
}
void TelemetryMonitor::SendMetric(utils::SharedPtr<MetricWrapper> metric) {
- if ((NULL != streamer_) && streamer_->is_client_connected_) {
+ if (streamer_ && streamer_->is_client_connected_) {
streamer_->PushMessage(metric);
}
}
@@ -170,6 +170,7 @@ void Streamer::exitThreadMain() {
LOG4CXX_AUTO_TRACE(logger_);
Stop();
messages_.Shutdown();
+ ThreadDelegate::exitThreadMain();
}
void Streamer::Start() {
diff --git a/src/components/telemetry_monitor/test/CMakeLists.txt b/src/components/telemetry_monitor/test/CMakeLists.txt
index 7d2de19854..960985e45c 100644
--- a/src/components/telemetry_monitor/test/CMakeLists.txt
+++ b/src/components/telemetry_monitor/test/CMakeLists.txt
@@ -28,7 +28,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
include
@@ -40,20 +40,10 @@ include_directories(
${COMPONENTS_DIR}/resumption/include
${JSONCPP_INCLUDE_DIRECTORY}
)
-
-set(testSources
- metric_wrapper_test.cc
- telemetry_monitor_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
-)
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}")
-set(testLibraries
+set(LIBRARIES
gmock
TelemetryMonitor
jsoncpp
@@ -68,22 +58,20 @@ set(testLibraries
MessageHelper
Resumption
jsoncpp
- transport_manager
+ TransportManager
MediaManager
ProtocolHandler
connectionHandler
)
if (BUILD_USB_SUPPORT)
- list(APPEND testLibraries Libusb-1.0.16)
+ list(APPEND LIBRARIES libusb-1.0.so)
endif()
if (BUILD_BT_SUPPORT)
- list(APPEND testLibraries bluetooth)
+ list(APPEND LIBRARIES bluetooth)
endif()
-file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-
-create_test("telemetry_monitor_test" "${testSources}" "${testLibraries}")
+create_test("telemetry_monitor_test" "${SOURCES}" "${LIBRARIES}")
-endif()
+file(COPY ${COMPONENTS_DIR}/telemetry_monitor/test/log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/src/components/telemetry_monitor/test/application_manager_metric_test.cc b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
index 5d97ac3528..9029c41bc4 100644
--- a/src/components/telemetry_monitor/test/application_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_metric_test.cc
@@ -133,6 +133,6 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetricWithGrabResources) {
delete resources;
}
-} // namespace telemetry_monitor
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
diff --git a/src/components/telemetry_monitor/test/application_manager_observer_test.cc b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
index 09ef04a2d8..5b7a551247 100644
--- a/src/components/telemetry_monitor/test/application_manager_observer_test.cc
+++ b/src/components/telemetry_monitor/test/application_manager_observer_test.cc
@@ -55,6 +55,6 @@ TEST(ApplicationManagerObserver, CallOnMessage) {
app_observer.OnMessage(ptr);
}
-} // namespace telemetry_monitor
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
diff --git a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
index 0ef5a530fd..fdda58bd08 100644
--- a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
+++ b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_MOCK_TELEMETRY_MONITOR_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_MOCK_TELEMETRY_MONITOR_H_
+#ifndef SRC_COMPONENTS_TELEMETRY_MONITOR_TEST_INCLUDE_TELEMETRY_MONITOR_MOCK_TELEMETRY_MONITOR_H_
+#define SRC_COMPONENTS_TELEMETRY_MONITOR_TEST_INCLUDE_TELEMETRY_MONITOR_MOCK_TELEMETRY_MONITOR_H_
#include <string>
#include "gmock/gmock.h"
@@ -55,4 +55,4 @@ class MockTelemetryMonitor : public telemetry_monitor::TelemetryMonitor {
} // namespace transport_manager_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_MOCK_TELEMETRY_MONITOR_H_
+#endif // SRC_COMPONENTS_TELEMETRY_MONITOR_TEST_INCLUDE_TELEMETRY_MONITOR_MOCK_TELEMETRY_MONITOR_H_
diff --git a/src/components/telemetry_monitor/test/metric_wrapper_test.cc b/src/components/telemetry_monitor/test/metric_wrapper_test.cc
index 91361f3df2..f1e3c77db4 100644
--- a/src/components/telemetry_monitor/test/metric_wrapper_test.cc
+++ b/src/components/telemetry_monitor/test/metric_wrapper_test.cc
@@ -77,6 +77,6 @@ TEST(MetricWrapper, GetJsonMetricWithGrabResources) {
delete resources;
}
-} // namespace telemetry_monitor
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
diff --git a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
index e41aeb6edd..8253cf2553 100644
--- a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
+++ b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc
@@ -120,6 +120,6 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) {
delete resources;
}
-} // namespace telemetry_monitor
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
index 8c48a51304..5235f0a469 100644
--- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
+++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
@@ -40,6 +40,8 @@
#include "connection_handler/mock_connection_handler.h"
#include "transport_manager/mock_transport_manager.h"
#include "telemetry_monitor/mock_telemetry_observable.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
using testing::Return;
using testing::_;
@@ -90,17 +92,18 @@ TEST(TelemetryMonitorTest, MessageProcess) {
EXPECT_CALL(am_observeble, SetTelemetryObserver(_));
EXPECT_CALL(transport_manager_mock, SetTelemetryObserver(_));
telemetry_monitor::TelemetryMonitor telemetry_monitor(server_address, port);
- StreamerMock streamer_mock(&telemetry_monitor);
+ utils::SharedPtr<StreamerMock> streamer_mock =
+ utils::MakeShared<StreamerMock>(&telemetry_monitor);
+ // streamer_mock will be freed by telemetry_monitor on destruction
telemetry_monitor.Start();
-
- telemetry_monitor.set_streamer(&streamer_mock);
+ telemetry_monitor.set_streamer(streamer_mock);
telemetry_monitor.Init(
&protocol_handler_mock, &am_observeble, &transport_manager_mock);
utils::SharedPtr<telemetry_monitor::MetricWrapper> test_metric;
- EXPECT_CALL(streamer_mock, PushMessage(test_metric));
+ EXPECT_CALL(*streamer_mock, PushMessage(test_metric));
telemetry_monitor.SendMetric(test_metric);
}
-} // namespace telemetry_monitor
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
diff --git a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
index 9e485ce4f1..6eb479387a 100644
--- a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
+++ b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc
@@ -111,6 +111,6 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) {
delete resources;
}
-} // namespace telemetry_monitor
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
diff --git a/src/components/telemetry_monitor/test/transport_manager_observer_test.cc b/src/components/telemetry_monitor/test/transport_manager_observer_test.cc
index 866ff25863..adc857d6cc 100644
--- a/src/components/telemetry_monitor/test/transport_manager_observer_test.cc
+++ b/src/components/telemetry_monitor/test/transport_manager_observer_test.cc
@@ -54,6 +54,6 @@ TEST(TransportManagerObserverTest, MessageProcess) {
delete ptr;
}
-} // namespace telemetry_monitor
+} // namespace telemetry_monitor_test
} // namespace components
} // namespace test
diff --git a/src/components/test_main.cc b/src/components/test_main.cc
index 66013d78c4..72c90acb5c 100644
--- a/src/components/test_main.cc
+++ b/src/components/test_main.cc
@@ -1,8 +1,8 @@
#include "gmock/gmock.h"
#include "utils/logger.h"
#include "utils/custom_string.h"
-namespace custom_str = utils::custom_string;
int main(int argc, char** argv) {
+ namespace custom_str = utils::custom_string;
testing::InitGoogleMock(&argc, argv);
::testing::DefaultValue<custom_str::CustomString>::Set(
custom_str::CustomString(""));
diff --git a/src/components/transport_manager/CMakeLists.txt b/src/components/transport_manager/CMakeLists.txt
index fbe6018d6a..4fa224393d 100644
--- a/src/components/transport_manager/CMakeLists.txt
+++ b/src/components/transport_manager/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ford Motor Company
+# Copyright (c) 2017, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,8 +28,8 @@
# 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
include
@@ -38,87 +38,73 @@ include_directories (
${COMPONENTS_DIR}/connection_handler/include
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/resumption/include
+ ${POLICY_GLOBAL_INCLUDE_PATH}/
${JSONCPP_INCLUDE_DIRECTORY}
- ${LIBUSB_INCLUDE_DIRECTORY}
${LOG4CXX_INCLUDE_DIRECTORY}
)
-if (BUILD_BT_SUPPORT)
- include_directories(
- )
-endif()
-set (SOURCES
- ${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
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+
+set(EXCLUDE_PATHS)
+
+set(LIBRARIES
+ ProtocolLibrary
+ Utils
)
-if (BUILD_BT_SUPPORT)
- list (APPEND SOURCES
- ${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
+if(BUILD_BT_SUPPORT)
+ list(APPEND LIBRARIES
+ bluetooth
+ )
+else()
+ list(APPEND EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/bluetooth
+ ${COMPONENTS_DIR}/transport_manager/src/bluetooth
)
endif()
-if (BUILD_USB_SUPPORT)
- list (APPEND SOURCES
- ${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(BUILD_USB_SUPPORT)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- list (APPEND SOURCES
- ${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
+ set(EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/usb/qnx
+ ${COMPONENTS_DIR}/transport_manager/src/usb/qnx
)
+
elseif(CMAKE_SYSTEM_NAME STREQUAL "QNX")
- list(APPEND SOURCES
- ${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
+ set(EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/usb/libusb
+ ${COMPONENTS_DIR}/transport_manager/src/usb/libusb
+ )
+ list(APPEND LIBRARIES
+ usbdi
)
endif()
-endif(BUILD_USB_SUPPORT)
-
+else()
+ list(APPEND EXCLUDE_PATHS
+ ${COMPONENTS_DIR}/transport_manager/include/transport_manager/usb
+ ${COMPONENTS_DIR}/transport_manager/src/usb
+ )
+endif()
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+if(NOT BUILD_TESTS)
+ list (APPEND EXCLUDE_PATH
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/iap2_emulation/iap2_transport_adapter.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/iap2_emulation/iap2_transport_adapter.cc
+ )
endif()
-add_library(${target} ${SOURCES})
-target_link_libraries(${target} ProtocolLibrary)
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
-if (BUILD_USB_SUPPORT)
- if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- target_link_libraries(${target} usbdi)
- endif()
-endif(BUILD_USB_SUPPORT)
+add_library("TransportManager" ${SOURCES})
+target_link_libraries("TransportManager" ${LIBRARIES})
if(ENABLE_LOG)
- target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
-endif()
-
-if (BUILD_BT_SUPPORT)
- target_link_libraries(${target} bluetooth)
-endif()
-
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ target_link_libraries("TransportManager" log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
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 cdc820e555..0574b2609f 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
@@ -95,4 +95,4 @@ class BluetoothConnectionFactory : public ServerConnectionFactory {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_CONNECTION_FACTORY_H_
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_CONNECTION_FACTORY_H_
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 5194873597..5532307216 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
@@ -122,4 +122,4 @@ class BluetoothDevice : public Device {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_DEVICE_H_
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_DEVICE_H_
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 764b64fef3..dc38a971f5 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
@@ -188,4 +188,4 @@ class BluetoothDeviceScanner : public DeviceScanner {
} // namespace transport_adapter
} // namespace transport_manager
-#endif /* BLUETOOTH_DEVICE_SCANNER_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_DEVICE_SCANNER_H_
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 3f524dac0f..c2a1be212a 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
@@ -2,7 +2,7 @@
* \file bluetooth_socket_connection.h
* \brief BluetoothSocketConnection class header file.
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -66,12 +66,13 @@ class BluetoothSocketConnection : public ThreadedSocketConnection {
protected:
/**
- * @brief Establish connection.
+ * @brief Check if we can start the connection attempt and establish
+ *connection status.
*
- * @param error Connection error.
+ * @param error contains information of any error that occurred during
+ *connection attempt.
*
- * @return True - connection established.
- * false - connection not established.
+ * @return result that states whether we successfully connected or not.
*/
virtual bool Establish(ConnectError** error);
};
@@ -79,4 +80,4 @@ class BluetoothSocketConnection : public ThreadedSocketConnection {
} // namespace transport_adapter
} // namespace transport_manager
-#endif /* BLUETOOTH_SOCKET_CONNECTION_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_SOCKET_CONNECTION_H_
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 82e85bac70..c4bd02d64b 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
@@ -33,8 +33,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_ADAPTER_H
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_ADAPTER_H
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_TRANSPORT_ADAPTER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_TRANSPORT_ADAPTER_H_
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
@@ -79,4 +79,4 @@ class BluetoothTransportAdapter : public TransportAdapterImpl {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_ADAPTER
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_BLUETOOTH_BLUETOOTH_TRANSPORT_ADAPTER_H_
diff --git a/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
new file mode 100644
index 0000000000..36a2b374dd
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/iap2_emulation/iap2_transport_adapter.h
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_H_
+
+#include "transport_manager/tcp/tcp_transport_adapter.h"
+#include "transport_manager/transport_manager_settings.h"
+#include "resumption/last_state.h"
+#include "utils/macro.h"
+#include "utils/threads/thread_delegate.h"
+
+namespace threads {
+class Thread;
+}
+
+namespace transport_manager {
+namespace transport_adapter {
+
+/**
+ * @brief The IAP2BluetoothEmulationTransportAdapter class implements iAP2
+ * Bluetooth transport over TCP
+ */
+class IAP2BluetoothEmulationTransportAdapter : public TcpTransportAdapter {
+ public:
+ /**
+ * @brief IAP2BluetoothEmulationTransportAdapter constructor
+ * @param port TCP port to listen on
+ * @param last_state LastState instance reference
+ * @param settings Settings reference
+ */
+ IAP2BluetoothEmulationTransportAdapter(
+ const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings);
+
+ /**
+ * @brief DeviceSwitched is called during switching from iAP2 Bluetooth to
+ * iAP2 USB transport.
+ * Currently there is no logic to switch back from iAP2 USB to iAP2 Bluetooth
+ * due to Bluetooth reconnection takes much time and this violates some Apple
+ * restrictions for iAP2 protocol, so if this method will be called - assert
+ * will be called
+ * @param device_handle Device handle of switched device
+ */
+ void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+
+ protected:
+ /**
+ * @brief GetDeviceType Provides SDL device type for transport adapter
+ * @return Device type
+ */
+ DeviceType GetDeviceType() const OVERRIDE;
+};
+
+/**
+ * @brief The IAP2USBEmulationTransportAdapter class implements emulation of
+ * iAP2 USB transport over TCP
+ */
+class IAP2USBEmulationTransportAdapter : public TcpTransportAdapter {
+ public:
+ /**
+ * @brief IAP2USBEmulationTransportAdapter constructor
+ * @param port TCP port to listen on
+ * @param last_state LastState instance reference
+ * @param settings Settings reference
+ */
+ IAP2USBEmulationTransportAdapter(const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings);
+
+ /**
+ * Destructor
+ */
+ ~IAP2USBEmulationTransportAdapter();
+
+ /**
+ * @brief DeviceSwitched is called during switching from iAP2 Bluetooth to
+ * iAP2 USB transport. Sends ACK signal for switching request.
+ * @param device_handle Device handle of switched device
+ */
+ void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+
+ protected:
+ /**
+ * @brief GetDeviceType Provides SDL device type for transport adapter
+ * @return Device type
+ */
+ DeviceType GetDeviceType() const OVERRIDE;
+
+ private:
+ /**
+ * @brief The IAPSignalHandlerDelegate class handles signals from the system
+ * to start transport switching flow
+ */
+ class IAPSignalHandlerDelegate : public threads::ThreadDelegate {
+ public:
+ /**
+ * @brief IAPSignalHandlerDelegate Constructor
+ * @param adapter Pointer to iAP2 USB adapter
+ */
+ IAPSignalHandlerDelegate(IAP2USBEmulationTransportAdapter& adapter);
+
+ /**
+ * @brief threadMain Main loop to track incoming signals
+ */
+ void threadMain() OVERRIDE;
+
+ /**
+ * @brief exitThreadMain Stops main loop
+ */
+ void exitThreadMain() OVERRIDE;
+
+ private:
+ /**
+ * @brief adapter_ Reference to owning adapter
+ */
+ IAP2USBEmulationTransportAdapter& adapter_;
+
+ /**
+ * @brief run_flag_ Flag defines whether main loop is active
+ */
+ bool run_flag_;
+
+ /**
+ * @brief in_ Input signals channel descriptor
+ */
+ int in_;
+ };
+
+ threads::Thread* signal_handler_;
+ int out_;
+};
+} // namespace transport_adapter
+} // namespace transport_manager
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_IAP2_EMULATION_IAP2_TRANSPORT_ADAPTER_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 7f238e91ec..da24a4d65d 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
@@ -2,7 +2,7 @@
* \file tcp_connection_factory.h
* \brief TcpConnectionFactory class header file.
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,11 +37,12 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_CONNECTION_FACTORY_H_
#include "transport_manager/transport_adapter/server_connection_factory.h"
-#include "transport_manager/transport_adapter/transport_adapter_controller.h"
namespace transport_manager {
namespace transport_adapter {
+class TransportAdapterController;
+
/**
* @brief Create connections.
*/
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 981ba9f6ee..7aa0b72687 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
@@ -66,6 +66,18 @@ class TcpDevice : public Device {
**/
TcpDevice(const in_addr_t& in_addr, const std::string& name);
+#if defined(BUILD_TESTS)
+ /**
+ * @brief TcpDevice
+ * @param in_addr IP address of device
+ * @param device_uid Unique device id
+ * @param transport_switch_id Id used for transport switching
+ */
+ TcpDevice(const in_addr_t& in_addr,
+ const std::string& device_uid,
+ const std::string& transport_switch_id);
+#endif
+
virtual ~TcpDevice();
/**
diff --git a/src/components/transport_manager/include/transport_manager/tcp/tcp_server_originated_socket_connection.h b/src/components/transport_manager/include/transport_manager/tcp/tcp_server_originated_socket_connection.h
new file mode 100644
index 0000000000..bf38fae37e
--- /dev/null
+++ b/src/components/transport_manager/include/transport_manager/tcp/tcp_server_originated_socket_connection.h
@@ -0,0 +1,84 @@
+/*
+ * \file tcp_server_originated_socket_connection.h
+ * \brief TcpServerOriginatedSocketConnection class header file.
+ *
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SERVER_ORIGINATED_SOCKET_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SERVER_ORIGINATED_SOCKET_CONNECTION_H_
+
+#include "transport_manager/transport_adapter/threaded_socket_connection.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+class TransportAdapterController;
+
+/**
+ * @brief Class responsible for communication over sockets that originated by
+ * server.
+ */
+class TcpServerOriginatedSocketConnection : public ThreadedSocketConnection {
+ public:
+ /**
+ * @brief Constructor.
+ *
+ * @param device_uid Device unique identifier.
+ * @param app_handle Handle of application.
+ * @param controller Pointer to the device adapter controller.
+ */
+ TcpServerOriginatedSocketConnection(const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller);
+
+ /**
+ * @brief Destructor.
+ */
+ virtual ~TcpServerOriginatedSocketConnection();
+
+ protected:
+ /**
+ * @brief Check if we can start the connection attempt and establish
+ *connection status.
+ *
+ * @param error contains information of any error that occurred during
+ *connection attempt.
+ *
+ * @return result that states whether we successfully connected or not.
+ */
+ virtual bool Establish(ConnectError** error);
+};
+
+} // namespace transport_adapter
+} // namespace transport_manager
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SERVER_ORIGINATED_SOCKET_CONNECTION_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 4d7901f4f0..a3e081e238 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
@@ -2,7 +2,7 @@
* \file tcp_socket_connection.h
* \brief TcpSocketConnection class header file.
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,11 +36,6 @@
#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SOCKET_CONNECTION_H_
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TCP_TCP_SOCKET_CONNECTION_H_
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-
#include "transport_manager/transport_adapter/threaded_socket_connection.h"
namespace transport_manager {
@@ -71,36 +66,13 @@ class TcpSocketConnection : public ThreadedSocketConnection {
protected:
/**
- * @brief
- */
- virtual bool Establish(ConnectError** error);
-};
-
-/**
- * @brief Class responsible for communication over sockets that originated by
- * server.
- */
-class TcpServerOiginatedSocketConnection : public ThreadedSocketConnection {
- public:
- /**
- * @brief Constructor.
+ * @brief Check if we can start the connection attempt and establish
+ *connection status.
*
- * @param device_uid Device unique identifier.
- * @param app_handle Handle of application.
- * @param controller Pointer to the device adapter controller.
- */
- TcpServerOiginatedSocketConnection(const DeviceUID& device_uid,
- const ApplicationHandle& app_handle,
- TransportAdapterController* controller);
-
- /**
- * @brief Destructor.
- */
- virtual ~TcpServerOiginatedSocketConnection();
-
- protected:
- /**
- * @brief
+ * @param error contains information of any error that occurred during
+ *connection attempt.
+ *
+ * @return result that states whether we successfully connected or not.
*/
virtual bool Establish(ConnectError** error);
};
diff --git a/src/components/transport_manager/include/transport_manager/telemetry_observer.h b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
index 1097feaecb..5e42289a03 100644
--- a/src/components/transport_manager/include/transport_manager/telemetry_observer.h
+++ b/src/components/transport_manager/include/transport_manager/telemetry_observer.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TIME_METRIC_OBSERVER_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TIME_METRIC_OBSERVER_H_
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TELEMETRY_OBSERVER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TELEMETRY_OBSERVER_H_
#include "transport_manager/common.h"
#include "protocol/raw_message.h"
@@ -52,4 +52,4 @@ class TMTelemetryObserver {
virtual ~TMTelemetryObserver() {}
};
} // transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TIME_METRIC_OBSERVER_H_
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TELEMETRY_OBSERVER_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 8df2c4d299..f905e11c43 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
@@ -84,4 +84,4 @@ class ClientConnectionListener {
} // namespace transport_adapter
} // namespace transport_manager
-#endif /* CLIENT_CONNECTION_LISTENER_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CLIENT_CONNECTION_LISTENER_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 6e58f692a9..ae399fe210 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
@@ -82,4 +82,4 @@ class DeviceScanner {
} // namespace transport_adapter
} // namespace transport_manager
-#endif /* DEVICE_SCANNER_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_DEVICE_SCANNER_H_
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 3cd93e1316..5013117f27 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
@@ -86,4 +86,4 @@ class ServerConnectionFactory {
} // namespace transport_adapter
} // namespace transport_manager
-#endif /* SERVER_CONNECTION_FACTORY_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_SERVER_CONNECTION_FACTORY_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/threaded_socket_connection.h
index ab0c5cbf85..3792b94d7c 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,7 +1,7 @@
/*
* \file threaded_socket_connection.h
* \brief Header for classes responsible for communication over sockets.
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -40,6 +40,7 @@
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/common.h"
+#include "utils/atomic_object.h"
#include "utils/threads/thread_delegate.h"
#include "utils/lock.h"
@@ -88,6 +89,15 @@ class ThreadedSocketConnection : public Connection {
bool IsFramesToSendQueueEmpty() const;
/**
+ * @brief Check if connection has been terminated.
+ *
+ * @return Information which states that connection was marked as terminated.
+ */
+ bool IsConnectionTerminated() const {
+ return terminate_flag_;
+ }
+
+ /**
* @brief Set variable that hold socket No.
*/
void set_socket(int socket) {
@@ -111,6 +121,15 @@ class ThreadedSocketConnection : public Connection {
*/
virtual ~ThreadedSocketConnection();
+ /**
+ * @brief Check if we can start the connection attempt and establish
+ *connection status.
+ *
+ * @param error contains information of any error that occurred during
+ *connection attempt.
+ *
+ * @return result that states whether we successfully connected or not.
+ */
virtual bool Establish(ConnectError** error) = 0;
/**
@@ -134,6 +153,25 @@ class ThreadedSocketConnection : public Connection {
return app_handle_;
}
+ /**
+ * @brief Get variable that hold socket No.
+ */
+ int get_socket() const {
+ return socket_;
+ }
+
+ /**
+ * @brief Checks current socket value, sends shutdown and close commands for
+ * this socket and clear current socket value.
+ */
+ void ShutdownAndCloseSocket();
+
+ /**
+ * @brief This method will ensure that thread has finished running and then it
+ * will delete this thread.
+ */
+ void StopAndJoinThread();
+
private:
class SocketConnectionDelegate : public threads::ThreadDelegate {
public:
@@ -163,7 +201,7 @@ class ThreadedSocketConnection : public Connection {
FrameQueue frames_to_send_;
mutable sync_primitives::Lock frames_to_send_mutex_;
- int socket_;
+ sync_primitives::atomic_int socket_;
bool terminate_flag_;
bool unexpected_disconnect_;
const DeviceUID device_uid_;
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
index d4c97d5233..2b1ada79ad 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h
@@ -400,6 +400,26 @@ class TransportAdapterImpl : public TransportAdapter,
const DataSendError& error) OVERRIDE;
/**
+ * @brief DoTransportSwitch notifies listeners of transport adapter events
+ * that transport switching is requested by system
+ */
+ void DoTransportSwitch() const OVERRIDE;
+
+ /**
+ * @brief DeviceSwitched Notifies system on successful transport switch for
+ * particular device
+ * @param device_handle Device handle of switched device
+ */
+ void DeviceSwitched(const DeviceUID& device_handle) OVERRIDE;
+
+ /**
+ * @brief GetSwitchableDevices Provides list of devices able to switch their
+ * transport (e.g. iAP2 Bluetooth to iAP2 USB).
+ * @return
+ */
+ SwitchableDevices GetSwitchableDevices() const OVERRIDE;
+
+ /**
* @brief Return name of device.
*
* @param device_id Device unique identifier.
@@ -409,6 +429,13 @@ class TransportAdapterImpl : public TransportAdapter,
std::string DeviceName(const DeviceUID& device_id) const OVERRIDE;
/**
+ * @brief StopDevice looks for specific device in devices list and calls
+ * Stop() interface of that device
+ * @param device_id unique device identifier that has to be stopped.
+ */
+ void StopDevice(const DeviceUID& device_id) const OVERRIDE;
+
+ /**
* @brief Allows to obtain connection type used by device.
* @return connection type.
*/
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
index 0a1eeb6b4a..424fa53dea 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener.h
@@ -146,6 +146,7 @@ class TransportAdapterListener {
const DeviceUID& device_handle,
const ApplicationHandle& app_handle,
const CommunicationError& error) = 0;
+
/**
* @brief Search specified device adapter in the container of shared pointers
*to device adapters to be sure it is available,
@@ -269,6 +270,13 @@ class TransportAdapterListener {
virtual void OnCommunicationError(const TransportAdapter* transport_adapter,
const DeviceUID& device_handle,
const ApplicationHandle& app_handle) = 0;
+ /**
+ * @brief OnTransportSwitchRequested notifies on received signal to start
+ * transport switching flow (at the moment Bluetooth to USB only)
+ * @param transport_adapter Transport adapter who received the signal
+ */
+ virtual void OnTransportSwitchRequested(
+ const TransportAdapter* transport_adapter) = 0;
};
} // transport_adapter namespace
diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
index a0daa7b594..8a8031c3cf 100644
--- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
+++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_listener_impl.h
@@ -49,26 +49,6 @@ class TransportAdapterListenerImpl
: public transport_adapter::TransportAdapterListener {
public:
/**
- * @enum Available types of events.
- */
- enum EventTypeEnum {
- ON_SEARCH_DONE = 0,
- ON_SEARCH_FAIL,
- ON_DEVICE_LIST_UPDATED,
- ON_FIND_NEW_APPLICATIONS_REQUEST,
- ON_CONNECT_DONE,
- ON_CONNECT_FAIL,
- ON_DISCONNECT_DONE,
- ON_DISCONNECT_FAIL,
- ON_SEND_DONE,
- ON_SEND_FAIL,
- ON_RECEIVED_DONE,
- ON_RECEIVED_FAIL,
- ON_COMMUNICATION_ERROR,
- ON_UNEXPECTED_DISCONNECT
- };
-
- /**
* @brief Constructor.
*
* @param manager Pointer to the transport manager class.
@@ -283,7 +263,14 @@ class TransportAdapterListenerImpl
*/
virtual void OnCommunicationError(const TransportAdapter* adapter,
const DeviceUID& device,
- const ApplicationHandle& app_id);
+ const ApplicationHandle& app_id) OVERRIDE;
+
+ /**
+ * @brief OnTransportSwitchRequested notifies on received signal to start
+ * transport switching flow (at the moment Bluetooth to USB only)
+ * @param transport_adapter Transport adapter who received the signal
+ */
+ void OnTransportSwitchRequested(const TransportAdapter* adapter) OVERRIDE;
private:
TransportManager* transport_manager_;
@@ -291,4 +278,4 @@ class TransportAdapterListenerImpl
};
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_transport_adapter_transport_adapter_LISTENER_IMPL_H
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_LISTENER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_default.h b/src/components/transport_manager/include/transport_manager/transport_manager_default.h
index e89562a28d..8039f9c985 100644
--- a/src/components/transport_manager/include/transport_manager/transport_manager_default.h
+++ b/src/components/transport_manager/include/transport_manager/transport_manager_default.h
@@ -67,4 +67,4 @@ class TransportManagerDefault : public TransportManagerImpl {
};
}
-#endif /* TRANSPORT_MANAGER_DEFAULT_H_ */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_DEFAULT_H_
diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h
index 4dd74086be..eaa71ce3bb 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
@@ -39,6 +39,8 @@
#include <vector>
#include <utility>
#include <algorithm>
+#include <tuple>
+#include <functional>
#include "utils/timer.h"
#include "utils/timer_task_impl.h"
@@ -63,6 +65,7 @@ typedef threads::MessageLoopThread<std::queue<protocol_handler::RawMessagePtr> >
typedef threads::MessageLoopThread<std::queue<TransportAdapterEvent> >
TransportAdapterEventLoopThread;
typedef utils::SharedPtr<timer::Timer> TimerSPtr;
+typedef std::map<DeviceUID, TransportAdapter*> DeviceToAdapterMap;
/**
* @brief Implementation of transport manager.s
@@ -94,6 +97,7 @@ class TransportManagerImpl
bool shutdown_;
DeviceHandle device_handle_;
int messages_count;
+ bool active_;
ConnectionInternal(TransportManagerImpl* transport_manager,
TransportAdapter* transport_adapter,
@@ -241,11 +245,20 @@ class TransportManagerImpl
int Visibility(const bool& on_off) const OVERRIDE;
/**
+ * DEPRECATED
+ * Must be moved under 'private' section
* @brief Updates total device list with info from specific transport adapter.
* @param ta Transport adapter
*/
void UpdateDeviceList(TransportAdapter* ta);
+ /**
+ * @brief OnDeviceListUpdated updates device list and sends appropriate
+ * notifications to listeners in case of something is changed
+ * @param ta Transport adapter to check for updated devices state
+ */
+ void OnDeviceListUpdated(TransportAdapter* ta);
+
#ifdef TELEMETRY_MONITOR
/**
* @brief Setup observer for time metric.
@@ -307,44 +320,53 @@ class TransportManagerImpl
private:
/**
- * @brief Structure that contains conversion functions (Device ID -> Device
- * Handle; Device Handle -> Device ID)
- */
+ * @brief Structure that contains conversion functions (Device ID -> Device
+ * Handle; Device Handle -> Device ID)
+ */
struct Handle2GUIDConverter {
- typedef std::vector<DeviceUID> ConversionTable;
-
- DeviceHandle UidToHandle(const DeviceUID& dev_uid) {
- bool is_new = true;
- return UidToHandle(dev_uid, is_new);
- }
-
- DeviceHandle UidToHandle(const DeviceUID& dev_uid, bool& is_new) {
- {
- sync_primitives::AutoReadLock lock(conversion_table_lock);
- ConversionTable::iterator it = std::find(
- conversion_table_.begin(), conversion_table_.end(), dev_uid);
- if (it != conversion_table_.end()) {
- is_new = false;
- return std::distance(conversion_table_.begin(), it) +
- 1; // handle begin since 1 (one)
- }
+ /**
+ * @brief ConversionTable Records uid/connection type/handle
+ */
+ typedef std::vector<std::tuple<DeviceUID, std::string, DeviceHandle> >
+ ConversionTable;
+
+ /**
+ * @brief The HandleFinder struct helper to search for hanlde in coversion
+ * table
+ */
+ struct HandleFinder {
+ explicit HandleFinder(const DeviceHandle& look_for)
+ : look_for_(look_for) {}
+
+ bool operator()(const ConversionTable::value_type value) const {
+ return look_for_ == std::get<2>(value);
}
- is_new = true;
- sync_primitives::AutoWriteLock lock(conversion_table_lock);
- conversion_table_.push_back(dev_uid);
- return conversion_table_.size(); // handle begin since 1 (one)
- }
-
- DeviceUID HandleToUid(const DeviceHandle handle) {
- sync_primitives::AutoReadLock lock(conversion_table_lock);
- if (handle == 0 || handle > conversion_table_.size()) {
- return DeviceUID();
- }
- return conversion_table_[handle - 1]; // handle begin since 1 (one)
- }
+ const DeviceHandle look_for_;
+ };
+
+ /**
+ * @brief UidToHandle Converts UID to handle considering connection type as
+ * UID may be the same in case device is connected over Bluetooth/USB (e.g.
+ * for IAP2)
+ * @param dev_uid Device UID
+ * @param connection_type Connection type
+ * @return Device handle
+ */
+ DeviceHandle UidToHandle(const DeviceUID& dev_uid,
+ const std::string& connection_type);
+
+ /**
+ * @brief HandleToUid Converts handle to device UID
+ * @param handle Device handle
+ * @return Device UID
+ */
+ DeviceUID HandleToUid(const DeviceHandle handle);
+
+ private:
ConversionTable conversion_table_;
- sync_primitives::RWLock conversion_table_lock;
+ std::hash<std::string> hash_function_;
+ sync_primitives::RWLock conversion_table_lock_;
};
/**
@@ -353,6 +375,15 @@ class TransportManagerImpl
*/
Handle2GUIDConverter converter_;
+#ifdef BUILD_TESTS
+ public:
+ Handle2GUIDConverter& get_converter() {
+ return converter_;
+ }
+
+ private:
+#endif // BUILD_TESTS
+
explicit TransportManagerImpl(const TransportManagerImpl&);
int connection_id_counter_;
sync_primitives::RWLock connections_lock_;
@@ -372,13 +403,70 @@ class TransportManagerImpl
sync_primitives::RWLock device_list_lock_;
DeviceInfoList device_list_;
+ timer::Timer device_switch_timer_;
+ sync_primitives::Lock device_lock_;
+ DeviceUID device_to_reconnect_;
+
+ /**
+ * @brief Adds new incoming connection to connections list
+ * @param c New connection
+ */
void AddConnection(const ConnectionInternal& c);
+
+ /**
+ * @brief Removes connection from connections list
+ * @param id Identifier of connection to be removed
+ * @param transport_adapter Pointer to transport adapter
+ * that holds connection
+ */
void RemoveConnection(const uint32_t id,
transport_adapter::TransportAdapter* transport_adapter);
+
+ /**
+ * @brief Deactivates all connections related to certain device
+ * @param device_uid Device unique identifier
+ */
+ void DeactivateDeviceConnections(const DeviceUID& device_uid);
+ /**
+ * @brief Returns connection from connections list by connection identifier
+ * @param id Connection identifier
+ * @return Pointer to connection or NULL if connection could not be found
+ */
ConnectionInternal* GetConnection(const ConnectionUID id);
+
+ /**
+ * @brief Returns connection from connections list by device unique id
+ * and application handle
+ * @param device Device unique identifier
+ * @param application Application handle
+ * @return Pointer to connection or NULL if connection could not be found
+ */
ConnectionInternal* GetConnection(const DeviceUID& device,
const ApplicationHandle& application);
+ /**
+ * @brief Returns active connection from connections list by device unique
+ * id
+ * and application handle
+ * (this method returns only active connections as opposed to previous one)
+ * @param device Device unique identifier
+ * @param application Application handle
+ * @return Pointer to connection or NULL if connection could not be found
+ */
+ ConnectionInternal* GetActiveConnection(const DeviceUID& device,
+ const ApplicationHandle& application);
+
+ /**
+ * @brief TryDeviceSwitch in case USB device is connected and there is
+ * appropriate Bluetooth device with same UUID stops Bluetooth device and
+ * initiates switching sequence for upper layers. Also starts timer to wait
+ * for sequence to complete.
+ * @param ta Transport adapter having device to try switching sequence
+ * At the moment implementation implies only IAP2-Bluetooth to IAP2-USB
+ * switching
+ */
+ void TryDeviceSwitch(TransportAdapter* ta);
+
void AddDataToContainer(
ConnectionUID id,
std::map<ConnectionUID, std::pair<unsigned int, unsigned char*> >&
@@ -394,11 +482,25 @@ class TransportManagerImpl
unsigned int frame_size,
unsigned char** frame);
- void OnDeviceListUpdated(TransportAdapter* ta);
void DisconnectAllDevices();
void TerminateAllAdapters();
int InitAllAdapters();
static Connection convert(const ConnectionInternal& p);
+
+ /**
+ * @brief ReconnectionTimeout notifies upper layers on switching sequence
+ * timeout expiration
+ */
+ void ReconnectionTimeout();
+
+ /**
+ * @brief UpdateDeviceMapping handles internal device-to-adapter mapping,
+ * performs its update on adding/removal of devices. Also used by IAP2
+ * switching flow to substitute BT with USB transport
+ * @param ta Pointer to transport adapter
+ * @return True if mapping has been updated, otherwise - false
+ */
+ bool UpdateDeviceMapping(TransportAdapter* ta);
}; // class TransportManagerImpl
} // namespace transport_manager
#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_MANAGER_IMPL_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h b/src/components/transport_manager/include/transport_manager/usb/libusb/platform_usb_device.h
index 1aa6881b38..baec1938b1 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
@@ -37,7 +37,7 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_LIBUSB_PLATFORM_USB_DEVICE_H_
#include <string>
-#include <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
namespace transport_manager {
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
index bad1cd7117..5f6bd40957 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
@@ -80,6 +80,7 @@ class UsbConnection : public Connection {
uint8_t out_endpoint_;
uint16_t out_endpoint_max_packet_size_;
unsigned char* in_buffer_;
+ uint16_t in_buffer_size_;
libusb_transfer* in_transfer_;
libusb_transfer* out_transfer_;
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 b2ebd3a977..bed631ea2e 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
@@ -36,7 +36,7 @@
#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 <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
#include "transport_manager/transport_adapter/transport_adapter.h"
#include "transport_manager/usb/usb_control_transfer.h"
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 92a813ed7c..ee7039efde 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
@@ -62,4 +62,4 @@ class UsbAoaAdapter : public TransportAdapterImpl {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_AOA_ADAPTER
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_AOA_ADAPTER_H_
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 ebd25bd37b..e3d50905d5 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
@@ -64,4 +64,4 @@ class UsbConnectionFactory : public ServerConnectionFactory {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONNECTION_FACTORY_H_
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_CONNECTION_FACTORY_H_
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 a3597ff3d4..850902bea3 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
@@ -33,8 +33,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONTROL_TRANSFER_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONTROL_TRANSFER_H_
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_CONTROL_TRANSFER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_CONTROL_TRANSFER_H_
namespace transport_manager {
@@ -103,4 +103,4 @@ class UsbControlTransferSequence {
} // namespace
} // namespace
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_CONTROL_TRANSFER_H_
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_CONTROL_TRANSFER_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device.h b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
index fdcfb6e155..8ca1a32a28 100644
--- a/src/components/transport_manager/include/transport_manager/usb/usb_device.h
+++ b/src/components/transport_manager/include/transport_manager/usb/usb_device.h
@@ -74,4 +74,4 @@ class UsbDevice : public Device {
} // namespace transport_adapter
} // namespace transport_manager
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE_H_
diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h b/src/components/transport_manager/include/transport_manager/usb/usb_device_scanner.h
index 9efb7ba58d..a6065de2b2 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
@@ -33,8 +33,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_DEVICE_SCANNER_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_DEVICE_SCANNER_H_
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE_SCANNER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE_SCANNER_H_
#include <list>
@@ -74,4 +74,4 @@ class UsbDeviceScanner : public DeviceScanner, public UsbDeviceListener {
} // namespace
} // namespace
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_DEVICE_SCANNER
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_USB_USB_DEVICE_SCANNER_H_
diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
index bb27493701..0d8a77c88f 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc
@@ -2,7 +2,7 @@
* \file bluetooth_connection_factory.cc
* \brief BluetoothConnectionFactory class source file.
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,11 +33,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "transport_manager/bluetooth/bluetooth_connection_factory.h"
#include "transport_manager/bluetooth/bluetooth_socket_connection.h"
-
#include "utils/logger.h"
+#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -54,17 +54,16 @@ TransportAdapter::Error BluetoothConnectionFactory::Init() {
TransportAdapter::Error BluetoothConnectionFactory::CreateConnection(
const DeviceUID& device_uid, const ApplicationHandle& app_handle) {
- LOG4CXX_TRACE(logger_,
- "enter. device_uid: " << &device_uid
- << ", app_handle: " << &app_handle);
- BluetoothSocketConnection* connection(
- new BluetoothSocketConnection(device_uid, app_handle, controller_));
+ LOG4CXX_AUTO_TRACE(logger_);
+ utils::SharedPtr<BluetoothSocketConnection> connection =
+ utils::MakeShared<BluetoothSocketConnection>(
+ device_uid, app_handle, controller_);
+ controller_->ConnectionCreated(connection, device_uid, app_handle);
TransportAdapter::Error error = connection->Start();
if (TransportAdapter::OK != error) {
- LOG4CXX_ERROR(logger_, "connection::Start() failed");
- delete connection;
+ LOG4CXX_ERROR(logger_,
+ "Bluetooth connection::Start() failed with error: " << error);
}
- LOG4CXX_TRACE(logger_, "exit with error: " << error);
return error;
}
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 85e6dc3f96..743c95f2e6 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc
@@ -255,9 +255,11 @@ void BluetoothDeviceScanner::CheckSDLServiceOnDevices(
if (hci_read_remote_name_ret != 0) {
LOG4CXX_ERROR_WITH_ERRNO(logger_, "hci_read_remote_name failed");
+ int name_len = sizeof(deviceName) / sizeof(deviceName[0]);
strncpy(deviceName,
BluetoothDevice::GetUniqueDeviceId(bd_address).c_str(),
- sizeof(deviceName) / sizeof(deviceName[0]));
+ name_len - 1);
+ deviceName[name_len - 1] = '\0';
}
Device* bluetooth_device =
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 5f1eed4c5e..b4370e4b12 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_socket_connection.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,7 +56,9 @@ BluetoothSocketConnection::BluetoothSocketConnection(
TransportAdapterController* controller)
: ThreadedSocketConnection(device_uid, app_handle, controller) {}
-BluetoothSocketConnection::~BluetoothSocketConnection() {}
+BluetoothSocketConnection::~BluetoothSocketConnection() {
+ StopAndJoinThread();
+}
bool BluetoothSocketConnection::Establish(ConnectError** error) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -104,14 +106,12 @@ bool BluetoothSocketConnection::Establish(ConnectError** error) {
if (0 == connect_status) {
LOG4CXX_DEBUG(logger_, "rfcomm Connect ok");
break;
- }
- if (errno != 111 && errno != 104) {
- LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno);
- break;
- }
- if (errno) {
- LOG4CXX_DEBUG(logger_, "rfcomm Connect errno " << errno);
- close(rfcomm_socket);
+ } else { // If connect_status is not 0, an errno is returned
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "rfcomm Connect failed");
+ close(rfcomm_socket); // Always close the socket upon error
+ if (errno != ECONNREFUSED && errno != ECONNRESET) {
+ break;
+ }
}
sleep(2);
} while (--attempts > 0);
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 a82c40ca15..0f83f32c60 100644
--- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
+++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc
@@ -2,7 +2,7 @@
* \file bluetooth_transport_adapter.cc
* \brief BluetoothTransportAdapter class source file.
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -111,7 +111,8 @@ void BluetoothTransportAdapter::Store() const {
}
}
bluetooth_adapter_dictionary["devices"] = devices_dictionary;
- last_state().dictionary["TransportManager"]["BluetoothAdapter"] =
+ Json::Value& dictionary = last_state().get_dictionary();
+ dictionary["TransportManager"]["BluetoothAdapter"] =
bluetooth_adapter_dictionary;
LOG4CXX_TRACE(logger_, "exit");
}
@@ -120,7 +121,7 @@ bool BluetoothTransportAdapter::Restore() {
LOG4CXX_TRACE(logger_, "enter");
bool errors_occured = false;
const Json::Value bluetooth_adapter_dictionary =
- last_state().dictionary["TransportManager"]["BluetoothAdapter"];
+ last_state().get_dictionary()["TransportManager"]["BluetoothAdapter"];
const Json::Value devices_dictionary =
bluetooth_adapter_dictionary["devices"];
for (Json::Value::const_iterator i = devices_dictionary.begin();
diff --git a/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
new file mode 100644
index 0000000000..6b7d44ea8d
--- /dev/null
+++ b/src/components/transport_manager/src/iap2_emulation/iap2_transport_adapter.cc
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/iap2_emulation/iap2_transport_adapter.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "utils/threads/thread.h"
+#include "utils/file_system.h"
+
+namespace {
+static const mode_t mode = 0666;
+static const auto in_signals_channel = "iap_signals_in";
+static const auto out_signals_channel = "iap_signals_out";
+} // namespace
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "IAP2Emulation");
+
+IAP2BluetoothEmulationTransportAdapter::IAP2BluetoothEmulationTransportAdapter(
+ const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings)
+ : TcpTransportAdapter(port, last_state, settings) {}
+
+void IAP2BluetoothEmulationTransportAdapter::DeviceSwitched(
+ const DeviceUID& device_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ UNUSED(device_handle);
+ DCHECK(!"Switching for iAP2 Bluetooth is not supported.");
+}
+
+DeviceType IAP2BluetoothEmulationTransportAdapter::GetDeviceType() const {
+ return IOS_BT;
+}
+
+IAP2USBEmulationTransportAdapter::IAP2USBEmulationTransportAdapter(
+ const uint16_t port,
+ resumption::LastState& last_state,
+ const TransportManagerSettings& settings)
+ : TcpTransportAdapter(port, last_state, settings), out_(0) {
+ auto delegate = new IAPSignalHandlerDelegate(*this);
+ signal_handler_ = threads::CreateThread("iAP signal handler", delegate);
+ signal_handler_->start();
+ const auto result = mkfifo(out_signals_channel, mode);
+ LOG4CXX_DEBUG(logger_, "Out signals channel creation result: " << result);
+}
+
+IAP2USBEmulationTransportAdapter::~IAP2USBEmulationTransportAdapter() {
+ signal_handler_->join();
+ auto delegate = signal_handler_->delegate();
+ signal_handler_->set_delegate(NULL);
+ delete delegate;
+ threads::DeleteThread(signal_handler_);
+ LOG4CXX_DEBUG(logger_, "Out close result: " << close(out_));
+ LOG4CXX_DEBUG(logger_, "Out unlink result: " << unlink(out_signals_channel));
+}
+
+void IAP2USBEmulationTransportAdapter::DeviceSwitched(
+ const DeviceUID& device_handle) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ UNUSED(device_handle);
+ const auto switch_signal_ack = std::string("SDL_TRANSPORT_SWITCH_ACK\n");
+
+ auto out_ = open(out_signals_channel, O_WRONLY);
+ LOG4CXX_DEBUG(logger_, "Out channel descriptor: " << out_);
+
+ if (out_ < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to open out signals channel");
+ return;
+ }
+
+ const auto bytes =
+ write(out_, switch_signal_ack.c_str(), switch_signal_ack.size());
+ UNUSED(bytes);
+ LOG4CXX_DEBUG(logger_, "Written bytes to out: " << bytes);
+
+ LOG4CXX_DEBUG(logger_, "Switching signal ACK is sent");
+ LOG4CXX_DEBUG(logger_, "iAP2 USB device is switched with iAP2 Bluetooth");
+ close(out_);
+}
+
+DeviceType IAP2USBEmulationTransportAdapter::GetDeviceType() const {
+ return IOS_USB;
+}
+
+IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::
+ IAPSignalHandlerDelegate(IAP2USBEmulationTransportAdapter& adapter)
+ : adapter_(adapter), run_flag_(true), in_(0) {
+ const auto result = mkfifo(in_signals_channel, mode);
+ LOG4CXX_DEBUG(logger_, "In signals channel creation result: " << result);
+}
+
+void IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::threadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Signal handling is started");
+ const auto switch_signal = "SDL_TRANSPORT_SWITCH";
+ LOG4CXX_DEBUG(logger_, "Waiting for signal: " << switch_signal);
+
+ in_ = open(in_signals_channel, O_RDONLY);
+ LOG4CXX_DEBUG(logger_, "In channel descriptor: " << in_);
+ if (in_ < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to open in signals channel");
+ return;
+ }
+
+ const auto size = 32;
+ while (run_flag_) {
+ char buffer[size];
+ auto bytes = read(in_, &buffer, size - 1);
+ if (0 == bytes) {
+ continue;
+ }
+ if (-1 == bytes) {
+ LOG4CXX_DEBUG(logger_, "Error during input pipe read");
+ break;
+ }
+ LOG4CXX_DEBUG(logger_, "Read in bytes: " << bytes);
+ buffer[bytes] = '\0';
+ std::string str(buffer);
+ if (std::string::npos != str.find(switch_signal)) {
+ LOG4CXX_DEBUG(logger_, "Switch signal received.");
+ adapter_.DoTransportSwitch();
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_, "In close result: " << close(in_));
+ LOG4CXX_DEBUG(logger_, "In unlink result: " << unlink(in_signals_channel));
+}
+
+void IAP2USBEmulationTransportAdapter::IAPSignalHandlerDelegate::
+ exitThreadMain() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Stopping signal handling.");
+ run_flag_ = false;
+ ThreadDelegate::exitThreadMain();
+}
+}
+} // namespace transport_manager::transport_adapter
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 a075b1afb7..207149eb8c 100644
--- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc
+++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -53,6 +53,7 @@
#include <sstream>
#include "utils/logger.h"
+#include "utils/make_shared.h"
#include "utils/threads/thread.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/tcp/tcp_device.h"
@@ -92,7 +93,10 @@ TransportAdapter::Error TcpClientListener::Init() {
server_address.sin_addr.s_addr = INADDR_ANY;
int optval = 1;
- setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
+ if (0 !=
+ setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_REUSEADDR failed");
+ }
if (bind(socket_,
reinterpret_cast<sockaddr*>(&server_address),
@@ -145,12 +149,28 @@ void SetKeepaliveOptions(const int fd) {
int keepintvl = 1;
#ifdef __linux__
int user_timeout = 7000; // milliseconds
- setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes));
- setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle));
- setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt));
- setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl));
- setsockopt(
- fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &user_timeout, sizeof(user_timeout));
+ if (0 != setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &yes, sizeof(yes))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt SO_KEEPALIVE failed");
+ }
+ if (0 !=
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPIDLE failed");
+ }
+ if (0 !=
+ setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPCNT failed");
+ }
+ if (0 != setsockopt(
+ fd, IPPROTO_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_KEEPINTVL failed");
+ }
+ if (0 != setsockopt(fd,
+ IPPROTO_TCP,
+ TCP_USER_TIMEOUT,
+ &user_timeout,
+ sizeof(user_timeout))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "setsockopt TCP_USER_TIMEOUT failed");
+ }
#elif defined(__QNX__) // __linux__
// TODO(KKolodiy): Out of order!
const int kMidLength = 4;
@@ -210,24 +230,38 @@ void TcpClientListener::Loop() {
inet_ntoa(client_address.sin_addr),
sizeof(device_name) / sizeof(device_name[0]));
LOG4CXX_INFO(logger_, "Connected client " << device_name);
+ LOG4CXX_INFO(logger_, "Port is: " << port_);
if (enable_keepalive_) {
SetKeepaliveOptions(connection_fd);
}
+ const auto device_uid =
+ device_name + std::string(":") + std::to_string(port_);
+
+#if defined(BUILD_TESTS)
+ TcpDevice* tcp_device =
+ new TcpDevice(client_address.sin_addr.s_addr, device_uid, device_name);
+#else
TcpDevice* tcp_device =
- new TcpDevice(client_address.sin_addr.s_addr, device_name);
+ new TcpDevice(client_address.sin_addr.s_addr, device_uid);
+#endif // BUILD_TESTS
+
DeviceSptr device = controller_->AddDevice(tcp_device);
tcp_device = static_cast<TcpDevice*>(device.get());
const ApplicationHandle app_handle =
tcp_device->AddIncomingApplication(connection_fd);
- TcpSocketConnection* connection(new TcpSocketConnection(
- device->unique_device_id(), app_handle, controller_));
+ utils::SharedPtr<TcpSocketConnection> connection =
+ utils::MakeShared<TcpSocketConnection>(
+ device->unique_device_id(), app_handle, controller_);
+ controller_->ConnectionCreated(
+ connection, device->unique_device_id(), app_handle);
connection->set_socket(connection_fd);
const TransportAdapter::Error error = connection->Start();
- if (error != TransportAdapter::OK) {
- delete connection;
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(logger_,
+ "TCP connection::Start() failed with error: " << error);
}
}
}
@@ -241,10 +275,16 @@ void TcpClientListener::StopLoop() {
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);
+ if (0 != connect(byesocket,
+ reinterpret_cast<sockaddr*>(&server_address),
+ sizeof(server_address))) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to connect byesocket");
+ } else {
+ // Can only shutdown socket if connected
+ if (0 != shutdown(byesocket, SHUT_RDWR)) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Failed to shutdown byesocket");
+ }
+ }
close(byesocket);
}
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 5b1e9af6cb..114425076a 100644
--- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
+++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,10 +30,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
#include "transport_manager/tcp/tcp_connection_factory.h"
-#include "transport_manager/tcp/tcp_socket_connection.h"
+#include "transport_manager/tcp/tcp_server_originated_socket_connection.h"
#include "utils/logger.h"
+#include "utils/make_shared.h"
namespace transport_manager {
namespace transport_adapter {
@@ -54,16 +56,17 @@ TransportAdapter::Error TcpConnectionFactory::CreateConnection(
LOG4CXX_DEBUG(logger_,
"DeviceUID: " << &device_uid
<< ", ApplicationHandle: " << &app_handle);
- TcpServerOiginatedSocketConnection* connection(
- new TcpServerOiginatedSocketConnection(
- device_uid, app_handle, controller_));
- 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;
+ utils::SharedPtr<TcpServerOriginatedSocketConnection> connection =
+ utils::MakeShared<TcpServerOriginatedSocketConnection>(
+ device_uid, app_handle, controller_);
+ controller_->ConnectionCreated(connection, device_uid, app_handle);
+ const TransportAdapter::Error error = connection->Start();
+ if (TransportAdapter::OK != error) {
+ LOG4CXX_ERROR(logger_,
+ "TCP ServerOriginated connection::Start() failed 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 d3f132759a..dbcb5d38cb 100644
--- a/src/components/transport_manager/src/tcp/tcp_device.cc
+++ b/src/components/transport_manager/src/tcp/tcp_device.cc
@@ -46,6 +46,23 @@ TcpDevice::TcpDevice(const in_addr_t& in_addr, const std::string& name)
LOG4CXX_AUTO_TRACE(logger_);
}
+#if defined(BUILD_TESTS)
+TcpDevice::TcpDevice(const in_addr_t& in_addr,
+ const std::string& device_uid,
+ const std::string& transport_switch_id)
+ : Device(device_uid, device_uid, transport_switch_id)
+ , applications_mutex_()
+ , in_addr_(in_addr)
+ , last_handle_(0) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "Device created with transport switch emulation support.");
+ LOG4CXX_DEBUG(logger_,
+ "Device parameters: " << device_uid << " / "
+ << transport_switch_id);
+}
+#endif // BUILD_TESTS
+
bool TcpDevice::IsSameAs(const Device* other) const {
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Device: " << other);
diff --git a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
new file mode 100644
index 0000000000..516f2d3ec4
--- /dev/null
+++ b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc
@@ -0,0 +1,111 @@
+/*
+ *
+ * Copyright (c) 2017, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "transport_manager/tcp/tcp_server_originated_socket_connection.h"
+#include "transport_manager/tcp/tcp_device.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+#include "utils/logger.h"
+
+namespace transport_manager {
+namespace transport_adapter {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
+
+TcpServerOriginatedSocketConnection::TcpServerOriginatedSocketConnection(
+ const DeviceUID& device_uid,
+ const ApplicationHandle& app_handle,
+ TransportAdapterController* controller)
+ : ThreadedSocketConnection(device_uid, app_handle, controller) {}
+
+TcpServerOriginatedSocketConnection::~TcpServerOriginatedSocketConnection() {
+ StopAndJoinThread();
+}
+
+bool TcpServerOriginatedSocketConnection::Establish(ConnectError** 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();
+ return false;
+ }
+ TcpDevice* tcp_device = static_cast<TcpDevice*>(device.get());
+
+ const int port = tcp_device->GetApplicationPort(application_handle());
+ if (-1 == port) {
+ LOG4CXX_ERROR(logger_,
+ "Application port for " << application_handle()
+ << " not found");
+ *error = new ConnectError();
+ return false;
+ }
+
+ if (IsConnectionTerminated()) {
+ LOG4CXX_ERROR(
+ logger_,
+ "Connection is already terminated. Socket will not be created");
+ *error = new ConnectError();
+ return false;
+ }
+
+ const int socket = ::socket(AF_INET, SOCK_STREAM, 0);
+ if (socket < 0) {
+ LOG4CXX_ERROR(logger_, "Failed to create socket");
+ *error = new ConnectError();
+ return false;
+ }
+
+ struct sockaddr_in addr = {0};
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = tcp_device->in_addr();
+ addr.sin_port = htons(port);
+
+ LOG4CXX_DEBUG(logger_,
+ "Connecting " << inet_ntoa(addr.sin_addr) << ":" << port);
+ set_socket(socket);
+ if (::connect(get_socket(), (struct sockaddr*)&addr, sizeof(addr)) < 0) {
+ LOG4CXX_ERROR(logger_,
+ "Failed to connect for application " << application_handle()
+ << ", error " << errno);
+ *error = new ConnectError();
+ ShutdownAndCloseSocket();
+ return false;
+ }
+
+ return true;
+}
+
+} // 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 acab9f555f..a2ef38f3cb 100644
--- a/src/components/transport_manager/src/tcp/tcp_socket_connection.cc
+++ b/src/components/transport_manager/src/tcp/tcp_socket_connection.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,16 +32,9 @@
*/
#include "transport_manager/tcp/tcp_socket_connection.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"
+#include "utils/logger.h"
namespace transport_manager {
namespace transport_adapter {
@@ -53,65 +46,11 @@ TcpSocketConnection::TcpSocketConnection(const DeviceUID& device_uid,
TransportAdapterController* controller)
: ThreadedSocketConnection(device_uid, app_handle, controller) {}
-TcpSocketConnection::~TcpSocketConnection() {}
-
-bool TcpSocketConnection::Establish(ConnectError** error) {
- return true;
+TcpSocketConnection::~TcpSocketConnection() {
+ StopAndJoinThread();
}
-TcpServerOiginatedSocketConnection::TcpServerOiginatedSocketConnection(
- const DeviceUID& device_uid,
- const ApplicationHandle& app_handle,
- TransportAdapterController* controller)
- : ThreadedSocketConnection(device_uid, app_handle, controller) {}
-
-TcpServerOiginatedSocketConnection::~TcpServerOiginatedSocketConnection() {}
-
-bool TcpServerOiginatedSocketConnection::Establish(ConnectError** 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();
- return false;
- }
- TcpDevice* tcp_device = static_cast<TcpDevice*>(device.get());
-
- const int port = tcp_device->GetApplicationPort(application_handle());
- if (-1 == port) {
- LOG4CXX_ERROR(logger_,
- "Application port for " << application_handle()
- << " not found");
- *error = new ConnectError();
- return false;
- }
-
- const int socket = ::socket(AF_INET, SOCK_STREAM, 0);
- if (socket < 0) {
- LOG4CXX_ERROR(logger_, "Failed to create socket");
- *error = new ConnectError();
- return false;
- }
-
- struct sockaddr_in addr = {0};
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = tcp_device->in_addr();
- addr.sin_port = htons(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);
- *error = new ConnectError();
- ::close(socket);
- return false;
- }
-
- set_socket(socket);
+bool TcpSocketConnection::Establish(ConnectError** error) {
return true;
}
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 a389deb517..0e9e63263b 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,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -110,7 +110,7 @@ void TcpTransportAdapter::Store() const {
}
}
tcp_adapter_dictionary["devices"] = devices_dictionary;
- Json::Value& dictionary = last_state().dictionary;
+ Json::Value& dictionary = last_state().get_dictionary();
dictionary["TransportManager"]["TcpAdapter"] = tcp_adapter_dictionary;
}
@@ -118,7 +118,7 @@ bool TcpTransportAdapter::Restore() {
LOG4CXX_AUTO_TRACE(logger_);
bool errors_occurred = false;
const Json::Value tcp_adapter_dictionary =
- last_state().dictionary["TransportManager"]["TcpAdapter"];
+ last_state().get_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();
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 5e9f3d941d..9d594affe4 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,5 +1,5 @@
/*
- * Copyright (c) 2013, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -70,10 +70,7 @@ ThreadedSocketConnection::ThreadedSocketConnection(
ThreadedSocketConnection::~ThreadedSocketConnection() {
LOG4CXX_AUTO_TRACE(logger_);
- Disconnect();
- thread_->join();
- delete thread_->delegate();
- threads::DeleteThread(thread_);
+ DCHECK(NULL == thread_);
if (-1 != read_fd_) {
close(read_fd_);
@@ -83,6 +80,14 @@ ThreadedSocketConnection::~ThreadedSocketConnection() {
}
}
+void ThreadedSocketConnection::StopAndJoinThread() {
+ Disconnect();
+ thread_->join();
+ delete thread_->delegate();
+ threads::DeleteThread(thread_);
+ thread_ = NULL;
+}
+
void ThreadedSocketConnection::Abort() {
LOG4CXX_AUTO_TRACE(logger_);
unexpected_disconnect_ = true;
@@ -126,7 +131,8 @@ void ThreadedSocketConnection::Finalize() {
LOG4CXX_DEBUG(logger_, "not unexpected_disconnect");
controller_->ConnectionFinished(device_handle(), application_handle());
}
- close(socket_);
+
+ ShutdownAndCloseSocket();
}
TransportAdapter::Error ThreadedSocketConnection::Notify() const {
@@ -157,16 +163,17 @@ TransportAdapter::Error ThreadedSocketConnection::SendData(
TransportAdapter::Error ThreadedSocketConnection::Disconnect() {
LOG4CXX_AUTO_TRACE(logger_);
terminate_flag_ = true;
+ ShutdownAndCloseSocket();
return Notify();
}
void ThreadedSocketConnection::threadMain() {
LOG4CXX_AUTO_TRACE(logger_);
- controller_->ConnectionCreated(this, device_handle(), application_handle());
ConnectError* connect_error = NULL;
if (!Establish(&connect_error)) {
LOG4CXX_ERROR(logger_, "Connection Establish failed");
delete connect_error;
+ Abort();
}
LOG4CXX_DEBUG(logger_, "Connection established");
controller_->ConnectDone(device_handle(), application_handle());
@@ -191,6 +198,22 @@ bool ThreadedSocketConnection::IsFramesToSendQueueEmpty() const {
return frames_to_send_.empty();
}
+void ThreadedSocketConnection::ShutdownAndCloseSocket() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const int socket = socket_;
+ socket_ = -1;
+ if (socket != -1) {
+ if (shutdown(socket, SHUT_RDWR) != 0) {
+ LOG4CXX_WARN(logger_, "Socket was unable to be shutdowned");
+ }
+ if (close(socket) != 0) {
+ LOG4CXX_ERROR_WITH_ERRNO(logger_, "Failed to close socket");
+ }
+ } else {
+ LOG4CXX_WARN(logger_, "Socket has been already closed or not created yet");
+ }
+}
+
void ThreadedSocketConnection::Transmit() {
LOG4CXX_AUTO_TRACE(logger_);
@@ -245,7 +268,7 @@ void ThreadedSocketConnection::Transmit() {
const bool is_queue_empty = IsFramesToSendQueueEmpty();
// Send data if possible
- if (!is_queue_empty && (poll_fds[0].revents | POLLOUT)) {
+ if (!is_queue_empty && (poll_fds[0].revents & POLLOUT)) {
LOG4CXX_DEBUG(logger_, "frames_to_send_ not empty() ");
// send data
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 f0fddfb4f5..bdacd68006 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,13 +45,16 @@ namespace transport_adapter {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
namespace {
+// @deprecated DeviceTypes: PASA_AOA, PASA_BLUETOOTH, MME
DeviceTypes devicesType = {
- std::make_pair(AOA, std::string("USB_AOA")),
- std::make_pair(PASA_AOA, std::string("USB_AOA")),
- std::make_pair(MME, std::string("USB_IOS")),
- std::make_pair(BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(PASA_BLUETOOTH, std::string("BLUETOOTH")),
- std::make_pair(TCP, std::string("WIFI"))};
+ std::make_pair(DeviceType::AOA, std::string("USB_AOA")),
+ std::make_pair(DeviceType::PASA_AOA, std::string("USB_AOA")),
+ std::make_pair(DeviceType::BLUETOOTH, std::string("BLUETOOTH")),
+ std::make_pair(DeviceType::PASA_BLUETOOTH, std::string("BLUETOOTH")),
+ std::make_pair(DeviceType::MME, std::string("USB_IOS")),
+ std::make_pair(DeviceType::IOS_BT, std::string("BLUETOOTH_IOS")),
+ std::make_pair(DeviceType::IOS_USB, std::string("USB_IOS")),
+ std::make_pair(DeviceType::TCP, std::string("WIFI"))};
}
TransportAdapterImpl::TransportAdapterImpl(
@@ -79,6 +82,7 @@ TransportAdapterImpl::TransportAdapterImpl(
}
TransportAdapterImpl::~TransportAdapterImpl() {
+ listeners_.clear();
Terminate();
if (device_scanner_) {
@@ -155,10 +159,9 @@ TransportAdapter::Error TransportAdapterImpl::Init() {
initialised_ = (error == OK);
- if (get_settings().use_last_state()) {
+ if (get_settings().use_last_state() && initialised_) {
if (!Restore()) {
LOG4CXX_WARN(logger_, "could not restore transport adapter state");
- error = FAIL;
}
}
LOG4CXX_TRACE(logger_, "exit with error: " << error);
@@ -192,6 +195,10 @@ TransportAdapter::Error TransportAdapterImpl::Connect(
LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
return BAD_STATE;
}
+ if (!initialised_) {
+ LOG4CXX_TRACE(logger_, "exit with BAD_STATE");
+ return BAD_STATE;
+ }
connections_lock_.AcquireForWriting();
const bool already_exists =
@@ -498,15 +505,13 @@ void TransportAdapterImpl::SearchDeviceFailed(const SearchDeviceError& error) {
}
bool TransportAdapterImpl::IsSearchDevicesSupported() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
return device_scanner_ != 0;
- LOG4CXX_TRACE(logger_, "exit");
}
bool TransportAdapterImpl::IsServerOriginatedConnectSupported() const {
- LOG4CXX_TRACE(logger_, "enter");
+ LOG4CXX_AUTO_TRACE(logger_);
return server_connection_factory_ != 0;
- LOG4CXX_TRACE(logger_, "exit");
}
bool TransportAdapterImpl::IsClientOriginatedConnectSupported() const {
@@ -690,6 +695,23 @@ void TransportAdapterImpl::DataSendFailed(
LOG4CXX_TRACE(logger_, "exit");
}
+void TransportAdapterImpl::DoTransportSwitch() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::for_each(
+ listeners_.begin(),
+ listeners_.end(),
+ std::bind2nd(
+ std::mem_fun(&TransportAdapterListener::OnTransportSwitchRequested),
+ this));
+}
+
+void TransportAdapterImpl::DeviceSwitched(const DeviceUID& device_handle) {
+ LOG4CXX_DEBUG(logger_,
+ "Switching is not implemented for that adapter type "
+ << GetConnectionType().c_str());
+ UNUSED(device_handle);
+}
+
DeviceSptr TransportAdapterImpl::FindDevice(const DeviceUID& device_id) const {
LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id);
DeviceSptr ret;
@@ -860,10 +882,40 @@ std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const {
}
}
+void TransportAdapterImpl::StopDevice(const DeviceUID& device_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DeviceSptr device = FindDevice(device_id);
+ if (device) {
+ device->Stop();
+ }
+}
+
std::string TransportAdapterImpl::GetConnectionType() const {
return devicesType[GetDeviceType()];
}
+SwitchableDevices TransportAdapterImpl::GetSwitchableDevices() const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SwitchableDevices devices;
+ sync_primitives::AutoLock locker(devices_mutex_);
+ for (DeviceMap::const_iterator it = devices_.begin(); it != devices_.end();
+ ++it) {
+ const auto device_uid = it->first;
+ const auto device = it->second;
+ const auto transport_switch_id = device->transport_switch_id();
+ if (transport_switch_id.empty()) {
+ LOG4CXX_DEBUG(logger_,
+ "Device is not suitable for switching: " << device_uid);
+ continue;
+ }
+ LOG4CXX_DEBUG(logger_, "Device is suitable for switching: " << device_uid);
+ devices.insert(std::make_pair(device_uid, transport_switch_id));
+ }
+ LOG4CXX_INFO(logger_,
+ "Found number of switchable devices: " << devices.size());
+ return devices;
+}
+
#ifdef TELEMETRY_MONITOR
void TransportAdapterImpl::SetTelemetryObserver(TMTelemetryObserver* observer) {
metric_observer_ = observer;
diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
index 2ab19ade86..f1181ce921 100644
--- a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
+++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc
@@ -48,13 +48,12 @@ TransportAdapterListenerImpl::TransportAdapterListenerImpl(
void TransportAdapterListenerImpl::OnSearchDeviceDone(
const TransportAdapter* adapter) {
LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE,
- transport_adapter_,
- "",
- 0,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr());
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEARCH_DONE,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -68,13 +67,12 @@ void TransportAdapterListenerImpl::OnSearchDeviceFailed(
LOG4CXX_TRACE(logger_,
"enter. adapter: " << adapter << ", error: " << &error);
SearchDeviceError* err = new SearchDeviceError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL,
- transport_adapter_,
- "",
- 0,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEARCH_FAIL,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -86,13 +84,12 @@ void TransportAdapterListenerImpl::OnSearchDeviceFailed(
void TransportAdapterListenerImpl::OnDeviceListUpdated(
const TransportAdapter* adapter) {
LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED,
- transport_adapter_,
- "",
- 0,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr());
+ const TransportAdapterEvent event(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ transport_adapter_,
+ "",
+ 0,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -105,7 +102,7 @@ void TransportAdapterListenerImpl::OnFindNewApplicationsRequest(
const TransportAdapter* adapter) {
LOG4CXX_TRACE(logger_, "enter. adapter* " << adapter);
const TransportAdapterEvent event(
- TransportAdapterListenerImpl::ON_FIND_NEW_APPLICATIONS_REQUEST,
+ EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST,
transport_adapter_,
"",
0,
@@ -126,13 +123,12 @@ void TransportAdapterListenerImpl::OnConnectDone(
LOG4CXX_TRACE(logger_,
"enter adapter*: " << adapter << ", device: " << &device
<< ", application_id: " << &application_id);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE,
- transport_adapter_,
- device,
- application_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(new BaseError()));
+ const TransportAdapterEvent event(EventTypeEnum::ON_CONNECT_DONE,
+ transport_adapter_,
+ device,
+ application_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -151,13 +147,12 @@ void TransportAdapterListenerImpl::OnConnectFailed(
<< ", application_id: " << &app_id
<< ", error: " << &error);
ConnectError* err = new ConnectError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_CONNECT_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -173,13 +168,12 @@ void TransportAdapterListenerImpl::OnDisconnectDone(
LOG4CXX_TRACE(logger_,
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(new BaseError()));
+ const TransportAdapterEvent event(EventTypeEnum::ON_DISCONNECT_DONE,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -198,13 +192,12 @@ void TransportAdapterListenerImpl::OnDisconnectFailed(
<< ", application_id: " << &app_id
<< ", error: " << &error);
DisconnectError* err = new DisconnectError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_DISCONNECT_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -230,13 +223,12 @@ void TransportAdapterListenerImpl::OnDataReceiveDone(
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id
<< ", data_container: " << data_container);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE,
- transport_adapter_,
- device,
- app_id,
- data_container,
- BaseErrorPtr(new BaseError()));
+ const TransportAdapterEvent event(EventTypeEnum::ON_RECEIVED_DONE,
+ transport_adapter_,
+ device,
+ app_id,
+ data_container,
+ BaseErrorPtr(new BaseError()));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -255,13 +247,12 @@ void TransportAdapterListenerImpl::OnDataReceiveFailed(
<< ", application_id: " << &app_id
<< ", error: " << &error);
DataReceiveError* err = new DataReceiveError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL,
- transport_adapter_,
- device,
- app_id,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_RECEIVED_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -279,13 +270,12 @@ void TransportAdapterListenerImpl::OnDataSendDone(
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id
<< ", data_container: " << data_container);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE,
- transport_adapter_,
- device,
- app_id,
- data_container,
- new BaseError());
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEND_DONE,
+ transport_adapter_,
+ device,
+ app_id,
+ data_container,
+ new BaseError());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -306,13 +296,12 @@ void TransportAdapterListenerImpl::OnDataSendFailed(
<< ", data_container: " << data_container
<< ", error: " << &error);
DataSendError* err = new DataSendError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL,
- transport_adapter_,
- device,
- app_id,
- data_container,
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_SEND_FAIL,
+ transport_adapter_,
+ device,
+ app_id,
+ data_container,
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -336,13 +325,12 @@ void TransportAdapterListenerImpl::OnUnexpectedDisconnect(
<< ", application: " << &application
<< ", error: " << &error);
CommunicationError* err = new CommunicationError(error);
- const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
- transport_adapter_,
- device,
- application,
- ::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(err));
+ const TransportAdapterEvent event(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
+ transport_adapter_,
+ device,
+ application,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(err));
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
@@ -358,18 +346,34 @@ void TransportAdapterListenerImpl::OnCommunicationError(
LOG4CXX_TRACE(logger_,
"enter. adapter: " << adapter << ", device: " << &device
<< ", application_id: " << &app_id);
+ const TransportAdapterEvent event(EventTypeEnum::ON_COMMUNICATION_ERROR,
+ transport_adapter_,
+ device,
+ app_id,
+ ::protocol_handler::RawMessagePtr(),
+ BaseErrorPtr(new BaseError()));
+ if (transport_manager_ != NULL &&
+ transport_manager::E_SUCCESS !=
+ transport_manager_->ReceiveEventFromDevice(event)) {
+ LOG4CXX_WARN(logger_, "Failed to receive event from device");
+ }
+ LOG4CXX_TRACE(logger_, "exit");
+}
+
+void TransportAdapterListenerImpl::OnTransportSwitchRequested(
+ const transport_adapter::TransportAdapter* adapter) {
+ LOG4CXX_AUTO_TRACE(logger_);
const TransportAdapterEvent event(
- TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR,
+ EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
transport_adapter_,
- device,
- app_id,
+ "",
+ 0,
::protocol_handler::RawMessagePtr(),
- BaseErrorPtr(new BaseError()));
+ BaseErrorPtr());
if (transport_manager_ != NULL &&
transport_manager::E_SUCCESS !=
transport_manager_->ReceiveEventFromDevice(event)) {
LOG4CXX_WARN(logger_, "Failed to receive event from device");
}
- LOG4CXX_TRACE(logger_, "exit");
}
} // 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 31f398233b..196ad09af4 100644
--- a/src/components/transport_manager/src/transport_manager_default.cc
+++ b/src/components/transport_manager/src/transport_manager_default.cc
@@ -44,6 +44,10 @@
#include "transport_manager/usb/usb_aoa_adapter.h"
#endif // USB_SUPPORT
+#if defined(BUILD_TESTS)
+#include "transport_manager/iap2_emulation/iap2_transport_adapter.h"
+#endif // BUILD_TEST
+
namespace transport_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
@@ -97,6 +101,23 @@ int TransportManagerDefault::Init(resumption::LastState& last_state) {
ta_usb = NULL;
#endif // USB_SUPPORT
+#if defined BUILD_TESTS
+ const uint16_t iap2_bt_emu_port = 23456;
+ transport_adapter::IAP2BluetoothEmulationTransportAdapter*
+ iap2_bt_emu_adapter =
+ new transport_adapter::IAP2BluetoothEmulationTransportAdapter(
+ iap2_bt_emu_port, last_state, get_settings());
+
+ AddTransportAdapter(iap2_bt_emu_adapter);
+
+ const uint16_t iap2_usb_emu_port = 34567;
+ transport_adapter::IAP2USBEmulationTransportAdapter* iap2_usb_emu_adapter =
+ new transport_adapter::IAP2USBEmulationTransportAdapter(
+ iap2_usb_emu_port, last_state, get_settings());
+
+ AddTransportAdapter(iap2_usb_emu_adapter);
+#endif // BUILD_TEST
+
LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
return E_SUCCESS;
}
diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc
index 8a4b01ad85..e9933e3c82 100644
--- a/src/components/transport_manager/src/transport_manager_impl.cc
+++ b/src/components/transport_manager/src/transport_manager_impl.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,17 @@
using ::transport_manager::transport_adapter::TransportAdapter;
+namespace {
+struct ConnectionFinder {
+ const uint32_t id_;
+ explicit ConnectionFinder(const uint32_t id) : id_(id) {}
+ bool operator()(const transport_manager::TransportManagerImpl::Connection&
+ connection) const {
+ return id_ == connection.id;
+ }
+};
+} // namespace
+
namespace transport_manager {
CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager")
@@ -82,7 +93,11 @@ TransportManagerImpl::TransportManagerImpl(
, connection_id_counter_(0)
, message_queue_("TM MessageQueue", this)
, event_queue_("TM EventQueue", this)
- , settings_(settings) {
+ , settings_(settings)
+ , device_switch_timer_(
+ "Device reconection timer",
+ new timer::TimerTaskImpl<TransportManagerImpl>(
+ this, &TransportManagerImpl::ReconnectionTimeout)) {
LOG4CXX_TRACE(logger_, "TransportManager has created");
}
@@ -108,6 +123,12 @@ TransportManagerImpl::~TransportManagerImpl() {
LOG4CXX_INFO(logger_, "TransportManager object destroyed");
}
+void TransportManagerImpl::ReconnectionTimeout() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ RaiseEvent(&TransportManagerListener::OnDeviceSwitchingFinish,
+ device_to_reconnect_);
+}
+
int TransportManagerImpl::ConnectDevice(const DeviceHandle device_handle) {
LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle);
if (!this->is_initialized_) {
@@ -413,14 +434,19 @@ int TransportManagerImpl::AddTransportAdapter(
"transport_adapter_listeners_.end()");
return E_ADAPTER_EXISTS;
}
- transport_adapter_listeners_[transport_adapter] =
+
+ auto listener =
new TransportAdapterListenerImpl(this, transport_adapter);
- transport_adapter->AddListener(
- transport_adapter_listeners_[transport_adapter]);
+ transport_adapter->AddListener(listener);
+
if (transport_adapter->IsInitialised() ||
transport_adapter->Init() == TransportAdapter::OK) {
+ transport_adapter_listeners_[transport_adapter] = listener;
transport_adapters_.push_back(transport_adapter);
+ } else {
+ delete listener;
+ delete transport_adapter;
}
LOG4CXX_TRACE(logger_, "exit with E_SUCCESS");
return E_SUCCESS;
@@ -559,7 +585,8 @@ void TransportManagerImpl::UpdateDeviceList(TransportAdapter* ta) {
const DeviceList dev_list = ta->GetDeviceList();
for (DeviceList::const_iterator it = dev_list.begin(); it != dev_list.end();
++it) {
- DeviceHandle device_handle = converter_.UidToHandle(*it);
+ DeviceHandle device_handle =
+ converter_.UidToHandle(*it, ta->GetConnectionType());
DeviceInfo info(
device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType());
device_list_.push_back(std::make_pair(ta, info));
@@ -623,24 +650,44 @@ void TransportManagerImpl::RemoveConnection(
LOG4CXX_AUTO_TRACE(logger_);
LOG4CXX_DEBUG(logger_, "Id: " << id);
sync_primitives::AutoWriteLock lock(connections_lock_);
+ LOG4CXX_DEBUG(logger_, "Removing connection with id: " << id);
+ const std::vector<ConnectionInternal>::iterator it = std::find_if(
+ connections_.begin(), connections_.end(), ConnectionFinder(id));
+ if (connections_.end() != it) {
+ if (transport_adapter) {
+ transport_adapter->RemoveFinalizedConnection(it->device, it->application);
+ }
+ connections_.erase(it);
+ }
+}
+
+void TransportManagerImpl::DeactivateDeviceConnections(
+ const DeviceUID& device_uid) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ sync_primitives::AutoWriteLock lock(connections_lock_);
+ LOG4CXX_DEBUG(logger_,
+ "Deactivating connections for device with UID: " << device_uid);
+
+ size_t counter = 0;
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
- if (it->id == id) {
- connections_.erase(it);
- if (transport_adapter) {
- transport_adapter->RemoveFinalizedConnection(it->device,
- it->application);
- }
- break;
+ if (it->device == device_uid) {
+ it->active_ = false;
+ ++counter;
}
}
+ LOG4CXX_DEBUG(logger_,
+ "Deactivated "
+ << counter
+ << " connections for device with UID: " << device_uid);
}
TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
const ConnectionUID id) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_, "ConnectionUID: " << &id);
+ LOG4CXX_DEBUG(logger_, "ConnectionUID: " << id);
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
@@ -655,9 +702,8 @@ TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
const DeviceUID& device, const ApplicationHandle& application) {
LOG4CXX_AUTO_TRACE(logger_);
- LOG4CXX_DEBUG(logger_,
- "DeviceUID: " << &device
- << "ApplicationHandle: " << &application);
+ LOG4CXX_DEBUG(
+ logger_, "DeviceUID: " << device << "ApplicationHandle: " << application);
for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
it != connections_.end();
++it) {
@@ -669,21 +715,201 @@ TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection(
return NULL;
}
-void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
- LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << ta);
- const DeviceList device_list = ta->GetDeviceList();
- LOG4CXX_DEBUG(logger_, "DEVICE_LIST_UPDATED " << device_list.size());
- for (DeviceList::const_iterator it = device_list.begin();
- it != device_list.end();
+TransportManagerImpl::ConnectionInternal*
+TransportManagerImpl::GetActiveConnection(
+ const DeviceUID& device, const ApplicationHandle& application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_,
+ "DeviceUID: " << device
+ << " ApplicationHandle: " << application);
+ for (std::vector<ConnectionInternal>::iterator it = connections_.begin();
+ it != connections_.end();
+ ++it) {
+ if (it->device == device && it->application == application && it->active_) {
+ LOG4CXX_DEBUG(logger_, "ConnectionInternal. It's address: " << &*it);
+ return &*it;
+ }
+ }
+ return NULL;
+}
+
+namespace {
+
+struct IOSBTAdapterFinder {
+ bool operator()(const std::vector<TransportAdapter*>::value_type& i) const {
+ return i->GetDeviceType() == transport_adapter::DeviceType::IOS_BT;
+ }
+};
+
+struct SwitchableFinder {
+ explicit SwitchableFinder(SwitchableDevices::const_iterator what)
+ : what_(what) {}
+ bool operator()(const SwitchableDevices::value_type& i) const {
+ return what_->second == i.second;
+ }
+
+ private:
+ SwitchableDevices::const_iterator what_;
+};
+
+} // namespace
+
+void TransportManagerImpl::TryDeviceSwitch(
+ transport_adapter::TransportAdapter* adapter) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (adapter->GetDeviceType() != transport_adapter::DeviceType::IOS_USB) {
+ LOG4CXX_ERROR(logger_, "Switching requested not from iAP-USB transport.");
+ return;
+ }
+
+ const auto ios_bt_adapter = std::find_if(transport_adapters_.begin(),
+ transport_adapters_.end(),
+ IOSBTAdapterFinder());
+
+ if (transport_adapters_.end() == ios_bt_adapter) {
+ LOG4CXX_WARN(
+ logger_,
+ "There is no iAP2 Bluetooth adapter found. Switching is not possible.");
+ return;
+ }
+
+ const SwitchableDevices usb_switchable_devices =
+ adapter->GetSwitchableDevices();
+ const auto bt_switchable_devices = (*ios_bt_adapter)->GetSwitchableDevices();
+ auto bt = bt_switchable_devices.end();
+ auto usb = usb_switchable_devices.begin();
+ for (; usb != usb_switchable_devices.end(); ++usb) {
+ SwitchableFinder finder(usb);
+ bt = std::find_if(
+ bt_switchable_devices.begin(), bt_switchable_devices.end(), finder);
+
+ if (bt != bt_switchable_devices.end()) {
+ break;
+ }
+ }
+
+ if (bt_switchable_devices.end() == bt) {
+ LOG4CXX_WARN(logger_,
+ "No suitable for switching iAP2 Bluetooth device found.");
+ return;
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Found UUID suitable for transport switching: " << bt->second);
+ LOG4CXX_DEBUG(
+ logger_, "Device to switch from: " << bt->first << " to: " << usb->first);
+
+ sync_primitives::AutoWriteLock lock(device_to_adapter_map_lock_);
+
+ const auto bt_device_uid = bt->first;
+ const auto device_to_switch = device_to_adapter_map_.find(bt_device_uid);
+ if (device_to_adapter_map_.end() == device_to_switch) {
+ LOG4CXX_ERROR(logger_,
+ "There is no known device found with UID "
+ << bt_device_uid
+ << " . Transport switching is not possible.");
+ DCHECK_OR_RETURN_VOID(false);
+ return;
+ }
+
+ const auto usb_uid = usb->first;
+ const auto bt_uid = device_to_switch->first;
+ const auto bt_adapter = device_to_switch->second;
+
+ LOG4CXX_DEBUG(logger_,
+ "Known device with UID "
+ << bt_uid << " is appropriate for transport switching.");
+
+ RaiseEvent(
+ &TransportManagerListener::OnDeviceSwitchingStart, bt_uid, usb_uid);
+
+ bt_adapter->StopDevice(bt_uid);
+ adapter->DeviceSwitched(usb_uid);
+
+ DeactivateDeviceConnections(bt_uid);
+
+ device_to_reconnect_ = bt_uid;
+
+ const uint32_t timeout = get_settings().app_transport_change_timer() +
+ get_settings().app_transport_change_timer_addition();
+ device_switch_timer_.Start(timeout, timer::kSingleShot);
+
+ LOG4CXX_DEBUG(logger_,
+ "Device switch for device id " << bt_uid << " is done.");
+ return;
+}
+
+bool TransportManagerImpl::UpdateDeviceMapping(
+ transport_adapter::TransportAdapter* ta) {
+ const DeviceList adapter_device_list = ta->GetDeviceList();
+ LOG4CXX_DEBUG(logger_, "DEVICE_LIST_UPDATED " << adapter_device_list.size());
+
+ sync_primitives::AutoWriteLock lock(device_to_adapter_map_lock_);
+
+ LOG4CXX_DEBUG(logger_,
+ "Before cleanup and update. Device map size is "
+ << device_to_adapter_map_.size());
+
+ for (auto item = device_to_adapter_map_.begin();
+ device_to_adapter_map_.end() != item;) {
+ const auto adapter = item->second;
+ if (adapter != ta) {
+ ++item;
+ continue;
+ }
+
+ const auto device_uid = item->first;
+ if (adapter_device_list.end() != std::find(adapter_device_list.begin(),
+ adapter_device_list.end(),
+ device_uid)) {
+ ++item;
+ continue;
+ }
+
+ device_to_adapter_map_.erase(item);
+ item = device_to_adapter_map_.begin();
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "After cleanup. Device map size is "
+ << device_to_adapter_map_.size());
+
+ for (DeviceList::const_iterator it = adapter_device_list.begin();
+ it != adapter_device_list.end();
++it) {
- device_to_adapter_map_lock_.AcquireForWriting();
- device_to_adapter_map_.insert(std::make_pair(*it, ta));
- device_to_adapter_map_lock_.Release();
- DeviceHandle device_handle = converter_.UidToHandle(*it);
- DeviceInfo info(
- device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType());
+ const auto device_uid = *it;
+ const auto result =
+ device_to_adapter_map_.insert(std::make_pair(device_uid, ta));
+ if (!result.second) {
+ LOG4CXX_WARN(logger_,
+ "Device UID "
+ << device_uid
+ << " is known already. Processing skipped."
+ "Connection type is: " << ta->GetConnectionType());
+ continue;
+ }
+ DeviceHandle device_handle =
+ converter_.UidToHandle(device_uid, ta->GetConnectionType());
+ DeviceInfo info(device_handle,
+ device_uid,
+ ta->DeviceName(device_uid),
+ ta->GetConnectionType());
RaiseEvent(&TransportManagerListener::OnDeviceFound, info);
}
+
+ LOG4CXX_DEBUG(logger_,
+ "After update. Device map size is "
+ << device_to_adapter_map_.size());
+
+ return true;
+}
+
+void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
+ LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << ta);
+ if (!UpdateDeviceMapping(ta)) {
+ LOG4CXX_ERROR(logger_, "Device list update failed.");
+ return;
+ }
UpdateDeviceList(ta);
std::vector<DeviceInfo> device_infos;
device_list_lock_.AcquireForReading();
@@ -700,31 +926,36 @@ void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) {
void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_TRACE(logger_, "enter");
switch (event.event_type) {
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE: {
+ case EventTypeEnum::ON_SEARCH_DONE: {
RaiseEvent(&TransportManagerListener::OnScanDevicesFinished);
LOG4CXX_DEBUG(logger_, "event_type = ON_SEARCH_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL: {
+ case EventTypeEnum::ON_SEARCH_FAIL: {
// error happened in real search process (external error)
RaiseEvent(&TransportManagerListener::OnScanDevicesFailed,
*static_cast<SearchDeviceError*>(event.event_error.get()));
LOG4CXX_DEBUG(logger_, "event_type = ON_SEARCH_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED: {
+ case EventTypeEnum::ON_DEVICE_LIST_UPDATED: {
OnDeviceListUpdated(event.transport_adapter);
LOG4CXX_DEBUG(logger_, "event_type = ON_DEVICE_LIST_UPDATED");
break;
}
- case TransportAdapterListenerImpl::ON_FIND_NEW_APPLICATIONS_REQUEST: {
+ case EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED: {
+ TryDeviceSwitch(event.transport_adapter);
+ LOG4CXX_DEBUG(logger_, "event_type = ON_TRANSPORT_SWITCH_REQUESTED");
+ break;
+ }
+ case EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST: {
RaiseEvent(&TransportManagerListener::OnFindNewApplicationsRequest);
LOG4CXX_DEBUG(logger_, "event_type = ON_FIND_NEW_APPLICATIONS_REQUEST");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE: {
- const DeviceHandle device_handle =
- converter_.UidToHandle(event.device_uid);
+ case EventTypeEnum::ON_CONNECT_DONE: {
+ const DeviceHandle device_handle = converter_.UidToHandle(
+ event.device_uid, event.transport_adapter->GetConnectionType());
AddConnection(ConnectionInternal(this,
event.transport_adapter,
++connection_id_counter_,
@@ -741,10 +972,12 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL: {
+ case EventTypeEnum::ON_CONNECT_FAIL: {
RaiseEvent(
&TransportManagerListener::OnConnectionFailed,
- DeviceInfo(converter_.UidToHandle(event.device_uid),
+ DeviceInfo(converter_.UidToHandle(
+ event.device_uid,
+ event.transport_adapter->GetConnectionType()),
event.device_uid,
event.transport_adapter->DeviceName(event.device_uid),
event.transport_adapter->GetConnectionType()),
@@ -752,7 +985,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE: {
+ case EventTypeEnum::ON_DISCONNECT_DONE: {
connections_lock_.AcquireForReading();
ConnectionInternal* connection =
GetConnection(event.device_uid, event.application_id);
@@ -771,16 +1004,16 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL: {
- const DeviceHandle device_handle =
- converter_.UidToHandle(event.device_uid);
+ case EventTypeEnum::ON_DISCONNECT_FAIL: {
+ const DeviceHandle device_handle = converter_.UidToHandle(
+ event.device_uid, event.transport_adapter->GetConnectionType());
RaiseEvent(&TransportManagerListener::OnDisconnectFailed,
device_handle,
DisconnectDeviceError());
LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE: {
+ case EventTypeEnum::ON_SEND_DONE: {
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
metric_observer_->StopRawMsg(event.event_data.get());
@@ -807,7 +1040,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_SEND_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL: {
+ case EventTypeEnum::ON_SEND_FAIL: {
#ifdef TELEMETRY_MONITOR
if (metric_observer_) {
metric_observer_->StopRawMsg(event.event_data.get());
@@ -842,11 +1075,11 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "eevent_type = ON_SEND_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE: {
+ case EventTypeEnum::ON_RECEIVED_DONE: {
{
sync_primitives::AutoReadLock lock(connections_lock_);
ConnectionInternal* connection =
- GetConnection(event.device_uid, event.application_id);
+ GetActiveConnection(event.device_uid, event.application_id);
if (connection == NULL) {
LOG4CXX_ERROR(logger_,
"Connection ('" << event.device_uid << ", "
@@ -869,11 +1102,11 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_DONE");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL: {
+ case EventTypeEnum::ON_RECEIVED_FAIL: {
LOG4CXX_DEBUG(logger_, "Event ON_RECEIVED_FAIL");
connections_lock_.AcquireForReading();
ConnectionInternal* connection =
- GetConnection(event.device_uid, event.application_id);
+ GetActiveConnection(event.device_uid, event.application_id);
if (connection == NULL) {
LOG4CXX_ERROR(logger_,
"Connection ('" << event.device_uid << ", "
@@ -888,12 +1121,11 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) {
LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_FAIL");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR: {
+ case EventTypeEnum::ON_COMMUNICATION_ERROR: {
LOG4CXX_DEBUG(logger_, "event_type = ON_COMMUNICATION_ERROR");
break;
}
- case TransportAdapterListenerImpl::EventTypeEnum::
- ON_UNEXPECTED_DISCONNECT: {
+ case EventTypeEnum::ON_UNEXPECTED_DISCONNECT: {
connections_lock_.AcquireForReading();
ConnectionInternal* connection =
GetConnection(event.device_uid, event.application_id);
@@ -980,7 +1212,8 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal(
this, &ConnectionInternal::DisconnectFailedRoutine)))
, shutdown_(false)
, device_handle_(device_handle)
- , messages_count(0) {
+ , messages_count(0)
+ , active_(true) {
Connection::id = id;
Connection::device = dev_id;
Connection::application = app_id;
@@ -996,4 +1229,55 @@ void TransportManagerImpl::ConnectionInternal::DisconnectFailedRoutine() {
LOG4CXX_TRACE(logger_, "exit");
}
+DeviceHandle TransportManagerImpl::Handle2GUIDConverter::UidToHandle(
+ const DeviceUID& dev_uid, const std::string& connection_type) {
+ DeviceHandle handle = hash_function_(dev_uid + connection_type);
+
+ {
+ sync_primitives::AutoReadLock lock(conversion_table_lock_);
+
+ auto it = std::find_if(conversion_table_.begin(),
+ conversion_table_.end(),
+ HandleFinder(handle));
+
+ if (it != conversion_table_.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Handle for UID is found: " << std::get<0>(*it) << "/"
+ << std::get<1>(*it) << "/"
+ << std::get<2>(*it));
+ return std::get<2>(*it);
+ }
+ }
+
+ sync_primitives::AutoWriteLock lock(conversion_table_lock_);
+
+ auto t = std::make_tuple(dev_uid, connection_type, handle);
+ conversion_table_.push_back(
+ std::make_tuple(dev_uid, connection_type, handle));
+ LOG4CXX_DEBUG(logger_,
+ "Handle for UID is added: " << std::get<0>(t) << "/"
+ << std::get<1>(t) << "/"
+ << std::get<2>(t));
+ return handle;
+}
+
+DeviceUID TransportManagerImpl::Handle2GUIDConverter::HandleToUid(
+ const DeviceHandle handle) {
+ sync_primitives::AutoReadLock lock(conversion_table_lock_);
+
+ auto it = std::find_if(
+ conversion_table_.begin(), conversion_table_.end(), HandleFinder(handle));
+
+ if (it != conversion_table_.end()) {
+ LOG4CXX_DEBUG(logger_,
+ "Handle is found: " << std::get<0>(*it) << "/"
+ << std::get<1>(*it) << "/"
+ << std::get<2>(*it));
+ return std::get<0>(*it);
+ }
+
+ LOG4CXX_DEBUG(logger_, "Handle is not found: " << handle);
+ return DeviceUID("uknown_uid");
+}
+
} // namespace transport_manager
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
index 409209b2b2..e9ab2bae8e 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -34,7 +34,7 @@
#include <unistd.h>
#include <iomanip>
-#include <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
#include <sstream>
@@ -43,6 +43,10 @@
#include "utils/logger.h"
+// Define the buffer size, because the Android accessory protocol packet support
+// packet buffers up to 16Kbytes
+#define TRANSPORT_USB_BUFFER_MAX_SIZE (16 * 1024)
+
namespace transport_manager {
namespace transport_adapter {
@@ -64,6 +68,7 @@ UsbConnection::UsbConnection(const DeviceUID& device_uid,
, out_endpoint_(0)
, out_endpoint_max_packet_size_(0)
, in_buffer_(NULL)
+ , in_buffer_size_(0)
, in_transfer_(NULL)
, out_transfer_(0)
, out_messages_()
@@ -96,7 +101,7 @@ bool UsbConnection::PostInTransfer() {
device_handle_,
in_endpoint_,
in_buffer_,
- in_endpoint_max_packet_size_,
+ in_buffer_size_,
InTransferCallback,
this,
0);
@@ -307,7 +312,14 @@ bool UsbConnection::Init() {
LOG4CXX_TRACE(logger_, "exit with FALSE. Condition: !FindEndpoints()");
return false;
}
- in_buffer_ = new unsigned char[in_endpoint_max_packet_size_];
+
+ if (in_endpoint_max_packet_size_ < TRANSPORT_USB_BUFFER_MAX_SIZE) {
+ in_buffer_size_ = TRANSPORT_USB_BUFFER_MAX_SIZE;
+ } else {
+ in_buffer_size_ = in_endpoint_max_packet_size_;
+ }
+
+ in_buffer_ = new unsigned char[in_buffer_size_];
in_transfer_ = libusb_alloc_transfer(0);
if (NULL == in_transfer_) {
LOG4CXX_ERROR(logger_, "libusb_alloc_transfer failed");
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 3462b557ce..b7faf1ef6b 100644
--- a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
+++ b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc
@@ -60,7 +60,7 @@ UsbAoaAdapter::UsbAoaAdapter(resumption::LastState& last_state,
UsbAoaAdapter::~UsbAoaAdapter() {}
DeviceType UsbAoaAdapter::GetDeviceType() const {
- return PASA_AOA;
+ return 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 28992d8f40..1136dfad21 100644
--- a/src/components/transport_manager/src/usb/usb_connection_factory.cc
+++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,7 @@
#include "transport_manager/usb/usb_device.h"
#include "transport_manager/transport_adapter/transport_adapter_impl.h"
#include "utils/logger.h"
+#include "utils/make_shared.h"
#if defined(__QNXNTO__)
#include "transport_manager/usb/qnx/usb_connection.h"
@@ -73,15 +74,14 @@ TransportAdapter::Error UsbConnectionFactory::CreateConnection(
}
UsbDevice* usb_device = static_cast<UsbDevice*>(device.get());
- UsbConnection* usb_connection = new UsbConnection(device_uid,
- app_handle,
- controller_,
- usb_handler_,
- usb_device->usb_device());
-
- controller_->ConnectionCreated(usb_connection, device_uid, app_handle);
-
- if (usb_connection->Init()) {
+ utils::SharedPtr<UsbConnection> connection =
+ utils::MakeShared<UsbConnection>(device_uid,
+ app_handle,
+ controller_,
+ usb_handler_,
+ usb_device->usb_device());
+ controller_->ConnectionCreated(connection, device_uid, app_handle);
+ if (connection->Init()) {
LOG4CXX_INFO(logger_, "USB connection initialised");
LOG4CXX_TRACE(logger_,
"exit with TransportAdapter::OK. Condition: USB connection "
diff --git a/src/components/transport_manager/test/CMakeLists.txt b/src/components/transport_manager/test/CMakeLists.txt
index da20f1d43c..41aae296ac 100644
--- a/src/components/transport_manager/test/CMakeLists.txt
+++ b/src/components/transport_manager/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ford Motor Company
+# Copyright (c) 2017, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,8 +28,7 @@
# 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(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories(
include
@@ -42,10 +41,16 @@ include_directories(
${JSONCPP_INCLUDE_DIRECTORY}
)
+set(EXCLUDE_PATHS
+ raw_message_matcher.cc
+)
+
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+
set(LIBRARIES
gmock
ConfigProfile
- transport_manager
+ TransportManager
Utils
ConfigProfile
ProtocolLibrary
@@ -54,24 +59,15 @@ set(LIBRARIES
)
if (BUILD_USB_SUPPORT)
- list(APPEND LIBRARIES Libusb-1.0.16)
+ list(APPEND LIBRARIES libusb-1.0.so)
endif()
if (BUILD_BT_SUPPORT)
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBRARIES bluetooth)
+ endif()
endif()
-set(SOURCES
- ${TM_TEST_DIR}/transport_manager_impl_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
- ${TM_TEST_DIR}/transport_manager_default_test.cc
-)
-
create_test("transport_manager_test" "${SOURCES}" "${LIBRARIES}")
+
file(COPY smartDeviceLink_test.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY app_info_storage2 DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-endif()
diff --git a/src/components/transport_manager/test/app_info_storage2 b/src/components/transport_manager/test/app_info_storage2
deleted file mode 100644
index 794c8b90bc..0000000000
--- a/src/components/transport_manager/test/app_info_storage2
+++ /dev/null
@@ -1,99 +0,0 @@
-{
- "TransportManager" : {
- "BluetoothAdapter" : null,
- "TcpAdapter" : {
- "devices" : [
- {
- "address" : "57.48.0.1",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name0"
- },
- {
- "address" : "57.48.0.2",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name1"
- },
- {
- "address" : "57.48.0.3",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name2"
- },
- {
- "address" : "57.48.0.4",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name3"
- },
- {
- "address" : "57.48.0.5",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name4"
- },
- {
- "address" : "57.48.0.6",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name5"
- },
- {
- "address" : "57.48.0.7",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name6"
- },
- {
- "address" : "57.48.0.8",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name7"
- },
- {
- "address" : "57.48.0.9",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name8"
- },
- {
- "address" : "57.48.0.10",
- "applications" : [
- {
- "port" : "12345"
- }
- ],
- "name" : "unique_device_name9"
- }
- ]
- }
- }
-}
diff --git a/src/components/transport_manager/test/include/transport_manager/client_connection_listener_mock.h b/src/components/transport_manager/test/include/transport_manager/client_connection_listener_mock.h
deleted file mode 100644
index 6378e69932..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/client_connection_listener_mock.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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 MockClientConnectionListener
- : 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/transport_manager/connection_mock.h b/src/components/transport_manager/test/include/transport_manager/connection_mock.h
deleted file mode 100644
index fbcfcb2271..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/connection_mock.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#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 MockConnection : 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/transport_manager/device_mock.h b/src/components/transport_manager/test/include/transport_manager/device_mock.h
deleted file mode 100644
index a77a715ac8..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/device_mock.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef 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 MockDevice : public ::transport_manager::transport_adapter::Device {
- public:
- MockDevice(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_CONST_METHOD1(LaunchApp, void(const std::string& bundle_id));
- MOCK_METHOD0(Stop, void());
-};
-
-class MockTCPDevice : public ::transport_manager::transport_adapter::TcpDevice {
- public:
- MockTCPDevice(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/transport_manager/device_scanner_mock.h b/src/components/transport_manager/test/include/transport_manager/device_scanner_mock.h
deleted file mode 100644
index d751994e9a..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/device_scanner_mock.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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 MockDeviceScanner
- : 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/transport_manager/mock_telemetry_observer.h b/src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h
index 9d4e86728b..dc65f06fbd 100644
--- a/src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h
+++ b/src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Ford Motor Company
+ * Copyright (c) 2016, 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_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TEST_MOCK_TELEMETRY_OBSERVER_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TEST_MOCK_TELEMETRY_OBSERVER_H_
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
#include "gmock/gmock.h"
#include "transport_manager/telemetry_observer.h"
@@ -40,14 +40,14 @@ namespace test {
namespace components {
namespace transport_manager_test {
-class MockTMTelemetryObserver
- : public ::transport_manager::TMTelemetryObserver {
+class MockTMTelemetryObserver : public transport_manager::TMTelemetryObserver {
public:
MOCK_METHOD1(StartRawMsg, void(const protocol_handler::RawMessage* ptr));
MOCK_METHOD1(StopRawMsg, void(const protocol_handler::RawMessage* ptr));
};
-} // transport_manager_test
-} // components
-} // test
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TEST_MOCK_TELEMETRY_OBSERVER_H_
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TELEMETRY_OBSERVER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h
deleted file mode 100644
index c6862c19d6..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * \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_test {
-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/transport_manager/mock_transport_manager_listener.h b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h
new file mode 100644
index 0000000000..58e143342a
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_listener.h
@@ -0,0 +1,91 @@
+/*
+ * 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_MOCK_TRANSPORT_MANAGER_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_LISTENER_H_
+
+#include <vector>
+#include <gmock/gmock.h>
+#include "transport_manager/transport_manager_listener.h"
+#include "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 MockTransportManagerListener : public TransportManagerListener {
+ public:
+ MOCK_METHOD1(OnDeviceListUpdated,
+ void(const std::vector<DeviceInfo>& device_info));
+ 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(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(const ConnectionUID connection_id));
+ MOCK_METHOD2(OnUnexpectedDisconnect,
+ void(const ConnectionUID connection_id,
+ const CommunicationError& error));
+ MOCK_METHOD2(OnConnectionClosedFailure,
+ void(const ConnectionUID connection_id,
+ const DisconnectError& 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 ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD1(OnTMMessageReceiveFailed, void(const DataReceiveError& error));
+ MOCK_METHOD1(OnTMMessageSend,
+ void(const ::protocol_handler::RawMessagePtr message));
+ MOCK_METHOD2(OnTMMessageSendFailed,
+ void(const DataSendError& error,
+ const ::protocol_handler::RawMessagePtr message));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_MOCK_TRANSPORT_MANAGER_LISTENER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
index 8f20afff60..bb15c19d3b 100644
--- a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
+++ b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h
@@ -33,8 +33,8 @@
* 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_
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_
#include <gmock/gmock.h>
@@ -47,7 +47,7 @@ using ::testing::MatchResultListener;
namespace test {
namespace components {
-namespace transport_manager {
+namespace transport_manager_test {
using namespace ::protocol_handler;
@@ -68,9 +68,8 @@ inline const Matcher<RawMessagePtr> RawMessageEq(RawMessagePtr msg) {
return MakeMatcher(new RawMessageMatcher(msg));
}
-} // namespace transport_manager
+} // namespace transport_manager_test
} // namespace components
} // namespace test
-#endif /* APPLINK_TEST_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_ \
- */
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h b/src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h
deleted file mode 100644
index 795d9492fc..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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 MockServerConnectionFactory
- : 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/transport_manager/transport_adapter/mock_client_connection_listener.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_client_connection_listener.h
new file mode 100644
index 0000000000..0f6f1e9f14
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_client_connection_listener.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_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_CLIENT_CONNECTION_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_CLIENT_CONNECTION_LISTENER_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/client_connection_listener.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class MockClientConnectionListener
+ : 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_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_CLIENT_CONNECTION_LISTENER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_connection.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_connection.h
new file mode 100644
index 0000000000..d1f48c1ed9
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_connection.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_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_CONNECTION_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_CONNECTION_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 MockConnection : 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_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_CONNECTION_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_device_scanner.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_device_scanner.h
new file mode 100644
index 0000000000..f35ee9e0fa
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_device_scanner.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_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_DEVICE_SCANNER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_DEVICE_SCANNER_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/device_scanner.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class MockDeviceScanner
+ : 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_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_DEVICE_SCANNER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_server_connection_factory.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_server_connection_factory.h
new file mode 100644
index 0000000000..b79143badf
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_server_connection_factory.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_SERVER_CONNECTION_FACTORY_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_SERVER_CONNECTION_FACTORY_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/server_connection_factory.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+class MockServerConnectionFactory
+ : 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_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_SERVER_CONNECTION_FACTORY_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h
new file mode 100644
index 0000000000..642c193d63
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_controller.h
@@ -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.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_CONTROLLER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_CONTROLLER_H_
+
+#include "gmock/gmock.h"
+#include "transport_manager/transport_adapter/transport_adapter_controller.h"
+
+namespace test {
+namespace components {
+namespace transport_manager_test {
+
+using namespace ::transport_manager::transport_adapter;
+
+class MockTransportAdapterController : 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_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_CONTROLLER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
index c576c3de6c..384f55605a 100644
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h
@@ -34,8 +34,8 @@
#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_IMPL_H_
#include "gmock/gmock.h"
-#include "transport_manager/transport_adapter/transport_adapter_impl.h"
#include "transport_manager/transport_manager_settings.h"
+#include "transport_manager/transport_adapter/transport_adapter_impl.h"
using ::transport_manager::transport_adapter::TransportAdapterImpl;
using ::transport_manager::transport_adapter::DeviceScanner;
@@ -68,14 +68,17 @@ class MockTransportAdapterImpl : public TransportAdapterImpl {
const ApplicationHandle& app_handle) {
return this->FindEstablishedConnection(device_handle, app_handle);
}
- virtual ~MockTransportAdapterImpl(){};
+ virtual ~MockTransportAdapterImpl() {}
virtual DeviceType GetDeviceType() const {
- return UNKNOWN;
+ return DeviceType::UNKNOWN;
}
MOCK_CONST_METHOD0(Store, void());
MOCK_METHOD0(Restore, bool());
+ MOCK_CONST_METHOD1(FindDevice,
+ transport_manager::transport_adapter::DeviceSptr(
+ const DeviceUID& device_id));
};
} // namespace transport_manager_test
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
new file mode 100644
index 0000000000..03e7630e8b
--- /dev/null
+++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_listener.h
@@ -0,0 +1,131 @@
+/*
+ * \file mock_transport_adapter_listener.h
+ * \brief
+ *
+ * Copyright (c) 2016, Ford Motor Company
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the Ford Motor Company nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_LISTENER_H_
+#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_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_test {
+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&));
+ MOCK_METHOD1(OnTransportSwitchRequested,
+ void(const TransportAdapter* transport_adapter));
+};
+
+} // namespace transport_manager_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_TRANSPORT_ADAPTER_LISTENER_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h
deleted file mode 100644
index 1dc6839ac9..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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_manager/transport_adapter_listener_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter_listener_mock.h
deleted file mode 100644
index a2577ad9ee..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter_listener_mock.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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 {
-
-namespace tm = transport_manager;
-namespace ta = tm::transport_adapter;
-using ta::TransportAdapter;
-using ta::TransportAdapterListener;
-using tm::SearchDeviceError;
-using tm::DeviceUID;
-using tm::ApplicationHandle;
-using tm::ConnectError;
-using tm::CommunicationError;
-using tm::DisconnectError;
-using tm::DisconnectDeviceError;
-using tm::DataSendError;
-using tm::DataReceiveError;
-
-class MockTransportAdapterListener : 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_manager/transport_adapter_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h
deleted file mode 100644
index 815b04930a..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 2016, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_H_
-#define SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_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 MockTransportAdapter
- : 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_METHOD2(RunAppOnDevice, void(const std::string&, const std::string&));
- 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(RemoveFinalizedConnection,
- void(const ::transport_manager::DeviceUID& device_handle,
- const ::transport_manager::ApplicationHandle& app_handle));
- 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 TELEMETRY_MONITOR
- MOCK_METHOD0(GetTelemetryObserver,
- ::transport_manager::TMTelemetryObserver*());
-#endif // TELEMETRY_MONITOR
-};
-
-} // namespace transport_manager_test
-} // namespace components
-} // namespace test
-
-#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_TEST_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_MOCK_H_
diff --git a/src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h
deleted file mode 100644
index e5b0468968..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef 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/transport_manager_listener_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_manager_listener_mock.h
deleted file mode 100644
index 30f602119d..0000000000
--- a/src/components/transport_manager/test/include/transport_manager/transport_manager_listener_mock.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2015, Ford Motor Company
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the Ford Motor Company nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SRC_COMPONENTS_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>& device_info));
- 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(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(const ConnectionUID connection_id));
- MOCK_METHOD2(OnUnexpectedDisconnect,
- void(const ConnectionUID connection_id,
- const CommunicationError& error));
- MOCK_METHOD2(OnConnectionClosedFailure,
- void(const ConnectionUID connection_id,
- const DisconnectError& 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 ::protocol_handler::RawMessagePtr message));
- MOCK_METHOD1(OnTMMessageReceiveFailed, void(const DataReceiveError& error));
- MOCK_METHOD1(OnTMMessageSend,
- void(const ::protocol_handler::RawMessagePtr message));
- MOCK_METHOD2(OnTMMessageSendFailed,
- void(const DataSendError& error,
- const ::protocol_handler::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/raw_message_matcher.cc b/src/components/transport_manager/test/raw_message_matcher.cc
index 130ddc96c8..61d73a9253 100644
--- a/src/components/transport_manager/test/raw_message_matcher.cc
+++ b/src/components/transport_manager/test/raw_message_matcher.cc
@@ -30,12 +30,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "include/raw_message_matcher.h"
-//#include "../../include/protocol/raw_message.h"
+#include "include/transport_manager/raw_message_matcher.h"
namespace test {
namespace components {
-namespace transport_manager {
+namespace transport_manager_test {
RawMessageMatcher::RawMessageMatcher(RawMessagePtr ptr) : ptr_(ptr) {}
@@ -60,6 +59,6 @@ void RawMessageMatcher::DescribeNegationTo(::std::ostream* os) const {
::std::copy(ptr_->data(), ptr_->data() + ptr_->data_size(), out);
}
-} // namespace transport_manager
+} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc
index 782b363a38..b179f63ece 100644
--- a/src/components/transport_manager/test/tcp_client_listener_test.cc
+++ b/src/components/transport_manager/test/tcp_client_listener_test.cc
@@ -31,7 +31,7 @@
*/
#include "gtest/gtest.h"
-#include "transport_manager/transport_adapter_mock.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter.h"
#include "transport_manager/tcp/tcp_client_listener.h"
#include "transport_manager/mock_transport_manager.h"
#include "transport_manager/transport_adapter/transport_adapter_controller.h"
diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
index 60732f0328..dd587569d3 100644
--- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc
+++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc
@@ -32,12 +32,12 @@
#include "gtest/gtest.h"
#include "transport_manager/tcp/tcp_transport_adapter.h"
-#include "transport_manager/transport_adapter/connection.h"
-#include "resumption/last_state.h"
+#include "resumption/last_state_impl.h"
#include "protocol/raw_message.h"
-#include "transport_manager/transport_adapter_listener_mock.h"
-#include "transport_manager/device_mock.h"
-#include "transport_manager/connection_mock.h"
+#include "transport_manager/transport_adapter/connection.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter_listener.h"
+#include "transport_manager/transport_adapter/mock_device.h"
+#include "transport_manager/transport_adapter/mock_connection.h"
#include "transport_manager/tcp/mock_tcp_transport_adapter.h"
#include "transport_manager/mock_transport_manager_settings.h"
@@ -58,7 +58,7 @@ class TcpAdapterTest : public ::testing::Test {
protected:
TcpAdapterTest() : last_state_("app_storage_folder", "app_info_storage") {}
MockTransportManagerSettings transport_manager_settings;
- resumption::LastState last_state_;
+ resumption::LastStateImpl last_state_;
const uint32_t port = 12345;
const std::string string_port = "12345";
};
@@ -90,7 +90,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) {
// Check that value is saved
Json::Value& tcp_dict =
- last_state_.dictionary["TransportManager"]["TcpAdapter"];
+ last_state_.get_dictionary()["TransportManager"]["TcpAdapter"];
ASSERT_TRUE(tcp_dict.isObject());
ASSERT_FALSE(tcp_dict["devices"].isNull());
@@ -142,7 +142,8 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) {
// Check that values are saved
Json::Value& tcp_dict =
- last_state_.dictionary["TransportManager"]["TcpAdapter"];
+ last_state_.get_dictionary()["TransportManager"]["TcpAdapter"];
+
ASSERT_TRUE(tcp_dict.isObject());
ASSERT_FALSE(tcp_dict["devices"].isNull());
for (uint32_t i = 0; i < count_dev; i++) {
@@ -199,7 +200,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) {
// Check that value is saved
Json::Value& tcp_dict =
- last_state_.dictionary["TransportManager"]["TcpAdapter"];
+ last_state_.get_dictionary()["TransportManager"]["TcpAdapter"];
ASSERT_TRUE(tcp_dict.isObject());
ASSERT_FALSE(tcp_dict["devices"].isNull());
@@ -236,13 +237,15 @@ TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) {
// Check that value is not saved
Json::Value& tcp_dict =
- last_state_.dictionary["TransportManager"]["TcpAdapter"]["devices"];
+ last_state_.get_dictionary()["TransportManager"]["TcpAdapter"]["devices"];
+
ASSERT_TRUE(tcp_dict.isNull());
}
TEST_F(TcpAdapterTest, RestoreData_DataNotStored) {
Json::Value& tcp_adapter_dictionary =
- last_state_.dictionary["TransportManager"]["TcpAdapter"];
+ last_state_.get_dictionary()["TransportManager"]["TcpAdapter"];
+
tcp_adapter_dictionary = Json::Value();
MockTCPTransportAdapter transport_adapter(
port, last_state_, transport_manager_settings);
diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc
index d56949301c..14b8850b49 100644
--- a/src/components/transport_manager/test/transport_adapter_listener_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc
@@ -31,9 +31,9 @@
*/
#include "gtest/gtest.h"
-#include "transport_manager/transport_adapter_mock.h"
-#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
#include "transport_manager/mock_transport_manager.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter.h"
+#include "transport_manager/transport_adapter/transport_adapter_listener_impl.h"
namespace test {
namespace components {
@@ -45,16 +45,16 @@ using namespace ::transport_manager;
class TransportAdapterListenerTest : public ::testing::Test {
public:
TransportAdapterListenerTest()
- : app_handle(1)
- , dev_id("device_id")
- , transport_listener(&tr_mock, &adapter_mock) {}
+ : dev_id("device_id")
+ , transport_listener(&tr_mock, &adapter_mock)
+ , app_handle(1) {}
protected:
- const int app_handle;
const std::string dev_id;
MockTransportManager tr_mock;
MockTransportAdapter adapter_mock;
TransportAdapterListenerImpl transport_listener;
+ const int app_handle;
};
MATCHER_P4(IsEvent, eventType, adapter, dev_id, app_id, "") {
@@ -73,33 +73,30 @@ MATCHER_P5(IsEvent, eventType, adapter, dev_id, app_id, 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));
+ ReceiveEventFromDevice(IsEvent(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));
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ 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));
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_CONNECT_FAIL, &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnConnectFailed(&adapter_mock, dev_id, app_handle, er);
}
@@ -107,12 +104,12 @@ 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));
+ ReceiveEventFromDevice(IsEvent(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);
}
@@ -120,12 +117,11 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveDone) {
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));
+ EXPECT_CALL(
+ tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ EventTypeEnum::ON_RECEIVED_FAIL, &adapter_mock, dev_id, app_handle)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnDataReceiveFailed(
&adapter_mock, dev_id, app_handle, err);
}
@@ -136,12 +132,12 @@ TEST_F(TransportAdapterListenerTest, OnDataSendDone) {
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));
+ ReceiveEventFromDevice(IsEvent(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);
}
@@ -153,56 +149,50 @@ TEST_F(TransportAdapterListenerTest, OnDataSendFailed) {
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));
+ ReceiveEventFromDevice(IsEvent(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));
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(
+ 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));
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(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));
+ EXPECT_CALL(tr_mock,
+ ReceiveEventFromDevice(IsEvent(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,
+ IsEvent(EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST,
&adapter_mock,
"",
0))).WillOnce(Return(E_SUCCESS));
@@ -211,11 +201,9 @@ TEST_F(TransportAdapterListenerTest, OnFindNewApplicationsRequest) {
TEST_F(TransportAdapterListenerTest, OnSearchDeviceDone) {
EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE,
- &adapter_mock,
- "",
- 0))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(
+ IsEvent(EventTypeEnum::ON_SEARCH_DONE, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnSearchDeviceDone(&adapter_mock);
}
@@ -223,11 +211,9 @@ TEST_F(TransportAdapterListenerTest, OnSearchDeviceFailed) {
SearchDeviceError er;
EXPECT_CALL(tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL,
- &adapter_mock,
- "",
- 0))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(
+ IsEvent(EventTypeEnum::ON_SEARCH_FAIL, &adapter_mock, "", 0)))
+ .WillOnce(Return(E_SUCCESS));
transport_listener.OnSearchDeviceFailed(&adapter_mock, er);
}
@@ -236,11 +222,10 @@ TEST_F(TransportAdapterListenerTest, OnUnexpectedDisconnect) {
EXPECT_CALL(
tr_mock,
- ReceiveEventFromDevice(IsEvent(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
- &adapter_mock,
- dev_id,
- app_handle))).WillOnce(Return(E_SUCCESS));
+ ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
+ &adapter_mock,
+ dev_id,
+ app_handle))).WillOnce(Return(E_SUCCESS));
transport_listener.OnUnexpectedDisconnect(
&adapter_mock, dev_id, app_handle, err);
}
diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc
index bd4c0a3bc1..6d709e0c17 100644
--- a/src/components/transport_manager/test/transport_adapter_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_test.cc
@@ -31,12 +31,12 @@
*/
#include "gtest/gtest.h"
-#include "transport_manager/device_scanner_mock.h"
-#include "transport_manager/client_connection_listener_mock.h"
-#include "transport_manager/server_connection_factory_mock.h"
-#include "transport_manager/device_mock.h"
-#include "transport_manager/connection_mock.h"
-#include "transport_manager/transport_adapter_listener_mock.h"
+#include "transport_manager/transport_adapter/mock_device_scanner.h"
+#include "transport_manager/transport_adapter/mock_client_connection_listener.h"
+#include "transport_manager/transport_adapter/mock_server_connection_factory.h"
+#include "transport_manager/transport_adapter/mock_device.h"
+#include "transport_manager/transport_adapter/mock_connection.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter_listener.h"
#include "transport_manager/transport_adapter/mock_transport_adapter_impl.h"
#include "transport_manager/mock_transport_manager_settings.h"
@@ -46,7 +46,7 @@
#include "transport_manager/transport_adapter/connection.h"
#include "protocol/raw_message.h"
#include "utils/make_shared.h"
-#include "resumption/last_state.h"
+#include "resumption/last_state_impl.h"
#include "config_profile/profile.h"
namespace test {
@@ -74,7 +74,7 @@ class TransportAdapterTest : public ::testing::Test {
}
NiceMock<MockTransportManagerSettings> transport_manager_settings;
- resumption::LastState last_state_;
+ resumption::LastStateImpl last_state_;
std::string dev_id;
std::string uniq_id;
int app_handle;
@@ -159,7 +159,7 @@ TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) {
utils::SharedPtr<MockDevice> mockdev = new MockDevice(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
- std::vector<utils::SharedPtr<Device>> devList;
+ std::vector<utils::SharedPtr<Device> > devList;
devList.push_back(mockdev);
EXPECT_CALL(*mockdev, IsSameAs(_)).WillOnce(Return(true));
@@ -189,9 +189,10 @@ TEST_F(TransportAdapterTest, AddDevice) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ utils::SharedPtr<MockDevice> mockdev =
+ utils::MakeShared<MockDevice>(dev_id, uniq_id);
- EXPECT_CALL(mock_listener, OnDeviceListUpdated(_));
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
}
@@ -276,7 +277,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ utils::SharedPtr<MockDevice> mockdev =
+ utils::MakeShared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -286,6 +288,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) {
int app_handle = 1;
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::FAIL, res);
@@ -303,6 +306,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) {
EXPECT_CALL(*serverMock, IsInitialised()).Times(0);
EXPECT_CALL(*serverMock, CreateConnection(_, _)).Times(0);
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id))
+ .WillOnce(Return(utils::SharedPtr<MockDevice>()));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::BAD_PARAM, res);
@@ -318,7 +323,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ utils::SharedPtr<MockDevice> mockdev =
+ utils::MakeShared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -332,6 +338,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
@@ -347,7 +354,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ utils::SharedPtr<MockDevice> mockdev =
+ utils::MakeShared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -361,6 +369,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
@@ -370,6 +379,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle)).Times(0);
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error newres = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, newres);
@@ -415,7 +425,8 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ utils::SharedPtr<MockDevice> mockdev =
+ utils::MakeShared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -428,6 +439,7 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) {
EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true));
EXPECT_CALL(*serverMock, CreateConnection(uniq_id, app_handle))
.WillOnce(Return(TransportAdapter::OK));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id);
EXPECT_EQ(TransportAdapter::OK, res);
@@ -455,8 +467,9 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
MockTransportAdapterListener mock_listener;
transport_adapter.AddListener(&mock_listener);
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
- EXPECT_CALL(mock_listener, OnDeviceListUpdated(_));
+ utils::SharedPtr<MockDevice> mockdev =
+ utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -465,23 +478,25 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) {
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
-
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
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);
- MockConnection* mock_connection = new MockConnection();
+ utils::SharedPtr<MockConnection> mock_connection =
+ utils::MakeShared<MockConnection>();
transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle);
+ EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter));
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));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
DisconnectDeviceError error;
transport_adapter.DeviceDisconnected(uniq_id, error);
@@ -697,7 +712,8 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
transport_adapter.Init();
- MockDevice* mockdev = new MockDevice(dev_id, uniq_id);
+ utils::SharedPtr<MockDevice> mockdev =
+ utils::MakeShared<MockDevice>(dev_id, uniq_id);
transport_adapter.AddDevice(mockdev);
std::vector<std::string> devList = transport_adapter.GetDeviceList();
@@ -707,6 +723,7 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) {
int app_handle = 1;
std::vector<int> intList = {app_handle};
EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList));
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
std::vector<int> res = transport_adapter.GetApplicationList(uniq_id);
ASSERT_EQ(1u, res.size());
EXPECT_EQ(intList[0], res[0]);
@@ -752,6 +769,8 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_NoDeviseWithAskedId_UNSUCCESS) {
transport_adapter.AddDevice(mock_device);
EXPECT_CALL(*mock_device, LaunchApp(bundle_id)).Times(0);
+ EXPECT_CALL(transport_adapter, FindDevice("test_device_uid1"))
+ .WillOnce(Return(utils::SharedPtr<MockDevice>()));
transport_adapter.RunAppOnDevice("test_device_uid1", bundle_id);
}
@@ -769,10 +788,27 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_DeviseWithAskedIdWasFound_SUCCESS) {
transport_adapter.AddDevice(mock_device);
EXPECT_CALL(*mock_device, LaunchApp(bundle_id));
+ EXPECT_CALL(transport_adapter, FindDevice(device_uid))
+ .WillOnce(Return(mock_device));
transport_adapter.RunAppOnDevice(device_uid, bundle_id);
}
+TEST_F(TransportAdapterTest, StopDevice) {
+ MockTransportAdapterImpl transport_adapter(
+ NULL, NULL, NULL, last_state_, transport_manager_settings);
+ EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true));
+ transport_adapter.Init();
+
+ auto mockdev = utils::MakeShared<MockDevice>(dev_id, uniq_id);
+ transport_adapter.AddDevice(mockdev);
+
+ EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev));
+ EXPECT_CALL(*mockdev, Stop());
+
+ transport_adapter.StopDevice(uniq_id);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/transport_manager/test/transport_manager_default_test.cc b/src/components/transport_manager/test/transport_manager_default_test.cc
index 8207737d93..d095a51cb6 100644
--- a/src/components/transport_manager/test/transport_manager_default_test.cc
+++ b/src/components/transport_manager/test/transport_manager_default_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,44 +29,115 @@
* 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"
-#include "resumption/last_state.h"
#include "transport_manager/mock_transport_manager_settings.h"
-#include "resumption/last_state.h"
+#include "resumption/mock_last_state.h"
namespace test {
namespace components {
namespace transport_manager_test {
+using resumption_test::MockLastState;
using ::testing::Return;
+using ::testing::ReturnRef;
+using ::testing::NiceMock;
+
+namespace {
+const std::string kDeviceName = "name";
+const std::string kDeviceAddress = "address";
+const std::string kDeviceApplications = "applications";
+const std::string kApplicationPort = "port";
+const std::string kApplicationPortValue = "12345";
+const std::string kApplicationRfcomm = "rfcomm_channel";
+const std::string kApplicationRfcommValue = "7";
+const std::string kTransportManager = "TransportManager";
+const std::string kTcpAdapter = "TcpAdapter";
+const std::string kBluetoothAdapter = "BluetoothAdapter";
+const std::string kDevices = "devices";
+} // namespace
TEST(TestTransportManagerDefault, Init_LastStateNotUsed) {
MockTransportManagerSettings transport_manager_settings;
transport_manager::TransportManagerDefault transport_manager(
transport_manager_settings);
- resumption::LastState last_state("app_storage_folder", "app_info_storage2");
+
+ NiceMock<MockLastState> mock_last_state;
+ Json::Value custom_dictionary = Json::Value();
+
+ ON_CALL(mock_last_state, get_dictionary())
+ .WillByDefault(ReturnRef(custom_dictionary));
EXPECT_CALL(transport_manager_settings, use_last_state())
.WillRepeatedly(Return(false));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
- .WillRepeatedly(Return(1u));
- transport_manager.Init(last_state);
+ .WillRepeatedly(Return(12345u));
+
+ transport_manager.Init(mock_last_state);
+ transport_manager.Stop();
}
TEST(TestTransportManagerDefault, Init_LastStateUsed) {
MockTransportManagerSettings transport_manager_settings;
transport_manager::TransportManagerDefault transport_manager(
transport_manager_settings);
- resumption::LastState last_state("app_storage_folder", "app_info_storage2");
+
+ NiceMock<MockLastState> mock_last_state;
+ Json::Value custom_dictionary;
+ Json::Value tcp_device;
+ tcp_device[kDeviceName] = "unique_tcp_device_name";
+ tcp_device[kDeviceAddress] = "127.0.0.1";
+ tcp_device[kDeviceApplications][0][kApplicationPort] = kApplicationPortValue;
+ Json::Value bluetooth_device;
+ bluetooth_device[kDeviceName] = "unique_bluetooth_device_name";
+ bluetooth_device[kDeviceAddress] = "AB:CD:EF:GH:IJ:KL";
+ bluetooth_device[kDeviceApplications][0][kApplicationRfcomm] =
+ kApplicationRfcommValue;
+ custom_dictionary[kTransportManager][kTcpAdapter][kDevices][0] = tcp_device;
+ custom_dictionary[kTransportManager][kBluetoothAdapter][kDevices][0] =
+ bluetooth_device;
+
+ ON_CALL(mock_last_state, get_dictionary())
+ .WillByDefault(ReturnRef(custom_dictionary));
EXPECT_CALL(transport_manager_settings, use_last_state())
.WillRepeatedly(Return(true));
EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
- .WillRepeatedly(Return(1u));
+ .WillRepeatedly(Return(12345u));
+ transport_manager.Init(mock_last_state);
+ transport_manager.Stop();
+}
+
+TEST(TestTransportManagerDefault, Init_LastStateUsed_InvalidPort) {
+ MockTransportManagerSettings transport_manager_settings;
+ transport_manager::TransportManagerDefault transport_manager(
+ transport_manager_settings);
+
+ NiceMock<MockLastState> mock_last_state;
+ Json::Value custom_dictionary;
+ Json::Value tcp_device;
+ tcp_device[kDeviceName] = "unique_tcp_device_name";
+ tcp_device[kDeviceAddress] = "127.0.0.1";
+ tcp_device[kDeviceApplications][0][kApplicationPort] = "1";
+ Json::Value bluetooth_device;
+ bluetooth_device[kDeviceName] = "unique_bluetooth_device_name";
+ bluetooth_device[kDeviceAddress] = "AB:CD:EF:GH:IJ:KL";
+ bluetooth_device[kDeviceApplications][0][kApplicationRfcomm] =
+ kApplicationRfcommValue;
+ custom_dictionary[kTransportManager][kTcpAdapter][kDevices][0] = tcp_device;
+ custom_dictionary[kTransportManager][kBluetoothAdapter][kDevices][0] =
+ bluetooth_device;
- transport_manager.Init(last_state);
+ ON_CALL(mock_last_state, get_dictionary())
+ .WillByDefault(ReturnRef(custom_dictionary));
+
+ EXPECT_CALL(transport_manager_settings, use_last_state())
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port())
+ .WillRepeatedly(Return(1u));
+ transport_manager.Init(mock_last_state);
transport_manager.Stop();
}
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
index 110b41e08b..eebb247908 100644
--- a/src/components/transport_manager/test/transport_manager_impl_test.cc
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -35,24 +35,22 @@
#include "protocol/raw_message.h"
#include "transport_manager/common.h"
#include "transport_manager/transport_manager_impl.h"
-
#include "transport_manager/mock_telemetry_observer.h"
-#include "transport_manager/transport_manager_listener_mock.h"
-#include "transport_manager/mock_transport_adapter_listener.h"
+#include "transport_manager/mock_transport_manager_listener.h"
#include "transport_manager/mock_telemetry_observer.h"
-#include "transport_manager/transport_adapter_mock.h"
+#include "transport_manager/transport_adapter/mock_transport_adapter.h"
#include "transport_manager/mock_transport_manager_impl.h"
#include "transport_manager/mock_transport_manager_settings.h"
-#include "utils/make_shared.h"
+#include "resumption/last_state_impl.h"
#include "utils/shared_ptr.h"
-
-#include "resumption/last_state.h"
#include "utils/make_shared.h"
+#include "utils/test_async_waiter.h"
using ::testing::_;
using ::testing::AtLeast;
using ::testing::Return;
using ::testing::ReturnRef;
+using ::testing::DoAll;
using ::protocol_handler::RawMessage;
using ::protocol_handler::RawMessagePtr;
@@ -63,23 +61,31 @@ namespace test {
namespace components {
namespace transport_manager_test {
+namespace {
const std::string kAppStorageFolder = "app_storage_folder";
const std::string kAppInfoFolder = "app_info_folder";
-const int kAsyncExpectationsTimeout = 10000;
+const uint32_t kAsyncExpectationsTimeout = 10000u;
+}
class TransportManagerImplTest : public ::testing::Test {
protected:
TransportManagerImplTest()
- : tm_(settings)
- , device_handle_(1)
+ : mock_adapter_(NULL)
+ , tm_(mock_transport_manager_settings_)
, mac_address_("MA:CA:DR:ES:S")
- , dev_info_(device_handle_, mac_address_, "TestDeviceName", "BTMAC") {}
+ , connection_type_("BTMAC")
+ , device_name_("TestDeviceName")
+ , device_handle_(
+ tm_.get_converter().UidToHandle(mac_address_, connection_type_))
+ , dev_info_(
+ device_handle_, mac_address_, device_name_, connection_type_) {}
void SetUp() OVERRIDE {
- resumption::LastState last_state_("app_storage_folder", "app_info_storage");
+ resumption::LastStateImpl last_state_("app_storage_folder",
+ "app_info_storage");
tm_.Init(last_state_);
mock_adapter_ = new MockTransportAdapter();
- tm_listener_ = MakeShared<TransportManagerListenerMock>();
+ tm_listener_ = MakeShared<MockTransportManagerListener>();
#ifdef TELEMETRY_MONITOR
tm_.SetTelemetryObserver(&mock_metric_observer_);
@@ -100,11 +106,46 @@ class TransportManagerImplTest : public ::testing::Test {
MakeShared<RawMessage>(connection_key_, version_protocol_, data, kSize);
}
- void HandleDeviceListUpdated() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED);
+ DeviceInfo ConstructDeviceInfo(const std::string& mac_address,
+ const std::string& connection_type,
+ const std::string& device_name) {
+ const auto device_handle(
+ tm_.get_converter().UidToHandle(mac_address, connection_type));
+
+ return DeviceInfo(device_handle, mac_address, device_name, connection_type);
+ }
+
+ void SetOnDeviceExpectations(const DeviceInfo& device_info) {
+ EXPECT_CALL(*tm_listener_, OnDeviceAdded(device_info));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ }
+
+ void SetDeviceExpectations(MockTransportAdapter* mock_adapter,
+ const DeviceList& device_list,
+ const DeviceInfo& device_info) {
+ EXPECT_CALL(*mock_adapter, GetDeviceList())
+ .WillRepeatedly(Return(device_list));
+
+ EXPECT_CALL(*mock_adapter, DeviceName(device_info.mac_address()))
+ .WillRepeatedly(Return(device_info.name()));
+
+ EXPECT_CALL(*mock_adapter, GetConnectionType())
+ .WillRepeatedly(Return(device_info.connection_type()));
+ }
+
+ void SetAddDeviceExpectations(MockTransportAdapter* mock_adapter,
+ transport_adapter::DeviceType type,
+ const DeviceList& device_list,
+ const DeviceInfo& device_info) {
+ SetDeviceExpectations(mock_adapter, device_list, device_info);
- TransportAdapterEvent test_event(type,
+ EXPECT_CALL(*mock_adapter, GetDeviceType()).WillRepeatedly(Return(type));
+
+ SetOnDeviceExpectations(device_info);
+ }
+
+ void HandleDeviceListUpdated() {
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -124,19 +165,15 @@ class TransportManagerImplTest : public ::testing::Test {
.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));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
tm_.TestHandle(test_event);
device_list_.pop_back();
}
void HandleConnection() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_CONNECT_DONE,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -146,7 +183,7 @@ class TransportManagerImplTest : public ::testing::Test {
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()));
+ .WillRepeatedly(Return(dev_info_.connection_type()));
EXPECT_CALL(*tm_listener_,
OnConnectionEstablished(dev_info_, connection_key_));
@@ -155,10 +192,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleConnectionFailed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_CONNECT_FAIL,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -168,7 +202,7 @@ class TransportManagerImplTest : public ::testing::Test {
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()));
+ .WillRepeatedly(Return(dev_info_.connection_type()));
EXPECT_CALL(*tm_listener_, OnConnectionFailed(dev_info_, _));
@@ -176,9 +210,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSendDone() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEND_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -193,9 +225,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleReceiveDone() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -210,10 +240,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSendFailed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEND_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -226,10 +253,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSearchDone() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -242,10 +266,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleSearchFail() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -258,16 +279,13 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleFindNewApplicationsRequest() {
- const 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_);
+ TransportAdapterEvent test_event(
+ EventTypeEnum::ON_FIND_NEW_APPLICATIONS_REQUEST,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_);
EXPECT_CALL(*tm_listener_, OnFindNewApplicationsRequest());
@@ -275,10 +293,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleConnectionClosed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DISCONNECT_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -293,10 +308,7 @@ class TransportManagerImplTest : public ::testing::Test {
}
void HandleDisconnectionFailed() {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DISCONNECT_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -312,19 +324,22 @@ class TransportManagerImplTest : public ::testing::Test {
EXPECT_CALL(*mock_adapter_, Terminate());
ASSERT_EQ(E_SUCCESS, tm_.Stop());
}
- MockTransportManagerSettings settings;
- MockTransportManagerImpl tm_;
+
+ MockTransportManagerSettings mock_transport_manager_settings_;
#ifdef TELEMETRY_MONITOR
MockTMTelemetryObserver mock_metric_observer_;
#endif // TELEMETRY_MONITOR
MockTransportAdapter* mock_adapter_;
- utils::SharedPtr<TransportManagerListenerMock> tm_listener_;
+ utils::SharedPtr<MockTransportManagerListener> tm_listener_;
+ MockTransportManagerImpl tm_;
const ApplicationHandle application_id_ = 1;
ConnectionUID connection_key_;
RawMessagePtr test_message_;
- DeviceHandle device_handle_;
std::string mac_address_;
+ std::string connection_type_;
+ std::string device_name_;
+ DeviceHandle device_handle_;
const DeviceInfo dev_info_;
DeviceList device_list_;
@@ -491,16 +506,19 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice) {
// Arrange
HandleConnection();
+ TestAsyncWaiter waiter;
EXPECT_CALL(*mock_adapter_,
SendData(mac_address_, application_id_, test_message_))
- .WillOnce(Return(TransportAdapter::OK));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(TransportAdapter::OK)));
#ifdef TELEMETRY_MONITOR
EXPECT_CALL(mock_metric_observer_, StartRawMsg(test_message_.get()));
#endif // TELEMETRY_MONITOR
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, SendMessageToDevice_SendingFailed) {
@@ -511,66 +529,81 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice_SendingFailed) {
EXPECT_CALL(mock_metric_observer_, StartRawMsg(_));
#endif // TELEMETRY_MONITOR
+ TestAsyncWaiter waiter;
EXPECT_CALL(*mock_adapter_,
SendData(mac_address_, application_id_, test_message_))
.WillOnce(Return(TransportAdapter::FAIL));
- EXPECT_CALL(*tm_listener_, OnTMMessageSendFailed(_, test_message_));
+ EXPECT_CALL(*tm_listener_, OnTMMessageSendFailed(_, test_message_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
#ifdef TELEMETRY_MONITOR
EXPECT_CALL(mock_metric_observer_, StopRawMsg(_)).Times(0);
#endif // TELEMETRY_MONITOR
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, SendMessageToDevice_StartTimeObserver) {
// Arrange
HandleConnection();
+
+ TestAsyncWaiter waiter;
EXPECT_CALL(*mock_adapter_,
SendData(mac_address_, application_id_, test_message_))
- .WillOnce(Return(TransportAdapter::OK));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(TransportAdapter::OK)));
#ifdef TELEMETRY_MONITOR
EXPECT_CALL(mock_metric_observer_, StartRawMsg(_));
#endif // TELEMETRY_MONITOR
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, SendMessageToDevice_SendDone) {
// Arrange
HandleConnection();
+ TestAsyncWaiter waiter;
EXPECT_CALL(*mock_adapter_,
SendData(mac_address_, application_id_, test_message_))
- .WillOnce(Return(TransportAdapter::OK));
+ .WillOnce(
+ DoAll(NotifyTestAsyncWaiter(&waiter), Return(TransportAdapter::OK)));
+
#ifdef TELEMETRY_MONITOR
EXPECT_CALL(mock_metric_observer_, StartRawMsg(test_message_.get()));
#endif // TELEMETRY_MONITOR
+
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
HandleSendDone();
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, SendMessageFailed_GetHandleSendFailed) {
// Arrange
HandleConnection();
+ TestAsyncWaiter waiter;
EXPECT_CALL(*mock_adapter_,
SendData(mac_address_, application_id_, test_message_))
- .WillOnce(Return(TransportAdapter::FAIL));
+ .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter),
+ Return(TransportAdapter::FAIL)));
+
#ifdef TELEMETRY_MONITOR
EXPECT_CALL(mock_metric_observer_, StartRawMsg(test_message_.get()));
#endif // TELEMETRY_MONITOR
+
EXPECT_CALL(*tm_listener_, OnTMMessageSendFailed(_, test_message_));
EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_));
HandleSendFailed();
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, RemoveDevice_DeviceWasAdded) {
@@ -624,78 +657,72 @@ TEST_F(TransportManagerImplTest, Reinit_InitAdapterFailed) {
TEST_F(TransportManagerImplTest, UpdateDeviceList_AddNewDevice) {
device_list_.push_back(dev_info_.mac_address());
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- 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_);
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
device_list_.pop_back();
}
TEST_F(TransportManagerImplTest, UpdateDeviceList_RemoveDevice) {
device_list_.push_back(dev_info_.mac_address());
-
- ::testing::InSequence seq;
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- 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_);
+ {
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ ::testing::InSequence s;
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
+ }
device_list_.pop_back();
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+
// Device list is empty now
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
+ ::testing::InSequence s;
EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
- tm_.UpdateDeviceList(mock_adapter_);
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ tm_.OnDeviceListUpdated(mock_adapter_);
}
/*
* Tests which check correct handling and receiving events
*/
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceDone) {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
-
- TransportAdapterEvent test_event(type,
+ TestAsyncWaiter waiter;
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_DONE,
mock_adapter_,
mac_address_,
application_id_,
test_message_,
error_);
- EXPECT_CALL(*tm_listener_, OnScanDevicesFinished());
+ EXPECT_CALL(*tm_listener_, OnScanDevicesFinished())
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
tm_.ReceiveEventFromDevice(test_event);
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TestAsyncWaiter waiter;
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_FAIL,
mock_adapter_,
mac_address_,
application_id_,
test_message_,
error_);
- EXPECT_CALL(*tm_listener_, OnScanDevicesFailed(_));
+ EXPECT_CALL(*tm_listener_, OnScanDevicesFailed(_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
tm_.ReceiveEventFromDevice(test_event);
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) {
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
mock_adapter_,
dev_info_.mac_address(),
application_id_,
@@ -705,6 +732,7 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) {
std::vector<DeviceInfo> vector_dev_info;
vector_dev_info.push_back(dev_info_);
+ TestAsyncWaiter waiter;
EXPECT_CALL(*mock_adapter_, GetDeviceList())
.Times(AtLeast(1))
.WillRepeatedly(Return(device_list_));
@@ -715,13 +743,15 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) {
.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));
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
+ EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
tm_.ReceiveEventFromDevice(test_event);
device_list_.pop_back();
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+
+ EXPECT_TRUE(waiter.WaitFor(2, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, CheckEvents) {
@@ -745,10 +775,7 @@ TEST_F(TransportManagerImplTest, CheckReceiveEvent) {
TEST_F(TransportManagerImplTest, CheckReceiveFailedEvent) {
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -763,10 +790,7 @@ TEST_F(TransportManagerImplTest, CheckReceiveFailedEvent) {
TEST_F(TransportManagerImplTest, CheckUnexpectedDisconnect) {
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
mock_adapter_,
mac_address_,
application_id_,
@@ -848,10 +872,12 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice_ConnectionNotExist) {
TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_TMIsNotInitialized) {
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE);
- TransportAdapterEvent test_event(
- type, NULL, mac_address_, application_id_, test_message_, error_);
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEARCH_DONE,
+ NULL,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_);
// Check before Act
UninitializeTM();
// Act and Assert
@@ -879,10 +905,14 @@ TEST_F(TransportManagerImplTest, Visibility_TMIsNotInitialized) {
TEST_F(TransportManagerImplTest, HandleMessage_ConnectionNotExist) {
EXPECT_CALL(*mock_adapter_,
SendData(mac_address_, application_id_, test_message_)).Times(0);
- EXPECT_CALL(*tm_listener_, OnTMMessageSendFailed(_, test_message_));
+
+ TestAsyncWaiter waiter;
+ EXPECT_CALL(*tm_listener_, OnTMMessageSendFailed(_, test_message_))
+ .WillOnce(NotifyTestAsyncWaiter(&waiter));
tm_.TestHandle(test_message_);
- testing::Mock::AsyncVerifyAndClearExpectations(kAsyncExpectationsTimeout);
+
+ EXPECT_TRUE(waiter.WaitFor(1, kAsyncExpectationsTimeout));
}
TEST_F(TransportManagerImplTest, SearchDevices_TMIsNotInitialized) {
@@ -907,84 +937,10 @@ TEST_F(TransportManagerImplTest,
}
TEST_F(TransportManagerImplTest,
- UpdateDeviceList_AddDevices_TwoTransportAdapters) {
- // Arrange
- MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
- device_list_.push_back(dev_info_.mac_address());
- // Check before Act
- EXPECT_CALL(*second_mock_adapter, AddListener(_));
- EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
- EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
-
- // Act and Assert
- EXPECT_CALL(*second_mock_adapter, GetDeviceList())
- .WillOnce(Return(device_list_));
- EXPECT_CALL(*second_mock_adapter, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*second_mock_adapter, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- tm_.UpdateDeviceList(second_mock_adapter);
-
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- 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_);
-
- device_list_.pop_back();
-}
-
-TEST_F(TransportManagerImplTest,
- UpdateDeviceList_RemoveDevices_TwoTransportAdapters) {
- // Arrange
- MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
- device_list_.push_back(dev_info_.mac_address());
- // Check before Act
- EXPECT_CALL(*second_mock_adapter, AddListener(_));
- EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
- EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
-
- // Act and Assert
- EXPECT_CALL(*second_mock_adapter, GetDeviceList())
- .WillOnce(Return(device_list_));
- EXPECT_CALL(*second_mock_adapter, DeviceName(dev_info_.mac_address()))
- .WillOnce(Return(dev_info_.name()));
- EXPECT_CALL(*second_mock_adapter, GetConnectionType())
- .WillOnce(Return(dev_info_.connection_type()));
- EXPECT_CALL(*tm_listener_, OnDeviceAdded(dev_info_));
- tm_.UpdateDeviceList(second_mock_adapter);
-
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- 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_);
-
- device_list_.pop_back();
-
- EXPECT_CALL(*second_mock_adapter, GetDeviceList())
- .WillOnce(Return(device_list_));
- EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
- tm_.UpdateDeviceList(second_mock_adapter);
-
- EXPECT_CALL(*mock_adapter_, GetDeviceList()).WillOnce(Return(device_list_));
- EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
- tm_.UpdateDeviceList(mock_adapter_);
-}
-
-TEST_F(TransportManagerImplTest,
CheckEventOnDisconnectDone_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_DISCONNECT_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -1000,10 +956,7 @@ TEST_F(TransportManagerImplTest,
TEST_F(TransportManagerImplTest, CheckEventOnSendDone_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE);
-
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_SEND_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -1021,9 +974,7 @@ TEST_F(TransportManagerImplTest, CheckEventOnSendDone_ConnectionNotExist) {
TEST_F(TransportManagerImplTest, CheckEventOnReceivedDone_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_DONE,
mock_adapter_,
mac_address_,
application_id_,
@@ -1040,9 +991,7 @@ TEST_F(TransportManagerImplTest, CheckEventOnReceivedDone_ConnectionNotExist) {
TEST_F(TransportManagerImplTest, CheckEventOnReceivedFail_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_RECEIVED_FAIL,
mock_adapter_,
mac_address_,
application_id_,
@@ -1057,9 +1006,7 @@ TEST_F(TransportManagerImplTest,
CheckEventOnUnexpectedDisconnect_ConnectionNotExist) {
// SetUp does not add connections
// Arrange
- const int type = static_cast<int>(
- TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT);
- TransportAdapterEvent test_event(type,
+ TransportAdapterEvent test_event(EventTypeEnum::ON_UNEXPECTED_DISCONNECT,
mock_adapter_,
mac_address_,
application_id_,
@@ -1077,6 +1024,305 @@ TEST_F(TransportManagerImplTest, RunAppOnDevice_TransportAdapterFound_SUCCESS) {
tm_.RunAppOnDevice(device_handle_, bundle_id);
}
+TEST_F(TransportManagerImplTest,
+ UpdateDeviceList_AddDevices_TwoTransportAdapters_ExpectSuccess) {
+ // Arrange
+ MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
+ device_list_.push_back(dev_info_.mac_address());
+ // Check before Act
+ EXPECT_CALL(*second_mock_adapter, AddListener(_));
+ EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
+ EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
+
+ // Act and Assert
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
+
+ const std::string mac_address("NE:WA:DR:ES:SS");
+ const std::string connection_type("TCP");
+ const std::string device_name("TestName");
+ const transport_manager::DeviceHandle device_handle(
+ tm_.get_converter().UidToHandle(mac_address, connection_type));
+
+ DeviceInfo second_device(
+ device_handle, mac_address, device_name, connection_type);
+ DeviceList device_list_2;
+ device_list_2.push_back(second_device.mac_address());
+
+ SetDeviceExpectations(second_mock_adapter, device_list_2, second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(second_device));
+ SetOnDeviceExpectations(second_device);
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ device_list_.pop_back();
+}
+
+TEST_F(
+ TransportManagerImplTest,
+ UpdateDeviceList_AddSameUUIDNonSwitchableDevices_TwoTransportAdapters_ExpectNoSwitch) {
+ device_list_.push_back(dev_info_.mac_address());
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::TCP,
+ device_list_,
+ dev_info_);
+
+ tm_.OnDeviceListUpdated(mock_adapter_);
+
+ // Adapter will be removed by TM on destruction
+ MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
+ EXPECT_CALL(*second_mock_adapter, AddListener(_));
+ EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
+ EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
+
+ const auto usb_serial = "USB_serial";
+ DeviceInfo second_device =
+ ConstructDeviceInfo(usb_serial, "USB_IOS", "SecondDeviceName");
+
+ DeviceList second_adapter_device_list;
+ second_adapter_device_list.push_back(usb_serial);
+
+ SetAddDeviceExpectations(second_mock_adapter,
+ transport_adapter::DeviceType::IOS_USB,
+ second_adapter_device_list,
+ second_device);
+
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ // Act
+ EXPECT_CALL(*second_mock_adapter, StopDevice(_)).Times(0);
+ EXPECT_CALL(*second_mock_adapter, DeviceSwitched(_)).Times(0);
+
+ tm_.TestHandle(
+ TransportAdapterEvent(EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
+ second_mock_adapter,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest, OnlyOneDeviceShouldNotTriggerSwitch) {
+ device_list_.push_back(dev_info_.mac_address());
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+ SetOnDeviceExpectations(dev_info_);
+
+ EXPECT_CALL(*mock_adapter_, StopDevice(_)).Times(0);
+ EXPECT_CALL(*mock_adapter_, DeviceSwitched(_)).Times(0);
+ EXPECT_CALL(*tm_listener_, OnDeviceSwitchingStart(_, _)).Times(0);
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest,
+ TwoTransportAdapterAddSameSwitchableDevice_ExpectSuccess) {
+ device_list_.push_back(dev_info_.mac_address());
+ const uint32_t timeout = 0;
+
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::IOS_BT,
+ device_list_,
+ dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ auto second_mock_adapter = utils::MakeShared<MockTransportAdapter>();
+
+ const auto usb_serial = "USB_serial";
+ DeviceInfo second_device =
+ ConstructDeviceInfo(usb_serial, "USB_IOS", "SecondDeviceName");
+
+ DeviceList second_adapter_devices;
+ second_adapter_devices.push_back(second_device.mac_address());
+
+ SetAddDeviceExpectations(second_mock_adapter.get(),
+ transport_adapter::DeviceType::IOS_USB,
+ second_adapter_devices,
+ second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(second_device));
+ EXPECT_CALL(*second_mock_adapter, DeviceSwitched(_)).Times(0);
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ second_mock_adapter.get(),
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ // Act
+ const auto uuid = "ABC-DEF-GHJ-KLM";
+ SwitchableDevices bt_switchables;
+ bt_switchables.insert(std::make_pair(dev_info_.mac_address(), uuid));
+ EXPECT_CALL(*mock_adapter_, GetSwitchableDevices())
+ .WillOnce(Return(bt_switchables));
+
+ SwitchableDevices usb_switchables;
+ usb_switchables.insert(std::make_pair(second_device.mac_address(), uuid));
+ EXPECT_CALL(*second_mock_adapter, GetSwitchableDevices())
+ .WillOnce(Return(usb_switchables));
+
+ EXPECT_CALL(*mock_adapter_, StopDevice(mac_address_));
+ EXPECT_CALL(*second_mock_adapter, DeviceSwitched(usb_serial));
+ EXPECT_CALL(mock_transport_manager_settings_, app_transport_change_timer())
+ .WillOnce(Return(timeout));
+ EXPECT_CALL(mock_transport_manager_settings_,
+ app_transport_change_timer_addition()).WillOnce(Return(0));
+
+ EXPECT_CALL(*tm_listener_, OnDeviceSwitchingStart(mac_address_, usb_serial));
+
+ tm_.TestHandle(
+ TransportAdapterEvent(EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
+ second_mock_adapter.get(),
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ // There is internal timer started on switching. Need to wait for timeout.
+ sleep(1);
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest,
+ TwoTransportAdapterAddSameDeviceSecondSkipped) {
+ device_list_.push_back(dev_info_.mac_address());
+
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::IOS_BT,
+ device_list_,
+ dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(_));
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ auto second_mock_adapter = utils::MakeShared<MockTransportAdapter>();
+
+ DeviceInfo second_device =
+ ConstructDeviceInfo("MA:CA:DR:ES:S", "USB_IOS", "SecondDeviceName");
+
+ SetAddDeviceExpectations(second_mock_adapter.get(),
+ transport_adapter::DeviceType::IOS_USB,
+ device_list_,
+ second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(_)).Times(0);
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ second_mock_adapter.get(),
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest, NoDeviceTransportSwitchRequest_Fail) {
+ device_list_.push_back(dev_info_.mac_address());
+ SetAddDeviceExpectations(mock_adapter_,
+ transport_adapter::DeviceType::IOS_USB,
+ device_list_,
+ dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(_));
+
+ tm_.TestHandle(TransportAdapterEvent(EventTypeEnum::ON_DEVICE_LIST_UPDATED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ EXPECT_CALL(*mock_adapter_, StopDevice(mac_address_)).Times(0);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceSwitchingStart(mac_address_, mac_address_))
+ .Times(0);
+
+ tm_.TestHandle(
+ TransportAdapterEvent(EventTypeEnum::ON_TRANSPORT_SWITCH_REQUESTED,
+ mock_adapter_,
+ mac_address_,
+ application_id_,
+ test_message_,
+ error_));
+
+ device_list_.pop_back();
+}
+
+TEST_F(TransportManagerImplTest,
+ UpdateDeviceList_RemoveDevices_TwoTransportAdapters_ExpectSuccess) {
+ // Arrange
+ MockTransportAdapter* second_mock_adapter = new MockTransportAdapter();
+ device_list_.push_back(dev_info_.mac_address());
+ // Check before Act
+ EXPECT_CALL(*second_mock_adapter, AddListener(_));
+ EXPECT_CALL(*second_mock_adapter, IsInitialised()).WillOnce(Return(true));
+ EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(second_mock_adapter));
+
+ // Act and Assert
+ SetDeviceExpectations(mock_adapter_, device_list_, dev_info_);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(dev_info_));
+ SetOnDeviceExpectations(dev_info_);
+ tm_.OnDeviceListUpdated(mock_adapter_);
+
+ const std::string mac_address("NE:WA:DR:ES:SS");
+ const std::string connection_type("TCP");
+ const std::string device_name("TestName");
+ const transport_manager::DeviceHandle device_handle(
+ tm_.get_converter().UidToHandle(mac_address, connection_type));
+
+ DeviceInfo second_device(
+ device_handle, mac_address, device_name, connection_type);
+ DeviceList device_list_2;
+ device_list_2.push_back(second_device.mac_address());
+ SetDeviceExpectations(second_mock_adapter, device_list_2, second_device);
+
+ EXPECT_CALL(*tm_listener_, OnDeviceFound(second_device));
+ SetOnDeviceExpectations(second_device);
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ device_list_.pop_back();
+ device_list_2.pop_back();
+
+ EXPECT_CALL(*second_mock_adapter, GetDeviceList())
+ .WillRepeatedly(Return(device_list_2));
+ EXPECT_CALL(*tm_listener_, OnDeviceRemoved(second_device));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ tm_.OnDeviceListUpdated(second_mock_adapter);
+
+ EXPECT_CALL(*mock_adapter_, GetDeviceList())
+ .WillRepeatedly(Return(device_list_));
+ EXPECT_CALL(*tm_listener_, OnDeviceRemoved(dev_info_));
+ EXPECT_CALL(*tm_listener_, OnDeviceListUpdated(_));
+ tm_.OnDeviceListUpdated(mock_adapter_);
+}
+
} // namespace transport_manager_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/CMakeLists.txt b/src/components/utils/CMakeLists.txt
index f72d43e546..51835c125a 100644
--- a/src/components/utils/CMakeLists.txt
+++ b/src/components/utils/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,62 +28,77 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
-set(UTILS_INCLUDE_DIR ${COMPONENTS_DIR}/utils/include)
-set(UTILS_SRC_DIR ${COMPONENTS_DIR}/utils/src)
+find_package(Sqlite3 REQUIRED)
include_directories (
- ${UTILS_INCLUDE_DIR}
+ ${COMPONENTS_DIR}/utils/include
${COMPONENTS_DIR}/config_profile/include
${COMPONENTS_DIR}/media_manager/include
${COMPONENTS_DIR}/protocol_handler/include
${LOG4CXX_INCLUDE_DIRECTORY}
)
-set (SOURCES
- ${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
- ${UTILS_SRC_DIR}/convert_utils.cc
- ${UTILS_SRC_DIR}/custom_string.cc
- ${UTILS_SRC_DIR}/timer.cc
+# dbms
+set(DBMS_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/utils/sqlite_wrapper
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/sqlite_wrapper
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/utils/qdb_wrapper
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/qdb_wrapper
)
+set(EXCLUDE_PATHS
+ thread_manager.cc
+ pulse_thread_delegate.cc
+ ${DBMS_PATHS}
+)
+
+set(LIBRARIES)
+
+if(NOT BUILD_BACKTRACE_SUPPORT)
+ list(APPEND EXCLUDE_PATHS
+ back_trace.cc
+ )
+endif()
+
if(ENABLE_LOG)
- list(APPEND SOURCES
- ${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
+ list(APPEND LIBRARIES
+ log4cxx -L${LOG4CXX_LIBS_DIRECTORY}
+ apr-1 -L${APR_LIBS_DIRECTORY}
+ aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY}
+ ConfigProfile
+ )
+else()
+ list(APPEND EXCLUDE_PATHS
+ push_log.cc
+ log_message_loop_thread.cc
+ logger_status.cc
+ auto_trace.cc
+ logger.cc
)
endif()
-if (BUILD_BACKTRACE_SUPPORT)
- list(APPEND SOURCES
- ${UTILS_SRC_DIR}/back_trace.cc
- )
+if(NOT BUILD_BT_SUPPORT)
+ list(APPEND EXCLUDE_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/utils/bluetooth
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/bluetooth
+ )
endif()
-if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- list(APPEND SOURCES
- ${UTILS_SRC_DIR}/threads/pulse_thread_delegate.cc
+if (NOT CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ list(APPEND EXCLUDE_PATHS
+ pulse_thread_delegate.cc
)
endif()
-add_library("Utils" ${SOURCES})
+set(PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
+)
+
+collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}")
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
# --- QDB Wrapper
@@ -94,26 +109,16 @@ else ()
endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- list(APPEND LIBRARIES dl)
+ list(APPEND LIBRARIES dl pthread ${RTLIB})
endif()
+add_library("Utils" ${SOURCES})
+target_link_libraries("Utils" ${LIBRARIES})
if(ENABLE_LOG)
- list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY})
- list(APPEND LIBRARIES apr-1 -L${APR_LIBS_DIRECTORY})
- list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY})
- list(APPEND LIBRARIES ConfigProfile)
-
- ADD_DEPENDENCIES(Utils install-3rd_party_logger)
+ add_dependencies("Utils" install-3rd_party_logger)
endif()
-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/file_system.h b/src/components/utils/include/utils/file_system.h
index 5862241c9c..22c200934f 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -38,6 +38,7 @@
#include <string>
#include <vector>
#include <iostream>
+#include <fstream>
namespace file_system {
@@ -153,6 +154,14 @@ std::string CurrentWorkingDirectory();
std::string GetAbsolutePath(const std::string& path);
/**
+ * @brief Checks if file name contains invalid symbols e.g. '/'
+ * @param file_name file name to check
+ * @return true if file name does not contain any invalid symbol otherwise
+ * returns false
+ */
+bool IsFileNameValid(const std::string& file_name);
+
+/**
* @brief Removes file
*
* @param name path to file
diff --git a/src/components/utils/include/utils/helpers.h b/src/components/utils/include/utils/helpers.h
index f44bdfea9b..f13d69aa83 100644
--- a/src/components/utils/include/utils/helpers.h
+++ b/src/components/utils/include/utils/helpers.h
@@ -29,8 +29,8 @@
* 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
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H_
#include <algorithm>
/**
* These helpers allows to simplify compare strategy between some objects.
@@ -134,4 +134,4 @@ bool in_range(const Container& container,
}
}
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_HELPERS_H
+#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 deea1a07c0..d6a9edd072 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -66,6 +66,8 @@ class LogMessageLoopThread : public LogMessageLoopThreadTemplate {
LogMessageLoopThread();
~LogMessageLoopThread();
+ private:
+ LogMessageHandler* handler_;
DISALLOW_COPY_AND_ASSIGN(LogMessageLoopThread);
};
diff --git a/src/components/utils/include/utils/qdb_wrapper/sql_database.h b/src/components/utils/include/utils/qdb_wrapper/sql_database.h
index ba5c8a722a..a9c17c0a56 100644
--- a/src/components/utils/include/utils/qdb_wrapper/sql_database.h
+++ b/src/components/utils/include/utils/qdb_wrapper/sql_database.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_DATABASE_H_
-#define SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_DATABASE_H_
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_DATABASE_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_DATABASE_H_
#include <qdb/qdb.h>
#include <string>
@@ -132,4 +132,4 @@ class SQLDatabase {
} // namespace dbms
} // namespace utils
-#endif // SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_DATABASE_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_DATABASE_H_
diff --git a/src/components/utils/include/utils/qdb_wrapper/sql_error.h b/src/components/utils/include/utils/qdb_wrapper/sql_error.h
index 25fd558308..b02f7689e7 100644
--- a/src/components/utils/include/utils/qdb_wrapper/sql_error.h
+++ b/src/components/utils/include/utils/qdb_wrapper/sql_error.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_ERROR_H_
-#define SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_ERROR_H_
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_ERROR_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_ERROR_H_
#include <string>
@@ -77,4 +77,4 @@ class SQLError {
} // namespace dbms
} // namespace utils
-#endif // SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_ERROR_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_ERROR_H_
diff --git a/src/components/utils/include/utils/qdb_wrapper/sql_query.h b/src/components/utils/include/utils/qdb_wrapper/sql_query.h
index f1da6ccad9..bc3e7a592b 100644
--- a/src/components/utils/include/utils/qdb_wrapper/sql_query.h
+++ b/src/components/utils/include/utils/qdb_wrapper/sql_query.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_QUERY_H_
-#define SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_QUERY_H_
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_QUERY_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_QUERY_H_
#include <stdint.h>
#include <qdb/qdb.h>
@@ -262,4 +262,4 @@ class SQLQuery {
} // namespace dbms
} // namespace utils
-#endif // SRC_COMPONENTS_POLICY_QDB_WRAPPER_INCLUDE_QDB_WRAPPER_SQL_QUERY_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_QDB_WRAPPER_SQL_QUERY_H_
diff --git a/src/components/utils/include/utils/resource_usage.h b/src/components/utils/include/utils/resource_usage.h
index 4dd8a7eafd..d358c49225 100644
--- a/src/components/utils/include/utils/resource_usage.h
+++ b/src/components/utils/include/utils/resource_usage.h
@@ -173,4 +173,4 @@ class Resources {
};
}
-#endif /* SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RESOURCE_USAGE_H_ */
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_RESOURCE_USAGE_H_
diff --git a/src/components/utils/include/utils/signals.h b/src/components/utils/include/utils/signals.h
index 48120d53cd..72d29a9e28 100644
--- a/src/components/utils/include/utils/signals.h
+++ b/src/components/utils/include/utils/signals.h
@@ -46,4 +46,4 @@ bool WaitTerminationSignals(sighandler_t sig_handler);
} // namespace utils
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SIGNALS_H_
diff --git a/src/components/utils/include/utils/sqlite_wrapper/sql_database.h b/src/components/utils/include/utils/sqlite_wrapper/sql_database.h
index 8b78881473..f68c5e215e 100644
--- a/src/components/utils/include/utils/sqlite_wrapper/sql_database.h
+++ b/src/components/utils/include/utils/sqlite_wrapper/sql_database.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_DATABASE_H_
-#define SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_DATABASE_H_
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_DATABASE_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_DATABASE_H_
#include <string>
#include "utils/sqlite_wrapper/sql_error.h"
@@ -169,4 +169,4 @@ class SQLDatabase {
} // namespace dbms
} // namespace utils
-#endif // SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_DATABASE_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_DATABASE_H_
diff --git a/src/components/utils/include/utils/sqlite_wrapper/sql_error.h b/src/components/utils/include/utils/sqlite_wrapper/sql_error.h
index 8a53e12169..e7dd2e5017 100644
--- a/src/components/utils/include/utils/sqlite_wrapper/sql_error.h
+++ b/src/components/utils/include/utils/sqlite_wrapper/sql_error.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_ERROR_H_
-#define SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_ERROR_H_
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_ERROR_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_ERROR_H_
#include <string>
@@ -106,4 +106,4 @@ class SQLError {
} // namespace dbms
} // namespace utils
-#endif // SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_ERROR_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_ERROR_H_
diff --git a/src/components/utils/include/utils/sqlite_wrapper/sql_query.h b/src/components/utils/include/utils/sqlite_wrapper/sql_query.h
index de75e37c62..dc45be7ed1 100644
--- a/src/components/utils/include/utils/sqlite_wrapper/sql_query.h
+++ b/src/components/utils/include/utils/sqlite_wrapper/sql_query.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_QUERY_H_
-#define SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_QUERY_H_
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_QUERY_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_QUERY_H_
#include <stdint.h>
#include <string>
@@ -230,4 +230,4 @@ class SQLQuery {
} // namespace dbms
} // namespace utils
-#endif // SRC_COMPONENTS_POLICY_SQLITE_WRAPPER_INCLUDE_SQLITE_WRAPPER_SQL_QUERY_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_SQLITE_WRAPPER_SQL_QUERY_H_
diff --git a/src/components/utils/include/utils/threads/thread_validator.h b/src/components/utils/include/utils/threads/thread_validator.h
index 2e7dac02ab..97611657d3 100644
--- a/src/components/utils/include/utils/threads/thread_validator.h
+++ b/src/components/utils/include/utils/threads/thread_validator.h
@@ -29,8 +29,8 @@
* 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_THREADS_THREAD_VALIDATOR_H_
-#define SRC_COMPONENTS_UTILS_INCLUDE_THREADS_THREAD_VALIDATOR_H_
+#ifndef SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_VALIDATOR_H_
+#define SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_VALIDATOR_H_
#include "utils/threads/thread.h"
@@ -104,4 +104,4 @@ class SingleThreadValidator {
} // namespace threads
-#endif // SRC_COMPONENTS_UTILS_INCLUDE_THREADS_THREAD_VALIDATOR_H_
+#endif // SRC_COMPONENTS_UTILS_INCLUDE_UTILS_THREADS_THREAD_VALIDATOR_H_
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index 91ff0c3b07..62a91ad1f3 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -60,8 +60,11 @@ uint64_t file_system::GetAvailableDiskSpace(const std::string& path) {
int64_t file_system::FileSize(const std::string& path) {
if (file_system::FileExists(path)) {
struct stat file_info = {0};
- stat(path.c_str(), &file_info);
- return file_info.st_size;
+ if (0 != stat(path.c_str(), &file_info)) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file size: " << path);
+ } else {
+ return file_info.st_size;
+ }
}
return 0;
}
@@ -70,15 +73,8 @@ size_t file_system::DirectorySize(const std::string& path) {
size_t size = 0;
int32_t return_code = 0;
DIR* directory = NULL;
-
-#ifndef __QNXNTO__
struct dirent dir_element_;
struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer = new char[offsetof(struct dirent, d_name) +
- pathconf(path.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
struct dirent* result = NULL;
struct stat file_info = {0};
directory = opendir(path.c_str());
@@ -100,15 +96,14 @@ size_t file_system::DirectorySize(const std::string& path) {
}
}
closedir(directory);
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
return size;
}
std::string file_system::CreateDirectory(const std::string& name) {
if (!DirectoryExists(name)) {
- mkdir(name.c_str(), S_IRWXU);
+ if (0 != mkdir(name.c_str(), S_IRWXU)) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Unable to create directory: " << name);
+ }
}
return name;
@@ -222,6 +217,10 @@ std::string file_system::GetAbsolutePath(const std::string& path) {
return std::string(abs_path);
}
+bool file_system::IsFileNameValid(const std::string& file_name) {
+ return file_name.end() == std::find(file_name.begin(), file_name.end(), '/');
+}
+
bool file_system::DeleteFile(const std::string& name) {
if (FileExists(name) && IsAccessible(name, W_OK)) {
return !remove(name.c_str());
@@ -232,15 +231,8 @@ bool file_system::DeleteFile(const std::string& name) {
void file_system::remove_directory_content(const std::string& directory_name) {
int32_t return_code = 0;
DIR* directory = NULL;
-#ifndef __QNXNTO__
struct dirent dir_element_;
struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer =
- new char[offsetof(struct dirent, d_name) +
- pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
struct dirent* result = NULL;
directory = opendir(directory_name.c_str());
@@ -261,15 +253,15 @@ void file_system::remove_directory_content(const std::string& directory_name) {
remove_directory_content(full_element_path);
rmdir(full_element_path.c_str());
} else {
- remove(full_element_path.c_str());
+ if (0 != remove(full_element_path.c_str())) {
+ LOG4CXX_WARN_WITH_ERRNO(
+ logger_, "Unable to remove file: " << full_element_path);
+ }
}
}
}
closedir(directory);
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
}
bool file_system::RemoveDirectory(const std::string& directory_name,
@@ -305,15 +297,8 @@ std::vector<std::string> file_system::ListFiles(
int32_t return_code = 0;
DIR* directory = NULL;
-#ifndef __QNXNTO__
struct dirent dir_element_;
struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer =
- new char[offsetof(struct dirent, d_name) +
- pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
struct dirent* result = NULL;
directory = opendir(directory_name.c_str());
@@ -333,10 +318,6 @@ std::vector<std::string> file_system::ListFiles(
closedir(directory);
}
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
-
return listFiles;
}
@@ -411,12 +392,10 @@ bool file_system::CreateFile(const std::string& path) {
uint64_t file_system::GetFileModificationTime(const std::string& path) {
struct stat info;
- stat(path.c_str(), &info);
-#ifndef __QNXNTO__
+ if (0 != stat(path.c_str(), &info)) {
+ LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file mod time: " << path);
+ }
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) {
diff --git a/src/components/utils/src/lock_posix.cc b/src/components/utils/src/lock_posix.cc
index 0a678123f0..9b90ad20b9 100644
--- a/src/components/utils/src/lock_posix.cc
+++ b/src/components/utils/src/lock_posix.cc
@@ -80,7 +80,7 @@ void Lock::Acquire() {
LOG4CXX_FATAL(logger_,
"Failed to acquire mutex " << &mutex_ << ": "
<< strerror(status));
- DCHECK(status != 0);
+ NOTREACHED();
} else {
AssertFreeAndMarkTaken();
}
diff --git a/src/components/utils/src/log_message_loop_thread.cc b/src/components/utils/src/log_message_loop_thread.cc
index 77bc8107eb..2b7f28fbfd 100644
--- a/src/components/utils/src/log_message_loop_thread.cc
+++ b/src/components/utils/src/log_message_loop_thread.cc
@@ -44,12 +44,14 @@ void LogMessageHandler::Handle(const LogMessage message) {
}
LogMessageLoopThread::LogMessageLoopThread()
- : LogMessageLoopThreadTemplate("Logger", new LogMessageHandler()) {}
+ : LogMessageLoopThreadTemplate("Logger",
+ handler_ = new LogMessageHandler()) {}
LogMessageLoopThread::~LogMessageLoopThread() {
// we'll have to drop messages
// while deleting logger thread
logger_status = DeletingLoggerThread;
+ delete handler_;
}
} // namespace logger
diff --git a/src/components/utils/src/qdb_wrapper/CMakeLists.txt b/src/components/utils/src/qdb_wrapper/CMakeLists.txt
index c19321568e..6a10c3aa10 100644
--- a/src/components/utils/src/qdb_wrapper/CMakeLists.txt
+++ b/src/components/utils/src/qdb_wrapper/CMakeLists.txt
@@ -29,26 +29,27 @@
# POSSIBILITY OF SUCH DAMAGE.
set(target dbms)
+set(QDB_SRC_DIR ${COMPONENTS_DIR}/utils/src/qdb_wrapper)
-include_directories(${COMPONENTS_DIR}/utils/include/utils)
+include_directories(${COMPONENTS_DIR}/utils/include/)
set(SOURCES
- ./sql_database.cc
- ./sql_query.cc
- ./sql_error.cc
+ ${QDB_SRC_DIR}/sql_database.cc
+ ${QDB_SRC_DIR}/sql_query.cc
+ ${QDB_SRC_DIR}/sql_error.cc
)
add_library(${target} ${SOURCES})
target_link_libraries(${target} qdb Utils)
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/policy.ini DESTINATION ${CMAKE_BINARY_DIR}/src/appMain)
- file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/qdbserver.sh DESTINATION ${CMAKE_BINARY_DIR}/src/appMain)
+ file(COPY ${QDB_SRC_DIR}/policy.ini DESTINATION ${CMAKE_BINARY_DIR}/src/appMain)
+ file(COPY ${QDB_SRC_DIR}/qdbserver.sh DESTINATION ${CMAKE_BINARY_DIR}/src/appMain)
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
- install(FILES policy.ini DESTINATION bin)
- install(FILES qdbserver.sh DESTINATION bin
+ install(FILES ${QDB_SRC_DIR}/policy.ini DESTINATION bin)
+ install(FILES ${QDB_SRC_DIR}/qdbserver.sh DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif ()
diff --git a/src/components/utils/src/signals_linux.cc b/src/components/utils/src/signals_posix.cc
index 274c254716..274c254716 100644
--- a/src/components/utils/src/signals_linux.cc
+++ b/src/components/utils/src/signals_posix.cc
diff --git a/src/components/utils/src/sqlite_wrapper/CMakeLists.txt b/src/components/utils/src/sqlite_wrapper/CMakeLists.txt
index 9a3f3cdd0f..858d3b0283 100644
--- a/src/components/utils/src/sqlite_wrapper/CMakeLists.txt
+++ b/src/components/utils/src/sqlite_wrapper/CMakeLists.txt
@@ -29,15 +29,16 @@
# POSSIBILITY OF SUCH DAMAGE.
set(target dbms)
+set(SQLITE_SRC_DIR ${COMPONENTS_DIR}/utils/src/sqlite_wrapper)
find_package(Sqlite3 REQUIRED)
include_directories(${COMPONENTS_DIR}/utils/include/utils)
set(SOURCES
- ./sql_database.cc
- ./sql_query.cc
- ./sql_error.cc
+ ${SQLITE_SRC_DIR}/sql_database.cc
+ ${SQLITE_SRC_DIR}/sql_query.cc
+ ${SQLITE_SRC_DIR}/sql_error.cc
)
add_library(${target} ${SOURCES})
diff --git a/src/components/utils/src/sqlite_wrapper/sql_database.cc b/src/components/utils/src/sqlite_wrapper/sql_database.cc
index 8c9563ca71..a73d117109 100644
--- a/src/components/utils/src/sqlite_wrapper/sql_database.cc
+++ b/src/components/utils/src/sqlite_wrapper/sql_database.cc
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_database.h"
#include <sqlite3.h>
namespace utils {
@@ -54,6 +54,9 @@ bool SQLDatabase::Open() {
if (conn_)
return true;
error_ = sqlite3_open(get_path().c_str(), &conn_);
+ if (error_ != SQLITE_OK) {
+ conn_ = NULL;
+ }
return error_ == SQLITE_OK;
}
diff --git a/src/components/utils/src/sqlite_wrapper/sql_error.cc b/src/components/utils/src/sqlite_wrapper/sql_error.cc
index 9062731a81..a67e11971a 100644
--- a/src/components/utils/src/sqlite_wrapper/sql_error.cc
+++ b/src/components/utils/src/sqlite_wrapper/sql_error.cc
@@ -30,7 +30,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sqlite_wrapper/sql_error.h"
+#include "utils/sqlite_wrapper/sql_error.h"
namespace utils {
namespace dbms {
diff --git a/src/components/utils/src/sqlite_wrapper/sql_query.cc b/src/components/utils/src/sqlite_wrapper/sql_query.cc
index 5a62ec360d..8bac9f703b 100644
--- a/src/components/utils/src/sqlite_wrapper/sql_query.cc
+++ b/src/components/utils/src/sqlite_wrapper/sql_query.cc
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "sqlite_wrapper/sql_query.h"
+#include "utils/sqlite_wrapper/sql_query.h"
#include <sqlite3.h>
#include <cassert>
-#include "sqlite_wrapper/sql_database.h"
+#include "utils/sqlite_wrapper/sql_database.h"
namespace utils {
namespace dbms {
diff --git a/src/components/utils/src/threads/thread_delegate.cc b/src/components/utils/src/threads/thread_delegate.cc
index 7bdce000da..917603f92c 100644
--- a/src/components/utils/src/threads/thread_delegate.cc
+++ b/src/components/utils/src/threads/thread_delegate.cc
@@ -52,6 +52,7 @@ void ThreadDelegate::exitThreadMain() {
} else {
pthread_cancel(thread_->thread_handle());
}
+ thread_ = NULL;
}
}
diff --git a/src/components/utils/src/threads/posix_thread.cc b/src/components/utils/src/threads/thread_posix.cc
index 51e59fa108..51e59fa108 100644
--- a/src/components/utils/src/threads/posix_thread.cc
+++ b/src/components/utils/src/threads/thread_posix.cc
diff --git a/src/components/utils/src/timer.cc b/src/components/utils/src/timer.cc
index 642f16e574..b819b56f54 100644
--- a/src/components/utils/src/timer.cc
+++ b/src/components/utils/src/timer.cc
@@ -64,7 +64,7 @@ timer::Timer::~Timer() {
StopDelegate();
single_shot_ = true;
- delegate_.release();
+ delegate_.reset();
DeleteThread(thread_);
DCHECK(task_);
delete task_;
diff --git a/src/components/utils/test/CMakeLists.txt b/src/components/utils/test/CMakeLists.txt
index 6ec12a17e6..f6bd24ff09 100644
--- a/src/components/utils/test/CMakeLists.txt
+++ b/src/components/utils/test/CMakeLists.txt
@@ -28,7 +28,8 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake)
include_directories (
${JSONCPP_INCLUDE_DIRECTORY}
@@ -36,77 +37,64 @@ include_directories (
${COMPONENTS_DIR}/utils/include
${COMPONENTS_DIR}/rpc_base/include
${COMPONENTS_DIR}/utils/test/include
- ${COMPONENTS_DIR}/policy/include
+ ${POLICY_PATH}/include
)
-set(testSources
- messagemeter_test.cc
- file_system_test.cc
- date_time_test.cc
- system_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
- rwlock_posix_test.cc
- async_runner_test.cc
- shared_ptr_test.cc
- scope_guard_test.cc
- atomic_object_test.cc
- message_loop_thread_test.cc
- custom_string_test.cc
- timer_test.cc
+set(EXCLUDE_PATHS
+ qdb_wrapper
+ test_generator
)
-set(testLibraries
- gmock
- Utils
- Policy
- ConfigProfile
-)
+if(NOT ENABLE_LOG)
+ list(APPEND EXCLUDE_PATHS
+ auto_trace_test.cc
+ log_message_loop_thread_test.cc
+ )
+endif()
+
+if(NOT BUILD_BACKTRACE_SUPPORT)
+ list(APPEND EXCLUDE_PATHS
+ back_trace_test.cc
+ )
+endif()
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
+ # exclude tests for SQLite wrapper
+ list (APPEND EXCLUDE_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/sqlite_wrapper
)
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
+ # exclude tests for QDB wrapper
+ list (APPEND EXCLUDE_PATHS
+ ${CMAKE_CURRENT_SOURCE_DIR}/qdb_wrapper
)
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()
+# exclude some tests
+list(APPEND EXCLUDE_PATHS
+ generated_code_with_sqlite_test.cc
+ posix_thread_test.cc
+ resource_usage_test.cc
+)
-if (BUILD_BACKTRACE_SUPPORT)
- list(APPEND testSources back_trace_test.cc)
-endif()
+collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" "${EXCLUDE_PATHS}")
+
+set(LIBRARIES
+ gmock
+ Utils
+ Policy
+ ConfigProfile
+)
+
+create_test(utils_test "${SOURCES}" "${LIBRARIES}")
file(COPY testscript.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY log4cxx.properties DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY smartDeviceLink.ini DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-create_test("utils_test" "${testSources}" "${testLibraries}")
-
add_subdirectory(test_generator)
-
-endif()
diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc
index 9badbadf1c..65abad65c2 100644
--- a/src/components/utils/test/async_runner_test.cc
+++ b/src/components/utils/test/async_runner_test.cc
@@ -30,57 +30,72 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <ctime>
#include <stdlib.h>
-
-#include "gtest/gtest.h"
-
+#include <ctime>
+#include <memory>
#include "utils/lock.h"
-#include "utils/conditional_variable.h"
#include "utils/threads/async_runner.h"
+#include "utils/conditional_variable.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
namespace utils {
-using namespace sync_primitives;
using namespace threads;
namespace {
-uint32_t check_value = 0;
+size_t kCheckValue = 0u;
+const size_t kDelegatesAmount = 4u;
}
// ThreadDelegate successor
class TestThreadDelegate : public ThreadDelegate {
public:
+ TestThreadDelegate(sync_primitives::ConditionalVariable& cond_var,
+ sync_primitives::Lock& test_lock)
+ : cond_var_(cond_var), test_lock_(test_lock) {}
+
void threadMain() {
- ++check_value;
+ sync_primitives::AutoLock lock(test_lock_);
+ ++kCheckValue;
+ cond_var_.NotifyOne();
}
+
+ protected:
+ sync_primitives::ConditionalVariable& cond_var_;
+ sync_primitives::Lock& test_lock_;
+};
+
+class MockThreadDelegate : public ThreadDelegate {
+ public:
+ MOCK_METHOD0(threadMain, void());
+ MOCK_METHOD0(exitThreadMain, void());
};
class AsyncRunnerTest : public ::testing::Test {
public:
- AsyncRunnerTest() : kDelegatesNum_(1), asr_pt_(NULL) {
+ AsyncRunnerTest() {
+ // Clear global value before test execution
+ kCheckValue = 0;
CreateAsyncRunner();
CreateThreadsArray();
}
~AsyncRunnerTest() {
- DeleteAsyncRunner();
DeleteThreadsArray();
}
protected:
- Lock test_lock_;
- uint32_t kDelegatesNum_;
- ConditionalVariable cond_var_;
- TestThreadDelegate** delegates_;
- AsyncRunner* asr_pt_;
+ ThreadDelegate** delegates_;
+ ::utils::SharedPtr<AsyncRunner> async_runner_;
void CreateThreadsArray() {
- srand(std::time(NULL));
- kDelegatesNum_ = (rand() % 20 + 1);
- delegates_ = new TestThreadDelegate* [kDelegatesNum_];
+ delegates_ = new ThreadDelegate* [kDelegatesAmount];
}
void DeleteThreadsArray() {
@@ -88,51 +103,36 @@ class AsyncRunnerTest : public ::testing::Test {
}
void CreateAsyncRunner() {
- asr_pt_ = new AsyncRunner("test");
- }
- void DeleteAsyncRunner() {
- delete asr_pt_;
+ async_runner_ = ::utils::MakeShared<AsyncRunner>("test");
}
};
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]);
+ sync_primitives::ConditionalVariable cond_var;
+ sync_primitives::Lock test_lock;
+ for (size_t i = 0; i < kDelegatesAmount; ++i) {
+ sync_primitives::AutoLock lock(test_lock);
+ delegates_[i] = new TestThreadDelegate(cond_var, test_lock);
+ async_runner_->AsyncRun(delegates_[i]);
+ // Wait for delegate to be run
+ cond_var.WaitFor(lock, 1500);
}
- // 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);
+ // Expect all delegates started successfully
+ EXPECT_EQ(kDelegatesAmount, kCheckValue);
}
-// 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]);
+TEST_F(AsyncRunnerTest, StopThenRun_ExpectDelegateNotStarted) {
+ // Create Delegate mock
+ MockThreadDelegate mock_thread_delegate;
+ // Check that delegate was not started due to Stop() called before AsyncRun()
+ EXPECT_CALL(mock_thread_delegate, threadMain()).Times(0);
+ {
+ ::utils::SharedPtr<AsyncRunner> async_runner =
+ ::utils::MakeShared<AsyncRunner>("test");
+ async_runner->Stop();
+ async_runner->AsyncRun(&mock_thread_delegate);
}
- // Expect 3 delegates run successlully. The other stopped.
- EXPECT_EQ(kDelegatesNum_ / 2, check_value);
}
} // namespace utils
diff --git a/src/components/utils/test/atomic_object_test.cc b/src/components/utils/test/atomic_object_test.cc
index 2072b955e8..44975fd004 100644
--- a/src/components/utils/test/atomic_object_test.cc
+++ b/src/components/utils/test/atomic_object_test.cc
@@ -34,7 +34,8 @@
#include "gtest/gtest.h"
namespace test {
-namespace utils {
+namespace components {
+namespace utils_test {
TEST(AtomicObjectTest, Construct) {
sync_primitives::atomic_int var(5);
@@ -51,5 +52,6 @@ TEST(AtomicObjectTest, Construct) {
EXPECT_FALSE(flag == true);
}
-} // utils
-} // test
+} // namespace utils_test
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/back_trace_test.cc b/src/components/utils/test/back_trace_test.cc
index 071c4d3342..dcb2a79baa 100644
--- a/src/components/utils/test/back_trace_test.cc
+++ b/src/components/utils/test/back_trace_test.cc
@@ -35,7 +35,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using namespace ::utils;
@@ -47,6 +47,6 @@ TEST(BackTraceTest, CallStackShouldNotBeEmpty) {
ASSERT_FALSE(symbols.empty());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/bitstream_test.cc b/src/components/utils/test/bitstream_test.cc
index df27aaa835..caec4b3970 100644
--- a/src/components/utils/test/bitstream_test.cc
+++ b/src/components/utils/test/bitstream_test.cc
@@ -37,7 +37,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using ::utils::BitStream;
@@ -220,6 +220,6 @@ TEST(BitstreamTest, ExtractBitstream_WithDataMarkedBad_ExpectIsBad) {
EXPECT_TRUE(bs.IsBad());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/conditional_variable_test.cc b/src/components/utils/test/conditional_variable_test.cc
index 8c3bd7db8c..524d53cafa 100644
--- a/src/components/utils/test/conditional_variable_test.cc
+++ b/src/components/utils/test/conditional_variable_test.cc
@@ -41,7 +41,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
class ConditionalVariableTest : public ::testing::Test {
public:
@@ -123,10 +123,10 @@ TEST_F(
CheckWaitForWithTimeout1sec_ThreadBlockedForTimeout_ExpectSuccessfulWakeUp) {
sync_primitives::AutoLock test_lock(test_mutex_);
sync_primitives::ConditionalVariable::WaitStatus wait_st =
- cond_var_.WaitFor(test_lock, 1000);
+ cond_var_.WaitFor(test_lock, 10);
EXPECT_EQ(sync_primitives::ConditionalVariable::kTimeout, wait_st);
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/custom_string_test.cc b/src/components/utils/test/custom_string_test.cc
index 3610bfb36b..bca332be5a 100644
--- a/src/components/utils/test/custom_string_test.cc
+++ b/src/components/utils/test/custom_string_test.cc
@@ -39,7 +39,7 @@ namespace custom_str = utils::custom_string;
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
std::string CreateMultibyteString(uint8_t* array, size_t array_size) {
return std::string(array, array + array_size);
@@ -314,6 +314,6 @@ TEST_F(
EXPECT_TRUE(obj.CompareIgnoreCase(mbstring.c_str()));
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/data_accessor_test.cc b/src/components/utils/test/data_accessor_test.cc
index b15310ff3f..c7c728b676 100644
--- a/src/components/utils/test/data_accessor_test.cc
+++ b/src/components/utils/test/data_accessor_test.cc
@@ -36,7 +36,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
TEST(DataAccessorTest, CreateDataAccessor) {
// arrange
@@ -129,6 +129,6 @@ TEST(DataAccessorTest,
testSet_lock_.Release();
}
-} // namespace utils
+} // namespace utils_test
} // 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 fc34b7a998..a209ab4d43 100644
--- a/src/components/utils/test/date_time_test.cc
+++ b/src/components/utils/test/date_time_test.cc
@@ -35,7 +35,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using namespace date_time;
TEST(DateTimeTest, GetCurrentTime) {
@@ -398,6 +398,6 @@ TEST(DateTimeTest, Operator_minus_TimevalStruct_negative) {
ASSERT_NE(-8000000, date_time::DateTime::getSecs(time2 - time1));
}
-} // namespace utils
+} // namespace utils_test
} // 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 1d90721680..95469766f8 100644
--- a/src/components/utils/test/file_system_test.cc
+++ b/src/components/utils/test/file_system_test.cc
@@ -40,7 +40,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
typedef std::vector<std::string> StringArray;
@@ -1271,6 +1271,6 @@ TEST(FileSystemTest, GetAbsolutePath_TrickiPath_CorrectAbsolutePath) {
}
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/generated_code_with_sqlite_test.cc b/src/components/utils/test/generated_code_with_sqlite_test.cc
index 0feb040f49..1c829c838c 100644
--- a/src/components/utils/test/generated_code_with_sqlite_test.cc
+++ b/src/components/utils/test/generated_code_with_sqlite_test.cc
@@ -33,7 +33,9 @@
#include "gtest/gtest.h"
#include "utils/generated_code_with_sqlite_test.h"
-namespace rpc {
+namespace test {
+namespace components {
+namespace rpc_test {
class GeneratedCodeTest : public ::testing::Test {
public:
@@ -64,7 +66,7 @@ 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),"
+ "application_id VARCHAR(45) COLLATE NOCASE,"
"url VARCHAR(45) NOT NULL,"
"is_default INTEGER NOT NULL CHECK(is_default>=0))";
@@ -75,14 +77,14 @@ const std::string GeneratedCodeTest::kEndpointsContent =
const std::string GeneratedCodeTest::kAppPoliciesCreation =
"CREATE TABLE AppPolicies ("
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
- "application_id VARCHAR(45),"
+ "application_id VARCHAR(45) COLLATE NOCASE,"
"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,"
+ "application_id VARCHAR(45) NOT NULL COLLATE NOCASE,"
"group_name VARCHAR(45) NOT NULL )";
TEST_F(GeneratedCodeTest,
@@ -95,7 +97,7 @@ TEST_F(GeneratedCodeTest,
policy_table::ServiceEndpoints ep;
// assert
- EXPECT_TRUE(policy_table::FindSection(&db, ep));
+ EXPECT_TRUE(FindSection(&db, ep));
EXPECT_EQ(1u, ep.size());
// act
@@ -117,7 +119,7 @@ TEST_F(GeneratedCodeTest,
policy_table::ServiceEndpoints ep;
// assert
- EXPECT_TRUE(policy_table::RemoveSection(&db, ep));
+ EXPECT_TRUE(RemoveSection(&db, ep));
dbms::SQLQuery sqlquery(&db);
// act
@@ -151,7 +153,7 @@ TEST_F(GeneratedCodeTest,
ep["0x07"] = urllist;
// assert
- EXPECT_TRUE(policy_table::UpdateSection(&db, ep));
+ EXPECT_TRUE(UpdateSection(&db, ep));
dbms::SQLQuery sqlquery(&db);
std::string num_of_records_check = "select count (*) from endpoints";
@@ -188,7 +190,7 @@ TEST_F(GeneratedCodeTest,
ap[application_id].priority = policy_table::P_NORMAL;
// assert
- EXPECT_TRUE(policy_table::UpdateSection(&db, ap));
+ EXPECT_TRUE(UpdateSection(&db, ap));
// act
dbms::SQLQuery sqlquery(&db);
@@ -214,4 +216,6 @@ TEST_F(GeneratedCodeTest,
EXPECT_TRUE(sqlquery.Reset());
}
-} // namespace rpc
+} // namespace rpc_test
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h b/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h
index 8455639c07..e21fd75f87 100644
--- a/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h
+++ b/src/components/utils/test/include/utils/generated_code_with_sqlite_test.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Ford Motor Company
+/* Copyright (c) 2016, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_GENERATED_CODE_WITH_SQLITE_TEST_H_
-#define SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_GENERATED_CODE_WITH_SQLITE_TEST_H_
+#ifndef SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_GENERATED_CODE_WITH_SQLITE_TEST_H_
+#define SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_GENERATED_CODE_WITH_SQLITE_TEST_H_
#include <string>
#include "policy/policy_table/types.h"
@@ -38,12 +38,13 @@
#include "utils/sqlite_wrapper/sql_query.h"
#include "utils/sqlite_wrapper/sql_database.h"
+namespace test {
+namespace components {
+namespace rpc_test {
+
namespace policy_table = rpc::policy_table_interface_base;
namespace dbms = utils::dbms;
-namespace rpc {
-namespace policy_table_interface_base {
-
bool FindSection(dbms::SQLDatabase* db, policy_table::ServiceEndpoints& ep) {
/*
* Following table structure is assumed:
@@ -401,7 +402,8 @@ bool UpdateSection(dbms::SQLDatabase* db,
return true;
}
-} // namespace policy_table_interface_base
-} // namespace rpc
+} // namespace rpc_test
+} // namespace components
+} // namespace test
-#endif // SRC_COMPONENTS_POLICY_TEST_POLICY_INCLUDE_GENERATED_CODE_WITH_SQLITE_TEST_H_
+#endif // SRC_COMPONENTS_UTILS_TEST_INCLUDE_UTILS_GENERATED_CODE_WITH_SQLITE_TEST_H_
diff --git a/src/components/utils/test/lock_posix_test.cc b/src/components/utils/test/lock_posix_test.cc
index 9b0d9533bc..a78659ab31 100644
--- a/src/components/utils/test/lock_posix_test.cc
+++ b/src/components/utils/test/lock_posix_test.cc
@@ -35,7 +35,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using sync_primitives::Lock;
@@ -118,6 +118,6 @@ TEST(LockPosixTest, TryLockRecursiveMutex_ExpectMutexLockedTwice) {
test_mutex.Release();
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/log_message_loop_thread_test.cc b/src/components/utils/test/log_message_loop_thread_test.cc
index 14515961bb..032c7ecae1 100644
--- a/src/components/utils/test/log_message_loop_thread_test.cc
+++ b/src/components/utils/test/log_message_loop_thread_test.cc
@@ -37,7 +37,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using namespace ::logger;
using ::testing::_;
@@ -73,6 +73,6 @@ TEST(LogMessageLoopThread, HandleNeverCalled) {
logger::logger_status = LoggerThreadNotCreated;
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/message_queue_test.cc b/src/components/utils/test/message_queue_test.cc
index d80016c6a8..ddc1aa1d81 100644
--- a/src/components/utils/test/message_queue_test.cc
+++ b/src/components/utils/test/message_queue_test.cc
@@ -36,7 +36,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using ::utils::MessageQueue;
@@ -171,6 +171,6 @@ TEST_F(MessageQueueTest,
ASSERT_TRUE(check_value);
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/messagemeter_test.cc b/src/components/utils/test/messagemeter_test.cc
index 69db658542..4ec14ac1cc 100644
--- a/src/components/utils/test/messagemeter_test.cc
+++ b/src/components/utils/test/messagemeter_test.cc
@@ -42,7 +42,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
// Pair of values <second, msecond>
typedef std::pair<int, int> TimePair;
@@ -126,7 +126,8 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
}
}
-TEST_P(MessageMeterTest, TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
+TEST_P(MessageMeterTest,
+ DISABLED_TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
size_t messages = 0;
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
// Add messages for less range period
@@ -150,7 +151,7 @@ TEST_P(MessageMeterTest, TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
}
TEST_P(MessageMeterTest,
- TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
+ DISABLED_TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
size_t messages = 0;
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
// Add messages for less range period
@@ -184,7 +185,8 @@ TEST_P(MessageMeterTest,
}
}
-TEST_P(MessageMeterTest, Frequency_CountingOverPeriod_CorrectCountOfMessages) {
+TEST_P(MessageMeterTest,
+ DISABLED_Frequency_CountingOverPeriod_CorrectCountOfMessages) {
const size_t one_message = 1;
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
EXPECT_EQ(one_message, meter.TrackMessage(id1));
@@ -206,7 +208,7 @@ TEST_P(MessageMeterTest, Frequency_CountingOverPeriod_CorrectCountOfMessages) {
}
}
-TEST_P(MessageMeterTest, CountingOutOfPeriod) {
+TEST_P(MessageMeterTest, DISABLED_CountingOutOfPeriod) {
const size_t one_message = 1;
EXPECT_EQ(one_message, meter.TrackMessage(id1));
EXPECT_EQ(one_message, meter.TrackMessage(id2));
@@ -261,6 +263,6 @@ INSTANTIATE_TEST_CASE_P(MessageMeterTestCase,
MessageMeterTest,
::testing::ValuesIn(testing_time_pairs));
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/policy.sql b/src/components/utils/test/policy.sql
index 406579f6b7..292855734e 100644
--- a/src/components/utils/test/policy.sql
+++ b/src/components/utils/test/policy.sql
@@ -108,7 +108,7 @@ BEGIN TRANSACTION;
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,
+ `id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE,
`keep_context` BOOLEAN,
`steal_focus` BOOLEAN,
`default_hmi` VARCHAR(45),
@@ -131,7 +131,7 @@ BEGIN TRANSACTION;
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,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
`functional_group_id` INTEGER NOT NULL,
PRIMARY KEY(`application_id`,`functional_group_id`),
CONSTRAINT `fk_application_has_functional_group_application1`
@@ -144,9 +144,9 @@ BEGIN TRANSACTION;
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`);
+ ON `app_group`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `preconsented_group`(
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
`functional_group_id` INTEGER NOT NULL,
PRIMARY KEY(`application_id`,`functional_group_id`),
CONSTRAINT `fk_application_has_functional_group_application2`
@@ -161,7 +161,7 @@ BEGIN TRANSACTION;
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`);
+ ON `preconsented_group`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `seconds_between_retry`(
`index` INTEGER PRIMARY KEY NOT NULL,
`value` INTEGER NOT NULL
@@ -187,7 +187,7 @@ BEGIN TRANSACTION;
`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,
+ `application_id` VARCHAR(45) PRIMARY KEY NOT NULL COLLATE NOCASE,
`minutes_in_hmi_full` INTEGER DEFAULT 0,
`minutes_in_hmi_limited` INTEGER DEFAULT 0,
`minutes_in_hmi_background` INTEGER DEFAULT 0,
@@ -214,34 +214,34 @@ BEGIN TRANSACTION;
REFERENCES `language`(`code`)
);
CREATE INDEX IF NOT EXISTS `app_level.fk_app_levels_application1_idx`
- ON `app_level`(`application_id`);
+ ON `app_level`(`application_id` COLLATE NOCASE);
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,
+ `name` VARCHAR(100) NOT NULL COLLATE NOCASE,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
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`);
+ ON `nickname`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `app_type`(
`name` VARCHAR(50) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
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`);
+ ON `app_type`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `consent_group`(
`device_id` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
`functional_group_id` INTEGER NOT NULL,
`is_consented` BOOL NOT NULL,
`input` VARCHAR(45),
@@ -265,13 +265,13 @@ BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS `endpoint`(
`service` INTEGER NOT NULL,
`url` VARCHAR(100) NOT NULL,
- `application_id` VARCHAR(45) NOT NULL,
+ `application_id` VARCHAR(45) NOT NULL COLLATE NOCASE,
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`);
+ ON `endpoint`(`application_id` COLLATE NOCASE);
CREATE TABLE IF NOT EXISTS `message`(
`id` INTEGER PRIMARY KEY NOT NULL,
`tts` TEXT,
diff --git a/src/components/utils/test/posix_thread_test.cc b/src/components/utils/test/posix_thread_test.cc
index f98794d08a..a44e1b9b89 100644
--- a/src/components/utils/test/posix_thread_test.cc
+++ b/src/components/utils/test/posix_thread_test.cc
@@ -32,11 +32,11 @@
#include "gtest/gtest.h"
#include "utils/lock.h"
-#include "threads/thread.h"
+#include "utils/threads/thread.h"
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using namespace sync_primitives;
using namespace threads;
@@ -324,6 +324,6 @@ TEST(PosixThreadTest,
EXPECT_EQ(NULL, thread->delegate());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/prioritized_queue_test.cc b/src/components/utils/test/prioritized_queue_test.cc
index ef105f6c4e..082ff56713 100644
--- a/src/components/utils/test/prioritized_queue_test.cc
+++ b/src/components/utils/test/prioritized_queue_test.cc
@@ -35,7 +35,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using ::utils::PrioritizedQueue;
@@ -207,6 +207,6 @@ TEST_F(PrioritizedQueueTest,
EXPECT_EQ(message3, test_queue.front());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/qdb_wrapper/sql_database_test.cc b/src/components/utils/test/qdb_wrapper/sql_database_test.cc
index 881141f18c..4e1a822b57 100644
--- a/src/components/utils/test/qdb_wrapper/sql_database_test.cc
+++ b/src/components/utils/test/qdb_wrapper/sql_database_test.cc
@@ -41,8 +41,8 @@ using ::utils::dbms::SQLDatabase;
namespace test {
namespace components {
-namespace utils {
-namespace dbms {
+namespace utils_test {
+namespace dbms_test {
::testing::AssertionResult IsError(SQLError error) {
if (error.number() != ::utils::dbms::OK) {
@@ -133,7 +133,7 @@ TEST(SQLDatabaseTest, BadTransaction) {
EXPECT_TRUE(IsError(db.LastError()));
}
-} // namespace dbms
-} // namespace utils
+} // namespace dbms_test
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/qdb_wrapper/sql_query_test.cc b/src/components/utils/test/qdb_wrapper/sql_query_test.cc
index 6c866ffb9d..e575e4f575 100644
--- a/src/components/utils/test/qdb_wrapper/sql_query_test.cc
+++ b/src/components/utils/test/qdb_wrapper/sql_query_test.cc
@@ -44,8 +44,8 @@ using ::utils::dbms::SQLQuery;
namespace test {
namespace components {
-namespace utils {
-namespace dbms {
+namespace utils_test {
+namespace dbms_test {
class SQLQueryTest : public ::testing::Test {
protected:
@@ -305,7 +305,7 @@ TEST_F(SQLQueryTest, DoublePrepare) {
EXPECT_FALSE(IsError(query.LastError()));
}
-} // namespace dbms
-} // namespace utils
+} // namespace dbms_test
+} // 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
index 6cb140f4c5..6679219aa8 100644
--- a/src/components/utils/test/rwlock_posix_test.cc
+++ b/src/components/utils/test/rwlock_posix_test.cc
@@ -35,7 +35,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using sync_primitives::RWLock;
@@ -142,6 +142,6 @@ TEST_F(RWlockTest, AcquireForWriting_ExpectNoMoreAccessForWriting) {
EXPECT_TRUE(test_rwlock.Release());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/scope_guard_test.cc b/src/components/utils/test/scope_guard_test.cc
index ac05c2828c..5e685d6aba 100644
--- a/src/components/utils/test/scope_guard_test.cc
+++ b/src/components/utils/test/scope_guard_test.cc
@@ -36,14 +36,14 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using ::utils::ScopeGuard;
using ::utils::MakeGuard;
using ::utils::MakeObjGuard;
using ::testing::Mock;
-class TestObject {
+class TestCalleeObject {
public:
MOCK_METHOD0(function_to_call, void());
MOCK_METHOD1(function_to_call_with_param, void(void*));
@@ -68,21 +68,21 @@ TEST(ScopeGuardTest, CallFreeFunctionWithParam) {
}
TEST(ScopeGuardTest, CallObjectFunction) {
- TestObject obj;
+ TestCalleeObject obj;
Mock::AllowLeak(&obj); // Google tests bug
EXPECT_CALL(obj, function_to_call()).Times(1);
{
- ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ ScopeGuard guard = MakeObjGuard(obj, &TestCalleeObject::function_to_call);
UNUSED(guard);
}
}
TEST(ScopeGuardTest, CallObjectFunctionWithParam) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(1);
{
ScopeGuard guard =
- MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ MakeObjGuard(obj, &TestCalleeObject::function_to_call_with_param, &obj);
UNUSED(guard);
}
}
@@ -98,24 +98,24 @@ TEST(ScopeGuardTest, DismissCallFreeFunctionWithParam) {
}
TEST(ScopeGuardTest, DismissCallObjectFunction) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call()).Times(0);
{
- ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ ScopeGuard guard = MakeObjGuard(obj, &TestCalleeObject::function_to_call);
guard.Dismiss();
}
}
TEST(ScopeGuardTest, DismissCallObjectFunctionWithParam) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(0);
{
ScopeGuard guard =
- MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ MakeObjGuard(obj, &TestCalleeObject::function_to_call_with_param, &obj);
guard.Dismiss();
}
}
-} // namespace utils
-} // components
+} // namespace utils_test
+} // namespace components
} // namesapce test
diff --git a/src/components/utils/test/shared_ptr_test.cc b/src/components/utils/test/shared_ptr_test.cc
index 85682073aa..99fe4f7dd7 100644
--- a/src/components/utils/test/shared_ptr_test.cc
+++ b/src/components/utils/test/shared_ptr_test.cc
@@ -38,8 +38,7 @@
namespace test {
namespace components {
-namespace utils {
-namespace SharedPtrTest {
+namespace utils_test {
class CMockObject {
public:
@@ -58,12 +57,6 @@ class CExtendedMockObject : public CMockObject {
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) {}
@@ -514,7 +507,7 @@ TEST(SharedPtrTest, ValidMethodTest_ExpectCorrectValidation) {
ASSERT_FALSE(p2.valid());
}
-TEST(SharedPtrTest, StressTest) {
+TEST(SharedPtrTest, DISABLED_StressTest) {
// Arrange
const size_t kNumIterations = 1024U * 1024U;
@@ -543,3 +536,7 @@ TEST(SharedPtrTest, StressTest) {
objectCreated,
pointersCopied);
}
+
+} // namespace utils_test
+} // namespace components
+} // namespace test
diff --git a/src/components/utils/test/singleton_test.cc b/src/components/utils/test/singleton_test.cc
index 3bad45a7d7..ae05b6cbab 100644
--- a/src/components/utils/test/singleton_test.cc
+++ b/src/components/utils/test/singleton_test.cc
@@ -36,7 +36,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using ::utils::Singleton;
@@ -184,6 +184,6 @@ TEST(SingletonTest, DeleteSingletonInDifferentThread) {
ASSERT_FALSE(SingletonTest::exists());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/sqlite_wrapper/sql_database_test.cc b/src/components/utils/test/sqlite_wrapper/sql_database_test.cc
index bd278a863f..9732fbe078 100644
--- a/src/components/utils/test/sqlite_wrapper/sql_database_test.cc
+++ b/src/components/utils/test/sqlite_wrapper/sql_database_test.cc
@@ -38,8 +38,8 @@ using ::utils::dbms::SQLDatabase;
namespace test {
namespace components {
-namespace utils {
-namespace dbms {
+namespace utils_test {
+namespace dbms_test {
::testing::AssertionResult IsError(SQLError error) {
if (error.number() != ::utils::dbms::OK) {
@@ -217,7 +217,7 @@ TEST(SQLDatabaseTest, IsReadWrite_FirstOpenDBIsRWSecondIsNot) {
remove("test-database.sqlite");
}
-} // namespace dbms
-} // namespace utils
+} // namespace dbms_test
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
index 958fed93fa..c10c26a2c7 100644
--- a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
+++ b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
@@ -44,8 +44,8 @@ using ::utils::dbms::SQLQuery;
namespace test {
namespace components {
-namespace utils {
-namespace dbms {
+namespace utils_test {
+namespace dbms_test {
class SQLQueryTest : public ::testing::Test {
protected:
@@ -97,7 +97,9 @@ class SQLQueryTest : public ::testing::Test {
};
sqlite3* SQLQueryTest::conn = 0;
-const std::string SQLQueryTest::kDatabaseName = "test-query";
+
+// mounting /tmp as tmpfs will descrease utils unit tests runing time
+const std::string SQLQueryTest::kDatabaseName = "/tmp/test-query";
TEST_F(SQLQueryTest, Query_CreateQuery_QueryInDBEqualCreated) {
// arrange
@@ -374,7 +376,7 @@ TEST_F(SQLQueryTest, DoublePrepare_TwicePrepareQuery_ActWithoutErrors) {
EXPECT_FALSE(IsError(query.LastError()));
}
-} // namespace dbms
-} // namespace utils
+} // namespace dbms_test
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/stl_utils_test.cc b/src/components/utils/test/stl_utils_test.cc
index 1fbde052f1..5250a7a514 100644
--- a/src/components/utils/test/stl_utils_test.cc
+++ b/src/components/utils/test/stl_utils_test.cc
@@ -37,7 +37,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using ::utils::StlCollectionDeleter;
using ::utils::StlMapDeleter;
@@ -94,6 +94,6 @@ TEST(StlDeleter, DestructVectorWithSeveralElements) {
EXPECT_EQ(NULL, test_vector[1]);
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/system_test.cc b/src/components/utils/test/system_test.cc
index aced77f849..b479823aa5 100644
--- a/src/components/utils/test/system_test.cc
+++ b/src/components/utils/test/system_test.cc
@@ -35,7 +35,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using namespace ::utils;
@@ -125,6 +125,6 @@ TEST(SystemTest, ASynchronousInvokeEmptyCommand_InvokeSuccessfull) {
ASSERT_TRUE(object.Execute());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/test_generator/CMakeLists.txt b/src/components/utils/test/test_generator/CMakeLists.txt
index d649f927a5..5a7f939659 100644
--- a/src/components/utils/test/test_generator/CMakeLists.txt
+++ b/src/components/utils/test/test_generator/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Ford Motor Company
+# Copyright (c) 2016, Ford Motor Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,38 +28,35 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-if(BUILD_TESTS)
+include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/generators.cmake)
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}/tools/interfaceGenerator
${CMAKE_CURRENT_BINARY_DIR}
${COMPONENTS_DIR}/utils/include/utils
${COMPONENTS_DIR}/include/utils
+ ${JSONCPP_INCLUDE_DIRECTORY}
+ ${GMOCK_INCLUDE_DIRECTORY}
)
-set(full_xml_name "${CMAKE_SOURCE_DIR}/src/components/interfaces/MOBILE_API.xml")
-
-add_custom_target( generate_version
- COMMAND ${INTEFRACE_GENERATOR_CMD} ${full_xml_name} "mobile_apis"
- ${CMAKE_CURRENT_BINARY_DIR} "--parser-type" "sdlrpcv2"
- DEPENDS ${INTERFACE_GENERATOR_DEPENDENCIES} ${full_xml_name}
- VERBATIM
- )
+set(XML_NAME ${CMAKE_SOURCE_DIR}/src/components/interfaces/MOBILE_API.xml)
+add_custom_target(generate_version
+ COMMAND ${INTEFRACE_GENERATOR_CMD} ${XML_NAME} "mobile_apis"
+ ${CMAKE_CURRENT_BINARY_DIR} "--parser-type" "sdlrpcv2"
+ DEPENDS ${INTERFACE_GENERATOR_DEPENDENCIES} ${XML_NAME}
+ VERBATIM
+)
-set(testLibraries
+set(LIBRARIES
gmock
Utils
)
-set(testSources
+set(SOURCES
generated_msg_version_test.cc
)
-file(COPY ${full_xml_name} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-create_test("generator_test" "${testSources}" "${testLibraries}")
-add_dependencies("generator_test" generate_version)
+create_test(generator_test "${SOURCES}" "${LIBRARIES}")
+file(COPY ${XML_NAME} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-endif()
+add_dependencies("generator_test" generate_version)
diff --git a/src/components/utils/test/test_generator/generated_msg_version_test.cc b/src/components/utils/test/test_generator/generated_msg_version_test.cc
index e5a295ee96..c9647dcad0 100644
--- a/src/components/utils/test/test_generator/generated_msg_version_test.cc
+++ b/src/components/utils/test/test_generator/generated_msg_version_test.cc
@@ -41,9 +41,11 @@ using namespace std;
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
-void get_version_from_file(int& first_version, int& second_version) {
+void get_version_from_file(int& first_version,
+ int& second_version,
+ int& third_version) {
// Supposed that major and minor version include one number
const std::string& absolute_current_path =
file_system::CurrentWorkingDirectory();
@@ -55,10 +57,36 @@ void get_version_from_file(int& first_version, int& second_version) {
while (getline(xml_file, str)) {
std::size_t isfound = str.find("interface name");
if (isfound != std::string::npos) {
- std::size_t snd = str.find(".");
- ASSERT_TRUE(snd != std::string::npos);
- first_version = str[snd - 1] - 48;
- second_version = str[snd + 1] - 48;
+ std::size_t versionStart = str.find("\"", str.find("version="));
+ ASSERT_TRUE(versionStart != std::string::npos);
+
+ std::size_t splitPos = str.find(".", versionStart + 1);
+ ASSERT_TRUE(splitPos != std::string::npos);
+
+ std::size_t splitPos2 = str.find(".", splitPos + 1);
+ ASSERT_TRUE(splitPos2 != std::string::npos);
+
+ std::size_t versionEnd = str.find("\"", splitPos2 + 1);
+ ASSERT_TRUE(versionEnd != std::string::npos);
+
+ first_version = 0;
+ for (std::size_t iter = versionStart + 1; iter < splitPos; iter++) {
+ first_version *= 10;
+ first_version += (str[iter] - 48);
+ }
+
+ second_version = 0;
+ for (std::size_t iter = splitPos + 1; iter < splitPos2; iter++) {
+ second_version *= 10;
+ second_version += (str[iter] - 48);
+ }
+
+ third_version = 0;
+ for (std::size_t iter = splitPos2 + 1; iter < versionEnd; iter++) {
+ third_version *= 10;
+ third_version += (str[iter] - 48);
+ }
+
break;
}
}
@@ -67,11 +95,13 @@ void get_version_from_file(int& first_version, int& second_version) {
TEST(GeneratorTool, GetCorrectVersion) {
int first_version = 0;
int second_version = 0;
- get_version_from_file(first_version, second_version);
+ int third_version = 0;
+ get_version_from_file(first_version, second_version, third_version);
EXPECT_EQ(first_version, application_manager::major_version);
EXPECT_EQ(second_version, application_manager::minor_version);
+ EXPECT_EQ(third_version, application_manager::patch_version);
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/thread_validator_test.cc b/src/components/utils/test/thread_validator_test.cc
index b6e21d7157..a2df1eea5f 100644
--- a/src/components/utils/test/thread_validator_test.cc
+++ b/src/components/utils/test/thread_validator_test.cc
@@ -38,7 +38,7 @@
namespace test {
namespace components {
-namespace utils {
+namespace utils_test {
using namespace ::threads;
@@ -47,6 +47,6 @@ TEST(ThreadValidatorTest, CompareID_CurrentThreadAndPthread_AreEqual) {
ASSERT_EQ(object.creation_thread_id(), pthread_self());
}
-} // namespace utils
+} // namespace utils_test
} // namespace components
} // namespace test